@teipublisher/pb-components 1.44.2 → 2.0.0
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/CHANGELOG.md +60 -0
- package/dist/demo/demos.json +2 -1
- package/dist/demo/pb-browse-docs.html +2 -1
- package/dist/demo/pb-combo-box.html +1 -1
- package/dist/demo/pb-document.html +2 -2
- package/dist/demo/pb-load.html +2 -2
- package/dist/demo/pb-select-feature.html +1 -1
- package/dist/demo/pb-select-feature2.html +10 -3
- package/dist/demo/pb-select-feature3.html +1 -1
- package/dist/demo/pb-select-odd.html +1 -1
- package/dist/demo/pb-table-grid.html +1 -1
- package/dist/demo/pb-tabs.html +8 -2
- package/dist/demo/pb-toggle-feature.html +2 -2
- package/dist/demo/pb-toggle-feature2.html +2 -2
- package/dist/demo/pb-toggle-feature3.html +2 -2
- package/dist/demo/pb-view.html +1 -1
- package/dist/demo/pb-view4.html +86 -0
- package/dist/pb-code-editor.js +1 -1
- package/dist/pb-component-docs.js +33 -33
- package/dist/pb-components-bundle.js +173 -173
- package/dist/pb-edit-app.js +6 -6
- package/dist/pb-elements.json +93 -27
- package/dist/{pb-i18n-3963b098.js → pb-i18n-8a90c591.js} +1 -1
- package/dist/pb-leaflet-map.js +1 -1
- package/dist/pb-mixin-8a593923.js +158 -0
- package/dist/pb-odd-editor.js +47 -47
- package/dist/{vaadin-element-mixin-08cf11b5.js → vaadin-element-mixin-672938e3.js} +18 -18
- package/i18n/common/en.json +9 -1
- package/package.json +4 -3
- package/pb-elements.json +93 -27
- package/src/dts-client.js +14 -14
- package/src/dts-select-endpoint.js +5 -5
- package/src/pb-ajax.js +4 -4
- package/src/pb-authority-lookup.js +2 -2
- package/src/pb-autocomplete.js +9 -11
- package/src/pb-blacklab-highlight.js +3 -3
- package/src/pb-browse-docs.js +44 -27
- package/src/pb-browse.js +9 -3
- package/src/pb-combo-box.js +2 -2
- package/src/pb-document.js +15 -1
- package/src/pb-download.js +2 -2
- package/src/pb-edit-app.js +2 -2
- package/src/pb-edit-xml.js +2 -2
- package/src/pb-events.js +26 -18
- package/src/pb-grid.js +55 -53
- package/src/pb-lang.js +2 -2
- package/src/pb-link.js +10 -16
- package/src/pb-load.js +35 -25
- package/src/pb-login.js +2 -2
- package/src/pb-manage-odds.js +2 -2
- package/src/pb-markdown.js +2 -2
- package/src/pb-mei.js +2 -2
- package/src/pb-mixin.js +103 -196
- package/src/pb-odd-editor.js +2 -2
- package/src/pb-page.js +30 -21
- package/src/pb-paginate.js +24 -19
- package/src/pb-print-preview.js +2 -2
- package/src/pb-repeat.js +2 -1
- package/src/pb-search.js +34 -8
- package/src/pb-select-feature.js +62 -39
- package/src/pb-select-odd.js +8 -7
- package/src/pb-select-template.js +5 -4
- package/src/pb-select.js +31 -28
- package/src/pb-split-list.js +18 -11
- package/src/pb-table-grid.js +9 -8
- package/src/pb-tabs.js +29 -12
- package/src/pb-toggle-feature.js +51 -55
- package/src/pb-upload.js +10 -3
- package/src/pb-view.js +118 -95
- package/src/theming.js +148 -149
- package/src/urls.js +233 -0
- package/dist/pb-mixin-88125cb2.js +0 -158
package/dist/pb-edit-app.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./paper-checkbox-102e3b43.js";import{p as e,L as t,
|
|
1
|
+
import"./paper-checkbox-102e3b43.js";import{p as e,L as t,w as p,h as o,c as a}from"./pb-mixin-8a593923.js";import{t as i}from"./pb-i18n-8a90c591.js";import"./iron-form-9e72ac45.js";class n extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{error:{type:String},url:{type:String},templates:{type:Array},odds:{type:Array}})}constructor(){super(),this.templates=[],this.odds=[]}connectedCallback(){super.connectedCallback()}firstUpdated(){const e=this.shadowRoot.getElementById("form"),t=this.shadowRoot.getElementById("defaultView"),o=this.shadowRoot.getElementById("index"),a=this.shadowRoot.getElementById("template");this.subscribeTo("pb-i18n-update",e=>{const t=this.shadowRoot.querySelector("#defaultView paper-listbox");let p=t.selected;t.selected=void 0,t.selected=p;const o=this.shadowRoot.querySelector("#index paper-listbox");p=o.selected,o.selected=void 0,o.selected=p},[]),p("pb-page-ready",e=>{let t;t=this.minApiVersion("1.0.0")?e.endpoint+"/api/templates":e.endpoint+"/modules/lib/components-list-templates.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.templates=e}),t=this.minApiVersion("1.0.0")?e.endpoint+"/api/odd":e.endpoint+"/modules/lib/components-list-odds.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.odds=e});const p=this.shadowRoot.querySelector("form");this.minApiVersion("1.0.0")?p.action=e.endpoint+"/api/apps/generate":p.action=e.endpoint+"/modules/components-generate.xql"}),e.addEventListener("iron-form-presubmit",(function(){const e=t.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=o.selectedItem.getAttribute("value"),this.request.body.template=a.selectedItem.getAttribute("value")})),e.addEventListener("iron-form-response",e=>{console.log(e),e.detail.completes.then(e=>{this.emitTo("pb-end-update");const t=e.parseResponse();if(console.log("<pb-edit-app> Received response: %o",t),t.target){const e=window.location.href.replace(/^(.*)\/tei-publisher\/.*/,"$1");this.url=e+"/"+this.shadowRoot.querySelector("paper-input[name=abbrev]").value,this.error=null}else this.error=t.description;this.shadowRoot.getElementById("dialog").open()})}),e.addEventListener("iron-form-error",e=>{this.emitTo("pb-end-update"),console.log("<pb-edit-app> Received response: %o",e.detail.request.response),this.error=e.detail.request.response.description,this.shadowRoot.getElementById("dialog").open()}),e.addEventListener("iron-form-invalid",()=>this.emitTo("pb-end-update"))}_doSubmit(){this.emitTo("pb-start-update");this.shadowRoot.getElementById("form").submit()}render(){return o`
|
|
2
2
|
<iron-form id="form">
|
|
3
3
|
<form method="POST" accept="application/json" enctype="application/json">
|
|
4
4
|
<fieldset>
|
|
5
5
|
<legend>${i("document.selectODD")}</legend>
|
|
6
|
-
${this.odds.map(e=>
|
|
6
|
+
${this.odds.map(e=>o`<paper-checkbox name="odd" value="${e.name}">${e.label}</paper-checkbox>`)}
|
|
7
7
|
</fieldset>
|
|
8
8
|
<paper-input name="uri" type="url" required placeholder="https://e-editiones.org/apps/my-simple-app"
|
|
9
9
|
label="${i("appgen.uri")}" auto-validate></paper-input>
|
|
@@ -17,7 +17,7 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
17
17
|
<legend>${i("appgen.template.help")}</legend>
|
|
18
18
|
<paper-dropdown-menu id="template" label="${i("appgen.template.label")}" name="template">
|
|
19
19
|
<paper-listbox slot="dropdown-content" class="dropdown-content" attr-for-selected="value" selected="view.html">
|
|
20
|
-
${this.templates.map(e=>
|
|
20
|
+
${this.templates.map(e=>o`<paper-item value="${e.name}">${e.title}</paper-item>`)}
|
|
21
21
|
</paper-listbox>
|
|
22
22
|
</paper-dropdown-menu>
|
|
23
23
|
</fieldset>
|
|
@@ -52,7 +52,7 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
52
52
|
<paper-dialog id="dialog">
|
|
53
53
|
<h2>${i("appgen.dialog.title")}</h2>
|
|
54
54
|
<div id="dialogContent">
|
|
55
|
-
${this.error?
|
|
55
|
+
${this.error?o`<div id="error">${this.error}</div>`:o`<a href="${this.url}" target="_blank">
|
|
56
56
|
<paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${i("appgen.open")}</paper-button>
|
|
57
57
|
</a>
|
|
58
58
|
<p>${i("appgen.success")}</p>`}
|
|
@@ -61,7 +61,7 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
61
61
|
<paper-button dialog-dismiss autofocus>${i("dialogs.close")}</paper-button>
|
|
62
62
|
</div>
|
|
63
63
|
</paper-dialog>
|
|
64
|
-
`}static get styles(){return
|
|
64
|
+
`}static get styles(){return a`
|
|
65
65
|
:host {
|
|
66
66
|
display: block;
|
|
67
67
|
}
|
|
@@ -107,4 +107,4 @@ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./p
|
|
|
107
107
|
display: block;
|
|
108
108
|
flex: 1 0;
|
|
109
109
|
}
|
|
110
|
-
`}}customElements.define("pb-edit-app",
|
|
110
|
+
`}}customElements.define("pb-edit-app",n);export{n as PbEditApp};
|
package/dist/pb-elements.json
CHANGED
|
@@ -3172,6 +3172,11 @@
|
|
|
3172
3172
|
"type": "string",
|
|
3173
3173
|
"default": "\"\""
|
|
3174
3174
|
},
|
|
3175
|
+
{
|
|
3176
|
+
"name": "disable-history",
|
|
3177
|
+
"type": "boolean",
|
|
3178
|
+
"default": "false"
|
|
3179
|
+
},
|
|
3175
3180
|
{
|
|
3176
3181
|
"name": "subscribe",
|
|
3177
3182
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -3236,6 +3241,12 @@
|
|
|
3236
3241
|
"type": "string",
|
|
3237
3242
|
"default": "\"\""
|
|
3238
3243
|
},
|
|
3244
|
+
{
|
|
3245
|
+
"name": "disableHistory",
|
|
3246
|
+
"attribute": "disable-history",
|
|
3247
|
+
"type": "boolean",
|
|
3248
|
+
"default": "false"
|
|
3249
|
+
},
|
|
3239
3250
|
{
|
|
3240
3251
|
"name": "subscribe",
|
|
3241
3252
|
"attribute": "subscribe",
|
|
@@ -4753,7 +4764,8 @@
|
|
|
4753
4764
|
{
|
|
4754
4765
|
"name": "panels",
|
|
4755
4766
|
"description": "an array of panel items to display when the component is loaded. It should contain a\nnumber for each panel to show, indicating the ordinal position of the template within the `<pb-panel>`\nto initialize. For example, if you have two templates in `<pb-panel>`: \"transcription\" and \"translation\",\nsetting `panels=\"[0, 1]\"` will show two columns, one with the transcription, the other with the translation.\n\nPassing in a browser parameter `panels` with a comma-separated list will set this property as well.",
|
|
4756
|
-
"type": "array"
|
|
4767
|
+
"type": "array",
|
|
4768
|
+
"default": "[]"
|
|
4757
4769
|
},
|
|
4758
4770
|
{
|
|
4759
4771
|
"name": "direction",
|
|
@@ -4809,7 +4821,8 @@
|
|
|
4809
4821
|
"name": "panels",
|
|
4810
4822
|
"attribute": "panels",
|
|
4811
4823
|
"description": "an array of panel items to display when the component is loaded. It should contain a\nnumber for each panel to show, indicating the ordinal position of the template within the `<pb-panel>`\nto initialize. For example, if you have two templates in `<pb-panel>`: \"transcription\" and \"translation\",\nsetting `panels=\"[0, 1]\"` will show two columns, one with the transcription, the other with the translation.\n\nPassing in a browser parameter `panels` with a comma-separated list will set this property as well.",
|
|
4812
|
-
"type": "array"
|
|
4824
|
+
"type": "array",
|
|
4825
|
+
"default": "[]"
|
|
4813
4826
|
},
|
|
4814
4827
|
{
|
|
4815
4828
|
"name": "direction",
|
|
@@ -7996,6 +8009,11 @@
|
|
|
7996
8009
|
"type": "string",
|
|
7997
8010
|
"default": "\".\""
|
|
7998
8011
|
},
|
|
8012
|
+
{
|
|
8013
|
+
"name": "url-path",
|
|
8014
|
+
"type": "string",
|
|
8015
|
+
"default": "\"path\""
|
|
8016
|
+
},
|
|
7999
8017
|
{
|
|
8000
8018
|
"name": "api-version",
|
|
8001
8019
|
"type": "string",
|
|
@@ -8092,6 +8110,12 @@
|
|
|
8092
8110
|
"type": "string",
|
|
8093
8111
|
"default": "\".\""
|
|
8094
8112
|
},
|
|
8113
|
+
{
|
|
8114
|
+
"name": "urlPath",
|
|
8115
|
+
"attribute": "url-path",
|
|
8116
|
+
"type": "string",
|
|
8117
|
+
"default": "\"path\""
|
|
8118
|
+
},
|
|
8095
8119
|
{
|
|
8096
8120
|
"name": "apiVersion",
|
|
8097
8121
|
"attribute": "api-version",
|
|
@@ -9202,6 +9226,11 @@
|
|
|
9202
9226
|
"name": "subforms",
|
|
9203
9227
|
"type": "string"
|
|
9204
9228
|
},
|
|
9229
|
+
{
|
|
9230
|
+
"name": "name",
|
|
9231
|
+
"type": "string",
|
|
9232
|
+
"default": "\"query\""
|
|
9233
|
+
},
|
|
9205
9234
|
{
|
|
9206
9235
|
"name": "value",
|
|
9207
9236
|
"type": "string",
|
|
@@ -9227,6 +9256,11 @@
|
|
|
9227
9256
|
"type": "boolean",
|
|
9228
9257
|
"default": "false"
|
|
9229
9258
|
},
|
|
9259
|
+
{
|
|
9260
|
+
"name": "start",
|
|
9261
|
+
"type": "number",
|
|
9262
|
+
"default": "1"
|
|
9263
|
+
},
|
|
9230
9264
|
{
|
|
9231
9265
|
"name": "subscribe",
|
|
9232
9266
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -9275,6 +9309,12 @@
|
|
|
9275
9309
|
"attribute": "subforms",
|
|
9276
9310
|
"type": "string"
|
|
9277
9311
|
},
|
|
9312
|
+
{
|
|
9313
|
+
"name": "name",
|
|
9314
|
+
"attribute": "name",
|
|
9315
|
+
"type": "string",
|
|
9316
|
+
"default": "\"query\""
|
|
9317
|
+
},
|
|
9278
9318
|
{
|
|
9279
9319
|
"name": "value",
|
|
9280
9320
|
"attribute": "value",
|
|
@@ -9305,6 +9345,12 @@
|
|
|
9305
9345
|
"type": "boolean",
|
|
9306
9346
|
"default": "false"
|
|
9307
9347
|
},
|
|
9348
|
+
{
|
|
9349
|
+
"name": "start",
|
|
9350
|
+
"attribute": "start",
|
|
9351
|
+
"type": "number",
|
|
9352
|
+
"default": "1"
|
|
9353
|
+
},
|
|
9308
9354
|
{
|
|
9309
9355
|
"name": "subscribe",
|
|
9310
9356
|
"attribute": "subscribe",
|
|
@@ -9385,7 +9431,7 @@
|
|
|
9385
9431
|
{
|
|
9386
9432
|
"name": "pb-select-feature",
|
|
9387
9433
|
"path": "./src/pb-select-feature.js",
|
|
9388
|
-
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side. \n\nThe list of states is passed as a JSON array to property `items`:\n\n# Server-side\n\nProperties to be passed to the server are specified as follows:\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"properties\": {\"mode\": \"diplomatic\", \"view\": \"page\"}},\n {\"name\": \"Normalized View\", \"properties\": {\"mode\": \"norm\", \"view\": \"single\"}}\n]\n```\n\n# Client-side\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": false},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Normalized View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Plain Reading View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true}, {\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\", \"state\": true}]}\n]\n```\n\nEach item in the `selectors` property above defines either a state or a command. *state* will simply add\na css class `.
|
|
9434
|
+
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side. \n\nThe list of states is passed as a JSON array to property `items`:\n\n# Server-side\n\nProperties to be passed to the server are specified as follows:\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"properties\": {\"mode\": \"diplomatic\", \"view\": \"page\"}},\n {\"name\": \"Normalized View\", \"properties\": {\"mode\": \"norm\", \"view\": \"single\"}}\n]\n```\n\n# Client-side\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": false},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Normalized View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Plain Reading View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true}, {\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\", \"state\": true}]}\n]\n```\n\nEach item in the `selectors` property above defines either a state or a command. *state* will simply add\na css class `.toggle` to the target element when true. If *command* is set to 'disable', it will entirely disable\nthe functionality of selected elements - provided that they are\npublisher components implementing the corresponding `command` method of `pb-mixin`.\n\nClient-side you may also pass an optional property `\"global\": true` to toggle the state of elements which reside\nin the surrounding HTML context below `pb-page` (means: elements which are not inside a `pb-view` or `pb-load`).",
|
|
9389
9435
|
"attributes": [
|
|
9390
9436
|
{
|
|
9391
9437
|
"name": "name",
|
|
@@ -9511,6 +9557,9 @@
|
|
|
9511
9557
|
{
|
|
9512
9558
|
"name": "pb-toggle",
|
|
9513
9559
|
"description": "Fired when a feature is selected from the dropdown and sends the selected properties"
|
|
9560
|
+
},
|
|
9561
|
+
{
|
|
9562
|
+
"name": "pb-global-toggle"
|
|
9514
9563
|
}
|
|
9515
9564
|
]
|
|
9516
9565
|
},
|
|
@@ -10363,7 +10412,7 @@
|
|
|
10363
10412
|
{
|
|
10364
10413
|
"name": "selected",
|
|
10365
10414
|
"type": "number",
|
|
10366
|
-
"default": "
|
|
10415
|
+
"default": "0"
|
|
10367
10416
|
},
|
|
10368
10417
|
{
|
|
10369
10418
|
"name": "subscribe",
|
|
@@ -10402,7 +10451,7 @@
|
|
|
10402
10451
|
"name": "selected",
|
|
10403
10452
|
"attribute": "selected",
|
|
10404
10453
|
"type": "number",
|
|
10405
|
-
"default": "
|
|
10454
|
+
"default": "0"
|
|
10406
10455
|
},
|
|
10407
10456
|
{
|
|
10408
10457
|
"name": "subscribe",
|
|
@@ -10733,16 +10782,6 @@
|
|
|
10733
10782
|
"description": "(optional) CSS selector: selects the elements to toggle client side (sets or unsets a \nCSS class `.toggled`). Setting this property will not trigger a reload as everything is\nhandled by javascript.",
|
|
10734
10783
|
"type": "string"
|
|
10735
10784
|
},
|
|
10736
|
-
{
|
|
10737
|
-
"name": "on",
|
|
10738
|
-
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10739
|
-
"type": "string"
|
|
10740
|
-
},
|
|
10741
|
-
{
|
|
10742
|
-
"name": "off",
|
|
10743
|
-
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10744
|
-
"type": "string"
|
|
10745
|
-
},
|
|
10746
10785
|
{
|
|
10747
10786
|
"name": "checked",
|
|
10748
10787
|
"type": "boolean"
|
|
@@ -10753,6 +10792,18 @@
|
|
|
10753
10792
|
"type": "string",
|
|
10754
10793
|
"default": "\"on\""
|
|
10755
10794
|
},
|
|
10795
|
+
{
|
|
10796
|
+
"name": "on",
|
|
10797
|
+
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10798
|
+
"type": "string",
|
|
10799
|
+
"default": "\"on\""
|
|
10800
|
+
},
|
|
10801
|
+
{
|
|
10802
|
+
"name": "off",
|
|
10803
|
+
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10804
|
+
"type": "string",
|
|
10805
|
+
"default": "\"off\""
|
|
10806
|
+
},
|
|
10756
10807
|
{
|
|
10757
10808
|
"name": "action",
|
|
10758
10809
|
"description": "In combination with a selector specifies the action to be taken, currently one of\n`toggle` (default) or `disable`.",
|
|
@@ -10822,18 +10873,6 @@
|
|
|
10822
10873
|
"description": "(optional) CSS selector: selects the elements to toggle client side (sets or unsets a \nCSS class `.toggled`). Setting this property will not trigger a reload as everything is\nhandled by javascript.",
|
|
10823
10874
|
"type": "string"
|
|
10824
10875
|
},
|
|
10825
|
-
{
|
|
10826
|
-
"name": "on",
|
|
10827
|
-
"attribute": "on",
|
|
10828
|
-
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10829
|
-
"type": "string"
|
|
10830
|
-
},
|
|
10831
|
-
{
|
|
10832
|
-
"name": "off",
|
|
10833
|
-
"attribute": "off",
|
|
10834
|
-
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10835
|
-
"type": "string"
|
|
10836
|
-
},
|
|
10837
10876
|
{
|
|
10838
10877
|
"name": "checked",
|
|
10839
10878
|
"attribute": "checked",
|
|
@@ -10846,6 +10885,20 @@
|
|
|
10846
10885
|
"type": "string",
|
|
10847
10886
|
"default": "\"on\""
|
|
10848
10887
|
},
|
|
10888
|
+
{
|
|
10889
|
+
"name": "on",
|
|
10890
|
+
"attribute": "on",
|
|
10891
|
+
"description": "Value to set the parameter to when the feature is enabled.",
|
|
10892
|
+
"type": "string",
|
|
10893
|
+
"default": "\"on\""
|
|
10894
|
+
},
|
|
10895
|
+
{
|
|
10896
|
+
"name": "off",
|
|
10897
|
+
"attribute": "off",
|
|
10898
|
+
"description": "Value to set the parameter to when the feature is disabled.",
|
|
10899
|
+
"type": "string",
|
|
10900
|
+
"default": "\"off\""
|
|
10901
|
+
},
|
|
10849
10902
|
{
|
|
10850
10903
|
"name": "action",
|
|
10851
10904
|
"attribute": "action",
|
|
@@ -10938,6 +10991,12 @@
|
|
|
10938
10991
|
"description": "a comma-separated list of file suffixes to accept for upload\n(by default: .xml,.tei,.odd,.docx)",
|
|
10939
10992
|
"type": "string"
|
|
10940
10993
|
},
|
|
10994
|
+
{
|
|
10995
|
+
"name": "event",
|
|
10996
|
+
"description": "the event to emit when the upload has completed (default: 'pb-load')",
|
|
10997
|
+
"type": "string",
|
|
10998
|
+
"default": "\"pb-load\""
|
|
10999
|
+
},
|
|
10941
11000
|
{
|
|
10942
11001
|
"name": "subscribe",
|
|
10943
11002
|
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
@@ -10983,6 +11042,13 @@
|
|
|
10983
11042
|
"description": "a comma-separated list of file suffixes to accept for upload\n(by default: .xml,.tei,.odd,.docx)",
|
|
10984
11043
|
"type": "string"
|
|
10985
11044
|
},
|
|
11045
|
+
{
|
|
11046
|
+
"name": "event",
|
|
11047
|
+
"attribute": "event",
|
|
11048
|
+
"description": "the event to emit when the upload has completed (default: 'pb-load')",
|
|
11049
|
+
"type": "string",
|
|
11050
|
+
"default": "\"pb-load\""
|
|
11051
|
+
},
|
|
10986
11052
|
{
|
|
10987
11053
|
"name": "subscribe",
|
|
10988
11054
|
"attribute": "subscribe",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as t,L as e,N as n,A as s}from"./pb-mixin-8a593923.js";const i=new Map;let a;function r(t){a=t}function o(t){return t instanceof n?t.startNode.isConnected:t instanceof s?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{o(t)||i.delete(t)})}function l(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t)}function d(t,e){const n=e();t.value!==n&&(t.setValue(n),t.commit())}function u(t){a=t.t,i.forEach((t,e)=>{o(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=t(t=>e=>{i.set(e,t),d(e,t)}),f=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class b extends e{static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},options:{type:Object},_translated:{type:String}})}constructor(){super(),this.key="missing-key",this.options=null,this._translated=null}connectedCallback(){super.connectedCallback(),this._fallback=this.innerHTML,document.addEventListener("pb-i18n-update",this._translate.bind(this)),this._translate()}_translate(){const t=p(this.key,this.options);t&&t!==this.key?this._translated=t:this._translated=null}render(){return this._translated?this._translated:this._fallback}createRenderRoot(){return this}}customElements.define("pb-i18n",b);export{p as g,r as i,f as t};
|
package/dist/pb-leaflet-map.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as t,p as e,r as i,h as s,c as a}from"./pb-mixin-
|
|
1
|
+
import{L as t,p as e,r as i,h as s,c as a}from"./pb-mixin-8a593923.js";import"./es-global-bridge-6abe3a88.js";const o=["type","url","label","base","show"];class r extends t{static get properties(){return{type:{type:String},url:{type:String},base:{type:Boolean},show:{type:Boolean},label:{type:String},attribution:{type:String},minZoom:{type:Number,attribute:"min-zoom"},maxZoom:{type:Number,attribute:"max-zoom"},zoomOffset:{type:Number,attribute:"zoom-offset"},opacity:{type:Number},tileSize:{type:Number},id:{type:String},accessToken:{type:String,attribute:"access-token"}}}constructor(){super(),this.type="tile",this.url=null}get options(){const t={};return Object.keys(r.properties).forEach(e=>{o.indexOf(e)<0&&this[e]&&(t[e]=this[e])}),console.log("<pb-leaflet-map-layer> Options: %o",t),t}async data(){return new Promise(t=>{fetch(this.url).then(t=>t.json()).then(e=>t(e))})}}function l(t,e){try{return t.split(/\s*,\s*/).map(t=>parseInt(t,10))}catch(e){return console.error("<pb-map-icon> Invalid size specified: "+t),null}}customElements.define("pb-map-layer",r);class n extends t{static get properties(){return{name:{type:String},iconUrl:{type:String,attribute:"icon-url"},iconSize:{type:Array,converter:l,attribute:"icon-size"},iconAnchor:{type:Array,converter:l,attribute:"icon-anchor"},shadowUrl:{type:String,attribute:"shadow-url"},shadowSize:{type:Array,converter:l,attribute:"shadow-size"},shadowAnchor:{type:Array,converter:l,attribute:"shadow-anchor"},popupAncor:{type:Array,converter:l,attribute:"popup-anchor"}}}constructor(){super(),this.name="default",this.type="image",this.iconUrl=null}get options(){const t={};return Object.keys(n.properties).forEach(e=>{this[e]&&(t[e]=this[e])}),console.log("<pb-map-icon> Options: %o",t),t}}customElements.define("pb-map-icon",n);class c extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{latitude:{type:Number},longitude:{type:Number},zoom:{type:Number},crs:{type:String},fitMarkers:{type:Boolean,attribute:"fit-markers"},cluster:{type:Boolean},disableClusteringAt:{type:Number,attribute:"disable-clustering-at"},noScroll:{type:Boolean,attribute:"no-scroll"},accessToken:{type:String,attribute:"access-token"},toggle:{type:Boolean},imagesPath:{type:String,attribute:"images-path"},cssPath:{type:String,attribute:"css-path"},_map:{type:Object}})}constructor(){super(),this.latitude=51.505,this.longitude=-.09,this.zoom=15,this.crs="EPSG3857",this.accessToken="",this.imagesPath="../images/leaflet/",this.cssPath="../css/leaflet",this.toggle=!1,this.noScroll=!1,this.disabled=!0,this.cluster=!1,this.fitMarkers=!1,this.disableClusteringAt=null,this._icons={}}connectedCallback(){super.connectedCallback(),this._layers=this.querySelectorAll("pb-map-layer"),this._markers=this.querySelectorAll("pb-map-icon"),this.subscribeTo("pb-update-map",t=>{this._markerLayer.clearLayers(),t.detail.forEach(t=>{const e=L.marker([t.latitude,t.longitude]);t.label&&e.bindTooltip(t.label),e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t)}),e.bindTooltip(t.label),this.setMarkerIcon(e),this._markerLayer.addLayer(e)}),this._fitBounds()}),this.subscribeTo("pb-update",t=>{this._markerLayer.clearLayers();t.detail.root.querySelectorAll("pb-geolocation").forEach(t=>{const e=L.latLng(t.latitude,t.longitude),i=L.marker(e).addTo(this._markerLayer);t.label&&i.bindTooltip(t.label),t.popup&&i.bindPopup(t.popup),i.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t)}),this.setMarkerIcon(i)}),this._fitBounds()}),this.subscribeTo("pb-geolocation",t=>{if(t.detail.coordinates){if(this.latitude=t.detail.coordinates.latitude,this.longitude=t.detail.coordinates.longitude,this._hasMarker(this.latitude,this.longitude))console.log("<pb-leaflet-map> Marker already added to map");else{const e=L.marker([this.latitude,this.longitude]);e.addEventListener("click",()=>{this.emitTo("pb-leaflet-marker-click",t.detail.element)}),t.detail.label&&e.bindTooltip(t.detail.label),t.detail.popup&&e.bindPopup(t.detail.popup),this.setMarkerIcon(e),e.addTo(this._markerLayer),t.detail.fitBounds&&this._fitBounds(),console.log("<pb-leaflet-map> added marker")}this.toggle&&(this.disabled=!1);const e=t.detail.event;this._locationChanged(this.latitude,this.longitude,t.detail.zoom,e)}})}get map(){return this._map}setMarkerIcon(t){this._icons&&this._icons.default&&t.setIcon(this._icons.default)}firstUpdated(){this.toggle||(this.disabled=!1),window.ESGlobalBridge.requestAvailability();const t=i("../lib/leaflet-src.js"),e=i("../lib/leaflet.markercluster-src.js");window.ESGlobalBridge.instance.load("leaflet",t).then(()=>window.ESGlobalBridge.instance.load("plugin",e)),window.addEventListener("es-bridge-plugin-loaded",this._initMap.bind(this),{once:!0})}render(){const t=i(this.cssPath);return s`
|
|
2
2
|
<link rel="Stylesheet" href="${t}/leaflet.css">
|
|
3
3
|
<link rel="Stylesheet" href="${t}/MarkerCluster.Default.css">
|
|
4
4
|
<div id="map" style="height: 100%; width: 100%"></div>
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
* This code may only be used under the BSD style license found at
|
|
5
|
+
* http://polymer.github.io/LICENSE.txt
|
|
6
|
+
* The complete set of authors may be found at
|
|
7
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
8
|
+
* The complete set of contributors may be found at
|
|
9
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
|
+
* Code distributed by Google as part of the polymer project is also
|
|
11
|
+
* subject to an additional IP rights grant found at
|
|
12
|
+
* http://polymer.github.io/PATENTS.txt
|
|
13
|
+
*/
|
|
14
|
+
const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,e=(t,e,s=null,i=null)=>{for(;e!==s;){const s=e.nextSibling;t.insertBefore(e,i),e=s}},s=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},i=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${i}--\x3e`,r=new RegExp(`${i}|${n}`),o="$lit$";class a{constructor(t,e){this.parts=[],this.element=e;const s=[],n=[],a=document.createTreeWalker(e.content,133,null,!1);let c=0,u=-1,p=0;const{strings:m,values:{length:_}}=t;for(;p<_;){const t=a.nextNode();if(null!==t){if(u++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:s}=e;let i=0;for(let t=0;t<s;t++)l(e[t].name,o)&&i++;for(;i-- >0;){const e=m[p],s=d.exec(e)[2],i=s.toLowerCase()+o,n=t.getAttribute(i);t.removeAttribute(i);const a=n.split(r);this.parts.push({type:"attribute",index:u,name:s,strings:a}),p+=a.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),a.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(i)>=0){const i=t.parentNode,n=e.split(r),a=n.length-1;for(let e=0;e<a;e++){let s,r=n[e];if(""===r)s=h();else{const t=d.exec(r);null!==t&&l(t[2],o)&&(r=r.slice(0,t.index)+t[1]+t[2].slice(0,-o.length)+t[3]),s=document.createTextNode(r)}i.insertBefore(s,t),this.parts.push({type:"node",index:++u})}""===n[a]?(i.insertBefore(h(),t),s.push(t)):t.data=n[a],p+=a}}else if(8===t.nodeType)if(t.data===i){const e=t.parentNode;null!==t.previousSibling&&u!==c||(u++,e.insertBefore(h(),t)),c=u,this.parts.push({type:"node",index:u}),null===t.nextSibling?t.data="":(s.push(t),u--),p++}else{let e=-1;for(;-1!==(e=t.data.indexOf(i,e+1));)this.parts.push({type:"node",index:-1}),p++}}else a.currentNode=n.pop()}for(const t of s)t.parentNode.removeChild(t)}}const l=(t,e)=>{const s=t.length-e.length;return s>=0&&t.slice(s)===e},c=t=>-1!==t.index,h=()=>document.createComment(""),d=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,u=133;function p(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,u,null,!1);let r=_(i),o=i[r],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==o&&o.index===a;)o.index=null!==h?-1:o.index-l,r=_(i,r),o=i[r]}c.forEach(t=>t.parentNode.removeChild(t))}const m=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,u,null,!1);for(;s.nextNode();)e++;return e},_=(t,e=-1)=>{for(let s=e+1;s<t.length;s++){const e=t[s];if(c(e))return s}return-1};function f(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,u,null,!1);let o=_(n),a=0,l=-1;for(;r.nextNode();){l++;for(r.currentNode===s&&(a=m(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=_(n,o);return}o=_(n,o)}}}
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
18
|
+
* This code may only be used under the BSD style license found at
|
|
19
|
+
* http://polymer.github.io/LICENSE.txt
|
|
20
|
+
* The complete set of authors may be found at
|
|
21
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
22
|
+
* The complete set of contributors may be found at
|
|
23
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
24
|
+
* Code distributed by Google as part of the polymer project is also
|
|
25
|
+
* subject to an additional IP rights grant found at
|
|
26
|
+
* http://polymer.github.io/PATENTS.txt
|
|
27
|
+
*/const y=new WeakMap,g=t=>(...e)=>{const s=t(...e);return y.set(s,!0),s},S=t=>"function"==typeof t&&y.has(t),b={},w={};
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
31
|
+
* This code may only be used under the BSD style license found at
|
|
32
|
+
* http://polymer.github.io/LICENSE.txt
|
|
33
|
+
* The complete set of authors may be found at
|
|
34
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
35
|
+
* The complete set of contributors may be found at
|
|
36
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
37
|
+
* Code distributed by Google as part of the polymer project is also
|
|
38
|
+
* subject to an additional IP rights grant found at
|
|
39
|
+
* http://polymer.github.io/PATENTS.txt
|
|
40
|
+
*/
|
|
41
|
+
class v{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this.__parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),s=[],i=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let r,o=0,a=0,l=n.nextNode();for(;o<i.length;)if(r=i[o],c(r)){for(;a<r.index;)a++,"TEMPLATE"===l.nodeName&&(s.push(l),n.currentNode=l.content),null===(l=n.nextNode())&&(n.currentNode=s.pop(),l=n.nextNode());if("node"===r.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(l.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,r.name,r.strings,this.options));o++}else this.__parts.push(void 0),o++;return t&&(document.adoptNode(e),customElements.upgrade(e)),e}}
|
|
42
|
+
/**
|
|
43
|
+
* @license
|
|
44
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
45
|
+
* This code may only be used under the BSD style license found at
|
|
46
|
+
* http://polymer.github.io/LICENSE.txt
|
|
47
|
+
* The complete set of authors may be found at
|
|
48
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
49
|
+
* The complete set of contributors may be found at
|
|
50
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
51
|
+
* Code distributed by Google as part of the polymer project is also
|
|
52
|
+
* subject to an additional IP rights grant found at
|
|
53
|
+
* http://polymer.github.io/PATENTS.txt
|
|
54
|
+
*/const P=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),x=` ${i} `;class C{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let r=0;r<t;r++){const t=this.strings[r],a=t.lastIndexOf("\x3c!--");s=(a>-1||s)&&-1===t.indexOf("--\x3e",a+1);const l=d.exec(t);e+=null===l?t+(s?x:n):t.substr(0,l.index)+l[1]+l[2]+o+l[3]+i}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==P&&(e=P.createHTML(e)),t.innerHTML=e,t}}
|
|
55
|
+
/**
|
|
56
|
+
* @license
|
|
57
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
58
|
+
* This code may only be used under the BSD style license found at
|
|
59
|
+
* http://polymer.github.io/LICENSE.txt
|
|
60
|
+
* The complete set of authors may be found at
|
|
61
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
62
|
+
* The complete set of contributors may be found at
|
|
63
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
64
|
+
* Code distributed by Google as part of the polymer project is also
|
|
65
|
+
* subject to an additional IP rights grant found at
|
|
66
|
+
* http://polymer.github.io/PATENTS.txt
|
|
67
|
+
*/const N=t=>null===t||!("object"==typeof t||"function"==typeof t),T=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class E{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new A(this)}_getValue(){const t=this.strings,e=t.length-1,s=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=s[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!T(t))return t}let i="";for(let n=0;n<e;n++){i+=t[n];const e=s[n];if(void 0!==e){const t=e.value;if(N(t)||!T(t))i+="string"==typeof t?t:String(t);else for(const e of t)i+="string"==typeof e?e:String(e)}}return i+=t[e],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class A{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===b||N(t)&&t===this.value||(this.value=t,S(t)||(this.committer.dirty=!0))}commit(){for(;S(this.value);){const t=this.value;this.value=b,t(this)}this.value!==b&&this.committer.commit()}}class V{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(h()),this.endNode=t.appendChild(h())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=h()),t.__insert(this.endNode=h())}insertAfterPart(t){t.__insert(this.startNode=h()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;S(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}const t=this.__pendingValue;t!==b&&(N(t)?t!==this.value&&this.__commitText(t):t instanceof C?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):T(t)?this.__commitIterable(t):t===w?(this.value=w,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,s="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=s:this.__commitNode(document.createTextNode(s)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof v&&this.value.template===e)this.value.update(t.values);else{const s=new v(e,t.processor,this.options),i=s._clone();s.update(t.values),this.__commitNode(i),this.value=s}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)s=e[i],void 0===s&&(s=new V(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){s(this.startNode.parentNode,t.nextSibling,this.endNode)}}class U{constructor(t,e,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this.__pendingValue=t}commit(){for(;S(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=b}}class O extends E{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new R(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class R extends A{}let k=!1;(()=>{try{const t={get capture(){return k=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class L{constructor(t,e,s){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;S(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=M(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const M=t=>t&&(k?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
|
|
68
|
+
/**
|
|
69
|
+
* @license
|
|
70
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
71
|
+
* This code may only be used under the BSD style license found at
|
|
72
|
+
* http://polymer.github.io/LICENSE.txt
|
|
73
|
+
* The complete set of authors may be found at
|
|
74
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
75
|
+
* The complete set of contributors may be found at
|
|
76
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
77
|
+
* Code distributed by Google as part of the polymer project is also
|
|
78
|
+
* subject to an additional IP rights grant found at
|
|
79
|
+
* http://polymer.github.io/PATENTS.txt
|
|
80
|
+
*/;function j(t){let e=I.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},I.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const n=t.strings.join(i);return s=e.keyString.get(n),void 0===s&&(s=new a(t,t.getTemplateElement()),e.keyString.set(n,s)),e.stringsArray.set(t.strings,s),s}const I=new Map,q=new WeakMap,F=(t,e,i)=>{let n=q.get(e);void 0===n&&(s(e,e.firstChild),q.set(e,n=new V(Object.assign({templateFactory:j},i))),n.appendInto(e)),n.setValue(t),n.commit()};
|
|
81
|
+
/**
|
|
82
|
+
* @license
|
|
83
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
84
|
+
* This code may only be used under the BSD style license found at
|
|
85
|
+
* http://polymer.github.io/LICENSE.txt
|
|
86
|
+
* The complete set of authors may be found at
|
|
87
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
88
|
+
* The complete set of contributors may be found at
|
|
89
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
90
|
+
* Code distributed by Google as part of the polymer project is also
|
|
91
|
+
* subject to an additional IP rights grant found at
|
|
92
|
+
* http://polymer.github.io/PATENTS.txt
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
97
|
+
* This code may only be used under the BSD style license found at
|
|
98
|
+
* http://polymer.github.io/LICENSE.txt
|
|
99
|
+
* The complete set of authors may be found at
|
|
100
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
101
|
+
* The complete set of contributors may be found at
|
|
102
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
103
|
+
* Code distributed by Google as part of the polymer project is also
|
|
104
|
+
* subject to an additional IP rights grant found at
|
|
105
|
+
* http://polymer.github.io/PATENTS.txt
|
|
106
|
+
*/
|
|
107
|
+
class B{handleAttributeExpressions(t,e,s,i){const n=e[0];if("."===n){return new O(t,e.slice(1),s).parts}if("@"===n)return[new L(t,e.slice(1),i.eventContext)];if("?"===n)return[new U(t,e.slice(1),s)];return new E(t,e,s).parts}handleTextExpression(t){return new V(t)}}const H=new B;
|
|
108
|
+
/**
|
|
109
|
+
* @license
|
|
110
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
111
|
+
* This code may only be used under the BSD style license found at
|
|
112
|
+
* http://polymer.github.io/LICENSE.txt
|
|
113
|
+
* The complete set of authors may be found at
|
|
114
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
115
|
+
* The complete set of contributors may be found at
|
|
116
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
117
|
+
* Code distributed by Google as part of the polymer project is also
|
|
118
|
+
* subject to an additional IP rights grant found at
|
|
119
|
+
* http://polymer.github.io/PATENTS.txt
|
|
120
|
+
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const $=(t,...e)=>new C(t,e,"html",H)
|
|
121
|
+
/**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
124
|
+
* This code may only be used under the BSD style license found at
|
|
125
|
+
* http://polymer.github.io/LICENSE.txt
|
|
126
|
+
* The complete set of authors may be found at
|
|
127
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
128
|
+
* The complete set of contributors may be found at
|
|
129
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
130
|
+
* Code distributed by Google as part of the polymer project is also
|
|
131
|
+
* subject to an additional IP rights grant found at
|
|
132
|
+
* http://polymer.github.io/PATENTS.txt
|
|
133
|
+
*/,z=(t,e)=>`${t}--${e}`;let W=!0;void 0===window.ShadyCSS?W=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),W=!1);const J=t=>e=>{const s=z(e.type,t);let n=I.get(s);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},I.set(s,n));let r=n.stringsArray.get(e.strings);if(void 0!==r)return r;const o=e.strings.join(i);if(r=n.keyString.get(o),void 0===r){const s=e.getTemplateElement();W&&window.ShadyCSS.prepareTemplateDom(s,t),r=new a(e,s),n.keyString.set(o,r)}return n.stringsArray.set(e.strings,r),r},D=["html","svg"],Z=t=>{D.forEach(e=>{const s=I.get(z(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),p(t,s)})})},G=new Set,K=(t,e,s)=>{G.add(t);const i=s?s.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:r}=n;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(i,t);const o=document.createElement("style");for(let t=0;t<r;t++){const e=n[t];e.parentNode.removeChild(e),o.textContent+=e.textContent}Z(t);const a=i.content;s?f(s,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(s){a.insertBefore(o,a.firstChild);const t=new Set;t.add(o),p(s,t)}},Q=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=q.has(e),o=W&&11===e.nodeType&&!!e.host,a=o&&!G.has(n),l=a?document.createDocumentFragment():e;if(F(t,l,Object.assign({templateFactory:J(n)},i)),a){const t=q.get(l);q.delete(l);const i=t.value instanceof v?t.value.template:void 0;K(n,l,i),s(e,e.firstChild),e.appendChild(l),q.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)};window.JSCompiler_renameProperty=(t,e)=>t;const X={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Y=(t,e)=>e!==t&&(e==e||t==t),tt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:Y},et=1,st=4,it=8,nt=16,rt="finalized";class ot extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=tt){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdateInternal(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||tt}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(rt)||t.finalize(),this[rt]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=Y){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||X,n="function"==typeof i?i:i.fromAttribute;return n?n(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||X.toAttribute)(t,s)}initialize(){this._updateState=0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=tt){const i=this.constructor,n=i._attributeNameForProperty(t,s);if(void 0!==n){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=this._updateState|it,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=this._updateState&~it}}_attributeToProperty(t,e){if(this._updateState&it)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s.getPropertyOptions(i);this._updateState=this._updateState|nt,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~nt}}requestUpdateInternal(t,e,s){let i=!0;if(void 0!==t){const n=this.constructor;s=s||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,s.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==s.reflect||this._updateState&nt||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|st;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&st}get hasUpdated(){return this._updateState&et}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(this._updateState&et||(this._updateState=this._updateState|et,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~st}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}ot[rt]=!0;
|
|
134
|
+
/**
|
|
135
|
+
@license
|
|
136
|
+
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
|
137
|
+
This code may only be used under the BSD style license found at
|
|
138
|
+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
139
|
+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
140
|
+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
141
|
+
part of the polymer project is also subject to an additional IP rights grant
|
|
142
|
+
found at http://polymer.github.io/PATENTS.txt
|
|
143
|
+
*/
|
|
144
|
+
const at=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lt=Symbol();class ct{constructor(t,e){if(e!==lt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(at?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ht=t=>new ct(String(t),lt),dt=t=>{if(t instanceof ct)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)},ut=(t,...e)=>{const s=e.reduce((e,s,i)=>e+dt(s)+t[i+1],t[0]);return new ct(s,lt)};
|
|
145
|
+
/**
|
|
146
|
+
* @license
|
|
147
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
148
|
+
* This code may only be used under the BSD style license found at
|
|
149
|
+
* http://polymer.github.io/LICENSE.txt
|
|
150
|
+
* The complete set of authors may be found at
|
|
151
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
152
|
+
* The complete set of contributors may be found at
|
|
153
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
154
|
+
* Code distributed by Google as part of the polymer project is also
|
|
155
|
+
* subject to an additional IP rights grant found at
|
|
156
|
+
* http://polymer.github.io/PATENTS.txt
|
|
157
|
+
*/
|
|
158
|
+
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const pt={};class mt extends ot{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,s)=>t.reduceRight((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t),s),s=e(t,new Set),i=[];s.forEach(t=>i.unshift(t)),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!at){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return ht(e)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?at?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==pt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return pt}}function _t(t){const e=document.querySelector("script[src*=pb-components]");return e?new URL(t,e.src).href:new URL(t,window.location.href).href}function ft(t,e){var s,i,n;for(t=(t+"").split("."),e=(e+"").split("."),n=Math.max(t.length,e.length),s=0;s<n;s++)if(void 0===t[s]&&(t[s]="0"),void 0===e[s]&&(e[s]="0"),0!==(i=parseInt(t[s],10)-parseInt(e[s],10)))return i<0?-1:1;return 0}function yt(t,e){return ft(t,e)>=0}function gt(t,e,s){const i=getComputedStyle(t).getPropertyValue(e);if(i)try{return JSON.parse(i)}catch(t){return s}return s}mt.finalized=!0,mt.render=Q,mt.shadowRootOptions={mode:"open"},window.TeiPublisher||(window.TeiPublisher={},TeiPublisher.url=new URL(window.location.href));const St=new Set,bt=new Map,wt="__default__";function vt(){bt.clear()}function Pt(t,e){bt.has(t)?e(bt.get(t)):document.addEventListener(t,s=>{bt.set(t,s.detail),e(s.detail)},{once:!0})}function xt(t){const e=t.getAttribute("emit-config");if(e){const t=JSON.parse(e);return Object.keys(t)}const s=t.getAttribute("emit");return s?[s]:[wt]}function Ct(t){const e=t.getAttribute("subscribe-config");if(e){const t=JSON.parse(e);return Object.keys(t)}const s=t.getAttribute("subscribe");return s?[s]:[wt]}const Nt=t=>class extends t{static get properties(){return{subscribe:{type:String},subscribeConfig:{type:Object,attribute:"subscribe-config"},emit:{type:String},emitConfig:{type:Object,attribute:"emit-config"},waitFor:{type:String,attribute:"wait-for"},_isReady:{type:Boolean},disabled:{type:Boolean,reflect:!0},_endpoint:{type:String},_apiVersion:{type:String}}}constructor(){super(),this._isReady=!1,this.disabled=!1,this._subscriptions=new Map}connectedCallback(){super.connectedCallback(),Pt("pb-page-ready",t=>{this._endpoint=t.endpoint,this._apiVersion=t.apiVersion})}disconnectedCallback(){super.disconnectedCallback(),this._subscriptions.forEach((t,e)=>{t.forEach(t=>{document.removeEventListener(e,t)})})}command(t,e){"disable"===t&&(this.disabled=e)}wait(t){if(!this.waitFor)return void t();const e=Array.from(document.querySelectorAll(this.waitFor)).filter(t=>this.emitsOnSameChannel(t)),s=e.length;if(0===s)return void t();let i=s;e.forEach(e=>{if(e._isReady)return i-=1,void(0===i&&t());const s=e.addEventListener("pb-ready",n=>{n.detail.source!==this&&(i-=1,0===i&&(e.removeEventListener("pb-ready",s),t()))})})}waitForChannel(t){if(this.subscribeConfig)for(const e in this.subscribeConfig)this.subscribeConfig[e].forEach(s=>{if("pb-ready"===s&&St.has(e))return t()});else if(this.subscribe&&St.has(this.subscribe)||!this.subscribe&&St.has("__default__"))return t();const e=this.subscribeTo("pb-ready",s=>{s.detail._source!=this&&(e.forEach(t=>document.removeEventListener("pb-ready",t)),t())})}static waitOnce(t,e){Pt(t,e)}signalReady(t="pb-ready",e){this._isReady=!0,bt.set(t,e),this.dispatchEvent(new CustomEvent(t,{detail:{data:e,source:this}})),this.emitTo(t,e)}emitsOnSameChannel(t){const e=Ct(this),s=xt(t);return 0===e.length&&0===s.length||e.some(t=>s.includes(t))}subscribeTo(t,e,s=[]){const i=(s&&s.length?s:Ct(this)).map(s=>{const i=t=>{t.detail&&t.detail.key&&t.detail.key===s&&e(t)};return document.addEventListener(t,i),i});return this._subscriptions.set(t,i),i}emitTo(t,e,s=[]){(s&&s.length?s:xt(this)).forEach(s=>this._emit(s,t,e))}_emit(t,e,s){"pb-ready"===e&&St.add(t);const i=Object.assign({key:t,_source:this},s),n=new CustomEvent(e,{detail:i,composed:!0,bubbles:!0});this.dispatchEvent(n)}getDocument(){if(this.src){const t=document.getElementById(this.src);if(t)return t}return null}getParameter(t,e){const s=TeiPublisher.url.searchParams&&TeiPublisher.url.searchParams.getAll(t);return s&&1==s.length?s[0]:s&&s.length>1?s:e}getParameters(){const t={};for(let e of TeiPublisher.url.searchParams.keys())t[e]=this.getParameter(e);return t}getUrl(){return TeiPublisher.url}getEndpoint(){return this._endpoint}toAbsoluteURL(t,e){if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t))return t;const s=e||this.getEndpoint();let i;return i="."===s?new URL(window.location.href):"about:"===window.location.protocol?document.baseURI:new URL(s+"/",`${window.location.protocol}//${window.location.host}`),new URL(t,i).href}minApiVersion(t){return ft(this._apiVersion,t)>=0}lessThanApiVersion(t){return ft(this._apiVersion,t)<0}compareApiVersion(t){return ft(this._apiVersion,t)}};export{A,mt as L,V as N,Ct as a,ft as b,ut as c,wt as d,vt as e,g as f,gt as g,$ as h,N as i,h as j,e as k,s as l,yt as m,Nt as p,_t as r,Pt as w};
|