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

Side by Side Diff: pkg/web_components/lib/platform.concat.js.map

Issue 182193002: [polymer] interop with polymer-element and polymer.js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/web_components/lib/platform.concat.js ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 { 1 {
2 "version": 3, 2 "version": 3,
3 "file": "platform.concat.js", 3 "file": "platform.concat.js",
4 "sources": [ 4 "sources": [
5 "../WeakMap/weakmap.js", 5 "../WeakMap/weakmap.js",
6 "../observe-js/src/observe.js", 6 "../observe-js/src/observe.js",
7 "build/if-poly.js", 7 "build/if-poly.js",
8 "../ShadowDOM/src/wrappers.js", 8 "../ShadowDOM/src/wrappers.js",
9 "../ShadowDOM/src/microtask.js", 9 "../ShadowDOM/src/microtask.js",
10 "../ShadowDOM/src/MutationObserver.js", 10 "../ShadowDOM/src/MutationObserver.js",
11 "../ShadowDOM/src/TreeScope.js",
11 "../ShadowDOM/src/wrappers/events.js", 12 "../ShadowDOM/src/wrappers/events.js",
12 "../ShadowDOM/src/wrappers/NodeList.js", 13 "../ShadowDOM/src/wrappers/NodeList.js",
13 "../ShadowDOM/src/wrappers/HTMLCollection.js", 14 "../ShadowDOM/src/wrappers/HTMLCollection.js",
14 "../ShadowDOM/src/wrappers/Node.js", 15 "../ShadowDOM/src/wrappers/Node.js",
15 "../ShadowDOM/src/querySelector.js", 16 "../ShadowDOM/src/querySelector.js",
16 "../ShadowDOM/src/wrappers/node-interfaces.js", 17 "../ShadowDOM/src/wrappers/node-interfaces.js",
17 "../ShadowDOM/src/wrappers/CharacterData.js", 18 "../ShadowDOM/src/wrappers/CharacterData.js",
18 "../ShadowDOM/src/wrappers/Text.js", 19 "../ShadowDOM/src/wrappers/Text.js",
19 "../ShadowDOM/src/wrappers/Element.js", 20 "../ShadowDOM/src/wrappers/Element.js",
20 "../ShadowDOM/src/wrappers/HTMLElement.js", 21 "../ShadowDOM/src/wrappers/HTMLElement.js",
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 "../PointerEvents/src/capture.js", 88 "../PointerEvents/src/capture.js",
88 "../PointerGestures/src/PointerGestureEvent.js", 89 "../PointerGestures/src/PointerGestureEvent.js",
89 "../PointerGestures/src/initialize.js", 90 "../PointerGestures/src/initialize.js",
90 "../PointerGestures/src/pointermap.js", 91 "../PointerGestures/src/pointermap.js",
91 "../PointerGestures/src/dispatcher.js", 92 "../PointerGestures/src/dispatcher.js",
92 "../PointerGestures/src/hold.js", 93 "../PointerGestures/src/hold.js",
93 "../PointerGestures/src/track.js", 94 "../PointerGestures/src/track.js",
94 "../PointerGestures/src/flick.js", 95 "../PointerGestures/src/flick.js",
95 "../PointerGestures/src/pinch.js", 96 "../PointerGestures/src/pinch.js",
96 "../PointerGestures/src/tap.js", 97 "../PointerGestures/src/tap.js",
98 "../PointerGestures/src/registerScopes.js",
97 "../NodeBind/src/NodeBind.js", 99 "../NodeBind/src/NodeBind.js",
98 "../TemplateBinding/src/TemplateBinding.js", 100 "../TemplateBinding/src/TemplateBinding.js",
99 "../polymer-expressions/third_party/esprima/esprima.js", 101 "../polymer-expressions/third_party/esprima/esprima.js",
100 "../polymer-expressions/src/polymer-expressions.js", 102 "../polymer-expressions/src/polymer-expressions.js",
101 "src/patches-mdv.js" 103 "src/patches-mdv.js"
102 ], 104 ],
103 "names": [], 105 "names": [],
104 "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;A;AC5kDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtDA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1YA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChDA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnXA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;A;ACryBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;A;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;A;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxEA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;A;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A; AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7IA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;A;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxCA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1CA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtEA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;A;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9DA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3CA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;A;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvCA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;A;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvBA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpE A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9pBA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;A;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;A;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;A;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A; AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA,oB;ACzqBA,Q;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,K;AC 1DA,C;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA,oB;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;A;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;A CTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7LA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1BA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,W;AC9CA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/BA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClHA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ;ACjiBA;AACA;AACA;AACA;AACA;AACA,sD;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrJA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;A;AClSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;A;AC/PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzDA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;A;ACvDA;AACA;AACA;AACA;AACA;AACA,4D;ACLA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtcA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0B;AC/DA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;A;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5BA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1FA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnEA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3FA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClKA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A; ACpUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;A;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;A;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;A;ACjVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnFA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClCA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5CA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9CA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjEA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7OA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;A;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;A;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzJA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9GA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1XA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ;ACtsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5gCA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;A ChqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;A", 106 "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChlDA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;A;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5YA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A; AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;A;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrxBA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACdA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;A;ACztBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxEA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;A;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;A;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7IA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;A;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxCA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1CA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;A;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtEA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;A;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzCA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC9DA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3CA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnCA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;A;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;A;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;A;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACv CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;A;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;A;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACvBA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;A;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrqBA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;A;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;A;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACz TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;A;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3GA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;A;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oB; ACzsBA,Q;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,K;AC1DA,C;ACAA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;ACpjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oB ;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;A;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;ACTA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7LA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA,W;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClHA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACjiBA;AACA ;AACA;AACA;AACA;AACA,sD;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACrJA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClSA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/ PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzDA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;A;ACvDA;AACA;AACA;AACA;AACA;AACA,4D;ACLA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;A;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACtcA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0B;AC/DA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnEA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5BA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnEA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC3FA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;A;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACpUA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;A;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACzVA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;A;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;A;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;A;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;A;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;A;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;A;AC1OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC1HA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChIA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;A;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA; AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;ACt sCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AC5gCA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A;AChqB A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC A;AACA;AACA;A",
105 "sourcesContent": [ 107 "sourcesContent": [
106 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nif (typeof WeakMap === 'undefined') {\n (function() {\n var defineProperty = Object.defineProperty;\n var counter = Date.now() % 1 e9;\n\n var WeakMap = function() {\n this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');\n };\n\n WeakMap.prototype = {\n set: function(key, value) {\n var entry = key[this.name];\n if (en try && entry[0] === key)\n entry[1] = value;\n else\n d efineProperty(key, this.name, {value: [key, value], writable: true});\n },\ n get: function(key) {\n var entry;\n return (entry = key[thi s.name]) && entry[0] === key ?\n entry[1] : undefined;\n },\n delete: function(key) {\n this.set(key, undefined);\n }\n };\n \n window.WeakMap = WeakMap;\n })();\n}\n", 108 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nif (typeof WeakMap === 'undefined') {\n (function() {\n var defineProperty = Object.defineProperty;\n var counter = Date.now() % 1 e9;\n\n var WeakMap = function() {\n this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');\n };\n\n WeakMap.prototype = {\n set: function(key, value) {\n var entry = key[this.name];\n if (en try && entry[0] === key)\n entry[1] = value;\n else\n d efineProperty(key, this.name, {value: [key, value], writable: true});\n },\ n get: function(key) {\n var entry;\n return (entry = key[thi s.name]) && entry[0] === key ?\n entry[1] : undefined;\n },\n delete: function(key) {\n this.set(key, undefined);\n }\n };\n \n window.WeakMap = WeakMap;\n })();\n}\n",
107 "// Copyright 2012 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n var PROP_ADD_TYPE = 'add';\n var PROP_UPDATE_TYPE = 'update';\n var PROP_RECONFIGURE_TYPE = 'reconfigure';\n var PROP_DELETE_TYPE = 'delete';\n var ARRAY_SPLICE_TYPE = 'splice';\n\n // Detect and do basic sanity checking on Object/Array.observe.\n function detectObjectObserve() {\n if (typeof Obj ect.observe !== 'function' ||\n typeof Array.observe !== 'function') {\n return false;\n }\n\n var records = [];\n\n function callback(recs ) {\n records = recs;\n }\n\n var test = {};\n Object.observe(test , callback);\n test.id = 1;\n test.id = 2;\n delete test.id;\n Objec t.deliverChangeRecords(callback);\n if (records.length !== 3)\n return f alse;\n\n // TODO(rafaelw): Remove this when new change record type names mak e it to\n // chrome release.\n if (records[0].type == 'new' &&\n re cords[1].type == 'updated' &&\n records[2].type == 'deleted') {\n PR OP_ADD_TYPE = 'new';\n PROP_UPDATE_TYPE = 'updated';\n PROP_RECONFIGUR E_TYPE = 'reconfigured';\n PROP_DELETE_TYPE = 'deleted';\n } else if (re cords[0].type != 'add' ||\n records[1].type != 'update' ||\n records[2].type != 'delete') {\n console.error('Unexpected change record names for Object.observe. ' +\n 'Using dirty-checking instead');\n return false;\n }\n Object.unobserve(test, callback);\n\ n test = [0];\n Array.observe(test, callback);\n test[1] = 1;\n test .length = 0;\n Object.deliverChangeRecords(callback);\n if (records.length != 2)\n return false;\n if (records[0].type != ARRAY_SPLICE_TYPE ||\n records[1].type != ARRAY_SPLICE_TYPE) {\n return false;\n }\n A rray.unobserve(test, callback);\n\n return true;\n }\n\n var hasObserve = d etectObjectObserve();\n\n function detectEval() {\n // don't test for eval i f document has CSP securityPolicy object and we can see that\n // eval is not supported. This avoids an error message in console even when the exception\n // is caught\n if (global.document &&\n 'securityPolicy' in global.do cument &&\n !global.document.securityPolicy.allowsEval) {\n return f alse;\n }\n\n try {\n var f = new Function('', 'return true;');\n return f();\n } catch (ex) {\n return false;\n }\n }\n\n var hasE val = detectEval();\n\n function isIndex(s) {\n return +s === s >>> 0;\n }\ n\n function toNumber(s) {\n return +s;\n }\n\n function isObject(obj) {\n return obj === Object(obj);\n }\n\n var numberIsNaN = global.Number.isNaN || function isNaN(value) {\n return typeof value === 'number' && global.isNaN (value);\n }\n\n function areSameValue(left, right) {\n if (left === right) \n return left !== 0 || 1 / left === 1 / right;\n if (numberIsNaN(left) && numberIsNaN(right))\n return true;\n\n return left !== left && right !== right;\n }\n\n var createObject = ('__proto__' in {}) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).forEach(function(name) {\n Object.d efineProperty(newObject, name,\n Object.getOwnProper tyDescriptor(obj, name));\n });\n return newObject;\n };\n\n var i dentStart = '[\\$_a-zA-Z]';\n var identPart = '[\\$_a-zA-Z0-9]';\n var ident = identStart + '+' + identPart + '*';\n var elementIndex = '(?:[0-9]|[1-9]+[0-9] +)';\n var identOrElementIndex = '(?:' + ident + '|' + elementIndex + ')';\n v ar path = '(?:' + identOrElementIndex + ')(?:\\\\s*\\\\.\\\\s*' + identOrElement Index + ')*';\n var pathRegExp = new RegExp('^' + path + '$');\n\n function is PathValid(s) {\n if (typeof s != 'string')\n return false;\n s = s.tr im();\n\n if (s == '')\n return true;\n\n if (s[0] == '.')\n ret urn false;\n\n return pathRegExp.test(s);\n }\n\n var constructorIsPrivate = {};\n\n function Path(s, privateToken) {\n if (privateToken !== constructo rIsPrivate)\n throw Error('Use Path.get to retrieve path objects');\n\n if (s.trim() == '')\n return this;\n\n if (isIndex(s)) {\n this.pus h(s);\n return this;\n }\n\n s.split(/\\s*\\.\\s*/).filter(function(p art) {\n return part;\n }).forEach(function(part) {\n this.push(par t);\n }, this);\n\n if (hasEval && this.length) {\n this.getValueFrom = this.compiledGetValueFromFn();\n }\n }\n\n // TODO(rafaelw): Make simple LRU cache\n var pathCache = {};\n\n function getPath(pathString) {\n if (p athString instanceof Path)\n return pathString;\n\n if (pathString == nu ll)\n pathString = '';\n\n if (typeof pathString !== 'string')\n pa thString = String(pathString);\n\n var path = pathCache[pathString];\n if (path)\n return path;\n if (!isPathValid(pathString))\n return inva lidPath;\n var path = new Path(pathString, constructorIsPrivate);\n pathCa che[pathString] = path;\n return path;\n }\n\n Path.get = getPath;\n\n Pat h.prototype = createObject({\n __proto__: [],\n valid: true,\n\n toStri ng: function() {\n return this.join('.');\n },\n\n getValueFrom: func tion(obj, directObserver) {\n for (var i = 0; i < this.length; i++) {\n if (obj == null)\n return;\n obj = obj[this[i]];\n }\n return obj;\n },\n\n iterateObjects: function(obj, observe) {\n for (var i = 0; i < this.length; i++) {\n if (i)\n obj = obj[thi s[i - 1]];\n if (!obj)\n return;\n observe(obj);\n } \n },\n\n compiledGetValueFromFn: function() {\n var accessors = this .map(function(ident) {\n return isIndex(ident) ? '[\"' + ident + '\"]' : '.' + ident;\n });\n\n var str = '';\n var pathString = 'obj';\n str += 'if (obj != null';\n var i = 0;\n for (; i < (this.length - 1); i++) {\n var ident = this[i];\n pathString += accessors[i];\ n str += ' &&\\n ' + pathString + ' != null';\n }\n str += ')\\n';\n\n pathString += accessors[i];\n\n str += ' return ' + pathS tring + ';\\nelse\\n return undefined;';\n return new Function('obj', str) ;\n },\n\n setValueFrom: function(obj, value) {\n if (!this.length)\n return false;\n\n for (var i = 0; i < this.length - 1; i++) {\n if (!isObject(obj))\n return false;\n obj = obj[this[i]];\n }\n\n if (!isObject(obj))\n return false;\n\n obj[this[i]] = value;\n return true;\n }\n });\n\n var invalidPath = new Path('', constructorIsPrivate);\n invalidPath.valid = false;\n invalidPath.getValueFrom = invalidPath.setValueFrom = function() {};\n\n var MAX_DIRTY_CHECK_CYCLES = 1 000;\n\n function dirtyCheck(observer) {\n var cycles = 0;\n while (cycle s < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {\n cycles++;\n }\n if (global.testingExposeCycleCount)\n global.dirtyCheckCycleCount = cycles; \n\n return cycles > 0;\n }\n\n function objectIsEmpty(object) {\n for ( var prop in object)\n return false;\n return true;\n }\n\n function di ffIsEmpty(diff) {\n return objectIsEmpty(diff.added) &&\n objectIsE mpty(diff.removed) &&\n objectIsEmpty(diff.changed);\n }\n\n functio n diffObjectFromOldObject(object, oldObject) {\n var added = {};\n var rem oved = {};\n var changed = {};\n\n for (var prop in oldObject) {\n va r newValue = object[prop];\n\n if (newValue !== undefined && newValue === o ldObject[prop])\n continue;\n\n if (!(prop in object)) {\n re moved[prop] = undefined;\n continue;\n }\n\n if (newValue !== o ldObject[prop])\n changed[prop] = newValue;\n }\n\n for (var prop i n object) {\n if (prop in oldObject)\n continue;\n\n added[prop ] = object[prop];\n }\n\n if (Array.isArray(object) && object.length !== o ldObject.length)\n changed.length = object.length;\n\n return {\n a dded: added,\n removed: removed,\n changed: changed\n };\n }\n\n var eomTasks = [];\n function runEOMTasks() {\n if (!eomTasks.length)\n return false;\n\n for (var i = 0; i < eomTasks.length; i++) {\n eomTask s[i]();\n }\n eomTasks.length = 0;\n return true;\n }\n\n var runEOM = hasObserve ? (function(){\n var eomObj = { pingPong: true };\n var eomRu nScheduled = false;\n\n Object.observe(eomObj, function() {\n runEOMTask s();\n eomRunScheduled = false;\n });\n\n return function(fn) {\n eomTasks.push(fn);\n if (!eomRunScheduled) {\n eomRunScheduled = t rue;\n eomObj.pingPong = !eomObj.pingPong;\n }\n };\n })() :\n (function() {\n return function(fn) {\n eomTasks.push(fn);\n };\n }) ();\n\n var observedObjectCache = [];\n\n function newObservedObject() {\n var observer;\n var object;\n var discardRecords = false;\n var first = true;\n\n function callback(records) {\n if (observer && observer.state _ === OPENED && !discardRecords)\n observer.check_(records);\n }\n\n return {\n open: function(obs) {\n if (observer)\n throw Error('ObservedObject in use');\n\n if (!first)\n Object.deliver ChangeRecords(callback);\n\n observer = obs;\n first = false;\n },\n observe: function(obj, arrayObserve) {\n object = obj;\n if (arrayObserve)\n Array.observe(object, callback);\n else\ n Object.observe(object, callback);\n },\n deliver: function( discard) {\n discardRecords = discard;\n Object.deliverChangeRecor ds(callback);\n discardRecords = false;\n },\n close: function( ) {\n observer = undefined;\n Object.unobserve(object, callback);\ n observedObjectCache.push(this);\n }\n };\n }\n\n function get ObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCa che.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(obje ct, arrayObserve);\n return dir;\n }\n\n var emptyArray = [];\n var observ edSetCache = [];\n\n function newObservedSet() {\n var observers = [];\n var observerCount = 0;\n var objects = [];\n var toRemove = emptyArray;\n var resetNeeded = false;\n var resetScheduled = false;\n\n function obs erve(obj) {\n if (!isObject(obj))\n return;\n\n var index = toR emove.indexOf(obj);\n if (index >= 0) {\n toRemove[index] = undefine d;\n objects.push(obj);\n } else if (objects.indexOf(obj) < 0) {\n objects.push(obj);\n Object.observe(obj, callback);\n }\n\n observe(Object.getPrototypeOf(obj));\n }\n\n function reset() {\n resetScheduled = false;\n if (!resetNeeded)\n return;\n\n var o bjs = toRemove === emptyArray ? [] : toRemove;\n toRemove = objects;\n objects = objs;\n\n var observer;\n for (var id in observers) {\n observer = observers[id];\n if (!observer || observer.state_ != OPENE D)\n continue;\n\n observer.iterateObjects_(observe);\n }\n \n for (var i = 0; i < toRemove.length; i++) {\n var obj = toRemove[ i];\n if (obj)\n Object.unobserve(obj, callback);\n }\n\n toRemove.length = 0;\n }\n\n function scheduleReset() {\n if (res etScheduled)\n return;\n\n resetNeeded = true;\n resetScheduled = true;\n runEOM(reset);\n }\n\n function callback() {\n var ob server;\n\n for (var id in observers) {\n observer = observers[id];\ n if (!observer || observer.state_ != OPENED)\n continue;\n\n observer.check_();\n }\n\n scheduleReset();\n }\n\n var rec ord = {\n object: undefined,\n objects: objects,\n open: function (obs) {\n observers[obs.id_] = obs;\n observerCount++;\n ob s.iterateObjects_(observe);\n },\n close: function(obs) {\n var anyLeft = false;\n\n observers[obs.id_] = undefined;\n observerCo unt--;\n\n if (observerCount) {\n scheduleReset();\n re turn;\n }\n resetNeeded = false;\n\n for (var i = 0; i < ob jects.length; i++) {\n Object.unobserve(objects[i], callback);\n Observer.unobservedCount++;\n }\n\n observers.length = 0;\n objects.length = 0;\n observedSetCache.push(this);\n },\n r eset: scheduleReset\n };\n\n return record;\n }\n\n var lastObservedSet; \n\n function getObservedSet(observer, obj) {\n if (!lastObservedSet || last ObservedSet.object !== obj) {\n lastObservedSet = observedSetCache.pop() || newObservedSet();\n lastObservedSet.object = obj;\n }\n lastObserved Set.open(observer);\n return lastObservedSet;\n }\n\n var UNOPENED = 0;\n var OPENED = 1;\n var CLOSED = 2;\n var RESETTING = 3;\n\n var nextObserverId = 1;\n\n function Observer() {\n this.state_ = UNOPENED;\n this.callback _ = undefined;\n this.target_ = undefined; // TODO(rafaelw): Should be WeakRe f\n this.directObserver_ = undefined;\n this.value_ = undefined;\n this .id_ = nextObserverId++;\n }\n\n Observer.prototype = {\n open: function(ca llback, target) {\n if (this.state_ != UNOPENED)\n throw Error('Obse rver has already been opened.');\n\n addToAll(this);\n this.callback_ = callback;\n this.target_ = target;\n this.state_ = OPENED;\n th is.connect_();\n return this.value_;\n },\n\n close: function() {\n if (this.state_ != OPENED)\n return;\n\n removeFromAll(this);\n this.state_ = CLOSED;\n this.disconnect_();\n this.value_ = undef ined;\n this.callback_ = undefined;\n this.target_ = undefined;\n } ,\n\n deliver: function() {\n if (this.state_ != OPENED)\n return ;\n\n dirtyCheck(this);\n },\n\n report_: function(changes) {\n try {\n this.callback_.apply(this.target_, changes);\n } catch (ex) {\n Observer._errorThrownDuringCallback = true;\n console.error('E xception caught during observer callback: ' +\n (ex.stack || ex));\n }\n },\n\n discardChanges: function() {\n this.check_ (undefined, true);\n return this.value_;\n }\n }\n\n var collectObserv ers = !hasObserve;\n var allObservers;\n Observer._allObserversCount = 0;\n\n if (collectObservers) {\n allObservers = [];\n }\n\n function addToAll(obs erver) {\n Observer._allObserversCount++;\n if (!collectObservers)\n return;\n\n allObservers.push(observer);\n }\n\n function removeFromAll(obs erver) {\n Observer._allObserversCount--;\n }\n\n var runningMicrotaskCheck point = false;\n\n var hasDebugForceFullDelivery = typeof Object.deliverAllChan geRecords == 'function';\n\n global.Platform = global.Platform || {};\n\n glob al.Platform.performMicrotaskCheckpoint = function() {\n if (runningMicrotaskC heckpoint)\n return;\n\n if (hasDebugForceFullDelivery) {\n Object. deliverAllChangeRecords();\n return;\n }\n\n if (!collectObservers)\n return;\n\n runningMicrotaskCheckpoint = true;\n\n var cycles = 0;\n var anyChanged, toCheck;\n\n do {\n cycles++;\n toCheck = allOb servers;\n allObservers = [];\n anyChanged = false;\n\n for (var i = 0; i < toCheck.length; i++) {\n var observer = toCheck[i];\n i f (observer.state_ != OPENED)\n continue;\n\n if (observer.check _())\n anyChanged = true;\n\n allObservers.push(observer);\n }\n if (runEOMTasks())\n anyChanged = true;\n } while (cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);\n\n if (global.testingExposeCycleCoun t)\n global.dirtyCheckCycleCount = cycles;\n\n runningMicrotaskCheckpoin t = false;\n };\n\n if (collectObservers) {\n global.Platform.clearObserver s = function() {\n allObservers = [];\n };\n }\n\n function ObjectObse rver(object) {\n Observer.call(this);\n this.value_ = object;\n this.ol dObject_ = undefined;\n }\n\n ObjectObserver.prototype = createObject({\n _ _proto__: Observer.prototype,\n\n arrayObserve: false,\n\n connect_: funct ion(callback, target) {\n if (hasObserve) {\n this.directObserver_ = getObservedObject(this, this.value_,\n this.arrayObserve);\n } else {\n this.oldObject_ = this.copy Object(this.value_);\n }\n\n },\n\n copyObject: function(object) {\n var copy = Array.isArray(object) ? [] : {};\n for (var prop in object) {\n copy[prop] = object[prop];\n };\n if (Array.isArray(object ))\n copy.length = object.length;\n return copy;\n },\n\n chec k_: function(changeRecords, skipChanges) {\n var diff;\n var oldValues ;\n if (hasObserve) {\n if (!changeRecords)\n return false; \n\n oldValues = {};\n diff = diffObjectFromChangeRecords(this.val ue_, changeRecords,\n oldValues);\n } else {\n oldValues = this.oldObject_;\n diff = diffObjectFrom OldObject(this.value_, this.oldObject_);\n }\n\n if (diffIsEmpty(diff) )\n return false;\n\n if (!hasObserve)\n this.oldObject_ = th is.copyObject(this.value_);\n\n this.report_([\n diff.added || {},\n diff.removed || {},\n diff.changed || {},\n function(prope rty) {\n return oldValues[property];\n }\n ]);\n\n ret urn true;\n },\n\n disconnect_: function() {\n if (hasObserve) {\n this.directObserver_.close();\n this.directObserver_ = undefined;\n } else {\n this.oldObject_ = undefined;\n }\n },\n\n deli ver: function() {\n if (this.state_ != OPENED)\n return;\n\n if (hasObserve)\n this.directObserver_.deliver(false);\n else\n dirtyCheck(this);\n },\n\n discardChanges: function() {\n if (this.d irectObserver_)\n this.directObserver_.deliver(true);\n else\n this.oldObject_ = this.copyObject(this.value_);\n\n return this.value_;\n }\n });\n\n function ArrayObserver(array) {\n if (!Array.isArray(array) )\n throw Error('Provided object is not an Array');\n ObjectObserver.cal l(this, array);\n }\n\n ArrayObserver.prototype = createObject({\n\n __prot o__: ObjectObserver.prototype,\n\n arrayObserve: true,\n\n copyObject: fun ction(arr) {\n return arr.slice();\n },\n\n check_: function(changeRe cords) {\n var splices;\n if (hasObserve) {\n if (!changeRecord s)\n return false;\n splices = projectArraySplices(this.value_, changeRecords);\n } else {\n splices = calcSplices(this.value_, 0, t his.value_.length,\n this.oldObject_, 0, this.oldOb ject_.length);\n }\n\n if (!splices || !splices.length)\n retur n false;\n\n if (!hasObserve)\n this.oldObject_ = this.copyObject(th is.value_);\n\n this.report_([splices]);\n return true;\n }\n });\ n\n ArrayObserver.applySplices = function(previous, current, splices) {\n sp lices.forEach(function(splice) {\n var spliceArgs = [splice.index, splice.r emoved.length];\n var addIndex = splice.index;\n while (addIndex < spl ice.index + splice.addedCount) {\n spliceArgs.push(current[addIndex]);\n addIndex++;\n }\n\n Array.prototype.splice.apply(previous, spli ceArgs);\n });\n };\n\n function PathObserver(object, path) {\n Observer .call(this);\n\n this.object_ = object;\n this.path_ = path instanceof Pat h ? path : getPath(path);\n this.directObserver_ = undefined;\n }\n\n PathO bserver.prototype = createObject({\n __proto__: Observer.prototype,\n\n co nnect_: function() {\n if (hasObserve)\n this.directObserver_ = getO bservedSet(this, this.object_);\n\n this.check_(undefined, true);\n },\n \n disconnect_: function() {\n this.value_ = undefined;\n\n if (thi s.directObserver_) {\n this.directObserver_.close(this);\n this.di rectObserver_ = undefined;\n }\n },\n\n iterateObjects_: function(obs erve) {\n this.path_.iterateObjects(this.object_, observe);\n },\n\n check_: function(changeRecords, skipChanges) {\n var oldValue = this.value_ ;\n this.value_ = this.path_.getValueFrom(this.object_);\n if (skipCha nges || areSameValue(this.value_, oldValue))\n return false;\n\n thi s.report_([this.value_, oldValue]);\n return true;\n },\n\n setValue: function(newValue) {\n if (this.path_)\n this.path_.setValueFrom(th is.object_, newValue);\n }\n });\n\n function CompoundObserver() {\n Obs erver.call(this);\n\n this.value_ = [];\n this.directObserver_ = undefined ;\n this.observed_ = [];\n }\n\n var observerSentinel = {};\n\n CompoundOb server.prototype = createObject({\n __proto__: Observer.prototype,\n\n con nect_: function() {\n this.check_(undefined, true);\n\n if (!hasObserv e)\n return;\n\n var object;\n var needsDirectObserver = false; \n for (var i = 0; i < this.observed_.length; i += 2) {\n object = t his.observed_[i]\n if (object !== observerSentinel) {\n needsDir ectObserver = true;\n break;\n }\n }\n\n if (this.dire ctObserver_) {\n if (needsDirectObserver) {\n this.directObserve r_.reset();\n return;\n }\n this.directObserver_.close(); \n this.directObserver_ = undefined;\n return;\n }\n\n i f (needsDirectObserver)\n this.directObserver_ = getObservedSet(this, obj ect);\n },\n\n closeObservers_: function() {\n for (var i = 0; i < th is.observed_.length; i += 2) {\n if (this.observed_[i] === observerSentin el)\n this.observed_[i + 1].close();\n }\n this.observed_.len gth = 0;\n },\n\n disconnect_: function() {\n this.value_ = undefined ;\n\n if (this.directObserver_) {\n this.directObserver_.close(this) ;\n this.directObserver_ = undefined;\n }\n\n this.closeObserve rs_();\n },\n\n addPath: function(object, path) {\n if (this.state_ ! = UNOPENED && this.state_ != RESETTING)\n throw Error('Cannot add paths o nce started.');\n\n this.observed_.push(object, path instanceof Path ? path : getPath(path));\n },\n\n addObserver: function(observer) {\n if (t his.state_ != UNOPENED && this.state_ != RESETTING)\n throw Error('Cannot add observers once started.');\n\n observer.open(this.deliver, this);\n this.observed_.push(observerSentinel, observer);\n },\n\n startReset: f unction() {\n if (this.state_ != OPENED)\n throw Error('Can only res et while open');\n\n this.state_ = RESETTING;\n this.closeObservers_() ;\n },\n\n finishReset: function() {\n if (this.state_ != RESETTING)\ n throw Error('Can only finishReset after startReset');\n this.state _ = OPENED;\n this.connect_();\n\n return this.value_;\n },\n\n iterateObjects_: function(observe) {\n var object;\n for (var i = 0; i < this.observed_.length; i += 2) {\n object = this.observed_[i]\n if (object !== observerSentinel)\n this.observed_[i + 1].iterateObject s(object, observe)\n }\n },\n\n check_: function(changeRecords, skipC hanges) {\n var oldValues;\n for (var i = 0; i < this.observed_.length ; i += 2) {\n var pathOrObserver = this.observed_[i+1];\n var obje ct = this.observed_[i];\n var value = object === observerSentinel ?\n pathOrObserver.discardChanges() :\n pathOrObserver.getValueFr om(object)\n\n if (skipChanges) {\n this.value_[i / 2] = value;\ n continue;\n }\n\n if (areSameValue(value, this.value_[i / 2]))\n continue;\n\n oldValues = oldValues || [];\n ol dValues[i / 2] = this.value_[i / 2];\n this.value_[i / 2] = value;\n }\n\n if (!oldValues)\n return false;\n\n // TODO(rafaelw): Ha ving observed_ as the third callback arg here is\n // pretty lame API. Fix. \n this.report_([this.value_, oldValues, this.observed_]);\n return tr ue;\n }\n });\n\n function identFn(value) { return value; }\n\n function O bserverTransform(observable, getValueFn, setValueFn,\n dontPassThroughSet) {\n this.callback_ = undefined;\n this.target_ = un defined;\n this.value_ = undefined;\n this.observable_ = observable;\n this.getValueFn_ = getValueFn || identFn;\n this.setValueFn_ = setValueFn || identFn;\n // TODO(rafaelw): This is a temporary hack. PolymerExpressions nee ds this\n // at the moment because of a bug in it's dependency tracking.\n this.dontPassThroughSet_ = dontPassThroughSet;\n }\n\n ObserverTransform.prot otype = {\n open: function(callback, target) {\n this.callback_ = callba ck;\n this.target_ = target;\n this.value_ =\n this.getValueF n_(this.observable_.open(this.observedCallback_, this));\n return this.valu e_;\n },\n\n observedCallback_: function(value) {\n value = this.getV alueFn_(value);\n if (areSameValue(value, this.value_))\n return;\n var oldValue = this.value_;\n this.value_ = value;\n this.callbac k_.call(this.target_, this.value_, oldValue);\n },\n\n discardChanges: fun ction() {\n this.value_ = this.getValueFn_(this.observable_.discardChanges( ));\n return this.value_;\n },\n\n deliver: function() {\n retur n this.observable_.deliver();\n },\n\n setValue: function(value) {\n value = this.setValueFn_(value);\n if (!this.dontPassThroughSet_ && this.ob servable_.setValue)\n return this.observable_.setValue(value);\n },\n\ n close: function() {\n if (this.observable_)\n this.observable_. close();\n this.callback_ = undefined;\n this.target_ = undefined;\n this.observable_ = undefined;\n this.value_ = undefined;\n this.ge tValueFn_ = undefined;\n this.setValueFn_ = undefined;\n }\n }\n\n var expectedRecordTypes = {};\n expectedRecordTypes[PROP_ADD_TYPE] = true;\n expe ctedRecordTypes[PROP_UPDATE_TYPE] = true;\n expectedRecordTypes[PROP_DELETE_TYP E] = true;\n\n function notifyFunction(object, name) {\n if (typeof Object.o bserve !== 'function')\n return;\n\n var notifier = Object.getNotifier(o bject);\n return function(type, oldValue) {\n var changeRecord = {\n object: object,\n type: type,\n name: name\n };\n if (arguments.length === 2)\n changeRecord.oldValue = oldValue;\n noti fier.notify(changeRecord);\n }\n }\n\n Observer.defineComputedProperty = fu nction(target, name, observable) {\n var notify = notifyFunction(target, name );\n var value = observable.open(function(newValue, oldValue) {\n value = newValue;\n if (notify)\n notify(PROP_UPDATE_TYPE, oldValue);\n });\n\n Object.defineProperty(target, name, {\n get: function() {\n observable.deliver();\n return value;\n },\n set: function( newValue) {\n observable.setValue(newValue);\n return newValue;\n },\n configurable: true\n });\n\n return {\n close: functio n() {\n observable.close();\n Object.defineProperty(target, name, {\n value: value,\n writable: true,\n configurable: t rue\n });\n }\n };\n }\n\n function diffObjectFromChangeRecords (object, changeRecords, oldValues) {\n var added = {};\n var removed = {}; \n\n for (var i = 0; i < changeRecords.length; i++) {\n var record = cha ngeRecords[i];\n if (!expectedRecordTypes[record.type]) {\n console. error('Unknown changeRecord type: ' + record.type);\n console.error(recor d);\n continue;\n }\n\n if (!(record.name in oldValues))\n oldValues[record.name] = record.oldValue;\n\n if (record.type == PROP_UP DATE_TYPE)\n continue;\n\n if (record.type == PROP_ADD_TYPE) {\n if (record.name in removed)\n delete removed[record.name];\n else\n added[record.name] = true;\n\n continue;\n }\n\n // type = 'delete'\n if (record.name in added) {\n delete added[r ecord.name];\n delete oldValues[record.name];\n } else {\n re moved[record.name] = true;\n }\n }\n\n for (var prop in added)\n added[prop] = object[prop];\n\n for (var prop in removed)\n removed[pro p] = undefined;\n\n var changed = {};\n for (var prop in oldValues) {\n if (prop in added || prop in removed)\n continue;\n\n var newValu e = object[prop];\n if (oldValues[prop] !== newValue)\n changed[prop ] = newValue;\n }\n\n return {\n added: added,\n removed: remove d,\n changed: changed\n };\n }\n\n function newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount\n };\n }\n\n var EDIT_LEAVE = 0;\n var EDIT_UPDATE = 1;\n var EDIT_ADD = 2;\n var EDIT_DELETE = 3;\n\n function ArraySplice() { }\n\n ArraySplice.prototype = {\n\n // Note: This function is *based* on the computation of the Levenshtein\n // \"edit\" distance. The one change is tha t \"updates\" are treated as two\n // edits - not one. With Array splices, an update is really a delete\n // followed by an add. By retaining this, we opt imize for \"keeping\" the\n // maximum array items in the original array. For example:\n //\n // 'xxxx123' -> '123yyyy'\n //\n // With 1-edit u pdates, the shortest path would be just to update all seven\n // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n // leaves the su bstring '123' intact.\n calcEditDistances: function(current, currentStart, cu rrentEnd,\n old, oldStart, oldEnd) {\n // \" Deletion\" columns\n var rowCount = oldEnd - oldStart + 1;\n var colum nCount = currentEnd - currentStart + 1;\n var distances = new Array(rowCoun t);\n\n // \"Addition\" rows. Initialize null column.\n for (var i = 0 ; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (var j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (var i = 1 ; i < rowCount; i++) {\n for (var j = 1; j < columnCount; j++) {\n if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n var north = distances[i - 1][j] + 1;\n var west = distances[i][j - 1 ] + 1;\n distances[i][j] = north < west ? north : west;\n }\ n }\n }\n\n return distances;\n },\n\n // This starts at the final weight, and walks \"backward\" by finding\n // the minimum previous weight recursively until the origin of the weight\n // matrix.\n spliceOp erationsFromEditDistances: function(distances) {\n var i = distances.length - 1;\n var j = distances[0].length - 1;\n var current = distances[i][ j];\n var edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n var northWest = distances[i - 1][j - 1];\ n var west = distances[i - 1][j];\n var north = distances[i][j - 1 ];\n\n var min;\n if (west < north)\n min = west < northW est ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == cur rent) {\n edits.push(EDIT_LEAVE);\n } else {\n ed its.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(E DIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n },\n\n /**\n * Splice Projection functions:\n *\n * A splice map is a representati on of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items w ere removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n /**\n * Lacking individual splice mutation informatio n, the minimal set of\n * splices can be synthesized given the previous stat e and final state of an\n * array. The basic approach is to calculate the ed it distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\n calcSplices: function(current, curr entStart, currentEnd,\n old, oldStart, oldEnd) {\n var prefixCount = 0;\n var suffixCount = 0;\n\n var minLength = Math. min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = this.sharedPrefix(current, old, minLeng th);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - current Start == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentSt art == currentEnd) {\n var splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n \n return [ splice ];\n } else if (oldStart == oldEnd)\n retu rn [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n var ops = this.spliceOperationsFromEditDistances(\n this.calcEditDistances(curr ent, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n var splice = undefined;\n var splices = [];\n var i ndex = currentStart;\n var oldIndex = oldStart;\n for (var i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!sp lice)\n splice = newSplice(index, [], 0);\n\n splice.add edCount++;\n index++;\n break;\n case EDIT_DELETE :\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(sp lice);\n }\n return splices;\n },\n\n sharedPrefix: function(cur rent, old, searchLength) {\n for (var i = 0; i < searchLength; i++)\n if (!this.equals(current[i], old[i]))\n return i;\n return searc hLength;\n },\n\n sharedSuffix: function(current, old, searchLength) {\n var index1 = current.length;\n var index2 = old.length;\n var coun t = 0;\n while (count < searchLength && this.equals(current[--index1], old[ --index2]))\n count++;\n\n return count;\n },\n\n calculateSpl ices: function(current, previous) {\n return this.calcSplices(current, 0, c urrent.length, previous, 0,\n previous.length);\n },\n\n equals: function(currentValue, previousValue) {\n return curren tValue === previousValue;\n }\n };\n\n var arraySplice = new ArraySplice(); \n\n function calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n return arraySplice.calcSplices(current, curr entStart, currentEnd,\n old, oldStart, oldEnd) ;\n }\n\n function intersect(start1, end1, start2, end2) {\n // Disjoint\n if (end1 < start2 || end2 < start1)\n return -1;\n\n // Adjacent\n if (end1 == start2 || end2 == start1)\n return 0;\n\n // Non-zero inter sect, span1 first\n if (start1 < start2) {\n if (end1 < end2)\n r eturn end1 - start2; // Overlap\n else\n return end2 - start2; // Co ntained\n } else {\n // Non-zero intersect, span2 first\n if (end2 < end1)\n return end2 - start1; // Overlap\n else\n return en d1 - start1; // Contained\n }\n }\n\n function mergeSplice(splices, index, removed, addedCount) {\n\n var splice = newSplice(index, removed, addedCount) ;\n\n var inserted = false;\n var insertionOffset = 0;\n\n for (var i = 0; i < splices.length; i++) {\n var current = splices[i];\n current.i ndex += insertionOffset;\n\n if (inserted)\n continue;\n\n var intersectCount = intersect(splice.index,\n s plice.index + splice.removed.length,\n curre nt.index,\n current.index + current.addedCou nt);\n\n if (intersectCount >= 0) {\n // Merge the two splices\n\n splices.splice(i, 1);\n i--;\n\n insertionOffset -= current. addedCount - current.removed.length;\n\n splice.addedCount += current.add edCount - intersectCount;\n var deleteCount = splice.removed.length +\n current.removed.length - intersectCount;\n\n if ( !splice.addedCount && !deleteCount) {\n // merged splice is a noop. dis card.\n inserted = true;\n } else {\n var removed = cur rent.removed;\n\n if (splice.index < current.index) {\n // s ome prefix of splice.removed is prepended to current.removed.\n var p repend = splice.removed.slice(0, current.index - splice.index);\n Arr ay.prototype.push.apply(prepend, removed);\n removed = prepend;\n }\n\n if (splice.index + splice.removed.length > current.index + current.addedCount) {\n // some suffix of splice.removed is appended to current.removed.\n var append = splice.removed.slice(current.index + current.addedCount - splice.index);\n Array.prototype.push.apply(r emoved, append);\n }\n\n splice.removed = removed;\n if (current.index < splice.index) {\n splice.index = current.index;\n }\n }\n } else if (splice.index < current.index) {\n // Insert splice here.\n\n inserted = true;\n\n splices.splice(i , 0, splice);\n i++;\n\n var offset = splice.addedCount - splice.r emoved.length\n current.index += offset;\n insertionOffset += offs et;\n }\n }\n\n if (!inserted)\n splices.push(splice);\n }\n\n function createInitialSplices(array, changeRecords) {\n var splices = [];\n\ n for (var i = 0; i < changeRecords.length; i++) {\n var record = change Records[i];\n switch(record.type) {\n case ARRAY_SPLICE_TYPE:\n mergeSplice(splices, record.index, record.removed.slice(), record.addedCoun t);\n break;\n case PROP_ADD_TYPE:\n case PROP_UPDATE_TYP E:\n case PROP_DELETE_TYPE:\n if (!isIndex(record.name))\n continue;\n var index = toNumber(record.name);\n if (ind ex < 0)\n continue;\n mergeSplice(splices, index, [record.ol dValue], 1);\n break;\n default:\n console.error('Unexp ected record type: ' + JSON.stringify(record));\n break;\n }\n }\n\n return splices;\n }\n\n function projectArraySplices(array, changeRec ords) {\n var splices = [];\n\n createInitialSplices(array, changeRecords) .forEach(function(splice) {\n if (splice.addedCount == 1 && splice.removed. length == 1) {\n if (splice.removed[0] !== array[splice.index])\n splices.push(splice);\n\n return\n };\n\n splices = splices.c oncat(calcSplices(array, splice.index, splice.index + splice.addedCount,\n splice.removed, 0, splice.removed.length)); \n });\n\n return splices;\n }\n\n global.Observer = Observer;\n global .Observer.runEOM_ = runEOM;\n global.Observer.hasObjectObserve = hasObserve;\n global.ArrayObserver = ArrayObserver;\n global.ArrayObserver.calculateSplices = function(current, previous) {\n return arraySplice.calculateSplices(current , previous);\n };\n\n global.ArraySplice = ArraySplice;\n global.ObjectObserv er = ObjectObserver;\n global.PathObserver = PathObserver;\n global.CompoundOb server = CompoundObserver;\n global.Path = Path;\n global.ObserverTransform = ObserverTransform;\n\n // TODO(rafaelw): Only needed for testing until new chan ge record names\n // make it to release.\n global.Observer.changeRecordTypes = {\n add: PROP_ADD_TYPE,\n update: PROP_UPDATE_TYPE,\n reconfigure: PRO P_RECONFIGURE_TYPE,\n 'delete': PROP_DELETE_TYPE,\n splice: ARRAY_SPLICE_T YPE\n };\n})(typeof global !== 'undefined' && global && typeof module !== 'unde fined' && module ? global : this || window);\n", 109 "// Copyright 2012 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n var PROP_ADD_TYPE = 'add';\n var PROP_UPDATE_TYPE = 'update';\n var PROP_RECONFIGURE_TYPE = 'reconfigure';\n var PROP_DELETE_TYPE = 'delete';\n var ARRAY_SPLICE_TYPE = 'splice';\n\n // Detect and do basic sanity checking on Object/Array.observe.\n function detectObjectObserve() {\n if (typeof Obj ect.observe !== 'function' ||\n typeof Array.observe !== 'function') {\n return false;\n }\n\n var records = [];\n\n function callback(recs ) {\n records = recs;\n }\n\n var test = {};\n Object.observe(test , callback);\n test.id = 1;\n test.id = 2;\n delete test.id;\n Objec t.deliverChangeRecords(callback);\n if (records.length !== 3)\n return f alse;\n\n // TODO(rafaelw): Remove this when new change record type names mak e it to\n // chrome release.\n if (records[0].type == 'new' &&\n re cords[1].type == 'updated' &&\n records[2].type == 'deleted') {\n PR OP_ADD_TYPE = 'new';\n PROP_UPDATE_TYPE = 'updated';\n PROP_RECONFIGUR E_TYPE = 'reconfigured';\n PROP_DELETE_TYPE = 'deleted';\n } else if (re cords[0].type != 'add' ||\n records[1].type != 'update' ||\n records[2].type != 'delete') {\n console.error('Unexpected change record names for Object.observe. ' +\n 'Using dirty-checking instead');\n return false;\n }\n Object.unobserve(test, callback);\n\ n test = [0];\n Array.observe(test, callback);\n test[1] = 1;\n test .length = 0;\n Object.deliverChangeRecords(callback);\n if (records.length != 2)\n return false;\n if (records[0].type != ARRAY_SPLICE_TYPE ||\n records[1].type != ARRAY_SPLICE_TYPE) {\n return false;\n }\n A rray.unobserve(test, callback);\n\n return true;\n }\n\n var hasObserve = d etectObjectObserve();\n\n function detectEval() {\n // don't test for eval i f document has CSP securityPolicy object and we can see that\n // eval is not supported. This avoids an error message in console even when the exception\n // is caught\n if (global.document &&\n 'securityPolicy' in global.do cument &&\n !global.document.securityPolicy.allowsEval) {\n return f alse;\n }\n\n try {\n var f = new Function('', 'return true;');\n return f();\n } catch (ex) {\n return false;\n }\n }\n\n var hasE val = detectEval();\n\n function isIndex(s) {\n return +s === s >>> 0;\n }\ n\n function toNumber(s) {\n return +s;\n }\n\n function isObject(obj) {\n return obj === Object(obj);\n }\n\n var numberIsNaN = global.Number.isNaN || function isNaN(value) {\n return typeof value === 'number' && global.isNaN (value);\n }\n\n function areSameValue(left, right) {\n if (left === right) \n return left !== 0 || 1 / left === 1 / right;\n if (numberIsNaN(left) && numberIsNaN(right))\n return true;\n\n return left !== left && right !== right;\n }\n\n var createObject = ('__proto__' in {}) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).forEach(function(name) {\n Object.d efineProperty(newObject, name,\n Object.getOwnProper tyDescriptor(obj, name));\n });\n return newObject;\n };\n\n var i dentStart = '[\\$_a-zA-Z]';\n var identPart = '[\\$_a-zA-Z0-9]';\n var ident = identStart + '+' + identPart + '*';\n var elementIndex = '(?:[0-9]|[1-9]+[0-9] +)';\n var identOrElementIndex = '(?:' + ident + '|' + elementIndex + ')';\n v ar path = '(?:' + identOrElementIndex + ')(?:\\\\s*\\\\.\\\\s*' + identOrElement Index + ')*';\n var pathRegExp = new RegExp('^' + path + '$');\n\n function is PathValid(s) {\n if (typeof s != 'string')\n return false;\n s = s.tr im();\n\n if (s == '')\n return true;\n\n if (s[0] == '.')\n ret urn false;\n\n return pathRegExp.test(s);\n }\n\n var constructorIsPrivate = {};\n\n function Path(s, privateToken) {\n if (privateToken !== constructo rIsPrivate)\n throw Error('Use Path.get to retrieve path objects');\n\n if (s.trim() == '')\n return this;\n\n if (isIndex(s)) {\n this.pus h(s);\n return this;\n }\n\n s.split(/\\s*\\.\\s*/).filter(function(p art) {\n return part;\n }).forEach(function(part) {\n this.push(par t);\n }, this);\n\n if (hasEval && this.length) {\n this.getValueFrom = this.compiledGetValueFromFn();\n }\n }\n\n // TODO(rafaelw): Make simple LRU cache\n var pathCache = {};\n\n function getPath(pathString) {\n if (p athString instanceof Path)\n return pathString;\n\n if (pathString == nu ll)\n pathString = '';\n\n if (typeof pathString !== 'string')\n pa thString = String(pathString);\n\n var path = pathCache[pathString];\n if (path)\n return path;\n if (!isPathValid(pathString))\n return inva lidPath;\n var path = new Path(pathString, constructorIsPrivate);\n pathCa che[pathString] = path;\n return path;\n }\n\n Path.get = getPath;\n\n Pat h.prototype = createObject({\n __proto__: [],\n valid: true,\n\n toStri ng: function() {\n return this.join('.');\n },\n\n getValueFrom: func tion(obj, directObserver) {\n for (var i = 0; i < this.length; i++) {\n if (obj == null)\n return;\n obj = obj[this[i]];\n }\n return obj;\n },\n\n iterateObjects: function(obj, observe) {\n for (var i = 0; i < this.length; i++) {\n if (i)\n obj = obj[thi s[i - 1]];\n if (!obj)\n return;\n observe(obj);\n } \n },\n\n compiledGetValueFromFn: function() {\n var accessors = this .map(function(ident) {\n return isIndex(ident) ? '[\"' + ident + '\"]' : '.' + ident;\n });\n\n var str = '';\n var pathString = 'obj';\n str += 'if (obj != null';\n var i = 0;\n for (; i < (this.length - 1); i++) {\n var ident = this[i];\n pathString += accessors[i];\ n str += ' &&\\n ' + pathString + ' != null';\n }\n str += ')\\n';\n\n pathString += accessors[i];\n\n str += ' return ' + pathS tring + ';\\nelse\\n return undefined;';\n return new Function('obj', str) ;\n },\n\n setValueFrom: function(obj, value) {\n if (!this.length)\n return false;\n\n for (var i = 0; i < this.length - 1; i++) {\n if (!isObject(obj))\n return false;\n obj = obj[this[i]];\n }\n\n if (!isObject(obj))\n return false;\n\n obj[this[i]] = value;\n return true;\n }\n });\n\n var invalidPath = new Path('', constructorIsPrivate);\n invalidPath.valid = false;\n invalidPath.getValueFrom = invalidPath.setValueFrom = function() {};\n\n var MAX_DIRTY_CHECK_CYCLES = 1 000;\n\n function dirtyCheck(observer) {\n var cycles = 0;\n while (cycle s < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {\n cycles++;\n }\n if (global.testingExposeCycleCount)\n global.dirtyCheckCycleCount = cycles; \n\n return cycles > 0;\n }\n\n function objectIsEmpty(object) {\n for ( var prop in object)\n return false;\n return true;\n }\n\n function di ffIsEmpty(diff) {\n return objectIsEmpty(diff.added) &&\n objectIsE mpty(diff.removed) &&\n objectIsEmpty(diff.changed);\n }\n\n functio n diffObjectFromOldObject(object, oldObject) {\n var added = {};\n var rem oved = {};\n var changed = {};\n\n for (var prop in oldObject) {\n va r newValue = object[prop];\n\n if (newValue !== undefined && newValue === o ldObject[prop])\n continue;\n\n if (!(prop in object)) {\n re moved[prop] = undefined;\n continue;\n }\n\n if (newValue !== o ldObject[prop])\n changed[prop] = newValue;\n }\n\n for (var prop i n object) {\n if (prop in oldObject)\n continue;\n\n added[prop ] = object[prop];\n }\n\n if (Array.isArray(object) && object.length !== o ldObject.length)\n changed.length = object.length;\n\n return {\n a dded: added,\n removed: removed,\n changed: changed\n };\n }\n\n var eomTasks = [];\n function runEOMTasks() {\n if (!eomTasks.length)\n return false;\n\n for (var i = 0; i < eomTasks.length; i++) {\n eomTask s[i]();\n }\n eomTasks.length = 0;\n return true;\n }\n\n var runEOM = hasObserve ? (function(){\n var eomObj = { pingPong: true };\n var eomRu nScheduled = false;\n\n Object.observe(eomObj, function() {\n runEOMTask s();\n eomRunScheduled = false;\n });\n\n return function(fn) {\n eomTasks.push(fn);\n if (!eomRunScheduled) {\n eomRunScheduled = t rue;\n eomObj.pingPong = !eomObj.pingPong;\n }\n };\n })() :\n (function() {\n return function(fn) {\n eomTasks.push(fn);\n };\n }) ();\n\n var observedObjectCache = [];\n\n function newObservedObject() {\n var observer;\n var object;\n var discardRecords = false;\n var first = true;\n\n function callback(records) {\n if (observer && observer.state _ === OPENED && !discardRecords)\n observer.check_(records);\n }\n\n return {\n open: function(obs) {\n if (observer)\n throw Error('ObservedObject in use');\n\n if (!first)\n Object.deliver ChangeRecords(callback);\n\n observer = obs;\n first = false;\n },\n observe: function(obj, arrayObserve) {\n object = obj;\n if (arrayObserve)\n Array.observe(object, callback);\n else\ n Object.observe(object, callback);\n },\n deliver: function( discard) {\n discardRecords = discard;\n Object.deliverChangeRecor ds(callback);\n discardRecords = false;\n },\n close: function( ) {\n observer = undefined;\n Object.unobserve(object, callback);\ n observedObjectCache.push(this);\n }\n };\n }\n\n function get ObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCa che.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(obje ct, arrayObserve);\n return dir;\n }\n\n var emptyArray = [];\n var observ edSetCache = [];\n\n function newObservedSet() {\n var observers = [];\n var observerCount = 0;\n var objects = [];\n var toRemove = emptyArray;\n var resetNeeded = false;\n var resetScheduled = false;\n\n function obs erve(obj) {\n if (!isObject(obj))\n return;\n\n var index = toR emove.indexOf(obj);\n if (index >= 0) {\n toRemove[index] = undefine d;\n objects.push(obj);\n } else if (objects.indexOf(obj) < 0) {\n objects.push(obj);\n Object.observe(obj, callback);\n }\n\n observe(Object.getPrototypeOf(obj));\n }\n\n function reset() {\n var objs = toRemove === emptyArray ? [] : toRemove;\n toRemove = objects;\n objects = objs;\n\n var observer;\n for (var id in observers) {\ n observer = observers[id];\n if (!observer || observer.state_ != OPENED)\n continue;\n\n observer.iterateObjects_(observe);\n }\n\n for (var i = 0; i < toRemove.length; i++) {\n var obj = toRe move[i];\n if (obj)\n Object.unobserve(obj, callback);\n }\ n\n toRemove.length = 0;\n }\n\n function scheduledReset() {\n r esetScheduled = false;\n if (!resetNeeded)\n return;\n\n reset( );\n }\n\n function scheduleReset() {\n if (resetScheduled)\n return;\n\n resetNeeded = true;\n resetScheduled = true;\n runEOM (scheduledReset);\n }\n\n function callback() {\n reset();\n\n v ar observer;\n\n for (var id in observers) {\n observer = observers[ id];\n if (!observer || observer.state_ != OPENED)\n continue;\n \n observer.check_();\n }\n }\n\n var record = {\n object : undefined,\n objects: objects,\n open: function(obs) {\n obse rvers[obs.id_] = obs;\n observerCount++;\n obs.iterateObjects_(obs erve);\n },\n close: function(obs) {\n var anyLeft = false;\n\n observers[obs.id_] = undefined;\n observerCount--;\n\n if (observerCount) {\n scheduleReset();\n return;\n }\n resetNeeded = false;\n\n for (var i = 0; i < objects.length; i++) {\ n Object.unobserve(objects[i], callback);\n Observer.unobserve dCount++;\n }\n\n observers.length = 0;\n objects.length = 0;\n observedSetCache.push(this);\n },\n reset: scheduleReset\n };\n\n return record;\n }\n\n var lastObservedSet;\n\n function getObs ervedSet(observer, obj) {\n if (!lastObservedSet || lastObservedSet.object != = obj) {\n lastObservedSet = observedSetCache.pop() || newObservedSet();\n lastObservedSet.object = obj;\n }\n lastObservedSet.open(observer);\n return lastObservedSet;\n }\n\n var UNOPENED = 0;\n var OPENED = 1;\n va r CLOSED = 2;\n var RESETTING = 3;\n\n var nextObserverId = 1;\n\n function O bserver() {\n this.state_ = UNOPENED;\n this.callback_ = undefined;\n t his.target_ = undefined; // TODO(rafaelw): Should be WeakRef\n this.directObs erver_ = undefined;\n this.value_ = undefined;\n this.id_ = nextObserverId ++;\n }\n\n Observer.prototype = {\n open: function(callback, target) {\n if (this.state_ != UNOPENED)\n throw Error('Observer has already been opened.');\n\n addToAll(this);\n this.callback_ = callback;\n th is.target_ = target;\n this.state_ = OPENED;\n this.connect_();\n return this.value_;\n },\n\n close: function() {\n if (this.state_ ! = OPENED)\n return;\n\n removeFromAll(this);\n this.state_ = CL OSED;\n this.disconnect_();\n this.value_ = undefined;\n this.cal lback_ = undefined;\n this.target_ = undefined;\n },\n\n deliver: fun ction() {\n if (this.state_ != OPENED)\n return;\n\n dirtyCheck (this);\n },\n\n report_: function(changes) {\n try {\n this.c allback_.apply(this.target_, changes);\n } catch (ex) {\n Observer._ errorThrownDuringCallback = true;\n console.error('Exception caught durin g observer callback: ' +\n (ex.stack || ex));\n }\n },\n\n discardChanges: function() {\n this.check_(undefined, true);\n return this.value_;\n }\n }\n\n var collectObservers = !hasObserve;\n var allObservers;\n Observer._allObserversCount = 0;\n\n if (collectObservers ) {\n allObservers = [];\n }\n\n function addToAll(observer) {\n Observe r._allObserversCount++;\n if (!collectObservers)\n return;\n\n allObs ervers.push(observer);\n }\n\n function removeFromAll(observer) {\n Observe r._allObserversCount--;\n }\n\n var runningMicrotaskCheckpoint = false;\n\n v ar hasDebugForceFullDelivery = typeof Object.deliverAllChangeRecords == 'functio n';\n\n global.Platform = global.Platform || {};\n\n global.Platform.performMi crotaskCheckpoint = function() {\n if (runningMicrotaskCheckpoint)\n ret urn;\n\n if (hasDebugForceFullDelivery) {\n Object.deliverAllChangeRecor ds();\n return;\n }\n\n if (!collectObservers)\n return;\n\n runningMicrotaskCheckpoint = true;\n\n var cycles = 0;\n var anyChanged, t oCheck;\n\n do {\n cycles++;\n toCheck = allObservers;\n allOb servers = [];\n anyChanged = false;\n\n for (var i = 0; i < toCheck.le ngth; i++) {\n var observer = toCheck[i];\n if (observer.state_ != OPENED)\n continue;\n\n if (observer.check_())\n anyCh anged = true;\n\n allObservers.push(observer);\n }\n if (runEOM Tasks())\n anyChanged = true;\n } while (cycles < MAX_DIRTY_CHECK_CYCL ES && anyChanged);\n\n if (global.testingExposeCycleCount)\n global.dirt yCheckCycleCount = cycles;\n\n runningMicrotaskCheckpoint = false;\n };\n\n if (collectObservers) {\n global.Platform.clearObservers = function() {\n allObservers = [];\n };\n }\n\n function ObjectObserver(object) {\n O bserver.call(this);\n this.value_ = object;\n this.oldObject_ = undefined; \n }\n\n ObjectObserver.prototype = createObject({\n __proto__: Observer.pr ototype,\n\n arrayObserve: false,\n\n connect_: function(callback, target) {\n if (hasObserve) {\n this.directObserver_ = getObservedObject(th is, this.value_,\n this.arrayObs erve);\n } else {\n this.oldObject_ = this.copyObject(this.value_);\ n }\n\n },\n\n copyObject: function(object) {\n var copy = Array .isArray(object) ? [] : {};\n for (var prop in object) {\n copy[prop ] = object[prop];\n };\n if (Array.isArray(object))\n copy.leng th = object.length;\n return copy;\n },\n\n check_: function(changeRe cords, skipChanges) {\n var diff;\n var oldValues;\n if (hasObser ve) {\n if (!changeRecords)\n return false;\n\n oldValues = {};\n diff = diffObjectFromChangeRecords(this.value_, changeRecords,\n oldValues);\n } else {\n oldValues = this.oldObject_;\n diff = diffObjectFromOldObject(this.value_ , this.oldObject_);\n }\n\n if (diffIsEmpty(diff))\n return fal se;\n\n if (!hasObserve)\n this.oldObject_ = this.copyObject(this.va lue_);\n\n this.report_([\n diff.added || {},\n diff.removed || {},\n diff.changed || {},\n function(property) {\n ret urn oldValues[property];\n }\n ]);\n\n return true;\n },\n\n disconnect_: function() {\n if (hasObserve) {\n this.directObser ver_.close();\n this.directObserver_ = undefined;\n } else {\n this.oldObject_ = undefined;\n }\n },\n\n deliver: function() {\n if (this.state_ != OPENED)\n return;\n\n if (hasObserve)\n this.directObserver_.deliver(false);\n else\n dirtyCheck(this);\n },\n\n discardChanges: function() {\n if (this.directObserver_)\n this.directObserver_.deliver(true);\n else\n this.oldObject_ = t his.copyObject(this.value_);\n\n return this.value_;\n }\n });\n\n fun ction ArrayObserver(array) {\n if (!Array.isArray(array))\n throw Error( 'Provided object is not an Array');\n ObjectObserver.call(this, array);\n }\ n\n ArrayObserver.prototype = createObject({\n\n __proto__: ObjectObserver.p rototype,\n\n arrayObserve: true,\n\n copyObject: function(arr) {\n r eturn arr.slice();\n },\n\n check_: function(changeRecords) {\n var s plices;\n if (hasObserve) {\n if (!changeRecords)\n return false;\n splices = projectArraySplices(this.value_, changeRecords);\n } else {\n splices = calcSplices(this.value_, 0, this.value_.length,\n this.oldObject_, 0, this.oldObject_.length);\n }\n\n if (!splices || !splices.length)\n return false;\n\n if (!hasObserve)\n this.oldObject_ = this.copyObject(this.value_);\n\n this.report_([splices]);\n return true;\n }\n });\n\n ArrayObserver.ap plySplices = function(previous, current, splices) {\n splices.forEach(functio n(splice) {\n var spliceArgs = [splice.index, splice.removed.length];\n var addIndex = splice.index;\n while (addIndex < splice.index + splice.ad dedCount) {\n spliceArgs.push(current[addIndex]);\n addIndex++;\n }\n\n Array.prototype.splice.apply(previous, spliceArgs);\n });\n };\n\n function PathObserver(object, path) {\n Observer.call(this);\n\n t his.object_ = object;\n this.path_ = path instanceof Path ? path : getPath(pa th);\n this.directObserver_ = undefined;\n }\n\n PathObserver.prototype = c reateObject({\n __proto__: Observer.prototype,\n\n connect_: function() {\ n if (hasObserve)\n this.directObserver_ = getObservedSet(this, this .object_);\n\n this.check_(undefined, true);\n },\n\n disconnect_: fu nction() {\n this.value_ = undefined;\n\n if (this.directObserver_) {\ n this.directObserver_.close(this);\n this.directObserver_ = undef ined;\n }\n },\n\n iterateObjects_: function(observe) {\n this.p ath_.iterateObjects(this.object_, observe);\n },\n\n check_: function(chan geRecords, skipChanges) {\n var oldValue = this.value_;\n this.value_ = this.path_.getValueFrom(this.object_);\n if (skipChanges || areSameValue( this.value_, oldValue))\n return false;\n\n this.report_([this.value _, oldValue]);\n return true;\n },\n\n setValue: function(newValue) { \n if (this.path_)\n this.path_.setValueFrom(this.object_, newValue) ;\n }\n });\n\n function CompoundObserver() {\n Observer.call(this);\n\n this.value_ = [];\n this.directObserver_ = undefined;\n this.observed_ = [];\n }\n\n var observerSentinel = {};\n\n CompoundObserver.prototype = cr eateObject({\n __proto__: Observer.prototype,\n\n connect_: function() {\n this.check_(undefined, true);\n\n if (!hasObserve)\n return;\n \n var object;\n var needsDirectObserver = false;\n for (var i = 0; i < this.observed_.length; i += 2) {\n object = this.observed_[i]\n if (object !== observerSentinel) {\n needsDirectObserver = true;\n break;\n }\n }\n\n if (this.directObserver_) {\n if (needsDirectObserver) {\n this.directObserver_.reset();\n return;\n }\n this.directObserver_.close();\n this.direct Observer_ = undefined;\n return;\n }\n\n if (needsDirectObserve r)\n this.directObserver_ = getObservedSet(this, object);\n },\n\n closeObservers_: function() {\n for (var i = 0; i < this.observed_.length; i += 2) {\n if (this.observed_[i] === observerSentinel)\n this.o bserved_[i + 1].close();\n }\n this.observed_.length = 0;\n },\n\n disconnect_: function() {\n this.value_ = undefined;\n\n if (this.d irectObserver_) {\n this.directObserver_.close(this);\n this.direc tObserver_ = undefined;\n }\n\n this.closeObservers_();\n },\n\n addPath: function(object, path) {\n if (this.state_ != UNOPENED && this.st ate_ != RESETTING)\n throw Error('Cannot add paths once started.');\n\n this.observed_.push(object, path instanceof Path ? path : getPath(path));\n },\n\n addObserver: function(observer) {\n if (this.state_ != UNOPENE D && this.state_ != RESETTING)\n throw Error('Cannot add observers once s tarted.');\n\n observer.open(this.deliver, this);\n this.observed_.pus h(observerSentinel, observer);\n },\n\n startReset: function() {\n if (this.state_ != OPENED)\n throw Error('Can only reset while open');\n\n this.state_ = RESETTING;\n this.closeObservers_();\n },\n\n fini shReset: function() {\n if (this.state_ != RESETTING)\n throw Error( 'Can only finishReset after startReset');\n this.state_ = OPENED;\n th is.connect_();\n\n return this.value_;\n },\n\n iterateObjects_: func tion(observe) {\n var object;\n for (var i = 0; i < this.observed_.len gth; i += 2) {\n object = this.observed_[i]\n if (object !== obser verSentinel)\n this.observed_[i + 1].iterateObjects(object, observe)\n }\n },\n\n check_: function(changeRecords, skipChanges) {\n var oldValues;\n for (var i = 0; i < this.observed_.length; i += 2) {\n var pathOrObserver = this.observed_[i+1];\n var object = this.observed_[i ];\n var value = object === observerSentinel ?\n pathOrObserve r.discardChanges() :\n pathOrObserver.getValueFrom(object)\n\n if (skipChanges) {\n this.value_[i / 2] = value;\n continue;\ n }\n\n if (areSameValue(value, this.value_[i / 2]))\n co ntinue;\n\n oldValues = oldValues || [];\n oldValues[i / 2] = this .value_[i / 2];\n this.value_[i / 2] = value;\n }\n\n if (!oldV alues)\n return false;\n\n // TODO(rafaelw): Having observed_ as the third callback arg here is\n // pretty lame API. Fix.\n this.report_( [this.value_, oldValues, this.observed_]);\n return true;\n }\n });\n\n function identFn(value) { return value; }\n\n function ObserverTransform(obse rvable, getValueFn, setValueFn,\n dontPassThroughSet ) {\n this.callback_ = undefined;\n this.target_ = undefined;\n this.va lue_ = undefined;\n this.observable_ = observable;\n this.getValueFn_ = ge tValueFn || identFn;\n this.setValueFn_ = setValueFn || identFn;\n // TODO (rafaelw): This is a temporary hack. PolymerExpressions needs this\n // at th e moment because of a bug in it's dependency tracking.\n this.dontPassThrough Set_ = dontPassThroughSet;\n }\n\n ObserverTransform.prototype = {\n open: function(callback, target) {\n this.callback_ = callback;\n this.targe t_ = target;\n this.value_ =\n this.getValueFn_(this.observable_.o pen(this.observedCallback_, this));\n return this.value_;\n },\n\n ob servedCallback_: function(value) {\n value = this.getValueFn_(value);\n if (areSameValue(value, this.value_))\n return;\n var oldValue = t his.value_;\n this.value_ = value;\n this.callback_.call(this.target_, this.value_, oldValue);\n },\n\n discardChanges: function() {\n this .value_ = this.getValueFn_(this.observable_.discardChanges());\n return thi s.value_;\n },\n\n deliver: function() {\n return this.observable_.de liver();\n },\n\n setValue: function(value) {\n value = this.setValue Fn_(value);\n if (!this.dontPassThroughSet_ && this.observable_.setValue)\n return this.observable_.setValue(value);\n },\n\n close: function( ) {\n if (this.observable_)\n this.observable_.close();\n this. callback_ = undefined;\n this.target_ = undefined;\n this.observable_ = undefined;\n this.value_ = undefined;\n this.getValueFn_ = undefined ;\n this.setValueFn_ = undefined;\n }\n }\n\n var expectedRecordTypes = {};\n expectedRecordTypes[PROP_ADD_TYPE] = true;\n expectedRecordTypes[PROP_ UPDATE_TYPE] = true;\n expectedRecordTypes[PROP_DELETE_TYPE] = true;\n\n funct ion notifyFunction(object, name) {\n if (typeof Object.observe !== 'function' )\n return;\n\n var notifier = Object.getNotifier(object);\n return f unction(type, oldValue) {\n var changeRecord = {\n object: object,\n type: type,\n name: name\n };\n if (arguments.length == = 2)\n changeRecord.oldValue = oldValue;\n notifier.notify(changeRec ord);\n }\n }\n\n Observer.defineComputedProperty = function(target, name, observable) {\n var notify = notifyFunction(target, name);\n var value = o bservable.open(function(newValue, oldValue) {\n value = newValue;\n if (notify)\n notify(PROP_UPDATE_TYPE, oldValue);\n });\n\n Object.de fineProperty(target, name, {\n get: function() {\n observable.delive r();\n return value;\n },\n set: function(newValue) {\n observable.setValue(newValue);\n return newValue;\n },\n config urable: true\n });\n\n return {\n close: function() {\n observ able.close();\n Object.defineProperty(target, name, {\n value: v alue,\n writable: true,\n configurable: true\n });\n }\n };\n }\n\n function diffObjectFromChangeRecords(object, changeRecord s, oldValues) {\n var added = {};\n var removed = {};\n\n for (var i = 0; i < changeRecords.length; i++) {\n var record = changeRecords[i];\n if (!expectedRecordTypes[record.type]) {\n console.error('Unknown change Record type: ' + record.type);\n console.error(record);\n continue ;\n }\n\n if (!(record.name in oldValues))\n oldValues[record.n ame] = record.oldValue;\n\n if (record.type == PROP_UPDATE_TYPE)\n c ontinue;\n\n if (record.type == PROP_ADD_TYPE) {\n if (record.name i n removed)\n delete removed[record.name];\n else\n adde d[record.name] = true;\n\n continue;\n }\n\n // type = 'delete' \n if (record.name in added) {\n delete added[record.name];\n delete oldValues[record.name];\n } else {\n removed[record.name] = true;\n }\n }\n\n for (var prop in added)\n added[prop] = object [prop];\n\n for (var prop in removed)\n removed[prop] = undefined;\n\n var changed = {};\n for (var prop in oldValues) {\n if (prop in added || prop in removed)\n continue;\n\n var newValue = object[prop];\n if (oldValues[prop] !== newValue)\n changed[prop] = newValue;\n }\ n\n return {\n added: added,\n removed: removed,\n changed: ch anged\n };\n }\n\n function newSplice(index, removed, addedCount) {\n re turn {\n index: index,\n removed: removed,\n addedCount: addedCou nt\n };\n }\n\n var EDIT_LEAVE = 0;\n var EDIT_UPDATE = 1;\n var EDIT_ADD = 2;\n var EDIT_DELETE = 3;\n\n function ArraySplice() {}\n\n ArraySplice.pr ototype = {\n\n // Note: This function is *based* on the computation of the L evenshtein\n // \"edit\" distance. The one change is that \"updates\" are tre ated as two\n // edits - not one. With Array splices, an update is really a d elete\n // followed by an add. By retaining this, we optimize for \"keeping\" the\n // maximum array items in the original array. For example:\n //\n // 'xxxx123' -> '123yyyy'\n //\n // With 1-edit updates, the shortest path would be just to update all seven\n // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n // leaves the substring '123' intact. \n calcEditDistances: function(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n var rowCount = oldEnd - oldStart + 1;\n var columnCount = currentEnd - currentStart + 1;\n var distances = new Array(rowCount);\n\n // \"Add ition\" rows. Initialize null column.\n for (var i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\ n }\n\n // Initialize null row\n for (var j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (var i = 1; i < rowCount; i++) {\n for (var j = 1; j < columnCount; j++) {\n if (this.equals(cu rrent[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j ] = distances[i - 1][j - 1];\n else {\n var north = distance s[i - 1][j] + 1;\n var west = distances[i][j - 1] + 1;\n d istances[i][j] = north < west ? north : west;\n }\n }\n }\n \n return distances;\n },\n\n // This starts at the final weight, and walks \"backward\" by finding\n // the minimum previous weight recursively u ntil the origin of the weight\n // matrix.\n spliceOperationsFromEditDista nces: function(distances) {\n var i = distances.length - 1;\n var j = distances[0].length - 1;\n var current = distances[i][j];\n var edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.pu sh(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n var northWest = distances[i - 1][j - 1];\n var west = d istances[i - 1][j];\n var north = distances[i][j - 1];\n\n var min ;\n if (west < north)\n min = west < northWest ? west : northWes t;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE) ;\n current = northWest;\n }\n i--;\n j--; \n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ ADD);\n j--;\n current = north;\n }\n }\n\n e dits.reverse();\n return edits;\n },\n\n /**\n * Splice Projectio n functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually i t is a list of\n * tuples of\n *\n * <index, removed, addedCount>\ n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and coun ting forward\n * from |index|, |addedCount| items were added.\n */\n\n /**\n * Lacking individual splice mutation information, the minimal set of \n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix an d\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\n calcSplices: function(current, currentStart, currentEnd, \n old, oldStart, oldEnd) {\n var prefixCount = 0; \n var suffixCount = 0;\n\n var minLength = Math.min(currentEnd - curr entStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = this.sharedPrefix(current, old, minLength);\n\n if (cur rentEnd == current.length && oldEnd == old.length)\n suffixCount = this.s haredSuffix(current, old, minLength - prefixCount);\n\n currentStart += pre fixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\ n var splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ sp lice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(curren tStart, [], currentEnd - currentStart) ];\n\n var ops = this.spliceOperatio nsFromEditDistances(\n this.calcEditDistances(current, currentStart, cu rrentEnd,\n old, oldStart, oldEnd));\n\n va r splice = undefined;\n var splices = [];\n var index = currentStart;\ n var oldIndex = oldStart;\n for (var i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSpl ice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!s plice)\n splice = newSplice(index, [], 0);\n\n splice.re moved.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n },\n\n sharedPrefix: function(current, old, searchLeng th) {\n for (var i = 0; i < searchLength; i++)\n if (!this.equals(cu rrent[i], old[i]))\n return i;\n return searchLength;\n },\n\n sharedSuffix: function(current, old, searchLength) {\n var index1 = curr ent.length;\n var index2 = old.length;\n var count = 0;\n while ( count < searchLength && this.equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n },\n\n calculateSplices: function(curren t, previous) {\n return this.calcSplices(current, 0, current.length, previo us, 0,\n previous.length);\n },\n\n equals: f unction(currentValue, previousValue) {\n return currentValue === previousVa lue;\n }\n };\n\n var arraySplice = new ArraySplice();\n\n function calcSp lices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n return arraySplice.calcSplices(current, currentStart, currentEnd, \n old, oldStart, oldEnd);\n }\n\n function intersect(start1, end1, start2, end2) {\n // Disjoint\n if (end1 < start2 || end2 < start1)\n return -1;\n\n // Adjacent\n if (end1 == start2 | | end2 == start1)\n return 0;\n\n // Non-zero intersect, span1 first\n if (start1 < start2) {\n if (end1 < end2)\n return end1 - start2; // Overlap\n else\n return end2 - start2; // Contained\n } else { \n // Non-zero intersect, span2 first\n if (end2 < end1)\n retu rn end2 - start1; // Overlap\n else\n return end1 - start1; // Conta ined\n }\n }\n\n function mergeSplice(splices, index, removed, addedCount) {\n\n var splice = newSplice(index, removed, addedCount);\n\n var inserted = false;\n var insertionOffset = 0;\n\n for (var i = 0; i < splices.lengt h; i++) {\n var current = splices[i];\n current.index += insertionOffs et;\n\n if (inserted)\n continue;\n\n var intersectCount = inte rsect(splice.index,\n splice.index + splice. removed.length,\n current.index,\n current.index + current.addedCount);\n\n if (int ersectCount >= 0) {\n // Merge the two splices\n\n splices.splice( i, 1);\n i--;\n\n insertionOffset -= current.addedCount - current. removed.length;\n\n splice.addedCount += current.addedCount - intersectCo unt;\n var deleteCount = splice.removed.length +\n current.removed.length - intersectCount;\n\n if (!splice.addedCount && !deleteCount) {\n // merged splice is a noop. discard.\n inse rted = true;\n } else {\n var removed = current.removed;\n\n if (splice.index < current.index) {\n // some prefix of splice. removed is prepended to current.removed.\n var prepend = splice.remov ed.slice(0, current.index - splice.index);\n Array.prototype.push.app ly(prepend, removed);\n removed = prepend;\n }\n\n if (splice.index + splice.removed.length > current.index + current.addedCount) { \n // some suffix of splice.removed is appended to current.removed.\n var append = splice.removed.slice(current.index + current.addedCount - splice.index);\n Array.prototype.push.apply(removed, append);\n }\n\n splice.removed = removed;\n if (current.index < s plice.index) {\n splice.index = current.index;\n }\n }\n } else if (splice.index < current.index) {\n // Insert splice he re.\n\n inserted = true;\n\n splices.splice(i, 0, splice);\n i++;\n\n var offset = splice.addedCount - splice.removed.length\n current.index += offset;\n insertionOffset += offset;\n }\n }\n \n if (!inserted)\n splices.push(splice);\n }\n\n function createIniti alSplices(array, changeRecords) {\n var splices = [];\n\n for (var i = 0; i < changeRecords.length; i++) {\n var record = changeRecords[i];\n sw itch(record.type) {\n case ARRAY_SPLICE_TYPE:\n mergeSplice(spli ces, record.index, record.removed.slice(), record.addedCount);\n break; \n case PROP_ADD_TYPE:\n case PROP_UPDATE_TYPE:\n case PROP _DELETE_TYPE:\n if (!isIndex(record.name))\n continue;\n var index = toNumber(record.name);\n if (index < 0)\n continue;\n mergeSplice(splices, index, [record.oldValue], 1);\n break;\n default:\n console.error('Unexpected record type: ' + JSON.stringify(record));\n break;\n }\n }\n\n return splic es;\n }\n\n function projectArraySplices(array, changeRecords) {\n var spli ces = [];\n\n createInitialSplices(array, changeRecords).forEach(function(spl ice) {\n if (splice.addedCount == 1 && splice.removed.length == 1) {\n if (splice.removed[0] !== array[splice.index])\n splices.push(splice );\n\n return\n };\n\n splices = splices.concat(calcSplices(arr ay, splice.index, splice.index + splice.addedCount,\n splice.removed, 0, splice.removed.length));\n });\n\n retu rn splices;\n }\n\n global.Observer = Observer;\n global.Observer.runEOM_ = r unEOM;\n global.Observer.hasObjectObserve = hasObserve;\n global.ArrayObserver = ArrayObserver;\n global.ArrayObserver.calculateSplices = function(current, p revious) {\n return arraySplice.calculateSplices(current, previous);\n };\n\ n global.ArraySplice = ArraySplice;\n global.ObjectObserver = ObjectObserver;\ n global.PathObserver = PathObserver;\n global.CompoundObserver = CompoundObse rver;\n global.Path = Path;\n global.ObserverTransform = ObserverTransform;\n\ n // TODO(rafaelw): Only needed for testing until new change record names\n // make it to release.\n global.Observer.changeRecordTypes = {\n add: PROP_ADD _TYPE,\n update: PROP_UPDATE_TYPE,\n reconfigure: PROP_RECONFIGURE_TYPE,\n 'delete': PROP_DELETE_TYPE,\n splice: ARRAY_SPLICE_TYPE\n };\n})(typeof global !== 'undefined' && global && typeof module !== 'undefined' && module ? gl obal : this || window);\n",
108 "// prepoulate window.Platform.flags for default controls\r\nwindow.Platform = window.Platform || {};\r\n// prepopulate window.logFlags if necessary\r\nwind ow.logFlags = window.logFlags || {};\r\n// process flags\r\n(function(scope){\r\ n // import\r\n var flags = scope.flags || {};\r\n // populate flags from loc ation\r\n location.search.slice(1).split('&').forEach(function(o) {\r\n o = o.split('=');\r\n o[0] && (flags[o[0]] = o[1] || true);\r\n });\r\n var ent ryPoint = document.currentScript || document.querySelector('script[src*=\"platfo rm.js\"]');\r\n if (entryPoint) {\r\n var a = entryPoint.attributes;\r\n for (var i = 0, n; i < a.length; i++) {\r\n n = a[i];\r\n if (n.name ! == 'src') {\r\n flags[n.name] = n.value || true;\r\n }\r\n }\r\n }\r\n if (flags.log) {\r\n flags.log.split(',').forEach(function(f) {\r\n window.logFlags[f] = true;\r\n });\r\n }\r\n // If any of these flags m atch 'native', then force native ShadowDOM; any\r\n // other truthy value, or f ailure to detect native\r\n // ShadowDOM, results in polyfill\r\n flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill);\r\n if (flags.shadow == = 'native') {\r\n flags.shadow = false;\r\n } else {\r\n flags.shadow = f lags.shadow || !HTMLElement.prototype.createShadowRoot;\r\n }\r\n\r\n // Custo mElements polyfill flag\r\n if (flags.register) {\r\n window.CustomElements = window.CustomElements || {flags: {}};\r\n window.CustomElements.flags.regis ter = flags.register;\r\n }\r\n\r\n if (flags.imports) {\r\n window.HTMLImp orts = window.HTMLImports || {flags: {}};\r\n window.HTMLImports.flags.import s = flags.imports;\r\n }\r\n\r\n // export\r\n scope.flags = flags;\r\n})(Pla tform);\r\n\r\n// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n", 110 "// prepoulate window.Platform.flags for default controls\r\nwindow.Platform = window.Platform || {};\r\n// prepopulate window.logFlags if necessary\r\nwind ow.logFlags = window.logFlags || {};\r\n// process flags\r\n(function(scope){\r\ n // import\r\n var flags = scope.flags || {};\r\n // populate flags from loc ation\r\n location.search.slice(1).split('&').forEach(function(o) {\r\n o = o.split('=');\r\n o[0] && (flags[o[0]] = o[1] || true);\r\n });\r\n var ent ryPoint = document.currentScript || document.querySelector('script[src*=\"platfo rm.js\"]');\r\n if (entryPoint) {\r\n var a = entryPoint.attributes;\r\n for (var i = 0, n; i < a.length; i++) {\r\n n = a[i];\r\n if (n.name ! == 'src') {\r\n flags[n.name] = n.value || true;\r\n }\r\n }\r\n }\r\n if (flags.log) {\r\n flags.log.split(',').forEach(function(f) {\r\n window.logFlags[f] = true;\r\n });\r\n }\r\n // If any of these flags m atch 'native', then force native ShadowDOM; any\r\n // other truthy value, or f ailure to detect native\r\n // ShadowDOM, results in polyfill\r\n flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill);\r\n if (flags.shadow == = 'native') {\r\n flags.shadow = false;\r\n } else {\r\n flags.shadow = f lags.shadow || !HTMLElement.prototype.createShadowRoot;\r\n }\r\n\r\n // Custo mElements polyfill flag\r\n if (flags.register) {\r\n window.CustomElements = window.CustomElements || {flags: {}};\r\n window.CustomElements.flags.regis ter = flags.register;\r\n }\r\n\r\n if (flags.imports) {\r\n window.HTMLImp orts = window.HTMLImports || {flags: {}};\r\n window.HTMLImports.flags.import s = flags.imports;\r\n }\r\n\r\n // export\r\n scope.flags = flags;\r\n})(Pla tform);\r\n\r\n// select ShadowDOM impl\r\nif (Platform.flags.shadow) {\r\n",
109 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\nwindow.ShadowDOMPolyfill = {};\n\n(function(scope) {\n 'use stri ct';\n\n var constructorTable = new WeakMap();\n var nativePrototypeTable = ne w WeakMap();\n var wrappers = Object.create(null);\n\n // Don't test for eval if document has CSP securityPolicy object and we can\n // see that eval is not supported. This avoids an error message in console\n // even when the exception is caught\n var hasEval = !('securityPolicy' in document) ||\n document.s ecurityPolicy.allowsEval;\n if (hasEval) {\n try {\n var f = new Functi on('', 'return true;');\n hasEval = f();\n } catch (ex) {\n hasEval = false;\n }\n }\n\n function assert(b) {\n if (!b)\n throw new Er ror('Assertion failed');\n };\n\n var defineProperty = Object.defineProperty;\ n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertyDe scriptor = Object.getOwnPropertyDescriptor;\n\n function mixin(to, from) {\n getOwnPropertyNames(from).forEach(function(name) {\n defineProperty(to, na me, getOwnPropertyDescriptor(from, name));\n });\n return to;\n };\n\n f unction mixinStatics(to, from) {\n getOwnPropertyNames(from).forEach(function (name) {\n switch (name) {\n case 'arguments':\n case 'caller ':\n case 'length':\n case 'name':\n case 'prototype':\n case 'toString':\n return;\n }\n defineProperty(to, name , getOwnPropertyDescriptor(from, name));\n });\n return to;\n };\n\n fun ction oneOf(object, propertyNames) {\n for (var i = 0; i < propertyNames.leng th; i++) {\n if (propertyNames[i] in object)\n return propertyNames[ i];\n }\n }\n\n // Mozilla's old DOM bindings are bretty busted:\n // http s://bugzilla.mozilla.org/show_bug.cgi?id=855844\n // Make sure they are create before we start modifying things.\n getOwnPropertyNames(window);\n\n function getWrapperConstructor(node) {\n var nativePrototype = node.__proto__ || Objec t.getPrototypeOf(node);\n var wrapperConstructor = constructorTable.get(nativ ePrototype);\n if (wrapperConstructor)\n return wrapperConstructor;\n\n var parentWrapperConstructor = getWrapperConstructor(nativePrototype);\n\n var GeneratedWrapper = createWrapperConstructor(parentWrapperConstructor);\n registerInternal(nativePrototype, GeneratedWrapper, node);\n\n return Genera tedWrapper;\n }\n\n function addForwardingProperties(nativePrototype, wrapperP rototype) {\n installProperty(nativePrototype, wrapperPrototype, true);\n }\ n\n function registerInstanceProperties(wrapperPrototype, instanceObject) {\n installProperty(instanceObject, wrapperPrototype, false);\n }\n\n var isFire fox = /Firefox/.test(navigator.userAgent);\n\n // This is used as a fallback wh en getting the descriptor fails in\n // installProperty.\n var dummyDescriptor = {\n get: function() {},\n set: function(v) {},\n configurable: true, \n enumerable: true\n };\n\n function isEventHandlerName(name) {\n retur n /^on[a-z]+$/.test(name);\n }\n\n function isIdentifierName(name) {\n retu rn /^\\w[a-zA-Z_0-9]*$/.test(name);\n }\n\n function getGetter(name) {\n re turn hasEval && isIdentifierName(name) ?\n new Function('return this.impl .' + name) :\n function() { return this.impl[name]; };\n }\n\n function getSetter(name) {\n return hasEval && isIdentifierName(name) ?\n new Function('v', 'this.impl.' + name + ' = v') :\n function(v) { this.impl[n ame] = v; };\n }\n\n function getMethod(name) {\n return hasEval && isIdent ifierName(name) ?\n new Function('return this.impl.' + name +\n '.apply(this.impl, arguments)') :\n function() { return this.i mpl[name].apply(this.impl, arguments); };\n }\n\n function getDescriptor(sourc e, name) {\n try {\n return Object.getOwnPropertyDescriptor(source, name );\n } catch (ex) {\n // JSC and V8 both use data properties instead of accessors which can\n // cause getting the property desciptor to throw an e xception.\n // https://bugs.webkit.org/show_bug.cgi?id=49739\n return dummyDescriptor;\n }\n }\n\n function installProperty(source, target, allow Method, opt_blacklist) {\n var names = getOwnPropertyNames(source);\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n if (name === 'polymerBlackList_')\n continue;\n\n if (name in target)\n continue;\n\n if (source.polymerBlackList_ && source.polymerBlackList_[n ame])\n continue;\n\n if (isFirefox) {\n // Tickle Firefox's old bindings.\n source.__lookupGetter__(name);\n }\n var descri ptor = getDescriptor(source, name);\n var getter, setter;\n if (allowM ethod && typeof descriptor.value === 'function') {\n target[name] = getMe thod(name);\n continue;\n }\n\n var isEvent = isEventHandlerNam e(name);\n if (isEvent)\n getter = scope.getEventHandlerGetter(name) ;\n else\n getter = getGetter(name);\n\n if (descriptor.writabl e || descriptor.set) {\n if (isEvent)\n setter = scope.getEventH andlerSetter(name);\n else\n setter = getSetter(name);\n }\ n\n defineProperty(target, name, {\n get: getter,\n set: sett er,\n configurable: descriptor.configurable,\n enumerable: descrip tor.enumerable\n });\n }\n }\n\n /**\n * @param {Function} nativeCon structor\n * @param {Function} wrapperConstructor\n * @param {Object=} opt_i nstance If present, this is used to extract\n * properties from an instanc e object.\n */\n function register(nativeConstructor, wrapperConstructor, opt _instance) {\n var nativePrototype = nativeConstructor.prototype;\n regist erInternal(nativePrototype, wrapperConstructor, opt_instance);\n mixinStatics (wrapperConstructor, nativeConstructor);\n }\n\n function registerInternal(nat ivePrototype, wrapperConstructor, opt_instance) {\n var wrapperPrototype = wr apperConstructor.prototype;\n assert(constructorTable.get(nativePrototype) == = undefined);\n\n constructorTable.set(nativePrototype, wrapperConstructor);\ n nativePrototypeTable.set(wrapperPrototype, nativePrototype);\n\n addForw ardingProperties(nativePrototype, wrapperPrototype);\n if (opt_instance)\n registerInstanceProperties(wrapperPrototype, opt_instance);\n defineProper ty(wrapperPrototype, 'constructor', {\n value: wrapperConstructor,\n c onfigurable: true,\n enumerable: false,\n writable: true\n });\n } \n\n function isWrapperFor(wrapperConstructor, nativeConstructor) {\n return constructorTable.get(nativeConstructor.prototype) ===\n wrapperConstruct or;\n }\n\n /**\n * Creates a generic wrapper constructor based on |object| and its\n * constructor.\n * @param {Node} object\n * @return {Function} T he generated constructor.\n */\n function registerObject(object) {\n var n ativePrototype = Object.getPrototypeOf(object);\n\n var superWrapperConstruct or = getWrapperConstructor(nativePrototype);\n var GeneratedWrapper = createW rapperConstructor(superWrapperConstructor);\n registerInternal(nativePrototyp e, GeneratedWrapper, object);\n\n return GeneratedWrapper;\n }\n\n function createWrapperConstructor(superWrapperConstructor) {\n function GeneratedWrap per(node) {\n superWrapperConstructor.call(this, node);\n }\n Generat edWrapper.prototype =\n Object.create(superWrapperConstructor.prototype); \n GeneratedWrapper.prototype.constructor = GeneratedWrapper;\n\n return G eneratedWrapper;\n }\n\n var OriginalDOMImplementation = window.DOMImplementat ion;\n var OriginalEventTarget = window.EventTarget;\n var OriginalEvent = win dow.Event;\n var OriginalNode = window.Node;\n var OriginalWindow = window.Win dow;\n var OriginalRange = window.Range;\n var OriginalCanvasRenderingContext2 D = window.CanvasRenderingContext2D;\n var OriginalWebGLRenderingContext = wind ow.WebGLRenderingContext;\n var OriginalSVGElementInstance = window.SVGElementI nstance;\n\n function isWrapper(object) {\n return object instanceof wrapper s.EventTarget ||\n object instanceof wrappers.Event ||\n obj ect instanceof wrappers.Range ||\n object instanceof wrappers.DOMImple mentation ||\n object instanceof wrappers.CanvasRenderingContext2D ||\ n wrappers.WebGLRenderingContext &&\n object instanceof wrappers.WebGLRenderingContext;\n }\n\n function isNative(object) {\n retur n OriginalEventTarget && object instanceof OriginalEventTarget ||\n ob ject instanceof OriginalNode ||\n object instanceof OriginalEvent ||\n object instanceof OriginalWindow ||\n object instanceof Ori ginalRange ||\n object instanceof OriginalDOMImplementation ||\n object instanceof OriginalCanvasRenderingContext2D ||\n OriginalW ebGLRenderingContext &&\n object instanceof OriginalWebGLRendering Context ||\n OriginalSVGElementInstance &&\n object inst anceof OriginalSVGElementInstance;\n }\n\n /**\n * Wraps a node in a Wrapper Node. If there already exists a wrapper for the\n * |node| that wrapper is ret urned instead.\n * @param {Node} node\n * @return {WrapperNode}\n */\n fu nction wrap(impl) {\n if (impl === null)\n return null;\n\n assert(is Native(impl));\n return impl.polymerWrapper_ ||\n (impl.polymerWrapper _ = new (getWrapperConstructor(impl))(impl));\n }\n\n /**\n * Unwraps a wrap per and returns the node it is wrapping.\n * @param {WrapperNode} wrapper\n * @return {Node}\n */\n function unwrap(wrapper) {\n if (wrapper === null) \n return null;\n assert(isWrapper(wrapper));\n return wrapper.impl;\ n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @param {Object} obj ect\n * @return {Object} The native implementation object.\n */\n function unwrapIfNeeded(object) {\n return object && isWrapper(object) ? unwrap(object ) : object;\n }\n\n /**\n * Wraps object if it is not a wrapper.\n * @para m {Object} object\n * @return {Object} The wrapper for object.\n */\n funct ion wrapIfNeeded(object) {\n return object && !isWrapper(object) ? wrap(objec t) : object;\n }\n\n /**\n * Overrides the current wrapper (if any) for node .\n * @param {Node} node\n * @param {WrapperNode=} wrapper If left out the w rapper will be created as\n * needed next time someone wraps the node.\n */\n function rewrap(node, wrapper) {\n if (wrapper === null)\n return ;\n assert(isNative(node));\n assert(wrapper === undefined || isWrapper(wr apper));\n node.polymerWrapper_ = wrapper;\n }\n\n function defineGetter(co nstructor, name, getter) {\n defineProperty(constructor.prototype, name, {\n get: getter,\n configurable: true,\n enumerable: true\n });\n }\n\n function defineWrapGetter(constructor, name) {\n defineGetter(constru ctor, name, function() {\n return wrap(this.impl[name]);\n });\n }\n\n /**\n * Forwards existing methods on the native object to the wrapper methods .\n * This does not wrap any of the arguments or the return value since the\n * wrapper implementation already takes care of that.\n * @param {Array.<Func tion>} constructors\n * @parem {Array.<string>} names\n */\n function forwa rdMethodsToWrapper(constructors, names) {\n constructors.forEach(function(con structor) {\n names.forEach(function(name) {\n constructor.prototype [name] = function() {\n var w = wrapIfNeeded(this);\n return w [name].apply(w, arguments);\n };\n });\n });\n }\n\n scope.asse rt = assert;\n scope.constructorTable = constructorTable;\n scope.defineGetter = defineGetter;\n scope.defineWrapGetter = defineWrapGetter;\n scope.forwardM ethodsToWrapper = forwardMethodsToWrapper;\n scope.isWrapper = isWrapper;\n sc ope.isWrapperFor = isWrapperFor;\n scope.mixin = mixin;\n scope.nativePrototyp eTable = nativePrototypeTable;\n scope.oneOf = oneOf;\n scope.registerObject = registerObject;\n scope.registerWrapper = register;\n scope.rewrap = rewrap;\ n scope.unwrap = unwrap;\n scope.unwrapIfNeeded = unwrapIfNeeded;\n scope.wra p = wrap;\n scope.wrapIfNeeded = wrapIfNeeded;\n scope.wrappers = wrappers;\n\ n})(window.ShadowDOMPolyfill);\n", 111 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\nwindow.ShadowDOMPolyfill = {};\n\n(function(scope) {\n 'use stri ct';\n\n var constructorTable = new WeakMap();\n var nativePrototypeTable = ne w WeakMap();\n var wrappers = Object.create(null);\n\n // Don't test for eval if document has CSP securityPolicy object and we can\n // see that eval is not supported. This avoids an error message in console\n // even when the exception is caught\n var hasEval = !('securityPolicy' in document) ||\n document.s ecurityPolicy.allowsEval;\n if (hasEval) {\n try {\n var f = new Functi on('', 'return true;');\n hasEval = f();\n } catch (ex) {\n hasEval = false;\n }\n }\n\n function assert(b) {\n if (!b)\n throw new Er ror('Assertion failed');\n };\n\n var defineProperty = Object.defineProperty;\ n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertyDe scriptor = Object.getOwnPropertyDescriptor;\n\n function mixin(to, from) {\n getOwnPropertyNames(from).forEach(function(name) {\n defineProperty(to, na me, getOwnPropertyDescriptor(from, name));\n });\n return to;\n };\n\n f unction mixinStatics(to, from) {\n getOwnPropertyNames(from).forEach(function (name) {\n switch (name) {\n case 'arguments':\n case 'caller ':\n case 'length':\n case 'name':\n case 'prototype':\n case 'toString':\n return;\n }\n defineProperty(to, name , getOwnPropertyDescriptor(from, name));\n });\n return to;\n };\n\n fun ction oneOf(object, propertyNames) {\n for (var i = 0; i < propertyNames.leng th; i++) {\n if (propertyNames[i] in object)\n return propertyNames[ i];\n }\n }\n\n // Mozilla's old DOM bindings are bretty busted:\n // http s://bugzilla.mozilla.org/show_bug.cgi?id=855844\n // Make sure they are create before we start modifying things.\n getOwnPropertyNames(window);\n\n function getWrapperConstructor(node) {\n var nativePrototype = node.__proto__ || Objec t.getPrototypeOf(node);\n var wrapperConstructor = constructorTable.get(nativ ePrototype);\n if (wrapperConstructor)\n return wrapperConstructor;\n\n var parentWrapperConstructor = getWrapperConstructor(nativePrototype);\n\n var GeneratedWrapper = createWrapperConstructor(parentWrapperConstructor);\n registerInternal(nativePrototype, GeneratedWrapper, node);\n\n return Genera tedWrapper;\n }\n\n function addForwardingProperties(nativePrototype, wrapperP rototype) {\n installProperty(nativePrototype, wrapperPrototype, true);\n }\ n\n function registerInstanceProperties(wrapperPrototype, instanceObject) {\n installProperty(instanceObject, wrapperPrototype, false);\n }\n\n var isFire fox = /Firefox/.test(navigator.userAgent);\n\n // This is used as a fallback wh en getting the descriptor fails in\n // installProperty.\n var dummyDescriptor = {\n get: function() {},\n set: function(v) {},\n configurable: true, \n enumerable: true\n };\n\n function isEventHandlerName(name) {\n retur n /^on[a-z]+$/.test(name);\n }\n\n function isIdentifierName(name) {\n retu rn /^\\w[a-zA-Z_0-9]*$/.test(name);\n }\n\n function getGetter(name) {\n re turn hasEval && isIdentifierName(name) ?\n new Function('return this.impl .' + name) :\n function() { return this.impl[name]; };\n }\n\n function getSetter(name) {\n return hasEval && isIdentifierName(name) ?\n new Function('v', 'this.impl.' + name + ' = v') :\n function(v) { this.impl[n ame] = v; };\n }\n\n function getMethod(name) {\n return hasEval && isIdent ifierName(name) ?\n new Function('return this.impl.' + name +\n '.apply(this.impl, arguments)') :\n function() { return this.i mpl[name].apply(this.impl, arguments); };\n }\n\n function getDescriptor(sourc e, name) {\n try {\n return Object.getOwnPropertyDescriptor(source, name );\n } catch (ex) {\n // JSC and V8 both use data properties instead of accessors which can\n // cause getting the property desciptor to throw an e xception.\n // https://bugs.webkit.org/show_bug.cgi?id=49739\n return dummyDescriptor;\n }\n }\n\n function installProperty(source, target, allow Method, opt_blacklist) {\n var names = getOwnPropertyNames(source);\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n if (name === 'polymerBlackList_')\n continue;\n\n if (name in target)\n continue;\n\n if (source.polymerBlackList_ && source.polymerBlackList_[n ame])\n continue;\n\n if (isFirefox) {\n // Tickle Firefox's old bindings.\n source.__lookupGetter__(name);\n }\n var descri ptor = getDescriptor(source, name);\n var getter, setter;\n if (allowM ethod && typeof descriptor.value === 'function') {\n target[name] = getMe thod(name);\n continue;\n }\n\n var isEvent = isEventHandlerNam e(name);\n if (isEvent)\n getter = scope.getEventHandlerGetter(name) ;\n else\n getter = getGetter(name);\n\n if (descriptor.writabl e || descriptor.set) {\n if (isEvent)\n setter = scope.getEventH andlerSetter(name);\n else\n setter = getSetter(name);\n }\ n\n defineProperty(target, name, {\n get: getter,\n set: sett er,\n configurable: descriptor.configurable,\n enumerable: descrip tor.enumerable\n });\n }\n }\n\n /**\n * @param {Function} nativeCon structor\n * @param {Function} wrapperConstructor\n * @param {Object=} opt_i nstance If present, this is used to extract\n * properties from an instanc e object.\n */\n function register(nativeConstructor, wrapperConstructor, opt _instance) {\n var nativePrototype = nativeConstructor.prototype;\n regist erInternal(nativePrototype, wrapperConstructor, opt_instance);\n mixinStatics (wrapperConstructor, nativeConstructor);\n }\n\n function registerInternal(nat ivePrototype, wrapperConstructor, opt_instance) {\n var wrapperPrototype = wr apperConstructor.prototype;\n assert(constructorTable.get(nativePrototype) == = undefined);\n\n constructorTable.set(nativePrototype, wrapperConstructor);\ n nativePrototypeTable.set(wrapperPrototype, nativePrototype);\n\n addForw ardingProperties(nativePrototype, wrapperPrototype);\n if (opt_instance)\n registerInstanceProperties(wrapperPrototype, opt_instance);\n defineProper ty(wrapperPrototype, 'constructor', {\n value: wrapperConstructor,\n c onfigurable: true,\n enumerable: false,\n writable: true\n });\n // Set it again. Some VMs optimizes objects that are used as prototypes.\n w rapperConstructor.prototype = wrapperPrototype;\n }\n\n function isWrapperFor( wrapperConstructor, nativeConstructor) {\n return constructorTable.get(native Constructor.prototype) ===\n wrapperConstructor;\n }\n\n /**\n * Crea tes a generic wrapper constructor based on |object| and its\n * constructor.\n * @param {Node} object\n * @return {Function} The generated constructor.\n */\n function registerObject(object) {\n var nativePrototype = Object.getP rototypeOf(object);\n\n var superWrapperConstructor = getWrapperConstructor(n ativePrototype);\n var GeneratedWrapper = createWrapperConstructor(superWrapp erConstructor);\n registerInternal(nativePrototype, GeneratedWrapper, object) ;\n\n return GeneratedWrapper;\n }\n\n function createWrapperConstructor(su perWrapperConstructor) {\n function GeneratedWrapper(node) {\n superWrap perConstructor.call(this, node);\n }\n var p = Object.create(superWrapperC onstructor.prototype);\n p.constructor = GeneratedWrapper;\n GeneratedWrap per.prototype = p;\n\n return GeneratedWrapper;\n }\n\n var OriginalDOMImpl ementation = window.DOMImplementation;\n var OriginalEventTarget = window.Event Target;\n var OriginalEvent = window.Event;\n var OriginalNode = window.Node;\ n var OriginalWindow = window.Window;\n var OriginalRange = window.Range;\n v ar OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n var Or iginalWebGLRenderingContext = window.WebGLRenderingContext;\n var OriginalSVGEl ementInstance = window.SVGElementInstance;\n\n function isWrapper(object) {\n return object instanceof wrappers.EventTarget ||\n object instanceof wrappers.Event ||\n object instanceof wrappers.Range ||\n o bject instanceof wrappers.DOMImplementation ||\n object instanceof wra ppers.CanvasRenderingContext2D ||\n wrappers.WebGLRenderingContext &&\ n object instanceof wrappers.WebGLRenderingContext;\n }\n\n func tion isNative(object) {\n return OriginalEventTarget && object instanceof Ori ginalEventTarget ||\n object instanceof OriginalNode ||\n ob ject instanceof OriginalEvent ||\n object instanceof OriginalWindow || \n object instanceof OriginalRange ||\n object instanceof Or iginalDOMImplementation ||\n object instanceof OriginalCanvasRendering Context2D ||\n OriginalWebGLRenderingContext &&\n object instanceof OriginalWebGLRenderingContext ||\n OriginalSVGElementInsta nce &&\n object instanceof OriginalSVGElementInstance;\n }\n\n / **\n * Wraps a node in a WrapperNode. If there already exists a wrapper for th e\n * |node| that wrapper is returned instead.\n * @param {Node} node\n * @return {WrapperNode}\n */\n function wrap(impl) {\n if (impl === null)\n return null;\n\n assert(isNative(impl));\n return impl.polymerWrapper _ ||\n (impl.polymerWrapper_ = new (getWrapperConstructor(impl))(impl));\ n }\n\n /**\n * Unwraps a wrapper and returns the node it is wrapping.\n * @param {WrapperNode} wrapper\n * @return {Node}\n */\n function unwrap(wra pper) {\n if (wrapper === null)\n return null;\n assert(isWrapper(wra pper));\n return wrapper.impl;\n }\n\n /**\n * Unwraps object if it is a wrapper.\n * @param {Object} object\n * @return {Object} The native implemen tation object.\n */\n function unwrapIfNeeded(object) {\n return object && isWrapper(object) ? unwrap(object) : object;\n }\n\n /**\n * Wraps object i f it is not a wrapper.\n * @param {Object} object\n * @return {Object} The w rapper for object.\n */\n function wrapIfNeeded(object) {\n return object && !isWrapper(object) ? wrap(object) : object;\n }\n\n /**\n * Overrides the current wrapper (if any) for node.\n * @param {Node} node\n * @param {Wrapp erNode=} wrapper If left out the wrapper will be created as\n * needed nex t time someone wraps the node.\n */\n function rewrap(node, wrapper) {\n i f (wrapper === null)\n return;\n assert(isNative(node));\n assert(wra pper === undefined || isWrapper(wrapper));\n node.polymerWrapper_ = wrapper;\ n }\n\n function defineGetter(constructor, name, getter) {\n defineProperty (constructor.prototype, name, {\n get: getter,\n configurable: true,\n enumerable: true\n });\n }\n\n function defineWrapGetter(constructor, name) {\n defineGetter(constructor, name, function() {\n return wrap(th is.impl[name]);\n });\n }\n\n /**\n * Forwards existing methods on the na tive object to the wrapper methods.\n * This does not wrap any of the argument s or the return value since the\n * wrapper implementation already takes care of that.\n * @param {Array.<Function>} constructors\n * @parem {Array.<strin g>} names\n */\n function forwardMethodsToWrapper(constructors, names) {\n constructors.forEach(function(constructor) {\n names.forEach(function(name ) {\n constructor.prototype[name] = function() {\n var w = wrapI fNeeded(this);\n return w[name].apply(w, arguments);\n };\n });\n });\n }\n\n scope.assert = assert;\n scope.constructorTable = const ructorTable;\n scope.defineGetter = defineGetter;\n scope.defineWrapGetter = d efineWrapGetter;\n scope.forwardMethodsToWrapper = forwardMethodsToWrapper;\n scope.isWrapper = isWrapper;\n scope.isWrapperFor = isWrapperFor;\n scope.mixi n = mixin;\n scope.nativePrototypeTable = nativePrototypeTable;\n scope.oneOf = oneOf;\n scope.registerObject = registerObject;\n scope.registerWrapper = re gister;\n scope.rewrap = rewrap;\n scope.unwrap = unwrap;\n scope.unwrapIfNee ded = unwrapIfNeeded;\n scope.wrap = wrap;\n scope.wrapIfNeeded = wrapIfNeeded ;\n scope.wrappers = wrappers;\n\n})(window.ShadowDOMPolyfill);\n",
110 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(context) {\n 'use strict';\n\n var OriginalM utationObserver = window.MutationObserver;\n var callbacks = [];\n var pending = false;\n var timerFunc;\n\n function handle() {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks = [];\n for (var i = 0; i < c opies.length; i++) {\n (0, copies[i])();\n }\n }\n\n if (OriginalMutat ionObserver) {\n var counter = 1;\n var observer = new OriginalMutationObs erver(handle);\n var textNode = document.createTextNode(counter);\n observ er.observe(textNode, {characterData: true});\n\n timerFunc = function() {\n counter = (counter + 1) % 2;\n textNode.data = counter;\n };\n\n } else {\n timerFunc = window.setImmediate || window.setTimeout;\n }\n\n func tion setEndOfMicrotask(func) {\n callbacks.push(func);\n if (pending)\n return;\n pending = true;\n timerFunc(handle, 0);\n }\n\n context.set EndOfMicrotask = setEndOfMicrotask;\n\n})(window.ShadowDOMPolyfill);\n", 112 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(context) {\n 'use strict';\n\n var OriginalM utationObserver = window.MutationObserver;\n var callbacks = [];\n var pending = false;\n var timerFunc;\n\n function handle() {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks = [];\n for (var i = 0; i < c opies.length; i++) {\n (0, copies[i])();\n }\n }\n\n if (OriginalMutat ionObserver) {\n var counter = 1;\n var observer = new OriginalMutationObs erver(handle);\n var textNode = document.createTextNode(counter);\n observ er.observe(textNode, {characterData: true});\n\n timerFunc = function() {\n counter = (counter + 1) % 2;\n textNode.data = counter;\n };\n\n } else {\n timerFunc = window.setImmediate || window.setTimeout;\n }\n\n func tion setEndOfMicrotask(func) {\n callbacks.push(func);\n if (pending)\n return;\n pending = true;\n timerFunc(handle, 0);\n }\n\n context.set EndOfMicrotask = setEndOfMicrotask;\n\n})(window.ShadowDOMPolyfill);\n",
111 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var setEndOfMic rotask = scope.setEndOfMicrotask\n var wrapIfNeeded = scope.wrapIfNeeded\n var wrappers = scope.wrappers;\n\n var registrationsTable = new WeakMap();\n var globalMutationObservers = [];\n var isScheduled = false;\n\n function schedule Callback(observer) {\n if (isScheduled)\n return;\n setEndOfMicrotask (notifyObservers);\n isScheduled = true;\n }\n\n // http://dom.spec.whatwg. org/#mutation-observers\n function notifyObservers() {\n isScheduled = false ;\n\n do {\n var notifyList = globalMutationObservers.slice();\n va r anyNonEmpty = false;\n for (var i = 0; i < notifyList.length; i++) {\n var mo = notifyList[i];\n var queue = mo.takeRecords();\n rem oveTransientObserversFor(mo);\n if (queue.length) {\n mo.callbac k_(queue, mo);\n anyNonEmpty = true;\n }\n }\n } while ( anyNonEmpty);\n }\n\n /**\n * @param {string} type\n * @param {Node} targe t\n * @constructor\n */\n function MutationRecord(type, target) {\n this .type = type;\n this.target = target;\n this.addedNodes = new wrappers.Nod eList();\n this.removedNodes = new wrappers.NodeList();\n this.previousSib ling = null;\n this.nextSibling = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n /**\n * R egisters transient observers to ancestor and its ancesors for the node\n * whi ch was removed.\n * @param {!Node} ancestor\n * @param {!Node} node\n */\n function registerTransientObservers(ancestor, node) {\n for (; ancestor; an cestor = ancestor.parentNode) {\n var registrations = registrationsTable.ge t(ancestor);\n if (!registrations)\n continue;\n for (var i = 0 ; i < registrations.length; i++) {\n var registration = registrations[i]; \n if (registration.options.subtree)\n registration.addTransient Observer(node);\n }\n }\n }\n\n function removeTransientObserversFor(o bserver) {\n for (var i = 0; i < observer.nodes_.length; i++) {\n var no de = observer.nodes_[i];\n var registrations = registrationsTable.get(node) ;\n if (!registrations)\n return;\n for (var j = 0; j < registr ations.length; j++) {\n var registration = registrations[j];\n if (registration.observer === observer)\n registration.removeTransientObse rvers();\n }\n }\n }\n\n // http://dom.spec.whatwg.org/#queue-a-mutati on-record\n function enqueueMutation(target, type, data) {\n // 1.\n var interestedObservers = Object.create(null);\n var associatedStrings = Object.c reate(null);\n\n // 2.\n for (var node = target; node; node = node.parentN ode) {\n // 3.\n var registrations = registrationsTable.get(node);\n if (!registrations)\n continue;\n for (var j = 0; j < registrati ons.length; j++) {\n var registration = registrations[j];\n var op tions = registration.options;\n // 1.\n if (node !== target && !op tions.subtree)\n continue;\n\n // 2.\n if (type === 'attr ibutes' && !options.attributes)\n continue;\n\n // 3. If type is \"attributes\", options's attributeFilter is present, and\n // either op tions's attributeFilter does not contain name or namespace\n // is non-nu ll, continue.\n if (type === 'attributes' && options.attributeFilter &&\n (data.namespace !== null ||\n options.attributeFilter.in dexOf(data.name) === -1)) {\n continue;\n }\n\n // 4.\n if (type === 'characterData' && !options.characterData)\n continu e;\n\n // 5.\n if (type === 'childList' && !options.childList)\n continue;\n\n // 6.\n var observer = registration.observer ;\n interestedObservers[observer.uid_] = observer;\n\n // 7. If ei ther type is \"attributes\" and options's attributeOldValue is\n // true, or type is \"characterData\" and options's characterDataOldValue\n // is true, set the paired string of registered observer's observer in\n // in terested observers to oldValue.\n if (type === 'attributes' && options.at tributeOldValue ||\n type === 'characterData' && options.characterDat aOldValue) {\n associatedStrings[observer.uid_] = data.oldValue;\n }\n }\n }\n\n var anyRecordsEnqueued = false;\n\n // 4.\n fo r (var uid in interestedObservers) {\n var observer = interestedObservers[u id];\n var record = new MutationRecord(type, target);\n\n // 2.\n if ('name' in data && 'namespace' in data) {\n record.attributeName = da ta.name;\n record.attributeNamespace = data.namespace;\n }\n\n // 3.\n if (data.addedNodes)\n record.addedNodes = data.addedNodes;\ n\n // 4.\n if (data.removedNodes)\n record.removedNodes = data .removedNodes;\n\n // 5.\n if (data.previousSibling)\n record.p reviousSibling = data.previousSibling;\n\n // 6.\n if (data.nextSiblin g)\n record.nextSibling = data.nextSibling;\n\n // 7.\n if (ass ociatedStrings[uid] !== undefined)\n record.oldValue = associatedStrings[ uid];\n\n // 8.\n observer.records_.push(record);\n\n anyRecordsE nqueued = true;\n }\n\n if (anyRecordsEnqueued)\n scheduleCallback(); \n }\n\n var slice = Array.prototype.slice;\n\n /**\n * @param {!Object} op tions\n * @constructor\n */\n function MutationObserverOptions(options) {\n this.childList = !!options.childList;\n this.subtree = !!options.subtree; \n\n // 1. If either options' attributeOldValue or attributeFilter is present \n // and options' attributes is omitted, set options' attributes to true.\n if (!('attributes' in options) &&\n ('attributeOldValue' in options || 'attributeFilter' in options)) {\n this.attributes = true;\n } else {\n this.attributes = !!options.attributes;\n }\n\n // 2. If options' ch aracterDataOldValue is present and options'\n // characterData is omitted, se t options' characterData to true.\n if ('characterDataOldValue' in options && !('characterData' in options))\n this.characterData = true;\n else\n this.characterData = !!options.characterData;\n\n // 3. & 4.\n if (!thi s.attributes &&\n (options.attributeOldValue || 'attributeFilter' in opti ons) ||\n // 5.\n !this.characterData && options.characterDataOldV alue) {\n throw new TypeError();\n }\n\n this.characterData = !!optio ns.characterData;\n this.attributeOldValue = !!options.attributeOldValue;\n this.characterDataOldValue = !!options.characterDataOldValue;\n if ('attrib uteFilter' in options) {\n if (options.attributeFilter == null ||\n typeof options.attributeFilter !== 'object') {\n throw new TypeError(); \n }\n this.attributeFilter = slice.call(options.attributeFilter);\n } else {\n this.attributeFilter = null;\n }\n }\n\n var uidCounter = 0;\n\n /**\n * The class that maps to the DOM MutationObserver interface.\n * @param {Function} callback.\n * @constructor\n */\n function MutationOb server(callback) {\n this.callback_ = callback;\n this.nodes_ = [];\n t his.records_ = [];\n this.uid_ = ++uidCounter;\n\n // This will leak. Ther e is no way to implement this without WeakRefs :'(\n globalMutationObservers. push(this);\n }\n\n MutationObserver.prototype = {\n // http://dom.spec.wha twg.org/#dom-mutationobserver-observe\n observe: function(target, options) {\ n target = wrapIfNeeded(target);\n\n var newOptions = new MutationObse rverOptions(options);\n\n // 6.\n var registration;\n var registr ations = registrationsTable.get(target);\n if (!registrations)\n reg istrationsTable.set(target, registrations = []);\n\n for (var i = 0; i < re gistrations.length; i++) {\n if (registrations[i].observer === this) {\n registration = registrations[i];\n // 6.1.\n registra tion.removeTransientObservers();\n // 6.2.\n registration.opti ons = newOptions;\n }\n }\n\n // 7.\n if (!registration) { \n registration = new Registration(this, target, newOptions);\n re gistrations.push(registration);\n this.nodes_.push(target);\n }\n },\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-disconnect\n d isconnect: function() {\n this.nodes_.forEach(function(node) {\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < regi strations.length; i++) {\n var registration = registrations[i];\n if (registration.observer === this) {\n registrations.splice(i, 1 );\n // Each node can only have one registered observer associated wi th\n // this observer.\n break;\n }\n }\n }, this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n var copyOfRecords = this.records_;\n this.records_ = [];\n r eturn copyOfRecords;\n }\n };\n\n /**\n * Class used to represent a regis tered observer.\n * @param {MutationObserver} observer\n * @param {Node} tar get\n * @param {MutationObserverOptions} options\n * @constructor\n */\n function Registration(observer, target, options) {\n this.observer = observer ;\n this.target = target;\n this.options = options;\n this.transientObs ervedNodes = [];\n }\n\n Registration.prototype = {\n /**\n * Adds a tr ansient observer on node. The transient observer gets removed\n * next time we deliver the change records.\n * @param {Node} node\n */\n addTrans ientObserver: function(node) {\n // Don't add transient observers on the ta rget itself. We already have all\n // the required listeners set up on the target.\n if (node === this.target)\n return;\n\n this.transien tObservedNodes.push(node);\n var registrations = registrationsTable.get(nod e);\n if (!registrations)\n registrationsTable.set(node, registratio ns = []);\n\n // We know that registrations does not contain this because w e already\n // checked if node === this.target.\n registrations.push(t his);\n },\n\n removeTransientObservers: function() {\n var transient ObservedNodes = this.transientObservedNodes;\n this.transientObservedNodes = [];\n\n for (var i = 0; i < transientObservedNodes.length; i++) {\n var node = transientObservedNodes[i];\n var registrations = registratio nsTable.get(node);\n for (var j = 0; j < registrations.length; j++) {\n if (registrations[j] === this) {\n registrations.splice(j, 1) ;\n // Each node can only have one registered observer associated wit h\n // this observer.\n break;\n }\n }\n }\n }\n };\n\n scope.enqueueMutation = enqueueMutation;\n scope.regist erTransientObservers = registerTransientObservers;\n scope.wrappers.MutationObs erver = MutationObserver;\n scope.wrappers.MutationRecord = MutationRecord;\n\n })(window.ShadowDOMPolyfill);\n", 113 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var setEndOfMic rotask = scope.setEndOfMicrotask\n var wrapIfNeeded = scope.wrapIfNeeded\n var wrappers = scope.wrappers;\n\n var registrationsTable = new WeakMap();\n var globalMutationObservers = [];\n var isScheduled = false;\n\n function schedule Callback(observer) {\n if (isScheduled)\n return;\n setEndOfMicrotask (notifyObservers);\n isScheduled = true;\n }\n\n // http://dom.spec.whatwg. org/#mutation-observers\n function notifyObservers() {\n isScheduled = false ;\n\n do {\n var notifyList = globalMutationObservers.slice();\n va r anyNonEmpty = false;\n for (var i = 0; i < notifyList.length; i++) {\n var mo = notifyList[i];\n var queue = mo.takeRecords();\n rem oveTransientObserversFor(mo);\n if (queue.length) {\n mo.callbac k_(queue, mo);\n anyNonEmpty = true;\n }\n }\n } while ( anyNonEmpty);\n }\n\n /**\n * @param {string} type\n * @param {Node} targe t\n * @constructor\n */\n function MutationRecord(type, target) {\n this .type = type;\n this.target = target;\n this.addedNodes = new wrappers.Nod eList();\n this.removedNodes = new wrappers.NodeList();\n this.previousSib ling = null;\n this.nextSibling = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n /**\n * R egisters transient observers to ancestor and its ancesors for the node\n * whi ch was removed.\n * @param {!Node} ancestor\n * @param {!Node} node\n */\n function registerTransientObservers(ancestor, node) {\n for (; ancestor; an cestor = ancestor.parentNode) {\n var registrations = registrationsTable.ge t(ancestor);\n if (!registrations)\n continue;\n for (var i = 0 ; i < registrations.length; i++) {\n var registration = registrations[i]; \n if (registration.options.subtree)\n registration.addTransient Observer(node);\n }\n }\n }\n\n function removeTransientObserversFor(o bserver) {\n for (var i = 0; i < observer.nodes_.length; i++) {\n var no de = observer.nodes_[i];\n var registrations = registrationsTable.get(node) ;\n if (!registrations)\n return;\n for (var j = 0; j < registr ations.length; j++) {\n var registration = registrations[j];\n if (registration.observer === observer)\n registration.removeTransientObse rvers();\n }\n }\n }\n\n // http://dom.spec.whatwg.org/#queue-a-mutati on-record\n function enqueueMutation(target, type, data) {\n // 1.\n var interestedObservers = Object.create(null);\n var associatedStrings = Object.c reate(null);\n\n // 2.\n for (var node = target; node; node = node.parentN ode) {\n // 3.\n var registrations = registrationsTable.get(node);\n if (!registrations)\n continue;\n for (var j = 0; j < registrati ons.length; j++) {\n var registration = registrations[j];\n var op tions = registration.options;\n // 1.\n if (node !== target && !op tions.subtree)\n continue;\n\n // 2.\n if (type === 'attr ibutes' && !options.attributes)\n continue;\n\n // 3. If type is \"attributes\", options's attributeFilter is present, and\n // either op tions's attributeFilter does not contain name or namespace\n // is non-nu ll, continue.\n if (type === 'attributes' && options.attributeFilter &&\n (data.namespace !== null ||\n options.attributeFilter.in dexOf(data.name) === -1)) {\n continue;\n }\n\n // 4.\n if (type === 'characterData' && !options.characterData)\n continu e;\n\n // 5.\n if (type === 'childList' && !options.childList)\n continue;\n\n // 6.\n var observer = registration.observer ;\n interestedObservers[observer.uid_] = observer;\n\n // 7. If ei ther type is \"attributes\" and options's attributeOldValue is\n // true, or type is \"characterData\" and options's characterDataOldValue\n // is true, set the paired string of registered observer's observer in\n // in terested observers to oldValue.\n if (type === 'attributes' && options.at tributeOldValue ||\n type === 'characterData' && options.characterDat aOldValue) {\n associatedStrings[observer.uid_] = data.oldValue;\n }\n }\n }\n\n var anyRecordsEnqueued = false;\n\n // 4.\n fo r (var uid in interestedObservers) {\n var observer = interestedObservers[u id];\n var record = new MutationRecord(type, target);\n\n // 2.\n if ('name' in data && 'namespace' in data) {\n record.attributeName = da ta.name;\n record.attributeNamespace = data.namespace;\n }\n\n // 3.\n if (data.addedNodes)\n record.addedNodes = data.addedNodes;\ n\n // 4.\n if (data.removedNodes)\n record.removedNodes = data .removedNodes;\n\n // 5.\n if (data.previousSibling)\n record.p reviousSibling = data.previousSibling;\n\n // 6.\n if (data.nextSiblin g)\n record.nextSibling = data.nextSibling;\n\n // 7.\n if (ass ociatedStrings[uid] !== undefined)\n record.oldValue = associatedStrings[ uid];\n\n // 8.\n observer.records_.push(record);\n\n anyRecordsE nqueued = true;\n }\n\n if (anyRecordsEnqueued)\n scheduleCallback(); \n }\n\n var slice = Array.prototype.slice;\n\n /**\n * @param {!Object} op tions\n * @constructor\n */\n function MutationObserverOptions(options) {\n this.childList = !!options.childList;\n this.subtree = !!options.subtree; \n\n // 1. If either options' attributeOldValue or attributeFilter is present \n // and options' attributes is omitted, set options' attributes to true.\n if (!('attributes' in options) &&\n ('attributeOldValue' in options || 'attributeFilter' in options)) {\n this.attributes = true;\n } else {\n this.attributes = !!options.attributes;\n }\n\n // 2. If options' ch aracterDataOldValue is present and options'\n // characterData is omitted, se t options' characterData to true.\n if ('characterDataOldValue' in options && !('characterData' in options))\n this.characterData = true;\n else\n this.characterData = !!options.characterData;\n\n // 3. & 4.\n if (!thi s.attributes &&\n (options.attributeOldValue || 'attributeFilter' in opti ons) ||\n // 5.\n !this.characterData && options.characterDataOldV alue) {\n throw new TypeError();\n }\n\n this.characterData = !!optio ns.characterData;\n this.attributeOldValue = !!options.attributeOldValue;\n this.characterDataOldValue = !!options.characterDataOldValue;\n if ('attrib uteFilter' in options) {\n if (options.attributeFilter == null ||\n typeof options.attributeFilter !== 'object') {\n throw new TypeError(); \n }\n this.attributeFilter = slice.call(options.attributeFilter);\n } else {\n this.attributeFilter = null;\n }\n }\n\n var uidCounter = 0;\n\n /**\n * The class that maps to the DOM MutationObserver interface.\n * @param {Function} callback.\n * @constructor\n */\n function MutationOb server(callback) {\n this.callback_ = callback;\n this.nodes_ = [];\n t his.records_ = [];\n this.uid_ = ++uidCounter;\n\n // This will leak. Ther e is no way to implement this without WeakRefs :'(\n globalMutationObservers. push(this);\n }\n\n MutationObserver.prototype = {\n // http://dom.spec.wha twg.org/#dom-mutationobserver-observe\n observe: function(target, options) {\ n target = wrapIfNeeded(target);\n\n var newOptions = new MutationObse rverOptions(options);\n\n // 6.\n var registration;\n var registr ations = registrationsTable.get(target);\n if (!registrations)\n reg istrationsTable.set(target, registrations = []);\n\n for (var i = 0; i < re gistrations.length; i++) {\n if (registrations[i].observer === this) {\n registration = registrations[i];\n // 6.1.\n registra tion.removeTransientObservers();\n // 6.2.\n registration.opti ons = newOptions;\n }\n }\n\n // 7.\n if (!registration) { \n registration = new Registration(this, target, newOptions);\n re gistrations.push(registration);\n this.nodes_.push(target);\n }\n },\n\n // http://dom.spec.whatwg.org/#dom-mutationobserver-disconnect\n d isconnect: function() {\n this.nodes_.forEach(function(node) {\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < regi strations.length; i++) {\n var registration = registrations[i];\n if (registration.observer === this) {\n registrations.splice(i, 1 );\n // Each node can only have one registered observer associated wi th\n // this observer.\n break;\n }\n }\n }, this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n var copyOfRecords = this.records_;\n this.records_ = [];\n r eturn copyOfRecords;\n }\n };\n\n /**\n * Class used to represent a regis tered observer.\n * @param {MutationObserver} observer\n * @param {Node} tar get\n * @param {MutationObserverOptions} options\n * @constructor\n */\n function Registration(observer, target, options) {\n this.observer = observer ;\n this.target = target;\n this.options = options;\n this.transientObs ervedNodes = [];\n }\n\n Registration.prototype = {\n /**\n * Adds a tr ansient observer on node. The transient observer gets removed\n * next time we deliver the change records.\n * @param {Node} node\n */\n addTrans ientObserver: function(node) {\n // Don't add transient observers on the ta rget itself. We already have all\n // the required listeners set up on the target.\n if (node === this.target)\n return;\n\n this.transien tObservedNodes.push(node);\n var registrations = registrationsTable.get(nod e);\n if (!registrations)\n registrationsTable.set(node, registratio ns = []);\n\n // We know that registrations does not contain this because w e already\n // checked if node === this.target.\n registrations.push(t his);\n },\n\n removeTransientObservers: function() {\n var transient ObservedNodes = this.transientObservedNodes;\n this.transientObservedNodes = [];\n\n for (var i = 0; i < transientObservedNodes.length; i++) {\n var node = transientObservedNodes[i];\n var registrations = registratio nsTable.get(node);\n for (var j = 0; j < registrations.length; j++) {\n if (registrations[j] === this) {\n registrations.splice(j, 1) ;\n // Each node can only have one registered observer associated wit h\n // this observer.\n break;\n }\n }\n }\n }\n };\n\n scope.enqueueMutation = enqueueMutation;\n scope.regist erTransientObservers = registerTransientObservers;\n scope.wrappers.MutationObs erver = MutationObserver;\n scope.wrappers.MutationRecord = MutationRecord;\n\n })(window.ShadowDOMPolyfill);\n",
112 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var forwardMethodsToWrap per = scope.forwardMethodsToWrapper;\n var mixin = scope.mixin;\n var register Wrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = sco pe.wrap;\n var wrappers = scope.wrappers;\n\n var wrappedFuns = new WeakMap(); \n var listenersTable = new WeakMap();\n var handledEventsTable = new WeakMap( );\n var currentlyDispatchingEvents = new WeakMap();\n var targetTable = new W eakMap();\n var currentTargetTable = new WeakMap();\n var relatedTargetTable = new WeakMap();\n var eventPhaseTable = new WeakMap();\n var stopPropagationTa ble = new WeakMap();\n var stopImmediatePropagationTable = new WeakMap();\n va r eventHandlersTable = new WeakMap();\n var eventPathTable = new WeakMap();\n\n function isShadowRoot(node) {\n return node instanceof wrappers.ShadowRoot; \n }\n\n function isInsertionPoint(node) {\n var localName = node.localName ;\n return localName === 'content' || localName === 'shadow';\n }\n\n funct ion isShadowHost(node) {\n return !!node.shadowRoot;\n }\n\n function getEv entParent(node) {\n var dv;\n return node.parentNode || (dv = node.default View) && wrap(dv) || null;\n }\n\n // https://dvcs.w3.org/hg/webcomponents/raw -file/tip/spec/shadow/index.html#dfn-adjusted-parent\n function calculateParent s(node, context, ancestors) {\n if (ancestors.length)\n return ancestors .shift();\n\n // 1.\n if (isShadowRoot(node))\n return getInsertionPa rent(node) || node.host;\n\n // 2.\n var eventParents = scope.eventParents Table.get(node);\n if (eventParents) {\n // Copy over the remaining even t parents for next iteration.\n for (var i = 1; i < eventParents.length; i+ +) {\n ancestors[i - 1] = eventParents[i];\n }\n return eventPa rents[0];\n }\n\n // 3.\n if (context && isInsertionPoint(node)) {\n var parentNode = node.parentNode;\n if (parentNode && isShadowHost(paren tNode)) {\n var trees = scope.getShadowTrees(parentNode);\n var p = getInsertionParent(context);\n for (var i = 0; i < trees.length; i++) { \n if (trees[i].contains(p))\n return p;\n }\n } \n }\n\n return getEventParent(node);\n }\n\n // https://dvcs.w3.org/hg/ webcomponents/raw-file/tip/spec/shadow/index.html#event-retargeting\n function retarget(node) {\n var stack = []; // 1.\n var ancestor = node; // 2.\n var targets = [];\n var ancestors = [];\n while (ancestor) { // 3.\n var context = null; // 3.2.\n // TODO(arv): Change order of these. If the stack is empty we always end\n // up pushing ancestor, no matter what.\ n if (isInsertionPoint(ancestor)) { // 3.1.\n context = topMostNotI nsertionPoint(stack); // 3.1.1.\n var top = stack[stack.length - 1] || a ncestor; // 3.1.2.\n stack.push(top);\n } else if (!stack.length) { \n stack.push(ancestor); // 3.3.\n }\n var target = stack[stac k.length - 1]; // 3.4.\n targets.push({target: target, currentTarget: ance stor}); // 3.5.\n if (isShadowRoot(ancestor)) // 3.6.\n stack.pop( ); // 3.6.1.\n\n ancestor = calculateParents(ancestor, context, ancestors) ; // 3.7.\n }\n return targets;\n }\n\n function topMostNotInsertionPoi nt(stack) {\n for (var i = stack.length - 1; i >= 0; i--) {\n if (!isIns ertionPoint(stack[i]))\n return stack[i];\n }\n return null;\n }\n \n // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html# dfn-adjusted-related-target\n function adjustRelatedTarget(target, related) {\n var ancestors = [];\n while (target) { // 3.\n var stack = []; // 3.1.\n var ancestor = related; // 3.2.\n var last = undefined; // 3. 3. Needs to be reset every iteration.\n while (ancestor) {\n var con text = null;\n if (!stack.length) {\n stack.push(ancestor);\n } else {\n if (isInsertionPoint(ancestor)) { // 3.4.3.\n context = topMostNotInsertionPoint(stack);\n // isDistributed is m ore general than checking whether last is\n // assigned into ancestor .\n if (isDistributed(last)) { // 3.4.3.2.\n var head = stack[stack.length - 1];\n stack.push(head);\n }\n }\n }\n\n if (inSameTree(ancestor, target)) // 3.4.4.\n return stack[stack.length - 1];\n\n if (isShadowRoot(ancestor)) // 3.4.5.\n stack.pop();\n\n last = ancestor; // 3.4.6.\n a ncestor = calculateParents(ancestor, context, ancestors); // 3.4.7.\n }\n if (isShadowRoot(target)) // 3.5.\n target = target.host;\n el se\n target = target.parentNode; // 3.6.\n }\n }\n\n function getIn sertionParent(node) {\n return scope.insertionParentTable.get(node);\n }\n\n function isDistributed(node) {\n return getInsertionParent(node);\n }\n\n function rootOfNode(node) {\n var p;\n while (p = node.parentNode) {\n node = p;\n }\n return node;\n }\n\n function inSameTree(a, b) {\n return rootOfNode(a) === rootOfNode(b);\n }\n\n function enclosedBy(a, b) {\n if (a === b)\n return true;\n if (a instanceof wrappers.ShadowRoot)\ n return enclosedBy(rootOfNode(a.host), b);\n return false;\n }\n\n\n function dispatchOriginalEvent(originalEvent) {\n // Make sure this event is only dispatched once.\n if (handledEventsTable.get(originalEvent))\n ret urn;\n handledEventsTable.set(originalEvent, true);\n\n return dispatchEve nt(wrap(originalEvent), wrap(originalEvent.target));\n }\n\n function dispatch Event(event, originalWrapperTarget) {\n if (currentlyDispatchingEvents.get(ev ent))\n throw new Error('InvalidStateError')\n currentlyDispatchingEvent s.set(event, true);\n\n // Render to ensure that the event path is correct.\n scope.renderAllPending();\n var eventPath = retarget(originalWrapperTarge t);\n\n // For window load events the load event is dispatched at the window but\n // the target is set to the document.\n //\n // http://www.whatwg .org/specs/web-apps/current-work/multipage/the-end.html#the-end\n //\n // TODO(arv): Find a less hacky way to do this.\n if (event.type === 'load' &&\n eventPath.length === 2 &&\n eventPath[0].target instanceof wrappe rs.Document) {\n eventPath.shift();\n }\n\n eventPathTable.set(event, eventPath);\n\n if (dispatchCapturing(event, eventPath)) {\n if (dispat chAtTarget(event, eventPath)) {\n dispatchBubbling(event, eventPath);\n }\n }\n\n eventPhaseTable.set(event, Event.NONE);\n currentTargetTa ble.delete(event, null);\n currentlyDispatchingEvents.delete(event);\n\n r eturn event.defaultPrevented;\n }\n\n function dispatchCapturing(event, eventP ath) {\n var phase;\n\n for (var i = eventPath.length - 1; i > 0; i--) {\n var target = eventPath[i].target;\n var currentTarget = eventPath[i]. currentTarget;\n if (target === currentTarget)\n continue;\n\n phase = Event.CAPTURING_PHASE;\n if (!invoke(eventPath[i], event, phase))\n return false;\n }\n\n return true;\n }\n\n function dispatchAtTa rget(event, eventPath) {\n var phase = Event.AT_TARGET;\n return invoke(ev entPath[0], event, phase);\n }\n\n function dispatchBubbling(event, eventPath) {\n var bubbles = event.bubbles;\n var phase;\n\n for (var i = 1; i < eventPath.length; i++) {\n var target = eventPath[i].target;\n var cur rentTarget = eventPath[i].currentTarget;\n if (target === currentTarget)\n phase = Event.AT_TARGET;\n else if (bubbles && !stopImmediatePropaga tionTable.get(event))\n phase = Event.BUBBLING_PHASE;\n else\n continue;\n\n if (!invoke(eventPath[i], event, phase))\n return;\n }\n }\n\n function invoke(tuple, event, phase) {\n var target = tuple.t arget;\n var currentTarget = tuple.currentTarget;\n\n var listeners = list enersTable.get(currentTarget);\n if (!listeners)\n return true;\n\n i f ('relatedTarget' in event) {\n var originalEvent = unwrap(event);\n // X-Tag sets relatedTarget on a CustomEvent. If they do that there is no\n // way to have relatedTarget return the adjusted target but worse is that\n // the originalEvent might not have a relatedTarget so we hit an assert\n // when we try to wrap it.\n if (originalEvent.relatedTarget) {\n v ar relatedTarget = wrap(originalEvent.relatedTarget);\n\n var adjusted = adjustRelatedTarget(currentTarget, relatedTarget);\n if (adjusted === tar get)\n return true;\n\n relatedTargetTable.set(event, adjusted); \n }\n }\n\n eventPhaseTable.set(event, phase);\n var type = event .type;\n\n var anyRemoved = false;\n targetTable.set(event, target);\n currentTargetTable.set(event, currentTarget);\n\n for (var i = 0; i < listene rs.length; i++) {\n var listener = listeners[i];\n if (listener.remove d) {\n anyRemoved = true;\n continue;\n }\n\n if (listen er.type !== type ||\n !listener.capture && phase === Event.CAPTURING_PH ASE ||\n listener.capture && phase === Event.BUBBLING_PHASE) {\n continue;\n }\n\n try {\n if (typeof listener.handler === 'fun ction')\n listener.handler.call(currentTarget, event);\n else\n listener.handler.handleEvent(event);\n\n if (stopImmediatePropag ationTable.get(event))\n return false;\n\n } catch (ex) {\n if (window.onerror)\n window.onerror(ex.message);\n else\n console.error(ex, ex.stack);\n }\n }\n\n if (anyRemoved) {\n var copy = listeners.slice();\n listeners.length = 0;\n for (var i = 0; i < copy.length; i++) {\n if (!copy[i].removed)\n listeners. push(copy[i]);\n }\n }\n\n return !stopPropagationTable.get(event);\n }\n\n function Listener(type, handler, capture) {\n this.type = type;\n this.handler = handler;\n this.capture = Boolean(capture);\n }\n Listener. prototype = {\n equals: function(that) {\n return this.handler === that. handler && this.type === that.type &&\n this.capture === that.capture;\ n },\n get removed() {\n return this.handler === null;\n },\n r emove: function() {\n this.handler = null;\n }\n };\n\n var OriginalEv ent = window.Event;\n OriginalEvent.prototype.polymerBlackList_ = {\n return Value: true,\n // TODO(arv): keyLocation is part of KeyboardEvent but Firefox does not\n // support constructable KeyboardEvent so we keep it here for now .\n keyLocation: true\n };\n\n /**\n * Creates a new Event wrapper or wra ps an existin native Event object.\n * @param {string|Event} type\n * @param {Object=} options\n * @constructor\n */\n function Event(type, options) {\ n if (type instanceof OriginalEvent)\n this.impl = type;\n else\n return wrap(constructEvent(OriginalEvent, 'Event', type, options));\n }\n Ev ent.prototype = {\n get target() {\n return targetTable.get(this);\n },\n get currentTarget() {\n return currentTargetTable.get(this);\n } ,\n get eventPhase() {\n return eventPhaseTable.get(this);\n },\n get path() {\n var nodeList = new wrappers.NodeList();\n var eventPath = eventPathTable.get(this);\n if (eventPath) {\n var index = 0;\n var lastIndex = eventPath.length - 1;\n var baseRoot = rootOfNode(c urrentTargetTable.get(this));\n\n for (var i = 0; i <= lastIndex; i++) {\ n var currentTarget = eventPath[i].currentTarget;\n var curren tRoot = rootOfNode(currentTarget);\n if (enclosedBy(baseRoot, currentRo ot) &&\n // Make sure we do not add Window to the path.\n (i !== lastIndex || currentTarget instanceof wrappers.Node)) {\n nodeList[index++] = currentTarget;\n }\n }\n nodeList.len gth = index;\n }\n return nodeList;\n },\n stopPropagation: func tion() {\n stopPropagationTable.set(this, true);\n },\n stopImmediate Propagation: function() {\n stopPropagationTable.set(this, true);\n st opImmediatePropagationTable.set(this, true);\n }\n };\n registerWrapper(Ori ginalEvent, Event, document.createEvent('Event'));\n\n function unwrapOptions(o ptions) {\n if (!options || !options.relatedTarget)\n return options;\n return Object.create(options, {\n relatedTarget: {value: unwrap(options. relatedTarget)}\n });\n }\n\n function registerGenericEvent(name, SuperEven t, prototype) {\n var OriginalEvent = window[name];\n var GenericEvent = f unction(type, options) {\n if (type instanceof OriginalEvent)\n this .impl = type;\n else\n return wrap(constructEvent(OriginalEvent, nam e, type, options));\n };\n GenericEvent.prototype = Object.create(SuperEve nt.prototype);\n if (prototype)\n mixin(GenericEvent.prototype, prototyp e);\n if (OriginalEvent) {\n // - Old versions of Safari fails on new Fo cusEvent (and others?).\n // - IE does not support event constructors.\n // - createEvent('FocusEvent') throws in Firefox.\n // => Try the best p ractice solution first and fallback to the old way\n // if needed.\n t ry {\n registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent('te mp'));\n } catch (ex) {\n registerWrapper(OriginalEvent, GenericEven t,\n document.createEvent(name));\n }\n }\n re turn GenericEvent;\n }\n\n var UIEvent = registerGenericEvent('UIEvent', Event );\n var CustomEvent = registerGenericEvent('CustomEvent', Event);\n\n var rel atedTargetProto = {\n get relatedTarget() {\n return relatedTargetTable. get(this) || wrap(unwrap(this).relatedTarget);\n }\n };\n\n function getIni tFunction(name, relatedTargetIndex) {\n return function() {\n arguments[ relatedTargetIndex] = unwrap(arguments[relatedTargetIndex]);\n var impl = u nwrap(this);\n impl[name].apply(impl, arguments);\n };\n }\n\n var mou seEventProto = mixin({\n initMouseEvent: getInitFunction('initMouseEvent', 14 )\n }, relatedTargetProto);\n\n var focusEventProto = mixin({\n initFocusEv ent: getInitFunction('initFocusEvent', 5)\n }, relatedTargetProto);\n\n var Mo useEvent = registerGenericEvent('MouseEvent', UIEvent, mouseEventProto);\n var FocusEvent = registerGenericEvent('FocusEvent', UIEvent, focusEventProto);\n\n // In case the browser does not support event constructors we polyfill that\n / / by calling `createEvent('Foo')` and `initFooEvent` where the arguments to\n / / `initFooEvent` are derived from the registered default event init dict.\n var defaultInitDicts = Object.create(null);\n\n var supportsEventConstructors = (f unction() {\n try {\n new window.FocusEvent('focus');\n } catch (ex) {\n return false;\n }\n return true;\n })();\n\n /**\n * Construc ts a new native event.\n */\n function constructEvent(OriginalEvent, name, ty pe, options) {\n if (supportsEventConstructors)\n return new OriginalEve nt(type, unwrapOptions(options));\n\n // Create the arguments from the defaul t dictionary.\n var event = unwrap(document.createEvent(name));\n var defa ultDict = defaultInitDicts[name];\n var args = [type];\n Object.keys(defau ltDict).forEach(function(key) {\n var v = options != null && key in options ?\n options[key] : defaultDict[key];\n if (key === 'relatedTarget ')\n v = unwrap(v);\n args.push(v);\n });\n event['init' + nam e].apply(event, args);\n return event;\n }\n\n if (!supportsEventConstructo rs) {\n var configureEventConstructor = function(name, initDict, superName) { \n if (superName) {\n var superDict = defaultInitDicts[superName];\n initDict = mixin(mixin({}, superDict), initDict);\n }\n\n defa ultInitDicts[name] = initDict;\n };\n\n // The order of the default event init dictionary keys is important, the\n // arguments to initFooEvent is deri ved from that.\n configureEventConstructor('Event', {bubbles: false, cancelab le: false});\n configureEventConstructor('CustomEvent', {detail: null}, 'Even t');\n configureEventConstructor('UIEvent', {view: null, detail: 0}, 'Event') ;\n configureEventConstructor('MouseEvent', {\n screenX: 0,\n scree nY: 0,\n clientX: 0,\n clientY: 0,\n ctrlKey: false,\n altKe y: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null\n }, 'UIEvent');\n configureEventConstructor('FocusE vent', {relatedTarget: null}, 'UIEvent');\n }\n\n function BeforeUnloadEvent(i mpl) {\n Event.call(this);\n }\n BeforeUnloadEvent.prototype = Object.creat e(Event.prototype);\n mixin(BeforeUnloadEvent.prototype, {\n get returnValue () {\n return this.impl.returnValue;\n },\n set returnValue(v) {\n this.impl.returnValue = v;\n }\n });\n\n function isValidListener(fun) { \n if (typeof fun === 'function')\n return true;\n return fun && fun. handleEvent;\n }\n\n function isMutationEvent(type) {\n switch (type) {\n case 'DOMAttrModified':\n case 'DOMAttributeNameChanged':\n case ' DOMCharacterDataModified':\n case 'DOMElementNameChanged':\n case 'DOM NodeInserted':\n case 'DOMNodeInsertedIntoDocument':\n case 'DOMNodeRe moved':\n case 'DOMNodeRemovedFromDocument':\n case 'DOMSubtreeModifie d':\n return true;\n }\n return false;\n }\n\n var OriginalEventT arget = window.EventTarget;\n\n /**\n * This represents a wrapper for an Even tTarget.\n * @param {!EventTarget} impl The original event target.\n * @cons tructor\n */\n function EventTarget(impl) {\n this.impl = impl;\n }\n\n // Node and Window have different internal type checks in WebKit so we cannot\n // use the same method as the original function.\n var methodNames = [\n 'a ddEventListener',\n 'removeEventListener',\n 'dispatchEvent'\n ];\n\n [N ode, Window].forEach(function(constructor) {\n var p = constructor.prototype; \n methodNames.forEach(function(name) {\n Object.defineProperty(p, name + '_', {value: p[name]});\n });\n });\n\n function getTargetToListenAt(wrap per) {\n if (wrapper instanceof wrappers.ShadowRoot)\n wrapper = wrapper .host;\n return unwrap(wrapper);\n }\n\n EventTarget.prototype = {\n add EventListener: function(type, fun, capture) {\n if (!isValidListener(fun) | | isMutationEvent(type))\n return;\n\n var listener = new Listener(t ype, fun, capture);\n var listeners = listenersTable.get(this);\n if ( !listeners) {\n listeners = [];\n listenersTable.set(this, listene rs);\n } else {\n // Might have a duplicate.\n for (var i = 0 ; i < listeners.length; i++) {\n if (listener.equals(listeners[i]))\n return;\n }\n }\n\n listeners.push(listener);\n\n var target = getTargetToListenAt(this);\n target.addEventListener_(type, dispatchOriginalEvent, true);\n },\n removeEventListener: function(type, f un, capture) {\n capture = Boolean(capture);\n var listeners = listene rsTable.get(this);\n if (!listeners)\n return;\n var count = 0, found = false;\n for (var i = 0; i < listeners.length; i++) {\n if (listeners[i].type === type && listeners[i].capture === capture) {\n co unt++;\n if (listeners[i].handler === fun) {\n found = true; \n listeners[i].remove();\n }\n }\n }\n\n i f (found && count === 1) {\n var target = getTargetToListenAt(this);\n target.removeEventListener_(type, dispatchOriginalEvent, true);\n }\n },\n dispatchEvent: function(event) {\n // We want to use the native dispatchEvent because it triggers the default\n // actions (like checking a checkbox). However, if there are no listeners\n // in the composed tree th en there are no events that will trigger and\n // listeners in the non comp osed tree that are part of the event path are\n // not notified.\n //\ n // If we find out that there are no listeners in the composed tree we add \n // a temporary listener to the target which makes us get called back eve n\n // in that case.\n\n var nativeEvent = unwrap(event);\n var e ventType = nativeEvent.type;\n\n // Allow dispatching the same event again. This is safe because if user\n // code calls this during an existing dispa tch of the same event the\n // native dispatchEvent throws (that is require d by the spec).\n handledEventsTable.set(nativeEvent, false);\n\n // F orce rendering since we prefer native dispatch and that works on the\n // c omposed tree.\n scope.renderAllPending();\n\n var tempListener;\n if (!hasListenerInAncestors(this, eventType)) {\n tempListener = functio n() {};\n this.addEventListener(eventType, tempListener, true);\n }\ n\n try {\n return unwrap(this).dispatchEvent_(nativeEvent);\n } finally {\n if (tempListener)\n this.removeEventListener(event Type, tempListener, true);\n }\n }\n };\n\n function hasListener(node, type) {\n var listeners = listenersTable.get(node);\n if (listeners) {\n for (var i = 0; i < listeners.length; i++) {\n if (!listeners[i].rem oved && listeners[i].type === type)\n return true;\n }\n }\n return false;\n }\n\n function hasListenerInAncestors(target, type) {\n fo r (var node = unwrap(target); node; node = node.parentNode) {\n if (hasList ener(wrap(node), type))\n return true;\n }\n return false;\n }\n\n if (OriginalEventTarget)\n registerWrapper(OriginalEventTarget, EventTarget );\n\n function wrapEventTargetMethods(constructors) {\n forwardMethodsToWra pper(constructors, methodNames);\n }\n\n var originalElementFromPoint = docume nt.elementFromPoint;\n\n function elementFromPoint(self, document, x, y) {\n scope.renderAllPending();\n\n var element = wrap(originalElementFromPoint.ca ll(document.impl, x, y));\n var targets = retarget(element, this)\n for (v ar i = 0; i < targets.length; i++) {\n var target = targets[i];\n if ( target.currentTarget === self)\n return target.target;\n }\n return null;\n }\n\n /**\n * Returns a function that is to be used as a getter for `onfoo` properties.\n * @param {string} name\n * @return {Function}\n */\ n function getEventHandlerGetter(name) {\n return function() {\n var in lineEventHandlers = eventHandlersTable.get(this);\n return inlineEventHandl ers && inlineEventHandlers[name] &&\n inlineEventHandlers[name].value | | null;\n };\n }\n\n /**\n * Returns a function that is to be used as a setter for `onfoo` properties.\n * @param {string} name\n * @return {Functio n}\n */\n function getEventHandlerSetter(name) {\n var eventType = name.sl ice(2);\n return function(value) {\n var inlineEventHandlers = eventHand lersTable.get(this);\n if (!inlineEventHandlers) {\n inlineEventHand lers = Object.create(null);\n eventHandlersTable.set(this, inlineEventHan dlers);\n }\n\n var old = inlineEventHandlers[name];\n if (old)\n this.removeEventListener(eventType, old.wrapped, false);\n\n if (ty peof value === 'function') {\n var wrapped = function(e) {\n var rv = value.call(this, e);\n if (rv === false)\n e.preventDe fault();\n else if (name === 'onbeforeunload' && typeof rv === 'string' )\n e.returnValue = rv;\n // mouseover uses true for prevent Default but preventDefault for\n // mouseover is ignored by browsers th ese day.\n };\n\n this.addEventListener(eventType, wrapped, false) ;\n inlineEventHandlers[name] = {\n value: value,\n wra pped: wrapped\n };\n }\n };\n }\n\n scope.adjustRelatedTarget = adjustRelatedTarget;\n scope.elementFromPoint = elementFromPoint;\n scope.get EventHandlerGetter = getEventHandlerGetter;\n scope.getEventHandlerSetter = get EventHandlerSetter;\n scope.wrapEventTargetMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloadEvent = BeforeUnloadEvent;\n scope.wrappers.CustomE vent = CustomEvent;\n scope.wrappers.Event = Event;\n scope.wrappers.EventTarg et = EventTarget;\n scope.wrappers.FocusEvent = FocusEvent;\n scope.wrappers.M ouseEvent = MouseEvent;\n scope.wrappers.UIEvent = UIEvent;\n\n})(window.Shadow DOMPolyfill);\n", 114 "/**\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in t he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n /**\n * A tr ee scope represents the root of a tree. All nodes in a tree point to\n * the s ame TreeScope object. The tree scope of a node get set the first time\n * it i s accessed or when a node is added or remove to a tree.\n * @constructor\n * /\n function TreeScope(root, parent) {\n this.root = root;\n this.parent = parent;\n }\n\n TreeScope.prototype = {\n get renderer() {\n if (thi s.root instanceof scope.wrappers.ShadowRoot) {\n return scope.getRenderer ForHost(this.root.host);\n }\n return null;\n },\n\n contains: f unction(treeScope) {\n for (; treeScope; treeScope = treeScope.parent) {\n if (treeScope === this)\n return true;\n }\n return fa lse;\n }\n };\n\n function setTreeScope(node, treeScope) {\n if (node.tr eeScope_ !== treeScope) {\n node.treeScope_ = treeScope;\n for (var ch ild = node.firstChild; child; child = child.nextSibling) {\n setTreeScope (child, treeScope);\n }\n }\n }\n\n function getTreeScope(node) {\n if (node.treeScope_)\n return node.treeScope_;\n var parent = node.pare ntNode;\n var treeScope;\n if (parent)\n treeScope = getTreeScope(par ent);\n else\n treeScope = new TreeScope(node, null);\n return node.t reeScope_ = treeScope;\n }\n\n scope.TreeScope = TreeScope;\n scope.getTreeSc ope = getTreeScope;\n scope.setTreeScope = setTreeScope;\n\n})(window.ShadowDOM Polyfill);\n",
115 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var forwardMethodsToWrap per = scope.forwardMethodsToWrapper;\n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n va r unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers = scope.wrapp ers;\n\n var wrappedFuns = new WeakMap();\n var listenersTable = new WeakMap() ;\n var handledEventsTable = new WeakMap();\n var currentlyDispatchingEvents = new WeakMap();\n var targetTable = new WeakMap();\n var currentTargetTable = new WeakMap();\n var relatedTargetTable = new WeakMap();\n var eventPhaseTable = new WeakMap();\n var stopPropagationTable = new WeakMap();\n var stopImmedi atePropagationTable = new WeakMap();\n var eventHandlersTable = new WeakMap();\ n var eventPathTable = new WeakMap();\n\n function isShadowRoot(node) {\n r eturn node instanceof wrappers.ShadowRoot;\n }\n\n function isInsertionPoint(n ode) {\n var localName = node.localName;\n return localName === 'content' || localName === 'shadow';\n }\n\n function isShadowHost(node) {\n return ! !node.shadowRoot;\n }\n\n function getEventParent(node) {\n var dv;\n re turn node.parentNode || (dv = node.defaultView) && wrap(dv) || null;\n }\n\n / / https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#dfn-a djusted-parent\n function calculateParents(node, context, ancestors) {\n if (ancestors.length)\n return ancestors.shift();\n\n // 1.\n if (isShad owRoot(node))\n return getInsertionParent(node) || node.host;\n\n // 2.\ n var eventParents = scope.eventParentsTable.get(node);\n if (eventParents ) {\n // Copy over the remaining event parents for next iteration.\n f or (var i = 1; i < eventParents.length; i++) {\n ancestors[i - 1] = event Parents[i];\n }\n return eventParents[0];\n }\n\n // 3.\n if (context && isInsertionPoint(node)) {\n var parentNode = node.parentNode;\n if (parentNode && isShadowHost(parentNode)) {\n var trees = scope.g etShadowTrees(parentNode);\n var p = getInsertionParent(context);\n for (var i = 0; i < trees.length; i++) {\n if (trees[i].contains(p))\ n return p;\n }\n }\n }\n\n return getEventParent(n ode);\n }\n\n // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow /index.html#event-retargeting\n function retarget(node) {\n var stack = []; // 1.\n var ancestor = node; // 2.\n var targets = [];\n var ancestor s = [];\n while (ancestor) { // 3.\n var context = null; // 3.2.\n // TODO(arv): Change order of these. If the stack is empty we always end\n // up pushing ancestor, no matter what.\n if (isInsertionPoint(ancestor)) { // 3.1.\n context = topMostNotInsertionPoint(stack); // 3.1.1.\n var top = stack[stack.length - 1] || ancestor; // 3.1.2.\n stack.pus h(top);\n } else if (!stack.length) {\n stack.push(ancestor); // 3. 3.\n }\n var target = stack[stack.length - 1]; // 3.4.\n targets .push({target: target, currentTarget: ancestor}); // 3.5.\n if (isShadowRo ot(ancestor)) // 3.6.\n stack.pop(); // 3.6.1.\n\n ancestor = calc ulateParents(ancestor, context, ancestors); // 3.7.\n }\n return targets; \n }\n\n function topMostNotInsertionPoint(stack) {\n for (var i = stack.le ngth - 1; i >= 0; i--) {\n if (!isInsertionPoint(stack[i]))\n return stack[i];\n }\n return null;\n }\n\n // https://dvcs.w3.org/hg/webcompo nents/raw-file/tip/spec/shadow/index.html#dfn-adjusted-related-target\n functio n adjustRelatedTarget(target, related) {\n var ancestors = [];\n while (ta rget) { // 3.\n var stack = []; // 3.1.\n var ancestor = related; / / 3.2.\n var last = undefined; // 3.3. Needs to be reset every iteration.\ n while (ancestor) {\n var context = null;\n if (!stack.lengt h) {\n stack.push(ancestor);\n } else {\n if (isInserti onPoint(ancestor)) { // 3.4.3.\n context = topMostNotInsertionPoint( stack);\n // isDistributed is more general than checking whether last is\n // assigned into ancestor.\n if (isDistributed(last) ) { // 3.4.3.2.\n var head = stack[stack.length - 1];\n stack.push(head);\n }\n }\n }\n\n if (inSam eTree(ancestor, target)) // 3.4.4.\n return stack[stack.length - 1];\n \n if (isShadowRoot(ancestor)) // 3.4.5.\n stack.pop();\n\n last = ancestor; // 3.4.6.\n ancestor = calculateParents(ancestor, c ontext, ancestors); // 3.4.7.\n }\n if (isShadowRoot(target)) // 3.5 .\n target = target.host;\n else\n target = target.parentNode ; // 3.6.\n }\n }\n\n function getInsertionParent(node) {\n return scop e.insertionParentTable.get(node);\n }\n\n function isDistributed(node) {\n return getInsertionParent(node);\n }\n\n function inSameTree(a, b) {\n retu rn getTreeScope(a) === getTreeScope(b);\n }\n\n function dispatchOriginalEvent (originalEvent) {\n // Make sure this event is only dispatched once.\n if (handledEventsTable.get(originalEvent))\n return;\n handledEventsTable.s et(originalEvent, true);\n\n return dispatchEvent(wrap(originalEvent), wrap(o riginalEvent.target));\n }\n\n function dispatchEvent(event, originalWrapperTa rget) {\n if (currentlyDispatchingEvents.get(event))\n throw new Error(' InvalidStateError')\n currentlyDispatchingEvents.set(event, true);\n\n // Render to ensure that the event path is correct.\n scope.renderAllPending();\ n var eventPath = retarget(originalWrapperTarget);\n\n // For window load events the load event is dispatched at the window but\n // the target is set to the document.\n //\n // http://www.whatwg.org/specs/web-apps/current-wo rk/multipage/the-end.html#the-end\n //\n // TODO(arv): Find a less hacky w ay to do this.\n if (event.type === 'load' &&\n eventPath.length === 2 &&\n eventPath[0].target instanceof wrappers.Document) {\n eventPat h.shift();\n }\n\n eventPathTable.set(event, eventPath);\n\n if (dispat chCapturing(event, eventPath)) {\n if (dispatchAtTarget(event, eventPath)) {\n dispatchBubbling(event, eventPath);\n }\n }\n\n eventPhase Table.set(event, Event.NONE);\n currentTargetTable.delete(event, null);\n currentlyDispatchingEvents.delete(event);\n\n return event.defaultPrevented;\ n }\n\n function dispatchCapturing(event, eventPath) {\n var phase;\n\n for (var i = eventPath.length - 1; i > 0; i--) {\n var target = eventPath[i ].target;\n var currentTarget = eventPath[i].currentTarget;\n if (targ et === currentTarget)\n continue;\n\n phase = Event.CAPTURING_PHASE; \n if (!invoke(eventPath[i], event, phase))\n return false;\n }\n \n return true;\n }\n\n function dispatchAtTarget(event, eventPath) {\n var phase = Event.AT_TARGET;\n return invoke(eventPath[0], event, phase);\n }\n\n function dispatchBubbling(event, eventPath) {\n var bubbles = event.bu bbles;\n var phase;\n\n for (var i = 1; i < eventPath.length; i++) {\n var target = eventPath[i].target;\n var currentTarget = eventPath[i].curr entTarget;\n if (target === currentTarget)\n phase = Event.AT_TARGET ;\n else if (bubbles && !stopImmediatePropagationTable.get(event))\n phase = Event.BUBBLING_PHASE;\n else\n continue;\n\n if (!invo ke(eventPath[i], event, phase))\n return;\n }\n }\n\n function invok e(tuple, event, phase) {\n var target = tuple.target;\n var currentTarget = tuple.currentTarget;\n\n var listeners = listenersTable.get(currentTarget); \n if (!listeners)\n return true;\n\n if ('relatedTarget' in event) { \n var originalEvent = unwrap(event);\n // X-Tag sets relatedTarget on a CustomEvent. If they do that there is no\n // way to have relatedTarget return the adjusted target but worse is that\n // the originalEvent might n ot have a relatedTarget so we hit an assert\n // when we try to wrap it.\n if (originalEvent.relatedTarget) {\n var relatedTarget = wrap(origin alEvent.relatedTarget);\n\n var adjusted = adjustRelatedTarget(currentTar get, relatedTarget);\n if (adjusted === target)\n return true;\n \n relatedTargetTable.set(event, adjusted);\n }\n }\n\n eventP haseTable.set(event, phase);\n var type = event.type;\n\n var anyRemoved = false;\n targetTable.set(event, target);\n currentTargetTable.set(event, currentTarget);\n\n for (var i = 0; i < listeners.length; i++) {\n var l istener = listeners[i];\n if (listener.removed) {\n anyRemoved = tru e;\n continue;\n }\n\n if (listener.type !== type ||\n !listener.capture && phase === Event.CAPTURING_PHASE ||\n listener.cap ture && phase === Event.BUBBLING_PHASE) {\n continue;\n }\n\n t ry {\n if (typeof listener.handler === 'function')\n listener.ha ndler.call(currentTarget, event);\n else\n listener.handler.hand leEvent(event);\n\n if (stopImmediatePropagationTable.get(event))\n return false;\n\n } catch (ex) {\n if (window.onerror)\n window.onerror(ex.message);\n else\n console.error(ex, ex.stac k);\n }\n }\n\n if (anyRemoved) {\n var copy = listeners.slice() ;\n listeners.length = 0;\n for (var i = 0; i < copy.length; i++) {\n if (!copy[i].removed)\n listeners.push(copy[i]);\n }\n } \n\n return !stopPropagationTable.get(event);\n }\n\n function Listener(typ e, handler, capture) {\n this.type = type;\n this.handler = handler;\n this.capture = Boolean(capture);\n }\n Listener.prototype = {\n equals: fun ction(that) {\n return this.handler === that.handler && this.type === that. type &&\n this.capture === that.capture;\n },\n get removed() {\n return this.handler === null;\n },\n remove: function() {\n thi s.handler = null;\n }\n };\n\n var OriginalEvent = window.Event;\n Origina lEvent.prototype.polymerBlackList_ = {\n returnValue: true,\n // TODO(arv) : keyLocation is part of KeyboardEvent but Firefox does not\n // support cons tructable KeyboardEvent so we keep it here for now.\n keyLocation: true\n }; \n\n /**\n * Creates a new Event wrapper or wraps an existin native Event obj ect.\n * @param {string|Event} type\n * @param {Object=} options\n * @cons tructor\n */\n function Event(type, options) {\n if (type instanceof Origi nalEvent)\n this.impl = type;\n else\n return wrap(constructEvent(O riginalEvent, 'Event', type, options));\n }\n Event.prototype = {\n get tar get() {\n return targetTable.get(this);\n },\n get currentTarget() {\ n return currentTargetTable.get(this);\n },\n get eventPhase() {\n return eventPhaseTable.get(this);\n },\n get path() {\n var nodeLi st = new wrappers.NodeList();\n var eventPath = eventPathTable.get(this);\n if (eventPath) {\n var index = 0;\n var lastIndex = eventPat h.length - 1;\n var baseRoot = getTreeScope(currentTargetTable.get(this)) ;\n\n for (var i = 0; i <= lastIndex; i++) {\n var currentTarget = eventPath[i].currentTarget;\n var currentRoot = getTreeScope(current Target);\n if (currentRoot.contains(baseRoot) &&\n // Make sure we do not add Window to the path.\n (i !== lastIndex || curre ntTarget instanceof wrappers.Node)) {\n nodeList[index++] = currentTa rget;\n }\n }\n nodeList.length = index;\n }\n return nodeList;\n },\n stopPropagation: function() {\n stopPropagati onTable.set(this, true);\n },\n stopImmediatePropagation: function() {\n stopPropagationTable.set(this, true);\n stopImmediatePropagationTable.s et(this, true);\n }\n };\n registerWrapper(OriginalEvent, Event, document.c reateEvent('Event'));\n\n function unwrapOptions(options) {\n if (!options | | !options.relatedTarget)\n return options;\n return Object.create(optio ns, {\n relatedTarget: {value: unwrap(options.relatedTarget)}\n });\n } \n\n function registerGenericEvent(name, SuperEvent, prototype) {\n var Orig inalEvent = window[name];\n var GenericEvent = function(type, options) {\n if (type instanceof OriginalEvent)\n this.impl = type;\n else\n return wrap(constructEvent(OriginalEvent, name, type, options));\n };\n GenericEvent.prototype = Object.create(SuperEvent.prototype);\n if (proto type)\n mixin(GenericEvent.prototype, prototype);\n if (OriginalEvent) { \n // - Old versions of Safari fails on new FocusEvent (and others?).\n // - IE does not support event constructors.\n // - createEvent('FocusEve nt') throws in Firefox.\n // => Try the best practice solution first and fa llback to the old way\n // if needed.\n try {\n registerWrapper (OriginalEvent, GenericEvent, new OriginalEvent('temp'));\n } catch (ex) {\ n registerWrapper(OriginalEvent, GenericEvent,\n d ocument.createEvent(name));\n }\n }\n return GenericEvent;\n }\n\n var UIEvent = registerGenericEvent('UIEvent', Event);\n var CustomEvent = regis terGenericEvent('CustomEvent', Event);\n\n var relatedTargetProto = {\n get relatedTarget() {\n return relatedTargetTable.get(this) || wrap(unwrap(this ).relatedTarget);\n }\n };\n\n function getInitFunction(name, relatedTarget Index) {\n return function() {\n arguments[relatedTargetIndex] = unwrap( arguments[relatedTargetIndex]);\n var impl = unwrap(this);\n impl[name ].apply(impl, arguments);\n };\n }\n\n var mouseEventProto = mixin({\n i nitMouseEvent: getInitFunction('initMouseEvent', 14)\n }, relatedTargetProto);\ n\n var focusEventProto = mixin({\n initFocusEvent: getInitFunction('initFoc usEvent', 5)\n }, relatedTargetProto);\n\n var MouseEvent = registerGenericEve nt('MouseEvent', UIEvent, mouseEventProto);\n var FocusEvent = registerGenericE vent('FocusEvent', UIEvent, focusEventProto);\n\n // In case the browser does n ot support event constructors we polyfill that\n // by calling `createEvent('Fo o')` and `initFooEvent` where the arguments to\n // `initFooEvent` are derived from the registered default event init dict.\n var defaultInitDicts = Object.cr eate(null);\n\n var supportsEventConstructors = (function() {\n try {\n new window.FocusEvent('focus');\n } catch (ex) {\n return false;\n } \n return true;\n })();\n\n /**\n * Constructs a new native event.\n */ \n function constructEvent(OriginalEvent, name, type, options) {\n if (suppo rtsEventConstructors)\n return new OriginalEvent(type, unwrapOptions(option s));\n\n // Create the arguments from the default dictionary.\n var event = unwrap(document.createEvent(name));\n var defaultDict = defaultInitDicts[na me];\n var args = [type];\n Object.keys(defaultDict).forEach(function(key) {\n var v = options != null && key in options ?\n options[key] : defaultDict[key];\n if (key === 'relatedTarget')\n v = unwrap(v);\n args.push(v);\n });\n event['init' + name].apply(event, args);\n r eturn event;\n }\n\n if (!supportsEventConstructors) {\n var configureEvent Constructor = function(name, initDict, superName) {\n if (superName) {\n var superDict = defaultInitDicts[superName];\n initDict = mixin(mixi n({}, superDict), initDict);\n }\n\n defaultInitDicts[name] = initDict ;\n };\n\n // The order of the default event init dictionary keys is impor tant, the\n // arguments to initFooEvent is derived from that.\n configure EventConstructor('Event', {bubbles: false, cancelable: false});\n configureEv entConstructor('CustomEvent', {detail: null}, 'Event');\n configureEventConst ructor('UIEvent', {view: null, detail: 0}, 'Event');\n configureEventConstruc tor('MouseEvent', {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n ctrlKey: false,\n altKey: false,\n shiftKey: fa lse,\n metaKey: false,\n button: 0,\n relatedTarget: null\n }, 'UIEvent');\n configureEventConstructor('FocusEvent', {relatedTarget: null}, 'UIEvent');\n }\n\n function BeforeUnloadEvent(impl) {\n Event.call(this); \n }\n BeforeUnloadEvent.prototype = Object.create(Event.prototype);\n mixin( BeforeUnloadEvent.prototype, {\n get returnValue() {\n return this.impl. returnValue;\n },\n set returnValue(v) {\n this.impl.returnValue = v; \n }\n });\n\n function isValidListener(fun) {\n if (typeof fun === 'fun ction')\n return true;\n return fun && fun.handleEvent;\n }\n\n functi on isMutationEvent(type) {\n switch (type) {\n case 'DOMAttrModified':\n case 'DOMAttributeNameChanged':\n case 'DOMCharacterDataModified':\n case 'DOMElementNameChanged':\n case 'DOMNodeInserted':\n case 'D OMNodeInsertedIntoDocument':\n case 'DOMNodeRemoved':\n case 'DOMNodeR emovedFromDocument':\n case 'DOMSubtreeModified':\n return true;\n }\n return false;\n }\n\n var OriginalEventTarget = window.EventTarget;\n \n /**\n * This represents a wrapper for an EventTarget.\n * @param {!Event Target} impl The original event target.\n * @constructor\n */\n function Ev entTarget(impl) {\n this.impl = impl;\n }\n\n // Node and Window have diffe rent internal type checks in WebKit so we cannot\n // use the same method as th e original function.\n var methodNames = [\n 'addEventListener',\n 'remov eEventListener',\n 'dispatchEvent'\n ];\n\n [Node, Window].forEach(function (constructor) {\n var p = constructor.prototype;\n methodNames.forEach(fun ction(name) {\n Object.defineProperty(p, name + '_', {value: p[name]});\n });\n });\n\n function getTargetToListenAt(wrapper) {\n if (wrapper insta nceof wrappers.ShadowRoot)\n wrapper = wrapper.host;\n return unwrap(wra pper);\n }\n\n EventTarget.prototype = {\n addEventListener: function(type, fun, capture) {\n if (!isValidListener(fun) || isMutationEvent(type))\n return;\n\n var listener = new Listener(type, fun, capture);\n va r listeners = listenersTable.get(this);\n if (!listeners) {\n listen ers = [];\n listenersTable.set(this, listeners);\n } else {\n // Might have a duplicate.\n for (var i = 0; i < listeners.length; i++) {\n if (listener.equals(listeners[i]))\n return;\n }\ n }\n\n listeners.push(listener);\n\n var target = getTargetToLis tenAt(this);\n target.addEventListener_(type, dispatchOriginalEvent, true); \n },\n removeEventListener: function(type, fun, capture) {\n capture = Boolean(capture);\n var listeners = listenersTable.get(this);\n if (!listeners)\n return;\n var count = 0, found = false;\n for (v ar i = 0; i < listeners.length; i++) {\n if (listeners[i].type === type & & listeners[i].capture === capture) {\n count++;\n if (listene rs[i].handler === fun) {\n found = true;\n listeners[i].re move();\n }\n }\n }\n\n if (found && count === 1) {\n var target = getTargetToListenAt(this);\n target.removeEventListen er_(type, dispatchOriginalEvent, true);\n }\n },\n dispatchEvent: fun ction(event) {\n // We want to use the native dispatchEvent because it trig gers the default\n // actions (like checking a checkbox). However, if there are no listeners\n // in the composed tree then there are no events that w ill trigger and\n // listeners in the non composed tree that are part of th e event path are\n // not notified.\n //\n // If we find out that there are no listeners in the composed tree we add\n // a temporary listen er to the target which makes us get called back even\n // in that case.\n\n var nativeEvent = unwrap(event);\n var eventType = nativeEvent.type;\ n\n // Allow dispatching the same event again. This is safe because if user \n // code calls this during an existing dispatch of the same event the\n // native dispatchEvent throws (that is required by the spec).\n handle dEventsTable.set(nativeEvent, false);\n\n // Force rendering since we prefe r native dispatch and that works on the\n // composed tree.\n scope.re nderAllPending();\n\n var tempListener;\n if (!hasListenerInAncestors( this, eventType)) {\n tempListener = function() {};\n this.addEven tListener(eventType, tempListener, true);\n }\n\n try {\n retur n unwrap(this).dispatchEvent_(nativeEvent);\n } finally {\n if (temp Listener)\n this.removeEventListener(eventType, tempListener, true);\n }\n }\n };\n\n function hasListener(node, type) {\n var listeners = listenersTable.get(node);\n if (listeners) {\n for (var i = 0; i < list eners.length; i++) {\n if (!listeners[i].removed && listeners[i].type === type)\n return true;\n }\n }\n return false;\n }\n\n func tion hasListenerInAncestors(target, type) {\n for (var node = unwrap(target); node; node = node.parentNode) {\n if (hasListener(wrap(node), type))\n return true;\n }\n return false;\n }\n\n if (OriginalEventTarget)\n registerWrapper(OriginalEventTarget, EventTarget);\n\n function wrapEventTar getMethods(constructors) {\n forwardMethodsToWrapper(constructors, methodName s);\n }\n\n var originalElementFromPoint = document.elementFromPoint;\n\n fun ction elementFromPoint(self, document, x, y) {\n scope.renderAllPending();\n\ n var element = wrap(originalElementFromPoint.call(document.impl, x, y));\n var targets = retarget(element, this)\n for (var i = 0; i < targets.length; i++) {\n var target = targets[i];\n if (target.currentTarget === self )\n return target.target;\n }\n return null;\n }\n\n /**\n * Re turns a function that is to be used as a getter for `onfoo` properties.\n * @p aram {string} name\n * @return {Function}\n */\n function getEventHandlerGe tter(name) {\n return function() {\n var inlineEventHandlers = eventHand lersTable.get(this);\n return inlineEventHandlers && inlineEventHandlers[na me] &&\n inlineEventHandlers[name].value || null;\n };\n }\n\n /* *\n * Returns a function that is to be used as a setter for `onfoo` properties .\n * @param {string} name\n * @return {Function}\n */\n function getEven tHandlerSetter(name) {\n var eventType = name.slice(2);\n return function( value) {\n var inlineEventHandlers = eventHandlersTable.get(this);\n i f (!inlineEventHandlers) {\n inlineEventHandlers = Object.create(null);\n eventHandlersTable.set(this, inlineEventHandlers);\n }\n\n var old = inlineEventHandlers[name];\n if (old)\n this.removeEventListe ner(eventType, old.wrapped, false);\n\n if (typeof value === 'function') {\ n var wrapped = function(e) {\n var rv = value.call(this, e);\n if (rv === false)\n e.preventDefault();\n else if ( name === 'onbeforeunload' && typeof rv === 'string')\n e.returnValue = rv;\n // mouseover uses true for preventDefault but preventDefault fo r\n // mouseover is ignored by browsers these day.\n };\n\n this.addEventListener(eventType, wrapped, false);\n inlineEventHandler s[name] = {\n value: value,\n wrapped: wrapped\n };\n }\n };\n }\n\n scope.adjustRelatedTarget = adjustRelatedTarget;\n scop e.elementFromPoint = elementFromPoint;\n scope.getEventHandlerGetter = getEvent HandlerGetter;\n scope.getEventHandlerSetter = getEventHandlerSetter;\n scope. wrapEventTargetMethods = wrapEventTargetMethods;\n scope.wrappers.BeforeUnloadE vent = BeforeUnloadEvent;\n scope.wrappers.CustomEvent = CustomEvent;\n scope. wrappers.Event = Event;\n scope.wrappers.EventTarget = EventTarget;\n scope.wr appers.FocusEvent = FocusEvent;\n scope.wrappers.MouseEvent = MouseEvent;\n sc ope.wrappers.UIEvent = UIEvent;\n\n})(window.ShadowDOMPolyfill);\n",
113 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var wrap = scope.wrap;\n \n function nonEnum(obj, prop) {\n Object.defineProperty(obj, prop, {enumera ble: false});\n }\n\n function NodeList() {\n this.length = 0;\n nonEnum (this, 'length');\n }\n NodeList.prototype = {\n item: function(index) {\n return this[index];\n }\n };\n nonEnum(NodeList.prototype, 'item');\n\ n function wrapNodeList(list) {\n if (list == null)\n return list;\n var wrapperList = new NodeList();\n for (var i = 0, length = list.length; i < length; i++) {\n wrapperList[i] = wrap(list[i]);\n }\n wrapperList. length = length;\n return wrapperList;\n }\n\n function addWrapNodeListMeth od(wrapperConstructor, name) {\n wrapperConstructor.prototype[name] = functio n() {\n return wrapNodeList(this.impl[name].apply(this.impl, arguments));\n };\n }\n\n scope.wrappers.NodeList = NodeList;\n scope.addWrapNodeListMet hod = addWrapNodeListMethod;\n scope.wrapNodeList = wrapNodeList;\n\n})(window. ShadowDOMPolyfill);\n", 116 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var wrap = scope.wrap;\n \n function nonEnum(obj, prop) {\n Object.defineProperty(obj, prop, {enumera ble: false});\n }\n\n function NodeList() {\n this.length = 0;\n nonEnum (this, 'length');\n }\n NodeList.prototype = {\n item: function(index) {\n return this[index];\n }\n };\n nonEnum(NodeList.prototype, 'item');\n\ n function wrapNodeList(list) {\n if (list == null)\n return list;\n var wrapperList = new NodeList();\n for (var i = 0, length = list.length; i < length; i++) {\n wrapperList[i] = wrap(list[i]);\n }\n wrapperList. length = length;\n return wrapperList;\n }\n\n function addWrapNodeListMeth od(wrapperConstructor, name) {\n wrapperConstructor.prototype[name] = functio n() {\n return wrapNodeList(this.impl[name].apply(this.impl, arguments));\n };\n }\n\n scope.wrappers.NodeList = NodeList;\n scope.addWrapNodeListMet hod = addWrapNodeListMethod;\n scope.wrapNodeList = wrapNodeList;\n\n})(window. ShadowDOMPolyfill);\n",
114 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n // TODO(arv): I mplement.\n\n scope.wrapHTMLCollection = scope.wrapNodeList;\n scope.wrappers. HTMLCollection = scope.wrappers.NodeList;\n\n})(window.ShadowDOMPolyfill);\n", 117 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n // TODO(arv): I mplement.\n\n scope.wrapHTMLCollection = scope.wrapNodeList;\n scope.wrappers. HTMLCollection = scope.wrappers.NodeList;\n\n})(window.ShadowDOMPolyfill);\n",
115 "// Copyright 2012 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope. wrappers.EventTarget;\n var NodeList = scope.wrappers.NodeList;\n var assert = scope.assert;\n var defineWrapGetter = scope.defineWrapGetter;\n var enqueueM utation = scope.enqueueMutation;\n var isWrapper = scope.isWrapper;\n var mixi n = scope.mixin;\n var registerTransientObservers = scope.registerTransientObse rvers;\n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unw rap;\n var wrap = scope.wrap;\n var wrapIfNeeded = scope.wrapIfNeeded;\n var wrappers = scope.wrappers;\n\n function assertIsNodeWrapper(node) {\n assert (node instanceof Node);\n }\n\n function createOneElementNodeList(node) {\n var nodes = new NodeList();\n nodes[0] = node;\n nodes.length = 1;\n r eturn nodes;\n }\n\n var surpressMutations = false;\n\n /**\n * Called befo re node is inserted into a node to enqueue its removal from its\n * old parent .\n * @param {!Node} node The node that is about to be removed.\n * @param { !Node} parent The parent node that the node is being removed from.\n * @param {!NodeList} nodes The collected nodes.\n */\n function enqueueRemovalForInser tedNodes(node, parent, nodes) {\n enqueueMutation(parent, 'childList', {\n removedNodes: nodes,\n previousSibling: node.previousSibling,\n nex tSibling: node.nextSibling\n });\n }\n\n function enqueueRemovalForInserted DocumentFragment(df, nodes) {\n enqueueMutation(df, 'childList', {\n rem ovedNodes: nodes\n });\n }\n\n /**\n * Collects nodes from a DocumentFrag ment or a Node for removal followed\n * by an insertion.\n *\n * This upda tes the internal pointers for node, previousNode and nextNode.\n */\n functio n collectNodes(node, parentNode, previousNode, nextNode) {\n if (node instanc eof DocumentFragment) {\n var nodes = collectNodesForDocumentFragment(node) ;\n\n // The extra loop is to work around bugs with DocumentFragments in IE .\n surpressMutations = true;\n for (var i = nodes.length - 1; i >= 0; i--) {\n node.removeChild(nodes[i]);\n nodes[i].parentNode_ = par entNode;\n }\n surpressMutations = false;\n\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].previousSibling_ = nodes[i - 1] || previ ousNode;\n nodes[i].nextSibling_ = nodes[i + 1] || nextNode;\n }\n\n if (previousNode)\n previousNode.nextSibling_ = nodes[0];\n if (nextNode)\n nextNode.previousSibling_ = nodes[nodes.length - 1];\n\n return nodes;\n }\n\n var nodes = createOneElementNodeList(node);\n var oldParent = node.parentNode;\n if (oldParent) {\n // This will enque ue the mutation record for the removal as needed.\n oldParent.removeChild(n ode);\n }\n\n node.parentNode_ = parentNode;\n node.previousSibling_ = previousNode;\n node.nextSibling_ = nextNode;\n if (previousNode)\n p reviousNode.nextSibling_ = node;\n if (nextNode)\n nextNode.previousSibl ing_ = node;\n\n return nodes;\n }\n\n function collectNodesNative(node) {\ n if (node instanceof DocumentFragment)\n return collectNodesForDocument Fragment(node);\n\n var nodes = createOneElementNodeList(node);\n var oldP arent = node.parentNode;\n if (oldParent)\n enqueueRemovalForInsertedNod es(node, oldParent, nodes);\n return nodes;\n }\n\n function collectNodesFo rDocumentFragment(node) {\n var nodes = new NodeList();\n var i = 0;\n for (var child = node.firstChild; child; child = child.nextSibling) {\n nod es[i++] = child;\n }\n nodes.length = i;\n enqueueRemovalForInsertedDoc umentFragment(node, nodes);\n return nodes;\n }\n\n function snapshotNodeLi st(nodeList) {\n // NodeLists are not live at the moment so just return the s ame object.\n return nodeList;\n }\n\n // http://dom.spec.whatwg.org/#node- is-inserted\n function nodeWasAdded(node) {\n node.nodeIsInserted_();\n }\n \n function nodesWereAdded(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n nodeWasAdded(nodes[i]);\n }\n }\n\n // http://dom.spec.whatwg.org /#node-is-removed\n function nodeWasRemoved(node) {\n // Nothing at this poi nt in time.\n }\n\n function nodesWereRemoved(nodes) {\n // Nothing at this point in time.\n }\n\n function ensureSameOwnerDocument(parent, child) {\n var ownerDoc = parent.nodeType === Node.DOCUMENT_NODE ?\n parent : paren t.ownerDocument;\n if (ownerDoc !== child.ownerDocument)\n ownerDoc.adop tNode(child);\n }\n\n function adoptNodesIfNeeded(owner, nodes) {\n if (!no des.length)\n return;\n\n var ownerDoc = owner.ownerDocument;\n\n // All nodes have the same ownerDocument when we get here.\n if (ownerDoc === no des[0].ownerDocument)\n return;\n\n for (var i = 0; i < nodes.length; i+ +) {\n scope.adoptNodeNoRemove(nodes[i], ownerDoc);\n }\n }\n\n functi on unwrapNodesForInsertion(owner, nodes) {\n adoptNodesIfNeeded(owner, nodes) ;\n var length = nodes.length;\n\n if (length === 1)\n return unwrap( nodes[0]);\n\n var df = unwrap(owner.ownerDocument.createDocumentFragment()); \n for (var i = 0; i < length; i++) {\n df.appendChild(unwrap(nodes[i])) ;\n }\n return df;\n }\n\n function clearChildNodes(wrapper) {\n if ( wrapper.firstChild_ !== undefined) {\n var child = wrapper.firstChild_;\n while (child) {\n var tmp = child;\n child = child.nextSibling _;\n tmp.parentNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefine d;\n }\n }\n wrapper.firstChild_ = wrapper.lastChild_ = undefined;\n }\n\n function removeAllChildNodes(wrapper) {\n if (wrapper.invalidateShado wRenderer()) {\n var childWrapper = wrapper.firstChild;\n while (child Wrapper) {\n assert(childWrapper.parentNode === wrapper);\n var ne xtSibling = childWrapper.nextSibling;\n var childNode = unwrap(childWrapp er);\n var parentNode = childNode.parentNode;\n if (parentNode)\n originalRemoveChild.call(parentNode, childNode);\n childWrapper. previousSibling_ = childWrapper.nextSibling_ =\n childWrapper.parentN ode_ = null;\n childWrapper = nextSibling;\n }\n wrapper.firstC hild_ = wrapper.lastChild_ = null;\n } else {\n var node = unwrap(wrappe r);\n var child = node.firstChild;\n var nextSibling;\n while (ch ild) {\n nextSibling = child.nextSibling;\n originalRemoveChild.ca ll(node, child);\n child = nextSibling;\n }\n }\n }\n\n functio n invalidateParent(node) {\n var p = node.parentNode;\n return p && p.inva lidateShadowRenderer();\n }\n\n function cleanupNodes(nodes) {\n for (var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\n n.parentNode.remov eChild(n);\n }\n }\n\n var originalImportNode = document.importNode;\n var originalCloneNode = window.Node.prototype.cloneNode;\n\n function cloneNode(no de, deep, opt_doc) {\n var clone;\n if (opt_doc)\n clone = wrap(origi nalImportNode.call(opt_doc, node.impl, false));\n else\n clone = wrap(or iginalCloneNode.call(node.impl, false));\n\n if (deep) {\n for (var chil d = node.firstChild; child; child = child.nextSibling) {\n clone.appendCh ild(cloneNode(child, true, opt_doc));\n }\n\n if (node instanceof wrap pers.HTMLTemplateElement) {\n var cloneContent = clone.content;\n for (var child = node.content.firstChild;\n child;\n chi ld = child.nextSibling) {\n cloneContent.appendChild(cloneNode(child, tr ue, opt_doc));\n }\n }\n }\n // TODO(arv): Some HTML elements also clone other data like value.\n return clone;\n }\n\n var OriginalNode = window.Node;\n\n /**\n * This represents a wrapper of a native DOM node.\n * @param {!Node} original The original DOM node, aka, the visual DOM node.\n * @constructor\n * @extends {EventTarget}\n */\n function Node(original) { \n assert(original instanceof OriginalNode);\n\n EventTarget.call(this, or iginal);\n\n // These properties are used to override the visual references w ith the\n // logical ones. If the value is undefined it means that the logica l is the\n // same as the visual.\n\n /**\n * @type {Node|undefined}\n * @private\n */\n this.parentNode_ = undefined;\n\n /**\n * @ type {Node|undefined}\n * @private\n */\n this.firstChild_ = undefine d;\n\n /**\n * @type {Node|undefined}\n * @private\n */\n this .lastChild_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @priv ate\n */\n this.nextSibling_ = undefined;\n\n /**\n * @type {Node| undefined}\n * @private\n */\n this.previousSibling_ = undefined;\n }\n\n var OriginalDocumentFragment = window.DocumentFragment;\n var originalAp pendChild = OriginalNode.prototype.appendChild;\n var originalCompareDocumentPo sition =\n OriginalNode.prototype.compareDocumentPosition;\n var originalI nsertBefore = OriginalNode.prototype.insertBefore;\n var originalRemoveChild = OriginalNode.prototype.removeChild;\n var originalReplaceChild = OriginalNode.p rototype.replaceChild;\n\n var isIe = /Trident/.test(navigator.userAgent);\n\n var removeChildOriginalHelper = isIe ?\n function(parent, child) {\n try {\n originalRemoveChild.call(parent, child);\n } catch (ex ) {\n if (!(parent instanceof OriginalDocumentFragment))\n t hrow ex;\n }\n } :\n function(parent, child) {\n origina lRemoveChild.call(parent, child);\n };\n\n Node.prototype = Object.create( EventTarget.prototype);\n mixin(Node.prototype, {\n appendChild: function(ch ildWrapper) {\n return this.insertBefore(childWrapper, null);\n },\n\n insertBefore: function(childWrapper, refWrapper) {\n assertIsNodeWrapper( childWrapper);\n\n var refNode;\n if (refWrapper) {\n if (isWra pper(refWrapper)) {\n refNode = unwrap(refWrapper);\n } else {\n refNode = refWrapper;\n refWrapper = wrap(refNode);\n }\n } else {\n refWrapper = null;\n refNode = null;\n }\ n\n refWrapper && assert(refWrapper.parentNode === this);\n\n var node s;\n var previousNode =\n refWrapper ? refWrapper.previousSibling : this.lastChild;\n\n var useNative = !this.invalidateShadowRenderer() &&\n !invalidateParent(childWrapper);\n\n if (useNative)\n nodes = collectNodesNative(childWrapper);\n else\n nodes = c ollectNodes(childWrapper, this, previousNode, refWrapper);\n\n if (useNativ e) {\n ensureSameOwnerDocument(this, childWrapper);\n clearChildNo des(this);\n originalInsertBefore.call(this.impl, unwrap(childWrapper), r efNode);\n } else {\n if (!previousNode)\n this.firstChild_ = nodes[0];\n if (!refWrapper)\n this.lastChild_ = nodes[nodes. length - 1];\n\n var parentNode = refNode ? refNode.parentNode : this.imp l;\n\n // insertBefore refWrapper no matter what the parent is?\n if (parentNode) {\n originalInsertBefore.call(parentNode,\n unwrapNodesForInsertion(this, nodes), refNode);\n } else {\n a doptNodesIfNeeded(this, nodes);\n }\n }\n\n enqueueMutation(thi s, 'childList', {\n addedNodes: nodes,\n nextSibling: refWrapper,\ n previousSibling: previousNode\n });\n\n nodesWereAdded(nodes) ;\n\n return childWrapper;\n },\n\n removeChild: function(childWrappe r) {\n assertIsNodeWrapper(childWrapper);\n if (childWrapper.parentNod e !== this) {\n // IE has invalid DOM trees at times.\n var found = false;\n var childNodes = this.childNodes;\n for (var ieChild = this.firstChild; ieChild;\n ieChild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\n found = true;\n brea k;\n }\n }\n if (!found) {\n // TODO(arv): DOMEx ception\n throw new Error('NotFoundError');\n }\n }\n\n var childNode = unwrap(childWrapper);\n var childWrapperNextSibling = chi ldWrapper.nextSibling;\n var childWrapperPreviousSibling = childWrapper.pre viousSibling;\n\n if (this.invalidateShadowRenderer()) {\n // We nee d to remove the real node from the DOM before updating the\n // pointers. This is so that that mutation event is dispatched before\n // the pointe rs have changed.\n var thisFirstChild = this.firstChild;\n var thi sLastChild = this.lastChild;\n\n var parentNode = childNode.parentNode;\n if (parentNode)\n removeChildOriginalHelper(parentNode, childNo de);\n\n if (thisFirstChild === childWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (thisLastChild === childWrapper)\n this.lastChild_ = childWrapperPreviousSibling;\n if (childWrapperPrev iousSibling)\n childWrapperPreviousSibling.nextSibling_ = childWrapperN extSibling;\n if (childWrapperNextSibling) {\n childWrapperNextS ibling.previousSibling_ =\n childWrapperPreviousSibling;\n } \n\n childWrapper.previousSibling_ = childWrapper.nextSibling_ =\n childWrapper.parentNode_ = undefined;\n } else {\n clearChildNo des(this);\n removeChildOriginalHelper(this.impl, childNode);\n }\n\ n if (!surpressMutations) {\n enqueueMutation(this, 'childList', {\n removedNodes: createOneElementNodeList(childWrapper),\n nextS ibling: childWrapperNextSibling,\n previousSibling: childWrapperPreviou sSibling\n });\n }\n\n registerTransientObservers(this, childWr apper);\n\n return childWrapper;\n },\n\n replaceChild: function(newC hildWrapper, oldChildWrapper) {\n assertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if (isWrapper(oldChildWrapper)) {\n oldChi ldNode = unwrap(oldChildWrapper);\n } else {\n oldChildNode = oldChi ldWrapper;\n oldChildWrapper = wrap(oldChildNode);\n }\n\n if ( oldChildWrapper.parentNode !== this) {\n // TODO(arv): DOMException\n throw new Error('NotFoundError');\n }\n\n var nextNode = oldChildW rapper.nextSibling;\n var previousNode = oldChildWrapper.previousSibling;\n var nodes;\n\n var useNative = !this.invalidateShadowRenderer() &&\n !invalidateParent(newChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNative(newChildWrapper);\n } else {\n if (nextNode === newChildWrapper)\n nextNode = newChildWrapper.nextSi bling;\n nodes = collectNodes(newChildWrapper, this, previousNode, nextNo de);\n }\n\n if (!useNative) {\n if (this.firstChild === oldChi ldWrapper)\n this.firstChild_ = nodes[0];\n if (this.lastChild = == oldChildWrapper)\n this.lastChild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibling_ = oldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ = undefined;\n\n // replaceChild no matte r what the parent is?\n if (oldChildNode.parentNode) {\n origina lReplaceChild.call(\n oldChildNode.parentNode,\n unwra pNodesForInsertion(this, nodes),\n oldChildNode);\n }\n } else {\n ensureSameOwnerDocument(this, newChildWrapper);\n clea rChildNodes(this);\n originalReplaceChild.call(this.impl, unwrap(newChild Wrapper),\n oldChildNode);\n }\n\n en queueMutation(this, 'childList', {\n addedNodes: nodes,\n removedN odes: createOneElementNodeList(oldChildWrapper),\n nextSibling: nextNode, \n previousSibling: previousNode\n });\n\n nodeWasRemoved(oldCh ildWrapper);\n nodesWereAdded(nodes);\n\n return oldChildWrapper;\n },\n\n /**\n * Called after a node was inserted. Subclasses override thi s to invalidate\n * the renderer as needed.\n * @private\n */\n n odeIsInserted_: function() {\n for (var child = this.firstChild; child; chi ld = child.nextSibling) {\n child.nodeIsInserted_();\n }\n },\n\n hasChildNodes: function() {\n return this.firstChild !== null;\n },\ n\n /** @type {Node} */\n get parentNode() {\n // If the parentNode h as not been overridden, use the original parentNode.\n return this.parentNo de_ !== undefined ?\n this.parentNode_ : wrap(this.impl.parentNode);\n },\n\n /** @type {Node} */\n get firstChild() {\n return this.firs tChild_ !== undefined ?\n this.firstChild_ : wrap(this.impl.firstChild) ;\n },\n\n /** @type {Node} */\n get lastChild() {\n return this.l astChild_ !== undefined ?\n this.lastChild_ : wrap(this.impl.lastChild) ;\n },\n\n /** @type {Node} */\n get nextSibling() {\n return this .nextSibling_ !== undefined ?\n this.nextSibling_ : wrap(this.impl.next Sibling);\n },\n\n /** @type {Node} */\n get previousSibling() {\n return this.previousSibling_ !== undefined ?\n this.previousSibling_ : wrap(this.impl.previousSibling);\n },\n\n get parentElement() {\n va r p = this.parentNode;\n while (p && p.nodeType !== Node.ELEMENT_NODE) {\n p = p.parentNode;\n }\n return p;\n },\n\n get textConten t() {\n // TODO(arv): This should fallback to this.impl.textContent if ther e\n // are no shadow trees below or above the context node.\n var s = '';\n for (var child = this.firstChild; child; child = child.nextSibling) { \n if (child.nodeType != Node.COMMENT_NODE) {\n s += child.textC ontent;\n }\n }\n return s;\n },\n set textContent(textCo ntent) {\n var removedNodes = snapshotNodeList(this.childNodes);\n\n i f (this.invalidateShadowRenderer()) {\n removeAllChildNodes(this);\n if (textContent !== '') {\n var textNode = this.impl.ownerDocument.c reateTextNode(textContent);\n this.appendChild(textNode);\n }\n } else {\n clearChildNodes(this);\n this.impl.textContent = t extContent;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes) ;\n\n enqueueMutation(this, 'childList', {\n addedNodes: addedNodes, \n removedNodes: removedNodes\n });\n\n nodesWereRemoved(remove dNodes);\n nodesWereAdded(addedNodes);\n },\n\n get childNodes() {\n var wrapperList = new NodeList();\n var i = 0;\n for (var child = this.firstChild; child; child = child.nextSibling) {\n wrapperList[i++] = child;\n }\n wrapperList.length = i;\n return wrapperList;\n },\n\n cloneNode: function(deep) {\n return cloneNode(this, deep);\n },\n\n contains: function(child) {\n if (!child)\n return false; \n\n child = wrapIfNeeded(child);\n\n // TODO(arv): Optimize using own erDocument etc.\n if (child === this)\n return true;\n var pare ntNode = child.parentNode;\n if (!parentNode)\n return false;\n return this.contains(parentNode);\n },\n\n compareDocumentPosition: funct ion(otherNode) {\n // This only wraps, it therefore only operates on the co mposed DOM and not\n // the logical DOM.\n return originalCompareDocum entPosition.call(this.impl, unwrap(otherNode));\n },\n\n normalize: functi on() {\n var nodes = snapshotNodeList(this.childNodes);\n var remNodes = [];\n var s = '';\n var modNode;\n\n for (var i = 0, n; i < no des.length; i++) {\n n = nodes[i];\n if (n.nodeType === Node.TEXT_ NODE) {\n if (!modNode && !n.data.length)\n this.removeNode( n);\n else if (!modNode)\n modNode = n;\n else {\n s += n.data;\n remNodes.push(n);\n }\n } e lse {\n if (modNode && remNodes.length) {\n modNode.data += s;\n cleanUpNodes(remNodes);\n }\n remNodes = [];\n s = '';\n modNode = null;\n if (n.childNodes.length) \n n.normalize();\n }\n }\n\n // handle case where > 1 text nodes are the last children\n if (modNode && remNodes.length) {\n modNode.data += s;\n cleanupNodes(remNodes);\n }\n }\n });\ n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We use a DocumentFragment as a base and then delete the properties of\n // DocumentFragment.prototype fro m the wrapper Node. Since delete makes\n // objects slow in some JS engines we recreate the prototype object.\n registerWrapper(OriginalNode, Node, document.c reateDocumentFragment());\n delete Node.prototype.querySelector;\n delete Node .prototype.querySelectorAll;\n Node.prototype = mixin(Object.create(EventTarget .prototype), Node.prototype);\n\n scope.nodeWasAdded = nodeWasAdded;\n scope.n odeWasRemoved = nodeWasRemoved;\n scope.nodesWereAdded = nodesWereAdded;\n sco pe.nodesWereRemoved = nodesWereRemoved;\n scope.snapshotNodeList = snapshotNode List;\n scope.wrappers.Node = Node;\n scope.cloneNode = cloneNode;\n\n})(windo w.ShadowDOMPolyfill);\n", 118 "/**\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in t he LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var EventTarge t = scope.wrappers.EventTarget;\n var NodeList = scope.wrappers.NodeList;\n va r TreeScope = scope.TreeScope;\n var assert = scope.assert;\n var defineWrapGe tter = scope.defineWrapGetter;\n var enqueueMutation = scope.enqueueMutation;\n var getTreeScope = scope.getTreeScope;\n var isWrapper = scope.isWrapper;\n var mixin = scope.mixin;\n var registerTransientObservers = scope.registerTrans ientObservers;\n var registerWrapper = scope.registerWrapper;\n var setTreeSco pe = scope.setTreeScope;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap; \n var wrapIfNeeded = scope.wrapIfNeeded;\n var wrappers = scope.wrappers;\n\n function assertIsNodeWrapper(node) {\n assert(node instanceof Node);\n }\n \n function createOneElementNodeList(node) {\n var nodes = new NodeList();\n nodes[0] = node;\n nodes.length = 1;\n return nodes;\n }\n\n var sur pressMutations = false;\n\n /**\n * Called before node is inserted into a nod e to enqueue its removal from its\n * old parent.\n * @param {!Node} node Th e node that is about to be removed.\n * @param {!Node} parent The parent node that the node is being removed from.\n * @param {!NodeList} nodes The collecte d nodes.\n */\n function enqueueRemovalForInsertedNodes(node, parent, nodes) {\n enqueueMutation(parent, 'childList', {\n removedNodes: nodes,\n previousSibling: node.previousSibling,\n nextSibling: node.nextSibling\n });\n }\n\n function enqueueRemovalForInsertedDocumentFragment(df, nodes) {\ n enqueueMutation(df, 'childList', {\n removedNodes: nodes\n });\n } \n\n /**\n * Collects nodes from a DocumentFragment or a Node for removal fol lowed\n * by an insertion.\n *\n * This updates the internal pointers for node, previousNode and nextNode.\n */\n function collectNodes(node, parentNod e, previousNode, nextNode) {\n if (node instanceof DocumentFragment) {\n var nodes = collectNodesForDocumentFragment(node);\n\n // The extra loop i s to work around bugs with DocumentFragments in IE.\n surpressMutations = t rue;\n for (var i = nodes.length - 1; i >= 0; i--) {\n node.removeCh ild(nodes[i]);\n nodes[i].parentNode_ = parentNode;\n }\n surpr essMutations = false;\n\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].previousSibling_ = nodes[i - 1] || previousNode;\n nodes[i].nex tSibling_ = nodes[i + 1] || nextNode;\n }\n\n if (previousNode)\n previousNode.nextSibling_ = nodes[0];\n if (nextNode)\n nextNode. previousSibling_ = nodes[nodes.length - 1];\n\n return nodes;\n }\n\n var nodes = createOneElementNodeList(node);\n var oldParent = node.parentNod e;\n if (oldParent) {\n // This will enqueue the mutation record for the removal as needed.\n oldParent.removeChild(node);\n }\n\n node.paren tNode_ = parentNode;\n node.previousSibling_ = previousNode;\n node.nextSi bling_ = nextNode;\n if (previousNode)\n previousNode.nextSibling_ = nod e;\n if (nextNode)\n nextNode.previousSibling_ = node;\n\n return nod es;\n }\n\n function collectNodesNative(node) {\n if (node instanceof Docum entFragment)\n return collectNodesForDocumentFragment(node);\n\n var nod es = createOneElementNodeList(node);\n var oldParent = node.parentNode;\n if (oldParent)\n enqueueRemovalForInsertedNodes(node, oldParent, nodes);\n return nodes;\n }\n\n function collectNodesForDocumentFragment(node) {\n var nodes = new NodeList();\n var i = 0;\n for (var child = node.firstChi ld; child; child = child.nextSibling) {\n nodes[i++] = child;\n }\n n odes.length = i;\n enqueueRemovalForInsertedDocumentFragment(node, nodes);\n return nodes;\n }\n\n function snapshotNodeList(nodeList) {\n // NodeLis ts are not live at the moment so just return the same object.\n return nodeLi st;\n }\n\n // http://dom.spec.whatwg.org/#node-is-inserted\n function nodeWa sAdded(node, treeScope) {\n setTreeScope(node, treeScope);\n node.nodeIsIn serted_();\n }\n\n function nodesWereAdded(nodes, parent) {\n var treeScope = getTreeScope(parent);\n for (var i = 0; i < nodes.length; i++) {\n no deWasAdded(nodes[i], treeScope);\n }\n }\n\n // http://dom.spec.whatwg.org/ #node-is-removed\n function nodeWasRemoved(node) {\n setTreeScope(node, new TreeScope(node, null));\n }\n\n function nodesWereRemoved(nodes) {\n for (v ar i = 0; i < nodes.length; i++) {\n nodeWasRemoved(nodes[i]);\n }\n }\ n\n function ensureSameOwnerDocument(parent, child) {\n var ownerDoc = paren t.nodeType === Node.DOCUMENT_NODE ?\n parent : parent.ownerDocument;\n if (ownerDoc !== child.ownerDocument)\n ownerDoc.adoptNode(child);\n }\n\ n function adoptNodesIfNeeded(owner, nodes) {\n if (!nodes.length)\n re turn;\n\n var ownerDoc = owner.ownerDocument;\n\n // All nodes have the sa me ownerDocument when we get here.\n if (ownerDoc === nodes[0].ownerDocument) \n return;\n\n for (var i = 0; i < nodes.length; i++) {\n scope.ado ptNodeNoRemove(nodes[i], ownerDoc);\n }\n }\n\n function unwrapNodesForInse rtion(owner, nodes) {\n adoptNodesIfNeeded(owner, nodes);\n var length = n odes.length;\n\n if (length === 1)\n return unwrap(nodes[0]);\n\n var df = unwrap(owner.ownerDocument.createDocumentFragment());\n for (var i = 0; i < length; i++) {\n df.appendChild(unwrap(nodes[i]));\n }\n return df;\n }\n\n function clearChildNodes(wrapper) {\n if (wrapper.firstChild_ ! == undefined) {\n var child = wrapper.firstChild_;\n while (child) {\n var tmp = child;\n child = child.nextSibling_;\n tmp.paren tNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefined;\n }\n }\n wrapper.firstChild_ = wrapper.lastChild_ = undefined;\n }\n\n function remo veAllChildNodes(wrapper) {\n if (wrapper.invalidateShadowRenderer()) {\n var childWrapper = wrapper.firstChild;\n while (childWrapper) {\n a ssert(childWrapper.parentNode === wrapper);\n var nextSibling = childWrap per.nextSibling;\n var childNode = unwrap(childWrapper);\n var par entNode = childNode.parentNode;\n if (parentNode)\n originalRemo veChild.call(parentNode, childNode);\n childWrapper.previousSibling_ = ch ildWrapper.nextSibling_ =\n childWrapper.parentNode_ = null;\n childWrapper = nextSibling;\n }\n wrapper.firstChild_ = wrapper.lastC hild_ = null;\n } else {\n var node = unwrap(wrapper);\n var child = node.firstChild;\n var nextSibling;\n while (child) {\n nextS ibling = child.nextSibling;\n originalRemoveChild.call(node, child);\n child = nextSibling;\n }\n }\n }\n\n function invalidateParent(no de) {\n var p = node.parentNode;\n return p && p.invalidateShadowRenderer( );\n }\n\n function cleanupNodes(nodes) {\n for (var i = 0, n; i < nodes.le ngth; i++) {\n n = nodes[i];\n n.parentNode.removeChild(n);\n }\n }\n\n var originalImportNode = document.importNode;\n var originalCloneNode = window.Node.prototype.cloneNode;\n\n function cloneNode(node, deep, opt_doc) {\ n var clone;\n if (opt_doc)\n clone = wrap(originalImportNode.call(op t_doc, node.impl, false));\n else\n clone = wrap(originalCloneNode.call( node.impl, false));\n\n if (deep) {\n for (var child = node.firstChild; child; child = child.nextSibling) {\n clone.appendChild(cloneNode(child, true, opt_doc));\n }\n\n if (node instanceof wrappers.HTMLTemplateElem ent) {\n var cloneContent = clone.content;\n for (var child = node .content.firstChild;\n child;\n child = child.nextSiblin g) {\n cloneContent.appendChild(cloneNode(child, true, opt_doc));\n }\n }\n }\n // TODO(arv): Some HTML elements also clone other data like value.\n return clone;\n }\n\n function contains(self, child) {\n if (!child || getTreeScope(self) !== getTreeScope(child))\n return false;\n \n for (var node = child; node; node = node.parentNode) {\n if (node === self)\n return true;\n }\n return false;\n }\n\n var OriginalNod e = window.Node;\n\n /**\n * This represents a wrapper of a native DOM node.\ n * @param {!Node} original The original DOM node, aka, the visual DOM node.\n * @constructor\n * @extends {EventTarget}\n */\n function Node(original) {\n assert(original instanceof OriginalNode);\n\n EventTarget.call(this, original);\n\n // These properties are used to override the visual references with the\n // logical ones. If the value is undefined it means that the logi cal is the\n // same as the visual.\n\n /**\n * @type {Node|undefined} \n * @private\n */\n this.parentNode_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @private\n */\n this.firstChild_ = undefi ned;\n\n /**\n * @type {Node|undefined}\n * @private\n */\n th is.lastChild_ = undefined;\n\n /**\n * @type {Node|undefined}\n * @pr ivate\n */\n this.nextSibling_ = undefined;\n\n /**\n * @type {Nod e|undefined}\n * @private\n */\n this.previousSibling_ = undefined;\n \n this.treeScope_ = undefined;\n }\n\n var OriginalDocumentFragment = wind ow.DocumentFragment;\n var originalAppendChild = OriginalNode.prototype.appendC hild;\n var originalCompareDocumentPosition =\n OriginalNode.prototype.com pareDocumentPosition;\n var originalInsertBefore = OriginalNode.prototype.inser tBefore;\n var originalRemoveChild = OriginalNode.prototype.removeChild;\n var originalReplaceChild = OriginalNode.prototype.replaceChild;\n\n var isIe = /Tr ident/.test(navigator.userAgent);\n\n var removeChildOriginalHelper = isIe ?\n function(parent, child) {\n try {\n originalRemoveChild.cal l(parent, child);\n } catch (ex) {\n if (!(parent instanceof Ori ginalDocumentFragment))\n throw ex;\n }\n } :\n func tion(parent, child) {\n originalRemoveChild.call(parent, child);\n } ;\n\n Node.prototype = Object.create(EventTarget.prototype);\n mixin(Node.prot otype, {\n appendChild: function(childWrapper) {\n return this.insertBef ore(childWrapper, null);\n },\n\n insertBefore: function(childWrapper, ref Wrapper) {\n assertIsNodeWrapper(childWrapper);\n\n var refNode;\n if (refWrapper) {\n if (isWrapper(refWrapper)) {\n refNode = u nwrap(refWrapper);\n } else {\n refNode = refWrapper;\n refWrapper = wrap(refNode);\n }\n } else {\n refWrapper = nu ll;\n refNode = null;\n }\n\n refWrapper && assert(refWrapper.p arentNode === this);\n\n var nodes;\n var previousNode =\n re fWrapper ? refWrapper.previousSibling : this.lastChild;\n\n var useNative = !this.invalidateShadowRenderer() &&\n !invalidateParent(ch ildWrapper);\n\n if (useNative)\n nodes = collectNodesNative(childWr apper);\n else\n nodes = collectNodes(childWrapper, this, previousNo de, refWrapper);\n\n if (useNative) {\n ensureSameOwnerDocument(this , childWrapper);\n clearChildNodes(this);\n originalInsertBefore.c all(this.impl, unwrap(childWrapper), refNode);\n } else {\n if (!pre viousNode)\n this.firstChild_ = nodes[0];\n if (!refWrapper)\n this.lastChild_ = nodes[nodes.length - 1];\n\n var parentNode = r efNode ? refNode.parentNode : this.impl;\n\n // insertBefore refWrapper n o matter what the parent is?\n if (parentNode) {\n originalInser tBefore.call(parentNode,\n unwrapNodesForInsertion(this, nodes), re fNode);\n } else {\n adoptNodesIfNeeded(this, nodes);\n } \n }\n\n enqueueMutation(this, 'childList', {\n addedNodes: nod es,\n nextSibling: refWrapper,\n previousSibling: previousNode\n });\n\n nodesWereAdded(nodes, this);\n\n return childWrapper;\n },\n\n removeChild: function(childWrapper) {\n assertIsNodeWrapper(chil dWrapper);\n if (childWrapper.parentNode !== this) {\n // IE has inv alid DOM trees at times.\n var found = false;\n var childNodes = t his.childNodes;\n for (var ieChild = this.firstChild; ieChild;\n ieChild = ieChild.nextSibling) {\n if (ieChild === childWrapper) {\ n found = true;\n break;\n }\n }\n if (!found) {\n // TODO(arv): DOMException\n throw new Error(' NotFoundError');\n }\n }\n\n var childNode = unwrap(childWrappe r);\n var childWrapperNextSibling = childWrapper.nextSibling;\n var ch ildWrapperPreviousSibling = childWrapper.previousSibling;\n\n if (this.inva lidateShadowRenderer()) {\n // We need to remove the real node from the D OM before updating the\n // pointers. This is so that that mutation event is dispatched before\n // the pointers have changed.\n var thisFi rstChild = this.firstChild;\n var thisLastChild = this.lastChild;\n\n var parentNode = childNode.parentNode;\n if (parentNode)\n r emoveChildOriginalHelper(parentNode, childNode);\n\n if (thisFirstChild = == childWrapper)\n this.firstChild_ = childWrapperNextSibling;\n if (thisLastChild === childWrapper)\n this.lastChild_ = childWrapperPr eviousSibling;\n if (childWrapperPreviousSibling)\n childWrapper PreviousSibling.nextSibling_ = childWrapperNextSibling;\n if (childWrappe rNextSibling) {\n childWrapperNextSibling.previousSibling_ =\n childWrapperPreviousSibling;\n }\n\n childWrapper.previousSib ling_ = childWrapper.nextSibling_ =\n childWrapper.parentNode_ = unde fined;\n } else {\n clearChildNodes(this);\n removeChildOrigi nalHelper(this.impl, childNode);\n }\n\n if (!surpressMutations) {\n enqueueMutation(this, 'childList', {\n removedNodes: createOneEle mentNodeList(childWrapper),\n nextSibling: childWrapperNextSibling,\n previousSibling: childWrapperPreviousSibling\n });\n }\n\n registerTransientObservers(this, childWrapper);\n\n return childWrapper ;\n },\n\n replaceChild: function(newChildWrapper, oldChildWrapper) {\n assertIsNodeWrapper(newChildWrapper);\n\n var oldChildNode;\n if (i sWrapper(oldChildWrapper)) {\n oldChildNode = unwrap(oldChildWrapper);\n } else {\n oldChildNode = oldChildWrapper;\n oldChildWrapper = wrap(oldChildNode);\n }\n\n if (oldChildWrapper.parentNode !== this) {\n // TODO(arv): DOMException\n throw new Error('NotFoundError') ;\n }\n\n var nextNode = oldChildWrapper.nextSibling;\n var previ ousNode = oldChildWrapper.previousSibling;\n var nodes;\n\n var useNat ive = !this.invalidateShadowRenderer() &&\n !invalidatePare nt(newChildWrapper);\n\n if (useNative) {\n nodes = collectNodesNati ve(newChildWrapper);\n } else {\n if (nextNode === newChildWrapper)\ n nextNode = newChildWrapper.nextSibling;\n nodes = collectNodes (newChildWrapper, this, previousNode, nextNode);\n }\n\n if (!useNativ e) {\n if (this.firstChild === oldChildWrapper)\n this.firstChil d_ = nodes[0];\n if (this.lastChild === oldChildWrapper)\n this. lastChild_ = nodes[nodes.length - 1];\n\n oldChildWrapper.previousSibling _ = oldChildWrapper.nextSibling_ =\n oldChildWrapper.parentNode_ = un defined;\n\n // replaceChild no matter what the parent is?\n if (o ldChildNode.parentNode) {\n originalReplaceChild.call(\n o ldChildNode.parentNode,\n unwrapNodesForInsertion(this, nodes),\n oldChildNode);\n }\n } else {\n ensureSameOwnerDo cument(this, newChildWrapper);\n clearChildNodes(this);\n original ReplaceChild.call(this.impl, unwrap(newChildWrapper),\n oldChildNode);\n }\n\n enqueueMutation(this, 'childList', {\n addedNodes: nodes,\n removedNodes: createOneElementNodeList(oldCh ildWrapper),\n nextSibling: nextNode,\n previousSibling: previousN ode\n });\n\n nodeWasRemoved(oldChildWrapper);\n nodesWereAdded(n odes, this);\n\n return oldChildWrapper;\n },\n\n /**\n * Called after a node was inserted. Subclasses override this to invalidate\n * the re nderer as needed.\n * @private\n */\n nodeIsInserted_: function() {\n for (var child = this.firstChild; child; child = child.nextSibling) {\n child.nodeIsInserted_();\n }\n },\n\n hasChildNodes: function() {\n return this.firstChild !== null;\n },\n\n /** @type {Node} */\n get parentNode() {\n // If the parentNode has not been overridden, use th e original parentNode.\n return this.parentNode_ !== undefined ?\n this.parentNode_ : wrap(this.impl.parentNode);\n },\n\n /** @type {Node} */\n get firstChild() {\n return this.firstChild_ !== undefined ?\n this.firstChild_ : wrap(this.impl.firstChild);\n },\n\n /** @type {No de} */\n get lastChild() {\n return this.lastChild_ !== undefined ?\n this.lastChild_ : wrap(this.impl.lastChild);\n },\n\n /** @type {No de} */\n get nextSibling() {\n return this.nextSibling_ !== undefined ?\ n this.nextSibling_ : wrap(this.impl.nextSibling);\n },\n\n /** @ type {Node} */\n get previousSibling() {\n return this.previousSibling_ !== undefined ?\n this.previousSibling_ : wrap(this.impl.previousSiblin g);\n },\n\n get parentElement() {\n var p = this.parentNode;\n while (p && p.nodeType !== Node.ELEMENT_NODE) {\n p = p.parentNode;\n }\n return p;\n },\n\n get textContent() {\n // TODO(arv): Thi s should fallback to this.impl.textContent if there\n // are no shadow tree s below or above the context node.\n var s = '';\n for (var child = th is.firstChild; child; child = child.nextSibling) {\n if (child.nodeType ! = Node.COMMENT_NODE) {\n s += child.textContent;\n }\n }\n return s;\n },\n set textContent(textContent) {\n var removedNod es = snapshotNodeList(this.childNodes);\n\n if (this.invalidateShadowRender er()) {\n removeAllChildNodes(this);\n if (textContent !== '') {\n var textNode = this.impl.ownerDocument.createTextNode(textContent);\n this.appendChild(textNode);\n }\n } else {\n clearCh ildNodes(this);\n this.impl.textContent = textContent;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes);\n\n enqueueMutation(thi s, 'childList', {\n addedNodes: addedNodes,\n removedNodes: remove dNodes\n });\n\n nodesWereRemoved(removedNodes);\n nodesWereAdded (addedNodes, this);\n },\n\n get childNodes() {\n var wrapperList = n ew NodeList();\n var i = 0;\n for (var child = this.firstChild; child; child = child.nextSibling) {\n wrapperList[i++] = child;\n }\n wrapperList.length = i;\n return wrapperList;\n },\n\n cloneNode: fu nction(deep) {\n return cloneNode(this, deep);\n },\n\n contains: fun ction(child) {\n return contains(this, wrapIfNeeded(child));\n },\n\n compareDocumentPosition: function(otherNode) {\n // This only wraps, it th erefore only operates on the composed DOM and not\n // the logical DOM.\n return originalCompareDocumentPosition.call(this.impl, unwrap(otherNode));\n },\n\n normalize: function() {\n var nodes = snapshotNodeList(this.c hildNodes);\n var remNodes = [];\n var s = '';\n var modNode;\n\n for (var i = 0, n; i < nodes.length; i++) {\n n = nodes[i];\n if (n.nodeType === Node.TEXT_NODE) {\n if (!modNode && !n.data.length )\n this.removeNode(n);\n else if (!modNode)\n mo dNode = n;\n else {\n s += n.data;\n remNodes.pus h(n);\n }\n } else {\n if (modNode && remNodes.length) {\n modNode.data += s;\n cleanUpNodes(remNodes);\n }\n remNodes = [];\n s = '';\n modNode = null;\n if (n.childNodes.length)\n n.normalize();\n }\n }\ n\n // handle case where >1 text nodes are the last children\n if (mod Node && remNodes.length) {\n modNode.data += s;\n cleanupNodes(rem Nodes);\n }\n }\n });\n\n defineWrapGetter(Node, 'ownerDocument');\n\n // We use a DocumentFragment as a base and then delete the properties of\n // DocumentFragment.prototype from the wrapper Node. Since delete makes\n // obje cts slow in some JS engines we recreate the prototype object.\n registerWrapper (OriginalNode, Node, document.createDocumentFragment());\n delete Node.prototyp e.querySelector;\n delete Node.prototype.querySelectorAll;\n Node.prototype = mixin(Object.create(EventTarget.prototype), Node.prototype);\n\n scope.cloneNod e = cloneNode;\n scope.nodeWasAdded = nodeWasAdded;\n scope.nodeWasRemoved = n odeWasRemoved;\n scope.nodesWereAdded = nodesWereAdded;\n scope.nodesWereRemov ed = nodesWereRemoved;\n scope.snapshotNodeList = snapshotNodeList;\n scope.wr appers.Node = Node;\n\n})(window.ShadowDOMPolyfill);\n",
116 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LIC ENSE file.\n\n(function(scope) {\n 'use strict';\n\n function findOne(node, se lector) {\n var m, el = node.firstElementChild;\n while (el) {\n if ( el.matches(selector))\n return el;\n m = findOne(el, selector);\n if (m)\n return m;\n el = el.nextElementSibling;\n }\n retu rn null;\n }\n\n function findAll(node, selector, results) {\n var el = nod e.firstElementChild;\n while (el) {\n if (el.matches(selector))\n results[results.length++] = el;\n findAll(el, selector, results);\n e l = el.nextElementSibling;\n }\n return results;\n }\n\n // find and fin dAll will only match Simple Selectors,\n // Structural Pseudo Classes are not g uarenteed to be correct\n // http://www.w3.org/TR/css3-selectors/#simple-select ors\n\n var SelectorsInterface = {\n querySelector: function(selector) {\n return findOne(this, selector);\n },\n querySelectorAll: function(sele ctor) {\n return findAll(this, selector, new NodeList())\n }\n };\n\n var GetElementsByInterface = {\n getElementsByTagName: function(tagName) {\n // TODO(arv): Check tagName?\n return this.querySelectorAll(tagName);\ n },\n getElementsByClassName: function(className) {\n // TODO(arv): Check className?\n return this.querySelectorAll('.' + className);\n },\n getElementsByTagNameNS: function(ns, tagName) {\n if (ns === '*')\n return this.getElementsByTagName(tagName);\n\n // TODO(arv): Check tagN ame?\n var result = new NodeList;\n var els = this.getElementsByTagNam e(tagName);\n for (var i = 0, j = 0; i < els.length; i++) {\n if (el s[i].namespaceURI === ns)\n result[j++] = els[i];\n }\n resul t.length = j;\n return result;\n }\n };\n\n scope.GetElementsByInterfa ce = GetElementsByInterface;\n scope.SelectorsInterface = SelectorsInterface;\n \n})(window.ShadowDOMPolyfill);\n", 119 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LIC ENSE file.\n\n(function(scope) {\n 'use strict';\n\n function findOne(node, se lector) {\n var m, el = node.firstElementChild;\n while (el) {\n if ( el.matches(selector))\n return el;\n m = findOne(el, selector);\n if (m)\n return m;\n el = el.nextElementSibling;\n }\n retu rn null;\n }\n\n function findAll(node, selector, results) {\n var el = nod e.firstElementChild;\n while (el) {\n if (el.matches(selector))\n results[results.length++] = el;\n findAll(el, selector, results);\n e l = el.nextElementSibling;\n }\n return results;\n }\n\n // find and fin dAll will only match Simple Selectors,\n // Structural Pseudo Classes are not g uarenteed to be correct\n // http://www.w3.org/TR/css3-selectors/#simple-select ors\n\n var SelectorsInterface = {\n querySelector: function(selector) {\n return findOne(this, selector);\n },\n querySelectorAll: function(sele ctor) {\n return findAll(this, selector, new NodeList())\n }\n };\n\n var GetElementsByInterface = {\n getElementsByTagName: function(tagName) {\n // TODO(arv): Check tagName?\n return this.querySelectorAll(tagName);\ n },\n getElementsByClassName: function(className) {\n // TODO(arv): Check className?\n return this.querySelectorAll('.' + className);\n },\n getElementsByTagNameNS: function(ns, tagName) {\n if (ns === '*')\n return this.getElementsByTagName(tagName);\n\n // TODO(arv): Check tagN ame?\n var result = new NodeList;\n var els = this.getElementsByTagNam e(tagName);\n for (var i = 0, j = 0; i < els.length; i++) {\n if (el s[i].namespaceURI === ns)\n result[j++] = els[i];\n }\n resul t.length = j;\n return result;\n }\n };\n\n scope.GetElementsByInterfa ce = GetElementsByInterface;\n scope.SelectorsInterface = SelectorsInterface;\n \n})(window.ShadowDOMPolyfill);\n",
117 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var NodeList = scope.wra ppers.NodeList;\n\n function forwardElement(node) {\n while (node && node.no deType !== Node.ELEMENT_NODE) {\n node = node.nextSibling;\n }\n retu rn node;\n }\n\n function backwardsElement(node) {\n while (node && node.no deType !== Node.ELEMENT_NODE) {\n node = node.previousSibling;\n }\n return node;\n }\n\n var ParentNodeInterface = {\n get firstElementChild() {\n return forwardElement(this.firstChild);\n },\n\n get lastElementC hild() {\n return backwardsElement(this.lastChild);\n },\n\n get chil dElementCount() {\n var count = 0;\n for (var child = this.firstElemen tChild;\n child;\n child = child.nextElementSibling) {\n count++;\n }\n return count;\n },\n\n get children() {\n var wrapperList = new NodeList();\n var i = 0;\n for (var child = th is.firstElementChild;\n child;\n child = child.nextElementSi bling) {\n wrapperList[i++] = child;\n }\n wrapperList.length = i;\n return wrapperList;\n }\n };\n\n var ChildNodeInterface = {\n get nextElementSibling() {\n return forwardElement(this.nextSibling);\n },\n\n get previousElementSibling() {\n return backwardsElement(this.pr eviousSibling);\n }\n };\n\n scope.ChildNodeInterface = ChildNodeInterface; \n scope.ParentNodeInterface = ParentNodeInterface;\n\n})(window.ShadowDOMPolyf ill);\n", 120 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var NodeList = scope.wra ppers.NodeList;\n\n function forwardElement(node) {\n while (node && node.no deType !== Node.ELEMENT_NODE) {\n node = node.nextSibling;\n }\n retu rn node;\n }\n\n function backwardsElement(node) {\n while (node && node.no deType !== Node.ELEMENT_NODE) {\n node = node.previousSibling;\n }\n return node;\n }\n\n var ParentNodeInterface = {\n get firstElementChild() {\n return forwardElement(this.firstChild);\n },\n\n get lastElementC hild() {\n return backwardsElement(this.lastChild);\n },\n\n get chil dElementCount() {\n var count = 0;\n for (var child = this.firstElemen tChild;\n child;\n child = child.nextElementSibling) {\n count++;\n }\n return count;\n },\n\n get children() {\n var wrapperList = new NodeList();\n var i = 0;\n for (var child = th is.firstElementChild;\n child;\n child = child.nextElementSi bling) {\n wrapperList[i++] = child;\n }\n wrapperList.length = i;\n return wrapperList;\n }\n };\n\n var ChildNodeInterface = {\n get nextElementSibling() {\n return forwardElement(this.nextSibling);\n },\n\n get previousElementSibling() {\n return backwardsElement(this.pr eviousSibling);\n }\n };\n\n scope.ChildNodeInterface = ChildNodeInterface; \n scope.ParentNodeInterface = ParentNodeInterface;\n\n})(window.ShadowDOMPolyf ill);\n",
118 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface = scope.ChildNodeInterface;\n var Node = scope.wrappers.Node;\n var enqueueMuta tion = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalCharacterData = window.CharacterData; \n\n function CharacterData(node) {\n Node.call(this, node);\n }\n Charact erData.prototype = Object.create(Node.prototype);\n mixin(CharacterData.prototy pe, {\n get textContent() {\n return this.data;\n },\n set textCon tent(value) {\n this.data = value;\n },\n get data() {\n return this.impl.data;\n },\n set data(value) {\n var oldValue = this.impl.d ata;\n enqueueMutation(this, 'characterData', {\n oldValue: oldValue \n });\n this.impl.data = value;\n }\n });\n\n mixin(CharacterDat a.prototype, ChildNodeInterface);\n\n registerWrapper(OriginalCharacterData, Ch aracterData,\n document.createTextNode(''));\n\n scope.wrapper s.CharacterData = CharacterData;\n})(window.ShadowDOMPolyfill);\n", 121 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface = scope.ChildNodeInterface;\n var Node = scope.wrappers.Node;\n var enqueueMuta tion = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalCharacterData = window.CharacterData; \n\n function CharacterData(node) {\n Node.call(this, node);\n }\n Charact erData.prototype = Object.create(Node.prototype);\n mixin(CharacterData.prototy pe, {\n get textContent() {\n return this.data;\n },\n set textCon tent(value) {\n this.data = value;\n },\n get data() {\n return this.impl.data;\n },\n set data(value) {\n var oldValue = this.impl.d ata;\n enqueueMutation(this, 'characterData', {\n oldValue: oldValue \n });\n this.impl.data = value;\n }\n });\n\n mixin(CharacterDat a.prototype, ChildNodeInterface);\n\n registerWrapper(OriginalCharacterData, Ch aracterData,\n document.createTextNode(''));\n\n scope.wrapper s.CharacterData = CharacterData;\n})(window.ShadowDOMPolyfill);\n",
119 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var CharacterData = scop e.wrappers.CharacterData;\n var enqueueMutation = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n funct ion toUInt32(x) {\n return x >>> 0;\n }\n\n var OriginalText = window.Text; \n\n function Text(node) {\n CharacterData.call(this, node);\n }\n Text.pr ototype = Object.create(CharacterData.prototype);\n mixin(Text.prototype, {\n splitText: function(offset) {\n offset = toUInt32(offset);\n var s = this.data;\n if (offset > s.length)\n throw new Error('IndexSizeErr or');\n var head = s.slice(0, offset);\n var tail = s.slice(offset);\n this.data = head;\n var newTextNode = this.ownerDocument.createTextNo de(tail);\n if (this.parentNode)\n this.parentNode.insertBefore(newT extNode, this.nextSibling);\n return newTextNode;\n }\n });\n\n regist erWrapper(OriginalText, Text, document.createTextNode(''));\n\n scope.wrappers. Text = Text;\n})(window.ShadowDOMPolyfill);\n", 122 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var CharacterData = scop e.wrappers.CharacterData;\n var enqueueMutation = scope.enqueueMutation;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n funct ion toUInt32(x) {\n return x >>> 0;\n }\n\n var OriginalText = window.Text; \n\n function Text(node) {\n CharacterData.call(this, node);\n }\n Text.pr ototype = Object.create(CharacterData.prototype);\n mixin(Text.prototype, {\n splitText: function(offset) {\n offset = toUInt32(offset);\n var s = this.data;\n if (offset > s.length)\n throw new Error('IndexSizeErr or');\n var head = s.slice(0, offset);\n var tail = s.slice(offset);\n this.data = head;\n var newTextNode = this.ownerDocument.createTextNo de(tail);\n if (this.parentNode)\n this.parentNode.insertBefore(newT extNode, this.nextSibling);\n return newTextNode;\n }\n });\n\n regist erWrapper(OriginalText, Text, document.createTextNode(''));\n\n scope.wrappers. Text = Text;\n})(window.ShadowDOMPolyfill);\n",
120 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface = scope.ChildNodeInterface;\n var GetElementsByInterface = scope.GetElementsByIn terface;\n var Node = scope.wrappers.Node;\n var ParentNodeInterface = scope.P arentNodeInterface;\n var SelectorsInterface = scope.SelectorsInterface;\n var addWrapNodeListMethod = scope.addWrapNodeListMethod;\n var enqueueMutation = s cope.enqueueMutation;\n var mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var registerWrapper = scope.registerWrapper;\n var wrappers = scope.wrappers;\ n\n var OriginalElement = window.Element;\n\n var matchesNames = [\n 'match es', // needs to come first.\n 'mozMatchesSelector',\n 'msMatchesSelector ',\n 'webkitMatchesSelector',\n ].filter(function(name) {\n return Origin alElement.prototype[name];\n });\n\n var matchesName = matchesNames[0];\n\n v ar originalMatches = OriginalElement.prototype[matchesName];\n\n function inval idateRendererBasedOnAttribute(element, name) {\n // Only invalidate if parent node is a shadow host.\n var p = element.parentNode;\n if (!p || !p.shado wRoot)\n return;\n\n var renderer = scope.getRendererForHost(p);\n if (renderer.dependsOnAttribute(name))\n renderer.invalidate();\n }\n\n fun ction enqueAttributeChange(element, name, oldValue) {\n // This is not fully spec compliant. We should use localName (which might\n // have a different ca se than name) and the namespace (which requires us\n // to get the Attr objec t).\n enqueueMutation(element, 'attributes', {\n name: name,\n name space: null,\n oldValue: oldValue\n });\n }\n\n function Element(node) {\n Node.call(this, node);\n }\n Element.prototype = Object.create(Node.pr ototype);\n mixin(Element.prototype, {\n createShadowRoot: function() {\n var newShadowRoot = new wrappers.ShadowRoot(this);\n this.impl.polymerSh adowRoot_ = newShadowRoot;\n\n var renderer = scope.getRendererForHost(this );\n renderer.invalidate();\n\n return newShadowRoot;\n },\n\n g et shadowRoot() {\n return this.impl.polymerShadowRoot_ || null;\n },\n\ n setAttribute: function(name, value) {\n var oldValue = this.impl.getAt tribute(name);\n this.impl.setAttribute(name, value);\n enqueAttribute Change(this, name, oldValue);\n invalidateRendererBasedOnAttribute(this, na me);\n },\n\n removeAttribute: function(name) {\n var oldValue = this .impl.getAttribute(name);\n this.impl.removeAttribute(name);\n enqueAt tributeChange(this, name, oldValue);\n invalidateRendererBasedOnAttribute(t his, name);\n },\n\n matches: function(selector) {\n return originalM atches.call(this.impl, selector);\n }\n });\n\n matchesNames.forEach(functi on(name) {\n if (name !== 'matches') {\n Element.prototype[name] = funct ion(selector) {\n return this.matches(selector);\n };\n }\n });\ n\n if (OriginalElement.prototype.webkitCreateShadowRoot) {\n Element.protot ype.webkitCreateShadowRoot =\n Element.prototype.createShadowRoot;\n }\n \n /**\n * Useful for generating the accessor pair for a property that reflec ts an\n * attribute.\n */\n function setterDirtiesAttribute(prototype, prop ertyName, opt_attrName) {\n var attrName = opt_attrName || propertyName;\n Object.defineProperty(prototype, propertyName, {\n get: function() {\n return this.impl[propertyName];\n },\n set: function(v) {\n this.impl[propertyName] = v;\n invalidateRendererBasedOnAttribute(this, attrName);\n },\n configurable: true,\n enumerable: true\n }); \n }\n\n setterDirtiesAttribute(Element.prototype, 'id');\n setterDirtiesAttr ibute(Element.prototype, 'className', 'class');\n\n mixin(Element.prototype, Ch ildNodeInterface);\n mixin(Element.prototype, GetElementsByInterface);\n mixin (Element.prototype, ParentNodeInterface);\n mixin(Element.prototype, SelectorsI nterface);\n\n registerWrapper(OriginalElement, Element,\n doc ument.createElementNS(null, 'x'));\n\n // TODO(arv): Export setterDirtiesAttrib ute and apply it to more bindings\n // that reflect attributes.\n scope.matche sNames = matchesNames;\n scope.wrappers.Element = Element;\n})(window.ShadowDOM Polyfill);\n", 123 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var ChildNodeInterface = scope.ChildNodeInterface;\n var GetElementsByInterface = scope.GetElementsByIn terface;\n var Node = scope.wrappers.Node;\n var ParentNodeInterface = scope.P arentNodeInterface;\n var SelectorsInterface = scope.SelectorsInterface;\n var addWrapNodeListMethod = scope.addWrapNodeListMethod;\n var enqueueMutation = s cope.enqueueMutation;\n var mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var registerWrapper = scope.registerWrapper;\n var wrappers = scope.wrappers;\ n\n var OriginalElement = window.Element;\n\n var matchesNames = [\n 'match es', // needs to come first.\n 'mozMatchesSelector',\n 'msMatchesSelector ',\n 'webkitMatchesSelector',\n ].filter(function(name) {\n return Origin alElement.prototype[name];\n });\n\n var matchesName = matchesNames[0];\n\n v ar originalMatches = OriginalElement.prototype[matchesName];\n\n function inval idateRendererBasedOnAttribute(element, name) {\n // Only invalidate if parent node is a shadow host.\n var p = element.parentNode;\n if (!p || !p.shado wRoot)\n return;\n\n var renderer = scope.getRendererForHost(p);\n if (renderer.dependsOnAttribute(name))\n renderer.invalidate();\n }\n\n fun ction enqueAttributeChange(element, name, oldValue) {\n // This is not fully spec compliant. We should use localName (which might\n // have a different ca se than name) and the namespace (which requires us\n // to get the Attr objec t).\n enqueueMutation(element, 'attributes', {\n name: name,\n name space: null,\n oldValue: oldValue\n });\n }\n\n function Element(node) {\n Node.call(this, node);\n }\n Element.prototype = Object.create(Node.pr ototype);\n mixin(Element.prototype, {\n createShadowRoot: function() {\n var newShadowRoot = new wrappers.ShadowRoot(this);\n this.impl.polymerSh adowRoot_ = newShadowRoot;\n\n var renderer = scope.getRendererForHost(this );\n renderer.invalidate();\n\n return newShadowRoot;\n },\n\n g et shadowRoot() {\n return this.impl.polymerShadowRoot_ || null;\n },\n\ n setAttribute: function(name, value) {\n var oldValue = this.impl.getAt tribute(name);\n this.impl.setAttribute(name, value);\n enqueAttribute Change(this, name, oldValue);\n invalidateRendererBasedOnAttribute(this, na me);\n },\n\n removeAttribute: function(name) {\n var oldValue = this .impl.getAttribute(name);\n this.impl.removeAttribute(name);\n enqueAt tributeChange(this, name, oldValue);\n invalidateRendererBasedOnAttribute(t his, name);\n },\n\n matches: function(selector) {\n return originalM atches.call(this.impl, selector);\n }\n });\n\n matchesNames.forEach(functi on(name) {\n if (name !== 'matches') {\n Element.prototype[name] = funct ion(selector) {\n return this.matches(selector);\n };\n }\n });\ n\n if (OriginalElement.prototype.webkitCreateShadowRoot) {\n Element.protot ype.webkitCreateShadowRoot =\n Element.prototype.createShadowRoot;\n }\n \n /**\n * Useful for generating the accessor pair for a property that reflec ts an\n * attribute.\n */\n function setterDirtiesAttribute(prototype, prop ertyName, opt_attrName) {\n var attrName = opt_attrName || propertyName;\n Object.defineProperty(prototype, propertyName, {\n get: function() {\n return this.impl[propertyName];\n },\n set: function(v) {\n this.impl[propertyName] = v;\n invalidateRendererBasedOnAttribute(this, attrName);\n },\n configurable: true,\n enumerable: true\n }); \n }\n\n setterDirtiesAttribute(Element.prototype, 'id');\n setterDirtiesAttr ibute(Element.prototype, 'className', 'class');\n\n mixin(Element.prototype, Ch ildNodeInterface);\n mixin(Element.prototype, GetElementsByInterface);\n mixin (Element.prototype, ParentNodeInterface);\n mixin(Element.prototype, SelectorsI nterface);\n\n registerWrapper(OriginalElement, Element,\n doc ument.createElementNS(null, 'x'));\n\n // TODO(arv): Export setterDirtiesAttrib ute and apply it to more bindings\n // that reflect attributes.\n scope.matche sNames = matchesNames;\n scope.wrappers.Element = Element;\n})(window.ShadowDOM Polyfill);\n",
121 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap pers.Element;\n var defineGetter = scope.defineGetter;\n var enqueueMutation = scope.enqueueMutation;\n var mixin = scope.mixin;\n var nodesWereAdded = scop e.nodesWereAdded;\n var nodesWereRemoved = scope.nodesWereRemoved;\n var regis terWrapper = scope.registerWrapper;\n var snapshotNodeList = scope.snapshotNode List;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers = scope.wrappers;\n\n /////////////////////////////////////////////////////////// //////////////////\n // innerHTML and outerHTML\n\n // http://www.whatwg.org/s pecs/web-apps/current-work/multipage/the-end.html#escapingString\n var escapeAt trRegExp = /[&\\u00A0\"]/g;\n var escapeDataRegExp = /[&\\u00A0<>]/g;\n\n func tion escapeReplace(c) {\n switch (c) {\n case '&':\n return '&amp ;';\n case '<':\n return '&lt;';\n case '>':\n return '& gt;';\n case '\"':\n return '&quot;'\n case '\\u00A0':\n return '&nbsp;';\n }\n }\n\n function escapeAttr(s) {\n return s.replac e(escapeAttrRegExp, escapeReplace);\n }\n\n function escapeData(s) {\n retu rn s.replace(escapeDataRegExp, escapeReplace);\n }\n\n function makeSet(arr) { \n var set = {};\n for (var i = 0; i < arr.length; i++) {\n set[arr[i ]] = true;\n }\n return set;\n }\n\n // http://www.whatwg.org/specs/web- apps/current-work/#void-elements\n var voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n ]);\n\n var plaintextParents = makeSet([ \n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'n oframes',\n 'plaintext',\n 'noscript'\n ]);\n\n function getOuterHTML(no de, parentNode) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n var tagName = node.tagName.toLowerCase();\n var s = '<' + tagName ;\n var attrs = node.attributes;\n for (var i = 0, attr; attr = at trs[i]; i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName])\n return s;\n\n return s + getInnerHTML(node) + '</' + tagName + '>';\ n\n case Node.TEXT_NODE:\n var data = node.data;\n if (parent Node && plaintextParents[parentNode.localName])\n return data;\n return escapeData(data);\n\n case Node.COMMENT_NODE:\n return '<!-- ' + node.data + '-->';\n\n default:\n console.error(node);\n throw new Error('not implemented');\n }\n }\n\n function getInnerHTML(node) {\n if (node instanceof wrappers.HTMLTemplateElement)\n node = node.con tent;\n\n var s = '';\n for (var child = node.firstChild; child; child = c hild.nextSibling) {\n s += getOuterHTML(child, node);\n }\n return s; \n }\n\n function setInnerHTML(node, value, opt_tagName) {\n var tagName = opt_tagName || 'div';\n node.textContent = '';\n var tempElement = unwrap( node.ownerDocument.createElement(tagName));\n tempElement.innerHTML = value;\ n var firstChild;\n while (firstChild = tempElement.firstChild) {\n n ode.appendChild(wrap(firstChild));\n }\n }\n\n // IE11 does not have MSIE i n the user agent string.\n var oldIe = /MSIE/.test(navigator.userAgent);\n\n v ar OriginalHTMLElement = window.HTMLElement;\n var OriginalHTMLTemplateElement = window.HTMLTemplateElement;\n\n function HTMLElement(node) {\n Element.cal l(this, node);\n }\n HTMLElement.prototype = Object.create(Element.prototype); \n mixin(HTMLElement.prototype, {\n get innerHTML() {\n return getInner HTML(this);\n },\n set innerHTML(value) {\n // IE9 does not handle se t innerHTML correctly on plaintextParents. It\n // creates element children . For example\n //\n // scriptElement.innerHTML = '<a>test</a>'\n //\n // Creates a single HTMLAnchorElement child.\n if (oldIe && pl aintextParents[this.localName]) {\n this.textContent = value;\n re turn;\n }\n\n var removedNodes = snapshotNodeList(this.childNodes);\n\ n if (this.invalidateShadowRenderer()) {\n if (this instanceof wrapp ers.HTMLTemplateElement)\n setInnerHTML(this.content, value);\n else\n setInnerHTML(this, value, this.tagName);\n\n // If we have a non native template element we need to handle this\n // manually since se tting impl.innerHTML would add the html as direct\n // children and not be moved over to the content fragment.\n } else if (!OriginalHTMLTemplateEleme nt &&\n this instanceof wrappers.HTMLTemplateElement) {\n setInnerHTML(this.content, value);\n } else {\n this.impl.innerHTML = value;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes);\ n\n enqueueMutation(this, 'childList', {\n addedNodes: addedNodes,\n removedNodes: removedNodes\n });\n\n nodesWereRemoved(removedN odes);\n nodesWereAdded(addedNodes);\n },\n\n get outerHTML() {\n return getOuterHTML(this, this.parentNode);\n },\n set outerHTML(value) {\n var p = this.parentNode;\n if (p) {\n p.invalidateShadowRen derer();\n var df = frag(p, value);\n p.replaceChild(df, this);\n }\n },\n\n insertAdjacentHTML: function(position, text) {\n var contextElement, refNode;\n switch (String(position).toLowerCase()) {\n case 'beforebegin':\n contextElement = this.parentNode;\n r efNode = this;\n break;\n case 'afterend':\n contextEle ment = this.parentNode;\n refNode = this.nextSibling;\n break; \n case 'afterbegin':\n contextElement = this;\n refNod e = this.firstChild;\n break;\n case 'beforeend':\n con textElement = this;\n refNode = null;\n break;\n defaul t:\n return;\n }\n\n var df = frag(contextElement, text);\n contextElement.insertBefore(df, refNode);\n }\n });\n\n function frag(c ontextElement, html) {\n // TODO(arv): This does not work with SVG and other non HTML elements.\n var p = unwrap(contextElement.cloneNode(false));\n p. innerHTML = html;\n var df = unwrap(document.createDocumentFragment());\n var c;\n while (c = p.firstChild) {\n df.appendChild(c);\n }\n ret urn wrap(df);\n }\n\n function getter(name) {\n return function() {\n scope.renderAllPending();\n return this.impl[name];\n };\n }\n\n funct ion getterRequiresRendering(name) {\n defineGetter(HTMLElement, name, getter( name));\n }\n\n [\n 'clientHeight',\n 'clientLeft',\n 'clientTop',\n 'clientWidth',\n 'offsetHeight',\n 'offsetLeft',\n 'offsetTop',\n 'offsetWidth',\n 'scrollHeight',\n 'scrollWidth',\n ].forEach(getterRequ iresRendering);\n\n function getterAndSetterRequiresRendering(name) {\n Obje ct.defineProperty(HTMLElement.prototype, name, {\n get: getter(name),\n set: function(v) {\n scope.renderAllPending();\n this.impl[name] = v;\n },\n configurable: true,\n enumerable: true\n });\n } \n\n [\n 'scrollLeft',\n 'scrollTop',\n ].forEach(getterAndSetterRequire sRendering);\n\n function methodRequiresRendering(name) {\n Object.definePro perty(HTMLElement.prototype, name, {\n value: function() {\n scope.r enderAllPending();\n return this.impl[name].apply(this.impl, arguments);\ n },\n configurable: true,\n enumerable: true\n });\n }\n\n [\n 'getBoundingClientRect',\n 'getClientRects',\n 'scrollIntoView'\n ].forEach(methodRequiresRendering);\n\n // HTMLElement is abstract so we use a subclass that has no members.\n registerWrapper(OriginalHTMLElement, HTMLElemen t,\n document.createElement('b'));\n\n scope.wrappers.HTMLElem ent = HTMLElement;\n\n // TODO: Find a better way to share these two with Wrapp erShadowRoot.\n scope.getInnerHTML = getInnerHTML;\n scope.setInnerHTML = setI nnerHTML\n})(window.ShadowDOMPolyfill);\n", 124 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrap pers.Element;\n var defineGetter = scope.defineGetter;\n var enqueueMutation = scope.enqueueMutation;\n var mixin = scope.mixin;\n var nodesWereAdded = scop e.nodesWereAdded;\n var nodesWereRemoved = scope.nodesWereRemoved;\n var regis terWrapper = scope.registerWrapper;\n var snapshotNodeList = scope.snapshotNode List;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrappers = scope.wrappers;\n\n /////////////////////////////////////////////////////////// //////////////////\n // innerHTML and outerHTML\n\n // http://www.whatwg.org/s pecs/web-apps/current-work/multipage/the-end.html#escapingString\n var escapeAt trRegExp = /[&\\u00A0\"]/g;\n var escapeDataRegExp = /[&\\u00A0<>]/g;\n\n func tion escapeReplace(c) {\n switch (c) {\n case '&':\n return '&amp ;';\n case '<':\n return '&lt;';\n case '>':\n return '& gt;';\n case '\"':\n return '&quot;'\n case '\\u00A0':\n return '&nbsp;';\n }\n }\n\n function escapeAttr(s) {\n return s.replac e(escapeAttrRegExp, escapeReplace);\n }\n\n function escapeData(s) {\n retu rn s.replace(escapeDataRegExp, escapeReplace);\n }\n\n function makeSet(arr) { \n var set = {};\n for (var i = 0; i < arr.length; i++) {\n set[arr[i ]] = true;\n }\n return set;\n }\n\n // http://www.whatwg.org/specs/web- apps/current-work/#void-elements\n var voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n ]);\n\n var plaintextParents = makeSet([ \n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'n oframes',\n 'plaintext',\n 'noscript'\n ]);\n\n function getOuterHTML(no de, parentNode) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n var tagName = node.tagName.toLowerCase();\n var s = '<' + tagName ;\n var attrs = node.attributes;\n for (var i = 0, attr; attr = at trs[i]; i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName])\n return s;\n\n return s + getInnerHTML(node) + '</' + tagName + '>';\ n\n case Node.TEXT_NODE:\n var data = node.data;\n if (parent Node && plaintextParents[parentNode.localName])\n return data;\n return escapeData(data);\n\n case Node.COMMENT_NODE:\n return '<!-- ' + node.data + '-->';\n\n default:\n console.error(node);\n throw new Error('not implemented');\n }\n }\n\n function getInnerHTML(node) {\n if (node instanceof wrappers.HTMLTemplateElement)\n node = node.con tent;\n\n var s = '';\n for (var child = node.firstChild; child; child = c hild.nextSibling) {\n s += getOuterHTML(child, node);\n }\n return s; \n }\n\n function setInnerHTML(node, value, opt_tagName) {\n var tagName = opt_tagName || 'div';\n node.textContent = '';\n var tempElement = unwrap( node.ownerDocument.createElement(tagName));\n tempElement.innerHTML = value;\ n var firstChild;\n while (firstChild = tempElement.firstChild) {\n n ode.appendChild(wrap(firstChild));\n }\n }\n\n // IE11 does not have MSIE i n the user agent string.\n var oldIe = /MSIE/.test(navigator.userAgent);\n\n v ar OriginalHTMLElement = window.HTMLElement;\n var OriginalHTMLTemplateElement = window.HTMLTemplateElement;\n\n function HTMLElement(node) {\n Element.cal l(this, node);\n }\n HTMLElement.prototype = Object.create(Element.prototype); \n mixin(HTMLElement.prototype, {\n get innerHTML() {\n return getInner HTML(this);\n },\n set innerHTML(value) {\n // IE9 does not handle se t innerHTML correctly on plaintextParents. It\n // creates element children . For example\n //\n // scriptElement.innerHTML = '<a>test</a>'\n //\n // Creates a single HTMLAnchorElement child.\n if (oldIe && pl aintextParents[this.localName]) {\n this.textContent = value;\n re turn;\n }\n\n var removedNodes = snapshotNodeList(this.childNodes);\n\ n if (this.invalidateShadowRenderer()) {\n if (this instanceof wrapp ers.HTMLTemplateElement)\n setInnerHTML(this.content, value);\n else\n setInnerHTML(this, value, this.tagName);\n\n // If we have a non native template element we need to handle this\n // manually since se tting impl.innerHTML would add the html as direct\n // children and not be moved over to the content fragment.\n } else if (!OriginalHTMLTemplateEleme nt &&\n this instanceof wrappers.HTMLTemplateElement) {\n setInnerHTML(this.content, value);\n } else {\n this.impl.innerHTML = value;\n }\n\n var addedNodes = snapshotNodeList(this.childNodes);\ n\n enqueueMutation(this, 'childList', {\n addedNodes: addedNodes,\n removedNodes: removedNodes\n });\n\n nodesWereRemoved(removedN odes);\n nodesWereAdded(addedNodes, this);\n },\n\n get outerHTML() { \n return getOuterHTML(this, this.parentNode);\n },\n set outerHTML(v alue) {\n var p = this.parentNode;\n if (p) {\n p.invalidateSha dowRenderer();\n var df = frag(p, value);\n p.replaceChild(df, thi s);\n }\n },\n\n insertAdjacentHTML: function(position, text) {\n var contextElement, refNode;\n switch (String(position).toLowerCase()) {\ n case 'beforebegin':\n contextElement = this.parentNode;\n refNode = this;\n break;\n case 'afterend':\n cont extElement = this.parentNode;\n refNode = this.nextSibling;\n break;\n case 'afterbegin':\n contextElement = this;\n refNode = this.firstChild;\n break;\n case 'beforeend':\n contextElement = this;\n refNode = null;\n break;\n default:\n return;\n }\n\n var df = frag(contextElement, text );\n contextElement.insertBefore(df, refNode);\n }\n });\n\n function frag(contextElement, html) {\n // TODO(arv): This does not work with SVG and other non HTML elements.\n var p = unwrap(contextElement.cloneNode(false));\n p.innerHTML = html;\n var df = unwrap(document.createDocumentFragment()); \n var c;\n while (c = p.firstChild) {\n df.appendChild(c);\n }\n return wrap(df);\n }\n\n function getter(name) {\n return function() {\n scope.renderAllPending();\n return this.impl[name];\n };\n }\n\n function getterRequiresRendering(name) {\n defineGetter(HTMLElement, name, g etter(name));\n }\n\n [\n 'clientHeight',\n 'clientLeft',\n 'clientTo p',\n 'clientWidth',\n 'offsetHeight',\n 'offsetLeft',\n 'offsetTop' ,\n 'offsetWidth',\n 'scrollHeight',\n 'scrollWidth',\n ].forEach(gett erRequiresRendering);\n\n function getterAndSetterRequiresRendering(name) {\n Object.defineProperty(HTMLElement.prototype, name, {\n get: getter(name), \n set: function(v) {\n scope.renderAllPending();\n this.impl [name] = v;\n },\n configurable: true,\n enumerable: true\n }) ;\n }\n\n [\n 'scrollLeft',\n 'scrollTop',\n ].forEach(getterAndSetterR equiresRendering);\n\n function methodRequiresRendering(name) {\n Object.def ineProperty(HTMLElement.prototype, name, {\n value: function() {\n s cope.renderAllPending();\n return this.impl[name].apply(this.impl, argume nts);\n },\n configurable: true,\n enumerable: true\n });\n } \n\n [\n 'getBoundingClientRect',\n 'getClientRects',\n 'scrollIntoVie w'\n ].forEach(methodRequiresRendering);\n\n // HTMLElement is abstract so we use a subclass that has no members.\n registerWrapper(OriginalHTMLElement, HTML Element,\n document.createElement('b'));\n\n scope.wrappers.HT MLElement = HTMLElement;\n\n // TODO: Find a better way to share these two with WrapperShadowRoot.\n scope.getInnerHTML = getInnerHTML;\n scope.setInnerHTML = setInnerHTML\n})(window.ShadowDOMPolyfill);\n",
122 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalHTMLCanvasElement = window.HTMLCanvasElement;\n\n function HTMLCanvasElement(node) {\n HTMLElem ent.call(this, node);\n }\n HTMLCanvasElement.prototype = Object.create(HTMLEl ement.prototype);\n\n mixin(HTMLCanvasElement.prototype, {\n getContext: fun ction() {\n var context = this.impl.getContext.apply(this.impl, arguments); \n return context && wrap(context);\n }\n });\n\n registerWrapper(Orig inalHTMLCanvasElement, HTMLCanvasElement,\n document.createElem ent('canvas'));\n\n scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;\n})(w indow.ShadowDOMPolyfill);\n", 125 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalHTMLCanvasElement = window.HTMLCanvasElement;\n\n function HTMLCanvasElement(node) {\n HTMLElem ent.call(this, node);\n }\n HTMLCanvasElement.prototype = Object.create(HTMLEl ement.prototype);\n\n mixin(HTMLCanvasElement.prototype, {\n getContext: fun ction() {\n var context = this.impl.getContext.apply(this.impl, arguments); \n return context && wrap(context);\n }\n });\n\n registerWrapper(Orig inalHTMLCanvasElement, HTMLCanvasElement,\n document.createElem ent('canvas'));\n\n scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;\n})(w indow.ShadowDOMPolyfill);\n",
123 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n\n var OriginalHTMLContentElement = window.HTMLContentElemen t;\n\n function HTMLContentElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLContentElement.prototype = Object.create(HTMLElement.prototype);\n m ixin(HTMLContentElement.prototype, {\n get select() {\n return this.getA ttribute('select');\n },\n set select(value) {\n this.setAttribute('s elect', value);\n },\n\n setAttribute: function(n, v) {\n HTMLElement .prototype.setAttribute.call(this, n, v);\n if (String(n).toLowerCase() === 'select')\n this.invalidateShadowRenderer(true);\n }\n\n // getDis tributedNodes is added in ShadowRenderer\n\n // TODO: attribute boolean reset StyleInheritance;\n });\n\n if (OriginalHTMLContentElement)\n registerWrapp er(OriginalHTMLContentElement, HTMLContentElement);\n\n scope.wrappers.HTMLCont entElement = HTMLContentElement;\n})(window.ShadowDOMPolyfill);\n", 126 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n\n var OriginalHTMLContentElement = window.HTMLContentElemen t;\n\n function HTMLContentElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLContentElement.prototype = Object.create(HTMLElement.prototype);\n m ixin(HTMLContentElement.prototype, {\n get select() {\n return this.getA ttribute('select');\n },\n set select(value) {\n this.setAttribute('s elect', value);\n },\n\n setAttribute: function(n, v) {\n HTMLElement .prototype.setAttribute.call(this, n, v);\n if (String(n).toLowerCase() === 'select')\n this.invalidateShadowRenderer(true);\n }\n\n // getDis tributedNodes is added in ShadowRenderer\n\n // TODO: attribute boolean reset StyleInheritance;\n });\n\n if (OriginalHTMLContentElement)\n registerWrapp er(OriginalHTMLContentElement, HTMLContentElement);\n\n scope.wrappers.HTMLCont entElement = HTMLContentElement;\n})(window.ShadowDOMPolyfill);\n",
124 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n var unw rap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTMLImageElem ent = window.HTMLImageElement;\n\n function HTMLImageElement(node) {\n HTMLE lement.call(this, node);\n }\n HTMLImageElement.prototype = Object.create(HTML Element.prototype);\n\n registerWrapper(OriginalHTMLImageElement, HTMLImageElem ent,\n document.createElement('img'));\n\n function Image(widt h, height) {\n if (!(this instanceof Image)) {\n throw new TypeError(\n 'DOM object constructor cannot be called as a function.');\n }\n\n var node = unwrap(document.createElement('img'));\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (width !== undefined)\n node.widt h = width;\n if (height !== undefined)\n node.height = height;\n }\n\n Image.prototype = HTMLImageElement.prototype;\n\n scope.wrappers.HTMLImageElem ent = HTMLImageElement;\n scope.wrappers.Image = Image;\n})(window.ShadowDOMPol yfill);\n", 127 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n var unw rap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTMLImageElem ent = window.HTMLImageElement;\n\n function HTMLImageElement(node) {\n HTMLE lement.call(this, node);\n }\n HTMLImageElement.prototype = Object.create(HTML Element.prototype);\n\n registerWrapper(OriginalHTMLImageElement, HTMLImageElem ent,\n document.createElement('img'));\n\n function Image(widt h, height) {\n if (!(this instanceof Image)) {\n throw new TypeError(\n 'DOM object constructor cannot be called as a function.');\n }\n\n var node = unwrap(document.createElement('img'));\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (width !== undefined)\n node.widt h = width;\n if (height !== undefined)\n node.height = height;\n }\n\n Image.prototype = HTMLImageElement.prototype;\n\n scope.wrappers.HTMLImageElem ent = HTMLImageElement;\n scope.wrappers.Image = Image;\n})(window.ShadowDOMPol yfill);\n",
125 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n\n var OriginalHTMLShadowElement = window.HTMLShadowElement; \n\n function HTMLShadowElement(node) {\n HTMLElement.call(this, node);\n } \n HTMLShadowElement.prototype = Object.create(HTMLElement.prototype);\n mixin (HTMLShadowElement.prototype, {\n // TODO: attribute boolean resetStyleInheri tance;\n });\n\n if (OriginalHTMLShadowElement)\n registerWrapper(OriginalH TMLShadowElement, HTMLShadowElement);\n\n scope.wrappers.HTMLShadowElement = HT MLShadowElement;\n})(window.ShadowDOMPolyfill);\n", 128 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n\n var OriginalHTMLShadowElement = window.HTMLShadowElement; \n\n function HTMLShadowElement(node) {\n HTMLElement.call(this, node);\n } \n HTMLShadowElement.prototype = Object.create(HTMLElement.prototype);\n mixin (HTMLShadowElement.prototype, {\n // TODO: attribute boolean resetStyleInheri tance;\n });\n\n if (OriginalHTMLShadowElement)\n registerWrapper(OriginalH TMLShadowElement, HTMLShadowElement);\n\n scope.wrappers.HTMLShadowElement = HT MLShadowElement;\n})(window.ShadowDOMPolyfill);\n",
126 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v ar contentTable = new WeakMap();\n var templateContentsOwnerTable = new WeakMap ();\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/inde x.html#dfn-template-contents-owner\n function getTemplateContentsOwner(doc) {\n if (!doc.defaultView)\n return doc;\n var d = templateContentsOwnerT able.get(doc);\n if (!d) {\n // TODO(arv): This should either be a Docum ent or HTMLDocument depending\n // on doc.\n d = doc.implementation.cr eateHTMLDocument('');\n while (d.lastChild) {\n d.removeChild(d.last Child);\n }\n templateContentsOwnerTable.set(doc, d);\n }\n retu rn d;\n }\n\n function extractContent(templateElement) {\n // templateEleme nt is not a wrapper here.\n var doc = getTemplateContentsOwner(templateElemen t.ownerDocument);\n var df = unwrap(doc.createDocumentFragment());\n var c hild;\n while (child = templateElement.firstChild) {\n df.appendChild(ch ild);\n }\n return df;\n }\n\n var OriginalHTMLTemplateElement = window. HTMLTemplateElement;\n\n function HTMLTemplateElement(node) {\n HTMLElement. call(this, node);\n if (!OriginalHTMLTemplateElement) {\n var content = extractContent(node);\n contentTable.set(this, wrap(content));\n }\n }\ n HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);\n\n mi xin(HTMLTemplateElement.prototype, {\n get content() {\n if (OriginalHTM LTemplateElement)\n return wrap(this.impl.content);\n return content Table.get(this);\n },\n\n // TODO(arv): cloneNode needs to clone content.\ n\n });\n\n if (OriginalHTMLTemplateElement)\n registerWrapper(OriginalHTML TemplateElement, HTMLTemplateElement);\n\n scope.wrappers.HTMLTemplateElement = HTMLTemplateElement;\n})(window.ShadowDOMPolyfill);\n", 129 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v ar contentTable = new WeakMap();\n var templateContentsOwnerTable = new WeakMap ();\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/inde x.html#dfn-template-contents-owner\n function getTemplateContentsOwner(doc) {\n if (!doc.defaultView)\n return doc;\n var d = templateContentsOwnerT able.get(doc);\n if (!d) {\n // TODO(arv): This should either be a Docum ent or HTMLDocument depending\n // on doc.\n d = doc.implementation.cr eateHTMLDocument('');\n while (d.lastChild) {\n d.removeChild(d.last Child);\n }\n templateContentsOwnerTable.set(doc, d);\n }\n retu rn d;\n }\n\n function extractContent(templateElement) {\n // templateEleme nt is not a wrapper here.\n var doc = getTemplateContentsOwner(templateElemen t.ownerDocument);\n var df = unwrap(doc.createDocumentFragment());\n var c hild;\n while (child = templateElement.firstChild) {\n df.appendChild(ch ild);\n }\n return df;\n }\n\n var OriginalHTMLTemplateElement = window. HTMLTemplateElement;\n\n function HTMLTemplateElement(node) {\n HTMLElement. call(this, node);\n if (!OriginalHTMLTemplateElement) {\n var content = extractContent(node);\n contentTable.set(this, wrap(content));\n }\n }\ n HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);\n\n mi xin(HTMLTemplateElement.prototype, {\n get content() {\n if (OriginalHTM LTemplateElement)\n return wrap(this.impl.content);\n return content Table.get(this);\n },\n\n // TODO(arv): cloneNode needs to clone content.\ n\n });\n\n if (OriginalHTMLTemplateElement)\n registerWrapper(OriginalHTML TemplateElement, HTMLTemplateElement);\n\n scope.wrappers.HTMLTemplateElement = HTMLTemplateElement;\n})(window.ShadowDOMPolyfill);\n",
127 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n\n var O riginalHTMLMediaElement = window.HTMLMediaElement;\n\n function HTMLMediaElemen t(node) {\n HTMLElement.call(this, node);\n }\n HTMLMediaElement.prototype = Object.create(HTMLElement.prototype);\n\n registerWrapper(OriginalHTMLMediaEl ement, HTMLMediaElement,\n document.createElement('audio'));\n\ n scope.wrappers.HTMLMediaElement = HTMLMediaElement;\n})(window.ShadowDOMPolyf ill);\n", 130 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var registerWrapper = scope.registerWrapper;\n\n var O riginalHTMLMediaElement = window.HTMLMediaElement;\n\n function HTMLMediaElemen t(node) {\n HTMLElement.call(this, node);\n }\n HTMLMediaElement.prototype = Object.create(HTMLElement.prototype);\n\n registerWrapper(OriginalHTMLMediaEl ement, HTMLMediaElement,\n document.createElement('audio'));\n\ n scope.wrappers.HTMLMediaElement = HTMLMediaElement;\n})(window.ShadowDOMPolyf ill);\n",
128 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLMediaElement = s cope.wrappers.HTMLMediaElement;\n var registerWrapper = scope.registerWrapper;\ n var unwrap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTM LAudioElement = window.HTMLAudioElement;\n\n function HTMLAudioElement(node) {\ n HTMLMediaElement.call(this, node);\n }\n HTMLAudioElement.prototype = Obj ect.create(HTMLMediaElement.prototype);\n\n registerWrapper(OriginalHTMLAudioEl ement, HTMLAudioElement,\n document.createElement('audio'));\n\ n function Audio(src) {\n if (!(this instanceof Audio)) {\n throw new T ypeError(\n 'DOM object constructor cannot be called as a function.');\ n }\n\n var node = unwrap(document.createElement('audio'));\n HTMLMedia Element.call(this, node);\n rewrap(node, this);\n\n node.setAttribute('pre load', 'auto');\n if (src !== undefined)\n node.setAttribute('src', src) ;\n }\n\n Audio.prototype = HTMLAudioElement.prototype;\n\n scope.wrappers.HT MLAudioElement = HTMLAudioElement;\n scope.wrappers.Audio = Audio;\n})(window.S hadowDOMPolyfill);\n", 131 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLMediaElement = s cope.wrappers.HTMLMediaElement;\n var registerWrapper = scope.registerWrapper;\ n var unwrap = scope.unwrap;\n var rewrap = scope.rewrap;\n\n var OriginalHTM LAudioElement = window.HTMLAudioElement;\n\n function HTMLAudioElement(node) {\ n HTMLMediaElement.call(this, node);\n }\n HTMLAudioElement.prototype = Obj ect.create(HTMLMediaElement.prototype);\n\n registerWrapper(OriginalHTMLAudioEl ement, HTMLAudioElement,\n document.createElement('audio'));\n\ n function Audio(src) {\n if (!(this instanceof Audio)) {\n throw new T ypeError(\n 'DOM object constructor cannot be called as a function.');\ n }\n\n var node = unwrap(document.createElement('audio'));\n HTMLMedia Element.call(this, node);\n rewrap(node, this);\n\n node.setAttribute('pre load', 'auto');\n if (src !== undefined)\n node.setAttribute('src', src) ;\n }\n\n Audio.prototype = HTMLAudioElement.prototype;\n\n scope.wrappers.HT MLAudioElement = HTMLAudioElement;\n scope.wrappers.Audio = Audio;\n})(window.S hadowDOMPolyfill);\n",
129 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLOptionElement = window.HTMLOptionEl ement;\n\n function trimText(s) {\n return s.replace(/\\s+/g, ' ').trim();\n }\n\n function HTMLOptionElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);\n mi xin(HTMLOptionElement.prototype, {\n get text() {\n return trimText(this .textContent);\n },\n set text(value) {\n this.textContent = trimText (String(value));\n },\n get form() {\n return wrap(unwrap(this).form) ;\n }\n });\n\n registerWrapper(OriginalHTMLOptionElement, HTMLOptionElemen t,\n document.createElement('option'));\n\n function Option(te xt, value, defaultSelected, selected) {\n if (!(this instanceof Option)) {\n throw new TypeError(\n 'DOM object constructor cannot be called as a function.');\n }\n\n var node = unwrap(document.createElement('option') );\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (text ! == undefined)\n node.text = text;\n if (value !== undefined)\n node .setAttribute('value', value);\n if (defaultSelected === true)\n node.se tAttribute('selected', '');\n node.selected = selected === true;\n }\n\n Op tion.prototype = HTMLOptionElement.prototype;\n\n scope.wrappers.HTMLOptionElem ent = HTMLOptionElement;\n scope.wrappers.Option = Option;\n})(window.ShadowDOM Polyfill);\n", 132 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLOptionElement = window.HTMLOptionEl ement;\n\n function trimText(s) {\n return s.replace(/\\s+/g, ' ').trim();\n }\n\n function HTMLOptionElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);\n mi xin(HTMLOptionElement.prototype, {\n get text() {\n return trimText(this .textContent);\n },\n set text(value) {\n this.textContent = trimText (String(value));\n },\n get form() {\n return wrap(unwrap(this).form) ;\n }\n });\n\n registerWrapper(OriginalHTMLOptionElement, HTMLOptionElemen t,\n document.createElement('option'));\n\n function Option(te xt, value, defaultSelected, selected) {\n if (!(this instanceof Option)) {\n throw new TypeError(\n 'DOM object constructor cannot be called as a function.');\n }\n\n var node = unwrap(document.createElement('option') );\n HTMLElement.call(this, node);\n rewrap(node, this);\n\n if (text ! == undefined)\n node.text = text;\n if (value !== undefined)\n node .setAttribute('value', value);\n if (defaultSelected === true)\n node.se tAttribute('selected', '');\n node.selected = selected === true;\n }\n\n Op tion.prototype = HTMLOptionElement.prototype;\n\n scope.wrappers.HTMLOptionElem ent = HTMLOptionElement;\n scope.wrappers.Option = Option;\n})(window.ShadowDOM Polyfill);\n",
130 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v ar OriginalHTMLSelectElement = window.HTMLSelectElement;\n\n function HTMLSelec tElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLSelectElement.pr ototype = Object.create(HTMLElement.prototype);\n mixin(HTMLSelectElement.proto type, {\n add: function(element, before) {\n if (typeof before === 'obje ct') // also includes null\n before = unwrap(before);\n unwrap(this ).add(unwrap(element), before);\n },\n\n remove: function(indexOrNode) {\n // Spec only allows index but implementations allow index or node.\n // remove() is also allowed which is same as remove(undefined)\n if (typeof indexOrNode === 'object')\n indexOrNode = unwrap(indexOrNode);\n un wrap(this).remove(indexOrNode);\n },\n\n get form() {\n return wrap(u nwrap(this).form);\n }\n });\n\n registerWrapper(OriginalHTMLSelectElement, HTMLSelectElement,\n document.createElement('select'));\n\n s cope.wrappers.HTMLSelectElement = HTMLSelectElement;\n})(window.ShadowDOMPolyfil l);\n", 133 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n v ar OriginalHTMLSelectElement = window.HTMLSelectElement;\n\n function HTMLSelec tElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLSelectElement.pr ototype = Object.create(HTMLElement.prototype);\n mixin(HTMLSelectElement.proto type, {\n add: function(element, before) {\n if (typeof before === 'obje ct') // also includes null\n before = unwrap(before);\n unwrap(this ).add(unwrap(element), before);\n },\n\n remove: function(indexOrNode) {\n // Spec only allows index but implementations allow index or node.\n // remove() is also allowed which is same as remove(undefined)\n if (typeof indexOrNode === 'object')\n indexOrNode = unwrap(indexOrNode);\n un wrap(this).remove(indexOrNode);\n },\n\n get form() {\n return wrap(u nwrap(this).form);\n }\n });\n\n registerWrapper(OriginalHTMLSelectElement, HTMLSelectElement,\n document.createElement('select'));\n\n s cope.wrappers.HTMLSelectElement = HTMLSelectElement;\n})(window.ShadowDOMPolyfil l);\n",
131 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wra p;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\n\n var OriginalHTMLTa bleElement = window.HTMLTableElement;\n\n function HTMLTableElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableElement.prototype = Object.crea te(HTMLElement.prototype);\n mixin(HTMLTableElement.prototype, {\n get capti on() {\n return wrap(unwrap(this).caption);\n },\n createCaption: fun ction() {\n return wrap(unwrap(this).createCaption());\n },\n\n get t Head() {\n return wrap(unwrap(this).tHead);\n },\n createTHead: funct ion() {\n return wrap(unwrap(this).createTHead());\n },\n\n createTFo ot: function() {\n return wrap(unwrap(this).createTFoot());\n },\n ge t tFoot() {\n return wrap(unwrap(this).tFoot);\n },\n\n get tBodies() {\n return wrapHTMLCollection(unwrap(this).tBodies);\n },\n createTB ody: function() {\n return wrap(unwrap(this).createTBody());\n },\n\n get rows() {\n return wrapHTMLCollection(unwrap(this).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap(this).insertRow(index));\ n }\n });\n\n registerWrapper(OriginalHTMLTableElement, HTMLTableElement,\n document.createElement('table'));\n\n scope.wrappers.HTMLTabl eElement = HTMLTableElement;\n})(window.ShadowDOMPolyfill);\n", 134 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wra p;\n var wrapHTMLCollection = scope.wrapHTMLCollection;\n\n var OriginalHTMLTa bleElement = window.HTMLTableElement;\n\n function HTMLTableElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableElement.prototype = Object.crea te(HTMLElement.prototype);\n mixin(HTMLTableElement.prototype, {\n get capti on() {\n return wrap(unwrap(this).caption);\n },\n createCaption: fun ction() {\n return wrap(unwrap(this).createCaption());\n },\n\n get t Head() {\n return wrap(unwrap(this).tHead);\n },\n createTHead: funct ion() {\n return wrap(unwrap(this).createTHead());\n },\n\n createTFo ot: function() {\n return wrap(unwrap(this).createTFoot());\n },\n ge t tFoot() {\n return wrap(unwrap(this).tFoot);\n },\n\n get tBodies() {\n return wrapHTMLCollection(unwrap(this).tBodies);\n },\n createTB ody: function() {\n return wrap(unwrap(this).createTBody());\n },\n\n get rows() {\n return wrapHTMLCollection(unwrap(this).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap(this).insertRow(index));\ n }\n });\n\n registerWrapper(OriginalHTMLTableElement, HTMLTableElement,\n document.createElement('table'));\n\n scope.wrappers.HTMLTabl eElement = HTMLTableElement;\n})(window.ShadowDOMPolyfill);\n",
132 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection; \n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa bleSectionElement = window.HTMLTableSectionElement;\n\n function HTMLTableSecti onElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableSectionEle ment.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableSection Element.prototype, {\n get rows() {\n return wrapHTMLCollection(unwrap(t his).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap( this).insertRow(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableSec tionElement, HTMLTableSectionElement,\n document.createElement( 'thead'));\n\n scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement ;\n})(window.ShadowDOMPolyfill);\n", 135 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection; \n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa bleSectionElement = window.HTMLTableSectionElement;\n\n function HTMLTableSecti onElement(node) {\n HTMLElement.call(this, node);\n }\n HTMLTableSectionEle ment.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableSection Element.prototype, {\n get rows() {\n return wrapHTMLCollection(unwrap(t his).rows);\n },\n insertRow: function(index) {\n return wrap(unwrap( this).insertRow(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableSec tionElement, HTMLTableSectionElement,\n document.createElement( 'thead'));\n\n scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement ;\n})(window.ShadowDOMPolyfill);\n",
133 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection; \n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa bleRowElement = window.HTMLTableRowElement;\n\n function HTMLTableRowElement(no de) {\n HTMLElement.call(this, node);\n }\n HTMLTableRowElement.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableRowElement.prototype, { \n get cells() {\n return wrapHTMLCollection(unwrap(this).cells);\n } ,\n\n insertCell: function(index) {\n return wrap(unwrap(this).insertCel l(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableRowElement, HTMLT ableRowElement,\n document.createElement('tr'));\n\n scope.wra ppers.HTMLTableRowElement = HTMLTableRowElement;\n})(window.ShadowDOMPolyfill);\ n", 136 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope.wrappers.HTMLElement;\n var mixin = scope.mixin;\n var registerWrappe r = scope.registerWrapper;\n var wrapHTMLCollection = scope.wrapHTMLCollection; \n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalHTMLTa bleRowElement = window.HTMLTableRowElement;\n\n function HTMLTableRowElement(no de) {\n HTMLElement.call(this, node);\n }\n HTMLTableRowElement.prototype = Object.create(HTMLElement.prototype);\n mixin(HTMLTableRowElement.prototype, { \n get cells() {\n return wrapHTMLCollection(unwrap(this).cells);\n } ,\n\n insertCell: function(index) {\n return wrap(unwrap(this).insertCel l(index));\n }\n });\n\n registerWrapper(OriginalHTMLTableRowElement, HTMLT ableRowElement,\n document.createElement('tr'));\n\n scope.wra ppers.HTMLTableRowElement = HTMLTableRowElement;\n})(window.ShadowDOMPolyfill);\ n",
134 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n var HTMLElement = scope.wrappers.HTMLElem ent;\n var HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var HTMLTem plateElement = scope.wrappers.HTMLTemplateElement;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalHTMLUnknownEleme nt = window.HTMLUnknownElement;\n\n function HTMLUnknownElement(node) {\n sw itch (node.localName) {\n case 'content':\n return new HTMLContentEl ement(node);\n case 'shadow':\n return new HTMLShadowElement(node);\ n case 'template':\n return new HTMLTemplateElement(node);\n }\n HTMLElement.call(this, node);\n }\n HTMLUnknownElement.prototype = Object.c reate(HTMLElement.prototype);\n registerWrapper(OriginalHTMLUnknownElement, HTM LUnknownElement);\n scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;\n}) (window.ShadowDOMPolyfill);\n", 137 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n var HTMLElement = scope.wrappers.HTMLElem ent;\n var HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var HTMLTem plateElement = scope.wrappers.HTMLTemplateElement;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n\n var OriginalHTMLUnknownEleme nt = window.HTMLUnknownElement;\n\n function HTMLUnknownElement(node) {\n sw itch (node.localName) {\n case 'content':\n return new HTMLContentEl ement(node);\n case 'shadow':\n return new HTMLShadowElement(node);\ n case 'template':\n return new HTMLTemplateElement(node);\n }\n HTMLElement.call(this, node);\n }\n HTMLUnknownElement.prototype = Object.c reate(HTMLElement.prototype);\n registerWrapper(OriginalHTMLUnknownElement, HTM LUnknownElement);\n scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;\n}) (window.ShadowDOMPolyfill);\n",
135 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerObject = sco pe.registerObject;\n\n var SVG_NS = 'http://www.w3.org/2000/svg';\n var svgTit leElement = document.createElementNS(SVG_NS, 'title');\n var SVGTitleElement = registerObject(svgTitleElement);\n var SVGElement = Object.getPrototypeOf(SVGTi tleElement.prototype).constructor;\n\n scope.wrappers.SVGElement = SVGElement;\ n})(window.ShadowDOMPolyfill);\n", 138 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerObject = sco pe.registerObject;\n\n var SVG_NS = 'http://www.w3.org/2000/svg';\n var svgTit leElement = document.createElementNS(SVG_NS, 'title');\n var SVGTitleElement = registerObject(svgTitleElement);\n var SVGElement = Object.getPrototypeOf(SVGTi tleElement.prototype).constructor;\n\n scope.wrappers.SVGElement = SVGElement;\ n})(window.ShadowDOMPolyfill);\n",
136 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalSVGUseElement = window.SVGUseElement;\ n\n // IE uses SVGElement as parent interface, SVG2 (Blink & Gecko) uses\n // SVGGraphicsElement. Use the <g> element to get the right prototype.\n\n var SVG _NS = 'http://www.w3.org/2000/svg';\n var gWrapper = wrap(document.createElemen tNS(SVG_NS, 'g'));\n var useElement = document.createElementNS(SVG_NS, 'use');\ n var SVGGElement = gWrapper.constructor;\n var parentInterfacePrototype = Obj ect.getPrototypeOf(SVGGElement.prototype);\n var parentInterface = parentInterf acePrototype.constructor;\n\n function SVGUseElement(impl) {\n parentInterfa ce.call(this, impl);\n }\n\n SVGUseElement.prototype = Object.create(parentInt erfacePrototype);\n\n // Firefox does not expose instanceRoot.\n if ('instance Root' in useElement) {\n mixin(SVGUseElement.prototype, {\n get instance Root() {\n return wrap(unwrap(this).instanceRoot);\n },\n get a nimatedInstanceRoot() {\n return wrap(unwrap(this).animatedInstanceRoot); \n },\n });\n }\n\n registerWrapper(OriginalSVGUseElement, SVGUseEleme nt, useElement);\n\n scope.wrappers.SVGUseElement = SVGUseElement;\n})(window.S hadowDOMPolyfill);\n", 139 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var OriginalSVGUseElement = window.SVGUseElement;\ n\n // IE uses SVGElement as parent interface, SVG2 (Blink & Gecko) uses\n // SVGGraphicsElement. Use the <g> element to get the right prototype.\n\n var SVG _NS = 'http://www.w3.org/2000/svg';\n var gWrapper = wrap(document.createElemen tNS(SVG_NS, 'g'));\n var useElement = document.createElementNS(SVG_NS, 'use');\ n var SVGGElement = gWrapper.constructor;\n var parentInterfacePrototype = Obj ect.getPrototypeOf(SVGGElement.prototype);\n var parentInterface = parentInterf acePrototype.constructor;\n\n function SVGUseElement(impl) {\n parentInterfa ce.call(this, impl);\n }\n\n SVGUseElement.prototype = Object.create(parentInt erfacePrototype);\n\n // Firefox does not expose instanceRoot.\n if ('instance Root' in useElement) {\n mixin(SVGUseElement.prototype, {\n get instance Root() {\n return wrap(unwrap(this).instanceRoot);\n },\n get a nimatedInstanceRoot() {\n return wrap(unwrap(this).animatedInstanceRoot); \n },\n });\n }\n\n registerWrapper(OriginalSVGUseElement, SVGUseEleme nt, useElement);\n\n scope.wrappers.SVGUseElement = SVGUseElement;\n})(window.S hadowDOMPolyfill);\n",
137 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope. wrappers.EventTarget;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalSVGElementInstance = window.SVGElementInstance;\n if (!OriginalSVGElementInstance)\n return;\n\ n function SVGElementInstance(impl) {\n EventTarget.call(this, impl);\n }\n \n SVGElementInstance.prototype = Object.create(EventTarget.prototype);\n mixi n(SVGElementInstance.prototype, {\n /** @type {SVGElement} */\n get corres pondingElement() {\n return wrap(this.impl.correspondingElement);\n },\n \n /** @type {SVGUseElement} */\n get correspondingUseElement() {\n r eturn wrap(this.impl.correspondingUseElement);\n },\n\n /** @type {SVGElem entInstance} */\n get parentNode() {\n return wrap(this.impl.parentNode) ;\n },\n\n /** @type {SVGElementInstanceList} */\n get childNodes() {\n throw new Error('Not implemented');\n },\n\n /** @type {SVGElementIn stance} */\n get firstChild() {\n return wrap(this.impl.firstChild);\n },\n\n /** @type {SVGElementInstance} */\n get lastChild() {\n retu rn wrap(this.impl.lastChild);\n },\n\n /** @type {SVGElementInstance} */\n get previousSibling() {\n return wrap(this.impl.previousSibling);\n },\n\n /** @type {SVGElementInstance} */\n get nextSibling() {\n retu rn wrap(this.impl.nextSibling);\n }\n });\n\n registerWrapper(OriginalSVGEl ementInstance, SVGElementInstance);\n\n scope.wrappers.SVGElementInstance = SVG ElementInstance;\n})(window.ShadowDOMPolyfill);\n", 140 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope. wrappers.EventTarget;\n var mixin = scope.mixin;\n var registerWrapper = scope .registerWrapper;\n var wrap = scope.wrap;\n\n var OriginalSVGElementInstance = window.SVGElementInstance;\n if (!OriginalSVGElementInstance)\n return;\n\ n function SVGElementInstance(impl) {\n EventTarget.call(this, impl);\n }\n \n SVGElementInstance.prototype = Object.create(EventTarget.prototype);\n mixi n(SVGElementInstance.prototype, {\n /** @type {SVGElement} */\n get corres pondingElement() {\n return wrap(this.impl.correspondingElement);\n },\n \n /** @type {SVGUseElement} */\n get correspondingUseElement() {\n r eturn wrap(this.impl.correspondingUseElement);\n },\n\n /** @type {SVGElem entInstance} */\n get parentNode() {\n return wrap(this.impl.parentNode) ;\n },\n\n /** @type {SVGElementInstanceList} */\n get childNodes() {\n throw new Error('Not implemented');\n },\n\n /** @type {SVGElementIn stance} */\n get firstChild() {\n return wrap(this.impl.firstChild);\n },\n\n /** @type {SVGElementInstance} */\n get lastChild() {\n retu rn wrap(this.impl.lastChild);\n },\n\n /** @type {SVGElementInstance} */\n get previousSibling() {\n return wrap(this.impl.previousSibling);\n },\n\n /** @type {SVGElementInstance} */\n get nextSibling() {\n retu rn wrap(this.impl.nextSibling);\n }\n });\n\n registerWrapper(OriginalSVGEl ementInstance, SVGElementInstance);\n\n scope.wrappers.SVGElementInstance = SVG ElementInstance;\n})(window.ShadowDOMPolyfill);\n",
138 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n\n functio n CanvasRenderingContext2D(impl) {\n this.impl = impl;\n }\n\n mixin(Canvas RenderingContext2D.prototype, {\n get canvas() {\n return wrap(this.impl .canvas);\n },\n\n drawImage: function() {\n arguments[0] = unwrapIfN eeded(arguments[0]);\n this.impl.drawImage.apply(this.impl, arguments);\n },\n\n createPattern: function() {\n arguments[0] = unwrap(arguments[0 ]);\n return this.impl.createPattern.apply(this.impl, arguments);\n }\n });\n\n registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingConte xt2D,\n document.createElement('canvas').getContext('2d'));\n\n scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;\n})(window .ShadowDOMPolyfill);\n", 141 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;\n\n functio n CanvasRenderingContext2D(impl) {\n this.impl = impl;\n }\n\n mixin(Canvas RenderingContext2D.prototype, {\n get canvas() {\n return wrap(this.impl .canvas);\n },\n\n drawImage: function() {\n arguments[0] = unwrapIfN eeded(arguments[0]);\n this.impl.drawImage.apply(this.impl, arguments);\n },\n\n createPattern: function() {\n arguments[0] = unwrap(arguments[0 ]);\n return this.impl.createPattern.apply(this.impl, arguments);\n }\n });\n\n registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingConte xt2D,\n document.createElement('canvas').getContext('2d'));\n\n scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;\n})(window .ShadowDOMPolyfill);\n",
139 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrapIfNeeded = scope.u nwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWebGLRenderingContext = window.WebGLRenderingContext;\n\n // IE10 does not have WebGL.\n if (!Origin alWebGLRenderingContext)\n return;\n\n function WebGLRenderingContext(impl) {\n this.impl = impl;\n }\n\n mixin(WebGLRenderingContext.prototype, {\n get canvas() {\n return wrap(this.impl.canvas);\n },\n\n texImage2D: function() {\n arguments[5] = unwrapIfNeeded(arguments[5]);\n this.im pl.texImage2D.apply(this.impl, arguments);\n },\n\n texSubImage2D: functio n() {\n arguments[6] = unwrapIfNeeded(arguments[6]);\n this.impl.texSu bImage2D.apply(this.impl, arguments);\n }\n });\n\n // Blink/WebKit has bro ken DOM bindings. Usually we would create an instance\n // of the object and pa ss it into registerWrapper as a \"blueprint\" but\n // creating WebGL contexts is expensive and might fail so we use a dummy\n // object with dummy instance p roperties for these broken browsers.\n var instanceProperties = /WebKit/.test(n avigator.userAgent) ?\n {drawingBufferHeight: null, drawingBufferWidth: nul l} : {};\n\n registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingConte xt,\n instanceProperties);\n\n scope.wrappers.WebGLRenderingContext = WebG LRenderingContext;\n})(window.ShadowDOMPolyfill);\n", 142 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var mixin = scope.mixin; \n var registerWrapper = scope.registerWrapper;\n var unwrapIfNeeded = scope.u nwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWebGLRenderingContext = window.WebGLRenderingContext;\n\n // IE10 does not have WebGL.\n if (!Origin alWebGLRenderingContext)\n return;\n\n function WebGLRenderingContext(impl) {\n this.impl = impl;\n }\n\n mixin(WebGLRenderingContext.prototype, {\n get canvas() {\n return wrap(this.impl.canvas);\n },\n\n texImage2D: function() {\n arguments[5] = unwrapIfNeeded(arguments[5]);\n this.im pl.texImage2D.apply(this.impl, arguments);\n },\n\n texSubImage2D: functio n() {\n arguments[6] = unwrapIfNeeded(arguments[6]);\n this.impl.texSu bImage2D.apply(this.impl, arguments);\n }\n });\n\n // Blink/WebKit has bro ken DOM bindings. Usually we would create an instance\n // of the object and pa ss it into registerWrapper as a \"blueprint\" but\n // creating WebGL contexts is expensive and might fail so we use a dummy\n // object with dummy instance p roperties for these broken browsers.\n var instanceProperties = /WebKit/.test(n avigator.userAgent) ?\n {drawingBufferHeight: null, drawingBufferWidth: nul l} : {};\n\n registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingConte xt,\n instanceProperties);\n\n scope.wrappers.WebGLRenderingContext = WebG LRenderingContext;\n})(window.ShadowDOMPolyfill);\n",
140 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope .unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalRange = window.Range ;\n\n function Range(impl) {\n this.impl = impl;\n }\n Range.prototype = { \n get startContainer() {\n return wrap(this.impl.startContainer);\n },\n get endContainer() {\n return wrap(this.impl.endContainer);\n }, \n get commonAncestorContainer() {\n return wrap(this.impl.commonAncesto rContainer);\n },\n setStart: function(refNode,offset) {\n this.impl. setStart(unwrapIfNeeded(refNode), offset);\n },\n setEnd: function(refNode ,offset) {\n this.impl.setEnd(unwrapIfNeeded(refNode), offset);\n },\n setStartBefore: function(refNode) {\n this.impl.setStartBefore(unwrapIfNe eded(refNode));\n },\n setStartAfter: function(refNode) {\n this.impl .setStartAfter(unwrapIfNeeded(refNode));\n },\n setEndBefore: function(ref Node) {\n this.impl.setEndBefore(unwrapIfNeeded(refNode));\n },\n set EndAfter: function(refNode) {\n this.impl.setEndAfter(unwrapIfNeeded(refNod e));\n },\n selectNode: function(refNode) {\n this.impl.selectNode(un wrapIfNeeded(refNode));\n },\n selectNodeContents: function(refNode) {\n this.impl.selectNodeContents(unwrapIfNeeded(refNode));\n },\n compareB oundaryPoints: function(how, sourceRange) {\n return this.impl.compareBound aryPoints(how, unwrap(sourceRange));\n },\n extractContents: function() {\ n return wrap(this.impl.extractContents());\n },\n cloneContents: fun ction() {\n return wrap(this.impl.cloneContents());\n },\n insertNode : function(node) {\n this.impl.insertNode(unwrapIfNeeded(node));\n },\n surroundContents: function(newParent) {\n this.impl.surroundContents(unw rapIfNeeded(newParent));\n },\n cloneRange: function() {\n return wra p(this.impl.cloneRange());\n },\n isPointInRange: function(node, offset) { \n return this.impl.isPointInRange(unwrapIfNeeded(node), offset);\n },\n comparePoint: function(node, offset) {\n return this.impl.comparePoint( unwrapIfNeeded(node), offset);\n },\n intersectsNode: function(node) {\n return this.impl.intersectsNode(unwrapIfNeeded(node));\n },\n toString : function() {\n return this.impl.toString();\n }\n };\n\n // IE9 does not have createContextualFragment.\n if (OriginalRange.prototype.createContext ualFragment) {\n Range.prototype.createContextualFragment = function(html) {\ n return wrap(this.impl.createContextualFragment(html));\n };\n }\n\n registerWrapper(window.Range, Range, document.createRange());\n\n scope.wrapper s.Range = Range;\n\n})(window.ShadowDOMPolyfill);\n", 143 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope .unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalRange = window.Range ;\n\n function Range(impl) {\n this.impl = impl;\n }\n Range.prototype = { \n get startContainer() {\n return wrap(this.impl.startContainer);\n },\n get endContainer() {\n return wrap(this.impl.endContainer);\n }, \n get commonAncestorContainer() {\n return wrap(this.impl.commonAncesto rContainer);\n },\n setStart: function(refNode,offset) {\n this.impl. setStart(unwrapIfNeeded(refNode), offset);\n },\n setEnd: function(refNode ,offset) {\n this.impl.setEnd(unwrapIfNeeded(refNode), offset);\n },\n setStartBefore: function(refNode) {\n this.impl.setStartBefore(unwrapIfNe eded(refNode));\n },\n setStartAfter: function(refNode) {\n this.impl .setStartAfter(unwrapIfNeeded(refNode));\n },\n setEndBefore: function(ref Node) {\n this.impl.setEndBefore(unwrapIfNeeded(refNode));\n },\n set EndAfter: function(refNode) {\n this.impl.setEndAfter(unwrapIfNeeded(refNod e));\n },\n selectNode: function(refNode) {\n this.impl.selectNode(un wrapIfNeeded(refNode));\n },\n selectNodeContents: function(refNode) {\n this.impl.selectNodeContents(unwrapIfNeeded(refNode));\n },\n compareB oundaryPoints: function(how, sourceRange) {\n return this.impl.compareBound aryPoints(how, unwrap(sourceRange));\n },\n extractContents: function() {\ n return wrap(this.impl.extractContents());\n },\n cloneContents: fun ction() {\n return wrap(this.impl.cloneContents());\n },\n insertNode : function(node) {\n this.impl.insertNode(unwrapIfNeeded(node));\n },\n surroundContents: function(newParent) {\n this.impl.surroundContents(unw rapIfNeeded(newParent));\n },\n cloneRange: function() {\n return wra p(this.impl.cloneRange());\n },\n isPointInRange: function(node, offset) { \n return this.impl.isPointInRange(unwrapIfNeeded(node), offset);\n },\n comparePoint: function(node, offset) {\n return this.impl.comparePoint( unwrapIfNeeded(node), offset);\n },\n intersectsNode: function(node) {\n return this.impl.intersectsNode(unwrapIfNeeded(node));\n },\n toString : function() {\n return this.impl.toString();\n }\n };\n\n // IE9 does not have createContextualFragment.\n if (OriginalRange.prototype.createContext ualFragment) {\n Range.prototype.createContextualFragment = function(html) {\ n return wrap(this.impl.createContextualFragment(html));\n };\n }\n\n registerWrapper(window.Range, Range, document.createRange());\n\n scope.wrapper s.Range = Range;\n\n})(window.ShadowDOMPolyfill);\n",
141 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa ce = scope.GetElementsByInterface;\n var ParentNodeInterface = scope.ParentNode Interface;\n var SelectorsInterface = scope.SelectorsInterface;\n var mixin = scope.mixin;\n var registerObject = scope.registerObject;\n\n var DocumentFrag ment = registerObject(document.createDocumentFragment());\n mixin(DocumentFragm ent.prototype, ParentNodeInterface);\n mixin(DocumentFragment.prototype, Select orsInterface);\n mixin(DocumentFragment.prototype, GetElementsByInterface);\n\n var Comment = registerObject(document.createComment(''));\n\n scope.wrappers. Comment = Comment;\n scope.wrappers.DocumentFragment = DocumentFragment;\n\n})( window.ShadowDOMPolyfill);\n", 144 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa ce = scope.GetElementsByInterface;\n var ParentNodeInterface = scope.ParentNode Interface;\n var SelectorsInterface = scope.SelectorsInterface;\n var mixin = scope.mixin;\n var registerObject = scope.registerObject;\n\n var DocumentFrag ment = registerObject(document.createDocumentFragment());\n mixin(DocumentFragm ent.prototype, ParentNodeInterface);\n mixin(DocumentFragment.prototype, Select orsInterface);\n mixin(DocumentFragment.prototype, GetElementsByInterface);\n\n var Comment = registerObject(document.createComment(''));\n\n scope.wrappers. Comment = Comment;\n scope.wrappers.DocumentFragment = DocumentFragment;\n\n})( window.ShadowDOMPolyfill);\n",
142 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var DocumentFragment = s cope.wrappers.DocumentFragment;\n var elementFromPoint = scope.elementFromPoint ;\n var getInnerHTML = scope.getInnerHTML;\n var mixin = scope.mixin;\n var r ewrap = scope.rewrap;\n var setInnerHTML = scope.setInnerHTML;\n var unwrap = scope.unwrap;\n\n var shadowHostTable = new WeakMap();\n var nextOlderShadowTr eeTable = new WeakMap();\n\n var spaceCharRe = /[ \\t\\n\\r\\f]/;\n\n function ShadowRoot(hostWrapper) {\n var node = unwrap(hostWrapper.impl.ownerDocument .createDocumentFragment());\n DocumentFragment.call(this, node);\n\n // cr eateDocumentFragment associates the node with a wrapper\n // DocumentFragment instance. Override that.\n rewrap(node, this);\n\n var oldShadowRoot = ho stWrapper.shadowRoot;\n nextOlderShadowTreeTable.set(this, oldShadowRoot);\n\ n shadowHostTable.set(this, hostWrapper);\n }\n ShadowRoot.prototype = Obje ct.create(DocumentFragment.prototype);\n mixin(ShadowRoot.prototype, {\n get innerHTML() {\n return getInnerHTML(this);\n },\n set innerHTML(valu e) {\n setInnerHTML(this, value);\n this.invalidateShadowRenderer();\n },\n\n get olderShadowRoot() {\n return nextOlderShadowTreeTable.get (this) || null;\n },\n\n get host() {\n return shadowHostTable.get(th is) || null;\n },\n\n invalidateShadowRenderer: function() {\n return shadowHostTable.get(this).invalidateShadowRenderer();\n },\n\n elementFro mPoint: function(x, y) {\n return elementFromPoint(this, this.ownerDocument , x, y);\n },\n\n getElementById: function(id) {\n if (spaceCharRe.te st(id))\n return null;\n return this.querySelector('[id=\"' + id + ' \"]');\n }\n });\n\n scope.wrappers.ShadowRoot = ShadowRoot;\n\n})(window.S hadowDOMPolyfill);\n", 145 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var DocumentFragment = s cope.wrappers.DocumentFragment;\n var TreeScope = scope.TreeScope;\n var eleme ntFromPoint = scope.elementFromPoint;\n var getInnerHTML = scope.getInnerHTML;\ n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n var rew rap = scope.rewrap;\n var setInnerHTML = scope.setInnerHTML;\n var unwrap = sc ope.unwrap;\n\n var shadowHostTable = new WeakMap();\n var nextOlderShadowTree Table = new WeakMap();\n\n var spaceCharRe = /[ \\t\\n\\r\\f]/;\n\n function S hadowRoot(hostWrapper) {\n var node = unwrap(hostWrapper.impl.ownerDocument.c reateDocumentFragment());\n DocumentFragment.call(this, node);\n\n // crea teDocumentFragment associates the node with a wrapper\n // DocumentFragment i nstance. Override that.\n rewrap(node, this);\n\n this.treeScope_ = new Tr eeScope(this, getTreeScope(hostWrapper));\n\n var oldShadowRoot = hostWrapper .shadowRoot;\n nextOlderShadowTreeTable.set(this, oldShadowRoot);\n\n shad owHostTable.set(this, hostWrapper);\n }\n ShadowRoot.prototype = Object.create (DocumentFragment.prototype);\n mixin(ShadowRoot.prototype, {\n get innerHTM L() {\n return getInnerHTML(this);\n },\n set innerHTML(value) {\n setInnerHTML(this, value);\n this.invalidateShadowRenderer();\n },\n\ n get olderShadowRoot() {\n return nextOlderShadowTreeTable.get(this) || null;\n },\n\n get host() {\n return shadowHostTable.get(this) || nu ll;\n },\n\n invalidateShadowRenderer: function() {\n return shadowHo stTable.get(this).invalidateShadowRenderer();\n },\n\n elementFromPoint: f unction(x, y) {\n return elementFromPoint(this, this.ownerDocument, x, y);\ n },\n\n getElementById: function(id) {\n if (spaceCharRe.test(id))\n return null;\n return this.querySelector('[id=\"' + id + '\"]');\n }\n });\n\n scope.wrappers.ShadowRoot = ShadowRoot;\n\n})(window.ShadowDOMP olyfill);\n",
143 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LIC ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrapp ers.Element;\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n v ar HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var Node = scope.wra ppers.Node;\n var ShadowRoot = scope.wrappers.ShadowRoot;\n var assert = scope .assert;\n var mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n /**\n * Updates the fields of a wrapper to a snapshot of the logical DOM as needed.\n * Up means parentNode\n * Sideways means previous and next sibling.\n * @param {!Node} wrapper\n * /\n function updateWrapperUpAndSideways(wrapper) {\n wrapper.previousSibling _ = wrapper.previousSibling;\n wrapper.nextSibling_ = wrapper.nextSibling;\n wrapper.parentNode_ = wrapper.parentNode;\n }\n\n /**\n * Updates the fie lds of a wrapper to a snapshot of the logical DOM as needed.\n * Down means fi rst and last child\n * @param {!Node} wrapper\n */\n function updateWrapper Down(wrapper) {\n wrapper.firstChild_ = wrapper.firstChild;\n wrapper.last Child_ = wrapper.lastChild;\n }\n\n function updateAllChildNodes(parentNodeWra pper) {\n assert(parentNodeWrapper instanceof Node);\n for (var childWrapp er = parentNodeWrapper.firstChild;\n childWrapper;\n childWrappe r = childWrapper.nextSibling) {\n updateWrapperUpAndSideways(childWrapper); \n }\n updateWrapperDown(parentNodeWrapper);\n }\n\n function insertBefo re(parentNodeWrapper, newChildWrapper, refChildWrapper) {\n var parentNode = unwrap(parentNodeWrapper);\n var newChild = unwrap(newChildWrapper);\n var refChild = refChildWrapper ? unwrap(refChildWrapper) : null;\n\n remove(newC hildWrapper);\n updateWrapperUpAndSideways(newChildWrapper);\n\n if (!refC hildWrapper) {\n parentNodeWrapper.lastChild_ = parentNodeWrapper.lastChild ;\n if (parentNodeWrapper.lastChild === parentNodeWrapper.firstChild)\n parentNodeWrapper.firstChild_ = parentNodeWrapper.firstChild;\n\n var l astChildWrapper = wrap(parentNode.lastChild);\n if (lastChildWrapper)\n lastChildWrapper.nextSibling_ = lastChildWrapper.nextSibling;\n } else {\ n if (parentNodeWrapper.firstChild === refChildWrapper)\n parentNode Wrapper.firstChild_ = refChildWrapper;\n\n refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;\n }\n\n parentNode.insertBefore(newChi ld, refChild);\n }\n\n function remove(nodeWrapper) {\n var node = unwrap(n odeWrapper)\n var parentNode = node.parentNode;\n if (!parentNode)\n return;\n\n var parentNodeWrapper = wrap(parentNode);\n updateWrapperUpAnd Sideways(nodeWrapper);\n\n if (nodeWrapper.previousSibling)\n nodeWrappe r.previousSibling.nextSibling_ = nodeWrapper;\n if (nodeWrapper.nextSibling)\ n nodeWrapper.nextSibling.previousSibling_ = nodeWrapper;\n\n if (parent NodeWrapper.lastChild === nodeWrapper)\n parentNodeWrapper.lastChild_ = nod eWrapper;\n if (parentNodeWrapper.firstChild === nodeWrapper)\n parentNo deWrapper.firstChild_ = nodeWrapper;\n\n parentNode.removeChild(node);\n }\n \n var distributedChildNodesTable = new WeakMap();\n var eventParentsTable = n ew WeakMap();\n var insertionParentTable = new WeakMap();\n var rendererForHos tTable = new WeakMap();\n\n function distributeChildToInsertionPoint(child, ins ertionPoint) {\n getDistributedChildNodes(insertionPoint).push(child);\n a ssignToInsertionPoint(child, insertionPoint);\n\n var eventParents = eventPar entsTable.get(child);\n if (!eventParents)\n eventParentsTable.set(child , eventParents = []);\n eventParents.push(insertionPoint);\n }\n\n function resetDistributedChildNodes(insertionPoint) {\n distributedChildNodesTable.se t(insertionPoint, []);\n }\n\n function getDistributedChildNodes(insertionPoin t) {\n var rv = distributedChildNodesTable.get(insertionPoint);\n if (!rv) \n distributedChildNodesTable.set(insertionPoint, rv = []);\n return rv; \n }\n\n function getChildNodesSnapshot(node) {\n var result = [], i = 0;\n for (var child = node.firstChild; child; child = child.nextSibling) {\n result[i++] = child;\n }\n return result;\n }\n\n /**\n * Visits all nodes in the tree that fulfils the |predicate|. If the |visitor|\n * function returns |false| the traversal is aborted.\n * @param {!Node} tree\n * @param {function(!Node) : boolean} predicate\n * @param {function(!Node) : *} visito r\n */\n function visit(tree, predicate, visitor) {\n // This operates on logical DOM.\n for (var node = tree.firstChild; node; node = node.nextSibling ) {\n if (predicate(node)) {\n if (visitor(node) === false)\n return;\n } else {\n visit(node, predicate, visitor);\n }\n }\n }\n\n // Matching Insertion Points\n // http://dvcs.w3.org/hg/webcompo nents/raw-file/tip/spec/shadow/index.html#matching-insertion-points\n\n // TODO (arv): Verify this... I don't remember why I picked this regexp.\n var selector MatchRegExp = /^[*.:#[a-zA-Z_|]/;\n\n var allowedPseudoRegExp = new RegExp('^:( ' + [\n 'link',\n 'visited',\n 'target',\n 'enabled',\n 'disabled ',\n 'checked',\n 'indeterminate',\n 'nth-child',\n 'nth-last-child' ,\n 'nth-of-type',\n 'nth-last-of-type',\n 'first-child',\n 'last-ch ild',\n 'first-of-type',\n 'last-of-type',\n 'only-of-type',\n ].join( '|') + ')');\n\n\n /**\n * @param {Element} node\n * @oaram {Element} point The insertion point element.\n * @return {boolean} Whether the node matches t he insertion point.\n */\n function matchesCriteria(node, point) {\n var s elect = point.getAttribute('select');\n if (!select)\n return true;\n\n // Here we know the select attribute is a non empty string.\n select = sel ect.trim();\n if (!select)\n return true;\n\n if (!(node instanceof E lement))\n return false;\n\n // The native matches function in IE9 does not correctly work with elements\n // that are not in the document.\n // T ODO(arv): Implement matching in JS.\n // https://github.com/Polymer/ShadowDOM /issues/361\n if (select === '*' || select === node.localName)\n return true;\n\n // TODO(arv): This does not seem right. Need to check for a simple selector.\n if (!selectorMatchRegExp.test(select))\n return false;\n\n // TODO(arv): This no longer matches the spec.\n if (select[0] === ':' && ! allowedPseudoRegExp.test(select))\n return false;\n\n try {\n retur n node.matches(select);\n } catch (ex) {\n // Invalid selector.\n r eturn false;\n }\n }\n\n var request = oneOf(window, [\n 'requestAnimati onFrame',\n 'mozRequestAnimationFrame',\n 'webkitRequestAnimationFrame',\n 'setTimeout'\n ]);\n\n var pendingDirtyRenderers = [];\n var renderTimer; \n\n function renderAllPending() {\n // TODO(arv): Order these in document o rder. That way we do not have to\n // render something twice.\n for (var i = 0; i < pendingDirtyRenderers.length; i++) {\n pendingDirtyRenderers[i].r ender();\n }\n\n pendingDirtyRenderers = [];\n }\n\n function handleRequ estAnimationFrame() {\n renderTimer = null;\n renderAllPending();\n }\n\n /**\n * Returns existing shadow renderer for a host or creates it if it is n eeded.\n * @params {!Element} host\n * @return {!ShadowRenderer}\n */\n f unction getRendererForHost(host) {\n var renderer = rendererForHostTable.get( host);\n if (!renderer) {\n renderer = new ShadowRenderer(host);\n rendererForHostTable.set(host, renderer);\n }\n return renderer;\n }\n\n function getShadowRootAncestor(node) {\n for (; node; node = node.parentNode ) {\n if (node instanceof ShadowRoot)\n return node;\n }\n ret urn null;\n }\n\n function getRendererForShadowRoot(shadowRoot) {\n return getRendererForHost(shadowRoot.host);\n }\n\n var spliceDiff = new ArraySplice( );\n spliceDiff.equals = function(renderNode, rawNode) {\n return unwrap(ren derNode.node) === rawNode;\n };\n\n /**\n * RenderNode is used as an in memo ry \"render tree\". When we render the\n * composed tree we create a tree of R enderNodes, then we diff this against\n * the real DOM tree and make minimal c hanges as needed.\n */\n function RenderNode(node) {\n this.skip = false;\ n this.node = node;\n this.childNodes = [];\n }\n\n RenderNode.prototype = {\n append: function(node) {\n var rv = new RenderNode(node);\n this.childNodes.push(rv);\n return rv;\n },\n\n sync: function(opt_ad ded) {\n if (this.skip)\n return;\n\n var nodeWrapper = this.no de;\n // plain array of RenderNodes\n var newChildren = this.childNode s;\n // plain array of real nodes.\n var oldChildren = getChildNodesSn apshot(unwrap(nodeWrapper));\n var added = opt_added || new WeakMap();\n\n var splices = spliceDiff.calculateSplices(newChildren, oldChildren);\n\n var newIndex = 0, oldIndex = 0;\n var lastIndex = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice = splices[i];\n for (; lastIndex < splice.index; lastIndex++) {\n oldIndex++;\n newC hildren[newIndex++].sync(added);\n }\n\n var removedCount = splice .removed.length;\n for (var j = 0; j < removedCount; j++) {\n va r wrapper = wrap(oldChildren[oldIndex++]);\n if (!added.get(wrapper))\n remove(wrapper);\n }\n\n var addedCount = splice.added Count;\n var refNode = oldChildren[oldIndex] && wrap(oldChildren[oldIndex ]);\n for (var j = 0; j < addedCount; j++) {\n var newChildRende rNode = newChildren[newIndex++];\n var newChildWrapper = newChildRender Node.node;\n insertBefore(nodeWrapper, newChildWrapper, refNode);\n\n // Keep track of added so that we do not remove the node after it\n // has been added.\n added.set(newChildWrapper, true);\n\n newChildRenderNode.sync(added);\n }\n\n lastIndex += addedCount; \n }\n\n for (var i = lastIndex; i < newChildren.length; i++) {\n newChildren[i].sync(added);\n }\n }\n };\n\n function ShadowRendere r(host) {\n this.host = host;\n this.dirty = false;\n this.invalidateAt tributes();\n this.associateNode(host);\n }\n\n ShadowRenderer.prototype = {\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.h tml#rendering-shadow-trees\n render: function(opt_renderNode) {\n if (!t his.dirty)\n return;\n\n this.invalidateAttributes();\n this.tr eeComposition();\n\n var host = this.host;\n var shadowRoot = host.sha dowRoot;\n\n this.associateNode(host);\n var topMostRenderer = !render Node;\n var renderNode = opt_renderNode || new RenderNode(host);\n\n f or (var node = shadowRoot.firstChild; node; node = node.nextSibling) {\n this.renderNode(shadowRoot, renderNode, node, false);\n }\n\n if (topM ostRenderer)\n renderNode.sync();\n\n this.dirty = false;\n },\n\ n invalidate: function() {\n if (!this.dirty) {\n this.dirty = tr ue;\n pendingDirtyRenderers.push(this);\n if (renderTimer)\n return;\n renderTimer = window[request](handleRequestAnimationFrame, 0);\n }\n },\n\n renderNode: function(shadowRoot, renderNode, node, i sNested) {\n if (isShadowHost(node)) {\n renderNode = renderNode.app end(node);\n var renderer = getRendererForHost(node);\n renderer.d irty = true; // Need to rerender due to reprojection.\n renderer.render( renderNode);\n } else if (isInsertionPoint(node)) {\n this.renderIns ertionPoint(shadowRoot, renderNode, node, isNested);\n } else if (isShadowI nsertionPoint(node)) {\n this.renderShadowInsertionPoint(shadowRoot, rend erNode, node);\n } else {\n this.renderAsAnyDomTree(shadowRoot, rend erNode, node, isNested);\n }\n },\n\n renderAsAnyDomTree: function(sh adowRoot, renderNode, node, isNested) {\n renderNode = renderNode.append(no de);\n\n if (isShadowHost(node)) {\n var renderer = getRendererForHo st(node);\n // renderNode.skip = !renderer.dirty;\n renderer.inval idate();\n renderer.render(renderNode);\n } else {\n for (var child = node.firstChild; child; child = child.nextSibling) {\n this.re nderNode(shadowRoot, renderNode, child, isNested);\n }\n }\n },\n \n renderInsertionPoint: function(shadowRoot, renderNode, insertionPoint,\n isNested) {\n var distributedChildNodes = getDistributedChildNodes(insertionPoint);\n if (distributedChildNodes.lengt h) {\n this.associateNode(insertionPoint);\n\n for (var i = 0; i < distributedChildNodes.length; i++) {\n var child = distributedChildNod es[i];\n if (isInsertionPoint(child) && isNested)\n this.ren derInsertionPoint(shadowRoot, renderNode, child, isNested);\n else\n this.renderAsAnyDomTree(shadowRoot, renderNode, child, isNested);\n }\n } else {\n this.renderFallbackContent(shadowRoot, renderNode , insertionPoint);\n }\n this.associateNode(insertionPoint.parentNode) ;\n },\n\n renderShadowInsertionPoint: function(shadowRoot, renderNode,\n shadowInsertionPoint) {\n var nextO lderTree = shadowRoot.olderShadowRoot;\n if (nextOlderTree) {\n assi gnToInsertionPoint(nextOlderTree, shadowInsertionPoint);\n this.associate Node(shadowInsertionPoint.parentNode);\n for (var node = nextOlderTree.fi rstChild;\n node;\n node = node.nextSibling) {\n this.renderNode(nextOlderTree, renderNode, node, true);\n }\n } el se {\n this.renderFallbackContent(shadowRoot, renderNode,\n shadowInsertionPoint);\n }\n },\n\n renderFallba ckContent: function(shadowRoot, renderNode, fallbackHost) {\n this.associat eNode(fallbackHost);\n this.associateNode(fallbackHost.parentNode);\n for (var node = fallbackHost.firstChild; node; node = node.nextSibling) {\n this.renderAsAnyDomTree(shadowRoot, renderNode, node, false);\n }\n } ,\n\n /**\n * Invalidates the attributes used to keep track of which attr ibutes may\n * cause the renderer to be invalidated.\n */\n invalidat eAttributes: function() {\n this.attributes = Object.create(null);\n },\ n\n /**\n * Parses the selector and makes this renderer dependent on the attribute\n * being used in the selector.\n * @param {string} selector\n */\n updateDependentAttributes: function(selector) {\n if (!selecto r)\n return;\n\n var attributes = this.attributes;\n\n // .clas s\n if (/\\.\\w+/.test(selector))\n attributes['class'] = true;\n\n // #id\n if (/#\\w+/.test(selector))\n attributes['id'] = true; \n\n selector.replace(/\\[\\s*([^\\s=\\|~\\]]+)/g, function(_, name) {\n attributes[name] = true;\n });\n\n // Pseudo selectors have been removed from the spec.\n },\n\n dependsOnAttribute: function(name) {\n return this.attributes[name];\n },\n\n // http://dvcs.w3.org/hg/webcompo nents/raw-file/tip/spec/shadow/index.html#dfn-distribution-algorithm\n distri bute: function(tree, pool) {\n var self = this;\n\n visit(tree, isActi veInsertionPoint,\n function(insertionPoint) {\n resetDistri butedChildNodes(insertionPoint);\n self.updateDependentAttributes(\n insertionPoint.getAttribute('select'));\n\n for (var i = 0; i < pool.length; i++) { // 1.2\n var node = pool[i]; // 1.2 .1\n if (node === undefined) // removed\n continue; \n if (matchesCriteria(node, insertionPoint)) { // 1.2.2\n distributeChildToInsertionPoint(node, insertionPoint); // 1.2.2.1\n pool[i] = undefined; // 1.2.2.2\n }\n }\n });\n },\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/s pec/shadow/index.html#dfn-tree-composition\n treeComposition: function () {\n var shadowHost = this.host;\n var tree = shadowHost.shadowRoot; // 1 .\n var pool = []; // 2.\n\n for (var child = shadowHost.firstChild;\ n child;\n child = child.nextSibling) { // 3.\n if ( isInsertionPoint(child)) { // 3.2.\n var reprojected = getDistributedC hildNodes(child); // 3.2.1.\n // if reprojected is undef... reset it?\ n if (!reprojected || !reprojected.length) // 3.2.2.\n repr ojected = getChildNodesSnapshot(child);\n pool.push.apply(pool, reproje cted); // 3.2.3.\n } else {\n pool.push(child); // 3.3.\n }\n }\n\n var shadowInsertionPoint, point;\n while (tree) { // 4.\n // 4.1.\n shadowInsertionPoint = undefined; // Reset every iteration.\n visit(tree, isActiveShadowInsertionPoint, function(point) {\ n shadowInsertionPoint = point;\n return false;\n });\n point = shadowInsertionPoint;\n\n this.distribute(tree, pool); / / 4.2.\n if (point) { // 4.3.\n var nextOlderTree = tree.olderS hadowRoot; // 4.3.1.\n if (!nextOlderTree) {\n break; // 4 .3.1.1.\n } else {\n tree = nextOlderTree; // 4.3.2.2.\n assignToInsertionPoint(tree, point); // 4.3.2.2.\n continue ; // 4.3.2.3.\n }\n } else {\n break; // 4.4.\n }\n }\n },\n\n associateNode: function(node) {\n node.impl.pol ymerShadowRenderer_ = this;\n }\n };\n\n function isInsertionPoint(node) {\ n // Should this include <shadow>?\n return node instanceof HTMLContentEle ment;\n }\n\n function isActiveInsertionPoint(node) {\n // <content> inside another <content> or <shadow> is considered inactive.\n return node instance of HTMLContentElement;\n }\n\n function isShadowInsertionPoint(node) {\n re turn node instanceof HTMLShadowElement;\n }\n\n function isActiveShadowInserti onPoint(node) {\n // <shadow> inside another <content> or <shadow> is conside red inactive.\n return node instanceof HTMLShadowElement;\n }\n\n function isShadowHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n function getShadowTrees(host) {\n var trees = [];\n\n for (var tree = host.shadowR oot; tree; tree = tree.olderShadowRoot) {\n trees.push(tree);\n }\n r eturn trees;\n }\n\n function assignToInsertionPoint(tree, point) {\n inser tionParentTable.set(tree, point);\n }\n\n // http://dvcs.w3.org/hg/webcomponen ts/raw-file/tip/spec/shadow/index.html#rendering-shadow-trees\n function render (host) {\n new ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host when:\n //\n // - a direct child to the ShadowRoot is added or rem oved\n // - a direct child to the host is added or removed\n // - a new shadow root is created\n // - a direct child to a content/shadow element is added or removed\n // - a sibling to a content/shadow element is added or removed\n // - content[select] is changed\n // - an attribute in a direct child to a host is modified\n\n /**\n * This gets called when a node was added or removed to it .\n */\n Node.prototype.invalidateShadowRenderer = function(force) {\n var renderer = this.impl.polymerShadowRenderer_;\n if (renderer) {\n render er.invalidate();\n return true;\n }\n\n return false;\n };\n\n HTML ContentElement.prototype.getDistributedNodes = function() {\n // TODO(arv): W e should only rerender the dirty ancestor renderers (from\n // the root and d own).\n renderAllPending();\n return getDistributedChildNodes(this);\n }; \n\n HTMLShadowElement.prototype.nodeIsInserted_ =\n HTMLContentElement.protot ype.nodeIsInserted_ = function() {\n // Invalidate old renderer if any.\n this.invalidateShadowRenderer();\n\n var shadowRoot = getShadowRootAncestor(t his);\n var renderer;\n if (shadowRoot)\n renderer = getRendererForSh adowRoot(shadowRoot);\n this.impl.polymerShadowRenderer_ = renderer;\n if (renderer)\n renderer.invalidate();\n };\n\n scope.eventParentsTable = ev entParentsTable;\n scope.getRendererForHost = getRendererForHost;\n scope.getS hadowTrees = getShadowTrees;\n scope.insertionParentTable = insertionParentTabl e;\n scope.renderAllPending = renderAllPending;\n\n // Exposed for testing\n scope.visual = {\n insertBefore: insertBefore,\n remove: remove,\n };\n\n })(window.ShadowDOMPolyfill);\n", 146 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LIC ENSE file.\n\n(function(scope) {\n 'use strict';\n\n var Element = scope.wrapp ers.Element;\n var HTMLContentElement = scope.wrappers.HTMLContentElement;\n v ar HTMLShadowElement = scope.wrappers.HTMLShadowElement;\n var Node = scope.wra ppers.Node;\n var ShadowRoot = scope.wrappers.ShadowRoot;\n var assert = scope .assert;\n var getTreeScope = scope.getTreeScope;\n var mixin = scope.mixin;\n var oneOf = scope.oneOf;\n var unwrap = scope.unwrap;\n var wrap = scope.wra p;\n\n /**\n * Updates the fields of a wrapper to a snapshot of the logical D OM as needed.\n * Up means parentNode\n * Sideways means previous and next s ibling.\n * @param {!Node} wrapper\n */\n function updateWrapperUpAndSidewa ys(wrapper) {\n wrapper.previousSibling_ = wrapper.previousSibling;\n wrap per.nextSibling_ = wrapper.nextSibling;\n wrapper.parentNode_ = wrapper.paren tNode;\n }\n\n /**\n * Updates the fields of a wrapper to a snapshot of the logical DOM as needed.\n * Down means first and last child\n * @param {!Node } wrapper\n */\n function updateWrapperDown(wrapper) {\n wrapper.firstChil d_ = wrapper.firstChild;\n wrapper.lastChild_ = wrapper.lastChild;\n }\n\n function updateAllChildNodes(parentNodeWrapper) {\n assert(parentNodeWrapper instanceof Node);\n for (var childWrapper = parentNodeWrapper.firstChild;\n childWrapper;\n childWrapper = childWrapper.nextSibling) {\n updateWrapperUpAndSideways(childWrapper);\n }\n updateWrapperDown(parentN odeWrapper);\n }\n\n function insertBefore(parentNodeWrapper, newChildWrapper, refChildWrapper) {\n var parentNode = unwrap(parentNodeWrapper);\n var ne wChild = unwrap(newChildWrapper);\n var refChild = refChildWrapper ? unwrap(r efChildWrapper) : null;\n\n remove(newChildWrapper);\n updateWrapperUpAndS ideways(newChildWrapper);\n\n if (!refChildWrapper) {\n parentNodeWrappe r.lastChild_ = parentNodeWrapper.lastChild;\n if (parentNodeWrapper.lastChi ld === parentNodeWrapper.firstChild)\n parentNodeWrapper.firstChild_ = pa rentNodeWrapper.firstChild;\n\n var lastChildWrapper = wrap(parentNode.last Child);\n if (lastChildWrapper)\n lastChildWrapper.nextSibling_ = la stChildWrapper.nextSibling;\n } else {\n if (parentNodeWrapper.firstChil d === refChildWrapper)\n parentNodeWrapper.firstChild_ = refChildWrapper; \n\n refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;\n }\n\n parentNode.insertBefore(newChild, refChild);\n }\n\n function remo ve(nodeWrapper) {\n var node = unwrap(nodeWrapper)\n var parentNode = node .parentNode;\n if (!parentNode)\n return;\n\n var parentNodeWrapper = wrap(parentNode);\n updateWrapperUpAndSideways(nodeWrapper);\n\n if (node Wrapper.previousSibling)\n nodeWrapper.previousSibling.nextSibling_ = nodeW rapper;\n if (nodeWrapper.nextSibling)\n nodeWrapper.nextSibling.previou sSibling_ = nodeWrapper;\n\n if (parentNodeWrapper.lastChild === nodeWrapper) \n parentNodeWrapper.lastChild_ = nodeWrapper;\n if (parentNodeWrapper.f irstChild === nodeWrapper)\n parentNodeWrapper.firstChild_ = nodeWrapper;\n \n parentNode.removeChild(node);\n }\n\n var distributedChildNodesTable = n ew WeakMap();\n var eventParentsTable = new WeakMap();\n var insertionParentTa ble = new WeakMap();\n var rendererForHostTable = new WeakMap();\n\n function distributeChildToInsertionPoint(child, insertionPoint) {\n getDistributedChil dNodes(insertionPoint).push(child);\n assignToInsertionPoint(child, insertion Point);\n\n var eventParents = eventParentsTable.get(child);\n if (!eventP arents)\n eventParentsTable.set(child, eventParents = []);\n eventParent s.push(insertionPoint);\n }\n\n function resetDistributedChildNodes(insertionP oint) {\n distributedChildNodesTable.set(insertionPoint, []);\n }\n\n funct ion getDistributedChildNodes(insertionPoint) {\n var rv = distributedChildNod esTable.get(insertionPoint);\n if (!rv)\n distributedChildNodesTable.set (insertionPoint, rv = []);\n return rv;\n }\n\n function getChildNodesSnaps hot(node) {\n var result = [], i = 0;\n for (var child = node.firstChild; child; child = child.nextSibling) {\n result[i++] = child;\n }\n retu rn result;\n }\n\n /**\n * Visits all nodes in the tree that fulfils the |pr edicate|. If the |visitor|\n * function returns |false| the traversal is abort ed.\n * @param {!Node} tree\n * @param {function(!Node) : boolean} predicate \n * @param {function(!Node) : *} visitor\n */\n function visit(tree, predi cate, visitor) {\n // This operates on logical DOM.\n for (var node = tree .firstChild; node; node = node.nextSibling) {\n if (predicate(node)) {\n if (visitor(node) === false)\n return;\n } else {\n vi sit(node, predicate, visitor);\n }\n }\n }\n\n // Matching Insertion P oints\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.h tml#matching-insertion-points\n\n // TODO(arv): Verify this... I don't remember why I picked this regexp.\n var selectorMatchRegExp = /^[*.:#[a-zA-Z_|]/;\n\n var allowedPseudoRegExp = new RegExp('^:(' + [\n 'link',\n 'visited',\n 'target',\n 'enabled',\n 'disabled',\n 'checked',\n 'indeterminate ',\n 'nth-child',\n 'nth-last-child',\n 'nth-of-type',\n 'nth-last-o f-type',\n 'first-child',\n 'last-child',\n 'first-of-type',\n 'last -of-type',\n 'only-of-type',\n ].join('|') + ')');\n\n\n /**\n * @param { Element} node\n * @oaram {Element} point The insertion point element.\n * @r eturn {boolean} Whether the node matches the insertion point.\n */\n function matchesCriteria(node, point) {\n var select = point.getAttribute('select');\ n if (!select)\n return true;\n\n // Here we know the select attribut e is a non empty string.\n select = select.trim();\n if (!select)\n r eturn true;\n\n if (!(node instanceof Element))\n return false;\n\n / / The native matches function in IE9 does not correctly work with elements\n // that are not in the document.\n // TODO(arv): Implement matching in JS.\n // https://github.com/Polymer/ShadowDOM/issues/361\n if (select === '*' || select === node.localName)\n return true;\n\n // TODO(arv): This does n ot seem right. Need to check for a simple selector.\n if (!selectorMatchRegEx p.test(select))\n return false;\n\n // TODO(arv): This no longer matches the spec.\n if (select[0] === ':' && !allowedPseudoRegExp.test(select))\n return false;\n\n try {\n return node.matches(select);\n } catch ( ex) {\n // Invalid selector.\n return false;\n }\n }\n\n var requ est = oneOf(window, [\n 'requestAnimationFrame',\n 'mozRequestAnimationFra me',\n 'webkitRequestAnimationFrame',\n 'setTimeout'\n ]);\n\n var pendi ngDirtyRenderers = [];\n var renderTimer;\n\n function renderAllPending() {\n // TODO(arv): Order these in document order. That way we do not have to\n // render something twice.\n for (var i = 0; i < pendingDirtyRenderers.length ; i++) {\n var renderer = pendingDirtyRenderers[i];\n var parentRender er = renderer.parentRenderer;\n if (parentRenderer && parentRenderer.dirty) \n continue;\n renderer.render();\n }\n\n pendingDirtyRenderer s = [];\n }\n\n function handleRequestAnimationFrame() {\n renderTimer = nu ll;\n renderAllPending();\n }\n\n /**\n * Returns existing shadow rendere r for a host or creates it if it is needed.\n * @params {!Element} host\n * @return {!ShadowRenderer}\n */\n function getRendererForHost(host) {\n var renderer = rendererForHostTable.get(host);\n if (!renderer) {\n rendere r = new ShadowRenderer(host);\n rendererForHostTable.set(host, renderer);\n }\n return renderer;\n }\n\n function getShadowRootAncestor(node) {\n var root = getTreeScope(node).root;\n if (root instanceof ShadowRoot)\n return root;\n return null;\n }\n\n function getRendererForShadowRoot(sha dowRoot) {\n return getRendererForHost(shadowRoot.host);\n }\n\n var splice Diff = new ArraySplice();\n spliceDiff.equals = function(renderNode, rawNode) { \n return unwrap(renderNode.node) === rawNode;\n };\n\n /**\n * RenderNod e is used as an in memory \"render tree\". When we render the\n * composed tre e we create a tree of RenderNodes, then we diff this against\n * the real DOM tree and make minimal changes as needed.\n */\n function RenderNode(node) {\n this.skip = false;\n this.node = node;\n this.childNodes = [];\n }\n\ n RenderNode.prototype = {\n append: function(node) {\n var rv = new Re nderNode(node);\n this.childNodes.push(rv);\n return rv;\n },\n\n sync: function(opt_added) {\n if (this.skip)\n return;\n\n va r nodeWrapper = this.node;\n // plain array of RenderNodes\n var newCh ildren = this.childNodes;\n // plain array of real nodes.\n var oldChi ldren = getChildNodesSnapshot(unwrap(nodeWrapper));\n var added = opt_added || new WeakMap();\n\n var splices = spliceDiff.calculateSplices(newChildre n, oldChildren);\n\n var newIndex = 0, oldIndex = 0;\n var lastIndex = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice = spli ces[i];\n for (; lastIndex < splice.index; lastIndex++) {\n oldI ndex++;\n newChildren[newIndex++].sync(added);\n }\n\n va r removedCount = splice.removed.length;\n for (var j = 0; j < removedCoun t; j++) {\n var wrapper = wrap(oldChildren[oldIndex++]);\n if (!added.get(wrapper))\n remove(wrapper);\n }\n\n var ad dedCount = splice.addedCount;\n var refNode = oldChildren[oldIndex] && wr ap(oldChildren[oldIndex]);\n for (var j = 0; j < addedCount; j++) {\n var newChildRenderNode = newChildren[newIndex++];\n var newChildW rapper = newChildRenderNode.node;\n insertBefore(nodeWrapper, newChildW rapper, refNode);\n\n // Keep track of added so that we do not remove t he node after it\n // has been added.\n added.set(newChildWrap per, true);\n\n newChildRenderNode.sync(added);\n }\n\n l astIndex += addedCount;\n }\n\n for (var i = lastIndex; i < newChildre n.length; i++) {\n newChildren[i].sync(added);\n }\n }\n };\n\n function ShadowRenderer(host) {\n this.host = host;\n this.dirty = false; \n this.invalidateAttributes();\n this.associateNode(host);\n }\n\n Shad owRenderer.prototype = {\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/ tip/spec/shadow/index.html#rendering-shadow-trees\n render: function(opt_rend erNode) {\n if (!this.dirty)\n return;\n\n this.invalidateAttri butes();\n this.treeComposition();\n\n var host = this.host;\n va r shadowRoot = host.shadowRoot;\n\n this.associateNode(host);\n var to pMostRenderer = !renderNode;\n var renderNode = opt_renderNode || new Rende rNode(host);\n\n for (var node = shadowRoot.firstChild; node; node = node.n extSibling) {\n this.renderNode(shadowRoot, renderNode, node, false);\n }\n\n if (topMostRenderer)\n renderNode.sync();\n\n this.di rty = false;\n },\n\n get parentRenderer() {\n return getTreeScope(th is.host).renderer;\n },\n\n invalidate: function() {\n if (!this.dirt y) {\n this.dirty = true;\n pendingDirtyRenderers.push(this);\n if (renderTimer)\n return;\n renderTimer = window[request]( handleRequestAnimationFrame, 0);\n }\n },\n\n renderNode: function(sh adowRoot, renderNode, node, isNested) {\n if (isShadowHost(node)) {\n renderNode = renderNode.append(node);\n var renderer = getRendererForHo st(node);\n renderer.dirty = true; // Need to rerender due to reprojecti on.\n renderer.render(renderNode);\n } else if (isInsertionPoint(nod e)) {\n this.renderInsertionPoint(shadowRoot, renderNode, node, isNested) ;\n } else if (isShadowInsertionPoint(node)) {\n this.renderShadowIn sertionPoint(shadowRoot, renderNode, node);\n } else {\n this.render AsAnyDomTree(shadowRoot, renderNode, node, isNested);\n }\n },\n\n re nderAsAnyDomTree: function(shadowRoot, renderNode, node, isNested) {\n rend erNode = renderNode.append(node);\n\n if (isShadowHost(node)) {\n va r renderer = getRendererForHost(node);\n renderNode.skip = !renderer.dirt y;\n renderer.render(renderNode);\n } else {\n for (var child = node.firstChild; child; child = child.nextSibling) {\n this.renderNo de(shadowRoot, renderNode, child, isNested);\n }\n }\n },\n\n renderInsertionPoint: function(shadowRoot, renderNode, insertionPoint,\n isNested) {\n var distributedChildNodes = getDis tributedChildNodes(insertionPoint);\n if (distributedChildNodes.length) {\n this.associateNode(insertionPoint);\n\n for (var i = 0; i < distr ibutedChildNodes.length; i++) {\n var child = distributedChildNodes[i]; \n if (isInsertionPoint(child) && isNested)\n this.renderIns ertionPoint(shadowRoot, renderNode, child, isNested);\n else\n this.renderAsAnyDomTree(shadowRoot, renderNode, child, isNested);\n }\ n } else {\n this.renderFallbackContent(shadowRoot, renderNode, inse rtionPoint);\n }\n this.associateNode(insertionPoint.parentNode);\n },\n\n renderShadowInsertionPoint: function(shadowRoot, renderNode,\n shadowInsertionPoint) {\n var nextOlderTr ee = shadowRoot.olderShadowRoot;\n if (nextOlderTree) {\n assignToIn sertionPoint(nextOlderTree, shadowInsertionPoint);\n this.associateNode(s hadowInsertionPoint.parentNode);\n for (var node = nextOlderTree.firstChi ld;\n node;\n node = node.nextSibling) {\n this .renderNode(nextOlderTree, renderNode, node, true);\n }\n } else {\n this.renderFallbackContent(shadowRoot, renderNode,\n shadowInsertionPoint);\n }\n },\n\n renderFallbackCont ent: function(shadowRoot, renderNode, fallbackHost) {\n this.associateNode( fallbackHost);\n this.associateNode(fallbackHost.parentNode);\n for (v ar node = fallbackHost.firstChild; node; node = node.nextSibling) {\n thi s.renderAsAnyDomTree(shadowRoot, renderNode, node, false);\n }\n },\n\n /**\n * Invalidates the attributes used to keep track of which attributes may\n * cause the renderer to be invalidated.\n */\n invalidateAttri butes: function() {\n this.attributes = Object.create(null);\n },\n\n /**\n * Parses the selector and makes this renderer dependent on the attrib ute\n * being used in the selector.\n * @param {string} selector\n * /\n updateDependentAttributes: function(selector) {\n if (!selector)\n return;\n\n var attributes = this.attributes;\n\n // .class\n if (/\\.\\w+/.test(selector))\n attributes['class'] = true;\n\n / / #id\n if (/#\\w+/.test(selector))\n attributes['id'] = true;\n\n selector.replace(/\\[\\s*([^\\s=\\|~\\]]+)/g, function(_, name) {\n a ttributes[name] = true;\n });\n\n // Pseudo selectors have been remove d from the spec.\n },\n\n dependsOnAttribute: function(name) {\n retu rn this.attributes[name];\n },\n\n // http://dvcs.w3.org/hg/webcomponents/ raw-file/tip/spec/shadow/index.html#dfn-distribution-algorithm\n distribute: function(tree, pool) {\n var self = this;\n\n visit(tree, isActiveInse rtionPoint,\n function(insertionPoint) {\n resetDistributedC hildNodes(insertionPoint);\n self.updateDependentAttributes(\n insertionPoint.getAttribute('select'));\n\n for (var i = 0; i < pool.length; i++) { // 1.2\n var node = pool[i]; // 1.2.1\n if (node === undefined) // removed\n continue;\n if (matchesCriteria(node, insertionPoint)) { // 1.2.2\n distributeChildToInsertionPoint(node, insertionPoint); // 1.2.2.1\n pool[i] = undefined; // 1.2.2.2\n }\n }\n });\n },\n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/sh adow/index.html#dfn-tree-composition\n treeComposition: function () {\n var shadowHost = this.host;\n var tree = shadowHost.shadowRoot; // 1.\n var pool = []; // 2.\n\n for (var child = shadowHost.firstChild;\n child;\n child = child.nextSibling) { // 3.\n if (isInse rtionPoint(child)) { // 3.2.\n var reprojected = getDistributedChildNo des(child); // 3.2.1.\n // if reprojected is undef... reset it?\n if (!reprojected || !reprojected.length) // 3.2.2.\n reprojecte d = getChildNodesSnapshot(child);\n pool.push.apply(pool, reprojected); // 3.2.3.\n } else {\n pool.push(child); // 3.3.\n }\n }\n\n var shadowInsertionPoint, point;\n while (tree) { // 4.\n // 4.1.\n shadowInsertionPoint = undefined; // Reset every iterat ion.\n visit(tree, isActiveShadowInsertionPoint, function(point) {\n shadowInsertionPoint = point;\n return false;\n });\n point = shadowInsertionPoint;\n\n this.distribute(tree, pool); // 4.2. \n if (point) { // 4.3.\n var nextOlderTree = tree.olderShadowR oot; // 4.3.1.\n if (!nextOlderTree) {\n break; // 4.3.1.1 .\n } else {\n tree = nextOlderTree; // 4.3.2.2.\n assignToInsertionPoint(tree, point); // 4.3.2.2.\n continue; // 4.3.2.3.\n }\n } else {\n break; // 4.4.\n }\n }\n },\n\n associateNode: function(node) {\n node.impl.polymerSh adowRenderer_ = this;\n }\n };\n\n function isInsertionPoint(node) {\n / / Should this include <shadow>?\n return node instanceof HTMLContentElement;\ n }\n\n function isActiveInsertionPoint(node) {\n // <content> inside anoth er <content> or <shadow> is considered inactive.\n return node instanceof HTM LContentElement;\n }\n\n function isShadowInsertionPoint(node) {\n return n ode instanceof HTMLShadowElement;\n }\n\n function isActiveShadowInsertionPoin t(node) {\n // <shadow> inside another <content> or <shadow> is considered in active.\n return node instanceof HTMLShadowElement;\n }\n\n function isShad owHost(shadowHost) {\n return shadowHost.shadowRoot;\n }\n\n function getSh adowTrees(host) {\n var trees = [];\n\n for (var tree = host.shadowRoot; t ree; tree = tree.olderShadowRoot) {\n trees.push(tree);\n }\n return trees;\n }\n\n function assignToInsertionPoint(tree, point) {\n insertionPa rentTable.set(tree, point);\n }\n\n // http://dvcs.w3.org/hg/webcomponents/raw -file/tip/spec/shadow/index.html#rendering-shadow-trees\n function render(host) {\n new ShadowRenderer(host).render();\n };\n\n // Need to rerender shadow host when:\n //\n // - a direct child to the ShadowRoot is added or removed\n // - a direct child to the host is added or removed\n // - a new shadow root is created\n // - a direct child to a content/shadow element is added or remove d\n // - a sibling to a content/shadow element is added or removed\n // - cont ent[select] is changed\n // - an attribute in a direct child to a host is modif ied\n\n /**\n * This gets called when a node was added or removed to it.\n */\n Node.prototype.invalidateShadowRenderer = function(force) {\n var rende rer = this.impl.polymerShadowRenderer_;\n if (renderer) {\n renderer.inv alidate();\n return true;\n }\n\n return false;\n };\n\n HTMLConten tElement.prototype.getDistributedNodes = function() {\n // TODO(arv): We shou ld only rerender the dirty ancestor renderers (from\n // the root and down).\ n renderAllPending();\n return getDistributedChildNodes(this);\n };\n\n HTMLShadowElement.prototype.nodeIsInserted_ =\n HTMLContentElement.prototype.no deIsInserted_ = function() {\n // Invalidate old renderer if any.\n this.i nvalidateShadowRenderer();\n\n var shadowRoot = getShadowRootAncestor(this);\ n var renderer;\n if (shadowRoot)\n renderer = getRendererForShadowRo ot(shadowRoot);\n this.impl.polymerShadowRenderer_ = renderer;\n if (rende rer)\n renderer.invalidate();\n };\n\n scope.eventParentsTable = eventPar entsTable;\n scope.getRendererForHost = getRendererForHost;\n scope.getShadowT rees = getShadowTrees;\n scope.insertionParentTable = insertionParentTable;\n scope.renderAllPending = renderAllPending;\n\n // Exposed for testing\n scope. visual = {\n insertBefore: insertBefore,\n remove: remove,\n };\n\n})(win dow.ShadowDOMPolyfill);\n",
144 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var assert = scope.assert;\n var mixin = scope.mixin;\ n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var elementsWithFormProperty = [\n 'HTMLButtonEl ement',\n 'HTMLFieldSetElement',\n 'HTMLInputElement',\n 'HTMLKeygenEle ment',\n 'HTMLLabelElement',\n 'HTMLLegendElement',\n 'HTMLObjectElemen t',\n // HTMLOptionElement is handled in HTMLOptionElement.js\n 'HTMLOutpu tElement',\n // HTMLSelectElement is handled in HTMLSelectElement.js\n 'HT MLTextAreaElement',\n ];\n\n function createWrapperConstructor(name) {\n if (!window[name])\n return;\n\n // Ensure we are not overriding an alread y existing constructor.\n assert(!scope.wrappers[name]);\n\n var Generated Wrapper = function(node) {\n // At this point all of them extend HTMLElemen t.\n HTMLElement.call(this, node);\n }\n GeneratedWrapper.prototype = Object.create(HTMLElement.prototype);\n mixin(GeneratedWrapper.prototype, {\ n get form() {\n return wrap(unwrap(this).form);\n },\n });\ n\n registerWrapper(window[name], GeneratedWrapper,\n document.createE lement(name.slice(4, -7)));\n scope.wrappers[name] = GeneratedWrapper;\n }\n \n elementsWithFormProperty.forEach(createWrapperConstructor);\n\n})(window.Sha dowDOMPolyfill);\n", 147 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var HTMLElement = scope. wrappers.HTMLElement;\n var assert = scope.assert;\n var mixin = scope.mixin;\ n var registerWrapper = scope.registerWrapper;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n\n var elementsWithFormProperty = [\n 'HTMLButtonEl ement',\n 'HTMLFieldSetElement',\n 'HTMLInputElement',\n 'HTMLKeygenEle ment',\n 'HTMLLabelElement',\n 'HTMLLegendElement',\n 'HTMLObjectElemen t',\n // HTMLOptionElement is handled in HTMLOptionElement.js\n 'HTMLOutpu tElement',\n // HTMLSelectElement is handled in HTMLSelectElement.js\n 'HT MLTextAreaElement',\n ];\n\n function createWrapperConstructor(name) {\n if (!window[name])\n return;\n\n // Ensure we are not overriding an alread y existing constructor.\n assert(!scope.wrappers[name]);\n\n var Generated Wrapper = function(node) {\n // At this point all of them extend HTMLElemen t.\n HTMLElement.call(this, node);\n }\n GeneratedWrapper.prototype = Object.create(HTMLElement.prototype);\n mixin(GeneratedWrapper.prototype, {\ n get form() {\n return wrap(unwrap(this).form);\n },\n });\ n\n registerWrapper(window[name], GeneratedWrapper,\n document.createE lement(name.slice(4, -7)));\n scope.wrappers[name] = GeneratedWrapper;\n }\n \n elementsWithFormProperty.forEach(createWrapperConstructor);\n\n})(window.Sha dowDOMPolyfill);\n",
145 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope .unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalSelection = window.S election;\n\n function Selection(impl) {\n this.impl = impl;\n }\n Selecti on.prototype = {\n get anchorNode() {\n return wrap(this.impl.anchorNode );\n },\n get focusNode() {\n return wrap(this.impl.focusNode);\n },\n addRange: function(range) {\n this.impl.addRange(unwrap(range));\n },\n collapse: function(node, index) {\n this.impl.collapse(unwrapIfN eeded(node), index);\n },\n containsNode: function(node, allowPartial) {\n return this.impl.containsNode(unwrapIfNeeded(node), allowPartial);\n }, \n extend: function(node, offset) {\n this.impl.extend(unwrapIfNeeded(no de), offset);\n },\n getRangeAt: function(index) {\n return wrap(this .impl.getRangeAt(index));\n },\n removeRange: function(range) {\n thi s.impl.removeRange(unwrap(range));\n },\n selectAllChildren: function(node ) {\n this.impl.selectAllChildren(unwrapIfNeeded(node));\n },\n toStr ing: function() {\n return this.impl.toString();\n }\n };\n\n // WebKi t extensions. Not implemented.\n // readonly attribute Node baseNode;\n // rea donly attribute long baseOffset;\n // readonly attribute Node extentNode;\n // readonly attribute long extentOffset;\n // [RaisesException] void setBaseAndEx tent([Default=Undefined] optional Node baseNode,\n // [De fault=Undefined] optional long baseOffset,\n // [Default= Undefined] optional Node extentNode,\n // [Default=Undefi ned] optional long extentOffset);\n // [RaisesException, ImplementedAs=collapse ] void setPosition([Default=Undefined] optional Node node,\n // [Default=Undefined] optional long offset);\n\n registerWrapper(window.Selecti on, Selection, window.getSelection());\n\n scope.wrappers.Selection = Selection ;\n\n})(window.ShadowDOMPolyfill);\n", 148 "// Copyright 2014 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var registerWrapper = sc ope.registerWrapper;\n var unwrap = scope.unwrap;\n var unwrapIfNeeded = scope .unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalSelection = window.S election;\n\n function Selection(impl) {\n this.impl = impl;\n }\n Selecti on.prototype = {\n get anchorNode() {\n return wrap(this.impl.anchorNode );\n },\n get focusNode() {\n return wrap(this.impl.focusNode);\n },\n addRange: function(range) {\n this.impl.addRange(unwrap(range));\n },\n collapse: function(node, index) {\n this.impl.collapse(unwrapIfN eeded(node), index);\n },\n containsNode: function(node, allowPartial) {\n return this.impl.containsNode(unwrapIfNeeded(node), allowPartial);\n }, \n extend: function(node, offset) {\n this.impl.extend(unwrapIfNeeded(no de), offset);\n },\n getRangeAt: function(index) {\n return wrap(this .impl.getRangeAt(index));\n },\n removeRange: function(range) {\n thi s.impl.removeRange(unwrap(range));\n },\n selectAllChildren: function(node ) {\n this.impl.selectAllChildren(unwrapIfNeeded(node));\n },\n toStr ing: function() {\n return this.impl.toString();\n }\n };\n\n // WebKi t extensions. Not implemented.\n // readonly attribute Node baseNode;\n // rea donly attribute long baseOffset;\n // readonly attribute Node extentNode;\n // readonly attribute long extentOffset;\n // [RaisesException] void setBaseAndEx tent([Default=Undefined] optional Node baseNode,\n // [De fault=Undefined] optional long baseOffset,\n // [Default= Undefined] optional Node extentNode,\n // [Default=Undefi ned] optional long extentOffset);\n // [RaisesException, ImplementedAs=collapse ] void setPosition([Default=Undefined] optional Node node,\n // [Default=Undefined] optional long offset);\n\n registerWrapper(window.Selecti on, Selection, window.getSelection());\n\n scope.wrappers.Selection = Selection ;\n\n})(window.ShadowDOMPolyfill);\n",
146 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa ce = scope.GetElementsByInterface;\n var Node = scope.wrappers.Node;\n var Par entNodeInterface = scope.ParentNodeInterface;\n var Selection = scope.wrappers. Selection;\n var SelectorsInterface = scope.SelectorsInterface;\n var ShadowRo ot = scope.wrappers.ShadowRoot;\n var cloneNode = scope.cloneNode;\n var defin eWrapGetter = scope.defineWrapGetter;\n var elementFromPoint = scope.elementFro mPoint;\n var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;\n var m atchesNames = scope.matchesNames;\n var mixin = scope.mixin;\n var registerWra pper = scope.registerWrapper;\n var renderAllPending = scope.renderAllPending;\ n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n var wrap = scope. wrap;\n var wrapEventTargetMethods = scope.wrapEventTargetMethods;\n var wrapN odeList = scope.wrapNodeList;\n\n var implementationTable = new WeakMap();\n\n function Document(node) {\n Node.call(this, node);\n }\n Document.prototyp e = Object.create(Node.prototype);\n\n defineWrapGetter(Document, 'documentElem ent');\n\n // Conceptually both body and head can be in a shadow but suporting that seems\n // overkill at this point.\n defineWrapGetter(Document, 'body');\ n defineWrapGetter(Document, 'head');\n\n // document cannot be overridden so we override a bunch of its methods\n // directly on the instance.\n\n function wrapMethod(name) {\n var original = document[name];\n Document.prototype[ name] = function() {\n return wrap(original.apply(this.impl, arguments));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFragment',\n 'cr eateElement',\n 'createElementNS',\n 'createEvent',\n 'createEventNS',\ n 'createRange',\n 'createTextNode',\n 'getElementById'\n ].forEach(wr apMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n function adoptN odeNoRemove(node, doc) {\n originalAdoptNode.call(doc.impl, unwrap(node));\n adoptSubtree(node, doc);\n }\n\n function adoptSubtree(node, doc) {\n if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot);\n if (node instance of ShadowRoot)\n adoptOlderShadowRoots(node, doc);\n for (var child = no de.firstChild; child; child = child.nextSibling) {\n adoptSubtree(child, do c);\n }\n }\n\n function adoptOlderShadowRoots(shadowRoot, doc) {\n var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (oldShadowRoot)\n doc.a doptNode(oldShadowRoot);\n }\n\n var originalGetSelection = document.getSelect ion;\n\n mixin(Document.prototype, {\n adoptNode: function(node) {\n if (node.parentNode)\n node.parentNode.removeChild(node);\n adoptNodeN oRemove(node, this);\n return node;\n },\n elementFromPoint: function (x, y) {\n return elementFromPoint(this, this, x, y);\n },\n importNo de: function(node, deep) {\n return cloneNode(node, deep, this.impl);\n },\n getSelection: function() {\n renderAllPending();\n return new Selection(originalGetSelection.call(unwrap(this)));\n }\n });\n\n if (docum ent.registerElement) {\n var originalRegisterElement = document.registerEleme nt;\n Document.prototype.registerElement = function(tagName, object) {\n var prototype = object.prototype;\n\n // If we already used the object as a prototype for another custom\n // element.\n if (scope.nativePrototy peTable.get(prototype)) {\n // TODO(arv): DOMException\n throw new Error('NotSupportedError');\n }\n\n // Find first object on the proto type chain that already have a native\n // prototype. Keep track of all the objects before that so we can create\n // a similar structure for the nati ve case.\n var proto = Object.getPrototypeOf(prototype);\n var nativeP rototype;\n var prototypes = [];\n while (proto) {\n nativeProt otype = scope.nativePrototypeTable.get(proto);\n if (nativePrototype)\n break;\n prototypes.push(proto);\n proto = Object.getProto typeOf(proto);\n }\n\n if (!nativePrototype) {\n // TODO(arv): DOMException\n throw new Error('NotSupportedError');\n }\n\n // This works by creating a new prototype object that is empty, but has\n // the native prototype as its proto. The original prototype object\n // passe d into register is used as the wrapper prototype.\n\n var newPrototype = Ob ject.create(nativePrototype);\n for (var i = prototypes.length - 1; i >= 0; i--) {\n newPrototype = Object.create(newPrototype);\n }\n\n / / Add callbacks if present.\n // Names are taken from:\n // https:// code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/bin dings/v8/CustomElementConstructorBuilder.cpp&sq=package:chromium&type=cs&l=156\n // and not from the spec since the spec is out of date.\n [\n 'createdCallback',\n 'attachedCallback',\n 'detachedCallback',\n 'attributeChangedCallback',\n ].forEach(function(name) {\n var f = prototype[name];\n if (!f)\n return;\n newPrototype[ name] = function() {\n // if this element has been wrapped prior to reg istration,\n // the wrapper is stale; in this case rewrap\n if (!(wrap(this) instanceof CustomElementConstructor)) {\n rewrap(this) ;\n }\n f.apply(wrap(this), arguments);\n };\n }); \n\n var p = {prototype: newPrototype};\n if (object.extends)\n p.extends = object.extends;\n\n function CustomElementConstructor(node) {\ n if (!node) {\n if (object.extends) {\n return docum ent.createElement(object.extends, tagName);\n } else {\n ret urn document.createElement(tagName);\n }\n }\n this.impl = node;\n }\n CustomElementConstructor.prototype = prototype;\n C ustomElementConstructor.prototype.constructor = CustomElementConstructor;\n\n scope.constructorTable.set(newPrototype, CustomElementConstructor);\n sc ope.nativePrototypeTable.set(prototype, newPrototype);\n\n // registration is synchronous so do it last\n var nativeConstructor = originalRegisterElem ent.call(unwrap(this),\n tagName, p);\n return CustomElementConstr uctor;\n };\n\n forwardMethodsToWrapper([\n window.HTMLDocument || wi ndow.Document, // Gecko adds these to HTMLDocument\n ], [\n 'registerEl ement',\n ]);\n }\n\n // We also override some of the methods on document.b ody and document.head\n // for convenience.\n forwardMethodsToWrapper([\n w indow.HTMLBodyElement,\n window.HTMLDocument || window.Document, // Gecko ad ds these to HTMLDocument\n window.HTMLHeadElement,\n window.HTMLHtmlElemen t,\n ], [\n 'appendChild',\n 'compareDocumentPosition',\n 'contains',\ n 'getElementsByClassName',\n 'getElementsByTagName',\n 'getElementsByT agNameNS',\n 'insertBefore',\n 'querySelector',\n 'querySelectorAll',\n 'removeChild',\n 'replaceChild',\n ].concat(matchesNames));\n\n forward MethodsToWrapper([\n window.HTMLDocument || window.Document, // Gecko adds t hese to HTMLDocument\n ], [\n 'adoptNode',\n 'importNode',\n 'contains ',\n 'createComment',\n 'createDocumentFragment',\n 'createElement',\n 'createElementNS',\n 'createEvent',\n 'createEventNS',\n 'createRang e',\n 'createTextNode',\n 'elementFromPoint',\n 'getElementById',\n 'getSelection',\n ]);\n\n mixin(Document.prototype, GetElementsByInterface);\n mixin(Document.prototype, ParentNodeInterface);\n mixin(Document.prototype, S electorsInterface);\n\n mixin(Document.prototype, {\n get implementation() { \n var implementation = implementationTable.get(this);\n if (implement ation)\n return implementation;\n implementation =\n new DO MImplementation(unwrap(this).implementation);\n implementationTable.set(thi s, implementation);\n return implementation;\n }\n });\n\n registerWra pper(window.Document, Document,\n document.implementation.createHTMLDocumen t(''));\n\n // Both WebKit and Gecko uses HTMLDocument for document. HTML5/DOM only has\n // one Document interface and IE implements the standard correctly.\ n if (window.HTMLDocument)\n registerWrapper(window.HTMLDocument, Document); \n\n wrapEventTargetMethods([\n window.HTMLBodyElement,\n window.HTMLDocu ment || window.Document, // Gecko adds these to HTMLDocument\n window.HTMLHe adElement,\n ]);\n\n function DOMImplementation(impl) {\n this.impl = impl; \n }\n\n function wrapImplMethod(constructor, name) {\n var original = docu ment.implementation[name];\n constructor.prototype[name] = function() {\n return wrap(original.apply(this.impl, arguments));\n };\n }\n\n function forwardImplMethod(constructor, name) {\n var original = document.implementati on[name];\n constructor.prototype[name] = function() {\n return original .apply(this.impl, arguments);\n };\n }\n\n wrapImplMethod(DOMImplementation , 'createDocumentType');\n wrapImplMethod(DOMImplementation, 'createDocument'); \n wrapImplMethod(DOMImplementation, 'createHTMLDocument');\n forwardImplMetho d(DOMImplementation, 'hasFeature');\n\n registerWrapper(window.DOMImplementatio n, DOMImplementation);\n\n forwardMethodsToWrapper([\n window.DOMImplementat ion,\n ], [\n 'createDocumentType',\n 'createDocument',\n 'createHTMLD ocument',\n 'hasFeature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNodeNoRe move;\n scope.wrappers.DOMImplementation = DOMImplementation;\n scope.wrappers .Document = Document;\n\n})(window.ShadowDOMPolyfill);\n", 149 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var GetElementsByInterfa ce = scope.GetElementsByInterface;\n var Node = scope.wrappers.Node;\n var Par entNodeInterface = scope.ParentNodeInterface;\n var Selection = scope.wrappers. Selection;\n var SelectorsInterface = scope.SelectorsInterface;\n var ShadowRo ot = scope.wrappers.ShadowRoot;\n var TreeScope = scope.TreeScope;\n var clone Node = scope.cloneNode;\n var defineWrapGetter = scope.defineWrapGetter;\n var elementFromPoint = scope.elementFromPoint;\n var forwardMethodsToWrapper = sco pe.forwardMethodsToWrapper;\n var matchesNames = scope.matchesNames;\n var mix in = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderA llPending = scope.renderAllPending;\n var rewrap = scope.rewrap;\n var unwrap = scope.unwrap;\n var wrap = scope.wrap;\n var wrapEventTargetMethods = scope. wrapEventTargetMethods;\n var wrapNodeList = scope.wrapNodeList;\n\n var imple mentationTable = new WeakMap();\n\n function Document(node) {\n Node.call(th is, node);\n this.treeScope_ = new TreeScope(this, null);\n }\n Document.pr ototype = Object.create(Node.prototype);\n\n defineWrapGetter(Document, 'docume ntElement');\n\n // Conceptually both body and head can be in a shadow but supo rting that seems\n // overkill at this point.\n defineWrapGetter(Document, 'bo dy');\n defineWrapGetter(Document, 'head');\n\n // document cannot be overridd en so we override a bunch of its methods\n // directly on the instance.\n\n fu nction wrapMethod(name) {\n var original = document[name];\n Document.prot otype[name] = function() {\n return wrap(original.apply(this.impl, argument s));\n };\n }\n\n [\n 'createComment',\n 'createDocumentFragment',\n 'createElement',\n 'createElementNS',\n 'createEvent',\n 'createEven tNS',\n 'createRange',\n 'createTextNode',\n 'getElementById'\n ].forE ach(wrapMethod);\n\n var originalAdoptNode = document.adoptNode;\n\n function adoptNodeNoRemove(node, doc) {\n originalAdoptNode.call(doc.impl, unwrap(node ));\n adoptSubtree(node, doc);\n }\n\n function adoptSubtree(node, doc) {\n if (node.shadowRoot)\n doc.adoptNode(node.shadowRoot);\n if (node in stanceof ShadowRoot)\n adoptOlderShadowRoots(node, doc);\n for (var chil d = node.firstChild; child; child = child.nextSibling) {\n adoptSubtree(chi ld, doc);\n }\n }\n\n function adoptOlderShadowRoots(shadowRoot, doc) {\n var oldShadowRoot = shadowRoot.olderShadowRoot;\n if (oldShadowRoot)\n doc.adoptNode(oldShadowRoot);\n }\n\n var originalGetSelection = document.get Selection;\n\n mixin(Document.prototype, {\n adoptNode: function(node) {\n if (node.parentNode)\n node.parentNode.removeChild(node);\n adop tNodeNoRemove(node, this);\n return node;\n },\n elementFromPoint: fu nction(x, y) {\n return elementFromPoint(this, this, x, y);\n },\n im portNode: function(node, deep) {\n return cloneNode(node, deep, this.impl); \n },\n getSelection: function() {\n renderAllPending();\n retur n new Selection(originalGetSelection.call(unwrap(this)));\n }\n });\n\n if (document.registerElement) {\n var originalRegisterElement = document.registe rElement;\n Document.prototype.registerElement = function(tagName, object) {\ n var prototype = object.prototype;\n\n // If we already used the obje ct as a prototype for another custom\n // element.\n if (scope.nativeP rototypeTable.get(prototype)) {\n // TODO(arv): DOMException\n thr ow new Error('NotSupportedError');\n }\n\n // Find first object on the prototype chain that already have a native\n // prototype. Keep track of a ll the objects before that so we can create\n // a similar structure for th e native case.\n var proto = Object.getPrototypeOf(prototype);\n var n ativePrototype;\n var prototypes = [];\n while (proto) {\n nati vePrototype = scope.nativePrototypeTable.get(proto);\n if (nativePrototyp e)\n break;\n prototypes.push(proto);\n proto = Object.ge tPrototypeOf(proto);\n }\n\n if (!nativePrototype) {\n // TODO( arv): DOMException\n throw new Error('NotSupportedError');\n }\n\n // This works by creating a new prototype object that is empty, but has\n // the native prototype as its proto. The original prototype object\n // passed into register is used as the wrapper prototype.\n\n var newPrototyp e = Object.create(nativePrototype);\n for (var i = prototypes.length - 1; i >= 0; i--) {\n newPrototype = Object.create(newPrototype);\n }\n\n // Add callbacks if present.\n // Names are taken from:\n // ht tps://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Sour ce/bindings/v8/CustomElementConstructorBuilder.cpp&sq=package:chromium&type=cs&l =156\n // and not from the spec since the spec is out of date.\n [\n 'createdCallback',\n 'attachedCallback',\n 'detachedCallback ',\n 'attributeChangedCallback',\n ].forEach(function(name) {\n var f = prototype[name];\n if (!f)\n return;\n newProt otype[name] = function() {\n // if this element has been wrapped prior to registration,\n // the wrapper is stale; in this case rewrap\n if (!(wrap(this) instanceof CustomElementConstructor)) {\n rewrap (this);\n }\n f.apply(wrap(this), arguments);\n };\n });\n\n var p = {prototype: newPrototype};\n if (object.extends)\n p.extends = object.extends;\n\n function CustomElementConstructor(no de) {\n if (!node) {\n if (object.extends) {\n return document.createElement(object.extends, tagName);\n } else {\n return document.createElement(tagName);\n }\n }\n this .impl = node;\n }\n CustomElementConstructor.prototype = prototype;\n CustomElementConstructor.prototype.constructor = CustomElementConstructor;\ n\n scope.constructorTable.set(newPrototype, CustomElementConstructor);\n scope.nativePrototypeTable.set(prototype, newPrototype);\n\n // registr ation is synchronous so do it last\n var nativeConstructor = originalRegist erElement.call(unwrap(this),\n tagName, p);\n return CustomElement Constructor;\n };\n\n forwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument\n ], [\n 'regi sterElement',\n ]);\n }\n\n // We also override some of the methods on docu ment.body and document.head\n // for convenience.\n forwardMethodsToWrapper([\ n window.HTMLBodyElement,\n window.HTMLDocument || window.Document, // Ge cko adds these to HTMLDocument\n window.HTMLHeadElement,\n window.HTMLHtml Element,\n ], [\n 'appendChild',\n 'compareDocumentPosition',\n 'conta ins',\n 'getElementsByClassName',\n 'getElementsByTagName',\n 'getEleme ntsByTagNameNS',\n 'insertBefore',\n 'querySelector',\n 'querySelectorA ll',\n 'removeChild',\n 'replaceChild',\n ].concat(matchesNames));\n\n f orwardMethodsToWrapper([\n window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument\n ], [\n 'adoptNode',\n 'importNode',\n 'co ntains',\n 'createComment',\n 'createDocumentFragment',\n 'createElemen t',\n 'createElementNS',\n 'createEvent',\n 'createEventNS',\n 'crea teRange',\n 'createTextNode',\n 'elementFromPoint',\n 'getElementById', \n 'getSelection',\n ]);\n\n mixin(Document.prototype, GetElementsByInterfa ce);\n mixin(Document.prototype, ParentNodeInterface);\n mixin(Document.protot ype, SelectorsInterface);\n\n mixin(Document.prototype, {\n get implementati on() {\n var implementation = implementationTable.get(this);\n if (imp lementation)\n return implementation;\n implementation =\n new DOMImplementation(unwrap(this).implementation);\n implementationTable.s et(this, implementation);\n return implementation;\n }\n });\n\n regis terWrapper(window.Document, Document,\n document.implementation.createHTMLD ocument(''));\n\n // Both WebKit and Gecko uses HTMLDocument for document. HTML 5/DOM only has\n // one Document interface and IE implements the standard corre ctly.\n if (window.HTMLDocument)\n registerWrapper(window.HTMLDocument, Docu ment);\n\n wrapEventTargetMethods([\n window.HTMLBodyElement,\n window.HT MLDocument || window.Document, // Gecko adds these to HTMLDocument\n window. HTMLHeadElement,\n ]);\n\n function DOMImplementation(impl) {\n this.impl = impl;\n }\n\n function wrapImplMethod(constructor, name) {\n var original = document.implementation[name];\n constructor.prototype[name] = function() { \n return wrap(original.apply(this.impl, arguments));\n };\n }\n\n fun ction forwardImplMethod(constructor, name) {\n var original = document.implem entation[name];\n constructor.prototype[name] = function() {\n return or iginal.apply(this.impl, arguments);\n };\n }\n\n wrapImplMethod(DOMImplemen tation, 'createDocumentType');\n wrapImplMethod(DOMImplementation, 'createDocum ent');\n wrapImplMethod(DOMImplementation, 'createHTMLDocument');\n forwardImp lMethod(DOMImplementation, 'hasFeature');\n\n registerWrapper(window.DOMImpleme ntation, DOMImplementation);\n\n forwardMethodsToWrapper([\n window.DOMImple mentation,\n ], [\n 'createDocumentType',\n 'createDocument',\n 'creat eHTMLDocument',\n 'hasFeature',\n ]);\n\n scope.adoptNodeNoRemove = adoptNo deNoRemove;\n scope.wrappers.DOMImplementation = DOMImplementation;\n scope.wr appers.Document = Document;\n\n})(window.ShadowDOMPolyfill);\n",
147 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope. wrappers.EventTarget;\n var Selection = scope.wrappers.Selection;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderAllP ending = scope.renderAllPending;\n var unwrap = scope.unwrap;\n var unwrapIfNe eded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWindow = window.Window;\n var originalGetComputedStyle = window.getComputedStyle;\n va r originalGetSelection = window.getSelection;\n\n function Window(impl) {\n EventTarget.call(this, impl);\n }\n Window.prototype = Object.create(EventTarg et.prototype);\n\n OriginalWindow.prototype.getComputedStyle = function(el, pse udo) {\n return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pse udo);\n };\n\n OriginalWindow.prototype.getSelection = function() {\n retur n wrap(this || window).getSelection();\n };\n\n // Work around for https://bug zilla.mozilla.org/show_bug.cgi?id=943065\n delete window.getComputedStyle;\n d elete window.getSelection;\n\n ['addEventListener', 'removeEventListener', 'dis patchEvent'].forEach(\n function(name) {\n OriginalWindow.prototype[ name] = function() {\n var w = wrap(this || window);\n return w[name].apply(w, arguments);\n };\n\n // Work around for https://b ugzilla.mozilla.org/show_bug.cgi?id=943065\n delete window[name];\n });\n\n mixin(Window.prototype, {\n getComputedStyle: function(el, pseudo) { \n renderAllPending();\n return originalGetComputedStyle.call(unwrap(t his), unwrapIfNeeded(el),\n pseudo);\n },\n getSelection: function() {\n renderAllPending();\n return new Selection(originalGetSelection.call(unwrap(this)));\n },\n });\n\n regi sterWrapper(OriginalWindow, Window);\n\n scope.wrappers.Window = Window;\n\n})( window.ShadowDOMPolyfill);\n", 150 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var EventTarget = scope. wrappers.EventTarget;\n var Selection = scope.wrappers.Selection;\n var mixin = scope.mixin;\n var registerWrapper = scope.registerWrapper;\n var renderAllP ending = scope.renderAllPending;\n var unwrap = scope.unwrap;\n var unwrapIfNe eded = scope.unwrapIfNeeded;\n var wrap = scope.wrap;\n\n var OriginalWindow = window.Window;\n var originalGetComputedStyle = window.getComputedStyle;\n va r originalGetSelection = window.getSelection;\n\n function Window(impl) {\n EventTarget.call(this, impl);\n }\n Window.prototype = Object.create(EventTarg et.prototype);\n\n OriginalWindow.prototype.getComputedStyle = function(el, pse udo) {\n return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pse udo);\n };\n\n OriginalWindow.prototype.getSelection = function() {\n retur n wrap(this || window).getSelection();\n };\n\n // Work around for https://bug zilla.mozilla.org/show_bug.cgi?id=943065\n delete window.getComputedStyle;\n d elete window.getSelection;\n\n ['addEventListener', 'removeEventListener', 'dis patchEvent'].forEach(\n function(name) {\n OriginalWindow.prototype[ name] = function() {\n var w = wrap(this || window);\n return w[name].apply(w, arguments);\n };\n\n // Work around for https://b ugzilla.mozilla.org/show_bug.cgi?id=943065\n delete window[name];\n });\n\n mixin(Window.prototype, {\n getComputedStyle: function(el, pseudo) { \n renderAllPending();\n return originalGetComputedStyle.call(unwrap(t his), unwrapIfNeeded(el),\n pseudo);\n },\n getSelection: function() {\n renderAllPending();\n return new Selection(originalGetSelection.call(unwrap(this)));\n },\n });\n\n regi sterWrapper(OriginalWindow, Window);\n\n scope.wrappers.Window = Window;\n\n})( window.ShadowDOMPolyfill);\n",
148 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var isWrapperFor = scope .isWrapperFor;\n\n // This is a list of the elements we currently override the global constructor\n // for.\n var elements = {\n 'a': 'HTMLAnchorElement', \n // Do not create an applet element by default since it shows a warning in\ n // IE.\n // https://github.com/Polymer/polymer/issues/217\n // 'apple t': 'HTMLAppletElement',\n 'area': 'HTMLAreaElement',\n 'audio': 'HTMLAudi oElement',\n 'base': 'HTMLBaseElement',\n 'body': 'HTMLBodyElement',\n 'br': 'HTMLBRElement',\n 'button': 'HTMLButtonElement',\n 'canvas': 'HTMLC anvasElement',\n 'caption': 'HTMLTableCaptionElement',\n 'col': 'HTMLTable ColElement',\n // 'command': 'HTMLCommandElement', // Not fully implemented in Gecko.\n 'content': 'HTMLContentElement',\n 'data': 'HTMLDataElement',\ n 'datalist': 'HTMLDataListElement',\n 'del': 'HTMLModElement',\n 'dir' : 'HTMLDirectoryElement',\n 'div': 'HTMLDivElement',\n 'dl': 'HTMLDListEle ment',\n 'embed': 'HTMLEmbedElement',\n 'fieldset': 'HTMLFieldSetElement', \n 'font': 'HTMLFontElement',\n 'form': 'HTMLFormElement',\n 'frame': ' HTMLFrameElement',\n 'frameset': 'HTMLFrameSetElement',\n 'h1': 'HTMLHeadi ngElement',\n 'head': 'HTMLHeadElement',\n 'hr': 'HTMLHRElement',\n 'ht ml': 'HTMLHtmlElement',\n 'iframe': 'HTMLIFrameElement',\n 'img': 'HTMLIma geElement',\n 'input': 'HTMLInputElement',\n 'keygen': 'HTMLKeygenElement' ,\n 'label': 'HTMLLabelElement',\n 'legend': 'HTMLLegendElement',\n 'li ': 'HTMLLIElement',\n 'link': 'HTMLLinkElement',\n 'map': 'HTMLMapElement' ,\n 'marquee': 'HTMLMarqueeElement',\n 'menu': 'HTMLMenuElement',\n 'me nuitem': 'HTMLMenuItemElement',\n 'meta': 'HTMLMetaElement',\n 'meter': 'H TMLMeterElement',\n 'object': 'HTMLObjectElement',\n 'ol': 'HTMLOListEleme nt',\n 'optgroup': 'HTMLOptGroupElement',\n 'option': 'HTMLOptionElement', \n 'output': 'HTMLOutputElement',\n 'p': 'HTMLParagraphElement',\n 'par am': 'HTMLParamElement',\n 'pre': 'HTMLPreElement',\n 'progress': 'HTMLPro gressElement',\n 'q': 'HTMLQuoteElement',\n 'script': 'HTMLScriptElement', \n 'select': 'HTMLSelectElement',\n 'shadow': 'HTMLShadowElement',\n 's ource': 'HTMLSourceElement',\n 'span': 'HTMLSpanElement',\n 'style': 'HTML StyleElement',\n 'table': 'HTMLTableElement',\n 'tbody': 'HTMLTableSection Element',\n // WebKit and Moz are wrong:\n // https://bugs.webkit.org/show _bug.cgi?id=111469\n // https://bugzilla.mozilla.org/show_bug.cgi?id=848096\n // 'td': 'HTMLTableCellElement',\n 'template': 'HTMLTemplateElement',\n 'textarea': 'HTMLTextAreaElement',\n 'thead': 'HTMLTableSectionElement',\n 'time': 'HTMLTimeElement',\n 'title': 'HTMLTitleElement',\n 'tr': 'HTML TableRowElement',\n 'track': 'HTMLTrackElement',\n 'ul': 'HTMLUListElement ',\n 'video': 'HTMLVideoElement',\n };\n\n function overrideConstructor(tag Name) {\n var nativeConstructorName = elements[tagName];\n var nativeConst ructor = window[nativeConstructorName];\n if (!nativeConstructor)\n retu rn;\n var element = document.createElement(tagName);\n var wrapperConstruc tor = element.constructor;\n window[nativeConstructorName] = wrapperConstruct or;\n }\n\n Object.keys(elements).forEach(overrideConstructor);\n\n Object.ge tOwnPropertyNames(scope.wrappers).forEach(function(name) {\n window[name] = s cope.wrappers[name]\n });\n\n})(window.ShadowDOMPolyfill);\n", 151 "// Copyright 2013 The Polymer Authors. All rights reserved.\n// Use of this source code is goverened by a BSD-style\n// license that can be found in the LI CENSE file.\n\n(function(scope) {\n 'use strict';\n\n var isWrapperFor = scope .isWrapperFor;\n\n // This is a list of the elements we currently override the global constructor\n // for.\n var elements = {\n 'a': 'HTMLAnchorElement', \n // Do not create an applet element by default since it shows a warning in\ n // IE.\n // https://github.com/Polymer/polymer/issues/217\n // 'apple t': 'HTMLAppletElement',\n 'area': 'HTMLAreaElement',\n 'audio': 'HTMLAudi oElement',\n 'base': 'HTMLBaseElement',\n 'body': 'HTMLBodyElement',\n 'br': 'HTMLBRElement',\n 'button': 'HTMLButtonElement',\n 'canvas': 'HTMLC anvasElement',\n 'caption': 'HTMLTableCaptionElement',\n 'col': 'HTMLTable ColElement',\n // 'command': 'HTMLCommandElement', // Not fully implemented in Gecko.\n 'content': 'HTMLContentElement',\n 'data': 'HTMLDataElement',\ n 'datalist': 'HTMLDataListElement',\n 'del': 'HTMLModElement',\n 'dir' : 'HTMLDirectoryElement',\n 'div': 'HTMLDivElement',\n 'dl': 'HTMLDListEle ment',\n 'embed': 'HTMLEmbedElement',\n 'fieldset': 'HTMLFieldSetElement', \n 'font': 'HTMLFontElement',\n 'form': 'HTMLFormElement',\n 'frame': ' HTMLFrameElement',\n 'frameset': 'HTMLFrameSetElement',\n 'h1': 'HTMLHeadi ngElement',\n 'head': 'HTMLHeadElement',\n 'hr': 'HTMLHRElement',\n 'ht ml': 'HTMLHtmlElement',\n 'iframe': 'HTMLIFrameElement',\n 'img': 'HTMLIma geElement',\n 'input': 'HTMLInputElement',\n 'keygen': 'HTMLKeygenElement' ,\n 'label': 'HTMLLabelElement',\n 'legend': 'HTMLLegendElement',\n 'li ': 'HTMLLIElement',\n 'link': 'HTMLLinkElement',\n 'map': 'HTMLMapElement' ,\n 'marquee': 'HTMLMarqueeElement',\n 'menu': 'HTMLMenuElement',\n 'me nuitem': 'HTMLMenuItemElement',\n 'meta': 'HTMLMetaElement',\n 'meter': 'H TMLMeterElement',\n 'object': 'HTMLObjectElement',\n 'ol': 'HTMLOListEleme nt',\n 'optgroup': 'HTMLOptGroupElement',\n 'option': 'HTMLOptionElement', \n 'output': 'HTMLOutputElement',\n 'p': 'HTMLParagraphElement',\n 'par am': 'HTMLParamElement',\n 'pre': 'HTMLPreElement',\n 'progress': 'HTMLPro gressElement',\n 'q': 'HTMLQuoteElement',\n 'script': 'HTMLScriptElement', \n 'select': 'HTMLSelectElement',\n 'shadow': 'HTMLShadowElement',\n 's ource': 'HTMLSourceElement',\n 'span': 'HTMLSpanElement',\n 'style': 'HTML StyleElement',\n 'table': 'HTMLTableElement',\n 'tbody': 'HTMLTableSection Element',\n // WebKit and Moz are wrong:\n // https://bugs.webkit.org/show _bug.cgi?id=111469\n // https://bugzilla.mozilla.org/show_bug.cgi?id=848096\n // 'td': 'HTMLTableCellElement',\n 'template': 'HTMLTemplateElement',\n 'textarea': 'HTMLTextAreaElement',\n 'thead': 'HTMLTableSectionElement',\n 'time': 'HTMLTimeElement',\n 'title': 'HTMLTitleElement',\n 'tr': 'HTML TableRowElement',\n 'track': 'HTMLTrackElement',\n 'ul': 'HTMLUListElement ',\n 'video': 'HTMLVideoElement',\n };\n\n function overrideConstructor(tag Name) {\n var nativeConstructorName = elements[tagName];\n var nativeConst ructor = window[nativeConstructorName];\n if (!nativeConstructor)\n retu rn;\n var element = document.createElement(tagName);\n var wrapperConstruc tor = element.constructor;\n window[nativeConstructorName] = wrapperConstruct or;\n }\n\n Object.keys(elements).forEach(overrideConstructor);\n\n Object.ge tOwnPropertyNames(scope.wrappers).forEach(function(name) {\n window[name] = s cope.wrappers[name]\n });\n\n})(window.ShadowDOMPolyfill);\n",
149 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\n // convenient global\n window.wrap = Sh adowDOMPolyfill.wrapIfNeeded;\n window.unwrap = ShadowDOMPolyfill.unwrapIfNeede d;\n\n // users may want to customize other types\n // TODO(sjmiles): 'button' is now supported by ShadowDOMPolyfill, but\n // I've left this code here in ca se we need to temporarily patch another\n // type\n /*\n (function() {\n v ar elts = {HTMLButtonElement: 'button'};\n for (var c in elts) {\n windo w[c] = function() { throw 'Patched Constructor'; };\n window[c].prototype = Object.getPrototypeOf(\n document.createElement(elts[c]));\n }\n } )();\n */\n\n // patch in prefixed name\n Object.defineProperty(Element.proto type, 'webkitShadowRoot',\n Object.getOwnPropertyDescriptor(Element.prototy pe, 'shadowRoot'));\n\n var originalCreateShadowRoot = Element.prototype.create ShadowRoot;\n Element.prototype.createShadowRoot = function() {\n var root = originalCreateShadowRoot.call(this);\n CustomElements.watchShadow(this);\n return root;\n };\n\n Element.prototype.webkitCreateShadowRoot = Element.pro totype.createShadowRoot;\n})();\n", 152 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\n // convenient global\n window.wrap = Sh adowDOMPolyfill.wrapIfNeeded;\n window.unwrap = ShadowDOMPolyfill.unwrapIfNeede d;\n\n // users may want to customize other types\n // TODO(sjmiles): 'button' is now supported by ShadowDOMPolyfill, but\n // I've left this code here in ca se we need to temporarily patch another\n // type\n /*\n (function() {\n v ar elts = {HTMLButtonElement: 'button'};\n for (var c in elts) {\n windo w[c] = function() { throw 'Patched Constructor'; };\n window[c].prototype = Object.getPrototypeOf(\n document.createElement(elts[c]));\n }\n } )();\n */\n\n // patch in prefixed name\n Object.defineProperty(Element.proto type, 'webkitShadowRoot',\n Object.getOwnPropertyDescriptor(Element.prototy pe, 'shadowRoot'));\n\n var originalCreateShadowRoot = Element.prototype.create ShadowRoot;\n Element.prototype.createShadowRoot = function() {\n var root = originalCreateShadowRoot.call(this);\n CustomElements.watchShadow(this);\n return root;\n };\n\n Element.prototype.webkitCreateShadowRoot = Element.pro totype.createShadowRoot;\n})();\n",
150 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/*\n This is a limited shim for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#style s\n \n The intention here is to support only the styling features which can be \n relatively simply implemented. The goal is to allow users to avoid the \n most obvious pitfalls and do so without compromising performance significantly. \n For ShadowDOM styling that's not covered here, a set of best practices\n ca n be provided that should allow users to accomplish more complex styling.\n\n T he following is a list of specific ShadowDOM styling features and a brief\n dis cussion of the approach used to shim.\n\n Shimmed features:\n\n * :host, :ance stor: ShadowDOM allows styling of the shadowRoot's host\n element using the :ho st rule. To shim this feature, the :host styles are \n reformatted and prefixed with a given scope name and promoted to a \n document level stylesheet.\n For example, given a scope name of .foo, a rule like this:\n \n :host {\n background: red;\n }\n }\n \n becomes:\n \n .foo {\n backgr ound: red;\n }\n \n * encapsultion: Styles defined within ShadowDOM, apply only to \n dom inside the ShadowDOM. Polymer uses one of two techniques to imle ment\n this feature.\n \n By default, rules are prefixed with the host elemen t tag name \n as a descendant selector. This ensures styling does not leak out of the 'top'\n of the element's ShadowDOM. For example,\n\n div {\n font- weight: bold;\n }\n \n becomes:\n\n x-foo div {\n font-weight: bold;\ n }\n \n becomes:\n\n\n Alternatively, if Platform.ShadowCSS.strictStyling is set to true then \n selectors are scoped by adding an attribute selector su ffix to each\n simple selector that contains the host element tag name. Each el ement \n in the element's ShadowDOM template is also given the scope attribute. \n Thus, these rules match only elements that have the scope attribute.\n For example, given a scope name of x-foo, a rule like this:\n \n div {\n f ont-weight: bold;\n }\n \n becomes:\n \n div[x-foo] {\n font-weigh t: bold;\n }\n\n Note that elements that are dynamically added to a scope mu st have the scope\n selector added to them manually.\n\n * upper/lower bound e ncapsulation: Styles which are defined outside a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\n inside a shadowRoot.\n\n This st yling behavior is not emulated. Some possible ways to do this that \n were reje cted due to complexity and/or performance concerns include: (1) reset\n every p ossible property for every possible selector for a given scope name;\n (2) re-i mplement css in javascript.\n \n As an alternative, users should make sure to use selectors\n specific to the scope in which they are working.\n \n * ::dis tributed: This behavior is not emulated. It's often not necessary\n to style th e contents of a specific insertion point and instead, descendants\n of the host element can be styled selectively. Users can also create an \n extra node arou nd an insertion point and style that node's contents\n via descendent selectors . For example, with a shadowRoot like this:\n \n <style>\n ::content(di v) {\n background: red;\n }\n </style>\n <content></content>\n \n could become:\n \n <style>\n / *@polyfill .content-container div * / \n ::content(div) {\n background: red;\n }\n </style>\n <div class=\"content-container\">\n <content></content>\n </div>\n \ n Note the use of @polyfill in the comment above a ShadowDOM specific style\n declaration. This is a directive to the styling shim to use the selector \n in comments in lieu of the next selector when running under polyfill.\n*/\n(functio n(scope) {\n\nvar ShadowCSS = {\n strictStyling: false,\n registry: {},\n // Shim styles for a given root associated with a name and extendsName\n // 1. cac he root styles by name\n // 2. optionally tag root nodes with scope name\n // 3. shim polyfill directives /* @polyfill */ and /* @polyfill-rule */\n // 4. sh im :host and scoping\n shimStyling: function(root, name, extendsName, ownSheet) {\n var typeExtension = this.isTypeExtension(extendsName);\n // use cachi ng to make working with styles nodes easier and to facilitate\n // lookup of extendee\n var def = this.registerDefinition(root, name, extendsName);\n / / find styles and apply shimming...\n if (this.strictStyling) {\n this.a pplyScopeToContent(root, name);\n }\n var cssText = this.stylesToShimmedCs sText(def.rootStyles, def.scopeStyles,\n name, typeExtension);\n // pr ovide shimmedStyle for user extensibility\n def.shimmedStyle = cssTextToStyle (cssText);\n if (root) {\n root.shimmedStyle = def.shimmedStyle;\n }\ n // remove existing style elements\n for (var i=0, l=def.rootStyles.lengt h, s; (i<l) && (s=def.rootStyles[i]); \n i++) {\n s.parentNode.remov eChild(s);\n }\n // add style to document\n if (ownSheet) {\n addO wnSheet(cssText, name);\n } else {\n addCssToDocument(cssText);\n }\n },\n // apply @polyfill rules + :host and scope shimming\n stylesToShimmedCs sText: function(rootStyles, scopeStyles, name,\n typeExtension) {\n name = name || '';\n // insert @polyfill and @polyfill-rule rules into style elem ents\n // scoping process takes care of shimming these\n this.insertPolyfi llDirectives(rootStyles);\n this.insertPolyfillRules(rootStyles);\n var cs sText = this.shimScoping(scopeStyles, name, typeExtension);\n // note: we onl y need to do rootStyles since these are unscoped.\n cssText += this.extractPo lyfillUnscopedRules(rootStyles);\n return cssText.trim();\n },\n registerDe finition: function(root, name, extendsName) {\n var def = this.registry[name] = {\n root: root,\n name: name,\n extendsName: extendsName\n }\n var styles = root ? root.querySelectorAll('style') : [];\n styles = st yles ? Array.prototype.slice.call(styles, 0) : [];\n def.rootStyles = styles; \n def.scopeStyles = def.rootStyles;\n var extendee = this.registry[def.ex tendsName];\n if (extendee && (!root || root.querySelector('shadow'))) {\n def.scopeStyles = extendee.scopeStyles.concat(def.scopeStyles);\n }\n r eturn def;\n },\n isTypeExtension: function(extendsName) {\n return extends Name && extendsName.indexOf('-') < 0;\n },\n applyScopeToContent: function(roo t, name) {\n if (root) {\n // add the name attribute to each node in roo t.\n Array.prototype.forEach.call(root.querySelectorAll('*'),\n fu nction(node) {\n node.setAttribute(name, '');\n });\n / / and template contents too\n Array.prototype.forEach.call(root.querySelect orAll('template'),\n function(template) {\n this.applyScopeT oContent(template.content, name);\n },\n this);\n }\n },\n /*\n * Process styles to convert native ShadowDOM rules that will trip\n * up the css parser; we rely on decorating the stylesheet with comments.\n * \n * For example, we convert this rule:\n * \n * (comment start) @polyfill : host menu-item (comment end)\n * shadow::-webkit-distributed(menu-item) {\n * \n * to this:\n * \n * scopeName menu-item {\n *\n **/\n insertPolyf illDirectives: function(styles) {\n if (styles) {\n Array.prototype.forE ach.call(styles, function(s) {\n s.textContent = this.insertPolyfillDirec tivesInCssText(s.textContent);\n }, this);\n }\n },\n insertPolyfillDi rectivesInCssText: function(cssText) {\n return cssText.replace(cssPolyfillCo mmentRe, function(match, p1) {\n // remove end comment delimiter and add bl ock start\n return p1.slice(0, -2) + '{';\n });\n },\n /*\n * Proces s styles to add rules which will only apply under the polyfill\n * \n * For example, we convert this rule:\n * \n * (comment start) @polyfill-rule :host menu-item { \n * ... } (comment end)\n * \n * to this:\n * \n * scope Name menu-item {...}\n *\n **/\n insertPolyfillRules: function(styles) {\n if (styles) {\n Array.prototype.forEach.call(styles, function(s) {\n s.textContent = this.insertPolyfillRulesInCssText(s.textContent);\n }, t his);\n }\n },\n insertPolyfillRulesInCssText: function(cssText) {\n ret urn cssText.replace(cssPolyfillRuleCommentRe, function(match, p1) {\n // re move end comment delimiter\n return p1.slice(0, -1);\n });\n },\n /*\n * Process styles to add rules which will only apply under the polyfill\n * and do not process via CSSOM. (CSSOM is destructive to rules on rare \n * occa sions, e.g. -webkit-calc on Safari.)\n * For example, we convert this rule:\n * \n * (comment start) @polyfill-unscoped-rule menu-item { \n * ... } (com ment end)\n * \n * to this:\n * \n * menu-item {...}\n *\n **/\n ext ractPolyfillUnscopedRules: function(styles) {\n var cssText = '';\n if (st yles) {\n Array.prototype.forEach.call(styles, function(s) {\n cssTe xt += this.extractPolyfillUnscopedRulesFromCssText(\n s.textContent) + '\\n\\n';\n }, this);\n }\n return cssText;\n },\n extractPolyfil lUnscopedRulesFromCssText: function(cssText) {\n var r = '', matches;\n wh ile (matches = cssPolyfillUnscopedRuleCommentRe.exec(cssText)) {\n r += mat ches[1].slice(0, -1) + '\\n\\n';\n }\n return r;\n },\n /* Ensure styles are scoped. Pseudo-scoping takes a rule like:\n * \n * .foo {... } \n * \n * and converts this to\n * \n * scopeName .foo { ... }\n */\n shi mScoping: function(styles, name, typeExtension) {\n if (styles) {\n retu rn this.convertScopedStyles(styles, name, typeExtension);\n }\n },\n conver tScopedStyles: function(styles, name, typeExtension) {\n var cssText = styles ToCssText(styles);\n cssText = this.insertPolyfillHostInCssText(cssText);\n cssText = this.convertColonHost(cssText);\n cssText = this.convertColonAnce stor(cssText);\n cssText = this.convertCombinators(cssText);\n if (name) { \n var self = this, cssText;\n \n withCssRules(cssText, function( rules) {\n cssText = self.scopeRules(rules, name, typeExtension);\n });\n\n }\n return cssText;\n },\n /*\n * convert a rule like :host(.f oo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar\n */\n convertC olonHost: function(cssText) {\n return this.convertColonRule(cssText, cssColo nHostRe,\n this.colonHostPartReplacer);\n },\n /*\n * convert a rule like :ancestor(.foo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar, .foo scopeName > .bar { }\n * \n * and\n *\n * :ancestor(.foo:host) .ba r { ... }\n * \n * to\n * \n * scopeName.foo .bar { ... }\n */\n conve rtColonAncestor: function(cssText) {\n return this.convertColonRule(cssText, cssColonAncestorRe,\n this.colonAncestorPartReplacer);\n },\n convertCo lonRule: function(cssText, regExp, partReplacer) {\n // p1 = :host, p2 = cont ents of (), p3 rest of rule\n return cssText.replace(regExp, function(m, p1, p2, p3) {\n p1 = polyfillHostNoCombinator;\n if (p2) {\n var pa rts = p2.split(','), r = [];\n for (var i=0, l=parts.length, p; (i<l) && (p=parts[i]); i++) {\n p = p.trim();\n r.push(partReplacer(p1, p, p3));\n }\n return r.join(',');\n } else {\n retur n p1 + p3;\n }\n });\n },\n colonAncestorPartReplacer: function(host, part, suffix) {\n if (part.match(polyfillHost)) {\n return this.colonHos tPartReplacer(host, part, suffix);\n } else {\n return host + part + suf fix + ', ' + part + ' ' + host + suffix;\n }\n },\n colonHostPartReplacer: function(host, part, suffix) {\n return host + part.replace(polyfillHost, '') + suffix;\n },\n /*\n * Convert ^ and ^^ combinators by replacing with spac e.\n */\n convertCombinators: function(cssText) {\n return cssText.replace( /\\^\\^/g, ' ').replace(/\\^/g, ' ');\n },\n // change a selector like 'div' t o 'name div'\n scopeRules: function(cssRules, name, typeExtension) {\n var c ssText = '';\n if (cssRules) {\n Array.prototype.forEach.call(cssRules, function(rule) {\n if (rule.selectorText && (rule.style && rule.style.css Text)) {\n cssText += this.scopeSelector(rule.selectorText, name, typeE xtension, \n this.strictStyling) + ' {\\n\\t';\n cssText += this.propertiesFromRule(rule) + '\\n}\\n\\n';\n } else if (rule.type === CSSRule.MEDIA_RULE) {\n cssText += '@media ' + rule.media.mediaText + ' {\\n';\n cssText += this.scopeRules(rule.cssRules, name, typeExtension );\n cssText += '\\n}\\n\\n';\n } else if (rule.cssText) {\n cssText += rule.cssText + '\\n\\n';\n }\n }, this);\n }\n return cssText;\n },\n scopeSelector: function(selector, name, typeExtension , strict) {\n var r = [], parts = selector.split(',');\n parts.forEach(fun ction(p) {\n p = p.trim();\n if (this.selectorNeedsScoping(p, name, ty peExtension)) {\n p = (strict && !p.match(polyfillHostNoCombinator)) ? \n this.applyStrictSelectorScope(p, name) :\n this.applySimp leSelectorScope(p, name, typeExtension);\n }\n r.push(p);\n }, this );\n return r.join(', ');\n },\n selectorNeedsScoping: function(selector, n ame, typeExtension) {\n var re = this.makeScopeMatcher(name, typeExtension);\ n return !selector.match(re);\n },\n makeScopeMatcher: function(name, typeE xtension) {\n var matchScope = typeExtension ? '\\\\[is=[\\'\"]?' + name + '[ \\'\"]?\\\\]' : name;\n return new RegExp('^(' + matchScope + ')' + selectorR eSuffix, 'm');\n },\n // scope via name and [is=name]\n applySimpleSelectorSc ope: function(selector, name, typeExtension) {\n var scoper = typeExtension ? '[is=' + name + ']' : name;\n if (selector.match(polyfillHostRe)) {\n s elector = selector.replace(polyfillHostNoCombinator, scoper);\n return sele ctor.replace(polyfillHostRe, scoper + ' ');\n } else {\n return scoper + ' ' + selector;\n }\n },\n // return a selector with [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[ name]\n applyStrictSelectorScope: function(selector, name) {\n var splits = [' ', '>', '+', '~'],\n scoped = selector,\n attrName = '[' + name + ' ]';\n splits.forEach(function(sep) {\n var parts = scoped.split(sep);\n scoped = parts.map(function(p) {\n // remove :host since it should b e unnecessary\n var t = p.trim().replace(polyfillHostRe, '');\n if (t && (splits.indexOf(t) < 0) && (t.indexOf(attrName) < 0)) {\n p = t. replace(/([^:]*)(:*)(.*)/, '$1' + attrName + '$2$3')\n }\n return p;\n }).join(sep);\n });\n return scoped;\n },\n insertPolyfillHost InCssText: function(selector) {\n return selector.replace(hostRe, polyfillHos t).replace(colonHostRe,\n polyfillHost).replace(colonAncestorRe, polyfill Ancestor);\n },\n propertiesFromRule: function(rule) {\n // TODO(sorvell): Safari cssom incorrectly removes quotes from the content\n // property. (http s://bugs.webkit.org/show_bug.cgi?id=118045)\n if (rule.style.content && !rule .style.content.match(/['\"]+/)) {\n return rule.style.cssText.replace(/cont ent:[^;]*;/g, 'content: \\'' + \n rule.style.content + '\\';');\n }\ n return rule.style.cssText;\n }\n};\n\nvar selectorRe = /([^{]*)({[\\s\\S]* ?})/gim,\n cssCommentRe = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n cssP olyfillCommentRe = /\\/\\*\\s*@polyfill ([^*]*\\*+([^/*][^*]*\\*+)*\\/)([^{]*?){ /gim,\n cssPolyfillRuleCommentRe = /\\/\\*\\s@polyfill-rule([^*]*\\*+([^/*][^ *]*\\*+)*)\\//gim,\n cssPolyfillUnscopedRuleCommentRe = /\\/\\*\\s@polyfill-u nscoped-rule([^*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n cssPseudoRe = /::(x-[^\\s{ ,(]*)/gim,\n cssPartRe = /::part\\(([^)]*)\\)/gim,\n // note: :host pre-pr ocessed to -shadowcsshost.\n polyfillHost = '-shadowcsshost',\n // note: : ancestor pre-processed to -shadowcssancestor.\n polyfillAncestor = '-shadowcs sancestor',\n parenSuffix = ')(?:\\\\((' +\n '(?:\\\\([^)(]*\\\\)|[^)( ]*)+?' +\n ')\\\\))?([^,{]*)';\n cssColonHostRe = new RegExp('(' + pol yfillHost + parenSuffix, 'gim'),\n cssColonAncestorRe = new RegExp('(' + poly fillAncestor + parenSuffix, 'gim'),\n selectorReSuffix = '([>\\\\s~+\\[.,{:][ \\\\s\\\\S]*)?$',\n hostRe = /@host/gim,\n colonHostRe = /\\:host/gim,\n colonAncestorRe = /\\:ancestor/gim,\n /* host name without combinator */\n polyfillHostNoCombinator = polyfillHost + '-no-combinator',\n polyfillHost Re = new RegExp(polyfillHost, 'gim');\n polyfillAncestorRe = new RegExp(polyf illAncestor, 'gim');\n\nfunction stylesToCssText(styles, preserveComments) {\n var cssText = '';\n Array.prototype.forEach.call(styles, function(s) {\n css Text += s.textContent + '\\n\\n';\n });\n // strip comments for easier process ing\n if (!preserveComments) {\n cssText = cssText.replace(cssCommentRe, '') ;\n }\n return cssText;\n}\n\nfunction cssTextToStyle(cssText) {\n var style = document.createElement('style');\n style.textContent = cssText;\n return sty le;\n}\n\nfunction cssToRules(cssText) {\n var style = cssTextToStyle(cssText); \n document.head.appendChild(style);\n var rules = [];\n if (style.sheet) {\n // TODO(sorvell): Firefox throws when accessing the rules of a stylesheet\n // with an @import\n // https://bugzilla.mozilla.org/show_bug.cgi?id=62501 3\n try {\n rules = style.sheet.cssRules;\n } catch(e) {\n //\n }\n } else {\n console.warn('sheet not found', style);\n }\n style.pare ntNode.removeChild(style);\n return rules;\n}\n\nvar frame = document.createEle ment('iframe');\nframe.style.display = 'none';\n\nfunction initFrame() {\n fram e.initialized = true;\n document.body.appendChild(frame);\n var doc = frame.co ntentDocument;\n var base = doc.createElement('base');\n base.href = document. baseURI;\n doc.head.appendChild(base);\n}\n\nfunction inFrame(fn) {\n if (!fra me.initialized) {\n initFrame();\n }\n document.body.appendChild(frame);\n fn(frame.contentDocument);\n document.body.removeChild(frame);\n}\n\n// TODO(s orvell): use an iframe if the cssText contains an @import to workaround\n// http s://code.google.com/p/chromium/issues/detail?id=345114\nvar isChrome = navigator .userAgent.match('Chrome');\nfunction withCssRules(cssText, callback) {\n if (! callback) {\n return;\n }\n var rules;\n if (cssText.match('@import') && i sChrome) {\n var style = cssTextToStyle(cssText);\n inFrame(function(doc) {\n doc.head.appendChild(style.impl);\n rules = style.sheet.cssRules;\ n callback(rules);\n });\n } else {\n rules = cssToRules(cssText);\n callback(rules);\n }\n}\n\nfunction rulesToCss(cssRules) {\n for (var i=0, css=[]; i < cssRules.length; i++) {\n css.push(cssRules[i].cssText);\n }\n return css.join('\\n\\n');\n}\n\nfunction addCssToDocument(cssText) {\n if (cs sText) {\n getSheet().appendChild(document.createTextNode(cssText));\n }\n}\ n\nfunction addOwnSheet(cssText, name) {\n var style = cssTextToStyle(cssText); \n style.setAttribute(name, '');\n style.setAttribute(SHIMMED_ATTRIBUTE, '');\ n document.head.appendChild(style);\n}\n\nvar SHIM_ATTRIBUTE = 'shim-shadowdom' ;\nvar SHIMMED_ATTRIBUTE = 'shim-shadowdom-css';\n\nvar sheet;\nfunction getShee t() {\n if (!sheet) {\n sheet = document.createElement(\"style\");\n shee t.setAttribute(SHIMMED_ATTRIBUTE, '');\n sheet[SHIMMED_ATTRIBUTE] = true;\n }\n return sheet;\n}\n\n// add polyfill stylesheet to document\nif (window.Shad owDOMPolyfill) {\n addCssToDocument('style { display: none !important; }\\n');\ n var doc = wrap(document);\n var head = doc.querySelector('head');\n head.in sertBefore(getSheet(), head.childNodes[0]);\n\n // TODO(sorvell): monkey-patchi ng HTMLImports is abusive;\n // consider a better solution.\n document.addEven tListener('DOMContentLoaded', function() {\n var urlResolver = scope.urlResol ver;\n \n if (window.HTMLImports && !HTMLImports.useNative) {\n var S HIM_SHEET_SELECTOR = 'link[rel=stylesheet]' +\n '[' + SHIM_ATTRIBUTE + ']';\n var SHIM_STYLE_SELECTOR = 'style[' + SHIM_ATTRIBUTE + ']';\n HT MLImports.importer.documentPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n HTMLImports.importer.importsPreloadSelectors += ',' + SHIM_SHEET_SELECTOR;\n\n HTMLImports.parser.documentSelectors = [\n HTMLImports.parser.docume ntSelectors,\n SHIM_SHEET_SELECTOR,\n SHIM_STYLE_SELECTOR\n ] .join(',');\n \n var originalParseGeneric = HTMLImports.parser.parseGeneri c;\n\n HTMLImports.parser.parseGeneric = function(elt) {\n if (elt[S HIMMED_ATTRIBUTE]) {\n return;\n }\n var style = elt.__im portElement || elt;\n if (!style.hasAttribute(SHIM_ATTRIBUTE)) {\n originalParseGeneric.call(this, elt);\n return;\n }\n if (elt.__resource) {\n style = elt.ownerDocument.createElement('style' );\n style.textContent = urlResolver.resolveCssText(\n elt .__resource, elt.href);\n } else {\n urlResolver.resolveStyle(st yle); \n }\n var styles = [style];\n style.textContent = S hadowCSS.stylesToShimmedCssText(styles, styles);\n style.removeAttribute( SHIM_ATTRIBUTE, '');\n style.setAttribute(SHIMMED_ATTRIBUTE, '');\n style[SHIMMED_ATTRIBUTE] = true;\n // place in document\n if (st yle.parentNode !== head) {\n // replace links in head\n if (el t.parentNode === head) {\n head.replaceChild(style, elt);\n } else {\n head.appendChild(style);\n }\n }\n style.__importParsed = true;\n this.markParsingComplete(elt);\n }\n\ n var hasResource = HTMLImports.parser.hasResource;\n HTMLImports.pars er.hasResource = function(node) {\n if (node.localName === 'link' && node .rel === 'stylesheet' &&\n node.hasAttribute(SHIM_ATTRIBUTE)) {\n return (node.__resource);\n } else {\n return hasResource. call(this, node);\n }\n }\n\n }\n });\n}\n\n// exports\nscope.Sh adowCSS = ShadowCSS;\n\n})(window.Platform);", 153 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/*\n This is a limited shim for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#style s\n \n The intention here is to support only the styling features which can be \n relatively simply implemented. The goal is to allow users to avoid the \n most obvious pitfalls and do so without compromising performance significantly. \n For ShadowDOM styling that's not covered here, a set of best practices\n ca n be provided that should allow users to accomplish more complex styling.\n\n T he following is a list of specific ShadowDOM styling features and a brief\n dis cussion of the approach used to shim.\n\n Shimmed features:\n\n * :host, :ance stor: ShadowDOM allows styling of the shadowRoot's host\n element using the :ho st rule. To shim this feature, the :host styles are \n reformatted and prefixed with a given scope name and promoted to a \n document level stylesheet.\n For example, given a scope name of .foo, a rule like this:\n \n :host {\n background: red;\n }\n }\n \n becomes:\n \n .foo {\n backgr ound: red;\n }\n \n * encapsultion: Styles defined within ShadowDOM, apply only to \n dom inside the ShadowDOM. Polymer uses one of two techniques to imle ment\n this feature.\n \n By default, rules are prefixed with the host elemen t tag name \n as a descendant selector. This ensures styling does not leak out of the 'top'\n of the element's ShadowDOM. For example,\n\n div {\n font- weight: bold;\n }\n \n becomes:\n\n x-foo div {\n font-weight: bold;\ n }\n \n becomes:\n\n\n Alternatively, if Platform.ShadowCSS.strictStyling is set to true then \n selectors are scoped by adding an attribute selector su ffix to each\n simple selector that contains the host element tag name. Each el ement \n in the element's ShadowDOM template is also given the scope attribute. \n Thus, these rules match only elements that have the scope attribute.\n For example, given a scope name of x-foo, a rule like this:\n \n div {\n f ont-weight: bold;\n }\n \n becomes:\n \n div[x-foo] {\n font-weigh t: bold;\n }\n\n Note that elements that are dynamically added to a scope mu st have the scope\n selector added to them manually.\n\n * upper/lower bound e ncapsulation: Styles which are defined outside a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\n inside a shadowRoot.\n\n This st yling behavior is not emulated. Some possible ways to do this that \n were reje cted due to complexity and/or performance concerns include: (1) reset\n every p ossible property for every possible selector for a given scope name;\n (2) re-i mplement css in javascript.\n \n As an alternative, users should make sure to use selectors\n specific to the scope in which they are working.\n \n * ::dis tributed: This behavior is not emulated. It's often not necessary\n to style th e contents of a specific insertion point and instead, descendants\n of the host element can be styled selectively. Users can also create an \n extra node arou nd an insertion point and style that node's contents\n via descendent selectors . For example, with a shadowRoot like this:\n \n <style>\n ::content(di v) {\n background: red;\n }\n </style>\n <content></content>\n \n could become:\n \n <style>\n / *@polyfill .content-container div * / \n ::content(div) {\n background: red;\n }\n </style>\n <div class=\"content-container\">\n <content></content>\n </div>\n \ n Note the use of @polyfill in the comment above a ShadowDOM specific style\n declaration. This is a directive to the styling shim to use the selector \n in comments in lieu of the next selector when running under polyfill.\n*/\n(functio n(scope) {\n\nvar ShadowCSS = {\n strictStyling: false,\n registry: {},\n // Shim styles for a given root associated with a name and extendsName\n // 1. cac he root styles by name\n // 2. optionally tag root nodes with scope name\n // 3. shim polyfill directives /* @polyfill */ and /* @polyfill-rule */\n // 4. sh im :host and scoping\n shimStyling: function(root, name, extendsName) {\n va r scopeStyles = this.prepareRoot(root, name, extendsName);\n var typeExtensio n = this.isTypeExtension(extendsName);\n var scopeSelector = this.makeScopeSe lector(name, typeExtension);\n // use caching to make working with styles nod es easier and to facilitate\n // lookup of extendee\n var cssText = styles ToCssText(scopeStyles, true);\n cssText = this.scopeCssText(cssText, scopeSel ector);\n // cache shimmed css on root for user extensibility\n if (root) {\n root.shimmedStyle = cssText;\n }\n // add style to document\n this.addCssToDocument(cssText, name);\n },\n /*\n * Shim a style element with the given selector. Returns cssText that can\n * be included in the document v ia Platform.ShadowCSS.addCssToDocument(css).\n */\n shimStyle: function(style, selector) {\n return this.shimCssText(style.textContent, selector);\n },\n /*\n * Shim some cssText with the given selector. Returns cssText that can\n * be included in the document via Platform.ShadowCSS.addCssToDocument(css).\n * /\n shimCssText: function(cssText, selector) {\n cssText = this.insertDirect ives(cssText);\n return this.scopeCssText(cssText, selector);\n },\n makeSc opeSelector: function(name, typeExtension) {\n if (name) {\n return type Extension ? '[is=' + name + ']' : name;\n }\n return '';\n },\n isTypeEx tension: function(extendsName) {\n return extendsName && extendsName.indexOf( '-') < 0;\n },\n prepareRoot: function(root, name, extendsName) {\n var def = this.registerRoot(root, name, extendsName);\n this.replaceTextInStyles(def .rootStyles, this.insertDirectives);\n // remove existing style elements\n this.removeStyles(root, def.rootStyles);\n // apply strict attr\n if (thi s.strictStyling) {\n this.applyScopeToContent(root, name);\n }\n retu rn def.scopeStyles;\n },\n removeStyles: function(root, styles) {\n for (va r i=0, l=styles.length, s; (i<l) && (s=styles[i]); i++) {\n s.parentNode.re moveChild(s);\n }\n },\n registerRoot: function(root, name, extendsName) {\ n var def = this.registry[name] = {\n root: root,\n name: name,\n extendsName: extendsName\n }\n var styles = this.findStyles(root);\n def.rootStyles = styles;\n def.scopeStyles = def.rootStyles;\n var exten dee = this.registry[def.extendsName];\n if (extendee && (!root || root.queryS elector('shadow'))) {\n def.scopeStyles = extendee.scopeStyles.concat(def.s copeStyles);\n }\n return def;\n },\n findStyles: function(root) {\n if (!root) {\n return [];\n }\n var styles = root.querySelectorAll('s tyle');\n return Array.prototype.filter.call(styles, function(s) {\n ret urn !s.hasAttribute(NO_SHIM_ATTRIBUTE);\n });\n },\n applyScopeToContent: f unction(root, name) {\n if (root) {\n // add the name attribute to each node in root.\n Array.prototype.forEach.call(root.querySelectorAll('*'),\n function(node) {\n node.setAttribute(name, '');\n } );\n // and template contents too\n Array.prototype.forEach.call(root. querySelectorAll('template'),\n function(template) {\n this. applyScopeToContent(template.content, name);\n },\n this);\n }\n },\n insertDirectives: function(cssText) {\n cssText = this.insertPol yfillDirectivesInCssText(cssText);\n return this.insertPolyfillRulesInCssText (cssText);\n },\n /*\n * Process styles to convert native ShadowDOM rules th at will trip\n * up the css parser; we rely on decorating the stylesheet with inert rules.\n * \n * For example, we convert this rule:\n * \n * polyfi ll-next-selector { content: ':host menu-item'; }\n * ::content menu-item {\n * \n * to this:\n * \n * scopeName menu-item {\n *\n **/\n insertPoly fillDirectivesInCssText: function(cssText) {\n // TODO(sorvell): remove eithe r content or comment\n cssText = cssText.replace(cssCommentNextSelectorRe, fu nction(match, p1) {\n // remove end comment delimiter and add block start\n return p1.slice(0, -2) + '{';\n });\n return cssText.replace(cssCont entNextSelectorRe, function(match, p1) {\n return p1 + ' {';\n });\n }, \n /*\n * Process styles to add rules which will only apply under the polyfil l\n * \n * For example, we convert this rule:\n * \n * polyfill-rule {\n * content: ':host menu-item';\n * ...\n * }\n * \n * to this:\n * \n * scopeName menu-item {...}\n *\n **/\n insertPolyfillRulesInCssText: function(cssText) {\n // TODO(sorvell): remove either content or comment\n cssText = cssText.replace(cssCommentRuleRe, function(match, p1) {\n // rem ove end comment delimiter\n return p1.slice(0, -1);\n });\n return cs sText.replace(cssContentRuleRe, function(match, p1, p2, p3) {\n var rule = match.replace(p1, '').replace(p2, '');\n return p3 + rule;\n });\n },\n /* Ensure styles are scoped. Pseudo-scoping takes a rule like:\n * \n * . foo {... } \n * \n * and converts this to\n * \n * scopeName .foo { ... }\n */\n scopeCssText: function(cssText, scopeSelector) {\n var unscope d = this.extractUnscopedRulesFromCssText(cssText);\n cssText = this.insertPol yfillHostInCssText(cssText);\n cssText = this.convertColonHost(cssText);\n cssText = this.convertColonAncestor(cssText);\n cssText = this.convertCombin ators(cssText);\n if (scopeSelector) {\n var self = this, cssText;\n withCssRules(cssText, function(rules) {\n cssText = self.scopeRules(rul es, scopeSelector);\n });\n\n }\n cssText = cssText + '\\n' + unscope d;\n return cssText.trim();\n },\n /*\n * Process styles to add rules whi ch will only apply under the polyfill\n * and do not process via CSSOM. (CSSOM is destructive to rules on rare \n * occasions, e.g. -webkit-calc on Safari.) \n * For example, we convert this rule:\n * \n * (comment start) @polyfill -unscoped-rule menu-item { \n * ... } (comment end)\n * \n * to this:\n * \n * menu-item {...}\n *\n **/\n extractUnscopedRulesFromCssText: functi on(cssText) {\n // TODO(sorvell): remove either content or comment\n var r = '', m;\n while (m = cssCommentUnscopedRuleRe.exec(cssText)) {\n r += m[1].slice(0, -1) + '\\n\\n';\n }\n while (m = cssContentUnscopedRuleRe.ex ec(cssText)) {\n r += m[0].replace(m[2], '').replace(m[1], m[3]) + '\\n\\n' ;\n }\n return r;\n },\n /*\n * convert a rule like :host(.foo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar\n */\n convertColonHost: function(cssText) {\n return this.convertColonRule(cssText, cssColonHostRe,\n this.colonHostPartReplacer);\n },\n /*\n * convert a rule like :ance stor(.foo) > .bar { }\n *\n * to\n *\n * scopeName.foo > .bar, .foo scop eName > .bar { }\n * \n * and\n *\n * :ancestor(.foo:host) .bar { ... }\ n * \n * to\n * \n * scopeName.foo .bar { ... }\n */\n convertColonAnc estor: function(cssText) {\n return this.convertColonRule(cssText, cssColonAn cestorRe,\n this.colonAncestorPartReplacer);\n },\n convertColonRule: f unction(cssText, regExp, partReplacer) {\n // p1 = :host, p2 = contents of () , p3 rest of rule\n return cssText.replace(regExp, function(m, p1, p2, p3) {\ n p1 = polyfillHostNoCombinator;\n if (p2) {\n var parts = p2.s plit(','), r = [];\n for (var i=0, l=parts.length, p; (i<l) && (p=parts[i ]); i++) {\n p = p.trim();\n r.push(partReplacer(p1, p, p3));\ n }\n return r.join(',');\n } else {\n return p1 + p3; \n }\n });\n },\n colonAncestorPartReplacer: function(host, part, suff ix) {\n if (part.match(polyfillHost)) {\n return this.colonHostPartRepla cer(host, part, suffix);\n } else {\n return host + part + suffix + ', ' + part + ' ' + host + suffix;\n }\n },\n colonHostPartReplacer: function(h ost, part, suffix) {\n return host + part.replace(polyfillHost, '') + suffix; \n },\n /*\n * Convert ^ and ^^ combinators by replacing with space.\n */\n convertCombinators: function(cssText) {\n return cssText.replace(/\\^\\^/g, ' ').replace(/\\^/g, ' ');\n },\n // change a selector like 'div' to 'name di v'\n scopeRules: function(cssRules, scopeSelector) {\n var cssText = '';\n if (cssRules) {\n Array.prototype.forEach.call(cssRules, function(rule) { \n if (rule.selectorText && (rule.style && rule.style.cssText)) {\n cssText += this.scopeSelector(rule.selectorText, scopeSelector, \n this.strictStyling) + ' {\\n\\t';\n cssText += this.propertiesFromRul e(rule) + '\\n}\\n\\n';\n } else if (rule.type === CSSRule.MEDIA_RULE) {\ n cssText += '@media ' + rule.media.mediaText + ' {\\n';\n css Text += this.scopeRules(rule.cssRules, scopeSelector);\n cssText += '\\ n}\\n\\n';\n } else if (rule.cssText) {\n cssText += rule.cssTex t + '\\n\\n';\n }\n }, this);\n }\n return cssText;\n },\n s copeSelector: function(selector, scopeSelector, strict) {\n var r = [], parts = selector.split(',');\n parts.forEach(function(p) {\n p = p.trim();\n if (this.selectorNeedsScoping(p, scopeSelector)) {\n p = (strict && !p.match(polyfillHostNoCombinator)) ? \n this.applyStrictSelectorScop e(p, scopeSelector) :\n this.applySimpleSelectorScope(p, scopeSelecto r);\n }\n r.push(p);\n }, this);\n return r.join(', ');\n },\n selectorNeedsScoping: function(selector, scopeSelector) {\n var re = this.ma keScopeMatcher(scopeSelector);\n return !selector.match(re);\n },\n makeSco peMatcher: function(scopeSelector) {\n scopeSelector = scopeSelector.replace( /\\[/g, '\\\\[').replace(/\\[/g, '\\\\]');\n return new RegExp('^(' + scopeSe lector + ')' + selectorReSuffix, 'm');\n },\n // scope via name and [is=name]\ n applySimpleSelectorScope: function(selector, scopeSelector) {\n if (select or.match(polyfillHostRe)) {\n selector = selector.replace(polyfillHostNoCom binator, scopeSelector);\n return selector.replace(polyfillHostRe, scopeSel ector + ' ');\n } else {\n return scopeSelector + ' ' + selector;\n } \n },\n // return a selector with [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name]\n applyStrictSel ectorScope: function(selector, scopeSelector) {\n scopeSelector = scopeSelect or.replace(/\\[is=([^\\]]*)\\]/g, '$1');\n var splits = [' ', '>', '+', '~'], \n scoped = selector,\n attrName = '[' + scopeSelector + ']';\n spl its.forEach(function(sep) {\n var parts = scoped.split(sep);\n scoped = parts.map(function(p) {\n // remove :host since it should be unnecessar y\n var t = p.trim().replace(polyfillHostRe, '');\n if (t && (spli ts.indexOf(t) < 0) && (t.indexOf(attrName) < 0)) {\n p = t.replace(/([^ :]*)(:*)(.*)/, '$1' + attrName + '$2$3')\n }\n return p;\n }) .join(sep);\n });\n return scoped;\n },\n insertPolyfillHostInCssText: f unction(selector) {\n return selector.replace(hostRe, polyfillHost).replace(c olonHostRe,\n polyfillHost).replace(colonAncestorRe, polyfillAncestor);\n },\n propertiesFromRule: function(rule) {\n // TODO(sorvell): Safari cssom incorrectly removes quotes from the content\n // property. (https://bugs.web kit.org/show_bug.cgi?id=118045)\n if (rule.style.content && !rule.style.conte nt.match(/['\"]+/)) {\n return rule.style.cssText.replace(/content:[^;]*;/g , 'content: \\'' + \n rule.style.content + '\\';');\n }\n return rule.style.cssText;\n },\n replaceTextInStyles: function(styles, action) {\n if (styles && action) {\n if (!(styles instanceof Array)) {\n styl es = [styles];\n }\n Array.prototype.forEach.call(styles, function(s) {\n s.textContent = action.call(this, s.textContent);\n }, this);\n }\n },\n addCssToDocument: function(cssText, name) {\n if (cssText.match ('@import')) {\n addOwnSheet(cssText, name);\n } else {\n addCssToD ocument(cssText);\n }\n }\n};\n\nvar selectorRe = /([^{]*)({[\\s\\S]*?})/gim ,\n cssCommentRe = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n // TODO(sor vell): remove either content or comment\n cssCommentNextSelectorRe = /\\/\\*\ \s*@polyfill ([^*]*\\*+([^/*][^*]*\\*+)*\\/)([^{]*?){/gim,\n cssContentNextSe lectorRe = /polyfill-next-selector[^}]*content\\:[\\s]*'([^']*)'[^}]*}([^{]*?){/ gim,\n // TODO(sorvell): remove either content or comment\n cssCommentRule Re = /\\/\\*\\s@polyfill-rule([^*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n cssConten tRuleRe = /(polyfill-rule)[^}]*(content\\:[\\s]*'([^']*)'[^;]*;)[^}]*}/gim,\n // TODO(sorvell): remove either content or comment\n cssCommentUnscopedRuleR e = /\\/\\*\\s@polyfill-unscoped-rule([^*]*\\*+([^/*][^*]*\\*+)*)\\//gim,\n c ssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content\\:[\\s]*'([^']* )'[^;]*;)[^}]*}/gim,\n cssPseudoRe = /::(x-[^\\s{,(]*)/gim,\n cssPartRe = /::part\\(([^)]*)\\)/gim,\n // note: :host pre-processed to -shadowcsshost.\n polyfillHost = '-shadowcsshost',\n // note: :ancestor pre-processed to -s hadowcssancestor.\n polyfillAncestor = '-shadowcssancestor',\n parenSuffix = ')(?:\\\\((' +\n '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' +\n ')\\\\))?( [^,{]*)';\n cssColonHostRe = new RegExp('(' + polyfillHost + parenSuffix, 'gi m'),\n cssColonAncestorRe = new RegExp('(' + polyfillAncestor + parenSuffix, 'gim'),\n selectorReSuffix = '([>\\\\s~+\\[.,{:][\\\\s\\\\S]*)?$',\n hostR e = /@host/gim,\n colonHostRe = /\\:host/gim,\n colonAncestorRe = /\\:ance stor/gim,\n /* host name without combinator */\n polyfillHostNoCombinator = polyfillHost + '-no-combinator',\n polyfillHostRe = new RegExp(polyfillHost , 'gim'),\n polyfillAncestorRe = new RegExp(polyfillAncestor, 'gim');\n\nfunc tion stylesToCssText(styles, preserveComments) {\n var cssText = '';\n Array.p rototype.forEach.call(styles, function(s) {\n cssText += s.textContent + '\\n \\n';\n });\n // strip comments for easier processing\n if (!preserveComments ) {\n cssText = cssText.replace(cssCommentRe, '');\n }\n return cssText;\n} \n\nfunction cssTextToStyle(cssText) {\n var style = document.createElement('st yle');\n style.textContent = cssText;\n return style;\n}\n\nfunction cssToRule s(cssText) {\n var style = cssTextToStyle(cssText);\n document.head.appendChil d(style);\n var rules = [];\n if (style.sheet) {\n // TODO(sorvell): Firefo x throws when accessing the rules of a stylesheet\n // with an @import\n / / https://bugzilla.mozilla.org/show_bug.cgi?id=625013\n try {\n rules = style.sheet.cssRules;\n } catch(e) {\n //\n }\n } else {\n consol e.warn('sheet not found', style);\n }\n style.parentNode.removeChild(style);\n return rules;\n}\n\nvar frame = document.createElement('iframe');\nframe.style .display = 'none';\n\nfunction initFrame() {\n frame.initialized = true;\n doc ument.body.appendChild(frame);\n var doc = frame.contentDocument;\n var base = doc.createElement('base');\n base.href = document.baseURI;\n doc.head.appendC hild(base);\n}\n\nfunction inFrame(fn) {\n if (!frame.initialized) {\n initF rame();\n }\n document.body.appendChild(frame);\n fn(frame.contentDocument);\ n document.body.removeChild(frame);\n}\n\n// TODO(sorvell): use an iframe if th e cssText contains an @import to workaround\n// https://code.google.com/p/chromi um/issues/detail?id=345114\nvar isChrome = navigator.userAgent.match('Chrome');\ nfunction withCssRules(cssText, callback) {\n if (!callback) {\n return;\n }\n var rules;\n if (cssText.match('@import') && isChrome) {\n var style = cssTextToStyle(cssText);\n inFrame(function(doc) {\n doc.head.appendChil d(style.impl);\n rules = style.sheet.cssRules;\n callback(rules);\n });\n } else {\n rules = cssToRules(cssText);\n callback(rules);\n }\n} \n\nfunction rulesToCss(cssRules) {\n for (var i=0, css=[]; i < cssRules.length ; i++) {\n css.push(cssRules[i].cssText);\n }\n return css.join('\\n\\n');\ n}\n\nfunction addCssToDocument(cssText) {\n if (cssText) {\n getSheet().app endChild(document.createTextNode(cssText));\n }\n}\n\nfunction addOwnSheet(cssT ext, name) {\n var style = cssTextToStyle(cssText);\n style.setAttribute(name, '');\n style.setAttribute(SHIMMED_ATTRIBUTE, '');\n document.head.appendChild (style);\n}\n\nvar SHIM_ATTRIBUTE = 'shim-shadowdom';\nvar SHIMMED_ATTRIBUTE = ' shim-shadowdom-css';\nvar NO_SHIM_ATTRIBUTE = 'no-shim';\n\nvar sheet;\nfunction getSheet() {\n if (!sheet) {\n sheet = document.createElement(\"style\");\n sheet.setAttribute(SHIMMED_ATTRIBUTE, '');\n sheet[SHIMMED_ATTRIBUTE] = t rue;\n }\n return sheet;\n}\n\n// add polyfill stylesheet to document\nif (win dow.ShadowDOMPolyfill) {\n addCssToDocument('style { display: none !important; }\\n');\n var doc = wrap(document);\n var head = doc.querySelector('head');\n head.insertBefore(getSheet(), head.childNodes[0]);\n\n // TODO(sorvell): monke y-patching HTMLImports is abusive;\n // consider a better solution.\n document .addEventListener('DOMContentLoaded', function() {\n var urlResolver = scope. urlResolver;\n \n if (window.HTMLImports && !HTMLImports.useNative) {\n var SHIM_SHEET_SELECTOR = 'link[rel=stylesheet]' +\n '[' + SHIM_ATTR IBUTE + ']';\n var SHIM_STYLE_SELECTOR = 'style[' + SHIM_ATTRIBUTE + ']';\n HTMLImports.importer.documentPreloadSelectors += ',' + SHIM_SHEET_SELECTOR ;\n HTMLImports.importer.importsPreloadSelectors += ',' + SHIM_SHEET_SELECT OR;\n\n HTMLImports.parser.documentSelectors = [\n HTMLImports.parse r.documentSelectors,\n SHIM_SHEET_SELECTOR,\n SHIM_STYLE_SELECTOR\ n ].join(',');\n \n var originalParseGeneric = HTMLImports.parser.par seGeneric;\n\n HTMLImports.parser.parseGeneric = function(elt) {\n i f (elt[SHIMMED_ATTRIBUTE]) {\n return;\n }\n var style = elt.__importElement || elt;\n if (!style.hasAttribute(SHIM_ATTRIBUTE)) {\ n originalParseGeneric.call(this, elt);\n return;\n }\n if (elt.__resource) {\n style = elt.ownerDocument.createElement ('style');\n style.textContent = urlResolver.resolveCssText(\n elt.__resource, elt.href);\n } else {\n urlResolver.resolve Style(style); \n }\n style.textContent = ShadowCSS.shimStyle(styl e);\n style.removeAttribute(SHIM_ATTRIBUTE, '');\n style.setAttrib ute(SHIMMED_ATTRIBUTE, '');\n style[SHIMMED_ATTRIBUTE] = true;\n / / place in document\n if (style.parentNode !== head) {\n // repl ace links in head\n if (elt.parentNode === head) {\n head.re placeChild(style, elt);\n } else {\n head.appendChild(style) ;\n }\n }\n style.__importParsed = true;\n this.ma rkParsingComplete(elt);\n }\n\n var hasResource = HTMLImports.parser.h asResource;\n HTMLImports.parser.hasResource = function(node) {\n if (node.localName === 'link' && node.rel === 'stylesheet' &&\n node.ha sAttribute(SHIM_ATTRIBUTE)) {\n return (node.__resource);\n } el se {\n return hasResource.call(this, node);\n }\n }\n\n }\n });\n}\n\n// exports\nscope.ShadowCSS = ShadowCSS;\n\n})(window.Platform);" ,
151 "} else {", 154 "} else {",
152 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\n // poor man's adapter for template.conte nt on various platform scenarios\n window.templateContent = window.templateCont ent || function(inTemplate) {\n return inTemplate.content;\n };\n\n // so w e can call wrap/unwrap without testing for ShadowDOMPolyfill\n\n window.wrap = window.unwrap = function(n){\n return n;\n }\n\n var originalCreateShadowRo ot = Element.prototype.webkitCreateShadowRoot;\n Element.prototype.webkitCreate ShadowRoot = function() {\n var elderRoot = this.webkitShadowRoot;\n var r oot = originalCreateShadowRoot.call(this);\n root.olderShadowRoot = elderRoot ;\n root.host = this;\n CustomElements.watchShadow(this);\n return root ;\n }\n\n Object.defineProperties(Element.prototype, {\n shadowRoot: {\n get: function() {\n return this.webkitShadowRoot;\n }\n },\n createShadowRoot: {\n value: function() {\n return this.webkitCrea teShadowRoot();\n }\n }\n });\n\n window.templateContent = function(in Template) {\n // if MDV exists, it may need to boostrap this template to reve al content\n if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.bootstrap(inTemplate);\n }\n // fallback whe n there is no Shadow DOM polyfill, no MDV polyfill, and no\n // native templa te support\n if (!inTemplate.content && !inTemplate._content) {\n var fr ag = document.createDocumentFragment();\n while (inTemplate.firstChild) {\n frag.appendChild(inTemplate.firstChild);\n }\n inTemplate._con tent = frag;\n }\n return inTemplate.content || inTemplate._content;\n }; \n\n})();", 155 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\n // poor man's adapter for template.conte nt on various platform scenarios\n window.templateContent = window.templateCont ent || function(inTemplate) {\n return inTemplate.content;\n };\n\n // so w e can call wrap/unwrap without testing for ShadowDOMPolyfill\n\n window.wrap = window.unwrap = function(n){\n return n;\n }\n\n var originalCreateShadowRo ot = Element.prototype.webkitCreateShadowRoot;\n Element.prototype.webkitCreate ShadowRoot = function() {\n var elderRoot = this.webkitShadowRoot;\n var r oot = originalCreateShadowRoot.call(this);\n root.olderShadowRoot = elderRoot ;\n root.host = this;\n CustomElements.watchShadow(this);\n return root ;\n }\n\n Object.defineProperties(Element.prototype, {\n shadowRoot: {\n get: function() {\n return this.webkitShadowRoot;\n }\n },\n createShadowRoot: {\n value: function() {\n return this.webkitCrea teShadowRoot();\n }\n }\n });\n\n window.templateContent = function(in Template) {\n // if MDV exists, it may need to boostrap this template to reve al content\n if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.bootstrap(inTemplate);\n }\n // fallback whe n there is no Shadow DOM polyfill, no MDV polyfill, and no\n // native templa te support\n if (!inTemplate.content && !inTemplate._content) {\n var fr ag = document.createDocumentFragment();\n while (inTemplate.firstChild) {\n frag.appendChild(inTemplate.firstChild);\n }\n inTemplate._con tent = frag;\n }\n return inTemplate.content || inTemplate._content;\n }; \n\n})();",
153 "}", 156 "}",
154 "/* Any copyright is dedicated to the Public Domain.\n * http://creativecomm ons.org/publicdomain/zero/1.0/ */\n\n(function(scope) {\n 'use strict';\n\n // feature detect for URL constructor\n var hasWorkingUrl = false;\n if (!scope. forceJURL) {\n try {\n var u = new URL('b', 'http://a');\n hasWorki ngUrl = u.href === 'http://a/b';\n } catch(e) {}\n }\n\n if (hasWorkingUrl) \n return;\n\n var relative = Object.create(null);\n relative['ftp'] = 21;\ n relative['file'] = 0;\n relative['gopher'] = 70;\n relative['http'] = 80;\n relative['https'] = 443;\n relative['ws'] = 80;\n relative['wss'] = 443;\n\n var relativePathDotMapping = Object.create(null);\n relativePathDotMapping['% 2e'] = '.';\n relativePathDotMapping['.%2e'] = '..';\n relativePathDotMapping[ '%2e.'] = '..';\n relativePathDotMapping['%2e%2e'] = '..';\n\n function isRela tiveScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n\n funct ion invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n\n fu nction IDNAToASCII(h) {\n if ('' == h) {\n invalid.call(this)\n }\n // XXX\n return h.toLowerCase()\n }\n\n function percentEscape(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ? `\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf (unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponen t(c);\n }\n\n function percentEscapeQuery(c) {\n // XXX This actually needs to encode c using encoding and then\n // convert the bytes one-by-one.\n\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x 7F &&\n // \" # < > ` (do not escape '?')\n [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return enc odeURIComponent(c);\n }\n\n var EOF = undefined,\n ALPHA = /[a-zA-Z]/,\n ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n\n function parse(input, stateOver ride, base) {\n function err(message) {\n errors.push(message)\n }\n\ n var state = stateOverride || 'scheme start',\n cursor = 0,\n buffer = '',\n seenAt = false,\n seenBracket = false,\n err ors = [];\n\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this ._isInvalid) {\n var c = input[cursor];\n switch (state) {\n ca se 'scheme start':\n if (c && ALPHA.test(c)) {\n buffer += c .toLowerCase(); // ASCII-safe\n state = 'scheme';\n } else i f (!stateOverride) {\n buffer = '';\n state = 'no scheme'; \n continue;\n } else {\n err('Invalid scheme.'); \n break loop;\n }\n break;\n\n case 'scheme ':\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerC ase(); // ASCII-safe\n } else if (':' == c) {\n this._scheme = buffer;\n buffer = '';\n if (stateOverride) {\n break loop;\n }\n if (isRelativeScheme(this._scheme) ) {\n this._isRelative = true;\n }\n if ('fil e' == this._scheme) {\n state = 'relative';\n } else if (this._isRelative && base && base._scheme == this._scheme) {\n stat e = 'relative or authority';\n } else if (this._isRelative) {\n state = 'authority first slash';\n } else {\n st ate = 'scheme data';\n }\n } else if (!stateOverride) {\n buffer = '';\n cursor = 0;\n state = 'no scheme'; \n continue;\n } else if (EOF == c) {\n break loo p;\n } else {\n err('Code point not allowed in scheme: ' + c )\n break loop;\n }\n break;\n\n case 'schem e data':\n if ('?' == c) {\n query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#'; \n state = 'fragment';\n } else {\n // XXX error handling\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\ n this._schemeData += percentEscape(c);\n }\n } \n break;\n\n case 'no scheme':\n if (!base || !(isRela tiveScheme(base._scheme))) {\n err('Missing scheme.');\n i nvalid.call(this);\n } else {\n state = 'relative';\n continue;\n }\n break;\n\n case 'relative or autho rity':\n if ('/' == c && '/' == input[cursor+1]) {\n state = 'authority ignore slashes';\n } else {\n err('Expected /, g ot: ' + c);\n state = 'relative';\n continue\n }\ n break;\n\n case 'relative':\n this._isRelative = true ;\n if ('file' != this._scheme)\n this._scheme = base._schem e;\n if (EOF == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n break loop;\n } else if (' /' == c || '\\\\' == c) {\n if ('\\\\' == c)\n err('\\\\ is an invalid code point.');\n state = 'relative slash';\n } else if ('?' == c) {\n this._host = base._host;\n this._ port = base._port;\n this._path = base._path.slice();\n th is._query = '?';\n state = 'query';\n } else if ('#' == c) { \n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._quer y;\n this._fragment = '#';\n state = 'fragment';\n } else {\n var nextC = input[cursor+1]\n var nextNextC = input[cursor+2]\n if (\n 'file' != this._scheme || !ALP HA.test(c) ||\n (nextC != ':' && nextC != '|') ||\n (E OF != nextNextC && '/' != nextNextC && '\\\\' != nextNextC && '?' != nextNextC & & '#' != nextNextC)) {\n this._host = base._host;\n th is._port = base._port;\n this._path = base._path.slice();\n this._path.pop();\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'relative sla sh':\n if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c) {\n err('\\\\ is an invalid code point.');\n }\n if ('file' == this._scheme) {\n state = 'file host';\n } else {\n state = 'authority ignore slashes';\n }\n } else {\n if ('file' != this._scheme) {\n this._h ost = base._host;\n this._port = base._port;\n }\n state = 'relative path';\n continue;\n }\n br eak;\n\n case 'authority first slash':\n if ('/' == c) {\n state = 'authority second slash';\n } else {\n err(\"E xpected '/', got: \" + c);\n state = 'authority ignore slashes';\n continue;\n }\n break;\n\n case 'authority sec ond slash':\n state = 'authority ignore slashes';\n if ('/' != c) {\n err(\"Expected '/', got: \" + c);\n continue;\n }\n break;\n\n case 'authority ignore slashes':\n if ('/' != c && '\\\\' != c) {\n state = 'authority';\n continue;\n } else {\n err('Expected authority, got: ' + c); \n }\n break;\n\n case 'authority':\n if ('@' == c) {\n if (seenAt) {\n err('@ already seen.');\n buffer += '%40';\n }\n seenAt = true;\n for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n if ('\\t' == cp || '\\n' == cp || '\\r' == cp) {\n err('Invalid whitespace in authority.');\n continue;\n }\n // XXX check URL code points\n if (':' == cp && null === this._password) {\n this._password = '';\n continue;\n }\n var tempC = percentEscape(cp);\n (null !== this._password) ? this._password += tempC : this._username += tempC;\n }\n buffer = '';\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n cursor -= b uffer.length;\n buffer = '';\n state = 'host';\n continue;\n } else {\n buffer += c;\n }\n break;\n\n case 'file host':\n if (EOF == c || '/' == c || '\\ \\' == c || '?' == c || '#' == c) {\n if (buffer.length == 2 && ALPHA .test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {\n sta te = 'relative path';\n } else if (buffer.length == 0) {\n state = 'relative path start';\n } else {\n this._hos t = IDNAToASCII.call(this, buffer);\n buffer = '';\n s tate = 'relative path start';\n }\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid wh itespace in file host.');\n } else {\n buffer += c;\n }\n break;\n\n case 'host':\n case 'hostname':\n if (':' == c && !seenBracket) {\n // XXX host parsing\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'port';\n if ('hostname' == stateOverride) {\n break loop;\n }\n } else if (EOF == c || '/' == c || '\ \\\' == c || '?' == c || '#' == c) {\n this._host = IDNAToASCII.call( this, buffer);\n buffer = '';\n state = 'relative path sta rt';\n if (stateOverride) {\n break loop;\n } \n continue;\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n if ('[' == c) {\n seenBracket = true;\n } else if (']' == c) {\n seenBracket = false;\n }\n buffer += c;\n } else {\n err('Invalid code poin t in host/hostname: ' + c);\n }\n break;\n\n case 'port ':\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c || stateOverrid e) {\n if ('' != buffer) {\n var temp = parseInt(buffer, 10);\n if (temp != relative[this._scheme]) {\n this ._port = temp + '';\n }\n buffer = '';\n }\ n if (stateOverride) {\n break loop;\n }\n state = 'relative path start';\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid code po int in port: ' + c);\n } else {\n invalid.call(this);\n }\n break;\n\n case 'relative path start':\n if (' \\\\' == c)\n err(\"'\\\\' not allowed in path.\");\n state = 'relative path';\n if ('/' != c && '\\\\' != c) {\n contin ue;\n }\n break;\n\n case 'relative path':\n i f (EOF == c || '/' == c || '\\\\' == c || (!stateOverride && ('?' == c || '#' == c))) {\n if ('\\\\' == c) {\n err('\\\\ not allowed in relative path.');\n }\n var tmp;\n if (tmp = re lativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n }\n if ('..' == buffer) {\n this._path.pop();\n if ('/' != c && '\\\\' != c) {\n this._path.push('') ;\n }\n } else if ('.' == buffer && '/' != c && '\\\\' ! = c) {\n this._path.push('');\n } else if ('.' != buffer ) {\n if ('file' == this._scheme && this._path.length == 0 && buffe r.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {\n b uffer = buffer[0] + ':';\n }\n this._path.push(buffer) ;\n }\n buffer = '';\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragm ent';\n }\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n buffer += percentEscape(c);\n }\n break;\n\n case 'query':\n if (!stateOverride && '#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._query += p ercentEscapeQuery(c);\n }\n break;\n\n case 'fragment': \n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._fragment += c;\n }\n break;\n }\n\n cursor+ +;\n }\n }\n\n function clear() {\n this._scheme = '';\n this._scheme Data = '';\n this._username = '';\n this._password = null;\n this._host = '';\n this._port = '';\n this._path = [];\n this._query = '';\n t his._fragment = '';\n this._isInvalid = false;\n this._isRelative = false; \n }\n\n // Does not process domain names or IP addresses.\n // Does not hand le encoding for the query parameter.\n function jURL(url, base /* , encoding */ ) {\n if (base !== undefined && !(base instanceof jURL))\n base = new jU RL(String(base));\n\n this._url = url;\n clear.call(this);\n\n var inpu t = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n // encoding = encoding || 'utf-8'\n\n parse.call(this, input, null, base);\n }\n\n jURL.p rototype = {\n get href() {\n if (this._isInvalid)\n return this. _url;\n\n var authority = '';\n if ('' != this._username || null != th is._password) {\n authority = this._username +\n (null != this ._password ? ':' + this._password : '') + '@';\n }\n\n return this.pro tocol +\n (this._isRelative ? '//' + authority + this.host : '') +\n this.pathname + this._query + this._fragment;\n },\n set href(href) {\n clear.call(this);\n parse.call(this, href);\n },\n\n get pr otocol() {\n return this._scheme + ':';\n },\n set protocol(protocol) {\n if (this._isInvalid)\n return;\n parse.call(this, protocol + ':', 'scheme start');\n },\n\n get host() {\n return this._isInval id ? '' : this._port ?\n this._host + ':' + this._port : this._host;\n },\n set host(host) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, host, 'host');\n },\n\n get hostname () {\n return this._host;\n },\n set hostname(hostname) {\n if ( this._isInvalid || !this._isRelative)\n return;\n parse.call(this, h ostname, 'hostname');\n },\n\n get port() {\n return this._port;\n },\n set port(port) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, port, 'port');\n },\n\n get pathname() {\n return this._isInvalid ? '' : this._isRelative ?\n '/' + this ._path.join('/') : this._schemeData;\n },\n set pathname(pathname) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._path = [];\n parse.call(this, pathname, 'relative path start');\n },\n\n ge t search() {\n return this._isInvalid || !this._query || '?' == this._query ?\n '' : this._query;\n },\n set search(search) {\n if (thi s._isInvalid || !this._isRelative)\n return;\n this._query = '?';\n if ('?' == search[0])\n search = search.slice(1);\n parse.call( this, search, 'query');\n },\n\n get hash() {\n return this._isInvali d || !this._fragment || '#' == this._fragment ?\n '' : this._fragment;\ n },\n set hash(hash) {\n if (this._isInvalid)\n return;\n this._fragment = '#';\n if ('#' == hash[0])\n hash = hash.slice(1) ;\n parse.call(this, hash, 'fragment');\n }\n };\n\n scope.URL = jURL; \n\n})(window);\n", 157 "/* Any copyright is dedicated to the Public Domain.\n * http://creativecomm ons.org/publicdomain/zero/1.0/ */\n\n(function(scope) {\n 'use strict';\n\n // feature detect for URL constructor\n var hasWorkingUrl = false;\n if (!scope. forceJURL) {\n try {\n var u = new URL('b', 'http://a');\n hasWorki ngUrl = u.href === 'http://a/b';\n } catch(e) {}\n }\n\n if (hasWorkingUrl) \n return;\n\n var relative = Object.create(null);\n relative['ftp'] = 21;\ n relative['file'] = 0;\n relative['gopher'] = 70;\n relative['http'] = 80;\n relative['https'] = 443;\n relative['ws'] = 80;\n relative['wss'] = 443;\n\n var relativePathDotMapping = Object.create(null);\n relativePathDotMapping['% 2e'] = '.';\n relativePathDotMapping['.%2e'] = '..';\n relativePathDotMapping[ '%2e.'] = '..';\n relativePathDotMapping['%2e%2e'] = '..';\n\n function isRela tiveScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n\n funct ion invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n\n fu nction IDNAToASCII(h) {\n if ('' == h) {\n invalid.call(this)\n }\n // XXX\n return h.toLowerCase()\n }\n\n function percentEscape(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ? `\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf (unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponen t(c);\n }\n\n function percentEscapeQuery(c) {\n // XXX This actually needs to encode c using encoding and then\n // convert the bytes one-by-one.\n\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x 7F &&\n // \" # < > ` (do not escape '?')\n [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return enc odeURIComponent(c);\n }\n\n var EOF = undefined,\n ALPHA = /[a-zA-Z]/,\n ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n\n function parse(input, stateOver ride, base) {\n function err(message) {\n errors.push(message)\n }\n\ n var state = stateOverride || 'scheme start',\n cursor = 0,\n buffer = '',\n seenAt = false,\n seenBracket = false,\n err ors = [];\n\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this ._isInvalid) {\n var c = input[cursor];\n switch (state) {\n ca se 'scheme start':\n if (c && ALPHA.test(c)) {\n buffer += c .toLowerCase(); // ASCII-safe\n state = 'scheme';\n } else i f (!stateOverride) {\n buffer = '';\n state = 'no scheme'; \n continue;\n } else {\n err('Invalid scheme.'); \n break loop;\n }\n break;\n\n case 'scheme ':\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerC ase(); // ASCII-safe\n } else if (':' == c) {\n this._scheme = buffer;\n buffer = '';\n if (stateOverride) {\n break loop;\n }\n if (isRelativeScheme(this._scheme) ) {\n this._isRelative = true;\n }\n if ('fil e' == this._scheme) {\n state = 'relative';\n } else if (this._isRelative && base && base._scheme == this._scheme) {\n stat e = 'relative or authority';\n } else if (this._isRelative) {\n state = 'authority first slash';\n } else {\n st ate = 'scheme data';\n }\n } else if (!stateOverride) {\n buffer = '';\n cursor = 0;\n state = 'no scheme'; \n continue;\n } else if (EOF == c) {\n break loo p;\n } else {\n err('Code point not allowed in scheme: ' + c )\n break loop;\n }\n break;\n\n case 'schem e data':\n if ('?' == c) {\n query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#'; \n state = 'fragment';\n } else {\n // XXX error handling\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\ n this._schemeData += percentEscape(c);\n }\n } \n break;\n\n case 'no scheme':\n if (!base || !(isRela tiveScheme(base._scheme))) {\n err('Missing scheme.');\n i nvalid.call(this);\n } else {\n state = 'relative';\n continue;\n }\n break;\n\n case 'relative or autho rity':\n if ('/' == c && '/' == input[cursor+1]) {\n state = 'authority ignore slashes';\n } else {\n err('Expected /, g ot: ' + c);\n state = 'relative';\n continue\n }\ n break;\n\n case 'relative':\n this._isRelative = true ;\n if ('file' != this._scheme)\n this._scheme = base._schem e;\n if (EOF == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n break loop;\n } else if (' /' == c || '\\\\' == c) {\n if ('\\\\' == c)\n err('\\\\ is an invalid code point.');\n state = 'relative slash';\n } else if ('?' == c) {\n this._host = base._host;\n this._ port = base._port;\n this._path = base._path.slice();\n th is._query = '?';\n state = 'query';\n } else if ('#' == c) { \n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._quer y;\n this._fragment = '#';\n state = 'fragment';\n } else {\n var nextC = input[cursor+1]\n var nextNextC = input[cursor+2]\n if (\n 'file' != this._scheme || !ALP HA.test(c) ||\n (nextC != ':' && nextC != '|') ||\n (E OF != nextNextC && '/' != nextNextC && '\\\\' != nextNextC && '?' != nextNextC & & '#' != nextNextC)) {\n this._host = base._host;\n th is._port = base._port;\n this._path = base._path.slice();\n this._path.pop();\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'relative sla sh':\n if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c) {\n err('\\\\ is an invalid code point.');\n }\n if ('file' == this._scheme) {\n state = 'file host';\n } else {\n state = 'authority ignore slashes';\n }\n } else {\n if ('file' != this._scheme) {\n this._h ost = base._host;\n this._port = base._port;\n }\n state = 'relative path';\n continue;\n }\n br eak;\n\n case 'authority first slash':\n if ('/' == c) {\n state = 'authority second slash';\n } else {\n err(\"E xpected '/', got: \" + c);\n state = 'authority ignore slashes';\n continue;\n }\n break;\n\n case 'authority sec ond slash':\n state = 'authority ignore slashes';\n if ('/' != c) {\n err(\"Expected '/', got: \" + c);\n continue;\n }\n break;\n\n case 'authority ignore slashes':\n if ('/' != c && '\\\\' != c) {\n state = 'authority';\n continue;\n } else {\n err('Expected authority, got: ' + c); \n }\n break;\n\n case 'authority':\n if ('@' == c) {\n if (seenAt) {\n err('@ already seen.');\n buffer += '%40';\n }\n seenAt = true;\n for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n if ('\\t' == cp || '\\n' == cp || '\\r' == cp) {\n err('Invalid whitespace in authority.');\n continue;\n }\n // XXX check URL code points\n if (':' == cp && null === this._password) {\n this._password = '';\n continue;\n }\n var tempC = percentEscape(cp);\n (null !== this._password) ? this._password += tempC : this._username += tempC;\n }\n buffer = '';\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n cursor -= b uffer.length;\n buffer = '';\n state = 'host';\n continue;\n } else {\n buffer += c;\n }\n break;\n\n case 'file host':\n if (EOF == c || '/' == c || '\\ \\' == c || '?' == c || '#' == c) {\n if (buffer.length == 2 && ALPHA .test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {\n sta te = 'relative path';\n } else if (buffer.length == 0) {\n state = 'relative path start';\n } else {\n this._hos t = IDNAToASCII.call(this, buffer);\n buffer = '';\n s tate = 'relative path start';\n }\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid wh itespace in file host.');\n } else {\n buffer += c;\n }\n break;\n\n case 'host':\n case 'hostname':\n if (':' == c && !seenBracket) {\n // XXX host parsing\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'port';\n if ('hostname' == stateOverride) {\n break loop;\n }\n } else if (EOF == c || '/' == c || '\ \\\' == c || '?' == c || '#' == c) {\n this._host = IDNAToASCII.call( this, buffer);\n buffer = '';\n state = 'relative path sta rt';\n if (stateOverride) {\n break loop;\n } \n continue;\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n if ('[' == c) {\n seenBracket = true;\n } else if (']' == c) {\n seenBracket = false;\n }\n buffer += c;\n } else {\n err('Invalid code poin t in host/hostname: ' + c);\n }\n break;\n\n case 'port ':\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c || stateOverrid e) {\n if ('' != buffer) {\n var temp = parseInt(buffer, 10);\n if (temp != relative[this._scheme]) {\n this ._port = temp + '';\n }\n buffer = '';\n }\ n if (stateOverride) {\n break loop;\n }\n state = 'relative path start';\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid code po int in port: ' + c);\n } else {\n invalid.call(this);\n }\n break;\n\n case 'relative path start':\n if (' \\\\' == c)\n err(\"'\\\\' not allowed in path.\");\n state = 'relative path';\n if ('/' != c && '\\\\' != c) {\n contin ue;\n }\n break;\n\n case 'relative path':\n i f (EOF == c || '/' == c || '\\\\' == c || (!stateOverride && ('?' == c || '#' == c))) {\n if ('\\\\' == c) {\n err('\\\\ not allowed in relative path.');\n }\n var tmp;\n if (tmp = re lativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n }\n if ('..' == buffer) {\n this._path.pop();\n if ('/' != c && '\\\\' != c) {\n this._path.push('') ;\n }\n } else if ('.' == buffer && '/' != c && '\\\\' ! = c) {\n this._path.push('');\n } else if ('.' != buffer ) {\n if ('file' == this._scheme && this._path.length == 0 && buffe r.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {\n b uffer = buffer[0] + ':';\n }\n this._path.push(buffer) ;\n }\n buffer = '';\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragm ent';\n }\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n buffer += percentEscape(c);\n }\n break;\n\n case 'query':\n if (!stateOverride && '#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._query += p ercentEscapeQuery(c);\n }\n break;\n\n case 'fragment': \n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._fragment += c;\n }\n break;\n }\n\n cursor+ +;\n }\n }\n\n function clear() {\n this._scheme = '';\n this._scheme Data = '';\n this._username = '';\n this._password = null;\n this._host = '';\n this._port = '';\n this._path = [];\n this._query = '';\n t his._fragment = '';\n this._isInvalid = false;\n this._isRelative = false; \n }\n\n // Does not process domain names or IP addresses.\n // Does not hand le encoding for the query parameter.\n function jURL(url, base /* , encoding */ ) {\n if (base !== undefined && !(base instanceof jURL))\n base = new jU RL(String(base));\n\n this._url = url;\n clear.call(this);\n\n var inpu t = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n // encoding = encoding || 'utf-8'\n\n parse.call(this, input, null, base);\n }\n\n jURL.p rototype = {\n get href() {\n if (this._isInvalid)\n return this. _url;\n\n var authority = '';\n if ('' != this._username || null != th is._password) {\n authority = this._username +\n (null != this ._password ? ':' + this._password : '') + '@';\n }\n\n return this.pro tocol +\n (this._isRelative ? '//' + authority + this.host : '') +\n this.pathname + this._query + this._fragment;\n },\n set href(href) {\n clear.call(this);\n parse.call(this, href);\n },\n\n get pr otocol() {\n return this._scheme + ':';\n },\n set protocol(protocol) {\n if (this._isInvalid)\n return;\n parse.call(this, protocol + ':', 'scheme start');\n },\n\n get host() {\n return this._isInval id ? '' : this._port ?\n this._host + ':' + this._port : this._host;\n },\n set host(host) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, host, 'host');\n },\n\n get hostname () {\n return this._host;\n },\n set hostname(hostname) {\n if ( this._isInvalid || !this._isRelative)\n return;\n parse.call(this, h ostname, 'hostname');\n },\n\n get port() {\n return this._port;\n },\n set port(port) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, port, 'port');\n },\n\n get pathname() {\n return this._isInvalid ? '' : this._isRelative ?\n '/' + this ._path.join('/') : this._schemeData;\n },\n set pathname(pathname) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._path = [];\n parse.call(this, pathname, 'relative path start');\n },\n\n ge t search() {\n return this._isInvalid || !this._query || '?' == this._query ?\n '' : this._query;\n },\n set search(search) {\n if (thi s._isInvalid || !this._isRelative)\n return;\n this._query = '?';\n if ('?' == search[0])\n search = search.slice(1);\n parse.call( this, search, 'query');\n },\n\n get hash() {\n return this._isInvali d || !this._fragment || '#' == this._fragment ?\n '' : this._fragment;\ n },\n set hash(hash) {\n if (this._isInvalid)\n return;\n this._fragment = '#';\n if ('#' == hash[0])\n hash = hash.slice(1) ;\n parse.call(this, hash, 'fragment');\n }\n };\n\n scope.URL = jURL; \n\n})(window);\n",
155 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n// Old versions of iOS do not have bind.\n\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(s cope) {\n var self = this;\n var args = Array.prototype.slice.call(argumen ts, 1);\n return function() {\n var args2 = args.slice();\n args2.p ush.apply(args2, arguments);\n return self.apply(scope, args2);\n };\n };\n}\n\n// mixin\n\n// copy all properties from inProps (et al) to inObj\nfunct ion mixin(inObj/*, inProps, inMoreProps, ...*/) {\n var obj = inObj || {};\n f or (var i = 1; i < arguments.length; i++) {\n var p = arguments[i];\n try {\n for (var n in p) {\n copyProperty(n, p, obj);\n }\n } ca tch(x) {\n }\n }\n return obj;\n}\n\n// copy property inName from inSource object to inTarget object\nfunction copyProperty(inName, inSource, inTarget) {\n var pd = getPropertyDescriptor(inSource, inName);\n Object.defineProperty(inT arget, inName, pd);\n}\n\n// get property descriptor for inName on inObject, eve n if\n// inName exists on some link in inObject's prototype chain\nfunction getP ropertyDescriptor(inObject, inName) {\n if (inObject) {\n var pd = Object.ge tOwnPropertyDescriptor(inObject, inName);\n return pd || getPropertyDescripto r(Object.getPrototypeOf(inObject), inName);\n }\n}\n\n// export\n\nscope.mixin = mixin;\n\n})(window.Platform);", 158 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n// Old versions of iOS do not have bind.\n\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(s cope) {\n var self = this;\n var args = Array.prototype.slice.call(argumen ts, 1);\n return function() {\n var args2 = args.slice();\n args2.p ush.apply(args2, arguments);\n return self.apply(scope, args2);\n };\n };\n}\n\n// mixin\n\n// copy all properties from inProps (et al) to inObj\nfunct ion mixin(inObj/*, inProps, inMoreProps, ...*/) {\n var obj = inObj || {};\n f or (var i = 1; i < arguments.length; i++) {\n var p = arguments[i];\n try {\n for (var n in p) {\n copyProperty(n, p, obj);\n }\n } ca tch(x) {\n }\n }\n return obj;\n}\n\n// copy property inName from inSource object to inTarget object\nfunction copyProperty(inName, inSource, inTarget) {\n var pd = getPropertyDescriptor(inSource, inName);\n Object.defineProperty(inT arget, inName, pd);\n}\n\n// get property descriptor for inName on inObject, eve n if\n// inName exists on some link in inObject's prototype chain\nfunction getP ropertyDescriptor(inObject, inName) {\n if (inObject) {\n var pd = Object.ge tOwnPropertyDescriptor(inObject, inName);\n return pd || getPropertyDescripto r(Object.getPrototypeOf(inObject), inName);\n }\n}\n\n// export\n\nscope.mixin = mixin;\n\n})(window.Platform);",
156 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(scope) {\n\n 'use strict';\n\n // polyfill DOMTokenList\n // * add/remove: allow these methods to take multiple classNames\n // * toggle: add a 2nd argument which forces the given state rather\n // than toggling.\n\n var add = DOMTokenList.prototype.a dd;\n var remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.add = function() {\n for (var i = 0; i < arguments.length; i++) {\n add.cal l(this, arguments[i]);\n }\n };\n DOMTokenList.prototype.remove = function( ) {\n for (var i = 0; i < arguments.length; i++) {\n remove.call(this, a rguments[i]);\n }\n };\n DOMTokenList.prototype.toggle = function(name, boo l) {\n if (arguments.length == 1) {\n bool = !this.contains(name);\n }\n bool ? this.add(name) : this.remove(name);\n };\n DOMTokenList.prototyp e.switch = function(oldName, newName) {\n oldName && this.remove(oldName);\n newName && this.add(newName);\n };\n\n // add array() to NodeList, NamedNod eMap, HTMLCollection\n\n var ArraySlice = function() {\n return Array.protot ype.slice.call(this);\n };\n\n var namedNodeMap = (window.NamedNodeMap || wind ow.MozNamedAttrMap || {});\n\n NodeList.prototype.array = ArraySlice;\n namedN odeMap.prototype.array = ArraySlice;\n HTMLCollection.prototype.array = ArraySl ice;\n\n // polyfill performance.now\n\n if (!window.performance) {\n var s tart = Date.now();\n // only at millisecond precision\n window.performance = {now: function(){ return Date.now() - start }};\n }\n\n // polyfill for req uestAnimationFrame\n\n if (!window.requestAnimationFrame) {\n window.request AnimationFrame = (function() {\n var nativeRaf = window.webkitRequestAnimat ionFrame ||\n window.mozRequestAnimationFrame;\n\n return nativeRaf ?\n function(callback) {\n return nativeRaf(function() {\n callback(performance.now());\n });\n } :\n function ( callback ){\n return window.setTimeout(callback, 1000 / 60);\n };\n })();\n }\n\n if (!window.cancelAnimationFrame) {\n window.cancelA nimationFrame = (function() {\n return window.webkitCancelAnimationFrame | |\n window.mozCancelAnimationFrame ||\n function(id) {\n clearTimeout(id);\n };\n })();\n }\n\n // utility\n\n function crea teDOM(inTagOrNode, inHTML, inAttrs) {\n var dom = typeof inTagOrNode == 'stri ng' ?\n document.createElement(inTagOrNode) : inTagOrNode.cloneNode(true) ;\n dom.innerHTML = inHTML;\n if (inAttrs) {\n for (var n in inAttrs) {\n dom.setAttribute(n, inAttrs[n]);\n }\n }\n return dom;\n }\n // Make a stub for Polymer() for polyfill purposes; under the HTMLImports\ n // polyfill, scripts in the main document run before imports. That means\n / / if (1) polymer is imported and (2) Polymer() is called in the main document\n // in a script after the import, 2 occurs before 1. We correct this here\n // by specfiically patching Polymer(); this is not necessary under native\n // HTM LImports.\n var elementDeclarations = [];\n\n var polymerStub = function(name, dictionary) {\n elementDeclarations.push(arguments);\n }\n window.Polymer = polymerStub;\n\n // deliver queued delcarations\n scope.deliverDeclarations = function() {\n scope.deliverDeclarations = function() {\n throw 'Possib le attempt to load Polymer twice';\n };\n return elementDeclarations;\n } \n\n // Once DOMContent has loaded, any main document scripts that depend on\n // Polymer() should have run. Calling Polymer() now is an error until\n // pol ymer is imported.\n window.addEventListener('DOMContentLoaded', function() {\n if (window.Polymer === polymerStub) {\n window.Polymer = function() {\n console.error('You tried to use polymer without loading it first. To ' +\ n 'load polymer, <link rel=\"import\" href=\"' + \n 'component s/polymer/polymer.html\">');\n };\n }\n });\n\n // exports\n scope.cr eateDOM = createDOM;\n\n})(window.Platform);\n", 159 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(scope) {\n\n 'use strict';\n\n // polyfill DOMTokenList\n // * add/remove: allow these methods to take multiple classNames\n // * toggle: add a 2nd argument which forces the given state rather\n // than toggling.\n\n var add = DOMTokenList.prototype.a dd;\n var remove = DOMTokenList.prototype.remove;\n DOMTokenList.prototype.add = function() {\n for (var i = 0; i < arguments.length; i++) {\n add.cal l(this, arguments[i]);\n }\n };\n DOMTokenList.prototype.remove = function( ) {\n for (var i = 0; i < arguments.length; i++) {\n remove.call(this, a rguments[i]);\n }\n };\n DOMTokenList.prototype.toggle = function(name, boo l) {\n if (arguments.length == 1) {\n bool = !this.contains(name);\n }\n bool ? this.add(name) : this.remove(name);\n };\n DOMTokenList.prototyp e.switch = function(oldName, newName) {\n oldName && this.remove(oldName);\n newName && this.add(newName);\n };\n\n // add array() to NodeList, NamedNod eMap, HTMLCollection\n\n var ArraySlice = function() {\n return Array.protot ype.slice.call(this);\n };\n\n var namedNodeMap = (window.NamedNodeMap || wind ow.MozNamedAttrMap || {});\n\n NodeList.prototype.array = ArraySlice;\n namedN odeMap.prototype.array = ArraySlice;\n HTMLCollection.prototype.array = ArraySl ice;\n\n // polyfill performance.now\n\n if (!window.performance) {\n var s tart = Date.now();\n // only at millisecond precision\n window.performance = {now: function(){ return Date.now() - start }};\n }\n\n // polyfill for req uestAnimationFrame\n\n if (!window.requestAnimationFrame) {\n window.request AnimationFrame = (function() {\n var nativeRaf = window.webkitRequestAnimat ionFrame ||\n window.mozRequestAnimationFrame;\n\n return nativeRaf ?\n function(callback) {\n return nativeRaf(function() {\n callback(performance.now());\n });\n } :\n function ( callback ){\n return window.setTimeout(callback, 1000 / 60);\n };\n })();\n }\n\n if (!window.cancelAnimationFrame) {\n window.cancelA nimationFrame = (function() {\n return window.webkitCancelAnimationFrame | |\n window.mozCancelAnimationFrame ||\n function(id) {\n clearTimeout(id);\n };\n })();\n }\n\n // utility\n\n function crea teDOM(inTagOrNode, inHTML, inAttrs) {\n var dom = typeof inTagOrNode == 'stri ng' ?\n document.createElement(inTagOrNode) : inTagOrNode.cloneNode(true) ;\n dom.innerHTML = inHTML;\n if (inAttrs) {\n for (var n in inAttrs) {\n dom.setAttribute(n, inAttrs[n]);\n }\n }\n return dom;\n }\n // Make a stub for Polymer() for polyfill purposes; under the HTMLImports\ n // polyfill, scripts in the main document run before imports. That means\n / / if (1) polymer is imported and (2) Polymer() is called in the main document\n // in a script after the import, 2 occurs before 1. We correct this here\n // by specfiically patching Polymer(); this is not necessary under native\n // HTM LImports.\n var elementDeclarations = [];\n\n var polymerStub = function(name, dictionary) {\n elementDeclarations.push(arguments);\n }\n window.Polymer = polymerStub;\n\n // deliver queued delcarations\n scope.deliverDeclarations = function() {\n scope.deliverDeclarations = function() {\n throw 'Possib le attempt to load Polymer twice';\n };\n return elementDeclarations;\n } \n\n // Once DOMContent has loaded, any main document scripts that depend on\n // Polymer() should have run. Calling Polymer() now is an error until\n // pol ymer is imported.\n window.addEventListener('DOMContentLoaded', function() {\n if (window.Polymer === polymerStub) {\n window.Polymer = function() {\n console.error('You tried to use polymer without loading it first. To ' +\ n 'load polymer, <link rel=\"import\" href=\"' + \n 'component s/polymer/polymer.html\">');\n };\n }\n });\n\n // exports\n scope.cr eateDOM = createDOM;\n\n})(window.Platform);\n",
157 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n// poor man's adapter for template.content on various pla tform scenarios\nwindow.templateContent = window.templateContent || function(inT emplate) {\n return inTemplate.content;\n};", 160 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n// poor man's adapter for template.content on various pla tform scenarios\nwindow.templateContent = window.templateContent || function(inT emplate) {\n return inTemplate.content;\n};",
158 "(function(scope) {\n \n scope = scope || (window.Inspector = {});\n \n var inspector;\n\n window.sinspect = function(inNode, inProxy) {\n if (!insp ector) {\n inspector = window.open('', 'ShadowDOM Inspector', null, true);\ n inspector.document.write(inspectorHTML);\n //inspector.document.clos e();\n inspector.api = {\n shadowize: shadowize\n };\n }\n inspect(inNode || wrap(document.body), inProxy);\n };\n\n var inspectorHTML = [\n '<!DOCTYPE html>',\n '<html>',\n ' <head>',\n ' <title>Sha dowDOM Inspector</title>',\n ' <style>',\n ' body {',\n ' }',\n ' pre {',\n ' font: 9pt \"Courier New\", monospace;',\n ' line-height: 1.5em;',\n ' }',\n ' tag {',\n ' color: purple;',\n ' }',\n ' ul {',\n ' margin: 0 ;',\n ' padding: 0;',\n ' list-style: none;',\n ' }',\n ' li {',\n ' display: inline-block;',\n ' ba ckground-color: #f1f1f1;',\n ' padding: 4px 6px;',\n ' bor der-radius: 4px;',\n ' margin-right: 4px;',\n ' }',\n ' </style>',\n ' </head>',\n ' <body>',\n ' <ul id=\"crumbs\">',\n ' </ul>',\n ' <div id=\"tree\"></div>',\n ' </body>',\n '</ht ml>'\n ].join('\\n');\n \n var crumbs = [];\n\n var displayCrumbs = function () {\n // alias our document\n var d = inspector.document;\n // get cru mbbar\n var cb = d.querySelector('#crumbs');\n // clear crumbs\n cb.tex tContent = '';\n // build new crumbs\n for (var i=0, c; c=crumbs[i]; i++) {\n var a = d.createElement('a');\n a.href = '#';\n a.textContent = c.localName;\n a.idx = i;\n a.onclick = function(event) {\n var c;\n while (crumbs.length > this.idx) {\n c = crumbs.pop();\ n }\n inspect(c.shadow || c, c);\n event.preventDefault();\ n };\n cb.appendChild(d.createElement('li')).appendChild(a);\n }\n };\n\n var inspect = function(inNode, inProxy) {\n // alias our document\n var d = inspector.document;\n // reset list of drillable nodes\n drilla ble = [];\n // memoize our crumb proxy\n var proxy = inProxy || inNode;\n crumbs.push(proxy);\n // update crumbs\n displayCrumbs();\n // refle ct local tree\n d.body.querySelector('#tree').innerHTML =\n '<pre>' + output(inNode, inNode.childNodes) + '</pre>';\n };\n\n var forEach = Array.pro totype.forEach.call.bind(Array.prototype.forEach);\n\n var blacklisted = {STYLE :1, SCRIPT:1, \"#comment\": 1, TEMPLATE: 1};\n var blacklist = function(inNode) {\n return blacklisted[inNode.nodeName];\n };\n\n var output = function(in Node, inChildNodes, inIndent) {\n if (blacklist(inNode)) {\n return '';\ n }\n var indent = inIndent || '';\n if (inNode.localName || inNode.nod eType == 11) {\n var name = inNode.localName || 'shadow-root';\n //inC hildNodes = ShadowDOM.localNodes(inNode);\n var info = indent + describe(in Node);\n // if only textNodes\n // TODO(sjmiles): make correct for Sha dowDOM\n /*if (!inNode.children.length && inNode.localName !== 'content' && inNode.localName !== 'shadow') {\n info += catTextContent(inChildNodes); \n } else*/ {\n // TODO(sjmiles): native <shadow> has no reference t o its projection\n if (name == 'content' /*|| name == 'shadow'*/) {\n inChildNodes = inNode.getDistributedNodes();\n }\n info += ' <br/>';\n var ind = indent + '&nbsp;&nbsp;';\n forEach(inChildNode s, function(n) {\n info += output(n, n.childNodes, ind);\n });\n info += indent;\n }\n if (!({br:1}[name])) {\n info += '<tag>&lt;/' + name + '&gt;</tag>';\n info += '<br/>';\n }\n } el se {\n var text = inNode.textContent.trim();\n info = text ? indent + '\"' + text + '\"' + '<br/>' : '';\n }\n return info;\n };\n\n var catTe xtContent = function(inChildNodes) {\n var info = '';\n forEach(inChildNod es, function(n) {\n info += n.textContent.trim();\n });\n return info ;\n };\n\n var drillable = [];\n\n var describe = function(inNode) {\n var tag = '<tag>' + '&lt;';\n var name = inNode.localName || 'shadow-root';\n if (inNode.webkitShadowRoot || inNode.shadowRoot) {\n tag += ' <button idx =\"' + drillable.length +\n '\" onclick=\"api.shadowize.call(this)\">' + name + '</button>';\n drillable.push(inNode);\n } else {\n tag += n ame || 'shadow-root';\n }\n if (inNode.attributes) {\n forEach(inNode .attributes, function(a) {\n tag += ' ' + a.name + (a.value ? '=\"' + a.v alue + '\"' : '');\n });\n }\n tag += '&gt;'+ '</tag>';\n return t ag;\n };\n\n // remote api\n\n shadowize = function() {\n var idx = Number (this.attributes.idx.value);\n //alert(idx);\n var node = drillable[idx];\ n if (node) {\n inspect(node.webkitShadowRoot || node.shadowRoot, node)\ n } else {\n console.log(\"bad shadowize node\");\n console.dir(thi s);\n }\n };\n \n // export\n \n scope.output = output;\n \n})(window.I nspector);\n\n\n", 161 "(function(scope) {\n \n scope = scope || (window.Inspector = {});\n \n var inspector;\n\n window.sinspect = function(inNode, inProxy) {\n if (!insp ector) {\n inspector = window.open('', 'ShadowDOM Inspector', null, true);\ n inspector.document.write(inspectorHTML);\n //inspector.document.clos e();\n inspector.api = {\n shadowize: shadowize\n };\n }\n inspect(inNode || wrap(document.body), inProxy);\n };\n\n var inspectorHTML = [\n '<!DOCTYPE html>',\n '<html>',\n ' <head>',\n ' <title>Sha dowDOM Inspector</title>',\n ' <style>',\n ' body {',\n ' }',\n ' pre {',\n ' font: 9pt \"Courier New\", monospace;',\n ' line-height: 1.5em;',\n ' }',\n ' tag {',\n ' color: purple;',\n ' }',\n ' ul {',\n ' margin: 0 ;',\n ' padding: 0;',\n ' list-style: none;',\n ' }',\n ' li {',\n ' display: inline-block;',\n ' ba ckground-color: #f1f1f1;',\n ' padding: 4px 6px;',\n ' bor der-radius: 4px;',\n ' margin-right: 4px;',\n ' }',\n ' </style>',\n ' </head>',\n ' <body>',\n ' <ul id=\"crumbs\">',\n ' </ul>',\n ' <div id=\"tree\"></div>',\n ' </body>',\n '</ht ml>'\n ].join('\\n');\n \n var crumbs = [];\n\n var displayCrumbs = function () {\n // alias our document\n var d = inspector.document;\n // get cru mbbar\n var cb = d.querySelector('#crumbs');\n // clear crumbs\n cb.tex tContent = '';\n // build new crumbs\n for (var i=0, c; c=crumbs[i]; i++) {\n var a = d.createElement('a');\n a.href = '#';\n a.textContent = c.localName;\n a.idx = i;\n a.onclick = function(event) {\n var c;\n while (crumbs.length > this.idx) {\n c = crumbs.pop();\ n }\n inspect(c.shadow || c, c);\n event.preventDefault();\ n };\n cb.appendChild(d.createElement('li')).appendChild(a);\n }\n };\n\n var inspect = function(inNode, inProxy) {\n // alias our document\n var d = inspector.document;\n // reset list of drillable nodes\n drilla ble = [];\n // memoize our crumb proxy\n var proxy = inProxy || inNode;\n crumbs.push(proxy);\n // update crumbs\n displayCrumbs();\n // refle ct local tree\n d.body.querySelector('#tree').innerHTML =\n '<pre>' + output(inNode, inNode.childNodes) + '</pre>';\n };\n\n var forEach = Array.pro totype.forEach.call.bind(Array.prototype.forEach);\n\n var blacklisted = {STYLE :1, SCRIPT:1, \"#comment\": 1, TEMPLATE: 1};\n var blacklist = function(inNode) {\n return blacklisted[inNode.nodeName];\n };\n\n var output = function(in Node, inChildNodes, inIndent) {\n if (blacklist(inNode)) {\n return '';\ n }\n var indent = inIndent || '';\n if (inNode.localName || inNode.nod eType == 11) {\n var name = inNode.localName || 'shadow-root';\n //inC hildNodes = ShadowDOM.localNodes(inNode);\n var info = indent + describe(in Node);\n // if only textNodes\n // TODO(sjmiles): make correct for Sha dowDOM\n /*if (!inNode.children.length && inNode.localName !== 'content' && inNode.localName !== 'shadow') {\n info += catTextContent(inChildNodes); \n } else*/ {\n // TODO(sjmiles): native <shadow> has no reference t o its projection\n if (name == 'content' /*|| name == 'shadow'*/) {\n inChildNodes = inNode.getDistributedNodes();\n }\n info += ' <br/>';\n var ind = indent + '&nbsp;&nbsp;';\n forEach(inChildNode s, function(n) {\n info += output(n, n.childNodes, ind);\n });\n info += indent;\n }\n if (!({br:1}[name])) {\n info += '<tag>&lt;/' + name + '&gt;</tag>';\n info += '<br/>';\n }\n } el se {\n var text = inNode.textContent.trim();\n info = text ? indent + '\"' + text + '\"' + '<br/>' : '';\n }\n return info;\n };\n\n var catTe xtContent = function(inChildNodes) {\n var info = '';\n forEach(inChildNod es, function(n) {\n info += n.textContent.trim();\n });\n return info ;\n };\n\n var drillable = [];\n\n var describe = function(inNode) {\n var tag = '<tag>' + '&lt;';\n var name = inNode.localName || 'shadow-root';\n if (inNode.webkitShadowRoot || inNode.shadowRoot) {\n tag += ' <button idx =\"' + drillable.length +\n '\" onclick=\"api.shadowize.call(this)\">' + name + '</button>';\n drillable.push(inNode);\n } else {\n tag += n ame || 'shadow-root';\n }\n if (inNode.attributes) {\n forEach(inNode .attributes, function(a) {\n tag += ' ' + a.name + (a.value ? '=\"' + a.v alue + '\"' : '');\n });\n }\n tag += '&gt;'+ '</tag>';\n return t ag;\n };\n\n // remote api\n\n shadowize = function() {\n var idx = Number (this.attributes.idx.value);\n //alert(idx);\n var node = drillable[idx];\ n if (node) {\n inspect(node.webkitShadowRoot || node.shadowRoot, node)\ n } else {\n console.log(\"bad shadowize node\");\n console.dir(thi s);\n }\n };\n \n // export\n \n scope.output = output;\n \n})(window.I nspector);\n\n\n",
159 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\n // TODO(sorvell): It's desireable t o provide a default stylesheet \n // that's convenient for styling unresolved e lements, but\n // it's cumbersome to have to include this manually in every pag e.\n // It would make sense to put inside some HTMLImport but \n // the HTMLIm ports polyfill does not allow loading of stylesheets \n // that block rendering . Therefore this injection is tolerated here.\n\n var style = document.createEl ement('style');\n style.textContent = ''\n + 'body {'\n + 'transition : opacity ease-in 0.2s;' \n + ' } \\n'\n + 'body[unresolved] {'\n + 'opacity: 0; display: block; overflow: hidden;' \n + ' } \\n'\n ;\n var head = document.querySelector('head');\n head.insertBefore(style, head.fi rstChild);\n\n})(Platform);\n", 162 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\n // TODO(sorvell): It's desireable t o provide a default stylesheet \n // that's convenient for styling unresolved e lements, but\n // it's cumbersome to have to include this manually in every pag e.\n // It would make sense to put inside some HTMLImport but \n // the HTMLIm ports polyfill does not allow loading of stylesheets \n // that block rendering . Therefore this injection is tolerated here.\n\n var style = document.createEl ement('style');\n style.textContent = ''\n + 'body {'\n + 'transition : opacity ease-in 0.2s;' \n + ' } \\n'\n + 'body[unresolved] {'\n + 'opacity: 0; display: block; overflow: hidden;' \n + ' } \\n'\n ;\n var head = document.querySelector('head');\n head.insertBefore(style, head.fi rstChild);\n\n})(Platform);\n",
160 "(function(scope) {\n\n function withDependencies(task, depends) {\n dep ends = depends || [];\n if (!depends.map) {\n depends = [depends];\n }\n return task.apply(this, depends.map(marshal));\n }\n\n function module( name, dependsOrFactory, moduleFactory) {\n var module;\n switch (arguments .length) {\n case 0:\n return;\n case 1:\n module = null ;\n break;\n case 2:\n module = dependsOrFactory.apply(this); \n break;\n default:\n module = withDependencies(moduleFactor y, dependsOrFactory);\n break;\n }\n modules[name] = module;\n };\ n\n function marshal(name) {\n return modules[name];\n }\n\n var modules = {};\n\n function using(depends, task) {\n HTMLImports.whenImportsReady(func tion() {\n withDependencies(task, depends);\n });\n };\n\n // exports\ n\n scope.marshal = marshal;\n scope.module = module;\n scope.using = using;\ n\n})(window);", 163 "(function(scope) {\n\n function withDependencies(task, depends) {\n dep ends = depends || [];\n if (!depends.map) {\n depends = [depends];\n }\n return task.apply(this, depends.map(marshal));\n }\n\n function module( name, dependsOrFactory, moduleFactory) {\n var module;\n switch (arguments .length) {\n case 0:\n return;\n case 1:\n module = null ;\n break;\n case 2:\n module = dependsOrFactory.apply(this); \n break;\n default:\n module = withDependencies(moduleFactor y, dependsOrFactory);\n break;\n }\n modules[name] = module;\n };\ n\n function marshal(name) {\n return modules[name];\n }\n\n var modules = {};\n\n function using(depends, task) {\n HTMLImports.whenImportsReady(func tion() {\n withDependencies(task, depends);\n });\n };\n\n // exports\ n\n scope.marshal = marshal;\n scope.module = module;\n scope.using = using;\ n\n})(window);",
161 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\nvar iterations = 0;\nvar callbacks = [];\nvar twiddle = document.createTextNode('');\n\nfunction endOfMicrotask(callb ack) {\n twiddle.textContent = iterations++;\n callbacks.push(callback);\n}\n\ nfunction atEndOfMicrotask() {\n while (callbacks.length) {\n callbacks.shif t()();\n }\n}\n\nnew (window.MutationObserver || JsMutationObserver)(atEndOfMic rotask)\n .observe(twiddle, {characterData: true})\n ;\n\n// exports\n\nscope. endOfMicrotask = endOfMicrotask;\n\n})(Platform);\n\n", 164 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\nvar iterations = 0;\nvar callbacks = [];\nvar twiddle = document.createTextNode('');\n\nfunction endOfMicrotask(callb ack) {\n twiddle.textContent = iterations++;\n callbacks.push(callback);\n}\n\ nfunction atEndOfMicrotask() {\n while (callbacks.length) {\n callbacks.shif t()();\n }\n}\n\nnew (window.MutationObserver || JsMutationObserver)(atEndOfMic rotask)\n .observe(twiddle, {characterData: true})\n ;\n\n// exports\n\nscope. endOfMicrotask = endOfMicrotask;\n\n})(Platform);\n\n",
162 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar urlResolver = {\n resolveDom: function(root, url) {\n url = url || root.ownerDocument.baseURI;\n this.re solveAttributes(root, url);\n this.resolveStyles(root, url);\n // handle t emplate.content\n var templates = root.querySelectorAll('template');\n if (templates) {\n for (var i = 0, l = templates.length, t; (i < l) && (t = te mplates[i]); i++) {\n if (t.content) {\n this.resolveDom(t.conte nt, url);\n }\n }\n }\n },\n resolveTemplate: function(template ) {\n this.resolveDom(template.content, template.ownerDocument.baseURI);\n } ,\n resolveStyles: function(root, url) {\n var styles = root.querySelectorAl l('style');\n if (styles) {\n for (var i = 0, l = styles.length, s; (i < l) && (s = styles[i]); i++) {\n this.resolveStyle(s, url);\n }\n }\n },\n resolveStyle: function(style, url) {\n url = url || style.ownerDo cument.baseURI;\n style.textContent = this.resolveCssText(style.textContent, url);\n },\n resolveCssText: function(cssText, baseUrl) {\n cssText = repla ceUrlsInCssText(cssText, baseUrl, CSS_URL_REGEXP);\n return replaceUrlsInCssT ext(cssText, baseUrl, CSS_IMPORT_REGEXP);\n },\n resolveAttributes: function(r oot, url) {\n if (root.hasAttributes && root.hasAttributes()) {\n this.r esolveElementAttributes(root, url);\n }\n // search for attributes that ho st urls\n var nodes = root && root.querySelectorAll(URL_ATTRS_SELECTOR);\n if (nodes) {\n for (var i = 0, l = nodes.length, n; (i < l) && (n = nodes[ i]); i++) {\n this.resolveElementAttributes(n, url);\n }\n }\n } ,\n resolveElementAttributes: function(node, url) {\n url = url || node.owne rDocument.baseURI;\n URL_ATTRS.forEach(function(v) {\n var attr = node.a ttributes[v];\n if (attr && attr.value &&\n (attr.value.search(URL_ TEMPLATE_SEARCH) < 0)) {\n var urlPath = resolveRelativeUrl(url, attr.val ue);\n attr.value = urlPath;\n }\n });\n }\n};\n\nvar CSS_URL_RE GEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\ ())([^;]*)(;)/g;\nvar URL_ATTRS = ['href', 'src', 'action'];\nvar URL_ATTRS_SELE CTOR = '[' + URL_ATTRS.join('],[') + ']';\nvar URL_TEMPLATE_SEARCH = '{{.*}}';\n \nfunction replaceUrlsInCssText(cssText, baseUrl, regexp) {\n return cssText.re place(regexp, function(m, pre, url, post) {\n var urlPath = url.replace(/[\"' ]/g, '');\n urlPath = resolveRelativeUrl(baseUrl, urlPath);\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n}\n\nfunction resolveRelativeUrl(baseUr l, url) {\n var u = new URL(url, baseUrl);\n return makeDocumentRelPath(u.href );\n}\n\nfunction makeDocumentRelPath(url) {\n var root = document.baseURI;\n var u = new URL(url, root);\n if (u.host === root.host && u.port === root.port &&\n u.protocol === root.protocol) {\n return makeRelPath(root.pathname, u.pathname);\n } else {\n return url;\n }\n}\n\n// make a relative path fr om source to target\nfunction makeRelPath(source, target) {\n var s = source.sp lit('/');\n var t = target.split('/');\n while (s.length && s[0] === t[0]){\n s.shift();\n t.shift();\n }\n for (var i = 0, l = s.length - 1; i < l; i ++) {\n t.unshift('..');\n }\n return t.join('/');\n}\n\n// exports\nscope. urlResolver = urlResolver;\n\n})(Platform);\n", 165 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar urlResolver = {\n resolveDom: function(root, url) {\n url = url || root.ownerDocument.baseURI;\n this.re solveAttributes(root, url);\n this.resolveStyles(root, url);\n // handle t emplate.content\n var templates = root.querySelectorAll('template');\n if (templates) {\n for (var i = 0, l = templates.length, t; (i < l) && (t = te mplates[i]); i++) {\n if (t.content) {\n this.resolveDom(t.conte nt, url);\n }\n }\n }\n },\n resolveTemplate: function(template ) {\n this.resolveDom(template.content, template.ownerDocument.baseURI);\n } ,\n resolveStyles: function(root, url) {\n var styles = root.querySelectorAl l('style');\n if (styles) {\n for (var i = 0, l = styles.length, s; (i < l) && (s = styles[i]); i++) {\n this.resolveStyle(s, url);\n }\n }\n },\n resolveStyle: function(style, url) {\n url = url || style.ownerDo cument.baseURI;\n style.textContent = this.resolveCssText(style.textContent, url);\n },\n resolveCssText: function(cssText, baseUrl) {\n cssText = repla ceUrlsInCssText(cssText, baseUrl, CSS_URL_REGEXP);\n return replaceUrlsInCssT ext(cssText, baseUrl, CSS_IMPORT_REGEXP);\n },\n resolveAttributes: function(r oot, url) {\n if (root.hasAttributes && root.hasAttributes()) {\n this.r esolveElementAttributes(root, url);\n }\n // search for attributes that ho st urls\n var nodes = root && root.querySelectorAll(URL_ATTRS_SELECTOR);\n if (nodes) {\n for (var i = 0, l = nodes.length, n; (i < l) && (n = nodes[ i]); i++) {\n this.resolveElementAttributes(n, url);\n }\n }\n } ,\n resolveElementAttributes: function(node, url) {\n url = url || node.owne rDocument.baseURI;\n URL_ATTRS.forEach(function(v) {\n var attr = node.a ttributes[v];\n if (attr && attr.value &&\n (attr.value.search(URL_ TEMPLATE_SEARCH) < 0)) {\n var urlPath = resolveRelativeUrl(url, attr.val ue);\n attr.value = urlPath;\n }\n });\n }\n};\n\nvar CSS_URL_RE GEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\ ())([^;]*)(;)/g;\nvar URL_ATTRS = ['href', 'src', 'action'];\nvar URL_ATTRS_SELE CTOR = '[' + URL_ATTRS.join('],[') + ']';\nvar URL_TEMPLATE_SEARCH = '{{.*}}';\n \nfunction replaceUrlsInCssText(cssText, baseUrl, regexp) {\n return cssText.re place(regexp, function(m, pre, url, post) {\n var urlPath = url.replace(/[\"' ]/g, '');\n urlPath = resolveRelativeUrl(baseUrl, urlPath);\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n}\n\nfunction resolveRelativeUrl(baseUr l, url) {\n var u = new URL(url, baseUrl);\n return makeDocumentRelPath(u.href );\n}\n\nfunction makeDocumentRelPath(url) {\n var root = document.baseURI;\n var u = new URL(url, root);\n if (u.host === root.host && u.port === root.port &&\n u.protocol === root.protocol) {\n return makeRelPath(root.pathname, u.pathname);\n } else {\n return url;\n }\n}\n\n// make a relative path fr om source to target\nfunction makeRelPath(source, target) {\n var s = source.sp lit('/');\n var t = target.split('/');\n while (s.length && s[0] === t[0]){\n s.shift();\n t.shift();\n }\n for (var i = 0, l = s.length - 1; i < l; i ++) {\n t.unshift('..');\n }\n return t.join('/');\n}\n\n// exports\nscope. urlResolver = urlResolver;\n\n})(Platform);\n",
163 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(global) {\n\n var registrationsTable = new We akMap();\n\n // We use setImmediate or postMessage for our future callback.\n var setImmediate = window.msSetImmediate;\n\n // Use post message to emulate se tImmediate.\n if (!setImmediate) {\n var setImmediateQueue = [];\n var se ntinel = String(Math.random());\n window.addEventListener('message', function (e) {\n if (e.data === sentinel) {\n var queue = setImmediateQueue;\ n setImmediateQueue = [];\n queue.forEach(function(func) {\n func();\n });\n }\n });\n setImmediate = function(func) {\ n setImmediateQueue.push(func);\n window.postMessage(sentinel, '*');\n };\n }\n\n // This is used to ensure that we never schedule 2 callas to se tImmediate\n var isScheduled = false;\n\n // Keep track of observers that need s to be notified next time.\n var scheduledObservers = [];\n\n /**\n * Sched ules |dispatchCallback| to be called in the future.\n * @param {MutationObserv er} observer\n */\n function scheduleCallback(observer) {\n scheduledObser vers.push(observer);\n if (!isScheduled) {\n isScheduled = true;\n setImmediate(dispatchCallbacks);\n }\n }\n\n function wrapIfNeeded(node) {\ n return window.ShadowDOMPolyfill &&\n window.ShadowDOMPolyfill.wrapIf Needed(node) ||\n node;\n }\n\n function dispatchCallbacks() {\n // http://dom.spec.whatwg.org/#mutation-observers\n\n isScheduled = false; // Us ed to allow a new setImmediate call above.\n\n var observers = scheduledObser vers;\n scheduledObservers = [];\n // Sort observers based on their creati on UID (incremental).\n observers.sort(function(o1, o2) {\n return o1.ui d_ - o2.uid_;\n });\n\n var anyNonEmpty = false;\n observers.forEach(fu nction(observer) {\n\n // 2.1, 2.2\n var queue = observer.takeRecords( );\n // 2.3. Remove all transient registered observers whose observer is mo .\n removeTransientObserversFor(observer);\n\n // 2.4\n if (queue .length) {\n observer.callback_(queue, observer);\n anyNonEmpty = true;\n }\n });\n\n // 3.\n if (anyNonEmpty)\n dispatchCallba cks();\n }\n\n function removeTransientObserversFor(observer) {\n observer. nodes_.forEach(function(node) {\n var registrations = registrationsTable.ge t(node);\n if (!registrations)\n return;\n registrations.forEac h(function(registration) {\n if (registration.observer === observer)\n registration.removeTransientObservers();\n });\n });\n }\n\n /* *\n * This function is used for the \"For each registered observer observer (w ith\n * observer's options as options) in target's list of registered observer s,\n * run these substeps:\" and the \"For each ancestor ancestor of target, a nd for\n * each registered observer observer (with options options) in ancesto r's list\n * of registered observers, run these substeps:\" part of the algori thms. The\n * |options.subtree| is checked to ensure that the callback is call ed\n * correctly.\n *\n * @param {Node} target\n * @param {function(Muta tionObserverInit):MutationRecord} callback\n */\n function forEachAncestorAnd ObserverEnqueueRecord(target, callback) {\n for (var node = target; node; nod e = node.parentNode) {\n var registrations = registrationsTable.get(node);\ n\n if (registrations) {\n for (var j = 0; j < registrations.length; j++) {\n var registration = registrations[j];\n var options = registration.options;\n\n // Only target ignores subtree.\n i f (node !== target && !options.subtree)\n continue;\n\n var record = callback(options);\n if (record)\n registration.enq ueue(record);\n }\n }\n }\n }\n\n var uidCounter = 0;\n\n /**\ n * The class that maps to the DOM MutationObserver interface.\n * @param {F unction} callback.\n * @constructor\n */\n function JsMutationObserver(call back) {\n this.callback_ = callback;\n this.nodes_ = [];\n this.records _ = [];\n this.uid_ = ++uidCounter;\n }\n\n JsMutationObserver.prototype = {\n observe: function(target, options) {\n target = wrapIfNeeded(target) ;\n\n // 1.1\n if (!options.childList && !options.attributes && !optio ns.characterData ||\n\n // 1.2\n options.attributeOldValue && !options.attributes ||\n\n // 1.3\n options.attributeFilter && options.attributeFilter.length &&\n !options.attributes ||\n\n // 1.4\n options.characterDataOldValue && !options.characterData) {\n\n throw new SyntaxError();\n }\n\n var registrations = reg istrationsTable.get(target);\n if (!registrations)\n registrationsTa ble.set(target, registrations = []);\n\n // 2\n // If target's list of registered observers already includes a registered\n // observer associate d with the context object, replace that registered\n // observer's options with options.\n var registration;\n for (var i = 0; i < registrations. length; i++) {\n if (registrations[i].observer === this) {\n reg istration = registrations[i];\n registration.removeListeners();\n registration.options = options;\n break;\n }\n }\n\n // 3.\n // Otherwise, add a new registered observer to target's list of registered\n // observers with the context object as the observer and optio ns as the\n // options, and add target to context object's list of nodes on which it\n // is registered.\n if (!registration) {\n registra tion = new Registration(this, target, options);\n registrations.push(regi stration);\n this.nodes_.push(target);\n }\n\n registration.add Listeners();\n },\n\n disconnect: function() {\n this.nodes_.forEach( function(node) {\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n var registratio n = registrations[i];\n if (registration.observer === this) {\n registration.removeListeners();\n registrations.splice(i, 1);\n // Each node can only have one registered observer associated with\n // this observer.\n break;\n }\n }\n } , this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n var copyOfRecords = this.records_;\n this.records_ = [];\n return copyOfRecords;\n }\n };\n\n /**\n * @param {string} type\n * @param {No de} target\n * @constructor\n */\n function MutationRecord(type, target) {\ n this.type = type;\n this.target = target;\n this.addedNodes = [];\n this.removedNodes = [];\n this.previousSibling = null;\n this.nextSiblin g = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n function copyMutationRecord(original) {\n var record = new MutationRecord(original.type, original.target);\n record.ad dedNodes = original.addedNodes.slice();\n record.removedNodes = original.remo vedNodes.slice();\n record.previousSibling = original.previousSibling;\n r ecord.nextSibling = original.nextSibling;\n record.attributeName = original.a ttributeName;\n record.attributeNamespace = original.attributeNamespace;\n record.oldValue = original.oldValue;\n return record;\n };\n\n // We keep track of the two (possibly one) records used in a single mutation.\n var curren tRecord, recordWithOldValue;\n\n /**\n * Creates a record without |oldValue| and caches it as |currentRecord| for\n * later use.\n * @param {string} oldV alue\n * @return {MutationRecord}\n */\n function getRecord(type, target) { \n return currentRecord = new MutationRecord(type, target);\n }\n\n /**\n * Gets or creates a record with |oldValue| based in the |currentRecord|\n * @ param {string} oldValue\n * @return {MutationRecord}\n */\n function getRec ordWithOldValue(oldValue) {\n if (recordWithOldValue)\n return recordWit hOldValue;\n recordWithOldValue = copyMutationRecord(currentRecord);\n rec ordWithOldValue.oldValue = oldValue;\n return recordWithOldValue;\n }\n\n f unction clearRecords() {\n currentRecord = recordWithOldValue = undefined;\n }\n\n /**\n * @param {MutationRecord} record\n * @return {boolean} Whether the record represents a record from the current\n * mutation event.\n */\n function recordRepresentsCurrentMutation(record) {\n return record === recor dWithOldValue || record === currentRecord;\n }\n\n /**\n * Selects which rec ord, if any, to replace the last record in the queue.\n * This returns |null| if no record should be replaced.\n *\n * @param {MutationRecord} lastRecord\ n * @param {MutationRecord} newRecord\n * @param {MutationRecord}\n */\n function selectRecord(lastRecord, newRecord) {\n if (lastRecord === newRecord )\n return lastRecord;\n\n // Check if the the record we are adding repr esents the same record. If\n // so, we keep the one with the oldValue in it.\ n if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord))\n return recordWithOldValue;\n\n return null;\n }\n\n /**\n * Class used to represent a registered observer.\n * @param {MutationObserver} observer\n * @param {Node} target\n * @param {MutationObserverInit} options\n * @cons tructor\n */\n function Registration(observer, target, options) {\n this.o bserver = observer;\n this.target = target;\n this.options = options;\n this.transientObservedNodes = [];\n }\n\n Registration.prototype = {\n enq ueue: function(record) {\n var records = this.observer.records_;\n var length = records.length;\n\n // There are cases where we replace the last record with the new record.\n // For example if the record represents the s ame mutation we need to use\n // the one with the oldValue. If we get same record (this can happen as we\n // walk up the tree) we ignore the new reco rd.\n if (records.length > 0) {\n var lastRecord = records[length - 1];\n var recordToReplaceLast = selectRecord(lastRecord, record);\n if (recordToReplaceLast) {\n records[length - 1] = recordToReplaceLas t;\n return;\n }\n } else {\n scheduleCallback(this. observer);\n }\n\n records[length] = record;\n },\n\n addListene rs: function() {\n this.addListeners_(this.target);\n },\n\n addListe ners_: function(node) {\n var options = this.options;\n if (options.at tributes)\n node.addEventListener('DOMAttrModified', this, true);\n\n if (options.characterData)\n node.addEventListener('DOMCharacterDataMod ified', this, true);\n\n if (options.childList)\n node.addEventListe ner('DOMNodeInserted', this, true);\n\n if (options.childList || options.su btree)\n node.addEventListener('DOMNodeRemoved', this, true);\n },\n\n removeListeners: function() {\n this.removeListeners_(this.target);\n },\n\n removeListeners_: function(node) {\n var options = this.options ;\n if (options.attributes)\n node.removeEventListener('DOMAttrModif ied', this, true);\n\n if (options.characterData)\n node.removeEvent Listener('DOMCharacterDataModified', this, true);\n\n if (options.childList )\n node.removeEventListener('DOMNodeInserted', this, true);\n\n if (options.childList || options.subtree)\n node.removeEventListener('DOMNod eRemoved', this, true);\n },\n\n /**\n * Adds a transient observer on node. The transient observer gets removed\n * next time we deliver the chang e records.\n * @param {Node} node\n */\n addTransientObserver: functi on(node) {\n // Don't add transient observers on the target itself. We alre ady have all\n // the required listeners set up on the target.\n if (n ode === this.target)\n return;\n\n this.addListeners_(node);\n this.transientObservedNodes.push(node);\n var registrations = registrations Table.get(node);\n if (!registrations)\n registrationsTable.set(node , registrations = []);\n\n // We know that registrations does not contain t his because we already\n // checked if node === this.target.\n registr ations.push(this);\n },\n\n removeTransientObservers: function() {\n var transientObservedNodes = this.transientObservedNodes;\n this.transientO bservedNodes = [];\n\n transientObservedNodes.forEach(function(node) {\n // Transient observers are never added to the target.\n this.removeL isteners_(node);\n\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n if (registrat ions[i] === this) {\n registrations.splice(i, 1);\n // Eac h node can only have one registered observer associated with\n // thi s observer.\n break;\n }\n }\n }, this);\n }, \n\n handleEvent: function(e) {\n // Stop propagation since we are manag ing the propagation manually.\n // This means that other mutation events on the page will not work\n // correctly but that is by design.\n e.stop ImmediatePropagation();\n\n switch (e.type) {\n case 'DOMAttrModifie d':\n // http://dom.spec.whatwg.org/#concept-mo-queue-attributes\n\n var name = e.attrName;\n var namespace = e.relatedNode.namespace URI;\n var target = e.target;\n\n // 1.\n var record = new getRecord('attributes', target);\n record.attributeName = name;\n record.attributeNamespace = namespace;\n\n // 2.\n v ar oldValue =\n e.attrChange === MutationEvent.ADDITION ? null : e. prevValue;\n\n forEachAncestorAndObserverEnqueueRecord(target, function (options) {\n // 3.1, 4.2\n if (!options.attributes)\n return;\n\n // 3.2, 4.3\n if (options.attributeF ilter && options.attributeFilter.length &&\n options.attributeFil ter.indexOf(name) === -1 &&\n options.attributeFilter.indexOf(nam espace) === -1) {\n return;\n }\n // 3.3, 4.4 \n if (options.attributeOldValue)\n return getRecordWith OldValue(oldValue);\n\n // 3.4, 4.5\n return record;\n });\n\n break;\n\n case 'DOMCharacterDataModified':\n // http://dom.spec.whatwg.org/#concept-mo-queue-characterdata\n va r target = e.target;\n\n // 1.\n var record = getRecord('chara cterData', target);\n\n // 2.\n var oldValue = e.prevValue;\n\ n\n forEachAncestorAndObserverEnqueueRecord(target, function(options) { \n // 3.1, 4.2\n if (!options.characterData)\n return;\n\n // 3.2, 4.3\n if (options.characterDataOldVa lue)\n return getRecordWithOldValue(oldValue);\n\n // 3. 3, 4.4\n return record;\n });\n\n break;\n\n case 'DOMNodeRemoved':\n this.addTransientObserver(e.target);\n // Fall through.\n case 'DOMNodeInserted':\n // http://dom.sp ec.whatwg.org/#concept-mo-queue-childlist\n var target = e.relatedNode; \n var changedNode = e.target;\n var addedNodes, removedNodes; \n if (e.type === 'DOMNodeInserted') {\n addedNodes = [chang edNode];\n removedNodes = [];\n } else {\n\n adde dNodes = [];\n removedNodes = [changedNode];\n }\n var previousSibling = changedNode.previousSibling;\n var nextSibling = changedNode.nextSibling;\n\n // 1.\n var record = getRecord('c hildList', target);\n record.addedNodes = addedNodes;\n record .removedNodes = removedNodes;\n record.previousSibling = previousSiblin g;\n record.nextSibling = nextSibling;\n\n forEachAncestorAndO bserverEnqueueRecord(target, function(options) {\n // 2.1, 3.2\n if (!options.childList)\n return;\n\n // 2.2, 3.3 \n return record;\n });\n\n }\n\n clearRecords();\ n }\n };\n\n global.JsMutationObserver = JsMutationObserver;\n\n if (!glob al.MutationObserver)\n global.MutationObserver = JsMutationObserver;\n\n\n})( this);\n", 166 "/*\n * Copyright 2012 The Polymer Authors. All rights reserved.\n * Use of this source code is goverened by a BSD-style\n * license that can be found in th e LICENSE file.\n */\n\n(function(global) {\n\n var registrationsTable = new We akMap();\n\n // We use setImmediate or postMessage for our future callback.\n var setImmediate = window.msSetImmediate;\n\n // Use post message to emulate se tImmediate.\n if (!setImmediate) {\n var setImmediateQueue = [];\n var se ntinel = String(Math.random());\n window.addEventListener('message', function (e) {\n if (e.data === sentinel) {\n var queue = setImmediateQueue;\ n setImmediateQueue = [];\n queue.forEach(function(func) {\n func();\n });\n }\n });\n setImmediate = function(func) {\ n setImmediateQueue.push(func);\n window.postMessage(sentinel, '*');\n };\n }\n\n // This is used to ensure that we never schedule 2 callas to se tImmediate\n var isScheduled = false;\n\n // Keep track of observers that need s to be notified next time.\n var scheduledObservers = [];\n\n /**\n * Sched ules |dispatchCallback| to be called in the future.\n * @param {MutationObserv er} observer\n */\n function scheduleCallback(observer) {\n scheduledObser vers.push(observer);\n if (!isScheduled) {\n isScheduled = true;\n setImmediate(dispatchCallbacks);\n }\n }\n\n function wrapIfNeeded(node) {\ n return window.ShadowDOMPolyfill &&\n window.ShadowDOMPolyfill.wrapIf Needed(node) ||\n node;\n }\n\n function dispatchCallbacks() {\n // http://dom.spec.whatwg.org/#mutation-observers\n\n isScheduled = false; // Us ed to allow a new setImmediate call above.\n\n var observers = scheduledObser vers;\n scheduledObservers = [];\n // Sort observers based on their creati on UID (incremental).\n observers.sort(function(o1, o2) {\n return o1.ui d_ - o2.uid_;\n });\n\n var anyNonEmpty = false;\n observers.forEach(fu nction(observer) {\n\n // 2.1, 2.2\n var queue = observer.takeRecords( );\n // 2.3. Remove all transient registered observers whose observer is mo .\n removeTransientObserversFor(observer);\n\n // 2.4\n if (queue .length) {\n observer.callback_(queue, observer);\n anyNonEmpty = true;\n }\n });\n\n // 3.\n if (anyNonEmpty)\n dispatchCallba cks();\n }\n\n function removeTransientObserversFor(observer) {\n observer. nodes_.forEach(function(node) {\n var registrations = registrationsTable.ge t(node);\n if (!registrations)\n return;\n registrations.forEac h(function(registration) {\n if (registration.observer === observer)\n registration.removeTransientObservers();\n });\n });\n }\n\n /* *\n * This function is used for the \"For each registered observer observer (w ith\n * observer's options as options) in target's list of registered observer s,\n * run these substeps:\" and the \"For each ancestor ancestor of target, a nd for\n * each registered observer observer (with options options) in ancesto r's list\n * of registered observers, run these substeps:\" part of the algori thms. The\n * |options.subtree| is checked to ensure that the callback is call ed\n * correctly.\n *\n * @param {Node} target\n * @param {function(Muta tionObserverInit):MutationRecord} callback\n */\n function forEachAncestorAnd ObserverEnqueueRecord(target, callback) {\n for (var node = target; node; nod e = node.parentNode) {\n var registrations = registrationsTable.get(node);\ n\n if (registrations) {\n for (var j = 0; j < registrations.length; j++) {\n var registration = registrations[j];\n var options = registration.options;\n\n // Only target ignores subtree.\n i f (node !== target && !options.subtree)\n continue;\n\n var record = callback(options);\n if (record)\n registration.enq ueue(record);\n }\n }\n }\n }\n\n var uidCounter = 0;\n\n /**\ n * The class that maps to the DOM MutationObserver interface.\n * @param {F unction} callback.\n * @constructor\n */\n function JsMutationObserver(call back) {\n this.callback_ = callback;\n this.nodes_ = [];\n this.records _ = [];\n this.uid_ = ++uidCounter;\n }\n\n JsMutationObserver.prototype = {\n observe: function(target, options) {\n target = wrapIfNeeded(target) ;\n\n // 1.1\n if (!options.childList && !options.attributes && !optio ns.characterData ||\n\n // 1.2\n options.attributeOldValue && !options.attributes ||\n\n // 1.3\n options.attributeFilter && options.attributeFilter.length &&\n !options.attributes ||\n\n // 1.4\n options.characterDataOldValue && !options.characterData) {\n\n throw new SyntaxError();\n }\n\n var registrations = reg istrationsTable.get(target);\n if (!registrations)\n registrationsTa ble.set(target, registrations = []);\n\n // 2\n // If target's list of registered observers already includes a registered\n // observer associate d with the context object, replace that registered\n // observer's options with options.\n var registration;\n for (var i = 0; i < registrations. length; i++) {\n if (registrations[i].observer === this) {\n reg istration = registrations[i];\n registration.removeListeners();\n registration.options = options;\n break;\n }\n }\n\n // 3.\n // Otherwise, add a new registered observer to target's list of registered\n // observers with the context object as the observer and optio ns as the\n // options, and add target to context object's list of nodes on which it\n // is registered.\n if (!registration) {\n registra tion = new Registration(this, target, options);\n registrations.push(regi stration);\n this.nodes_.push(target);\n }\n\n registration.add Listeners();\n },\n\n disconnect: function() {\n this.nodes_.forEach( function(node) {\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n var registratio n = registrations[i];\n if (registration.observer === this) {\n registration.removeListeners();\n registrations.splice(i, 1);\n // Each node can only have one registered observer associated with\n // this observer.\n break;\n }\n }\n } , this);\n this.records_ = [];\n },\n\n takeRecords: function() {\n var copyOfRecords = this.records_;\n this.records_ = [];\n return copyOfRecords;\n }\n };\n\n /**\n * @param {string} type\n * @param {No de} target\n * @constructor\n */\n function MutationRecord(type, target) {\ n this.type = type;\n this.target = target;\n this.addedNodes = [];\n this.removedNodes = [];\n this.previousSibling = null;\n this.nextSiblin g = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n this.oldValue = null;\n }\n\n function copyMutationRecord(original) {\n var record = new MutationRecord(original.type, original.target);\n record.ad dedNodes = original.addedNodes.slice();\n record.removedNodes = original.remo vedNodes.slice();\n record.previousSibling = original.previousSibling;\n r ecord.nextSibling = original.nextSibling;\n record.attributeName = original.a ttributeName;\n record.attributeNamespace = original.attributeNamespace;\n record.oldValue = original.oldValue;\n return record;\n };\n\n // We keep track of the two (possibly one) records used in a single mutation.\n var curren tRecord, recordWithOldValue;\n\n /**\n * Creates a record without |oldValue| and caches it as |currentRecord| for\n * later use.\n * @param {string} oldV alue\n * @return {MutationRecord}\n */\n function getRecord(type, target) { \n return currentRecord = new MutationRecord(type, target);\n }\n\n /**\n * Gets or creates a record with |oldValue| based in the |currentRecord|\n * @ param {string} oldValue\n * @return {MutationRecord}\n */\n function getRec ordWithOldValue(oldValue) {\n if (recordWithOldValue)\n return recordWit hOldValue;\n recordWithOldValue = copyMutationRecord(currentRecord);\n rec ordWithOldValue.oldValue = oldValue;\n return recordWithOldValue;\n }\n\n f unction clearRecords() {\n currentRecord = recordWithOldValue = undefined;\n }\n\n /**\n * @param {MutationRecord} record\n * @return {boolean} Whether the record represents a record from the current\n * mutation event.\n */\n function recordRepresentsCurrentMutation(record) {\n return record === recor dWithOldValue || record === currentRecord;\n }\n\n /**\n * Selects which rec ord, if any, to replace the last record in the queue.\n * This returns |null| if no record should be replaced.\n *\n * @param {MutationRecord} lastRecord\ n * @param {MutationRecord} newRecord\n * @param {MutationRecord}\n */\n function selectRecord(lastRecord, newRecord) {\n if (lastRecord === newRecord )\n return lastRecord;\n\n // Check if the the record we are adding repr esents the same record. If\n // so, we keep the one with the oldValue in it.\ n if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord))\n return recordWithOldValue;\n\n return null;\n }\n\n /**\n * Class used to represent a registered observer.\n * @param {MutationObserver} observer\n * @param {Node} target\n * @param {MutationObserverInit} options\n * @cons tructor\n */\n function Registration(observer, target, options) {\n this.o bserver = observer;\n this.target = target;\n this.options = options;\n this.transientObservedNodes = [];\n }\n\n Registration.prototype = {\n enq ueue: function(record) {\n var records = this.observer.records_;\n var length = records.length;\n\n // There are cases where we replace the last record with the new record.\n // For example if the record represents the s ame mutation we need to use\n // the one with the oldValue. If we get same record (this can happen as we\n // walk up the tree) we ignore the new reco rd.\n if (records.length > 0) {\n var lastRecord = records[length - 1];\n var recordToReplaceLast = selectRecord(lastRecord, record);\n if (recordToReplaceLast) {\n records[length - 1] = recordToReplaceLas t;\n return;\n }\n } else {\n scheduleCallback(this. observer);\n }\n\n records[length] = record;\n },\n\n addListene rs: function() {\n this.addListeners_(this.target);\n },\n\n addListe ners_: function(node) {\n var options = this.options;\n if (options.at tributes)\n node.addEventListener('DOMAttrModified', this, true);\n\n if (options.characterData)\n node.addEventListener('DOMCharacterDataMod ified', this, true);\n\n if (options.childList)\n node.addEventListe ner('DOMNodeInserted', this, true);\n\n if (options.childList || options.su btree)\n node.addEventListener('DOMNodeRemoved', this, true);\n },\n\n removeListeners: function() {\n this.removeListeners_(this.target);\n },\n\n removeListeners_: function(node) {\n var options = this.options ;\n if (options.attributes)\n node.removeEventListener('DOMAttrModif ied', this, true);\n\n if (options.characterData)\n node.removeEvent Listener('DOMCharacterDataModified', this, true);\n\n if (options.childList )\n node.removeEventListener('DOMNodeInserted', this, true);\n\n if (options.childList || options.subtree)\n node.removeEventListener('DOMNod eRemoved', this, true);\n },\n\n /**\n * Adds a transient observer on node. The transient observer gets removed\n * next time we deliver the chang e records.\n * @param {Node} node\n */\n addTransientObserver: functi on(node) {\n // Don't add transient observers on the target itself. We alre ady have all\n // the required listeners set up on the target.\n if (n ode === this.target)\n return;\n\n this.addListeners_(node);\n this.transientObservedNodes.push(node);\n var registrations = registrations Table.get(node);\n if (!registrations)\n registrationsTable.set(node , registrations = []);\n\n // We know that registrations does not contain t his because we already\n // checked if node === this.target.\n registr ations.push(this);\n },\n\n removeTransientObservers: function() {\n var transientObservedNodes = this.transientObservedNodes;\n this.transientO bservedNodes = [];\n\n transientObservedNodes.forEach(function(node) {\n // Transient observers are never added to the target.\n this.removeL isteners_(node);\n\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n if (registrat ions[i] === this) {\n registrations.splice(i, 1);\n // Eac h node can only have one registered observer associated with\n // thi s observer.\n break;\n }\n }\n }, this);\n }, \n\n handleEvent: function(e) {\n // Stop propagation since we are manag ing the propagation manually.\n // This means that other mutation events on the page will not work\n // correctly but that is by design.\n e.stop ImmediatePropagation();\n\n switch (e.type) {\n case 'DOMAttrModifie d':\n // http://dom.spec.whatwg.org/#concept-mo-queue-attributes\n\n var name = e.attrName;\n var namespace = e.relatedNode.namespace URI;\n var target = e.target;\n\n // 1.\n var record = new getRecord('attributes', target);\n record.attributeName = name;\n record.attributeNamespace = namespace;\n\n // 2.\n v ar oldValue =\n e.attrChange === MutationEvent.ADDITION ? null : e. prevValue;\n\n forEachAncestorAndObserverEnqueueRecord(target, function (options) {\n // 3.1, 4.2\n if (!options.attributes)\n return;\n\n // 3.2, 4.3\n if (options.attributeF ilter && options.attributeFilter.length &&\n options.attributeFil ter.indexOf(name) === -1 &&\n options.attributeFilter.indexOf(nam espace) === -1) {\n return;\n }\n // 3.3, 4.4 \n if (options.attributeOldValue)\n return getRecordWith OldValue(oldValue);\n\n // 3.4, 4.5\n return record;\n });\n\n break;\n\n case 'DOMCharacterDataModified':\n // http://dom.spec.whatwg.org/#concept-mo-queue-characterdata\n va r target = e.target;\n\n // 1.\n var record = getRecord('chara cterData', target);\n\n // 2.\n var oldValue = e.prevValue;\n\ n\n forEachAncestorAndObserverEnqueueRecord(target, function(options) { \n // 3.1, 4.2\n if (!options.characterData)\n return;\n\n // 3.2, 4.3\n if (options.characterDataOldVa lue)\n return getRecordWithOldValue(oldValue);\n\n // 3. 3, 4.4\n return record;\n });\n\n break;\n\n case 'DOMNodeRemoved':\n this.addTransientObserver(e.target);\n // Fall through.\n case 'DOMNodeInserted':\n // http://dom.sp ec.whatwg.org/#concept-mo-queue-childlist\n var target = e.relatedNode; \n var changedNode = e.target;\n var addedNodes, removedNodes; \n if (e.type === 'DOMNodeInserted') {\n addedNodes = [chang edNode];\n removedNodes = [];\n } else {\n\n adde dNodes = [];\n removedNodes = [changedNode];\n }\n var previousSibling = changedNode.previousSibling;\n var nextSibling = changedNode.nextSibling;\n\n // 1.\n var record = getRecord('c hildList', target);\n record.addedNodes = addedNodes;\n record .removedNodes = removedNodes;\n record.previousSibling = previousSiblin g;\n record.nextSibling = nextSibling;\n\n forEachAncestorAndO bserverEnqueueRecord(target, function(options) {\n // 2.1, 3.2\n if (!options.childList)\n return;\n\n // 2.2, 3.3 \n return record;\n });\n\n }\n\n clearRecords();\ n }\n };\n\n global.JsMutationObserver = JsMutationObserver;\n\n if (!glob al.MutationObserver)\n global.MutationObserver = JsMutationObserver;\n\n\n})( this);\n",
164 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\nwindow.HTMLImports = window.HTMLImports || {flags:{}};", 167 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\nwindow.HTMLImports = window.HTMLImports || {flags:{}};",
165 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n // imports\n var path = scope.pa th;\n var xhr = scope.xhr;\n var flags = scope.flags;\n\n // TODO(sorvell): t his loader supports a dynamic list of urls\n // and an oncomplete callback that is called when the loader is done.\n // The polyfill currently does *not* need this dynamism or the onComplete\n // concept. Because of this, the loader coul d be simplified quite a bit.\n var Loader = function(onLoad, onComplete) {\n this.cache = {};\n this.onload = onLoad;\n this.oncomplete = onComplete;\ n this.inflight = 0;\n this.pending = {};\n };\n\n Loader.prototype = {\ n addNodes: function(nodes) {\n // number of transactions to complete\n this.inflight += nodes.length;\n // commence transactions\n for ( var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\n this.require( n);\n }\n // anything to do?\n this.checkDone();\n },\n add Node: function(node) {\n // number of transactions to complete\n this. inflight++;\n // commence transactions\n this.require(node);\n // anything to do?\n this.checkDone();\n },\n require: function(elt) {\ n var url = elt.src || elt.href;\n // ensure we have a standard url th at can be used\n // reliably for deduping.\n // TODO(sjmiles): ad-hoc\ n elt.__nodeUrl = url;\n // deduplication\n if (!this.dedupe(url, elt)) {\n // fetch this resource\n this.fetch(url, elt);\n } \n },\n dedupe: function(url, elt) {\n if (this.pending[url]) {\n // add to list of nodes waiting for inUrl\n this.pending[url].push(el t);\n // don't need fetch\n return true;\n }\n var resou rce;\n if (this.cache[url]) {\n this.onload(url, elt, this.cache[url ]);\n // finished this transaction\n this.tail();\n // don' t need fetch\n return true;\n }\n // first node waiting for inU rl\n this.pending[url] = [elt];\n // need fetch (not a dupe)\n re turn false;\n },\n fetch: function(url, elt) {\n flags.load && consol e.log('fetch', url, elt);\n var receiveXhr = function(err, resource) {\n this.receive(url, elt, err, resource);\n }.bind(this);\n xhr.load (url, receiveXhr);\n // TODO(sorvell): blocked on\n // https://code.go ogle.com/p/chromium/issues/detail?id=257221\n // xhr'ing for a document mak es scripts in imports runnable; otherwise\n // they are not; however, it re quires that we have doctype=html in\n // the import which is unacceptable. This is only needed on Chrome\n // to avoid the bug above.\n /*\n if (isDocumentLink(elt)) {\n xhr.loadDocument(url, receiveXhr);\n } else {\n xhr.load(url, receiveXhr);\n }\n */\n },\n rece ive: function(url, elt, err, resource) {\n this.cache[url] = resource;\n var $p = this.pending[url];\n for (var i=0, l=$p.length, p; (i<l) && (p= $p[i]); i++) {\n //if (!err) {\n this.onload(url, p, resource);\ n //}\n this.tail();\n }\n this.pending[url] = null;\n },\n tail: function() {\n --this.inflight;\n this.checkDone();\n },\n checkDone: function() {\n if (!this.inflight) {\n this.on complete();\n }\n }\n };\n\n xhr = xhr || {\n async: true,\n ok: function(request) {\n return (request.status >= 200 && request.status < 30 0)\n || (request.status === 304)\n || (request.status === 0);\ n },\n load: function(url, next, nextContext) {\n var request = new X MLHttpRequest();\n if (scope.flags.debug || scope.flags.bust) {\n ur l += '?' + Math.random();\n }\n request.open('GET', url, xhr.async);\n request.addEventListener('readystatechange', function(e) {\n if (re quest.readyState === 4) {\n next.call(nextContext, !xhr.ok(request) && request,\n request.response || request.responseText, url);\n }\n });\n request.send();\n return request;\n },\n loadDoc ument: function(url, next, nextContext) {\n this.load(url, next, nextContex t).responseType = 'document';\n }\n };\n\n // exports\n scope.xhr = xhr;\n scope.Loader = Loader;\n\n})(window.HTMLImports);\n", 168 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n // imports\n var path = scope.pa th;\n var xhr = scope.xhr;\n var flags = scope.flags;\n\n // TODO(sorvell): t his loader supports a dynamic list of urls\n // and an oncomplete callback that is called when the loader is done.\n // The polyfill currently does *not* need this dynamism or the onComplete\n // concept. Because of this, the loader coul d be simplified quite a bit.\n var Loader = function(onLoad, onComplete) {\n this.cache = {};\n this.onload = onLoad;\n this.oncomplete = onComplete;\ n this.inflight = 0;\n this.pending = {};\n };\n\n Loader.prototype = {\ n addNodes: function(nodes) {\n // number of transactions to complete\n this.inflight += nodes.length;\n // commence transactions\n for ( var i=0, l=nodes.length, n; (i<l) && (n=nodes[i]); i++) {\n this.require( n);\n }\n // anything to do?\n this.checkDone();\n },\n add Node: function(node) {\n // number of transactions to complete\n this. inflight++;\n // commence transactions\n this.require(node);\n // anything to do?\n this.checkDone();\n },\n require: function(elt) {\ n var url = elt.src || elt.href;\n // ensure we have a standard url th at can be used\n // reliably for deduping.\n // TODO(sjmiles): ad-hoc\ n elt.__nodeUrl = url;\n // deduplication\n if (!this.dedupe(url, elt)) {\n // fetch this resource\n this.fetch(url, elt);\n } \n },\n dedupe: function(url, elt) {\n if (this.pending[url]) {\n // add to list of nodes waiting for inUrl\n this.pending[url].push(el t);\n // don't need fetch\n return true;\n }\n var resou rce;\n if (this.cache[url]) {\n this.onload(url, elt, this.cache[url ]);\n // finished this transaction\n this.tail();\n // don' t need fetch\n return true;\n }\n // first node waiting for inU rl\n this.pending[url] = [elt];\n // need fetch (not a dupe)\n re turn false;\n },\n fetch: function(url, elt) {\n flags.load && consol e.log('fetch', url, elt);\n var receiveXhr = function(err, resource) {\n this.receive(url, elt, err, resource);\n }.bind(this);\n xhr.load (url, receiveXhr);\n // TODO(sorvell): blocked on\n // https://code.go ogle.com/p/chromium/issues/detail?id=257221\n // xhr'ing for a document mak es scripts in imports runnable; otherwise\n // they are not; however, it re quires that we have doctype=html in\n // the import which is unacceptable. This is only needed on Chrome\n // to avoid the bug above.\n /*\n if (isDocumentLink(elt)) {\n xhr.loadDocument(url, receiveXhr);\n } else {\n xhr.load(url, receiveXhr);\n }\n */\n },\n rece ive: function(url, elt, err, resource) {\n this.cache[url] = resource;\n var $p = this.pending[url];\n for (var i=0, l=$p.length, p; (i<l) && (p= $p[i]); i++) {\n //if (!err) {\n this.onload(url, p, resource);\ n //}\n this.tail();\n }\n this.pending[url] = null;\n },\n tail: function() {\n --this.inflight;\n this.checkDone();\n },\n checkDone: function() {\n if (!this.inflight) {\n this.on complete();\n }\n }\n };\n\n xhr = xhr || {\n async: true,\n ok: function(request) {\n return (request.status >= 200 && request.status < 30 0)\n || (request.status === 304)\n || (request.status === 0);\ n },\n load: function(url, next, nextContext) {\n var request = new X MLHttpRequest();\n if (scope.flags.debug || scope.flags.bust) {\n ur l += '?' + Math.random();\n }\n request.open('GET', url, xhr.async);\n request.addEventListener('readystatechange', function(e) {\n if (re quest.readyState === 4) {\n next.call(nextContext, !xhr.ok(request) && request,\n request.response || request.responseText, url);\n }\n });\n request.send();\n return request;\n },\n loadDoc ument: function(url, next, nextContext) {\n this.load(url, next, nextContex t).responseType = 'document';\n }\n };\n\n // exports\n scope.xhr = xhr;\n scope.Loader = Loader;\n\n})(window.HTMLImports);\n",
166 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar IMPORT_LINK_TYPE = 'import';\nv ar flags = scope.flags;\nvar isIe = /Trident/.test(navigator.userAgent);\n// TOD O(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importParser \n// highlander object to manage parsing of imports\n// parses import related el ements\n// and ensures proper parse order\n// parse order is enforced by crawlin g the tree and monitoring which elements\n// have been parsed; async parsing is also supported.\n\n// highlander object for parsing a document tree\nvar importP arser = {\n // parse selectors for main document elements\n documentSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import document elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',\n 'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'script[t ype=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',\n script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse the ne xt import in the tree\n parseNext: function() {\n var next = this.nextToPars e();\n if (next) {\n this.parse(next);\n }\n },\n parse: function(e lt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s] is already parsed', elt.localName);\n return;\n }\n var fn = this[this.m ap[elt.localName]];\n if (fn) {\n this.markParsing(elt);\n fn.call( this, elt);\n }\n },\n // only 1 element may be parsed at a time; parsing i s async so, each\n // parsing implementation must inform the system that parsin g is complete\n // via markParsingComplete.\n markParsing: function(elt) {\n flags.parse && console.log('parsing', elt);\n this.parsingElement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__importParsed = true;\n if (elt.__importElement) {\n elt.__importElement.__importParsed = true;\n }\n this.parsingElement = null;\n flags.parse && console.log('completed ', elt);\n this.parseNext();\n },\n parseImport: function(elt) {\n elt.i mport.__importParsed = true;\n // TODO(sorvell): consider if there's a better way to do this;\n // expose an imports parsing hook; this is needed, for exa mple, by the\n // CustomElements polyfill.\n if (HTMLImports.__importsPars ingHook) {\n HTMLImports.__importsParsingHook(elt);\n }\n // fire loa d event\n if (elt.__resource) {\n elt.dispatchEvent(new CustomEvent('loa d', {bubbles: false})); \n } else {\n elt.dispatchEvent(new CustomEve nt('error', {bubbles: false}));\n }\n // TODO(sorvell): workaround for Saf ari addEventListener not working\n // for elements not in the main document.\ n if (elt.__pending) {\n var fn;\n while (elt.__pending.length) {\n fn = elt.__pending.shift();\n if (fn) {\n fn({target: el t});\n }\n }\n }\n this.markParsingComplete(elt);\n },\n par seLink: function(linkElt) {\n if (nodeIsImport(linkElt)) {\n this.parseI mport(linkElt);\n } else {\n // make href absolute\n linkElt.href = linkElt.href;\n this.parseGeneric(linkElt);\n }\n },\n parseStyle: fu nction(elt) {\n // TODO(sorvell): style element load event can just not fire so clone styles\n var src = elt;\n elt = cloneStyle(elt);\n elt.__impor tElement = src;\n this.parseGeneric(elt);\n },\n parseGeneric: function(elt ) {\n this.trackElement(elt);\n document.head.appendChild(elt);\n },\n / / tracks when a loadable element has loaded\n trackElement: function(elt, callb ack) {\n var self = this;\n var done = function(e) {\n if (callback) {\n callback(e);\n }\n self.markParsingComplete(elt);\n };\n elt.addEventListener('load', done);\n elt.addEventListener('error', done) ;\n\n // NOTE: IE does not fire \"load\" event for styles that have already l oaded\n // This is in violation of the spec, so we try our hardest to work ar ound it\n if (isIe && elt.localName === 'style') {\n var fakeLoad = fals e;\n // If there's not @import in the textContent, assume it has loaded\n if (elt.textContent.indexOf('@import') == -1) {\n fakeLoad = true;\n // if we have a sheet, we have been parsed\n } else if (elt.sheet) {\n fakeLoad = true;\n var csr = elt.sheet.cssRules;\n var len = csr ? csr.length : 0;\n // search the rules for @import's\n for (var i = 0, r; (i < len) && (r = csr[i]); i++) {\n if (r.type === CSSR ule.IMPORT_RULE) {\n // if every @import has resolved, fake the load\ n fakeLoad = fakeLoad && Boolean(r.styleSheet);\n }\n }\n }\n // dispatch a fake load event and continue parsing\n if (fakeLoad) {\n elt.dispatchEvent(new CustomEvent('load', {bubbles: false} ));\n }\n }\n },\n // NOTE: execute scripts by injecting them and watc hing for the load/error\n // event. Inline scripts are handled via dataURL's be cause browsers tend to\n // provide correct parsing errors in this case. If thi s has any compatibility\n // issues, we can switch to injecting the inline scri pt with textContent.\n // Scripts with dataURL's do not appear to generate load events and therefore\n // we assume they execute synchronously.\n parseScript : function(scriptElt) {\n var script = document.createElement('script');\n script.__importElement = scriptElt;\n script.src = scriptElt.src ? scriptElt .src : \n generateScriptDataUrl(scriptElt);\n scope.currentScript = sc riptElt;\n this.trackElement(script, function(e) {\n script.parentNode.r emoveChild(script);\n scope.currentScript = null; \n });\n document. head.appendChild(script);\n },\n // determine the next element in the tree whi ch should be parsed\n nextToParse: function() {\n return !this.parsingElemen t && this.nextToParseInDoc(mainDoc);\n },\n nextToParseInDoc: function(doc, li nk) {\n var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));\n for (var i=0, l=nodes.length, p=0, n; (i<l) && (n=nodes[i]); i++) {\n if (!this.isParsed(n)) {\n if (this.hasResource(n)) {\n return nod eIsImport(n) ? this.nextToParseInDoc(n.import, n) : n;\n } else {\n return;\n }\n }\n }\n // all nodes have been parsed, ready to parse import, if any\n return link;\n },\n // return the set of parse s electors relevant for this node.\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDocument || node;\n return doc === mainDoc ? this.docume ntSelectors : this.importsSelectors;\n },\n isParsed: function(node) {\n re turn node.__importParsed;\n },\n hasResource: function(node) {\n if (nodeIs Import(node) && !node.import) {\n return false;\n }\n return true;\n }\n};\n\nfunction nodeIsImport(elt) {\n return (elt.localName === 'link') && ( elt.rel === IMPORT_LINK_TYPE);\n}\n\nfunction generateScriptDataUrl(script) {\n var scriptContent = generateScriptContent(script), b64;\n try {\n b64 = bto a(scriptContent);\n } catch(e) {\n b64 = btoa(unescape(encodeURIComponent(sc riptContent)));\n console.warn('Script contained non-latin characters that we re forced ' +\n 'to latin. Some characters may be wrong.', script);\n }\n return 'data:text/javascript;base64,' + b64;\n}\n\nfunction generateScriptConte nt(script) {\n return script.textContent + generateSourceMapHint(script);\n}\n\ n// calculate source map hint\nfunction generateSourceMapHint(script) {\n var m oniker = script.__nodeUrl;\n if (!moniker) {\n moniker = script.ownerDocumen t.baseURI;\n // there could be more than one script this url\n var tag = ' [' + Math.floor((Math.random()+1)*1000) + ']';\n // TODO(sjmiles): Polymer ha ck, should be pluggable if we need to allow \n // this sort of thing\n var matches = script.textContent.match(/Polymer\\(['\"]([^'\"]*)/);\n tag = matc hes && matches[1] || tag;\n // tag the moniker\n moniker += '/' + tag + '. js';\n }\n return '\\n//# sourceURL=' + moniker + '\\n';\n}\n\n// style/styles heet handling\n\n// clone style with proper path resolution for main document\n/ / NOTE: styles are the only elements that require direct path fixup.\nfunction c loneStyle(style) {\n var clone = style.ownerDocument.createElement('style');\n clone.textContent = style.textContent;\n path.resolveUrlsInStyle(clone);\n re turn clone;\n}\n\n// path fixup: style elements in imports must be made relative to the main \n// document. We fixup url's in url() and @import.\nvar CSS_URL_RE GEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\ ())([^;]*)(;)/g;\n\nvar path = {\n resolveUrlsInStyle: function(style) {\n v ar doc = style.ownerDocument;\n var resolver = doc.createElement('a');\n s tyle.textContent = this.resolveUrlsInCssText(style.textContent, resolver);\n return style; \n },\n resolveUrlsInCssText: function(cssText, urlObj) {\n var r = this.replaceUrls(cssText, urlObj, CSS_URL_REGEXP);\n r = this.replace Urls(r, urlObj, CSS_IMPORT_REGEXP);\n return r;\n },\n replaceUrls: functio n(text, urlObj, regexp) {\n return text.replace(regexp, function(m, pre, url, post) {\n var urlPath = url.replace(/[\"']/g, '');\n urlObj.href = ur lPath;\n urlPath = urlObj.href;\n return pre + '\\'' + urlPath + '\\'' + post;\n }); \n }\n}\n\n// exports\nscope.parser = importParser;\nscope .path = path;\nscope.isIE = isIe;\n\n})(HTMLImports);\n", 169 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar IMPORT_LINK_TYPE = 'import';\nv ar flags = scope.flags;\nvar isIe = /Trident/.test(navigator.userAgent);\n// TOD O(sorvell): SD polyfill intrusion\nvar mainDoc = window.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// importParser \n// highlander object to manage parsing of imports\n// parses import related el ements\n// and ensures proper parse order\n// parse order is enforced by crawlin g the tree and monitoring which elements\n// have been parsed; async parsing is also supported.\n\n// highlander object for parsing a document tree\nvar importP arser = {\n // parse selectors for main document elements\n documentSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // parse selectors for import document elements\n importsSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']',\n 'link[rel=stylesheet]',\n 'style',\n 'script:not([type])',\n 'script[t ype=\"text/javascript\"]'\n ].join(','),\n map: {\n link: 'parseLink',\n script: 'parseScript',\n style: 'parseStyle'\n },\n // try to parse the ne xt import in the tree\n parseNext: function() {\n var next = this.nextToPars e();\n if (next) {\n this.parse(next);\n }\n },\n parse: function(e lt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log('[%s] is already parsed', elt.localName);\n return;\n }\n var fn = this[this.m ap[elt.localName]];\n if (fn) {\n this.markParsing(elt);\n fn.call( this, elt);\n }\n },\n // only 1 element may be parsed at a time; parsing i s async so, each\n // parsing implementation must inform the system that parsin g is complete\n // via markParsingComplete.\n markParsing: function(elt) {\n flags.parse && console.log('parsing', elt);\n this.parsingElement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__importParsed = true;\n if (elt.__importElement) {\n elt.__importElement.__importParsed = true;\n }\n this.parsingElement = null;\n flags.parse && console.log('completed ', elt);\n this.parseNext();\n },\n parseImport: function(elt) {\n elt.i mport.__importParsed = true;\n // TODO(sorvell): consider if there's a better way to do this;\n // expose an imports parsing hook; this is needed, for exa mple, by the\n // CustomElements polyfill.\n if (HTMLImports.__importsPars ingHook) {\n HTMLImports.__importsParsingHook(elt);\n }\n // fire loa d event\n if (elt.__resource) {\n elt.dispatchEvent(new CustomEvent('loa d', {bubbles: false})); \n } else {\n elt.dispatchEvent(new CustomEve nt('error', {bubbles: false}));\n }\n // TODO(sorvell): workaround for Saf ari addEventListener not working\n // for elements not in the main document.\ n if (elt.__pending) {\n var fn;\n while (elt.__pending.length) {\n fn = elt.__pending.shift();\n if (fn) {\n fn({target: el t});\n }\n }\n }\n this.markParsingComplete(elt);\n },\n par seLink: function(linkElt) {\n if (nodeIsImport(linkElt)) {\n this.parseI mport(linkElt);\n } else {\n // make href absolute\n linkElt.href = linkElt.href;\n this.parseGeneric(linkElt);\n }\n },\n parseStyle: fu nction(elt) {\n // TODO(sorvell): style element load event can just not fire so clone styles\n var src = elt;\n elt = cloneStyle(elt);\n elt.__impor tElement = src;\n this.parseGeneric(elt);\n },\n parseGeneric: function(elt ) {\n this.trackElement(elt);\n document.head.appendChild(elt);\n },\n / / tracks when a loadable element has loaded\n trackElement: function(elt, callb ack) {\n var self = this;\n var done = function(e) {\n if (callback) {\n callback(e);\n }\n self.markParsingComplete(elt);\n };\n elt.addEventListener('load', done);\n elt.addEventListener('error', done) ;\n\n // NOTE: IE does not fire \"load\" event for styles that have already l oaded\n // This is in violation of the spec, so we try our hardest to work ar ound it\n if (isIe && elt.localName === 'style') {\n var fakeLoad = fals e;\n // If there's not @import in the textContent, assume it has loaded\n if (elt.textContent.indexOf('@import') == -1) {\n fakeLoad = true;\n // if we have a sheet, we have been parsed\n } else if (elt.sheet) {\n fakeLoad = true;\n var csr = elt.sheet.cssRules;\n var len = csr ? csr.length : 0;\n // search the rules for @import's\n for (var i = 0, r; (i < len) && (r = csr[i]); i++) {\n if (r.type === CSSR ule.IMPORT_RULE) {\n // if every @import has resolved, fake the load\ n fakeLoad = fakeLoad && Boolean(r.styleSheet);\n }\n }\n }\n // dispatch a fake load event and continue parsing\n if (fakeLoad) {\n elt.dispatchEvent(new CustomEvent('load', {bubbles: false} ));\n }\n }\n },\n // NOTE: execute scripts by injecting them and watc hing for the load/error\n // event. Inline scripts are handled via dataURL's be cause browsers tend to\n // provide correct parsing errors in this case. If thi s has any compatibility\n // issues, we can switch to injecting the inline scri pt with textContent.\n // Scripts with dataURL's do not appear to generate load events and therefore\n // we assume they execute synchronously.\n parseScript : function(scriptElt) {\n var script = document.createElement('script');\n script.__importElement = scriptElt;\n script.src = scriptElt.src ? scriptElt .src : \n generateScriptDataUrl(scriptElt);\n scope.currentScript = sc riptElt;\n this.trackElement(script, function(e) {\n script.parentNode.r emoveChild(script);\n scope.currentScript = null; \n });\n document. head.appendChild(script);\n },\n // determine the next element in the tree whi ch should be parsed\n nextToParse: function() {\n return !this.parsingElemen t && this.nextToParseInDoc(mainDoc);\n },\n nextToParseInDoc: function(doc, li nk) {\n var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));\n for (var i=0, l=nodes.length, p=0, n; (i<l) && (n=nodes[i]); i++) {\n if (!this.isParsed(n)) {\n if (this.hasResource(n)) {\n return nod eIsImport(n) ? this.nextToParseInDoc(n.import, n) : n;\n } else {\n return;\n }\n }\n }\n // all nodes have been parsed, ready to parse import, if any\n return link;\n },\n // return the set of parse s electors relevant for this node.\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDocument || node;\n return doc === mainDoc ? this.docume ntSelectors : this.importsSelectors;\n },\n isParsed: function(node) {\n re turn node.__importParsed;\n },\n hasResource: function(node) {\n if (nodeIs Import(node) && !node.import) {\n return false;\n }\n return true;\n }\n};\n\nfunction nodeIsImport(elt) {\n return (elt.localName === 'link') && ( elt.rel === IMPORT_LINK_TYPE);\n}\n\nfunction generateScriptDataUrl(script) {\n var scriptContent = generateScriptContent(script), b64;\n try {\n b64 = bto a(scriptContent);\n } catch(e) {\n b64 = btoa(unescape(encodeURIComponent(sc riptContent)));\n console.warn('Script contained non-latin characters that we re forced ' +\n 'to latin. Some characters may be wrong.', script);\n }\n return 'data:text/javascript;base64,' + b64;\n}\n\nfunction generateScriptConte nt(script) {\n return script.textContent + generateSourceMapHint(script);\n}\n\ n// calculate source map hint\nfunction generateSourceMapHint(script) {\n var m oniker = script.__nodeUrl;\n if (!moniker) {\n moniker = script.ownerDocumen t.baseURI;\n // there could be more than one script this url\n var tag = ' [' + Math.floor((Math.random()+1)*1000) + ']';\n // TODO(sjmiles): Polymer ha ck, should be pluggable if we need to allow \n // this sort of thing\n var matches = script.textContent.match(/Polymer\\(['\"]([^'\"]*)/);\n tag = matc hes && matches[1] || tag;\n // tag the moniker\n moniker += '/' + tag + '. js';\n }\n return '\\n//# sourceURL=' + moniker + '\\n';\n}\n\n// style/styles heet handling\n\n// clone style with proper path resolution for main document\n/ / NOTE: styles are the only elements that require direct path fixup.\nfunction c loneStyle(style) {\n var clone = style.ownerDocument.createElement('style');\n clone.textContent = style.textContent;\n path.resolveUrlsInStyle(clone);\n re turn clone;\n}\n\n// path fixup: style elements in imports must be made relative to the main \n// document. We fixup url's in url() and @import.\nvar CSS_URL_RE GEXP = /(url\\()([^)]*)(\\))/g;\nvar CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\ ())([^;]*)(;)/g;\n\nvar path = {\n resolveUrlsInStyle: function(style) {\n v ar doc = style.ownerDocument;\n var resolver = doc.createElement('a');\n s tyle.textContent = this.resolveUrlsInCssText(style.textContent, resolver);\n return style; \n },\n resolveUrlsInCssText: function(cssText, urlObj) {\n var r = this.replaceUrls(cssText, urlObj, CSS_URL_REGEXP);\n r = this.replace Urls(r, urlObj, CSS_IMPORT_REGEXP);\n return r;\n },\n replaceUrls: functio n(text, urlObj, regexp) {\n return text.replace(regexp, function(m, pre, url, post) {\n var urlPath = url.replace(/[\"']/g, '');\n urlObj.href = ur lPath;\n urlPath = urlObj.href;\n return pre + '\\'' + urlPath + '\\'' + post;\n }); \n }\n}\n\n// exports\nscope.parser = importParser;\nscope .path = path;\nscope.isIE = isIe;\n\n})(HTMLImports);\n",
167 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar hasNative = ('import' in docume nt.createElement('link'));\nvar useNative = hasNative;\nvar flags = scope.flags; \nvar IMPORT_LINK_TYPE = 'import';\n\n// TODO(sorvell): SD polyfill intrusion\nv ar mainDoc = window.ShadowDOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(doc ument) : document;\n\nif (!useNative) {\n\n // imports\n var xhr = scope.xhr;\ n var Loader = scope.Loader;\n var parser = scope.parser;\n\n // importer\n // highlander object to manage loading of imports\n\n // for any document, impo rter:\n // - loads any linked import documents (with deduping)\n\n var importe r = {\n documents: {},\n // nodes to load in the mian document\n docume ntPreloadSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load in imports\n importsPreloadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ].join(','),\n loadNode: function(node) {\n importLoader.add Node(node);\n },\n // load all loadable elements within the parent element \n loadSubtree: function(parent) {\n var nodes = this.marshalNodes(paren t);\n // add these nodes to loader's queue\n importLoader.addNodes(nod es);\n },\n marshalNodes: function(parent) {\n // all preloadable nod es in inDocument\n return parent.querySelectorAll(this.loadSelectorsForNode (parent));\n },\n // find the proper set of load selectors for a given nod e\n loadSelectorsForNode: function(node) {\n var doc = node.ownerDocumen t || node;\n return doc === mainDoc ? this.documentPreloadSelectors :\n this.importsPreloadSelectors;\n },\n loaded: function(url, elt, reso urce) {\n flags.load && console.log('loaded', url, elt);\n // store ge neric resource\n // TODO(sorvell): fails for nodes inside <template>.conten t\n // see https://code.google.com/p/chromium/issues/detail?id=249381.\n elt.__resource = resource;\n if (isDocumentLink(elt)) {\n var doc = this.documents[url];\n // if we've never seen a document at this url\n if (!doc) {\n // generate an HTMLDocument from data\n doc = makeDocument(resource, url);\n doc.__importLink = elt;\n // TODO(sorvell): we cannot use MO to detect parsed nodes because\n // SD polyfill does not report these as mutations.\n this.bootDocument(do c);\n // cache document\n this.documents[url] = doc;\n }\n // don't store import record until we're actually loaded\n // store document resource\n elt.import = doc;\n }\n parser.parseN ext();\n },\n bootDocument: function(doc) {\n this.loadSubtree(doc);\ n this.observe(doc);\n parser.parseNext();\n },\n loadedAll: fun ction() {\n parser.parseNext();\n }\n };\n\n // loader singleton\n va r importLoader = new Loader(importer.loaded.bind(importer), \n importer.loa dedAll.bind(importer));\n\n function isDocumentLink(elt) {\n return isLinkRe l(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel) {\n return e lt.localName === 'link' && elt.getAttribute('rel') === rel;\n }\n\n function i sScript(elt) {\n return elt.localName === 'script';\n }\n\n function makeDo cument(resource, url) {\n // create a new HTML document\n var doc = resour ce;\n if (!(doc instanceof Document)) {\n doc = document.implementation. createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the new document's so urce url\n doc._URL = url;\n // establish a relative path via <base>\n var base = doc.createElement('base');\n base.setAttribute('href', url);\n // add baseURI support to browsers (IE) that lack it.\n if (!doc.baseURI) {\n doc.baseURI = url;\n }\n // ensure UTF-8 charset\n var meta = doc .createElement('meta');\n meta.setAttribute('charset', 'utf-8');\n\n doc.h ead.appendChild(meta);\n doc.head.appendChild(base);\n // install HTML las t as it may trigger CustomElement upgrades\n // TODO(sjmiles): problem wrt to template boostrapping below,\n // template bootstrapping must (?) come befor e element upgrade\n // but we cannot bootstrap templates until they are in a document\n // which is too late\n if (!(resource instanceof Document)) {\n // install html\n doc.body.innerHTML = resource;\n }\n // TODO( sorvell): ideally this code is not aware of Template polyfill,\n // but for n ow the polyfill needs help to bootstrap these templates\n if (window.HTMLTemp lateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.boots trap(doc);\n }\n return doc;\n }\n} else {\n // do nothing if using nati ve imports\n var importer = {};\n}\n\n// NOTE: We cannot polyfill document.curr entScript because it's not possible\n// both to override and maintain the abilit y to capture the native value;\n// therefore we choose to expose _currentScript both when native imports\n// and the polyfill are in use.\nvar currentScriptDesc riptor = {\n get: function() {\n return HTMLImports.currentScript || documen t.currentScript;\n },\n configurable: true\n};\n\nObject.defineProperty(docume nt, '_currentScript', currentScriptDescriptor);\nObject.defineProperty(mainDoc, '_currentScript', currentScriptDescriptor);\n\n// Polyfill document.baseURI for browsers without it.\nif (!document.baseURI) {\n var baseURIDescriptor = {\n get: function() {\n return window.location.href;\n },\n configurable : true\n };\n\n Object.defineProperty(document, 'baseURI', baseURIDescriptor); \n Object.defineProperty(mainDoc, 'baseURI', baseURIDescriptor);\n}\n\n// call a callback when all HTMLImports in the document at call (or at least\n// docume nt ready) time have loaded.\n// 1. ensure the document is in a ready state (has dom), then \n// 2. watch for loading of imports and call callback when done\nfun ction whenImportsReady(callback, doc) {\n doc = doc || mainDoc;\n // if docume nt is loading, wait and try again\n whenDocumentReady(function() {\n watchIm portsLoad(callback, doc);\n }, doc);\n}\n\n// call the callback when the docume nt is in a ready state (has dom)\nvar requiredReadyState = HTMLImports.isIE ? 'c omplete' : 'interactive';\nvar READY_EVENT = 'readystatechange';\nfunction isDoc umentReady(doc) {\n return (doc.readyState === 'complete' ||\n doc.readySt ate === requiredReadyState);\n}\n\n// call <callback> when we ensure the documen t is in a ready state\nfunction whenDocumentReady(callback, doc) {\n if (!isDoc umentReady(doc)) {\n var checkReady = function() {\n if (doc.readyState === 'complete' || \n doc.readyState === requiredReadyState) {\n doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentReady(cal lback, doc);\n }\n }\n doc.addEventListener(READY_EVENT, checkReady); \n } else if (callback) {\n callback();\n }\n}\n\n// call <callback> when w e ensure all imports have loaded\nfunction watchImportsLoad(callback, doc) {\n var imports = doc.querySelectorAll('link[rel=import]');\n var loaded = 0, l = i mports.length;\n function checkDone(d) { \n if (loaded == l) {\n // go async to ensure parser isn't stuck on a script tag\n requestAnimationFrame( callback);\n }\n }\n function loadedImport(e) {\n loaded++;\n checkDo ne();\n }\n if (l) {\n for (var i=0, imp; (i<l) && (imp=imports[i]); i++) { \n if (isImportLoaded(imp)) {\n loadedImport.call(imp);\n } els e {\n imp.addEventListener('load', loadedImport);\n imp.addEventLi stener('error', loadedImport);\n }\n }\n } else {\n checkDone();\n }\n}\n\nfunction isImportLoaded(link) {\n return useNative ? (link.import && (l ink.import.readyState !== 'loading')) :\n link.__importParsed;\n}\n\n// exp orts\nscope.hasNative = hasNative;\nscope.useNative = useNative;\nscope.importer = importer;\nscope.whenImportsReady = whenImportsReady;\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\nscope.isImportLoaded = isImportLoaded;\nscope.importLoader = importLoader;\n\n})(window.HTMLImports);\n", 170 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\nvar hasNative = ('import' in docume nt.createElement('link'));\nvar useNative = hasNative;\nvar flags = scope.flags; \nvar IMPORT_LINK_TYPE = 'import';\n\n// TODO(sorvell): SD polyfill intrusion\nv ar mainDoc = window.ShadowDOMPolyfill ? \n ShadowDOMPolyfill.wrapIfNeeded(doc ument) : document;\n\nif (!useNative) {\n\n // imports\n var xhr = scope.xhr;\ n var Loader = scope.Loader;\n var parser = scope.parser;\n\n // importer\n // highlander object to manage loading of imports\n\n // for any document, impo rter:\n // - loads any linked import documents (with deduping)\n\n var importe r = {\n documents: {},\n // nodes to load in the mian document\n docume ntPreloadSelectors: 'link[rel=' + IMPORT_LINK_TYPE + ']',\n // nodes to load in imports\n importsPreloadSelectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ].join(','),\n loadNode: function(node) {\n importLoader.add Node(node);\n },\n // load all loadable elements within the parent element \n loadSubtree: function(parent) {\n var nodes = this.marshalNodes(paren t);\n // add these nodes to loader's queue\n importLoader.addNodes(nod es);\n },\n marshalNodes: function(parent) {\n // all preloadable nod es in inDocument\n return parent.querySelectorAll(this.loadSelectorsForNode (parent));\n },\n // find the proper set of load selectors for a given nod e\n loadSelectorsForNode: function(node) {\n var doc = node.ownerDocumen t || node;\n return doc === mainDoc ? this.documentPreloadSelectors :\n this.importsPreloadSelectors;\n },\n loaded: function(url, elt, reso urce) {\n flags.load && console.log('loaded', url, elt);\n // store ge neric resource\n // TODO(sorvell): fails for nodes inside <template>.conten t\n // see https://code.google.com/p/chromium/issues/detail?id=249381.\n elt.__resource = resource;\n if (isDocumentLink(elt)) {\n var doc = this.documents[url];\n // if we've never seen a document at this url\n if (!doc) {\n // generate an HTMLDocument from data\n doc = makeDocument(resource, url);\n doc.__importLink = elt;\n // TODO(sorvell): we cannot use MO to detect parsed nodes because\n // SD polyfill does not report these as mutations.\n this.bootDocument(do c);\n // cache document\n this.documents[url] = doc;\n }\n // don't store import record until we're actually loaded\n // store document resource\n elt.import = doc;\n }\n parser.parseN ext();\n },\n bootDocument: function(doc) {\n this.loadSubtree(doc);\ n this.observe(doc);\n parser.parseNext();\n },\n loadedAll: fun ction() {\n parser.parseNext();\n }\n };\n\n // loader singleton\n va r importLoader = new Loader(importer.loaded.bind(importer), \n importer.loa dedAll.bind(importer));\n\n function isDocumentLink(elt) {\n return isLinkRe l(elt, IMPORT_LINK_TYPE);\n }\n\n function isLinkRel(elt, rel) {\n return e lt.localName === 'link' && elt.getAttribute('rel') === rel;\n }\n\n function i sScript(elt) {\n return elt.localName === 'script';\n }\n\n function makeDo cument(resource, url) {\n // create a new HTML document\n var doc = resour ce;\n if (!(doc instanceof Document)) {\n doc = document.implementation. createHTMLDocument(IMPORT_LINK_TYPE);\n }\n // cache the new document's so urce url\n doc._URL = url;\n // establish a relative path via <base>\n var base = doc.createElement('base');\n base.setAttribute('href', url);\n // add baseURI support to browsers (IE) that lack it.\n if (!doc.baseURI) {\n doc.baseURI = url;\n }\n // ensure UTF-8 charset\n var meta = doc .createElement('meta');\n meta.setAttribute('charset', 'utf-8');\n\n doc.h ead.appendChild(meta);\n doc.head.appendChild(base);\n // install HTML las t as it may trigger CustomElement upgrades\n // TODO(sjmiles): problem wrt to template boostrapping below,\n // template bootstrapping must (?) come befor e element upgrade\n // but we cannot bootstrap templates until they are in a document\n // which is too late\n if (!(resource instanceof Document)) {\n // install html\n doc.body.innerHTML = resource;\n }\n // TODO( sorvell): ideally this code is not aware of Template polyfill,\n // but for n ow the polyfill needs help to bootstrap these templates\n if (window.HTMLTemp lateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.boots trap(doc);\n }\n return doc;\n }\n} else {\n // do nothing if using nati ve imports\n var importer = {};\n}\n\n// NOTE: We cannot polyfill document.curr entScript because it's not possible\n// both to override and maintain the abilit y to capture the native value;\n// therefore we choose to expose _currentScript both when native imports\n// and the polyfill are in use.\nvar currentScriptDesc riptor = {\n get: function() {\n return HTMLImports.currentScript || documen t.currentScript;\n },\n configurable: true\n};\n\nObject.defineProperty(docume nt, '_currentScript', currentScriptDescriptor);\nObject.defineProperty(mainDoc, '_currentScript', currentScriptDescriptor);\n\n// Polyfill document.baseURI for browsers without it.\nif (!document.baseURI) {\n var baseURIDescriptor = {\n get: function() {\n return window.location.href;\n },\n configurable : true\n };\n\n Object.defineProperty(document, 'baseURI', baseURIDescriptor); \n Object.defineProperty(mainDoc, 'baseURI', baseURIDescriptor);\n}\n\n// call a callback when all HTMLImports in the document at call (or at least\n// docume nt ready) time have loaded.\n// 1. ensure the document is in a ready state (has dom), then \n// 2. watch for loading of imports and call callback when done\nfun ction whenImportsReady(callback, doc) {\n doc = doc || mainDoc;\n // if docume nt is loading, wait and try again\n whenDocumentReady(function() {\n watchIm portsLoad(callback, doc);\n }, doc);\n}\n\n// call the callback when the docume nt is in a ready state (has dom)\nvar requiredReadyState = HTMLImports.isIE ? 'c omplete' : 'interactive';\nvar READY_EVENT = 'readystatechange';\nfunction isDoc umentReady(doc) {\n return (doc.readyState === 'complete' ||\n doc.readySt ate === requiredReadyState);\n}\n\n// call <callback> when we ensure the documen t is in a ready state\nfunction whenDocumentReady(callback, doc) {\n if (!isDoc umentReady(doc)) {\n var checkReady = function() {\n if (doc.readyState === 'complete' || \n doc.readyState === requiredReadyState) {\n doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentReady(cal lback, doc);\n }\n }\n doc.addEventListener(READY_EVENT, checkReady); \n } else if (callback) {\n callback();\n }\n}\n\n// call <callback> when w e ensure all imports have loaded\nfunction watchImportsLoad(callback, doc) {\n var imports = doc.querySelectorAll('link[rel=import]');\n var loaded = 0, l = i mports.length;\n function checkDone(d) { \n if (loaded == l) {\n // go async to ensure parser isn't stuck on a script tag\n requestAnimationFrame( callback);\n }\n }\n function loadedImport(e) {\n loaded++;\n checkDo ne();\n }\n if (l) {\n for (var i=0, imp; (i<l) && (imp=imports[i]); i++) { \n if (isImportLoaded(imp)) {\n loadedImport.call(imp);\n } els e {\n imp.addEventListener('load', loadedImport);\n imp.addEventLi stener('error', loadedImport);\n }\n }\n } else {\n checkDone();\n }\n}\n\nfunction isImportLoaded(link) {\n return useNative ? (link.import && (l ink.import.readyState !== 'loading')) :\n link.__importParsed;\n}\n\n// exp orts\nscope.hasNative = hasNative;\nscope.useNative = useNative;\nscope.importer = importer;\nscope.whenImportsReady = whenImportsReady;\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\nscope.isImportLoaded = isImportLoaded;\nscope.importLoader = importLoader;\n\n})(window.HTMLImports);\n",
168 " /*\nCopyright 2013 The Polymer Authors. All rights reserved.\nUse of this source code is governed by a BSD-style\nlicense that can be found in the LICENSE file.\n*/\n\n(function(scope){\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE ;\nvar importSelector = 'link[rel=' + IMPORT_LINK_TYPE + ']';\nvar importer = sc ope.importer;\n\n// we track mutations for addedNodes, looking for imports\nfunc tion handler(mutations) {\n for (var i=0, l=mutations.length, m; (i<l) && (m=mu tations[i]); i++) {\n if (m.type === 'childList' && m.addedNodes.length) {\n addedNodes(m.addedNodes);\n }\n }\n}\n\n// find loadable elements and a dd them to the importer\nfunction addedNodes(nodes) {\n for (var i=0, l=nodes.l ength, n; (i<l) && (n=nodes[i]); i++) {\n if (shouldLoadNode(n)) {\n imp orter.loadNode(n);\n }\n if (n.children && n.children.length) {\n add edNodes(n.children);\n }\n }\n}\n\nfunction shouldLoadNode(node) {\n return (node.nodeType === 1) && matches.call(node,\n importer.loadSelectorsForNod e(node));\n}\n\n// x-plat matches\nvar matches = HTMLElement.prototype.matches | | \n HTMLElement.prototype.matchesSelector || \n HTMLElement.prototype.web kitMatchesSelector ||\n HTMLElement.prototype.mozMatchesSelector ||\n HTML Element.prototype.msMatchesSelector;\n\nvar observer = new MutationObserver(hand ler);\n\n// observe the given root for loadable elements\nfunction observe(root) {\n observer.observe(root, {childList: true, subtree: true});\n}\n\n// exports \n// TODO(sorvell): factor so can put on scope\nscope.observe = observe;\nimport er.observe = observe;\n\n})(HTMLImports);\n", 171 " /*\nCopyright 2013 The Polymer Authors. All rights reserved.\nUse of this source code is governed by a BSD-style\nlicense that can be found in the LICENSE file.\n*/\n\n(function(scope){\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE ;\nvar importSelector = 'link[rel=' + IMPORT_LINK_TYPE + ']';\nvar importer = sc ope.importer;\n\n// we track mutations for addedNodes, looking for imports\nfunc tion handler(mutations) {\n for (var i=0, l=mutations.length, m; (i<l) && (m=mu tations[i]); i++) {\n if (m.type === 'childList' && m.addedNodes.length) {\n addedNodes(m.addedNodes);\n }\n }\n}\n\n// find loadable elements and a dd them to the importer\nfunction addedNodes(nodes) {\n for (var i=0, l=nodes.l ength, n; (i<l) && (n=nodes[i]); i++) {\n if (shouldLoadNode(n)) {\n imp orter.loadNode(n);\n }\n if (n.children && n.children.length) {\n add edNodes(n.children);\n }\n }\n}\n\nfunction shouldLoadNode(node) {\n return (node.nodeType === 1) && matches.call(node,\n importer.loadSelectorsForNod e(node));\n}\n\n// x-plat matches\nvar matches = HTMLElement.prototype.matches | | \n HTMLElement.prototype.matchesSelector || \n HTMLElement.prototype.web kitMatchesSelector ||\n HTMLElement.prototype.mozMatchesSelector ||\n HTML Element.prototype.msMatchesSelector;\n\nvar observer = new MutationObserver(hand ler);\n\n// observe the given root for loadable elements\nfunction observe(root) {\n observer.observe(root, {childList: true, subtree: true});\n}\n\n// exports \n// TODO(sorvell): factor so can put on scope\nscope.observe = observe;\nimport er.observe = observe;\n\n})(HTMLImports);\n",
169 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(){\n\n// bootstrap\n\n// IE shim for CustomEvent\ nif (typeof window.CustomEvent !== 'function') {\n window.CustomEvent = functio n(inType, dictionary) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent(inType,\n dictionary.bubbles === false ? false : true,\n dictionary.cancelable === false ? false : true,\n dictionary.detail);\ n return e;\n };\n}\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = w indow.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// Fire the 'HTMLImportsLoaded' event when imports in document at load time \n// have loaded. This event is required to simulate the script block ing \n// behavior of native imports. A main document script that needs to be sur e\n// imports have loaded should wait for this event.\nHTMLImports.whenImportsRe ady(function() {\n HTMLImports.ready = true;\n HTMLImports.readyTime = new Dat e().getTime();\n doc.dispatchEvent(\n new CustomEvent('HTMLImportsLoaded', { bubbles: true})\n );\n});\n\n\n// no need to bootstrap the polyfill when native imports is available.\nif (!HTMLImports.useNative) {\n function bootstrap() {\ n HTMLImports.importer.bootDocument(doc);\n }\n \n // TODO(sorvell): SD polyfill does *not* generate mutations for nodes added\n // by the parser. For this reason, we must wait until the dom exists to \n // bootstrap.\n if (docum ent.readyState === 'complete' ||\n (document.readyState === 'interactive' & & !window.attachEvent)) {\n bootstrap();\n } else {\n document.addEventLi stener('DOMContentLoaded', bootstrap);\n }\n}\n\n})();\n", 172 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(){\n\n// bootstrap\n\n// IE shim for CustomEvent\ nif (typeof window.CustomEvent !== 'function') {\n window.CustomEvent = functio n(inType, dictionary) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent(inType,\n dictionary.bubbles === false ? false : true,\n dictionary.cancelable === false ? false : true,\n dictionary.detail);\ n return e;\n };\n}\n\n// TODO(sorvell): SD polyfill intrusion\nvar doc = w indow.ShadowDOMPolyfill ? \n window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;\n\n// Fire the 'HTMLImportsLoaded' event when imports in document at load time \n// have loaded. This event is required to simulate the script block ing \n// behavior of native imports. A main document script that needs to be sur e\n// imports have loaded should wait for this event.\nHTMLImports.whenImportsRe ady(function() {\n HTMLImports.ready = true;\n HTMLImports.readyTime = new Dat e().getTime();\n doc.dispatchEvent(\n new CustomEvent('HTMLImportsLoaded', { bubbles: true})\n );\n});\n\n\n// no need to bootstrap the polyfill when native imports is available.\nif (!HTMLImports.useNative) {\n function bootstrap() {\ n HTMLImports.importer.bootDocument(doc);\n }\n \n // TODO(sorvell): SD polyfill does *not* generate mutations for nodes added\n // by the parser. For this reason, we must wait until the dom exists to \n // bootstrap.\n if (docum ent.readyState === 'complete' ||\n (document.readyState === 'interactive' & & !window.attachEvent)) {\n bootstrap();\n } else {\n document.addEventLi stener('DOMContentLoaded', bootstrap);\n }\n}\n\n})();\n",
170 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\nwindow.CustomElements = window.CustomElements || {flags:{}} ;", 173 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\nwindow.CustomElements = window.CustomElements || {flags:{}} ;",
171 " /*\r\nCopyright 2013 The Polymer Authors. All rights reserved.\r\nUse of t his source code is governed by a BSD-style\r\nlicense that can be found in the L ICENSE file.\r\n*/\r\n\r\n(function(scope){\r\n\r\nvar logFlags = window.logFlag s || {};\r\nvar IMPORT_LINK_TYPE = window.HTMLImports ? HTMLImports.IMPORT_LINK_ TYPE : 'none';\r\n\r\n// walk the subtree rooted at node, applying 'find(element , data)' function\r\n// to each element\r\n// if 'find' returns true for 'elemen t', do not search element's subtree\r\nfunction findAll(node, find, data) {\r\n var e = node.firstElementChild;\r\n if (!e) {\r\n e = node.firstChild;\r\n while (e && e.nodeType !== Node.ELEMENT_NODE) {\r\n e = e.nextSibling;\r \n }\r\n }\r\n while (e) {\r\n if (find(e, data) !== true) {\r\n fi ndAll(e, find, data);\r\n }\r\n e = e.nextElementSibling;\r\n }\r\n retu rn null;\r\n}\r\n\r\n// walk all shadowRoots on a given node.\r\nfunction forRoo ts(node, cb) {\r\n var root = node.shadowRoot;\r\n while(root) {\r\n forSub tree(root, cb);\r\n root = root.olderShadowRoot;\r\n }\r\n}\r\n\r\n// walk t he subtree rooted at node, including descent into shadow-roots,\r\n// applying ' cb' to each element\r\nfunction forSubtree(node, cb) {\r\n //logFlags.dom && no de.childNodes && node.childNodes.length && console.group('subTree: ', node);\r\n findAll(node, function(e) {\r\n if (cb(e)) {\r\n return true;\r\n } \r\n forRoots(e, cb);\r\n });\r\n forRoots(node, cb);\r\n //logFlags.dom & & node.childNodes && node.childNodes.length && console.groupEnd();\r\n}\r\n\r\n/ / manage lifecycle on added node\r\nfunction added(node) {\r\n if (upgrade(node )) {\r\n insertedNode(node);\r\n return true;\r\n }\r\n inserted(node);\ r\n}\r\n\r\n// manage lifecycle on added node's subtree only\r\nfunction addedSu btree(node) {\r\n forSubtree(node, function(e) {\r\n if (added(e)) {\r\n return true;\r\n }\r\n });\r\n}\r\n\r\n// manage lifecycle on added node a nd it's subtree\r\nfunction addedNode(node) {\r\n return added(node) || addedSu btree(node);\r\n}\r\n\r\n// upgrade custom elements at node, if applicable\r\nfu nction upgrade(node) {\r\n if (!node.__upgraded__ && node.nodeType === Node.ELE MENT_NODE) {\r\n var type = node.getAttribute('is') || node.localName;\r\n var definition = scope.registry[type];\r\n if (definition) {\r\n logFla gs.dom && console.group('upgrade:', node.localName);\r\n scope.upgrade(node );\r\n logFlags.dom && console.groupEnd();\r\n return true;\r\n }\r \n }\r\n}\r\n\r\nfunction insertedNode(node) {\r\n inserted(node);\r\n if (in Document(node)) {\r\n forSubtree(node, function(e) {\r\n inserted(e);\r\ n });\r\n }\r\n}\r\n\r\n// TODO(sorvell): on platforms without MutationObser ver, mutations may not be\r\n// reliable and therefore attached/detached are not reliable.\r\n// To make these callbacks less likely to fail, we defer all inser ts and removes\r\n// to give a chance for elements to be inserted into dom.\r\n/ / This ensures attachedCallback fires for elements that are created and\r\n// im mediately added to dom.\r\nvar hasPolyfillMutations = (!window.MutationObserver ||\r\n (window.MutationObserver === window.JsMutationObserver));\r\nscope.has PolyfillMutations = hasPolyfillMutations;\r\n\r\nvar isPendingMutations = false; \r\nvar pendingMutations = [];\r\nfunction deferMutation(fn) {\r\n pendingMutat ions.push(fn);\r\n if (!isPendingMutations) {\r\n isPendingMutations = true; \r\n var async = (window.Platform && window.Platform.endOfMicrotask) ||\r\n setTimeout;\r\n async(takeMutations);\r\n }\r\n}\r\n\r\nfunction takeM utations() {\r\n isPendingMutations = false;\r\n var $p = pendingMutations;\r\ n for (var i=0, l=$p.length, p; (i<l) && (p=$p[i]); i++) {\r\n p();\r\n }\r \n pendingMutations = [];\r\n}\r\n\r\nfunction inserted(element) {\r\n if (has PolyfillMutations) {\r\n deferMutation(function() {\r\n _inserted(elemen t);\r\n });\r\n } else {\r\n _inserted(element);\r\n }\r\n}\r\n\r\n// TO DO(sjmiles): if there are descents into trees that can never have inDocument(*) true, fix this\r\nfunction _inserted(element) {\r\n // TODO(sjmiles): it's poss ible we were inserted and removed in the space\r\n // of one microtask, in whic h case we won't be 'inDocument' here\r\n // But there are other cases where we are testing for inserted without\r\n // specific knowledge of mutations, and mu st test 'inDocument' to determine\r\n // whether to call inserted\r\n // If we can factor these cases into separate code paths we can have\r\n // better diag nostics.\r\n // TODO(sjmiles): when logging, do work on all custom elements so we can\r\n // track behavior even when callbacks not defined\r\n //console.log ('inserted: ', element.localName);\r\n if (element.attachedCallback || element. detachedCallback || (element.__upgraded__ && logFlags.dom)) {\r\n logFlags.do m && console.group('inserted:', element.localName);\r\n if (inDocument(elemen t)) {\r\n element.__inserted = (element.__inserted || 0) + 1;\r\n // i f we are in a 'removed' state, bluntly adjust to an 'inserted' state\r\n if (element.__inserted < 1) {\r\n element.__inserted = 1;\r\n }\r\n // if we are 'over inserted', squelch the callback\r\n if (element.__ins erted > 1) {\r\n logFlags.dom && console.warn('inserted:', element.localN ame,\r\n 'insert/remove count:', element.__inserted)\r\n } else if (element.attachedCallback) {\r\n logFlags.dom && console.log('inserted:' , element.localName);\r\n element.attachedCallback();\r\n }\r\n } \r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\nfunction removedN ode(node) {\r\n removed(node);\r\n forSubtree(node, function(e) {\r\n remov ed(e);\r\n });\r\n}\r\n\r\nfunction removed(element) {\r\n if (hasPolyfillMuta tions) {\r\n deferMutation(function() {\r\n _removed(element);\r\n }) ;\r\n } else {\r\n _removed(element);\r\n }\r\n}\r\n\r\nfunction _removed(e lement) {\r\n // TODO(sjmiles): temporary: do work on all custom elements so we can track\r\n // behavior even when callbacks not defined\r\n if (element.att achedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.d om)) {\r\n logFlags.dom && console.group('removed:', element.localName);\r\n if (!inDocument(element)) {\r\n element.__inserted = (element.__inserted || 0) - 1;\r\n // if we are in a 'inserted' state, bluntly adjust to an 'r emoved' state\r\n if (element.__inserted > 0) {\r\n element.__insert ed = 0;\r\n }\r\n // if we are 'over removed', squelch the callback\r\ n if (element.__inserted < 0) {\r\n logFlags.dom && console.warn('re moved:', element.localName,\r\n 'insert/remove count:', element.__ins erted)\r\n } else if (element.detachedCallback) {\r\n element.detach edCallback();\r\n }\r\n }\r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\n// SD polyfill intrustion due mainly to the fact that 'document' \r\n// is not entirely wrapped\r\nfunction wrapIfNeeded(node) {\r\n return wind ow.ShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node)\r\n : node;\r\n }\r\n\r\nfunction inDocument(element) {\r\n var p = element;\r\n var doc = wra pIfNeeded(document);\r\n while (p) {\r\n if (p == doc) {\r\n return tru e;\r\n }\r\n p = p.parentNode || p.host;\r\n }\r\n}\r\n\r\nfunction watch Shadow(node) {\r\n if (node.shadowRoot && !node.shadowRoot.__watched) {\r\n logFlags.dom && console.log('watching shadow-root for: ', node.localName);\r\n // watch all unwatched roots...\r\n var root = node.shadowRoot;\r\n whil e (root) {\r\n watchRoot(root);\r\n root = root.olderShadowRoot;\r\n }\r\n }\r\n}\r\n\r\nfunction watchRoot(root) {\r\n if (!root.__watched) {\r\ n observe(root);\r\n root.__watched = true;\r\n }\r\n}\r\n\r\nfunction ha ndler(mutations) {\r\n //\r\n if (logFlags.dom) {\r\n var mx = mutations[0] ;\r\n if (mx && mx.type === 'childList' && mx.addedNodes) {\r\n if (mx .addedNodes) {\r\n var d = mx.addedNodes[0];\r\n while (d && d !== document && !d.host) {\r\n d = d.parentNode;\r\n }\r\n var u = d && (d.URL || d._URL || (d.host && d.host.localName)) || '';\r \n u = u.split('/?').shift().split('/').pop();\r\n }\r\n }\r\ n console.group('mutations (%d) [%s]', mutations.length, u || '');\r\n }\r\n //\r\n mutations.forEach(function(mx) {\r\n //logFlags.dom && console.grou p('mutation');\r\n if (mx.type === 'childList') {\r\n forEach(mx.addedNo des, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n return;\r\n }\r\n // nodes a dded may need lifecycle management\r\n addedNode(n);\r\n });\r\n // removed nodes may need lifecycle management\r\n forEach(mx.removedNode s, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n return;\r\n }\r\n removedNode( n);\r\n });\r\n }\r\n //logFlags.dom && console.groupEnd();\r\n });\ r\n logFlags.dom && console.groupEnd();\r\n};\r\n\r\nvar observer = new Mutatio nObserver(handler);\r\n\r\nfunction takeRecords() {\r\n // TODO(sjmiles): ask R af why we have to call handler ourselves\r\n handler(observer.takeRecords());\r \n takeMutations();\r\n}\r\n\r\nvar forEach = Array.prototype.forEach.call.bind (Array.prototype.forEach);\r\n\r\nfunction observe(inRoot) {\r\n observer.obser ve(inRoot, {childList: true, subtree: true});\r\n}\r\n\r\nfunction observeDocume nt(doc) {\r\n observe(doc);\r\n}\r\n\r\nfunction upgradeDocument(doc) {\r\n lo gFlags.dom && console.group('upgradeDocument: ', (doc.baseURI).split('/').pop()) ;\r\n addedNode(doc);\r\n logFlags.dom && console.groupEnd();\r\n}\r\n\r\nfunc tion upgradeDocumentTree(doc) {\r\n doc = wrapIfNeeded(doc);\r\n //console.log ('upgradeDocumentTree: ', (doc.baseURI).split('/').pop());\r\n // upgrade conta ined imported documents\r\n var imports = doc.querySelectorAll('link[rel=' + IM PORT_LINK_TYPE + ']');\r\n for (var i=0, l=imports.length, n; (i<l) && (n=impor ts[i]); i++) {\r\n if (n.import && n.import.__parsed) {\r\n upgradeDocum entTree(n.import);\r\n }\r\n }\r\n upgradeDocument(doc);\r\n}\r\n\r\n// exp orts\r\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\r\nscope.watchShadow = watchS hadow;\r\nscope.upgradeDocumentTree = upgradeDocumentTree;\r\nscope.upgradeAll = addedNode;\r\nscope.upgradeSubtree = addedSubtree;\r\nscope.insertedNode = inse rtedNode;\r\n\r\nscope.observeDocument = observeDocument;\r\nscope.upgradeDocume nt = upgradeDocument;\r\n\r\nscope.takeRecords = takeRecords;\r\n\r\n})(window.C ustomElements);\r\n", 174 " /*\r\nCopyright 2013 The Polymer Authors. All rights reserved.\r\nUse of t his source code is governed by a BSD-style\r\nlicense that can be found in the L ICENSE file.\r\n*/\r\n\r\n(function(scope){\r\n\r\nvar logFlags = window.logFlag s || {};\r\nvar IMPORT_LINK_TYPE = window.HTMLImports ? HTMLImports.IMPORT_LINK_ TYPE : 'none';\r\n\r\n// walk the subtree rooted at node, applying 'find(element , data)' function\r\n// to each element\r\n// if 'find' returns true for 'elemen t', do not search element's subtree\r\nfunction findAll(node, find, data) {\r\n var e = node.firstElementChild;\r\n if (!e) {\r\n e = node.firstChild;\r\n while (e && e.nodeType !== Node.ELEMENT_NODE) {\r\n e = e.nextSibling;\r \n }\r\n }\r\n while (e) {\r\n if (find(e, data) !== true) {\r\n fi ndAll(e, find, data);\r\n }\r\n e = e.nextElementSibling;\r\n }\r\n retu rn null;\r\n}\r\n\r\n// walk all shadowRoots on a given node.\r\nfunction forRoo ts(node, cb) {\r\n var root = node.shadowRoot;\r\n while(root) {\r\n forSub tree(root, cb);\r\n root = root.olderShadowRoot;\r\n }\r\n}\r\n\r\n// walk t he subtree rooted at node, including descent into shadow-roots,\r\n// applying ' cb' to each element\r\nfunction forSubtree(node, cb) {\r\n //logFlags.dom && no de.childNodes && node.childNodes.length && console.group('subTree: ', node);\r\n findAll(node, function(e) {\r\n if (cb(e)) {\r\n return true;\r\n } \r\n forRoots(e, cb);\r\n });\r\n forRoots(node, cb);\r\n //logFlags.dom & & node.childNodes && node.childNodes.length && console.groupEnd();\r\n}\r\n\r\n/ / manage lifecycle on added node\r\nfunction added(node) {\r\n if (upgrade(node )) {\r\n insertedNode(node);\r\n return true;\r\n }\r\n inserted(node);\ r\n}\r\n\r\n// manage lifecycle on added node's subtree only\r\nfunction addedSu btree(node) {\r\n forSubtree(node, function(e) {\r\n if (added(e)) {\r\n return true;\r\n }\r\n });\r\n}\r\n\r\n// manage lifecycle on added node a nd it's subtree\r\nfunction addedNode(node) {\r\n return added(node) || addedSu btree(node);\r\n}\r\n\r\n// upgrade custom elements at node, if applicable\r\nfu nction upgrade(node) {\r\n if (!node.__upgraded__ && node.nodeType === Node.ELE MENT_NODE) {\r\n var type = node.getAttribute('is') || node.localName;\r\n var definition = scope.registry[type];\r\n if (definition) {\r\n logFla gs.dom && console.group('upgrade:', node.localName);\r\n scope.upgrade(node );\r\n logFlags.dom && console.groupEnd();\r\n return true;\r\n }\r \n }\r\n}\r\n\r\nfunction insertedNode(node) {\r\n inserted(node);\r\n if (in Document(node)) {\r\n forSubtree(node, function(e) {\r\n inserted(e);\r\ n });\r\n }\r\n}\r\n\r\n// TODO(sorvell): on platforms without MutationObser ver, mutations may not be\r\n// reliable and therefore attached/detached are not reliable.\r\n// To make these callbacks less likely to fail, we defer all inser ts and removes\r\n// to give a chance for elements to be inserted into dom.\r\n/ / This ensures attachedCallback fires for elements that are created and\r\n// im mediately added to dom.\r\nvar hasPolyfillMutations = (!window.MutationObserver ||\r\n (window.MutationObserver === window.JsMutationObserver));\r\nscope.has PolyfillMutations = hasPolyfillMutations;\r\n\r\nvar isPendingMutations = false; \r\nvar pendingMutations = [];\r\nfunction deferMutation(fn) {\r\n pendingMutat ions.push(fn);\r\n if (!isPendingMutations) {\r\n isPendingMutations = true; \r\n var async = (window.Platform && window.Platform.endOfMicrotask) ||\r\n setTimeout;\r\n async(takeMutations);\r\n }\r\n}\r\n\r\nfunction takeM utations() {\r\n isPendingMutations = false;\r\n var $p = pendingMutations;\r\ n for (var i=0, l=$p.length, p; (i<l) && (p=$p[i]); i++) {\r\n p();\r\n }\r \n pendingMutations = [];\r\n}\r\n\r\nfunction inserted(element) {\r\n if (has PolyfillMutations) {\r\n deferMutation(function() {\r\n _inserted(elemen t);\r\n });\r\n } else {\r\n _inserted(element);\r\n }\r\n}\r\n\r\n// TO DO(sjmiles): if there are descents into trees that can never have inDocument(*) true, fix this\r\nfunction _inserted(element) {\r\n // TODO(sjmiles): it's poss ible we were inserted and removed in the space\r\n // of one microtask, in whic h case we won't be 'inDocument' here\r\n // But there are other cases where we are testing for inserted without\r\n // specific knowledge of mutations, and mu st test 'inDocument' to determine\r\n // whether to call inserted\r\n // If we can factor these cases into separate code paths we can have\r\n // better diag nostics.\r\n // TODO(sjmiles): when logging, do work on all custom elements so we can\r\n // track behavior even when callbacks not defined\r\n //console.log ('inserted: ', element.localName);\r\n if (element.attachedCallback || element. detachedCallback || (element.__upgraded__ && logFlags.dom)) {\r\n logFlags.do m && console.group('inserted:', element.localName);\r\n if (inDocument(elemen t)) {\r\n element.__inserted = (element.__inserted || 0) + 1;\r\n // i f we are in a 'removed' state, bluntly adjust to an 'inserted' state\r\n if (element.__inserted < 1) {\r\n element.__inserted = 1;\r\n }\r\n // if we are 'over inserted', squelch the callback\r\n if (element.__ins erted > 1) {\r\n logFlags.dom && console.warn('inserted:', element.localN ame,\r\n 'insert/remove count:', element.__inserted)\r\n } else if (element.attachedCallback) {\r\n logFlags.dom && console.log('inserted:' , element.localName);\r\n element.attachedCallback();\r\n }\r\n } \r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\nfunction removedN ode(node) {\r\n removed(node);\r\n forSubtree(node, function(e) {\r\n remov ed(e);\r\n });\r\n}\r\n\r\nfunction removed(element) {\r\n if (hasPolyfillMuta tions) {\r\n deferMutation(function() {\r\n _removed(element);\r\n }) ;\r\n } else {\r\n _removed(element);\r\n }\r\n}\r\n\r\nfunction _removed(e lement) {\r\n // TODO(sjmiles): temporary: do work on all custom elements so we can track\r\n // behavior even when callbacks not defined\r\n if (element.att achedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.d om)) {\r\n logFlags.dom && console.group('removed:', element.localName);\r\n if (!inDocument(element)) {\r\n element.__inserted = (element.__inserted || 0) - 1;\r\n // if we are in a 'inserted' state, bluntly adjust to an 'r emoved' state\r\n if (element.__inserted > 0) {\r\n element.__insert ed = 0;\r\n }\r\n // if we are 'over removed', squelch the callback\r\ n if (element.__inserted < 0) {\r\n logFlags.dom && console.warn('re moved:', element.localName,\r\n 'insert/remove count:', element.__ins erted)\r\n } else if (element.detachedCallback) {\r\n element.detach edCallback();\r\n }\r\n }\r\n logFlags.dom && console.groupEnd();\r\n }\r\n}\r\n\r\n// SD polyfill intrustion due mainly to the fact that 'document' \r\n// is not entirely wrapped\r\nfunction wrapIfNeeded(node) {\r\n return wind ow.ShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node)\r\n : node;\r\n }\r\n\r\nfunction inDocument(element) {\r\n var p = element;\r\n var doc = wra pIfNeeded(document);\r\n while (p) {\r\n if (p == doc) {\r\n return tru e;\r\n }\r\n p = p.parentNode || p.host;\r\n }\r\n}\r\n\r\nfunction watch Shadow(node) {\r\n if (node.shadowRoot && !node.shadowRoot.__watched) {\r\n logFlags.dom && console.log('watching shadow-root for: ', node.localName);\r\n // watch all unwatched roots...\r\n var root = node.shadowRoot;\r\n whil e (root) {\r\n watchRoot(root);\r\n root = root.olderShadowRoot;\r\n }\r\n }\r\n}\r\n\r\nfunction watchRoot(root) {\r\n if (!root.__watched) {\r\ n observe(root);\r\n root.__watched = true;\r\n }\r\n}\r\n\r\nfunction ha ndler(mutations) {\r\n //\r\n if (logFlags.dom) {\r\n var mx = mutations[0] ;\r\n if (mx && mx.type === 'childList' && mx.addedNodes) {\r\n if (mx .addedNodes) {\r\n var d = mx.addedNodes[0];\r\n while (d && d !== document && !d.host) {\r\n d = d.parentNode;\r\n }\r\n var u = d && (d.URL || d._URL || (d.host && d.host.localName)) || '';\r \n u = u.split('/?').shift().split('/').pop();\r\n }\r\n }\r\ n console.group('mutations (%d) [%s]', mutations.length, u || '');\r\n }\r\n //\r\n mutations.forEach(function(mx) {\r\n //logFlags.dom && console.grou p('mutation');\r\n if (mx.type === 'childList') {\r\n forEach(mx.addedNo des, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n return;\r\n }\r\n // nodes a dded may need lifecycle management\r\n addedNode(n);\r\n });\r\n // removed nodes may need lifecycle management\r\n forEach(mx.removedNode s, function(n) {\r\n //logFlags.dom && console.log(n.localName);\r\n if (!n.localName) {\r\n return;\r\n }\r\n removedNode( n);\r\n });\r\n }\r\n //logFlags.dom && console.groupEnd();\r\n });\ r\n logFlags.dom && console.groupEnd();\r\n};\r\n\r\nvar observer = new Mutatio nObserver(handler);\r\n\r\nfunction takeRecords() {\r\n // TODO(sjmiles): ask R af why we have to call handler ourselves\r\n handler(observer.takeRecords());\r \n takeMutations();\r\n}\r\n\r\nvar forEach = Array.prototype.forEach.call.bind (Array.prototype.forEach);\r\n\r\nfunction observe(inRoot) {\r\n observer.obser ve(inRoot, {childList: true, subtree: true});\r\n}\r\n\r\nfunction observeDocume nt(doc) {\r\n observe(doc);\r\n}\r\n\r\nfunction upgradeDocument(doc) {\r\n lo gFlags.dom && console.group('upgradeDocument: ', (doc.baseURI).split('/').pop()) ;\r\n addedNode(doc);\r\n logFlags.dom && console.groupEnd();\r\n}\r\n\r\nfunc tion upgradeDocumentTree(doc) {\r\n doc = wrapIfNeeded(doc);\r\n //console.log ('upgradeDocumentTree: ', (doc.baseURI).split('/').pop());\r\n // upgrade conta ined imported documents\r\n var imports = doc.querySelectorAll('link[rel=' + IM PORT_LINK_TYPE + ']');\r\n for (var i=0, l=imports.length, n; (i<l) && (n=impor ts[i]); i++) {\r\n if (n.import && n.import.__parsed) {\r\n upgradeDocum entTree(n.import);\r\n }\r\n }\r\n upgradeDocument(doc);\r\n}\r\n\r\n// exp orts\r\nscope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\r\nscope.watchShadow = watchS hadow;\r\nscope.upgradeDocumentTree = upgradeDocumentTree;\r\nscope.upgradeAll = addedNode;\r\nscope.upgradeSubtree = addedSubtree;\r\nscope.insertedNode = inse rtedNode;\r\n\r\nscope.observeDocument = observeDocument;\r\nscope.upgradeDocume nt = upgradeDocument;\r\n\r\nscope.takeRecords = takeRecords;\r\n\r\n})(window.C ustomElements);\r\n",
172 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Implements `document.register`\n * @module Custom Elements\n*/\n\n/**\n * Polyfilled extensions to the `document` object.\n * @cla ss Document\n*/\n\n(function(scope) {\n\n// imports\n\nif (!scope) {\n scope = window.CustomElements = {flags:{}};\n}\nvar flags = scope.flags;\n\n// native do cument.registerElement?\n\nvar hasNative = Boolean(document.registerElement);\n/ / TODO(sorvell): See https://github.com/Polymer/polymer/issues/399\n// we'll add ress this by defaulting to CE polyfill in the presence of the SD\n// polyfill. T his will avoid spamming excess attached/detached callbacks.\n// If there is a co mpelling need to run CE native with SD polyfill,\n// we'll need to fix this issu e.\nvar useNative = !flags.register && hasNative && !window.ShadowDOMPolyfill;\n \nif (useNative) {\n\n // stub\n var nop = function() {};\n\n // exports\n s cope.registry = {};\n scope.upgradeElement = nop;\n\n scope.watchShadow = nop; \n scope.upgrade = nop;\n scope.upgradeAll = nop;\n scope.upgradeSubtree = no p;\n scope.observeDocument = nop;\n scope.upgradeDocument = nop;\n scope.upgr adeDocumentTree = nop;\n scope.takeRecords = nop;\n\n} else {\n\n /**\n * Re gisters a custom tag name with the document.\n *\n * When a registered eleme nt is created, a `readyCallback` method is called\n * in the scope of the elem ent. The `readyCallback` method can be specified on\n * either `options.protot ype` or `options.lifecycle` with the latter taking\n * precedence.\n *\n * @method register\n * @param {String} name The tag name to register. Must incl ude a dash ('-'),\n * for example 'x-component'.\n * @param {Object} opti ons\n * @param {String} [options.extends]\n * (_off spec_) Tag name of an element to extend (or blank for a new\n * element). This parameter is not part of the specification, but instead\n * is a hint for the polyf ill because the extendee is difficult to infer.\n * Remember that the inp ut prototype must chain to the extended element's\n * prototype (or HTMLE lement.prototype) regardless of the value of\n * `extends`.\n * @par am {Object} options.prototype The prototype to use for the new\n * elemen t. The prototype must inherit from HTMLElement.\n * @param {Object} [option s.lifecycle]\n * Callbacks that fire at important phases in the life of t he custom\n * element.\n *\n * @example\n * FancyButton = docu ment.registerElement(\"fancy-button\", {\n * extends: 'button',\n * prototype: Object.create(HTMLButtonElement.prototype, {\n * rea dyCallback: {\n * value: function() {\n * console.lo g(\"a fancy-button was created\",\n * }\n * }\n * })\n * });\n * @return {Function} Constructor for the newly register ed type.\n */\n function register(name, options) {\n //console.warn('docum ent.registerElement(\"' + name + '\", ', options, ')');\n // construct a defi ntion out of options\n // TODO(sjmiles): probably should clone options instea d of mutating it\n var definition = options || {};\n if (!name) {\n / / TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('document.registerElement: first argum ent `name` must not be empty');\n }\n if (name.indexOf('-') < 0) {\n // TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('document.registerElement: first argu ment (\\'name\\') must contain a dash (\\'-\\'). Argument provided was \\'' + St ring(name) + '\\'.');\n }\n // elements may only be registered once\n i f (getRegisteredDefinition(name)) {\n throw new Error('DuplicateDefinitionE rror: a type with name \\'' + String(name) + '\\' is already registered');\n }\n // must have a prototype, default to an extension of HTMLElement\n // TODO(sjmiles): probably should throw if no prototype, check spec\n if (!defin ition.prototype) {\n // TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('Options mi ssing required prototype property');\n }\n // record name\n definition. __name = name.toLowerCase();\n // ensure a lifecycle object so we don't have to null test it\n definition.lifecycle = definition.lifecycle || {};\n // build a list of ancestral custom elements (for native base detection)\n // TO DO(sjmiles): we used to need to store this, but current code only\n // uses i t in 'resolveTagName': it should probably be inlined\n definition.ancestry = ancestry(definition.extends);\n // extensions of native specializations of HT MLElement require localName\n // to remain native, and use secondary 'is' spe cifier for extension type\n resolveTagName(definition);\n // some platform s require modifications to the user-supplied prototype\n // chain\n resolv ePrototypeChain(definition);\n // overrides to implement attributeChanged cal lback\n overrideAttributeApi(definition.prototype);\n // 7.1.5: Register t he DEFINITION with DOCUMENT\n registerDefinition(definition.__name, definitio n);\n // 7.1.7. Run custom element constructor generation algorithm with PROT OTYPE\n // 7.1.8. Return the output of the previous step.\n definition.cto r = generateConstructor(definition);\n definition.ctor.prototype = definition .prototype;\n // force our .constructor to be our actual constructor\n def inition.prototype.constructor = definition.ctor;\n // if initial parsing is c omplete\n if (scope.ready) {\n // upgrade any pre-existing nodes of this type\n scope.upgradeDocumentTree(document);\n }\n return definition. ctor;\n }\n\n function ancestry(extnds) {\n var extendee = getRegisteredDef inition(extnds);\n if (extendee) {\n return ancestry(extendee.extends).c oncat([extendee]);\n }\n return [];\n }\n\n function resolveTagName(defi nition) {\n // if we are explicitly extending something, that thing is our\n // baseTag, unless it represents a custom component\n var baseTag = defini tion.extends;\n // if our ancestry includes custom components, we only have a \n // baseTag if one of them does\n for (var i=0, a; (a=definition.ancestr y[i]); i++) {\n baseTag = a.is && a.tag;\n }\n // our tag is our base Tag, if it exists, and otherwise just our name\n definition.tag = baseTag || definition.__name;\n if (baseTag) {\n // if there is a base tag, use sec ondary 'is' specifier\n definition.is = definition.__name;\n }\n }\n\n function resolvePrototypeChain(definition) {\n // if we don't support __prot o__ we need to locate the native level\n // prototype for precise mixing in\n if (!Object.__proto__) {\n // default prototype\n var nativeProtot ype = HTMLElement.prototype;\n // work out prototype when using type-extens ion\n if (definition.is) {\n var inst = document.createElement(defin ition.tag);\n nativePrototype = Object.getPrototypeOf(inst);\n }\n // ensure __proto__ reference is installed at each point on the prototype\n // chain.\n // NOTE: On platforms without __proto__, a mixin strategy is used instead\n // of prototype swizzling. In this case, this generated _ _proto__ provides\n // limited support for prototype traversal.\n var proto = definition.prototype, ancestor;\n while (proto && (proto !== native Prototype)) {\n var ancestor = Object.getPrototypeOf(proto);\n pro to.__proto__ = ancestor;\n proto = ancestor;\n }\n }\n // cach e this in case of mixin\n definition.native = nativePrototype;\n }\n\n // S ECTION 4\n\n function instantiate(definition) {\n // 4.a.1. Create a new obj ect that implements PROTOTYPE\n // 4.a.2. Let ELEMENT by this new object\n //\n // the custom element instantiation algorithm must also ensure that the \n // output is a valid DOM element with the proper wrapper in place.\n // \n return upgrade(domCreateElement(definition.tag), definition);\n }\n\n fu nction upgrade(element, definition) {\n // some definitions specify an 'is' a ttribute\n if (definition.is) {\n element.setAttribute('is', definition. is);\n }\n // remove 'unresolved' attr, which is a standin for :unresolved .\n element.removeAttribute('unresolved');\n // make 'element' implement d efinition.prototype\n implement(element, definition);\n // flag as upgrade d\n element.__upgraded__ = true;\n // lifecycle management\n created(el ement);\n // attachedCallback fires in tree order, call before recursing\n scope.insertedNode(element);\n // there should never be a shadow root on ele ment at this point\n scope.upgradeSubtree(element);\n // OUTPUT\n retur n element;\n }\n\n function implement(element, definition) {\n // prototype swizzling is best\n if (Object.__proto__) {\n element.__proto__ = defin ition.prototype;\n } else {\n // where above we can re-acquire inPrototy pe via\n // getPrototypeOf(Element), we cannot do so when\n // we use mixin, so we install a magic reference\n customMixin(element, definition.pr ototype, definition.native);\n element.__proto__ = definition.prototype;\n }\n }\n\n function customMixin(inTarget, inSrc, inNative) {\n // TODO(sj miles): 'used' allows us to only copy the 'youngest' version of\n // any prop erty. This set should be precalculated. We also need to\n // consider this fo r supporting 'super'.\n var used = {};\n // start with inSrc\n var p = inSrc;\n // The default is HTMLElement.prototype, so we add a test to avoid m ixing in\n // native prototypes\n while (p !== inNative && p !== HTMLEleme nt.prototype) {\n var keys = Object.getOwnPropertyNames(p);\n for (var i=0, k; k=keys[i]; i++) {\n if (!used[k]) {\n Object.defineProp erty(inTarget, k,\n Object.getOwnPropertyDescriptor(p, k));\n used[k] = 1;\n }\n }\n p = Object.getPrototypeOf(p);\n } \n }\n\n function created(element) {\n // invoke createdCallback\n if (e lement.createdCallback) {\n element.createdCallback();\n }\n }\n\n // attribute watching\n\n function overrideAttributeApi(prototype) {\n // overr ides to implement callbacks\n // TODO(sjmiles): should support access via .at tributes NamedNodeMap\n // TODO(sjmiles): preserves user defined overrides, i f any\n if (prototype.setAttribute._polyfilled) {\n return;\n }\n var setAttribute = prototype.setAttribute;\n prototype.setAttribute = functio n(name, value) {\n changeAttribute.call(this, name, value, setAttribute);\n }\n var removeAttribute = prototype.removeAttribute;\n prototype.remov eAttribute = function(name) {\n changeAttribute.call(this, name, null, remo veAttribute);\n }\n prototype.setAttribute._polyfilled = true;\n }\n\n / / https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/\n // index.htm l#dfn-attribute-changed-callback\n function changeAttribute(name, value, operat ion) {\n var oldValue = this.getAttribute(name);\n operation.apply(this, a rguments);\n var newValue = this.getAttribute(name);\n if (this.attributeC hangedCallback\n && (newValue !== oldValue)) {\n this.attributeChang edCallback(name, oldValue, newValue);\n }\n }\n\n // element registry (maps tag names to definitions)\n\n var registry = {};\n\n function getRegisteredDe finition(name) {\n if (name) {\n return registry[name.toLowerCase()];\n }\n }\n\n function registerDefinition(name, definition) {\n registry[nam e] = definition;\n }\n\n function generateConstructor(definition) {\n retur n function() {\n return instantiate(definition);\n };\n }\n\n var HTML _NAMESPACE = 'http://www.w3.org/1999/xhtml';\n function createElementNS(namespa ce, tag, typeExtension) {\n // NOTE: we do not support non-HTML elements,\n // just call createElementNS for non HTML Elements\n if (namespace === HTML _NAMESPACE) {\n return createElement(tag, typeExtension);\n } else {\n return domCreateElementNS(namespace, tag);\n }\n }\n\n function createE lement(tag, typeExtension) {\n // TODO(sjmiles): ignore 'tag' when using 'typ eExtension', we could\n // error check it, or perhaps there should only ever be one argument\n var definition = getRegisteredDefinition(typeExtension || t ag);\n if (definition) {\n if (tag == definition.tag && typeExtension == definition.is) {\n return new definition.ctor();\n }\n // Hand le empty string for type extension.\n if (!typeExtension && !definition.is) {\n return new definition.ctor();\n }\n }\n\n if (typeExtensi on) {\n var element = createElement(tag);\n element.setAttribute('is', typeExtension);\n return element;\n }\n var element = domCreateEleme nt(tag);\n // Custom tags should be HTMLElements even if not upgraded.\n i f (tag.indexOf('-') >= 0) {\n implement(element, HTMLElement);\n }\n return element;\n }\n\n function upgradeElement(element) {\n if (!element._ _upgraded__ && (element.nodeType === Node.ELEMENT_NODE)) {\n var is = eleme nt.getAttribute('is');\n var definition = getRegisteredDefinition(is || ele ment.localName);\n if (definition) {\n if (is && definition.tag == e lement.localName) {\n return upgrade(element, definition);\n } e lse if (!is && !definition.extends) {\n return upgrade(element, definit ion);\n }\n }\n }\n }\n\n function cloneNode(deep) {\n // ca ll original clone\n var n = domCloneNode.call(this, deep);\n // upgrade th e element and subtree\n scope.upgradeAll(n);\n // return the clone\n re turn n;\n }\n // capture native createElement before we override it\n\n var d omCreateElement = document.createElement.bind(document);\n var domCreateElement NS = document.createElementNS.bind(document);\n\n // capture native cloneNode b efore we override it\n\n var domCloneNode = Node.prototype.cloneNode;\n\n // e xports\n\n document.registerElement = register;\n document.createElement = cre ateElement; // override\n document.createElementNS = createElementNS; // overri de\n Node.prototype.cloneNode = cloneNode; // override\n\n scope.registry = re gistry;\n\n /**\n * Upgrade an element to a custom element. Upgrading an elem ent\n * causes the custom prototype to be applied, an `is` attribute\n * to be attached (as needed), and invocation of the `readyCallback`.\n * `upgrade` does nothing if the element is already upgraded, or\n * if it matches no regis tered custom tag name.\n *\n * @method ugprade\n * @param {Element} elemen t The element to upgrade.\n * @return {Element} The upgraded element.\n */\n scope.upgrade = upgradeElement;\n}\n\n// Create a custom 'instanceof'. This is necessary when CustomElements\n// are implemented via a mixin strategy, as for example on IE10.\nvar isInstance;\nif (!Object.__proto__ && !useNative) {\n isI nstance = function(obj, ctor) {\n var p = obj;\n while (p) {\n // NOT E: this is not technically correct since we're not checking if\n // an obje ct is an instance of a constructor; however, this should\n // be good enoug h for the mixin strategy.\n if (p === ctor.prototype) {\n return tru e;\n }\n p = p.__proto__;\n }\n return false;\n }\n} else {\n isInstance = function(obj, base) {\n return obj instanceof base;\n }\n}\n\n/ / exports\nscope.instanceof = isInstance;\n\n// bc\ndocument.register = document .registerElement;\n\nscope.hasNative = hasNative;\nscope.useNative = useNative;\ n\n})(window.CustomElements);\n", 175 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Implements `document.register`\n * @module Custom Elements\n*/\n\n/**\n * Polyfilled extensions to the `document` object.\n * @cla ss Document\n*/\n\n(function(scope) {\n\n// imports\n\nif (!scope) {\n scope = window.CustomElements = {flags:{}};\n}\nvar flags = scope.flags;\n\n// native do cument.registerElement?\n\nvar hasNative = Boolean(document.registerElement);\n/ / TODO(sorvell): See https://github.com/Polymer/polymer/issues/399\n// we'll add ress this by defaulting to CE polyfill in the presence of the SD\n// polyfill. T his will avoid spamming excess attached/detached callbacks.\n// If there is a co mpelling need to run CE native with SD polyfill,\n// we'll need to fix this issu e.\nvar useNative = !flags.register && hasNative && !window.ShadowDOMPolyfill;\n \nif (useNative) {\n\n // stub\n var nop = function() {};\n\n // exports\n s cope.registry = {};\n scope.upgradeElement = nop;\n\n scope.watchShadow = nop; \n scope.upgrade = nop;\n scope.upgradeAll = nop;\n scope.upgradeSubtree = no p;\n scope.observeDocument = nop;\n scope.upgradeDocument = nop;\n scope.upgr adeDocumentTree = nop;\n scope.takeRecords = nop;\n\n} else {\n\n /**\n * Re gisters a custom tag name with the document.\n *\n * When a registered eleme nt is created, a `readyCallback` method is called\n * in the scope of the elem ent. The `readyCallback` method can be specified on\n * either `options.protot ype` or `options.lifecycle` with the latter taking\n * precedence.\n *\n * @method register\n * @param {String} name The tag name to register. Must incl ude a dash ('-'),\n * for example 'x-component'.\n * @param {Object} opti ons\n * @param {String} [options.extends]\n * (_off spec_) Tag name of an element to extend (or blank for a new\n * element). This parameter is not part of the specification, but instead\n * is a hint for the polyf ill because the extendee is difficult to infer.\n * Remember that the inp ut prototype must chain to the extended element's\n * prototype (or HTMLE lement.prototype) regardless of the value of\n * `extends`.\n * @par am {Object} options.prototype The prototype to use for the new\n * elemen t. The prototype must inherit from HTMLElement.\n * @param {Object} [option s.lifecycle]\n * Callbacks that fire at important phases in the life of t he custom\n * element.\n *\n * @example\n * FancyButton = docu ment.registerElement(\"fancy-button\", {\n * extends: 'button',\n * prototype: Object.create(HTMLButtonElement.prototype, {\n * rea dyCallback: {\n * value: function() {\n * console.lo g(\"a fancy-button was created\",\n * }\n * }\n * })\n * });\n * @return {Function} Constructor for the newly register ed type.\n */\n function register(name, options) {\n //console.warn('docum ent.registerElement(\"' + name + '\", ', options, ')');\n // construct a defi ntion out of options\n // TODO(sjmiles): probably should clone options instea d of mutating it\n var definition = options || {};\n if (!name) {\n / / TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('document.registerElement: first argum ent `name` must not be empty');\n }\n if (name.indexOf('-') < 0) {\n // TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('document.registerElement: first argu ment (\\'name\\') must contain a dash (\\'-\\'). Argument provided was \\'' + St ring(name) + '\\'.');\n }\n // elements may only be registered once\n i f (getRegisteredDefinition(name)) {\n throw new Error('DuplicateDefinitionE rror: a type with name \\'' + String(name) + '\\' is already registered');\n }\n // must have a prototype, default to an extension of HTMLElement\n // TODO(sjmiles): probably should throw if no prototype, check spec\n if (!defin ition.prototype) {\n // TODO(sjmiles): replace with more appropriate error (EricB can probably\n // offer guidance)\n throw new Error('Options mi ssing required prototype property');\n }\n // record name\n definition. __name = name.toLowerCase();\n // ensure a lifecycle object so we don't have to null test it\n definition.lifecycle = definition.lifecycle || {};\n // build a list of ancestral custom elements (for native base detection)\n // TO DO(sjmiles): we used to need to store this, but current code only\n // uses i t in 'resolveTagName': it should probably be inlined\n definition.ancestry = ancestry(definition.extends);\n // extensions of native specializations of HT MLElement require localName\n // to remain native, and use secondary 'is' spe cifier for extension type\n resolveTagName(definition);\n // some platform s require modifications to the user-supplied prototype\n // chain\n resolv ePrototypeChain(definition);\n // overrides to implement attributeChanged cal lback\n overrideAttributeApi(definition.prototype);\n // 7.1.5: Register t he DEFINITION with DOCUMENT\n registerDefinition(definition.__name, definitio n);\n // 7.1.7. Run custom element constructor generation algorithm with PROT OTYPE\n // 7.1.8. Return the output of the previous step.\n definition.cto r = generateConstructor(definition);\n definition.ctor.prototype = definition .prototype;\n // force our .constructor to be our actual constructor\n def inition.prototype.constructor = definition.ctor;\n // if initial parsing is c omplete\n if (scope.ready) {\n // upgrade any pre-existing nodes of this type\n scope.upgradeDocumentTree(document);\n }\n return definition. ctor;\n }\n\n function ancestry(extnds) {\n var extendee = getRegisteredDef inition(extnds);\n if (extendee) {\n return ancestry(extendee.extends).c oncat([extendee]);\n }\n return [];\n }\n\n function resolveTagName(defi nition) {\n // if we are explicitly extending something, that thing is our\n // baseTag, unless it represents a custom component\n var baseTag = defini tion.extends;\n // if our ancestry includes custom components, we only have a \n // baseTag if one of them does\n for (var i=0, a; (a=definition.ancestr y[i]); i++) {\n baseTag = a.is && a.tag;\n }\n // our tag is our base Tag, if it exists, and otherwise just our name\n definition.tag = baseTag || definition.__name;\n if (baseTag) {\n // if there is a base tag, use sec ondary 'is' specifier\n definition.is = definition.__name;\n }\n }\n\n function resolvePrototypeChain(definition) {\n // if we don't support __prot o__ we need to locate the native level\n // prototype for precise mixing in\n if (!Object.__proto__) {\n // default prototype\n var nativeProtot ype = HTMLElement.prototype;\n // work out prototype when using type-extens ion\n if (definition.is) {\n var inst = document.createElement(defin ition.tag);\n nativePrototype = Object.getPrototypeOf(inst);\n }\n // ensure __proto__ reference is installed at each point on the prototype\n // chain.\n // NOTE: On platforms without __proto__, a mixin strategy is used instead\n // of prototype swizzling. In this case, this generated _ _proto__ provides\n // limited support for prototype traversal.\n var proto = definition.prototype, ancestor;\n while (proto && (proto !== native Prototype)) {\n var ancestor = Object.getPrototypeOf(proto);\n pro to.__proto__ = ancestor;\n proto = ancestor;\n }\n }\n // cach e this in case of mixin\n definition.native = nativePrototype;\n }\n\n // S ECTION 4\n\n function instantiate(definition) {\n // 4.a.1. Create a new obj ect that implements PROTOTYPE\n // 4.a.2. Let ELEMENT by this new object\n //\n // the custom element instantiation algorithm must also ensure that the \n // output is a valid DOM element with the proper wrapper in place.\n // \n return upgrade(domCreateElement(definition.tag), definition);\n }\n\n fu nction upgrade(element, definition) {\n // some definitions specify an 'is' a ttribute\n if (definition.is) {\n element.setAttribute('is', definition. is);\n }\n // remove 'unresolved' attr, which is a standin for :unresolved .\n element.removeAttribute('unresolved');\n // make 'element' implement d efinition.prototype\n implement(element, definition);\n // flag as upgrade d\n element.__upgraded__ = true;\n // lifecycle management\n created(el ement);\n // attachedCallback fires in tree order, call before recursing\n scope.insertedNode(element);\n // there should never be a shadow root on ele ment at this point\n scope.upgradeSubtree(element);\n // OUTPUT\n retur n element;\n }\n\n function implement(element, definition) {\n // prototype swizzling is best\n if (Object.__proto__) {\n element.__proto__ = defin ition.prototype;\n } else {\n // where above we can re-acquire inPrototy pe via\n // getPrototypeOf(Element), we cannot do so when\n // we use mixin, so we install a magic reference\n customMixin(element, definition.pr ototype, definition.native);\n element.__proto__ = definition.prototype;\n }\n }\n\n function customMixin(inTarget, inSrc, inNative) {\n // TODO(sj miles): 'used' allows us to only copy the 'youngest' version of\n // any prop erty. This set should be precalculated. We also need to\n // consider this fo r supporting 'super'.\n var used = {};\n // start with inSrc\n var p = inSrc;\n // The default is HTMLElement.prototype, so we add a test to avoid m ixing in\n // native prototypes\n while (p !== inNative && p !== HTMLEleme nt.prototype) {\n var keys = Object.getOwnPropertyNames(p);\n for (var i=0, k; k=keys[i]; i++) {\n if (!used[k]) {\n Object.defineProp erty(inTarget, k,\n Object.getOwnPropertyDescriptor(p, k));\n used[k] = 1;\n }\n }\n p = Object.getPrototypeOf(p);\n } \n }\n\n function created(element) {\n // invoke createdCallback\n if (e lement.createdCallback) {\n element.createdCallback();\n }\n }\n\n // attribute watching\n\n function overrideAttributeApi(prototype) {\n // overr ides to implement callbacks\n // TODO(sjmiles): should support access via .at tributes NamedNodeMap\n // TODO(sjmiles): preserves user defined overrides, i f any\n if (prototype.setAttribute._polyfilled) {\n return;\n }\n var setAttribute = prototype.setAttribute;\n prototype.setAttribute = functio n(name, value) {\n changeAttribute.call(this, name, value, setAttribute);\n }\n var removeAttribute = prototype.removeAttribute;\n prototype.remov eAttribute = function(name) {\n changeAttribute.call(this, name, null, remo veAttribute);\n }\n prototype.setAttribute._polyfilled = true;\n }\n\n / / https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/\n // index.htm l#dfn-attribute-changed-callback\n function changeAttribute(name, value, operat ion) {\n var oldValue = this.getAttribute(name);\n operation.apply(this, a rguments);\n var newValue = this.getAttribute(name);\n if (this.attributeC hangedCallback\n && (newValue !== oldValue)) {\n this.attributeChang edCallback(name, oldValue, newValue);\n }\n }\n\n // element registry (maps tag names to definitions)\n\n var registry = {};\n\n function getRegisteredDe finition(name) {\n if (name) {\n return registry[name.toLowerCase()];\n }\n }\n\n function registerDefinition(name, definition) {\n registry[nam e] = definition;\n }\n\n function generateConstructor(definition) {\n retur n function() {\n return instantiate(definition);\n };\n }\n\n var HTML _NAMESPACE = 'http://www.w3.org/1999/xhtml';\n function createElementNS(namespa ce, tag, typeExtension) {\n // NOTE: we do not support non-HTML elements,\n // just call createElementNS for non HTML Elements\n if (namespace === HTML _NAMESPACE) {\n return createElement(tag, typeExtension);\n } else {\n return domCreateElementNS(namespace, tag);\n }\n }\n\n function createE lement(tag, typeExtension) {\n // TODO(sjmiles): ignore 'tag' when using 'typ eExtension', we could\n // error check it, or perhaps there should only ever be one argument\n var definition = getRegisteredDefinition(typeExtension || t ag);\n if (definition) {\n if (tag == definition.tag && typeExtension == definition.is) {\n return new definition.ctor();\n }\n // Hand le empty string for type extension.\n if (!typeExtension && !definition.is) {\n return new definition.ctor();\n }\n }\n\n if (typeExtensi on) {\n var element = createElement(tag);\n element.setAttribute('is', typeExtension);\n return element;\n }\n var element = domCreateEleme nt(tag);\n // Custom tags should be HTMLElements even if not upgraded.\n i f (tag.indexOf('-') >= 0) {\n implement(element, HTMLElement);\n }\n return element;\n }\n\n function upgradeElement(element) {\n if (!element._ _upgraded__ && (element.nodeType === Node.ELEMENT_NODE)) {\n var is = eleme nt.getAttribute('is');\n var definition = getRegisteredDefinition(is || ele ment.localName);\n if (definition) {\n if (is && definition.tag == e lement.localName) {\n return upgrade(element, definition);\n } e lse if (!is && !definition.extends) {\n return upgrade(element, definit ion);\n }\n }\n }\n }\n\n function cloneNode(deep) {\n // ca ll original clone\n var n = domCloneNode.call(this, deep);\n // upgrade th e element and subtree\n scope.upgradeAll(n);\n // return the clone\n re turn n;\n }\n // capture native createElement before we override it\n\n var d omCreateElement = document.createElement.bind(document);\n var domCreateElement NS = document.createElementNS.bind(document);\n\n // capture native cloneNode b efore we override it\n\n var domCloneNode = Node.prototype.cloneNode;\n\n // e xports\n\n document.registerElement = register;\n document.createElement = cre ateElement; // override\n document.createElementNS = createElementNS; // overri de\n Node.prototype.cloneNode = cloneNode; // override\n\n scope.registry = re gistry;\n\n /**\n * Upgrade an element to a custom element. Upgrading an elem ent\n * causes the custom prototype to be applied, an `is` attribute\n * to be attached (as needed), and invocation of the `readyCallback`.\n * `upgrade` does nothing if the element is already upgraded, or\n * if it matches no regis tered custom tag name.\n *\n * @method ugprade\n * @param {Element} elemen t The element to upgrade.\n * @return {Element} The upgraded element.\n */\n scope.upgrade = upgradeElement;\n}\n\n// Create a custom 'instanceof'. This is necessary when CustomElements\n// are implemented via a mixin strategy, as for example on IE10.\nvar isInstance;\nif (!Object.__proto__ && !useNative) {\n isI nstance = function(obj, ctor) {\n var p = obj;\n while (p) {\n // NOT E: this is not technically correct since we're not checking if\n // an obje ct is an instance of a constructor; however, this should\n // be good enoug h for the mixin strategy.\n if (p === ctor.prototype) {\n return tru e;\n }\n p = p.__proto__;\n }\n return false;\n }\n} else {\n isInstance = function(obj, base) {\n return obj instanceof base;\n }\n}\n\n/ / exports\nscope.instanceof = isInstance;\n\n// bc\ndocument.register = document .registerElement;\n\nscope.hasNative = hasNative;\nscope.useNative = useNative;\ n\n})(window.CustomElements);\n",
173 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n// import\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n\n// highlander object for parsing a document tree\n\n var parser = {\n selectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ],\n map: {\n link: 'parseLink'\n },\n parse: function(inDocument) {\n if ( !inDocument.__parsed) {\n // only parse once\n inDocument.__parsed = t rue;\n // all parsable elements in inDocument (depth-first pre-order traver sal)\n var elts = inDocument.querySelectorAll(parser.selectors);\n // for each parsable node type, call the mapped parsing method\n forEach(elts, function(e) {\n parser[parser.map[e.localName]](e);\n });\n // upgrade all upgradeable static elements, anything dynamically\n // created should be caught by observer\n CustomElements.upgradeDocument(inDocument); \n // observe document for dom changes\n CustomElements.observeDocumen t(inDocument);\n }\n },\n parseLink: function(linkElt) {\n // imports\n if (isDocumentLink(linkElt)) {\n this.parseImport(linkElt);\n }\n }, \n parseImport: function(linkElt) {\n if (linkElt.import) {\n parser.pa rse(linkElt.import);\n }\n }\n};\n\nfunction isDocumentLink(inElt) {\n retu rn (inElt.localName === 'link'\n && inElt.getAttribute('rel') === IMPORT_LI NK_TYPE);\n}\n\nvar forEach = Array.prototype.forEach.call.bind(Array.prototype. forEach);\n\n// exports\n\nscope.parser = parser;\nscope.IMPORT_LINK_TYPE = IMPO RT_LINK_TYPE;\n\n})(window.CustomElements);", 176 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n\n// import\n\nvar IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n\n// highlander object for parsing a document tree\n\n var parser = {\n selectors: [\n 'link[rel=' + IMPORT_LINK_TYPE + ']'\n ],\n map: {\n link: 'parseLink'\n },\n parse: function(inDocument) {\n if ( !inDocument.__parsed) {\n // only parse once\n inDocument.__parsed = t rue;\n // all parsable elements in inDocument (depth-first pre-order traver sal)\n var elts = inDocument.querySelectorAll(parser.selectors);\n // for each parsable node type, call the mapped parsing method\n forEach(elts, function(e) {\n parser[parser.map[e.localName]](e);\n });\n // upgrade all upgradeable static elements, anything dynamically\n // created should be caught by observer\n CustomElements.upgradeDocument(inDocument); \n // observe document for dom changes\n CustomElements.observeDocumen t(inDocument);\n }\n },\n parseLink: function(linkElt) {\n // imports\n if (isDocumentLink(linkElt)) {\n this.parseImport(linkElt);\n }\n }, \n parseImport: function(linkElt) {\n if (linkElt.import) {\n parser.pa rse(linkElt.import);\n }\n }\n};\n\nfunction isDocumentLink(inElt) {\n retu rn (inElt.localName === 'link'\n && inElt.getAttribute('rel') === IMPORT_LI NK_TYPE);\n}\n\nvar forEach = Array.prototype.forEach.call.bind(Array.prototype. forEach);\n\n// exports\n\nscope.parser = parser;\nscope.IMPORT_LINK_TYPE = IMPO RT_LINK_TYPE;\n\n})(window.CustomElements);",
174 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope){\n\n// bootstrap parsing\nfunction bootstr ap() {\n // parse document\n CustomElements.parser.parse(document);\n // one more pass before register is 'live'\n CustomElements.upgradeDocument(document); \n // choose async\n var async = window.Platform && Platform.endOfMicrotask ? \n Platform.endOfMicrotask :\n setTimeout;\n async(function() {\n // s et internal 'ready' flag, now document.registerElement will trigger \n // syn chronous upgrades\n CustomElements.ready = true;\n // capture blunt profil ing data\n CustomElements.readyTime = Date.now();\n if (window.HTMLImports ) {\n CustomElements.elapsed = CustomElements.readyTime - HTMLImports.ready Time;\n }\n // notify the system that we are bootstrapped\n document.di spatchEvent(\n new CustomEvent('WebComponentsReady', {bubbles: true})\n );\n\n // install upgrade hook if HTMLImports are available\n if (window.H TMLImports) {\n HTMLImports.__importsParsingHook = function(elt) {\n CustomElements.parser.parse(elt.import);\n }\n }\n });\n}\n\n// Custom Event shim for IE\nif (typeof window.CustomEvent !== 'function') {\n window.Cus tomEvent = function(inType) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent(inType, true, true);\n return e;\n };\n}\n\n// When loading at readyState complete time (or via flag), boot custom elements\n// immediately. \n// If relevant, HTMLImports must already be loaded.\nif (document.readyState = == 'complete' || scope.flags.eager) {\n bootstrap();\n// When loading at readyS tate interactive time, bootstrap only if HTMLImports\n// are not pending. Also a void IE as the semantics of this state are unreliable.\n} else if (document.read yState === 'interactive' && !window.attachEvent &&\n (!window.HTMLImports || window.HTMLImports.ready)) {\n bootstrap();\n// When loading at other readyStat es, wait for the appropriate DOM event to \n// bootstrap.\n} else {\n var loadE vent = window.HTMLImports && !HTMLImports.ready ?\n 'HTMLImportsLoaded' : ' DOMContentLoaded';\n window.addEventListener(loadEvent, bootstrap);\n}\n\n})(wi ndow.CustomElements);\n", 177 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope){\n\n// bootstrap parsing\nfunction bootstr ap() {\n // parse document\n CustomElements.parser.parse(document);\n // one more pass before register is 'live'\n CustomElements.upgradeDocument(document); \n // choose async\n var async = window.Platform && Platform.endOfMicrotask ? \n Platform.endOfMicrotask :\n setTimeout;\n async(function() {\n // s et internal 'ready' flag, now document.registerElement will trigger \n // syn chronous upgrades\n CustomElements.ready = true;\n // capture blunt profil ing data\n CustomElements.readyTime = Date.now();\n if (window.HTMLImports ) {\n CustomElements.elapsed = CustomElements.readyTime - HTMLImports.ready Time;\n }\n // notify the system that we are bootstrapped\n document.di spatchEvent(\n new CustomEvent('WebComponentsReady', {bubbles: true})\n );\n\n // install upgrade hook if HTMLImports are available\n if (window.H TMLImports) {\n HTMLImports.__importsParsingHook = function(elt) {\n CustomElements.parser.parse(elt.import);\n }\n }\n });\n}\n\n// Custom Event shim for IE\nif (typeof window.CustomEvent !== 'function') {\n window.Cus tomEvent = function(inType) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent(inType, true, true);\n return e;\n };\n}\n\n// When loading at readyState complete time (or via flag), boot custom elements\n// immediately. \n// If relevant, HTMLImports must already be loaded.\nif (document.readyState = == 'complete' || scope.flags.eager) {\n bootstrap();\n// When loading at readyS tate interactive time, bootstrap only if HTMLImports\n// are not pending. Also a void IE as the semantics of this state are unreliable.\n} else if (document.read yState === 'interactive' && !window.attachEvent &&\n (!window.HTMLImports || window.HTMLImports.ready)) {\n bootstrap();\n// When loading at other readyStat es, wait for the appropriate DOM event to \n// bootstrap.\n} else {\n var loadE vent = window.HTMLImports && !HTMLImports.ready ?\n 'HTMLImportsLoaded' : ' DOMContentLoaded';\n window.addEventListener(loadEvent, bootstrap);\n}\n\n})(wi ndow.CustomElements);\n",
175 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\nif (window.ShadowDOMPolyfill) {\n\n // en sure wrapped inputs for these functions\n var fns = ['upgradeAll', 'upgradeSubt ree', 'observeDocument',\n 'upgradeDocument'];\n\n // cache originals\n v ar original = {};\n fns.forEach(function(fn) {\n original[fn] = CustomElemen ts[fn];\n });\n\n // override\n fns.forEach(function(fn) {\n CustomElement s[fn] = function(inNode) {\n return original[fn](wrap(inNode));\n };\n });\n\n}\n\n})();\n", 178 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n\nif (window.ShadowDOMPolyfill) {\n\n // en sure wrapped inputs for these functions\n var fns = ['upgradeAll', 'upgradeSubt ree', 'observeDocument',\n 'upgradeDocument'];\n\n // cache originals\n v ar original = {};\n fns.forEach(function(fn) {\n original[fn] = CustomElemen ts[fn];\n });\n\n // override\n fns.forEach(function(fn) {\n CustomElement s[fn] = function(inNode) {\n return original[fn](wrap(inNode));\n };\n });\n\n}\n\n})();\n",
176 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n var endOfMicrotask = scope.endOfMicro task;\n\n // Generic url loader\n function Loader(regex) {\n this.regex = r egex;\n }\n Loader.prototype = {\n // TODO(dfreedm): there may be a better factoring here\n // extract absolute urls from the text (full of relative url s)\n extractUrls: function(text, base) {\n var matches = [];\n var matched, u;\n while ((matched = this.regex.exec(text))) {\n u = new URL(matched[1], base);\n matches.push({matched: matched[0], url: u.href}) ;\n }\n return matches;\n },\n // take a text blob, a root url, and a callback and load all the urls found within the text\n // returns a map of absolute url to text\n process: function(text, root, callback) {\n v ar matches = this.extractUrls(text, root);\n this.fetch(matches, {}, callba ck);\n },\n // build a mapping of url -> text from matches\n fetch: fun ction(matches, map, callback) {\n var inflight = matches.length;\n\n / / return early if there is no fetching to be done\n if (!inflight) {\n return callback(map);\n }\n\n var done = function() {\n if ( --inflight === 0) {\n callback(map);\n }\n };\n\n // m ap url -> responseText\n var handleXhr = function(err, request) {\n var match = request.match;\n var key = match.url;\n // handle erro rs with an empty string\n if (err) {\n map[key] = '';\n return done();\n }\n var response = request.response || request.r esponseText;\n map[key] = response;\n this.fetch(this.extractUrls( response, key), map, done);\n };\n\n var m, req, url;\n for (var i = 0; i < inflight; i++) {\n m = matches[i];\n url = m.url;\n // if this url has already been requested, skip requesting it again\n if (map[url]) {\n // Async call to done to simplify the inflight logic \n endOfMicrotask(done);\n continue;\n }\n req = this.xhr(url, handleXhr, this);\n req.match = m;\n // tag the map with an XHR request to deduplicate at the same level\n map[url] = req;\n }\n },\n xhr: function(url, callback, scope) {\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.send ();\n request.onload = function() {\n callback.call(scope, null, req uest);\n };\n request.onerror = function() {\n callback.call(sc ope, null, request);\n };\n return request;\n }\n };\n\n scope.Lo ader = Loader;\n})(window.Platform);\n", 179 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n var endOfMicrotask = scope.endOfMicro task;\n\n // Generic url loader\n function Loader(regex) {\n this.regex = r egex;\n }\n Loader.prototype = {\n // TODO(dfreedm): there may be a better factoring here\n // extract absolute urls from the text (full of relative url s)\n extractUrls: function(text, base) {\n var matches = [];\n var matched, u;\n while ((matched = this.regex.exec(text))) {\n u = new URL(matched[1], base);\n matches.push({matched: matched[0], url: u.href}) ;\n }\n return matches;\n },\n // take a text blob, a root url, and a callback and load all the urls found within the text\n // returns a map of absolute url to text\n process: function(text, root, callback) {\n v ar matches = this.extractUrls(text, root);\n this.fetch(matches, {}, callba ck);\n },\n // build a mapping of url -> text from matches\n fetch: fun ction(matches, map, callback) {\n var inflight = matches.length;\n\n / / return early if there is no fetching to be done\n if (!inflight) {\n return callback(map);\n }\n\n var done = function() {\n if ( --inflight === 0) {\n callback(map);\n }\n };\n\n // m ap url -> responseText\n var handleXhr = function(err, request) {\n var match = request.match;\n var key = match.url;\n // handle erro rs with an empty string\n if (err) {\n map[key] = '';\n return done();\n }\n var response = request.response || request.r esponseText;\n map[key] = response;\n this.fetch(this.extractUrls( response, key), map, done);\n };\n\n var m, req, url;\n for (var i = 0; i < inflight; i++) {\n m = matches[i];\n url = m.url;\n // if this url has already been requested, skip requesting it again\n if (map[url]) {\n // Async call to done to simplify the inflight logic \n endOfMicrotask(done);\n continue;\n }\n req = this.xhr(url, handleXhr, this);\n req.match = m;\n // tag the map with an XHR request to deduplicate at the same level\n map[url] = req;\n }\n },\n xhr: function(url, callback, scope) {\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.send ();\n request.onload = function() {\n callback.call(scope, null, req uest);\n };\n request.onerror = function() {\n callback.call(sc ope, null, request);\n };\n return request;\n }\n };\n\n scope.Lo ader = Loader;\n})(window.Platform);\n",
177 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\nvar urlResolver = scope.urlResolver;\ nvar Loader = scope.Loader;\n\nfunction StyleResolver() {\n this.loader = new L oader(this.regex);\n}\nStyleResolver.prototype = {\n regex: /@import\\s+(?:url) ?[\"'\\(]*([^'\"\\)]*)['\"\\)]*;/g,\n // Recursively replace @imports with the text at that url\n resolve: function(text, url, callback) {\n var done = fun ction(map) {\n callback(this.flatten(text, url, map));\n }.bind(this);\n this.loader.process(text, url, done);\n },\n // resolve the textContent of a style node\n resolveNode: function(style, callback) {\n var text = style. textContent;\n var url = style.ownerDocument.baseURI;\n var done = functio n(text) {\n style.textContent = text;\n callback(style);\n };\n this.resolve(text, url, done);\n },\n // flatten all the @imports to text\n f latten: function(text, base, map) {\n var matches = this.loader.extractUrls(t ext, base);\n var match, url, intermediate;\n for (var i = 0; i < matches. length; i++) {\n match = matches[i];\n url = match.url;\n // reso lve any css text to be relative to the importer\n intermediate = urlResolve r.resolveCssText(map[url], url);\n // flatten intermediate @imports\n intermediate = this.flatten(intermediate, url, map);\n text = text.replace( match.matched, intermediate);\n }\n return text;\n },\n loadStyles: func tion(styles, callback) {\n var loaded=0, l = styles.length;\n // called in the context of the style\n function loadedStyle(style) {\n loaded++;\n if (loaded === l && callback) {\n callback();\n }\n }\n f or (var i=0, s; (i<l) && (s=styles[i]); i++) {\n this.resolveNode(s, loaded Style);\n }\n }\n};\n\nvar styleResolver = new StyleResolver();\n\n// export s\nscope.styleResolver = styleResolver;\n\n})(window.Platform);\n", 180 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\nvar urlResolver = scope.urlResolver;\ nvar Loader = scope.Loader;\n\nfunction StyleResolver() {\n this.loader = new L oader(this.regex);\n}\nStyleResolver.prototype = {\n regex: /@import\\s+(?:url) ?[\"'\\(]*([^'\"\\)]*)['\"\\)]*;/g,\n // Recursively replace @imports with the text at that url\n resolve: function(text, url, callback) {\n var done = fun ction(map) {\n callback(this.flatten(text, url, map));\n }.bind(this);\n this.loader.process(text, url, done);\n },\n // resolve the textContent of a style node\n resolveNode: function(style, callback) {\n var text = style. textContent;\n var url = style.ownerDocument.baseURI;\n var done = functio n(text) {\n style.textContent = text;\n callback(style);\n };\n this.resolve(text, url, done);\n },\n // flatten all the @imports to text\n f latten: function(text, base, map) {\n var matches = this.loader.extractUrls(t ext, base);\n var match, url, intermediate;\n for (var i = 0; i < matches. length; i++) {\n match = matches[i];\n url = match.url;\n // reso lve any css text to be relative to the importer\n intermediate = urlResolve r.resolveCssText(map[url], url);\n // flatten intermediate @imports\n intermediate = this.flatten(intermediate, url, map);\n text = text.replace( match.matched, intermediate);\n }\n return text;\n },\n loadStyles: func tion(styles, callback) {\n var loaded=0, l = styles.length;\n // called in the context of the style\n function loadedStyle(style) {\n loaded++;\n if (loaded === l && callback) {\n callback();\n }\n }\n f or (var i=0, s; (i<l) && (s=styles[i]); i++) {\n this.resolveNode(s, loaded Style);\n }\n }\n};\n\nvar styleResolver = new StyleResolver();\n\n// export s\nscope.styleResolver = styleResolver;\n\n})(window.Platform);\n",
178 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n scope = scope || {};\n scope.exter nal = scope.external || {};\n var target = {\n shadow: function(inEl) {\n if (inEl) {\n return inEl.shadowRoot || inEl.webkitShadowRoot;\n }\n },\n canTarget: function(shadow) {\n return shadow && Boolean(sha dow.elementFromPoint);\n },\n targetingShadow: function(inEl) {\n var s = this.shadow(inEl);\n if (this.canTarget(s)) {\n return s;\n }\n },\n olderShadow: function(shadow) {\n var os = shadow.olderSha dowRoot;\n if (!os) {\n var se = shadow.querySelector('shadow');\n if (se) {\n os = se.olderShadowRoot;\n }\n }\n r eturn os;\n },\n allShadows: function(element) {\n var shadows = [], s = this.shadow(element);\n while(s) {\n shadows.push(s);\n s = this.olderShadow(s);\n }\n return shadows;\n },\n searchRoot: function(inRoot, x, y) {\n if (inRoot) {\n var t = inRoot.elementFr omPoint(x, y);\n var st, sr, os;\n // is element a shadow host?\n sr = this.targetingShadow(t);\n while (sr) {\n // find th e the element inside the shadow root\n st = sr.elementFromPoint(x, y);\ n if (!st) {\n // check for older shadows\n sr = this.olderShadow(sr);\n } else {\n // shadowed element may c ontain a shadow root\n var ssr = this.targetingShadow(st);\n return this.searchRoot(ssr, x, y) || st;\n }\n }\n // light dom element is the target\n return t;\n }\n },\n owner: function(element) {\n var s = element;\n // walk up until you hit the shadow root or document\n while (s.parentNode) {\n s = s.parentNode; \n }\n // the owner element is expected to be a Document or ShadowRoot \n if (s.nodeType != Node.DOCUMENT_NODE && s.nodeType != Node.DOCUMENT_FRAG MENT_NODE) {\n s = document;\n }\n return s;\n },\n findT arget: function(inEvent) {\n var x = inEvent.clientX, y = inEvent.clientY;\ n // if the listener is in the shadow root, it is much faster to start ther e\n var s = this.owner(inEvent.target);\n // if x, y is not in this ro ot, fall back to document search\n if (!s.elementFromPoint(x, y)) {\n s = document;\n }\n return this.searchRoot(s, x, y);\n }\n };\n scope.targetFinding = target;\n scope.findTarget = target.findTarget.bind(targ et);\n\n window.PointerEventsPolyfill = scope;\n})(window.PointerEventsPolyfill );\n", 181 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n scope = scope || {};\n scope.exter nal = scope.external || {};\n var target = {\n shadow: function(inEl) {\n if (inEl) {\n return inEl.shadowRoot || inEl.webkitShadowRoot;\n }\n },\n canTarget: function(shadow) {\n return shadow && Boolean(sha dow.elementFromPoint);\n },\n targetingShadow: function(inEl) {\n var s = this.shadow(inEl);\n if (this.canTarget(s)) {\n return s;\n }\n },\n olderShadow: function(shadow) {\n var os = shadow.olderSha dowRoot;\n if (!os) {\n var se = shadow.querySelector('shadow');\n if (se) {\n os = se.olderShadowRoot;\n }\n }\n r eturn os;\n },\n allShadows: function(element) {\n var shadows = [], s = this.shadow(element);\n while(s) {\n shadows.push(s);\n s = this.olderShadow(s);\n }\n return shadows;\n },\n searchRoot: function(inRoot, x, y) {\n if (inRoot) {\n var t = inRoot.elementFr omPoint(x, y);\n var st, sr, os;\n // is element a shadow host?\n sr = this.targetingShadow(t);\n while (sr) {\n // find th e the element inside the shadow root\n st = sr.elementFromPoint(x, y);\ n if (!st) {\n // check for older shadows\n sr = this.olderShadow(sr);\n } else {\n // shadowed element may c ontain a shadow root\n var ssr = this.targetingShadow(st);\n return this.searchRoot(ssr, x, y) || st;\n }\n }\n // light dom element is the target\n return t;\n }\n },\n owner: function(element) {\n var s = element;\n // walk up until you hit the shadow root or document\n while (s.parentNode) {\n s = s.parentNode; \n }\n // the owner element is expected to be a Document or ShadowRoot \n if (s.nodeType != Node.DOCUMENT_NODE && s.nodeType != Node.DOCUMENT_FRAG MENT_NODE) {\n s = document;\n }\n return s;\n },\n findT arget: function(inEvent) {\n var x = inEvent.clientX, y = inEvent.clientY;\ n // if the listener is in the shadow root, it is much faster to start ther e\n var s = this.owner(inEvent.target);\n // if x, y is not in this ro ot, fall back to document search\n if (!s.elementFromPoint(x, y)) {\n s = document;\n }\n return this.searchRoot(s, x, y);\n }\n };\n scope.targetFinding = target;\n scope.findTarget = target.findTarget.bind(targ et);\n\n window.PointerEventsPolyfill = scope;\n})(window.PointerEventsPolyfill );\n",
179 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n function shadowSelector(v) {\n return ' body ^^ ' + selector(v);\n }\n function selector(v) {\n return '[touch-acti on=\"' + v + '\"]';\n }\n function rule(v) {\n return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; touch-action-delay: none; }';\n }\n var at trib2css = [\n 'none',\n 'auto',\n 'pan-x',\n 'pan-y',\n {\n rule: 'pan-x pan-y',\n selectors: [\n 'pan-x pan-y',\n 'pan- y pan-x'\n ]\n }\n ];\n var styles = '';\n attrib2css.forEach(functio n(r) {\n if (String(r) === r) {\n styles += selector(r) + rule(r) + '\\n ';\n styles += shadowSelector(r) + rule(r) + '\\n';\n } else {\n st yles += r.selectors.map(selector) + rule(r.rule) + '\\n';\n styles += r.sel ectors.map(shadowSelector) + rule(r.rule) + '\\n';\n }\n });\n var el = doc ument.createElement('style');\n el.textContent = styles;\n document.head.appen dChild(el);\n})();\n", 182 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function() {\n function shadowSelector(v) {\n return ' body ^^ ' + selector(v);\n }\n function selector(v) {\n return '[touch-acti on=\"' + v + '\"]';\n }\n function rule(v) {\n return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; touch-action-delay: none; }';\n }\n var at trib2css = [\n 'none',\n 'auto',\n 'pan-x',\n 'pan-y',\n {\n rule: 'pan-x pan-y',\n selectors: [\n 'pan-x pan-y',\n 'pan- y pan-x'\n ]\n }\n ];\n var styles = '';\n attrib2css.forEach(functio n(r) {\n if (String(r) === r) {\n styles += selector(r) + rule(r) + '\\n ';\n styles += shadowSelector(r) + rule(r) + '\\n';\n } else {\n st yles += r.selectors.map(selector) + rule(r.rule) + '\\n';\n styles += r.sel ectors.map(shadowSelector) + rule(r.rule) + '\\n';\n }\n });\n var el = doc ument.createElement('style');\n el.textContent = styles;\n document.head.appen dChild(el);\n})();\n",
180 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This is the constructor for new PointerEvents.\n *\n * New Pointer Events must be given a type, and an optional dictionary of\n * initialization properties.\n *\n * Due to certain platform requirements, events returned from the constructor\n * identify as MouseEvents.\n *\n * @constructor \n * @param {String} inType The type of the event to create.\n * @param {Object} [inDict] An optional dictionary of initial event properties.\n * @return {Event } A new PointerEvent of type `inType` and initialized with properties from `inDi ct`.\n */\n(function(scope) {\n // test for DOM Level 4 Events\n var NEW_MOUSE _EVENT = false;\n var HAS_BUTTONS = false;\n try {\n var ev = new MouseEven t('click', {buttons: 1});\n NEW_MOUSE_EVENT = true;\n HAS_BUTTONS = ev.but tons === 1;\n } catch(e) {\n }\n\n var MOUSE_PROPS = [\n 'bubbles',\n ' cancelable',\n 'view',\n 'detail',\n 'screenX',\n 'screenY',\n 'c lientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'm etaKey',\n 'button',\n 'relatedTarget',\n ];\n\n var MOUSE_DEFAULTS = [\ n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null\n ];\n\n funct ion PointerEvent(inType, inDict) {\n inDict = inDict || {};\n // According to the w3c spec,\n // http://www.w3.org/TR/DOM-Level-3-Events/#events-MouseE vent-button\n // MouseEvent.button == 0 can mean either no mouse button depre ssed, or the\n // left mouse button depressed.\n //\n // As of now, the only way to distinguish between the two states of\n // MouseEvent.button is by using the deprecated MouseEvent.which property, as\n // this maps mouse bu ttons to positive integers > 0, and uses 0 to mean that\n // no mouse button is held.\n //\n // MouseEvent.which is derived from MouseEvent.button at M ouseEvent creation,\n // but initMouseEvent does not expose an argument with which to set\n // MouseEvent.which. Calling initMouseEvent with a buttonArg o f 0 will set\n // MouseEvent.button == 0 and MouseEvent.which == 1, breaking the expectations\n // of app developers.\n //\n // The only way to prop agate the correct state of MouseEvent.which and\n // MouseEvent.button to a n ew MouseEvent.button == 0 and MouseEvent.which == 0\n // is to call initMouse Event with a buttonArg value of -1.\n //\n // This is fixed with DOM Level 4's use of buttons\n var buttons;\n if (inDict.buttons || HAS_BUTTONS) {\ n buttons = inDict.buttons;\n } else {\n switch (inDict.which) {\n case 1: buttons = 1; break;\n case 2: buttons = 4; break;\n case 3: buttons = 2; break;\n default: buttons = 0;\n }\n }\n\n var e;\n if (NEW_MOUSE_EVENT) {\n e = new MouseEvent(inType, inDict); \n } else {\n e = document.createEvent('MouseEvent');\n\n // import values from the given dictionary\n var props = {}, p;\n for(var i = 0 ; i < MOUSE_PROPS.length; i++) {\n p = MOUSE_PROPS[i];\n props[p] = inDict[p] || MOUSE_DEFAULTS[i];\n }\n\n // define the properties inh erited from MouseEvent\n e.initMouseEvent(\n inType, props.bubbles, props.cancelable, props.view, props.detail,\n props.screenX, props.screen Y, props.clientX, props.clientY, props.ctrlKey,\n props.altKey, props.shi ftKey, props.metaKey, props.button, props.relatedTarget\n );\n }\n\n // make the event pass instanceof checks\n e.__proto__ = PointerEvent.prototy pe;\n\n // define the buttons property according to DOM Level 3 spec\n if (!HAS_BUTTONS) {\n // IE 10 has buttons on MouseEvent.prototype as a getter w/o any setting\n // mechanism\n Object.defineProperty(e, 'buttons', {get: function(){ return buttons; }, enumerable: true});\n }\n\n // Spec r equires that pointers without pressure specified use 0.5 for down\n // state and 0 for up state.\n var pressure = 0;\n if (inDict.pressure) {\n pr essure = inDict.pressure;\n } else {\n pressure = buttons ? 0.5 : 0;\n }\n\n // define the properties of the PointerEvent interface\n Object.de fineProperties(e, {\n pointerId: { value: inDict.pointerId || 0, enumerable : true },\n width: { value: inDict.width || 0, enumerable: true },\n h eight: { value: inDict.height || 0, enumerable: true },\n pressure: { value : pressure, enumerable: true },\n tiltX: { value: inDict.tiltX || 0, enumer able: true },\n tiltY: { value: inDict.tiltY || 0, enumerable: true },\n pointerType: { value: inDict.pointerType || '', enumerable: true },\n hw Timestamp: { value: inDict.hwTimestamp || 0, enumerable: true },\n isPrimar y: { value: inDict.isPrimary || false, enumerable: true }\n });\n return e ;\n }\n\n // PointerEvent extends MouseEvent\n PointerEvent.prototype = Objec t.create(MouseEvent.prototype);\n\n // attach to window\n if (!scope.PointerEv ent) {\n scope.PointerEvent = PointerEvent;\n }\n})(window);\n", 183 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This is the constructor for new PointerEvents.\n *\n * New Pointer Events must be given a type, and an optional dictionary of\n * initialization properties.\n *\n * Due to certain platform requirements, events returned from the constructor\n * identify as MouseEvents.\n *\n * @constructor \n * @param {String} inType The type of the event to create.\n * @param {Object} [inDict] An optional dictionary of initial event properties.\n * @return {Event } A new PointerEvent of type `inType` and initialized with properties from `inDi ct`.\n */\n(function(scope) {\n // test for DOM Level 4 Events\n var NEW_MOUSE _EVENT = false;\n var HAS_BUTTONS = false;\n try {\n var ev = new MouseEven t('click', {buttons: 1});\n NEW_MOUSE_EVENT = true;\n HAS_BUTTONS = ev.but tons === 1;\n ev = null;\n } catch(e) {\n }\n\n var MOUSE_PROPS = [\n ' bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX',\n 's creenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'sh iftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n ];\n\n var MOU SE_DEFAULTS = [\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null\ n ];\n\n function PointerEvent(inType, inDict) {\n inDict = inDict || {};\n // According to the w3c spec,\n // http://www.w3.org/TR/DOM-Level-3-Event s/#events-MouseEvent-button\n // MouseEvent.button == 0 can mean either no mo use button depressed, or the\n // left mouse button depressed.\n //\n / / As of now, the only way to distinguish between the two states of\n // Mouse Event.button is by using the deprecated MouseEvent.which property, as\n // th is maps mouse buttons to positive integers > 0, and uses 0 to mean that\n // no mouse button is held.\n //\n // MouseEvent.which is derived from MouseE vent.button at MouseEvent creation,\n // but initMouseEvent does not expose a n argument with which to set\n // MouseEvent.which. Calling initMouseEvent wi th a buttonArg of 0 will set\n // MouseEvent.button == 0 and MouseEvent.which == 1, breaking the expectations\n // of app developers.\n //\n // The only way to propagate the correct state of MouseEvent.which and\n // MouseEve nt.button to a new MouseEvent.button == 0 and MouseEvent.which == 0\n // is t o call initMouseEvent with a buttonArg value of -1.\n //\n // This is fixe d with DOM Level 4's use of buttons\n var buttons = inDict.buttons;\n // t ouch has two possible buttons state: 0 and 1, rely on being told the right one\n if (!HAS_BUTTONS && !buttons && inType !== 'touch') {\n switch (inDict. which) {\n case 1: buttons = 1; break;\n case 2: buttons = 4; brea k;\n case 3: buttons = 2; break;\n default: buttons = 0;\n }\ n }\n\n var e;\n if (NEW_MOUSE_EVENT) {\n e = new MouseEvent(inTyp e, inDict);\n } else {\n e = document.createEvent('MouseEvent');\n\n // import values from the given dictionary\n var props = {}, p;\n fo r(var i = 0; i < MOUSE_PROPS.length; i++) {\n p = MOUSE_PROPS[i];\n props[p] = inDict[p] || MOUSE_DEFAULTS[i];\n }\n\n // define the pro perties inherited from MouseEvent\n e.initMouseEvent(\n inType, prop s.bubbles, props.cancelable, props.view, props.detail,\n props.screenX, p rops.screenY, props.clientX, props.clientY, props.ctrlKey,\n props.altKey , props.shiftKey, props.metaKey, props.button, props.relatedTarget\n );\n }\n\n // make the event pass instanceof checks\n e.__proto__ = PointerEv ent.prototype;\n\n // define the buttons property according to DOM Level 3 sp ec\n if (!HAS_BUTTONS) {\n // IE 10 has buttons on MouseEvent.prototype as a getter w/o any setting\n // mechanism\n Object.defineProperty(e, 'buttons', {get: function(){ return buttons; }, enumerable: true});\n }\n\n // Spec requires that pointers without pressure specified use 0.5 for down\n // state and 0 for up state.\n var pressure = 0;\n if (inDict.pressure) {\n pressure = inDict.pressure;\n } else {\n pressure = buttons ? 0 .5 : 0;\n }\n\n // define the properties of the PointerEvent interface\n Object.defineProperties(e, {\n pointerId: { value: inDict.pointerId || 0, enumerable: true },\n width: { value: inDict.width || 0, enumerable: true },\n height: { value: inDict.height || 0, enumerable: true },\n pressu re: { value: pressure, enumerable: true },\n tiltX: { value: inDict.tiltX | | 0, enumerable: true },\n tiltY: { value: inDict.tiltY || 0, enumerable: t rue },\n pointerType: { value: inDict.pointerType || '', enumerable: true } ,\n hwTimestamp: { value: inDict.hwTimestamp || 0, enumerable: true },\n isPrimary: { value: inDict.isPrimary || false, enumerable: true }\n });\n return e;\n }\n\n // PointerEvent extends MouseEvent\n PointerEvent.protot ype = Object.create(MouseEvent.prototype);\n\n // attach to window\n if (!scop e.PointerEvent) {\n scope.PointerEvent = PointerEvent;\n }\n})(window);\n",
181 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module implements an map of pointer states\n */\n(function(scope) {\n var USE_MAP = window.Map && window.Map.prototype.forE ach;\n var POINTERS_FN = function(){ return this.size; };\n function PointerMa p() {\n if (USE_MAP) {\n var m = new Map();\n m.pointers = POINTERS _FN;\n return m;\n } else {\n this.keys = [];\n this.values = [];\n }\n }\n\n PointerMap.prototype = {\n set: function(inId, inEvent) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.val ues[i] = inEvent;\n } else {\n this.keys.push(inId);\n this.v alues.push(inEvent);\n }\n },\n has: function(inId) {\n return t his.keys.indexOf(inId) > -1;\n },\n 'delete': function(inId) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.keys.splice(i, 1 );\n this.values.splice(i, 1);\n }\n },\n get: function(inId) {\n var i = this.keys.indexOf(inId);\n return this.values[i];\n },\ n clear: function() {\n this.keys.length = 0;\n this.values.length = 0;\n },\n // return value, key, map\n forEach: function(callback, thi sArg) {\n this.values.forEach(function(v, i) {\n callback.call(thisA rg, v, this.keys[i], this);\n }, this);\n },\n pointers: function() { \n return this.keys.length;\n }\n };\n\n scope.PointerMap = PointerMap ;\n})(window.PointerEventsPolyfill);\n", 184 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module implements an map of pointer states\n */\n(function(scope) {\n var USE_MAP = window.Map && window.Map.prototype.forE ach;\n var POINTERS_FN = function(){ return this.size; };\n function PointerMa p() {\n if (USE_MAP) {\n var m = new Map();\n m.pointers = POINTERS _FN;\n return m;\n } else {\n this.keys = [];\n this.values = [];\n }\n }\n\n PointerMap.prototype = {\n set: function(inId, inEvent) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.val ues[i] = inEvent;\n } else {\n this.keys.push(inId);\n this.v alues.push(inEvent);\n }\n },\n has: function(inId) {\n return t his.keys.indexOf(inId) > -1;\n },\n 'delete': function(inId) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.keys.splice(i, 1 );\n this.values.splice(i, 1);\n }\n },\n get: function(inId) {\n var i = this.keys.indexOf(inId);\n return this.values[i];\n },\ n clear: function() {\n this.keys.length = 0;\n this.values.length = 0;\n },\n // return value, key, map\n forEach: function(callback, thi sArg) {\n this.values.forEach(function(v, i) {\n callback.call(thisA rg, v, this.keys[i], this);\n }, this);\n },\n pointers: function() { \n return this.keys.length;\n }\n };\n\n scope.PointerMap = PointerMap ;\n})(window.PointerEventsPolyfill);\n",
182 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var CLONE_PROPS = [\n // MouseEv ent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX ',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey' ,\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n // DOM Level 3\n 'buttons',\n // PointerEvent\n 'pointerId',\n 'width', \n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType', \n 'hwTimestamp',\n 'isPrimary',\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'which'\n ];\n\n var CLONE_DEFAULTS = [\n // MouseEvent\n false,\n false,\n null,\n null,\n 0,\n 0,\ n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n nul l,\n // DOM Level 3\n 0,\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n // event instance\n '', \n null,\n null,\n 0\n ];\n\n var HAS_SVG_INSTANCE = (typeof SVGEleme ntInstance !== 'undefined');\n\n /**\n * This module is for normalizing event s. Mouse and Touch events will be\n * collected here, and fire PointerEvents t hat have the same semantics, no\n * matter the source.\n * Events fired:\n * - pointerdown: a pointing is added\n * - pointerup: a pointer is remove d\n * - pointermove: a pointer is moved\n * - pointerover: a pointer cro sses into an element\n * - pointerout: a pointer leaves an element\n * - pointercancel: a pointer will no longer generate events\n */\n var dispatche r = {\n targets: new WeakMap(),\n handledEvents: new WeakMap(),\n point ermap: new scope.PointerMap(),\n eventMap: {},\n // Scope objects for nati ve events.\n // This exists for ease of testing.\n eventSources: {},\n eventSourceList: [],\n /**\n * Add a new event source that will generate pointer events.\n *\n * `inSource` must contain an array of event names named `events`, and\n * functions with the names specified in the `events` a rray.\n * @param {string} name A name for the event source\n * @param {O bject} source A new source of platform events.\n */\n registerSource: fun ction(name, source) {\n var s = source;\n var newEvents = s.events;\n if (newEvents) {\n newEvents.forEach(function(e) {\n if (s[ e]) {\n this.eventMap[e] = s[e].bind(s);\n }\n }, thi s);\n this.eventSources[name] = s;\n this.eventSourceList.push(s); \n }\n },\n register: function(element) {\n var l = this.eventSo urceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceLis t[i]); i++) {\n // call eventsource register\n es.register.call(es , element);\n }\n },\n unregister: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.e ventSourceList[i]); i++) {\n // call eventsource register\n es.unr egister.call(es, element);\n }\n },\n contains: scope.external.contai ns || function(container, contained) {\n return container.contains(containe d);\n },\n // EVENTS\n down: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerdown', inEvent);\n },\n move: funct ion(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointermove ', inEvent);\n },\n up: function(inEvent) {\n inEvent.bubbles = true; \n this.fireEvent('pointerup', inEvent);\n },\n enter: function(inEve nt) {\n inEvent.bubbles = false;\n this.fireEvent('pointerenter', inEv ent);\n },\n leave: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerleave', inEvent);\n },\n over: function(inEven t) {\n inEvent.bubbles = true;\n this.fireEvent('pointerover', inEvent );\n },\n out: function(inEvent) {\n inEvent.bubbles = true;\n t his.fireEvent('pointerout', inEvent);\n },\n cancel: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointercancel', inEvent);\n },\n leaveOut: function(event) {\n this.out(event);\n if (!this .contains(event.target, event.relatedTarget)) {\n this.leave(event);\n }\n },\n enterOver: function(event) {\n this.over(event);\n i f (!this.contains(event.target, event.relatedTarget)) {\n this.enter(even t);\n }\n },\n // LISTENER LOGIC\n eventHandler: function(inEvent) {\n // This is used to prevent multiple dispatch of pointerevents from\n // platform events. This can happen when two elements in different scopes\n // are set up to create pointer events, which is relevant to Shadow DOM.\n if (this.handledEvents.get(inEvent)) {\n return;\n }\n var type = inEvent.type;\n var fn = this.eventMap && this.eventMap[type];\n if (fn) {\n fn(inEvent);\n }\n this.handledEvents.set(inEven t, true);\n },\n // set up event listeners\n listen: function(target, e vents) {\n events.forEach(function(e) {\n this.addEvent(target, e);\ n }, this);\n },\n // remove event listeners\n unlisten: function( target, events) {\n events.forEach(function(e) {\n this.removeEvent( target, e);\n }, this);\n },\n addEvent: scope.external.addEvent || f unction(target, eventName) {\n target.addEventListener(eventName, this.boun dHandler);\n },\n removeEvent: scope.external.removeEvent || function(targ et, eventName) {\n target.removeEventListener(eventName, this.boundHandler) ;\n },\n // EVENT CREATION AND TRACKING\n /**\n * Creates a new Eve nt of type `inType`, based on the information in\n * `inEvent`.\n *\n * @param {string} inType A string representing the type of event to create\n * @param {Event} inEvent A platform event with a target\n * @return {Even t} A PointerEvent of type `inType`\n */\n makeEvent: function(inType, inE vent) {\n // relatedTarget must be null if pointer is captured\n if (t his.captureInfo) {\n inEvent.relatedTarget = null;\n }\n var e = new PointerEvent(inType, inEvent);\n if (inEvent.preventDefault) {\n e.preventDefault = inEvent.preventDefault;\n }\n this.targets.set(e , this.targets.get(inEvent) || inEvent.target);\n return e;\n },\n // make and dispatch an event in one call\n fireEvent: function(inType, inEvent ) {\n var e = this.makeEvent(inType, inEvent);\n return this.dispatchE vent(e);\n },\n /**\n * Returns a snapshot of inEvent, with writable p roperties.\n *\n * @param {Event} inEvent An event that contains propert ies to copy.\n * @return {Object} An object containing shallow copies of `in Event`'s\n * properties.\n */\n cloneEvent: function(inEvent) {\n var eventCopy = {}, p;\n for (var i = 0; i < CLONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = inEvent[p] || CLONE_DEFAU LTS[i];\n // Work around SVGInstanceElement shadow tree\n // Retur n the <use> element that is represented by the instance for Safari, Chrome, IE.\ n // This is the behavior implemented by Firefox.\n if (HAS_SVG_IN STANCE && (p === 'target' || p === 'relatedTarget')) {\n if (eventCopy[ p] instanceof SVGElementInstance) {\n eventCopy[p] = eventCopy[p].cor respondingUseElement;\n }\n }\n }\n // keep the semant ics of preventDefault\n if (inEvent.preventDefault) {\n eventCopy.pr eventDefault = function() {\n inEvent.preventDefault();\n };\n }\n return eventCopy;\n },\n getTarget: function(inEvent) {\n // if pointer capture is set, route all events for the specified pointerId\n // to the capture target\n if (this.captureInfo) {\n if (this.ca ptureInfo.id === inEvent.pointerId) {\n return this.captureInfo.target; \n }\n }\n return this.targets.get(inEvent);\n },\n setCa pture: function(inPointerId, inTarget) {\n if (this.captureInfo) {\n this.releaseCapture(this.captureInfo.id);\n }\n this.captureInfo = {i d: inPointerId, target: inTarget};\n var e = new PointerEvent('gotpointerca pture', { bubbles: true });\n this.implicitRelease = this.releaseCapture.bi nd(this, inPointerId);\n document.addEventListener('pointerup', this.implic itRelease);\n document.addEventListener('pointercancel', this.implicitRelea se);\n this.targets.set(e, inTarget);\n this.asyncDispatchEvent(e);\n },\n releaseCapture: function(inPointerId) {\n if (this.captureInfo & & this.captureInfo.id === inPointerId) {\n var e = new PointerEvent('lost pointercapture', { bubbles: true });\n var t = this.captureInfo.target;\n this.captureInfo = null;\n document.removeEventListener('pointeru p', this.implicitRelease);\n document.removeEventListener('pointercancel' , this.implicitRelease);\n this.targets.set(e, t);\n this.asyncDis patchEvent(e);\n }\n },\n /**\n * Dispatches the event to its tar get.\n *\n * @param {Event} inEvent The event to be dispatched.\n * @return {Boolean} True if an event handler returns true, false otherwise.\n */\n dispatchEvent: scope.external.dispatchEvent || function(inEvent) {\n var t = this.getTarget(inEvent);\n if (t) {\n return t.dispatchEve nt(inEvent);\n }\n },\n asyncDispatchEvent: function(inEvent) {\n setTimeout(this.dispatchEvent.bind(this, inEvent), 0);\n }\n };\n dispatc her.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n scope.dispatcher = dispatcher;\n scope.register = dispatcher.register.bind(dispatcher);\n scop e.unregister = dispatcher.unregister.bind(dispatcher);\n})(window.PointerEventsP olyfill);\n", 185 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var CLONE_PROPS = [\n // MouseEv ent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX ',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey' ,\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n // DOM Level 3\n 'buttons',\n // PointerEvent\n 'pointerId',\n 'width', \n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType', \n 'hwTimestamp',\n 'isPrimary',\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'which'\n ];\n\n var CLONE_DEFAULTS = [\n // MouseEvent\n false,\n false,\n null,\n null,\n 0,\n 0,\ n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n nul l,\n // DOM Level 3\n 0,\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n // event instance\n '', \n null,\n null,\n 0\n ];\n\n var HAS_SVG_INSTANCE = (typeof SVGEleme ntInstance !== 'undefined');\n\n /**\n * This module is for normalizing event s. Mouse and Touch events will be\n * collected here, and fire PointerEvents t hat have the same semantics, no\n * matter the source.\n * Events fired:\n * - pointerdown: a pointing is added\n * - pointerup: a pointer is remove d\n * - pointermove: a pointer is moved\n * - pointerover: a pointer cro sses into an element\n * - pointerout: a pointer leaves an element\n * - pointercancel: a pointer will no longer generate events\n */\n var dispatche r = {\n targets: new WeakMap(),\n handledEvents: new WeakMap(),\n point ermap: new scope.PointerMap(),\n eventMap: {},\n // Scope objects for nati ve events.\n // This exists for ease of testing.\n eventSources: {},\n eventSourceList: [],\n /**\n * Add a new event source that will generate pointer events.\n *\n * `inSource` must contain an array of event names named `events`, and\n * functions with the names specified in the `events` a rray.\n * @param {string} name A name for the event source\n * @param {O bject} source A new source of platform events.\n */\n registerSource: fun ction(name, source) {\n var s = source;\n var newEvents = s.events;\n if (newEvents) {\n newEvents.forEach(function(e) {\n if (s[ e]) {\n this.eventMap[e] = s[e].bind(s);\n }\n }, thi s);\n this.eventSources[name] = s;\n this.eventSourceList.push(s); \n }\n },\n register: function(element) {\n var l = this.eventSo urceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceLis t[i]); i++) {\n // call eventsource register\n es.register.call(es , element);\n }\n },\n unregister: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.e ventSourceList[i]); i++) {\n // call eventsource register\n es.unr egister.call(es, element);\n }\n },\n contains: scope.external.contai ns || function(container, contained) {\n return container.contains(containe d);\n },\n // EVENTS\n down: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerdown', inEvent);\n },\n move: funct ion(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointermove ', inEvent);\n },\n up: function(inEvent) {\n inEvent.bubbles = true; \n this.fireEvent('pointerup', inEvent);\n },\n enter: function(inEve nt) {\n inEvent.bubbles = false;\n this.fireEvent('pointerenter', inEv ent);\n },\n leave: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerleave', inEvent);\n },\n over: function(inEven t) {\n inEvent.bubbles = true;\n this.fireEvent('pointerover', inEvent );\n },\n out: function(inEvent) {\n inEvent.bubbles = true;\n t his.fireEvent('pointerout', inEvent);\n },\n cancel: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointercancel', inEvent);\n },\n leaveOut: function(event) {\n this.out(event);\n if (!this .contains(event.target, event.relatedTarget)) {\n this.leave(event);\n }\n },\n enterOver: function(event) {\n this.over(event);\n i f (!this.contains(event.target, event.relatedTarget)) {\n this.enter(even t);\n }\n },\n // LISTENER LOGIC\n eventHandler: function(inEvent) {\n // This is used to prevent multiple dispatch of pointerevents from\n // platform events. This can happen when two elements in different scopes\n // are set up to create pointer events, which is relevant to Shadow DOM.\n if (this.handledEvents.get(inEvent)) {\n return;\n }\n var type = inEvent.type;\n var fn = this.eventMap && this.eventMap[type];\n if (fn) {\n fn(inEvent);\n }\n this.handledEvents.set(inEven t, true);\n },\n // set up event listeners\n listen: function(target, e vents) {\n events.forEach(function(e) {\n this.addEvent(target, e);\ n }, this);\n },\n // remove event listeners\n unlisten: function( target, events) {\n events.forEach(function(e) {\n this.removeEvent( target, e);\n }, this);\n },\n addEvent: scope.external.addEvent || f unction(target, eventName) {\n target.addEventListener(eventName, this.boun dHandler);\n },\n removeEvent: scope.external.removeEvent || function(targ et, eventName) {\n target.removeEventListener(eventName, this.boundHandler) ;\n },\n // EVENT CREATION AND TRACKING\n /**\n * Creates a new Eve nt of type `inType`, based on the information in\n * `inEvent`.\n *\n * @param {string} inType A string representing the type of event to create\n * @param {Event} inEvent A platform event with a target\n * @return {Even t} A PointerEvent of type `inType`\n */\n makeEvent: function(inType, inE vent) {\n // relatedTarget must be null if pointer is captured\n if (t his.captureInfo) {\n inEvent.relatedTarget = null;\n }\n var e = new PointerEvent(inType, inEvent);\n if (inEvent.preventDefault) {\n e.preventDefault = inEvent.preventDefault;\n }\n this.targets.set(e , this.targets.get(inEvent) || inEvent.target);\n return e;\n },\n // make and dispatch an event in one call\n fireEvent: function(inType, inEvent ) {\n var e = this.makeEvent(inType, inEvent);\n return this.dispatchE vent(e);\n },\n /**\n * Returns a snapshot of inEvent, with writable p roperties.\n *\n * @param {Event} inEvent An event that contains propert ies to copy.\n * @return {Object} An object containing shallow copies of `in Event`'s\n * properties.\n */\n cloneEvent: function(inEvent) {\n var eventCopy = {}, p;\n for (var i = 0; i < CLONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = inEvent[p] || CLONE_DEFAU LTS[i];\n // Work around SVGInstanceElement shadow tree\n // Retur n the <use> element that is represented by the instance for Safari, Chrome, IE.\ n // This is the behavior implemented by Firefox.\n if (HAS_SVG_IN STANCE && (p === 'target' || p === 'relatedTarget')) {\n if (eventCopy[ p] instanceof SVGElementInstance) {\n eventCopy[p] = eventCopy[p].cor respondingUseElement;\n }\n }\n }\n // keep the semant ics of preventDefault\n if (inEvent.preventDefault) {\n eventCopy.pr eventDefault = function() {\n inEvent.preventDefault();\n };\n }\n return eventCopy;\n },\n getTarget: function(inEvent) {\n // if pointer capture is set, route all events for the specified pointerId\n // to the capture target\n if (this.captureInfo) {\n if (this.ca ptureInfo.id === inEvent.pointerId) {\n return this.captureInfo.target; \n }\n }\n return this.targets.get(inEvent);\n },\n setCa pture: function(inPointerId, inTarget) {\n if (this.captureInfo) {\n this.releaseCapture(this.captureInfo.id);\n }\n this.captureInfo = {i d: inPointerId, target: inTarget};\n var e = new PointerEvent('gotpointerca pture', { bubbles: true });\n this.implicitRelease = this.releaseCapture.bi nd(this, inPointerId);\n document.addEventListener('pointerup', this.implic itRelease);\n document.addEventListener('pointercancel', this.implicitRelea se);\n this.targets.set(e, inTarget);\n this.asyncDispatchEvent(e);\n },\n releaseCapture: function(inPointerId) {\n if (this.captureInfo & & this.captureInfo.id === inPointerId) {\n var e = new PointerEvent('lost pointercapture', { bubbles: true });\n var t = this.captureInfo.target;\n this.captureInfo = null;\n document.removeEventListener('pointeru p', this.implicitRelease);\n document.removeEventListener('pointercancel' , this.implicitRelease);\n this.targets.set(e, t);\n this.asyncDis patchEvent(e);\n }\n },\n /**\n * Dispatches the event to its tar get.\n *\n * @param {Event} inEvent The event to be dispatched.\n * @return {Boolean} True if an event handler returns true, false otherwise.\n */\n dispatchEvent: scope.external.dispatchEvent || function(inEvent) {\n var t = this.getTarget(inEvent);\n if (t) {\n return t.dispatchEve nt(inEvent);\n }\n },\n asyncDispatchEvent: function(inEvent) {\n setTimeout(this.dispatchEvent.bind(this, inEvent), 0);\n }\n };\n dispatc her.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n scope.dispatcher = dispatcher;\n scope.register = dispatcher.register.bind(dispatcher);\n scop e.unregister = dispatcher.unregister.bind(dispatcher);\n})(window.PointerEventsP olyfill);\n",
183 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module uses Mutation Observers to dynamicall y adjust which nodes will\n * generate Pointer Events.\n *\n * All nodes that wi sh to generate Pointer Events must have the attribute\n * `touch-action` set to `none`.\n */\n(function(scope) {\n var forEach = Array.prototype.forEach.call.b ind(Array.prototype.forEach);\n var map = Array.prototype.map.call.bind(Array.p rototype.map);\n var toArray = Array.prototype.slice.call.bind(Array.prototype. slice);\n var filter = Array.prototype.filter.call.bind(Array.prototype.filter) ;\n var MO = window.MutationObserver || window.WebKitMutationObserver;\n var S ELECTOR = '[touch-action]';\n var OBSERVER_INIT = {\n subtree: true,\n ch ildList: true,\n attributes: true,\n attributeOldValue: true,\n attribu teFilter: ['touch-action']\n };\n\n function Installer(add, remove, changed, b inder) {\n this.addCallback = add.bind(binder);\n this.removeCallback = re move.bind(binder);\n this.changedCallback = changed.bind(binder);\n if (MO ) {\n this.observer = new MO(this.mutationWatcher.bind(this));\n }\n }\ n\n Installer.prototype = {\n watchSubtree: function(target) {\n // Onl y watch scopes that can target find, as these are top-level.\n // Otherwise we can see duplicate additions and removals that add noise.\n //\n // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see\n / / a removal without an insertion when a node is redistributed among\n // sh adows. Since it all ends up correct in the document, watching only\n // the document will yield the correct mutations to watch.\n if (scope.targetFind ing.canTarget(target)) {\n this.observer.observe(target, OBSERVER_INIT);\ n }\n },\n enableOnSubtree: function(target) {\n this.watchSubtr ee(target);\n if (target === document && document.readyState !== 'complete' ) {\n this.installOnLoad();\n } else {\n this.installNewSubtr ee(target);\n }\n },\n installNewSubtree: function(target) {\n f orEach(this.findElements(target), this.addElement, this);\n },\n findEleme nts: function(target) {\n if (target.querySelectorAll) {\n return ta rget.querySelectorAll(SELECTOR);\n }\n return [];\n },\n removeE lement: function(el) {\n this.removeCallback(el);\n },\n addElement: function(el) {\n this.addCallback(el);\n },\n elementChanged: functio n(el, oldValue) {\n this.changedCallback(el, oldValue);\n },\n concat Lists: function(accum, list) {\n return accum.concat(toArray(list));\n } ,\n // register all touch-action = none nodes on document load\n installOn Load: function() {\n document.addEventListener('DOMContentLoaded', this.ins tallNewSubtree.bind(this, document));\n },\n isElement: function(n) {\n return n.nodeType === Node.ELEMENT_NODE;\n },\n flattenMutationTree: fu nction(inNodes) {\n // find children with touch-action\n var tree = ma p(inNodes, this.findElements, this);\n // make sure the added nodes are acc ounted for\n tree.push(filter(inNodes, this.isElement));\n // flatten the list\n return tree.reduce(this.concatLists, []);\n },\n mutationW atcher: function(mutations) {\n mutations.forEach(this.mutationHandler, thi s);\n },\n mutationHandler: function(m) {\n if (m.type === 'childList ') {\n var added = this.flattenMutationTree(m.addedNodes);\n added .forEach(this.addElement, this);\n var removed = this.flattenMutationTree (m.removedNodes);\n removed.forEach(this.removeElement, this);\n } e lse if (m.type === 'attributes') {\n this.elementChanged(m.target, m.oldV alue);\n }\n }\n };\n\n if (!MO) {\n Installer.prototype.watchSubtr ee = function(){\n console.warn('PointerEventsPolyfill: MutationObservers n ot found, touch-action will not be dynamically detected');\n };\n }\n\n sco pe.Installer = Installer;\n})(window.PointerEventsPolyfill);\n", 186 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module uses Mutation Observers to dynamicall y adjust which nodes will\n * generate Pointer Events.\n *\n * All nodes that wi sh to generate Pointer Events must have the attribute\n * `touch-action` set to `none`.\n */\n(function(scope) {\n var forEach = Array.prototype.forEach.call.b ind(Array.prototype.forEach);\n var map = Array.prototype.map.call.bind(Array.p rototype.map);\n var toArray = Array.prototype.slice.call.bind(Array.prototype. slice);\n var filter = Array.prototype.filter.call.bind(Array.prototype.filter) ;\n var MO = window.MutationObserver || window.WebKitMutationObserver;\n var S ELECTOR = '[touch-action]';\n var OBSERVER_INIT = {\n subtree: true,\n ch ildList: true,\n attributes: true,\n attributeOldValue: true,\n attribu teFilter: ['touch-action']\n };\n\n function Installer(add, remove, changed, b inder) {\n this.addCallback = add.bind(binder);\n this.removeCallback = re move.bind(binder);\n this.changedCallback = changed.bind(binder);\n if (MO ) {\n this.observer = new MO(this.mutationWatcher.bind(this));\n }\n }\ n\n Installer.prototype = {\n watchSubtree: function(target) {\n // Onl y watch scopes that can target find, as these are top-level.\n // Otherwise we can see duplicate additions and removals that add noise.\n //\n // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see\n / / a removal without an insertion when a node is redistributed among\n // sh adows. Since it all ends up correct in the document, watching only\n // the document will yield the correct mutations to watch.\n if (scope.targetFind ing.canTarget(target)) {\n this.observer.observe(target, OBSERVER_INIT);\ n }\n },\n enableOnSubtree: function(target) {\n this.watchSubtr ee(target);\n if (target === document && document.readyState !== 'complete' ) {\n this.installOnLoad();\n } else {\n this.installNewSubtr ee(target);\n }\n },\n installNewSubtree: function(target) {\n f orEach(this.findElements(target), this.addElement, this);\n },\n findEleme nts: function(target) {\n if (target.querySelectorAll) {\n return ta rget.querySelectorAll(SELECTOR);\n }\n return [];\n },\n removeE lement: function(el) {\n this.removeCallback(el);\n },\n addElement: function(el) {\n this.addCallback(el);\n },\n elementChanged: functio n(el, oldValue) {\n this.changedCallback(el, oldValue);\n },\n concat Lists: function(accum, list) {\n return accum.concat(toArray(list));\n } ,\n // register all touch-action = none nodes on document load\n installOn Load: function() {\n document.addEventListener('readystatechange', function () {\n if (document.readyState === 'complete') {\n this.installN ewSubtree(document);\n }\n }.bind(this));\n },\n isElement: fu nction(n) {\n return n.nodeType === Node.ELEMENT_NODE;\n },\n flatten MutationTree: function(inNodes) {\n // find children with touch-action\n var tree = map(inNodes, this.findElements, this);\n // make sure the add ed nodes are accounted for\n tree.push(filter(inNodes, this.isElement));\n // flatten the list\n return tree.reduce(this.concatLists, []);\n } ,\n mutationWatcher: function(mutations) {\n mutations.forEach(this.muta tionHandler, this);\n },\n mutationHandler: function(m) {\n if (m.typ e === 'childList') {\n var added = this.flattenMutationTree(m.addedNodes) ;\n added.forEach(this.addElement, this);\n var removed = this.fla ttenMutationTree(m.removedNodes);\n removed.forEach(this.removeElement, t his);\n } else if (m.type === 'attributes') {\n this.elementChanged( m.target, m.oldValue);\n }\n }\n };\n\n if (!MO) {\n Installer.prot otype.watchSubtree = function(){\n console.warn('PointerEventsPolyfill: Mut ationObservers not found, touch-action will not be dynamically detected');\n };\n }\n\n scope.Installer = Installer;\n})(window.PointerEventsPolyfill);\n",
184 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function (scope) {\n var dispatcher = scope.dispatcher; \n var pointermap = dispatcher.pointermap;\n // radius around touchend that sw allows mouse events\n var DEDUP_DIST = 25;\n\n // handler block for native mou se events\n var mouseEvents = {\n POINTER_ID: 1,\n POINTER_TYPE: 'mouse', \n events: [\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout'\n ],\n register: function(target) {\n dispatcher.listen(target, this.events);\n },\n unregister: function(targe t) {\n dispatcher.unlisten(target, this.events);\n },\n lastTouches: [],\n // collide with the global mouse listener\n isEventSimulatedFromTouc h: function(inEvent) {\n var lts = this.lastTouches;\n var x = inEvent .clientX, y = inEvent.clientY;\n for (var i = 0, l = lts.length, t; i < l & & (t = lts[i]); i++) {\n // simulated mouse events will be swallowed near a primary touchend\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y); \n if (dx <= DEDUP_DIST && dy <= DEDUP_DIST) {\n return true;\n }\n }\n },\n prepareEvent: function(inEvent) {\n var e = dispatcher.cloneEvent(inEvent);\n // forward mouse preventDefault\n va r pd = e.preventDefault;\n e.preventDefault = function() {\n inEvent .preventDefault();\n pd();\n };\n e.pointerId = this.POINTER_ID ;\n e.isPrimary = true;\n e.pointerType = this.POINTER_TYPE;\n re turn e;\n },\n mousedown: function(inEvent) {\n if (!this.isEventSimu latedFromTouch(inEvent)) {\n var p = pointermap.has(this.POINTER_ID);\n // TODO(dfreedman) workaround for some elements not sending mouseup\n // http://crbug/149091\n if (p) {\n this.cancel(inEvent);\n }\n var e = this.prepareEvent(inEvent);\n pointermap.set(thi s.POINTER_ID, inEvent);\n dispatcher.down(e);\n }\n },\n mouse move: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) { \n var e = this.prepareEvent(inEvent);\n dispatcher.move(e);\n }\n },\n mouseup: function(inEvent) {\n if (!this.isEventSimulatedF romTouch(inEvent)) {\n var p = pointermap.get(this.POINTER_ID);\n if (p && p.button === inEvent.button) {\n var e = this.prepareEvent(inE vent);\n dispatcher.up(e);\n this.cleanupMouse();\n }\n }\n },\n mouseover: function(inEvent) {\n if (!this.isEventSimu latedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n dispatcher.enterOver(e);\n }\n },\n mouseout: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepa reEvent(inEvent);\n dispatcher.leaveOut(e);\n }\n },\n cancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatche r.cancel(e);\n this.cleanupMouse();\n },\n cleanupMouse: function() { \n pointermap['delete'](this.POINTER_ID);\n }\n };\n\n scope.mouseEven ts = mouseEvents;\n})(window.PointerEventsPolyfill);\n", 187 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function (scope) {\n var dispatcher = scope.dispatcher; \n var pointermap = dispatcher.pointermap;\n // radius around touchend that sw allows mouse events\n var DEDUP_DIST = 25;\n\n // handler block for native mou se events\n var mouseEvents = {\n POINTER_ID: 1,\n POINTER_TYPE: 'mouse', \n events: [\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout'\n ],\n register: function(target) {\n dispatcher.listen(target, this.events);\n },\n unregister: function(targe t) {\n dispatcher.unlisten(target, this.events);\n },\n lastTouches: [],\n // collide with the global mouse listener\n isEventSimulatedFromTouc h: function(inEvent) {\n var lts = this.lastTouches;\n var x = inEvent .clientX, y = inEvent.clientY;\n for (var i = 0, l = lts.length, t; i < l & & (t = lts[i]); i++) {\n // simulated mouse events will be swallowed near a primary touchend\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y); \n if (dx <= DEDUP_DIST && dy <= DEDUP_DIST) {\n return true;\n }\n }\n },\n prepareEvent: function(inEvent) {\n var e = dispatcher.cloneEvent(inEvent);\n // forward mouse preventDefault\n va r pd = e.preventDefault;\n e.preventDefault = function() {\n inEvent .preventDefault();\n pd();\n };\n e.pointerId = this.POINTER_ID ;\n e.isPrimary = true;\n e.pointerType = this.POINTER_TYPE;\n re turn e;\n },\n mousedown: function(inEvent) {\n if (!this.isEventSimu latedFromTouch(inEvent)) {\n var p = pointermap.has(this.POINTER_ID);\n // TODO(dfreedman) workaround for some elements not sending mouseup\n // http://crbug/149091\n if (p) {\n this.cancel(inEvent);\n }\n var e = this.prepareEvent(inEvent);\n pointermap.set(thi s.POINTER_ID, inEvent);\n dispatcher.down(e);\n }\n },\n mouse move: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) { \n var e = this.prepareEvent(inEvent);\n dispatcher.move(e);\n }\n },\n mouseup: function(inEvent) {\n if (!this.isEventSimulatedF romTouch(inEvent)) {\n var p = pointermap.get(this.POINTER_ID);\n if (p && p.button === inEvent.button) {\n var e = this.prepareEvent(inE vent);\n dispatcher.up(e);\n this.cleanupMouse();\n }\n }\n },\n mouseover: function(inEvent) {\n if (!this.isEventSimu latedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n dispatcher.enterOver(e);\n }\n },\n mouseout: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepa reEvent(inEvent);\n dispatcher.leaveOut(e);\n }\n },\n cancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatche r.cancel(e);\n this.cleanupMouse();\n },\n cleanupMouse: function() { \n pointermap['delete'](this.POINTER_ID);\n }\n };\n\n scope.mouseEven ts = mouseEvents;\n})(window.PointerEventsPolyfill);\n",
185 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var findTarget = scope.findTarget;\n var allShadows = scope.targetFinding.al lShadows.bind(scope.targetFinding);\n var pointermap = dispatcher.pointermap;\n var touchMap = Array.prototype.map.call.bind(Array.prototype.map);\n // This should be long enough to ignore compat mouse events made by touch\n var DEDUP_T IMEOUT = 2500;\n var CLICK_COUNT_TIMEOUT = 200;\n var ATTRIB = 'touch-action'; \n var INSTALLER;\n // The presence of touch event handlers blocks scrolling, and so we must be careful to\n // avoid adding handlers unnecessarily. Chrome plans to add a touch-action-delay property\n // (crbug.com/329559) to address t his, and once we have that we can opt-in to a simpler\n // handler registration mechanism. Rather than try to predict how exactly to opt-in to\n // that we'l l just leave this disabled until there is a build of Chrome to test.\n var HAS_ TOUCH_ACTION_DELAY = false;\n \n // handler block for native touch events\n v ar touchEvents = {\n scrollType: new WeakMap(),\n events: [\n 'touchs tart',\n 'touchmove',\n 'touchend',\n 'touchcancel'\n ],\n register: function(target) {\n if (HAS_TOUCH_ACTION_DELAY) {\n dispa tcher.listen(target, this.events);\n } else {\n INSTALLER.enableOnSu btree(target);\n }\n },\n unregister: function(target) {\n if (H AS_TOUCH_ACTION_DELAY) {\n dispatcher.unlisten(target, this.events);\n } else {\n // TODO(dfreedman): is it worth it to disconnect the MO?\n }\n },\n elementAdded: function(el) {\n var a = el.getAttribute( ATTRIB);\n var st = this.touchActionToScrollType(a);\n if (st) {\n this.scrollType.set(el, st);\n dispatcher.listen(el, this.events);\n // set touch-action on shadows as well\n allShadows(el).forEach(fu nction(s) {\n this.scrollType.set(s, st);\n dispatcher.listen( s, this.events);\n }, this);\n }\n },\n elementRemoved: functi on(el) {\n this.scrollType['delete'](el);\n dispatcher.unlisten(el, th is.events);\n // remove touch-action from shadow\n allShadows(el).forE ach(function(s) {\n this.scrollType['delete'](s);\n dispatcher.unl isten(s, this.events);\n }, this);\n },\n elementChanged: function(el , oldValue) {\n var a = el.getAttribute(ATTRIB);\n var st = this.touch ActionToScrollType(a);\n var oldSt = this.touchActionToScrollType(oldValue) ;\n // simply update scrollType if listeners are already established\n if (st && oldSt) {\n this.scrollType.set(el, st);\n allShadows(el ).forEach(function(s) {\n this.scrollType.set(s, st);\n }, this) ;\n } else if (oldSt) {\n this.elementRemoved(el);\n } else if (st) {\n this.elementAdded(el);\n }\n },\n scrollTypes: {\n EMITTER: 'none',\n XSCROLLER: 'pan-x',\n YSCROLLER: 'pan-y',\n SCROLLER: /^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/\n },\n touchActionToSc rollType: function(touchAction) {\n var t = touchAction;\n var st = th is.scrollTypes;\n if (t === 'none') {\n return 'none';\n } else if (t === st.XSCROLLER) {\n return 'X';\n } else if (t === st.YSCRO LLER) {\n return 'Y';\n } else if (st.SCROLLER.exec(t)) {\n r eturn 'XY';\n }\n },\n POINTER_TYPE: 'touch',\n firstTouch: null,\ n isPrimaryTouch: function(inTouch) {\n return this.firstTouch === inTou ch.identifier;\n },\n setPrimaryTouch: function(inTouch) {\n // set p rimary touch if there no pointers, or the only pointer is the mouse\n if (p ointermap.pointers() === 0 || (pointermap.pointers() === 1 && pointermap.has(1)) ) {\n this.firstTouch = inTouch.identifier;\n this.firstXY = {X: i nTouch.clientX, Y: inTouch.clientY};\n this.scrolling = false;\n t his.cancelResetClickCount();\n }\n },\n removePrimaryPointer: functio n(inPointer) {\n if (inPointer.isPrimary) {\n this.firstTouch = null ;\n this.firstXY = null;\n this.resetClickCount();\n }\n } ,\n clickCount: 0,\n resetId: null,\n resetClickCount: function() {\n var fn = function() {\n this.clickCount = 0;\n this.resetId = null;\n }.bind(this);\n this.resetId = setTimeout(fn, CLICK_COUNT_TIME OUT);\n },\n cancelResetClickCount: function() {\n if (this.resetId) {\n clearTimeout(this.resetId);\n }\n },\n touchToPointer: fun ction(inTouch) {\n var e = dispatcher.cloneEvent(inTouch);\n // Spec s pecifies that pointerId 1 is reserved for Mouse.\n // Touch identifiers can start at 0.\n // Add 2 to the touch identifier for compatibility.\n e .pointerId = inTouch.identifier + 2;\n e.target = findTarget(e);\n e.b ubbles = true;\n e.cancelable = true;\n e.detail = this.clickCount;\n e.button = 0;\n e.buttons = 1;\n e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;\n e.height = inTouch.webkitRadiusY || inTouch.radi usY || 0;\n e.pressure = inTouch.webkitForce || inTouch.force || 0.5;\n e.isPrimary = this.isPrimaryTouch(inTouch);\n e.pointerType = this.POINTE R_TYPE;\n return e;\n },\n processTouches: function(inEvent, inFuncti on) {\n var tl = inEvent.changedTouches;\n var pointers = touchMap(tl, this.touchToPointer, this);\n // forward touch preventDefaults\n poin ters.forEach(function(p) {\n p.preventDefault = function() {\n t his.scrolling = false;\n this.firstXY = null;\n inEvent.preven tDefault();\n };\n }, this);\n pointers.forEach(inFunction, thi s);\n },\n // For single axis scrollers, determines whether the element sh ould emit\n // pointer events or behave as a scroller\n shouldScroll: func tion(inEvent) {\n if (this.firstXY) {\n var ret;\n var scroll Axis = this.scrollType.get(inEvent.currentTarget);\n if (scrollAxis === ' none') {\n // this element is a touch-action: none, should never scroll \n ret = false;\n } else if (scrollAxis === 'XY') {\n / / this element should always scroll\n ret = true;\n } else {\n var t = inEvent.changedTouches[0];\n // check the intended scro ll axis, and other axis\n var a = scrollAxis;\n var oa = scrol lAxis === 'Y' ? 'X' : 'Y';\n var da = Math.abs(t['client' + a] - this.f irstXY[a]);\n var doa = Math.abs(t['client' + oa] - this.firstXY[oa]);\ n // if delta in the scroll axis > delta other axis, scroll instead of\ n // making events\n ret = da >= doa;\n }\n this .firstXY = null;\n return ret;\n }\n },\n findTouch: function( inTL, inId) {\n for (var i = 0, l = inTL.length, t; i < l && (t = inTL[i]); i++) {\n if (t.identifier === inId) {\n return true;\n } \n }\n },\n // In some instances, a touchstart can happen without a t ouchend. This\n // leaves the pointermap in a broken state.\n // Therefore , on every touchstart, we remove the touches that did not fire a\n // touchen d event.\n // To keep state globally consistent, we fire a\n // pointercan cel for this \"abandoned\" touch\n vacuumTouches: function(inEvent) {\n var tl = inEvent.touches;\n // pointermap.pointers() should be < tl.length here, as the touchstart has not\n // been processed yet.\n if (pointer map.pointers() >= tl.length) {\n var d = [];\n pointermap.forEach( function(value, key) {\n // Never remove pointerId == 1, which is mouse .\n // Touch identifiers are 2 smaller than their pointerId, which is t he\n // index in pointermap.\n if (key !== 1 && !this.findTouc h(tl, key - 2)) {\n var p = value.out;\n d.push(this.touch ToPointer(p));\n }\n }, this);\n d.forEach(this.cancelOut , this);\n }\n },\n touchstart: function(inEvent) {\n this.vacuu mTouches(inEvent);\n this.setPrimaryTouch(inEvent.changedTouches[0]);\n this.dedupSynthMouse(inEvent);\n if (!this.scrolling) {\n this.cli ckCount++;\n this.processTouches(inEvent, this.overDown);\n }\n } ,\n overDown: function(inPointer) {\n var p = pointermap.set(inPointer.p ointerId, {\n target: inPointer.target,\n out: inPointer,\n outTarget: inPointer.target\n });\n dispatcher.over(inPointer);\n dispatcher.enter(inPointer);\n dispatcher.down(inPointer);\n },\n t ouchmove: function(inEvent) {\n if (!this.scrolling) {\n if (this.sh ouldScroll(inEvent)) {\n this.scrolling = true;\n this.touchca ncel(inEvent);\n } else {\n inEvent.preventDefault();\n this.processTouches(inEvent, this.moveOverOut);\n }\n }\n },\n moveOverOut: function(inPointer) {\n var event = inPointer;\n var po inter = pointermap.get(event.pointerId);\n // a finger drifted off the scre en, ignore it\n if (!pointer) {\n return;\n }\n var outEve nt = pointer.out;\n var outTarget = pointer.outTarget;\n dispatcher.mo ve(event);\n if (outEvent && outTarget !== event.target) {\n outEven t.relatedTarget = event.target;\n event.relatedTarget = outTarget;\n // recover from retargeting by shadow\n outEvent.target = outTarget;\n if (event.target) {\n dispatcher.leaveOut(outEvent);\n dispatcher.enterOver(event);\n } else {\n // clean up case when finger leaves the screen\n event.target = outTarget;\n event. relatedTarget = null;\n this.cancelOut(event);\n }\n }\n pointer.out = event;\n pointer.outTarget = event.target;\n },\n to uchend: function(inEvent) {\n this.dedupSynthMouse(inEvent);\n this.pr ocessTouches(inEvent, this.upOut);\n },\n upOut: function(inPointer) {\n if (!this.scrolling) {\n dispatcher.up(inPointer);\n dispatche r.out(inPointer);\n dispatcher.leave(inPointer);\n }\n this.cle anUpPointer(inPointer);\n },\n touchcancel: function(inEvent) {\n thi s.processTouches(inEvent, this.cancelOut);\n },\n cancelOut: function(inPo inter) {\n dispatcher.cancel(inPointer);\n dispatcher.out(inPointer);\ n dispatcher.leave(inPointer);\n this.cleanUpPointer(inPointer);\n },\n cleanUpPointer: function(inPointer) {\n pointermap['delete'](inPoin ter.pointerId);\n this.removePrimaryPointer(inPointer);\n },\n // pre vent synth mouse events from creating pointer events\n dedupSynthMouse: funct ion(inEvent) {\n var lts = scope.mouseEvents.lastTouches;\n var t = in Event.changedTouches[0];\n // only the primary finger will synth mouse even ts\n if (this.isPrimaryTouch(t)) {\n // remember x/y of last touch\n var lt = {x: t.clientX, y: t.clientY};\n lts.push(lt);\n v ar fn = (function(lts, lt){\n var i = lts.indexOf(lt);\n if (i > -1) {\n lts.splice(i, 1);\n }\n }).bind(null, lts, lt);\n setTimeout(fn, DEDUP_TIMEOUT);\n }\n }\n };\n\n if (!HA S_TOUCH_ACTION_DELAY) {\n INSTALLER = new scope.Installer(touchEvents.element Added, touchEvents.elementRemoved, touchEvents.elementChanged, touchEvents);\n }\n\n scope.touchEvents = touchEvents;\n})(window.PointerEventsPolyfill);\n", 188 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var findTarget = scope.findTarget;\n var allShadows = scope.targetFinding.al lShadows.bind(scope.targetFinding);\n var pointermap = dispatcher.pointermap;\n var touchMap = Array.prototype.map.call.bind(Array.prototype.map);\n // This should be long enough to ignore compat mouse events made by touch\n var DEDUP_T IMEOUT = 2500;\n var CLICK_COUNT_TIMEOUT = 200;\n var ATTRIB = 'touch-action'; \n var INSTALLER;\n // The presence of touch event handlers blocks scrolling, and so we must be careful to\n // avoid adding handlers unnecessarily. Chrome plans to add a touch-action-delay property\n // (crbug.com/329559) to address t his, and once we have that we can opt-in to a simpler\n // handler registration mechanism. Rather than try to predict how exactly to opt-in to\n // that we'l l just leave this disabled until there is a build of Chrome to test.\n var HAS_ TOUCH_ACTION_DELAY = false;\n \n // handler block for native touch events\n v ar touchEvents = {\n scrollType: new WeakMap(),\n events: [\n 'touchs tart',\n 'touchmove',\n 'touchend',\n 'touchcancel'\n ],\n register: function(target) {\n if (HAS_TOUCH_ACTION_DELAY) {\n dispa tcher.listen(target, this.events);\n } else {\n INSTALLER.enableOnSu btree(target);\n }\n },\n unregister: function(target) {\n if (H AS_TOUCH_ACTION_DELAY) {\n dispatcher.unlisten(target, this.events);\n } else {\n // TODO(dfreedman): is it worth it to disconnect the MO?\n }\n },\n elementAdded: function(el) {\n var a = el.getAttribute( ATTRIB);\n var st = this.touchActionToScrollType(a);\n if (st) {\n this.scrollType.set(el, st);\n dispatcher.listen(el, this.events);\n // set touch-action on shadows as well\n allShadows(el).forEach(fu nction(s) {\n this.scrollType.set(s, st);\n dispatcher.listen( s, this.events);\n }, this);\n }\n },\n elementRemoved: functi on(el) {\n this.scrollType['delete'](el);\n dispatcher.unlisten(el, th is.events);\n // remove touch-action from shadow\n allShadows(el).forE ach(function(s) {\n this.scrollType['delete'](s);\n dispatcher.unl isten(s, this.events);\n }, this);\n },\n elementChanged: function(el , oldValue) {\n var a = el.getAttribute(ATTRIB);\n var st = this.touch ActionToScrollType(a);\n var oldSt = this.touchActionToScrollType(oldValue) ;\n // simply update scrollType if listeners are already established\n if (st && oldSt) {\n this.scrollType.set(el, st);\n allShadows(el ).forEach(function(s) {\n this.scrollType.set(s, st);\n }, this) ;\n } else if (oldSt) {\n this.elementRemoved(el);\n } else if (st) {\n this.elementAdded(el);\n }\n },\n scrollTypes: {\n EMITTER: 'none',\n XSCROLLER: 'pan-x',\n YSCROLLER: 'pan-y',\n SCROLLER: /^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/\n },\n touchActionToSc rollType: function(touchAction) {\n var t = touchAction;\n var st = th is.scrollTypes;\n if (t === 'none') {\n return 'none';\n } else if (t === st.XSCROLLER) {\n return 'X';\n } else if (t === st.YSCRO LLER) {\n return 'Y';\n } else if (st.SCROLLER.exec(t)) {\n r eturn 'XY';\n }\n },\n POINTER_TYPE: 'touch',\n firstTouch: null,\ n isPrimaryTouch: function(inTouch) {\n return this.firstTouch === inTou ch.identifier;\n },\n setPrimaryTouch: function(inTouch) {\n // set p rimary touch if there no pointers, or the only pointer is the mouse\n if (p ointermap.pointers() === 0 || (pointermap.pointers() === 1 && pointermap.has(1)) ) {\n this.firstTouch = inTouch.identifier;\n this.firstXY = {X: i nTouch.clientX, Y: inTouch.clientY};\n this.scrolling = false;\n t his.cancelResetClickCount();\n }\n },\n removePrimaryPointer: functio n(inPointer) {\n if (inPointer.isPrimary) {\n this.firstTouch = null ;\n this.firstXY = null;\n this.resetClickCount();\n }\n } ,\n clickCount: 0,\n resetId: null,\n resetClickCount: function() {\n var fn = function() {\n this.clickCount = 0;\n this.resetId = null;\n }.bind(this);\n this.resetId = setTimeout(fn, CLICK_COUNT_TIME OUT);\n },\n cancelResetClickCount: function() {\n if (this.resetId) {\n clearTimeout(this.resetId);\n }\n },\n typeToButtons: func tion(type) {\n var ret = 0;\n if (type === 'touchstart' || type === 't ouchmove') {\n ret = 1;\n }\n return ret;\n },\n touchToP ointer: function(inTouch) {\n var e = dispatcher.cloneEvent(inTouch);\n // Spec specifies that pointerId 1 is reserved for Mouse.\n // Touch iden tifiers can start at 0.\n // Add 2 to the touch identifier for compatibilit y.\n e.pointerId = inTouch.identifier + 2;\n e.target = findTarget(e); \n e.bubbles = true;\n e.cancelable = true;\n e.detail = this.cli ckCount;\n e.button = 0;\n e.buttons = this.typeToButtons(this.current TouchEvent);\n e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;\n e.height = inTouch.webkitRadiusY || inTouch.radiusY || 0;\n e.pressure = inTouch.webkitForce || inTouch.force || 0.5;\n e.isPrimary = this.isPrima ryTouch(inTouch);\n e.pointerType = this.POINTER_TYPE;\n return e;\n },\n processTouches: function(inEvent, inFunction) {\n var tl = inEven t.changedTouches;\n this.currentTouchEvent = inEvent.type;\n var point ers = touchMap(tl, this.touchToPointer, this);\n // forward touch preventDe faults\n pointers.forEach(function(p) {\n p.preventDefault = functio n() {\n this.scrolling = false;\n this.firstXY = null;\n inEvent.preventDefault();\n };\n }, this);\n pointers.forEa ch(inFunction, this);\n },\n // For single axis scrollers, determines whet her the element should emit\n // pointer events or behave as a scroller\n shouldScroll: function(inEvent) {\n if (this.firstXY) {\n var ret;\n var scrollAxis = this.scrollType.get(inEvent.currentTarget);\n if (scrollAxis === 'none') {\n // this element is a touch-action: none, s hould never scroll\n ret = false;\n } else if (scrollAxis === 'X Y') {\n // this element should always scroll\n ret = true;\n } else {\n var t = inEvent.changedTouches[0];\n // check the intended scroll axis, and other axis\n var a = scrollAxis;\n var oa = scrollAxis === 'Y' ? 'X' : 'Y';\n var da = Math.abs(t['cli ent' + a] - this.firstXY[a]);\n var doa = Math.abs(t['client' + oa] - t his.firstXY[oa]);\n // if delta in the scroll axis > delta other axis, scroll instead of\n // making events\n ret = da >= doa;\n }\n this.firstXY = null;\n return ret;\n }\n },\n fi ndTouch: function(inTL, inId) {\n for (var i = 0, l = inTL.length, t; i < l && (t = inTL[i]); i++) {\n if (t.identifier === inId) {\n retur n true;\n }\n }\n },\n // In some instances, a touchstart can happen without a touchend. This\n // leaves the pointermap in a broken state. \n // Therefore, on every touchstart, we remove the touches that did not fire a\n // touchend event.\n // To keep state globally consistent, we fire a\ n // pointercancel for this \"abandoned\" touch\n vacuumTouches: function( inEvent) {\n var tl = inEvent.touches;\n // pointermap.pointers() shou ld be < tl.length here, as the touchstart has not\n // been processed yet.\ n if (pointermap.pointers() >= tl.length) {\n var d = [];\n p ointermap.forEach(function(value, key) {\n // Never remove pointerId == 1, which is mouse.\n // Touch identifiers are 2 smaller than their poi nterId, which is the\n // index in pointermap.\n if (key !== 1 && !this.findTouch(tl, key - 2)) {\n var p = value.out;\n d.push(this.touchToPointer(p));\n }\n }, this);\n d.forE ach(this.cancelOut, this);\n }\n },\n touchstart: function(inEvent) { \n this.vacuumTouches(inEvent);\n this.setPrimaryTouch(inEvent.changed Touches[0]);\n this.dedupSynthMouse(inEvent);\n if (!this.scrolling) { \n this.clickCount++;\n this.processTouches(inEvent, this.overDown );\n }\n },\n overDown: function(inPointer) {\n var p = pointerm ap.set(inPointer.pointerId, {\n target: inPointer.target,\n out: i nPointer,\n outTarget: inPointer.target\n });\n dispatcher.over (inPointer);\n dispatcher.enter(inPointer);\n dispatcher.down(inPointe r);\n },\n touchmove: function(inEvent) {\n if (!this.scrolling) {\n if (this.shouldScroll(inEvent)) {\n this.scrolling = true;\n this.touchcancel(inEvent);\n } else {\n inEvent.preventDef ault();\n this.processTouches(inEvent, this.moveOverOut);\n }\n }\n },\n moveOverOut: function(inPointer) {\n var event = inPoin ter;\n var pointer = pointermap.get(event.pointerId);\n // a finger dr ifted off the screen, ignore it\n if (!pointer) {\n return;\n } \n var outEvent = pointer.out;\n var outTarget = pointer.outTarget;\n dispatcher.move(event);\n if (outEvent && outTarget !== event.target) {\n outEvent.relatedTarget = event.target;\n event.relatedTarget = outTarget;\n // recover from retargeting by shadow\n outEvent.tar get = outTarget;\n if (event.target) {\n dispatcher.leaveOut(out Event);\n dispatcher.enterOver(event);\n } else {\n // clean up case when finger leaves the screen\n event.target = outTarget; \n event.relatedTarget = null;\n this.cancelOut(event);\n }\n }\n pointer.out = event;\n pointer.outTarget = event.targe t;\n },\n touchend: function(inEvent) {\n this.dedupSynthMouse(inEven t);\n this.processTouches(inEvent, this.upOut);\n },\n upOut: functio n(inPointer) {\n if (!this.scrolling) {\n dispatcher.up(inPointer);\ n dispatcher.out(inPointer);\n dispatcher.leave(inPointer);\n }\n this.cleanUpPointer(inPointer);\n },\n touchcancel: function(inE vent) {\n this.processTouches(inEvent, this.cancelOut);\n },\n cancel Out: function(inPointer) {\n dispatcher.cancel(inPointer);\n dispatche r.out(inPointer);\n dispatcher.leave(inPointer);\n this.cleanUpPointer (inPointer);\n },\n cleanUpPointer: function(inPointer) {\n pointerma p['delete'](inPointer.pointerId);\n this.removePrimaryPointer(inPointer);\n },\n // prevent synth mouse events from creating pointer events\n dedu pSynthMouse: function(inEvent) {\n var lts = scope.mouseEvents.lastTouches; \n var t = inEvent.changedTouches[0];\n // only the primary finger wil l synth mouse events\n if (this.isPrimaryTouch(t)) {\n // remember x /y of last touch\n var lt = {x: t.clientX, y: t.clientY};\n lts.pu sh(lt);\n var fn = (function(lts, lt){\n var i = lts.indexOf(lt) ;\n if (i > -1) {\n lts.splice(i, 1);\n }\n }).bind(null, lts, lt);\n setTimeout(fn, DEDUP_TIMEOUT);\n }\n }\ n };\n\n if (!HAS_TOUCH_ACTION_DELAY) {\n INSTALLER = new scope.Installer(t ouchEvents.elementAdded, touchEvents.elementRemoved, touchEvents.elementChanged, touchEvents);\n }\n\n scope.touchEvents = touchEvents;\n})(window.PointerEven tsPolyfill);\n",
186 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var pointermap = dispatcher.pointermap;\n var HAS_BITMAP_TYPE = window.MSPoi nterEvent && typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE === 'number';\n var msEvents = {\n events: [\n 'MSPointerDown',\n 'MSPointerMove',\ n 'MSPointerUp',\n 'MSPointerOut',\n 'MSPointerOver',\n 'MSP ointerCancel',\n 'MSGotPointerCapture',\n 'MSLostPointerCapture'\n ],\n register: function(target) {\n dispatcher.listen(target, this.event s);\n },\n unregister: function(target) {\n dispatcher.unlisten(targe t, this.events);\n },\n POINTER_TYPES: [\n '',\n 'unavailable',\ n 'touch',\n 'pen',\n 'mouse'\n ],\n prepareEvent: function (inEvent) {\n var e = inEvent;\n if (HAS_BITMAP_TYPE) {\n e = d ispatcher.cloneEvent(inEvent);\n e.pointerType = this.POINTER_TYPES[inEve nt.pointerType];\n }\n return e;\n },\n cleanup: function(id) {\ n pointermap['delete'](id);\n },\n MSPointerDown: function(inEvent) { \n pointermap.set(inEvent.pointerId, inEvent);\n var e = this.prepareE vent(inEvent);\n dispatcher.down(e);\n },\n MSPointerMove: function(i nEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.move(e);\ n },\n MSPointerUp: function(inEvent) {\n var e = this.prepareEvent(i nEvent);\n dispatcher.up(e);\n this.cleanup(inEvent.pointerId);\n } ,\n MSPointerOut: function(inEvent) {\n var e = this.prepareEvent(inEven t);\n dispatcher.leaveOut(e);\n },\n MSPointerOver: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.enterOver(e);\n },\n MSPointerCancel: function(inEvent) {\n var e = this.prepareEvent (inEvent);\n dispatcher.cancel(e);\n this.cleanup(inEvent.pointerId);\ n },\n MSLostPointerCapture: function(inEvent) {\n var e = dispatcher .makeEvent('lostpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n },\n MSGotPointerCapture: function(inEvent) {\n var e = dispatcher.m akeEvent('gotpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n }\n };\n\n scope.msEvents = msEvents;\n})(window.PointerEventsPolyfill);\n", 189 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var pointermap = dispatcher.pointermap;\n var HAS_BITMAP_TYPE = window.MSPoi nterEvent && typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE === 'number';\n var msEvents = {\n events: [\n 'MSPointerDown',\n 'MSPointerMove',\ n 'MSPointerUp',\n 'MSPointerOut',\n 'MSPointerOver',\n 'MSP ointerCancel',\n 'MSGotPointerCapture',\n 'MSLostPointerCapture'\n ],\n register: function(target) {\n dispatcher.listen(target, this.event s);\n },\n unregister: function(target) {\n dispatcher.unlisten(targe t, this.events);\n },\n POINTER_TYPES: [\n '',\n 'unavailable',\ n 'touch',\n 'pen',\n 'mouse'\n ],\n prepareEvent: function (inEvent) {\n var e = inEvent;\n if (HAS_BITMAP_TYPE) {\n e = d ispatcher.cloneEvent(inEvent);\n e.pointerType = this.POINTER_TYPES[inEve nt.pointerType];\n }\n return e;\n },\n cleanup: function(id) {\ n pointermap['delete'](id);\n },\n MSPointerDown: function(inEvent) { \n pointermap.set(inEvent.pointerId, inEvent);\n var e = this.prepareE vent(inEvent);\n dispatcher.down(e);\n },\n MSPointerMove: function(i nEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.move(e);\ n },\n MSPointerUp: function(inEvent) {\n var e = this.prepareEvent(i nEvent);\n dispatcher.up(e);\n this.cleanup(inEvent.pointerId);\n } ,\n MSPointerOut: function(inEvent) {\n var e = this.prepareEvent(inEven t);\n dispatcher.leaveOut(e);\n },\n MSPointerOver: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n dispatcher.enterOver(e);\n },\n MSPointerCancel: function(inEvent) {\n var e = this.prepareEvent (inEvent);\n dispatcher.cancel(e);\n this.cleanup(inEvent.pointerId);\ n },\n MSLostPointerCapture: function(inEvent) {\n var e = dispatcher .makeEvent('lostpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n },\n MSGotPointerCapture: function(inEvent) {\n var e = dispatcher.m akeEvent('gotpointercapture', inEvent);\n dispatcher.dispatchEvent(e);\n }\n };\n\n scope.msEvents = msEvents;\n})(window.PointerEventsPolyfill);\n",
187 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module contains the handlers for native plat form events.\n * From here, the dispatcher is called to create unified pointer e vents.\n * Included are touch events (v1), mouse events, and MSPointerEvents.\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n\n // only activa te if this platform does not have pointer events\n if (window.navigator.pointer Enabled === undefined) {\n Object.defineProperty(window.navigator, 'pointerEn abled', {value: true, enumerable: true});\n\n if (window.navigator.msPointerE nabled) {\n var tp = window.navigator.msMaxTouchPoints;\n Object.defin eProperty(window.navigator, 'maxTouchPoints', {\n value: tp,\n enu merable: true\n });\n dispatcher.registerSource('ms', scope.msEvents); \n } else {\n dispatcher.registerSource('mouse', scope.mouseEvents);\n if (window.ontouchstart !== undefined) {\n dispatcher.registerSource( 'touch', scope.touchEvents);\n }\n }\n\n dispatcher.register(document );\n }\n})(window.PointerEventsPolyfill);\n", 190 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module contains the handlers for native plat form events.\n * From here, the dispatcher is called to create unified pointer e vents.\n * Included are touch events (v1), mouse events, and MSPointerEvents.\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n\n // only activa te if this platform does not have pointer events\n if (window.navigator.pointer Enabled === undefined) {\n Object.defineProperty(window.navigator, 'pointerEn abled', {value: true, enumerable: true});\n\n if (window.navigator.msPointerE nabled) {\n var tp = window.navigator.msMaxTouchPoints;\n Object.defin eProperty(window.navigator, 'maxTouchPoints', {\n value: tp,\n enu merable: true\n });\n dispatcher.registerSource('ms', scope.msEvents); \n } else {\n dispatcher.registerSource('mouse', scope.mouseEvents);\n if (window.ontouchstart !== undefined) {\n dispatcher.registerSource( 'touch', scope.touchEvents);\n }\n }\n\n dispatcher.register(document );\n }\n})(window.PointerEventsPolyfill);\n",
188 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var n = window.navigator;\n var s, r;\n function assertDown(id) {\n if ( !dispatcher.pointermap.has(id)) {\n throw new Error('InvalidPointerId');\n }\n }\n if (n.msPointerEnabled) {\n s = function(pointerId) {\n ass ertDown(pointerId);\n this.msSetPointerCapture(pointerId);\n };\n r = function(pointerId) {\n assertDown(pointerId);\n this.msReleasePointe rCapture(pointerId);\n };\n } else {\n s = function setPointerCapture(poi nterId) {\n assertDown(pointerId);\n dispatcher.setCapture(pointerId, this);\n };\n r = function releasePointerCapture(pointerId) {\n asser tDown(pointerId);\n dispatcher.releaseCapture(pointerId, this);\n };\n }\n if (window.Element && !Element.prototype.setPointerCapture) {\n Object.d efineProperties(Element.prototype, {\n 'setPointerCapture': {\n valu e: s\n },\n 'releasePointerCapture': {\n value: r\n }\n });\n }\n})(window.PointerEventsPolyfill);\n", 191 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\ n var n = window.navigator;\n var s, r;\n function assertDown(id) {\n if ( !dispatcher.pointermap.has(id)) {\n throw new Error('InvalidPointerId');\n }\n }\n if (n.msPointerEnabled) {\n s = function(pointerId) {\n ass ertDown(pointerId);\n this.msSetPointerCapture(pointerId);\n };\n r = function(pointerId) {\n assertDown(pointerId);\n this.msReleasePointe rCapture(pointerId);\n };\n } else {\n s = function setPointerCapture(poi nterId) {\n assertDown(pointerId);\n dispatcher.setCapture(pointerId, this);\n };\n r = function releasePointerCapture(pointerId) {\n asser tDown(pointerId);\n dispatcher.releaseCapture(pointerId, this);\n };\n }\n if (window.Element && !Element.prototype.setPointerCapture) {\n Object.d efineProperties(Element.prototype, {\n 'setPointerCapture': {\n valu e: s\n },\n 'releasePointerCapture': {\n value: r\n }\n });\n }\n})(window.PointerEventsPolyfill);\n",
189 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * PointerGestureEvent is the constructor for all Po interGesture events.\n *\n * @module PointerGestures\n * @class PointerGestureEv ent\n * @extends UIEvent\n * @constructor\n * @param {String} inType Event type\ n * @param {Object} [inDict] Dictionary of properties to initialize on the event \n */\n\nfunction PointerGestureEvent(inType, inDict) {\n var dict = inDict || {};\n var e = document.createEvent('Event');\n var props = {\n bubbles: Boo lean(dict.bubbles) === dict.bubbles || true,\n cancelable: Boolean(dict.cance lable) === dict.cancelable || true\n };\n\n e.initEvent(inType, props.bubbles, props.cancelable);\n\n var keys = Object.keys(dict), k;\n for (var i = 0; i < keys.length; i++) {\n k = keys[i];\n e[k] = dict[k];\n }\n\n e.preventT ap = this.preventTap;\n\n return e;\n}\n\n/**\n * Allows for any gesture to pre vent the tap gesture.\n *\n * @method preventTap\n */\nPointerGestureEvent.proto type.preventTap = function() {\n this.tapPrevented = true;\n};\n\n", 192 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * PointerGestureEvent is the constructor for all Po interGesture events.\n *\n * @module PointerGestures\n * @class PointerGestureEv ent\n * @extends UIEvent\n * @constructor\n * @param {String} inType Event type\ n * @param {Object} [inDict] Dictionary of properties to initialize on the event \n */\n\nfunction PointerGestureEvent(inType, inDict) {\n var dict = inDict || {};\n var e = document.createEvent('Event');\n var props = {\n bubbles: Boo lean(dict.bubbles) === dict.bubbles || true,\n cancelable: Boolean(dict.cance lable) === dict.cancelable || true\n };\n\n e.initEvent(inType, props.bubbles, props.cancelable);\n\n var keys = Object.keys(dict), k;\n for (var i = 0; i < keys.length; i++) {\n k = keys[i];\n e[k] = dict[k];\n }\n\n e.preventT ap = this.preventTap;\n\n return e;\n}\n\n/**\n * Allows for any gesture to pre vent the tap gesture.\n *\n * @method preventTap\n */\nPointerGestureEvent.proto type.preventTap = function() {\n this.tapPrevented = true;\n};\n\n",
190 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n /**\n * This class contains the g esture recognizers that create the PointerGesture\n * events.\n *\n * @cla ss PointerGestures\n * @static\n */\n scope = scope || {};\n scope.utils = {\n LCA: {\n // Determines the lowest node in the ancestor chain of a a nd b\n find: function(a, b) {\n if (a === b) {\n return a;\ n }\n // fast case, a is a direct descendant of b or vice versa\n if (a.contains) {\n if (a.contains(b)) {\n return a;\ n }\n if (b.contains(a)) {\n return b;\n } \n }\n var adepth = this.depth(a);\n var bdepth = this.dept h(b);\n var d = adepth - bdepth;\n if (d > 0) {\n a = thi s.walk(a, d);\n } else {\n b = this.walk(b, -d);\n }\n while(a && b && a !== b) {\n a = this.walk(a, 1);\n b = t his.walk(b, 1);\n }\n return a;\n },\n walk: function(n, u) {\n for (var i = 0; i < u; i++) {\n n = n.parentNode;\n }\n return n;\n },\n depth: function(n) {\n var d = 0 ;\n while(n) {\n d++;\n n = n.parentNode;\n }\n return d;\n }\n }\n };\n scope.findLCA = function(a, b) {\n return scope.utils.LCA.find(a, b);\n }\n window.PointerGestures = scope;\n})(w indow.PointerGestures);\n", 193 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n /**\n * This class contains the g esture recognizers that create the PointerGesture\n * events.\n *\n * @cla ss PointerGestures\n * @static\n */\n scope = scope || {};\n scope.utils = {\n LCA: {\n // Determines the lowest node in the ancestor chain of a a nd b\n find: function(a, b) {\n if (a === b) {\n return a;\ n }\n // fast case, a is a direct descendant of b or vice versa\n if (a.contains) {\n if (a.contains(b)) {\n return a;\ n }\n if (b.contains(a)) {\n return b;\n } \n }\n var adepth = this.depth(a);\n var bdepth = this.dept h(b);\n var d = adepth - bdepth;\n if (d > 0) {\n a = thi s.walk(a, d);\n } else {\n b = this.walk(b, -d);\n }\n while(a && b && a !== b) {\n a = this.walk(a, 1);\n b = t his.walk(b, 1);\n }\n return a;\n },\n walk: function(n, u) {\n for (var i = 0; i < u; i++) {\n n = n.parentNode;\n }\n return n;\n },\n depth: function(n) {\n var d = 0 ;\n while(n) {\n d++;\n n = n.parentNode;\n }\n return d;\n }\n }\n };\n scope.findLCA = function(a, b) {\n return scope.utils.LCA.find(a, b);\n }\n window.PointerGestures = scope;\n})(w indow.PointerGestures);\n",
191 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module implements an map of pointer states\n */\n(function(scope) {\n var USE_MAP = window.Map && window.Map.prototype.forE ach;\n var POINTERS_FN = function(){ return this.size; };\n function PointerMa p() {\n if (USE_MAP) {\n var m = new Map();\n m.pointers = POINTERS _FN;\n return m;\n } else {\n this.keys = [];\n this.values = [];\n }\n }\n\n PointerMap.prototype = {\n set: function(inId, inEvent) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.val ues[i] = inEvent;\n } else {\n this.keys.push(inId);\n this.v alues.push(inEvent);\n }\n },\n has: function(inId) {\n return t his.keys.indexOf(inId) > -1;\n },\n 'delete': function(inId) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.keys.splice(i, 1 );\n this.values.splice(i, 1);\n }\n },\n get: function(inId) {\n var i = this.keys.indexOf(inId);\n return this.values[i];\n },\ n clear: function() {\n this.keys.length = 0;\n this.values.length = 0;\n },\n // return value, key, map\n forEach: function(callback, thi sArg) {\n this.values.forEach(function(v, i) {\n callback.call(thisA rg, v, this.keys[i], this);\n }, this);\n },\n pointers: function() { \n return this.keys.length;\n }\n };\n\n scope.PointerMap = PointerMap ;\n})(window.PointerGestures);\n", 194 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This module implements an map of pointer states\n */\n(function(scope) {\n var USE_MAP = window.Map && window.Map.prototype.forE ach;\n var POINTERS_FN = function(){ return this.size; };\n function PointerMa p() {\n if (USE_MAP) {\n var m = new Map();\n m.pointers = POINTERS _FN;\n return m;\n } else {\n this.keys = [];\n this.values = [];\n }\n }\n\n PointerMap.prototype = {\n set: function(inId, inEvent) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.val ues[i] = inEvent;\n } else {\n this.keys.push(inId);\n this.v alues.push(inEvent);\n }\n },\n has: function(inId) {\n return t his.keys.indexOf(inId) > -1;\n },\n 'delete': function(inId) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.keys.splice(i, 1 );\n this.values.splice(i, 1);\n }\n },\n get: function(inId) {\n var i = this.keys.indexOf(inId);\n return this.values[i];\n },\ n clear: function() {\n this.keys.length = 0;\n this.values.length = 0;\n },\n // return value, key, map\n forEach: function(callback, thi sArg) {\n this.values.forEach(function(v, i) {\n callback.call(thisA rg, v, this.keys[i], this);\n }, this);\n },\n pointers: function() { \n return this.keys.length;\n }\n };\n\n scope.PointerMap = PointerMap ;\n})(window.PointerGestures);\n",
192 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var CLONE_PROPS = [\n // MouseEv ent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX ',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey' ,\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n // DOM Level 3\n 'buttons',\n // PointerEvent\n 'pointerId',\n 'width', \n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType', \n 'hwTimestamp',\n 'isPrimary',\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'screenX',\n 'screenY',\n 'pageX',\n 'pageY',\n 'tapPrevented'\n ];\n\n var CLONE_DEFAULTS = [\n // MouseE vent\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n // DO M Level 3\n 0,\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n // event instance\n '',\n null,\n null,\n 0,\n 0,\n 0,\n 0\n ];\n\n var dispatcher = {\n hand ledEvents: new WeakMap(),\n targets: new WeakMap(),\n handlers: {},\n r ecognizers: {},\n events: {},\n // Add a new gesture recognizer to the eve nt listeners.\n // Recognizer needs an `events` property.\n registerRecogn izer: function(inName, inRecognizer) {\n var r = inRecognizer;\n this. recognizers[inName] = r;\n r.events.forEach(function(e) {\n if (r[e] ) {\n this.events[e] = true;\n var f = r[e].bind(r);\n this.addHandler(e, f);\n }\n }, this);\n },\n addHandler: fu nction(inEvent, inFn) {\n var e = inEvent;\n if (!this.handlers[e]) {\ n this.handlers[e] = [];\n }\n this.handlers[e].push(inFn);\n },\n // add event listeners for inTarget\n registerTarget: function(inTa rget) {\n this.listen(Object.keys(this.events), inTarget);\n },\n // remove event listeners for inTarget\n unregisterTarget: function(inTarget) {\ n this.unlisten(Object.keys(this.events), inTarget);\n },\n // LISTEN ER LOGIC\n eventHandler: function(inEvent) {\n if (this.handledEvents.ge t(inEvent)) {\n return;\n }\n var type = inEvent.type, fns = th is.handlers[type];\n if (fns) {\n this.makeQueue(fns, inEvent);\n }\n this.handledEvents.set(inEvent, true);\n },\n // queue event f or async dispatch\n makeQueue: function(inHandlerFns, inEvent) {\n // mu st clone events to keep the (possibly shadowed) target correct for\n // asy nc dispatching\n var e = this.cloneEvent(inEvent);\n setTimeout(this.r unQueue.bind(this, inHandlerFns, e), 0);\n },\n // Dispatch the queued eve nts\n runQueue: function(inHandlers, inEvent) {\n this.currentPointerId = inEvent.pointerId;\n for (var i = 0, f, l = inHandlers.length; (i < l) && (f = inHandlers[i]); i++) {\n f(inEvent);\n }\n this.currentPo interId = 0;\n },\n // set up event listeners\n listen: function(inEven ts, inTarget) {\n inEvents.forEach(function(e) {\n this.addEvent(e, this.boundHandler, false, inTarget);\n }, this);\n },\n // remove eve nt listeners\n unlisten: function(inEvents) {\n inEvents.forEach(functio n(e) {\n this.removeEvent(e, this.boundHandler, false, inTarget);\n }, this);\n },\n addEvent: function(inEventName, inEventHandler, inCapture , inTarget) {\n inTarget.addEventListener(inEventName, inEventHandler, inCa pture);\n },\n removeEvent: function(inEventName, inEventHandler, inCaptur e, inTarget) {\n inTarget.removeEventListener(inEventName, inEventHandler, inCapture);\n },\n // EVENT CREATION AND TRACKING\n // Creates a new Ev ent of type `inType`, based on the information in\n // `inEvent`.\n makeEv ent: function(inType, inDict) {\n return new PointerGestureEvent(inType, in Dict);\n },\n /*\n * Returns a snapshot of inEvent, with writable prop erties.\n *\n * @method cloneEvent\n * @param {Event} inEvent An eve nt that contains properties to copy.\n * @return {Object} An object containi ng shallow copies of `inEvent`'s\n * properties.\n */\n cloneEvent : function(inEvent) {\n var eventCopy = {}, p;\n for (var i = 0; i < C LONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = i nEvent[p] || CLONE_DEFAULTS[i];\n }\n return eventCopy;\n },\n / / Dispatches the event to its target.\n dispatchEvent: function(inEvent, inTa rget) {\n var t = inTarget || this.targets.get(inEvent);\n if (t) {\n t.dispatchEvent(inEvent);\n if (inEvent.tapPrevented) {\n this.preventTap(this.currentPointerId);\n }\n }\n },\n asyncD ispatchEvent: function(inEvent, inTarget) {\n var fn = function() {\n this.dispatchEvent(inEvent, inTarget);\n }.bind(this);\n setTimeout( fn, 0);\n },\n preventTap: function(inPointerId) {\n var t = this.rec ognizers.tap;\n if (t){\n t.preventTap(inPointerId);\n }\n } \n };\n dispatcher.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n scope.dispatcher = dispatcher;\n var registerQueue = [];\n var immediateRegis ter = false;\n /**\n * Enable gesture events for a given scope, typically\n * [ShadowRoots](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/i ndex.html#shadow-root-object).\n *\n * @for PointerGestures\n * @method re gister\n * @param {ShadowRoot} scope A top level scope to enable gesture\n * support on.\n */\n scope.register = function(inScope) {\n if (immediateRe gister) {\n var pe = window.PointerEventsPolyfill;\n if (pe) {\n pe.register(inScope);\n }\n scope.dispatcher.registerTarget(inScope) ;\n } else {\n registerQueue.push(inScope);\n }\n };\n // wait to r egister scopes until recognizers load\n document.addEventListener('DOMContentLo aded', function() {\n immediateRegister = true;\n registerQueue.push(docum ent);\n registerQueue.forEach(scope.register);\n });\n})(window.PointerGestu res);\n", 195 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n(function(scope) {\n var CLONE_PROPS = [\n // MouseEv ent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX ',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey' ,\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n // DOM Level 3\n 'buttons',\n // PointerEvent\n 'pointerId',\n 'width', \n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType', \n 'hwTimestamp',\n 'isPrimary',\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'screenX',\n 'screenY',\n 'pageX',\n 'pageY',\n 'tapPrevented'\n ];\n\n var CLONE_DEFAULTS = [\n // MouseE vent\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n // DO M Level 3\n 0,\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n // event instance\n '',\n null,\n null,\n 0,\n 0,\n 0,\n 0\n ];\n\n var dispatcher = {\n hand ledEvents: new WeakMap(),\n targets: new WeakMap(),\n handlers: {},\n r ecognizers: {},\n events: {},\n // Add a new gesture recognizer to the eve nt listeners.\n // Recognizer needs an `events` property.\n registerRecogn izer: function(inName, inRecognizer) {\n var r = inRecognizer;\n this. recognizers[inName] = r;\n r.events.forEach(function(e) {\n if (r[e] ) {\n this.events[e] = true;\n var f = r[e].bind(r);\n this.addHandler(e, f);\n }\n }, this);\n },\n addHandler: fu nction(inEvent, inFn) {\n var e = inEvent;\n if (!this.handlers[e]) {\ n this.handlers[e] = [];\n }\n this.handlers[e].push(inFn);\n },\n // add event listeners for inTarget\n registerTarget: function(inTa rget) {\n this.listen(Object.keys(this.events), inTarget);\n },\n // remove event listeners for inTarget\n unregisterTarget: function(inTarget) {\ n this.unlisten(Object.keys(this.events), inTarget);\n },\n // LISTEN ER LOGIC\n eventHandler: function(inEvent) {\n if (this.handledEvents.ge t(inEvent)) {\n return;\n }\n var type = inEvent.type, fns = th is.handlers[type];\n if (fns) {\n this.makeQueue(fns, inEvent);\n }\n this.handledEvents.set(inEvent, true);\n },\n // queue event f or async dispatch\n makeQueue: function(inHandlerFns, inEvent) {\n // mu st clone events to keep the (possibly shadowed) target correct for\n // asy nc dispatching\n var e = this.cloneEvent(inEvent);\n setTimeout(this.r unQueue.bind(this, inHandlerFns, e), 0);\n },\n // Dispatch the queued eve nts\n runQueue: function(inHandlers, inEvent) {\n this.currentPointerId = inEvent.pointerId;\n for (var i = 0, f, l = inHandlers.length; (i < l) && (f = inHandlers[i]); i++) {\n f(inEvent);\n }\n this.currentPo interId = 0;\n },\n // set up event listeners\n listen: function(inEven ts, inTarget) {\n inEvents.forEach(function(e) {\n this.addEvent(e, this.boundHandler, false, inTarget);\n }, this);\n },\n // remove eve nt listeners\n unlisten: function(inEvents) {\n inEvents.forEach(functio n(e) {\n this.removeEvent(e, this.boundHandler, false, inTarget);\n }, this);\n },\n addEvent: function(inEventName, inEventHandler, inCapture , inTarget) {\n inTarget.addEventListener(inEventName, inEventHandler, inCa pture);\n },\n removeEvent: function(inEventName, inEventHandler, inCaptur e, inTarget) {\n inTarget.removeEventListener(inEventName, inEventHandler, inCapture);\n },\n // EVENT CREATION AND TRACKING\n // Creates a new Ev ent of type `inType`, based on the information in\n // `inEvent`.\n makeEv ent: function(inType, inDict) {\n return new PointerGestureEvent(inType, in Dict);\n },\n /*\n * Returns a snapshot of inEvent, with writable prop erties.\n *\n * @method cloneEvent\n * @param {Event} inEvent An eve nt that contains properties to copy.\n * @return {Object} An object containi ng shallow copies of `inEvent`'s\n * properties.\n */\n cloneEvent : function(inEvent) {\n var eventCopy = {}, p;\n for (var i = 0; i < C LONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = i nEvent[p] || CLONE_DEFAULTS[i];\n }\n return eventCopy;\n },\n / / Dispatches the event to its target.\n dispatchEvent: function(inEvent, inTa rget) {\n var t = inTarget || this.targets.get(inEvent);\n if (t) {\n t.dispatchEvent(inEvent);\n if (inEvent.tapPrevented) {\n this.preventTap(this.currentPointerId);\n }\n }\n },\n asyncD ispatchEvent: function(inEvent, inTarget) {\n var fn = function() {\n this.dispatchEvent(inEvent, inTarget);\n }.bind(this);\n setTimeout( fn, 0);\n },\n preventTap: function(inPointerId) {\n var t = this.rec ognizers.tap;\n if (t){\n t.preventTap(inPointerId);\n }\n } \n };\n dispatcher.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n // recognizers call into the dispatcher and load later\n // solve the chicken and egg problem by having registerScopes module run last\n dispatcher.registerQ ueue = [];\n dispatcher.immediateRegister = false;\n scope.dispatcher = dispat cher;\n /**\n * Enable gesture events for a given scope, typically\n * [Sha dowRoots](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.ht ml#shadow-root-object).\n *\n * @for PointerGestures\n * @method register\ n * @param {ShadowRoot} scope A top level scope to enable gesture\n * suppor t on.\n */\n scope.register = function(inScope) {\n if (dispatcher.immedia teRegister) {\n var pe = window.PointerEventsPolyfill;\n if (pe) {\n pe.register(inScope);\n }\n scope.dispatcher.registerTarget(inSc ope);\n } else {\n dispatcher.registerQueue.push(inScope);\n }\n };\ n scope.register(document);\n})(window.PointerGestures);\n",
193 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event is fired when a pointer is held down f or 200ms.\n *\n * @module PointerGestures\n * @submodule Events\n * @class hold\ n */\n/**\n * Type of pointer that made the holding event.\n * @type String\n * @property pointerType\n */\n/**\n * Screen X axis position of the held pointer\n * @type Number\n * @property clientX\n */\n/**\n * Screen Y axis position of th e held pointer\n * @type Number\n * @property clientY\n */\n/**\n * Type of poin ter that made the holding event.\n * @type String\n * @property pointerType\n */ \n/**\n * This event is fired every 200ms while a pointer is held down.\n *\n * @class holdpulse\n * @extends hold\n */\n/**\n * Milliseconds pointer has been h eld down.\n * @type Number\n * @property holdTime\n */\n/**\n * This event is fi red when a held pointer is released or moved.\n *\n * @class released\n */\n\n(f unction(scope) {\n var dispatcher = scope.dispatcher;\n var hold = {\n // w ait at least HOLD_DELAY ms between hold and pulse events\n HOLD_DELAY: 200,\n // pointer can move WIGGLE_THRESHOLD pixels before not counting as a hold\n WIGGLE_THRESHOLD: 16,\n events: [\n 'pointerdown',\n 'pointermov e',\n 'pointerup',\n 'pointercancel'\n ],\n heldPointer: null,\n holdJob: null,\n pulse: function() {\n var hold = Date.now() - this. heldPointer.timeStamp;\n var type = this.held ? 'holdpulse' : 'hold';\n this.fireHold(type, hold);\n this.held = true;\n },\n cancel: funct ion() {\n clearInterval(this.holdJob);\n if (this.held) {\n thi s.fireHold('release');\n }\n this.held = false;\n this.heldPointe r = null;\n this.target = null;\n this.holdJob = null;\n },\n po interdown: function(inEvent) {\n if (inEvent.isPrimary && !this.heldPointer ) {\n this.heldPointer = inEvent;\n this.target = inEvent.target;\ n this.holdJob = setInterval(this.pulse.bind(this), this.HOLD_DELAY);\n }\n },\n pointerup: function(inEvent) {\n if (this.heldPointer && this.heldPointer.pointerId === inEvent.pointerId) {\n this.cancel();\n }\n },\n pointercancel: function(inEvent) {\n this.cancel();\n },\n pointermove: function(inEvent) {\n if (this.heldPointer && this.he ldPointer.pointerId === inEvent.pointerId) {\n var x = inEvent.clientX - this.heldPointer.clientX;\n var y = inEvent.clientY - this.heldPointer.cl ientY;\n if ((x * x + y * y) > this.WIGGLE_THRESHOLD) {\n this.c ancel();\n }\n }\n },\n fireHold: function(inType, inHoldTime) {\n var p = {\n pointerType: this.heldPointer.pointerType,\n clientX: this.heldPointer.clientX,\n clientY: this.heldPointer.clientY\n };\n if (inHoldTime) {\n p.holdTime = inHoldTime;\n }\n var e = dispatcher.makeEvent(inType, p);\n dispatcher.dispatchEvent(e, this.target);\n if (e.tapPrevented) {\n dispatcher.preventTap(this.h eldPointer.pointerId);\n }\n }\n };\n dispatcher.registerRecognizer('h old', hold);\n})(window.PointerGestures);\n", 196 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event is fired when a pointer is held down f or 200ms.\n *\n * @module PointerGestures\n * @submodule Events\n * @class hold\ n */\n/**\n * Type of pointer that made the holding event.\n * @type String\n * @property pointerType\n */\n/**\n * Screen X axis position of the held pointer\n * @type Number\n * @property clientX\n */\n/**\n * Screen Y axis position of th e held pointer\n * @type Number\n * @property clientY\n */\n/**\n * Type of poin ter that made the holding event.\n * @type String\n * @property pointerType\n */ \n/**\n * This event is fired every 200ms while a pointer is held down.\n *\n * @class holdpulse\n * @extends hold\n */\n/**\n * Milliseconds pointer has been h eld down.\n * @type Number\n * @property holdTime\n */\n/**\n * This event is fi red when a held pointer is released or moved.\n *\n * @class released\n */\n\n(f unction(scope) {\n var dispatcher = scope.dispatcher;\n var hold = {\n // w ait at least HOLD_DELAY ms between hold and pulse events\n HOLD_DELAY: 200,\n // pointer can move WIGGLE_THRESHOLD pixels before not counting as a hold\n WIGGLE_THRESHOLD: 16,\n events: [\n 'pointerdown',\n 'pointermov e',\n 'pointerup',\n 'pointercancel'\n ],\n heldPointer: null,\n holdJob: null,\n pulse: function() {\n var hold = Date.now() - this. heldPointer.timeStamp;\n var type = this.held ? 'holdpulse' : 'hold';\n this.fireHold(type, hold);\n this.held = true;\n },\n cancel: funct ion() {\n clearInterval(this.holdJob);\n if (this.held) {\n thi s.fireHold('release');\n }\n this.held = false;\n this.heldPointe r = null;\n this.target = null;\n this.holdJob = null;\n },\n po interdown: function(inEvent) {\n if (inEvent.isPrimary && !this.heldPointer ) {\n this.heldPointer = inEvent;\n this.target = inEvent.target;\ n this.holdJob = setInterval(this.pulse.bind(this), this.HOLD_DELAY);\n }\n },\n pointerup: function(inEvent) {\n if (this.heldPointer && this.heldPointer.pointerId === inEvent.pointerId) {\n this.cancel();\n }\n },\n pointercancel: function(inEvent) {\n this.cancel();\n },\n pointermove: function(inEvent) {\n if (this.heldPointer && this.he ldPointer.pointerId === inEvent.pointerId) {\n var x = inEvent.clientX - this.heldPointer.clientX;\n var y = inEvent.clientY - this.heldPointer.cl ientY;\n if ((x * x + y * y) > this.WIGGLE_THRESHOLD) {\n this.c ancel();\n }\n }\n },\n fireHold: function(inType, inHoldTime) {\n var p = {\n pointerType: this.heldPointer.pointerType,\n clientX: this.heldPointer.clientX,\n clientY: this.heldPointer.clientY\n };\n if (inHoldTime) {\n p.holdTime = inHoldTime;\n }\n var e = dispatcher.makeEvent(inType, p);\n dispatcher.dispatchEvent(e, this.target);\n if (e.tapPrevented) {\n dispatcher.preventTap(this.h eldPointer.pointerId);\n }\n }\n };\n dispatcher.registerRecognizer('h old', hold);\n})(window.PointerGestures);\n",
194 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event denotes the beginning of a series of t racking events.\n *\n * @module PointerGestures\n * @submodule Events\n * @class trackstart\n */\n/**\n * Pixels moved in the x direction since trackstart.\n * @type Number\n * @property dx\n */\n/**\n * Pixes moved in the y direction since trackstart.\n * @type Number\n * @property dy\n */\n/**\n * Pixels moved in the x direction since the last track.\n * @type Number\n * @property ddx\n */\n/**\ n * Pixles moved in the y direction since the last track.\n * @type Number\n * @ property ddy\n */\n/**\n * The clientX position of the track gesture.\n * @type Number\n * @property clientX\n */\n/**\n * The clientY position of the track ges ture.\n * @type Number\n * @property clientY\n */\n/**\n * The pageX position of the track gesture.\n * @type Number\n * @property pageX\n */\n/**\n * The pageY position of the track gesture.\n * @type Number\n * @property pageY\n */\n/**\n * The screenX position of the track gesture.\n * @type Number\n * @property scr eenX\n */\n/**\n * The screenY position of the track gesture.\n * @type Number\n * @property screenY\n */\n/**\n * The last x axis direction of the pointer.\n * @type Number\n * @property xDirection\n */\n/**\n * The last y axis direction o f the pointer.\n * @type Number\n * @property yDirection\n */\n/**\n * A shared object between all tracking events.\n * @type Object\n * @property trackInfo\n * /\n/**\n * The element currently under the pointer.\n * @type Element\n * @prope rty relatedTarget\n */\n/**\n * The type of pointer that make the track gesture. \n * @type String\n * @property pointerType\n */\n/**\n *\n * This event fires f or all pointer movement being tracked.\n *\n * @class track\n * @extends trackst art\n */\n/**\n * This event fires when the pointer is no longer being tracked.\ n *\n * @class trackend\n * @extends trackstart\n */\n\n (function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = new scope.PointerMap();\ n var track = {\n events: [\n 'pointerdown',\n 'pointermove',\ n 'pointerup',\n 'pointercancel'\n ],\n WIGGLE_THRESHOLD: 4, \n clampDir: function(inDelta) {\n return inDelta > 0 ? 1 : -1;\n },\n calcPositionDelta: function(inA, inB) {\n var x = 0, y = 0;\n if (inA && inB) {\n x = inB.pageX - inA.pageX;\n y = inB.page Y - inA.pageY;\n }\n return {x: x, y: y};\n },\n fireTrack: function(inType, inEvent, inTrackingData) {\n var t = inTrackingData;\n var d = this.calcPositionDelta(t.downEvent, inEvent);\n var dd = this. calcPositionDelta(t.lastMoveEvent, inEvent);\n if (dd.x) {\n t.xDi rection = this.clampDir(dd.x);\n }\n if (dd.y) {\n t.yDirect ion = this.clampDir(dd.y);\n }\n var trackData = {\n dx: d.x ,\n dy: d.y,\n ddx: dd.x,\n ddy: dd.y,\n clientX : inEvent.clientX,\n clientY: inEvent.clientY,\n pageX: inEvent. pageX,\n pageY: inEvent.pageY,\n screenX: inEvent.screenX,\n screenY: inEvent.screenY,\n xDirection: t.xDirection,\n yDi rection: t.yDirection,\n trackInfo: t.trackInfo,\n relatedTarget : inEvent.target,\n pointerType: inEvent.pointerType\n };\n var e = dispatcher.makeEvent(inType, trackData);\n t.lastMoveEvent = inEve nt;\n dispatcher.dispatchEvent(e, t.downTarget);\n },\n pointerdow n: function(inEvent) {\n if (inEvent.isPrimary && (inEvent.pointerType === 'mouse' ? inEvent.buttons === 1 : true)) {\n var p = {\n down Event: inEvent,\n downTarget: inEvent.target,\n trackInfo: { },\n lastMoveEvent: null,\n xDirection: 0,\n yDire ction: 0,\n tracking: false\n };\n pointermap.set(inEv ent.pointerId, p);\n }\n },\n pointermove: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (! p.tracking) {\n var d = this.calcPositionDelta(p.downEvent, inEvent);\ n var move = d.x * d.x + d.y * d.y;\n // start tracking only if finger moves more than WIGGLE_THRESHOLD\n if (move > this.WIGGLE_T HRESHOLD) {\n p.tracking = true;\n this.fireTrack('track start', p.downEvent, p);\n this.fireTrack('track', inEvent, p);\n }\n } else {\n this.fireTrack('track', inEvent, p);\n }\n }\n },\n pointerup: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (p.tracking) {\n this.fireTrack('trackend', inEvent, p);\n }\n poin termap.delete(inEvent.pointerId);\n }\n },\n pointercancel: functi on(inEvent) {\n this.pointerup(inEvent);\n }\n };\n dispatcher.reg isterRecognizer('track', track);\n })(window.PointerGestures);\n", 197 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event denotes the beginning of a series of t racking events.\n *\n * @module PointerGestures\n * @submodule Events\n * @class trackstart\n */\n/**\n * Pixels moved in the x direction since trackstart.\n * @type Number\n * @property dx\n */\n/**\n * Pixes moved in the y direction since trackstart.\n * @type Number\n * @property dy\n */\n/**\n * Pixels moved in the x direction since the last track.\n * @type Number\n * @property ddx\n */\n/**\ n * Pixles moved in the y direction since the last track.\n * @type Number\n * @ property ddy\n */\n/**\n * The clientX position of the track gesture.\n * @type Number\n * @property clientX\n */\n/**\n * The clientY position of the track ges ture.\n * @type Number\n * @property clientY\n */\n/**\n * The pageX position of the track gesture.\n * @type Number\n * @property pageX\n */\n/**\n * The pageY position of the track gesture.\n * @type Number\n * @property pageY\n */\n/**\n * The screenX position of the track gesture.\n * @type Number\n * @property scr eenX\n */\n/**\n * The screenY position of the track gesture.\n * @type Number\n * @property screenY\n */\n/**\n * The last x axis direction of the pointer.\n * @type Number\n * @property xDirection\n */\n/**\n * The last y axis direction o f the pointer.\n * @type Number\n * @property yDirection\n */\n/**\n * A shared object between all tracking events.\n * @type Object\n * @property trackInfo\n * /\n/**\n * The element currently under the pointer.\n * @type Element\n * @prope rty relatedTarget\n */\n/**\n * The type of pointer that make the track gesture. \n * @type String\n * @property pointerType\n */\n/**\n *\n * This event fires f or all pointer movement being tracked.\n *\n * @class track\n * @extends trackst art\n */\n/**\n * This event fires when the pointer is no longer being tracked.\ n *\n * @class trackend\n * @extends trackstart\n */\n\n (function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = new scope.PointerMap();\ n var track = {\n events: [\n 'pointerdown',\n 'pointermove',\ n 'pointerup',\n 'pointercancel'\n ],\n WIGGLE_THRESHOLD: 4, \n clampDir: function(inDelta) {\n return inDelta > 0 ? 1 : -1;\n },\n calcPositionDelta: function(inA, inB) {\n var x = 0, y = 0;\n if (inA && inB) {\n x = inB.pageX - inA.pageX;\n y = inB.page Y - inA.pageY;\n }\n return {x: x, y: y};\n },\n fireTrack: function(inType, inEvent, inTrackingData) {\n var t = inTrackingData;\n var d = this.calcPositionDelta(t.downEvent, inEvent);\n var dd = this. calcPositionDelta(t.lastMoveEvent, inEvent);\n if (dd.x) {\n t.xDi rection = this.clampDir(dd.x);\n }\n if (dd.y) {\n t.yDirect ion = this.clampDir(dd.y);\n }\n var trackData = {\n dx: d.x ,\n dy: d.y,\n ddx: dd.x,\n ddy: dd.y,\n clientX : inEvent.clientX,\n clientY: inEvent.clientY,\n pageX: inEvent. pageX,\n pageY: inEvent.pageY,\n screenX: inEvent.screenX,\n screenY: inEvent.screenY,\n xDirection: t.xDirection,\n yDi rection: t.yDirection,\n trackInfo: t.trackInfo,\n relatedTarget : inEvent.target,\n pointerType: inEvent.pointerType\n };\n var e = dispatcher.makeEvent(inType, trackData);\n t.lastMoveEvent = inEve nt;\n dispatcher.dispatchEvent(e, t.downTarget);\n },\n pointerdow n: function(inEvent) {\n if (inEvent.isPrimary && (inEvent.pointerType === 'mouse' ? inEvent.buttons === 1 : true)) {\n var p = {\n down Event: inEvent,\n downTarget: inEvent.target,\n trackInfo: { },\n lastMoveEvent: null,\n xDirection: 0,\n yDire ction: 0,\n tracking: false\n };\n pointermap.set(inEv ent.pointerId, p);\n }\n },\n pointermove: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (! p.tracking) {\n var d = this.calcPositionDelta(p.downEvent, inEvent);\ n var move = d.x * d.x + d.y * d.y;\n // start tracking only if finger moves more than WIGGLE_THRESHOLD\n if (move > this.WIGGLE_T HRESHOLD) {\n p.tracking = true;\n this.fireTrack('track start', p.downEvent, p);\n this.fireTrack('track', inEvent, p);\n }\n } else {\n this.fireTrack('track', inEvent, p);\n }\n }\n },\n pointerup: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (p.tracking) {\n this.fireTrack('trackend', inEvent, p);\n }\n poin termap.delete(inEvent.pointerId);\n }\n },\n pointercancel: functi on(inEvent) {\n this.pointerup(inEvent);\n }\n };\n dispatcher.reg isterRecognizer('track', track);\n })(window.PointerGestures);\n",
195 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event denotes a rapid down/move/up sequence from a pointer.\n *\n * The event is sent to the first element the pointer went down on.\n *\n * @module PointerGestures\n * @submodule Events\n * @class flick\ n */\n/**\n * Signed velocity of the flick in the x direction.\n * @property xVe locity\n * @type Number\n */\n/**\n * Signed velocity of the flick in the y dire ction.\n * @type Number\n * @property yVelocity\n */\n/**\n * Unsigned total vel ocity of the flick.\n * @type Number\n * @property velocity\n */\n/**\n * Angle of the flick in degrees, with 0 along the\n * positive x axis.\n * @type Number\ n * @property angle\n */\n/**\n * Axis with the greatest absolute velocity. Deno ted\n * with 'x' or 'y'.\n * @type String\n * @property majorAxis\n */\n/**\n * Type of the pointer that made the flick.\n * @type String\n * @property pointerT ype\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var flic k = {\n // TODO(dfreedman): value should be low enough for low speed flicks, but\n // high enough to remove accidental flicks\n MIN_VELOCITY: 0.5 /* px /ms */,\n MAX_QUEUE: 4,\n moveQueue: [],\n target: null,\n pointerId : null,\n events: [\n 'pointerdown',\n 'pointermove',\n 'point erup',\n 'pointercancel'\n ],\n pointerdown: function(inEvent) {\n if (inEvent.isPrimary && !this.pointerId) {\n this.pointerId = inEvent .pointerId;\n this.target = inEvent.target;\n this.addMove(inEvent );\n }\n },\n pointermove: function(inEvent) {\n if (inEvent.poi nterId === this.pointerId) {\n this.addMove(inEvent);\n }\n },\n pointerup: function(inEvent) {\n if (inEvent.pointerId === this.pointerI d) {\n this.fireFlick(inEvent);\n }\n this.cleanup();\n },\n pointercancel: function(inEvent) {\n this.cleanup();\n },\n clean up: function() {\n this.moveQueue = [];\n this.target = null;\n t his.pointerId = null;\n },\n addMove: function(inEvent) {\n if (this. moveQueue.length >= this.MAX_QUEUE) {\n this.moveQueue.shift();\n }\ n this.moveQueue.push(inEvent);\n },\n fireFlick: function(inEvent) { \n var e = inEvent;\n var l = this.moveQueue.length;\n var dt, dx , dy, tx, ty, tv, x = 0, y = 0, v = 0;\n // flick based off the fastest seg ment of movement\n for (var i = 0, m; i < l && (m = this.moveQueue[i]); i++ ) {\n dt = e.timeStamp - m.timeStamp;\n dx = e.clientX - m.clientX , dy = e.clientY - m.clientY;\n tx = dx / dt, ty = dy / dt, tv = Math.sqr t(tx * tx + ty * ty);\n if (tv > v) {\n x = tx, y = ty, v = tv;\ n }\n }\n var ma = Math.abs(x) > Math.abs(y) ? 'x' : 'y';\n var a = this.calcAngle(x, y);\n if (Math.abs(v) >= this.MIN_VELOCITY) {\n var ev = dispatcher.makeEvent('flick', {\n xVelocity: x,\n yVelocity: y,\n velocity: v,\n angle: a,\n major Axis: ma,\n pointerType: inEvent.pointerType\n });\n disp atcher.dispatchEvent(ev, this.target);\n }\n },\n calcAngle: function (inX, inY) {\n return (Math.atan2(inY, inX) * 180 / Math.PI);\n }\n };\ n dispatcher.registerRecognizer('flick', flick);\n})(window.PointerGestures);\n ", 198 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event denotes a rapid down/move/up sequence from a pointer.\n *\n * The event is sent to the first element the pointer went down on.\n *\n * @module PointerGestures\n * @submodule Events\n * @class flick\ n */\n/**\n * Signed velocity of the flick in the x direction.\n * @property xVe locity\n * @type Number\n */\n/**\n * Signed velocity of the flick in the y dire ction.\n * @type Number\n * @property yVelocity\n */\n/**\n * Unsigned total vel ocity of the flick.\n * @type Number\n * @property velocity\n */\n/**\n * Angle of the flick in degrees, with 0 along the\n * positive x axis.\n * @type Number\ n * @property angle\n */\n/**\n * Axis with the greatest absolute velocity. Deno ted\n * with 'x' or 'y'.\n * @type String\n * @property majorAxis\n */\n/**\n * Type of the pointer that made the flick.\n * @type String\n * @property pointerT ype\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var flic k = {\n // TODO(dfreedman): value should be low enough for low speed flicks, but\n // high enough to remove accidental flicks\n MIN_VELOCITY: 0.5 /* px /ms */,\n MAX_QUEUE: 4,\n moveQueue: [],\n target: null,\n pointerId : null,\n events: [\n 'pointerdown',\n 'pointermove',\n 'point erup',\n 'pointercancel'\n ],\n pointerdown: function(inEvent) {\n if (inEvent.isPrimary && !this.pointerId) {\n this.pointerId = inEvent .pointerId;\n this.target = inEvent.target;\n this.addMove(inEvent );\n }\n },\n pointermove: function(inEvent) {\n if (inEvent.poi nterId === this.pointerId) {\n this.addMove(inEvent);\n }\n },\n pointerup: function(inEvent) {\n if (inEvent.pointerId === this.pointerI d) {\n this.fireFlick(inEvent);\n }\n this.cleanup();\n },\n pointercancel: function(inEvent) {\n this.cleanup();\n },\n clean up: function() {\n this.moveQueue = [];\n this.target = null;\n t his.pointerId = null;\n },\n addMove: function(inEvent) {\n if (this. moveQueue.length >= this.MAX_QUEUE) {\n this.moveQueue.shift();\n }\ n this.moveQueue.push(inEvent);\n },\n fireFlick: function(inEvent) { \n var e = inEvent;\n var l = this.moveQueue.length;\n var dt, dx , dy, tx, ty, tv, x = 0, y = 0, v = 0;\n // flick based off the fastest seg ment of movement\n for (var i = 0, m; i < l && (m = this.moveQueue[i]); i++ ) {\n dt = e.timeStamp - m.timeStamp;\n dx = e.clientX - m.clientX , dy = e.clientY - m.clientY;\n tx = dx / dt, ty = dy / dt, tv = Math.sqr t(tx * tx + ty * ty);\n if (tv > v) {\n x = tx, y = ty, v = tv;\ n }\n }\n var ma = Math.abs(x) > Math.abs(y) ? 'x' : 'y';\n var a = this.calcAngle(x, y);\n if (Math.abs(v) >= this.MIN_VELOCITY) {\n var ev = dispatcher.makeEvent('flick', {\n xVelocity: x,\n yVelocity: y,\n velocity: v,\n angle: a,\n major Axis: ma,\n pointerType: inEvent.pointerType\n });\n disp atcher.dispatchEvent(ev, this.target);\n }\n },\n calcAngle: function (inX, inY) {\n return (Math.atan2(inY, inX) * 180 / Math.PI);\n }\n };\ n dispatcher.registerRecognizer('flick', flick);\n})(window.PointerGestures);\n ",
196 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/*\n * Basic strategy: find the farthest apart points, us e as diameter of circle\n * react to size change and rotation of the chord\n */\ n\n/**\n * @module PointerGestures\n * @submodule Events\n * @class pinch\n */\n /**\n * Scale of the pinch zoom gesture\n * @property scale\n * @type Number\n * /\n/**\n * Center X position of pointers causing pinch\n * @property centerX\n * @type Number\n */\n/**\n * Center Y position of pointers causing pinch\n * @pro perty centerY\n * @type Number\n */\n\n/**\n * @module PointerGestures\n * @subm odule Events\n * @class rotate\n */\n/**\n * Angle (in degrees) of rotation. Mea sured from starting positions of pointers.\n * @property angle\n * @type Number\ n */\n/**\n * Center X position of pointers causing rotation\n * @property cente rX\n * @type Number\n */\n/**\n * Center Y position of pointers causing rotation \n * @property centerY\n * @type Number\n */\n(function(scope) {\n var dispatch er = scope.dispatcher;\n var pointermap = new scope.PointerMap();\n var RAD_TO _DEG = 180 / Math.PI;\n var pinch = {\n events: [\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel'\n ],\n refere nce: {},\n pointerdown: function(ev) {\n pointermap.set(ev.pointerId, ev );\n if (pointermap.pointers() == 2) {\n var points = this.calcChord ();\n var angle = this.calcAngle(points);\n this.reference = {\n angle: angle,\n diameter: points.diameter,\n target: s cope.findLCA(points.a.target, points.b.target)\n };\n }\n },\n pointerup: function(ev) {\n pointermap.delete(ev.pointerId);\n },\n pointermove: function(ev) {\n if (pointermap.has(ev.pointerId)) {\n pointermap.set(ev.pointerId, ev);\n if (pointermap.pointers() > 1) {\n this.calcPinchRotate();\n }\n }\n },\n pointercancel: f unction(ev) {\n this.pointerup(ev);\n },\n dispatchPinch: function(di ameter, points) {\n var zoom = diameter / this.reference.diameter;\n v ar ev = dispatcher.makeEvent('pinch', {\n scale: zoom,\n centerX: points.center.x,\n centerY: points.center.y\n });\n dispatcher. dispatchEvent(ev, this.reference.target);\n },\n dispatchRotate: function( angle, points) {\n var diff = Math.round((angle - this.reference.angle) % 3 60);\n var ev = dispatcher.makeEvent('rotate', {\n angle: diff,\n centerX: points.center.x,\n centerY: points.center.y\n });\n dispatcher.dispatchEvent(ev, this.reference.target);\n },\n calcPinchRo tate: function() {\n var points = this.calcChord();\n var diameter = p oints.diameter;\n var angle = this.calcAngle(points);\n if (diameter ! = this.reference.diameter) {\n this.dispatchPinch(diameter, points);\n }\n if (angle != this.reference.angle) {\n this.dispatchRotate(an gle, points);\n }\n },\n calcChord: function() {\n var pointers = [];\n pointermap.forEach(function(p) {\n pointers.push(p);\n });\n var dist = 0;\n var points = {};\n var x, y, d;\n for (var i = 0; i < pointers.length; i++) {\n var a = pointers[i];\n f or (var j = i + 1; j < pointers.length; j++) {\n var b = pointers[j];\n x = Math.abs(a.clientX - b.clientX);\n y = Math.abs(a.clientY - b.clientY);\n d = x + y;\n if (d > dist) {\n dis t = d;\n points = {a: a, b: b};\n }\n }\n }\n x = Math.abs(points.a.clientX + points.b.clientX) / 2;\n y = Math.abs(po ints.a.clientY + points.b.clientY) / 2;\n points.center = { x: x, y: y };\n points.diameter = dist;\n return points;\n },\n calcAngle: func tion(points) {\n var x = points.a.clientX - points.b.clientX;\n var y = points.a.clientY - points.b.clientY;\n return (360 + Math.atan2(y, x) * R AD_TO_DEG) % 360;\n },\n };\n dispatcher.registerRecognizer('pinch', pinch) ;\n})(window.PointerGestures);\n", 199 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/*\n * Basic strategy: find the farthest apart points, us e as diameter of circle\n * react to size change and rotation of the chord\n */\ n\n/**\n * @module PointerGestures\n * @submodule Events\n * @class pinch\n */\n /**\n * Scale of the pinch zoom gesture\n * @property scale\n * @type Number\n * /\n/**\n * Center X position of pointers causing pinch\n * @property centerX\n * @type Number\n */\n/**\n * Center Y position of pointers causing pinch\n * @pro perty centerY\n * @type Number\n */\n\n/**\n * @module PointerGestures\n * @subm odule Events\n * @class rotate\n */\n/**\n * Angle (in degrees) of rotation. Mea sured from starting positions of pointers.\n * @property angle\n * @type Number\ n */\n/**\n * Center X position of pointers causing rotation\n * @property cente rX\n * @type Number\n */\n/**\n * Center Y position of pointers causing rotation \n * @property centerY\n * @type Number\n */\n(function(scope) {\n var dispatch er = scope.dispatcher;\n var pointermap = new scope.PointerMap();\n var RAD_TO _DEG = 180 / Math.PI;\n var pinch = {\n events: [\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel'\n ],\n refere nce: {},\n pointerdown: function(ev) {\n pointermap.set(ev.pointerId, ev );\n if (pointermap.pointers() == 2) {\n var points = this.calcChord ();\n var angle = this.calcAngle(points);\n this.reference = {\n angle: angle,\n diameter: points.diameter,\n target: s cope.findLCA(points.a.target, points.b.target)\n };\n }\n },\n pointerup: function(ev) {\n pointermap.delete(ev.pointerId);\n },\n pointermove: function(ev) {\n if (pointermap.has(ev.pointerId)) {\n pointermap.set(ev.pointerId, ev);\n if (pointermap.pointers() > 1) {\n this.calcPinchRotate();\n }\n }\n },\n pointercancel: f unction(ev) {\n this.pointerup(ev);\n },\n dispatchPinch: function(di ameter, points) {\n var zoom = diameter / this.reference.diameter;\n v ar ev = dispatcher.makeEvent('pinch', {\n scale: zoom,\n centerX: points.center.x,\n centerY: points.center.y\n });\n dispatcher. dispatchEvent(ev, this.reference.target);\n },\n dispatchRotate: function( angle, points) {\n var diff = Math.round((angle - this.reference.angle) % 3 60);\n var ev = dispatcher.makeEvent('rotate', {\n angle: diff,\n centerX: points.center.x,\n centerY: points.center.y\n });\n dispatcher.dispatchEvent(ev, this.reference.target);\n },\n calcPinchRo tate: function() {\n var points = this.calcChord();\n var diameter = p oints.diameter;\n var angle = this.calcAngle(points);\n if (diameter ! = this.reference.diameter) {\n this.dispatchPinch(diameter, points);\n }\n if (angle != this.reference.angle) {\n this.dispatchRotate(an gle, points);\n }\n },\n calcChord: function() {\n var pointers = [];\n pointermap.forEach(function(p) {\n pointers.push(p);\n });\n var dist = 0;\n var points = {};\n var x, y, d;\n for (var i = 0; i < pointers.length; i++) {\n var a = pointers[i];\n f or (var j = i + 1; j < pointers.length; j++) {\n var b = pointers[j];\n x = Math.abs(a.clientX - b.clientX);\n y = Math.abs(a.clientY - b.clientY);\n d = x + y;\n if (d > dist) {\n dis t = d;\n points = {a: a, b: b};\n }\n }\n }\n x = Math.abs(points.a.clientX + points.b.clientX) / 2;\n y = Math.abs(po ints.a.clientY + points.b.clientY) / 2;\n points.center = { x: x, y: y };\n points.diameter = dist;\n return points;\n },\n calcAngle: func tion(points) {\n var x = points.a.clientX - points.b.clientX;\n var y = points.a.clientY - points.b.clientY;\n return (360 + Math.atan2(y, x) * R AD_TO_DEG) % 360;\n },\n };\n dispatcher.registerRecognizer('pinch', pinch) ;\n})(window.PointerGestures);\n",
197 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event is fired when a pointer quickly goes d own and up, and is used to\n * denote activation.\n *\n * Any gesture event can prevent the tap event from being created by calling\n * `event.preventTap`.\n *\ n * Any pointer event can prevent the tap by setting the `tapPrevented` property \n * on itself.\n *\n * @module PointerGestures\n * @submodule Events\n * @class tap\n */\n/**\n * X axis position of the tap.\n * @property x\n * @type Number\ n */\n/**\n * Y axis position of the tap.\n * @property y\n * @type Number\n */\ n/**\n * Type of the pointer that made the tap.\n * @property pointerType\n * @t ype String\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = new scope.PointerMap();\n var tap = {\n events: [\n 'poin terdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel',\n 'keyup'\n ],\n pointerdown: function(inEvent) {\n if (inEvent.isPr imary && !inEvent.tapPrevented) {\n pointermap.set(inEvent.pointerId, {\n target: inEvent.target,\n x: inEvent.clientX,\n y: i nEvent.clientY\n });\n }\n },\n pointermove: function(inEvent) {\n if (inEvent.isPrimary) {\n var start = pointermap.get(inEvent.p ointerId);\n if (start) {\n if (inEvent.tapPrevented) {\n pointermap.delete(inEvent.pointerId);\n }\n }\n }\n },\n shouldTap: function(e) {\n if (!e.tapPrevented) {\n // only allow left click to tap for mouse\n return e.pointerType === 'mouse' ? e .buttons === 1 : true;\n }\n },\n pointerup: function(inEvent) {\n var start = pointermap.get(inEvent.pointerId);\n if (start && this.shoul dTap(inEvent)) {\n var t = scope.findLCA(start.target, inEvent.target);\n if (t) {\n var e = dispatcher.makeEvent('tap', {\n x : inEvent.clientX,\n y: inEvent.clientY,\n detail: inEvent .detail,\n pointerType: inEvent.pointerType\n });\n dispatcher.dispatchEvent(e, t);\n }\n }\n pointermap.delete(in Event.pointerId);\n },\n pointercancel: function(inEvent) {\n pointer map.delete(inEvent.pointerId);\n },\n keyup: function(inEvent) {\n va r code = inEvent.keyCode;\n // 32 == spacebar\n if (code === 32) {\n var t = inEvent.target;\n if (!(t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement)) {\n dispatcher.dispatchEvent(dispatche r.makeEvent('tap', {\n x: 0,\n y: 0,\n detail: 0,\n pointerType: 'unavailable'\n }), t);\n }\n }\n },\n preventTap: function(inPointerId) {\n pointermap.delete(inPo interId);\n }\n };\n dispatcher.registerRecognizer('tap', tap);\n})(window. PointerGestures);\n", 200 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This event is fired when a pointer quickly goes d own and up, and is used to\n * denote activation.\n *\n * Any gesture event can prevent the tap event from being created by calling\n * `event.preventTap`.\n *\ n * Any pointer event can prevent the tap by setting the `tapPrevented` property \n * on itself.\n *\n * @module PointerGestures\n * @submodule Events\n * @class tap\n */\n/**\n * X axis position of the tap.\n * @property x\n * @type Number\ n */\n/**\n * Y axis position of the tap.\n * @property y\n * @type Number\n */\ n/**\n * Type of the pointer that made the tap.\n * @property pointerType\n * @t ype String\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = new scope.PointerMap();\n var tap = {\n events: [\n 'poin terdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel',\n 'keyup'\n ],\n pointerdown: function(inEvent) {\n if (inEvent.isPr imary && !inEvent.tapPrevented) {\n pointermap.set(inEvent.pointerId, {\n target: inEvent.target,\n buttons: inEvent.buttons,\n x: inEvent.clientX,\n y: inEvent.clientY\n });\n }\n } ,\n pointermove: function(inEvent) {\n if (inEvent.isPrimary) {\n var start = pointermap.get(inEvent.pointerId);\n if (start) {\n if (inEvent.tapPrevented) {\n pointermap.delete(inEvent.pointerId);\ n }\n }\n }\n },\n shouldTap: function(e, downState) {\n if (!e.tapPrevented) {\n if (e.pointerType === 'mouse') {\n // only allow left click to tap for mouse\n return downState.butto ns === 1;\n } else {\n return true;\n }\n }\n },\ n pointerup: function(inEvent) {\n var start = pointermap.get(inEvent.po interId);\n if (start && this.shouldTap(inEvent, start)) {\n var t = scope.findLCA(start.target, inEvent.target);\n if (t) {\n var e = dispatcher.makeEvent('tap', {\n x: inEvent.clientX,\n y : inEvent.clientY,\n detail: inEvent.detail,\n pointerType : inEvent.pointerType\n });\n dispatcher.dispatchEvent(e, t);\ n }\n }\n pointermap.delete(inEvent.pointerId);\n },\n po intercancel: function(inEvent) {\n pointermap.delete(inEvent.pointerId);\n },\n keyup: function(inEvent) {\n var code = inEvent.keyCode;\n // 32 == spacebar\n if (code === 32) {\n var t = inEvent.target;\n if (!(t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement)) {\n dispatcher.dispatchEvent(dispatcher.makeEvent('tap', {\n x: 0,\n y: 0,\n detail: 0,\n pointerType: 'una vailable'\n }), t);\n }\n }\n },\n preventTap: functi on(inPointerId) {\n pointermap.delete(inPointerId);\n }\n };\n dispatc her.registerRecognizer('tap', tap);\n})(window.PointerGestures);\n",
198 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n var filter = Array.prototype.filter.call.bind(Array.prototype.filt er);\n\n function getTreeScope(node) {\n while (node.parentNode) {\n no de = node.parentNode;\n }\n\n return typeof node.getElementById === 'funct ion' ? node : null;\n }\n\n // JScript does not have __proto__. We wrap all ob ject literals with\n // createObject which uses Object.create, Object.definePro perty and\n // Object.getOwnPropertyDescriptor to create a new object that does the exact\n // same thing. The main downside to this solution is that we have to extract\n // all those property descriptors for IE.\n var createObject = (' __proto__' in {}) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj ;\n var newObject = Object.create(proto);\n Object.getOwnPropertyN ames(obj).forEach(function(name) {\n Object.defineProperty(newObject, n ame,\n Object.getOwnPropertyDescriptor(obj, name)) ;\n });\n return newObject;\n };\n\n // IE does not support have Document.prototype.contains.\n if (typeof document.contains != 'function') {\n Document.prototype.contains = function(node) {\n if (node === this || node.parentNode === this)\n return true;\n return this.documentEl ement.contains(node);\n }\n }\n\n Node.prototype.bind = function(name, obse rvable) {\n console.error('Unhandled binding to Node: ', this, name, observab le);\n };\n\n function unbind(node, name) {\n var bindings = node.bindings; \n if (!bindings) {\n node.bindings = {};\n return;\n }\n\n v ar binding = bindings[name];\n if (!binding)\n return;\n\n binding.cl ose();\n bindings[name] = undefined;\n }\n\n Node.prototype.unbind = functi on(name) {\n unbind(this, name);\n };\n\n Node.prototype.unbindAll = functi on() {\n if (!this.bindings)\n return;\n var names = Object.keys(this .bindings);\n for (var i = 0; i < names.length; i++) {\n var binding = t his.bindings[names[i]];\n if (binding)\n binding.close();\n }\n\n this.bindings = {};\n };\n\n function sanitizeValue(value) {\n return v alue == null ? '' : value;\n }\n\n function updateText(node, value) {\n nod e.data = sanitizeValue(value);\n }\n\n function textBinding(node) {\n retur n function(value) {\n return updateText(node, value);\n };\n }\n\n Tex t.prototype.bind = function(name, value, oneTime) {\n if (name !== 'textConte nt')\n return Node.prototype.bind.call(this, name, value, oneTime);\n\n if (oneTime)\n return updateText(this, value);\n\n unbind(this, 'textCon tent');\n updateText(this, value.open(textBinding(this)));\n return this.b indings.textContent = value;\n }\n\n function updateAttribute(el, name, condit ional, value) {\n if (conditional) {\n if (value)\n el.setAttribu te(name, '');\n else\n el.removeAttribute(name);\n return;\n }\n\n el.setAttribute(name, sanitizeValue(value));\n }\n\n function attrib uteBinding(el, name, conditional) {\n return function(value) {\n updateA ttribute(el, name, conditional, value);\n };\n }\n\n Element.prototype.bind = function(name, value, oneTime) {\n var conditional = name[name.length - 1] == '?';\n if (conditional) {\n this.removeAttribute(name);\n name = name.slice(0, -1);\n }\n\n if (oneTime)\n return updateAttribute(th is, name, conditional, value);\n\n unbind(this, name);\n updateAttribute(t his, name, conditional,\n value.open(attributeBinding(this, name, conditi onal)));\n\n return this.bindings[name] = value;\n };\n\n var checkboxEvent Type;\n (function() {\n // Attempt to feature-detect which event (change or click) is fired first\n // for checkboxes.\n var div = document.createElem ent('div');\n var checkbox = div.appendChild(document.createElement('input')) ;\n checkbox.setAttribute('type', 'checkbox');\n var first;\n var count = 0;\n checkbox.addEventListener('click', function(e) {\n count++;\n first = first || 'click';\n });\n checkbox.addEventListener('change', f unction() {\n count++;\n first = first || 'change';\n });\n\n va r event = document.createEvent('MouseEvent');\n event.initMouseEvent(\"click\ ", true, true, window, 0, 0, 0, 0, 0, false,\n false, false, false, 0, nu ll);\n checkbox.dispatchEvent(event);\n // WebKit/Blink don't fire the cha nge event if the element is outside the\n // document, so assume 'change' for that case.\n checkboxEventType = count == 1 ? 'change' : first;\n })();\n\n function getEventForInputType(element) {\n switch (element.type) {\n c ase 'checkbox':\n return checkboxEventType;\n case 'radio':\n c ase 'select-multiple':\n case 'select-one':\n return 'change';\n case 'range':\n if (/Trident|MSIE/.test(navigator.userAgent))\n return 'change';\n default:\n return 'input';\n }\n }\n\n fun ction updateInput(input, property, value, santizeFn) {\n input[property] = (s antizeFn || sanitizeValue)(value);\n }\n\n function inputBinding(input, proper ty, santizeFn) {\n return function(value) {\n return updateInput(input, property, value, santizeFn);\n }\n }\n\n function noop() {}\n\n function b indInputEvent(input, property, observable, postEventFn) {\n var eventType = g etEventForInputType(input);\n\n function eventHandler() {\n observable.s etValue(input[property]);\n observable.discardChanges();\n (postEventF n || noop)(input);\n Platform.performMicrotaskCheckpoint();\n }\n inp ut.addEventListener(eventType, eventHandler);\n\n var capturedClose = observa ble.close;\n observable.close = function() {\n if (!capturedClose)\n return;\n input.removeEventListener(eventType, eventHandler);\n\n observable.close = capturedClose;\n observable.close();\n capturedClos e = undefined;\n }\n }\n\n function booleanSanitize(value) {\n return Bo olean(value);\n }\n\n // |element| is assumed to be an HTMLInputElement with | type| == 'radio'.\n // Returns an array containing all radio buttons other than |element| that\n // have the same |name|, either in the form that |element| be longs to or,\n // if no form, in the document tree to which |element| belongs.\ n //\n // This implementation is based upon the HTML spec definition of a\n / / \"radio button group\":\n // http://www.whatwg.org/specs/web-apps/current-w ork/multipage/number-state.html#radio-button-group\n //\n function getAssociat edRadioButtons(element) {\n if (element.form) {\n return filter(element. form.elements, function(el) {\n return el != element &&\n el.t agName == 'INPUT' &&\n el.type == 'radio' &&\n el.name == element.name;\n });\n } else {\n var treeScope = getTreeScope(eleme nt);\n if (!treeScope)\n return [];\n var radios = treeScope.qu erySelectorAll(\n 'input[type=\"radio\"][name=\"' + element.name + '\"] ');\n return filter(radios, function(el) {\n return el != element && !el.form;\n });\n }\n }\n\n function checkedPostEvent(input) {\n / / Only the radio button that is getting checked gets an event. We\n // theref ore find all the associated radio buttons and update their\n // check binding manually.\n if (input.tagName === 'INPUT' &&\n input.type === 'radio' ) {\n getAssociatedRadioButtons(input).forEach(function(radio) {\n v ar checkedBinding = radio.bindings.checked;\n if (checkedBinding) {\n // Set the value directly to avoid an infinite call stack.\n chec kedBinding.setValue(false);\n }\n });\n }\n }\n\n HTMLInputElem ent.prototype.bind = function(name, value, oneTime) {\n if (name !== 'value' && name !== 'checked')\n return HTMLElement.prototype.bind.call(this, name, value, oneTime);\n\n\n this.removeAttribute(name);\n var sanitizeFn = nam e == 'checked' ? booleanSanitize : sanitizeValue;\n var postEventFn = name == 'checked' ? checkedPostEvent : noop;\n\n if (oneTime)\n return updateIn put(this, name, value, sanitizeFn);\n\n unbind(this, name);\n bindInputEve nt(this, name, value, postEventFn);\n updateInput(this, name,\n value.open(inputBinding(this, name, sanitizeFn)),\n sanitizeFn) ;\n\n return this.bindings[name] = value;\n }\n\n HTMLTextAreaElement.proto type.bind = function(name, value, oneTime) {\n if (name !== 'value')\n r eturn HTMLElement.prototype.bind.call(this, name, value, oneTime);\n\n this.r emoveAttribute('value');\n\n if (oneTime)\n return updateInput(this, 'va lue', value);\n\n unbind(this, 'value');\n bindInputEvent(this, 'value', v alue);\n updateInput(this, 'value',\n value.open(inputBinding( this, 'value', sanitizeValue)));\n\n return this.bindings.value = value;\n } \n\n function updateOption(option, value) {\n var parentNode = option.parent Node;;\n var select;\n var selectBinding;\n var oldValue;\n if (pare ntNode instanceof HTMLSelectElement &&\n parentNode.bindings &&\n parentNode.bindings.value) {\n select = parentNode;\n selectBinding = select.bindings.value;\n oldValue = select.value;\n }\n\n option.valu e = sanitizeValue(value);\n\n if (select && select.value != oldValue) {\n selectBinding.setValue(select.value);\n selectBinding.discardChanges();\n Platform.performMicrotaskCheckpoint();\n }\n }\n\n function optionBin ding(option) {\n return function(value) {\n updateOption(option, value); \n }\n }\n\n HTMLOptionElement.prototype.bind = function(name, value, oneTi me) {\n if (name !== 'value')\n return HTMLElement.prototype.bind.call(t his, name, value, oneTime);\n\n this.removeAttribute('value');\n\n if (one Time)\n return updateOption(this, value);\n\n unbind(this, 'value');\n bindInputEvent(this, 'value', value);\n updateOption(this, value.open(optio nBinding(this)));\n return this.bindings.value = value;\n }\n\n HTMLSelectE lement.prototype.bind = function(name, value, oneTime) {\n if (name === 'sele ctedindex')\n name = 'selectedIndex';\n\n if (name !== 'selectedIndex' & & name !== 'value')\n return HTMLElement.prototype.bind.call(this, name, va lue, oneTime);\n\n this.removeAttribute(name);\n\n if (oneTime)\n ret urn updateInput(this, name, value);\n\n unbind(this, name);\n bindInputEve nt(this, name, value);\n updateInput(this, name,\n value.open( inputBinding(this, name)));\n return this.bindings[name] = value;\n }\n})(th is);\n", 201 "/*\n * Copyright 2014 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Because recognizers are loaded after dispatcher, we have to wait to register\n * scopes until after all the recognizers.\n */\n(f unction(scope) {\n var dispatcher = scope.dispatcher;\n function registerScope s() {\n dispatcher.immediateRegister = true;\n var rq = dispatcher.registe rQueue;\n rq.forEach(scope.register);\n rq.length = 0;\n }\n if (documen t.readyState === 'complete') {\n registerScopes();\n } else {\n // regist er scopes after a steadystate is reached\n // less MutationObserver churn\n document.addEventListener('readystatechange', function() {\n if (document .readyState === 'complete') {\n registerScopes();\n }\n });\n }\ n})(window.PointerGestures);\n",
202 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n var filter = Array.prototype.filter.call.bind(Array.prototype.filt er);\n\n function getTreeScope(node) {\n while (node.parentNode) {\n no de = node.parentNode;\n }\n\n return typeof node.getElementById === 'funct ion' ? node : null;\n }\n\n\n Node.prototype.bind = function(name, observable) {\n console.error('Unhandled binding to Node: ', this, name, observable);\n };\n\n function unbind(node, name) {\n var bindings = node.bindings;\n i f (!bindings) {\n node.bindings = {};\n return;\n }\n\n var bind ing = bindings[name];\n if (!binding)\n return;\n\n binding.close();\ n bindings[name] = undefined;\n }\n\n Node.prototype.unbind = function(name ) {\n unbind(this, name);\n };\n\n Node.prototype.unbindAll = function() {\ n if (!this.bindings)\n return;\n var names = Object.keys(this.bindin gs);\n for (var i = 0; i < names.length; i++) {\n var binding = this.bin dings[names[i]];\n if (binding)\n binding.close();\n }\n\n thi s.bindings = {};\n };\n\n function sanitizeValue(value) {\n return value == null ? '' : value;\n }\n\n function updateText(node, value) {\n node.data = sanitizeValue(value);\n }\n\n function textBinding(node) {\n return funct ion(value) {\n return updateText(node, value);\n };\n }\n\n Text.proto type.bind = function(name, value, oneTime) {\n if (name !== 'textContent')\n return Node.prototype.bind.call(this, name, value, oneTime);\n\n if (one Time)\n return updateText(this, value);\n\n unbind(this, 'textContent'); \n updateText(this, value.open(textBinding(this)));\n return this.bindings .textContent = value;\n }\n\n function updateAttribute(el, name, conditional, value) {\n if (conditional) {\n if (value)\n el.setAttribute(name , '');\n else\n el.removeAttribute(name);\n return;\n }\n\n el.setAttribute(name, sanitizeValue(value));\n }\n\n function attributeBind ing(el, name, conditional) {\n return function(value) {\n updateAttribut e(el, name, conditional, value);\n };\n }\n\n Element.prototype.bind = func tion(name, value, oneTime) {\n var conditional = name[name.length - 1] == '?' ;\n if (conditional) {\n this.removeAttribute(name);\n name = name. slice(0, -1);\n }\n\n if (oneTime)\n return updateAttribute(this, nam e, conditional, value);\n\n unbind(this, name);\n updateAttribute(this, na me, conditional,\n value.open(attributeBinding(this, name, conditional))) ;\n\n return this.bindings[name] = value;\n };\n\n var checkboxEventType;\n (function() {\n // Attempt to feature-detect which event (change or click) is fired first\n // for checkboxes.\n var div = document.createElement('di v');\n var checkbox = div.appendChild(document.createElement('input'));\n checkbox.setAttribute('type', 'checkbox');\n var first;\n var count = 0;\n checkbox.addEventListener('click', function(e) {\n count++;\n firs t = first || 'click';\n });\n checkbox.addEventListener('change', function () {\n count++;\n first = first || 'change';\n });\n\n var event = document.createEvent('MouseEvent');\n event.initMouseEvent(\"click\", true , true, window, 0, 0, 0, 0, 0, false,\n false, false, false, 0, null);\n checkbox.dispatchEvent(event);\n // WebKit/Blink don't fire the change eve nt if the element is outside the\n // document, so assume 'change' for that c ase.\n checkboxEventType = count == 1 ? 'change' : first;\n })();\n\n funct ion getEventForInputType(element) {\n switch (element.type) {\n case 'ch eckbox':\n return checkboxEventType;\n case 'radio':\n case 'se lect-multiple':\n case 'select-one':\n return 'change';\n case 'range':\n if (/Trident|MSIE/.test(navigator.userAgent))\n retur n 'change';\n default:\n return 'input';\n }\n }\n\n function u pdateInput(input, property, value, santizeFn) {\n input[property] = (santizeF n || sanitizeValue)(value);\n }\n\n function inputBinding(input, property, san tizeFn) {\n return function(value) {\n return updateInput(input, propert y, value, santizeFn);\n }\n }\n\n function noop() {}\n\n function bindInpu tEvent(input, property, observable, postEventFn) {\n var eventType = getEvent ForInputType(input);\n\n function eventHandler() {\n observable.setValue (input[property]);\n observable.discardChanges();\n (postEventFn || no op)(input);\n Platform.performMicrotaskCheckpoint();\n }\n input.addE ventListener(eventType, eventHandler);\n\n var capturedClose = observable.clo se;\n observable.close = function() {\n if (!capturedClose)\n ret urn;\n input.removeEventListener(eventType, eventHandler);\n\n observa ble.close = capturedClose;\n observable.close();\n capturedClose = und efined;\n }\n }\n\n function booleanSanitize(value) {\n return Boolean(v alue);\n }\n\n // |element| is assumed to be an HTMLInputElement with |type| = = 'radio'.\n // Returns an array containing all radio buttons other than |eleme nt| that\n // have the same |name|, either in the form that |element| belongs t o or,\n // if no form, in the document tree to which |element| belongs.\n //\n // This implementation is based upon the HTML spec definition of a\n // \"rad io button group\":\n // http://www.whatwg.org/specs/web-apps/current-work/mul tipage/number-state.html#radio-button-group\n //\n function getAssociatedRadio Buttons(element) {\n if (element.form) {\n return filter(element.form.el ements, function(el) {\n return el != element &&\n el.tagName == 'INPUT' &&\n el.type == 'radio' &&\n el.name == element .name;\n });\n } else {\n var treeScope = getTreeScope(element);\n if (!treeScope)\n return [];\n var radios = treeScope.querySele ctorAll(\n 'input[type=\"radio\"][name=\"' + element.name + '\"]');\n return filter(radios, function(el) {\n return el != element && !el.fo rm;\n });\n }\n }\n\n function checkedPostEvent(input) {\n // Only the radio button that is getting checked gets an event. We\n // therefore fin d all the associated radio buttons and update their\n // check binding manual ly.\n if (input.tagName === 'INPUT' &&\n input.type === 'radio') {\n getAssociatedRadioButtons(input).forEach(function(radio) {\n var chec kedBinding = radio.bindings.checked;\n if (checkedBinding) {\n / / Set the value directly to avoid an infinite call stack.\n checkedBind ing.setValue(false);\n }\n });\n }\n }\n\n HTMLInputElement.pro totype.bind = function(name, value, oneTime) {\n if (name !== 'value' && name !== 'checked')\n return HTMLElement.prototype.bind.call(this, name, value, oneTime);\n\n\n this.removeAttribute(name);\n var sanitizeFn = name == 'c hecked' ? booleanSanitize : sanitizeValue;\n var postEventFn = name == 'check ed' ? checkedPostEvent : noop;\n\n if (oneTime)\n return updateInput(thi s, name, value, sanitizeFn);\n\n unbind(this, name);\n bindInputEvent(this , name, value, postEventFn);\n updateInput(this, name,\n value .open(inputBinding(this, name, sanitizeFn)),\n sanitizeFn);\n\n return this.bindings[name] = value;\n }\n\n HTMLTextAreaElement.prototype.bi nd = function(name, value, oneTime) {\n if (name !== 'value')\n return H TMLElement.prototype.bind.call(this, name, value, oneTime);\n\n this.removeAt tribute('value');\n\n if (oneTime)\n return updateInput(this, 'value', v alue);\n\n unbind(this, 'value');\n bindInputEvent(this, 'value', value);\ n updateInput(this, 'value',\n value.open(inputBinding(this, ' value', sanitizeValue)));\n\n return this.bindings.value = value;\n }\n\n f unction updateOption(option, value) {\n var parentNode = option.parentNode;;\ n var select;\n var selectBinding;\n var oldValue;\n if (parentNode instanceof HTMLSelectElement &&\n parentNode.bindings &&\n parentN ode.bindings.value) {\n select = parentNode;\n selectBinding = select. bindings.value;\n oldValue = select.value;\n }\n\n option.value = san itizeValue(value);\n\n if (select && select.value != oldValue) {\n selec tBinding.setValue(select.value);\n selectBinding.discardChanges();\n P latform.performMicrotaskCheckpoint();\n }\n }\n\n function optionBinding(op tion) {\n return function(value) {\n updateOption(option, value);\n } \n }\n\n HTMLOptionElement.prototype.bind = function(name, value, oneTime) {\n if (name !== 'value')\n return HTMLElement.prototype.bind.call(this, na me, value, oneTime);\n\n this.removeAttribute('value');\n\n if (oneTime)\n return updateOption(this, value);\n\n unbind(this, 'value');\n bindI nputEvent(this, 'value', value);\n updateOption(this, value.open(optionBindin g(this)));\n return this.bindings.value = value;\n }\n\n HTMLSelectElement. prototype.bind = function(name, value, oneTime) {\n if (name === 'selectedind ex')\n name = 'selectedIndex';\n\n if (name !== 'selectedIndex' && name !== 'value')\n return HTMLElement.prototype.bind.call(this, name, value, on eTime);\n\n this.removeAttribute(name);\n\n if (oneTime)\n return upd ateInput(this, name, value);\n\n unbind(this, name);\n bindInputEvent(this , name, value);\n updateInput(this, name,\n value.open(inputBi nding(this, name)));\n return this.bindings[name] = value;\n }\n})(this);\n" ,
199 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n function assert(v) {\n if (!v)\n throw new Error('Assertio n failed');\n }\n\n var forEach = Array.prototype.forEach.call.bind(Array.prot otype.forEach);\n\n function getFragmentRoot(node) {\n var p;\n while (p = node.parentNode) {\n node = p;\n }\n\n return node;\n }\n\n funct ion searchRefId(node, id) {\n if (!id)\n return;\n\n var ref;\n va r selector = '#' + id;\n while (!ref) {\n node = getFragmentRoot(node);\ n\n if (node.protoContent_)\n ref = node.protoContent_.querySelector (selector);\n else if (node.getElementById)\n ref = node.getElementB yId(id);\n\n if (ref || !node.templateCreator_)\n break\n\n nod e = node.templateCreator_;\n }\n\n return ref;\n }\n\n function getInsta nceRoot(node) {\n while (node.parentNode) {\n node = node.parentNode;\n }\n return node.templateCreator_ ? node : null;\n }\n\n var Map;\n if ( global.Map && typeof global.Map.prototype.forEach === 'function') {\n Map = g lobal.Map;\n } else {\n Map = function() {\n this.keys = [];\n thi s.values = [];\n };\n\n Map.prototype = {\n set: function(key, value) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n this.keys.push(key);\n this.values.push(value);\n } else {\ n this.values[index] = value;\n }\n },\n\n get: functi on(key) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n return;\n\n return this.values[index];\n },\n\n delet e: function(key, value) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n return false;\n\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return true;\n },\n\n f orEach: function(f, opt_this) {\n for (var i = 0; i < this.keys.length; i ++)\n f.call(opt_this || this, this.values[i], this.keys[i], this);\n }\n };\n }\n\n // JScript does not have __proto__. We wrap all object l iterals with\n // createObject which uses Object.create, Object.defineProperty and\n // Object.getOwnPropertyDescriptor to create a new object that does the e xact\n // same thing. The main downside to this solution is that we have to ext ract\n // all those property descriptors for IE.\n var createObject = ('__prot o__' in {}) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(o bj).forEach(function(name) {\n Object.defineProperty(newObject, name,\n Object.getOwnPropertyDescriptor(obj, name));\n });\n return newObject;\n };\n\n // IE does not support have D ocument.prototype.contains.\n if (typeof document.contains != 'function') {\n Document.prototype.contains = function(node) {\n if (node === this || nod e.parentNode === this)\n return true;\n return this.documentElement. contains(node);\n }\n }\n\n var BIND = 'bind';\n var REPEAT = 'repeat';\n var IF = 'if';\n\n var templateAttributeDirectives = {\n 'template': true,\ n 'repeat': true,\n 'bind': true,\n 'ref': true\n };\n\n var semantic TemplateElements = {\n 'THEAD': true,\n 'TBODY': true,\n 'TFOOT': true, \n 'TH': true,\n 'TR': true,\n 'TD': true,\n 'COLGROUP': true,\n 'COL': true,\n 'CAPTION': true,\n 'OPTION': true,\n 'OPTGROUP': true\n };\n\n var hasTemplateElement = typeof HTMLTemplateElement !== 'undefined';\n if (hasTemplateElement) {\n // TODO(rafaelw): Remove when fix for\n // ht tps://codereview.chromium.org/164803002/\n // makes it to Chrome release.\n (function() {\n var t = document.createElement('template');\n var d = t.content.ownerDocument;\n var html = d.appendChild(d.createElement('html '));\n var head = html.appendChild(d.createElement('head'));\n var bas e = d.createElement('base');\n base.href = document.baseURI;\n head.ap pendChild(base);\n })();\n }\n\n var allTemplatesSelectors = 'template, ' + \n Object.keys(semanticTemplateElements).map(function(tagName) {\n r eturn tagName.toLowerCase() + '[template]';\n }).join(', ');\n\n function isSVGTemplate(el) {\n return el.tagName == 'template' &&\n el.names paceURI == 'http://www.w3.org/2000/svg';\n }\n\n function isHTMLTemplate(el) { \n return el.tagName == 'TEMPLATE' &&\n el.namespaceURI == 'http:// www.w3.org/1999/xhtml';\n }\n\n function isAttributeTemplate(el) {\n return Boolean(semanticTemplateElements[el.tagName] &&\n el.hasAttri bute('template'));\n }\n\n function isTemplate(el) {\n if (el.isTemplate_ = == undefined)\n el.isTemplate_ = el.tagName == 'TEMPLATE' || isAttributeTem plate(el);\n\n return el.isTemplate_;\n }\n\n // FIXME: Observe templates b eing added/removed from documents\n // FIXME: Expose imperative API to decorate and observe templates in\n // \"disconnected tress\" (e.g. ShadowRoot)\n docu ment.addEventListener('DOMContentLoaded', function(e) {\n bootstrapTemplatesR ecursivelyFrom(document);\n // FIXME: Is this needed? Seems like it shouldn't be.\n Platform.performMicrotaskCheckpoint();\n }, false);\n\n function for AllTemplatesFrom(node, fn) {\n var subTemplates = node.querySelectorAll(allTe mplatesSelectors);\n\n if (isTemplate(node))\n fn(node)\n forEach(sub Templates, fn);\n }\n\n function bootstrapTemplatesRecursivelyFrom(node) {\n function bootstrap(template) {\n if (!HTMLTemplateElement.decorate(templa te))\n bootstrapTemplatesRecursivelyFrom(template.content);\n }\n\n forAllTemplatesFrom(node, bootstrap);\n }\n\n if (!hasTemplateElement) {\n /**\n * This represents a <template> element.\n * @constructor\n * @extends {HTMLElement}\n */\n global.HTMLTemplateElement = function() {\n throw TypeError('Illegal constructor');\n };\n }\n\n var hasProto = ' __proto__' in {};\n\n function mixin(to, from) {\n Object.getOwnPropertyName s(from).forEach(function(name) {\n Object.defineProperty(to, name,\n Object.getOwnPropertyDescriptor(from, name));\n });\n } \n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.h tml#dfn-template-contents-owner\n function getOrCreateTemplateContentsOwner(tem plate) {\n var doc = template.ownerDocument\n if (!doc.defaultView)\n return doc;\n var d = doc.templateContentsOwner_;\n if (!d) {\n // T ODO(arv): This should either be a Document or HTMLDocument depending\n // o n doc.\n d = doc.implementation.createHTMLDocument('');\n while (d.las tChild) {\n d.removeChild(d.lastChild);\n }\n doc.templateConte ntsOwner_ = d;\n }\n return d;\n }\n\n function getTemplateStagingDocume nt(template) {\n if (!template.stagingDocument_) {\n var owner = templat e.ownerDocument;\n if (!owner.stagingDocument_) {\n owner.stagingDoc ument_ = owner.implementation.createHTMLDocument('');\n\n // TODO(rafaelw ): Remove when fix for\n // https://codereview.chromium.org/164803002/\n // makes it to Chrome release.\n var base = owner.stagingDocument_ .createElement('base');\n base.href = document.baseURI;\n owner.st agingDocument_.head.appendChild(base);\n\n owner.stagingDocument_.staging Document_ = owner.stagingDocument_;\n }\n\n template.stagingDocument_ = owner.stagingDocument_;\n }\n\n return template.stagingDocument_;\n }\n \n // For non-template browsers, the parser will disallow <template> in certain \n // locations, so we allow \"attribute templates\" which combine the template \n // element with the top-level container node of the content, e.g.\n //\n / / <tr template repeat=\"{{ foo }}\"\" class=\"bar\"><td>Bar</td></tr>\n //\n // becomes\n //\n // <template repeat=\"{{ foo }}\">\n // + #document-fr agment\n // + <tr class=\"bar\">\n // + <td>Bar</td>\n //\n functi on extractTemplateFromAttributeTemplate(el) {\n var template = el.ownerDocume nt.createElement('template');\n el.parentNode.insertBefore(template, el);\n\n var attribs = el.attributes;\n var count = attribs.length;\n while (co unt-- > 0) {\n var attrib = attribs[count];\n if (templateAttributeDir ectives[attrib.name]) {\n if (attrib.name !== 'template')\n temp late.setAttribute(attrib.name, attrib.value);\n el.removeAttribute(attrib .name);\n }\n }\n\n return template;\n }\n\n function extractTempla teFromSVGTemplate(el) {\n var template = el.ownerDocument.createElement('temp late');\n el.parentNode.insertBefore(template, el);\n\n var attribs = el.a ttributes;\n var count = attribs.length;\n while (count-- > 0) {\n va r attrib = attribs[count];\n template.setAttribute(attrib.name, attrib.valu e);\n el.removeAttribute(attrib.name);\n }\n\n el.parentNode.removeCh ild(el);\n return template;\n }\n\n function liftNonNativeTemplateChildrenI ntoContent(template, el, useRoot) {\n var content = template.content;\n if (useRoot) {\n content.appendChild(el);\n return;\n }\n\n var ch ild;\n while (child = el.firstChild) {\n content.appendChild(child);\n }\n }\n\n var templateObserver;\n if (typeof MutationObserver == 'function' ) {\n templateObserver = new MutationObserver(function(records) {\n for (var i = 0; i < records.length; i++) {\n records[i].target.refChanged_(); \n }\n });\n }\n\n /**\n * Ensures proper API and content model for template elements.\n * @param {HTMLTemplateElement} opt_instanceRef The templa te element which\n * |el| template element will return as the value of its ref(), and whose\n * content will be used as source when createInstance() is invoked.\n */\n HTMLTemplateElement.decorate = function(el, opt_instanceR ef) {\n if (el.templateIsDecorated_)\n return false;\n\n var template Element = el;\n templateElement.templateIsDecorated_ = true;\n\n var isNat iveHTMLTemplate = isHTMLTemplate(templateElement) &&\n hasTemplateElement;\n var bootstrapContents = isNativeHTMLTemplate;\n var liftContents = !isNativeHTMLTemplate;\n var liftRoot = false;\n\n if (!isNativeHTMLTemplate) {\n if (isAttributeTemplate(templateElement)) {\n assert(!opt_instanceRef);\n templateElement = extractTemplateFromAt tributeTemplate(el);\n templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplate = hasTemplateElement;\n liftRoot = true;\n } else if (isSVGTemplate(templateElement)) {\n templateElement = extractT emplateFromSVGTemplate(el);\n templateElement.templateIsDecorated_ = true ;\n isNativeHTMLTemplate = hasTemplateElement;\n }\n }\n\n if (!isNativeHTMLTemplate) {\n fixTemplateElementPrototype(templateElement);\n var doc = getOrCreateTemplateContentsOwner(templateElement);\n templa teElement.content_ = doc.createDocumentFragment();\n }\n\n if (opt_instanc eRef) {\n // template is contained within an instance, its direct content m ust be\n // empty\n templateElement.instanceRef_ = opt_instanceRef;\n } else if (liftContents) {\n liftNonNativeTemplateChildrenIntoContent(te mplateElement,\n el,\n liftRoot);\n } else if (bootstrapContents) {\n bootstrapTemplatesRecursivelyFrom(templateElement.content);\n }\n\n return true;\n };\n\n // TODO(rafaelw): This used to decorate recursively all templates from a given\n // node. This happens by default on 'DOMContentLoa ded', but may be needed\n // in subtrees not descendent from document (e.g. Sha dowRoot).\n // Review whether this is the right public API.\n HTMLTemplateElem ent.bootstrap = bootstrapTemplatesRecursivelyFrom;\n\n var htmlElement = global .HTMLUnknownElement || HTMLElement;\n\n var contentDescriptor = {\n get: fun ction() {\n return this.content_;\n },\n enumerable: true,\n confi gurable: true\n };\n\n if (!hasTemplateElement) {\n // Gecko is more picky with the prototype than WebKit. Make sure to use the\n // same prototype as c reated in the constructor.\n HTMLTemplateElement.prototype = Object.create(ht mlElement.prototype);\n\n Object.defineProperty(HTMLTemplateElement.prototype , 'content',\n contentDescriptor);\n }\n\n function f ixTemplateElementPrototype(el) {\n if (hasProto)\n el.__proto__ = HTMLTe mplateElement.prototype;\n else\n mixin(el, HTMLTemplateElement.prototyp e);\n }\n\n function ensureSetModelScheduled(template) {\n if (!template.se tModelFn_) {\n template.setModelFn_ = function() {\n template.setMod elFnScheduled_ = false;\n var map = getBindings(template,\n te mplate.delegate_ && template.delegate_.prepareBinding);\n processBindings (template, map, template.model_);\n };\n }\n\n if (!template.setModel FnScheduled_) {\n template.setModelFnScheduled_ = true;\n Observer.run EOM_(template.setModelFn_);\n }\n }\n\n mixin(HTMLTemplateElement.prototype , {\n bind: function(name, value, oneTime) {\n if (name != 'ref')\n return Element.prototype.bind.call(this, name, value, oneTime);\n\n var self = this;\n var ref = oneTime ? value : value.open(function(ref) {\n self.setAttribute('ref', ref);\n self.refChanged_();\n });\n\n this.setAttribute('ref', ref);\n this.refChanged_();\n if (oneTime )\n return;\n\n this.unbind('ref');\n return this.bindings.ref = value;\n },\n\n processBindingDirectives_: function(directives) {\n if (this.iterator_)\n this.iterator_.closeDeps();\n\n if (!directiv es.if && !directives.bind && !directives.repeat) {\n if (this.iterator_) {\n this.iterator_.close();\n this.iterator_ = undefined;\n this.bindings.iterator = undefined;\n }\n\n return;\n }\n\n if (!this.iterator_) {\n this.iterator_ = new TemplateIterator (this);\n this.bindings = this.bindings || {};\n this.bindings.ite rator = this.iterator_;\n }\n\n this.iterator_.updateDependencies(dire ctives, this.model_);\n\n if (templateObserver) {\n templateObserver .observe(this, { attributes: true,\n att ributeFilter: ['ref'] });\n }\n\n return this.iterator_;\n },\n\n createInstance: function(model, bindingDelegate, delegate_,\n instanceBindings_) {\n if (bindingDelegate)\n delegate_ = this.newDelegate_(bindingDelegate);\n\n if (!this.refContent_)\n t his.refContent_ = this.ref_.content;\n var content = this.refContent_;\n var map = this.bindingMap_;\n if (!map || map.content !== content) {\n // TODO(rafaelw): Setup a MutationObserver on content to detect\n / / when the instanceMap is invalid.\n map = createInstanceBindingMap(conte nt,\n delegate_ && delegate_.prepareBinding) || [];\n map.cont ent = content;\n this.bindingMap_ = map;\n }\n\n var stagingDoc ument = getTemplateStagingDocument(this);\n var instance = stagingDocument. createDocumentFragment();\n instance.templateCreator_ = this;\n instan ce.protoContent_ = content;\n\n var instanceRecord = {\n firstNode: null,\n lastNode: null,\n model: model\n };\n\n var i = 0;\n for (var child = content.firstChild; child; child = child.nextSibling) {\n var clone = cloneAndBindInstance(child, instance, stagingDocument,\n map.children[i++],\n model,\n delegate_ ,\n instanceBindings_);\n clone.t emplateInstance_ = instanceRecord;\n }\n\n instanceRecord.firstNode = instance.firstChild;\n instanceRecord.lastNode = instance.lastChild;\n instance.templateCreator_ = undefined;\n instance.protoContent_ = undefine d;\n return instance;\n },\n\n get model() {\n return this.model _;\n },\n\n set model(model) {\n this.model_ = model;\n ensureSe tModelScheduled(this);\n },\n\n get bindingDelegate() {\n return this .delegate_ && this.delegate_.raw;\n },\n\n refChanged_: function() {\n if (!this.iterator_ || this.refContent_ === this.ref_.content)\n return ;\n\n this.refContent_ = undefined;\n this.iterator_.valueChanged();\n this.iterator_.updateIteratedValue();\n },\n\n clear: function() {\n this.model_ = undefined;\n this.delegate_ = undefined;\n this.bi ndings_ = undefined;\n this.refContent_ = undefined;\n if (!this.itera tor_)\n return;\n this.iterator_.valueChanged();\n this.iterato r_.close()\n this.iterator_ = undefined;\n },\n\n setDelegate_: funct ion(delegate) {\n this.delegate_ = delegate;\n this.bindingMap_ = unde fined;\n if (this.iterator_) {\n this.iterator_.instancePositionChan gedFn_ = undefined;\n this.iterator_.instanceModelFn_ = undefined;\n }\n },\n\n newDelegate_: function(bindingDelegate) {\n if (!bindingD elegate)\n return {};\n\n function delegateFn(name) {\n var f n = bindingDelegate && bindingDelegate[name];\n if (typeof fn != 'functio n')\n return;\n\n return function() {\n return fn.apply (bindingDelegate, arguments);\n };\n }\n\n return {\n ra w: bindingDelegate,\n prepareBinding: delegateFn('prepareBinding'),\n prepareInstanceModel: delegateFn('prepareInstanceModel'),\n prepareIn stancePositionChanged:\n delegateFn('prepareInstancePositionChanged') \n };\n },\n\n // TODO(rafaelw): Assigning .bindingDelegate always su cceeds. It may\n // make sense to issue a warning or even throw if the templa te is already\n // \"activated\", since this would be a strange thing to do.\ n set bindingDelegate(bindingDelegate) {\n if (this.delegate_) {\n throw Error('Template must be cleared before a new bindingDelegate ' +\n 'can be assigned');\n }\n\n this.setDelegate_(this.newDe legate_(bindingDelegate));\n },\n\n get ref_() {\n var ref = searchRe fId(this, this.getAttribute('ref'));\n if (!ref)\n ref = this.instan ceRef_;\n\n if (!ref)\n return this;\n\n var nextRef = ref.ref_ ;\n return nextRef ? nextRef : ref;\n }\n });\n\n // Returns\n // a ) undefined if there are no mustaches.\n // b) [TEXT, (ONE_TIME?, PATH, DELEG ATE_FN, TEXT)+] if there is at least one mustache.\n function parseMustaches(s, name, node, prepareBindingFn) {\n if (!s || !s.length)\n return;\n\n var tokens;\n var length = s.length;\n var startIndex = 0, lastIndex = 0, endIndex = 0;\n var onlyOneTime = true;\n while (lastIndex < length) {\n var startIndex = s.indexOf('{{', lastIndex);\n var oneTimeStart = s.in dexOf('[[', lastIndex);\n var oneTime = false;\n var terminator = '}}' ;\n\n if (oneTimeStart >= 0 &&\n (startIndex < 0 || oneTimeStart < startIndex)) {\n startIndex = oneTimeStart;\n oneTime = true;\n terminator = ']]';\n }\n\n endIndex = startIndex < 0 ? -1 : s.in dexOf(terminator, startIndex + 2);\n\n if (endIndex < 0) {\n if (!to kens)\n return;\n\n tokens.push(s.slice(lastIndex)); // TEXT\n break;\n }\n\n tokens = tokens || [];\n tokens.push(s.slice (lastIndex, startIndex)); // TEXT\n var pathString = s.slice(startIndex + 2 , endIndex).trim();\n tokens.push(oneTime); // ONE_TIME?\n onlyOneTime = onlyOneTime && oneTime;\n tokens.push(Path.get(pathString)); // PATH\n var delegateFn = prepareBindingFn &&\n prepareBindingF n(pathString, name, node);\n tokens.push(delegateFn); // DELEGATE_FN\n lastIndex = endIndex + 2;\n }\n\n if (lastIndex === length)\n tokens .push(''); // TEXT\n\n tokens.hasOnePath = tokens.length === 5;\n tokens.i sSimplePath = tokens.hasOnePath &&\n tokens[0] == '' && \n tokens[4] == '';\n tokens.onlyOneTime = onlyOneTi me;\n\n tokens.combinator = function(values) {\n var newValue = tokens[0 ];\n\n for (var i = 1; i < tokens.length; i += 4) {\n var value = to kens.hasOnePath ? values : values[(i - 1) / 4];\n if (value !== undefined )\n newValue += value;\n newValue += tokens[i + 3];\n }\n\n return newValue;\n }\n\n return tokens;\n };\n\n function processO neTimeBinding(name, tokens, node, model) {\n if (tokens.hasOnePath) {\n var delegateFn = tokens[3];\n var value = delegateFn ? delegateFn(model, no de, true) :\n tokens[2].getValueFrom(model);\n return tokens.isSimplePath ? value : tokens.combinator(value);\n }\n\n v ar values = [];\n for (var i = 1; i < tokens.length; i += 4) {\n var del egateFn = tokens[i + 2];\n values[(i - 1) / 4] = delegateFn ? delegateFn(mo del, node) :\n tokens[i + 1].getValueFrom(model);\n }\n\n return tokens.combinator(values);\n }\n\n function processSinglePathBinding(name, tok ens, node, model) {\n var delegateFn = tokens[3];\n var observer = delegat eFn ? delegateFn(model, node, false) :\n new PathObserver(model, tokens[2 ]);\n\n return tokens.isSimplePath ? observer :\n new ObserverTransfor m(observer, tokens.combinator);\n }\n\n function processBinding(name, tokens, node, model) {\n if (tokens.onlyOneTime)\n return processOneTimeBinding( name, tokens, node, model);\n\n if (tokens.hasOnePath)\n return processS inglePathBinding(name, tokens, node, model);\n\n var observer = new CompoundO bserver();\n\n for (var i = 1; i < tokens.length; i += 4) {\n var oneTim e = tokens[i];\n var delegateFn = tokens[i + 2];\n\n if (delegateFn) { \n var value = delegateFn(model, node, oneTime);\n if (oneTime)\n observer.addPath(value)\n else\n observer.addObserver(v alue);\n continue;\n }\n\n var path = tokens[i + 1];\n if (oneTime)\n observer.addPath(path.getValueFrom(model))\n else\n observer.addPath(model, path);\n }\n\n return new ObserverTransform(obs erver, tokens.combinator);\n }\n\n function processBindings(node, bindings, mo del, instanceBindings) {\n for (var i = 0; i < bindings.length; i += 2) {\n var name = bindings[i]\n var tokens = bindings[i + 1];\n var value = processBinding(name, tokens, node, model);\n var binding = node.bind(nam e, value, tokens.onlyOneTime);\n if (binding && instanceBindings)\n instanceBindings.push(binding);\n }\n\n if (!bindings.isTemplate)\n r eturn;\n\n node.model_ = model;\n var iter = node.processBindingDirectives _(bindings);\n if (instanceBindings && iter)\n instanceBindings.push(ite r);\n }\n\n function parseWithDefault(el, name, prepareBindingFn) {\n var v = el.getAttribute(name);\n return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn);\n }\n\n function parseAttributeBindings(element, prepa reBindingFn) {\n assert(element);\n\n var bindings = [];\n var ifFound = false;\n var bindFound = false;\n\n for (var i = 0; i < element.attribut es.length; i++) {\n var attr = element.attributes[i];\n var name = att r.name;\n var value = attr.value;\n\n // Allow bindings expressed in a ttributes to be prefixed with underbars.\n // We do this to allow correct s emantics for browsers that don't implement\n // <template> where certain at tributes might trigger side-effects -- and\n // for IE which sanitizes cert ain attributes, disallowing mustache\n // replacements in their text.\n while (name[0] === '_') {\n name = name.substring(1);\n }\n\n if (isTemplate(element) &&\n (name === IF || name === BIND || name === REPEAT)) {\n continue;\n }\n\n var tokens = parseMustaches(val ue, name, element,\n prepareBindingFn);\n if (!tokens)\n continue;\n\n bindings.push(name, tokens);\n }\n\n if (isTemplate(element)) {\n bindings.isTemplate = true;\n binding s.if = parseWithDefault(element, IF, prepareBindingFn);\n bindings.bind = p arseWithDefault(element, BIND, prepareBindingFn);\n bindings.repeat = parse WithDefault(element, REPEAT, prepareBindingFn);\n\n if (bindings.if && !bin dings.bind && !bindings.repeat)\n bindings.bind = parseMustaches('{{}}', BIND, element, prepareBindingFn);\n }\n\n return bindings;\n }\n\n funct ion getBindings(node, prepareBindingFn) {\n if (node.nodeType === Node.ELEMEN T_NODE)\n return parseAttributeBindings(node, prepareBindingFn);\n\n if (node.nodeType === Node.TEXT_NODE) {\n var tokens = parseMustaches(node.dat a, 'textContent', node,\n prepareBindingFn);\n if (tokens)\n return ['textContent', tokens];\n }\n\n return [ ];\n }\n\n function cloneAndBindInstance(node, parent, stagingDocument, bindin gs, model,\n delegate,\n instanceBindings,\n instanceRecord) {\n var clone = parent.appendChild(stagingDocument.importNode(node, false));\n\n var i = 0;\n for (var child = node.firstChild; child; child = child.nextSibl ing) {\n cloneAndBindInstance(child, clone, stagingDocument,\n bindings.children[i++],\n model,\n delegate,\n instanceBindings) ;\n }\n\n if (bindings.isTemplate) {\n HTMLTemplateElement.decorate(c lone, node);\n if (delegate)\n clone.setDelegate_(delegate);\n }\ n\n processBindings(clone, bindings, model, instanceBindings);\n return cl one;\n }\n\n function createInstanceBindingMap(node, prepareBindingFn) {\n var map = getBindings(node, prepareBindingFn);\n map.children = {};\n var index = 0;\n for (var child = node.firstChild; child; child = child.nextSibli ng) {\n map.children[index++] = createInstanceBindingMap(child, prepareBind ingFn);\n }\n\n return map;\n }\n\n Object.defineProperty(Node.prototype , 'templateInstance', {\n get: function() {\n var instance = this.templa teInstance_;\n return instance ? instance :\n (this.parentNode ? t his.parentNode.templateInstance : undefined);\n }\n });\n\n function Templa teIterator(templateElement) {\n this.closed = false;\n this.templateElemen t_ = templateElement;\n\n // Flattened array of tuples:\n // <instanceTe rminatorNode, [bindingsSetupByInstance]>\n this.terminators = [];\n\n this .deps = undefined;\n this.iteratedValue = [];\n this.presentValue = undefi ned;\n this.arrayObserver = undefined;\n }\n\n TemplateIterator.prototype = {\n closeDeps: function() {\n var deps = this.deps;\n if (deps) {\ n if (deps.ifOneTime === false)\n deps.ifValue.close();\n if (deps.oneTime === false)\n deps.value.close();\n }\n },\n\n updateDependencies: function(directives, model) {\n this.closeDeps();\n \n var deps = this.deps = {};\n var template = this.templateElement_;\ n\n if (directives.if) {\n deps.hasIf = true;\n deps.ifOneTim e = directives.if.onlyOneTime;\n deps.ifValue = processBinding(IF, direct ives.if, template, model);\n\n // oneTime if & predicate is false. nothin g else to do.\n if (deps.ifOneTime && !deps.ifValue) {\n this.up dateIteratedValue();\n return;\n }\n\n if (!deps.ifOneTim e)\n deps.ifValue.open(this.updateIteratedValue, this);\n }\n\n if (directives.repeat) {\n deps.repeat = true;\n deps.oneTime = directives.repeat.onlyOneTime;\n deps.value = processBinding(REPEAT, dir ectives.repeat, template, model);\n } else {\n deps.repeat = false;\ n deps.oneTime = directives.bind.onlyOneTime;\n deps.value = proce ssBinding(BIND, directives.bind, template, model);\n }\n\n if (!deps.o neTime)\n deps.value.open(this.updateIteratedValue, this);\n\n this. updateIteratedValue();\n },\n\n updateIteratedValue: function() {\n i f (this.deps.hasIf) {\n var ifValue = this.deps.ifValue;\n if (!th is.deps.ifOneTime)\n ifValue = ifValue.discardChanges();\n if (! ifValue) {\n this.valueChanged();\n return;\n }\n }\n\n var value = this.deps.value;\n if (!this.deps.oneTime)\n value = value.discardChanges();\n if (!this.deps.repeat)\n value = [ value];\n var observe = this.deps.repeat &&\n !this.deps .oneTime &&\n Array.isArray(value);\n this.valueChanged( value, observe);\n },\n\n valueChanged: function(value, observeValue) {\n if (!Array.isArray(value))\n value = [];\n\n if (value === this .iteratedValue)\n return;\n\n this.unobserve();\n this.presentV alue = value;\n if (observeValue) {\n this.arrayObserver = new Array Observer(this.presentValue);\n this.arrayObserver.open(this.handleSplices , this);\n }\n\n this.handleSplices(ArrayObserver.calculateSplices(thi s.presentValue,\n this.it eratedValue));\n },\n\n getTerminatorAt: function(index) {\n if (inde x == -1)\n return this.templateElement_;\n var terminator = this.ter minators[index*2];\n if (terminator.nodeType !== Node.ELEMENT_NODE ||\n this.templateElement_ === terminator) {\n return terminator;\n }\n\n var subIterator = terminator.iterator_;\n if (!subIterator)\n return terminator;\n\n return subIterator.getTerminatorAt(subIterator .terminators.length/2 - 1);\n },\n\n // TODO(rafaelw): If we inserting seq uences of instances we can probably\n // avoid lots of calls to getTerminator At(), or cache its result.\n insertInstanceAt: function(index, fragment, inst anceNodes,\n instanceBindings) {\n var previo usTerminator = this.getTerminatorAt(index - 1);\n var terminator = previous Terminator;\n if (fragment)\n terminator = fragment.lastChild || ter minator;\n else if (instanceNodes)\n terminator = instanceNodes[inst anceNodes.length - 1] || terminator;\n\n this.terminators.splice(index*2, 0 , terminator, instanceBindings);\n var parent = this.templateElement_.paren tNode;\n var insertBeforeNode = previousTerminator.nextSibling;\n\n if (fragment) {\n parent.insertBefore(fragment, insertBeforeNode);\n } else if (instanceNodes) {\n for (var i = 0; i < instanceNodes.length; i+ +)\n parent.insertBefore(instanceNodes[i], insertBeforeNode);\n }\ n },\n\n extractInstanceAt: function(index) {\n var instanceNodes = [ ];\n var previousTerminator = this.getTerminatorAt(index - 1);\n var t erminator = this.getTerminatorAt(index);\n instanceNodes.instanceBindings = this.terminators[index*2 + 1];\n this.terminators.splice(index*2, 2);\n\n var parent = this.templateElement_.parentNode;\n while (terminator !== previousTerminator) {\n var node = previousTerminator.nextSibling;\n if (node == terminator)\n terminator = previousTerminator;\n\n parent.removeChild(node);\n instanceNodes.push(node);\n }\n\n return instanceNodes;\n },\n\n getDelegateFn: function(fn) {\n fn = fn && fn(this.templateElement_);\n return typeof fn === 'function' ? fn : null;\n },\n\n handleSplices: function(splices) {\n if (this.closed | | !splices.length)\n return;\n\n var template = this.templateElement _;\n\n if (!template.parentNode) {\n this.close();\n return;\ n }\n\n ArrayObserver.applySplices(this.iteratedValue, this.presentVal ue,\n splices);\n\n var delegate = template .delegate_;\n if (this.instanceModelFn_ === undefined) {\n this.inst anceModelFn_ =\n this.getDelegateFn(delegate && delegate.prepareInsta nceModel);\n }\n\n if (this.instancePositionChangedFn_ === undefined) {\n this.instancePositionChangedFn_ =\n this.getDelegateFn(del egate &&\n delegate.prepareInstancePositionChanged );\n }\n\n var instanceCache = new Map;\n var removeDelta = 0;\n splices.forEach(function(splice) {\n splice.removed.forEach(function (model) {\n var instanceNodes =\n this.extractInstanceAt(s plice.index + removeDelta);\n instanceCache.set(model, instanceNodes);\ n }, this);\n\n removeDelta -= splice.addedCount;\n }, this); \n\n splices.forEach(function(splice) {\n var addIndex = splice.inde x;\n for (; addIndex < splice.index + splice.addedCount; addIndex++) {\n var model = this.iteratedValue[addIndex];\n var fragment = und efined;\n var instanceNodes = instanceCache.get(model);\n var instanceBindings;\n if (instanceNodes) {\n instanceCache.del ete(model);\n instanceBindings = instanceNodes.instanceBindings;\n } else {\n instanceBindings = [];\n if (this.instan ceModelFn_)\n model = this.instanceModelFn_(model);\n\n if (model !== undefined) {\n fragment = template.createInstance(mod el, undefined, delegate,\n insta nceBindings);\n }\n }\n\n this.insertInstanceAt(add Index, fragment, instanceNodes,\n instanceBinding s);\n }\n }, this);\n\n instanceCache.forEach(function(instance Nodes) {\n this.closeInstanceBindings(instanceNodes.instanceBindings);\n }, this);\n\n if (this.instancePositionChangedFn_)\n this.repor tInstancesMoved(splices);\n },\n\n reportInstanceMoved: function(index) {\ n var previousTerminator = this.getTerminatorAt(index - 1);\n var term inator = this.getTerminatorAt(index);\n if (previousTerminator === terminat or)\n return; // instance has zero nodes.\n\n // We must use the fir st node of the instance, because any subsequent\n // nodes may have been ge nerated by sub-templates.\n // TODO(rafaelw): This is brittle WRT instance mutation -- e.g. if the\n // first node was removed by script.\n var t emplateInstance = previousTerminator.nextSibling.templateInstance;\n this.i nstancePositionChangedFn_(templateInstance, index);\n },\n\n reportInstanc esMoved: function(splices) {\n var index = 0;\n var offset = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice = splices[i];\n if (offset != 0) {\n while (index < splice.index) {\n this.reportInstanceMoved(index);\n index++;\n }\n } else {\n index = splice.index;\n }\n\n while (index < spl ice.index + splice.addedCount) {\n this.reportInstanceMoved(index);\n index++;\n }\n\n offset += splice.addedCount - splice.remo ved.length;\n }\n\n if (offset == 0)\n return;\n\n var len gth = this.terminators.length / 2;\n while (index < length) {\n this .reportInstanceMoved(index);\n index++;\n }\n },\n\n closeInst anceBindings: function(instanceBindings) {\n for (var i = 0; i < instanceBi ndings.length; i++) {\n instanceBindings[i].close();\n }\n },\n\n unobserve: function() {\n if (!this.arrayObserver)\n return;\n\n this.arrayObserver.close();\n this.arrayObserver = undefined;\n }, \n\n close: function() {\n if (this.closed)\n return;\n this .unobserve();\n for (var i = 1; i < this.terminators.length; i += 2) {\n this.closeInstanceBindings(this.terminators[i]);\n }\n\n this.ter minators.length = 0;\n this.closeDeps();\n this.templateElement_.itera tor_ = undefined;\n this.closed = true;\n }\n };\n\n // Polyfill-speci fic API.\n HTMLTemplateElement.forAllTemplatesFrom_ = forAllTemplatesFrom;\n})( this);\n", 203 "// Copyright 2011 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function(global) {\n 'use strict';\n\n function assert(v) {\n if (!v)\n throw new Error('Assertio n failed');\n }\n\n var forEach = Array.prototype.forEach.call.bind(Array.prot otype.forEach);\n\n function getFragmentRoot(node) {\n var p;\n while (p = node.parentNode) {\n node = p;\n }\n\n return node;\n }\n\n funct ion searchRefId(node, id) {\n if (!id)\n return;\n\n var ref;\n va r selector = '#' + id;\n while (!ref) {\n node = getFragmentRoot(node);\ n\n if (node.protoContent_)\n ref = node.protoContent_.querySelector (selector);\n else if (node.getElementById)\n ref = node.getElementB yId(id);\n\n if (ref || !node.templateCreator_)\n break\n\n nod e = node.templateCreator_;\n }\n\n return ref;\n }\n\n function getInsta nceRoot(node) {\n while (node.parentNode) {\n node = node.parentNode;\n }\n return node.templateCreator_ ? node : null;\n }\n\n var Map;\n if ( global.Map && typeof global.Map.prototype.forEach === 'function') {\n Map = g lobal.Map;\n } else {\n Map = function() {\n this.keys = [];\n thi s.values = [];\n };\n\n Map.prototype = {\n set: function(key, value) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n this.keys.push(key);\n this.values.push(value);\n } else {\ n this.values[index] = value;\n }\n },\n\n get: functi on(key) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n return;\n\n return this.values[index];\n },\n\n delet e: function(key, value) {\n var index = this.keys.indexOf(key);\n if (index < 0)\n return false;\n\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return true;\n },\n\n f orEach: function(f, opt_this) {\n for (var i = 0; i < this.keys.length; i ++)\n f.call(opt_this || this, this.values[i], this.keys[i], this);\n }\n };\n }\n\n // JScript does not have __proto__. We wrap all object l iterals with\n // createObject which uses Object.create, Object.defineProperty and\n // Object.getOwnPropertyDescriptor to create a new object that does the e xact\n // same thing. The main downside to this solution is that we have to ext ract\n // all those property descriptors for IE.\n var createObject = ('__prot o__' in {}) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(o bj).forEach(function(name) {\n Object.defineProperty(newObject, name,\n Object.getOwnPropertyDescriptor(obj, name));\n });\n return newObject;\n };\n\n // IE does not support have D ocument.prototype.contains.\n if (typeof document.contains != 'function') {\n Document.prototype.contains = function(node) {\n if (node === this || nod e.parentNode === this)\n return true;\n return this.documentElement. contains(node);\n }\n }\n\n var BIND = 'bind';\n var REPEAT = 'repeat';\n var IF = 'if';\n\n var templateAttributeDirectives = {\n 'template': true,\ n 'repeat': true,\n 'bind': true,\n 'ref': true\n };\n\n var semantic TemplateElements = {\n 'THEAD': true,\n 'TBODY': true,\n 'TFOOT': true, \n 'TH': true,\n 'TR': true,\n 'TD': true,\n 'COLGROUP': true,\n 'COL': true,\n 'CAPTION': true,\n 'OPTION': true,\n 'OPTGROUP': true\n };\n\n var hasTemplateElement = typeof HTMLTemplateElement !== 'undefined';\n if (hasTemplateElement) {\n // TODO(rafaelw): Remove when fix for\n // ht tps://codereview.chromium.org/164803002/\n // makes it to Chrome release.\n (function() {\n var t = document.createElement('template');\n var d = t.content.ownerDocument;\n var html = d.appendChild(d.createElement('html '));\n var head = html.appendChild(d.createElement('head'));\n var bas e = d.createElement('base');\n base.href = document.baseURI;\n head.ap pendChild(base);\n })();\n }\n\n var allTemplatesSelectors = 'template, ' + \n Object.keys(semanticTemplateElements).map(function(tagName) {\n r eturn tagName.toLowerCase() + '[template]';\n }).join(', ');\n\n function isSVGTemplate(el) {\n return el.tagName == 'template' &&\n el.names paceURI == 'http://www.w3.org/2000/svg';\n }\n\n function isHTMLTemplate(el) { \n return el.tagName == 'TEMPLATE' &&\n el.namespaceURI == 'http:// www.w3.org/1999/xhtml';\n }\n\n function isAttributeTemplate(el) {\n return Boolean(semanticTemplateElements[el.tagName] &&\n el.hasAttri bute('template'));\n }\n\n function isTemplate(el) {\n if (el.isTemplate_ = == undefined)\n el.isTemplate_ = el.tagName == 'TEMPLATE' || isAttributeTem plate(el);\n\n return el.isTemplate_;\n }\n\n // FIXME: Observe templates b eing added/removed from documents\n // FIXME: Expose imperative API to decorate and observe templates in\n // \"disconnected tress\" (e.g. ShadowRoot)\n docu ment.addEventListener('DOMContentLoaded', function(e) {\n bootstrapTemplatesR ecursivelyFrom(document);\n // FIXME: Is this needed? Seems like it shouldn't be.\n Platform.performMicrotaskCheckpoint();\n }, false);\n\n function for AllTemplatesFrom(node, fn) {\n var subTemplates = node.querySelectorAll(allTe mplatesSelectors);\n\n if (isTemplate(node))\n fn(node)\n forEach(sub Templates, fn);\n }\n\n function bootstrapTemplatesRecursivelyFrom(node) {\n function bootstrap(template) {\n if (!HTMLTemplateElement.decorate(templa te))\n bootstrapTemplatesRecursivelyFrom(template.content);\n }\n\n forAllTemplatesFrom(node, bootstrap);\n }\n\n if (!hasTemplateElement) {\n /**\n * This represents a <template> element.\n * @constructor\n * @extends {HTMLElement}\n */\n global.HTMLTemplateElement = function() {\n throw TypeError('Illegal constructor');\n };\n }\n\n var hasProto = ' __proto__' in {};\n\n function mixin(to, from) {\n Object.getOwnPropertyName s(from).forEach(function(name) {\n Object.defineProperty(to, name,\n Object.getOwnPropertyDescriptor(from, name));\n });\n } \n\n // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.h tml#dfn-template-contents-owner\n function getOrCreateTemplateContentsOwner(tem plate) {\n var doc = template.ownerDocument\n if (!doc.defaultView)\n return doc;\n var d = doc.templateContentsOwner_;\n if (!d) {\n // T ODO(arv): This should either be a Document or HTMLDocument depending\n // o n doc.\n d = doc.implementation.createHTMLDocument('');\n while (d.las tChild) {\n d.removeChild(d.lastChild);\n }\n doc.templateConte ntsOwner_ = d;\n }\n return d;\n }\n\n function getTemplateStagingDocume nt(template) {\n if (!template.stagingDocument_) {\n var owner = templat e.ownerDocument;\n if (!owner.stagingDocument_) {\n owner.stagingDoc ument_ = owner.implementation.createHTMLDocument('');\n\n // TODO(rafaelw ): Remove when fix for\n // https://codereview.chromium.org/164803002/\n // makes it to Chrome release.\n var base = owner.stagingDocument_ .createElement('base');\n base.href = document.baseURI;\n owner.st agingDocument_.head.appendChild(base);\n\n owner.stagingDocument_.staging Document_ = owner.stagingDocument_;\n }\n\n template.stagingDocument_ = owner.stagingDocument_;\n }\n\n return template.stagingDocument_;\n }\n \n // For non-template browsers, the parser will disallow <template> in certain \n // locations, so we allow \"attribute templates\" which combine the template \n // element with the top-level container node of the content, e.g.\n //\n / / <tr template repeat=\"{{ foo }}\"\" class=\"bar\"><td>Bar</td></tr>\n //\n // becomes\n //\n // <template repeat=\"{{ foo }}\">\n // + #document-fr agment\n // + <tr class=\"bar\">\n // + <td>Bar</td>\n //\n functi on extractTemplateFromAttributeTemplate(el) {\n var template = el.ownerDocume nt.createElement('template');\n el.parentNode.insertBefore(template, el);\n\n var attribs = el.attributes;\n var count = attribs.length;\n while (co unt-- > 0) {\n var attrib = attribs[count];\n if (templateAttributeDir ectives[attrib.name]) {\n if (attrib.name !== 'template')\n temp late.setAttribute(attrib.name, attrib.value);\n el.removeAttribute(attrib .name);\n }\n }\n\n return template;\n }\n\n function extractTempla teFromSVGTemplate(el) {\n var template = el.ownerDocument.createElement('temp late');\n el.parentNode.insertBefore(template, el);\n\n var attribs = el.a ttributes;\n var count = attribs.length;\n while (count-- > 0) {\n va r attrib = attribs[count];\n template.setAttribute(attrib.name, attrib.valu e);\n el.removeAttribute(attrib.name);\n }\n\n el.parentNode.removeCh ild(el);\n return template;\n }\n\n function liftNonNativeTemplateChildrenI ntoContent(template, el, useRoot) {\n var content = template.content;\n if (useRoot) {\n content.appendChild(el);\n return;\n }\n\n var ch ild;\n while (child = el.firstChild) {\n content.appendChild(child);\n }\n }\n\n var templateObserver;\n if (typeof MutationObserver == 'function' ) {\n templateObserver = new MutationObserver(function(records) {\n for (var i = 0; i < records.length; i++) {\n records[i].target.refChanged_(); \n }\n });\n }\n\n /**\n * Ensures proper API and content model for template elements.\n * @param {HTMLTemplateElement} opt_instanceRef The templa te element which\n * |el| template element will return as the value of its ref(), and whose\n * content will be used as source when createInstance() is invoked.\n */\n HTMLTemplateElement.decorate = function(el, opt_instanceR ef) {\n if (el.templateIsDecorated_)\n return false;\n\n var template Element = el;\n templateElement.templateIsDecorated_ = true;\n\n var isNat iveHTMLTemplate = isHTMLTemplate(templateElement) &&\n hasTemplateElement;\n var bootstrapContents = isNativeHTMLTemplate;\n var liftContents = !isNativeHTMLTemplate;\n var liftRoot = false;\n\n if (!isNativeHTMLTemplate) {\n if (isAttributeTemplate(templateElement)) {\n assert(!opt_instanceRef);\n templateElement = extractTemplateFromAt tributeTemplate(el);\n templateElement.templateIsDecorated_ = true;\n isNativeHTMLTemplate = hasTemplateElement;\n liftRoot = true;\n } else if (isSVGTemplate(templateElement)) {\n templateElement = extractT emplateFromSVGTemplate(el);\n templateElement.templateIsDecorated_ = true ;\n isNativeHTMLTemplate = hasTemplateElement;\n }\n }\n\n if (!isNativeHTMLTemplate) {\n fixTemplateElementPrototype(templateElement);\n var doc = getOrCreateTemplateContentsOwner(templateElement);\n templa teElement.content_ = doc.createDocumentFragment();\n }\n\n if (opt_instanc eRef) {\n // template is contained within an instance, its direct content m ust be\n // empty\n templateElement.instanceRef_ = opt_instanceRef;\n } else if (liftContents) {\n liftNonNativeTemplateChildrenIntoContent(te mplateElement,\n el,\n liftRoot);\n } else if (bootstrapContents) {\n bootstrapTemplatesRecursivelyFrom(templateElement.content);\n }\n\n return true;\n };\n\n // TODO(rafaelw): This used to decorate recursively all templates from a given\n // node. This happens by default on 'DOMContentLoa ded', but may be needed\n // in subtrees not descendent from document (e.g. Sha dowRoot).\n // Review whether this is the right public API.\n HTMLTemplateElem ent.bootstrap = bootstrapTemplatesRecursivelyFrom;\n\n var htmlElement = global .HTMLUnknownElement || HTMLElement;\n\n var contentDescriptor = {\n get: fun ction() {\n return this.content_;\n },\n enumerable: true,\n confi gurable: true\n };\n\n if (!hasTemplateElement) {\n // Gecko is more picky with the prototype than WebKit. Make sure to use the\n // same prototype as c reated in the constructor.\n HTMLTemplateElement.prototype = Object.create(ht mlElement.prototype);\n\n Object.defineProperty(HTMLTemplateElement.prototype , 'content',\n contentDescriptor);\n }\n\n function f ixTemplateElementPrototype(el) {\n if (hasProto)\n el.__proto__ = HTMLTe mplateElement.prototype;\n else\n mixin(el, HTMLTemplateElement.prototyp e);\n }\n\n function ensureSetModelScheduled(template) {\n if (!template.se tModelFn_) {\n template.setModelFn_ = function() {\n template.setMod elFnScheduled_ = false;\n var map = getBindings(template,\n te mplate.delegate_ && template.delegate_.prepareBinding);\n processBindings (template, map, template.model_);\n };\n }\n\n if (!template.setModel FnScheduled_) {\n template.setModelFnScheduled_ = true;\n Observer.run EOM_(template.setModelFn_);\n }\n }\n\n mixin(HTMLTemplateElement.prototype , {\n bind: function(name, value, oneTime) {\n if (name != 'ref')\n return Element.prototype.bind.call(this, name, value, oneTime);\n\n var self = this;\n var ref = oneTime ? value : value.open(function(ref) {\n self.setAttribute('ref', ref);\n self.refChanged_();\n });\n\n this.setAttribute('ref', ref);\n this.refChanged_();\n if (oneTime )\n return;\n\n this.unbind('ref');\n return this.bindings.ref = value;\n },\n\n processBindingDirectives_: function(directives) {\n if (this.iterator_)\n this.iterator_.closeDeps();\n\n if (!directiv es.if && !directives.bind && !directives.repeat) {\n if (this.iterator_) {\n this.iterator_.close();\n this.iterator_ = undefined;\n this.bindings.iterator = undefined;\n }\n\n return;\n }\n\n if (!this.iterator_) {\n this.iterator_ = new TemplateIterator (this);\n this.bindings = this.bindings || {};\n this.bindings.ite rator = this.iterator_;\n }\n\n this.iterator_.updateDependencies(dire ctives, this.model_);\n\n if (templateObserver) {\n templateObserver .observe(this, { attributes: true,\n att ributeFilter: ['ref'] });\n }\n\n return this.iterator_;\n },\n\n createInstance: function(model, bindingDelegate, delegate_,\n instanceBindings_) {\n if (bindingDelegate)\n delegate_ = this.newDelegate_(bindingDelegate);\n\n if (!this.refContent_)\n t his.refContent_ = this.ref_.content;\n var content = this.refContent_;\n var map = this.bindingMap_;\n if (!map || map.content !== content) {\n // TODO(rafaelw): Setup a MutationObserver on content to detect\n / / when the instanceMap is invalid.\n map = createInstanceBindingMap(conte nt,\n delegate_ && delegate_.prepareBinding) || [];\n map.cont ent = content;\n this.bindingMap_ = map;\n }\n\n var stagingDoc ument = getTemplateStagingDocument(this);\n var instance = stagingDocument. createDocumentFragment();\n instance.templateCreator_ = this;\n instan ce.protoContent_ = content;\n\n var instanceRecord = {\n firstNode: null,\n lastNode: null,\n model: model\n };\n\n var i = 0;\n for (var child = content.firstChild; child; child = child.nextSibling) {\n var clone = cloneAndBindInstance(child, instance, stagingDocument,\n map.children[i++],\n model,\n delegate_ ,\n instanceBindings_);\n clone.t emplateInstance_ = instanceRecord;\n }\n\n instanceRecord.firstNode = instance.firstChild;\n instanceRecord.lastNode = instance.lastChild;\n instance.templateCreator_ = undefined;\n instance.protoContent_ = undefine d;\n return instance;\n },\n\n get model() {\n return this.model _;\n },\n\n set model(model) {\n this.model_ = model;\n ensureSe tModelScheduled(this);\n },\n\n get bindingDelegate() {\n return this .delegate_ && this.delegate_.raw;\n },\n\n refChanged_: function() {\n if (!this.iterator_ || this.refContent_ === this.ref_.content)\n return ;\n\n this.refContent_ = undefined;\n this.iterator_.valueChanged();\n this.iterator_.updateIteratedValue();\n },\n\n clear: function() {\n this.model_ = undefined;\n this.delegate_ = undefined;\n this.bi ndings_ = undefined;\n this.refContent_ = undefined;\n if (!this.itera tor_)\n return;\n this.iterator_.valueChanged();\n this.iterato r_.close()\n this.iterator_ = undefined;\n },\n\n setDelegate_: funct ion(delegate) {\n this.delegate_ = delegate;\n this.bindingMap_ = unde fined;\n if (this.iterator_) {\n this.iterator_.instancePositionChan gedFn_ = undefined;\n this.iterator_.instanceModelFn_ = undefined;\n }\n },\n\n newDelegate_: function(bindingDelegate) {\n if (!bindingD elegate)\n return {};\n\n function delegateFn(name) {\n var f n = bindingDelegate && bindingDelegate[name];\n if (typeof fn != 'functio n')\n return;\n\n return function() {\n return fn.apply (bindingDelegate, arguments);\n };\n }\n\n return {\n ra w: bindingDelegate,\n prepareBinding: delegateFn('prepareBinding'),\n prepareInstanceModel: delegateFn('prepareInstanceModel'),\n prepareIn stancePositionChanged:\n delegateFn('prepareInstancePositionChanged') \n };\n },\n\n // TODO(rafaelw): Assigning .bindingDelegate always su cceeds. It may\n // make sense to issue a warning or even throw if the templa te is already\n // \"activated\", since this would be a strange thing to do.\ n set bindingDelegate(bindingDelegate) {\n if (this.delegate_) {\n throw Error('Template must be cleared before a new bindingDelegate ' +\n 'can be assigned');\n }\n\n this.setDelegate_(this.newDe legate_(bindingDelegate));\n },\n\n get ref_() {\n var ref = searchRe fId(this, this.getAttribute('ref'));\n if (!ref)\n ref = this.instan ceRef_;\n\n if (!ref)\n return this;\n\n var nextRef = ref.ref_ ;\n return nextRef ? nextRef : ref;\n }\n });\n\n // Returns\n // a ) undefined if there are no mustaches.\n // b) [TEXT, (ONE_TIME?, PATH, DELEG ATE_FN, TEXT)+] if there is at least one mustache.\n function parseMustaches(s, name, node, prepareBindingFn) {\n if (!s || !s.length)\n return;\n\n var tokens;\n var length = s.length;\n var startIndex = 0, lastIndex = 0, endIndex = 0;\n var onlyOneTime = true;\n while (lastIndex < length) {\n var startIndex = s.indexOf('{{', lastIndex);\n var oneTimeStart = s.in dexOf('[[', lastIndex);\n var oneTime = false;\n var terminator = '}}' ;\n\n if (oneTimeStart >= 0 &&\n (startIndex < 0 || oneTimeStart < startIndex)) {\n startIndex = oneTimeStart;\n oneTime = true;\n terminator = ']]';\n }\n\n endIndex = startIndex < 0 ? -1 : s.in dexOf(terminator, startIndex + 2);\n\n if (endIndex < 0) {\n if (!to kens)\n return;\n\n tokens.push(s.slice(lastIndex)); // TEXT\n break;\n }\n\n tokens = tokens || [];\n tokens.push(s.slice (lastIndex, startIndex)); // TEXT\n var pathString = s.slice(startIndex + 2 , endIndex).trim();\n tokens.push(oneTime); // ONE_TIME?\n onlyOneTime = onlyOneTime && oneTime;\n tokens.push(Path.get(pathString)); // PATH\n var delegateFn = prepareBindingFn &&\n prepareBindingF n(pathString, name, node);\n tokens.push(delegateFn); // DELEGATE_FN\n lastIndex = endIndex + 2;\n }\n\n if (lastIndex === length)\n tokens .push(''); // TEXT\n\n tokens.hasOnePath = tokens.length === 5;\n tokens.i sSimplePath = tokens.hasOnePath &&\n tokens[0] == '' && \n tokens[4] == '';\n tokens.onlyOneTime = onlyOneTi me;\n\n tokens.combinator = function(values) {\n var newValue = tokens[0 ];\n\n for (var i = 1; i < tokens.length; i += 4) {\n var value = to kens.hasOnePath ? values : values[(i - 1) / 4];\n if (value !== undefined )\n newValue += value;\n newValue += tokens[i + 3];\n }\n\n return newValue;\n }\n\n return tokens;\n };\n\n function processO neTimeBinding(name, tokens, node, model) {\n if (tokens.hasOnePath) {\n var delegateFn = tokens[3];\n var value = delegateFn ? delegateFn(model, no de, true) :\n tokens[2].getValueFrom(model);\n return tokens.isSimplePath ? value : tokens.combinator(value);\n }\n\n v ar values = [];\n for (var i = 1; i < tokens.length; i += 4) {\n var del egateFn = tokens[i + 2];\n values[(i - 1) / 4] = delegateFn ? delegateFn(mo del, node) :\n tokens[i + 1].getValueFrom(model);\n }\n\n return tokens.combinator(values);\n }\n\n function processSinglePathBinding(name, tok ens, node, model) {\n var delegateFn = tokens[3];\n var observer = delegat eFn ? delegateFn(model, node, false) :\n new PathObserver(model, tokens[2 ]);\n\n return tokens.isSimplePath ? observer :\n new ObserverTransfor m(observer, tokens.combinator);\n }\n\n function processBinding(name, tokens, node, model) {\n if (tokens.onlyOneTime)\n return processOneTimeBinding( name, tokens, node, model);\n\n if (tokens.hasOnePath)\n return processS inglePathBinding(name, tokens, node, model);\n\n var observer = new CompoundO bserver();\n\n for (var i = 1; i < tokens.length; i += 4) {\n var oneTim e = tokens[i];\n var delegateFn = tokens[i + 2];\n\n if (delegateFn) { \n var value = delegateFn(model, node, oneTime);\n if (oneTime)\n observer.addPath(value)\n else\n observer.addObserver(v alue);\n continue;\n }\n\n var path = tokens[i + 1];\n if (oneTime)\n observer.addPath(path.getValueFrom(model))\n else\n observer.addPath(model, path);\n }\n\n return new ObserverTransform(obs erver, tokens.combinator);\n }\n\n function processBindings(node, bindings, mo del, instanceBindings) {\n for (var i = 0; i < bindings.length; i += 2) {\n var name = bindings[i]\n var tokens = bindings[i + 1];\n var value = processBinding(name, tokens, node, model);\n var binding = node.bind(nam e, value, tokens.onlyOneTime);\n if (binding && instanceBindings)\n instanceBindings.push(binding);\n }\n\n if (!bindings.isTemplate)\n r eturn;\n\n node.model_ = model;\n var iter = node.processBindingDirectives _(bindings);\n if (instanceBindings && iter)\n instanceBindings.push(ite r);\n }\n\n function parseWithDefault(el, name, prepareBindingFn) {\n var v = el.getAttribute(name);\n return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn);\n }\n\n function parseAttributeBindings(element, prepa reBindingFn) {\n assert(element);\n\n var bindings = [];\n var ifFound = false;\n var bindFound = false;\n\n for (var i = 0; i < element.attribut es.length; i++) {\n var attr = element.attributes[i];\n var name = att r.name;\n var value = attr.value;\n\n // Allow bindings expressed in a ttributes to be prefixed with underbars.\n // We do this to allow correct s emantics for browsers that don't implement\n // <template> where certain at tributes might trigger side-effects -- and\n // for IE which sanitizes cert ain attributes, disallowing mustache\n // replacements in their text.\n while (name[0] === '_') {\n name = name.substring(1);\n }\n\n if (isTemplate(element) &&\n (name === IF || name === BIND || name === REPEAT)) {\n continue;\n }\n\n var tokens = parseMustaches(val ue, name, element,\n prepareBindingFn);\n if (!tokens)\n continue;\n\n bindings.push(name, tokens);\n }\n\n if (isTemplate(element)) {\n bindings.isTemplate = true;\n binding s.if = parseWithDefault(element, IF, prepareBindingFn);\n bindings.bind = p arseWithDefault(element, BIND, prepareBindingFn);\n bindings.repeat = parse WithDefault(element, REPEAT, prepareBindingFn);\n\n if (bindings.if && !bin dings.bind && !bindings.repeat)\n bindings.bind = parseMustaches('{{}}', BIND, element, prepareBindingFn);\n }\n\n return bindings;\n }\n\n funct ion getBindings(node, prepareBindingFn) {\n if (node.nodeType === Node.ELEMEN T_NODE)\n return parseAttributeBindings(node, prepareBindingFn);\n\n if (node.nodeType === Node.TEXT_NODE) {\n var tokens = parseMustaches(node.dat a, 'textContent', node,\n prepareBindingFn);\n if (tokens)\n return ['textContent', tokens];\n }\n\n return [ ];\n }\n\n function cloneAndBindInstance(node, parent, stagingDocument, bindin gs, model,\n delegate,\n instanceBindings,\n instanceRecord) {\n var clone = parent.appendChild(stagingDocument.importNode(node, false));\n\n var i = 0;\n for (var child = node.firstChild; child; child = child.nextSibl ing) {\n cloneAndBindInstance(child, clone, stagingDocument,\n bindings.children[i++],\n model,\n delegate,\n instanceBindings) ;\n }\n\n if (bindings.isTemplate) {\n HTMLTemplateElement.decorate(c lone, node);\n if (delegate)\n clone.setDelegate_(delegate);\n }\ n\n processBindings(clone, bindings, model, instanceBindings);\n return cl one;\n }\n\n function createInstanceBindingMap(node, prepareBindingFn) {\n var map = getBindings(node, prepareBindingFn);\n map.children = {};\n var index = 0;\n for (var child = node.firstChild; child; child = child.nextSibli ng) {\n map.children[index++] = createInstanceBindingMap(child, prepareBind ingFn);\n }\n\n return map;\n }\n\n Object.defineProperty(Node.prototype , 'templateInstance', {\n get: function() {\n var instance = this.templa teInstance_;\n return instance ? instance :\n (this.parentNode ? t his.parentNode.templateInstance : undefined);\n }\n });\n\n function Templa teIterator(templateElement) {\n this.closed = false;\n this.templateElemen t_ = templateElement;\n\n // Flattened array of tuples:\n // <instanceTe rminatorNode, [bindingsSetupByInstance]>\n this.terminators = [];\n\n this .deps = undefined;\n this.iteratedValue = [];\n this.presentValue = undefi ned;\n this.arrayObserver = undefined;\n }\n\n TemplateIterator.prototype = {\n closeDeps: function() {\n var deps = this.deps;\n if (deps) {\ n if (deps.ifOneTime === false)\n deps.ifValue.close();\n if (deps.oneTime === false)\n deps.value.close();\n }\n },\n\n updateDependencies: function(directives, model) {\n this.closeDeps();\n \n var deps = this.deps = {};\n var template = this.templateElement_;\ n\n if (directives.if) {\n deps.hasIf = true;\n deps.ifOneTim e = directives.if.onlyOneTime;\n deps.ifValue = processBinding(IF, direct ives.if, template, model);\n\n // oneTime if & predicate is false. nothin g else to do.\n if (deps.ifOneTime && !deps.ifValue) {\n this.up dateIteratedValue();\n return;\n }\n\n if (!deps.ifOneTim e)\n deps.ifValue.open(this.updateIteratedValue, this);\n }\n\n if (directives.repeat) {\n deps.repeat = true;\n deps.oneTime = directives.repeat.onlyOneTime;\n deps.value = processBinding(REPEAT, dir ectives.repeat, template, model);\n } else {\n deps.repeat = false;\ n deps.oneTime = directives.bind.onlyOneTime;\n deps.value = proce ssBinding(BIND, directives.bind, template, model);\n }\n\n if (!deps.o neTime)\n deps.value.open(this.updateIteratedValue, this);\n\n this. updateIteratedValue();\n },\n\n updateIteratedValue: function() {\n i f (this.deps.hasIf) {\n var ifValue = this.deps.ifValue;\n if (!th is.deps.ifOneTime)\n ifValue = ifValue.discardChanges();\n if (! ifValue) {\n this.valueChanged();\n return;\n }\n }\n\n var value = this.deps.value;\n if (!this.deps.oneTime)\n value = value.discardChanges();\n if (!this.deps.repeat)\n value = [ value];\n var observe = this.deps.repeat &&\n !this.deps .oneTime &&\n Array.isArray(value);\n this.valueChanged( value, observe);\n },\n\n valueChanged: function(value, observeValue) {\n if (!Array.isArray(value))\n value = [];\n\n if (value === this .iteratedValue)\n return;\n\n this.unobserve();\n this.presentV alue = value;\n if (observeValue) {\n this.arrayObserver = new Array Observer(this.presentValue);\n this.arrayObserver.open(this.handleSplices , this);\n }\n\n this.handleSplices(ArrayObserver.calculateSplices(thi s.presentValue,\n this.it eratedValue));\n },\n\n getTerminatorAt: function(index) {\n if (inde x == -1)\n return this.templateElement_;\n var terminator = this.ter minators[index*2];\n if (terminator.nodeType !== Node.ELEMENT_NODE ||\n this.templateElement_ === terminator) {\n return terminator;\n }\n\n var subIterator = terminator.iterator_;\n if (!subIterator)\n return terminator;\n\n return subIterator.getTerminatorAt(subIterator .terminators.length/2 - 1);\n },\n\n // TODO(rafaelw): If we inserting seq uences of instances we can probably\n // avoid lots of calls to getTerminator At(), or cache its result.\n insertInstanceAt: function(index, fragment, inst anceNodes,\n instanceBindings) {\n var previo usTerminator = this.getTerminatorAt(index - 1);\n var terminator = previous Terminator;\n if (fragment)\n terminator = fragment.lastChild || ter minator;\n else if (instanceNodes)\n terminator = instanceNodes[inst anceNodes.length - 1] || terminator;\n\n this.terminators.splice(index*2, 0 , terminator, instanceBindings);\n var parent = this.templateElement_.paren tNode;\n var insertBeforeNode = previousTerminator.nextSibling;\n\n if (fragment) {\n parent.insertBefore(fragment, insertBeforeNode);\n } else if (instanceNodes) {\n for (var i = 0; i < instanceNodes.length; i+ +)\n parent.insertBefore(instanceNodes[i], insertBeforeNode);\n }\ n },\n\n extractInstanceAt: function(index) {\n var instanceNodes = [ ];\n var previousTerminator = this.getTerminatorAt(index - 1);\n var t erminator = this.getTerminatorAt(index);\n instanceNodes.instanceBindings = this.terminators[index*2 + 1];\n this.terminators.splice(index*2, 2);\n\n var parent = this.templateElement_.parentNode;\n while (terminator !== previousTerminator) {\n var node = previousTerminator.nextSibling;\n if (node == terminator)\n terminator = previousTerminator;\n\n parent.removeChild(node);\n instanceNodes.push(node);\n }\n\n return instanceNodes;\n },\n\n getDelegateFn: function(fn) {\n fn = fn && fn(this.templateElement_);\n return typeof fn === 'function' ? fn : null;\n },\n\n handleSplices: function(splices) {\n if (this.closed | | !splices.length)\n return;\n\n var template = this.templateElement _;\n\n if (!template.parentNode) {\n this.close();\n return;\ n }\n\n ArrayObserver.applySplices(this.iteratedValue, this.presentVal ue,\n splices);\n\n var delegate = template .delegate_;\n if (this.instanceModelFn_ === undefined) {\n this.inst anceModelFn_ =\n this.getDelegateFn(delegate && delegate.prepareInsta nceModel);\n }\n\n if (this.instancePositionChangedFn_ === undefined) {\n this.instancePositionChangedFn_ =\n this.getDelegateFn(del egate &&\n delegate.prepareInstancePositionChanged );\n }\n\n var instanceCache = new Map;\n var removeDelta = 0;\n splices.forEach(function(splice) {\n splice.removed.forEach(function (model) {\n var instanceNodes =\n this.extractInstanceAt(s plice.index + removeDelta);\n instanceCache.set(model, instanceNodes);\ n }, this);\n\n removeDelta -= splice.addedCount;\n }, this); \n\n splices.forEach(function(splice) {\n var addIndex = splice.inde x;\n for (; addIndex < splice.index + splice.addedCount; addIndex++) {\n var model = this.iteratedValue[addIndex];\n var fragment = und efined;\n var instanceNodes = instanceCache.get(model);\n var instanceBindings;\n if (instanceNodes) {\n instanceCache.del ete(model);\n instanceBindings = instanceNodes.instanceBindings;\n } else {\n instanceBindings = [];\n if (this.instan ceModelFn_)\n model = this.instanceModelFn_(model);\n\n if (model !== undefined) {\n fragment = template.createInstance(mod el, undefined, delegate,\n insta nceBindings);\n }\n }\n\n this.insertInstanceAt(add Index, fragment, instanceNodes,\n instanceBinding s);\n }\n }, this);\n\n instanceCache.forEach(function(instance Nodes) {\n this.closeInstanceBindings(instanceNodes.instanceBindings);\n }, this);\n\n if (this.instancePositionChangedFn_)\n this.repor tInstancesMoved(splices);\n },\n\n reportInstanceMoved: function(index) {\ n var previousTerminator = this.getTerminatorAt(index - 1);\n var term inator = this.getTerminatorAt(index);\n if (previousTerminator === terminat or)\n return; // instance has zero nodes.\n\n // We must use the fir st node of the instance, because any subsequent\n // nodes may have been ge nerated by sub-templates.\n // TODO(rafaelw): This is brittle WRT instance mutation -- e.g. if the\n // first node was removed by script.\n var t emplateInstance = previousTerminator.nextSibling.templateInstance;\n this.i nstancePositionChangedFn_(templateInstance, index);\n },\n\n reportInstanc esMoved: function(splices) {\n var index = 0;\n var offset = 0;\n for (var i = 0; i < splices.length; i++) {\n var splice = splices[i];\n if (offset != 0) {\n while (index < splice.index) {\n this.reportInstanceMoved(index);\n index++;\n }\n } else {\n index = splice.index;\n }\n\n while (index < spl ice.index + splice.addedCount) {\n this.reportInstanceMoved(index);\n index++;\n }\n\n offset += splice.addedCount - splice.remo ved.length;\n }\n\n if (offset == 0)\n return;\n\n var len gth = this.terminators.length / 2;\n while (index < length) {\n this .reportInstanceMoved(index);\n index++;\n }\n },\n\n closeInst anceBindings: function(instanceBindings) {\n for (var i = 0; i < instanceBi ndings.length; i++) {\n instanceBindings[i].close();\n }\n },\n\n unobserve: function() {\n if (!this.arrayObserver)\n return;\n\n this.arrayObserver.close();\n this.arrayObserver = undefined;\n }, \n\n close: function() {\n if (this.closed)\n return;\n this .unobserve();\n for (var i = 1; i < this.terminators.length; i += 2) {\n this.closeInstanceBindings(this.terminators[i]);\n }\n\n this.ter minators.length = 0;\n this.closeDeps();\n this.templateElement_.itera tor_ = undefined;\n this.closed = true;\n }\n };\n\n // Polyfill-speci fic API.\n HTMLTemplateElement.forAllTemplatesFrom_ = forAllTemplatesFrom;\n})( this);\n",
200 "/*\n Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyrig ht (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>\n Copyright (C) 2012 Ariya Hida yat <ariya.hidayat@gmail.com>\n Copyright (C) 2012 Mathias Bynens <mathias@qiwi .be>\n Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>\n C opyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>\n Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>\n Copyright (C) 2012 Arpad Borsos <arpad.borsos @googlemail.com>\n Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>\n \n Redistribution and use in source and binary forms, with or without\n modifi cation, are permitted provided that the following conditions are met:\n\n * R edistributions of source code must retain the above copyright\n notice, thi s list of conditions and the following disclaimer.\n * Redistributions in bin ary form must reproduce the above copyright\n notice, this list of conditio ns and the following disclaimer in the\n documentation and/or other materia ls provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIG HT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBST ITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPT ION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI CT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH D AMAGE.\n*/\n\n(function (global) {\n 'use strict';\n\n var Token,\n TokenName,\n Syntax,\n Messages,\n source,\n index, \n length,\n delegate,\n lookahead,\n state;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8\n };\n\n TokenName = {};\n T okenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '<end>'; \n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.Nu mericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n\n Syntax = {\n ArrayExpr ession: 'ArrayExpression',\n BinaryExpression: 'BinaryExpression',\n CallExpression: 'CallExpression',\n ConditionalExpression: 'Conditiona lExpression',\n EmptyStatement: 'EmptyStatement',\n ExpressionStat ement: 'ExpressionStatement',\n Identifier: 'Identifier',\n Litera l: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExp ression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ThisExpression: 'ThisExpression',\n Unar yExpression: 'UnaryExpression'\n };\n\n // Error messages should be identi cal to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\ '%1\\' has already been declared'\n };\n\n // Ensure the condition is true , otherwise throw an error.\n // This is only to have a better contract seman tic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condi tion on any user input.\n\n function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57 ); // 0..9\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 32) || // space\n (ch === 9) || // t ab\n (ch === 0xB) ||\n (ch === 0xC) ||\n (ch == = 0xA0) ||\n (ch >= 0x1680 && '\\u1680\\u180E\\u2000\\u2001\\u2002\\u 2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\uFEF F'.indexOf(String.fromCharCode(ch)) > 0);\n }\n\n // 7.3 Line Terminators\ n\n function isLineTerminator(ch) {\n return (ch === 10) || (ch === 13 ) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names a nd Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 3 6) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122); // a..z\n }\n\n function isIdentifierPart(ch) {\n return (ch === 36) | | (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z \n (ch >= 48 && ch <= 57); // 0..9\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n return (id === 'this')\n } \n\n // 7.4 Comments\n\n function skipWhitespace() {\n while (index < length && isWhiteSpace(source.charCodeAt(index))) {\n ++index;\n }\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.c harCodeAt(index);\n if (isIdentifierPart(ch)) {\n ++in dex;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier () {\n var start, id, type;\n\n start = index;\n\n id = get Identifier();\n\n // There is no keyword or literal with only one charact er.\n // Thus, it must be an identifier.\n if (id.length === 1) {\ n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') { \n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n range: [start, index]\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = ind ex,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 46: // . dot\n case 40: // ( open bracket\n case 41: // ) close bracket \n case 59: // ; semicolon\n case 44: // , comma\n case 123: // { open curly brace\n case 125: // } close curly brace\n case 91: // [\n case 93: // ]\n case 58: // :\n case 63: // ?\n ++index;\n return {\n type: T oken.Punctuator,\n value: String.fromCharCode(code),\n range: [start, index]\n };\n\n default:\n code 2 = source.charCodeAt(index + 1);\n\n // '=' (char #61) marks an assi gnment or comparison operator.\n if (code2 === 61) {\n switch (code) {\n case 37: // %\n case 38: // & \n case 42: // *:\n case 43: // +\n case 45: // -\n case 47: // /\n case 60: // <\n case 62: // >\n case 124: // |\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + St ring.fromCharCode(code2),\n range: [start, index]\n };\n\n case 33: // !\n case 61: // = \n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 61) {\n ++i ndex;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n range: [start, index]\n };\n default:\n break;\n }\n }\n break;\n }\n\n // Peek more characters.\n\n ch2 = source[index + 1];\n\n // Other 2-character punctuators: && || \n\n if (ch1 === ch2 && ('&|'.indexOf(ch1) >= 0)) {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch1 + ch2,\n range: [start, index]\n };\n }\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index; \n return {\n type: Token.Punctuator,\n value: ch1,\n range: [start, index]\n };\n }\n \n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.cha rCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a dec imal digit or a decimal point');\n\n start = index;\n number = ''; \n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({ }, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n nu mber += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\ n\n if (ch === 'e' || ch === 'E') {\n number += source[index++ ];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (i sDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigi t(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages .UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentif ierStart(source.charCodeAt(index))) {\n throwError({}, Messages.Unexp ectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token. NumericLiteral,\n value: parseFloat(number),\n range: [sta rt, index]\n };\n }\n\n // 7.8.4 String Literals\n\n function sc anStringLiteral() {\n var str = '', quote, start, ch, octal = false;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"' ),\n 'String literal must starts with a quote');\n\n start = i ndex;\n ++index;\n\n while (index < length) {\n ch = so urce[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCode At(0))) {\n switch (ch) {\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case ' f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n str += ch;\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLitera l,\n value: str,\n octal: octal,\n range: [star t, index]\n };\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyw ord ||\n token.type === Token.BooleanLiteral ||\n token.ty pe === Token.NullLiteral;\n }\n\n function advance() {\n var ch;\n\ n skipWhitespace();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n range: [index, index]\n };\n }\n\n ch = source.charCodeAt(index);\n\n // V ery common: ( and ) and ;\n if (ch === 40 || ch === 41 || ch === 58) {\n return scanPunctuator();\n }\n\n // String literal star ts with single quote (#39) or double quote (#34).\n if (ch === 39 || ch = == 34) {\n return scanStringLiteral();\n }\n\n if (isId entifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Dot (.) char #46 can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 46) {\n if ( isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNume ricLiteral();\n }\n return scanPunctuator();\n }\n\ n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.range[1];\n\ n lookahead = advance();\n\n index = token.range[1];\n\n re turn token;\n }\n\n function peek() {\n var pos;\n\n pos = i ndex;\n lookahead = advance();\n index = pos;\n }\n\n // Thr ow an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n func tion (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n error = new Error(msg);\n error.inde x = index;\n error.description = msg;\n throw error;\n }\n\n // Throw an exception because of the token.\n\n function throwUnexpected(tok en) {\n throwError(token, Messages.UnexpectedToken, token.value);\n }\ n\n // Expect the next token to match the specified punctuator.\n // If no t, an exception will be thrown.\n\n function expect(value) {\n var tok en = lex();\n if (token.type !== Token.Punctuator || token.value !== valu e) {\n throwUnexpected(token);\n }\n }\n\n // Return tru e if the next token matches the specified punctuator.\n\n function match(valu e) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyw ord\n\n function matchKeyword(keyword) {\n return lookahead.type === T oken.Keyword && lookahead.value === keyword;\n }\n\n function consumeSemic olon() {\n // Catch the very common case first: immediately a semicolon ( char #59).\n if (source.charCodeAt(index) === 59) {\n lex();\n return;\n }\n\n skipWhitespace();\n\n if (match (';')) {\n lex();\n return;\n }\n\n if (look ahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahea d);\n }\n }\n\n // 11.1.4 Array Initialiser\n\n function parseAr rayInitialiser() {\n var elements = [];\n\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elem ents.push(parseExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n ex pect(']');\n\n return delegate.createArrayExpression(elements);\n }\n\ n // 11.1.5 Object Initialiser\n\n function parseObjectPropertyKey() {\n var token;\n\n skipWhitespace();\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n return delegate.createLiteral(token);\n }\n\n return delegate.crea teIdentifier(token.value);\n }\n\n function parseObjectProperty() {\n var token, key;\n\n token = lookahead;\n skipWhitespace();\n\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n }\n\n key = parseObjectPropertyKe y();\n expect(':');\n return delegate.createProperty('init', key, parseExpression());\n }\n\n function parseObjectInitialiser() {\n v ar properties = [];\n\n expect('{');\n\n while (!match('}')) {\n properties.push(parseObjectProperty());\n\n if (!match('}') ) {\n expect(',');\n }\n }\n\n expect('} ');\n\n return delegate.createObjectExpression(properties);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expres sions\n\n function parsePrimaryExpression() {\n var type, token, expr; \n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n type = lookahead.type;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else i f (type === Token.StringLiteral || type === Token.NumericLiteral) {\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keywor d) {\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n toke n.value = (token.value === 'true');\n expr = delegate.createLiteral(t oken);\n } else if (type === Token.NullLiteral) {\n token = le x();\n token.value = null;\n expr = delegate.createLiteral (token);\n } else if (match('[')) {\n expr = parseArrayInitial iser();\n } else if (match('{')) {\n expr = parseObjectInitial iser();\n }\n\n if (expr) {\n return expr;\n }\n \n throwUnexpected(lex());\n }\n\n // 11.2 Left-Hand-Side Expressio ns\n\n function parseArguments() {\n var args = [];\n\n expect( '(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token;\n\n token = le x();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(tok en);\n }\n\n return delegate.createIdentifier(token.value);\n } \n\n function parseNonComputedMember() {\n expect('.');\n\n ret urn parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n \n expect(']');\n\n return expr;\n }\n\n function parseLeftH andSideExpression() {\n var expr, property;\n\n expr = parsePrimar yExpression();\n\n while (match('.') || match('[')) {\n if (ma tch('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n } \n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n var pa rsePostfixExpression = parseLeftHandSideExpression;\n\n // 11.4 Unary Operato rs\n\n function parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\ n expr = parsePostfixExpression();\n } else if (match('+') || match('-') || match('!')) {\n token = lex();\n expr = pars eUnaryExpression();\n expr = delegate.createUnaryExpression(token.val ue, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throwError({}, Messages.UnexpectedToken) ;\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token) {\n v ar prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== To ken.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n cas e '&&':\n prec = 2;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = 7;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\ n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Addit ive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Opera tors\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrec edence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpressi on();\n\n stack = [left, token, right];\n\n while ((prec = binaryP recedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(tok en);\n expr = parseUnaryExpression();\n stack.push(expr);\ n }\n\n // Final reduce to clean-up the stack.\n i = stack. length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }\n\n\n // 11.12 Con ditional Operator\n\n function parseConditionalExpression() {\n var ex pr, consequent, alternate;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditiona lExpression();\n expect(':');\n alternate = parseCondition alExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n }\n\n // Sim plification since we do not support AssignmentExpression.\n var parseExpressi on = parseConditionalExpression;\n\n // Polymer Syntax extensions\n\n // F ilter ::\n // Identifier\n // Identifier \"(\" \")\"\n // Identif ier \"(\" FilterArguments \")\"\n\n function parseFilter() {\n var ide ntifier, args;\n\n identifier = lex();\n\n if (identifier.type !== Token.Identifier) {\n throwUnexpected(identifier);\n }\n\n args = match('(') ? parseArguments() : [];\n\n return delegate.creat eFilter(identifier.value, args);\n }\n\n // Filters ::\n // \"|\" Fil ter\n // Filters \"|\" Filter\n\n function parseFilters() {\n whi le (match('|')) {\n lex();\n parseFilter();\n }\n }\n\n // TopLevel ::\n // LabelledExpressions\n // AsExpression\n // InExpression\n // FilterExpression\n\n // AsExpression ::\n // FilterExpression as Identifier\n\n // InExpression ::\n // Identifi er, Identifier in FilterExpression\n // Identifier in FilterExpression\n\n // FilterExpression ::\n // Expression\n // Expression Filters\n\n function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahe ad.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } els e {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }\n\n function parseAsExpression (expr) {\n lex(); // as\n var identifier = lex().value;\n delegate.createAsExpression(expr, identifier);\n }\n\n function parseInExp ression(identifier) {\n var indexName;\n if (lookahead.value === ' ,') {\n lex();\n if (lookahead.type !== Token.Identifier)\ n throwUnexpected(lookahead);\n indexName = lex().valu e;\n }\n\n lex(); // in\n var expr = parseExpression();\n parseFilters();\n delegate.createInExpression(identifier.name, ind exName, expr);\n }\n\n function parse(code, inDelegate) {\n delegat e = inDelegate;\n source = code;\n index = 0;\n length = so urce.length;\n lookahead = null;\n state = {\n labelSet : {}\n };\n\n return parseTopLevel();\n }\n\n global.esprima = {\n parse: parse\n };\n})(this);\n", 204 "/*\n Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyrig ht (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>\n Copyright (C) 2012 Ariya Hida yat <ariya.hidayat@gmail.com>\n Copyright (C) 2012 Mathias Bynens <mathias@qiwi .be>\n Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>\n C opyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>\n Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>\n Copyright (C) 2012 Arpad Borsos <arpad.borsos @googlemail.com>\n Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>\n \n Redistribution and use in source and binary forms, with or without\n modifi cation, are permitted provided that the following conditions are met:\n\n * R edistributions of source code must retain the above copyright\n notice, thi s list of conditions and the following disclaimer.\n * Redistributions in bin ary form must reproduce the above copyright\n notice, this list of conditio ns and the following disclaimer in the\n documentation and/or other materia ls provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIG HT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBST ITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPT ION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI CT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH D AMAGE.\n*/\n\n(function (global) {\n 'use strict';\n\n var Token,\n TokenName,\n Syntax,\n Messages,\n source,\n index, \n length,\n delegate,\n lookahead,\n state;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8\n };\n\n TokenName = {};\n T okenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '<end>'; \n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.Nu mericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n\n Syntax = {\n ArrayExpr ession: 'ArrayExpression',\n BinaryExpression: 'BinaryExpression',\n CallExpression: 'CallExpression',\n ConditionalExpression: 'Conditiona lExpression',\n EmptyStatement: 'EmptyStatement',\n ExpressionStat ement: 'ExpressionStatement',\n Identifier: 'Identifier',\n Litera l: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExp ression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ThisExpression: 'ThisExpression',\n Unar yExpression: 'UnaryExpression'\n };\n\n // Error messages should be identi cal to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\ '%1\\' has already been declared'\n };\n\n // Ensure the condition is true , otherwise throw an error.\n // This is only to have a better contract seman tic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condi tion on any user input.\n\n function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57 ); // 0..9\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 32) || // space\n (ch === 9) || // t ab\n (ch === 0xB) ||\n (ch === 0xC) ||\n (ch == = 0xA0) ||\n (ch >= 0x1680 && '\\u1680\\u180E\\u2000\\u2001\\u2002\\u 2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\uFEF F'.indexOf(String.fromCharCode(ch)) > 0);\n }\n\n // 7.3 Line Terminators\ n\n function isLineTerminator(ch) {\n return (ch === 10) || (ch === 13 ) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names a nd Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 3 6) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122); // a..z\n }\n\n function isIdentifierPart(ch) {\n return (ch === 36) | | (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z \n (ch >= 48 && ch <= 57); // 0..9\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n return (id === 'this')\n } \n\n // 7.4 Comments\n\n function skipWhitespace() {\n while (index < length && isWhiteSpace(source.charCodeAt(index))) {\n ++index;\n }\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.c harCodeAt(index);\n if (isIdentifierPart(ch)) {\n ++in dex;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier () {\n var start, id, type;\n\n start = index;\n\n id = get Identifier();\n\n // There is no keyword or literal with only one charact er.\n // Thus, it must be an identifier.\n if (id.length === 1) {\ n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') { \n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n range: [start, index]\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = ind ex,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 46: // . dot\n case 40: // ( open bracket\n case 41: // ) close bracket \n case 59: // ; semicolon\n case 44: // , comma\n case 123: // { open curly brace\n case 125: // } close curly brace\n case 91: // [\n case 93: // ]\n case 58: // :\n case 63: // ?\n ++index;\n return {\n type: T oken.Punctuator,\n value: String.fromCharCode(code),\n range: [start, index]\n };\n\n default:\n code 2 = source.charCodeAt(index + 1);\n\n // '=' (char #61) marks an assi gnment or comparison operator.\n if (code2 === 61) {\n switch (code) {\n case 37: // %\n case 38: // & \n case 42: // *:\n case 43: // +\n case 45: // -\n case 47: // /\n case 60: // <\n case 62: // >\n case 124: // |\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + St ring.fromCharCode(code2),\n range: [start, index]\n };\n\n case 33: // !\n case 61: // = \n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 61) {\n ++i ndex;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n range: [start, index]\n };\n default:\n break;\n }\n }\n break;\n }\n\n // Peek more characters.\n\n ch2 = source[index + 1];\n\n // Other 2-character punctuators: && || \n\n if (ch1 === ch2 && ('&|'.indexOf(ch1) >= 0)) {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch1 + ch2,\n range: [start, index]\n };\n }\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index; \n return {\n type: Token.Punctuator,\n value: ch1,\n range: [start, index]\n };\n }\n \n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.cha rCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a dec imal digit or a decimal point');\n\n start = index;\n number = ''; \n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({ }, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n nu mber += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\ n\n if (ch === 'e' || ch === 'E') {\n number += source[index++ ];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (i sDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigi t(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages .UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentif ierStart(source.charCodeAt(index))) {\n throwError({}, Messages.Unexp ectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token. NumericLiteral,\n value: parseFloat(number),\n range: [sta rt, index]\n };\n }\n\n // 7.8.4 String Literals\n\n function sc anStringLiteral() {\n var str = '', quote, start, ch, octal = false;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"' ),\n 'String literal must starts with a quote');\n\n start = i ndex;\n ++index;\n\n while (index < length) {\n ch = so urce[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCode At(0))) {\n switch (ch) {\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case ' f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n str += ch;\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLitera l,\n value: str,\n octal: octal,\n range: [star t, index]\n };\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyw ord ||\n token.type === Token.BooleanLiteral ||\n token.ty pe === Token.NullLiteral;\n }\n\n function advance() {\n var ch;\n\ n skipWhitespace();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n range: [index, index]\n };\n }\n\n ch = source.charCodeAt(index);\n\n // V ery common: ( and ) and ;\n if (ch === 40 || ch === 41 || ch === 58) {\n return scanPunctuator();\n }\n\n // String literal star ts with single quote (#39) or double quote (#34).\n if (ch === 39 || ch = == 34) {\n return scanStringLiteral();\n }\n\n if (isId entifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Dot (.) char #46 can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 46) {\n if ( isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNume ricLiteral();\n }\n return scanPunctuator();\n }\n\ n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.range[1];\n\ n lookahead = advance();\n\n index = token.range[1];\n\n re turn token;\n }\n\n function peek() {\n var pos;\n\n pos = i ndex;\n lookahead = advance();\n index = pos;\n }\n\n // Thr ow an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n func tion (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n error = new Error(msg);\n error.inde x = index;\n error.description = msg;\n throw error;\n }\n\n // Throw an exception because of the token.\n\n function throwUnexpected(tok en) {\n throwError(token, Messages.UnexpectedToken, token.value);\n }\ n\n // Expect the next token to match the specified punctuator.\n // If no t, an exception will be thrown.\n\n function expect(value) {\n var tok en = lex();\n if (token.type !== Token.Punctuator || token.value !== valu e) {\n throwUnexpected(token);\n }\n }\n\n // Return tru e if the next token matches the specified punctuator.\n\n function match(valu e) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyw ord\n\n function matchKeyword(keyword) {\n return lookahead.type === T oken.Keyword && lookahead.value === keyword;\n }\n\n function consumeSemic olon() {\n // Catch the very common case first: immediately a semicolon ( char #59).\n if (source.charCodeAt(index) === 59) {\n lex();\n return;\n }\n\n skipWhitespace();\n\n if (match (';')) {\n lex();\n return;\n }\n\n if (look ahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahea d);\n }\n }\n\n // 11.1.4 Array Initialiser\n\n function parseAr rayInitialiser() {\n var elements = [];\n\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elem ents.push(parseExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n ex pect(']');\n\n return delegate.createArrayExpression(elements);\n }\n\ n // 11.1.5 Object Initialiser\n\n function parseObjectPropertyKey() {\n var token;\n\n skipWhitespace();\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n return delegate.createLiteral(token);\n }\n\n return delegate.crea teIdentifier(token.value);\n }\n\n function parseObjectProperty() {\n var token, key;\n\n token = lookahead;\n skipWhitespace();\n\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n }\n\n key = parseObjectPropertyKe y();\n expect(':');\n return delegate.createProperty('init', key, parseExpression());\n }\n\n function parseObjectInitialiser() {\n v ar properties = [];\n\n expect('{');\n\n while (!match('}')) {\n properties.push(parseObjectProperty());\n\n if (!match('}') ) {\n expect(',');\n }\n }\n\n expect('} ');\n\n return delegate.createObjectExpression(properties);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expres sions\n\n function parsePrimaryExpression() {\n var type, token, expr; \n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n type = lookahead.type;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else i f (type === Token.StringLiteral || type === Token.NumericLiteral) {\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keywor d) {\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n toke n.value = (token.value === 'true');\n expr = delegate.createLiteral(t oken);\n } else if (type === Token.NullLiteral) {\n token = le x();\n token.value = null;\n expr = delegate.createLiteral (token);\n } else if (match('[')) {\n expr = parseArrayInitial iser();\n } else if (match('{')) {\n expr = parseObjectInitial iser();\n }\n\n if (expr) {\n return expr;\n }\n \n throwUnexpected(lex());\n }\n\n // 11.2 Left-Hand-Side Expressio ns\n\n function parseArguments() {\n var args = [];\n\n expect( '(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token;\n\n token = le x();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(tok en);\n }\n\n return delegate.createIdentifier(token.value);\n } \n\n function parseNonComputedMember() {\n expect('.');\n\n ret urn parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n \n expect(']');\n\n return expr;\n }\n\n function parseLeftH andSideExpression() {\n var expr, property;\n\n expr = parsePrimar yExpression();\n\n while (match('.') || match('[')) {\n if (ma tch('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n } \n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n var pa rsePostfixExpression = parseLeftHandSideExpression;\n\n // 11.4 Unary Operato rs\n\n function parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\ n expr = parsePostfixExpression();\n } else if (match('+') || match('-') || match('!')) {\n token = lex();\n expr = pars eUnaryExpression();\n expr = delegate.createUnaryExpression(token.val ue, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throwError({}, Messages.UnexpectedToken) ;\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token) {\n v ar prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== To ken.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n cas e '&&':\n prec = 2;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = 7;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\ n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Addit ive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Opera tors\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrec edence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpressi on();\n\n stack = [left, token, right];\n\n while ((prec = binaryP recedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(tok en);\n expr = parseUnaryExpression();\n stack.push(expr);\ n }\n\n // Final reduce to clean-up the stack.\n i = stack. length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }\n\n\n // 11.12 Con ditional Operator\n\n function parseConditionalExpression() {\n var ex pr, consequent, alternate;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditiona lExpression();\n expect(':');\n alternate = parseCondition alExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n }\n\n // Sim plification since we do not support AssignmentExpression.\n var parseExpressi on = parseConditionalExpression;\n\n // Polymer Syntax extensions\n\n // F ilter ::\n // Identifier\n // Identifier \"(\" \")\"\n // Identif ier \"(\" FilterArguments \")\"\n\n function parseFilter() {\n var ide ntifier, args;\n\n identifier = lex();\n\n if (identifier.type !== Token.Identifier) {\n throwUnexpected(identifier);\n }\n\n args = match('(') ? parseArguments() : [];\n\n return delegate.creat eFilter(identifier.value, args);\n }\n\n // Filters ::\n // \"|\" Fil ter\n // Filters \"|\" Filter\n\n function parseFilters() {\n whi le (match('|')) {\n lex();\n parseFilter();\n }\n }\n\n // TopLevel ::\n // LabelledExpressions\n // AsExpression\n // InExpression\n // FilterExpression\n\n // AsExpression ::\n // FilterExpression as Identifier\n\n // InExpression ::\n // Identifi er, Identifier in FilterExpression\n // Identifier in FilterExpression\n\n // FilterExpression ::\n // Expression\n // Expression Filters\n\n function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahe ad.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } els e {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }\n\n function parseAsExpression (expr) {\n lex(); // as\n var identifier = lex().value;\n delegate.createAsExpression(expr, identifier);\n }\n\n function parseInExp ression(identifier) {\n var indexName;\n if (lookahead.value === ' ,') {\n lex();\n if (lookahead.type !== Token.Identifier)\ n throwUnexpected(lookahead);\n indexName = lex().valu e;\n }\n\n lex(); // in\n var expr = parseExpression();\n parseFilters();\n delegate.createInExpression(identifier.name, ind exName, expr);\n }\n\n function parse(code, inDelegate) {\n delegat e = inDelegate;\n source = code;\n index = 0;\n length = so urce.length;\n lookahead = null;\n state = {\n labelSet : {}\n };\n\n return parseTopLevel();\n }\n\n global.esprima = {\n parse: parse\n };\n})(this);\n",
201 "// Copyright 2013 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function (global) {\n 'use strict';\n\n // JScript does not have __proto__. We wrap all object literals w ith\n // createObject which uses Object.create, Object.defineProperty and\n // Object.getOwnPropertyDescriptor to create a new object that does the exact\n / / same thing. The main downside to this solution is that we have to extract\n / / all those property descriptors for IE.\n var createObject = ('__proto__' in { }) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).forEa ch(function(name) {\n Object.defineProperty(newObject, name,\n Object.getOwnPropertyDescriptor(obj, name));\n });\ n return newObject;\n };\n\n function prepareBinding(expressionText , name, node, filterRegistry) {\n var expression;\n try {\n expressio n = getExpression(expressionText);\n if (expression.scopeIdent &&\n (node.nodeType !== Node.ELEMENT_NODE ||\n node.tagName !== 'TEMPLATE ' ||\n (name !== 'bind' && name !== 'repeat'))) {\n throw Error ('as and in can only be used within <template bind/repeat>');\n }\n } ca tch (ex) {\n console.error('Invalid expression syntax: ' + expressionText, ex);\n return;\n }\n\n return function(model, node, oneTime) {\n var binding = expression.getBinding(model, filterRegistry, oneTime);\n if (expression.scopeIdent && binding) {\n node.polymerExpressionScopeIdent_ = expression.scopeIdent;\n if (expression.indexIdent)\n node.pol ymerExpressionIndexIdent_ = expression.indexIdent;\n }\n\n return bind ing;\n }\n }\n\n // TODO(rafaelw): Implement simple LRU.\n var expressionP arseCache = Object.create(null);\n\n function getExpression(expressionText) {\n var expression = expressionParseCache[expressionText];\n if (!expression) {\n var delegate = new ASTDelegate();\n esprima.parse(expressionText, delegate);\n expression = new Expression(delegate);\n expressionParse Cache[expressionText] = expression;\n }\n return expression;\n }\n\n fun ction Literal(value) {\n this.value = value;\n this.valueFn_ = undefined;\ n }\n\n Literal.prototype = {\n valueFn: function() {\n if (!this.valu eFn_) {\n var value = this.value;\n this.valueFn_ = function() {\n return value;\n }\n }\n\n return this.valueFn_;\n }\n }\n\n function IdentPath(name) {\n this.name = name;\n this.path = P ath.get(name);\n }\n\n IdentPath.prototype = {\n valueFn: function() {\n if (!this.valueFn_) {\n var name = this.name;\n var path = this .path;\n this.valueFn_ = function(model, observer) {\n if (obser ver)\n observer.addPath(model, path);\n\n return path.getVal ueFrom(model);\n }\n }\n\n return this.valueFn_;\n },\n\n setValue: function(model, newValue) {\n if (this.path.length == 1);\n model = findScope(model, this.path[0]);\n\n return this.path.setValueFro m(model, newValue);\n }\n };\n\n function MemberExpression(object, property , accessor) {\n // convert literal computed property access where literal val ue is a value\n // path to ident dot-access.\n if (accessor == '[' &&\n property instanceof Literal &&\n Path.get(property.value).valid) {\n accessor = '.';\n property = new IdentPath(property.value);\n }\n\ n this.dynamicDeps = typeof object == 'function' || object.dynamic;\n\n th is.dynamic = typeof property == 'function' ||\n property.dynam ic ||\n accessor == '[';\n\n this.simplePath =\n !th is.dynamic &&\n !this.dynamicDeps &&\n property instanceof IdentPa th &&\n (object instanceof MemberExpression || object instanceof IdentPat h);\n\n this.object = this.simplePath ? object : getFn(object);\n this.pro perty = accessor == '.' ? property : getFn(property);\n }\n\n MemberExpression .prototype = {\n get fullPath() {\n if (!this.fullPath_) {\n var last = this.object instanceof IdentPath ?\n this.object.name : this.o bject.fullPath;\n this.fullPath_ = Path.get(last + '.' + this.property.na me);\n }\n\n return this.fullPath_;\n },\n\n valueFn: function() {\n if (!this.valueFn_) {\n var object = this.object;\n\n if (this.simplePath) {\n var path = this.fullPath;\n\n this.valu eFn_ = function(model, observer) {\n if (observer)\n obs erver.addPath(model, path);\n\n return path.getValueFrom(model);\n };\n } else if (this.property instanceof IdentPath) {\n v ar path = Path.get(this.property.name);\n\n this.valueFn_ = function(mo del, observer) {\n var context = object(model, observer);\n\n if (observer)\n observer.addPath(context, path);\n\n return path.getValueFrom(context);\n }\n } else {\n // Computed property.\n var property = this.property;\n\n this.v alueFn_ = function(model, observer) {\n var context = object(model, o bserver);\n var propName = property(model, observer);\n if (observer)\n observer.addPath(context, propName);\n\n r eturn context ? context[propName] : undefined;\n };\n }\n } \n return this.valueFn_;\n },\n\n setValue: function(model, newValue) {\n if (this.simplePath) {\n this.fullPath.setValueFrom(model, newV alue);\n return newValue;\n }\n\n var object = this.object(mode l);\n var propName = this.property instanceof IdentPath ? this.property.nam e :\n this.property(model);\n return object[propName] = newValue;\ n }\n };\n\n function Filter(name, args) {\n this.name = name;\n this .args = [];\n for (var i = 0; i < args.length; i++) {\n this.args[i] = g etFn(args[i]);\n }\n }\n\n Filter.prototype = {\n transform: function(va lue, toModelDirection, filterRegistry, model,\n observer) {\n var fn = filterRegistry[this.name];\n var context = model;\n if (fn) {\n context = undefined;\n } else {\n fn = context[t his.name];\n if (!fn) {\n console.error('Cannot find filter: ' + this.name);\n return;\n }\n }\n\n // If toModelDirect ion is falsey, then the \"normal\" (dom-bound) direction\n // is used. Othe rwise, it looks for a 'toModel' property function on the\n // object.\n if (toModelDirection) {\n fn = fn.toModel;\n } else if (typeof fn. toDOM == 'function') {\n fn = fn.toDOM;\n }\n\n if (typeof fn ! = 'function') {\n console.error('No ' + (toModelDirection ? 'toModel' : ' toDOM') +\n ' found on' + this.name);\n return;\n }\n\n var args = [value];\n for (var i = 0; i < this.args.length; i ++) {\n args[i + 1] = getFn(this.args[i])(model, observer);\n }\n\n return fn.apply(context, args);\n }\n };\n\n function notImplemented() { throw Error('Not Implemented'); }\n\n var unaryOperators = {\n '+': funct ion(v) { return +v; },\n '-': function(v) { return -v; },\n '!': function( v) { return !v; }\n };\n\n var binaryOperators = {\n '+': function(l, r) { return l+r; },\n '-': function(l, r) { return l-r; },\n '*': function(l, r ) { return l*r; },\n '/': function(l, r) { return l/r; },\n '%': function( l, r) { return l%r; },\n '<': function(l, r) { return l<r; },\n '>': funct ion(l, r) { return l>r; },\n '<=': function(l, r) { return l<=r; },\n '>=' : function(l, r) { return l>=r; },\n '==': function(l, r) { return l==r; },\n '!=': function(l, r) { return l!=r; },\n '===': function(l, r) { return l ===r; },\n '!==': function(l, r) { return l!==r; },\n '&&': function(l, r) { return l&&r; },\n '||': function(l, r) { return l||r; },\n };\n\n functi on getFn(arg) {\n return typeof arg == 'function' ? arg : arg.valueFn();\n } \n\n function ASTDelegate() {\n this.expression = null;\n this.filters = [];\n this.deps = {};\n this.currentPath = undefined;\n this.scopeIdent = undefined;\n this.indexIdent = undefined;\n this.dynamicDeps = false;\n }\n\n ASTDelegate.prototype = {\n createUnaryExpression: function(op, argu ment) {\n if (!unaryOperators[op])\n throw Error('Disallowed operato r: ' + op);\n\n argument = getFn(argument);\n\n return function(model, observer) {\n return unaryOperators[op](argument(model, observer));\n };\n },\n\n createBinaryExpression: function(op, left, right) {\n if (!binaryOperators[op])\n throw Error('Disallowed operator: ' + op);\n\ n left = getFn(left);\n right = getFn(right);\n\n return function (model, observer) {\n return binaryOperators[op](left(model, observer),\n right(model, observer));\n };\n },\n\ n createConditionalExpression: function(test, consequent, alternate) {\n test = getFn(test);\n consequent = getFn(consequent);\n alternate = g etFn(alternate);\n\n return function(model, observer) {\n return tes t(model, observer) ?\n consequent(model, observer) : alternate(model, observer);\n }\n },\n\n createIdentifier: function(name) {\n va r ident = new IdentPath(name);\n ident.type = 'Identifier';\n return i dent;\n },\n\n createMemberExpression: function(accessor, object, property ) {\n var ex = new MemberExpression(object, property, accessor);\n if (ex.dynamicDeps)\n this.dynamicDeps = true;\n return ex;\n },\n\n createLiteral: function(token) {\n return new Literal(token.value);\n },\n\n createArrayExpression: function(elements) {\n for (var i = 0; i < elements.length; i++)\n elements[i] = getFn(elements[i]);\n\n ret urn function(model, observer) {\n var arr = []\n for (var i = 0; i < elements.length; i++)\n arr.push(elements[i](model, observer));\n return arr;\n }\n },\n\n createProperty: function(kind, key, val ue) {\n return {\n key: key instanceof IdentPath ? key.name : key.va lue,\n value: value\n };\n },\n\n createObjectExpression: func tion(properties) {\n for (var i = 0; i < properties.length; i++)\n p roperties[i].value = getFn(properties[i].value);\n\n return function(model, observer) {\n var obj = {};\n for (var i = 0; i < properties.leng th; i++)\n obj[properties[i].key] = properties[i].value(model, observer );\n return obj;\n }\n },\n\n createFilter: function(name, arg s) {\n this.filters.push(new Filter(name, args));\n },\n\n createAsEx pression: function(expression, scopeIdent) {\n this.expression = expression ;\n this.scopeIdent = scopeIdent;\n },\n\n createInExpression: functi on(scopeIdent, indexIdent, expression) {\n this.expression = expression;\n this.scopeIdent = scopeIdent;\n this.indexIdent = indexIdent;\n },\ n\n createTopLevel: function(expression) {\n this.expression = expressio n;\n },\n\n createThisExpression: notImplemented\n }\n\n function Consta ntObservable(value) {\n this.value_ = value;\n }\n\n ConstantObservable.pro totype = {\n open: function() { return this.value_; },\n discardChanges: f unction() { return this.value_; },\n deliver: function() {},\n close: func tion() {},\n }\n\n function Expression(delegate) {\n this.scopeIdent = dele gate.scopeIdent;\n this.indexIdent = delegate.indexIdent;\n\n if (!delegat e.expression)\n throw Error('No expression found.');\n\n this.expression = delegate.expression;\n getFn(this.expression); // forces enumeration of pa th dependencies\n\n this.filters = delegate.filters;\n this.dynamicDeps = delegate.dynamicDeps;\n }\n\n Expression.prototype = {\n getBinding: functi on(model, filterRegistry, oneTime) {\n if (oneTime)\n return this.ge tValue(model, undefined, filterRegistry);\n\n var observer = new CompoundOb server();\n this.getValue(model, observer, filterRegistry); // captures de ps.\n var self = this;\n\n function valueFn() {\n if (self.dyna micDeps)\n observer.startReset();\n\n var value = self.getValue( model,\n self.dynamicDeps ? observer : undefine d,\n filterRegistry);\n if (self.dynamic Deps)\n observer.finishReset();\n\n return value;\n }\n\n function setValueFn(newValue) {\n self.setValue(model, newValue, filt erRegistry);\n return newValue;\n }\n\n return new ObserverTran sform(observer, valueFn, setValueFn, true);\n },\n\n getValue: function(mo del, observer, filterRegistry) {\n var value = getFn(this.expression)(model , observer);\n for (var i = 0; i < this.filters.length; i++) {\n val ue = this.filters[i].transform(value, false, filterRegistry, model,\n observer);\n }\n\n return value;\n } ,\n\n setValue: function(model, newValue, filterRegistry) {\n var count = this.filters ? this.filters.length : 0;\n while (count-- > 0) {\n newValue = this.filters[count].transform(newValue, true, filterRegistry,\n model);\n }\n\n if (this.ex pression.setValue)\n return this.expression.setValue(model, newValue);\n }\n }\n\n /**\n * Converts a style property name to a css property name. For example:\n * \"WebkitUserSelect\" to \"-webkit-user-select\"\n */\n fun ction convertStylePropertyName(name) {\n return String(name).replace(/[A-Z]/g , function(c) {\n return '-' + c.toLowerCase();\n });\n }\n\n function isEventHandler(name) {\n return name[0] === 'o' &&\n name[1] === ' n' &&\n name[2] === '-';\n }\n\n var mixedCaseEventTypes = {};\n [\ n 'webkitAnimationStart',\n 'webkitAnimationEnd',\n 'webkitTransitionEn d',\n 'DOMFocusOut',\n 'DOMFocusIn',\n 'DOMMouseScroll'\n ].forEach(fu nction(e) {\n mixedCaseEventTypes[e.toLowerCase()] = e;\n });\n\n var paren tScopeName = '@' + Math.random().toString(36).slice(2);\n\n // Single ident pat hs must bind directly to the appropriate scope object.\n // I.e. Pushed values in two-bindings need to be assigned to the actual model\n // object.\n functio n findScope(model, prop) {\n while (model[parentScopeName] &&\n !Ob ject.prototype.hasOwnProperty.call(model, prop)) {\n model = model[parentSc opeName];\n }\n\n return model;\n }\n\n function resolveEventReceiver(mo del, path, node) {\n if (path.length == 0)\n return undefined;\n\n if (path.length == 1)\n return findScope(model, path[0]);\n\n for (var i = 0; model != null && i < path.length - 1; i++) {\n model = model[path[i]];\ n }\n\n return model;\n }\n\n function prepareEventBinding(path, name, p olymerExpressions) {\n var eventType = name.substring(3);\n eventType = mi xedCaseEventTypes[eventType] || eventType;\n\n return function(model, node, o neTime) {\n var fn, receiver, handler;\n if (typeof polymerExpressions .resolveEventHandler == 'function') {\n handler = function(e) {\n fn = fn || polymerExpressions.resolveEventHandler(model, path, node);\n fn(e, e.detail, e.currentTarget);\n\n if (Platform && typeof Platfor m.flush == 'function')\n Platform.flush();\n };\n } else {\n handler = function(e) {\n fn = fn || path.getValueFrom(model );\n receiver = receiver || resolveEventReceiver(model, path, node);\n\ n fn.apply(receiver, [e, e.detail, e.currentTarget]);\n\n if ( Platform && typeof Platform.flush == 'function')\n Platform.flush();\ n };\n }\n\n node.addEventListener(eventType, handler);\n\n if (oneTime)\n return;\n\n function bindingValue() {\n retu rn '{{ ' + path + ' }}';\n }\n\n return {\n open: bindingValue, \n discardChanges: bindingValue,\n close: function() {\n node.removeEventListener(eventType, handler);\n }\n };\n }\n }\n \n function PolymerExpressions() {}\n\n PolymerExpressions.prototype = {\n // \"built-in\" filters\n styleObject: function(value) {\n var parts = [ ];\n for (var key in value) {\n parts.push(convertStylePropertyName( key) + ': ' + value[key]);\n }\n return parts.join('; ');\n },\n\n tokenList: function(value) {\n var tokens = [];\n for (var key in v alue) {\n if (value[key])\n tokens.push(key);\n }\n re turn tokens.join(' ');\n },\n\n // binding delegate API\n prepareInstan cePositionChanged: function(template) {\n var indexIdent = template.polymer ExpressionIndexIdent_;\n if (!indexIdent)\n return;\n\n return function(templateInstance, index) {\n templateInstance.model[indexIdent] = index;\n };\n },\n\n prepareBinding: function(pathString, name, nod e) {\n var path = Path.get(pathString);\n if (isEventHandler(name)) {\ n if (!path.valid) {\n console.error('on-* bindings must be simp le path expressions');\n return;\n }\n\n return prepareEv entBinding(path, name, this);\n }\n\n if (path.valid) {\n if (p ath.length == 1) {\n return function(model, node, oneTime) {\n if (oneTime)\n return path.getValueFrom(model);\n\n v ar scope = findScope(model, path[0]);\n return new PathObserver(scope , path);\n }\n }\n\n return; // bail out early if pathStr ing is simple path.\n }\n\n return prepareBinding(pathString, name, no de, this);\n },\n\n prepareInstanceModel: function(template) {\n var scopeName = template.polymerExpressionScopeIdent_;\n if (!scopeName)\n return;\n\n var parentScope = template.templateInstance ?\n tem plate.templateInstance.model :\n template.model;\n\n var indexName = template.polymerExpressionIndexIdent_;\n\n return function(model) {\n var scope = Object.create(parentScope);\n scope[scopeName] = model;\ n scope[indexName] = undefined;\n scope[parentScopeName] = parentS cope;\n return scope;\n };\n }\n };\n\n global.PolymerExpressio ns = PolymerExpressions;\n if (global.exposeGetExpression)\n global.getExpre ssion_ = getExpression;\n\n global.PolymerExpressions.prepareEventBinding = pre pareEventBinding;\n})(this);\n", 205 "// Copyright 2013 Google Inc.\n//\n// Licensed under the Apache License, Ve rsion 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http:/ /www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law o r agreed to in writing, software\n// distributed under the License is distribute d on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe r express or implied.\n// See the License for the specific language governing pe rmissions and\n// limitations under the License.\n\n(function (global) {\n 'use strict';\n\n // JScript does not have __proto__. We wrap all object literals w ith\n // createObject which uses Object.create, Object.defineProperty and\n // Object.getOwnPropertyDescriptor to create a new object that does the exact\n / / same thing. The main downside to this solution is that we have to extract\n / / all those property descriptors for IE.\n var createObject = ('__proto__' in { }) ?\n function(obj) { return obj; } :\n function(obj) {\n var proto = obj.__proto__;\n if (!proto)\n return obj;\n var newObject = Object.create(proto);\n Object.getOwnPropertyNames(obj).forEa ch(function(name) {\n Object.defineProperty(newObject, name,\n Object.getOwnPropertyDescriptor(obj, name));\n });\ n return newObject;\n };\n\n function prepareBinding(expressionText , name, node, filterRegistry) {\n var expression;\n try {\n expressio n = getExpression(expressionText);\n if (expression.scopeIdent &&\n (node.nodeType !== Node.ELEMENT_NODE ||\n node.tagName !== 'TEMPLATE ' ||\n (name !== 'bind' && name !== 'repeat'))) {\n throw Error ('as and in can only be used within <template bind/repeat>');\n }\n } ca tch (ex) {\n console.error('Invalid expression syntax: ' + expressionText, ex);\n return;\n }\n\n return function(model, node, oneTime) {\n var binding = expression.getBinding(model, filterRegistry, oneTime);\n if (expression.scopeIdent && binding) {\n node.polymerExpressionScopeIdent_ = expression.scopeIdent;\n if (expression.indexIdent)\n node.pol ymerExpressionIndexIdent_ = expression.indexIdent;\n }\n\n return bind ing;\n }\n }\n\n // TODO(rafaelw): Implement simple LRU.\n var expressionP arseCache = Object.create(null);\n\n function getExpression(expressionText) {\n var expression = expressionParseCache[expressionText];\n if (!expression) {\n var delegate = new ASTDelegate();\n esprima.parse(expressionText, delegate);\n expression = new Expression(delegate);\n expressionParse Cache[expressionText] = expression;\n }\n return expression;\n }\n\n fun ction Literal(value) {\n this.value = value;\n this.valueFn_ = undefined;\ n }\n\n Literal.prototype = {\n valueFn: function() {\n if (!this.valu eFn_) {\n var value = this.value;\n this.valueFn_ = function() {\n return value;\n }\n }\n\n return this.valueFn_;\n }\n }\n\n function IdentPath(name) {\n this.name = name;\n this.path = P ath.get(name);\n }\n\n IdentPath.prototype = {\n valueFn: function() {\n if (!this.valueFn_) {\n var name = this.name;\n var path = this .path;\n this.valueFn_ = function(model, observer) {\n if (obser ver)\n observer.addPath(model, path);\n\n return path.getVal ueFrom(model);\n }\n }\n\n return this.valueFn_;\n },\n\n setValue: function(model, newValue) {\n if (this.path.length == 1);\n model = findScope(model, this.path[0]);\n\n return this.path.setValueFro m(model, newValue);\n }\n };\n\n function MemberExpression(object, property , accessor) {\n // convert literal computed property access where literal val ue is a value\n // path to ident dot-access.\n if (accessor == '[' &&\n property instanceof Literal &&\n Path.get(property.value).valid) {\n accessor = '.';\n property = new IdentPath(property.value);\n }\n\ n this.dynamicDeps = typeof object == 'function' || object.dynamic;\n\n th is.dynamic = typeof property == 'function' ||\n property.dynam ic ||\n accessor == '[';\n\n this.simplePath =\n !th is.dynamic &&\n !this.dynamicDeps &&\n property instanceof IdentPa th &&\n (object instanceof MemberExpression || object instanceof IdentPat h);\n\n this.object = this.simplePath ? object : getFn(object);\n this.pro perty = accessor == '.' ? property : getFn(property);\n }\n\n MemberExpression .prototype = {\n get fullPath() {\n if (!this.fullPath_) {\n var last = this.object instanceof IdentPath ?\n this.object.name : this.o bject.fullPath;\n this.fullPath_ = Path.get(last + '.' + this.property.na me);\n }\n\n return this.fullPath_;\n },\n\n valueFn: function() {\n if (!this.valueFn_) {\n var object = this.object;\n\n if (this.simplePath) {\n var path = this.fullPath;\n\n this.valu eFn_ = function(model, observer) {\n if (observer)\n obs erver.addPath(model, path);\n\n return path.getValueFrom(model);\n };\n } else if (this.property instanceof IdentPath) {\n v ar path = Path.get(this.property.name);\n\n this.valueFn_ = function(mo del, observer) {\n var context = object(model, observer);\n\n if (observer)\n observer.addPath(context, path);\n\n return path.getValueFrom(context);\n }\n } else {\n // Computed property.\n var property = this.property;\n\n this.v alueFn_ = function(model, observer) {\n var context = object(model, o bserver);\n var propName = property(model, observer);\n if (observer)\n observer.addPath(context, propName);\n\n r eturn context ? context[propName] : undefined;\n };\n }\n } \n return this.valueFn_;\n },\n\n setValue: function(model, newValue) {\n if (this.simplePath) {\n this.fullPath.setValueFrom(model, newV alue);\n return newValue;\n }\n\n var object = this.object(mode l);\n var propName = this.property instanceof IdentPath ? this.property.nam e :\n this.property(model);\n return object[propName] = newValue;\ n }\n };\n\n function Filter(name, args) {\n this.name = name;\n this .args = [];\n for (var i = 0; i < args.length; i++) {\n this.args[i] = g etFn(args[i]);\n }\n }\n\n Filter.prototype = {\n transform: function(va lue, toModelDirection, filterRegistry, model,\n observer) {\n var fn = filterRegistry[this.name];\n var context = model;\n if (fn) {\n context = undefined;\n } else {\n fn = context[t his.name];\n if (!fn) {\n console.error('Cannot find filter: ' + this.name);\n return;\n }\n }\n\n // If toModelDirect ion is falsey, then the \"normal\" (dom-bound) direction\n // is used. Othe rwise, it looks for a 'toModel' property function on the\n // object.\n if (toModelDirection) {\n fn = fn.toModel;\n } else if (typeof fn. toDOM == 'function') {\n fn = fn.toDOM;\n }\n\n if (typeof fn ! = 'function') {\n console.error('No ' + (toModelDirection ? 'toModel' : ' toDOM') +\n ' found on' + this.name);\n return;\n }\n\n var args = [value];\n for (var i = 0; i < this.args.length; i ++) {\n args[i + 1] = getFn(this.args[i])(model, observer);\n }\n\n return fn.apply(context, args);\n }\n };\n\n function notImplemented() { throw Error('Not Implemented'); }\n\n var unaryOperators = {\n '+': funct ion(v) { return +v; },\n '-': function(v) { return -v; },\n '!': function( v) { return !v; }\n };\n\n var binaryOperators = {\n '+': function(l, r) { return l+r; },\n '-': function(l, r) { return l-r; },\n '*': function(l, r ) { return l*r; },\n '/': function(l, r) { return l/r; },\n '%': function( l, r) { return l%r; },\n '<': function(l, r) { return l<r; },\n '>': funct ion(l, r) { return l>r; },\n '<=': function(l, r) { return l<=r; },\n '>=' : function(l, r) { return l>=r; },\n '==': function(l, r) { return l==r; },\n '!=': function(l, r) { return l!=r; },\n '===': function(l, r) { return l ===r; },\n '!==': function(l, r) { return l!==r; },\n '&&': function(l, r) { return l&&r; },\n '||': function(l, r) { return l||r; },\n };\n\n functi on getFn(arg) {\n return typeof arg == 'function' ? arg : arg.valueFn();\n } \n\n function ASTDelegate() {\n this.expression = null;\n this.filters = [];\n this.deps = {};\n this.currentPath = undefined;\n this.scopeIdent = undefined;\n this.indexIdent = undefined;\n this.dynamicDeps = false;\n }\n\n ASTDelegate.prototype = {\n createUnaryExpression: function(op, argu ment) {\n if (!unaryOperators[op])\n throw Error('Disallowed operato r: ' + op);\n\n argument = getFn(argument);\n\n return function(model, observer) {\n return unaryOperators[op](argument(model, observer));\n };\n },\n\n createBinaryExpression: function(op, left, right) {\n if (!binaryOperators[op])\n throw Error('Disallowed operator: ' + op);\n\ n left = getFn(left);\n right = getFn(right);\n\n return function (model, observer) {\n return binaryOperators[op](left(model, observer),\n right(model, observer));\n };\n },\n\ n createConditionalExpression: function(test, consequent, alternate) {\n test = getFn(test);\n consequent = getFn(consequent);\n alternate = g etFn(alternate);\n\n return function(model, observer) {\n return tes t(model, observer) ?\n consequent(model, observer) : alternate(model, observer);\n }\n },\n\n createIdentifier: function(name) {\n va r ident = new IdentPath(name);\n ident.type = 'Identifier';\n return i dent;\n },\n\n createMemberExpression: function(accessor, object, property ) {\n var ex = new MemberExpression(object, property, accessor);\n if (ex.dynamicDeps)\n this.dynamicDeps = true;\n return ex;\n },\n\n createLiteral: function(token) {\n return new Literal(token.value);\n },\n\n createArrayExpression: function(elements) {\n for (var i = 0; i < elements.length; i++)\n elements[i] = getFn(elements[i]);\n\n ret urn function(model, observer) {\n var arr = []\n for (var i = 0; i < elements.length; i++)\n arr.push(elements[i](model, observer));\n return arr;\n }\n },\n\n createProperty: function(kind, key, val ue) {\n return {\n key: key instanceof IdentPath ? key.name : key.va lue,\n value: value\n };\n },\n\n createObjectExpression: func tion(properties) {\n for (var i = 0; i < properties.length; i++)\n p roperties[i].value = getFn(properties[i].value);\n\n return function(model, observer) {\n var obj = {};\n for (var i = 0; i < properties.leng th; i++)\n obj[properties[i].key] = properties[i].value(model, observer );\n return obj;\n }\n },\n\n createFilter: function(name, arg s) {\n this.filters.push(new Filter(name, args));\n },\n\n createAsEx pression: function(expression, scopeIdent) {\n this.expression = expression ;\n this.scopeIdent = scopeIdent;\n },\n\n createInExpression: functi on(scopeIdent, indexIdent, expression) {\n this.expression = expression;\n this.scopeIdent = scopeIdent;\n this.indexIdent = indexIdent;\n },\ n\n createTopLevel: function(expression) {\n this.expression = expressio n;\n },\n\n createThisExpression: notImplemented\n }\n\n function Consta ntObservable(value) {\n this.value_ = value;\n }\n\n ConstantObservable.pro totype = {\n open: function() { return this.value_; },\n discardChanges: f unction() { return this.value_; },\n deliver: function() {},\n close: func tion() {},\n }\n\n function Expression(delegate) {\n this.scopeIdent = dele gate.scopeIdent;\n this.indexIdent = delegate.indexIdent;\n\n if (!delegat e.expression)\n throw Error('No expression found.');\n\n this.expression = delegate.expression;\n getFn(this.expression); // forces enumeration of pa th dependencies\n\n this.filters = delegate.filters;\n this.dynamicDeps = delegate.dynamicDeps;\n }\n\n Expression.prototype = {\n getBinding: functi on(model, filterRegistry, oneTime) {\n if (oneTime)\n return this.ge tValue(model, undefined, filterRegistry);\n\n var observer = new CompoundOb server();\n this.getValue(model, observer, filterRegistry); // captures de ps.\n var self = this;\n\n function valueFn() {\n if (self.dyna micDeps)\n observer.startReset();\n\n var value = self.getValue( model,\n self.dynamicDeps ? observer : undefine d,\n filterRegistry);\n if (self.dynamic Deps)\n observer.finishReset();\n\n return value;\n }\n\n function setValueFn(newValue) {\n self.setValue(model, newValue, filt erRegistry);\n return newValue;\n }\n\n return new ObserverTran sform(observer, valueFn, setValueFn, true);\n },\n\n getValue: function(mo del, observer, filterRegistry) {\n var value = getFn(this.expression)(model , observer);\n for (var i = 0; i < this.filters.length; i++) {\n val ue = this.filters[i].transform(value, false, filterRegistry, model,\n observer);\n }\n\n return value;\n } ,\n\n setValue: function(model, newValue, filterRegistry) {\n var count = this.filters ? this.filters.length : 0;\n while (count-- > 0) {\n newValue = this.filters[count].transform(newValue, true, filterRegistry,\n model);\n }\n\n if (this.ex pression.setValue)\n return this.expression.setValue(model, newValue);\n }\n }\n\n /**\n * Converts a style property name to a css property name. For example:\n * \"WebkitUserSelect\" to \"-webkit-user-select\"\n */\n fun ction convertStylePropertyName(name) {\n return String(name).replace(/[A-Z]/g , function(c) {\n return '-' + c.toLowerCase();\n });\n }\n\n function isEventHandler(name) {\n return name[0] === 'o' &&\n name[1] === ' n' &&\n name[2] === '-';\n }\n\n var mixedCaseEventTypes = {};\n [\ n 'webkitAnimationStart',\n 'webkitAnimationEnd',\n 'webkitTransitionEn d',\n 'DOMFocusOut',\n 'DOMFocusIn',\n 'DOMMouseScroll'\n ].forEach(fu nction(e) {\n mixedCaseEventTypes[e.toLowerCase()] = e;\n });\n\n var paren tScopeName = '@' + Math.random().toString(36).slice(2);\n\n // Single ident pat hs must bind directly to the appropriate scope object.\n // I.e. Pushed values in two-bindings need to be assigned to the actual model\n // object.\n functio n findScope(model, prop) {\n while (model[parentScopeName] &&\n !Ob ject.prototype.hasOwnProperty.call(model, prop)) {\n model = model[parentSc opeName];\n }\n\n return model;\n }\n\n function resolveEventReceiver(mo del, path, node) {\n if (path.length == 0)\n return undefined;\n\n if (path.length == 1)\n return findScope(model, path[0]);\n\n for (var i = 0; model != null && i < path.length - 1; i++) {\n model = model[path[i]];\ n }\n\n return model;\n }\n\n function prepareEventBinding(path, name, p olymerExpressions) {\n var eventType = name.substring(3);\n eventType = mi xedCaseEventTypes[eventType] || eventType;\n\n return function(model, node, o neTime) {\n var fn, receiver, handler;\n if (typeof polymerExpressions .resolveEventHandler == 'function') {\n handler = function(e) {\n fn = fn || polymerExpressions.resolveEventHandler(model, path, node);\n fn(e, e.detail, e.currentTarget);\n\n if (Platform && typeof Platfor m.flush == 'function')\n Platform.flush();\n };\n } else {\n handler = function(e) {\n fn = fn || path.getValueFrom(model );\n receiver = receiver || resolveEventReceiver(model, path, node);\n\ n fn.apply(receiver, [e, e.detail, e.currentTarget]);\n\n if ( Platform && typeof Platform.flush == 'function')\n Platform.flush();\ n };\n }\n\n node.addEventListener(eventType, handler);\n\n if (oneTime)\n return;\n\n function bindingValue() {\n retu rn '{{ ' + path + ' }}';\n }\n\n return {\n open: bindingValue, \n discardChanges: bindingValue,\n close: function() {\n node.removeEventListener(eventType, handler);\n }\n };\n }\n }\n \n function PolymerExpressions() {}\n\n PolymerExpressions.prototype = {\n // \"built-in\" filters\n styleObject: function(value) {\n var parts = [ ];\n for (var key in value) {\n parts.push(convertStylePropertyName( key) + ': ' + value[key]);\n }\n return parts.join('; ');\n },\n\n tokenList: function(value) {\n var tokens = [];\n for (var key in v alue) {\n if (value[key])\n tokens.push(key);\n }\n re turn tokens.join(' ');\n },\n\n // binding delegate API\n prepareInstan cePositionChanged: function(template) {\n var indexIdent = template.polymer ExpressionIndexIdent_;\n if (!indexIdent)\n return;\n\n return function(templateInstance, index) {\n templateInstance.model[indexIdent] = index;\n };\n },\n\n prepareBinding: function(pathString, name, nod e) {\n var path = Path.get(pathString);\n if (isEventHandler(name)) {\ n if (!path.valid) {\n console.error('on-* bindings must be simp le path expressions');\n return;\n }\n\n return prepareEv entBinding(path, name, this);\n }\n\n if (path.valid) {\n if (p ath.length == 1) {\n return function(model, node, oneTime) {\n if (oneTime)\n return path.getValueFrom(model);\n\n v ar scope = findScope(model, path[0]);\n return new PathObserver(scope , path);\n }\n }\n\n return; // bail out early if pathStr ing is simple path.\n }\n\n return prepareBinding(pathString, name, no de, this);\n },\n\n prepareInstanceModel: function(template) {\n var scopeName = template.polymerExpressionScopeIdent_;\n if (!scopeName)\n return;\n\n var parentScope = template.templateInstance ?\n tem plate.templateInstance.model :\n template.model;\n\n var indexName = template.polymerExpressionIndexIdent_;\n\n return function(model) {\n var scope = Object.create(parentScope);\n scope[scopeName] = model;\ n scope[indexName] = undefined;\n scope[parentScopeName] = parentS cope;\n return scope;\n };\n }\n };\n\n global.PolymerExpressio ns = PolymerExpressions;\n if (global.exposeGetExpression)\n global.getExpre ssion_ = getExpression;\n\n global.PolymerExpressions.prepareEventBinding = pre pareEventBinding;\n})(this);\n",
202 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\n// inject style sheet\nvar style = do cument.createElement('style');\nstyle.textContent = 'template {display: none !im portant;} /* injected by platform.js */';\nvar head = document.querySelector('he ad');\nhead.insertBefore(style, head.firstChild);\n\n// flush (with logging)\nva r flushing;\nfunction flush() {\n if (!flushing) {\n flushing = true;\n s cope.endOfMicrotask(function() {\n flushing = false;\n logFlags.data & & console.group('Platform.flush()');\n scope.performMicrotaskCheckpoint();\ n logFlags.data && console.groupEnd();\n });\n }\n};\n\n// polling dirt y checker\nvar FLUSH_POLL_INTERVAL = 125;\nwindow.addEventListener('WebComponent sReady', function() {\n flush();\n // flush periodically if platform does not have object observe.\n if (!Observer.hasObjectObserve) {\n scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);\n }\n});\n\nif (window.CustomElements && !CustomElements.useNative) {\n var originalImportNode = Document.prototype. importNode;\n Document.prototype.importNode = function(node, deep) {\n var i mported = originalImportNode.call(this, node, deep);\n CustomElements.upgrade All(imported);\n return imported;\n }\n}\n\n// exports\nscope.flush = flush; \n\n})(window.Platform);\n\n" 206 "/*\n * Copyright 2013 The Polymer Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n(function(scope) {\n\n// inject style sheet\nvar style = do cument.createElement('style');\nstyle.textContent = 'template {display: none !im portant;} /* injected by platform.js */';\nvar head = document.querySelector('he ad');\nhead.insertBefore(style, head.firstChild);\n\n// flush (with logging)\nva r flushing;\nfunction flush() {\n if (!flushing) {\n flushing = true;\n s cope.endOfMicrotask(function() {\n flushing = false;\n logFlags.data & & console.group('Platform.flush()');\n scope.performMicrotaskCheckpoint();\ n logFlags.data && console.groupEnd();\n });\n }\n};\n\n// polling dirt y checker\nvar FLUSH_POLL_INTERVAL = 125;\nwindow.addEventListener('WebComponent sReady', function() {\n flush();\n // flush periodically if platform does not have object observe.\n if (!Observer.hasObjectObserve) {\n scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);\n }\n});\n\nif (window.CustomElements && !CustomElements.useNative) {\n var originalImportNode = Document.prototype. importNode;\n Document.prototype.importNode = function(node, deep) {\n var i mported = originalImportNode.call(this, node, deep);\n CustomElements.upgrade All(imported);\n return imported;\n }\n}\n\n// exports\nscope.flush = flush; \n\n})(window.Platform);\n\n"
203 ] 207 ]
204 } 208 }
OLDNEW
« no previous file with comments | « pkg/web_components/lib/platform.concat.js ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698