@teipublisher/pb-components 3.0.0-next-4.16 → 3.0.0-next-4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +104 -5
- package/CHANGELOG.md +15 -0
- package/cypress.config.js +2 -2
- package/dist/demo/pb-i18n.html +4 -1
- package/dist/{focus-mixin-Bq-O03uC.js → focus-mixin-BovUXNGZ.js} +17 -17
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-components-bundle.js +3 -3
- package/dist/{pb-dialog-E9XIBi_S.js → pb-dialog-DDg5xSQQ.js} +1 -1
- package/dist/pb-edit-app.js +1 -1
- package/dist/pb-i18n-UbZecobk.js +1 -0
- package/dist/pb-leaflet-map.js +1 -1
- package/dist/pb-mei.js +1 -1
- package/dist/pb-odd-editor.js +64 -64
- package/dist/unsafe-html-CaP8bK29.js +1 -0
- package/package.json +1 -1
- package/src/pb-autocomplete.js +5 -5
- package/src/pb-i18n.js +39 -3
- package/src/pb-odd-elementspec-editor.js +2 -2
- package/src/pb-page.js +8 -3
- package/vite.config.js +2 -2
- package/dist/pb-i18n-Dne_FgGK.js +0 -1
- package/dist/unsafe-html-C7vzzZJI.js +0 -1
package/.github/dependabot.yml
CHANGED
|
@@ -1,11 +1,110 @@
|
|
|
1
|
+
# Separate entries per branch — Dependabot has no shorthand for multi-branch PR targets.
|
|
2
|
+
#
|
|
3
|
+
# Groups are evaluated in order: first matching group wins. Specific toolchains come first,
|
|
4
|
+
# then broad dependency-type buckets.
|
|
5
|
+
|
|
1
6
|
version: 2
|
|
2
7
|
updates:
|
|
3
|
-
#
|
|
4
|
-
- package-ecosystem:
|
|
8
|
+
# ─── GitHub Actions → default branch (main) ─────────────────────────────────
|
|
9
|
+
- package-ecosystem: github-actions
|
|
5
10
|
directory: "/"
|
|
6
11
|
schedule:
|
|
7
|
-
interval:
|
|
8
|
-
|
|
12
|
+
interval: weekly
|
|
13
|
+
groups:
|
|
14
|
+
actions:
|
|
15
|
+
patterns:
|
|
16
|
+
- "*"
|
|
17
|
+
|
|
18
|
+
# ─── GitHub Actions → next-4 ────────────────────────────────────────────────
|
|
19
|
+
- package-ecosystem: github-actions
|
|
9
20
|
directory: "/"
|
|
10
21
|
schedule:
|
|
11
|
-
interval:
|
|
22
|
+
interval: weekly
|
|
23
|
+
target-branch: next-4
|
|
24
|
+
groups:
|
|
25
|
+
actions:
|
|
26
|
+
patterns:
|
|
27
|
+
- "*"
|
|
28
|
+
|
|
29
|
+
# ─── npm → default branch (main) ────────────────────────────────────────────
|
|
30
|
+
- package-ecosystem: npm
|
|
31
|
+
directory: "/"
|
|
32
|
+
schedule:
|
|
33
|
+
interval: daily
|
|
34
|
+
versioning-strategy: increase-if-necessary
|
|
35
|
+
groups:
|
|
36
|
+
rollup-and-vite:
|
|
37
|
+
patterns:
|
|
38
|
+
- "rollup"
|
|
39
|
+
- "vite"
|
|
40
|
+
- "@rollup/*"
|
|
41
|
+
- "rollup-plugin-*"
|
|
42
|
+
babel:
|
|
43
|
+
patterns:
|
|
44
|
+
- "@babel/*"
|
|
45
|
+
cypress-and-test-tooling:
|
|
46
|
+
patterns:
|
|
47
|
+
- "cypress"
|
|
48
|
+
- "concurrently"
|
|
49
|
+
- "eslint-plugin-cypress"
|
|
50
|
+
- "eslint-plugin-chai-friendly"
|
|
51
|
+
- "web-component-analyzer"
|
|
52
|
+
eslint-prettier-and-lint:
|
|
53
|
+
patterns:
|
|
54
|
+
- "eslint"
|
|
55
|
+
- "@eslint/*"
|
|
56
|
+
- "eslint-*"
|
|
57
|
+
- "globals"
|
|
58
|
+
- "lint-staged"
|
|
59
|
+
- "@open-wc/eslint-config"
|
|
60
|
+
- "@open-wc/prettier-config"
|
|
61
|
+
semantic-release:
|
|
62
|
+
patterns:
|
|
63
|
+
- "semantic-release"
|
|
64
|
+
- "@semantic-release/*"
|
|
65
|
+
production-dependencies:
|
|
66
|
+
dependency-type: production
|
|
67
|
+
development-dependencies:
|
|
68
|
+
dependency-type: development
|
|
69
|
+
|
|
70
|
+
# ─── npm → next-4 (identical grouping) ──────────────────────────────────────
|
|
71
|
+
- package-ecosystem: npm
|
|
72
|
+
directory: "/"
|
|
73
|
+
schedule:
|
|
74
|
+
interval: daily
|
|
75
|
+
versioning-strategy: increase-if-necessary
|
|
76
|
+
target-branch: next-4
|
|
77
|
+
groups:
|
|
78
|
+
rollup-and-vite:
|
|
79
|
+
patterns:
|
|
80
|
+
- "rollup"
|
|
81
|
+
- "vite"
|
|
82
|
+
- "@rollup/*"
|
|
83
|
+
- "rollup-plugin-*"
|
|
84
|
+
babel:
|
|
85
|
+
patterns:
|
|
86
|
+
- "@babel/*"
|
|
87
|
+
cypress-and-test-tooling:
|
|
88
|
+
patterns:
|
|
89
|
+
- "cypress"
|
|
90
|
+
- "concurrently"
|
|
91
|
+
- "eslint-plugin-cypress"
|
|
92
|
+
- "eslint-plugin-chai-friendly"
|
|
93
|
+
- "web-component-analyzer"
|
|
94
|
+
eslint-prettier-and-lint:
|
|
95
|
+
patterns:
|
|
96
|
+
- "eslint"
|
|
97
|
+
- "@eslint/*"
|
|
98
|
+
- "eslint-*"
|
|
99
|
+
- "globals"
|
|
100
|
+
- "lint-staged"
|
|
101
|
+
- "@open-wc/eslint-config"
|
|
102
|
+
- "@open-wc/prettier-config"
|
|
103
|
+
semantic-release:
|
|
104
|
+
patterns:
|
|
105
|
+
- "semantic-release"
|
|
106
|
+
- "@semantic-release/*"
|
|
107
|
+
production-dependencies:
|
|
108
|
+
dependency-type: production
|
|
109
|
+
development-dependencies:
|
|
110
|
+
dependency-type: development
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [3.0.0-next-4.18](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.17...v3.0.0-next-4.18) (2026-05-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **pb-i18n:** always fall back to common localization ([4906fd0](https://github.com/eeditiones/tei-publisher-components/commit/4906fd0e5bc6cda5e2780d6cc42656927ede64ab))
|
|
7
|
+
* **pb-i18n:** do not double-include the common locales ([fc216aa](https://github.com/eeditiones/tei-publisher-components/commit/fc216aa5ceba0d411eb25970985448168bfaf1d5))
|
|
8
|
+
|
|
9
|
+
# [3.0.0-next-4.17](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.16...v3.0.0-next-4.17) (2026-05-08)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **pb-i18n:** make translate a directive again ([82cda45](https://github.com/eeditiones/tei-publisher-components/commit/82cda45399bdf6149607ed638362029fa912c4cc))
|
|
15
|
+
|
|
1
16
|
# [3.0.0-next-4.16](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.15...v3.0.0-next-4.16) (2026-05-06)
|
|
2
17
|
|
|
3
18
|
|
package/cypress.config.js
CHANGED
|
@@ -71,7 +71,7 @@ module.exports = defineConfig({
|
|
|
71
71
|
// keep your other tasks if needed
|
|
72
72
|
return config
|
|
73
73
|
},
|
|
74
|
-
baseUrl: process.env.CYPRESS_baseUrl || 'http://localhost:
|
|
74
|
+
baseUrl: process.env.CYPRESS_baseUrl || 'http://localhost:8000',
|
|
75
75
|
retries: 1,
|
|
76
76
|
specPattern: 'test/cypress/e2e/**/*.cy.{js,ts}',
|
|
77
77
|
supportFile: 'test/cypress/support/e2e.js',
|
|
@@ -83,4 +83,4 @@ module.exports = defineConfig({
|
|
|
83
83
|
existBackend: process.env.CYPRESS_existBackend || 'http://localhost:8080/exist/apps/tei-publisher'
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
})
|
|
86
|
+
})
|
package/dist/demo/pb-i18n.html
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<h3 data-i18n="menu.download.title"></h3>
|
|
61
61
|
<div>Attributes can be translated as well (card heading above)</div>
|
|
62
62
|
</div>
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
<h2>without a label</h2>
|
|
65
65
|
<pb-lang label="language" selected="en" nolabel="nolabel">
|
|
66
66
|
<option value="de">German</option>
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
<option value="nl">Dutch</option>
|
|
74
74
|
</pb-lang>
|
|
75
75
|
|
|
76
|
+
|
|
77
|
+
<h2>localizations by the system</h2>
|
|
78
|
+
<p>the string 'search' is localized in the common en.json to <pb-i18n id="search" key="search.search">MISSING</pb-i18n></p>
|
|
76
79
|
</pb-page>
|
|
77
80
|
</template>
|
|
78
81
|
</pb-demo-snippet>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin-B7EAqf7q.js";import{t as c}from"./pb-dialog-
|
|
1
|
+
import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin-B7EAqf7q.js";import{t as c}from"./pb-dialog-DDg5xSQQ.js";import{e as d,a as h,b as u,g as p,t as g}from"./pb-i18n-UbZecobk.js";import{l as f}from"./logger-BDsEU7Z8.js";import{o as m}from"./unsafe-html-CaP8bK29.js";const v=e=>e??t;class b extends(c(e(s))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{noAnimation:{type:Boolean,attribute:"no-animation"},opened:{type:Boolean},toggles:{type:Boolean},expandIcon:{type:String,attribute:"expand-icon"},collapseIcon:{type:String,attribute:"collapse-icon"},iconSprite:{type:String,attribute:"icon-sprite"},noIcons:{type:Boolean,attribute:"no-icons"}})}constructor(){super(),this.horizontal=!1,this.noAnimation=!1,this.opened=!1,this.expandIcon="icons:expand-more",this.collapseIcon="icons:expand-less",this.noIcons=!1,this.toggles=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("pb-collapse-open",()=>{this.open()}),this.toggles&&this.subscribeTo("pb-collapse-open",t=>{if(t.detail&&t.detail._source!==this){for(const e of this.querySelectorAll("pb-collapse"))if(e===t.detail._source)return;this.close()}})}updated(t){if(super.updated(t),t.has("opened")){const t=this.shadowRoot.querySelector("details");t&&(t.open=this.opened)}}open(){this.opened||(this.opened=!0,this.emitTo("pb-collapse-open",this))}close(){this.opened&&(this.opened=!1)}toggle(){this.opened=!this.opened,this.opened&&this.emitTo("pb-collapse-open",this.data)}_handleToggle(t){t.preventDefault(),this.toggle()}render(){return n`
|
|
2
2
|
<details ?open="${this.opened}" class="${this.horizontal?"horizontal":""}">
|
|
3
3
|
<summary
|
|
4
4
|
@click="${this._handleToggle}"
|
|
@@ -15,7 +15,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
15
15
|
</details>
|
|
16
16
|
`}_renderIcon({position:t}){if(this.noIcons)return null;const e=this.classList&&this.classList.contains("icon-right");if("left"===t&&e||"right"===t&&!e)return null;const s=this._customIconImage(),i=s&&"none"!==s,o=this.opened?this.collapseIcon:this.expandIcon,r=this.iconSprite||null;return n`
|
|
17
17
|
<span class="collapse-icon" data-custom="${i?"true":"false"}">
|
|
18
|
-
<pb-icon icon="${o}" sprite=${
|
|
18
|
+
<pb-icon icon="${o}" sprite=${v(r||void 0)} decorative></pb-icon>
|
|
19
19
|
</span>
|
|
20
20
|
`}_customIconImage(){return"undefined"==typeof window||"function"!=typeof getComputedStyle?"none":getComputedStyle(this).getPropertyValue("--pb-collapse-icon-image").trim()||"none"}static get styles(){return i`
|
|
21
21
|
:host {
|
|
@@ -107,10 +107,10 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
107
107
|
max-height: 0;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
`}}customElements.get("pb-collapse")||customElements.define("pb-collapse",v);class b extends HTMLElement{static get observedAttributes(){return["handle-as","method","with-credentials","content-type"]}constructor(){super(),this._url="",this._method="GET",this._handleAs="json",this._withCredentials=!1,this._contentType=null,this.params={},this.headers={},this.body=void 0,this.loading=!1,this.lastResponse=null,this.lastRequest=null,this.lastError=null,this._controller=null}connectedCallback(){this.hasAttribute("method")&&this.attributeChangedCallback("method",null,this.getAttribute("method")),this.hasAttribute("handle-as")&&this.attributeChangedCallback("handle-as",null,this.getAttribute("handle-as")),this.hasAttribute("with-credentials")&&this.attributeChangedCallback("with-credentials",null,this.getAttribute("with-credentials")),this.hasAttribute("content-type")&&this.attributeChangedCallback("content-type",null,this.getAttribute("content-type"))}attributeChangedCallback(t,e,s){switch(t){case"handle-as":this._handleAs=(s||"json").toLowerCase();break;case"method":this._method=(s||"GET").toUpperCase();break;case"with-credentials":this._withCredentials=null!==s;break;case"content-type":this._contentType=s||null}}set url(t){this._url=t||""}get url(){return this._url}set method(t){const e=(t||"GET").toUpperCase();this._method!==e&&(this._method=e,null==t?this.removeAttribute("method"):this.setAttribute("method",t))}get method(){return this._method}set handleAs(t){const e=(t||"json").toLowerCase();this._handleAs!==e&&(this._handleAs=e,null==t?this.removeAttribute("handle-as"):this.setAttribute("handle-as",t))}get handleAs(){return this._handleAs}set withCredentials(t){const e=Boolean(t);this._withCredentials!==e&&(this._withCredentials=e,e?this.setAttribute("with-credentials",""):this.removeAttribute("with-credentials"))}get withCredentials(){return this._withCredentials}set contentType(t){this._contentType!==t&&(this._contentType=t||null,null==t?this.removeAttribute("content-type"):this.setAttribute("content-type",t))}get contentType(){return this._contentType}abort(){this._controller&&(this._controller.abort(),this._controller=null,this.loading=!1)}async generateRequest(){if(!this._url)return null;this.abort(),this._controller=new AbortController;const t=this._buildRequestInit();t.signal=this._controller.signal,this.loading=!0;try{const e=this._buildUrlWithParams(),s=await fetch(e,t),{parsed:n,rawText:i}=await this._parseBody(s);if(this.lastRequest={url:e,method:this._method,params:this.params,headers:t.headers},!s.ok){const t={status:s.status,statusText:s.statusText,response:i,xhr:this._createXhrShim(s)};return this.lastError=t,this.lastResponse=null,this.loading=!1,this.dispatchEvent(new CustomEvent("error",{detail:t})),null}this.lastError=null,this.lastResponse=n,this.loading=!1;const o={response:n,status:s.status,xhr:this._createXhrShim(s),request:this.lastRequest};return this.dispatchEvent(new CustomEvent("response",{detail:o})),n}catch(t){if("AbortError"===t.name)return null;if(!this.lastError){const e={status:t.status||0,statusText:t.statusText||t.message,response:t.response||null,xhr:t.xhr||null};this.lastError=e,this.lastResponse=null,this.dispatchEvent(new CustomEvent("error",{detail:e}))}return this.loading=!1,null}finally{this._controller=null}}_buildUrlWithParams(){if(!this.params||0===Object.keys(this.params).length)return this._url;const t=[];if(Object.entries(this.params).forEach(([e,s])=>{null!=s&&(Array.isArray(s)?s.forEach(s=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`)}):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`))}),0===t.length)return this._url;const e=this._url.includes("?")?"&":"?";return`${this._url}${e}${t.join("&")}`}_buildRequestInit(){const t=this.headers&&"function"==typeof this.headers.entries?Object.fromEntries(this.headers.entries()):this.headers||{},e=new Headers(t),s={method:this._method||"GET",headers:e,credentials:this._withCredentials?"include":"same-origin"},n=this._prepareBody(e);return void 0!==n&&(s.body=n),s}_prepareBody(t){if(null==this.body)return;if(this.body instanceof FormData||this.body instanceof Blob||this.body instanceof ArrayBuffer)return this.body;if("string"==typeof this.body)return this._contentType&&!t.has("Content-Type")&&t.set("Content-Type",this._contentType),this.body;if(this.body instanceof URLSearchParams)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this.body.toString();if("application/x-www-form-urlencoded"===this._contentType)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this._encodeFormBody(this.body);const e=this._contentType||"application/json";return t.has("Content-Type")||t.set("Content-Type",e),e.includes("json")?JSON.stringify(this.body):this.body}async _parseBody(t){const e=t.clone();let s="";try{s=await e.text()}catch(t){s=""}if(204===t.status||205===t.status)return{parsed:null,rawText:""};switch(this._handleAs){case"text":return{parsed:s,rawText:s};case"json":if(!s)return{parsed:null,rawText:s};try{return{parsed:JSON.parse(s),rawText:s}}catch(t){return{parsed:null,rawText:s}}case"blob":return{parsed:await t.blob(),rawText:s};case"arraybuffer":return{parsed:await t.arrayBuffer(),rawText:s};default:return{parsed:s,rawText:s}}}_createXhrShim(t){return{status:t.status,statusText:t.statusText,responseURL:t.url,getResponseHeader:e=>t.headers.get(e),getAllResponseHeaders:()=>[...t.headers.entries()].map(([t,e])=>`${t}: ${e}`).join("\r\n")}}_encodeFormBody(t){if(t instanceof URLSearchParams)return t.toString();if("string"==typeof t)return t;if(!t||"object"!=typeof t)return"";const e=new URLSearchParams;return Object.entries(t).forEach(([t,s])=>{Array.isArray(s)?s.forEach(s=>e.append(t,s)):null!=s&&e.append(t,s)}),e.toString()}}customElements.get("pb-fetch")||customElements.define("pb-fetch",b);const y=d(class extends h{constructor(t){var e;if(super(t),t.type!==u.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e){var s;e[t]&&(null===(s=this.nt)||void 0===s||!s.has(t))&&this.st.add(t)}return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){var i;const s=!!e[t];s===this.st.has(t)||(null===(i=this.nt)||void 0===i?void 0:i.has(t))||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return o}});let _=0;const w={ENTER:"Enter",ESC:"Escape",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},x=200;function k(t){if("object"==typeof t&&t){const e=t.text??t.value??"",s=t.value??t.text??"";return{text:String(e),value:String(s)}}const e=null==t?"":String(t);return{text:e,value:e}}function C(t=[]){return Array.isArray(t)?t.map(k):[]}class S extends(e(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},label:{type:String},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String},helperText:{type:String,attribute:"helper-text"},alwaysFloatLabel:{type:Boolean,attribute:"always-float-label"},disabled:{type:Boolean,reflect:!0},requestParams:{type:Object,attribute:!1}})}constructor(){super(),this.placeholder="search.placeholder",this.label="",this.suggestions=[],this.substring=!1,this.preload=!1,this.icon="",this.helperText="",this.alwaysFloatLabel=!1,this.disabled=!1,this.lastSelected=null,this.value="",this.name="",this._hiddenInput=null,this._initialized=!1,this._menuOpen=!1,this._isFocused=!1,this._inputValue="",this._filteredSuggestions=[],this._highlightedIndex=-1,this._loading=!1,this._pointerSelecting=!1,this._fetchTimeout=null,this._abortController=null,this.requestParams={},this._inputId="pb-autocomplete-input-"+ ++_}_resolveLabelText(){return this.label?g(this.label):this.placeholder?g(this.placeholder):""}_resolveHelperText(){return this.helperText?g(this.helperText):""}get _input(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(this._inputId))??null}connectedCallback(){super.connectedCallback(),this._inputValue=this.value||""}firstUpdated(){!this._hiddenInput&&this.name&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this.appendChild(this._hiddenInput)),r("pb-page-ready",()=>{this.preload&&this.source?this._sendRequest():this.value&&this.source?this._sendRequest(this.value):(this._syncInputValueFromSuggestions(),this._filterSuggestions())}),this.source||(this._syncInputValueFromSuggestions(),this._filterSuggestions())}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this._fetchTimeout),this._abortController&&(this._abortController.abort(),this._abortController=null)}updated(t){t.has("suggestions")&&(this._filterSuggestions(),this._syncInputValueFromSuggestions()),t.has("value")&&(this._syncInputValueFromSuggestions(),this._hiddenInput&&(this._hiddenInput.value=this.value??"")),t.has("name")&&(!this._hiddenInput&&this.name?(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this._hiddenInput.disabled=this.disabled,this.appendChild(this._hiddenInput)):this._hiddenInput&&(this._hiddenInput.name=this.name)),t.has("disabled")&&(this.disabled&&this._closeMenu(),this._hiddenInput&&(this._hiddenInput.disabled=this.disabled))}render(){const e=this._resolveLabelText(),s=this._resolveHelperText(),i={"pb-input-container":!0,"pb-input-container--focused":this._isFocused,"pb-input-container--filled":!!this._inputValue,"pb-input-container--has-prefix":!!this.icon,"pb-input-container--always-float":this.alwaysFloatLabel,"pb-input-container--disabled":this.disabled},o=this._menuOpen&&this._highlightedIndex>=0?`pb-autocomplete-option-${this._highlightedIndex}`:void 0,r=this._filteredSuggestions,a=this._menuOpen&&(r.length>0||this._loading),l=e?`${this._inputId}-label`:void 0,c=s?`${this._inputId}-helper`:void 0,d=!l&&e?e:void 0,h=l||!this.placeholder?"":g(this.placeholder);return n`
|
|
110
|
+
`}}customElements.get("pb-collapse")||customElements.define("pb-collapse",b);class y extends HTMLElement{static get observedAttributes(){return["handle-as","method","with-credentials","content-type"]}constructor(){super(),this._url="",this._method="GET",this._handleAs="json",this._withCredentials=!1,this._contentType=null,this.params={},this.headers={},this.body=void 0,this.loading=!1,this.lastResponse=null,this.lastRequest=null,this.lastError=null,this._controller=null}connectedCallback(){this.hasAttribute("method")&&this.attributeChangedCallback("method",null,this.getAttribute("method")),this.hasAttribute("handle-as")&&this.attributeChangedCallback("handle-as",null,this.getAttribute("handle-as")),this.hasAttribute("with-credentials")&&this.attributeChangedCallback("with-credentials",null,this.getAttribute("with-credentials")),this.hasAttribute("content-type")&&this.attributeChangedCallback("content-type",null,this.getAttribute("content-type"))}attributeChangedCallback(t,e,s){switch(t){case"handle-as":this._handleAs=(s||"json").toLowerCase();break;case"method":this._method=(s||"GET").toUpperCase();break;case"with-credentials":this._withCredentials=null!==s;break;case"content-type":this._contentType=s||null}}set url(t){this._url=t||""}get url(){return this._url}set method(t){const e=(t||"GET").toUpperCase();this._method!==e&&(this._method=e,null==t?this.removeAttribute("method"):this.setAttribute("method",t))}get method(){return this._method}set handleAs(t){const e=(t||"json").toLowerCase();this._handleAs!==e&&(this._handleAs=e,null==t?this.removeAttribute("handle-as"):this.setAttribute("handle-as",t))}get handleAs(){return this._handleAs}set withCredentials(t){const e=Boolean(t);this._withCredentials!==e&&(this._withCredentials=e,e?this.setAttribute("with-credentials",""):this.removeAttribute("with-credentials"))}get withCredentials(){return this._withCredentials}set contentType(t){this._contentType!==t&&(this._contentType=t||null,null==t?this.removeAttribute("content-type"):this.setAttribute("content-type",t))}get contentType(){return this._contentType}abort(){this._controller&&(this._controller.abort(),this._controller=null,this.loading=!1)}async generateRequest(){if(!this._url)return null;this.abort(),this._controller=new AbortController;const t=this._buildRequestInit();t.signal=this._controller.signal,this.loading=!0;try{const e=this._buildUrlWithParams(),s=await fetch(e,t),{parsed:n,rawText:i}=await this._parseBody(s);if(this.lastRequest={url:e,method:this._method,params:this.params,headers:t.headers},!s.ok){const t={status:s.status,statusText:s.statusText,response:i,xhr:this._createXhrShim(s)};return this.lastError=t,this.lastResponse=null,this.loading=!1,this.dispatchEvent(new CustomEvent("error",{detail:t})),null}this.lastError=null,this.lastResponse=n,this.loading=!1;const o={response:n,status:s.status,xhr:this._createXhrShim(s),request:this.lastRequest};return this.dispatchEvent(new CustomEvent("response",{detail:o})),n}catch(t){if("AbortError"===t.name)return null;if(!this.lastError){const e={status:t.status||0,statusText:t.statusText||t.message,response:t.response||null,xhr:t.xhr||null};this.lastError=e,this.lastResponse=null,this.dispatchEvent(new CustomEvent("error",{detail:e}))}return this.loading=!1,null}finally{this._controller=null}}_buildUrlWithParams(){if(!this.params||0===Object.keys(this.params).length)return this._url;const t=[];if(Object.entries(this.params).forEach(([e,s])=>{null!=s&&(Array.isArray(s)?s.forEach(s=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`)}):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`))}),0===t.length)return this._url;const e=this._url.includes("?")?"&":"?";return`${this._url}${e}${t.join("&")}`}_buildRequestInit(){const t=this.headers&&"function"==typeof this.headers.entries?Object.fromEntries(this.headers.entries()):this.headers||{},e=new Headers(t),s={method:this._method||"GET",headers:e,credentials:this._withCredentials?"include":"same-origin"},n=this._prepareBody(e);return void 0!==n&&(s.body=n),s}_prepareBody(t){if(null==this.body)return;if(this.body instanceof FormData||this.body instanceof Blob||this.body instanceof ArrayBuffer)return this.body;if("string"==typeof this.body)return this._contentType&&!t.has("Content-Type")&&t.set("Content-Type",this._contentType),this.body;if(this.body instanceof URLSearchParams)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this.body.toString();if("application/x-www-form-urlencoded"===this._contentType)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this._encodeFormBody(this.body);const e=this._contentType||"application/json";return t.has("Content-Type")||t.set("Content-Type",e),e.includes("json")?JSON.stringify(this.body):this.body}async _parseBody(t){const e=t.clone();let s="";try{s=await e.text()}catch(t){s=""}if(204===t.status||205===t.status)return{parsed:null,rawText:""};switch(this._handleAs){case"text":return{parsed:s,rawText:s};case"json":if(!s)return{parsed:null,rawText:s};try{return{parsed:JSON.parse(s),rawText:s}}catch(t){return{parsed:null,rawText:s}}case"blob":return{parsed:await t.blob(),rawText:s};case"arraybuffer":return{parsed:await t.arrayBuffer(),rawText:s};default:return{parsed:s,rawText:s}}}_createXhrShim(t){return{status:t.status,statusText:t.statusText,responseURL:t.url,getResponseHeader:e=>t.headers.get(e),getAllResponseHeaders:()=>[...t.headers.entries()].map(([t,e])=>`${t}: ${e}`).join("\r\n")}}_encodeFormBody(t){if(t instanceof URLSearchParams)return t.toString();if("string"==typeof t)return t;if(!t||"object"!=typeof t)return"";const e=new URLSearchParams;return Object.entries(t).forEach(([t,s])=>{Array.isArray(s)?s.forEach(s=>e.append(t,s)):null!=s&&e.append(t,s)}),e.toString()}}customElements.get("pb-fetch")||customElements.define("pb-fetch",y);const _=d(class extends h{constructor(t){var e;if(super(t),t.type!==u.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e){var s;e[t]&&(null===(s=this.nt)||void 0===s||!s.has(t))&&this.st.add(t)}return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){var i;const s=!!e[t];s===this.st.has(t)||(null===(i=this.nt)||void 0===i?void 0:i.has(t))||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return o}});let w=0;const x={ENTER:"Enter",ESC:"Escape",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},k=200;function C(t){if("object"==typeof t&&t){const e=t.text??t.value??"",s=t.value??t.text??"";return{text:String(e),value:String(s)}}const e=null==t?"":String(t);return{text:e,value:e}}function S(t=[]){return Array.isArray(t)?t.map(C):[]}class E extends(e(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},label:{type:String},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String},helperText:{type:String,attribute:"helper-text"},alwaysFloatLabel:{type:Boolean,attribute:"always-float-label"},disabled:{type:Boolean,reflect:!0},requestParams:{type:Object,attribute:!1}})}constructor(){super(),this.placeholder="search.placeholder",this.label="",this.suggestions=[],this.substring=!1,this.preload=!1,this.icon="",this.helperText="",this.alwaysFloatLabel=!1,this.disabled=!1,this.lastSelected=null,this.value="",this.name="",this._hiddenInput=null,this._initialized=!1,this._menuOpen=!1,this._isFocused=!1,this._inputValue="",this._filteredSuggestions=[],this._highlightedIndex=-1,this._loading=!1,this._pointerSelecting=!1,this._fetchTimeout=null,this._abortController=null,this.requestParams={},this._inputId="pb-autocomplete-input-"+ ++w}_resolveLabelText(){return this.label?p(this.label):this.placeholder?p(this.placeholder):""}_resolveHelperText(){return this.helperText?p(this.helperText):""}get _input(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(this._inputId))??null}connectedCallback(){super.connectedCallback(),this._inputValue=this.value||""}firstUpdated(){!this._hiddenInput&&this.name&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this.appendChild(this._hiddenInput)),r("pb-page-ready",()=>{this.preload&&this.source?this._sendRequest():this.value&&this.source?this._sendRequest(this.value):(this._syncInputValueFromSuggestions(),this._filterSuggestions())}),this.source||(this._syncInputValueFromSuggestions(),this._filterSuggestions())}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this._fetchTimeout),this._abortController&&(this._abortController.abort(),this._abortController=null)}updated(t){t.has("suggestions")&&(this._filterSuggestions(),this._syncInputValueFromSuggestions()),t.has("value")&&(this._syncInputValueFromSuggestions(),this._hiddenInput&&(this._hiddenInput.value=this.value??"")),t.has("name")&&(!this._hiddenInput&&this.name?(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this._hiddenInput.disabled=this.disabled,this.appendChild(this._hiddenInput)):this._hiddenInput&&(this._hiddenInput.name=this.name)),t.has("disabled")&&(this.disabled&&this._closeMenu(),this._hiddenInput&&(this._hiddenInput.disabled=this.disabled))}render(){const e=this._resolveLabelText(),s=this._resolveHelperText(),i={"pb-input-container":!0,"pb-input-container--focused":this._isFocused,"pb-input-container--filled":!!this._inputValue,"pb-input-container--has-prefix":!!this.icon,"pb-input-container--always-float":this.alwaysFloatLabel,"pb-input-container--disabled":this.disabled},o=this._menuOpen&&this._highlightedIndex>=0?`pb-autocomplete-option-${this._highlightedIndex}`:void 0,r=this._filteredSuggestions,a=this._menuOpen&&(r.length>0||this._loading),l=e?`${this._inputId}-label`:void 0,c=s?`${this._inputId}-helper`:void 0,d=!l&&e?e:void 0,h=l||!this.placeholder?"":p(this.placeholder);return n`
|
|
111
111
|
<div class="autocomplete">
|
|
112
112
|
<slot></slot>
|
|
113
|
-
<div class="${
|
|
113
|
+
<div class="${_(i)}">
|
|
114
114
|
${this.icon?n`<pb-icon class="pb-input-prefix" icon="${this.icon}" decorative></pb-icon>`:t}
|
|
115
115
|
<input
|
|
116
116
|
id="${this._inputId}"
|
|
@@ -125,10 +125,10 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
125
125
|
aria-autocomplete="list"
|
|
126
126
|
aria-expanded="${this._menuOpen?"true":"false"}"
|
|
127
127
|
aria-controls="pb-autocomplete-list"
|
|
128
|
-
aria-activedescendant=${
|
|
129
|
-
aria-labelledby=${
|
|
130
|
-
aria-describedby=${
|
|
131
|
-
aria-label=${
|
|
128
|
+
aria-activedescendant=${v(o)}
|
|
129
|
+
aria-labelledby=${v(l)}
|
|
130
|
+
aria-describedby=${v(c)}
|
|
131
|
+
aria-label=${v(d)}
|
|
132
132
|
?disabled=${this.disabled}
|
|
133
133
|
@input=${this._handleInput}
|
|
134
134
|
@keydown=${this._handleKeydown}
|
|
@@ -157,7 +157,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
157
157
|
`}_renderSuggestion(t,e){const s=e===this._highlightedIndex;return n`
|
|
158
158
|
<li
|
|
159
159
|
id="pb-autocomplete-option-${e}"
|
|
160
|
-
class=${
|
|
160
|
+
class=${_({suggestion:!0,"suggestion--active":s})}
|
|
161
161
|
role="option"
|
|
162
162
|
aria-selected="${s?"true":"false"}"
|
|
163
163
|
@click=${()=>this._selectSuggestion(t)}
|
|
@@ -165,7 +165,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
165
165
|
>
|
|
166
166
|
${t.text}
|
|
167
167
|
</li>
|
|
168
|
-
`}_handleInput(t){if(this.disabled)return void t.preventDefault();const e=t.currentTarget;this._inputValue=e.value,this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),this._filterSuggestions(),this._menuOpen=!0,this._highlightedIndex=this._filteredSuggestions.length?0:-1,this.requestUpdate(),this.source&&!this.preload&&this._scheduleFetch(this.value),this.emitTo("pb-autocomplete-input",{text:this._inputValue,value:this.value})}_handleFocus(){this.disabled||(this._isFocused=!0,this._filteredSuggestions.length&&(this._menuOpen=!0))}_handleBlur(){this._isFocused=!1,this._pointerSelecting||window.setTimeout(()=>{this._isFocused||this._pointerSelecting||this._closeMenu()},100)}_handleSuggestionsPointerDown(t){this.disabled||(t.preventDefault(),this._pointerSelecting=!0)}_handleSuggestionsPointerUp(){var t;this.disabled||(this._pointerSelecting=!1,null===(t=this._input)||void 0===t||t.focus())}_handleKeydown(t){if(this.disabled)return;const{key:e}=t;switch(e){case
|
|
168
|
+
`}_handleInput(t){if(this.disabled)return void t.preventDefault();const e=t.currentTarget;this._inputValue=e.value,this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),this._filterSuggestions(),this._menuOpen=!0,this._highlightedIndex=this._filteredSuggestions.length?0:-1,this.requestUpdate(),this.source&&!this.preload&&this._scheduleFetch(this.value),this.emitTo("pb-autocomplete-input",{text:this._inputValue,value:this.value})}_handleFocus(){this.disabled||(this._isFocused=!0,this._filteredSuggestions.length&&(this._menuOpen=!0))}_handleBlur(){this._isFocused=!1,this._pointerSelecting||window.setTimeout(()=>{this._isFocused||this._pointerSelecting||this._closeMenu()},100)}_handleSuggestionsPointerDown(t){this.disabled||(t.preventDefault(),this._pointerSelecting=!0)}_handleSuggestionsPointerUp(){var t;this.disabled||(this._pointerSelecting=!1,null===(t=this._input)||void 0===t||t.focus())}_handleKeydown(t){if(this.disabled)return;const{key:e}=t;switch(e){case x.ARROW_DOWN:t.preventDefault(),this._openMenu(),this._moveHighlight(1);break;case x.ARROW_UP:t.preventDefault(),this._openMenu(),this._moveHighlight(-1);break;case x.ENTER:this._menuOpen&&t.preventDefault(),this._handleEnter();break;case x.ESC:this._closeMenu()}}_handleEnter(){if(this.disabled)return;if(this._menuOpen&&this._highlightedIndex>=0){const t=this._filteredSuggestions[this._highlightedIndex];if(t)return void this._selectSuggestion(t)}if(!this.value)return;const t=this._findSuggestionByValue(this.value);t&&this._selectSuggestion(t)}_openMenu(){this.disabled||this._menuOpen||(this._menuOpen=!0,this.requestUpdate())}_closeMenu(){this._menuOpen&&(this._menuOpen=!1,this._highlightedIndex=-1,this.requestUpdate())}_moveHighlight(t){if(this.disabled)return;const e=this._filteredSuggestions;if(!e.length)return this._highlightedIndex=-1,void this.requestUpdate();let s=this._highlightedIndex+t;s<0?s=e.length-1:s>=e.length&&(s=0),this._setHighlightedIndex(s)}async _setHighlightedIndex(t){var e;this._highlightedIndex=t,this.requestUpdate(),await this.updateComplete;const s=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById(`pb-autocomplete-option-${t}`);null==s||s.scrollIntoView({block:"nearest"})}_selectSuggestion(t){if(this.disabled)return;const{text:e,value:s}=C(t);this.lastSelected=e,this.value=s,this._inputValue=e,this._hiddenInput&&(this._hiddenInput.value=s);const n=this._input;n&&(n.value=e),this._closeMenu(),this.emitTo("pb-autocomplete-selected",{text:e,value:s}),this.emitTo("pb-autocomplete-input",{text:e,value:s})}_filterSuggestions(){const t=S(this.suggestions);if(!t.length)return void(this._filteredSuggestions=[]);const e=(this._inputValue||"").trim().toLowerCase();if(!e)return void(this._filteredSuggestions=t);const s=this.substring?t=>t.text.toLowerCase().includes(e):t=>t.text.toLowerCase().startsWith(e);this._filteredSuggestions=t.filter(s)}_findSuggestionByValue(t){if(!t)return null;const e=S(this.suggestions),s=String(t).toLowerCase();return e.find(t=>t.value.toLowerCase()===s||t.text.toLowerCase()===s)??null}_syncInputValueFromSuggestions(){if(!this.value)return void(this._inputValue="");const t=this._findSuggestionByValue(this.value);this._inputValue=t?t.text:this.value}_scheduleFetch(t){window.clearTimeout(this._fetchTimeout),this._fetchTimeout=window.setTimeout(()=>{this._fetchTimeout=null,this._sendRequest(t)},k)}async _sendRequest(t){if(!this.source)return;const e=this.toAbsoluteURL(this.source);let s;try{s=new URL(e)}catch(t){s=new URL(e,window.location.href)}const n=Object.assign(Object.assign({},this.requestParams||{}),this._getParameters());null!=t&&(n.query=t),Object.entries(n).forEach(([t,e])=>{null!=e&&(Array.isArray(e)?e.forEach(e=>s.searchParams.append(t,e)):s.searchParams.set(t,e))}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._loading=!0,this._menuOpen=!0,this.requestUpdate();try{const t=await fetch(s.href,{method:"GET",credentials:"include",signal:this._abortController.signal,headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Request failed with status ${t.status}`);const e=await t.json();this._applyRemoteSuggestions(e)}catch(t){"AbortError"!==t.name&&f.error("pb-autocomplete: request failed",t)}finally{var i;if(null!==(i=this._abortController)&&void 0!==i&&i.signal.aborted)return void(this._loading=!1);this._loading=!1,this._abortController=null,this.requestUpdate()}}_applyRemoteSuggestions(t){if(!Array.isArray(t))return this.suggestions=[],this._filteredSuggestions=[],this._highlightedIndex=-1,this._menuOpen=!1,void this.requestUpdate();this._initialized=!0,this.suggestions=[...t],this._filteredSuggestions=S(t),this._highlightedIndex=this._filteredSuggestions.length?0:-1,this._menuOpen=!0,this._syncInputValueFromSuggestions(),this.requestUpdate()}_getParameters(){const t={};return this.querySelectorAll("[name]").forEach(e=>{t[e.name]=e.value}),t}static get styles(){return i`
|
|
169
169
|
:host {
|
|
170
170
|
display: inline-flex;
|
|
171
171
|
flex-direction: column;
|
|
@@ -311,7 +311,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
311
311
|
background-color: transparent;
|
|
312
312
|
color: rgba(0, 0, 0, 0.54);
|
|
313
313
|
}
|
|
314
|
-
`}}customElements.get("pb-autocomplete")||customElements.define("pb-autocomplete",
|
|
314
|
+
`}}customElements.get("pb-autocomplete")||customElements.define("pb-autocomplete",E);const T="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function A(t,e,s,n){t.addEventListener?t.addEventListener(e,s,n):t.attachEvent&&t.attachEvent(`on${e}`,s)}function O(t,e,s,n){t&&(t.removeEventListener?t.removeEventListener(e,s,n):t.detachEvent&&t.detachEvent(`on${e}`,s))}function I(t,e){const s=e.slice(0,e.length-1),n=[];for(let e=0;e<s.length;e++)n.push(t[s[e].toLowerCase()]);return n}function j(t){"string"!=typeof t&&(t="");const e=(t=t.replace(/\s/g,"")).split(",");let s=e.lastIndexOf("");for(;s>=0;)e[s-1]+=",",e.splice(s,1),s=e.lastIndexOf("");return e}function M(t,e){const s=t.length>=e.length?t:e,n=t.length>=e.length?e:t;let i=!0;for(let t=0;t<s.length;t++)-1===n.indexOf(s[t])&&(i=!1);return i}function $(t){let e=t.keyCode||t.which||t.charCode;return t.code&&/^Key[A-Z]$/.test(t.code)&&(e=t.code.charCodeAt(3)),e}const P={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":T?173:189,"=":T?61:187,";":T?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},L={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},N={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},B={16:!1,18:!1,17:!1,91:!1},R={};for(let t=1;t<20;t++)P[`f${t}`]=111+t;let D=[],U=null,V="all";const F=new Map,q=t=>P[t.toLowerCase()]||L[t.toLowerCase()]||t.toUpperCase().charCodeAt(0),z=t=>Object.keys(P).find(e=>P[e]===t),K=t=>Object.keys(L).find(e=>L[e]===t),X=t=>{V=t||"all"},H=()=>V||"all",W=()=>D.map(t=>z(t)||K(t)||String.fromCharCode(t)),Y=()=>{const t=[];return Object.keys(R).forEach(e=>{R[e].forEach(({key:e,scope:s,mods:n,shortcut:i})=>{t.push({scope:s,shortcut:i,mods:n,keys:e.split("+").map(t=>q(t))})})}),t},Z=t=>{const e=t.target||t.srcElement,{tagName:s}=e;let n=!0;const i="INPUT"===s&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||"TEXTAREA"===s||"SELECT"===s)&&!e.readOnly)&&(n=!1),n},G=t=>("string"==typeof t&&(t=q(t)),-1!==D.indexOf(t)),J=(t,e)=>{let s,n;t||(t=H());for(const e in R)if(Object.prototype.hasOwnProperty.call(R,e))for(s=R[e],n=0;n<s.length;)s[n].scope===t?s.splice(n,1).forEach(({element:t})=>rt(t)):n++;H()===t&&X(e||"all")};function Q(t){let e=$(t);t.key&&"capslock"===t.key.toLowerCase()&&(e=q(t.key));const s=D.indexOf(e);if(s>=0&&D.splice(s,1),t.key&&"meta"===t.key.toLowerCase()&&D.splice(0,D.length),(93===e||224===e)&&(e=91),e in B){B[e]=!1;for(const t in L)L[t]===e&&(it[t]=!1)}}const tt=(t,...e)=>{if(void 0===t)Object.keys(R).forEach(t=>{Array.isArray(R[t])&&R[t].forEach(t=>et(t)),delete R[t]}),rt(null);else if(Array.isArray(t))t.forEach(t=>{t.key&&et(t)});else if("object"==typeof t)t.key&&et(t);else if("string"==typeof t){let[s,n]=e;"function"==typeof s&&(n=s,s=""),et({key:t,scope:s,method:n,splitKey:"+"})}},et=({key:t,scope:e,method:s,splitKey:n="+"})=>{j(t).forEach(t=>{const i=t.split(n),o=i.length,r=i[o-1],a="*"===r?"*":q(r);if(!R[a])return;e||(e=H());const l=o>1?I(L,i):[],c=[];R[a]=R[a].filter(t=>{const n=(!s||t.method===s)&&t.scope===e&&M(t.mods,l);return n&&c.push(t.element),!n}),c.forEach(t=>rt(t))})};function st(t,e,s,n){if(e.element!==n)return;let i;if(e.scope===s||"all"===e.scope){i=e.mods.length>0;for(const t in B)Object.prototype.hasOwnProperty.call(B,t)&&(!B[t]&&e.mods.indexOf(+t)>-1||B[t]&&-1===e.mods.indexOf(+t))&&(i=!1);(0===e.mods.length&&!B[16]&&!B[18]&&!B[17]&&!B[91]||i||"*"===e.shortcut)&&(e.keys=[],e.keys=e.keys.concat(D),!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function nt(t,e){const s=R["*"];let n=$(t);if(t.key&&"capslock"===t.key.toLowerCase()||!(it.filter||Z).call(this,t))return;if((93===n||224===n)&&(n=91),-1===D.indexOf(n)&&229!==n&&D.push(n),["metaKey","ctrlKey","altKey","shiftKey"].forEach(e=>{const s=N[e];t[e]&&-1===D.indexOf(s)?D.push(s):!t[e]&&D.indexOf(s)>-1?D.splice(D.indexOf(s),1):"metaKey"===e&&t[e]&&(D=D.filter(t=>t in N||t===n))}),n in B){B[n]=!0;for(const e in L)if(Object.prototype.hasOwnProperty.call(L,e)){const s=N[L[e]];it[e]=t[s]}if(!s)return}for(const e in B)Object.prototype.hasOwnProperty.call(B,e)&&(B[e]=t[N[e]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===D.indexOf(17)&&D.push(17),-1===D.indexOf(18)&&D.push(18),B[17]=!0,B[18]=!0);const i=H();if(s)for(let n=0;n<s.length;n++)s[n].scope===i&&("keydown"===t.type&&s[n].keydown||"keyup"===t.type&&s[n].keyup)&&st(t,s[n],i,e);if(!(n in R))return;const o=R[n],r=o.length;for(let s=0;s<r;s++)if(("keydown"===t.type&&o[s].keydown||"keyup"===t.type&&o[s].keyup)&&o[s].key){const n=o[s],{splitKey:r}=n,a=n.key.split(r),l=[];for(let t=0;t<a.length;t++)l.push(q(a[t]));l.sort().join("")===D.sort().join("")&&st(t,n,i,e)}}const it=function(t,e,s){D=[];const n=j(t);let i=[],o="all",r=document,a=0,l=!1,c=!0,d="+",h=!1,u=!1;if(void 0===s&&"function"==typeof e&&(s=e),"[object Object]"===Object.prototype.toString.call(e)){const t=e;t.scope&&(o=t.scope),t.element&&(r=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(c=t.keydown),void 0!==t.capture&&(h=t.capture),"string"==typeof t.splitKey&&(d=t.splitKey),!0===t.single&&(u=!0)}for("string"==typeof e&&(o=e),u&&tt(t,o);a<n.length;a++){const t=n[a].split(d);i=[],t.length>1&&(i=I(L,t));let e=t[t.length-1];e="*"===e?"*":q(e),e in R||(R[e]=[]),R[e].push({keyup:l,keydown:c,scope:o,mods:i,shortcut:n[a],method:s,key:n[a],splitKey:d,element:r})}if(void 0!==r&&"undefined"!=typeof window){if(!F.has(r)){const t=(t=window.event)=>nt(t,r),e=(t=window.event)=>{nt(t,r),Q(t)};F.set(r,{keydownListener:t,keyupListenr:e,capture:h}),A(r,"keydown",t,h),A(r,"keyup",e,h)}if(!U){const t=()=>{D=[]};U={listener:t,capture:h},A(window,"focus",t,h)}}};function ot(t,e="all"){Object.keys(R).forEach(s=>{R[s].filter(s=>s.scope===e&&s.shortcut===t).forEach(t=>{t&&t.method&&t.method({},t)})})}function rt(t){const e=Object.values(R).flat();if(e.findIndex(({element:e})=>e===t)<0&&t){const{keydownListener:e,keyupListenr:s,capture:n}=F.get(t)||{};e&&s&&(O(t,"keyup",s,n),O(t,"keydown",e,n),F.delete(t))}if((e.length<=0||F.size<=0)&&(Array.from(F.keys()).forEach(t=>{const{keydownListener:e,keyupListenr:s,capture:n}=F.get(t)||{};e&&s&&(O(t,"keyup",s,n),O(t,"keydown",e,n),F.delete(t))}),F.clear(),Object.keys(R).forEach(t=>delete R[t]),U)){const{listener:t,capture:e}=U;O(window,"focus",t,e),U=null}}const at={getPressedKeyString:W,setScope:X,getScope:H,deleteScope:J,getPressedKeyCodes:()=>D.slice(0),getAllKeyCodes:Y,isPressed:G,filter:Z,trigger:ot,unbind:tt,keyMap:P,modifier:L,modifierMap:N};for(const t in at){const e=t;Object.prototype.hasOwnProperty.call(at,e)&&(it[e]=at[e])}if("undefined"!=typeof window){const t=window.hotkeys;it.noConflict=e=>(e&&window.hotkeys===it&&(window.hotkeys=t),it),window.hotkeys=it}const lt=new Set(["INPUT","SELECT","TEXTAREA","PAPER-INPUT","PAPER-TEXTAREA","PB-SEARCH"]);let ct=!0;ct&&(it.filter=t=>{const{target:e}=t;if(e.isContentEditable)return!1;const{tagName:s}=e;return!lt.has(s)},ct=!1);const dt=t=>class extends t{static get properties(){return Object.assign(Object.assign({},super.properties),{},{hotkeys:{type:Object}})}constructor(){super(),this.hotkeys={}}registerHotkey(t,e,s){t&&this.hotkeys[t]&&(s?it(this.hotkeys[t],{element:s},e):it(this.hotkeys[t],e))}display(t){if(t&&this.hotkeys[t]){const e=[];return this.hotkeys[t].split(/\s*,\s*/).forEach(t=>{e.push(t.replace("+","-"))}),e.join(", ")}return""}};function ht(t,e,s){s?it(t,{element:s},e):it(t,e)}window.pbKeyboard=ht;const ut=(t="")=>t.replace(/[-_]/g," ").trim();class pt extends s{static properties={icon:{type:String},disabled:{type:Boolean,reflect:!0},label:{type:String},toggles:{type:Boolean},active:{type:Boolean,reflect:!0}};constructor(){super(),this.icon="",this.disabled=!1,this.label="",this.toggles=!1,this.active=!1}render(){const t=this.title||"",e=this.icon?ut(this.icon.includes(":")?this.icon.split(":").pop():this.icon):"",s=this.label||t||e;return n`
|
|
315
315
|
<button
|
|
316
316
|
class="pb-button pb-button--icon"
|
|
317
317
|
type="button"
|
|
@@ -359,15 +359,15 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
359
359
|
:host([active]) button {
|
|
360
360
|
background: var(--pb-icon-button-active-background, rgba(0, 0, 0, 0.08));
|
|
361
361
|
}
|
|
362
|
-
`}customElements.get("pb-icon-button")||customElements.define("pb-icon-button",
|
|
362
|
+
`}customElements.get("pb-icon-button")||customElements.define("pb-icon-button",pt);class gt extends(c(s)){static get styles(){return i`
|
|
363
363
|
:host {
|
|
364
364
|
display: block;
|
|
365
365
|
}
|
|
366
366
|
`}static get properties(){return{title:{type:String,reflect:!0},type:{type:String},message:{type:String,reflect:!0},open:{type:Boolean,reflect:!0}}}constructor(){super(),this.title="",this.message="",this.type="message",this.open=!1}render(){return n`
|
|
367
367
|
<pb-dialog>
|
|
368
|
-
<h2 id="title" slot="title">${
|
|
368
|
+
<h2 id="title" slot="title">${m(this.title)}</h2>
|
|
369
369
|
<div id="message" class="message" tabindex="0">
|
|
370
|
-
${this.message?
|
|
370
|
+
${this.message?m(this.message):n`<slot></slot>`}
|
|
371
371
|
</div>
|
|
372
372
|
|
|
373
373
|
<div class="buttons" slot="footer">
|
|
@@ -383,7 +383,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
383
383
|
`}
|
|
384
384
|
</div>
|
|
385
385
|
</pb-dialog>
|
|
386
|
-
`}firstUpdated(){this.modal=this.renderRoot.querySelector("pb-dialog")}show(t,e){return this.type="message",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{this.renderRoot.querySelector(".close").addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})})})})}confirm(t,e){return this.type="confirm",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{const s=this.renderRoot.querySelector(".confirm"),n=this.renderRoot.querySelector(".reject");s.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})}),n.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),e({once:!0})})})})}set(t,e){(t||e)&&(t&&(this.title=t),e&&(this.message=e))}isMessage(){return"message"===this.type}isConfirm(){return"confirm"===this.type}}customElements.define("pb-message",
|
|
386
|
+
`}firstUpdated(){this.modal=this.renderRoot.querySelector("pb-dialog")}show(t,e){return this.type="message",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{this.renderRoot.querySelector(".close").addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})})})})}confirm(t,e){return this.type="confirm",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{const s=this.renderRoot.querySelector(".confirm"),n=this.renderRoot.querySelector(".reject");s.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})}),n.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),e({once:!0})})})})}set(t,e){(t||e)&&(t&&(this.title=t),e&&(this.message=e))}isMessage(){return"message"===this.type}isConfirm(){return"confirm"===this.type}}customElements.define("pb-message",gt);class ft extends(c(e(s))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{path:{type:String},src:{type:String},title:{type:String},_href:{type:String}})}constructor(){super(),this.title=""}connectedCallback(){super.connectedCallback(),r("pb-page-ready",t=>{if("."===t.endpoint)this._href="/exist/apps/eXide/";else{const e=/^(.*:\/+[^/]+)\/.*$/.exec(t.endpoint);this._href=e?`${e[1]}/exist/apps/eXide/`:"/exist/apps/eXide/"}})}render(){return new URL(this._href,window.location.href).origin===this.getUrl().origin?n`<a href="${this._href}" target="eXide" title="${this.title}" @click="${this.open}"
|
|
387
387
|
><slot></slot
|
|
388
388
|
></a>`:n`<a href="${this._href}/index.html?open=${this.path}" title="${this.title}"
|
|
389
389
|
><slot></slot
|
|
@@ -395,7 +395,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
395
395
|
a {
|
|
396
396
|
text-decoration: none;
|
|
397
397
|
}
|
|
398
|
-
`}setPath(t){this.path=t}open(t){t.preventDefault();let e=this._href,{path:s}=this;if(this.src){const t=document.getElementById(this.src);s=t.getFullPath(),e=t.sourceView}const n=window.open("","eXide");if(n&&!n.closed){n.eXide?(f.log("<pb-edit-xml> using existing eXide to open %s",s),n.eXide.app.findDocument(s),n.focus()):(f.log("<pb-edit-xml> opening new eXide for %s",s),window.eXide_onload=function(){n.eXide.app.findDocument(s)},n.location=e)}}}function ft(t){return t.replace(/-[a-z]/gu,t=>t[1].toUpperCase())}customElements.define("pb-edit-xml",gt),window.Vaadin||={},window.Vaadin.featureFlags||={};const mt={};function vt(t,e="25.0.3"){if(Object.defineProperty(t,"version",{get:()=>e}),t.experimental){const e="string"==typeof t.experimental?t.experimental:`${ft(t.is.split("-").slice(1).join("-"))}Component`;if(!window.Vaadin.featureFlags[e]&&!mt[e])return mt[e]=new Set,mt[e].add(t),void Object.defineProperty(window.Vaadin.featureFlags,e,{get:()=>0===mt[e].size,set(t){t&&mt[e].size>0&&(mt[e].forEach(t=>{customElements.define(t.is,t)}),mt[e].clear())}});if(mt[e])return void mt[e].add(t)}const s=customElements.get(t.is);if(s){const e=s.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${s.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}const bt=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,yt=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function _t(){function t(){return!0}return St(t)}function wt(){try{return!!xt()||!!kt()&&(yt?!Ct():!_t())}catch(t){return!1}}function xt(){return localStorage.getItem("vaadin.developmentmode.force")}function kt(){return["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0}function Ct(){if(yt){if(Object.keys(yt).map(t=>yt[t]).filter(t=>t.productionMode).length>0)return!0}return!1}function St(t,e){if("function"!=typeof t)return;const s=bt.exec(t.toString());if(s)try{t=new Function(s[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(e)}window.Vaadin=window.Vaadin||{};const Et=function(t,e){if(window.Vaadin.developmentMode)return St(t,e)};function Tt(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=wt());const At=function(){if("function"==typeof Et)return Et(Tt)};let Ot=0,It=0;const jt=[];let Mt=!1;function $t(){Mt=!1;const t=jt.length;for(let e=0;e<t;e++){const t=jt[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}jt.splice(0,t),It+=t}const Pt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Lt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Nt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Bt={run(t){Mt||(Mt=!0,queueMicrotask(()=>$t())),jt.push(t);const e=Ot;return Ot+=1,e},cancel(t){const e=t-It;if(e>=0){if(!jt[e])throw new Error(`invalid async handle: ${t}`);jt[e]=null}}},Rt=new Set;class Dt{static debounce(t,e,s){return t instanceof Dt?t._cancelAsync():t=new Dt,t.setConfig(e,s),t}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,Rt.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),Rt.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}}function Ut(t){Rt.add(t)}const Vt=[];function Ft(t,e,s=t.getAttribute("dir")){e?t.setAttribute("dir",e):null!=s&&t.removeAttribute("dir")}function qt(){return document.documentElement.getAttribute("dir")}function zt(){const t=qt();Vt.forEach(e=>{Ft(e,t)})}new MutationObserver(zt).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Kt=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")&&!this.__restoreSubscription||(this.__subscribe(),Ft(this,qt(),null))}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"dir"!==t)return;const n=qt(),i=s===n&&-1===Vt.indexOf(this),o=!s&&e&&-1===Vt.indexOf(this),r=s!==n&&e===n;i||o?(this.__subscribe(),Ft(this,n,s)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=Vt.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,e,s){("dir"!==s||""!==e||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,e,s)}_attributeToProperty(t,e,s){"dir"!==t||e?super._attributeToProperty(t,e,s):this.dir=""}__subscribe(){Vt.includes(this)||Vt.push(this)}__unsubscribe(){Vt.includes(this)&&Vt.splice(Vt.indexOf(this),1)}};let Xt;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){At()};const Ht=new Set,Wt=t=>class extends(Kt(t)){static finalize(){super.finalize();const{is:t}=this;if(t&&!Ht.has(t)){window.Vaadin.registrations.push(this),Ht.add(t);const e=window.Vaadin.developmentModeCallback;e&&(Xt=Dt.debounce(Xt,Nt,()=>{e["vaadin-usage-statistics"]()}),Ut(Xt))}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}},Yt=new WeakMap;function Zt(t,e){let s=e;for(;s;){if(Yt.get(s)===t)return!0;s=Object.getPrototypeOf(s)}return!1}function Gt(t){return e=>{if(Zt(t,e))return e;const s=t(e);return Yt.set(s,t),s}}function Jt(t,e){return t.split(".").reduce((t,e)=>t?t[e]:void 0,e)}function Qt(t,e,s){const n=t.split("."),i=n.pop();n.reduce((t,e)=>t[e],s)[i]=e}const te={},ee=/([A-Z])/gu;function se(t){return te[t]||(te[t]=t.replace(ee,"-$1").toLowerCase()),te[t]}function ne(t){return t[0].toUpperCase()+t.substring(1)}function ie(t){const[e,s]=t.split("(");return{method:e,observerProps:s.replace(")","").split(",").map(t=>t.trim())}}function oe(t,e){return Object.prototype.hasOwnProperty.call(t,e)||(t[e]=new Map(t[e])),t[e]}const re=Gt(t=>{class e extends t{static enabledWarnings=[];static createProperty(t,e){[String,Boolean,Number,Array].includes(e)&&(e={type:e}),e&&e.reflectToAttribute&&(e.reflect=!0),super.createProperty(t,e)}static getOrCreateMap(t){return oe(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){const t=this.getOrCreateMap("__complexObservers");this.observers.forEach(e=>{const{method:s,observerProps:n}=ie(e);t.set(s,n)})}}static addCheckedInitializer(t){super.addInitializer(e=>{e instanceof this&&t(e)})}static getPropertyDescriptor(t,e,s){const n=super.getPropertyDescriptor(t,e,s);let i=n;if(this.getOrCreateMap("__propKeys").set(t,e),s.sync&&(i={get:n.get,set(n){const i=this[t];a(n,i)&&(this[e]=n,this.requestUpdate(t,i,s),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),s.readOnly){const e=i.set;this.addCheckedInitializer(s=>{s[`_set${ne(t)}`]=function(t){e.call(s,t)}}),i={get:i.get,set(){},configurable:!0,enumerable:!0}}if("value"in s&&this.addCheckedInitializer(e=>{const n="function"==typeof s.value?s.value.call(e):s.value;s.readOnly?e[`_set${ne(t)}`](n):e[t]=n}),s.observer){const e=s.observer;this.getOrCreateMap("__observers").set(t,e),this.addCheckedInitializer(t=>{t[e]||console.warn(`observer method ${e} not defined`)})}if(s.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){const t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(s.computed){const e=`__assignComputed${t}`,n=ie(s.computed);this.prototype[e]=function(...e){this[t]=this[n.method](...e)},this.getOrCreateMap("__computedObservers").set(e,n.observerProps)}return s.attribute||(s.attribute=se(t)),i}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();const{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){const e=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),e||this.ready()}setProperties(t){Object.entries(t).forEach(([t,e])=>{const s=this.constructor.__propKeys.get(t),n=this[s];this[s]=e,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){const e=oe(this,"__dynamicMethodObservers"),{method:s,observerProps:n}=ie(t);e.set(s,n)}_createPropertyObserver(t,e){oe(this,"__dynamicPropertyObservers").set(e,t)}__runComplexObservers(t,e){e.forEach((e,s)=>{e.some(e=>t.has(e))&&(this[s]?this[s](...e.map(t=>this[t])):console.warn(`observer method ${s} not defined`))})}__runDynamicObservers(t,e){e.forEach((e,s)=>{t.has(e)&&this[s]&&this[s](this[e],t.get(e))})}__runObservers(t,e){t.forEach((t,s)=>{const n=e.get(s);void 0!==n&&this[n]&&this[n](this[s],t)})}__runNotifyProps(t,e){t.forEach((t,s)=>{e.has(s)&&this.dispatchEvent(new CustomEvent(`${se(s)}-changed`,{detail:{value:this[s]}}))})}_get(t,e){return Jt(t,e)}_set(t,e,s){Qt(t,e,s)}}return e});function ae(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}class le{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const s=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,i)=>{const o=t.indexOf(e);-1===o?s.push(e):o!==i&&n.push(e)}),(e.length||s.length||n.length)&&this.callback({addedNodes:e,currentNodes:t,movedNodes:n,removedNodes:s}),this._storedNodes=t}}let ce=0;function de(){return ce++}class he extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${de()}`}constructor(t,e,s,n={}){super();const{initializer:i,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=n;this.host=t,this.slotName=e,this.tagName=s,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=i,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:s}=this;let n=this.defaultNode;return!n&&s&&(n=document.createElement(s),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>(e.nodeType!==Node.ELEMENT_NODE||!e.hasAttribute("data-slot-ignore"))&&(e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,s=this.host.shadowRoot.querySelector(e);this.__slotObserver=new le(s,({addedNodes:t,removedNodes:e})=>{const s=this.multiple?this.nodes:[this.node],n=t.filter(t=>!(ae(t)||s.includes(t)||t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore")));e.length&&(this.nodes=s.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),n&&n.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...s,...n].filter(t=>t!==this.defaultNode),n.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=n[0],this.initAddedNode(this.node)))})}}class ue extends he{constructor(t){super(t,"tooltip"),this.setTarget(t),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(t),t.addEventListener("content-changed",this.__onContentChange)}teardownNode(t){this.manual||this.host.removeAttribute("has-tooltip"),t.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__onContentChange(t){this.__notifyChange(t.target)}__notifyChange(t){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:t}}))}}class pe extends EventTarget{#t;#e=new Set;#s;#n=!1;constructor(t){super(),this.#t=t,this.#s=new CSSStyleSheet}#i(t){const{propertyName:e}=t;this.#e.has(e)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:e}}))}observe(t){this.connect(),this.#e.has(t)||(this.#e.add(t),this.#s.replaceSync(`\n :root::before, :host::before {\n content: '' !important;\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n visibility: hidden !important;\n transition: 1ms allow-discrete step-end !important;\n transition-property: ${[...this.#e].join(", ")} !important;\n }\n `))}connect(){this.#n||(this.#t.adoptedStyleSheets.unshift(this.#s),this.#o.addEventListener("transitionstart",t=>this.#i(t)),this.#o.addEventListener("transitionend",t=>this.#i(t)),this.#n=!0)}disconnect(){this.#e.clear(),this.#t.adoptedStyleSheets=this.#t.adoptedStyleSheets.filter(t=>t!==this.#s),this.#o.removeEventListener("transitionstart",this.#i),this.#o.removeEventListener("transitionend",this.#i),this.#n=!1}get#o(){return this.#t.documentElement??this.#t.host}static for(t){return t.__cssPropertyObserver||=new pe(t),t.__cssPropertyObserver}}function ge(t){const{baseStyles:e,themeStyles:s,elementStyles:n,lumoInjector:i}=t.constructor,o=t.__lumoStyleSheet;return o&&(e||s)?[...i.includeBaseStyles?e:[],o,...s]:[o,...n].filter(Boolean)}function fe(t){l(t.shadowRoot,ge(t))}function me(t,e){t.__lumoStyleSheet=e,fe(t)}function ve(t){t.__lumoStyleSheet=void 0,fe(t)}const be=new Set;function ye(t){be.has(t)||(be.add(t),console.warn(t))}const _e=new WeakMap;function we(t){try{return t.media.mediaText}catch{return ye('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function xe(t){try{return t.cssRules}catch{return ye('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}function ke(t,e={tags:new Map,modules:new Map}){for(const n of xe(t)){if(n instanceof CSSImportRule){const t=we(n);t.startsWith("lumo_")?e.modules.set(t,[...n.styleSheet.cssRules]):ke(n.styleSheet,e);continue}if(n instanceof CSSMediaRule){const t=we(n);t.startsWith("lumo_")&&e.modules.set(t,[...n.cssRules]);continue}if(n instanceof CSSStyleRule&&n.cssText.includes("-inject"))for(const t of n.style){var s;const i=null===(s=t.match(/^--_lumo-(.*)-inject-modules$/u))||void 0===s?void 0:s[1];if(!i)continue;const o=n.style.getPropertyValue(t);e.tags.set(i,o.split(",").map(t=>t.trim().replace(/'|"/gu,"")))}else;}return e}function Ce(t){let e=new Map,s=new Map;for(const n of t){let t=_e.get(n);t||(t=ke(n),_e.set(n,t)),e=new Map([...e,...t.tags]),s=new Map([...s,...t.modules])}return{tags:e,modules:s}}function Se(t){return`--_lumo-${t.is}-inject`}class Ee{#t;#r;#a=new Map;#l=new Map;constructor(t=document){this.#t=t,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=pe.for(t),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(t=>t.forEach(ve))}forceUpdate(){for(const t of this.#a.keys())this.#c(t)}componentConnected(t){const{lumoInjector:e}=t.constructor,{is:s}=e;this.#l.set(s,this.#l.get(s)??new Set),this.#l.get(s).add(t);const n=this.#a.get(s);if(n)return void(n.cssRules.length>0&&me(t,n));this.#d(s);const i=Se(e);this.#r.observe(i)}componentDisconnected(t){var e;const{is:s}=t.constructor.lumoInjector;null===(e=this.#l.get(s))||void 0===e||e.delete(t),ve(t)}handlePropertyChange(t){var e;const{propertyName:s}=t.detail,n=null===(e=s.match(/^--_lumo-(.*)-inject$/u))||void 0===e?void 0:e[1];n&&this.#c(n)}#d(t){this.#a.set(t,new CSSStyleSheet),this.#c(t)}#c(t){var e;const{tags:s,modules:n}=Ce(this.#h),i=(s.get(t)??[]).flatMap(t=>n.get(t)??[]).map(t=>t.cssText).join("\n"),o=this.#a.get(t);o.replaceSync(i),null===(e=this.#l.get(t))||void 0===e||e.forEach(t=>{i?me(t,o):ve(t)})}get#h(){let t=new Set;for(const e of[this.#t,document])t=t.union(new Set(e.styleSheets)),t=t.union(new Set(e.adoptedStyleSheets));return[...t]}}const Te=new Set;function Ae(t){const e=t.getRootNode();return e.host&&e.host.constructor.version?Ae(e.host):e}const Oe=t=>class extends t{static finalize(){super.finalize();const t=Se(this.lumoInjector);this.is&&!Te.has(t)&&(Te.add(t),CSS.registerProperty({name:t,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();const t=Ae(this);t.__lumoInjectorDisabled||this.isConnected&&(t.__lumoInjector||=new Ee(t),this.__lumoInjector=t.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},Ie=t=>class extends t{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),"theme"===t&&this._set_theme(s)}},je=[],Me=new Set,$e=new Set;function Pe(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function Le(t,e){return(t||"").split(" ").some(t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e))}function Ne(t){return t.map(t=>t.cssText).join("\n")}const Be="vaadin-themable-mixin-style";function Re(t,e){const s=document.createElement("style");s.id=Be,s.textContent=Ne(t),e.content.appendChild(s)}function De(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function Ue(t){const e=[];return t.include&&[].concat(t.include).forEach(t=>{const s=je.find(e=>e.moduleId===t);s?e.push(...Ue(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),e}function Ve(t){const e=`${t}-default-theme`,s=je.filter(s=>s.moduleId!==e&&Le(s.themeFor,t)).map(t=>Object.assign(Object.assign({},t),{},{styles:[...Ue(t),...t.styles],includePriority:De(t.moduleId)})).sort((t,e)=>e.includePriority-t.includePriority);return s.length>0?s:je.filter(t=>t.moduleId===e)}const Fe=t=>class extends(Ie(t)){constructor(){super(),Me.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&$e.add(this.is),this.elementStyles)return;const t=this.prototype._template;t&&!Pe(this)&&Re(this.getStylesForThis(),t)}static finalizeStyles(t){return this.baseStyles=t?[t].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){const e=t.__themes||[],s=Object.getPrototypeOf(this.prototype),n=(s?s.constructor.__themes:[])||[];this.__themes=[...e,...n,...Ve(this.is)];const i=this.__themes.flatMap(t=>t.styles);return i.filter((t,e)=>e===i.lastIndexOf(t))}},qe=(t,...e)=>{const s=document.createElement("style");s.id=t,s.textContent=e.map(t=>t.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",s)};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(t=>{CSS.registerProperty({name:t,syntax:"<color>",inherits:!0,initialValue:"light-dark(black, white)"})}),qe("vaadin-base",i`
|
|
398
|
+
`}setPath(t){this.path=t}open(t){t.preventDefault();let e=this._href,{path:s}=this;if(this.src){const t=document.getElementById(this.src);s=t.getFullPath(),e=t.sourceView}const n=window.open("","eXide");if(n&&!n.closed){n.eXide?(f.log("<pb-edit-xml> using existing eXide to open %s",s),n.eXide.app.findDocument(s),n.focus()):(f.log("<pb-edit-xml> opening new eXide for %s",s),window.eXide_onload=function(){n.eXide.app.findDocument(s)},n.location=e)}}}function mt(t){return t.replace(/-[a-z]/gu,t=>t[1].toUpperCase())}customElements.define("pb-edit-xml",ft),window.Vaadin||={},window.Vaadin.featureFlags||={};const vt={};function bt(t,e="25.0.3"){if(Object.defineProperty(t,"version",{get:()=>e}),t.experimental){const e="string"==typeof t.experimental?t.experimental:`${mt(t.is.split("-").slice(1).join("-"))}Component`;if(!window.Vaadin.featureFlags[e]&&!vt[e])return vt[e]=new Set,vt[e].add(t),void Object.defineProperty(window.Vaadin.featureFlags,e,{get:()=>0===vt[e].size,set(t){t&&vt[e].size>0&&(vt[e].forEach(t=>{customElements.define(t.is,t)}),vt[e].clear())}});if(vt[e])return void vt[e].add(t)}const s=customElements.get(t.is);if(s){const e=s.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${s.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}const yt=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,_t=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function wt(){function t(){return!0}return Et(t)}function xt(){try{return!!kt()||!!Ct()&&(_t?!St():!wt())}catch(t){return!1}}function kt(){return localStorage.getItem("vaadin.developmentmode.force")}function Ct(){return["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0}function St(){if(_t){if(Object.keys(_t).map(t=>_t[t]).filter(t=>t.productionMode).length>0)return!0}return!1}function Et(t,e){if("function"!=typeof t)return;const s=yt.exec(t.toString());if(s)try{t=new Function(s[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(e)}window.Vaadin=window.Vaadin||{};const Tt=function(t,e){if(window.Vaadin.developmentMode)return Et(t,e)};function At(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=xt());const Ot=function(){if("function"==typeof Tt)return Tt(At)};let It=0,jt=0;const Mt=[];let $t=!1;function Pt(){$t=!1;const t=Mt.length;for(let e=0;e<t;e++){const t=Mt[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}Mt.splice(0,t),jt+=t}const Lt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Nt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Bt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Rt={run(t){$t||($t=!0,queueMicrotask(()=>Pt())),Mt.push(t);const e=It;return It+=1,e},cancel(t){const e=t-jt;if(e>=0){if(!Mt[e])throw new Error(`invalid async handle: ${t}`);Mt[e]=null}}},Dt=new Set;class Ut{static debounce(t,e,s){return t instanceof Ut?t._cancelAsync():t=new Ut,t.setConfig(e,s),t}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,Dt.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),Dt.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}}function Vt(t){Dt.add(t)}const Ft=[];function qt(t,e,s=t.getAttribute("dir")){e?t.setAttribute("dir",e):null!=s&&t.removeAttribute("dir")}function zt(){return document.documentElement.getAttribute("dir")}function Kt(){const t=zt();Ft.forEach(e=>{qt(e,t)})}new MutationObserver(Kt).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Xt=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")&&!this.__restoreSubscription||(this.__subscribe(),qt(this,zt(),null))}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"dir"!==t)return;const n=zt(),i=s===n&&-1===Ft.indexOf(this),o=!s&&e&&-1===Ft.indexOf(this),r=s!==n&&e===n;i||o?(this.__subscribe(),qt(this,n,s)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=Ft.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,e,s){("dir"!==s||""!==e||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,e,s)}_attributeToProperty(t,e,s){"dir"!==t||e?super._attributeToProperty(t,e,s):this.dir=""}__subscribe(){Ft.includes(this)||Ft.push(this)}__unsubscribe(){Ft.includes(this)&&Ft.splice(Ft.indexOf(this),1)}};let Ht;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){Ot()};const Wt=new Set,Yt=t=>class extends(Xt(t)){static finalize(){super.finalize();const{is:t}=this;if(t&&!Wt.has(t)){window.Vaadin.registrations.push(this),Wt.add(t);const e=window.Vaadin.developmentModeCallback;e&&(Ht=Ut.debounce(Ht,Bt,()=>{e["vaadin-usage-statistics"]()}),Vt(Ht))}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}},Zt=new WeakMap;function Gt(t,e){let s=e;for(;s;){if(Zt.get(s)===t)return!0;s=Object.getPrototypeOf(s)}return!1}function Jt(t){return e=>{if(Gt(t,e))return e;const s=t(e);return Zt.set(s,t),s}}function Qt(t,e){return t.split(".").reduce((t,e)=>t?t[e]:void 0,e)}function te(t,e,s){const n=t.split("."),i=n.pop();n.reduce((t,e)=>t[e],s)[i]=e}const ee={},se=/([A-Z])/gu;function ne(t){return ee[t]||(ee[t]=t.replace(se,"-$1").toLowerCase()),ee[t]}function ie(t){return t[0].toUpperCase()+t.substring(1)}function oe(t){const[e,s]=t.split("(");return{method:e,observerProps:s.replace(")","").split(",").map(t=>t.trim())}}function re(t,e){return Object.prototype.hasOwnProperty.call(t,e)||(t[e]=new Map(t[e])),t[e]}const ae=Jt(t=>{class e extends t{static enabledWarnings=[];static createProperty(t,e){[String,Boolean,Number,Array].includes(e)&&(e={type:e}),e&&e.reflectToAttribute&&(e.reflect=!0),super.createProperty(t,e)}static getOrCreateMap(t){return re(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){const t=this.getOrCreateMap("__complexObservers");this.observers.forEach(e=>{const{method:s,observerProps:n}=oe(e);t.set(s,n)})}}static addCheckedInitializer(t){super.addInitializer(e=>{e instanceof this&&t(e)})}static getPropertyDescriptor(t,e,s){const n=super.getPropertyDescriptor(t,e,s);let i=n;if(this.getOrCreateMap("__propKeys").set(t,e),s.sync&&(i={get:n.get,set(n){const i=this[t];a(n,i)&&(this[e]=n,this.requestUpdate(t,i,s),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),s.readOnly){const e=i.set;this.addCheckedInitializer(s=>{s[`_set${ie(t)}`]=function(t){e.call(s,t)}}),i={get:i.get,set(){},configurable:!0,enumerable:!0}}if("value"in s&&this.addCheckedInitializer(e=>{const n="function"==typeof s.value?s.value.call(e):s.value;s.readOnly?e[`_set${ie(t)}`](n):e[t]=n}),s.observer){const e=s.observer;this.getOrCreateMap("__observers").set(t,e),this.addCheckedInitializer(t=>{t[e]||console.warn(`observer method ${e} not defined`)})}if(s.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){const t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(s.computed){const e=`__assignComputed${t}`,n=oe(s.computed);this.prototype[e]=function(...e){this[t]=this[n.method](...e)},this.getOrCreateMap("__computedObservers").set(e,n.observerProps)}return s.attribute||(s.attribute=ne(t)),i}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();const{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){const e=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),e||this.ready()}setProperties(t){Object.entries(t).forEach(([t,e])=>{const s=this.constructor.__propKeys.get(t),n=this[s];this[s]=e,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){const e=re(this,"__dynamicMethodObservers"),{method:s,observerProps:n}=oe(t);e.set(s,n)}_createPropertyObserver(t,e){re(this,"__dynamicPropertyObservers").set(e,t)}__runComplexObservers(t,e){e.forEach((e,s)=>{e.some(e=>t.has(e))&&(this[s]?this[s](...e.map(t=>this[t])):console.warn(`observer method ${s} not defined`))})}__runDynamicObservers(t,e){e.forEach((e,s)=>{t.has(e)&&this[s]&&this[s](this[e],t.get(e))})}__runObservers(t,e){t.forEach((t,s)=>{const n=e.get(s);void 0!==n&&this[n]&&this[n](this[s],t)})}__runNotifyProps(t,e){t.forEach((t,s)=>{e.has(s)&&this.dispatchEvent(new CustomEvent(`${ne(s)}-changed`,{detail:{value:this[s]}}))})}_get(t,e){return Qt(t,e)}_set(t,e,s){te(t,e,s)}}return e});function le(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}class ce{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const s=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,i)=>{const o=t.indexOf(e);-1===o?s.push(e):o!==i&&n.push(e)}),(e.length||s.length||n.length)&&this.callback({addedNodes:e,currentNodes:t,movedNodes:n,removedNodes:s}),this._storedNodes=t}}let de=0;function he(){return de++}class ue extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${he()}`}constructor(t,e,s,n={}){super();const{initializer:i,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=n;this.host=t,this.slotName=e,this.tagName=s,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=i,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:s}=this;let n=this.defaultNode;return!n&&s&&(n=document.createElement(s),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>(e.nodeType!==Node.ELEMENT_NODE||!e.hasAttribute("data-slot-ignore"))&&(e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,s=this.host.shadowRoot.querySelector(e);this.__slotObserver=new ce(s,({addedNodes:t,removedNodes:e})=>{const s=this.multiple?this.nodes:[this.node],n=t.filter(t=>!(le(t)||s.includes(t)||t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore")));e.length&&(this.nodes=s.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),n&&n.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...s,...n].filter(t=>t!==this.defaultNode),n.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=n[0],this.initAddedNode(this.node)))})}}class pe extends ue{constructor(t){super(t,"tooltip"),this.setTarget(t),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(t),t.addEventListener("content-changed",this.__onContentChange)}teardownNode(t){this.manual||this.host.removeAttribute("has-tooltip"),t.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__onContentChange(t){this.__notifyChange(t.target)}__notifyChange(t){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:t}}))}}class ge extends EventTarget{#t;#e=new Set;#s;#n=!1;constructor(t){super(),this.#t=t,this.#s=new CSSStyleSheet}#i(t){const{propertyName:e}=t;this.#e.has(e)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:e}}))}observe(t){this.connect(),this.#e.has(t)||(this.#e.add(t),this.#s.replaceSync(`\n :root::before, :host::before {\n content: '' !important;\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n visibility: hidden !important;\n transition: 1ms allow-discrete step-end !important;\n transition-property: ${[...this.#e].join(", ")} !important;\n }\n `))}connect(){this.#n||(this.#t.adoptedStyleSheets.unshift(this.#s),this.#o.addEventListener("transitionstart",t=>this.#i(t)),this.#o.addEventListener("transitionend",t=>this.#i(t)),this.#n=!0)}disconnect(){this.#e.clear(),this.#t.adoptedStyleSheets=this.#t.adoptedStyleSheets.filter(t=>t!==this.#s),this.#o.removeEventListener("transitionstart",this.#i),this.#o.removeEventListener("transitionend",this.#i),this.#n=!1}get#o(){return this.#t.documentElement??this.#t.host}static for(t){return t.__cssPropertyObserver||=new ge(t),t.__cssPropertyObserver}}function fe(t){const{baseStyles:e,themeStyles:s,elementStyles:n,lumoInjector:i}=t.constructor,o=t.__lumoStyleSheet;return o&&(e||s)?[...i.includeBaseStyles?e:[],o,...s]:[o,...n].filter(Boolean)}function me(t){l(t.shadowRoot,fe(t))}function ve(t,e){t.__lumoStyleSheet=e,me(t)}function be(t){t.__lumoStyleSheet=void 0,me(t)}const ye=new Set;function _e(t){ye.has(t)||(ye.add(t),console.warn(t))}const we=new WeakMap;function xe(t){try{return t.media.mediaText}catch{return _e('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function ke(t){try{return t.cssRules}catch{return _e('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}function Ce(t,e={tags:new Map,modules:new Map}){for(const n of ke(t)){if(n instanceof CSSImportRule){const t=xe(n);t.startsWith("lumo_")?e.modules.set(t,[...n.styleSheet.cssRules]):Ce(n.styleSheet,e);continue}if(n instanceof CSSMediaRule){const t=xe(n);t.startsWith("lumo_")&&e.modules.set(t,[...n.cssRules]);continue}if(n instanceof CSSStyleRule&&n.cssText.includes("-inject"))for(const t of n.style){var s;const i=null===(s=t.match(/^--_lumo-(.*)-inject-modules$/u))||void 0===s?void 0:s[1];if(!i)continue;const o=n.style.getPropertyValue(t);e.tags.set(i,o.split(",").map(t=>t.trim().replace(/'|"/gu,"")))}else;}return e}function Se(t){let e=new Map,s=new Map;for(const n of t){let t=we.get(n);t||(t=Ce(n),we.set(n,t)),e=new Map([...e,...t.tags]),s=new Map([...s,...t.modules])}return{tags:e,modules:s}}function Ee(t){return`--_lumo-${t.is}-inject`}class Te{#t;#r;#a=new Map;#l=new Map;constructor(t=document){this.#t=t,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=ge.for(t),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(t=>t.forEach(be))}forceUpdate(){for(const t of this.#a.keys())this.#c(t)}componentConnected(t){const{lumoInjector:e}=t.constructor,{is:s}=e;this.#l.set(s,this.#l.get(s)??new Set),this.#l.get(s).add(t);const n=this.#a.get(s);if(n)return void(n.cssRules.length>0&&ve(t,n));this.#d(s);const i=Ee(e);this.#r.observe(i)}componentDisconnected(t){var e;const{is:s}=t.constructor.lumoInjector;null===(e=this.#l.get(s))||void 0===e||e.delete(t),be(t)}handlePropertyChange(t){var e;const{propertyName:s}=t.detail,n=null===(e=s.match(/^--_lumo-(.*)-inject$/u))||void 0===e?void 0:e[1];n&&this.#c(n)}#d(t){this.#a.set(t,new CSSStyleSheet),this.#c(t)}#c(t){var e;const{tags:s,modules:n}=Se(this.#h),i=(s.get(t)??[]).flatMap(t=>n.get(t)??[]).map(t=>t.cssText).join("\n"),o=this.#a.get(t);o.replaceSync(i),null===(e=this.#l.get(t))||void 0===e||e.forEach(t=>{i?ve(t,o):be(t)})}get#h(){let t=new Set;for(const e of[this.#t,document])t=t.union(new Set(e.styleSheets)),t=t.union(new Set(e.adoptedStyleSheets));return[...t]}}const Ae=new Set;function Oe(t){const e=t.getRootNode();return e.host&&e.host.constructor.version?Oe(e.host):e}const Ie=t=>class extends t{static finalize(){super.finalize();const t=Ee(this.lumoInjector);this.is&&!Ae.has(t)&&(Ae.add(t),CSS.registerProperty({name:t,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();const t=Oe(this);t.__lumoInjectorDisabled||this.isConnected&&(t.__lumoInjector||=new Te(t),this.__lumoInjector=t.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},je=t=>class extends t{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),"theme"===t&&this._set_theme(s)}},Me=[],$e=new Set,Pe=new Set;function Le(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function Ne(t,e){return(t||"").split(" ").some(t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e))}function Be(t){return t.map(t=>t.cssText).join("\n")}const Re="vaadin-themable-mixin-style";function De(t,e){const s=document.createElement("style");s.id=Re,s.textContent=Be(t),e.content.appendChild(s)}function Ue(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function Ve(t){const e=[];return t.include&&[].concat(t.include).forEach(t=>{const s=Me.find(e=>e.moduleId===t);s?e.push(...Ve(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),e}function Fe(t){const e=`${t}-default-theme`,s=Me.filter(s=>s.moduleId!==e&&Ne(s.themeFor,t)).map(t=>Object.assign(Object.assign({},t),{},{styles:[...Ve(t),...t.styles],includePriority:Ue(t.moduleId)})).sort((t,e)=>e.includePriority-t.includePriority);return s.length>0?s:Me.filter(t=>t.moduleId===e)}const qe=t=>class extends(je(t)){constructor(){super(),$e.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&Pe.add(this.is),this.elementStyles)return;const t=this.prototype._template;t&&!Le(this)&&De(this.getStylesForThis(),t)}static finalizeStyles(t){return this.baseStyles=t?[t].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){const e=t.__themes||[],s=Object.getPrototypeOf(this.prototype),n=(s?s.constructor.__themes:[])||[];this.__themes=[...e,...n,...Fe(this.is)];const i=this.__themes.flatMap(t=>t.styles);return i.filter((t,e)=>e===i.lastIndexOf(t))}},ze=(t,...e)=>{const s=document.createElement("style");s.id=t,s.textContent=e.map(t=>t.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",s)};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(t=>{CSS.registerProperty({name:t,syntax:"<color>",inherits:!0,initialValue:"light-dark(black, white)"})}),ze("vaadin-base",i`
|
|
399
399
|
@layer vaadin.base {
|
|
400
400
|
html {
|
|
401
401
|
/* Background color */
|
|
@@ -504,4 +504,4 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
`);const
|
|
507
|
+
`);const Ke=t=>t,Xe="string"==typeof document.head.style.touchAction,He="__polymerGestures",We="__polymerGesturesHandled",Ye="__polymerGesturesTouchAction",Ze=25,Ge=5,Je=2,Qe=["mousedown","mousemove","mouseup","click"],ts=[0,1,4,2],es=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function ss(t){return Qe.indexOf(t)>-1}let ns=!1;function is(t){ss(t)}!function(){try{const t=Object.defineProperty({},"passive",{get(){ns=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();const os=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),rs={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function as(t){const e=t.type;if(!ss(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!es&&(e=ts[t.which]||0),Boolean(1&e)}return 0===(void 0===t.button?0:t.button)}function ls(t){if("click"===t.type){if(0===t.detail)return!0;const e=vs(t);if(!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return!0;const s=e.getBoundingClientRect(),n=t.pageX,i=t.pageY;return!(n>=s.left&&n<=s.right&&i>=s.top&&i<=s.bottom)}return!1}const cs={touch:{x:0,y:0,id:-1,scrollDecided:!1}};function ds(t){let e="auto";const s=ps(t);for(let t,n=0;n<s.length;n++)if(t=s[n],t[Ye]){e=t[Ye];break}return e}function hs(t,e,s){t.movefn=e,t.upfn=s,document.addEventListener("mousemove",e),document.addEventListener("mouseup",s)}function us(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}const ps=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],gs={},fs=[];function ms(t,e){let s=document.elementFromPoint(t,e),n=s;for(;n&&n.shadowRoot&&!window.ShadyDOM;){const i=n;if(n=n.shadowRoot.elementFromPoint(t,e),i===n)break;n&&(s=n)}return s}function vs(t){const e=ps(t);return e.length>0?e[0]:t.target}function bs(t){const e=t.type,s=t.currentTarget[He];if(!s)return;const n=s[e];if(!n)return;if(!t[We]&&(t[We]={},e.startsWith("touch"))){const s=t.changedTouches[0];if("touchstart"===e&&1===t.touches.length&&(cs.touch.id=s.identifier),cs.touch.id!==s.identifier)return;Xe||"touchstart"!==e&&"touchmove"!==e||ys(t)}const i=t[We];if(!i.skip){for(let e,s=0;s<fs.length;s++)e=fs[s],n[e.name]&&!i[e.name]&&e.flow&&e.flow.start.indexOf(t.type)>-1&&e.reset&&e.reset();for(let s,o=0;o<fs.length;o++)s=fs[o],n[s.name]&&!i[s.name]&&(i[s.name]=!0,s[e](t))}}function ys(t){const e=t.changedTouches[0],s=t.type;if("touchstart"===s)cs.touch.x=e.clientX,cs.touch.y=e.clientY,cs.touch.scrollDecided=!1;else if("touchmove"===s){if(cs.touch.scrollDecided)return;cs.touch.scrollDecided=!0;const s=ds(t);let n=!1;const i=Math.abs(cs.touch.x-e.clientX),o=Math.abs(cs.touch.y-e.clientY);t.cancelable&&("none"===s?n=!0:"pan-x"===s?n=o>i:"pan-y"===s&&(n=i>o)),n?t.preventDefault():Es("track")}}function _s(t,e,s){return!!gs[e]&&(ws(t,e,s),!0)}function ws(t,e,s){const n=gs[e],i=n.deps,o=n.name;let r=t[He];r||(t[He]=r={});for(let e,s,n=0;n<i.length;n++)e=i[n],os&&ss(e)&&"click"!==e||(s=r[e],s||(r[e]=s={_count:0}),0===s._count&&t.addEventListener(e,bs,is(e)),s[o]=(s[o]||0)+1,s._count=(s._count||0)+1);t.addEventListener(e,s),n.touchAction&&Cs(t,n.touchAction)}function xs(t){fs.push(t),t.emits.forEach(e=>{gs[e]=t})}function ks(t){for(let e,s=0;s<fs.length;s++){e=fs[s];for(let s,n=0;n<e.emits.length;n++)if(s=e.emits[n],s===t)return e}return null}function Cs(t,e){Xe&&t instanceof HTMLElement&&Rt.run(()=>{t.style.touchAction=e}),t[Ye]=e}function Ss(t,e,s){const n=new Event(e,{bubbles:!0,cancelable:!0,composed:!0});if(n.detail=s,Ke(t).dispatchEvent(n),n.defaultPrevented){const t=s.preventer||s.sourceEvent;t&&t.preventDefault&&t.preventDefault()}}function Es(t){const e=ks(t);e.info&&(e.info.prevent=!0)}function Ts(t,e,s,n){e&&Ss(e,t,{x:s.clientX,y:s.clientY,sourceEvent:s,preventer:n,prevent:t=>Es(t)})}function As(t,e,s){if(t.prevent)return!1;if(t.started)return!0;const n=Math.abs(t.x-e),i=Math.abs(t.y-s);return n>=Ge||i>=Ge}function Os(t,e,s){if(!e)return;const n=t.moves[t.moves.length-2],i=t.moves[t.moves.length-1],o=i.x-t.x,r=i.y-t.y;let a,l=0;n&&(a=i.x-n.x,l=i.y-n.y),Ss(e,"track",{state:t.state,x:s.clientX,y:s.clientY,dx:o,dy:r,ddx:a,ddy:l,sourceEvent:s,hover:()=>ms(s.clientX,s.clientY)})}function Is(t,e,s){const n=Math.abs(e.clientX-t.x),i=Math.abs(e.clientY-t.y),o=vs(s||e);!o||rs[o.localName]&&o.hasAttribute("disabled")||(isNaN(n)||isNaN(i)||n<=Ze&&i<=Ze||ls(e))&&(t.prevent||Ss(o,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:s}))}xs({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){us(this.info)},mousedown(t){if(!as(t))return;const e=vs(t),s=this,n=t=>{as(t)||(Ts("up",e,t),us(s.info))},i=t=>{as(t)&&Ts("up",e,t),us(s.info)};hs(this.info,n,i),Ts("down",e,t)},touchstart(t){Ts("down",vs(t),t.changedTouches[0],t)},touchend(t){Ts("up",vs(t),t.changedTouches[0],t)}}),xs({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(t){this.moves.length>Je&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,us(this.info)},mousedown(t){if(!as(t))return;const e=vs(t),s=this,n=t=>{const n=t.clientX,i=t.clientY;As(s.info,n,i)&&(s.info.state=s.info.started?"mouseup"===t.type?"end":"track":"start","start"===s.info.state&&Es("tap"),s.info.addMove({x:n,y:i}),as(t)||(s.info.state="end",us(s.info)),e&&Os(s.info,e,t),s.info.started=!0)},i=t=>{s.info.started&&n(t),us(s.info)};hs(this.info,n,i),this.info.x=t.clientX,this.info.y=t.clientY},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove(t){const e=vs(t),s=t.changedTouches[0],n=s.clientX,i=s.clientY;As(this.info,n,i)&&("start"===this.info.state&&Es("tap"),this.info.addMove({x:n,y:i}),Os(this.info,e,s),this.info.state="track",this.info.started=!0)},touchend(t){const e=vs(t),s=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:s.clientX,y:s.clientY}),Os(this.info,e,s))}}),xs({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(t){as(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click(t){as(t)&&Is(this.info,t)},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchend(t){Is(this.info,t.changedTouches[0],t)}});const js=Jt(t=>class extends t{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}_disabledChanged(t){this._setAriaDisabled(t)}_setAriaDisabled(t){t?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}}),Ms=Jt(t=>class extends t{ready(){super.ready(),this.addEventListener("keydown",t=>{this._onKeyDown(t)}),this.addEventListener("keyup",t=>{this._onKeyUp(t)})}_onKeyDown(t){switch(t.key){case"Enter":this._onEnter(t);break;case"Escape":this._onEscape(t)}}_onKeyUp(t){}_onEnter(t){}_onEscape(t){}}),$s=t=>class extends(js(Ms(t))){get _activeKeys(){return[" "]}ready(){super.ready(),_s(this,"down",t=>{this._shouldSetActive(t)&&this._setActive(!0)}),_s(this,"up",()=>{this._setActive(!1)})}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(t){return!this.disabled}_onKeyDown(t){super._onKeyDown(t),this._shouldSetActive(t)&&this._activeKeys.includes(t.key)&&(this._setActive(!0),document.addEventListener("keyup",t=>{this._activeKeys.includes(t.key)&&this._setActive(!1)},{once:!0}))}_setActive(t){this.toggleAttribute("active",t)}};let Ps=!1;function Ls(){return Ps}function Ns(t){const e=t.style;if("hidden"===e.visibility||"none"===e.display)return!0;const s=window.getComputedStyle(t);return"hidden"===s.visibility||"none"===s.display}function Bs(t){return t.checkVisibility?!t.checkVisibility({visibilityProperty:!0}):null===t.offsetParent&&0===t.clientWidth&&0===t.clientHeight||Ns(t)}function Rs(t){return t.getRootNode().activeElement===t}window.addEventListener("keydown",()=>{Ps=!0},{capture:!0}),window.addEventListener("mousedown",()=>{Ps=!1},{capture:!0});const Ds=Jt(t=>class extends t{get _keyboardActive(){return Ls()}ready(){this.addEventListener("focusin",t=>{this._shouldSetFocus(t)&&this._setFocused(!0)}),this.addEventListener("focusout",t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)}),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}focus(t){super.focus(t),t&&!1===t.focusVisible||this.setAttribute("focus-ring","")}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}});export{$s as A,js as D,Yt as E,Ds as F,Ms as K,Ie as L,ae as P,ue as S,qe as T,pe as a,Ut as b,Nt as c,bt as d,Rs as e,Bs as f,ce as g,Jt as h,Ls as i,v as o,dt as p,Lt as t};
|