diff --git a/api-console/README.md b/api-console/README.md index c2b84ad..939b407 100644 --- a/api-console/README.md +++ b/api-console/README.md @@ -10,6 +10,4 @@ Based on https://github.com/mulesoft/api-console ## Embedding the output into extension -1. Remove `sw.js` and `workbox-*.js` files. - -1. Rename the javascript file that is formatted like `204c1d73.js` to `apic-build.js` and copy the folder contents (except `index.html`) to `../extension/assets/api-console/`. +Rename the javascript file that is formatted like `204c1d73.js` to `apic-build.js`, then copy this file and `vendor.js` to `../extension/assets/api-console/`. diff --git a/api-console/package-lock.json b/api-console/package-lock.json index 83c3829..4a66f5e 100644 --- a/api-console/package-lock.json +++ b/api-console/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "api-console": "^6.4.9", - "fs-extra": "^9.1.0" + "fs-extra": "^10.0.0" }, "devDependencies": { "@open-wc/building-rollup": "^1.10.0", @@ -23,7 +23,7 @@ "lint-staged": "^10.5.4", "postcss": "^8.2.13", "rimraf": "^3.0.2", - "rollup": "^2.46.0", + "rollup": "^2.47.0", "rollup-plugin-cpy": "^2.0.1", "rollup-plugin-postcss": "^4.0.0", "uglify-js": "^3.13.5" @@ -3449,14 +3449,6 @@ "node": ">=8" } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -6475,17 +6467,16 @@ } }, "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", "dependencies": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/fs.realpath": { @@ -12260,9 +12251,9 @@ } }, "node_modules/rollup": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.46.0.tgz", - "integrity": "sha512-qPGoUBNl+Z8uNu0z7pD3WPTABWRbcOwIrO/5ccDJzmrtzn0LVf6Lj91+L5CcWhXl6iWf23FQ6m8Jkl2CmN1O7Q==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz", + "integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -17769,11 +17760,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" - }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -20308,11 +20294,10 @@ } }, "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", "requires": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" @@ -25105,9 +25090,9 @@ } }, "rollup": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.46.0.tgz", - "integrity": "sha512-qPGoUBNl+Z8uNu0z7pD3WPTABWRbcOwIrO/5ccDJzmrtzn0LVf6Lj91+L5CcWhXl6iWf23FQ6m8Jkl2CmN1O7Q==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz", + "integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==", "dev": true, "requires": { "fsevents": "~2.3.1" diff --git a/api-console/package.json b/api-console/package.json index 61b8cec..cb9af56 100644 --- a/api-console/package.json +++ b/api-console/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "api-console": "^6.4.9", - "fs-extra": "^9.1.0" + "fs-extra": "^10.0.0" }, "devDependencies": { "@open-wc/building-rollup": "^1.10.0", @@ -25,7 +25,7 @@ "lint-staged": "^10.5.4", "postcss": "^8.2.13", "rimraf": "^3.0.2", - "rollup": "^2.46.0", + "rollup": "^2.47.0", "rollup-plugin-cpy": "^2.0.1", "rollup-plugin-postcss": "^4.0.0", "uglify-js": "^3.13.5" diff --git a/api-console/src/api-console-app.js b/api-console/src/api-console-app.js new file mode 100644 index 0000000..7c67659 --- /dev/null +++ b/api-console/src/api-console-app.js @@ -0,0 +1,20 @@ +import { html } from 'lit-element'; +import { ApiConsoleApp } from 'api-console/src/ApiConsoleApp.js'; + +/* This class overrides ApiConsoleApp methods to customize existing API Console features */ +class CustomApiConsoleApp extends ApiConsoleApp { + /* + * Override _helpersTemplate() to remove redundant 'oauth-authorization' + * elements since they are already created in the 'api-request-editor' element somehow. + */ + _helpersTemplate() { + super._helpersTemplate(); + return html` + `; + } +} + +window.customElements.define('api-console-app', CustomApiConsoleApp); \ No newline at end of file diff --git a/api-console/src/apic-app.js b/api-console/src/apic-app.js deleted file mode 100644 index 58d4272..0000000 --- a/api-console/src/apic-app.js +++ /dev/null @@ -1,51 +0,0 @@ -import { - html, - render -} from 'lit-html'; - -export class ApicApplication { - constructor() { - this.consoleSelector = '#console'; - } - - initialize() { - this.apic = document.querySelector('api-console-app'); - - window.addEventListener('message', this._onMessage.bind(this)); - } - - _onMessage(e) { - console.log(e); - const model = JSON.parse(e.data); - this.apic.amf = model; - } - - template() { - return html ` - - `; - } - - render() { - if (this._rendering) { - return; - } - this.consoleContainer = document.querySelector(this.consoleSelector); - this._rendering = true; - setTimeout(() => { - this._rendering = false; - this._render(); - if (!this.__firstRendered) { - this.__firstRendered = true; - setTimeout(() => this.initialize()); - } - }); - } - - _render() { - const content = this.template(); - render(content, this.consoleContainer); - } -} \ No newline at end of file diff --git a/api-console/src/apic-build.js b/api-console/src/apic-build.js index 4221751..e9e1532 100644 --- a/api-console/src/apic-build.js +++ b/api-console/src/apic-build.js @@ -1,4 +1,3 @@ import './styles.css'; import './dark.css'; -import 'api-console/api-console-app'; -import './index.js'; \ No newline at end of file +import './api-console-app.js'; \ No newline at end of file diff --git a/api-console/src/index.html b/api-console/src/index.html index 23b6f5d..ed4630f 100644 --- a/api-console/src/index.html +++ b/api-console/src/index.html @@ -10,7 +10,7 @@ -
+ diff --git a/api-console/src/index.js b/api-console/src/index.js deleted file mode 100644 index 6bdb610..0000000 --- a/api-console/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import { - ApicApplication -} from './apic-app.js'; - -document.addEventListener('WebComponentsReady', function () { - if (!window.ShadyCSS) { - return; - } - - function shouldAddDocumentStyle(n) { - return n.nodeType === Node.ELEMENT_NODE && n.localName === 'style' && !n.hasAttribute('scope'); - } - const CustomStyleInterface = window.ShadyCSS.CustomStyleInterface; - - const candidates = document.querySelectorAll('style'); - for (let i = 0; i < candidates.length; i++) { - const candidate = candidates[i]; - if (shouldAddDocumentStyle(candidate)) { - CustomStyleInterface.addCustomStyle(candidate); - } - } -}); - -document.addEventListener('DOMContentLoaded', function () { - const consoleApp = new ApicApplication(); - consoleApp.render(); -}); \ No newline at end of file diff --git a/extension/CHANGELOG.md b/extension/CHANGELOG.md index 256129a..be2fc5f 100644 --- a/extension/CHANGELOG.md +++ b/extension/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## 1.2.0 + +### Features + +#### The API Console "Try It" functionality + +Now it is possible to use the Try It functionality in the opened API preview. + +Note: the OAuth 2.0 `Authorization code (server flow)` response type will not work due to the VS Code webview API limitations. + +### Changes + +* An error message is shown in cases when a language server is not ready to execute commands that depend on it. + + This prevents issues in the following cases: + + * When `exchange.json` is deleted, the language server may be not ready to restart. + + * When a command is executed and language server is not ready, erroneous or confusing behavior may occur. + For example, opening an API file preview when language server is restarting would result in empty API console without any notifications. + +* Enhanced security of the preview tab by enforcing the [`Content-Security-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) rules. + +### Fixes + +* Eliminated a lag when opening an API file preview. + +* Updated commands in README. + +* When `exchange.json` is deleted, the extension will no longer wait for input to restart the language server. + ## 1.1.0 ### Features diff --git a/extension/README.md b/extension/README.md index 4b75db2..c49d970 100644 --- a/extension/README.md +++ b/extension/README.md @@ -21,7 +21,8 @@ See supported types of documents: https://github.com/aml-org/als#what-is-als * `API Contractor: Restart language server` - Restarts the client and language server. * `API Contractor: Preview current API file` - Opens current API file in the API console. -* `API Contractor: Set a root API file` - Writes the `exchange.json` file to workspace root with the path to the root API file. +* `API Contractor: Set current API file as root file` - Writes the `exchange.json` file to workspace root with the relative path to current API file. +* `API Contractor: Convert current API file` - Shows the option menus with available conversion formats and syntaxes and converts the current API file according to the selections. ## Available settings @@ -42,7 +43,7 @@ can find currently supported features there. ##### Setting a root API file -The `API Contractor: Set a root API file` command allows setting the root API file for the current workspace. +The `API Contractor: Set current API file as root file` command allows setting the root API file for the current workspace. As the result, the `exchange.json` file will be created in the workspace root and contain a relative path to the main API file. This enables proper linking and validation for separate JSON/YAML files that are linked to the root API file. @@ -59,7 +60,7 @@ You can configure this behavior by changing the `apiContractor.autoRenameRefs` o ##### API files preview -Currently opened API file can be previewed with the API Console. A command to invoke API file preview is `ALS: Preview current API file`. +Currently opened API file can be previewed and tried out with the API Console. A command to invoke API file preview is `ALS: Preview current API file`. #### API format conversion diff --git a/extension/assets/api-console/apic-build.js b/extension/assets/api-console/apic-build.js index 64360b4..f1dd160 100644 --- a/extension/assets/api-console/apic-build.js +++ b/extension/assets/api-console/apic-build.js @@ -1,4 +1,4 @@ -function e(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}e("/* \r\n TODO: VS Code variables should be used for theming.\r\n https://code.visualstudio.com/api/extension-guides/webview#theming-webview-content\r\n*/\r\nhtml {\r\n --primary-color: #00A2DF;\r\n --accent-color: #4CAF50;\r\n --code-background-color: #f5f2f0;\r\n --error-color: #F44336;\r\n /* --secondary-text-color: #616161; */\r\n /* --primary-background-color: #424242; */\r\n /* --code-background-color: #263238;\r\n --code-color: #fff; */\r\n \r\n --anypoiont-dropdown-shaddow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);\r\n --anypoiont-autocomplete-dropdown-shaddow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);\r\n \r\n --anypoint-listbox-background-color: #fff;\r\n \r\n --arc-font-body1-font-size: 16px;\r\n --arc-font-body1-font-weight: 400;\r\n --arc-font-body1-line-height: 20px;\r\n --arc-font-code-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace;\r\n \r\n --arc-font-headline-font-size: 24px;\r\n --arc-font-headline-font-weight: 400;\r\n --arc-font-headline-letter-spacing: -.012em;\r\n --arc-font-headline-line-height: 32px;\r\n \r\n --arc-font-title-font-size: 20px;\r\n --arc-font-title-font-weight: 500;\r\n --arc-font-title-line-height: 28px;\r\n \r\n --arc-font-subhead-font-size: 16px;\r\n --arc-font-subhead-font-weight: 400;\r\n --arc-font-subhead-line-height: 24px;\r\n \r\n --code-mirror-height: auto;\r\n \r\n --api-navigation-list-item-selected-background-color: #E1F5FE;\r\n --api-navigation-list-item-selected-color: #0277BD;\r\n --api-navigation-operation-font-size: 13px;\r\n /* --api-navigation-color: #000; */\r\n \r\n --http-method-label-get-background-color: rgb(0, 128, 0);\r\n --http-method-label-get-color: #fff;\r\n --http-method-label-post-background-color: #006ec5;\r\n --http-method-label-post-color: #fff;\r\n --http-method-label-put-background-color: #ffa500;\r\n --http-method-label-put-color: #1D0029;\r\n --http-method-label-delete-background-color: #e93628;\r\n --http-method-label-delete-color: #fff;\r\n --http-method-label-patch-background-color: #811f92;\r\n --http-method-label-patch-color: #F2F1EF;\r\n \r\n /* --api-body-document-media-button-background-color: #2196F3; */\r\n }\r\n ");e("html {\r\n --primary-color: #ffcc80;\r\n --primary-text-color: #fff;\r\n --accent-color: #9c27b0;\r\n --secondary-text-color: rgba(255, 255, 255, 0.84);\r\n --primary-background-color: #212121;\r\n --error-color: #ff9090;\r\n --link-color: #8bc34a;\r\n\r\n /* layout */\r\n --api-console-toolbar-background-color: #424242;\r\n --api-console-menu-background-color: var(--primary-background-color);\r\n --api-console-menu-color: #fff;\r\n\r\n --anypoint-checkbox-label-color: #F5F5F5;\r\n --anypoint-input-background-color: #494949;\r\n --anypoint-input-label-color: #fff;\r\n --anypoint-input-input-color: #fff;\r\n --anypoint-input-border-bottom-color: #fff;\r\n --anypoint-input-focused-border-bottom-color: #fff;\r\n --anypoint-input-label-background-color: rgb(66, 66, 66);\r\n --anypoint-input-legacy-focus-background-color: #3a3b3c;\r\n --anypoint-input-legacy-focus-border-color: #178bea;\r\n --anypoint-input-info-message-color: #fff;\r\n\r\n --inline-documentation-background-color: #3a3a3a;\r\n\r\n --anypoint-menu-button-border-radius: 12px;\r\n\r\n --anypoint-dropdown-menu-background-color: #494949;\r\n --anypoint-dropdown-menu-label-background-color: var(--primary-background-color);\r\n --anypoint-listbox-background-color: #494949;\r\n --anypoint-dropdown-menu-focus-background-color: #616161;\r\n --anypoint-dropdown-menu-label-color: #fff;\r\n --anypoint-dropdown-menu-info-message-color: #fff;\r\n --anypoint-item-hover-background-color: #616161;\r\n --anypoint-item-focused-background-color: #212121;\r\n --anypoint-autocomplete-background-color: #494949;\r\n --anypoint-icon-button-emphasis-low-color: #c5c5c5;\r\n\r\n --anypoint-button-emphasis-low-hover-background-color: #616161;\r\n --anypoint-button-emphasis-low-focus-background-color: var(--anypoint-button-emphasis-low-hover-background-color);\r\n --anypoint-button-emphasis-low-focus-color: var(--primary-color);\r\n\r\n --code-mirror-background-color: #1e1e1e;\r\n --code-mirror-gutters-background-color: #1e1e1e;\r\n --code-mirror-string-color: #C3E88D;\r\n --code-mirror-punctuation-color: #EEFFFF;\r\n --code-mirror-atom-color: #F07178;\r\n --code-mirror-number-color: #F78C6A;\r\n --code-mirror-cursor-color: #009688;\r\n --code-mirror-tag-color: #ffffff;\r\n --code-mirror-tag-color: #b4b4b4;\r\n --code-mirror-gutters-border-right-color: #757575;\r\n\r\n --code-operator-value-background-color: transparent;\r\n --code-background-color: #212121;\r\n --code-color: #fff;\r\n --code-type-number-value-color: #eb67b0;\r\n --code-property-value-color: #b0e6ff;\r\n --code-type-text-value-color: #ffb89b;\r\n --code-type-boolean-value-color: #72baff;\r\n --code-type-number-value-color: #b5cea8;\r\n --code-token-comment-value-color: #91afcd;\r\n --code-keyword-value-color: #63d0ff;\r\n\r\n --api-type-document-type-attribute-color: #fff;\r\n --api-annotation-document-color: #fff;\r\n --api-body-document-description-color: #fff;\r\n --api-method-documentation-description-color: #fff;\r\n --api-method-documentation-bottom-navigation-color: #fff;\r\n --api-method-documentation-url-background-color: var(--code-background-color);\r\n --markdown-styles-code-text-shadow: none;\r\n\r\n --http-code-snippet-code-text-shadow: #fff;\r\n --http-code-snippet-container-background-color: var(--code-background-color);\r\n --http-code-snippet-code-function-color: #82AAFF;\r\n --http-code-snippet-code-keyword-color: #C792EA;\r\n --http-code-snippet-code-cdata-color: #adb9c5;\r\n\r\n --api-type-document-property-parent-color: #fff;\r\n\r\n --from-row-action-icon-color: #fff;\r\n --icon-button-color: #fff;\r\n --api-form-action-icon-color: #fff;\r\n --api-form-action-button-color: #fff;\r\n\r\n --auth-method-oauth2-redirect-info-color: #fff;\r\n --inline-documentation-color: #fff;\r\n\r\n --api-endpoint-documentation-bottom-navigation-color: var(--link-color);\r\n --api-endpoint-documentation-description-color: #fff;\r\n --api-method-documentation-bottom-navigation-color: var(--link-color);\r\n\r\n --authorization-method-oauth2-redirect-info-color: #fff;\r\n\r\n --api-navigation-section-title-focus-background-color: rgba(255, 255, 255, 0.12);\r\n --api-navigation-list-item-selected-background-color: rgba(255, 255, 255, 0.3);\r\n --api-navigation-list-item-selected-color: #FFF;\r\n\r\n /* Response error message */\r\n --error-message-icon-color: rgba(255, 255, 255, 0.64);\r\n --error-message-color: #fff;\r\n --error-message-code-color: #9e9e9e;\r\n\r\n /* HTTP method colors */\r\n --http-get-color: rgba(0, 128, 0, 0.74);\r\n --http-post-color: rgba(33, 150, 243, 0.74);\r\n --http-put-color: rgba(255, 165, 0, 0.74);\r\n --http-patch-color: rgb(156, 39, 176);\r\n --http-delete-color: rgba(244, 67, 54, 0.74);\r\n --http-options-color: rgba(128, 128, 128, 0.74);\r\n --http-head-color: rgba(128, 128, 128, 0.74);\r\n --http-connect-color: rgba(128, 128, 128, 0.74);\r\n --http-trace-color: rgba(128, 128, 128, 0.74);\r\n --http-method-label-get-background-color: var(--http-get-color);\r\n --http-method-label-get-color: #fff;\r\n --http-method-label-post-background-color: var(--http-post-color);\r\n --http-method-label-post-color: #fff;\r\n --http-method-label-patch-background-color: var(--http-patch-color);\r\n --http-method-label-patch-color: #fff;\r\n --http-method-label-put-background-color: var(--http-put-color);\r\n --http-method-label-put-color: #fff;\r\n --http-method-label-delete-background-color: var(--http-delete-color);\r\n --http-method-label-delete-color: #fff;\r\n --http-method-label-options-background-color: var(--http-options-color);\r\n --http-method-label-options-background-color: #fff;\r\n --http-method-label-head-background-color: var(--http-head-color);\r\n --http-method-label-head-background-color: #fff;\r\n --http-method-label-trace-background-color: var(--http-trace-color);\r\n --http-method-label-trace-background-color: #fff;\r\n --http-method-label-connect-background-color: var(--http-connect-color);\r\n --http-method-label-connect-background-color: #fff;\r\n}\r\n\r\nbody {\r\n background-color: #212121;\r\n color: #fff;\r\n\r\n margin: 0;\r\n padding: 0;\r\n font-family: 'Roboto', 'Noto', sans-serif;\r\n font-size: 15px;\r\n height: 100%;\r\n}\r\n\r\napi-selector {\r\n background-color: #111111;\r\n color: #fff;\r\n}\r\n");const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(e,t,i=null,s=null)=>{for(;t!==i;){const i=t.nextSibling;e.insertBefore(t,s),t=i}},s=(e,t,i=null)=>{for(;t!==i;){const i=t.nextSibling;e.removeChild(t),t=i}},n=`{{lit-${String(Math.random()).slice(2)}}}`,a=`\x3c!--${n}--\x3e`,r=new RegExp(`${n}|${a}`);class o{constructor(e,t){this.parts=[],this.element=t;const i=[],s=[],a=document.createTreeWalker(t.content,133,null,!1);let o=0,c=-1,p=0;const{strings:u,values:{length:m}}=e;for(;p0;){const t=u[p],i=d.exec(t)[2],s=i.toLowerCase()+"$lit$",n=e.getAttribute(s);e.removeAttribute(s);const a=n.split(r);this.parts.push({type:"attribute",index:c,name:i,strings:a}),p+=a.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(n)>=0){const s=e.parentNode,n=t.split(r),a=n.length-1;for(let t=0;t{const i=e.length-t.length;return i>=0&&e.slice(i)===t},c=e=>-1!==e.index,h=()=>document.createComment(""),d=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function p(e,t){const{element:{content:i},parts:s}=e,n=document.createTreeWalker(i,133,null,!1);let a=m(s),r=s[a],o=-1,l=0;const c=[];let h=null;for(;n.nextNode();){o++;const e=n.currentNode;for(e.previousSibling===h&&(h=null),t.has(e)&&(c.push(e),null===h&&(h=e)),null!==h&&l++;void 0!==r&&r.index===o;)r.index=null!==h?-1:r.index-l,a=m(s,a),r=s[a]}c.forEach((e=>e.parentNode.removeChild(e)))}const u=e=>{let t=11===e.nodeType?0:1;const i=document.createTreeWalker(e,133,null,!1);for(;i.nextNode();)t++;return t},m=(e,t=-1)=>{for(let i=t+1;i(...t)=>{const i=e(...t);return y.set(i,!0),i},f=e=>"function"==typeof e&&y.has(e),b={},_={};class v{constructor(e,t,i){this.__parts=[],this.template=e,this.processor=t,this.options=i}update(e){let t=0;for(const i of this.__parts)void 0!==i&&i.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),i=[],s=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let a,r=0,o=0,l=n.nextNode();for(;re}),x=` ${n} `;class k{constructor(e,t,i,s){this.strings=e,this.values=t,this.type=i,this.processor=s}getHTML(){const e=this.strings.length-1;let t="",i=!1;for(let s=0;s-1||i)&&-1===e.indexOf("--\x3e",r+1);const o=d.exec(e);t+=null===o?e+(i?x:a):e.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+n}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==w&&(t=w.createHTML(t)),e.innerHTML=t,e}}class S extends k{getHTML(){return`${super.getHTML()}`}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,s=t.firstChild;return t.removeChild(s),i(t,s.firstChild),e}}const A=e=>null===e||!("object"==typeof e||"function"==typeof e),T=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class C{constructor(e,t,i){this.dirty=!0,this.element=e,this.name=t,this.strings=i,this.parts=[];for(let e=0;e{try{const e={get capture(){return R=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class N{constructor(e,t,i){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=i,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;f(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=b,e(this)}if(this.__pendingValue===b)return;const e=this.__pendingValue,t=this.value,i=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),s=null!=e&&(null==t||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=z(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=b}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const z=e=>e&&(R?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);function I(e){let t=L.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},L.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const s=e.strings.join(n);return i=t.keyString.get(s),void 0===i&&(i=new o(e,e.getTemplateElement()),t.keyString.set(s,i)),t.stringsArray.set(e.strings,i),i}const L=new Map,q=new WeakMap,H=(e,t,i)=>{let n=q.get(t);void 0===n&&(s(t,t.firstChild),q.set(t,n=new E(Object.assign({templateFactory:I},i))),n.appendInto(t)),n.setValue(e),n.commit()};const D=new class{handleAttributeExpressions(e,t,i,s){const n=t[0];if("."===n){return new P(e,t.slice(1),i).parts}if("@"===n)return[new N(e,t.slice(1),s.eventContext)];if("?"===n)return[new O(e,t.slice(1),i)];return new C(e,t,i).parts}handleTextExpression(e){return new E(e)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const U=(e,...t)=>new k(e,t,"html",D),B=(e,...t)=>new S(e,t,"svg",D),V=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const j=e=>t=>{const i=V(t.type,e);let s=L.get(i);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},L.set(i,s));let a=s.stringsArray.get(t.strings);if(void 0!==a)return a;const r=t.strings.join(n);if(a=s.keyString.get(r),void 0===a){const i=t.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(i,e),a=new o(t,i),s.keyString.set(r,a)}return s.stringsArray.set(t.strings,a),a},K=["html","svg"],W=new Set,G=(e,t,i)=>{W.add(e);const s=i?i.element:document.createElement("template"),n=t.querySelectorAll("style"),{length:a}=n;if(0===a)return void window.ShadyCSS.prepareTemplateStyles(s,e);const r=document.createElement("style");for(let e=0;e{K.forEach((t=>{const i=L.get(V(t,e));void 0!==i&&i.keyString.forEach((e=>{const{element:{content:t}}=e,i=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{i.add(e)})),p(e,i)}))}))})(e);const o=s.content;i?function(e,t,i=null){const{element:{content:s},parts:n}=e;if(null==i)return void s.appendChild(t);const a=document.createTreeWalker(s,133,null,!1);let r=m(n),o=0,l=-1;for(;a.nextNode();)for(l++,a.currentNode===i&&(o=u(t),i.parentNode.insertBefore(t,i));-1!==r&&n[r].index===l;){if(o>0){for(;-1!==r;)n[r].index+=o,r=m(n,r);return}r=m(n,r)}}(i,r,o.firstChild):o.insertBefore(r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(s,e);const l=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(i){o.insertBefore(r,o.firstChild);const e=new Set;e.add(r),p(i,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const J={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},Z=(e,t)=>t!==e&&(t==t||e==e),X={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:Z};class Y extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,i)=>{const s=this._attributeNameForProperty(i,t);void 0!==s&&(this._attributeToPropertyMap.set(s,i),e.push(s))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=X){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const i="symbol"==typeof e?Symbol():`__${e}`,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){const n=this[e];this[t]=s,this.requestUpdateInternal(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||X}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const i of t)this.createProperty(i,e[i])}}static _attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,i=Z){return i(e,t)}static _propertyValueFromAttribute(e,t){const i=t.type,s=t.converter||J,n="function"==typeof s?s:s.fromAttribute;return n?n(e,i):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const i=t.type,s=t.converter;return(s&&s.toAttribute||J.toAttribute)(e,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,i){t!==i&&this._attributeToProperty(e,i)}_propertyToAttribute(e,t,i=X){const s=this.constructor,n=s._attributeNameForProperty(e,i);if(void 0!==n){const e=s._propertyValueToAttribute(t,i);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const i=this.constructor,s=i._attributeToPropertyMap.get(e);if(void 0!==s){const e=i.getPropertyOptions(s);this._updateState=16|this._updateState,this[s]=i._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,i){let s=!0;if(void 0!==e){const n=this.constructor;i=i||n.getPropertyOptions(e),n._valueHasChanged(this[e],t,i.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,i))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}Y.finalized=!0;const Q=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ee=Symbol();class te{constructor(e,t){if(t!==ee)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(Q?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ie=(e,...t)=>{const i=t.reduce(((t,i,s)=>t+(e=>{if(e instanceof te)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[s+1]),e[0]);return new te(i,ee)};(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const se={};class ne extends Y{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,i)=>e.reduceRight(((e,i)=>Array.isArray(i)?t(i,e):(e.add(i),e)),i),i=t(e,new Set),s=[];i.forEach((e=>s.unshift(e))),this._styles=s}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!Q){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new te(String(t),ee)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==se&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return se}}ne.finalized=!0,ne.render=(e,t,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,a=q.has(t),r=F&&11===t.nodeType&&!!t.host,o=r&&!W.has(n),l=o?document.createDocumentFragment():t;if(H(e,l,Object.assign({templateFactory:j(n)},i)),o){const e=q.get(l);q.delete(l);const i=e.value instanceof v?e.value.template:void 0;G(n,l,i),s(t,t.firstChild),t.appendChild(l),q.set(t,e)}!a&&r&&window.ShadyCSS.styleElement(t.host)};const ae=!(window.ShadyDOM&&window.ShadyDOM.inUse);let re,oe;function le(e){re=(!e||!e.shimcssproperties)&&(ae||Boolean(!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.cssBuild&&(oe=window.ShadyCSS.cssBuild);const ce=Boolean(window.ShadyCSS&&window.ShadyCSS.disableRuntime);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?re=window.ShadyCSS.nativeCss:window.ShadyCSS?(le(window.ShadyCSS),window.ShadyCSS=void 0):le(window.WebComponents&&window.WebComponents.flags);const he=re;class de{constructor(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""}}function pe(e){return ue(function(e){let t=new de;t.start=0,t.end=e.length;let i=t;for(let s=0,n=e.length;s{":root"===e.selector&&(e.selector="html"),this.transformRule(e)})),e.textContent=$e(t),t}transformRules(e,t){this._currentElement=t,Oe(e,(e=>{this.transformRule(e)})),this._currentElement=null}transformRule(e){e.cssText=this.transformCssText(e.parsedCssText,e),":root"===e.selector&&(e.selector=":host > *")}transformCssText(e,t){return e=e.replace(xe,((e,i,s,n)=>this._produceCssProperties(e,i,s,n,t))),this._consumeCssProperties(e,t)}_getInitialValueForProperty(e){return this._measureElement||(this._measureElement=document.createElement("meta"),this._measureElement.setAttribute("apply-shim-measure",""),this._measureElement.style.all="initial",document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(e)}_fallbacksFromPreviousRules(e){let t=e;for(;t.parent;)t=t.parent;const i={};let s=!1;return Oe(t,(t=>{s=s||t===e,s||t.selector===e.selector&&Object.assign(i,this._cssTextToMap(t.parsedCssText))})),i}_consumeCssProperties(e,t){let i=null;for(;i=ke.exec(e);){let s=i[0],n=i[1],a=i.index,r=a+s.indexOf("@apply"),o=a+s.length,l=e.slice(0,r),c=e.slice(o),h=t?this._fallbacksFromPreviousRules(t):{};Object.assign(h,this._cssTextToMap(l));let d=this._atApplyToCssProperties(n,h);e=`${l}${d}${c}`,ke.lastIndex=a+d.length}return e}_atApplyToCssProperties(e,t){e=e.replace(Ie,"");let i=[],s=this._map.get(e);if(s||(this._map.set(e,{}),s=this._map.get(e)),s){let n,a,r;this._currentElement&&(s.dependants[this._currentElement]=!0);const o=s.properties;for(n in o)r=t&&t[n],a=[n,": var(",e,"_-_",n],r&&a.push(",",r.replace(qe,"")),a.push(")"),qe.test(o[n])&&a.push(" !important"),i.push(a.join(""))}return i.join("; ")}_replaceInitialOrInherit(e,t){let i=Le.exec(t);return i&&(t=i[1]?this._getInitialValueForProperty(e):"apply-shim-inherit"),t}_cssTextToMap(e,t=!1){let i,s,n=e.split(";"),a={};for(let e,r,o=0;o1&&(i=r[0].trim(),s=r.slice(1).join(":"),t&&(s=this._replaceInitialOrInherit(i,s)),a[i]=s));return a}_invalidateMixinEntry(e){if(De)for(let t in e.dependants)t!==this._currentElement&&De(t)}_produceCssProperties(e,t,i,s,n){if(i&&Pe(i,((e,t)=>{t&&this._map.get(t)&&(s=`@apply ${t};`)})),!s)return e;let a=this._consumeCssProperties(""+s,n),r=e.slice(0,e.indexOf("--")),o=this._cssTextToMap(a,!0),l=o,c=this._map.get(t),h=c&&c.properties;h?l=Object.assign(Object.create(h),o):this._map.set(t,l);let d,p,u=[],m=!1;for(d in l)p=o[d],void 0===p&&(p="initial"),h&&!(d in h)&&(m=!0),u.push(`${t}_-_${d}: ${p}`);return m&&this._invalidateMixinEntry(c),c&&(c.properties=l),i&&(r=`${e};${r}`),`${r}${u.join("; ")};`}}Ue.prototype.detectMixin=Ue.prototype.detectMixin,Ue.prototype.transformStyle=Ue.prototype.transformStyle,Ue.prototype.transformCustomStyle=Ue.prototype.transformCustomStyle,Ue.prototype.transformRules=Ue.prototype.transformRules,Ue.prototype.transformRule=Ue.prototype.transformRule,Ue.prototype.transformTemplate=Ue.prototype.transformTemplate,Ue.prototype._separator="_-_",Object.defineProperty(Ue.prototype,"invalidCallback",{get:()=>De,set(e){De=e}});const Be={},Ve="_applyShimCurrentVersion",Fe="_applyShimNextVersion",je="_applyShimValidatingVersion",Ke=Promise.resolve();function We(e){let t=Be[e];t&&function(e){e[Ve]=e[Ve]||0,e[je]=e[je]||0,e[Fe]=(e[Fe]||0)+1}(t)}function Ge(e){return e[Ve]===e[Fe]}let Je,Ze=null,Xe=window.HTMLImports&&window.HTMLImports.whenReady||null;function Ye(e){requestAnimationFrame((function(){Xe?Xe(e):(Ze||(Ze=new Promise((e=>{Je=e})),"complete"===document.readyState?Je():document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&Je()}))),Ze.then((function(){e&&e()})))}))}const Qe="__shadyCSSCachedStyle";let et=null,tt=null;class it{constructor(){this.customStyles=[],this.enqueued=!1,Ye((()=>{window.ShadyCSS.flushCustomStyles&&window.ShadyCSS.flushCustomStyles()}))}enqueueDocumentValidation(){!this.enqueued&&tt&&(this.enqueued=!0,Ye(tt))}addCustomStyle(e){e.__seenByShadyCSS||(e.__seenByShadyCSS=!0,this.customStyles.push(e),this.enqueueDocumentValidation())}getStyleForCustomStyle(e){if(e[Qe])return e[Qe];let t;return t=e.getStyle?e.getStyle():e,t}processStyles(){const e=this.customStyles;for(let t=0;tet,set(e){et=e}},validateCallback:{get:()=>tt,set(e){let t=!1;tt||(t=!0),tt=e,t&&this.enqueueDocumentValidation()}}});const st=new Ue;class nt{constructor(){this.customStyleInterface=null,st.invalidCallback=We}ensure(){this.customStyleInterface||window.ShadyCSS.CustomStyleInterface&&(this.customStyleInterface=window.ShadyCSS.CustomStyleInterface,this.customStyleInterface.transformCallback=e=>{st.transformCustomStyle(e)},this.customStyleInterface.validateCallback=()=>{requestAnimationFrame((()=>{this.customStyleInterface.enqueued&&this.flushCustomStyles()}))})}prepareTemplate(e,t){if(this.ensure(),Re(e))return;Be[t]=e;let i=st.transformTemplate(e,t);e._styleAst=i}flushCustomStyles(){if(this.ensure(),!this.customStyleInterface)return;let e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(let t=0;t-1?i=t:(s=t,i=e.getAttribute&&e.getAttribute("is")||""):(i=e.is,s=e.extends),{is:i,typeExtension:s}}(e),i=Be[t];if((!i||!Re(i))&&i&&!Ge(i)){(function(e){return!Ge(e)&&e[je]===e[Fe]})(i)||(this.prepareTemplate(i,t),function(e){e[je]=e[Fe],e._validating||(e._validating=!0,Ke.then((function(){e[Ve]=e[Fe],e._validating=!1})))}(i));let s=e.shadowRoot;if(s){let e=s.querySelector("style");e&&(e.__cssRules=i._styleAst,e.textContent=$e(i._styleAst))}}}styleDocument(e){this.ensure(),this.styleSubtree(document.body,e)}}if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){const e=new nt;let t=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate(t,i,s){e.flushCustomStyles(),e.prepareTemplate(t,i)},prepareTemplateStyles(e,t,i){window.ShadyCSS.prepareTemplate(e,t,i)},prepareTemplateDom(e,t){},styleSubtree(t,i){e.flushCustomStyles(),e.styleSubtree(t,i)},styleElement(t){e.flushCustomStyles(),e.styleElement(t)},styleDocument(t){e.flushCustomStyles(),e.styleDocument(t)},getComputedStyleValue:(e,t)=>ze(e,t),flushCustomStyles(){e.flushCustomStyles()},nativeCss:he,nativeShadow:ae,cssBuild:oe,disableRuntime:ce},t&&(window.ShadyCSS.CustomStyleInterface=t)}window.ShadyCSS.ApplyShim=st,window.JSCompiler_renameProperty=function(e,t){return e};let at,rt,ot=/(url\()([^)]*)(\))/g,lt=/(^\/[^\/])|(^#)|(^[\w-\d]*:)/;function ct(e,t){if(e&<.test(e))return e;if("//"===e)return e;if(void 0===at){at=!1;try{const e=new URL("b","http://a");e.pathname="c%20d",at="http://a/c%20d"===e.href}catch(e){}}if(t||(t=document.baseURI||window.location.href),at)try{return new URL(e,t).href}catch(t){return e}return rt||(rt=document.implementation.createHTMLDocument("temp"),rt.base=rt.createElement("base"),rt.head.appendChild(rt.base),rt.anchor=rt.createElement("a"),rt.body.appendChild(rt.anchor)),rt.base.href=t,rt.anchor.href=e,rt.anchor.href||e}function ht(e,t){return e.replace(ot,(function(e,i,s,n){return i+"'"+ct(s.replace(/["']/g,""),t)+"'"+n}))}function dt(e){return e.substring(0,e.lastIndexOf("/")+1)}const pt=!window.ShadyDOM||!window.ShadyDOM.inUse;Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss);const ut=pt&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype&&(()=>{try{const e=new CSSStyleSheet;e.replaceSync("");const t=document.createElement("div");return t.attachShadow({mode:"open"}),t.shadowRoot.adoptedStyleSheets=[e],t.shadowRoot.adoptedStyleSheets[0]===e}catch(e){return!1}})();let mt=window.Polymer&&window.Polymer.rootPath||dt(document.baseURI||window.location.href),yt=window.Polymer&&window.Polymer.sanitizeDOMValue||void 0,gt=window.Polymer&&window.Polymer.setPassiveTouchGestures||!1,ft=window.Polymer&&window.Polymer.strictTemplatePolicy||!1,bt=window.Polymer&&window.Polymer.allowTemplateFromDomModule||!1,_t=window.Polymer&&window.Polymer.legacyOptimizations||!1,vt=window.Polymer&&window.Polymer.legacyWarnings||!1,wt=window.Polymer&&window.Polymer.syncInitialRender||!1,xt=window.Polymer&&window.Polymer.legacyUndefined||!1,kt=window.Polymer&&window.Polymer.orderedComputed||!1,St=window.Polymer&&window.Polymer.removeNestedTemplates||!1,At=window.Polymer&&window.Polymer.fastDomIf||!1,Tt=window.Polymer&&window.Polymer.suppressTemplateNotifications||!1,Ct=window.Polymer&&window.Polymer.legacyNoObservedAttributes||!1,$t=window.Polymer&&window.Polymer.useAdoptedStyleSheetsWithBuiltCSS||!1,Et=0;const Ot=function(e){let t=e.__mixinApplications;t||(t=new WeakMap,e.__mixinApplications=t);let i=Et++;return function(s){let n=s.__mixinSet;if(n&&n[i])return s;let a=t,r=a.get(s);if(!r){r=e(s),a.set(s,r);let t=Object.create(r.__mixinSet||n||null);t[i]=!0,r.__mixinSet=t}return r}};let Pt={},Mt={};function Rt(e,t){Pt[e]=Mt[e.toLowerCase()]=t}function Nt(e){return Pt[e]||Mt[e.toLowerCase()]}class zt extends HTMLElement{static get observedAttributes(){return["id"]}static import(e,t){if(e){let i=Nt(e);return i&&t?i.querySelector(t):i}return null}attributeChangedCallback(e,t,i,s){t!==i&&this.register()}get assetpath(){if(!this.__assetpath){const e=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,t=ct(this.getAttribute("assetpath")||"",e.baseURI);this.__assetpath=dt(t)}return this.__assetpath}register(e){if(e=e||this.id){if(ft&&void 0!==Nt(e))throw Rt(e,null),new Error(`strictTemplatePolicy: dom-module ${e} re-registered`);this.id=e,Rt(e,this),(t=this).querySelector("style")&&console.warn("dom-module %s has style outside template",t.id)}var t}}zt.prototype.modules=Pt,customElements.define("dom-module",zt);function It(e){return zt.import(e)}function Lt(e){const t=ht((e.body?e.body:e).textContent,e.baseURI),i=document.createElement("style");return i.textContent=t,i}function qt(e){const t=e.trim().split(/\s+/),i=[];for(let e=0;eShadyDOM.patch(e):e=>e;function Ft(e){return e.indexOf(".")>=0}function jt(e){let t=e.indexOf(".");return-1===t?e:e.slice(0,t)}function Kt(e,t){return 0===e.indexOf(t+".")}function Wt(e,t){return 0===t.indexOf(e+".")}function Gt(e,t,i){return t+i.slice(e.length)}function Jt(e){if(Array.isArray(e)){let t=[];for(let i=0;i1){for(let e=0;ee[1].toUpperCase())))}function si(e){return Qt[e]||(Qt[e]=e.replace(ti,"-$1").toLowerCase())}let ni=0,ai=0,ri=[],oi=0,li=!1,ci=document.createTextNode("");new window.MutationObserver((function(){li=!1;const e=ri.length;for(let t=0;t{throw e}))}}ri.splice(0,e),ai+=e})).observe(ci,{characterData:!0});const hi={after:e=>({run:t=>window.setTimeout(t,e),cancel(e){window.clearTimeout(e)}}),run:(e,t)=>window.setTimeout(e,t),cancel(e){window.clearTimeout(e)}},di={run:e=>window.requestAnimationFrame(e),cancel(e){window.cancelAnimationFrame(e)}},pi={run:e=>(li||(li=!0,ci.textContent=oi++),ri.push(e),ni++),cancel(e){const t=e-ai;if(t>=0){if(!ri[t])throw new Error("invalid async handle: "+e);ri[t]=null}}},ui=pi,mi=Ot((e=>class extends e{static createProperties(e){const t=this.prototype;for(let i in e)i in t||t._createPropertyAccessor(i)}static attributeNameForProperty(e){return e.toLowerCase()}static typeForProperty(e){}_createPropertyAccessor(e,t){this._addPropertyToAttributeMap(e),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[e]||(this.__dataHasAccessor[e]=!0,this._definePropertyAccessor(e,t))}_addPropertyToAttributeMap(e){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let t=this.__dataAttributes[e];return t||(t=this.constructor.attributeNameForProperty(e),this.__dataAttributes[t]=e),t}_definePropertyAccessor(e,t){Object.defineProperty(this,e,{get(){return this.__data[e]},set:t?function(){}:function(t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let e in this.__dataHasAccessor)this.hasOwnProperty(e)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[e]=this[e],delete this[e])}_initializeInstanceProperties(e){Object.assign(this,e)}_setProperty(e,t){this._setPendingProperty(e,t)&&this._invalidateProperties()}_getProperty(e){return this.__data[e]}_setPendingProperty(e,t,i){let s=this.__data[e],n=this._shouldPropertyChange(e,t,s);return n&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(e in this.__dataOld)&&(this.__dataOld[e]=s),this.__data[e]=t,this.__dataPending[e]=t),n}_isPropertyPending(e){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(e))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,ui.run((()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())})))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const e=this.__data,t=this.__dataPending,i=this.__dataOld;this._shouldPropertiesChange(e,t,i)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(e,t,i)),this.__dataCounter--}_shouldPropertiesChange(e,t,i){return Boolean(t)}_propertiesChanged(e,t,i){}_shouldPropertyChange(e,t,i){return i!==t&&(i==i||t==t)}attributeChangedCallback(e,t,i,s){t!==i&&this._attributeToProperty(e,i),super.attributeChangedCallback&&super.attributeChangedCallback(e,t,i,s)}_attributeToProperty(e,t,i){if(!this.__serializing){const s=this.__dataAttributes,n=s&&s[e]||e;this[n]=this._deserializeValue(t,i||this.constructor.typeForProperty(n))}}_propertyToAttribute(e,t,i){this.__serializing=!0,i=arguments.length<3?this[e]:i,this._valueToNodeAttribute(this,i,t||this.constructor.attributeNameForProperty(e)),this.__serializing=!1}_valueToNodeAttribute(e,t,i){const s=this._serializeValue(t);"class"!==i&&"name"!==i&&"slot"!==i||(e=Vt(e)),void 0===s?e.removeAttribute(i):e.setAttribute(i,s)}_serializeValue(e){switch(typeof e){case"boolean":return e?"":void 0;default:return null!=e?e.toString():void 0}}_deserializeValue(e,t){switch(t){case Boolean:return null!==e;case Number:return Number(e);default:return e}}})),yi={};let gi=HTMLElement.prototype;for(;gi;){let e=Object.getOwnPropertyNames(gi);for(let t=0;t{const t=mi(e);return class extends t{static createPropertiesForAttributes(){let e=this.observedAttributes;for(let t=0;tclass extends e{static _parseTemplate(e,t){if(!e._templateInfo){let i=e._templateInfo={};i.nodeInfoList=[],i.nestedTemplate=Boolean(t),i.stripWhiteSpace=t&&t.stripWhiteSpace||e.hasAttribute("strip-whitespace"),this._parseTemplateContent(e,i,{parent:null})}return e._templateInfo}static _parseTemplateContent(e,t,i){return this._parseTemplateNode(e.content,t,i)}static _parseTemplateNode(e,t,i){let s=!1,n=e;return"template"!=n.localName||n.hasAttribute("preserve-content")?"slot"===n.localName&&(t.hasInsertionPoint=!0):s=this._parseTemplateNestedTemplate(n,t,i)||s,wi(n),n.firstChild&&this._parseTemplateChildNodes(n,t,i),n.hasAttributes&&n.hasAttributes()&&(s=this._parseTemplateNodeAttributes(n,t,i)||s),s||i.noted}static _parseTemplateChildNodes(e,t,i){if("script"!==e.localName&&"style"!==e.localName)for(let s,n=e.firstChild,a=0;n;n=s){if("template"==n.localName&&(n=xi(n)),s=n.nextSibling,n.nodeType===Node.TEXT_NODE){let i=s;for(;i&&i.nodeType===Node.TEXT_NODE;)n.textContent+=i.textContent,s=i.nextSibling,e.removeChild(i),i=s;if(t.stripWhiteSpace&&!n.textContent.trim()){e.removeChild(n);continue}}let r={parentIndex:a,parentInfo:i};this._parseTemplateNode(n,t,r)&&(r.infoIndex=t.nodeInfoList.push(r)-1),n.parentNode&&a++}}static _parseTemplateNestedTemplate(e,t,i){let s=e,n=this._parseTemplate(s,t);return(n.content=s.content.ownerDocument.createDocumentFragment()).appendChild(s.content),i.templateInfo=n,!0}static _parseTemplateNodeAttributes(e,t,i){let s=!1,n=Array.from(e.attributes);for(let a,r=n.length-1;a=n[r];r--)s=this._parseTemplateNodeAttribute(e,t,i,a.name,a.value)||s;return s}static _parseTemplateNodeAttribute(e,t,i,s,n){return"on-"===s.slice(0,3)?(e.removeAttribute(s),i.events=i.events||[],i.events.push({name:s.slice(3),value:n}),!0):"id"===s&&(i.id=n,!0)}static _contentForTemplate(e){let t=e._templateInfo;return t&&t.content||e.content}_stampTemplate(e,t){e&&!e.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e);let i=(t=t||this.constructor._parseTemplate(e)).nodeInfoList,s=t.content||e.content,n=document.importNode(s,!0);n.__noInsertionPoint=!t.hasInsertionPoint;let a=n.nodeList=new Array(i.length);n.$={};for(let e,s=0,r=i.length;s!e.literal)).length+(s.dynamicFn?1:0)}for(let e in s)t[e]||n.push(e);return{counts:i,ready:n,total:a}}(e);for(;s=a.shift();){t.set(s,t.size);const e=i[s];e&&e.forEach((e=>{const t=e.info.methodInfo;--r,0==--n[t]&&a.push(t)}))}if(0!==r){const t=e;console.warn(`Computed graph for ${t.localName} incomplete; circular?`)}e.constructor.__orderedComputedDeps=t}return t}(e),r=[];for(let e in t)Vi(e,n,r,a,s);let o;for(;o=r.shift();)Fi(e,"",t,i,o)&&Vi(o.methodInfo,n,r,a,s);Object.assign(i,e.__dataOld),Object.assign(t,e.__dataPending),e.__dataPending=null}else{let a=t;for(;Ri(e,n,a,i,s);)Object.assign(i,e.__dataOld),Object.assign(t,e.__dataPending),a=e.__dataPending,e.__dataPending=null}}const Bi=(e,t,i)=>{let s=0,n=t.length-1,a=-1;for(;s<=n;){const r=s+n>>1,o=i.get(t[r].methodInfo)-i.get(e.methodInfo);if(o<0)s=r+1;else{if(!(o>0)){a=r;break}n=r-1}}a<0&&(a=n+1),t.splice(a,0,e)},Vi=(e,t,i,s,n)=>{const a=t[n?jt(e):e];if(a)for(let t=0;tc.source.length&&"property"==l.kind&&!l.isCompound&&o.__isPropertyEffectsClient&&o.__dataHasAccessor&&o.__dataHasAccessor[l.target]){let s=i[t];t=Gt(c.source,l.target,t),o._setPendingPropertyOrPath(t,s,!1,!0)&&e._enqueueClient(o)}else{let r=n.evaluator._evaluateBinding(e,c,t,i,s,a);r!==Ei&&function(e,t,i,s,n){n=function(e,t,i,s){if(i.isCompound){let n=e.__dataCompoundStorage[i.target];n[s.compoundIndex]=t,t=n.join("")}"attribute"!==i.kind&&("textContent"!==i.target&&("value"!==i.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t));return t}(t,n,i,s),yt&&(n=yt(n,i.target,i.kind,t));if("attribute"==i.kind)e._valueToNodeAttribute(t,n,i.target);else{let s=i.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[s]?t[Oi.READ_ONLY]&&t[Oi.READ_ONLY][s]||t._setPendingProperty(s,n)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,s,n)}}(e,o,l,c,r)}}function Gi(e,t){if(t.isCompound){let i=e.__dataCompoundStorage||(e.__dataCompoundStorage={}),s=t.parts,n=new Array(s.length);for(let e=0;e="0"&&s<="9"&&(s="#"),s){case"'":case'"':i.value=t.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(t),i.literal=!0}return i.literal||(i.rootProperty=jt(t),i.structured=Ft(t),i.structured&&(i.wildcard=".*"==t.slice(-2),i.wildcard&&(i.name=t.slice(0,-2)))),i}function ss(e,t,i){let s=Xt(e,i);return void 0===s&&(s=t[i]),s}function ns(e,t,i,s){const n={indexSplices:s};xt&&!e._overrideLegacyUndefined&&(t.splices=n),e.notifyPath(i+".splices",n),e.notifyPath(i+".length",t.length),xt&&!e._overrideLegacyUndefined&&(n.indexSplices=[])}function as(e,t,i,s,n,a){ns(e,t,i,[{index:s,addedCount:n,removed:a,object:t,type:"splice"}])}const rs=Ot((e=>{const t=Ci(fi(e));return class extends t{constructor(){super(),this.__isPropertyEffectsClient=!0,this.__dataClientsReady,this.__dataPendingClients,this.__dataToNotify,this.__dataLinkedPaths,this.__dataHasPaths,this.__dataCompoundStorage,this.__dataHost,this.__dataTemp,this.__dataClientsInitialized,this.__data,this.__dataPending,this.__dataOld,this.__computeEffects,this.__computeInfo,this.__reflectEffects,this.__notifyEffects,this.__propagateEffects,this.__observeEffects,this.__readOnly,this.__templateInfo,this._overrideLegacyUndefined}get PROPERTY_EFFECT_TYPES(){return Oi}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(os.length){let e=os[os.length-1];e._enqueueClient(this),this.__dataHost=e}}_initializeProtoProperties(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}_initializeInstanceProperties(e){let t=this[Oi.READ_ONLY];for(let i in e)t&&t[i]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=e[i])}_addPropertyEffect(e,t,i){this._createPropertyAccessor(e,t==Oi.READ_ONLY);let s=Mi(this,t,!0)[e];s||(s=this[t][e]=[]),s.push(i)}_removePropertyEffect(e,t,i){let s=Mi(this,t,!0)[e],n=s.indexOf(i);n>=0&&s.splice(n,1)}_hasPropertyEffect(e,t){let i=this[t];return Boolean(i&&i[e])}_hasReadOnlyEffect(e){return this._hasPropertyEffect(e,Oi.READ_ONLY)}_hasNotifyEffect(e){return this._hasPropertyEffect(e,Oi.NOTIFY)}_hasReflectEffect(e){return this._hasPropertyEffect(e,Oi.REFLECT)}_hasComputedEffect(e){return this._hasPropertyEffect(e,Oi.COMPUTE)}_setPendingPropertyOrPath(e,t,i,s){if(s||jt(Array.isArray(e)?e[0]:e)!==e){if(!s){let i=Xt(this,e);if(!(e=Yt(this,e,t))||!super._shouldPropertyChange(e,t,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,i))return function(e,t,i){let s=e.__dataLinkedPaths;if(s){let n;for(let a in s){let r=s[a];Wt(a,t)?(n=Gt(a,r,t),e._setPendingPropertyOrPath(n,i,!0,!0)):Wt(r,t)&&(n=Gt(r,a,t),e._setPendingPropertyOrPath(n,i,!0,!0))}}}(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,i);this[e]=t}return!1}_setUnmanagedPropertyToNode(e,t,i){i===e[t]&&"object"!=typeof i||("className"===t&&(e=Vt(e)),e[t]=i)}_setPendingProperty(e,t,i){let s=this.__dataHasPaths&&Ft(e),n=s?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,n[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),s?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(s||this[Oi.NOTIFY]&&this[Oi.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=i),!0)}_setProperty(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(let t=0;t{Ri(this,e.propertyEffects,t,i,s,e.nodeList);for(let n=e.firstChild;n;n=n.nextSibling)this._runEffectsForTemplate(n,t,i,s)};e.runEffects?e.runEffects(n,t,s):n(t,s)}linkPaths(e,t){e=Jt(e),t=Jt(t),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[e]=t}unlinkPaths(e){e=Jt(e),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[e]}notifySplices(e,t){let i={path:""};ns(this,Xt(this,e,i),i.path,t)}get(e,t){return Xt(t||this,e)}set(e,t,i){i?Yt(i,e,t):this[Oi.READ_ONLY]&&this[Oi.READ_ONLY][e]||this._setPendingPropertyOrPath(e,t,!0)&&this._invalidateProperties()}push(e,...t){let i={path:""},s=Xt(this,e,i),n=s.length,a=s.push(...t);return t.length&&as(this,s,i.path,n,t.length,[]),a}pop(e){let t={path:""},i=Xt(this,e,t),s=Boolean(i.length),n=i.pop();return s&&as(this,i,t.path,i.length,0,[n]),n}splice(e,t,i,...s){let n,a={path:""},r=Xt(this,e,a);return t<0?t=r.length-Math.floor(-t):t&&(t=Math.floor(t)),n=2===arguments.length?r.splice(t):r.splice(t,i,...s),(s.length||n.length)&&as(this,r,a.path,t,s.length,n),n}shift(e){let t={path:""},i=Xt(this,e,t),s=Boolean(i.length),n=i.shift();return s&&as(this,i,t.path,0,0,[n]),n}unshift(e,...t){let i={path:""},s=Xt(this,e,i),n=s.unshift(...t);return t.length&&as(this,s,i.path,0,t.length,[]),n}notifyPath(e,t){let i;if(1==arguments.length){let s={path:""};t=Xt(this,e,s),i=s.path}else i=Array.isArray(e)?Jt(e):e;this._setPendingPropertyOrPath(i,t,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(e,t){var i;this._addPropertyEffect(e,Oi.READ_ONLY),t&&(this["_set"+(i=e,i[0].toUpperCase()+i.substring(1))]=function(t){this._setProperty(e,t)})}_createPropertyObserver(e,t,i){let s={property:e,method:t,dynamicFn:Boolean(i)};this._addPropertyEffect(e,Oi.OBSERVE,{fn:Ii,info:s,trigger:{name:e}}),i&&this._addPropertyEffect(t,Oi.OBSERVE,{fn:Ii,info:s,trigger:{name:t}})}_createMethodObserver(e,t){let i=ts(e);if(!i)throw new Error("Malformed observer expression '"+e+"'");Zi(this,i,Oi.OBSERVE,Xi,null,t)}_createNotifyingProperty(e){this._addPropertyEffect(e,Oi.NOTIFY,{fn:Hi,info:{eventName:si(e)+"-changed",property:e}})}_createReflectedProperty(e){let t=this.constructor.attributeNameForProperty(e);"-"===t[0]?console.warn("Property "+e+" cannot be reflected to attribute "+t+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(e,Oi.REFLECT,{fn:Di,info:{attrName:t}})}_createComputedProperty(e,t,i){let s=ts(t);if(!s)throw new Error("Malformed computed expression '"+t+"'");const n=Zi(this,s,Oi.COMPUTE,Fi,e,i);Mi(this,"__computeInfo")[e]=n}_marshalArgs(e,t,i){const s=this.__data,n=[];for(let a=0,r=e.length;a1)return Ei;n[a]=c}return n}static addPropertyEffect(e,t,i){this.prototype._addPropertyEffect(e,t,i)}static createPropertyObserver(e,t,i){this.prototype._createPropertyObserver(e,t,i)}static createMethodObserver(e,t){this.prototype._createMethodObserver(e,t)}static createNotifyingProperty(e){this.prototype._createNotifyingProperty(e)}static createReadOnlyProperty(e,t){this.prototype._createReadOnlyProperty(e,t)}static createReflectedProperty(e){this.prototype._createReflectedProperty(e)}static createComputedProperty(e,t,i){this.prototype._createComputedProperty(e,t,i)}static bindTemplate(e){return this.prototype._bindTemplate(e)}_bindTemplate(e,t){let i=this.constructor._parseTemplate(e),s=this.__preBoundTemplateInfo==i;if(!s)for(let e in i.propertyEffects)this._createPropertyAccessor(e);if(t)if(i=Object.create(i),i.wasPreBound=s,this.__templateInfo){const t=e._parentTemplateInfo||this.__templateInfo,s=t.lastChild;i.parent=t,t.lastChild=i,i.previousSibling=s,s?s.nextSibling=i:t.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(e,t,i){(e.hostProps=e.hostProps||{})[t]=!0;let s=e.propertyEffects=e.propertyEffects||{};(s[t]=s[t]||[]).push(i)}_stampTemplate(e,t){t=t||this._bindTemplate(e,!0),os.push(this);let i=super._stampTemplate(e,t);if(os.pop(),t.nodeList=i.nodeList,!t.wasPreBound){let e=t.childNodes=[];for(let t=i.firstChild;t;t=t.nextSibling)e.push(t)}return i.templateInfo=t,function(e,t){let{nodeList:i,nodeInfoList:s}=t;if(s.length)for(let t=0;tn&&s.push({literal:e.slice(n,i.index)});let a=i[1][0],r=Boolean(i[2]),o=i[3].trim(),l=!1,c="",h=-1;"{"==a&&(h=o.indexOf("::"))>0&&(c=o.substring(h+2),o=o.substring(0,h),l=!0);let d=ts(o),p=[];if(d){let{args:e,methodName:i}=d;for(let t=0;t{const t=mi(e);function i(e){const t=Object.getPrototypeOf(e);return t.prototype instanceof n?t:null}function s(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",e))){let t=null;if(e.hasOwnProperty(JSCompiler_renameProperty("properties",e))){const i=e.properties;i&&(t=function(e){const t={};for(let i in e){const s=e[i];t[i]="function"==typeof s?{type:s}:s}return t}(i))}e.__ownProperties=t}return e.__ownProperties}class n extends t{static get observedAttributes(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){this.prototype;const e=this._properties;this.__observedAttributes=e?Object.keys(e).map((e=>this.prototype._addPropertyToAttributeMap(e))):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const e=i(this);e&&e.finalize(),this.__finalized=!0,this._finalizeClass()}}static _finalizeClass(){const e=s(this);e&&this.createProperties(e)}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const e=i(this);this.__properties=Object.assign({},e&&e._properties,s(this))}return this.__properties}static typeForProperty(e){const t=this._properties[e];return t&&t.type}_initializeProperties(){this.constructor.finalize(),super._initializeProperties()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._enableProperties()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback()}}return n})),cs=window.ShadyCSS&&window.ShadyCSS.cssBuild,hs=Ot((e=>{const t=ls(rs(e));function i(e,t,i,s){i.computed&&(i.readOnly=!0),i.computed&&(e._hasReadOnlyEffect(t)?console.warn(`Cannot redefine computed property '${t}'.`):e._createComputedProperty(t,i.computed,s)),i.readOnly&&!e._hasReadOnlyEffect(t)?e._createReadOnlyProperty(t,!i.computed):!1===i.readOnly&&e._hasReadOnlyEffect(t)&&console.warn(`Cannot make readOnly property '${t}' non-readOnly.`),i.reflectToAttribute&&!e._hasReflectEffect(t)?e._createReflectedProperty(t):!1===i.reflectToAttribute&&e._hasReflectEffect(t)&&console.warn(`Cannot make reflected property '${t}' non-reflected.`),i.notify&&!e._hasNotifyEffect(t)?e._createNotifyingProperty(t):!1===i.notify&&e._hasNotifyEffect(t)&&console.warn(`Cannot make notify property '${t}' non-notify.`),i.observer&&e._createPropertyObserver(t,i.observer,s[i.observer]),e._addPropertyToAttributeMap(t)}function s(e,t,i,s){if(!cs){const n=t.content.querySelectorAll("style"),a=Dt(t),r=function(e){let t=It(e);return t?Ut(t):[]}(i),o=t.content.firstElementChild;for(let i=0;i{t+=e.textContent,e.parentNode.removeChild(e)})),e._styleSheet=new CSSStyleSheet,e._styleSheet.replaceSync(t)}}}return class extends t{static get polymerElementVersion(){return"3.4.1"}static _finalizeClass(){t._finalizeClass.call(this);const e=((i=this).hasOwnProperty(JSCompiler_renameProperty("__ownObservers",i))||(i.__ownObservers=i.hasOwnProperty(JSCompiler_renameProperty("observers",i))?i.observers:null),i.__ownObservers);var i;e&&this.createObservers(e,this._properties),this._prepareTemplate()}static _prepareTemplate(){let e=this.template;e&&("string"==typeof e?(console.error("template getter must return HTMLTemplateElement"),e=null):_t||(e=e.cloneNode(!0))),this.prototype._template=e}static createProperties(e){for(let t in e)i(this.prototype,t,e[t],e)}static createObservers(e,t){const i=this.prototype;for(let s=0;s{this._timer=null,ps.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),ps.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(e,t,i){return e instanceof ds?e._cancelAsync():e=new ds,e.setConfig(t,i),e}}let ps=new Set;const us=function(e){ps.add(e)},ms=function(){const e=Boolean(ps.size);return ps.forEach((e=>{try{e.flush()}catch(e){setTimeout((()=>{throw e}))}})),e};let ys="string"==typeof document.head.style.touchAction,gs="__polymerGestures",fs="__polymerGesturesHandled",bs="__polymerGesturesTouchAction",_s=["mousedown","mousemove","mouseup","click"],vs=[0,1,4,2],ws=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function xs(e){return _s.indexOf(e)>-1}let ks=!1;function Ss(e){if(!xs(e)&&"touchend"!==e)return ys&&ks&>?{passive:!0}:void 0}!function(){try{let e=Object.defineProperty({},"passive",{get(){ks=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();let As=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const Ts=[],Cs={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},$s={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function Es(e){let t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];let i=e.getRootNode();if(e.id){let s=i.querySelectorAll(`label[for = ${e.id}]`);for(let e=0;e-1}if(s[e]===Rs.mouse.target)return}if(t)return;e.preventDefault(),e.stopPropagation()}};function Ps(e){let t=As?["click"]:_s;for(let i,s=0;se.composedPath&&e.composedPath()||[],Ls={},qs=[];function Hs(e){const t=Is(e);return t.length>0?t[0]:e.target}function Ds(e){let t,i=e.type,s=e.currentTarget.__polymerGestures;if(!s)return;let n=s[i];if(n){if(!e[fs]&&(e[fs]={},"touch"===i.slice(0,5))){let t=(e=e).changedTouches[0];if("touchstart"===i&&1===e.touches.length&&(Rs.touch.id=t.identifier),Rs.touch.id!==t.identifier)return;ys||"touchstart"!==i&&"touchmove"!==i||function(e){let t=e.changedTouches[0],i=e.type;if("touchstart"===i)Rs.touch.x=t.clientX,Rs.touch.y=t.clientY,Rs.touch.scrollDecided=!1;else if("touchmove"===i){if(Rs.touch.scrollDecided)return;Rs.touch.scrollDecided=!0;let i=function(e){let t="auto",i=Is(e);for(let e,s=0;sn:"pan-y"===i&&(s=n>a)),s?e.preventDefault():Ks("track")}}(e)}if(t=e[fs],!t.skip){for(let i,s=0;s-1&&i.reset&&i.reset();for(let s,a=0;a{e.style.touchAction=t})),e[bs]=t}function js(e,t,i){let s=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(s.detail=i,Vt(e).dispatchEvent(s),s.defaultPrevented){let e=i.preventer||i.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function Ks(e){let t=function(e){for(let t,i=0;i=5||n>=5}function Js(e,t,i){if(!t)return;let s,n=e.moves[e.moves.length-2],a=e.moves[e.moves.length-1],r=a.x-e.x,o=a.y-e.y,l=0;n&&(s=a.x-n.x,l=a.y-n.y),js(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:r,dy:o,ddx:s,ddy:l,sourceEvent:i,hover:function(){return function(e,t){let i=document.elementFromPoint(e,t),s=i;for(;s&&s.shadowRoot&&!window.ShadyDOM;){let n=s;if(s=s.shadowRoot.elementFromPoint(e,t),n===s)break;s&&(i=s)}return i}(i.clientX,i.clientY)}})}function Zs(e,t,i){let s=Math.abs(t.clientX-e.x),n=Math.abs(t.clientY-e.y),a=Hs(i||t);!a||$s[a.localName]&&a.hasAttribute("disabled")||(isNaN(s)||isNaN(n)||s<=25&&n<=25||function(e){if("click"===e.type){if(0===e.detail)return!0;let t=Hs(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;let i=t.getBoundingClientRect(),s=e.pageX,n=e.pageY;return!(s>=i.left&&s<=i.right&&n>=i.top&&n<=i.bottom)}return!1}(t))&&(e.prevent||js(a,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i}))}Vs({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){zs(this.info)},mousedown:function(e){if(!Ms(e))return;let t=Hs(e),i=this;Ns(this.info,(function(e){Ms(e)||(Ws("up",t,e),zs(i.info))}),(function(e){Ms(e)&&Ws("up",t,e),zs(i.info)})),Ws("down",t,e)},touchstart:function(e){Ws("down",Hs(e),e.changedTouches[0],e)},touchend:function(e){Ws("up",Hs(e),e.changedTouches[0],e)}}),Vs({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,zs(this.info)},mousedown:function(e){if(!Ms(e))return;let t=Hs(e),i=this,s=function(e){let s=e.clientX,n=e.clientY;Gs(i.info,s,n)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&Ks("tap"),i.info.addMove({x:s,y:n}),Ms(e)||(i.info.state="end",zs(i.info)),t&&Js(i.info,t,e),i.info.started=!0)};Ns(this.info,s,(function(e){i.info.started&&s(e),zs(i.info)})),this.info.x=e.clientX,this.info.y=e.clientY},touchstart:function(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){let t=Hs(e),i=e.changedTouches[0],s=i.clientX,n=i.clientY;Gs(this.info,s,n)&&("start"===this.info.state&&Ks("tap"),this.info.addMove({x:s,y:n}),Js(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend:function(e){let t=Hs(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),Js(this.info,t,i))}}),Vs({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){Ms(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){Ms(e)&&Zs(this.info,e)},touchstart:function(e){const t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){Zs(this.info,e.changedTouches[0],e)}});const Xs=Ot((e=>class extends e{_addEventListenerToNode(e,t,i){Us(e,t,i)||super._addEventListenerToNode(e,t,i)}_removeEventListenerFromNode(e,t,i){Bs(e,t,i)||super._removeEventListenerFromNode(e,t,i)}})),Ys=/:host\(:dir\((ltr|rtl)\)\)/g,Qs=/([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g,en=/:dir\((?:ltr|rtl)\)/,tn=Boolean(window.ShadyDOM&&window.ShadyDOM.inUse),sn=[];let nn=null,an="";function rn(){an=document.documentElement.getAttribute("dir")}function on(e){if(!e.__autoDirOptOut){e.setAttribute("dir",an)}}function ln(){rn(),an=document.documentElement.getAttribute("dir");for(let e=0;e{tn||nn||(rn(),nn=new MutationObserver(ln),nn.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}));const t=fi(e);class i extends t{static _processStyleText(e,i){return e=t._processStyleText.call(this,e,i),!tn&&en.test(e)&&(e=this._replaceDirInCssText(e),this.__activateDir=!0),e}static _replaceDirInCssText(e){let t=e;return t=t.replace(Ys,':host([dir="$1"])'),t=t.replace(Qs,':host([dir="$2"]) $1'),t}constructor(){super(),this.__autoDirOptOut=!1}ready(){super.ready(),this.__autoDirOptOut=this.hasAttribute("dir")}connectedCallback(){t.prototype.connectedCallback&&super.connectedCallback(),this.constructor.__activateDir&&(nn&&nn.takeRecords().length&&ln(),sn.push(this),on(this))}disconnectedCallback(){if(t.prototype.disconnectedCallback&&super.disconnectedCallback(),this.constructor.__activateDir){const e=sn.indexOf(this);e>-1&&sn.splice(e,1)}}}return i.__activateDir=!1,i}));let hn=!1,dn=[],pn=[];function un(){hn=!0,requestAnimationFrame((function(){hn=!1,function(e){for(;e.length;)mn(e.shift())}(dn),setTimeout((function(){!function(e){for(let t=0,i=e.length;t{throw e}))}}function yn(e,t,i){hn||un(),pn.push([e,t,i])}function gn(){document.body.removeAttribute("unresolved")}function fn(e,t,i){return{index:e,removed:t,addedCount:i}}"interactive"===document.readyState||"complete"===document.readyState?gn():window.addEventListener("DOMContentLoaded",gn);function bn(e,t,i,s,n,a){let r,o=0,l=0,c=Math.min(i-t,a-n);if(0==t&&0==n&&(o=function(e,t,i){for(let s=0;s0||i>0;){if(0==t){n.push(2),i--;continue}if(0==i){n.push(3),t--;continue}let a,r=e[t-1][i-1],o=e[t-1][i],l=e[t][i-1];a=own(e)?Vt(e=e).assignedNodes({flatten:!0}):[e])).reduce(((e,t)=>e.concat(t)),[])}constructor(e,t){this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=e,this.callback=t,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){wn(this._target)?this._listenSlots([this._target]):Vt(this._target).children&&(this._listenSlots(Vt(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,(e=>{this._processMutations(e)})):(this._nativeChildrenObserver=new MutationObserver((e=>{this._processMutations(e)})),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){wn(this._target)?this._unlistenSlots([this._target]):Vt(this._target).children&&(this._unlistenSlots(Vt(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,pi.run((()=>this.flush())))}_processMutations(e){this._processSlotMutations(e),this.flush()}_processSlotMutations(e){if(e)for(let t=0;t{"activeElement"!=t&&(e.prototype[t]=Cn.prototype[t])})),$n(e.prototype,["classList"]),On=e,Object.defineProperties(En.prototype,{localTarget:{get(){const e=this.event.currentTarget,t=e&&Pn(e).getOwnerRoot(),i=this.path;for(let e=0;e{for(;e;){const t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return()=>[]};Ot((e=>{const t=hs(e);let i=zn(t);return class extends t{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return i.call(this).concat("disable-upgrade")}_initializeProperties(){this.hasAttribute("disable-upgrade")?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}attributeChangedCallback(e,t,i,s){"disable-upgrade"==e?this.__isUpgradeDisabled&&null==i&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,Vt(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(e,t,i,s)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}));let In=window.ShadyCSS;const Ln=Ot((e=>{const t=Xs(hs(e)),i=cs?t:cn(t),s=zn(i),n={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class a extends i{constructor(){super(),this.isAttached,this.__boundListeners,this._debouncers,this.__isUpgradeDisabled,this.__needsAttributesAtConnected,this._legacyForceObservedAttributes}static get importMeta(){return this.prototype.importMeta}created(){}__attributeReaction(e,t,i){(this.__dataAttributes&&this.__dataAttributes[e]||"disable-upgrade"===e)&&this.attributeChangedCallback(e,t,i,null)}setAttribute(e,t){if(Ct&&!this._legacyForceObservedAttributes){const i=this.getAttribute(e);super.setAttribute(e,t),this.__attributeReaction(e,i,String(t))}else super.setAttribute(e,t)}removeAttribute(e){if(Ct&&!this._legacyForceObservedAttributes){const t=this.getAttribute(e);super.removeAttribute(e),this.__attributeReaction(e,t,null)}else super.removeAttribute(e)}static get observedAttributes(){return Ct&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],this.prototype),this.__observedAttributes):s.call(this).concat("disable-upgrade")}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(e){return super._canApplyPropertyDefault(e)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}connectedCallback(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(super.connectedCallback(),this.isAttached=!0,this.attached())}attached(){}disconnectedCallback(){this.__isUpgradeDisabled||(super.disconnectedCallback(),this.isAttached=!1,this.detached())}detached(){}attributeChangedCallback(e,t,i,s){t!==i&&("disable-upgrade"==e?this.__isUpgradeDisabled&&null==i&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,Vt(this).isConnected&&this.connectedCallback()):(super.attributeChangedCallback(e,t,i,s),this.attributeChanged(e,t,i)))}attributeChanged(e,t,i){}_initializeProperties(){if(_t&&this.hasAttribute("disable-upgrade"))this.__isUpgradeDisabled=!0;else{let e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),super._initializeProperties(),this.root=this,this.created(),Ct&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}_takeAttributes(){const e=this.attributes;for(let t=0,i=e.length;t{if(!Nn(e,n))return;const t=Array.from(Mn.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(let e=0;e{for(let t=0;t0?hi.after(i):pi,t.bind(this))}isDebouncerActive(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];return!(!t||!t.isActive())}flushDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.flush()}cancelDebouncer(e){this._debouncers=this._debouncers||{};let t=this._debouncers[e];t&&t.cancel()}async(e,t){return t>0?hi.run(e.bind(this),t):~pi.run(e.bind(this))}cancelAsync(e){e<0?pi.cancel(~e):hi.cancel(e)}create(e,t){let i=document.createElement(e);if(t)if(i.setProperties)i.setProperties(t);else for(let e in t)i[e]=t[e];return i}elementMatches(e,t){return Tn(t||this,e)}toggleAttribute(e,t){let i=this;return 3===arguments.length&&(i=arguments[2]),1==arguments.length&&(t=!i.hasAttribute(e)),t?(Vt(i).setAttribute(e,""),!0):(Vt(i).removeAttribute(e),!1)}toggleClass(e,t,i){i=i||this,1==arguments.length&&(t=!i.classList.contains(e)),t?i.classList.add(e):i.classList.remove(e)}transform(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}translate3d(e,t,i,s){s=s||this,this.transform("translate3d("+e+","+t+","+i+")",s)}arrayDelete(e,t){let i;if(Array.isArray(e)){if(i=e.indexOf(t),i>=0)return e.splice(i,1)}else{if(i=Xt(this,e).indexOf(t),i>=0)return this.splice(e,i,1)}return null}_logger(e,t){switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e](...t)}}_log(...e){this._logger("log",e)}_warn(...e){this._logger("warn",e)}_error(...e){this._logger("error",e)}_logf(e,...t){return["[%s::%s]",this.is,e,...t]}}return a.prototype.is="",a})),qn={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},Hn={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},Dn=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},Hn);function Un(e,t,i,s){!function(e,t,i){const s=e._noAccessors,n=Object.getOwnPropertyNames(e);for(let a=0;a=0;s--){let n=e[s];n?Array.isArray(n)?Bn(n,t):t.indexOf(n)<0&&(!i||i.indexOf(n)<0)&&t.unshift(n):console.warn("behavior is null, check for missing or 404 import")}return t}function Vn(e,t){for(const i in t){const s=e[i],n=t[i];e[i]=!("value"in n)&&s&&"value"in s?Object.assign({value:s.value},n):n}}const Fn=Ln(HTMLElement);function jn(e,t,i){let s;const n={};class a extends t{static _finalizeClass(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(s)for(let e,t=0;t=0;t--){const i=e[t];for(let e in i)this._ensureAttribute(e,i[e])}super._ensureAttributes()}ready(){super.ready();let e=n.ready;if(e)for(let t=0;t{s&&function(e,t,i){for(let s=0;sclass extends e{_shouldPropertyChange(e,t,i){return Wn(this,e,t,i,!0)}})),Jn=Ot((e=>class extends e{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(e,t,i){return Wn(this,e,t,i,this.mutableData)}}));Gn._mutablePropertyChange=Wn;let Zn=null;function Xn(){return Zn}Xn.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:Xn,writable:!0}});const Yn=rs(Xn),Qn=Gn(Yn);const ea=rs(class{});function ta(e,t){for(let i=0;i{e.model=this,i(e)}));else{let s=this.__dataHost.__dataHost;s&&s._addEventListenerToNode(e,t,i)}}_showHideChildren(e){ta(e,this.children)}_setUnmanagedPropertyToNode(e,t,i){e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==t?e.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(e,t,i)}get parentModel(){let e=this.__parentModel;if(!e){let t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}dispatchEvent(e){return!0}}const sa=Gn(ia);function na(e){let t=e.__dataHost;return t&&t._methodHost||t}function aa(e,t,i){let s=i.mutableData?sa:ia;ca.mixin&&(s=ca.mixin(s));let n=class extends s{};return n.prototype.__templatizeOptions=i,n.prototype._bindTemplate(e),function(e,t,i,s){let n=i.hostProps||{};for(let t in s.instanceProps){delete n[t];let i=s.notifyInstanceProp;i&&e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:la(t,i)})}if(s.forwardHostProp&&t.__dataHost)for(let t in n)i.hasHostProps||(i.hasHostProps=!0),e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(e,t,i){e.__dataHost._setPendingPropertyOrPath("_host_"+t,i[t],!0,!0)}})}(n,e,t,i),n}function ra(e,t,i,s){let n=i.forwardHostProp;if(n&&t.hasHostProps){const a="template"==e.localName;let r=t.templatizeTemplateClass;if(!r){if(a){let e=i.mutableData?Qn:Yn;class s extends e{}r=t.templatizeTemplateClass=s}else{const i=e.constructor;class s extends i{}r=t.templatizeTemplateClass=s}let o=t.hostProps;for(let e in o)r.prototype._addPropertyEffect("_host_"+e,r.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:oa(e,n)}),r.prototype._createNotifyingProperty("_host_"+e);vt&&s&&function(e,t,i){const s=i.constructor._properties,{propertyEffects:n}=e,{instanceProps:a}=t;for(let e in n)if(!(s[e]||a&&a[e])){const t=n[e];for(let i=0;i can only be templatized once");e.__templatizeOwner=t;let s=(t?t.constructor:ia)._parseTemplate(e),n=s.templatizeInstanceClass;n||(n=aa(e,s,i),s.templatizeInstanceClass=n);const a=na(e);ra(e,s,i,a);let r=class extends n{};return r.prototype._methodHost=a,r.prototype.__dataHost=e,r.prototype.__templatizeOwner=t,r.prototype.__hostProps=s.hostProps,r=r,r}let ha=!1;function da(){if(_t&&!pt){if(!ha){ha=!0;const e=document.createElement("style");e.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(e)}return!0}return!1}const pa=Xs(Jn(rs(HTMLElement)));customElements.define("dom-bind",class extends pa{static get observedAttributes(){return["mutable-data"]}constructor(){if(super(),ft)throw new Error("strictTemplatePolicy: dom-bind not allowed");this.root=null,this.$=null,this.__children=null}attributeChangedCallback(e,t,i,s){this.mutableData=!0}connectedCallback(){da()||(this.style.display="none"),this.render()}disconnectedCallback(){this.__removeChildren()}__insertChildren(){Vt(Vt(this).parentNode).insertBefore(this.root,this)}__removeChildren(){if(this.__children)for(let e=0;e{if(e=this.querySelector("template"),!e)throw new Error("dom-bind requires a