##// END OF EJS Templates
frontend: Use Polymer 2.0
ergo -
r2915:59bfd308 default
parent child Browse files
Show More
@@ -1,17 +1,17 b''
1 {
1 {
2 "name": "rhodecode-elements",
2 "name": "rhodecode-elements",
3 "description": "User interface for elements for rhodecode",
3 "description": "User interface for elements for rhodecode",
4 "main": "index.html",
4 "main": "index.html",
5 "dependencies": {
5 "dependencies": {
6 "webcomponentsjs": "^0.7.22",
6 "webcomponentsjs": "^1.2.3",
7 "polymer": "Polymer/polymer#^1.6.1",
7 "polymer": "Polymer/polymer#^2.6.0",
8 "paper-button": "PolymerElements/paper-button#^1.0.13",
8 "paper-button": "PolymerElements/paper-button#^2.1.2",
9 "paper-spinner": "PolymerElements/paper-spinner#^1.2.0",
9 "paper-spinner": "PolymerElements/paper-spinner#^2.1.0",
10 "paper-tooltip": "PolymerElements/paper-tooltip#^1.1.2",
10 "paper-tooltip": "PolymerElements/paper-tooltip#^2.1.1",
11 "paper-toast": "PolymerElements/paper-toast#^1.3.0",
11 "paper-toast": "PolymerElements/paper-toast#^2.1.2",
12 "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.2.0",
12 "paper-toggle-button": "PolymerElements/paper-toggle-button#^2.1.1",
13 "iron-ajax": "PolymerElements/iron-ajax#^1.4.4",
13 "iron-ajax": "PolymerElements/iron-ajax#^2.1.3",
14 "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.13",
14 "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.2.0",
15 "iron-a11y-keys": "PolymerElements/iron-a11y-keys#^1.0.6"
15 "iron-a11y-keys": "PolymerElements/iron-a11y-keys#^2.1.2"
16 }
16 }
17 }
17 }
@@ -1,32 +1,32 b''
1 {
1 {
2 "name": "rhodecode-enterprise",
2 "name": "rhodecode-enterprise",
3 "version": "1.0.0",
3 "version": "1.0.0",
4 "private": true,
4 "private": true,
5 "description" : "RhodeCode JS packaged",
5 "description" : "RhodeCode JS packaged",
6 "license": "SEE LICENSE IN LICENSE.txt",
6 "license": "SEE LICENSE IN LICENSE.txt",
7 "repository" : {
7 "repository" : {
8 "type" : "hg",
8 "type" : "hg",
9 "url" : "https://code.rhodecode.com/rhodecode-enterprise-ce"
9 "url" : "https://code.rhodecode.com/rhodecode-enterprise-ce"
10 },
10 },
11 "devDependencies": {
11 "devDependencies": {
12 "grunt": "^0.4.5",
12 "grunt": "^0.4.5",
13 "grunt-contrib-copy": "^1.0.0",
13 "grunt-contrib-copy": "^1.0.0",
14 "grunt-contrib-concat": "^0.5.1",
14 "grunt-contrib-concat": "^0.5.1",
15 "grunt-contrib-jshint": "^0.12.0",
15 "grunt-contrib-jshint": "^0.12.0",
16 "grunt-contrib-less": "^1.1.0",
16 "grunt-contrib-less": "^1.1.0",
17 "grunt-contrib-watch": "^0.6.1",
17 "grunt-contrib-watch": "^0.6.1",
18 "crisper": "^2.0.2",
18 "crisper": "^2.1.1",
19 "vulcanize": "^1.14.8",
19 "vulcanize": "^1.16.0",
20 "grunt-crisper": "^1.0.1",
20 "grunt-crisper": "^1.0.1",
21 "grunt-vulcanize": "^1.0.0",
21 "grunt-vulcanize": "^1.0.0",
22 "node2nix": "^1.0.0",
22 "node2nix": "^1.0.0",
23 "jshint": "^2.9.1-rc3",
23 "jshint": "^2.9.1-rc3",
24 "bower": "^1.8.4",
24 "bower": "^1.8.4",
25 "jquery": "1.11.3",
25 "jquery": "1.11.3",
26 "favico.js": "^0.3.10",
26 "favico.js": "^0.3.10",
27 "clipboard": "^1.7.1",
27 "clipboard": "^1.7.1",
28 "moment": "^2.18.1",
28 "moment": "^2.18.1",
29 "mousetrap": "^1.6.1",
29 "mousetrap": "^1.6.1",
30 "appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1"
30 "appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1"
31 }
31 }
32 }
32 }
@@ -1,150 +1,150 b''
1 ccLog = Logger.get('RhodeCodeApp');
1 ccLog = Logger.get('RhodeCodeApp');
2 ccLog.setLevel(Logger.OFF);
2 ccLog.setLevel(Logger.OFF);
3
3
4 var rhodeCodeApp = Polymer({
4 var rhodeCodeApp = Polymer({
5 is: 'rhodecode-app',
5 is: 'rhodecode-app',
6 attached: function () {
6 attached: function () {
7 ccLog.debug('rhodeCodeApp created');
7 ccLog.debug('rhodeCodeApp created');
8 $.Topic('/notifications').subscribe(this.handleNotifications.bind(this));
8 $.Topic('/notifications').subscribe(this.handleNotifications.bind(this));
9 $.Topic('/favicon/update').subscribe(this.faviconUpdate.bind(this));
9 $.Topic('/favicon/update').subscribe(this.faviconUpdate.bind(this));
10 $.Topic('/connection_controller/subscribe').subscribe(
10 $.Topic('/connection_controller/subscribe').subscribe(
11 this.subscribeToChannelTopic.bind(this));
11 this.subscribeToChannelTopic.bind(this));
12 // this event can be used to coordinate plugins to do their
12 // this event can be used to coordinate plugins to do their
13 // initialization before channelstream is kicked off
13 // initialization before channelstream is kicked off
14 $.Topic('/__MAIN_APP__').publish({});
14 $.Topic('/__MAIN_APP__').publish({});
15
15
16 for (var i = 0; i < alertMessagePayloads.length; i++) {
16 for (var i = 0; i < alertMessagePayloads.length; i++) {
17 $.Topic('/notifications').publish(alertMessagePayloads[i]);
17 $.Topic('/notifications').publish(alertMessagePayloads[i]);
18 }
18 }
19 this.kickoffChannelstreamPlugin();
19 this.kickoffChannelstreamPlugin();
20 },
20 },
21
21
22 /** proxy to channelstream connection */
22 /** proxy to channelstream connection */
23 getChannelStreamConnection: function () {
23 getChannelStreamConnection: function () {
24 return this.$['channelstream-connection'];
24 return this.$['channelstream-connection'];
25 },
25 },
26
26
27 handleNotifications: function (data) {
27 handleNotifications: function (data) {
28 var elem = document.getElementById('notifications');
28 var elem = document.getElementById('notifications');
29 if(elem){
29 if(elem){
30 elem.handleNotification(data);
30 elem.handleNotification(data);
31 }
31 }
32
32
33 },
33 },
34
34
35 faviconUpdate: function (data) {
35 faviconUpdate: function (data) {
36 this.$$('rhodecode-favicon').counter = data.count;
36 this.shadowRoot.querySelector('rhodecode-favicon').counter = data.count;
37 },
37 },
38
38
39 /** opens connection to ws server */
39 /** opens connection to ws server */
40 kickoffChannelstreamPlugin: function (data) {
40 kickoffChannelstreamPlugin: function (data) {
41 ccLog.debug('kickoffChannelstreamPlugin');
41 ccLog.debug('kickoffChannelstreamPlugin');
42 var channels = ['broadcast'];
42 var channels = ['broadcast'];
43 var addChannels = this.checkViewChannels();
43 var addChannels = this.checkViewChannels();
44 for (var i = 0; i < addChannels.length; i++) {
44 for (var i = 0; i < addChannels.length; i++) {
45 channels.push(addChannels[i]);
45 channels.push(addChannels[i]);
46 }
46 }
47 if (window.CHANNELSTREAM_SETTINGS && CHANNELSTREAM_SETTINGS.enabled){
47 if (window.CHANNELSTREAM_SETTINGS && CHANNELSTREAM_SETTINGS.enabled){
48 var channelstreamConnection = this.getChannelStreamConnection();
48 var channelstreamConnection = this.getChannelStreamConnection();
49 channelstreamConnection.connectUrl = CHANNELSTREAM_URLS.connect;
49 channelstreamConnection.connectUrl = CHANNELSTREAM_URLS.connect;
50 channelstreamConnection.subscribeUrl = CHANNELSTREAM_URLS.subscribe;
50 channelstreamConnection.subscribeUrl = CHANNELSTREAM_URLS.subscribe;
51 channelstreamConnection.websocketUrl = CHANNELSTREAM_URLS.ws + '/ws';
51 channelstreamConnection.websocketUrl = CHANNELSTREAM_URLS.ws + '/ws';
52 channelstreamConnection.longPollUrl = CHANNELSTREAM_URLS.longpoll + '/listen';
52 channelstreamConnection.longPollUrl = CHANNELSTREAM_URLS.longpoll + '/listen';
53 // some channels might already be registered by topic
53 // some channels might already be registered by topic
54 for (var i = 0; i < channels.length; i++) {
54 for (var i = 0; i < channels.length; i++) {
55 channelstreamConnection.push('channels', channels[i]);
55 channelstreamConnection.push('channels', channels[i]);
56 }
56 }
57 // append any additional channels registered in other plugins
57 // append any additional channels registered in other plugins
58 $.Topic('/connection_controller/subscribe').processPrepared();
58 $.Topic('/connection_controller/subscribe').processPrepared();
59 channelstreamConnection.connect();
59 channelstreamConnection.connect();
60 }
60 }
61 },
61 },
62
62
63 checkViewChannels: function () {
63 checkViewChannels: function () {
64 // subscribe to different channels data is sent.
64 // subscribe to different channels data is sent.
65
65
66 var channels = [];
66 var channels = [];
67 // subscribe to PR repo channel for PR's'
67 // subscribe to PR repo channel for PR's'
68 if (templateContext.pull_request_data.pull_request_id) {
68 if (templateContext.pull_request_data.pull_request_id) {
69 var channelName = '/repo$' + templateContext.repo_name + '$/pr/' +
69 var channelName = '/repo$' + templateContext.repo_name + '$/pr/' +
70 String(templateContext.pull_request_data.pull_request_id);
70 String(templateContext.pull_request_data.pull_request_id);
71 channels.push(channelName);
71 channels.push(channelName);
72 }
72 }
73
73
74 if (templateContext.commit_data.commit_id) {
74 if (templateContext.commit_data.commit_id) {
75 var channelName = '/repo$' + templateContext.repo_name + '$/commit/' +
75 var channelName = '/repo$' + templateContext.repo_name + '$/commit/' +
76 String(templateContext.commit_data.commit_id);
76 String(templateContext.commit_data.commit_id);
77 channels.push(channelName);
77 channels.push(channelName);
78 }
78 }
79
79
80 return channels;
80 return channels;
81 },
81 },
82
82
83 /** subscribes users from channels in channelstream */
83 /** subscribes users from channels in channelstream */
84 subscribeToChannelTopic: function (channels) {
84 subscribeToChannelTopic: function (channels) {
85 var channelstreamConnection = this.getChannelStreamConnection();
85 var channelstreamConnection = this.getChannelStreamConnection();
86 var toSubscribe = channelstreamConnection.calculateSubscribe(channels);
86 var toSubscribe = channelstreamConnection.calculateSubscribe(channels);
87 ccLog.debug('subscribeToChannelTopic', toSubscribe);
87 ccLog.debug('subscribeToChannelTopic', toSubscribe);
88 if (toSubscribe.length > 0) {
88 if (toSubscribe.length > 0) {
89 // if we are connected then subscribe
89 // if we are connected then subscribe
90 if (channelstreamConnection.connected) {
90 if (channelstreamConnection.connected) {
91 channelstreamConnection.subscribe(toSubscribe);
91 channelstreamConnection.subscribe(toSubscribe);
92 }
92 }
93 // not connected? just push channels onto the stack
93 // not connected? just push channels onto the stack
94 else {
94 else {
95 for (var i = 0; i < toSubscribe.length; i++) {
95 for (var i = 0; i < toSubscribe.length; i++) {
96 channelstreamConnection.push('channels', toSubscribe[i]);
96 channelstreamConnection.push('channels', toSubscribe[i]);
97 }
97 }
98 }
98 }
99 }
99 }
100 },
100 },
101
101
102 /** publish received messages into correct topic */
102 /** publish received messages into correct topic */
103 receivedMessage: function (event) {
103 receivedMessage: function (event) {
104 for (var i = 0; i < event.detail.length; i++) {
104 for (var i = 0; i < event.detail.length; i++) {
105 var message = event.detail[i];
105 var message = event.detail[i];
106 if (message.message.topic) {
106 if (message.message.topic) {
107 ccLog.debug('publishing', message.message.topic);
107 ccLog.debug('publishing', message.message.topic);
108 $.Topic(message.message.topic).publish(message);
108 $.Topic(message.message.topic).publish(message);
109 }
109 }
110 else if (message.type === 'presence'){
110 else if (message.type === 'presence'){
111 $.Topic('/connection_controller/presence').publish(message);
111 $.Topic('/connection_controller/presence').publish(message);
112 }
112 }
113 else {
113 else {
114 ccLog.warn('unhandled message', message);
114 ccLog.warn('unhandled message', message);
115 }
115 }
116 }
116 }
117 },
117 },
118
118
119 handleConnected: function (event) {
119 handleConnected: function (event) {
120 var channelstreamConnection = this.getChannelStreamConnection();
120 var channelstreamConnection = this.getChannelStreamConnection();
121 channelstreamConnection.set('channelsState',
121 channelstreamConnection.set('channelsState',
122 event.detail.channels_info);
122 event.detail.channels_info);
123 channelstreamConnection.set('userState', event.detail.state);
123 channelstreamConnection.set('userState', event.detail.state);
124 channelstreamConnection.set('channels', event.detail.channels);
124 channelstreamConnection.set('channels', event.detail.channels);
125 this.propagageChannelsState();
125 this.propagageChannelsState();
126 },
126 },
127 handleSubscribed: function (event) {
127 handleSubscribed: function (event) {
128 var channelstreamConnection = this.getChannelStreamConnection();
128 var channelstreamConnection = this.getChannelStreamConnection();
129 var channelInfo = event.detail.channels_info;
129 var channelInfo = event.detail.channels_info;
130 var channelKeys = Object.keys(event.detail.channels_info);
130 var channelKeys = Object.keys(event.detail.channels_info);
131 for (var i = 0; i < channelKeys.length; i++) {
131 for (var i = 0; i < channelKeys.length; i++) {
132 var key = channelKeys[i];
132 var key = channelKeys[i];
133 channelstreamConnection.set(['channelsState', key], channelInfo[key]);
133 channelstreamConnection.set(['channelsState', key], channelInfo[key]);
134 }
134 }
135 channelstreamConnection.set('channels', event.detail.channels);
135 channelstreamConnection.set('channels', event.detail.channels);
136 this.propagageChannelsState();
136 this.propagageChannelsState();
137 },
137 },
138 /** propagates channel states on topics */
138 /** propagates channel states on topics */
139 propagageChannelsState: function (event) {
139 propagageChannelsState: function (event) {
140 var channelstreamConnection = this.getChannelStreamConnection();
140 var channelstreamConnection = this.getChannelStreamConnection();
141 var channel_data = channelstreamConnection.channelsState;
141 var channel_data = channelstreamConnection.channelsState;
142 var channels = channelstreamConnection.channels;
142 var channels = channelstreamConnection.channels;
143 for (var i = 0; i < channels.length; i++) {
143 for (var i = 0; i < channels.length; i++) {
144 var key = channels[i];
144 var key = channels[i];
145 $.Topic('/connection_controller/channel_update').publish(
145 $.Topic('/connection_controller/channel_update').publish(
146 {channel: key, state: channel_data[key]}
146 {channel: key, state: channel_data[key]}
147 );
147 );
148 }
148 }
149 }
149 }
150 });
150 });
@@ -1,24 +1,23 b''
1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
2 <link rel="import" href="../../../../../../bower_components/paper-toast/paper-toast.html">
3 <link rel="import" href="../../../../../../bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
2 <link rel="import" href="../../../../../../bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
4 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
3 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
5 <dom-module id="rhodecode-toast">
4 <dom-module id="rhodecode-toast">
6 <template>
5 <template>
7 <style include="shared-styles"></style>
6 <style include="shared-styles"></style>
8 <link rel="stylesheet" href="rhodecode-toast.css">
7 <link rel="stylesheet" href="rhodecode-toast.css">
9 <template is="dom-if" if="[[hasToasts]]">
8 <template is="dom-if" if="[[hasToasts]]">
10 <div class$="container toast-message-holder [[conditionalClass(isFixed)]]">
9 <div class$="container toast-message-holder [[conditionalClass(isFixed)]]">
11 <template is="dom-repeat" items="[[toasts]]">
10 <template is="dom-repeat" items="[[toasts]]">
12 <div class$="alert alert-[[item.level]]">
11 <div class$="alert alert-[[item.level]]">
13 <div on-tap="dismissNotification" class="toast-close" index-pos="[[index]]">
12 <div on-tap="dismissNotification" class="toast-close" index-pos="[[index]]">
14 <span>[[_gettext('Close')]]</span>
13 <span>[[_gettext('Close')]]</span>
15 </div>
14 </div>
16 <rhodecode-unsafe-html text="[[item.message]]"></rhodecode-unsafe-html>
15 <rhodecode-unsafe-html text="[[item.message]]"></rhodecode-unsafe-html>
17 </div>
16 </div>
18 </template>
17 </template>
19 </div>
18 </div>
20 </template>
19 </template>
21 </template>
20 </template>
22
21
23 <script src="rhodecode-toast.js"></script>
22 <script src="rhodecode-toast.js"></script>
24 </dom-module>
23 </dom-module>
@@ -1,9 +1,9 b''
1 <link rel="import" href="../../../../../../bower_components/polymer/polymer.html">
1 <link rel="import" href="../../../../../../bower_components/polymer/polymer.html">
2
2
3 <dom-module id="rhodecode-unsafe-html">
3 <dom-module id="rhodecode-unsafe-html">
4 <template>
4 <template>
5 <style include="shared-styles"></style>
5 <style include="shared-styles"></style>
6 <content></content>
6 <slot></slot>
7 </template>
7 </template>
8 <script src="rhodecode-unsafe-html.js"></script>
8 <script src="rhodecode-unsafe-html.js"></script>
9 </dom-module>
9 </dom-module>
This diff has been collapsed as it changes many lines, (2723 lines changed) Show them Hide them
@@ -1,2505 +1,230 b''
1 /**
1 /**
2 * @license
2 @license @nocompile
3 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 * Code distributed by Google as part of the polymer project is also
7 Code distributed by Google as part of the polymer project is also
8 * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 */
9 */
10 // @version 0.7.24
10 (function(){/*
11 (function() {
12 window.WebComponents = window.WebComponents || {
13 flags: {}
14 };
15 var file = "webcomponents-lite.js";
16 var script = document.querySelector('script[src*="' + file + '"]');
17 var flags = {};
18 if (!flags.noOpts) {
19 location.search.slice(1).split("&").forEach(function(option) {
20 var parts = option.split("=");
21 var match;
22 if (parts[0] && (match = parts[0].match(/wc-(.+)/))) {
23 flags[match[1]] = parts[1] || true;
24 }
25 });
26 if (script) {
27 for (var i = 0, a; a = script.attributes[i]; i++) {
28 if (a.name !== "src") {
29 flags[a.name] = a.value || true;
30 }
31 }
32 }
33 if (flags.log && flags.log.split) {
34 var parts = flags.log.split(",");
35 flags.log = {};
36 parts.forEach(function(f) {
37 flags.log[f] = true;
38 });
39 } else {
40 flags.log = {};
41 }
42 }
43 if (flags.register) {
44 window.CustomElements = window.CustomElements || {
45 flags: {}
46 };
47 window.CustomElements.flags.register = flags.register;
48 }
49 WebComponents.flags = flags;
50 })();
51
52 (function(scope) {
53 "use strict";
54 var hasWorkingUrl = false;
55 if (!scope.forceJURL) {
56 try {
57 var u = new URL("b", "http://a");
58 u.pathname = "c%20d";
59 hasWorkingUrl = u.href === "http://a/c%20d";
60 } catch (e) {}
61 }
62 if (hasWorkingUrl) return;
63 var relative = Object.create(null);
64 relative["ftp"] = 21;
65 relative["file"] = 0;
66 relative["gopher"] = 70;
67 relative["http"] = 80;
68 relative["https"] = 443;
69 relative["ws"] = 80;
70 relative["wss"] = 443;
71 var relativePathDotMapping = Object.create(null);
72 relativePathDotMapping["%2e"] = ".";
73 relativePathDotMapping[".%2e"] = "..";
74 relativePathDotMapping["%2e."] = "..";
75 relativePathDotMapping["%2e%2e"] = "..";
76 function isRelativeScheme(scheme) {
77 return relative[scheme] !== undefined;
78 }
79 function invalid() {
80 clear.call(this);
81 this._isInvalid = true;
82 }
83 function IDNAToASCII(h) {
84 if ("" == h) {
85 invalid.call(this);
86 }
87 return h.toLowerCase();
88 }
89 function percentEscape(c) {
90 var unicode = c.charCodeAt(0);
91 if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) {
92 return c;
93 }
94 return encodeURIComponent(c);
95 }
96 function percentEscapeQuery(c) {
97 var unicode = c.charCodeAt(0);
98 if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) {
99 return c;
100 }
101 return encodeURIComponent(c);
102 }
103 var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/;
104 function parse(input, stateOverride, base) {
105 function err(message) {
106 errors.push(message);
107 }
108 var state = stateOverride || "scheme start", cursor = 0, buffer = "", seenAt = false, seenBracket = false, errors = [];
109 loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {
110 var c = input[cursor];
111 switch (state) {
112 case "scheme start":
113 if (c && ALPHA.test(c)) {
114 buffer += c.toLowerCase();
115 state = "scheme";
116 } else if (!stateOverride) {
117 buffer = "";
118 state = "no scheme";
119 continue;
120 } else {
121 err("Invalid scheme.");
122 break loop;
123 }
124 break;
125
126 case "scheme":
127 if (c && ALPHANUMERIC.test(c)) {
128 buffer += c.toLowerCase();
129 } else if (":" == c) {
130 this._scheme = buffer;
131 buffer = "";
132 if (stateOverride) {
133 break loop;
134 }
135 if (isRelativeScheme(this._scheme)) {
136 this._isRelative = true;
137 }
138 if ("file" == this._scheme) {
139 state = "relative";
140 } else if (this._isRelative && base && base._scheme == this._scheme) {
141 state = "relative or authority";
142 } else if (this._isRelative) {
143 state = "authority first slash";
144 } else {
145 state = "scheme data";
146 }
147 } else if (!stateOverride) {
148 buffer = "";
149 cursor = 0;
150 state = "no scheme";
151 continue;
152 } else if (EOF == c) {
153 break loop;
154 } else {
155 err("Code point not allowed in scheme: " + c);
156 break loop;
157 }
158 break;
159
160 case "scheme data":
161 if ("?" == c) {
162 this._query = "?";
163 state = "query";
164 } else if ("#" == c) {
165 this._fragment = "#";
166 state = "fragment";
167 } else {
168 if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
169 this._schemeData += percentEscape(c);
170 }
171 }
172 break;
173
174 case "no scheme":
175 if (!base || !isRelativeScheme(base._scheme)) {
176 err("Missing scheme.");
177 invalid.call(this);
178 } else {
179 state = "relative";
180 continue;
181 }
182 break;
183
184 case "relative or authority":
185 if ("/" == c && "/" == input[cursor + 1]) {
186 state = "authority ignore slashes";
187 } else {
188 err("Expected /, got: " + c);
189 state = "relative";
190 continue;
191 }
192 break;
193
194 case "relative":
195 this._isRelative = true;
196 if ("file" != this._scheme) this._scheme = base._scheme;
197 if (EOF == c) {
198 this._host = base._host;
199 this._port = base._port;
200 this._path = base._path.slice();
201 this._query = base._query;
202 this._username = base._username;
203 this._password = base._password;
204 break loop;
205 } else if ("/" == c || "\\" == c) {
206 if ("\\" == c) err("\\ is an invalid code point.");
207 state = "relative slash";
208 } else if ("?" == c) {
209 this._host = base._host;
210 this._port = base._port;
211 this._path = base._path.slice();
212 this._query = "?";
213 this._username = base._username;
214 this._password = base._password;
215 state = "query";
216 } else if ("#" == c) {
217 this._host = base._host;
218 this._port = base._port;
219 this._path = base._path.slice();
220 this._query = base._query;
221 this._fragment = "#";
222 this._username = base._username;
223 this._password = base._password;
224 state = "fragment";
225 } else {
226 var nextC = input[cursor + 1];
227 var nextNextC = input[cursor + 2];
228 if ("file" != this._scheme || !ALPHA.test(c) || nextC != ":" && nextC != "|" || EOF != nextNextC && "/" != nextNextC && "\\" != nextNextC && "?" != nextNextC && "#" != nextNextC) {
229 this._host = base._host;
230 this._port = base._port;
231 this._username = base._username;
232 this._password = base._password;
233 this._path = base._path.slice();
234 this._path.pop();
235 }
236 state = "relative path";
237 continue;
238 }
239 break;
240
241 case "relative slash":
242 if ("/" == c || "\\" == c) {
243 if ("\\" == c) {
244 err("\\ is an invalid code point.");
245 }
246 if ("file" == this._scheme) {
247 state = "file host";
248 } else {
249 state = "authority ignore slashes";
250 }
251 } else {
252 if ("file" != this._scheme) {
253 this._host = base._host;
254 this._port = base._port;
255 this._username = base._username;
256 this._password = base._password;
257 }
258 state = "relative path";
259 continue;
260 }
261 break;
262
263 case "authority first slash":
264 if ("/" == c) {
265 state = "authority second slash";
266 } else {
267 err("Expected '/', got: " + c);
268 state = "authority ignore slashes";
269 continue;
270 }
271 break;
272
273 case "authority second slash":
274 state = "authority ignore slashes";
275 if ("/" != c) {
276 err("Expected '/', got: " + c);
277 continue;
278 }
279 break;
280
281 case "authority ignore slashes":
282 if ("/" != c && "\\" != c) {
283 state = "authority";
284 continue;
285 } else {
286 err("Expected authority, got: " + c);
287 }
288 break;
289
290 case "authority":
291 if ("@" == c) {
292 if (seenAt) {
293 err("@ already seen.");
294 buffer += "%40";
295 }
296 seenAt = true;
297 for (var i = 0; i < buffer.length; i++) {
298 var cp = buffer[i];
299 if ("\t" == cp || "\n" == cp || "\r" == cp) {
300 err("Invalid whitespace in authority.");
301 continue;
302 }
303 if (":" == cp && null === this._password) {
304 this._password = "";
305 continue;
306 }
307 var tempC = percentEscape(cp);
308 null !== this._password ? this._password += tempC : this._username += tempC;
309 }
310 buffer = "";
311 } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
312 cursor -= buffer.length;
313 buffer = "";
314 state = "host";
315 continue;
316 } else {
317 buffer += c;
318 }
319 break;
320
321 case "file host":
322 if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
323 if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ":" || buffer[1] == "|")) {
324 state = "relative path";
325 } else if (buffer.length == 0) {
326 state = "relative path start";
327 } else {
328 this._host = IDNAToASCII.call(this, buffer);
329 buffer = "";
330 state = "relative path start";
331 }
332 continue;
333 } else if ("\t" == c || "\n" == c || "\r" == c) {
334 err("Invalid whitespace in file host.");
335 } else {
336 buffer += c;
337 }
338 break;
339
340 case "host":
341 case "hostname":
342 if (":" == c && !seenBracket) {
343 this._host = IDNAToASCII.call(this, buffer);
344 buffer = "";
345 state = "port";
346 if ("hostname" == stateOverride) {
347 break loop;
348 }
349 } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
350 this._host = IDNAToASCII.call(this, buffer);
351 buffer = "";
352 state = "relative path start";
353 if (stateOverride) {
354 break loop;
355 }
356 continue;
357 } else if ("\t" != c && "\n" != c && "\r" != c) {
358 if ("[" == c) {
359 seenBracket = true;
360 } else if ("]" == c) {
361 seenBracket = false;
362 }
363 buffer += c;
364 } else {
365 err("Invalid code point in host/hostname: " + c);
366 }
367 break;
368
369 case "port":
370 if (/[0-9]/.test(c)) {
371 buffer += c;
372 } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c || stateOverride) {
373 if ("" != buffer) {
374 var temp = parseInt(buffer, 10);
375 if (temp != relative[this._scheme]) {
376 this._port = temp + "";
377 }
378 buffer = "";
379 }
380 if (stateOverride) {
381 break loop;
382 }
383 state = "relative path start";
384 continue;
385 } else if ("\t" == c || "\n" == c || "\r" == c) {
386 err("Invalid code point in port: " + c);
387 } else {
388 invalid.call(this);
389 }
390 break;
391
392 case "relative path start":
393 if ("\\" == c) err("'\\' not allowed in path.");
394 state = "relative path";
395 if ("/" != c && "\\" != c) {
396 continue;
397 }
398 break;
399
400 case "relative path":
401 if (EOF == c || "/" == c || "\\" == c || !stateOverride && ("?" == c || "#" == c)) {
402 if ("\\" == c) {
403 err("\\ not allowed in relative path.");
404 }
405 var tmp;
406 if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
407 buffer = tmp;
408 }
409 if (".." == buffer) {
410 this._path.pop();
411 if ("/" != c && "\\" != c) {
412 this._path.push("");
413 }
414 } else if ("." == buffer && "/" != c && "\\" != c) {
415 this._path.push("");
416 } else if ("." != buffer) {
417 if ("file" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == "|") {
418 buffer = buffer[0] + ":";
419 }
420 this._path.push(buffer);
421 }
422 buffer = "";
423 if ("?" == c) {
424 this._query = "?";
425 state = "query";
426 } else if ("#" == c) {
427 this._fragment = "#";
428 state = "fragment";
429 }
430 } else if ("\t" != c && "\n" != c && "\r" != c) {
431 buffer += percentEscape(c);
432 }
433 break;
434
435 case "query":
436 if (!stateOverride && "#" == c) {
437 this._fragment = "#";
438 state = "fragment";
439 } else if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
440 this._query += percentEscapeQuery(c);
441 }
442 break;
443
444 case "fragment":
445 if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
446 this._fragment += c;
447 }
448 break;
449 }
450 cursor++;
451 }
452 }
453 function clear() {
454 this._scheme = "";
455 this._schemeData = "";
456 this._username = "";
457 this._password = null;
458 this._host = "";
459 this._port = "";
460 this._path = [];
461 this._query = "";
462 this._fragment = "";
463 this._isInvalid = false;
464 this._isRelative = false;
465 }
466 function jURL(url, base) {
467 if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base));
468 this._url = url;
469 clear.call(this);
470 var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
471 parse.call(this, input, null, base);
472 }
473 jURL.prototype = {
474 toString: function() {
475 return this.href;
476 },
477 get href() {
478 if (this._isInvalid) return this._url;
479 var authority = "";
480 if ("" != this._username || null != this._password) {
481 authority = this._username + (null != this._password ? ":" + this._password : "") + "@";
482 }
483 return this.protocol + (this._isRelative ? "//" + authority + this.host : "") + this.pathname + this._query + this._fragment;
484 },
485 set href(href) {
486 clear.call(this);
487 parse.call(this, href);
488 },
489 get protocol() {
490 return this._scheme + ":";
491 },
492 set protocol(protocol) {
493 if (this._isInvalid) return;
494 parse.call(this, protocol + ":", "scheme start");
495 },
496 get host() {
497 return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host;
498 },
499 set host(host) {
500 if (this._isInvalid || !this._isRelative) return;
501 parse.call(this, host, "host");
502 },
503 get hostname() {
504 return this._host;
505 },
506 set hostname(hostname) {
507 if (this._isInvalid || !this._isRelative) return;
508 parse.call(this, hostname, "hostname");
509 },
510 get port() {
511 return this._port;
512 },
513 set port(port) {
514 if (this._isInvalid || !this._isRelative) return;
515 parse.call(this, port, "port");
516 },
517 get pathname() {
518 return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData;
519 },
520 set pathname(pathname) {
521 if (this._isInvalid || !this._isRelative) return;
522 this._path = [];
523 parse.call(this, pathname, "relative path start");
524 },
525 get search() {
526 return this._isInvalid || !this._query || "?" == this._query ? "" : this._query;
527 },
528 set search(search) {
529 if (this._isInvalid || !this._isRelative) return;
530 this._query = "?";
531 if ("?" == search[0]) search = search.slice(1);
532 parse.call(this, search, "query");
533 },
534 get hash() {
535 return this._isInvalid || !this._fragment || "#" == this._fragment ? "" : this._fragment;
536 },
537 set hash(hash) {
538 if (this._isInvalid) return;
539 this._fragment = "#";
540 if ("#" == hash[0]) hash = hash.slice(1);
541 parse.call(this, hash, "fragment");
542 },
543 get origin() {
544 var host;
545 if (this._isInvalid || !this._scheme) {
546 return "";
547 }
548 switch (this._scheme) {
549 case "data":
550 case "file":
551 case "javascript":
552 case "mailto":
553 return "null";
554 }
555 host = this.host;
556 if (!host) {
557 return "";
558 }
559 return this._scheme + "://" + host;
560 }
561 };
562 var OriginalURL = scope.URL;
563 if (OriginalURL) {
564 jURL.createObjectURL = function(blob) {
565 return OriginalURL.createObjectURL.apply(OriginalURL, arguments);
566 };
567 jURL.revokeObjectURL = function(url) {
568 OriginalURL.revokeObjectURL(url);
569 };
570 }
571 scope.URL = jURL;
572 })(self);
573
11
574 if (typeof WeakMap === "undefined") {
12 Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
575 (function() {
13 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
576 var defineProperty = Object.defineProperty;
14 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
577 var counter = Date.now() % 1e9;
15 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
578 var WeakMap = function() {
16 Code distributed by Google as part of the polymer project is also
579 this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
17 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
580 };
18 */
581 WeakMap.prototype = {
19 'use strict';var p,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ea="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ha(){ha=function(){};ea.Symbol||(ea.Symbol=ia)}var ia=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}();
582 set: function(key, value) {
20 function ja(){ha();var a=ea.Symbol.iterator;a||(a=ea.Symbol.iterator=ea.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ka(this)}});ja=function(){}}function ka(a){var b=0;return la(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function la(a){ja();a={next:a};a[ea.Symbol.iterator]=function(){return this};return a}function ma(a){ja();var b=a[Symbol.iterator];return b?b.call(a):ka(a)}
583 var entry = key[this.name];
21 function na(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}
584 if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
22 (function(){if(!function(){var a=document.createEvent("Event");a.initEvent("foo",!0,!0);a.preventDefault();return a.defaultPrevented}()){var a=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(a.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var b=/Trident/.test(navigator.userAgent);if(!window.CustomEvent||b&&"function"!==typeof window.CustomEvent)window.CustomEvent=function(a,b){b=b||{};var c=document.createEvent("CustomEvent");
585 value: [ key, value ],
23 c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c},window.CustomEvent.prototype=window.Event.prototype;if(!window.Event||b&&"function"!==typeof window.Event){var c=window.Event;window.Event=function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};if(c)for(var d in c)window.Event[d]=c[d];window.Event.prototype=c.prototype}if(!window.MouseEvent||b&&"function"!==typeof window.MouseEvent){b=window.MouseEvent;window.MouseEvent=function(a,
586 writable: true
24 b){b=b||{};var c=document.createEvent("MouseEvent");c.initMouseEvent(a,!!b.bubbles,!!b.cancelable,b.view||window,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);return c};if(b)for(d in b)window.MouseEvent[d]=b[d];window.MouseEvent.prototype=b.prototype}Array.from||(Array.from=function(a){return[].slice.call(a)});Object.assign||(Object.assign=function(a,b){for(var c=[].slice.call(arguments,1),d=0,e;d<c.length;d++)if(e=c[d])for(var f=
587 });
25 a,m=e,n=Object.getOwnPropertyNames(m),t=0;t<n.length;t++)e=n[t],f[e]=m[e];return a})})(window.WebComponents);(function(){function a(){}function b(a,b){if(!a.childNodes.length)return[];switch(a.nodeType){case Node.DOCUMENT_NODE:return ya.call(a,b);case Node.DOCUMENT_FRAGMENT_NODE:return qb.call(a,b);default:return ba.call(a,b)}}var c="undefined"===typeof HTMLTemplateElement,d=!(document.createDocumentFragment().cloneNode()instanceof DocumentFragment),e=!1;/Trident/.test(navigator.userAgent)&&function(){function a(a,b){if(a instanceof DocumentFragment)for(var d;d=a.firstChild;)c.call(this,d,b);else c.call(this,
588 return this;
26 a,b);return a}e=!0;var b=Node.prototype.cloneNode;Node.prototype.cloneNode=function(a){a=b.call(this,a);this instanceof DocumentFragment&&(a.__proto__=DocumentFragment.prototype);return a};DocumentFragment.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll;DocumentFragment.prototype.querySelector=HTMLElement.prototype.querySelector;Object.defineProperties(DocumentFragment.prototype,{nodeType:{get:function(){return Node.DOCUMENT_FRAGMENT_NODE},configurable:!0},localName:{get:function(){},
589 },
27 configurable:!0},nodeName:{get:function(){return"#document-fragment"},configurable:!0}});var c=Node.prototype.insertBefore;Node.prototype.insertBefore=a;var d=Node.prototype.appendChild;Node.prototype.appendChild=function(b){b instanceof DocumentFragment?a.call(this,b,null):d.call(this,b);return b};var f=Node.prototype.removeChild,h=Node.prototype.replaceChild;Node.prototype.replaceChild=function(b,c){b instanceof DocumentFragment?(a.call(this,b,c),f.call(this,c)):h.call(this,b,c);return c};Document.prototype.createDocumentFragment=
590 get: function(key) {
28 function(){var a=this.createElement("df");a.__proto__=DocumentFragment.prototype;return a};var g=Document.prototype.importNode;Document.prototype.importNode=function(a,b){b=g.call(this,a,b||!1);a instanceof DocumentFragment&&(b.__proto__=DocumentFragment.prototype);return b}}();var f=Node.prototype.cloneNode,h=Document.prototype.createElement,g=Document.prototype.importNode,k=Node.prototype.removeChild,l=Node.prototype.appendChild,m=Node.prototype.replaceChild,n=DOMParser.prototype.parseFromString,
591 var entry;
29 t=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),C=Object.getOwnPropertyDescriptor(window.Node.prototype,"childNodes"),ba=Element.prototype.querySelectorAll,ya=Document.prototype.querySelectorAll,qb=DocumentFragment.prototype.querySelectorAll,rb=function(){if(!c){var a=document.createElement("template"),b=document.createElement("template");b.content.appendChild(document.createElement("div"));a.content.appendChild(b);a=a.cloneNode(!0);return 0===a.content.childNodes.length||
592 return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
30 0===a.content.firstChild.content.childNodes.length||d}}();if(c){var V=document.implementation.createHTMLDocument("template"),D=!0,ca=document.createElement("style");ca.textContent="template{display:none;}";var oa=document.head;oa.insertBefore(ca,oa.firstElementChild);a.prototype=Object.create(HTMLElement.prototype);var za=!document.createElement("div").hasOwnProperty("innerHTML");a.I=function(b){if(!b.content&&b.namespaceURI===document.documentElement.namespaceURI){b.content=V.createDocumentFragment();
593 },
31 for(var c;c=b.firstChild;)l.call(b.content,c);if(za)b.__proto__=a.prototype;else if(b.cloneNode=function(b){return a.a(this,b)},D)try{T(b),da(b)}catch(Gh){D=!1}a.C(b.content)}};var fa={option:["select"],thead:["table"],col:["colgroup","table"],tr:["tbody","table"],th:["tr","tbody","table"],td:["tr","tbody","table"]},T=function(b){Object.defineProperty(b,"innerHTML",{get:function(){return sb(this)},set:function(b){var c=fa[(/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(b)||["",""])[1].toLowerCase()];if(c)for(var d=
594 "delete": function(key) {
32 0;d<c.length;d++)b="<"+c[d]+">"+b+"</"+c[d]+">";V.body.innerHTML=b;for(a.C(V);this.content.firstChild;)k.call(this.content,this.content.firstChild);b=V.body;if(c)for(d=0;d<c.length;d++)b=b.lastChild;for(;b.firstChild;)l.call(this.content,b.firstChild)},configurable:!0})},da=function(a){Object.defineProperty(a,"outerHTML",{get:function(){return"<template>"+this.innerHTML+"</template>"},set:function(a){if(this.parentNode){V.body.innerHTML=a;for(a=this.ownerDocument.createDocumentFragment();V.body.firstChild;)l.call(a,
595 var entry = key[this.name];
33 V.body.firstChild);m.call(this.parentNode,a,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};T(a.prototype);da(a.prototype);a.C=function(c){c=b(c,"template");for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)a.I(f)};document.addEventListener("DOMContentLoaded",function(){a.C(document)});Document.prototype.createElement=function(){var b=h.apply(this,arguments);"template"===b.localName&&a.I(b);return b};DOMParser.prototype.parseFromString=
596 if (!entry || entry[0] !== key) return false;
34 function(){var b=n.apply(this,arguments);a.C(b);return b};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return sb(this)},set:function(b){t.set.call(this,b);a.C(this)},configurable:!0,enumerable:!0});var sf=/[&\u00A0"]/g,Kc=/[&\u00A0<>]/g,Lc=function(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";case '"':return"&quot;";case "\u00a0":return"&nbsp;"}};ca=function(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b};var tf=ca("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),
597 entry[0] = entry[1] = undefined;
35 uf=ca("style script xmp iframe noembed noframes plaintext noscript".split(" ")),sb=function(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):C.get.call(a),e=0,f=d.length,h;e<f&&(h=d[e]);e++){a:{var g=h;var k=a;var l=b;switch(g.nodeType){case Node.ELEMENT_NODE:for(var T=g.localName,m="<"+T,da=g.attributes,n=0;k=da[n];n++)m+=" "+k.name+'="'+k.value.replace(sf,Lc)+'"';m+=">";g=tf[T]?m:m+sb(g,l)+"</"+T+">";break a;case Node.TEXT_NODE:g=g.data;g=k&&uf[k.localName]?g:g.replace(Kc,Lc);
598 return true;
36 break a;case Node.COMMENT_NODE:g="\x3c!--"+g.data+"--\x3e";break a;default:throw window.console.error(g),Error("not implemented");}}c+=g}return c}}if(c||rb){a.a=function(a,b){var c=f.call(a,!1);this.I&&this.I(c);b&&(l.call(c.content,f.call(a.content,!0)),tb(c.content,a.content));return c};var tb=function(c,d){if(d.querySelectorAll&&(d=b(d,"template"),0!==d.length)){c=b(c,"template");for(var e=0,f=c.length,h,g;e<f;e++)g=d[e],h=c[e],a&&a.I&&a.I(g),m.call(h.parentNode,vf.call(g,!0),h)}},vf=Node.prototype.cloneNode=
599 },
37 function(b){if(!e&&d&&this instanceof DocumentFragment)if(b)var c=wf.call(this.ownerDocument,this,!0);else return this.ownerDocument.createDocumentFragment();else this.nodeType===Node.ELEMENT_NODE&&"template"===this.localName&&this.namespaceURI==document.documentElement.namespaceURI?c=a.a(this,b):c=f.call(this,b);b&&tb(c,this);return c},wf=Document.prototype.importNode=function(c,d){d=d||!1;if("template"===c.localName)return a.a(c,d);var e=g.call(this,c,d);if(d){tb(e,c);c=b(e,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"]');
600 has: function(key) {
38 for(var f,k=0;k<c.length;k++){f=c[k];d=h.call(document,"script");d.textContent=f.textContent;for(var l=f.attributes,T=0,da;T<l.length;T++)da=l[T],d.setAttribute(da.name,da.value);m.call(f.parentNode,d,f)}}return e}}c&&(window.HTMLTemplateElement=a)})();var pa;Array.isArray?pa=Array.isArray:pa=function(a){return"[object Array]"===Object.prototype.toString.call(a)};var qa=pa;var ra=0,sa,ta="undefined"!==typeof window?window:void 0,ua=ta||{},va=ua.MutationObserver||ua.WebKitMutationObserver,wa="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;function xa(){return"undefined"!==typeof sa?function(){sa(Aa)}:Ba()}function Ca(){var a=0,b=new va(Aa),c=document.createTextNode("");b.observe(c,{characterData:!0});return function(){c.data=a=++a%2}}
601 var entry = key[this.name];
39 function Da(){var a=new MessageChannel;a.port1.onmessage=Aa;return function(){return a.port2.postMessage(0)}}function Ba(){var a=setTimeout;return function(){return a(Aa,1)}}var Ea=Array(1E3);function Aa(){for(var a=0;a<ra;a+=2)(0,Ea[a])(Ea[a+1]),Ea[a]=void 0,Ea[a+1]=void 0;ra=0}var Fa,Ga;
602 if (!entry) return false;
40 if("undefined"===typeof self&&"undefined"!==typeof process&&"[object process]"==={}.toString.call(process))Ga=function(){return process.vb(Aa)};else{var Ha;if(va)Ha=Ca();else{var Ia;if(wa)Ia=Da();else{var Ja;if(void 0===ta&&"function"===typeof require)try{var Ka=require("vertx");sa=Ka.xb||Ka.wb;Ja=xa()}catch(a){Ja=Ba()}else Ja=Ba();Ia=Ja}Ha=Ia}Ga=Ha}Fa=Ga;function La(a,b){Ea[ra]=a;Ea[ra+1]=b;ra+=2;2===ra&&Fa()};function Ma(a,b){var c=this,d=new this.constructor(Na);void 0===d[Oa]&&Pa(d);var e=c.h;if(e){var f=arguments[e-1];La(function(){return Qa(e,d,f,c.f)})}else Ra(c,d,a,b);return d};function Sa(a){if(a&&"object"===typeof a&&a.constructor===this)return a;var b=new this(Na);Ta(b,a);return b};var Oa=Math.random().toString(36).substring(16);function Na(){}var Va=new Ua;function Wa(a){try{return a.then}catch(b){return Va.error=b,Va}}function Xa(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function Ya(a,b,c){La(function(a){var d=!1,f=Xa(c,b,function(c){d||(d=!0,b!==c?Ta(a,c):q(a,c))},function(b){d||(d=!0,r(a,b))});!d&&f&&(d=!0,r(a,f))},a)}function Za(a,b){1===b.h?q(a,b.f):2===b.h?r(a,b.f):Ra(b,void 0,function(b){return Ta(a,b)},function(b){return r(a,b)})}
603 return entry[0] === key;
41 function $a(a,b,c){b.constructor===a.constructor&&c===Ma&&b.constructor.resolve===Sa?Za(a,b):c===Va?(r(a,Va.error),Va.error=null):void 0===c?q(a,b):"function"===typeof c?Ya(a,b,c):q(a,b)}function Ta(a,b){if(a===b)r(a,new TypeError("You cannot resolve a promise with itself"));else{var c=typeof b;null===b||"object"!==c&&"function"!==c?q(a,b):$a(a,b,Wa(b))}}function ab(a){a.va&&a.va(a.f);bb(a)}function q(a,b){void 0===a.h&&(a.f=b,a.h=1,0!==a.M.length&&La(bb,a))}
604 }
42 function r(a,b){void 0===a.h&&(a.h=2,a.f=b,La(ab,a))}function Ra(a,b,c,d){var e=a.M,f=e.length;a.va=null;e[f]=b;e[f+1]=c;e[f+2]=d;0===f&&a.h&&La(bb,a)}function bb(a){var b=a.M,c=a.h;if(0!==b.length){for(var d,e,f=a.f,h=0;h<b.length;h+=3)d=b[h],e=b[h+c],d?Qa(c,d,e,f):e(f);a.M.length=0}}function Ua(){this.error=null}var cb=new Ua;
605 };
43 function Qa(a,b,c,d){var e="function"===typeof c;if(e){try{var f=c(d)}catch(l){cb.error=l,f=cb}if(f===cb){var h=!0;var g=f.error;f.error=null}else var k=!0;if(b===f){r(b,new TypeError("A promises callback cannot return that same promise."));return}}else f=d,k=!0;void 0===b.h&&(e&&k?Ta(b,f):h?r(b,g):1===a?q(b,f):2===a&&r(b,f))}function db(a,b){try{b(function(b){Ta(a,b)},function(b){r(a,b)})}catch(c){r(a,c)}}var eb=0;function Pa(a){a[Oa]=eb++;a.h=void 0;a.f=void 0;a.M=[]};function fb(a,b){this.Ka=a;this.F=new a(Na);this.F[Oa]||Pa(this.F);if(qa(b))if(this.V=this.length=b.length,this.f=Array(this.length),0===this.length)q(this.F,this.f);else{this.length=this.length||0;for(a=0;void 0===this.h&&a<b.length;a++)gb(this,b[a],a);0===this.V&&q(this.F,this.f)}else r(this.F,Error("Array Methods must be provided an Array"))}
606 window.WeakMap = WeakMap;
44 function gb(a,b,c){var d=a.Ka,e=d.resolve;e===Sa?(e=Wa(b),e===Ma&&void 0!==b.h?hb(a,b.h,c,b.f):"function"!==typeof e?(a.V--,a.f[c]=b):d===u?(d=new d(Na),$a(d,b,e),ib(a,d,c)):ib(a,new d(function(a){return a(b)}),c)):ib(a,e(b),c)}function hb(a,b,c,d){var e=a.F;void 0===e.h&&(a.V--,2===b?r(e,d):a.f[c]=d);0===a.V&&q(e,a.f)}function ib(a,b,c){Ra(b,void 0,function(b){return hb(a,1,c,b)},function(b){return hb(a,2,c,b)})};function jb(a){return(new fb(this,a)).F};function kb(a){var b=this;return qa(a)?new b(function(c,d){for(var e=a.length,f=0;f<e;f++)b.resolve(a[f]).then(c,d)}):new b(function(a,b){return b(new TypeError("You must pass an array to race."))})};function lb(a){var b=new this(Na);r(b,a);return b};function u(a){this[Oa]=eb++;this.f=this.h=void 0;this.M=[];if(Na!==a){if("function"!==typeof a)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(this instanceof u)db(this,a);else throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");}}u.prototype={constructor:u,then:Ma,a:function(a){return this.then(null,a)}};/*
607 })();
608 }
609
45
610 (function(global) {
46 Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
611 if (global.JsMutationObserver) {
47 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
612 return;
48 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
613 }
49 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
614 var registrationsTable = new WeakMap();
50 Code distributed by Google as part of the polymer project is also
615 var setImmediate;
51 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
616 if (/Trident|Edge/.test(navigator.userAgent)) {
52 */
617 setImmediate = setTimeout;
53 window.Promise||(window.Promise=u,u.prototype["catch"]=u.prototype.a,u.prototype.then=u.prototype.then,u.all=jb,u.race=kb,u.resolve=Sa,u.reject=lb);(function(a){function b(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function c(a){if(C)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!g(b)&&(b=b.parentNode););a.__importDoc=b}return b}function d(a){var b=m(document,"link[rel=import]:not([import-dependency])"),
618 } else if (window.setImmediate) {
54 c=b.length;c?n(b,function(b){return h(b,function(){0===--c&&a()})}):a()}function e(a){function b(){"loading"!==document.readyState&&document.body&&(document.removeEventListener("readystatechange",b),a())}document.addEventListener("readystatechange",b);b()}function f(a){e(function(){return d(function(){return a&&a()})})}function h(a,b){if(a.__loaded)b&&b();else if("script"===a.localName&&!a.src||"style"===a.localName&&!a.firstChild)a.__loaded=!0,b&&b();else{var c=function(d){a.removeEventListener(d.type,
619 setImmediate = window.setImmediate;
55 c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);oa&&"style"===a.localName||a.addEventListener("error",c)}}function g(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.a={};this.b=0;this.c=new MutationObserver(function(b){return a.Va(b)});this.c.observe(document.head,{childList:!0,subtree:!0});this.loadImports(document)}function l(a){n(m(a,"template"),function(a){n(m(a.content,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'),
620 } else {
56 function(a){var b=document.createElement("script");n(a.attributes,function(a){return b.setAttribute(a.name,a.value)});b.textContent=a.textContent;a.parentNode.replaceChild(b,a)});l(a.content)})}function m(a,b){return a.childNodes.length?a.querySelectorAll(b):ba}function n(a,b,c){var d=a?a.length:0,e=c?-1:1;for(c=c?d-1:0;c<d&&0<=c;c+=e)b(a[c],c)}var t=document.createElement("link"),C="import"in t,ba=t.querySelectorAll("*"),ya=null;!1==="currentScript"in document&&Object.defineProperty(document,"currentScript",
621 var setImmediateQueue = [];
57 {get:function(){return ya||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null)},configurable:!0});var qb=/(url\()([^)]*)(\))/g,rb=/(@import[\s]+(?!url\())([^;]*)(;)/g,V=/(<link[^>]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,D={Pa:function(a,b){a.href&&a.setAttribute("href",D.ba(a.getAttribute("href"),b));a.src&&a.setAttribute("src",D.ba(a.getAttribute("src"),b));if("style"===a.localName){var c=D.za(a.textContent,b,qb);a.textContent=D.za(c,b,rb)}},za:function(a,b,c){return a.replace(c,
622 var sentinel = String(Math.random());
58 function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=D.ba(a,b));return c+"'"+a+"'"+e})},ba:function(a,b){if(void 0===D.ha){D.ha=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";D.ha="http://a/c%20d"===c.href}catch(Kc){}}if(D.ha)return(new URL(a,b)).href;c=D.Ha;c||(c=document.implementation.createHTMLDocument("temp"),D.Ha=c,c.ra=c.createElement("base"),c.head.appendChild(c.ra),c.qa=c.createElement("a"));c.ra.href=b;c.qa.href=a;return c.qa.href||a}},ca={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a=
623 window.addEventListener("message", function(e) {
59 a.split(",");var d=a[1];d=-1<a[0].indexOf(";base64")?atob(d):decodeURIComponent(d);b(d)}else{var e=new XMLHttpRequest;e.open("GET",a,ca.async);e.onload=function(){var a=e.responseURL||e.getResponseHeader("Location");a&&0===a.indexOf("/")&&(a=(location.origin||location.protocol+"//"+location.host)+a);var d=e.response||e.responseText;304===e.status||0===e.status||200<=e.status&&300>e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},oa=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent);
624 if (e.data === sentinel) {
60 k.prototype.loadImports=function(a){var b=this;a=m(a,"link[rel=import]");n(a,function(a){return b.o(a)})};k.prototype.o=function(a){var b=this,c=a.href;if(void 0!==this.a[c]){var d=this.a[c];d&&d.__loaded&&(a.__import=d,this.i(a))}else this.b++,this.a[c]="pending",ca.load(c,function(a,d){a=b.Wa(a,d||c);b.a[c]=a;b.b--;b.loadImports(a);b.J()},function(){b.a[c]=null;b.b--;b.J()})};k.prototype.Wa=function(a,b){if(!a)return document.createDocumentFragment();oa&&(a=a.replace(V,function(a,b,c){return-1===
625 var queue = setImmediateQueue;
61 a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content,l(a);else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=D.ba(c.getAttribute("href"),b),c.removeAttribute("href");c=m(a,'link[rel=import],link[rel=stylesheet][href][type=import-disable],style:not([type]),link[rel=stylesheet][href]:not([type]),script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]');
626 setImmediateQueue = [];
62 var d=0;n(c,function(a){h(a);D.Pa(a,b);a.setAttribute("import-dependency","");if("script"===a.localName&&!a.src&&a.textContent){if("module"===a.type)throw Error("Inline module scripts are not supported in HTML Imports.");a.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(a.textContent+("\n//# sourceURL="+b+(d?"-"+d:"")+".js\n")));a.textContent="";d++}});return a};k.prototype.J=function(){var a=this;if(!this.b){this.c.disconnect();this.flatten(document);var b=!1,c=!1,d=function(){c&&
627 queue.forEach(function(func) {
63 b&&(a.loadImports(document),a.b||(a.c.observe(document.head,{childList:!0,subtree:!0}),a.Ta()))};this.Ya(function(){c=!0;d()});this.Xa(function(){b=!0;d()})}};k.prototype.flatten=function(a){var b=this;a=m(a,"link[rel=import]");n(a,function(a){var c=b.a[a.href];(a.__import=c)&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b.a[a.href]=a,a.readyState="loading",a.__import=a,b.flatten(c),a.appendChild(c))})};k.prototype.Xa=function(a){function b(e){if(e<d){var f=c[e],g=document.createElement("script");f.removeAttribute("import-dependency");
628 func();
64 n(f.attributes,function(a){return g.setAttribute(a.name,a.value)});ya=g;f.parentNode.replaceChild(g,f);h(g,function(){ya=null;b(e+1)})}else a()}var c=m(document,"script[import-dependency]"),d=c.length;b(0)};k.prototype.Ya=function(a){var b=m(document,"style[import-dependency],link[rel=stylesheet][import-dependency]"),d=b.length;if(d){var e=oa&&!!document.querySelector("link[rel=stylesheet][href][type=import-disable]");n(b,function(b){h(b,function(){b.removeAttribute("import-dependency");0===--d&&
629 });
65 a()});if(e&&b.parentNode!==document.head){var f=document.createElement(b.localName);f.__appliedElement=b;f.setAttribute("type","import-placeholder");b.parentNode.insertBefore(f,b.nextSibling);for(f=c(b);f&&c(f);)f=c(f);f.parentNode!==document.head&&(f=null);document.head.insertBefore(b,f);b.removeAttribute("type")}})}else a()};k.prototype.Ta=function(){var a=this,b=m(document,"link[rel=import]");n(b,function(b){return a.i(b)},!0)};k.prototype.i=function(a){a.__loaded||(a.__loaded=!0,a.import&&(a.import.readyState=
630 }
66 "complete"),a.dispatchEvent(b(a.import?"load":"error",{bubbles:!1,cancelable:!1,detail:void 0})))};k.prototype.Va=function(a){var b=this;n(a,function(a){return n(a.addedNodes,function(a){a&&a.nodeType===Node.ELEMENT_NODE&&(g(a)?b.o(a):b.loadImports(a))})})};var za=null;if(C)t=m(document,"link[rel=import]"),n(t,function(a){a.import&&"loading"===a.import.readyState||(a.__loaded=!0)}),t=function(a){a=a.target;g(a)&&(a.__loaded=!0)},document.addEventListener("load",t,!0),document.addEventListener("error",
631 });
67 t,!0);else{var fa=Object.getOwnPropertyDescriptor(Node.prototype,"baseURI");Object.defineProperty((!fa||fa.configurable?Node:Element).prototype,"baseURI",{get:function(){var a=g(this)?this:c(this);return a?a.href:fa&&fa.get?fa.get.call(this):(document.querySelector("base")||window.location).href},configurable:!0,enumerable:!0});Object.defineProperty(HTMLLinkElement.prototype,"import",{get:function(){return this.__import||null},configurable:!0,enumerable:!0});e(function(){za=new k})}f(function(){return document.dispatchEvent(b("HTMLImportsLoaded",
632 setImmediate = function(func) {
68 {cancelable:!0,bubbles:!0,detail:void 0}))});a.useNative=C;a.whenReady=f;a.importForElement=c;a.loadImports=function(a){za&&za.loadImports(a)}})(window.HTMLImports=window.HTMLImports||{});/*
633 setImmediateQueue.push(func);
634 window.postMessage(sentinel, "*");
635 };
636 }
637 var isScheduled = false;
638 var scheduledObservers = [];
639 function scheduleCallback(observer) {
640 scheduledObservers.push(observer);
641 if (!isScheduled) {
642 isScheduled = true;
643 setImmediate(dispatchCallbacks);
644 }
645 }
646 function wrapIfNeeded(node) {
647 return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
648 }
649 function dispatchCallbacks() {
650 isScheduled = false;
651 var observers = scheduledObservers;
652 scheduledObservers = [];
653 observers.sort(function(o1, o2) {
654 return o1.uid_ - o2.uid_;
655 });
656 var anyNonEmpty = false;
657 observers.forEach(function(observer) {
658 var queue = observer.takeRecords();
659 removeTransientObserversFor(observer);
660 if (queue.length) {
661 observer.callback_(queue, observer);
662 anyNonEmpty = true;
663 }
664 });
665 if (anyNonEmpty) dispatchCallbacks();
666 }
667 function removeTransientObserversFor(observer) {
668 observer.nodes_.forEach(function(node) {
669 var registrations = registrationsTable.get(node);
670 if (!registrations) return;
671 registrations.forEach(function(registration) {
672 if (registration.observer === observer) registration.removeTransientObservers();
673 });
674 });
675 }
676 function forEachAncestorAndObserverEnqueueRecord(target, callback) {
677 for (var node = target; node; node = node.parentNode) {
678 var registrations = registrationsTable.get(node);
679 if (registrations) {
680 for (var j = 0; j < registrations.length; j++) {
681 var registration = registrations[j];
682 var options = registration.options;
683 if (node !== target && !options.subtree) continue;
684 var record = callback(options);
685 if (record) registration.enqueue(record);
686 }
687 }
688 }
689 }
690 var uidCounter = 0;
691 function JsMutationObserver(callback) {
692 this.callback_ = callback;
693 this.nodes_ = [];
694 this.records_ = [];
695 this.uid_ = ++uidCounter;
696 }
697 JsMutationObserver.prototype = {
698 observe: function(target, options) {
699 target = wrapIfNeeded(target);
700 if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
701 throw new SyntaxError();
702 }
703 var registrations = registrationsTable.get(target);
704 if (!registrations) registrationsTable.set(target, registrations = []);
705 var registration;
706 for (var i = 0; i < registrations.length; i++) {
707 if (registrations[i].observer === this) {
708 registration = registrations[i];
709 registration.removeListeners();
710 registration.options = options;
711 break;
712 }
713 }
714 if (!registration) {
715 registration = new Registration(this, target, options);
716 registrations.push(registration);
717 this.nodes_.push(target);
718 }
719 registration.addListeners();
720 },
721 disconnect: function() {
722 this.nodes_.forEach(function(node) {
723 var registrations = registrationsTable.get(node);
724 for (var i = 0; i < registrations.length; i++) {
725 var registration = registrations[i];
726 if (registration.observer === this) {
727 registration.removeListeners();
728 registrations.splice(i, 1);
729 break;
730 }
731 }
732 }, this);
733 this.records_ = [];
734 },
735 takeRecords: function() {
736 var copyOfRecords = this.records_;
737 this.records_ = [];
738 return copyOfRecords;
739 }
740 };
741 function MutationRecord(type, target) {
742 this.type = type;
743 this.target = target;
744 this.addedNodes = [];
745 this.removedNodes = [];
746 this.previousSibling = null;
747 this.nextSibling = null;
748 this.attributeName = null;
749 this.attributeNamespace = null;
750 this.oldValue = null;
751 }
752 function copyMutationRecord(original) {
753 var record = new MutationRecord(original.type, original.target);
754 record.addedNodes = original.addedNodes.slice();
755 record.removedNodes = original.removedNodes.slice();
756 record.previousSibling = original.previousSibling;
757 record.nextSibling = original.nextSibling;
758 record.attributeName = original.attributeName;
759 record.attributeNamespace = original.attributeNamespace;
760 record.oldValue = original.oldValue;
761 return record;
762 }
763 var currentRecord, recordWithOldValue;
764 function getRecord(type, target) {
765 return currentRecord = new MutationRecord(type, target);
766 }
767 function getRecordWithOldValue(oldValue) {
768 if (recordWithOldValue) return recordWithOldValue;
769 recordWithOldValue = copyMutationRecord(currentRecord);
770 recordWithOldValue.oldValue = oldValue;
771 return recordWithOldValue;
772 }
773 function clearRecords() {
774 currentRecord = recordWithOldValue = undefined;
775 }
776 function recordRepresentsCurrentMutation(record) {
777 return record === recordWithOldValue || record === currentRecord;
778 }
779 function selectRecord(lastRecord, newRecord) {
780 if (lastRecord === newRecord) return lastRecord;
781 if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
782 return null;
783 }
784 function Registration(observer, target, options) {
785 this.observer = observer;
786 this.target = target;
787 this.options = options;
788 this.transientObservedNodes = [];
789 }
790 Registration.prototype = {
791 enqueue: function(record) {
792 var records = this.observer.records_;
793 var length = records.length;
794 if (records.length > 0) {
795 var lastRecord = records[length - 1];
796 var recordToReplaceLast = selectRecord(lastRecord, record);
797 if (recordToReplaceLast) {
798 records[length - 1] = recordToReplaceLast;
799 return;
800 }
801 } else {
802 scheduleCallback(this.observer);
803 }
804 records[length] = record;
805 },
806 addListeners: function() {
807 this.addListeners_(this.target);
808 },
809 addListeners_: function(node) {
810 var options = this.options;
811 if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
812 if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
813 if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
814 if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
815 },
816 removeListeners: function() {
817 this.removeListeners_(this.target);
818 },
819 removeListeners_: function(node) {
820 var options = this.options;
821 if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
822 if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
823 if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
824 if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
825 },
826 addTransientObserver: function(node) {
827 if (node === this.target) return;
828 this.addListeners_(node);
829 this.transientObservedNodes.push(node);
830 var registrations = registrationsTable.get(node);
831 if (!registrations) registrationsTable.set(node, registrations = []);
832 registrations.push(this);
833 },
834 removeTransientObservers: function() {
835 var transientObservedNodes = this.transientObservedNodes;
836 this.transientObservedNodes = [];
837 transientObservedNodes.forEach(function(node) {
838 this.removeListeners_(node);
839 var registrations = registrationsTable.get(node);
840 for (var i = 0; i < registrations.length; i++) {
841 if (registrations[i] === this) {
842 registrations.splice(i, 1);
843 break;
844 }
845 }
846 }, this);
847 },
848 handleEvent: function(e) {
849 e.stopImmediatePropagation();
850 switch (e.type) {
851 case "DOMAttrModified":
852 var name = e.attrName;
853 var namespace = e.relatedNode.namespaceURI;
854 var target = e.target;
855 var record = new getRecord("attributes", target);
856 record.attributeName = name;
857 record.attributeNamespace = namespace;
858 var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
859 forEachAncestorAndObserverEnqueueRecord(target, function(options) {
860 if (!options.attributes) return;
861 if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
862 return;
863 }
864 if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
865 return record;
866 });
867 break;
868
869 case "DOMCharacterDataModified":
870 var target = e.target;
871 var record = getRecord("characterData", target);
872 var oldValue = e.prevValue;
873 forEachAncestorAndObserverEnqueueRecord(target, function(options) {
874 if (!options.characterData) return;
875 if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
876 return record;
877 });
878 break;
879
880 case "DOMNodeRemoved":
881 this.addTransientObserver(e.target);
882
69
883 case "DOMNodeInserted":
70 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
884 var changedNode = e.target;
71 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
885 var addedNodes, removedNodes;
72 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
886 if (e.type === "DOMNodeInserted") {
73 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
887 addedNodes = [ changedNode ];
74 Code distributed by Google as part of the polymer project is also
888 removedNodes = [];
75 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
889 } else {
76 */
890 addedNodes = [];
77 window.WebComponents=window.WebComponents||{flags:{}};var mb=document.querySelector('script[src*="webcomponents-lite.js"]'),nb=/wc-(.+)/,v={};if(!v.noOpts){location.search.slice(1).split("&").forEach(function(a){a=a.split("=");var b;a[0]&&(b=a[0].match(nb))&&(v[b[1]]=a[1]||!0)});if(mb)for(var ob=0,pb;pb=mb.attributes[ob];ob++)"src"!==pb.name&&(v[pb.name]=pb.value||!0);if(v.log&&v.log.split){var ub=v.log.split(",");v.log={};ub.forEach(function(a){v.log[a]=!0})}else v.log={}}
891 removedNodes = [ changedNode ];
78 window.WebComponents.flags=v;var vb=v.shadydom;vb&&(window.ShadyDOM=window.ShadyDOM||{},window.ShadyDOM.force=vb);var wb=v.register||v.ce;wb&&window.customElements&&(window.customElements.forcePolyfill=wb);/*
892 }
893 var previousSibling = changedNode.previousSibling;
894 var nextSibling = changedNode.nextSibling;
895 var record = getRecord("childList", e.target.parentNode);
896 record.addedNodes = addedNodes;
897 record.removedNodes = removedNodes;
898 record.previousSibling = previousSibling;
899 record.nextSibling = nextSibling;
900 forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
901 if (!options.childList) return;
902 return record;
903 });
904 }
905 clearRecords();
906 }
907 };
908 global.JsMutationObserver = JsMutationObserver;
909 if (!global.MutationObserver) {
910 global.MutationObserver = JsMutationObserver;
911 JsMutationObserver._isPolyfilled = true;
912 }
913 })(self);
914
915 (function() {
916 var needsTemplate = typeof HTMLTemplateElement === "undefined";
917 if (/Trident/.test(navigator.userAgent)) {
918 (function() {
919 var importNode = document.importNode;
920 document.importNode = function() {
921 var n = importNode.apply(document, arguments);
922 if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
923 var f = document.createDocumentFragment();
924 f.appendChild(n);
925 return f;
926 } else {
927 return n;
928 }
929 };
930 })();
931 }
932 var needsCloning = function() {
933 if (!needsTemplate) {
934 var t = document.createElement("template");
935 var t2 = document.createElement("template");
936 t2.content.appendChild(document.createElement("div"));
937 t.content.appendChild(t2);
938 var clone = t.cloneNode(true);
939 return clone.content.childNodes.length === 0 || clone.content.firstChild.content.childNodes.length === 0;
940 }
941 }();
942 var TEMPLATE_TAG = "template";
943 var TemplateImpl = function() {};
944 if (needsTemplate) {
945 var contentDoc = document.implementation.createHTMLDocument("template");
946 var canDecorate = true;
947 var templateStyle = document.createElement("style");
948 templateStyle.textContent = TEMPLATE_TAG + "{display:none;}";
949 var head = document.head;
950 head.insertBefore(templateStyle, head.firstElementChild);
951 TemplateImpl.prototype = Object.create(HTMLElement.prototype);
952 TemplateImpl.decorate = function(template) {
953 if (template.content) {
954 return;
955 }
956 template.content = contentDoc.createDocumentFragment();
957 var child;
958 while (child = template.firstChild) {
959 template.content.appendChild(child);
960 }
961 template.cloneNode = function(deep) {
962 return TemplateImpl.cloneNode(this, deep);
963 };
964 if (canDecorate) {
965 try {
966 Object.defineProperty(template, "innerHTML", {
967 get: function() {
968 var o = "";
969 for (var e = this.content.firstChild; e; e = e.nextSibling) {
970 o += e.outerHTML || escapeData(e.data);
971 }
972 return o;
973 },
974 set: function(text) {
975 contentDoc.body.innerHTML = text;
976 TemplateImpl.bootstrap(contentDoc);
977 while (this.content.firstChild) {
978 this.content.removeChild(this.content.firstChild);
979 }
980 while (contentDoc.body.firstChild) {
981 this.content.appendChild(contentDoc.body.firstChild);
982 }
983 },
984 configurable: true
985 });
986 } catch (err) {
987 canDecorate = false;
988 }
989 }
990 TemplateImpl.bootstrap(template.content);
991 };
992 TemplateImpl.bootstrap = function(doc) {
993 var templates = doc.querySelectorAll(TEMPLATE_TAG);
994 for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
995 TemplateImpl.decorate(t);
996 }
997 };
998 document.addEventListener("DOMContentLoaded", function() {
999 TemplateImpl.bootstrap(document);
1000 });
1001 var createElement = document.createElement;
1002 document.createElement = function() {
1003 "use strict";
1004 var el = createElement.apply(document, arguments);
1005 if (el.localName === "template") {
1006 TemplateImpl.decorate(el);
1007 }
1008 return el;
1009 };
1010 var escapeDataRegExp = /[&\u00A0<>]/g;
1011 function escapeReplace(c) {
1012 switch (c) {
1013 case "&":
1014 return "&amp;";
1015
1016 case "<":
1017 return "&lt;";
1018
1019 case ">":
1020 return "&gt;";
1021
1022 case "Β ":
1023 return "&nbsp;";
1024 }
1025 }
1026 function escapeData(s) {
1027 return s.replace(escapeDataRegExp, escapeReplace);
1028 }
1029 }
1030 if (needsTemplate || needsCloning) {
1031 var nativeCloneNode = Node.prototype.cloneNode;
1032 TemplateImpl.cloneNode = function(template, deep) {
1033 var clone = nativeCloneNode.call(template, false);
1034 if (this.decorate) {
1035 this.decorate(clone);
1036 }
1037 if (deep) {
1038 clone.content.appendChild(nativeCloneNode.call(template.content, true));
1039 this.fixClonedDom(clone.content, template.content);
1040 }
1041 return clone;
1042 };
1043 TemplateImpl.fixClonedDom = function(clone, source) {
1044 if (!source.querySelectorAll) return;
1045 var s$ = source.querySelectorAll(TEMPLATE_TAG);
1046 var t$ = clone.querySelectorAll(TEMPLATE_TAG);
1047 for (var i = 0, l = t$.length, t, s; i < l; i++) {
1048 s = s$[i];
1049 t = t$[i];
1050 if (this.decorate) {
1051 this.decorate(s);
1052 }
1053 t.parentNode.replaceChild(s.cloneNode(true), t);
1054 }
1055 };
1056 var originalImportNode = document.importNode;
1057 Node.prototype.cloneNode = function(deep) {
1058 var dom = nativeCloneNode.call(this, deep);
1059 if (deep) {
1060 TemplateImpl.fixClonedDom(dom, this);
1061 }
1062 return dom;
1063 };
1064 document.importNode = function(element, deep) {
1065 if (element.localName === TEMPLATE_TAG) {
1066 return TemplateImpl.cloneNode(element, deep);
1067 } else {
1068 var dom = originalImportNode.call(document, element, deep);
1069 if (deep) {
1070 TemplateImpl.fixClonedDom(dom, element);
1071 }
1072 return dom;
1073 }
1074 };
1075 if (needsCloning) {
1076 HTMLTemplateElement.prototype.cloneNode = function(deep) {
1077 return TemplateImpl.cloneNode(this, deep);
1078 };
1079 }
1080 }
1081 if (needsTemplate) {
1082 window.HTMLTemplateElement = TemplateImpl;
1083 }
1084 })();
1085
1086 (function(scope) {
1087 "use strict";
1088 if (!(window.performance && window.performance.now)) {
1089 var start = Date.now();
1090 window.performance = {
1091 now: function() {
1092 return Date.now() - start;
1093 }
1094 };
1095 }
1096 if (!window.requestAnimationFrame) {
1097 window.requestAnimationFrame = function() {
1098 var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
1099 return nativeRaf ? function(callback) {
1100 return nativeRaf(function() {
1101 callback(performance.now());
1102 });
1103 } : function(callback) {
1104 return window.setTimeout(callback, 1e3 / 60);
1105 };
1106 }();
1107 }
1108 if (!window.cancelAnimationFrame) {
1109 window.cancelAnimationFrame = function() {
1110 return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
1111 clearTimeout(id);
1112 };
1113 }();
1114 }
1115 var workingDefaultPrevented = function() {
1116 var e = document.createEvent("Event");
1117 e.initEvent("foo", true, true);
1118 e.preventDefault();
1119 return e.defaultPrevented;
1120 }();
1121 if (!workingDefaultPrevented) {
1122 var origPreventDefault = Event.prototype.preventDefault;
1123 Event.prototype.preventDefault = function() {
1124 if (!this.cancelable) {
1125 return;
1126 }
1127 origPreventDefault.call(this);
1128 Object.defineProperty(this, "defaultPrevented", {
1129 get: function() {
1130 return true;
1131 },
1132 configurable: true
1133 });
1134 };
1135 }
1136 var isIE = /Trident/.test(navigator.userAgent);
1137 if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
1138 window.CustomEvent = function(inType, params) {
1139 params = params || {};
1140 var e = document.createEvent("CustomEvent");
1141 e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
1142 return e;
1143 };
1144 window.CustomEvent.prototype = window.Event.prototype;
1145 }
1146 if (!window.Event || isIE && typeof window.Event !== "function") {
1147 var origEvent = window.Event;
1148 window.Event = function(inType, params) {
1149 params = params || {};
1150 var e = document.createEvent("Event");
1151 e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
1152 return e;
1153 };
1154 window.Event.prototype = origEvent.prototype;
1155 }
1156 })(window.WebComponents);
1157
1158 window.HTMLImports = window.HTMLImports || {
1159 flags: {}
1160 };
1161
79
1162 (function(scope) {
80 Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
1163 var IMPORT_LINK_TYPE = "import";
81 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
1164 var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link"));
82 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
1165 var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);
83 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
1166 var wrap = function(node) {
84 Code distributed by Google as part of the polymer project is also
1167 return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;
85 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
1168 };
86 */
1169 var rootDocument = wrap(document);
87 function xb(){this.ya=this.root=null;this.Z=!1;this.D=this.U=this.la=this.assignedSlot=this.assignedNodes=this.K=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.N=void 0;this.Da=this.ta=!1;this.S={}}xb.prototype.toJSON=function(){return{}};function w(a){a.fa||(a.fa=new xb);return a.fa}function x(a){return a&&a.fa};var y=window.ShadyDOM||{};y.Ra=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var yb=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");y.w=!!(yb&&yb.configurable&&yb.get);y.na=y.force||!y.Ra;var zb=navigator.userAgent.match("Trident"),Ab=navigator.userAgent.match("Edge");void 0===y.Ba&&(y.Ba=y.w&&(zb||Ab));function Bb(a){return(a=x(a))&&void 0!==a.firstChild}function z(a){return"ShadyRoot"===a.La}function Cb(a){a=a.getRootNode();if(z(a))return a}
1170 var currentScriptDescriptor = {
88 var Db=Element.prototype,Eb=Db.matches||Db.matchesSelector||Db.mozMatchesSelector||Db.msMatchesSelector||Db.oMatchesSelector||Db.webkitMatchesSelector;function Fb(a,b){if(a&&b)for(var c=Object.getOwnPropertyNames(b),d=0,e;d<c.length&&(e=c[d]);d++){var f=Object.getOwnPropertyDescriptor(b,e);f&&Object.defineProperty(a,e,f)}}function Gb(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];for(d=0;d<c.length;d++)Fb(a,c[d]);return a}function Hb(a,b){for(var c in b)a[c]=b[c]}
1171 get: function() {
89 var Ib=document.createTextNode(""),Jb=0,Kb=[];(new MutationObserver(function(){for(;Kb.length;)try{Kb.shift()()}catch(a){throw Ib.textContent=Jb++,a;}})).observe(Ib,{characterData:!0});function Lb(a){Kb.push(a);Ib.textContent=Jb++}var Mb=!!document.contains;function Nb(a,b){for(;b;){if(b==a)return!0;b=b.parentNode}return!1}
1172 var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
90 function Ob(a){for(var b=a.length-1;0<=b;b--){var c=a[b],d=c.getAttribute("id")||c.getAttribute("name");d&&"length"!==d&&isNaN(d)&&(a[d]=c)}a.item=function(b){return a[b]};a.namedItem=function(b){if("length"!==b&&isNaN(b)&&a[b])return a[b];for(var c=ma(a),d=c.next();!d.done;d=c.next())if(d=d.value,(d.getAttribute("id")||d.getAttribute("name"))==b)return d;return null};return a};var Pb=[],Qb;function Rb(a){Qb||(Qb=!0,Lb(Sb));Pb.push(a)}function Sb(){Qb=!1;for(var a=!!Pb.length;Pb.length;)Pb.shift()();return a}Sb.list=Pb;function Tb(){this.a=!1;this.addedNodes=[];this.removedNodes=[];this.Y=new Set}function Ub(a){a.a||(a.a=!0,Lb(function(){Vb(a)}))}function Vb(a){if(a.a){a.a=!1;var b=a.takeRecords();b.length&&a.Y.forEach(function(a){a(b)})}}Tb.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var a=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];this.addedNodes=[];this.removedNodes=[];return a}return[]};
1173 return wrap(script);
91 function Wb(a,b){var c=w(a);c.K||(c.K=new Tb);c.K.Y.add(b);var d=c.K;return{Ia:b,H:d,Ma:a,takeRecords:function(){return d.takeRecords()}}}function Xb(a){var b=a&&a.H;b&&(b.Y.delete(a.Ia),b.Y.size||(w(a.Ma).K=null))}
1174 },
92 function Yb(a,b){var c=b.getRootNode();return a.map(function(a){var b=c===a.target.getRootNode();if(b&&a.addedNodes){if(b=Array.from(a.addedNodes).filter(function(a){return c===a.getRootNode()}),b.length)return a=Object.create(a),Object.defineProperty(a,"addedNodes",{value:b,configurable:!0}),a}else if(b)return a}).filter(function(a){return a})};var A={},Zb=Element.prototype.insertBefore,$b=Element.prototype.replaceChild,ac=Element.prototype.removeChild,bc=Element.prototype.setAttribute,cc=Element.prototype.removeAttribute,dc=Element.prototype.cloneNode,ec=Document.prototype.importNode,fc=Element.prototype.addEventListener,gc=Element.prototype.removeEventListener,hc=Window.prototype.addEventListener,ic=Window.prototype.removeEventListener,jc=Element.prototype.dispatchEvent,kc=Node.prototype.contains||HTMLElement.prototype.contains,lc=Document.prototype.getElementById,
1175 configurable: true
93 mc=Element.prototype.querySelector,nc=DocumentFragment.prototype.querySelector,oc=Document.prototype.querySelector,pc=Element.prototype.querySelectorAll,qc=DocumentFragment.prototype.querySelectorAll,rc=Document.prototype.querySelectorAll;A.appendChild=Element.prototype.appendChild;A.insertBefore=Zb;A.replaceChild=$b;A.removeChild=ac;A.setAttribute=bc;A.removeAttribute=cc;A.cloneNode=dc;A.importNode=ec;A.addEventListener=fc;A.removeEventListener=gc;A.fb=hc;A.gb=ic;A.dispatchEvent=jc;A.contains=kc;
1176 };
94 A.getElementById=lc;A.pb=mc;A.sb=nc;A.nb=oc;A.querySelector=function(a){switch(this.nodeType){case Node.ELEMENT_NODE:return mc.call(this,a);case Node.DOCUMENT_NODE:return oc.call(this,a);default:return nc.call(this,a)}};A.qb=pc;A.tb=qc;A.ob=rc;A.querySelectorAll=function(a){switch(this.nodeType){case Node.ELEMENT_NODE:return pc.call(this,a);case Node.DOCUMENT_NODE:return rc.call(this,a);default:return qc.call(this,a)}};var sc=/[&\u00A0"]/g,tc=/[&\u00A0<>]/g;function uc(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";case '"':return"&quot;";case "\u00a0":return"&nbsp;"}}function vc(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}var wc=vc("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),xc=vc("style script xmp iframe noembed noframes plaintext noscript".split(" "));
1177 Object.defineProperty(document, "_currentScript", currentScriptDescriptor);
95 function yc(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):a.childNodes,e=0,f=d.length,h;e<f&&(h=d[e]);e++){a:{var g=h;var k=a;var l=b;switch(g.nodeType){case Node.ELEMENT_NODE:for(var m=g.localName,n="<"+m,t=g.attributes,C=0;k=t[C];C++)n+=" "+k.name+'="'+k.value.replace(sc,uc)+'"';n+=">";g=wc[m]?n:n+yc(g,l)+"</"+m+">";break a;case Node.TEXT_NODE:g=g.data;g=k&&xc[k.localName]?g:g.replace(tc,uc);break a;case Node.COMMENT_NODE:g="\x3c!--"+g.data+"--\x3e";break a;default:throw window.console.error(g),
1178 Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor);
96 Error("not implemented");}}c+=g}return c};var B={},E=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),F=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);function zc(a){var b=[];E.currentNode=a;for(a=E.firstChild();a;)b.push(a),a=E.nextSibling();return b}B.parentNode=function(a){E.currentNode=a;return E.parentNode()};B.firstChild=function(a){E.currentNode=a;return E.firstChild()};B.lastChild=function(a){E.currentNode=a;return E.lastChild()};B.previousSibling=function(a){E.currentNode=a;return E.previousSibling()};
1179 var isIE = /Trident/.test(navigator.userAgent);
97 B.nextSibling=function(a){E.currentNode=a;return E.nextSibling()};B.childNodes=zc;B.parentElement=function(a){F.currentNode=a;return F.parentNode()};B.firstElementChild=function(a){F.currentNode=a;return F.firstChild()};B.lastElementChild=function(a){F.currentNode=a;return F.lastChild()};B.previousElementSibling=function(a){F.currentNode=a;return F.previousSibling()};B.nextElementSibling=function(a){F.currentNode=a;return F.nextSibling()};
1180 function whenReady(callback, doc) {
98 B.children=function(a){var b=[];F.currentNode=a;for(a=F.firstChild();a;)b.push(a),a=F.nextSibling();return Ob(b)};B.innerHTML=function(a){return yc(a,function(a){return zc(a)})};B.textContent=function(a){switch(a.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b;default:return a.nodeValue}};var G={},Ac=y.w,Bc=[Node.prototype,Element.prototype,HTMLElement.prototype];function H(a){var b;a:{for(b=0;b<Bc.length;b++){var c=Bc[b];if(c.hasOwnProperty(a)){b=c;break a}}b=void 0}if(!b)throw Error("Could not find descriptor for "+a);return Object.getOwnPropertyDescriptor(b,a)}
1181 doc = doc || rootDocument;
99 var I=Ac?{parentNode:H("parentNode"),firstChild:H("firstChild"),lastChild:H("lastChild"),previousSibling:H("previousSibling"),nextSibling:H("nextSibling"),childNodes:H("childNodes"),parentElement:H("parentElement"),previousElementSibling:H("previousElementSibling"),nextElementSibling:H("nextElementSibling"),innerHTML:H("innerHTML"),textContent:H("textContent"),firstElementChild:H("firstElementChild"),lastElementChild:H("lastElementChild"),children:H("children")}:{},Cc=Ac?{firstElementChild:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,
1182 whenDocumentReady(function() {
100 "firstElementChild"),lastElementChild:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"lastElementChild"),children:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"children")}:{},Dc=Ac?{firstElementChild:Object.getOwnPropertyDescriptor(Document.prototype,"firstElementChild"),lastElementChild:Object.getOwnPropertyDescriptor(Document.prototype,"lastElementChild"),children:Object.getOwnPropertyDescriptor(Document.prototype,"children")}:{};G.xa=I;G.rb=Cc;G.mb=Dc;G.parentNode=function(a){return I.parentNode.get.call(a)};
1183 watchImportsLoad(callback, doc);
101 G.firstChild=function(a){return I.firstChild.get.call(a)};G.lastChild=function(a){return I.lastChild.get.call(a)};G.previousSibling=function(a){return I.previousSibling.get.call(a)};G.nextSibling=function(a){return I.nextSibling.get.call(a)};G.childNodes=function(a){return Array.prototype.slice.call(I.childNodes.get.call(a))};G.parentElement=function(a){return I.parentElement.get.call(a)};G.previousElementSibling=function(a){return I.previousElementSibling.get.call(a)};G.nextElementSibling=function(a){return I.nextElementSibling.get.call(a)};
1184 }, doc);
102 G.innerHTML=function(a){return I.innerHTML.get.call(a)};G.textContent=function(a){return I.textContent.get.call(a)};G.children=function(a){switch(a.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:return Cc.children.get.call(a);case Node.DOCUMENT_NODE:return Dc.children.get.call(a);default:return I.children.get.call(a)}};
1185 }
103 G.firstElementChild=function(a){switch(a.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:return Cc.firstElementChild.get.call(a);case Node.DOCUMENT_NODE:return Dc.firstElementChild.get.call(a);default:return I.firstElementChild.get.call(a)}};G.lastElementChild=function(a){switch(a.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:return Cc.lastElementChild.get.call(a);case Node.DOCUMENT_NODE:return Dc.lastElementChild.get.call(a);default:return I.lastElementChild.get.call(a)}};var J=y.Ba?G:B;function Ec(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
1186 var requiredReadyState = isIE ? "complete" : "interactive";
104 var Fc=y.w,Gc=document.implementation.createHTMLDocument("inert"),Hc=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),Ic=Hc&&Hc.get,Jc=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"),Mc={parentElement:{get:function(){var a=x(this);(a=a&&a.parentNode)&&a.nodeType!==Node.ELEMENT_NODE&&(a=null);return void 0!==a?a:J.parentElement(this)},configurable:!0},parentNode:{get:function(){var a=x(this);a=a&&a.parentNode;return void 0!==a?a:J.parentNode(this)},configurable:!0},
1187 var READY_EVENT = "readystatechange";
105 nextSibling:{get:function(){var a=x(this);a=a&&a.nextSibling;return void 0!==a?a:J.nextSibling(this)},configurable:!0},previousSibling:{get:function(){var a=x(this);a=a&&a.previousSibling;return void 0!==a?a:J.previousSibling(this)},configurable:!0},nextElementSibling:{get:function(){var a=x(this);if(a&&void 0!==a.nextSibling){for(a=this.nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return J.nextElementSibling(this)},configurable:!0},previousElementSibling:{get:function(){var a=
1188 function isDocumentReady(doc) {
106 x(this);if(a&&void 0!==a.previousSibling){for(a=this.previousSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return J.previousElementSibling(this)},configurable:!0}},Nc={className:{get:function(){return this.getAttribute("class")||""},set:function(a){this.setAttribute("class",a)},configurable:!0}},Oc={childNodes:{get:function(){if(Bb(this)){var a=x(this);if(!a.childNodes){a.childNodes=[];for(var b=this.firstChild;b;b=b.nextSibling)a.childNodes.push(b)}var c=a.childNodes}else c=
1189 return doc.readyState === "complete" || doc.readyState === requiredReadyState;
107 J.childNodes(this);c.item=function(a){return c[a]};return c},configurable:!0},childElementCount:{get:function(){return this.children.length},configurable:!0},firstChild:{get:function(){var a=x(this);a=a&&a.firstChild;return void 0!==a?a:J.firstChild(this)},configurable:!0},lastChild:{get:function(){var a=x(this);a=a&&a.lastChild;return void 0!==a?a:J.lastChild(this)},configurable:!0},textContent:{get:function(){if(Bb(this)){for(var a=[],b=0,c=this.childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&
1190 }
108 a.push(d.textContent);return a.join("")}return J.textContent(this)},set:function(a){if("undefined"===typeof a||null===a)a="";switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!Bb(this)&&Fc){var b=this.firstChild;(b!=this.lastChild||b&&b.nodeType!=Node.TEXT_NODE)&&Ec(this);G.xa.textContent.set.call(this,a)}else Ec(this),(0<a.length||this.nodeType===Node.ELEMENT_NODE)&&this.appendChild(document.createTextNode(a));break;default:this.nodeValue=a}},configurable:!0},firstElementChild:{get:function(){var a=
1191 function whenDocumentReady(callback, doc) {
109 x(this);if(a&&void 0!==a.firstChild){for(a=this.firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return J.firstElementChild(this)},configurable:!0},lastElementChild:{get:function(){var a=x(this);if(a&&void 0!==a.lastChild){for(a=this.lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return J.lastElementChild(this)},configurable:!0},children:{get:function(){return Bb(this)?Ob(Array.prototype.filter.call(this.childNodes,function(a){return a.nodeType===Node.ELEMENT_NODE})):
1192 if (!isDocumentReady(doc)) {
110 J.children(this)},configurable:!0},innerHTML:{get:function(){return Bb(this)?yc("template"===this.localName?this.content:this):J.innerHTML(this)},set:function(a){var b="template"===this.localName?this.content:this;Ec(b);var c=this.localName||"div";c=this.namespaceURI&&this.namespaceURI!==Gc.namespaceURI?Gc.createElementNS(this.namespaceURI,c):Gc.createElement(c);Fc?G.xa.innerHTML.set.call(c,a):c.innerHTML=a;for(a="template"===this.localName?c.content:c;a.firstChild;)b.appendChild(a.firstChild)},configurable:!0}},
1193 var checkReady = function() {
111 Pc={shadowRoot:{get:function(){var a=x(this);return a&&a.ya||null},configurable:!0}},Qc={activeElement:{get:function(){var a=Jc&&Jc.get?Jc.get.call(document):y.w?void 0:document.activeElement;if(a&&a.nodeType){var b=!!z(this);if(this===document||b&&this.host!==a&&A.contains.call(this.host,a)){for(b=Cb(a);b&&b!==this;)a=b.host,b=Cb(a);a=this===document?b?null:a:b===this?a:null}else a=null}else a=null;return a},set:function(){},configurable:!0}};
1194 if (doc.readyState === "complete" || doc.readyState === requiredReadyState) {
112 function K(a,b,c){for(var d in b){var e=Object.getOwnPropertyDescriptor(a,d);e&&e.configurable||!e&&c?Object.defineProperty(a,d,b[d]):c&&console.warn("Could not define",d,"on",a)}}function Rc(a){K(a,Mc);K(a,Nc);K(a,Oc);K(a,Qc)}
1195 doc.removeEventListener(READY_EVENT, checkReady);
113 function Sc(){var a=Tc.prototype;a.__proto__=DocumentFragment.prototype;K(a,Mc,!0);K(a,Oc,!0);K(a,Qc,!0);Object.defineProperties(a,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}});["localName","namespaceURI","prefix"].forEach(function(b){Object.defineProperty(a,b,{value:void 0,configurable:!0})});["ownerDocument","baseURI","isConnected"].forEach(function(b){Object.defineProperty(a,b,{get:function(){return this.host[b]},
1196 whenDocumentReady(callback, doc);
114 configurable:!0})})}var Uc=y.w?function(){}:function(a){var b=w(a);b.ta||(b.ta=!0,K(a,Mc,!0),K(a,Nc,!0))},Vc=y.w?function(){}:function(a){w(a).Da||(K(a,Oc,!0),K(a,Pc,!0))};var Wc=J.childNodes;function Xc(a,b,c){Uc(a);c=c||null;var d=w(a),e=w(b),f=c?w(c):null;d.previousSibling=c?f.previousSibling:b.lastChild;if(f=x(d.previousSibling))f.nextSibling=a;if(f=x(d.nextSibling=c))f.previousSibling=a;d.parentNode=b;c?c===e.firstChild&&(e.firstChild=a):(e.lastChild=a,e.firstChild||(e.firstChild=a));e.childNodes=null}
1197 }
115 function Yc(a){var b=w(a);if(void 0===b.firstChild){b.childNodes=null;var c=Wc(a);b.firstChild=c[0]||null;b.lastChild=c[c.length-1]||null;Vc(a);for(b=0;b<c.length;b++){var d=c[b],e=w(d);e.parentNode=a;e.nextSibling=c[b+1]||null;e.previousSibling=c[b-1]||null;Uc(d)}}};var Zc=J.parentNode;
1198 };
116 function $c(a,b,c){if(b===a)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(c){var d=x(c);d=d&&d.parentNode;if(void 0!==d&&d!==a||void 0===d&&Zc(c)!==a)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.");}if(c===b)return b;b.parentNode&&ad(b.parentNode,b);var e,f;if(!b.__noInsertionPoint){if(f=e=Cb(a)){var h;"slot"===b.localName?h=[b]:b.querySelectorAll&&
1199 doc.addEventListener(READY_EVENT, checkReady);
117 (h=b.querySelectorAll("slot"));f=h&&h.length?h:void 0}f&&(h=e,d=f,h.a=h.a||[],h.g=h.g||[],h.j=h.j||{},h.a.push.apply(h.a,[].concat(d instanceof Array?d:na(ma(d)))))}("slot"===a.localName||f)&&(e=e||Cb(a))&&bd(e);if(Bb(a)){e=c;Vc(a);f=w(a);void 0!==f.firstChild&&(f.childNodes=null);if(b.nodeType===Node.DOCUMENT_FRAGMENT_NODE){f=b.childNodes;for(h=0;h<f.length;h++)Xc(f[h],a,e);e=w(b);f=void 0!==e.firstChild?null:void 0;e.firstChild=e.lastChild=f;e.childNodes=f}else Xc(b,a,e);e=x(a);if(cd(a)){bd(e.root);
1200 } else if (callback) {
118 var g=!0}else e.root&&(g=!0)}g||(g=z(a)?a.host:a,c?(c=dd(c),A.insertBefore.call(g,b,c)):A.appendChild.call(g,b));ed(a,b);return b}
1201 callback();
119 function ad(a,b){if(b.parentNode!==a)throw Error("The node to be removed is not a child of this node: "+b);var c=Cb(b),d=x(a);if(Bb(a)){var e=w(b),f=w(a);b===f.firstChild&&(f.firstChild=e.nextSibling);b===f.lastChild&&(f.lastChild=e.previousSibling);var h=e.previousSibling,g=e.nextSibling;h&&(w(h).nextSibling=g);g&&(w(g).previousSibling=h);e.parentNode=e.previousSibling=e.nextSibling=void 0;void 0!==f.childNodes&&(f.childNodes=null);if(cd(a)){bd(d.root);var k=!0}}fd(b);if(c){(e=a&&"slot"===a.localName)&&
1202 }
120 (k=!0);if(c.g){gd(c);f=c.j;for(ba in f)for(h=f[ba],g=0;g<h.length;g++){var l=h[g];if(Nb(b,l)){h.splice(g,1);var m=c.g.indexOf(l);0<=m&&c.g.splice(m,1);g--;m=x(l);if(l=m.D)for(var n=0;n<l.length;n++){var t=l[n],C=hd(t);C&&A.removeChild.call(C,t)}m.D=[];m.assignedNodes=[];m=!0}}var ba=m}else ba=void 0;(ba||e)&&bd(c)}k||(k=z(a)?a.host:a,(!d.root&&"slot"!==b.localName||k===Zc(b))&&A.removeChild.call(k,b));ed(a,null,b);return b}
1203 }
121 function fd(a){var b=x(a);if(b&&void 0!==b.N){b=a.childNodes;for(var c=0,d=b.length,e;c<d&&(e=b[c]);c++)fd(e)}if(a=x(a))a.N=void 0}function dd(a){var b=a;a&&"slot"===a.localName&&(b=(b=(b=x(a))&&b.D)&&b.length?b[0]:dd(a.nextSibling));return b}function cd(a){return(a=(a=x(a))&&a.root)&&id(a)}
1204 function markTargetLoaded(event) {
122 function jd(a,b){if("slot"===b)a=a.parentNode,cd(a)&&bd(x(a).root);else if("slot"===a.localName&&"name"===b&&(b=Cb(a))){if(b.g){gd(b);var c=a.Ga,d=kd(a);if(d!==c){c=b.j[c];var e=c.indexOf(a);0<=e&&c.splice(e,1);c=b.j[d]||(b.j[d]=[]);c.push(a);1<c.length&&(b.j[d]=ld(c))}}bd(b)}}function ed(a,b,c){if(a=(a=x(a))&&a.K)b&&a.addedNodes.push(b),c&&a.removedNodes.push(c),Ub(a)}
1205 event.target.__loaded = true;
123 function md(a){if(a&&a.nodeType){var b=w(a),c=b.N;void 0===c&&(z(a)?(c=a,b.N=c):(c=(c=a.parentNode)?md(c):a,A.contains.call(document.documentElement,a)&&(b.N=c)));return c}}function nd(a,b,c){var d=[];od(a.childNodes,b,c,d);return d}function od(a,b,c,d){for(var e=0,f=a.length,h;e<f&&(h=a[e]);e++){var g;if(g=h.nodeType===Node.ELEMENT_NODE){g=h;var k=b,l=c,m=d,n=k(g);n&&m.push(g);l&&l(n)?g=n:(od(g.childNodes,k,l,m),g=void 0)}if(g)break}}var pd=null;
1206 }
124 function qd(a,b,c){pd||(pd=window.ShadyCSS&&window.ShadyCSS.ScopingShim);pd&&"class"===b?pd.setElementClass(a,c):(A.setAttribute.call(a,b,c),jd(a,b))}function rd(a,b){if(a.ownerDocument!==document||"template"===a.localName)return A.importNode.call(document,a,b);var c=A.importNode.call(document,a,!1);if(b){a=a.childNodes;b=0;for(var d;b<a.length;b++)d=rd(a[b],!0),c.appendChild(d)}return c};var sd="__eventWrappers"+Date.now(),td=function(){var a=Object.getOwnPropertyDescriptor(Event.prototype,"composed");return a?function(b){return a.get.call(b)}:null}(),ud={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,
1207 function watchImportsLoad(callback, doc) {
125 pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},vd={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0};
1208 var imports = doc.querySelectorAll("link[rel=import]");
126 function wd(a,b){var c=[],d=a;for(a=a===window?window:a.getRootNode();d;)c.push(d),d=d.assignedSlot?d.assignedSlot:d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&d.host&&(b||d!==a)?d.host:d.parentNode;c[c.length-1]===document&&c.push(window);return c}function xd(a,b){if(!z)return a;a=wd(a,!0);for(var c=0,d,e,f,h;c<b.length;c++)if(d=b[c],f=d===window?window:d.getRootNode(),f!==e&&(h=a.indexOf(f),e=f),!z(f)||-1<h)return d}
1209 var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = [];
127 var yd={get composed(){void 0===this.R&&(td?this.R=td(this):!1!==this.isTrusted&&(this.R=ud[this.type]));return this.R||!1},composedPath:function(){this.sa||(this.sa=wd(this.__target,this.composed));return this.sa},get target(){return xd(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){if(!this.ea)return null;this.ua||(this.ua=wd(this.ea,!0));return xd(this.currentTarget,this.ua)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.da=
1210 function checkDone() {
128 !0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.da=this.Ca=!0}};function zd(a){function b(b,d){b=new a(b,d);b.R=d&&!!d.composed;return b}Hb(b,a);b.prototype=a.prototype;return b}var Ad={focus:!0,blur:!0};function Bd(a){return a.__target!==a.target||a.ea!==a.relatedTarget}function Cd(a,b,c){if(c=b.__handlers&&b.__handlers[a.type]&&b.__handlers[a.type][c])for(var d=0,e;(e=c[d])&&(!Bd(a)||a.target!==a.relatedTarget)&&(e.call(b,a),!a.Ca);d++);}
1211 if (parsedCount == importCount && callback) {
129 function Dd(a){var b=a.composedPath();Object.defineProperty(a,"currentTarget",{get:function(){return d},configurable:!0});for(var c=b.length-1;0<=c;c--){var d=b[c];Cd(a,d,"capture");if(a.da)return}Object.defineProperty(a,"eventPhase",{get:function(){return Event.AT_TARGET}});var e;for(c=0;c<b.length;c++){d=b[c];var f=x(d);f=f&&f.root;if(0===c||f&&f===e)if(Cd(a,d,"bubble"),d!==window&&(e=d.getRootNode()),a.da)break}}
1212 callback({
130 function Ed(a,b,c,d,e,f){for(var h=0;h<a.length;h++){var g=a[h],k=g.type,l=g.capture,m=g.once,n=g.passive;if(b===g.node&&c===k&&d===l&&e===m&&f===n)return h}return-1}
1213 allImports: imports,
131 function Fd(a,b,c){if(b){var d=typeof b;if("function"===d||"object"===d)if("object"!==d||b.handleEvent&&"function"===typeof b.handleEvent){var e=this instanceof Window?A.fb:A.addEventListener;if(vd[a])return e.call(this,a,b,c);if(c&&"object"===typeof c){var f=!!c.capture;var h=!!c.once;var g=!!c.passive}else f=!!c,g=h=!1;var k=c&&c.ga||this,l=b[sd];if(l){if(-1<Ed(l,k,a,f,h,g))return}else b[sd]=[];l=function(e){h&&this.removeEventListener(a,b,c);e.__target||Gd(e);if(k!==this){var f=Object.getOwnPropertyDescriptor(e,
1214 loadedImports: newImports,
132 "currentTarget");Object.defineProperty(e,"currentTarget",{get:function(){return k},configurable:!0})}e.__previousCurrentTarget=e.currentTarget;if(!z(k)||-1!=e.composedPath().indexOf(k))if(e.composed||-1<e.composedPath().indexOf(k))if(Bd(e)&&e.target===e.relatedTarget)e.eventPhase===Event.BUBBLING_PHASE&&e.stopImmediatePropagation();else if(e.eventPhase===Event.CAPTURING_PHASE||e.bubbles||e.target===k||k instanceof Window){var g="function"===d?b.call(k,e):b.handleEvent&&b.handleEvent(e);k!==this&&
1215 errorImports: errorImports
133 (f?(Object.defineProperty(e,"currentTarget",f),f=null):delete e.currentTarget);return g}};b[sd].push({node:k,type:a,capture:f,once:h,passive:g,hb:l});Ad[a]?(this.__handlers=this.__handlers||{},this.__handlers[a]=this.__handlers[a]||{capture:[],bubble:[]},this.__handlers[a][f?"capture":"bubble"].push(l)):e.call(this,a,l,c)}}}
1216 });
134 function Hd(a,b,c){if(b){var d=this instanceof Window?A.gb:A.removeEventListener;if(vd[a])return d.call(this,a,b,c);if(c&&"object"===typeof c){var e=!!c.capture;var f=!!c.once;var h=!!c.passive}else e=!!c,h=f=!1;var g=c&&c.ga||this,k=void 0;var l=null;try{l=b[sd]}catch(m){}l&&(f=Ed(l,g,a,e,f,h),-1<f&&(k=l.splice(f,1)[0].hb,l.length||(b[sd]=void 0)));d.call(this,a,k||b,c);k&&Ad[a]&&this.__handlers&&this.__handlers[a]&&(a=this.__handlers[a][e?"capture":"bubble"],k=a.indexOf(k),-1<k&&a.splice(k,1))}}
1217 }
135 function Id(){for(var a in Ad)window.addEventListener(a,function(a){a.__target||(Gd(a),Dd(a))},!0)}function Gd(a){a.__target=a.target;a.ea=a.relatedTarget;if(y.w){var b=Object.getPrototypeOf(a);if(!b.hasOwnProperty("__patchProto")){var c=Object.create(b);c.jb=b;Fb(c,yd);b.__patchProto=c}a.__proto__=b.__patchProto}else Fb(a,yd)}var Jd=zd(window.Event),Kd=zd(window.CustomEvent),Ld=zd(window.MouseEvent);
1218 }
136 function Md(){window.Event=Jd;window.CustomEvent=Kd;window.MouseEvent=Ld;Id();if(!td&&Object.getOwnPropertyDescriptor(Event.prototype,"isTrusted")){var a=function(){var a=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(a)};Element.prototype.click?Element.prototype.click=a:HTMLElement.prototype.click&&(HTMLElement.prototype.click=a)}};function Nd(a,b){return{index:a,O:[],X:b}}
1219 function loadedImport(e) {
137 function Od(a,b,c,d){var e=0,f=0,h=0,g=0,k=Math.min(b-e,d-f);if(0==e&&0==f)a:{for(h=0;h<k;h++)if(a[h]!==c[h])break a;h=k}if(b==a.length&&d==c.length){g=a.length;for(var l=c.length,m=0;m<k-h&&Pd(a[--g],c[--l]);)m++;g=m}e+=h;f+=h;b-=g;d-=g;if(0==b-e&&0==d-f)return[];if(e==b){for(b=Nd(e,0);f<d;)b.O.push(c[f++]);return[b]}if(f==d)return[Nd(e,b-e)];k=e;h=f;d=d-h+1;g=b-k+1;b=Array(d);for(l=0;l<d;l++)b[l]=Array(g),b[l][0]=l;for(l=0;l<g;l++)b[0][l]=l;for(l=1;l<d;l++)for(m=1;m<g;m++)if(a[k+m-1]===c[h+l-1])b[l][m]=
1220 markTargetLoaded(e);
138 b[l-1][m-1];else{var n=b[l-1][m]+1,t=b[l][m-1]+1;b[l][m]=n<t?n:t}k=b.length-1;h=b[0].length-1;d=b[k][h];for(a=[];0<k||0<h;)0==k?(a.push(2),h--):0==h?(a.push(3),k--):(g=b[k-1][h-1],l=b[k-1][h],m=b[k][h-1],n=l<m?l<g?l:g:m<g?m:g,n==g?(g==d?a.push(0):(a.push(1),d=g),k--,h--):n==l?(a.push(3),k--,d=l):(a.push(2),h--,d=m));a.reverse();b=void 0;k=[];for(h=0;h<a.length;h++)switch(a[h]){case 0:b&&(k.push(b),b=void 0);e++;f++;break;case 1:b||(b=Nd(e,0));b.X++;e++;b.O.push(c[f]);f++;break;case 2:b||(b=Nd(e,0));
1221 newImports.push(this);
139 b.X++;e++;break;case 3:b||(b=Nd(e,0)),b.O.push(c[f]),f++}b&&k.push(b);return k}function Pd(a,b){return a===b};var hd=J.parentNode,Qd=J.childNodes,Rd={},Sd=y.deferConnectionCallbacks&&"loading"===document.readyState,Td;function Ud(a){var b=[];do b.unshift(a);while(a=a.parentNode);return b}
1222 parsedCount++;
140 function Tc(a,b,c){if(a!==Rd)throw new TypeError("Illegal constructor");this.La="ShadyRoot";this.host=b;this.c=c&&c.mode;Yc(b);a=w(b);a.root=this;a.ya="closed"!==this.c?this:null;a=w(this);a.firstChild=a.lastChild=a.parentNode=a.nextSibling=a.previousSibling=null;a.childNodes=[];this.b=this.W=!1;this.a=this.j=this.g=null;bd(this)}function bd(a){a.W||(a.W=!0,Rb(function(){return Vd(a)}))}
1223 checkDone();
141 function Vd(a){for(var b;a;){a.W&&(b=a);a:{var c=a;a=c.host.getRootNode();if(z(a))for(var d=c.host.childNodes,e=0;e<d.length;e++)if(c=d[e],"slot"==c.localName)break a;a=void 0}}b&&b._renderRoot()}
1224 }
142 Tc.prototype._renderRoot=function(){var a=Sd;Sd=!0;this.W=!1;if(this.g){gd(this);for(var b=0,c;b<this.g.length;b++){c=this.g[b];var d=x(c),e=d.assignedNodes;d.assignedNodes=[];d.D=[];if(d.la=e)for(d=0;d<e.length;d++){var f=x(e[d]);f.U=f.assignedSlot;f.assignedSlot===c&&(f.assignedSlot=null)}}for(c=this.host.firstChild;c;c=c.nextSibling)Wd(this,c);for(b=0;b<this.g.length;b++){c=this.g[b];e=x(c);if(!e.assignedNodes.length)for(d=c.firstChild;d;d=d.nextSibling)Wd(this,d,c);(d=(d=x(c.parentNode))&&d.root)&&
1225 function errorLoadingImport(e) {
143 id(d)&&d._renderRoot();Xd(this,e.D,e.assignedNodes);if(d=e.la){for(f=0;f<d.length;f++)x(d[f]).U=null;e.la=null;d.length>e.assignedNodes.length&&(e.Z=!0)}e.Z&&(e.Z=!1,Yd(this,c))}b=this.g;c=[];for(e=0;e<b.length;e++)d=b[e].parentNode,(f=x(d))&&f.root||!(0>c.indexOf(d))||c.push(d);for(b=0;b<c.length;b++){e=c[b];d=e===this?this.host:e;f=[];e=e.childNodes;for(var h=0;h<e.length;h++){var g=e[h];if("slot"==g.localName){g=x(g).D;for(var k=0;k<g.length;k++)f.push(g[k])}else f.push(g)}e=void 0;h=Qd(d);g=Od(f,
1226 errorImports.push(this);
144 f.length,h,h.length);for(var l=k=0;k<g.length&&(e=g[k]);k++){for(var m=0,n;m<e.O.length&&(n=e.O[m]);m++)hd(n)===d&&A.removeChild.call(d,n),h.splice(e.index+l,1);l-=e.X}for(l=0;l<g.length&&(e=g[l]);l++)for(k=h[e.index],m=e.index;m<e.index+e.X;m++)n=f[m],A.insertBefore.call(d,n,k),h.splice(m,0,n)}}if(!this.b)for(n=this.host.childNodes,c=0,b=n.length;c<b;c++)e=n[c],d=x(e),hd(e)!==this.host||"slot"!==e.localName&&d.assignedSlot||A.removeChild.call(this.host,e);this.b=!0;Sd=a;Td&&Td()};
1227 parsedCount++;
145 function Wd(a,b,c){var d=w(b),e=d.U;d.U=null;c||(c=(a=a.j[b.slot||"__catchall"])&&a[0]);c?(w(c).assignedNodes.push(b),d.assignedSlot=c):d.assignedSlot=void 0;e!==d.assignedSlot&&d.assignedSlot&&(w(d.assignedSlot).Z=!0)}function Xd(a,b,c){for(var d=0,e;d<c.length&&(e=c[d]);d++)if("slot"==e.localName){var f=x(e).assignedNodes;f&&f.length&&Xd(a,b,f)}else b.push(c[d])}function Yd(a,b){A.dispatchEvent.call(b,new Event("slotchange"));b=x(b);b.assignedSlot&&Yd(a,b.assignedSlot)}
1228 checkDone();
146 function gd(a){if(a.a&&a.a.length){for(var b=a.a,c,d=0;d<b.length;d++){var e=b[d];Yc(e);Yc(e.parentNode);var f=kd(e);a.j[f]?(c=c||{},c[f]=!0,a.j[f].push(e)):a.j[f]=[e];a.g.push(e)}if(c)for(var h in c)a.j[h]=ld(a.j[h]);a.a=[]}}function kd(a){var b=a.name||a.getAttribute("name")||"__catchall";return a.Ga=b}function ld(a){return a.sort(function(a,c){a=Ud(a);for(var b=Ud(c),e=0;e<a.length;e++){c=a[e];var f=b[e];if(c!==f)return a=Array.from(c.parentNode.childNodes),a.indexOf(c)-a.indexOf(f)}})}
1229 }
147 function id(a){gd(a);return!(!a.g||!a.g.length)}
1230 if (importCount) {
148 if(window.customElements&&y.na){var Zd=new Map;Td=function(){var a=Array.from(Zd);Zd.clear();a=ma(a);for(var b=a.next();!b.done;b=a.next()){b=ma(b.value);var c=b.next().value;b.next().value?c.Ea():c.Fa()}};Sd&&document.addEventListener("readystatechange",function(){Sd=!1;Td()},{once:!0});var $d=function(a,b,c){var d=0,e="__isConnected"+d++;if(b||c)a.prototype.connectedCallback=a.prototype.Ea=function(){Sd?Zd.set(this,!0):this[e]||(this[e]=!0,b&&b.call(this))},a.prototype.disconnectedCallback=a.prototype.Fa=
1231 for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) {
149 function(){Sd?this.isConnected||Zd.set(this,!1):this[e]&&(this[e]=!1,c&&c.call(this))};return a},define=window.customElements.define;Object.defineProperty(window.CustomElementRegistry.prototype,"define",{value:function(a,b){var c=b.prototype.connectedCallback,d=b.prototype.disconnectedCallback;define.call(window.customElements,a,$d(b,c,d));b.prototype.connectedCallback=c;b.prototype.disconnectedCallback=d}})};function ae(a){var b=a.getRootNode();z(b)&&Vd(b);return(a=x(a))&&a.assignedSlot||null}
1232 if (isImportLoaded(imp)) {
150 var be={addEventListener:Fd.bind(window),removeEventListener:Hd.bind(window)},ce={addEventListener:Fd,removeEventListener:Hd,appendChild:function(a){return $c(this,a)},insertBefore:function(a,b){return $c(this,a,b)},removeChild:function(a){return ad(this,a)},replaceChild:function(a,b){$c(this,a,b);ad(this,b);return a},cloneNode:function(a){if("template"==this.localName)var b=A.cloneNode.call(this,a);else if(b=A.cloneNode.call(this,!1),a&&b.nodeType!==Node.ATTRIBUTE_NODE){a=this.childNodes;for(var c=
1233 newImports.push(this);
151 0,d;c<a.length;c++)d=a[c].cloneNode(!0),b.appendChild(d)}return b},getRootNode:function(){return md(this)},contains:function(a){return Nb(this,a)},dispatchEvent:function(a){Sb();return A.dispatchEvent.call(this,a)}};
1234 parsedCount++;
152 Object.defineProperties(ce,{isConnected:{get:function(){if(Ic&&Ic.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;var a=this.ownerDocument;if(Mb){if(A.contains.call(a,this))return!0}else if(a.documentElement&&A.contains.call(a.documentElement,this))return!0;for(a=this;a&&!(a instanceof Document);)a=a.parentNode||(z(a)?a.host:void 0);return!!(a&&a instanceof Document)},configurable:!0}});
1235 checkDone();
153 var de={get assignedSlot(){return ae(this)}},ee={querySelector:function(a){return nd(this,function(b){return Eb.call(b,a)},function(a){return!!a})[0]||null},querySelectorAll:function(a,b){if(b){b=Array.prototype.slice.call(A.querySelectorAll.call(this,a));var c=this.getRootNode();return b.filter(function(a){return a.getRootNode()==c})}return nd(this,function(b){return Eb.call(b,a)})}},fe={assignedNodes:function(a){if("slot"===this.localName){var b=this.getRootNode();z(b)&&Vd(b);return(b=x(this))?
1236 } else {
154 (a&&a.flatten?b.D:b.assignedNodes)||[]:[]}}},ge=Gb({setAttribute:function(a,b){qd(this,a,b)},removeAttribute:function(a){A.removeAttribute.call(this,a);jd(this,a)},attachShadow:function(a){if(!this)throw"Must provide a host.";if(!a)throw"Not enough arguments.";return new Tc(Rd,this,a)},get slot(){return this.getAttribute("slot")},set slot(a){qd(this,"slot",a)},get assignedSlot(){return ae(this)}},ee,fe);Object.defineProperties(ge,Pc);
1237 imp.addEventListener("load", loadedImport);
155 var he=Gb({importNode:function(a,b){return rd(a,b)},getElementById:function(a){return nd(this,function(b){return b.id==a},function(a){return!!a})[0]||null}},ee);Object.defineProperties(he,{_activeElement:Qc.activeElement});
1238 imp.addEventListener("error", errorLoadingImport);
156 for(var ie=HTMLElement.prototype.blur,je={blur:function(){var a=x(this);(a=(a=a&&a.root)&&a.activeElement)?a.blur():ie.call(this)}},ke={},le=ma(Object.getOwnPropertyNames(Document.prototype)),me=le.next();!me.done;ke={u:ke.u},me=le.next())ke.u=me.value,"on"===ke.u.substring(0,2)&&Object.defineProperty(je,ke.u,{set:function(a){return function(b){var c=w(this),d=a.u.substring(2);c.S[a.u]&&this.removeEventListener(d,c.S[a.u]);this.addEventListener(d,b,{});c.S[a.u]=b}}(ke),get:function(a){return function(){var b=
1239 }
157 x(this);return b&&b.S[a.u]}}(ke),configurable:!0});var ne={addEventListener:function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.ga=this;this.host.addEventListener(a,b,c)},removeEventListener:function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.ga=this;this.host.removeEventListener(a,b,c)},getElementById:function(a){return nd(this,function(b){return b.id==a},function(a){return!!a})[0]||null}};
1240 }
158 function L(a,b){for(var c=Object.getOwnPropertyNames(b),d=0;d<c.length;d++){var e=c[d],f=Object.getOwnPropertyDescriptor(b,e);f.value?a[e]=f.value:Object.defineProperty(a,e,f)}};if(y.na){var ShadyDOM={inUse:y.na,patch:function(a){Vc(a);Uc(a);return a},isShadyRoot:z,enqueue:Rb,flush:Sb,settings:y,filterMutations:Yb,observeChildren:Wb,unobserveChildren:Xb,nativeMethods:A,nativeTree:J,deferConnectionCallbacks:y.deferConnectionCallbacks};window.ShadyDOM=ShadyDOM;Md();var oe=window.customElements&&window.customElements.nativeHTMLElement||HTMLElement;L(Tc.prototype,ne);L(window.Node.prototype,ce);L(window.Window.prototype,be);L(window.Text.prototype,de);L(window.DocumentFragment.prototype,
1241 } else {
159 ee);L(window.Element.prototype,ge);L(window.Document.prototype,he);window.HTMLSlotElement&&L(window.HTMLSlotElement.prototype,fe);L(oe.prototype,je);y.w&&(Rc(window.Node.prototype),Rc(window.Text.prototype),Rc(window.DocumentFragment.prototype),Rc(window.Element.prototype),Rc(oe.prototype),Rc(window.Document.prototype),window.HTMLSlotElement&&Rc(window.HTMLSlotElement.prototype));Sc();window.ShadowRoot=Tc};var pe=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function qe(a){var b=pe.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return!b&&a}function M(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))}
1242 checkDone();
160 function re(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}
1243 }
161 function se(a,b,c){c=void 0===c?new Set:c;for(var d=a;d;){if(d.nodeType===Node.ELEMENT_NODE){var e=d;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){d=e.import;if(d instanceof Node&&!c.has(d))for(c.add(d),d=d.firstChild;d;d=d.nextSibling)se(d,b,c);d=re(a,e);continue}else if("template"===f){d=re(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)se(e,b,c)}d=d.firstChild?d.firstChild:re(a,d)}}function N(a,b,c){a[b]=c};function te(){this.a=new Map;this.o=new Map;this.i=[];this.c=!1}function ue(a,b,c){a.a.set(b,c);a.o.set(c.constructor,c)}function ve(a,b){a.c=!0;a.i.push(b)}function we(a,b){a.c&&se(b,function(b){return a.b(b)})}te.prototype.b=function(a){if(this.c&&!a.__CE_patched){a.__CE_patched=!0;for(var b=0;b<this.i.length;b++)this.i[b](a)}};function O(a,b){var c=[];se(b,function(a){return c.push(a)});for(b=0;b<c.length;b++){var d=c[b];1===d.__CE_state?a.connectedCallback(d):xe(a,d)}}
1244 }
162 function P(a,b){var c=[];se(b,function(a){return c.push(a)});for(b=0;b<c.length;b++){var d=c[b];1===d.__CE_state&&a.disconnectedCallback(d)}}
1245 function isImportLoaded(link) {
163 function Q(a,b,c){c=void 0===c?{}:c;var d=c.eb||new Set,e=c.ca||function(b){return xe(a,b)},f=[];se(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var c=b.import;c instanceof Node&&(c.__CE_isImportDocument=!0,c.__CE_hasRegistry=!0);c&&"complete"===c.readyState?c.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var c=b.import;if(!c.__CE_documentLoadHandled){c.__CE_documentLoadHandled=!0;var f=new Set(d);f.delete(c);Q(a,c,{eb:f,ca:e})}})}else f.push(b)},d);
1246 return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed;
164 if(a.c)for(b=0;b<f.length;b++)a.b(f[b]);for(b=0;b<f.length;b++)e(f[b])}
1247 }
165 function xe(a,b){if(void 0===b.__CE_state){var c=b.ownerDocument;if(c.defaultView||c.__CE_isImportDocument&&c.__CE_hasRegistry)if(c=a.a.get(b.localName)){c.constructionStack.push(b);var d=c.constructor;try{try{if(new d!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{c.constructionStack.pop()}}catch(h){throw b.__CE_state=2,h;}b.__CE_state=1;b.__CE_definition=c;if(c.attributeChangedCallback)for(c=c.observedAttributes,d=0;d<c.length;d++){var e=c[d],
1248 if (useNative) {
166 f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null)}M(b)&&a.connectedCallback(b)}}}te.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a)};te.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a)};
1249 new MutationObserver(function(mxns) {
167 te.prototype.attributeChangedCallback=function(a,b,c,d,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,c,d,e)};function ye(a){var b=document;this.l=a;this.a=b;this.H=void 0;Q(this.l,this.a);"loading"===this.a.readyState&&(this.H=new MutationObserver(this.b.bind(this)),this.H.observe(this.a,{childList:!0,subtree:!0}))}function ze(a){a.H&&a.H.disconnect()}ye.prototype.b=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||ze(this);for(b=0;b<a.length;b++)for(var c=a[b].addedNodes,d=0;d<c.length;d++)Q(this.l,c[d])};function Ae(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a)})}Ae.prototype.resolve=function(a){if(this.a)throw Error("Already resolved.");this.a=a;this.b&&this.b(a)};function R(a){this.ia=!1;this.l=a;this.ma=new Map;this.ja=function(a){return a()};this.T=!1;this.ka=[];this.Ja=new ye(a)}p=R.prototype;
1250 for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {
168 p.define=function(a,b){var c=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!qe(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.l.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.ia)throw Error("A custom element is already being defined.");this.ia=!0;try{var d=function(a){var b=e[a];if(void 0!==b&&!(b instanceof Function))throw Error("The '"+a+"' callback must be a function.");
1251 if (m.addedNodes) {
169 return b},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=d("connectedCallback");var h=d("disconnectedCallback");var g=d("adoptedCallback");var k=d("attributeChangedCallback");var l=b.observedAttributes||[]}catch(m){return}finally{this.ia=!1}b={localName:a,constructor:b,connectedCallback:f,disconnectedCallback:h,adoptedCallback:g,attributeChangedCallback:k,observedAttributes:l,constructionStack:[]};ue(this.l,a,b);this.ka.push(b);
1252 handleImports(m.addedNodes);
170 this.T||(this.T=!0,this.ja(function(){return Be(c)}))};p.ca=function(a){Q(this.l,a)};
1253 }
171 function Be(a){if(!1!==a.T){a.T=!1;for(var b=a.ka,c=[],d=new Map,e=0;e<b.length;e++)d.set(b[e].localName,[]);Q(a.l,document,{ca:function(b){if(void 0===b.__CE_state){var e=b.localName,f=d.get(e);f?f.push(b):a.l.a.get(e)&&c.push(b)}}});for(e=0;e<c.length;e++)xe(a.l,c[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=d.get(f.localName);for(var h=0;h<f.length;h++)xe(a.l,f[h]);(e=a.ma.get(e))&&e.resolve(void 0)}}}p.get=function(a){if(a=this.l.a.get(a))return a.constructor};
1254 }
172 p.whenDefined=function(a){if(!qe(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.ma.get(a);if(b)return b.c;b=new Ae;this.ma.set(a,b);this.l.a.get(a)&&!this.ka.some(function(b){return b.localName===a})&&b.resolve(void 0);return b.c};p.Za=function(a){ze(this.Ja);var b=this.ja;this.ja=function(c){return a(function(){return b(c)})}};window.CustomElementRegistry=R;R.prototype.define=R.prototype.define;R.prototype.upgrade=R.prototype.ca;
1255 }).observe(document.head, {
173 R.prototype.get=R.prototype.get;R.prototype.whenDefined=R.prototype.whenDefined;R.prototype.polyfillWrapFlushCallback=R.prototype.Za;var Ce=window.Document.prototype.createElement,De=window.Document.prototype.createElementNS,Ee=window.Document.prototype.importNode,Fe=window.Document.prototype.prepend,Ge=window.Document.prototype.append,He=window.DocumentFragment.prototype.prepend,Ie=window.DocumentFragment.prototype.append,Je=window.Node.prototype.cloneNode,Ke=window.Node.prototype.appendChild,Le=window.Node.prototype.insertBefore,Me=window.Node.prototype.removeChild,Ne=window.Node.prototype.replaceChild,Oe=Object.getOwnPropertyDescriptor(window.Node.prototype,
1256 childList: true
174 "textContent"),Pe=window.Element.prototype.attachShadow,Qe=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Re=window.Element.prototype.getAttribute,Se=window.Element.prototype.setAttribute,Te=window.Element.prototype.removeAttribute,Ue=window.Element.prototype.getAttributeNS,Ve=window.Element.prototype.setAttributeNS,We=window.Element.prototype.removeAttributeNS,Xe=window.Element.prototype.insertAdjacentElement,Ye=window.Element.prototype.insertAdjacentHTML,Ze=window.Element.prototype.prepend,
1257 });
175 $e=window.Element.prototype.append,af=window.Element.prototype.before,bf=window.Element.prototype.after,cf=window.Element.prototype.replaceWith,df=window.Element.prototype.remove,ef=window.HTMLElement,ff=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),gf=window.HTMLElement.prototype.insertAdjacentElement,hf=window.HTMLElement.prototype.insertAdjacentHTML;var jf=new function(){};function kf(){var a=lf;window.HTMLElement=function(){function b(){var b=this.constructor,d=a.o.get(b);if(!d)throw Error("The custom element being constructed was not registered with `customElements`.");var e=d.constructionStack;if(0===e.length)return e=Ce.call(document,d.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=d,a.b(e),e;d=e.length-1;var f=e[d];if(f===jf)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");
1258 function handleImports(nodes) {
176 e[d]=jf;Object.setPrototypeOf(f,b.prototype);a.b(f);return f}b.prototype=ef.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}()};function mf(a,b,c){function d(b){return function(c){for(var d=[],e=0;e<arguments.length;++e)d[e-0]=arguments[e];e=[];for(var f=[],l=0;l<d.length;l++){var m=d[l];m instanceof Element&&M(m)&&f.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)e.push(m);else e.push(m)}b.apply(this,d);for(d=0;d<f.length;d++)P(a,f[d]);if(M(this))for(d=0;d<e.length;d++)f=e[d],f instanceof Element&&O(a,f)}}void 0!==c.aa&&(b.prepend=d(c.aa));void 0!==c.append&&(b.append=d(c.append))};function nf(){var a=lf;N(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var c=a.a.get(b);if(c)return new c.constructor}b=Ce.call(this,b);a.b(b);return b});N(Document.prototype,"importNode",function(b,c){b=Ee.call(this,b,c);this.__CE_hasRegistry?Q(a,b):we(a,b);return b});N(Document.prototype,"createElementNS",function(b,c){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var d=a.a.get(c);if(d)return new d.constructor}b=De.call(this,b,c);a.b(b);return b});
1259 for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
177 mf(a,Document.prototype,{aa:Fe,append:Ge})};function of(){var a=lf;function b(b,d){Object.defineProperty(b,"textContent",{enumerable:d.enumerable,configurable:!0,get:d.get,set:function(b){if(this.nodeType===Node.TEXT_NODE)d.set.call(this,b);else{var c=void 0;if(this.firstChild){var e=this.childNodes,g=e.length;if(0<g&&M(this)){c=Array(g);for(var k=0;k<g;k++)c[k]=e[k]}}d.set.call(this,b);if(c)for(b=0;b<c.length;b++)P(a,c[b])}}})}N(Node.prototype,"insertBefore",function(b,d){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);
1260 if (isImport(n)) {
178 b=Le.call(this,b,d);if(M(this))for(d=0;d<c.length;d++)O(a,c[d]);return b}c=M(b);d=Le.call(this,b,d);c&&P(a,b);M(this)&&O(a,b);return d});N(Node.prototype,"appendChild",function(b){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=Ke.call(this,b);if(M(this))for(var e=0;e<c.length;e++)O(a,c[e]);return b}c=M(b);e=Ke.call(this,b);c&&P(a,b);M(this)&&O(a,b);return e});N(Node.prototype,"cloneNode",function(b){b=Je.call(this,b);this.ownerDocument.__CE_hasRegistry?Q(a,b):
1261 handleImport(n);
179 we(a,b);return b});N(Node.prototype,"removeChild",function(b){var c=M(b),e=Me.call(this,b);c&&P(a,b);return e});N(Node.prototype,"replaceChild",function(b,d){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=Ne.call(this,b,d);if(M(this))for(P(a,d),d=0;d<c.length;d++)O(a,c[d]);return b}c=M(b);var f=Ne.call(this,b,d),h=M(this);h&&P(a,d);c&&P(a,b);h&&O(a,b);return f});Oe&&Oe.get?b(Node.prototype,Oe):ve(a,function(a){b(a,{enumerable:!0,configurable:!0,get:function(){for(var a=
1262 }
180 [],b=0;b<this.childNodes.length;b++)a.push(this.childNodes[b].textContent);return a.join("")},set:function(a){for(;this.firstChild;)Me.call(this,this.firstChild);Ke.call(this,document.createTextNode(a))}})})};function pf(a){var b=Element.prototype;function c(b){return function(c){for(var d=[],e=0;e<arguments.length;++e)d[e-0]=arguments[e];e=[];for(var g=[],k=0;k<d.length;k++){var l=d[k];l instanceof Element&&M(l)&&g.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)e.push(l);else e.push(l)}b.apply(this,d);for(d=0;d<g.length;d++)P(a,g[d]);if(M(this))for(d=0;d<e.length;d++)g=e[d],g instanceof Element&&O(a,g)}}void 0!==af&&(b.before=c(af));void 0!==af&&(b.after=c(bf));void 0!==
1263 }
181 cf&&N(b,"replaceWith",function(b){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];d=[];for(var h=[],g=0;g<c.length;g++){var k=c[g];k instanceof Element&&M(k)&&h.push(k);if(k instanceof DocumentFragment)for(k=k.firstChild;k;k=k.nextSibling)d.push(k);else d.push(k)}g=M(this);cf.apply(this,c);for(c=0;c<h.length;c++)P(a,h[c]);if(g)for(P(a,this),c=0;c<d.length;c++)h=d[c],h instanceof Element&&O(a,h)});void 0!==df&&N(b,"remove",function(){var b=M(this);df.call(this);b&&P(a,this)})};function qf(){var a=lf;function b(b,c){Object.defineProperty(b,"innerHTML",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(b){var d=this,e=void 0;M(this)&&(e=[],se(this,function(a){a!==d&&e.push(a)}));c.set.call(this,b);if(e)for(var f=0;f<e.length;f++){var h=e[f];1===h.__CE_state&&a.disconnectedCallback(h)}this.ownerDocument.__CE_hasRegistry?Q(a,this):we(a,this);return b}})}function c(b,c){N(b,"insertAdjacentElement",function(b,d){var e=M(d);b=c.call(this,b,d);e&&P(a,d);M(b)&&O(a,
1264 }
182 d);return b})}function d(b,c){function d(b,c){for(var d=[];b!==c;b=b.nextSibling)d.push(b);for(c=0;c<d.length;c++)Q(a,d[c])}N(b,"insertAdjacentHTML",function(a,b){a=a.toLowerCase();if("beforebegin"===a){var e=this.previousSibling;c.call(this,a,b);d(e||this.parentNode.firstChild,this)}else if("afterbegin"===a)e=this.firstChild,c.call(this,a,b),d(this.firstChild,e);else if("beforeend"===a)e=this.lastChild,c.call(this,a,b),d(e||this.firstChild,null);else if("afterend"===a)e=this.nextSibling,c.call(this,
1265 function isImport(element) {
183 a,b),d(this.nextSibling,e);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");})}Pe&&N(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=Pe.call(this,a)});Qe&&Qe.get?b(Element.prototype,Qe):ff&&ff.get?b(HTMLElement.prototype,ff):ve(a,function(a){b(a,{enumerable:!0,configurable:!0,get:function(){return Je.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName,c=b?this.content:
1266 return element.localName === "link" && element.rel === "import";
184 this,d=De.call(document,this.namespaceURI,this.localName);for(d.innerHTML=a;0<c.childNodes.length;)Me.call(c,c.childNodes[0]);for(a=b?d.content:d;0<a.childNodes.length;)Ke.call(c,a.childNodes[0])}})});N(Element.prototype,"setAttribute",function(b,c){if(1!==this.__CE_state)return Se.call(this,b,c);var d=Re.call(this,b);Se.call(this,b,c);c=Re.call(this,b);a.attributeChangedCallback(this,b,d,c,null)});N(Element.prototype,"setAttributeNS",function(b,c,d){if(1!==this.__CE_state)return Ve.call(this,b,c,
1267 }
185 d);var e=Ue.call(this,b,c);Ve.call(this,b,c,d);d=Ue.call(this,b,c);a.attributeChangedCallback(this,c,e,d,b)});N(Element.prototype,"removeAttribute",function(b){if(1!==this.__CE_state)return Te.call(this,b);var c=Re.call(this,b);Te.call(this,b);null!==c&&a.attributeChangedCallback(this,b,c,null,null)});N(Element.prototype,"removeAttributeNS",function(b,c){if(1!==this.__CE_state)return We.call(this,b,c);var d=Ue.call(this,b,c);We.call(this,b,c);var e=Ue.call(this,b,c);d!==e&&a.attributeChangedCallback(this,
1268 function handleImport(element) {
186 c,d,e,b)});gf?c(HTMLElement.prototype,gf):Xe?c(Element.prototype,Xe):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");hf?d(HTMLElement.prototype,hf):Ye?d(Element.prototype,Ye):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");mf(a,Element.prototype,{aa:Ze,append:$e});pf(a)};var rf=window.customElements;if(!rf||rf.forcePolyfill||"function"!=typeof rf.define||"function"!=typeof rf.get){var lf=new te;kf();nf();mf(lf,DocumentFragment.prototype,{aa:He,append:Ie});of();qf();document.__CE_hasRegistry=!0;var customElements=new R(lf);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements})};function xf(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""}
1269 var loaded = element.import;
187 function yf(a){a=a.replace(zf,"").replace(Af,"");var b=Bf,c=a,d=new xf;d.start=0;d.end=c.length;for(var e=d,f=0,h=c.length;f<h;f++)if("{"===c[f]){e.rules||(e.rules=[]);var g=e,k=g.rules[g.rules.length-1]||null;e=new xf;e.start=f+1;e.parent=g;e.previous=k;g.rules.push(e)}else"}"===c[f]&&(e.end=f+1,e=e.parent||d);return b(d,a)}
1270 if (loaded) {
188 function Bf(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=Cf(c),c=c.replace(Df," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=Ef:c.match(Ff)&&(a.type=Gf,a.keyframesName=a.selector.split(Df).pop()):a.type=0===c.indexOf("--")?Hf:If);if(c=a.rules)for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)Bf(f,
1271 markTargetLoaded({
189 b);return a}function Cf(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})}
1272 target: element
190 function Jf(a,b,c){c=void 0===c?"":c;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=e.length,g;f<h&&(g=e[f]);f++)d=Jf(g,b,d)}else b?b=a.cssText:(b=a.cssText,b=b.replace(Kf,"").replace(Lf,""),b=b.replace(Mf,"").replace(Nf,"")),(d=b.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(c+=a.selector+" {\n"),c+=d,a.selector&&(c+="}\n\n"));return c}
1273 });
191 var If=1,Gf=7,Ef=4,Hf=1E3,zf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,Af=/@import[^;]*;/gim,Kf=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,Lf=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,Mf=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,Nf=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,Ff=/^@[^\s]*keyframes/,Df=/\s+/g;var S=!(window.ShadyDOM&&window.ShadyDOM.inUse),Of;function Pf(a){Of=a&&a.shimcssproperties?!1:S||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?Of=window.ShadyCSS.nativeCss:window.ShadyCSS?(Pf(window.ShadyCSS),window.ShadyCSS=void 0):Pf(window.WebComponents&&window.WebComponents.flags);var U=Of;var Qf=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,Rf=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,Sf=/(--[\w-]+)\s*([:,;)]|$)/gi,Tf=/(animation\s*:)|(animation-name\s*:)/,Uf=/@media\s(.*)/,Vf=/\{[^}]*\}/g;var Wf=new Set;function Xf(a,b){if(!a)return"";"string"===typeof a&&(a=yf(a));b&&Yf(a,b);return Jf(a,U)}function Zf(a){!a.__cssRules&&a.textContent&&(a.__cssRules=yf(a.textContent));return a.__cssRules||null}function $f(a){return!!a.parent&&a.parent.type===Gf}function Yf(a,b,c,d){if(a){var e=!1,f=a.type;if(d&&f===Ef){var h=a.selector.match(Uf);h&&(window.matchMedia(h[1]).matches||(e=!0))}f===If?b(a):c&&f===Gf?c(a):f===Hf&&(e=!0);if((a=a.rules)&&!e){e=0;f=a.length;for(var g;e<f&&(g=a[e]);e++)Yf(g,b,c,d)}}}
1274 } else {
192 function ag(a,b,c,d){var e=document.createElement("style");b&&e.setAttribute("scope",b);e.textContent=a;bg(e,c,d);return e}var cg=null;function bg(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);cg?a.compareDocumentPosition(cg)===Node.DOCUMENT_POSITION_PRECEDING&&(cg=a):cg=a}
1275 element.addEventListener("load", markTargetLoaded);
193 function dg(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var d=0;var e=c+3;for(var f=a.length;e<f;e++)if("("===a[e])d++;else if(")"===a[e]&&0===--d)break a;e=-1}d=a.substring(c+4,e);c=a.substring(0,c);a=dg(a.substring(e+1),b);e=d.indexOf(",");return-1===e?b(c,d.trim(),"",a):b(c,d.substring(0,e).trim(),d.substring(e+1).trim(),a)}function eg(a,b){S?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)}
1276 element.addEventListener("error", markTargetLoaded);
194 function fg(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,P:c}};function gg(){}function hg(a,b){var c=W;a.__styleScoped?a.__styleScoped=null:ig(c,a,function(a){jg(a,b||"")})}function ig(a,b,c){b.nodeType===Node.ELEMENT_NODE&&c(b);if(b="template"===b.localName?(b.content||b.kb||b).childNodes:b.children||b.childNodes)for(var d=0;d<b.length;d++)ig(a,b[d],c)}
1277 }
195 function jg(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var d=a.getAttribute(kg);c?d&&(b=d.replace("style-scope","").replace(b,""),eg(a,b)):eg(a,(d?d+" ":"")+"style-scope "+b)}}function lg(a,b,c){var d=W;a.__styleScoped?a.__styleScoped=null:ig(d,a,function(a){jg(a,b,!0);jg(a,c)})}function mg(a,b){var c=W;a.__styleScoped?a.__styleScoped=null:ig(c,a,function(a){jg(a,b||"",!0)})}
1278 }
196 function ng(a,b,c){var d=W,e=a.__cssBuild;S||"shady"===e?b=Xf(b,c):(a=fg(a),b=og(d,b,a.is,a.P,c)+"\n\n");return b.trim()}function og(a,b,c,d,e){var f=pg(c,d);c=c?qg+c:"";return Xf(b,function(b){b.c||(b.selector=b.s=rg(a,b,a.b,c,f),b.c=!0);e&&e(b,c,f)})}function pg(a,b){return b?"[is="+a+"]":a}function rg(a,b,c,d,e){var f=b.selector.split(sg);if(!$f(b)){b=0;for(var h=f.length,g;b<h&&(g=f[b]);b++)f[b]=c.call(a,g,d,e)}return f.join(sg)}
1279 (function() {
197 function tg(a){return a.replace(ug,function(a,c,d){-1<d.indexOf("+")?d=d.replace(/\+/g,"___"):-1<d.indexOf("___")&&(d=d.replace(/___/g,"+"));return":"+c+"("+d+")"})}gg.prototype.b=function(a,b,c){var d=!1;a=a.trim();var e=ug.test(a);e&&(a=a.replace(ug,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=tg(a));a=a.replace(vg,wg+" $1");a=a.replace(xg,function(a,e,g){d||(a=yg(g,e,b,c),d=d||a.stop,e=a.Oa,g=a.value);return e+g});e&&(a=tg(a));return a};
1280 if (document.readyState === "loading") {
198 function yg(a,b,c,d){var e=a.indexOf(zg);0<=a.indexOf(wg)?a=Ag(a,d):0!==e&&(a=c?Bg(a,c):a);c=!1;0<=e&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Cg,function(a,b){return" > "+b}))}a=a.replace(Dg,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,Oa:b,stop:f}}function Bg(a,b){a=a.split(Eg);a[0]+=b;return a.join(Eg)}
1281 var imports = document.querySelectorAll("link[rel=import]");
199 function Ag(a,b){var c=a.match(Fg);return(c=c&&c[2].trim()||"")?c[0].match(Gg)?a.replace(Fg,function(a,c,f){return b+f}):c.split(Gg)[0]===b?c:Hg:a.replace(wg,b)}function Ig(a){a.selector===Jg&&(a.selector="html")}gg.prototype.c=function(a){return a.match(zg)?this.b(a,Kg):Bg(a.trim(),Kg)};ea.Object.defineProperties(gg.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});
1282 for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {
200 var ug=/:(nth[-\w]+)\(([^)]+)\)/,Kg=":not(.style-scope)",sg=",",xg=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Gg=/[[.:#*]/,wg=":host",Jg=":root",zg="::slotted",vg=new RegExp("^("+zg+")"),Fg=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Cg=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Dg=/(.*):dir\((?:(ltr|rtl))\)/,qg=".",Eg=":",kg="class",Hg="should_not_match",W=new gg;function Lg(a,b,c,d){this.B=a||null;this.b=b||null;this.oa=c||[];this.L=null;this.P=d||"";this.a=this.v=this.G=null}function X(a){return a?a.__styleInfo:null}function Mg(a,b){return a.__styleInfo=b}Lg.prototype.c=function(){return this.B};Lg.prototype._getStyleRules=Lg.prototype.c;function Ng(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var Og=navigator.userAgent.match("Trident");function Pg(){}function Qg(a){var b={},c=[],d=0;Yf(a,function(a){Rg(a);a.index=d++;a=a.m.cssText;for(var c;c=Sf.exec(a);){var e=c[1];":"!==c[2]&&(b[e]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var e in b)a.push(e);return a}
1283 handleImport(imp);
201 function Rg(a){if(!a.m){var b={},c={};Sg(a,c)&&(b.A=c,a.rules=null);b.cssText=a.parsedCssText.replace(Vf,"").replace(Qf,"");a.m=b}}function Sg(a,b){var c=a.m;if(c){if(c.A)return Object.assign(b,c.A),!0}else{c=a.parsedCssText;for(var d;a=Qf.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}}
1284 }
202 function Tg(a,b,c){b&&(b=0<=b.indexOf(";")?Ug(a,b,c):dg(b,function(b,e,f,h){if(!e)return b+h;(e=Tg(a,c[e],c))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=Tg(a,c[f]||f,c)||f;return b+(e||"")+h}));return b&&b.trim()||""}
1285 }
203 function Ug(a,b,c){b=b.split(";");for(var d=0,e,f;d<b.length;d++)if(e=b[d]){Rf.lastIndex=0;if(f=Rf.exec(e))e=Tg(a,c[f[1]],c);else if(f=e.indexOf(":"),-1!==f){var h=e.substring(f);h=h.trim();h=Tg(a,h,c)||h;e=e.substring(0,f)+h}b[d]=e&&e.lastIndexOf(";")===e.length-1?e.slice(0,-1):e||""}return b.join(";")}
1286 })();
204 function Vg(a,b){var c={},d=[];Yf(a,function(a){a.m||Rg(a);var e=a.s||a.parsedSelector;b&&a.m.A&&e&&Ng.call(b,e)&&(Sg(a,c),a=a.index,e=parseInt(a/32,10),d[e]=(d[e]||0)|1<<a%32)},null,!0);return{A:c,key:d}}
1287 }
205 function Wg(a,b,c,d){b.m||Rg(b);if(b.m.A){var e=fg(a);a=e.is;e=e.P;e=a?pg(a,e):"html";var f=b.parsedSelector,h=":host > *"===f||"html"===f,g=0===f.indexOf(":host")&&!h;"shady"===c&&(h=f===e+" > *."+e||-1!==f.indexOf("html"),g=!h&&0===f.indexOf(e));"shadow"===c&&(h=":host > *"===f||"html"===f,g=g&&!h);if(h||g)c=e,g&&(b.s||(b.s=rg(W,b,W.b,a?qg+a:"",e)),c=b.s||e),d({ab:c,Ua:g,ub:h})}}
1288 whenReady(function(detail) {
206 function Xg(a,b){var c={},d={},e=b&&b.__cssBuild;Yf(b,function(b){Wg(a,b,e,function(e){Ng.call(a.lb||a,e.ab)&&(e.Ua?Sg(b,c):Sg(b,d))})},null,!0);return{$a:d,Sa:c}}
1289 window.HTMLImports.ready = true;
207 function Yg(a,b,c,d){var e=fg(b),f=pg(e.is,e.P),h=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])");e=X(b).B;var g=Zg(e,d);return ng(b,e,function(b){var e="";b.m||Rg(b);b.m.cssText&&(e=Ug(a,b.m.cssText,c));b.cssText=e;if(!S&&!$f(b)&&b.cssText){var k=e=b.cssText;null==b.wa&&(b.wa=Tf.test(e));if(b.wa)if(null==b.$){b.$=[];for(var n in g)k=g[n],k=k(e),e!==k&&(e=k,b.$.push(n))}else{for(n=0;n<b.$.length;++n)k=g[b.$[n]],e=k(e);k=e}b.cssText=k;b.s=b.s||b.selector;e="."+
1290 window.HTMLImports.readyTime = new Date().getTime();
208 d;n=b.s.split(",");k=0;for(var t=n.length,C;k<t&&(C=n[k]);k++)n[k]=C.match(h)?C.replace(f,e):e+" "+C;b.selector=n.join(",")}})}function Zg(a,b){a=a.b;var c={};if(!S&&a)for(var d=0,e=a[d];d<a.length;e=a[++d]){var f=e,h=b;f.i=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+h;f.s=f.s||f.selector;f.selector=f.s.replace(f.keyframesName,f.a);c[e.keyframesName]=$g(e)}return c}function $g(a){return function(b){return b.replace(a.i,a.a)}}
1291 var evt = rootDocument.createEvent("CustomEvent");
209 function ah(a,b){var c=bh,d=Zf(a);a.textContent=Xf(d,function(a){var d=a.cssText=a.parsedCssText;a.m&&a.m.cssText&&(d=d.replace(Kf,"").replace(Lf,""),a.cssText=Ug(c,d,b))})}ea.Object.defineProperties(Pg.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var bh=new Pg;var ch={},dh=window.customElements;if(dh&&!S){var eh=dh.define;dh.define=function(a,b,c){var d=document.createComment(" Shady DOM styles for "+a+" "),e=document.head;e.insertBefore(d,(cg?cg.nextSibling:null)||e.firstChild);cg=d;ch[a]=d;eh.call(dh,a,b,c)}};function fh(){this.cache={}}fh.prototype.store=function(a,b,c,d){var e=this.cache[a]||[];e.push({A:b,styleElement:c,v:d});100<e.length&&e.shift();this.cache[a]=e};fh.prototype.fetch=function(a,b,c){if(a=this.cache[a])for(var d=a.length-1;0<=d;d--){var e=a[d],f;a:{for(f=0;f<c.length;f++){var h=c[f];if(e.A[h]!==b[h]){f=!1;break a}}f=!0}if(f)return e}};function gh(){}
1292 evt.initCustomEvent("HTMLImportsLoaded", true, true, detail);
210 function hh(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var d=0;d<c.addedNodes.length;d++){var e=c.addedNodes[d];if(e.nodeType===Node.ELEMENT_NODE){var f=e.getRootNode();var h=e;var g=[];h.classList?g=Array.from(h.classList):h instanceof window.SVGElement&&h.hasAttribute("class")&&(g=h.getAttribute("class").split(/\s+/));h=g;g=h.indexOf(W.a);if((h=-1<g?h[g+1]:"")&&f===e.ownerDocument)mg(e,h);else if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f=
1293 rootDocument.dispatchEvent(evt);
211 f.host))for(f=fg(f).is,f!==h&&lg(e,h,f),e=window.ShadyDOM.nativeMethods.querySelectorAll.call(e,":not(."+W.a+")"),f=0;f<e.length;f++)if(h=e[f],g=h.getRootNode().host)g=fg(g).is,jg(h,g)}}}}
1294 });
212 if(!S){var ih=new MutationObserver(hh),jh=function(a){ih.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)jh(document);else{var kh=function(){jh(document.body)};window.HTMLImports?window.HTMLImports.whenReady(kh):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){kh();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else kh()})}gh=function(){hh(ih.takeRecords())}}
1295 scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;
213 var lh=gh;var mh={};var nh=Promise.resolve();function oh(a){if(a=mh[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function ph(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function qh(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,nh.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))};var rh=new fh;function Y(){this.J={};this.c=document.documentElement;var a=new xf;a.rules=[];this.i=Mg(this.c,new Lg(a));this.o=!1;this.b=this.a=null}p=Y.prototype;p.pa=function(){lh()};p.Qa=function(a){return Zf(a)};p.cb=function(a){return Xf(a)};p.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)};
1296 scope.useNative = useNative;
214 p.prepareTemplateStyles=function(a,b,c){if(!a.o){a.o=!0;a.name=b;a.extends=c;mh[b]=a;var d=(d=a.content.querySelector("style"))?d.getAttribute("css-build")||"":"";var e=[];for(var f=a.content.querySelectorAll("style"),h=0;h<f.length;h++){var g=f[h];if(g.hasAttribute("shady-unscoped")){if(!S){var k=g.textContent;Wf.has(k)||(Wf.add(k),k=g.cloneNode(!0),document.head.appendChild(k));g.parentNode.removeChild(g)}}else e.push(g.textContent),g.parentNode.removeChild(g)}e=e.join("").trim();c={is:b,extends:c,
1297 scope.rootDocument = rootDocument;
215 ib:d};sh(this);f=Rf.test(e)||Qf.test(e);Rf.lastIndex=0;Qf.lastIndex=0;e=yf(e);f&&U&&this.a&&this.a.transformRules(e,b);a._styleAst=e;a.J=d;d=[];U||(d=Qg(a._styleAst));if(!d.length||U)e=S?a.content:null,b=ch[b],f=ng(c,a._styleAst),b=f.length?ag(f,c.is,e,b):void 0,a.a=b;a.i=d}};p.prepareTemplateDom=function(a,b){S||a.c||(a.c=!0,hg(a.content,b))};
1298 scope.whenReady = whenReady;
216 function th(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.Aa(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.o)&&a.flushCustomStyles()})})}function sh(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=oh);th(a)}
1299 scope.isIE = isIE;
217 p.flushCustomStyles=function(){sh(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued){if(U)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&U&&this.a){var d=Zf(c);sh(this);this.a.transformRules(d);c.textContent=Xf(d)}}else for(uh(this,this.c,this.i),b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&ah(c,this.i.G);this.b.enqueued=!1;this.o&&!U&&this.styleDocument()}}};
1300 })(window.HTMLImports);
218 p.styleElement=function(a,b){var c=fg(a).is,d=X(a);if(!d){var e=fg(a);d=e.is;e=e.P;var f=ch[d];d=mh[d];if(d){var h=d._styleAst;var g=d.i}d=Mg(a,new Lg(h,f,g,e))}a!==this.c&&(this.o=!0);b&&(d.L=d.L||{},Object.assign(d.L,b));if(U){if(d.L){b=d.L;for(var k in b)null===k?a.style.removeProperty(k):a.style.setProperty(k,b[k])}if(((k=mh[c])||a===this.c)&&k&&k.a&&!ph(k)){if(ph(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)sh(this),this.a&&this.a.transformRules(k._styleAst,c),k.a.textContent=
1301
219 ng(a,d.B),qh(k);S&&(c=a.shadowRoot)&&(c.querySelector("style").textContent=ng(a,d.B));d.B=k._styleAst}}else if(this.pa(),uh(this,a,d),d.oa&&d.oa.length){c=d;k=fg(a).is;d=(b=rh.fetch(k,c.G,c.oa))?b.styleElement:null;h=c.v;(g=b&&b.v)||(g=this.J[k]=(this.J[k]||0)+1,g=k+"-"+g);c.v=g;g=c.v;e=bh;e=d?d.textContent||"":Yg(e,a,c.G,g);f=X(a);var l=f.a;l&&!S&&l!==d&&(l._useCount--,0>=l._useCount&&l.parentNode&&l.parentNode.removeChild(l));S?f.a?(f.a.textContent=e,d=f.a):e&&(d=ag(e,g,a.shadowRoot,f.b)):d?d.parentNode||
1302 (function(scope) {
220 (Og&&-1<e.indexOf("@media")&&(d.textContent=e),bg(d,null,f.b)):e&&(d=ag(e,g,null,f.b));d&&(d._useCount=d._useCount||0,f.a!=d&&d._useCount++,f.a=d);g=d;S||(d=c.v,f=e=a.getAttribute("class")||"",h&&(f=e.replace(new RegExp("\\s*x-scope\\s*"+h+"\\s*","g")," ")),f+=(f?" ":"")+"x-scope "+d,e!==f&&eg(a,f));b||rh.store(k,c.G,g,c.v)}};function vh(a,b){return(b=b.getRootNode().host)?X(b)?b:vh(a,b):a.c}
1303 var modules = [];
221 function uh(a,b,c){a=vh(a,b);var d=X(a);a=Object.create(d.G||null);var e=Xg(b,c.B);b=Vg(d.B,b).A;Object.assign(a,e.Sa,b,e.$a);b=c.L;for(var f in b)if((e=b[f])||0===e)a[f]=e;f=bh;b=Object.getOwnPropertyNames(a);for(e=0;e<b.length;e++)d=b[e],a[d]=Tg(f,a[d],a);c.G=a}p.styleDocument=function(a){this.styleSubtree(this.c,a)};
1304 var addModule = function(module) {
222 p.styleSubtree=function(a,b){var c=a.shadowRoot;(c||a===this.c)&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])};p.Aa=function(a){var b=this,c=Zf(a);Yf(c,function(a){if(S)Ig(a);else{var c=W;a.selector=a.parsedSelector;Ig(a);a.selector=a.s=rg(c,a,c.c,void 0,void 0)}U&&(sh(b),b.a&&b.a.transformRule(a))});U?a.textContent=Xf(c):this.i.B.rules.push(c)};
1305 modules.push(module);
223 p.getComputedStyleValue=function(a,b){var c;U||(c=(X(a)||X(vh(this,a))).G[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};p.bb=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var d=a.getAttribute("class");if(d){d=d.split(/\s/);for(var e=0;e<d.length;e++)if(d[e]===W.a){c=d[e+1];break}}}c&&b.push(W.a,c);U||(c=X(a))&&c.v&&b.push(bh.a,c.v);eg(a,b.join(" "))};p.Na=function(a){return X(a)};Y.prototype.flush=Y.prototype.pa;
1306 };
224 Y.prototype.prepareTemplate=Y.prototype.prepareTemplate;Y.prototype.styleElement=Y.prototype.styleElement;Y.prototype.styleDocument=Y.prototype.styleDocument;Y.prototype.styleSubtree=Y.prototype.styleSubtree;Y.prototype.getComputedStyleValue=Y.prototype.getComputedStyleValue;Y.prototype.setElementClass=Y.prototype.bb;Y.prototype._styleInfoForNode=Y.prototype.Na;Y.prototype.transformCustomStyleForDocument=Y.prototype.Aa;Y.prototype.getStyleAst=Y.prototype.Qa;Y.prototype.styleAstToString=Y.prototype.cb;
1307 var initializeModules = function() {
225 Y.prototype.flushCustomStyles=Y.prototype.flushCustomStyles;Object.defineProperties(Y.prototype,{nativeShadow:{get:function(){return S}},nativeCss:{get:function(){return U}}});var Z=new Y,wh,xh;window.ShadyCSS&&(wh=window.ShadyCSS.ApplyShim,xh=window.ShadyCSS.CustomStyleInterface);
1308 modules.forEach(function(module) {
226 window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplate(a,b,c)},prepareTemplateDom:function(a,b){Z.prepareTemplateDom(a,b)},prepareTemplateStyles:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplateStyles(a,b,c)},styleSubtree:function(a,b){Z.flushCustomStyles();Z.styleSubtree(a,b)},styleElement:function(a){Z.flushCustomStyles();Z.styleElement(a)},styleDocument:function(a){Z.flushCustomStyles();Z.styleDocument(a)},flushCustomStyles:function(){Z.flushCustomStyles()},
1309 module(scope);
227 getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:U,nativeShadow:S};wh&&(window.ShadyCSS.ApplyShim=wh);xh&&(window.ShadyCSS.CustomStyleInterface=xh);var yh=window.customElements,zh=window.HTMLImports,Ah=window.HTMLTemplateElement;window.WebComponents=window.WebComponents||{};if(yh&&yh.polyfillWrapFlushCallback){var Bh,Ch=function(){if(Bh){Ah.C&&Ah.C(window.document);var a=Bh;Bh=null;a();return!0}},Dh=zh.whenReady;yh.polyfillWrapFlushCallback(function(a){Bh=a;Dh(Ch)});zh.whenReady=function(a){Dh(function(){Ch()?zh.whenReady(a):a()})}}
1310 });
228 zh.whenReady(function(){requestAnimationFrame(function(){window.WebComponents.ready=!0;document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})});var Eh=document.createElement("style");Eh.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var Fh=document.querySelector("head");Fh.insertBefore(Eh,Fh.firstChild);}).call(this);
1311 };
1312 scope.addModule = addModule;
1313 scope.initializeModules = initializeModules;
1314 })(window.HTMLImports);
1315
1316 window.HTMLImports.addModule(function(scope) {
1317 var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g;
1318 var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g;
1319 var path = {
1320 resolveUrlsInStyle: function(style, linkUrl) {
1321 var doc = style.ownerDocument;
1322 var resolver = doc.createElement("a");
1323 style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver);
1324 return style;
1325 },
1326 resolveUrlsInCssText: function(cssText, linkUrl, urlObj) {
1327 var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP);
1328 r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP);
1329 return r;
1330 },
1331 replaceUrls: function(text, urlObj, linkUrl, regexp) {
1332 return text.replace(regexp, function(m, pre, url, post) {
1333 var urlPath = url.replace(/["']/g, "");
1334 if (linkUrl) {
1335 urlPath = new URL(urlPath, linkUrl).href;
1336 }
1337 urlObj.href = urlPath;
1338 urlPath = urlObj.href;
1339 return pre + "'" + urlPath + "'" + post;
1340 });
1341 }
1342 };
1343 scope.path = path;
1344 });
1345
1346 window.HTMLImports.addModule(function(scope) {
1347 var xhr = {
1348 async: true,
1349 ok: function(request) {
1350 return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;
1351 },
1352 load: function(url, next, nextContext) {
1353 var request = new XMLHttpRequest();
1354 if (scope.flags.debug || scope.flags.bust) {
1355 url += "?" + Math.random();
1356 }
1357 request.open("GET", url, xhr.async);
1358 request.addEventListener("readystatechange", function(e) {
1359 if (request.readyState === 4) {
1360 var redirectedUrl = null;
1361 try {
1362 var locationHeader = request.getResponseHeader("Location");
1363 if (locationHeader) {
1364 redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
1365 }
1366 } catch (e) {
1367 console.error(e.message);
1368 }
1369 next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
1370 }
1371 });
1372 request.send();
1373 return request;
1374 },
1375 loadDocument: function(url, next, nextContext) {
1376 this.load(url, next, nextContext).responseType = "document";
1377 }
1378 };
1379 scope.xhr = xhr;
1380 });
1381
1382 window.HTMLImports.addModule(function(scope) {
1383 var xhr = scope.xhr;
1384 var flags = scope.flags;
1385 var Loader = function(onLoad, onComplete) {
1386 this.cache = {};
1387 this.onload = onLoad;
1388 this.oncomplete = onComplete;
1389 this.inflight = 0;
1390 this.pending = {};
1391 };
1392 Loader.prototype = {
1393 addNodes: function(nodes) {
1394 this.inflight += nodes.length;
1395 for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
1396 this.require(n);
1397 }
1398 this.checkDone();
1399 },
1400 addNode: function(node) {
1401 this.inflight++;
1402 this.require(node);
1403 this.checkDone();
1404 },
1405 require: function(elt) {
1406 var url = elt.src || elt.href;
1407 elt.__nodeUrl = url;
1408 if (!this.dedupe(url, elt)) {
1409 this.fetch(url, elt);
1410 }
1411 },
1412 dedupe: function(url, elt) {
1413 if (this.pending[url]) {
1414 this.pending[url].push(elt);
1415 return true;
1416 }
1417 var resource;
1418 if (this.cache[url]) {
1419 this.onload(url, elt, this.cache[url]);
1420 this.tail();
1421 return true;
1422 }
1423 this.pending[url] = [ elt ];
1424 return false;
1425 },
1426 fetch: function(url, elt) {
1427 flags.load && console.log("fetch", url, elt);
1428 if (!url) {
1429 setTimeout(function() {
1430 this.receive(url, elt, {
1431 error: "href must be specified"
1432 }, null);
1433 }.bind(this), 0);
1434 } else if (url.match(/^data:/)) {
1435 var pieces = url.split(",");
1436 var header = pieces[0];
1437 var body = pieces[1];
1438 if (header.indexOf(";base64") > -1) {
1439 body = atob(body);
1440 } else {
1441 body = decodeURIComponent(body);
1442 }
1443 setTimeout(function() {
1444 this.receive(url, elt, null, body);
1445 }.bind(this), 0);
1446 } else {
1447 var receiveXhr = function(err, resource, redirectedUrl) {
1448 this.receive(url, elt, err, resource, redirectedUrl);
1449 }.bind(this);
1450 xhr.load(url, receiveXhr);
1451 }
1452 },
1453 receive: function(url, elt, err, resource, redirectedUrl) {
1454 this.cache[url] = resource;
1455 var $p = this.pending[url];
1456 for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
1457 this.onload(url, p, resource, err, redirectedUrl);
1458 this.tail();
1459 }
1460 this.pending[url] = null;
1461 },
1462 tail: function() {
1463 --this.inflight;
1464 this.checkDone();
1465 },
1466 checkDone: function() {
1467 if (!this.inflight) {
1468 this.oncomplete();
1469 }
1470 }
1471 };
1472 scope.Loader = Loader;
1473 });
1474
1475 window.HTMLImports.addModule(function(scope) {
1476 var Observer = function(addCallback) {
1477 this.addCallback = addCallback;
1478 this.mo = new MutationObserver(this.handler.bind(this));
1479 };
1480 Observer.prototype = {
1481 handler: function(mutations) {
1482 for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {
1483 if (m.type === "childList" && m.addedNodes.length) {
1484 this.addedNodes(m.addedNodes);
1485 }
1486 }
1487 },
1488 addedNodes: function(nodes) {
1489 if (this.addCallback) {
1490 this.addCallback(nodes);
1491 }
1492 for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {
1493 if (n.children && n.children.length) {
1494 this.addedNodes(n.children);
1495 }
1496 }
1497 },
1498 observe: function(root) {
1499 this.mo.observe(root, {
1500 childList: true,
1501 subtree: true
1502 });
1503 }
1504 };
1505 scope.Observer = Observer;
1506 });
1507
1508 window.HTMLImports.addModule(function(scope) {
1509 var path = scope.path;
1510 var rootDocument = scope.rootDocument;
1511 var flags = scope.flags;
1512 var isIE = scope.isIE;
1513 var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
1514 var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]";
1515 var importParser = {
1516 documentSelectors: IMPORT_SELECTOR,
1517 importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]:not([type])", "style:not([type])", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","),
1518 map: {
1519 link: "parseLink",
1520 script: "parseScript",
1521 style: "parseStyle"
1522 },
1523 dynamicElements: [],
1524 parseNext: function() {
1525 var next = this.nextToParse();
1526 if (next) {
1527 this.parse(next);
1528 }
1529 },
1530 parse: function(elt) {
1531 if (this.isParsed(elt)) {
1532 flags.parse && console.log("[%s] is already parsed", elt.localName);
1533 return;
1534 }
1535 var fn = this[this.map[elt.localName]];
1536 if (fn) {
1537 this.markParsing(elt);
1538 fn.call(this, elt);
1539 }
1540 },
1541 parseDynamic: function(elt, quiet) {
1542 this.dynamicElements.push(elt);
1543 if (!quiet) {
1544 this.parseNext();
1545 }
1546 },
1547 markParsing: function(elt) {
1548 flags.parse && console.log("parsing", elt);
1549 this.parsingElement = elt;
1550 },
1551 markParsingComplete: function(elt) {
1552 elt.__importParsed = true;
1553 this.markDynamicParsingComplete(elt);
1554 if (elt.__importElement) {
1555 elt.__importElement.__importParsed = true;
1556 this.markDynamicParsingComplete(elt.__importElement);
1557 }
1558 this.parsingElement = null;
1559 flags.parse && console.log("completed", elt);
1560 },
1561 markDynamicParsingComplete: function(elt) {
1562 var i = this.dynamicElements.indexOf(elt);
1563 if (i >= 0) {
1564 this.dynamicElements.splice(i, 1);
1565 }
1566 },
1567 parseImport: function(elt) {
1568 elt.import = elt.__doc;
1569 if (window.HTMLImports.__importsParsingHook) {
1570 window.HTMLImports.__importsParsingHook(elt);
1571 }
1572 if (elt.import) {
1573 elt.import.__importParsed = true;
1574 }
1575 this.markParsingComplete(elt);
1576 if (elt.__resource && !elt.__error) {
1577 elt.dispatchEvent(new CustomEvent("load", {
1578 bubbles: false
1579 }));
1580 } else {
1581 elt.dispatchEvent(new CustomEvent("error", {
1582 bubbles: false
1583 }));
1584 }
1585 if (elt.__pending) {
1586 var fn;
1587 while (elt.__pending.length) {
1588 fn = elt.__pending.shift();
1589 if (fn) {
1590 fn({
1591 target: elt
1592 });
1593 }
1594 }
1595 }
1596 this.parseNext();
1597 },
1598 parseLink: function(linkElt) {
1599 if (nodeIsImport(linkElt)) {
1600 this.parseImport(linkElt);
1601 } else {
1602 linkElt.href = linkElt.href;
1603 this.parseGeneric(linkElt);
1604 }
1605 },
1606 parseStyle: function(elt) {
1607 var src = elt;
1608 elt = cloneStyle(elt);
1609 src.__appliedElement = elt;
1610 elt.__importElement = src;
1611 this.parseGeneric(elt);
1612 },
1613 parseGeneric: function(elt) {
1614 this.trackElement(elt);
1615 this.addElementToDocument(elt);
1616 },
1617 rootImportForElement: function(elt) {
1618 var n = elt;
1619 while (n.ownerDocument.__importLink) {
1620 n = n.ownerDocument.__importLink;
1621 }
1622 return n;
1623 },
1624 addElementToDocument: function(elt) {
1625 var port = this.rootImportForElement(elt.__importElement || elt);
1626 port.parentNode.insertBefore(elt, port);
1627 },
1628 trackElement: function(elt, callback) {
1629 var self = this;
1630 var done = function(e) {
1631 elt.removeEventListener("load", done);
1632 elt.removeEventListener("error", done);
1633 if (callback) {
1634 callback(e);
1635 }
1636 self.markParsingComplete(elt);
1637 self.parseNext();
1638 };
1639 elt.addEventListener("load", done);
1640 elt.addEventListener("error", done);
1641 if (isIE && elt.localName === "style") {
1642 var fakeLoad = false;
1643 if (elt.textContent.indexOf("@import") == -1) {
1644 fakeLoad = true;
1645 } else if (elt.sheet) {
1646 fakeLoad = true;
1647 var csr = elt.sheet.cssRules;
1648 var len = csr ? csr.length : 0;
1649 for (var i = 0, r; i < len && (r = csr[i]); i++) {
1650 if (r.type === CSSRule.IMPORT_RULE) {
1651 fakeLoad = fakeLoad && Boolean(r.styleSheet);
1652 }
1653 }
1654 }
1655 if (fakeLoad) {
1656 setTimeout(function() {
1657 elt.dispatchEvent(new CustomEvent("load", {
1658 bubbles: false
1659 }));
1660 });
1661 }
1662 }
1663 },
1664 parseScript: function(scriptElt) {
1665 var script = document.createElement("script");
1666 script.__importElement = scriptElt;
1667 script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
1668 scope.currentScript = scriptElt;
1669 this.trackElement(script, function(e) {
1670 if (script.parentNode) {
1671 script.parentNode.removeChild(script);
1672 }
1673 scope.currentScript = null;
1674 });
1675 this.addElementToDocument(script);
1676 },
1677 nextToParse: function() {
1678 this._mayParse = [];
1679 return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());
1680 },
1681 nextToParseInDoc: function(doc, link) {
1682 if (doc && this._mayParse.indexOf(doc) < 0) {
1683 this._mayParse.push(doc);
1684 var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
1685 for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
1686 if (!this.isParsed(n)) {
1687 if (this.hasResource(n)) {
1688 return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;
1689 } else {
1690 return;
1691 }
1692 }
1693 }
1694 }
1695 return link;
1696 },
1697 nextToParseDynamic: function() {
1698 return this.dynamicElements[0];
1699 },
1700 parseSelectorsForNode: function(node) {
1701 var doc = node.ownerDocument || node;
1702 return doc === rootDocument ? this.documentSelectors : this.importsSelectors;
1703 },
1704 isParsed: function(node) {
1705 return node.__importParsed;
1706 },
1707 needsDynamicParsing: function(elt) {
1708 return this.dynamicElements.indexOf(elt) >= 0;
1709 },
1710 hasResource: function(node) {
1711 if (nodeIsImport(node) && node.__doc === undefined) {
1712 return false;
1713 }
1714 return true;
1715 }
1716 };
1717 function nodeIsImport(elt) {
1718 return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE;
1719 }
1720 function generateScriptDataUrl(script) {
1721 var scriptContent = generateScriptContent(script);
1722 return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent);
1723 }
1724 function generateScriptContent(script) {
1725 return script.textContent + generateSourceMapHint(script);
1726 }
1727 function generateSourceMapHint(script) {
1728 var owner = script.ownerDocument;
1729 owner.__importedScripts = owner.__importedScripts || 0;
1730 var moniker = script.ownerDocument.baseURI;
1731 var num = owner.__importedScripts ? "-" + owner.__importedScripts : "";
1732 owner.__importedScripts++;
1733 return "\n//# sourceURL=" + moniker + num + ".js\n";
1734 }
1735 function cloneStyle(style) {
1736 var clone = style.ownerDocument.createElement("style");
1737 clone.textContent = style.textContent;
1738 path.resolveUrlsInStyle(clone);
1739 return clone;
1740 }
1741 scope.parser = importParser;
1742 scope.IMPORT_SELECTOR = IMPORT_SELECTOR;
1743 });
1744
229
1745 window.HTMLImports.addModule(function(scope) {
230 //# sourceMappingURL=webcomponents-lite.js.map
1746 var flags = scope.flags;
1747 var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
1748 var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;
1749 var rootDocument = scope.rootDocument;
1750 var Loader = scope.Loader;
1751 var Observer = scope.Observer;
1752 var parser = scope.parser;
1753 var importer = {
1754 documents: {},
1755 documentPreloadSelectors: IMPORT_SELECTOR,
1756 importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","),
1757 loadNode: function(node) {
1758 importLoader.addNode(node);
1759 },
1760 loadSubtree: function(parent) {
1761 var nodes = this.marshalNodes(parent);
1762 importLoader.addNodes(nodes);
1763 },
1764 marshalNodes: function(parent) {
1765 return parent.querySelectorAll(this.loadSelectorsForNode(parent));
1766 },
1767 loadSelectorsForNode: function(node) {
1768 var doc = node.ownerDocument || node;
1769 return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;
1770 },
1771 loaded: function(url, elt, resource, err, redirectedUrl) {
1772 flags.load && console.log("loaded", url, elt);
1773 elt.__resource = resource;
1774 elt.__error = err;
1775 if (isImportLink(elt)) {
1776 var doc = this.documents[url];
1777 if (doc === undefined) {
1778 doc = err ? null : makeDocument(resource, redirectedUrl || url);
1779 if (doc) {
1780 doc.__importLink = elt;
1781 this.bootDocument(doc);
1782 }
1783 this.documents[url] = doc;
1784 }
1785 elt.__doc = doc;
1786 }
1787 parser.parseNext();
1788 },
1789 bootDocument: function(doc) {
1790 this.loadSubtree(doc);
1791 this.observer.observe(doc);
1792 parser.parseNext();
1793 },
1794 loadedAll: function() {
1795 parser.parseNext();
1796 }
1797 };
1798 var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));
1799 importer.observer = new Observer();
1800 function isImportLink(elt) {
1801 return isLinkRel(elt, IMPORT_LINK_TYPE);
1802 }
1803 function isLinkRel(elt, rel) {
1804 return elt.localName === "link" && elt.getAttribute("rel") === rel;
1805 }
1806 function hasBaseURIAccessor(doc) {
1807 return !!Object.getOwnPropertyDescriptor(doc, "baseURI");
1808 }
1809 function makeDocument(resource, url) {
1810 var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);
1811 doc._URL = url;
1812 var base = doc.createElement("base");
1813 base.setAttribute("href", url);
1814 if (!doc.baseURI && !hasBaseURIAccessor(doc)) {
1815 Object.defineProperty(doc, "baseURI", {
1816 value: url
1817 });
1818 }
1819 var meta = doc.createElement("meta");
1820 meta.setAttribute("charset", "utf-8");
1821 doc.head.appendChild(meta);
1822 doc.head.appendChild(base);
1823 doc.body.innerHTML = resource;
1824 if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
1825 HTMLTemplateElement.bootstrap(doc);
1826 }
1827 return doc;
1828 }
1829 if (!document.baseURI) {
1830 var baseURIDescriptor = {
1831 get: function() {
1832 var base = document.querySelector("base");
1833 return base ? base.href : window.location.href;
1834 },
1835 configurable: true
1836 };
1837 Object.defineProperty(document, "baseURI", baseURIDescriptor);
1838 Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor);
1839 }
1840 scope.importer = importer;
1841 scope.importLoader = importLoader;
1842 });
1843
1844 window.HTMLImports.addModule(function(scope) {
1845 var parser = scope.parser;
1846 var importer = scope.importer;
1847 var dynamic = {
1848 added: function(nodes) {
1849 var owner, parsed, loading;
1850 for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
1851 if (!owner) {
1852 owner = n.ownerDocument;
1853 parsed = parser.isParsed(owner);
1854 }
1855 loading = this.shouldLoadNode(n);
1856 if (loading) {
1857 importer.loadNode(n);
1858 }
1859 if (this.shouldParseNode(n) && parsed) {
1860 parser.parseDynamic(n, loading);
1861 }
1862 }
1863 },
1864 shouldLoadNode: function(node) {
1865 return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));
1866 },
1867 shouldParseNode: function(node) {
1868 return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));
1869 }
1870 };
1871 importer.observer.addCallback = dynamic.added.bind(dynamic);
1872 var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;
1873 });
1874
1875 (function(scope) {
1876 var initializeModules = scope.initializeModules;
1877 var isIE = scope.isIE;
1878 if (scope.useNative) {
1879 return;
1880 }
1881 initializeModules();
1882 var rootDocument = scope.rootDocument;
1883 function bootstrap() {
1884 window.HTMLImports.importer.bootDocument(rootDocument);
1885 }
1886 if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) {
1887 bootstrap();
1888 } else {
1889 document.addEventListener("DOMContentLoaded", bootstrap);
1890 }
1891 })(window.HTMLImports);
1892
1893 window.CustomElements = window.CustomElements || {
1894 flags: {}
1895 };
1896
1897 (function(scope) {
1898 var flags = scope.flags;
1899 var modules = [];
1900 var addModule = function(module) {
1901 modules.push(module);
1902 };
1903 var initializeModules = function() {
1904 modules.forEach(function(module) {
1905 module(scope);
1906 });
1907 };
1908 scope.addModule = addModule;
1909 scope.initializeModules = initializeModules;
1910 scope.hasNative = Boolean(document.registerElement);
1911 scope.isIE = /Trident/.test(navigator.userAgent);
1912 scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
1913 })(window.CustomElements);
1914
1915 window.CustomElements.addModule(function(scope) {
1916 var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
1917 function forSubtree(node, cb) {
1918 findAllElements(node, function(e) {
1919 if (cb(e)) {
1920 return true;
1921 }
1922 forRoots(e, cb);
1923 });
1924 forRoots(node, cb);
1925 }
1926 function findAllElements(node, find, data) {
1927 var e = node.firstElementChild;
1928 if (!e) {
1929 e = node.firstChild;
1930 while (e && e.nodeType !== Node.ELEMENT_NODE) {
1931 e = e.nextSibling;
1932 }
1933 }
1934 while (e) {
1935 if (find(e, data) !== true) {
1936 findAllElements(e, find, data);
1937 }
1938 e = e.nextElementSibling;
1939 }
1940 return null;
1941 }
1942 function forRoots(node, cb) {
1943 var root = node.shadowRoot;
1944 while (root) {
1945 forSubtree(root, cb);
1946 root = root.olderShadowRoot;
1947 }
1948 }
1949 function forDocumentTree(doc, cb) {
1950 _forDocumentTree(doc, cb, []);
1951 }
1952 function _forDocumentTree(doc, cb, processingDocuments) {
1953 doc = window.wrap(doc);
1954 if (processingDocuments.indexOf(doc) >= 0) {
1955 return;
1956 }
1957 processingDocuments.push(doc);
1958 var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
1959 for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
1960 if (n.import) {
1961 _forDocumentTree(n.import, cb, processingDocuments);
1962 }
1963 }
1964 cb(doc);
1965 }
1966 scope.forDocumentTree = forDocumentTree;
1967 scope.forSubtree = forSubtree;
1968 });
1969
1970 window.CustomElements.addModule(function(scope) {
1971 var flags = scope.flags;
1972 var forSubtree = scope.forSubtree;
1973 var forDocumentTree = scope.forDocumentTree;
1974 function addedNode(node, isAttached) {
1975 return added(node, isAttached) || addedSubtree(node, isAttached);
1976 }
1977 function added(node, isAttached) {
1978 if (scope.upgrade(node, isAttached)) {
1979 return true;
1980 }
1981 if (isAttached) {
1982 attached(node);
1983 }
1984 }
1985 function addedSubtree(node, isAttached) {
1986 forSubtree(node, function(e) {
1987 if (added(e, isAttached)) {
1988 return true;
1989 }
1990 });
1991 }
1992 var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"];
1993 scope.hasPolyfillMutations = hasThrottledAttached;
1994 scope.hasThrottledAttached = hasThrottledAttached;
1995 var isPendingMutations = false;
1996 var pendingMutations = [];
1997 function deferMutation(fn) {
1998 pendingMutations.push(fn);
1999 if (!isPendingMutations) {
2000 isPendingMutations = true;
2001 setTimeout(takeMutations);
2002 }
2003 }
2004 function takeMutations() {
2005 isPendingMutations = false;
2006 var $p = pendingMutations;
2007 for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
2008 p();
2009 }
2010 pendingMutations = [];
2011 }
2012 function attached(element) {
2013 if (hasThrottledAttached) {
2014 deferMutation(function() {
2015 _attached(element);
2016 });
2017 } else {
2018 _attached(element);
2019 }
2020 }
2021 function _attached(element) {
2022 if (element.__upgraded__ && !element.__attached) {
2023 element.__attached = true;
2024 if (element.attachedCallback) {
2025 element.attachedCallback();
2026 }
2027 }
2028 }
2029 function detachedNode(node) {
2030 detached(node);
2031 forSubtree(node, function(e) {
2032 detached(e);
2033 });
2034 }
2035 function detached(element) {
2036 if (hasThrottledAttached) {
2037 deferMutation(function() {
2038 _detached(element);
2039 });
2040 } else {
2041 _detached(element);
2042 }
2043 }
2044 function _detached(element) {
2045 if (element.__upgraded__ && element.__attached) {
2046 element.__attached = false;
2047 if (element.detachedCallback) {
2048 element.detachedCallback();
2049 }
2050 }
2051 }
2052 function inDocument(element) {
2053 var p = element;
2054 var doc = window.wrap(document);
2055 while (p) {
2056 if (p == doc) {
2057 return true;
2058 }
2059 p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
2060 }
2061 }
2062 function watchShadow(node) {
2063 if (node.shadowRoot && !node.shadowRoot.__watched) {
2064 flags.dom && console.log("watching shadow-root for: ", node.localName);
2065 var root = node.shadowRoot;
2066 while (root) {
2067 observe(root);
2068 root = root.olderShadowRoot;
2069 }
2070 }
2071 }
2072 function handler(root, mutations) {
2073 if (flags.dom) {
2074 var mx = mutations[0];
2075 if (mx && mx.type === "childList" && mx.addedNodes) {
2076 if (mx.addedNodes) {
2077 var d = mx.addedNodes[0];
2078 while (d && d !== document && !d.host) {
2079 d = d.parentNode;
2080 }
2081 var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
2082 u = u.split("/?").shift().split("/").pop();
2083 }
2084 }
2085 console.group("mutations (%d) [%s]", mutations.length, u || "");
2086 }
2087 var isAttached = inDocument(root);
2088 mutations.forEach(function(mx) {
2089 if (mx.type === "childList") {
2090 forEach(mx.addedNodes, function(n) {
2091 if (!n.localName) {
2092 return;
2093 }
2094 addedNode(n, isAttached);
2095 });
2096 forEach(mx.removedNodes, function(n) {
2097 if (!n.localName) {
2098 return;
2099 }
2100 detachedNode(n);
2101 });
2102 }
2103 });
2104 flags.dom && console.groupEnd();
2105 }
2106 function takeRecords(node) {
2107 node = window.wrap(node);
2108 if (!node) {
2109 node = window.wrap(document);
2110 }
2111 while (node.parentNode) {
2112 node = node.parentNode;
2113 }
2114 var observer = node.__observer;
2115 if (observer) {
2116 handler(node, observer.takeRecords());
2117 takeMutations();
2118 }
2119 }
2120 var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
2121 function observe(inRoot) {
2122 if (inRoot.__observer) {
2123 return;
2124 }
2125 var observer = new MutationObserver(handler.bind(this, inRoot));
2126 observer.observe(inRoot, {
2127 childList: true,
2128 subtree: true
2129 });
2130 inRoot.__observer = observer;
2131 }
2132 function upgradeDocument(doc) {
2133 doc = window.wrap(doc);
2134 flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
2135 var isMainDocument = doc === window.wrap(document);
2136 addedNode(doc, isMainDocument);
2137 observe(doc);
2138 flags.dom && console.groupEnd();
2139 }
2140 function upgradeDocumentTree(doc) {
2141 forDocumentTree(doc, upgradeDocument);
2142 }
2143 var originalCreateShadowRoot = Element.prototype.createShadowRoot;
2144 if (originalCreateShadowRoot) {
2145 Element.prototype.createShadowRoot = function() {
2146 var root = originalCreateShadowRoot.call(this);
2147 window.CustomElements.watchShadow(this);
2148 return root;
2149 };
2150 }
2151 scope.watchShadow = watchShadow;
2152 scope.upgradeDocumentTree = upgradeDocumentTree;
2153 scope.upgradeDocument = upgradeDocument;
2154 scope.upgradeSubtree = addedSubtree;
2155 scope.upgradeAll = addedNode;
2156 scope.attached = attached;
2157 scope.takeRecords = takeRecords;
2158 });
2159
2160 window.CustomElements.addModule(function(scope) {
2161 var flags = scope.flags;
2162 function upgrade(node, isAttached) {
2163 if (node.localName === "template") {
2164 if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
2165 HTMLTemplateElement.decorate(node);
2166 }
2167 }
2168 if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
2169 var is = node.getAttribute("is");
2170 var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
2171 if (definition) {
2172 if (is && definition.tag == node.localName || !is && !definition.extends) {
2173 return upgradeWithDefinition(node, definition, isAttached);
2174 }
2175 }
2176 }
2177 }
2178 function upgradeWithDefinition(element, definition, isAttached) {
2179 flags.upgrade && console.group("upgrade:", element.localName);
2180 if (definition.is) {
2181 element.setAttribute("is", definition.is);
2182 }
2183 implementPrototype(element, definition);
2184 element.__upgraded__ = true;
2185 created(element);
2186 if (isAttached) {
2187 scope.attached(element);
2188 }
2189 scope.upgradeSubtree(element, isAttached);
2190 flags.upgrade && console.groupEnd();
2191 return element;
2192 }
2193 function implementPrototype(element, definition) {
2194 if (Object.__proto__) {
2195 element.__proto__ = definition.prototype;
2196 } else {
2197 customMixin(element, definition.prototype, definition.native);
2198 element.__proto__ = definition.prototype;
2199 }
2200 }
2201 function customMixin(inTarget, inSrc, inNative) {
2202 var used = {};
2203 var p = inSrc;
2204 while (p !== inNative && p !== HTMLElement.prototype) {
2205 var keys = Object.getOwnPropertyNames(p);
2206 for (var i = 0, k; k = keys[i]; i++) {
2207 if (!used[k]) {
2208 Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
2209 used[k] = 1;
2210 }
2211 }
2212 p = Object.getPrototypeOf(p);
2213 }
2214 }
2215 function created(element) {
2216 if (element.createdCallback) {
2217 element.createdCallback();
2218 }
2219 }
2220 scope.upgrade = upgrade;
2221 scope.upgradeWithDefinition = upgradeWithDefinition;
2222 scope.implementPrototype = implementPrototype;
2223 });
2224
2225 window.CustomElements.addModule(function(scope) {
2226 var isIE = scope.isIE;
2227 var upgradeDocumentTree = scope.upgradeDocumentTree;
2228 var upgradeAll = scope.upgradeAll;
2229 var upgradeWithDefinition = scope.upgradeWithDefinition;
2230 var implementPrototype = scope.implementPrototype;
2231 var useNative = scope.useNative;
2232 function register(name, options) {
2233 var definition = options || {};
2234 if (!name) {
2235 throw new Error("document.registerElement: first argument `name` must not be empty");
2236 }
2237 if (name.indexOf("-") < 0) {
2238 throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
2239 }
2240 if (isReservedTag(name)) {
2241 throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
2242 }
2243 if (getRegisteredDefinition(name)) {
2244 throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
2245 }
2246 if (!definition.prototype) {
2247 definition.prototype = Object.create(HTMLElement.prototype);
2248 }
2249 definition.__name = name.toLowerCase();
2250 if (definition.extends) {
2251 definition.extends = definition.extends.toLowerCase();
2252 }
2253 definition.lifecycle = definition.lifecycle || {};
2254 definition.ancestry = ancestry(definition.extends);
2255 resolveTagName(definition);
2256 resolvePrototypeChain(definition);
2257 overrideAttributeApi(definition.prototype);
2258 registerDefinition(definition.__name, definition);
2259 definition.ctor = generateConstructor(definition);
2260 definition.ctor.prototype = definition.prototype;
2261 definition.prototype.constructor = definition.ctor;
2262 if (scope.ready) {
2263 upgradeDocumentTree(document);
2264 }
2265 return definition.ctor;
2266 }
2267 function overrideAttributeApi(prototype) {
2268 if (prototype.setAttribute._polyfilled) {
2269 return;
2270 }
2271 var setAttribute = prototype.setAttribute;
2272 prototype.setAttribute = function(name, value) {
2273 changeAttribute.call(this, name, value, setAttribute);
2274 };
2275 var removeAttribute = prototype.removeAttribute;
2276 prototype.removeAttribute = function(name) {
2277 changeAttribute.call(this, name, null, removeAttribute);
2278 };
2279 prototype.setAttribute._polyfilled = true;
2280 }
2281 function changeAttribute(name, value, operation) {
2282 name = name.toLowerCase();
2283 var oldValue = this.getAttribute(name);
2284 operation.apply(this, arguments);
2285 var newValue = this.getAttribute(name);
2286 if (this.attributeChangedCallback && newValue !== oldValue) {
2287 this.attributeChangedCallback(name, oldValue, newValue);
2288 }
2289 }
2290 function isReservedTag(name) {
2291 for (var i = 0; i < reservedTagList.length; i++) {
2292 if (name === reservedTagList[i]) {
2293 return true;
2294 }
2295 }
2296 }
2297 var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
2298 function ancestry(extnds) {
2299 var extendee = getRegisteredDefinition(extnds);
2300 if (extendee) {
2301 return ancestry(extendee.extends).concat([ extendee ]);
2302 }
2303 return [];
2304 }
2305 function resolveTagName(definition) {
2306 var baseTag = definition.extends;
2307 for (var i = 0, a; a = definition.ancestry[i]; i++) {
2308 baseTag = a.is && a.tag;
2309 }
2310 definition.tag = baseTag || definition.__name;
2311 if (baseTag) {
2312 definition.is = definition.__name;
2313 }
2314 }
2315 function resolvePrototypeChain(definition) {
2316 if (!Object.__proto__) {
2317 var nativePrototype = HTMLElement.prototype;
2318 if (definition.is) {
2319 var inst = document.createElement(definition.tag);
2320 nativePrototype = Object.getPrototypeOf(inst);
2321 }
2322 var proto = definition.prototype, ancestor;
2323 var foundPrototype = false;
2324 while (proto) {
2325 if (proto == nativePrototype) {
2326 foundPrototype = true;
2327 }
2328 ancestor = Object.getPrototypeOf(proto);
2329 if (ancestor) {
2330 proto.__proto__ = ancestor;
2331 }
2332 proto = ancestor;
2333 }
2334 if (!foundPrototype) {
2335 console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is);
2336 }
2337 definition.native = nativePrototype;
2338 }
2339 }
2340 function instantiate(definition) {
2341 return upgradeWithDefinition(domCreateElement(definition.tag), definition);
2342 }
2343 var registry = {};
2344 function getRegisteredDefinition(name) {
2345 if (name) {
2346 return registry[name.toLowerCase()];
2347 }
2348 }
2349 function registerDefinition(name, definition) {
2350 registry[name] = definition;
2351 }
2352 function generateConstructor(definition) {
2353 return function() {
2354 return instantiate(definition);
2355 };
2356 }
2357 var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
2358 function createElementNS(namespace, tag, typeExtension) {
2359 if (namespace === HTML_NAMESPACE) {
2360 return createElement(tag, typeExtension);
2361 } else {
2362 return domCreateElementNS(namespace, tag);
2363 }
2364 }
2365 function createElement(tag, typeExtension) {
2366 if (tag) {
2367 tag = tag.toLowerCase();
2368 }
2369 if (typeExtension) {
2370 typeExtension = typeExtension.toLowerCase();
2371 }
2372 var definition = getRegisteredDefinition(typeExtension || tag);
2373 if (definition) {
2374 if (tag == definition.tag && typeExtension == definition.is) {
2375 return new definition.ctor();
2376 }
2377 if (!typeExtension && !definition.is) {
2378 return new definition.ctor();
2379 }
2380 }
2381 var element;
2382 if (typeExtension) {
2383 element = createElement(tag);
2384 element.setAttribute("is", typeExtension);
2385 return element;
2386 }
2387 element = domCreateElement(tag);
2388 if (tag.indexOf("-") >= 0) {
2389 implementPrototype(element, HTMLElement);
2390 }
2391 return element;
2392 }
2393 var domCreateElement = document.createElement.bind(document);
2394 var domCreateElementNS = document.createElementNS.bind(document);
2395 var isInstance;
2396 if (!Object.__proto__ && !useNative) {
2397 isInstance = function(obj, ctor) {
2398 if (obj instanceof ctor) {
2399 return true;
2400 }
2401 var p = obj;
2402 while (p) {
2403 if (p === ctor.prototype) {
2404 return true;
2405 }
2406 p = p.__proto__;
2407 }
2408 return false;
2409 };
2410 } else {
2411 isInstance = function(obj, base) {
2412 return obj instanceof base;
2413 };
2414 }
2415 function wrapDomMethodToForceUpgrade(obj, methodName) {
2416 var orig = obj[methodName];
2417 obj[methodName] = function() {
2418 var n = orig.apply(this, arguments);
2419 upgradeAll(n);
2420 return n;
2421 };
2422 }
2423 wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
2424 wrapDomMethodToForceUpgrade(document, "importNode");
2425 document.registerElement = register;
2426 document.createElement = createElement;
2427 document.createElementNS = createElementNS;
2428 scope.registry = registry;
2429 scope.instanceof = isInstance;
2430 scope.reservedTagList = reservedTagList;
2431 scope.getRegisteredDefinition = getRegisteredDefinition;
2432 document.register = document.registerElement;
2433 });
2434
2435 (function(scope) {
2436 var useNative = scope.useNative;
2437 var initializeModules = scope.initializeModules;
2438 var isIE = scope.isIE;
2439 if (useNative) {
2440 var nop = function() {};
2441 scope.watchShadow = nop;
2442 scope.upgrade = nop;
2443 scope.upgradeAll = nop;
2444 scope.upgradeDocumentTree = nop;
2445 scope.upgradeSubtree = nop;
2446 scope.takeRecords = nop;
2447 scope.instanceof = function(obj, base) {
2448 return obj instanceof base;
2449 };
2450 } else {
2451 initializeModules();
2452 }
2453 var upgradeDocumentTree = scope.upgradeDocumentTree;
2454 var upgradeDocument = scope.upgradeDocument;
2455 if (!window.wrap) {
2456 if (window.ShadowDOMPolyfill) {
2457 window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
2458 window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
2459 } else {
2460 window.wrap = window.unwrap = function(node) {
2461 return node;
2462 };
2463 }
2464 }
2465 if (window.HTMLImports) {
2466 window.HTMLImports.__importsParsingHook = function(elt) {
2467 if (elt.import) {
2468 upgradeDocument(wrap(elt.import));
2469 }
2470 };
2471 }
2472 function bootstrap() {
2473 upgradeDocumentTree(window.wrap(document));
2474 window.CustomElements.ready = true;
2475 var requestAnimationFrame = window.requestAnimationFrame || function(f) {
2476 setTimeout(f, 16);
2477 };
2478 requestAnimationFrame(function() {
2479 setTimeout(function() {
2480 window.CustomElements.readyTime = Date.now();
2481 if (window.HTMLImports) {
2482 window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
2483 }
2484 document.dispatchEvent(new CustomEvent("WebComponentsReady", {
2485 bubbles: true
2486 }));
2487 });
2488 });
2489 }
2490 if (document.readyState === "complete" || scope.flags.eager) {
2491 bootstrap();
2492 } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
2493 bootstrap();
2494 } else {
2495 var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
2496 window.addEventListener(loadEvent, bootstrap);
2497 }
2498 })(window.CustomElements);
2499
2500 (function(scope) {
2501 var style = document.createElement("style");
2502 style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
2503 var head = document.querySelector("head");
2504 head.insertBefore(style, head.firstChild);
2505 })(window.WebComponents); No newline at end of file
@@ -1,130 +1,133 b''
1 <template is="dom-bind" id="notificationsPage">
1 <dom-bind id="notificationsPage">
2 <template>
2 <iron-ajax id="toggleNotifications"
3 <iron-ajax id="toggleNotifications"
3 method="post"
4 method="post"
4 url="${h.route_path('my_account_notifications_toggle_visibility')}"
5 url="${h.route_path('my_account_notifications_toggle_visibility')}"
5 content-type="application/json"
6 content-type="application/json"
6 loading="{{changeNotificationsLoading}}"
7 loading="{{changeNotificationsLoading}}"
7 on-response="handleNotifications"
8 on-response="handleNotifications"
8 handle-as="json">
9 handle-as="json">
9 </iron-ajax>
10 </iron-ajax>
10
11
11 <iron-ajax id="sendTestNotification"
12 <iron-ajax id="sendTestNotification"
12 method="post"
13 method="post"
13 url="${h.route_path('my_account_notifications_test_channelstream')}"
14 url="${h.route_path('my_account_notifications_test_channelstream')}"
14 content-type="application/json"
15 content-type="application/json"
15 on-response="handleTestNotification"
16 on-response="handleTestNotification"
16 handle-as="json">
17 handle-as="json">
17 </iron-ajax>
18 </iron-ajax>
18
19
19 <div class="panel panel-default">
20 <div class="panel panel-default">
20 <div class="panel-heading">
21 <div class="panel-heading">
21 <h3 class="panel-title">${_('Your Live Notification Settings')}</h3>
22 <h3 class="panel-title">${_('Your Live Notification Settings')}</h3>
22 </div>
23 </div>
23 <div class="panel-body">
24 <div class="panel-body">
24
25
25 <p><strong>IMPORTANT:</strong> This feature requires enabled channelstream websocket server to function correctly.</p>
26 <p><strong>IMPORTANT:</strong> This feature requires enabled channelstream websocket server to function correctly.</p>
26
27
27 <p class="hidden">Status of browser notifications permission: <strong id="browser-notification-status"></strong></p>
28 <p class="hidden">Status of browser notifications permission: <strong id="browser-notification-status"></strong></p>
28
29
29 <div class="form">
30 <div class="form">
30 <div class="fields">
31 <div class="fields">
31 <div class="field">
32 <div class="field">
32 <div class="label">
33 <div class="label">
33 <label for="new_email">${_('Notifications Status')}:</label>
34 <label for="new_email">${_('Notifications Status')}:</label>
34 </div>
35 </div>
35 <div class="checkboxes">
36 <div class="checkboxes">
36 <rhodecode-toggle id="live-notifications" active="[[changeNotificationsLoading]]" on-change="toggleNotifications" ${'checked' if c.rhodecode_user.get_instance().user_data.get('notification_status') else ''}></rhodecode-toggle>
37 <rhodecode-toggle id="live-notifications" active="[[changeNotificationsLoading]]" on-change="toggleNotifications" ${'checked' if c.rhodecode_user.get_instance().user_data.get('notification_status') else ''}></rhodecode-toggle>
37 </div>
38 </div>
38 </div>
39 </div>
39 </div>
40 </div>
40 </div>
41 </div>
41 </div>
42 </div>
42 </div>
43 </div>
43
44
44 <div class="panel panel-default">
45 <div class="panel panel-default">
45 <div class="panel-heading">
46 <div class="panel-heading">
46 <h3 class="panel-title">${_('Test Notifications')}</h3>
47 <h3 class="panel-title">${_('Test Notifications')}</h3>
47 </div>
48 </div>
48 <div class="panel-body">
49 <div class="panel-body">
49
50
50
51
51 <div style="padding: 0px 0px 20px 0px">
52 <div style="padding: 0px 0px 20px 0px">
52 <button class="btn" id="test-notification" on-tap="testNotifications">Test flash message</button>
53 <button class="btn" id="test-notification" on-tap="testNotifications">Test flash message</button>
53 <button class="btn" id="test-notification-live" on-tap="testNotificationsLive">Test live notification</button>
54 <button class="btn" id="test-notification-live" on-tap="testNotificationsLive">Test live notification</button>
54 </div>
55 </div>
55 <h4 id="test-response"></h4>
56 <h4 id="test-response"></h4>
56
57
57 </div>
58 </div>
58
59
59
60
60
61
61 </div>
62 </div>
62
63
64
65 </template>
66 </dom-bind>
67
63 <script type="text/javascript">
68 <script type="text/javascript">
64 /** because im not creating a custom element for this page
69 /** because im not creating a custom element for this page
65 * we need to push the function onto the dom-template
70 * we need to push the function onto the dom-template
66 * ideally we turn this into notification-settings elements
71 * ideally we turn this into notification-settings elements
67 * then it will be cleaner
72 * then it will be cleaner
68 */
73 */
69 var ctrlr = $('#notificationsPage')[0];
74 var ctrlr = $('#notificationsPage')[0];
70 ctrlr.toggleNotifications = function(event){
75 ctrlr.toggleNotifications = function(event){
71 var ajax = $('#toggleNotifications')[0];
76 var ajax = $('#toggleNotifications')[0];
72 ajax.headers = {"X-CSRF-Token": CSRF_TOKEN};
77 ajax.headers = {"X-CSRF-Token": CSRF_TOKEN};
73 ajax.body = {notification_status:event.target.active};
78 ajax.body = {notification_status:event.target.active};
74 ajax.generateRequest();
79 ajax.generateRequest();
75 };
80 };
76 ctrlr.handleNotifications = function(event){
81 ctrlr.handleNotifications = function(event){
77 $('#live-notifications')[0].checked = event.detail.response;
82 $('#live-notifications')[0].checked = event.detail.response;
78 };
83 };
79
84
80 ctrlr.testNotifications = function(event){
85 ctrlr.testNotifications = function(event){
81 var levels = ['info', 'error', 'warning', 'success'];
86 var levels = ['info', 'error', 'warning', 'success'];
82 var level = levels[Math.floor(Math.random()*levels.length)];
87 var level = levels[Math.floor(Math.random()*levels.length)];
83 function getRandomArbitrary(min, max) {
88 function getRandomArbitrary(min, max) {
84 return parseInt(Math.random() * (max - min) + min);
89 return parseInt(Math.random() * (max - min) + min);
85 }
90 }
86 function shuffle(a) {
91 function shuffle(a) {
87 var j, x, i;
92 var j, x, i;
88 for (i = a.length; i; i--) {
93 for (i = a.length; i; i--) {
89 j = Math.floor(Math.random() * i);
94 j = Math.floor(Math.random() * i);
90 x = a[i - 1];
95 x = a[i - 1];
91 a[i - 1] = a[j];
96 a[i - 1] = a[j];
92 a[j] = x;
97 a[j] = x;
93 }
98 }
94 }
99 }
95 var wordDb = [
100 var wordDb = [
96 "Leela,", "Bender,", "we are", "going", "grave", "robbing.",
101 "Leela,", "Bender,", "we are", "going", "grave", "robbing.",
97 "Oh,", "I", "think", "we", "should", "just", "stay", "friends.",
102 "Oh,", "I", "think", "we", "should", "just", "stay", "friends.",
98 "got", "to", "find", "a", "way", "to", "escape", "the", "horrible",
103 "got", "to", "find", "a", "way", "to", "escape", "the", "horrible",
99 "ravages", "of", "youth.", "Suddenly,", "going", "to",
104 "ravages", "of", "youth.", "Suddenly,", "going", "to",
100 "the", "bathroom", "like", "clockwork,", "every", "three",
105 "the", "bathroom", "like", "clockwork,", "every", "three",
101 "hours.", "And", "those", "jerks", "at", "Social", "Security",
106 "hours.", "And", "those", "jerks", "at", "Social", "Security",
102 "stopped", "sending", "me", "checks.", "Now", "have", "to", "pay"
107 "stopped", "sending", "me", "checks.", "Now", "have", "to", "pay"
103 ];
108 ];
104 shuffle(wordDb);
109 shuffle(wordDb);
105 wordDb = wordDb.slice(0, getRandomArbitrary(3, wordDb.length));
110 wordDb = wordDb.slice(0, getRandomArbitrary(3, wordDb.length));
106 var randomMessage = wordDb.join(" ");
111 var randomMessage = wordDb.join(" ");
107 var payload = {
112 var payload = {
108 message: {
113 message: {
109 message: randomMessage + " " + new Date(),
114 message: randomMessage + " " + new Date(),
110 level: level,
115 level: level,
111 force: true
116 force: true
112 }
117 }
113 };
118 };
114 $.Topic('/notifications').publish(payload);
119 $.Topic('/notifications').publish(payload);
115 };
120 };
116 ctrlr.testNotificationsLive = function(event){
121 ctrlr.testNotificationsLive = function(event){
117 var ajax = $('#sendTestNotification')[0];
122 var ajax = $('#sendTestNotification')[0];
118 ajax.headers = {"X-CSRF-Token": CSRF_TOKEN};
123 ajax.headers = {"X-CSRF-Token": CSRF_TOKEN};
119 ajax.body = {test_msg: 'Hello !'};
124 ajax.body = {test_msg: 'Hello !'};
120 ajax.generateRequest();
125 ajax.generateRequest();
121 };
126 };
122 ctrlr.handleTestNotification = function(event){
127 ctrlr.handleTestNotification = function(event){
123 var reply = event.detail.response.response;
128 var reply = event.detail.response.response;
124 reply = reply || 'no reply form server';
129 reply = reply || 'no reply form server';
125 $('#test-response').html(reply);
130 $('#test-response').html(reply);
126 };
131 };
127
132
128 </script>
133 </script>
129
130 </template>
@@ -1,188 +1,161 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html>
2 <!DOCTYPE html>
3
3
4 <%
4 <%
5 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
5 c.template_context['repo_name'] = getattr(c, 'repo_name', '')
6 go_import_header = ''
6 go_import_header = ''
7 if hasattr(c, 'rhodecode_db_repo'):
7 if hasattr(c, 'rhodecode_db_repo'):
8 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
8 c.template_context['repo_type'] = c.rhodecode_db_repo.repo_type
9 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_rev[1]
9 c.template_context['repo_landing_commit'] = c.rhodecode_db_repo.landing_rev[1]
10
10
11 if getattr(c, 'repo_group', None):
11 if getattr(c, 'repo_group', None):
12 c.template_context['repo_group_id'] = c.repo_group.group_id
12 c.template_context['repo_group_id'] = c.repo_group.group_id
13
13
14 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
14 if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
15 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
15 c.template_context['rhodecode_user']['username'] = c.rhodecode_user.username
16 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
16 c.template_context['rhodecode_user']['email'] = c.rhodecode_user.email
17 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
17 c.template_context['rhodecode_user']['notification_status'] = c.rhodecode_user.get_instance().user_data.get('notification_status', True)
18 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
18 c.template_context['rhodecode_user']['first_name'] = c.rhodecode_user.first_name
19 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
19 c.template_context['rhodecode_user']['last_name'] = c.rhodecode_user.last_name
20
20
21 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
21 c.template_context['visual']['default_renderer'] = h.get_visual_attr(c, 'default_renderer')
22 c.template_context['default_user'] = {
22 c.template_context['default_user'] = {
23 'username': h.DEFAULT_USER,
23 'username': h.DEFAULT_USER,
24 'user_id': 1
24 'user_id': 1
25 }
25 }
26
26
27 %>
27 %>
28 <html xmlns="http://www.w3.org/1999/xhtml">
28 <html xmlns="http://www.w3.org/1999/xhtml">
29 <head>
29 <head>
30 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}"></script>
30 <script src="${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.js', ver=c.rhodecode_version_hash)}"></script>
31 <link rel="import" href="${h.asset('js/rhodecode-components.html', ver=c.rhodecode_version_hash)}">
31 <link rel="import" href="${h.asset('js/rhodecode-components.html', ver=c.rhodecode_version_hash)}">
32 <title>${self.title()}</title>
32 <title>${self.title()}</title>
33 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
33 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
34
34
35 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
35 ${h.go_import_header(request, getattr(c, 'rhodecode_db_repo', None))}
36
36
37 % if 'safari' in (request.user_agent or '').lower():
37 % if 'safari' in (request.user_agent or '').lower():
38 <meta name="referrer" content="origin">
38 <meta name="referrer" content="origin">
39 % else:
39 % else:
40 <meta name="referrer" content="origin-when-cross-origin">
40 <meta name="referrer" content="origin-when-cross-origin">
41 % endif
41 % endif
42
42
43 <%def name="robots()">
43 <%def name="robots()">
44 <meta name="robots" content="index, nofollow"/>
44 <meta name="robots" content="index, nofollow"/>
45 </%def>
45 </%def>
46 ${self.robots()}
46 ${self.robots()}
47 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
47 <link rel="icon" href="${h.asset('images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
48
48
49 ## CSS definitions
49 ## CSS definitions
50 <%def name="css()">
50 <%def name="css()">
51 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
51 <link rel="stylesheet" type="text/css" href="${h.asset('css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
52 <!--[if lt IE 9]>
52 <!--[if lt IE 9]>
53 <link rel="stylesheet" type="text/css" href="${h.asset('css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/>
53 <link rel="stylesheet" type="text/css" href="${h.asset('css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/>
54 <![endif]-->
54 <![endif]-->
55 ## EXTRA FOR CSS
55 ## EXTRA FOR CSS
56 ${self.css_extra()}
56 ${self.css_extra()}
57 </%def>
57 </%def>
58 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
58 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
59 <%def name="css_extra()">
59 <%def name="css_extra()">
60 </%def>
60 </%def>
61
61
62 ${self.css()}
62 ${self.css()}
63
63
64 ## JAVASCRIPT
64 ## JAVASCRIPT
65 <%def name="js()">
65 <%def name="js()">
66 <script>
67 // setup Polymer options
68 window.Polymer = {lazyRegister: true, dom: 'shadow'};
69
70 // Load webcomponentsjs polyfill if browser does not support native Web Components
71 (function() {
72 'use strict';
73 var onload = function() {
74 // For native Imports, manually fire WebComponentsReady so user code
75 // can use the same code path for native and polyfill'd imports.
76 if (!window.HTMLImports) {
77 document.dispatchEvent(
78 new CustomEvent('WebComponentsReady', {bubbles: true})
79 );
80 }
81 };
82 var webComponentsSupported = (
83 'registerElement' in document
84 && 'import' in document.createElement('link')
85 && 'content' in document.createElement('template')
86 );
87 if (!webComponentsSupported) {
88 } else {
89 onload();
90 }
91 })();
92 </script>
93
66
94 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
67 <script src="${h.asset('js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
95 <script type="text/javascript">
68 <script type="text/javascript">
96 // register templateContext to pass template variables to JS
69 // register templateContext to pass template variables to JS
97 var templateContext = ${h.json.dumps(c.template_context)|n};
70 var templateContext = ${h.json.dumps(c.template_context)|n};
98
71
99 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
72 var APPLICATION_URL = "${h.route_path('home').rstrip('/')}";
100 var ASSET_URL = "${h.asset('')}";
73 var ASSET_URL = "${h.asset('')}";
101 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
74 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
102 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
75 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
103
76
104 var APPENLIGHT = {
77 var APPENLIGHT = {
105 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
78 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
106 key: '${getattr(c, "appenlight_api_public_key", "")}',
79 key: '${getattr(c, "appenlight_api_public_key", "")}',
107 % if getattr(c, 'appenlight_server_url', None):
80 % if getattr(c, 'appenlight_server_url', None):
108 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
81 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
109 % endif
82 % endif
110 requestInfo: {
83 requestInfo: {
111 % if getattr(c, 'rhodecode_user', None):
84 % if getattr(c, 'rhodecode_user', None):
112 ip: '${c.rhodecode_user.ip_addr}',
85 ip: '${c.rhodecode_user.ip_addr}',
113 username: '${c.rhodecode_user.username}'
86 username: '${c.rhodecode_user.username}'
114 % endif
87 % endif
115 },
88 },
116 tags: {
89 tags: {
117 rhodecode_version: '${c.rhodecode_version}',
90 rhodecode_version: '${c.rhodecode_version}',
118 rhodecode_edition: '${c.rhodecode_edition}'
91 rhodecode_edition: '${c.rhodecode_edition}'
119 }
92 }
120 };
93 };
121
94
122 </script>
95 </script>
123 <%include file="/base/plugins_base.mako"/>
96 <%include file="/base/plugins_base.mako"/>
124 <!--[if lt IE 9]>
97 <!--[if lt IE 9]>
125 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
98 <script language="javascript" type="text/javascript" src="${h.asset('js/src/excanvas.min.js')}"></script>
126 <![endif]-->
99 <![endif]-->
127 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
100 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
128 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
101 <script> var alertMessagePayloads = ${h.flash.json_alerts(request=request)|n}; </script>
129 ## avoide escaping the %N
102 ## avoide escaping the %N
130 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode-components.js', ver=c.rhodecode_version_hash)}"></script>
103 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode-components.js', ver=c.rhodecode_version_hash)}"></script>
131 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
104 <script>CodeMirror.modeURL = "${h.asset('') + 'js/mode/%N/%N.js?ver='+c.rhodecode_version_hash}";</script>
132
105
133
106
134 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
107 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
135 ${self.js_extra()}
108 ${self.js_extra()}
136
109
137 <script type="text/javascript">
110 <script type="text/javascript">
138 Rhodecode = (function() {
111 Rhodecode = (function() {
139 function _Rhodecode() {
112 function _Rhodecode() {
140 this.comments = new CommentsController();
113 this.comments = new CommentsController();
141 }
114 }
142 return new _Rhodecode();
115 return new _Rhodecode();
143 })();
116 })();
144
117
145 $(document).ready(function(){
118 $(document).ready(function(){
146 show_more_event();
119 show_more_event();
147 timeagoActivate();
120 timeagoActivate();
148 clipboardActivate();
121 clipboardActivate();
149 })
122 })
150 </script>
123 </script>
151
124
152 </%def>
125 </%def>
153
126
154 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
127 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
155 <%def name="js_extra()"></%def>
128 <%def name="js_extra()"></%def>
156 ${self.js()}
129 ${self.js()}
157
130
158 <%def name="head_extra()"></%def>
131 <%def name="head_extra()"></%def>
159 ${self.head_extra()}
132 ${self.head_extra()}
160 ## extra stuff
133 ## extra stuff
161 %if c.pre_code:
134 %if c.pre_code:
162 ${c.pre_code|n}
135 ${c.pre_code|n}
163 %endif
136 %endif
164 </head>
137 </head>
165 <body id="body">
138 <body id="body">
166 <noscript>
139 <noscript>
167 <div class="noscript-error">
140 <div class="noscript-error">
168 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
141 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
169 </div>
142 </div>
170 </noscript>
143 </noscript>
171 ## IE hacks
144 ## IE hacks
172 <!--[if IE 7]>
145 <!--[if IE 7]>
173 <script>$(document.body).addClass('ie7')</script>
146 <script>$(document.body).addClass('ie7')</script>
174 <![endif]-->
147 <![endif]-->
175 <!--[if IE 8]>
148 <!--[if IE 8]>
176 <script>$(document.body).addClass('ie8')</script>
149 <script>$(document.body).addClass('ie8')</script>
177 <![endif]-->
150 <![endif]-->
178 <!--[if IE 9]>
151 <!--[if IE 9]>
179 <script>$(document.body).addClass('ie9')</script>
152 <script>$(document.body).addClass('ie9')</script>
180 <![endif]-->
153 <![endif]-->
181
154
182 ${next.body()}
155 ${next.body()}
183 %if c.post_code:
156 %if c.post_code:
184 ${c.post_code|n}
157 ${c.post_code|n}
185 %endif
158 %endif
186 <rhodecode-app></rhodecode-app>
159 <rhodecode-app></rhodecode-app>
187 </body>
160 </body>
188 </html>
161 </html>
General Comments 0
You need to be logged in to leave comments. Login now