@teipublisher/pb-components 1.28.2 → 1.30.2
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 +33 -0
- package/dist/demo/demos.json +2 -1
- package/dist/demo/pb-view3.html +90 -0
- package/dist/pb-components-bundle.js +106 -106
- package/dist/pb-elements.json +22 -0
- package/dist/pb-odd-editor.js +29 -19
- package/i18n/common/de.json +3 -1
- package/i18n/common/en.json +2 -1
- package/package.json +1 -1
- package/pb-elements.json +22 -0
- package/src/pb-odd-model-editor.js +26 -15
- package/src/pb-odd-parameter-editor.js +1 -1
- package/src/pb-view-annotate.js +21 -11
- package/src/pb-view.js +28 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as t,P as e,h as
|
|
1
|
+
import{d as t,P as e,h as n,a as i,t as r,i as o,g as a,I as s,b as l,c,e as h,f as p,j as d,k as u,l as g,D as f,m,n as v,G as b,o as y,p as _,r as w,N as x,q as k,s as z,u as A,v as S,w as C}from"./paper-checkbox-ea000977.js";import{u as E,p as M,P as L,E as H,T}from"./pb-message-a461d7ee.js";import{L as V,h as $,r as O,c as P,p as R,a as I,b as N,m as F}from"./pb-mixin-ae9e2885.js";import"./iron-form-ee64c98d.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -8,7 +8,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
|
8
8
|
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
9
9
|
part of the polymer project is also subject to an additional IP rights grant
|
|
10
10
|
found at http://polymer.github.io/PATENTS.txt
|
|
11
|
-
*/const B={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(e,
|
|
11
|
+
*/const B={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(e,n){if(this._oldScrollTarget&&(this._toggleScrollListener(!1,this._oldScrollTarget),this._oldScrollTarget=null),n)if("document"===e)this.scrollTarget=this._doc;else if("string"==typeof e){var i=this.domHost;this.scrollTarget=i&&i.$?i.$[e]:t(this.ownerDocument).querySelector("#"+e)}else this._isValidScrollTarget()&&(this._oldScrollTarget=e,this._toggleScrollListener(this._shouldHaveListener,e))},_scrollHandler:function(){},get _defaultScrollTarget(){return this._doc},get _doc(){return this.ownerDocument.documentElement},get _scrollTop(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageYOffset:this.scrollTarget.scrollTop:0},get _scrollLeft(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageXOffset:this.scrollTarget.scrollLeft:0},set _scrollTop(t){this.scrollTarget===this._doc?window.scrollTo(window.pageXOffset,t):this._isValidScrollTarget()&&(this.scrollTarget.scrollTop=t)},set _scrollLeft(t){this.scrollTarget===this._doc?window.scrollTo(t,window.pageYOffset):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=t)},scroll:function(t,e){var n;"object"==typeof t?(n=t.left,e=t.top):n=t,n=n||0,e=e||0,this.scrollTarget===this._doc?window.scrollTo(n,e):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=n,this.scrollTarget.scrollTop=e)},get _scrollTargetWidth(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerWidth:this.scrollTarget.offsetWidth:0},get _scrollTargetHeight(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerHeight:this.scrollTarget.offsetHeight:0},_isValidScrollTarget:function(){return this.scrollTarget instanceof HTMLElement},_toggleScrollListener:function(t,e){var n=e===this._doc?window:e;t?this._boundScrollHandler||(this._boundScrollHandler=this._scrollHandler.bind(this),n.addEventListener("scroll",this._boundScrollHandler)):this._boundScrollHandler&&(n.removeEventListener("scroll",this._boundScrollHandler),this._boundScrollHandler=null)},toggleScrollListener:function(t){this._shouldHaveListener=t,this._toggleScrollListener(t,this.scrollTarget)}},D={},j=function(t,e){if(null!=D[t])throw new Error("effect `"+t+"` is already registered.");D[t]=e},q=[B,{properties:{effects:{type:String},effectsConfig:{type:Object,value:function(){return{}}},disabled:{type:Boolean,reflectToAttribute:!0,value:!1},threshold:{type:Number,value:0},thresholdTriggered:{type:Boolean,notify:!0,readOnly:!0,reflectToAttribute:!0}},observers:["_effectsChanged(effects, effectsConfig, isAttached)"],_updateScrollState:function(t){},isOnScreen:function(){return!1},isContentBelow:function(){return!1},_effectsRunFn:null,_effects:null,get _clampedScrollTop(){return Math.max(0,this._scrollTop)},attached:function(){this._scrollStateChanged()},detached:function(){this._tearDownEffects()},createEffect:function(t,e){var n=D[t];if(!n)throw new ReferenceError(this._getUndefinedMsg(t));var i=this._boundEffect(n,e||{});return i.setUp(),i},_effectsChanged:function(t,e,n){this._tearDownEffects(),t&&n&&(t.split(" ").forEach((function(t){var n;""!==t&&((n=D[t])?this._effects.push(this._boundEffect(n,e[t])):console.warn(this._getUndefinedMsg(t)))}),this),this._setUpEffect())},_layoutIfDirty:function(){return this.offsetWidth},_boundEffect:function(t,e){e=e||{};var n=parseFloat(e.startsAt||0),i=parseFloat(e.endsAt||1),r=i-n,o=function(){},a=0===n&&1===i?t.run:function(e,i){t.run.call(this,Math.max(0,(e-n)/r),i)};return{setUp:t.setUp?t.setUp.bind(this,e):o,run:t.run?a.bind(this):o,tearDown:t.tearDown?t.tearDown.bind(this):o}},_setUpEffect:function(){this.isAttached&&this._effects&&(this._effectsRunFn=[],this._effects.forEach((function(t){!1!==t.setUp()&&this._effectsRunFn.push(t.run)}),this))},_tearDownEffects:function(){this._effects&&this._effects.forEach((function(t){t.tearDown()})),this._effectsRunFn=[],this._effects=[]},_runEffects:function(t,e){this._effectsRunFn&&this._effectsRunFn.forEach((function(n){n(t,e)}))},_scrollHandler:function(){this._scrollStateChanged()},_scrollStateChanged:function(){if(!this.disabled){var t=this._clampedScrollTop;this._updateScrollState(t),this.threshold>0&&this._setThresholdTriggered(t>=this.threshold)}},_getDOMRef:function(t){console.warn("_getDOMRef","`"+t+"` is undefined")},_getUndefinedMsg:function(t){return"Scroll effect `"+t+"` is undefined. Did you forget to import app-layout/app-scroll-effects/effects/"+t+".html ?"}}];
|
|
12
12
|
/**
|
|
13
13
|
@license
|
|
14
14
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -29,7 +29,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
29
29
|
part of the polymer project is also subject to an additional IP rights grant
|
|
30
30
|
found at http://polymer.github.io/PATENTS.txt
|
|
31
31
|
*/
|
|
32
|
-
function U(t,e,i
|
|
32
|
+
function U(t,e,n,i){n.apply(i,e.map((function(e){return e[0]+(e[1]-e[0])*t})))}
|
|
33
33
|
/**
|
|
34
34
|
@license
|
|
35
35
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -40,7 +40,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
40
40
|
part of the polymer project is also subject to an additional IP rights grant
|
|
41
41
|
found at http://polymer.github.io/PATENTS.txt
|
|
42
42
|
*/
|
|
43
|
-
j("blend-background",{setUp:function(){var t={};t.backgroundFrontLayer=this._getDOMRef("backgroundFrontLayer"),t.backgroundRearLayer=this._getDOMRef("backgroundRearLayer"),t.backgroundFrontLayer.style.willChange="opacity",t.backgroundFrontLayer.style.transform="translateZ(0)",t.backgroundRearLayer.style.willChange="opacity",t.backgroundRearLayer.style.transform="translateZ(0)",t.backgroundRearLayer.style.opacity=0,this._fxBlendBackground=t},run:function(t,e){var
|
|
43
|
+
j("blend-background",{setUp:function(){var t={};t.backgroundFrontLayer=this._getDOMRef("backgroundFrontLayer"),t.backgroundRearLayer=this._getDOMRef("backgroundRearLayer"),t.backgroundFrontLayer.style.willChange="opacity",t.backgroundFrontLayer.style.transform="translateZ(0)",t.backgroundRearLayer.style.willChange="opacity",t.backgroundRearLayer.style.transform="translateZ(0)",t.backgroundRearLayer.style.opacity=0,this._fxBlendBackground=t},run:function(t,e){var n=this._fxBlendBackground;n.backgroundFrontLayer.style.opacity=1-t,n.backgroundRearLayer.style.opacity=t},tearDown:function(){delete this._fxBlendBackground}}),
|
|
44
44
|
/**
|
|
45
45
|
@license
|
|
46
46
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -51,7 +51,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
51
51
|
part of the polymer project is also subject to an additional IP rights grant
|
|
52
52
|
found at http://polymer.github.io/PATENTS.txt
|
|
53
53
|
*/
|
|
54
|
-
j("fade-background",{setUp:function(t){var e={},
|
|
54
|
+
j("fade-background",{setUp:function(t){var e={},n=t.duration||"0.5s";e.backgroundFrontLayer=this._getDOMRef("backgroundFrontLayer"),e.backgroundRearLayer=this._getDOMRef("backgroundRearLayer"),e.backgroundFrontLayer.style.willChange="opacity",e.backgroundFrontLayer.style.webkitTransform="translateZ(0)",e.backgroundFrontLayer.style.transitionProperty="opacity",e.backgroundFrontLayer.style.transitionDuration=n,e.backgroundRearLayer.style.willChange="opacity",e.backgroundRearLayer.style.webkitTransform="translateZ(0)",e.backgroundRearLayer.style.transitionProperty="opacity",e.backgroundRearLayer.style.transitionDuration=n,this._fxFadeBackground=e},run:function(t,e){var n=this._fxFadeBackground;t>=1?(n.backgroundFrontLayer.style.opacity=0,n.backgroundRearLayer.style.opacity=1):(n.backgroundFrontLayer.style.opacity=1,n.backgroundRearLayer.style.opacity=0)},tearDown:function(){delete this._fxFadeBackground}}),
|
|
55
55
|
/**
|
|
56
56
|
@license
|
|
57
57
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -62,7 +62,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
62
62
|
part of the polymer project is also subject to an additional IP rights grant
|
|
63
63
|
found at http://polymer.github.io/PATENTS.txt
|
|
64
64
|
*/
|
|
65
|
-
j("waterfall",{run:function(){this.shadow=this.isOnScreen()&&this.isContentBelow()}}),j("resize-title",{setUp:function(){var t=this._getDOMRef("mainTitle"),e=this._getDOMRef("condensedTitle");if(!e)return console.warn("Scroll effect `resize-title`: undefined `condensed-title`"),!1;if(!t)return console.warn("Scroll effect `resize-title`: undefined `main-title`"),!1;e.style.willChange="opacity",e.style.webkitTransform="translateZ(0)",e.style.transform="translateZ(0)",e.style.webkitTransformOrigin="left top",e.style.transformOrigin="left top",t.style.willChange="opacity",t.style.webkitTransformOrigin="left top",t.style.transformOrigin="left top",t.style.webkitTransform="translateZ(0)",t.style.transform="translateZ(0)";var
|
|
65
|
+
j("waterfall",{run:function(){this.shadow=this.isOnScreen()&&this.isContentBelow()}}),j("resize-title",{setUp:function(){var t=this._getDOMRef("mainTitle"),e=this._getDOMRef("condensedTitle");if(!e)return console.warn("Scroll effect `resize-title`: undefined `condensed-title`"),!1;if(!t)return console.warn("Scroll effect `resize-title`: undefined `main-title`"),!1;e.style.willChange="opacity",e.style.webkitTransform="translateZ(0)",e.style.transform="translateZ(0)",e.style.webkitTransformOrigin="left top",e.style.transformOrigin="left top",t.style.willChange="opacity",t.style.webkitTransformOrigin="left top",t.style.transformOrigin="left top",t.style.webkitTransform="translateZ(0)",t.style.transform="translateZ(0)";var n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r={};r.scale=parseInt(window.getComputedStyle(e)["font-size"],10)/parseInt(window.getComputedStyle(t)["font-size"],10),r.titleDX=n.left-i.left,r.titleDY=n.top-i.top,r.condensedTitle=e,r.title=t,this._fxResizeTitle=r},run:function(t,e){var n=this._fxResizeTitle;this.condenses||(e=0),t>=1?(n.title.style.opacity=0,n.condensedTitle.style.opacity=1):(n.title.style.opacity=1,n.condensedTitle.style.opacity=0),U(Math.min(1,t),[[1,n.scale],[0,-n.titleDX],[e,e-n.titleDY]],(function(t,e,i){this.transform("translate("+e+"px, "+i+"px) scale3d("+t+", "+t+", 1)",n.title)}),this)},tearDown:function(){delete this._fxResizeTitle}}),
|
|
66
66
|
/**
|
|
67
67
|
@license
|
|
68
68
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -73,7 +73,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
73
73
|
part of the polymer project is also subject to an additional IP rights grant
|
|
74
74
|
found at http://polymer.github.io/PATENTS.txt
|
|
75
75
|
*/
|
|
76
|
-
j("parallax-background",{setUp:function(t){var e={},
|
|
76
|
+
j("parallax-background",{setUp:function(t){var e={},n=parseFloat(t.scalar);e.background=this._getDOMRef("background"),e.backgroundFrontLayer=this._getDOMRef("backgroundFrontLayer"),e.backgroundRearLayer=this._getDOMRef("backgroundRearLayer"),e.deltaBg=e.backgroundFrontLayer.offsetHeight-e.background.offsetHeight,0===e.deltaBg?(isNaN(n)&&(n=.8),e.deltaBg=(this._dHeight||0)*n):(isNaN(n)&&(n=1),e.deltaBg=e.deltaBg*n),this._fxParallaxBackground=e},run:function(t,e){var n=this._fxParallaxBackground;this.transform("translate3d(0px, "+n.deltaBg*Math.min(1,t)+"px, 0px)",n.backgroundFrontLayer),n.backgroundRearLayer&&this.transform("translate3d(0px, "+n.deltaBg*Math.min(1,t)+"px, 0px)",n.backgroundRearLayer)},tearDown:function(){delete this._fxParallaxBackground}}),
|
|
77
77
|
/**
|
|
78
78
|
@license
|
|
79
79
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -95,7 +95,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
95
95
|
part of the polymer project is also subject to an additional IP rights grant
|
|
96
96
|
found at http://polymer.github.io/PATENTS.txt
|
|
97
97
|
*/
|
|
98
|
-
j("resize-snapped-title",{setUp:function(t){var e=this._getDOMRef("mainTitle"),
|
|
98
|
+
j("resize-snapped-title",{setUp:function(t){var e=this._getDOMRef("mainTitle"),n=this._getDOMRef("condensedTitle"),i=t.duration||"0.2s",r={};return n?e?(e.style.transitionProperty="opacity",e.style.transitionDuration=i,n.style.transitionProperty="opacity",n.style.transitionDuration=i,r.condensedTitle=n,r.title=e,void(this._fxResizeSnappedTitle=r)):(console.warn("Scroll effect `resize-snapped-title`: undefined `main-title`"),!1):(console.warn("Scroll effect `resize-snapped-title`: undefined `condensed-title`"),!1)},run:function(t,e){var n=this._fxResizeSnappedTitle;t>0?(n.title.style.opacity=0,n.condensedTitle.style.opacity=1):(n.title.style.opacity=1,n.condensedTitle.style.opacity=0)},tearDown:function(){var t=this._fxResizeSnappedTitle;t.title.style.transition="",t.condensedTitle.style.transition="",delete this._fxResizeSnappedTitle}}),
|
|
99
99
|
/**
|
|
100
100
|
@license
|
|
101
101
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -106,7 +106,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
106
106
|
part of the polymer project is also subject to an additional IP rights grant
|
|
107
107
|
found at http://polymer.github.io/PATENTS.txt
|
|
108
108
|
*/
|
|
109
|
-
e({_template:
|
|
109
|
+
e({_template:n`
|
|
110
110
|
<style>
|
|
111
111
|
:host {
|
|
112
112
|
display: block;
|
|
@@ -281,7 +281,7 @@ e({_template:i`
|
|
|
281
281
|
<div id="tooltip" class="hidden">
|
|
282
282
|
<slot></slot>
|
|
283
283
|
</div>
|
|
284
|
-
`,is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object,value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var e=t(this).parentNode,
|
|
284
|
+
`,is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object,value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var e=t(this).parentNode,n=t(this).getOwnerRoot();return this.for?t(n).querySelector("#"+this.for):e.nodeType==Node.DOCUMENT_FRAGMENT_NODE?n.host:e},attached:function(){this._findTarget()},detached:function(){this.manualMode||this._removeListeners()},playAnimation:function(t){"entry"===t?this.show():"exit"===t&&this.hide()},cancelAnimation:function(){this.$.tooltip.classList.add("cancel-animation")},show:function(){if(!this._showing){if(""===t(this).textContent.trim()){for(var e=!0,n=t(this).getEffectiveChildNodes(),i=0;i<n.length;i++)if(""!==n[i].textContent.trim()){e=!1;break}if(e)return}this._showing=!0,this.$.tooltip.classList.remove("hidden"),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.updatePosition(),this._animationPlaying=!0,this.$.tooltip.classList.add(this._getAnimationType("entry"))}},hide:function(){if(this._showing){if(this._animationPlaying)return this._showing=!1,void this._cancelAnimation();this._onAnimationFinish(),this._showing=!1,this._animationPlaying=!0}},updatePosition:function(){if(this._target&&this.offsetParent){var t=this.offset;14!=this.marginTop&&14==this.offset&&(t=this.marginTop);var e,n,i=this.offsetParent.getBoundingClientRect(),r=this._target.getBoundingClientRect(),o=this.getBoundingClientRect(),a=(r.width-o.width)/2,s=(r.height-o.height)/2,l=r.left-i.left,c=r.top-i.top;switch(this.position){case"top":e=l+a,n=c-o.height-t;break;case"bottom":e=l+a,n=c+r.height+t;break;case"left":e=l-o.width-t,n=c+s;break;case"right":e=l+r.width+t,n=c+s}this.fitToVisibleBounds?(i.left+e+o.width>window.innerWidth?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,e)+"px",this.style.right="auto"),i.top+n+o.height>window.innerHeight?(this.style.bottom=i.height-c+t+"px",this.style.top="auto"):(this.style.top=Math.max(-i.top,n)+"px",this.style.bottom="auto")):(this.style.left=e+"px",this.style.top=n+"px")}},_addListeners:function(){this._target&&(this.listen(this._target,"mouseenter","show"),this.listen(this._target,"focus","show"),this.listen(this._target,"mouseleave","hide"),this.listen(this._target,"blur","hide"),this.listen(this._target,"tap","hide")),this.listen(this.$.tooltip,"animationend","_onAnimationEnd"),this.listen(this,"mouseenter","hide")},_findTarget:function(){this.manualMode||this._removeListeners(),this._target=this.target,this.manualMode||this._addListeners()},_delayChange:function(t){500!==t&&this.updateStyles({"--paper-tooltip-delay-in":t+"ms"})},_manualModeChanged:function(){this.manualMode?this._removeListeners():this._addListeners()},_cancelAnimation:function(){this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add("hidden")},_onAnimationFinish:function(){this._showing&&(this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add(this._getAnimationType("exit")))},_onAnimationEnd:function(){this._animationPlaying=!1,this._showing||(this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.add("hidden"))},_getAnimationType:function(t){if("entry"===t&&""!==this.animationEntry)return this.animationEntry;if("exit"===t&&""!==this.animationExit)return this.animationExit;if(this.animationConfig[t]&&"string"==typeof this.animationConfig[t][0].name){if(this.animationConfig[t][0].timing&&this.animationConfig[t][0].timing.delay&&0!==this.animationConfig[t][0].timing.delay){var e=this.animationConfig[t][0].timing.delay;"entry"===t?this.updateStyles({"--paper-tooltip-delay-in":e+"ms"}):"exit"===t&&this.updateStyles({"--paper-tooltip-delay-out":e+"ms"})}return this.animationConfig[t][0].name}},_removeListeners:function(){this._target&&(this.unlisten(this._target,"mouseenter","show"),this.unlisten(this._target,"focus","show"),this.unlisten(this._target,"mouseleave","hide"),this.unlisten(this._target,"blur","hide"),this.unlisten(this._target,"tap","hide")),this.unlisten(this.$.tooltip,"animationend","_onAnimationEnd"),this.unlisten(this,"mouseenter","hide")}});
|
|
285
285
|
/**
|
|
286
286
|
@license
|
|
287
287
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -292,7 +292,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
292
292
|
part of the polymer project is also subject to an additional IP rights grant
|
|
293
293
|
found at http://polymer.github.io/PATENTS.txt
|
|
294
294
|
*/
|
|
295
|
-
const W=
|
|
295
|
+
const W=n`
|
|
296
296
|
<style include="paper-material-styles">
|
|
297
297
|
:host {
|
|
298
298
|
@apply --layout-vertical;
|
|
@@ -382,7 +382,7 @@ const W=i`
|
|
|
382
382
|
|
|
383
383
|
<iron-icon id="icon" hidden\$="{{!_computeIsIconFab(icon, src)}}" src="[[src]]" icon="[[icon]]"></iron-icon>
|
|
384
384
|
<span hidden\$="{{_computeIsIconFab(icon, src)}}">{{label}}</span>
|
|
385
|
-
`;W.setAttribute("strip-whitespace",""),e({_template:W,is:"paper-fab",behaviors:[
|
|
385
|
+
`;W.setAttribute("strip-whitespace",""),e({_template:W,is:"paper-fab",behaviors:[i],properties:{src:{type:String,value:""},icon:{type:String,value:""},mini:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,observer:"_labelChanged"}},_labelChanged:function(){this.setAttribute("aria-label",this.label)},_computeIsIconFab:function(t,e){return t.length>0||e.length>0}});var G=function(t){var e=/\blang(?:uage)?-([\w-]+)\b/i,n=0,i={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(e){return e instanceof o?new o(e.type,t(e.content),e.alias):Array.isArray(e)?e.map(t):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++n}),t.__id},clone:function t(e,n){var i,o;switch(n=n||{},r.util.type(e)){case"Object":if(o=r.util.objId(e),n[o])return n[o];for(var a in i={},n[o]=i,e)e.hasOwnProperty(a)&&(i[a]=t(e[a],n));return i;case"Array":return o=r.util.objId(e),n[o]?n[o]:(i=[],n[o]=i,e.forEach((function(e,r){i[r]=t(e,n)})),i);default:return e}},getLanguage:function(t){for(;t&&!e.test(t.className);)t=t.parentElement;return t?(t.className.match(e)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(i){var t=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(i.stack)||[])[1];if(t){var e=document.getElementsByTagName("script");for(var n in e)if(e[n].src==t)return e[n]}return null}},isActive:function(t,e,n){for(var i="no-"+e;t;){var r=t.classList;if(r.contains(e))return!0;if(r.contains(i))return!1;t=t.parentElement}return!!n}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(t,e){var n=r.util.clone(r.languages[t]);for(var i in e)n[i]=e[i];return n},insertBefore:function(t,e,n,i){var o=(i=i||r.languages)[t],a={};for(var s in o)if(o.hasOwnProperty(s)){if(s==e)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(s)||(a[s]=o[s])}var c=i[t];return i[t]=a,r.languages.DFS(r.languages,(function(e,n){n===c&&e!=t&&(this[e]=a)})),a},DFS:function t(e,n,i,o){o=o||{};var a=r.util.objId;for(var s in e)if(e.hasOwnProperty(s)){n.call(e,s,e[s],i||s);var l=e[s],c=r.util.type(l);"Object"!==c||o[a(l)]?"Array"!==c||o[a(l)]||(o[a(l)]=!0,t(l,n,s,o)):(o[a(l)]=!0,t(l,n,null,o))}}},plugins:{},highlightAll:function(t,e){r.highlightAllUnder(document,t,e)},highlightAllUnder:function(t,e,n){var i={callback:n,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",i),i.elements=Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)),r.hooks.run("before-all-elements-highlight",i);for(var o,a=0;o=i.elements[a++];)r.highlightElement(o,!0===e,i.callback)},highlightElement:function(n,i,o){var a=r.util.getLanguage(n),s=r.languages[a];n.className=n.className.replace(e,"").replace(/\s+/g," ")+" language-"+a;var l=n.parentElement;l&&"pre"===l.nodeName.toLowerCase()&&(l.className=l.className.replace(e,"").replace(/\s+/g," ")+" language-"+a);var c={element:n,language:a,grammar:s,code:n.textContent};function h(t){c.highlightedCode=t,r.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,r.hooks.run("after-highlight",c),r.hooks.run("complete",c),o&&o.call(c.element)}if(r.hooks.run("before-sanity-check",c),(l=c.element.parentElement)&&"pre"===l.nodeName.toLowerCase()&&!l.hasAttribute("tabindex")&&l.setAttribute("tabindex","0"),!c.code)return r.hooks.run("complete",c),void(o&&o.call(c.element));if(r.hooks.run("before-highlight",c),c.grammar)if(i&&t.Worker){var p=new Worker(r.filename);p.onmessage=function(t){h(t.data)},p.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else h(r.highlight(c.code,c.grammar,c.language));else h(r.util.encode(c.code))},highlight:function(t,e,n){var i={code:t,grammar:e,language:n};return r.hooks.run("before-tokenize",i),i.tokens=r.tokenize(i.code,i.grammar),r.hooks.run("after-tokenize",i),o.stringify(r.util.encode(i.tokens),i.language)},tokenize:function(t,e){var n=e.rest;if(n){for(var i in n)e[i]=n[i];delete e.rest}var r=new l;return c(r,r.head,t),s(t,r,e,r.head,0),p(r)},hooks:{all:{},add:function(t,e){var n=r.hooks.all;n[t]=n[t]||[],n[t].push(e)},run:function(t,e){var n=r.hooks.all[t];if(n&&n.length)for(var i,o=0;i=n[o++];)i(e)}},Token:o};function o(t,e,n,i){this.type=t,this.content=e,this.alias=n,this.length=0|(i||"").length}function a(t,e,n,i){t.lastIndex=e;var r=t.exec(n);if(r&&i&&r[1]){var o=r[1].length;r.index+=o,r[0]=r[0].slice(o)}return r}function s(t,e,n,i,l,p){for(var d in n)if(n.hasOwnProperty(d)&&n[d]){var u=n[d];u=Array.isArray(u)?u:[u];for(var g=0;g<u.length;++g){if(p&&p.cause==d+","+g)return;var f=u[g],m=f.inside,v=!!f.lookbehind,b=!!f.greedy,y=f.alias;if(b&&!f.pattern.global){var _=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,_+"g")}for(var w=f.pattern||f,x=i.next,k=l;x!==e.tail&&!(p&&k>=p.reach);k+=x.value.length,x=x.next){var z=x.value;if(e.length>t.length)return;if(!(z instanceof o)){var A,S=1;if(b){if(!(A=a(w,k,t,v)))break;var C=A.index,E=A.index+A[0].length,M=k;for(M+=x.value.length;C>=M;)M+=(x=x.next).value.length;if(k=M-=x.value.length,x.value instanceof o)continue;for(var L=x;L!==e.tail&&(M<E||"string"==typeof L.value);L=L.next)S++,M+=L.value.length;S--,z=t.slice(k,M),A.index-=k}else if(!(A=a(w,0,z,v)))continue;C=A.index;var H=A[0],T=z.slice(0,C),V=z.slice(C+H.length),$=k+z.length;p&&$>p.reach&&(p.reach=$);var O=x.prev;if(T&&(O=c(e,O,T),k+=T.length),h(e,O,S),x=c(e,O,new o(d,m?r.tokenize(H,m):H,y,H)),V&&c(e,x,V),S>1){var P={cause:d+","+g,reach:$};s(t,e,n,x.prev,k,P),p&&P.reach>p.reach&&(p.reach=P.reach)}}}}}}function l(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function c(t,e,n){var i=e.next,r={value:n,prev:e,next:i};return e.next=r,i.prev=r,t.length++,r}function h(t,e,n){for(var i=e.next,r=0;r<n&&i!==t.tail;r++)i=i.next;e.next=i,i.prev=e,t.length-=r}function p(t){for(var e=[],n=t.head.next;n!==t.tail;)e.push(n.value),n=n.next;return e}if(t.Prism=r,o.stringify=function t(e,n){if("string"==typeof e)return e;if(Array.isArray(e)){var i="";return e.forEach((function(e){i+=t(e,n)})),i}var o={type:e.type,content:t(e.content,n),tag:"span",classes:["token",e.type],attributes:{},language:n},a=e.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(o.classes,a):o.classes.push(a)),r.hooks.run("wrap",o);var s="";for(var l in o.attributes)s+=" "+l+'="'+(o.attributes[l]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+s+">"+o.content+"</"+o.tag+">"},!t.document)return t.addEventListener?(r.disableWorkerMessageHandler||t.addEventListener("message",(function(e){var n=JSON.parse(e.data),i=n.language,o=n.code,a=n.immediateClose;t.postMessage(r.highlight(o,r.languages[i],i)),a&&t.close()}),!1),r):r;var d=r.util.currentScript();function u(){r.manual||r.highlightAll()}if(d&&(r.filename=d.src,d.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var g=document.readyState;"loading"===g||"interactive"===g&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
|
|
386
386
|
/**
|
|
387
387
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
388
388
|
*
|
|
@@ -390,10 +390,10 @@ const W=i`
|
|
|
390
390
|
* @author Lea Verou <https://lea.verou.me>
|
|
391
391
|
* @namespace
|
|
392
392
|
* @public
|
|
393
|
-
*/"undefined"!=typeof module&&module.exports&&(module.exports=G),"undefined"!=typeof global&&(global.Prism=G),G.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?\]\]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},G.languages.markup.tag.inside["attr-value"].inside.entity=G.languages.markup.entity,G.languages.markup.doctype.inside["internal-subset"].inside=G.languages.markup,G.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(G.languages.markup.tag,"addInlined",{value:function(t,e){var i={};i["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:G.languages[e]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var n={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};n["language-"+e]={pattern:/[\s\S]+/,inside:G.languages[e]};var r={};r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:n},G.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(G.languages.markup.tag,"addAttribute",{value:function(t,e){G.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:G.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),G.languages.html=G.languages.markup,G.languages.mathml=G.languages.markup,G.languages.svg=G.languages.markup,G.languages.xml=G.languages.extend("markup",{}),G.languages.ssml=G.languages.xml,G.languages.atom=G.languages.xml,G.languages.rss=G.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var i=t.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(G),G.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},G.languages.javascript=G.languages.extend("clike",{"class-name":[G.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),G.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,G.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:G.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:G.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:G.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:G.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:G.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),G.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:G.languages.javascript}},string:/[\s\S]+/}}}),G.languages.markup&&(G.languages.markup.tag.addInlined("script","javascript"),G.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),G.languages.js=G.languages.javascript,function(){if(void 0!==G&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t="Loading…",e=function(t,e){return"✖ Error "+t+" while fetching file: "+e},i="✖ Error: File does not exist or is empty",n={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",o="loading",a="loaded",s="failed",l="pre[data-src]:not(["+r+'="'+a+'"]):not(['+r+'="'+o+'"])',c=/\blang(?:uage)?-([\w-]+)\b/i;G.hooks.add("before-highlightall",(function(t){t.selector+=", "+l})),G.hooks.add("before-sanity-check",(function(c){var h=c.element;if(h.matches(l)){c.code="",h.setAttribute(r,o);var d=h.appendChild(document.createElement("CODE"));d.textContent=t;var u=h.getAttribute("data-src"),g=c.language;if("none"===g){var f=(/\.(\w+)$/.exec(u)||[,"none"])[1];g=n[f]||f}p(d,g),p(h,g);var m=G.plugins.autoloader;m&&m.loadLanguages(g);var v=new XMLHttpRequest;v.open("GET",u,!0),v.onreadystatechange=function(){4==v.readyState&&(v.status<400&&v.responseText?(h.setAttribute(r,a),d.textContent=v.responseText,G.highlightElement(d)):(h.setAttribute(r,s),v.status>=400?d.textContent=e(v.status,v.statusText):d.textContent=i))},v.send(null)}})),G.plugins.fileHighlight={highlight:function(t){for(var e,i=(t||document).querySelectorAll(l),n=0;e=i[n++];)G.highlightElement(e)}};var h=!1;G.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),G.plugins.fileHighlight.highlight.apply(this,arguments)}}function p(t,e){var i=t.className;i=i.replace(c," ")+" language-"+e,t.className=i.replace(/\s+/g," ").trim()}}(),function(t){t.languages.xquery=t.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[-\w:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},function:/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:/]/}),t.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,t.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/i,t.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,t.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,inside:t.languages.xquery,alias:"language-xquery"};var e=function(t){return"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(e).join("")},i=function(n){for(var r=[],o=0;o<n.length;o++){var a=n[o],s=!1;if("string"!=typeof a&&("tag"===a.type&&a.content[0]&&"tag"===a.content[0].type?"</"===a.content[0].content[0].content?r.length>0&&r[r.length-1].tagName===e(a.content[0].content[1])&&r.pop():"/>"===a.content[a.content.length-1].content||r.push({tagName:e(a.content[0].content[1]),openedBraces:0}):!(r.length>0&&"punctuation"===a.type&&"{"===a.content)||n[o+1]&&"punctuation"===n[o+1].type&&"{"===n[o+1].content||n[o-1]&&"plain-text"===n[o-1].type&&"{"===n[o-1].content?r.length>0&&r[r.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?r[r.length-1].openedBraces--:"comment"!==a.type&&(s=!0):r[r.length-1].openedBraces++),(s||"string"==typeof a)&&r.length>0&&0===r[r.length-1].openedBraces){var l=e(a);o<n.length-1&&("string"==typeof n[o+1]||"plain-text"===n[o+1].type)&&(l+=e(n[o+1]),n.splice(o+1,1)),o>0&&("string"==typeof n[o-1]||"plain-text"===n[o-1].type)&&(l=e(n[o-1])+l,n.splice(o-1,1),o--),/^\s+$/.test(l)?n[o]=l:n[o]=new t.Token("plain-text",l,null,l)}a.content&&"string"!=typeof a.content&&i(a.content)}};t.hooks.add("after-tokenize",(function(t){"xquery"===t.language&&i(t.tokens)}))}(Prism),function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var t=Object.assign||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t};e.prototype={setDefaults:function(e){this.defaults=t(this.defaults,e)},normalize:function(e,n){for(var r in n=t(this.defaults,n)){var o=i(r);"normalize"!==r&&"setDefaults"!==o&&n[r]&&this[o]&&(e=this[o].call(this,e,n[r]))}return e},leftTrim:function(t){return t.replace(/^\s+/,"")},rightTrim:function(t){return t.replace(/\s+$/,"")},tabsToSpaces:function(t,e){return e=0|e||4,t.replace(/\t/g,new Array(++e).join(" "))},spacesToTabs:function(t,e){return e=0|e||4,t.replace(RegExp(" {"+e+"}","g"),"\t")},removeTrailing:function(t){return t.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(t){return t.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(t){var e=t.match(/^[^\S\n\r]*(?=\S)/gm);return e&&e[0].length?(e.sort((function(t,e){return t.length-e.length})),e[0].length?t.replace(RegExp("^"+e[0],"gm"),""):t):t},indent:function(t,e){return t.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++e).join("\t")+"$&")},breakLines:function(t,e){e=!0===e?80:0|e||80;for(var i=t.split("\n"),r=0;r<i.length;++r)if(!(n(i[r])<=e)){for(var o=i[r].split(/(\s+)/g),a=0,s=0;s<o.length;++s){var l=n(o[s]);(a+=l)>e&&(o[s]="\n"+o[s],a=l)}i[r]=o.join("")}return i.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof Prism&&(Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(t){var e=Prism.plugins.NormalizeWhitespace;if((!t.settings||!1!==t.settings["whitespace-normalization"])&&Prism.util.isActive(t.element,"whitespace-normalization",!0))if(t.element&&t.element.parentNode||!t.code){var i=t.element.parentNode;if(t.code&&i&&"pre"===i.nodeName.toLowerCase()){for(var n=i.childNodes,r="",o="",a=!1,s=0;s<n.length;++s){var l=n[s];l==t.element?a=!0:"#text"===l.nodeName&&(a?o+=l.nodeValue:r+=l.nodeValue,i.removeChild(l),--s)}if(t.element.children.length&&Prism.plugins.KeepMarkup){var c=r+t.element.innerHTML+o;t.element.innerHTML=e.normalize(c,t.settings),t.code=t.element.textContent}else t.code=r+t.code+o,t.code=e.normalize(t.code,t.settings)}}else t.code=e.normalize(t.code,t.settings)})))}function e(e){this.defaults=t({},e)}function i(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function n(t){for(var e=0,i=0;i<t.length;++i)t.charCodeAt(i)=="\t".charCodeAt(0)&&(e+=3);return t.length+e}}(),function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var t="line-numbers",e=/\n(?!$)/g,i=Prism.plugins.lineNumbers={getLine:function(e,i){if("PRE"===e.tagName&&e.classList.contains(t)){var n=e.querySelector(".line-numbers-rows");if(n){var r=parseInt(e.getAttribute("data-start"),10)||1,o=r+(n.children.length-1);i<r&&(i=r),i>o&&(i=o);var a=i-r;return n.children[a]}}},resize:function(t){r([t])},assumeViewportIndependence:!0},n=void 0;window.addEventListener("resize",(function(){i.assumeViewportIndependence&&n===window.innerWidth||(n=window.innerWidth,r(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(i){if(i.code){var n=i.element,o=n.parentNode;if(o&&/pre/i.test(o.nodeName)&&!n.querySelector(".line-numbers-rows")&&Prism.util.isActive(n,t)){n.classList.remove(t),o.classList.add(t);var a,s=i.code.match(e),l=s?s.length+1:1,c=new Array(l+1).join("<span></span>");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=c,o.hasAttribute("data-start")&&(o.style.counterReset="linenumber "+(parseInt(o.getAttribute("data-start"),10)-1)),i.element.appendChild(a),r([o]),Prism.hooks.run("line-numbers",i)}}})),Prism.hooks.add("line-numbers",(function(t){t.plugins=t.plugins||{},t.plugins.lineNumbers=!0}))}function r(t){if(0!=(t=t.filter((function(t){var e=o(t)["white-space"];return"pre-wrap"===e||"pre-line"===e}))).length){var i=t.map((function(t){var i=t.querySelector("code"),n=t.querySelector(".line-numbers-rows");if(i&&n){var r=t.querySelector(".line-numbers-sizer"),o=i.textContent.split(e);r||((r=document.createElement("span")).className="line-numbers-sizer",i.appendChild(r)),r.innerHTML="0",r.style.display="block";var a=r.getBoundingClientRect().height;return r.innerHTML="",{element:t,lines:o,lineHeights:[],oneLinerHeight:a,sizer:r}}})).filter(Boolean);i.forEach((function(t){var e=t.sizer,i=t.lines,n=t.lineHeights,r=t.oneLinerHeight;n[i.length-1]=void 0,i.forEach((function(t,i){if(t&&t.length>1){var o=e.appendChild(document.createElement("span"));o.style.display="block",o.textContent=t}else n[i]=r}))})),i.forEach((function(t){for(var e=t.sizer,i=t.lineHeights,n=0,r=0;r<i.length;r++)void 0===i[r]&&(i[r]=e.children[n++].getBoundingClientRect().height)})),i.forEach((function(t){var e=t.sizer,i=t.element.querySelector(".line-numbers-rows");e.style.display="none",e.innerHTML="",t.lineHeights.forEach((function(t,e){i.children[e].style.height=t+"px"}))}))}}function o(t){return t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null}}();class X extends V{static get properties(){return{language:{type:String},code:{type:String},theme:{type:String},lineNumbers:{type:Boolean,attribute:"line-numbers"},_styles:{type:String}}}constructor(){super(),this.language="xml",this.theme="default",this.lineNumbers=!1}connectedCallback(){super.connectedCallback();null===this.getAttribute("theme")&&this.setAttribute("theme","default")}firstUpdated(){if(super.firstUpdated(),!this.code){const t=this.querySelector("template");this.code=t?Prism.plugins.NormalizeWhitespace.normalize(t.innerHTML):Prism.plugins.NormalizeWhitespace.normalize(this.textContent)}}attributeChangedCallback(t,e,i){switch(super.attributeChangedCallback(t,e,i),t){case"theme":X.loadTheme(i).then(t=>{this._styles=t})}}updated(t){super.updated(t),t.has("code")&&this.highlight()}highlight(){Prism.highlightAllUnder(this.shadowRoot)}render(){return this.code?$`
|
|
393
|
+
*/"undefined"!=typeof module&&module.exports&&(module.exports=G),"undefined"!=typeof global&&(global.Prism=G),G.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?\]\]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},G.languages.markup.tag.inside["attr-value"].inside.entity=G.languages.markup.entity,G.languages.markup.doctype.inside["internal-subset"].inside=G.languages.markup,G.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),Object.defineProperty(G.languages.markup.tag,"addInlined",{value:function(t,e){var n={};n["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:G.languages[e]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+e]={pattern:/[\s\S]+/,inside:G.languages[e]};var r={};r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:i},G.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(G.languages.markup.tag,"addAttribute",{value:function(t,e){G.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:G.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),G.languages.html=G.languages.markup,G.languages.mathml=G.languages.markup,G.languages.svg=G.languages.markup,G.languages.xml=G.languages.extend("markup",{}),G.languages.ssml=G.languages.xml,G.languages.atom=G.languages.xml,G.languages.rss=G.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(G),G.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},G.languages.javascript=G.languages.extend("clike",{"class-name":[G.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),G.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,G.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:G.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:G.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:G.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:G.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:G.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),G.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:G.languages.javascript}},string:/[\s\S]+/}}}),G.languages.markup&&(G.languages.markup.tag.addInlined("script","javascript"),G.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),G.languages.js=G.languages.javascript,function(){if(void 0!==G&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t="Loading…",e=function(t,e){return"✖ Error "+t+" while fetching file: "+e},n="✖ Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",o="loading",a="loaded",s="failed",l="pre[data-src]:not(["+r+'="'+a+'"]):not(['+r+'="'+o+'"])',c=/\blang(?:uage)?-([\w-]+)\b/i;G.hooks.add("before-highlightall",(function(t){t.selector+=", "+l})),G.hooks.add("before-sanity-check",(function(c){var h=c.element;if(h.matches(l)){c.code="",h.setAttribute(r,o);var d=h.appendChild(document.createElement("CODE"));d.textContent=t;var u=h.getAttribute("data-src"),g=c.language;if("none"===g){var f=(/\.(\w+)$/.exec(u)||[,"none"])[1];g=i[f]||f}p(d,g),p(h,g);var m=G.plugins.autoloader;m&&m.loadLanguages(g);var v=new XMLHttpRequest;v.open("GET",u,!0),v.onreadystatechange=function(){4==v.readyState&&(v.status<400&&v.responseText?(h.setAttribute(r,a),d.textContent=v.responseText,G.highlightElement(d)):(h.setAttribute(r,s),v.status>=400?d.textContent=e(v.status,v.statusText):d.textContent=n))},v.send(null)}})),G.plugins.fileHighlight={highlight:function(t){for(var e,n=(t||document).querySelectorAll(l),i=0;e=n[i++];)G.highlightElement(e)}};var h=!1;G.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),G.plugins.fileHighlight.highlight.apply(this,arguments)}}function p(t,e){var n=t.className;n=n.replace(c," ")+" language-"+e,t.className=n.replace(/\s+/g," ").trim()}}(),function(t){t.languages.xquery=t.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[-\w:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},function:/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:/]/}),t.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,t.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/i,t.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,t.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,inside:t.languages.xquery,alias:"language-xquery"};var e=function(t){return"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(e).join("")},n=function(i){for(var r=[],o=0;o<i.length;o++){var a=i[o],s=!1;if("string"!=typeof a&&("tag"===a.type&&a.content[0]&&"tag"===a.content[0].type?"</"===a.content[0].content[0].content?r.length>0&&r[r.length-1].tagName===e(a.content[0].content[1])&&r.pop():"/>"===a.content[a.content.length-1].content||r.push({tagName:e(a.content[0].content[1]),openedBraces:0}):!(r.length>0&&"punctuation"===a.type&&"{"===a.content)||i[o+1]&&"punctuation"===i[o+1].type&&"{"===i[o+1].content||i[o-1]&&"plain-text"===i[o-1].type&&"{"===i[o-1].content?r.length>0&&r[r.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?r[r.length-1].openedBraces--:"comment"!==a.type&&(s=!0):r[r.length-1].openedBraces++),(s||"string"==typeof a)&&r.length>0&&0===r[r.length-1].openedBraces){var l=e(a);o<i.length-1&&("string"==typeof i[o+1]||"plain-text"===i[o+1].type)&&(l+=e(i[o+1]),i.splice(o+1,1)),o>0&&("string"==typeof i[o-1]||"plain-text"===i[o-1].type)&&(l=e(i[o-1])+l,i.splice(o-1,1),o--),/^\s+$/.test(l)?i[o]=l:i[o]=new t.Token("plain-text",l,null,l)}a.content&&"string"!=typeof a.content&&n(a.content)}};t.hooks.add("after-tokenize",(function(t){"xquery"===t.language&&n(t.tokens)}))}(Prism),function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var t=Object.assign||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t};e.prototype={setDefaults:function(e){this.defaults=t(this.defaults,e)},normalize:function(e,i){for(var r in i=t(this.defaults,i)){var o=n(r);"normalize"!==r&&"setDefaults"!==o&&i[r]&&this[o]&&(e=this[o].call(this,e,i[r]))}return e},leftTrim:function(t){return t.replace(/^\s+/,"")},rightTrim:function(t){return t.replace(/\s+$/,"")},tabsToSpaces:function(t,e){return e=0|e||4,t.replace(/\t/g,new Array(++e).join(" "))},spacesToTabs:function(t,e){return e=0|e||4,t.replace(RegExp(" {"+e+"}","g"),"\t")},removeTrailing:function(t){return t.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(t){return t.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(t){var e=t.match(/^[^\S\n\r]*(?=\S)/gm);return e&&e[0].length?(e.sort((function(t,e){return t.length-e.length})),e[0].length?t.replace(RegExp("^"+e[0],"gm"),""):t):t},indent:function(t,e){return t.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++e).join("\t")+"$&")},breakLines:function(t,e){e=!0===e?80:0|e||80;for(var n=t.split("\n"),r=0;r<n.length;++r)if(!(i(n[r])<=e)){for(var o=n[r].split(/(\s+)/g),a=0,s=0;s<o.length;++s){var l=i(o[s]);(a+=l)>e&&(o[s]="\n"+o[s],a=l)}n[r]=o.join("")}return n.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof Prism&&(Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(t){var e=Prism.plugins.NormalizeWhitespace;if((!t.settings||!1!==t.settings["whitespace-normalization"])&&Prism.util.isActive(t.element,"whitespace-normalization",!0))if(t.element&&t.element.parentNode||!t.code){var n=t.element.parentNode;if(t.code&&n&&"pre"===n.nodeName.toLowerCase()){for(var i=n.childNodes,r="",o="",a=!1,s=0;s<i.length;++s){var l=i[s];l==t.element?a=!0:"#text"===l.nodeName&&(a?o+=l.nodeValue:r+=l.nodeValue,n.removeChild(l),--s)}if(t.element.children.length&&Prism.plugins.KeepMarkup){var c=r+t.element.innerHTML+o;t.element.innerHTML=e.normalize(c,t.settings),t.code=t.element.textContent}else t.code=r+t.code+o,t.code=e.normalize(t.code,t.settings)}}else t.code=e.normalize(t.code,t.settings)})))}function e(e){this.defaults=t({},e)}function n(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function i(t){for(var e=0,n=0;n<t.length;++n)t.charCodeAt(n)=="\t".charCodeAt(0)&&(e+=3);return t.length+e}}(),function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var t="line-numbers",e=/\n(?!$)/g,n=Prism.plugins.lineNumbers={getLine:function(e,n){if("PRE"===e.tagName&&e.classList.contains(t)){var i=e.querySelector(".line-numbers-rows");if(i){var r=parseInt(e.getAttribute("data-start"),10)||1,o=r+(i.children.length-1);n<r&&(n=r),n>o&&(n=o);var a=n-r;return i.children[a]}}},resize:function(t){r([t])},assumeViewportIndependence:!0},i=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&i===window.innerWidth||(i=window.innerWidth,r(Array.prototype.slice.call(document.querySelectorAll("pre."+t))))})),Prism.hooks.add("complete",(function(n){if(n.code){var i=n.element,o=i.parentNode;if(o&&/pre/i.test(o.nodeName)&&!i.querySelector(".line-numbers-rows")&&Prism.util.isActive(i,t)){i.classList.remove(t),o.classList.add(t);var a,s=n.code.match(e),l=s?s.length+1:1,c=new Array(l+1).join("<span></span>");(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=c,o.hasAttribute("data-start")&&(o.style.counterReset="linenumber "+(parseInt(o.getAttribute("data-start"),10)-1)),n.element.appendChild(a),r([o]),Prism.hooks.run("line-numbers",n)}}})),Prism.hooks.add("line-numbers",(function(t){t.plugins=t.plugins||{},t.plugins.lineNumbers=!0}))}function r(t){if(0!=(t=t.filter((function(t){var e=o(t)["white-space"];return"pre-wrap"===e||"pre-line"===e}))).length){var n=t.map((function(t){var n=t.querySelector("code"),i=t.querySelector(".line-numbers-rows");if(n&&i){var r=t.querySelector(".line-numbers-sizer"),o=n.textContent.split(e);r||((r=document.createElement("span")).className="line-numbers-sizer",n.appendChild(r)),r.innerHTML="0",r.style.display="block";var a=r.getBoundingClientRect().height;return r.innerHTML="",{element:t,lines:o,lineHeights:[],oneLinerHeight:a,sizer:r}}})).filter(Boolean);n.forEach((function(t){var e=t.sizer,n=t.lines,i=t.lineHeights,r=t.oneLinerHeight;i[n.length-1]=void 0,n.forEach((function(t,n){if(t&&t.length>1){var o=e.appendChild(document.createElement("span"));o.style.display="block",o.textContent=t}else i[n]=r}))})),n.forEach((function(t){for(var e=t.sizer,n=t.lineHeights,i=0,r=0;r<n.length;r++)void 0===n[r]&&(n[r]=e.children[i++].getBoundingClientRect().height)})),n.forEach((function(t){var e=t.sizer,n=t.element.querySelector(".line-numbers-rows");e.style.display="none",e.innerHTML="",t.lineHeights.forEach((function(t,e){n.children[e].style.height=t+"px"}))}))}}function o(t){return t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null}}();class X extends V{static get properties(){return{language:{type:String},code:{type:String},theme:{type:String},lineNumbers:{type:Boolean,attribute:"line-numbers"},_styles:{type:String}}}constructor(){super(),this.language="xml",this.theme="default",this.lineNumbers=!1}connectedCallback(){super.connectedCallback();null===this.getAttribute("theme")&&this.setAttribute("theme","default")}firstUpdated(){if(super.firstUpdated(),!this.code){const t=this.querySelector("template");this.code=t?Prism.plugins.NormalizeWhitespace.normalize(t.innerHTML):Prism.plugins.NormalizeWhitespace.normalize(this.textContent)}}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"theme":X.loadTheme(n).then(t=>{this._styles=t})}}updated(t){super.updated(t),t.has("code")&&this.highlight()}highlight(){Prism.highlightAllUnder(this.shadowRoot)}render(){return this.code?$`
|
|
394
394
|
${this._styles}
|
|
395
395
|
<pre class="${this.lineNumbers?"line-numbers":""} language-${this.language}"><code>${this.code}</code></pre>
|
|
396
|
-
`:$`<pre class="line-numbers"><code><code></pre>`}static async loadTheme(t){const e="default"===t?"prism.css":`prism-${t}.css`,
|
|
396
|
+
`:$`<pre class="line-numbers"><code><code></pre>`}static async loadTheme(t){const e="default"===t?"prism.css":`prism-${t}.css`,n=O("../css/prismjs/")+e;console.log("<pb-code-highlight> loading theme %s from %s",t,n);const i=await fetch(n).then(async t=>t.text()).catch(t=>"");return $`<style>${i}</style>`}static get styles(){return P`
|
|
397
397
|
:host {
|
|
398
398
|
display: block;
|
|
399
399
|
}
|
|
@@ -445,7 +445,7 @@ const W=i`
|
|
|
445
445
|
padding-right: 0.8em;
|
|
446
446
|
text-align: right;
|
|
447
447
|
}
|
|
448
|
-
`}}customElements.define("pb-code-highlight",X);const K="https://teipublisher.com/exist/apps/tei-publisher";class Z extends V{static get properties(){return{title:{type:String},code:{type:String},_editorLoaded:{type:Boolean},_showCodeLabel:{type:String},_editCodeLabel:{type:String}}}constructor(){super(),this.title="TEI Publisher Webcomponents Example",this.code="Loading ...",this._showCodeLabel="demo.showCode.show"}connectedCallback(){super.connectedCallback();const t=this.querySelector("template");this.code=Z.removeIndent(t.innerHTML),this.code=this.code.replace(/\s*<style[\s\S]*>[\s\S]*?<\/style>\s*/g,"");const e=document.importNode(t.content,!0);this.appendChild(e)}render(){let t=this.code.replace(/(endpoint="[^"]+")/,`endpoint="${K}"`);t=Z.indent(t,2);const e=this.querySelector("style");let
|
|
448
|
+
`}}customElements.define("pb-code-highlight",X);const K="https://teipublisher.com/exist/apps/tei-publisher";class Z extends V{static get properties(){return{title:{type:String},code:{type:String},_editorLoaded:{type:Boolean},_showCodeLabel:{type:String},_editCodeLabel:{type:String}}}constructor(){super(),this.title="TEI Publisher Webcomponents Example",this.code="Loading ...",this._showCodeLabel="demo.showCode.show"}connectedCallback(){super.connectedCallback();const t=this.querySelector("template");this.code=Z.removeIndent(t.innerHTML),this.code=this.code.replace(/\s*<style[\s\S]*>[\s\S]*?<\/style>\s*/g,"");const e=document.importNode(t.content,!0);this.appendChild(e)}render(){let t=this.code.replace(/(endpoint="[^"]+")/,`endpoint="${K}"`);t=Z.indent(t,2);const e=this.querySelector("style");let n="";e&&(n=e.innerText);const i="\n@import url('https://fonts.googleapis.com/css?family=Oswald|Roboto&display=swap');\n\nbody {\n margin: 10px 20px;\n font-size: 16px;\n font-family: 'Roboto', 'Noto', sans - serif;\n line-height: 1.42857;\n font-weight: 300;\n color: #333333;\n\n --paper-tooltip-delay-in: 200;\n}\n\n"+Z.removeIndent(n),o=`\n<html>\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n\n <title>${this.title}</title>\n <script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.4.3/webcomponents-loader.js"><\/script>\n <script type="module" src="https://unpkg.com/@teipublisher/pb-components@latest/dist/pb-components-bundle.js"><\/script>\n <script type="module" src="https://unpkg.com/@teipublisher/pb-components@latest/dist/pb-leaflet-map.js"><\/script>\n </head>\n\n <body>\n ${t}\n </body>\n</html>`,a={title:this.title,html:o,html_pre_processor:"none",css:i,css_starter:"normalize",template:!1,editors:110};return $`
|
|
449
449
|
<div class="snippet"><slot></slot></div>
|
|
450
450
|
<pb-code-highlight id="source" theme="coy" language="html" line-numbers .code="${this.code}"></pb-code-highlight>
|
|
451
451
|
<div id="container"></div>
|
|
@@ -507,7 +507,7 @@ const W=i`
|
|
|
507
507
|
border-color: #999;
|
|
508
508
|
color: #999;
|
|
509
509
|
}
|
|
510
|
-
`}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,i,n=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||i&&i(t,r)},{once:n})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(i=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||i(t)},{once:!0})})}static emit(t,e=null,i=null){const n=i||{};e&&(n.key=e);const r=new CustomEvent(t,{detail:n});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.28.2";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",it="right",nt="left",rt="auto",ot=[tt,et,it,nt],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});bt(n)&&ft(n)&&(Object.assign(n.style,o),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function St(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&yt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var i=Lt(t);bt(i)&&["html","body"].indexOf(ft(i))<0;){var n=Ct(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function Vt(t){for(var e=mt(t),i=Ht(t);i&&Et(i)&&"static"===Ct(i).position;)i=Ht(i);return i&&("html"===ft(i)||"body"===ft(i)&&"static"===Ct(i).position)?e:i||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,i){return Ot(t,Pt(e,i))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,a=i.modifiersData.popperOffsets,s=kt(i.placement),l=$t(s),c=[nt,it].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,i),p=At(o),d="y"===l?tt:nt,u="y"===l?et:it,g=i.rects.reference[c]+i.rects.reference[l]-a[l]-i.rects.popper[c],f=a[l]-i.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;i.modifiersData[n]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&St(e.elements.popper,n)&&(e.elements.arrow=n)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:Rt(Rt(e*n)/n)||0,y:Rt(Rt(i*n)/n)||0}}function Gt(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=nt,b=tt,y=window;if(l){var _=Vt(i),w="clientHeight",x="clientWidth";_===mt(i)&&"static"!==Ct(_=Mt(i)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-n.height,g*=s?1:-1),r===nt&&(v=it,d-=_[x]-n.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,a=void 0===o||o,s=i.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,a=n.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,Kt)})),s&&l.addEventListener("resize",i.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,Kt)})),s&&l.removeEventListener("resize",i.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ie(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ne(t){var e=mt(t),i=Mt(t),n=e.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,s=0;return n&&(r=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,s=n.offsetTop)),{width:r,height:o,x:a+ie(t),y:s}}function re(t){var e,i=Mt(t),n=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-n.scrollLeft+ie(t),l=-n.scrollTop;return"rtl"===Ct(r||i).direction&&(s+=Ot(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var i;void 0===e&&(e=[]);var n=ae(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=mt(n),a=r?[o].concat(o.visualViewport||[],oe(n)?n:[]):n,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ne(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),i=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(i)?e.filter((function(t){return vt(t)&&St(t,i)&&"body"!==ft(t)})):[]}function de(t,e,i){var n="clippingParents"===e?pe(t):[].concat(e),r=[].concat(n,[i]),o=r[0],a=r.reduce((function(e,i){var n=he(t,i);return e.top=Ot(n.top,e.top),e.right=Pt(n.right,e.right),e.bottom=Pt(n.bottom,e.bottom),e.left=Ot(n.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case tt:e={x:s,y:i.y-n.height};break;case et:e={x:s,y:i.y+i.height};break;case it:e={x:i.x+i.width,y:l};break;case nt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(i[h]/2-n[h]/2);break;case st:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.boundary,a=void 0===o?lt:o,s=i.rootBoundary,l=void 0===s?ct:s,c=i.elementContext,h=void 0===c?ht:c,p=i.altBoundary,d=void 0!==p&&p,u=i.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[it,et].indexOf(t)>=0?1:-1,i=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[i]*e}))}return A}function me(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,a=i.padding,s=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(n),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,i){return e[i]=fe(t,{placement:i,boundary:r,rootBoundary:o,padding:a})[kt(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,a=i.altAxis,s=void 0===a||a,l=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,d=i.altBoundary,u=i.flipVariations,g=void 0===u||u,f=i.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(kt(i)===rt?me(e,{placement:i,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?it:nt:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[n]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function _e(t){return[tt,it,et,nt].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,n),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,i){var n=kt(t),r=[nt,tt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[nt,it].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,i){return t[i]=xe(i,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=a}function ze(t){var e=t.state,i=t.name;e.modifiersData[i]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,a=i.altAxis,s=void 0!==a&&a,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,d=i.tether,u=void 0===d||d,g=i.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:nt,E="y"===_?et:it,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:nt,Q="x"===_?et:it,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[n]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,i){void 0===i&&(i=!1);var n=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!i)&&(("body"!==ft(e)||oe(n))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):n&&(s.x=ie(n))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||r(t)})),n}function He(t){var e=Le(t);return gt.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(i){h(),r.options=Object.assign({},o,r.options,i),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(n,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,i=t.popper;if(Oe(e,i)){r.rects={reference:Me(e,Vt(i),"fixed"===r.options.strategy),popper:At(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var o=r.orderedModifiers[n],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,n=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:n}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(i).then((function(t){!s&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function Ue(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,i){return t.indexOf(e)===i}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function ti(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function ei(){return document.createElement("div")}function ii(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function ni(t){return Ue(t,"NodeList")}function ri(t){return Ue(t,"MouseEvent")}function oi(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ai(t){return ii(t)?[t]:ni(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function si(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function li(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function ci(t){var e,i=Ke(t)[0];return(null==i||null==(e=i.ownerDocument)?void 0:e.body)?i.ownerDocument:document}function hi(t,e){var i=e.clientX,n=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-n+l>o,u=n-e.bottom-c>o,g=e.left-i+h>o,f=i-e.right-p>o;return d||u||g||f}))}function pi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}var di={isTouch:!1},ui=0;function gi(){di.isTouch||(di.isTouch=!0,window.performance&&document.addEventListener("mousemove",fi))}function fi(){var t=performance.now();t-ui<20&&(di.isTouch=!1,document.removeEventListener("mousemove",fi)),ui=t}function mi(){var t=document.activeElement;if(oi(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function vi(){document.addEventListener("touchstart",gi,je),window.addEventListener("blur",mi)}var bi="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",yi=/MSIE |Trident\//.test(bi),_i={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},wi={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},xi=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},_i,{},wi),ki=Object.keys(xi),zi=function(t){Object.keys(t).forEach((function(e){xi[e]=t[e]}))};function Ai(t){var e=(t.plugins||[]).reduce((function(e,i){var n=i.name,r=i.defaultValue;return n&&(e[n]=void 0!==t[n]?t[n]:r),e}),{});return Object.assign({},t,{},e)}function Si(t,e){return(e?Object.keys(Ai(Object.assign({},xi,{plugins:e}))):ki).reduce((function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e}),{})}function Ci(t,e){var i=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Si(t,e.plugins));return i.aria=Object.assign({},xi.aria,{},i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}var Ei=function(){return"innerHTML"};function Mi(t,e){t[Ei()]=e}function Li(t){var e=ei();return!0===t?e.className=Be:(e.className=De,ii(t)?e.appendChild(t):Mi(e,t)),e}function Hi(t,e){ii(e.content)?(Mi(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Mi(t,e.content):t.textContent=e.content)}function Ti(t){var e=t.firstElementChild,i=Je(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(Ne)})),arrow:i.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:i.find((function(t){return t.classList.contains(Fe)}))}}function Vi(t){var e=ei(),i=ei();i.className=Ie,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=ei();function r(i,n){var r=Ti(e),o=r.box,a=r.content,s=r.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Hi(a,t.props),n.arrow?s?i.arrow!==n.arrow&&(o.removeChild(s),o.appendChild(Li(n.arrow))):o.appendChild(Li(n.arrow)):s&&o.removeChild(s)}return n.className=Ne,n.setAttribute("data-state","hidden"),Hi(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}Vi.$$tippy=!0;var $i=1,Oi=[],Pi=[];function Ri(t,e){var i,n,r,o,a,s,l,c=Ci(t,Object.assign({},xi,{},Ai(ti(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=$i++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:ei(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?ci(t):document}function H(){return Ti(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||di.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,xi.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,i){var n;(void 0===i&&(i=!0),z.forEach((function(i){i[t]&&i[t].apply(void 0,e)})),i)&&(n=_.props)[t].apply(n,e)}function O(){var e=_.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(i);if(_.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var r=e&&e.replace(n,"").trim();r?t.setAttribute(i,r):t.removeAttribute(i)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Oi=Oi.filter((function(t){return t!==f}))}function I(t){if(!(di.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(di.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var i=H().box;function n(t){t.target===i&&(pi(i,"remove",n),e())}if(0===t)return e();pi(i,"remove",a),pi(i,"add",n),a=n}function W(e,i,n){void 0===n&&(n=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(yi?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,i=t.eventType,n=t.handler,r=t.options;e.removeEventListener(i,n,r)})),g=[]}function K(t){var e,i=!1;if(_.state.isEnabled&&!J(t)&&!p){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&ri(t)&&Oi.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?i=!0:rt(t),"click"===t.type&&(h=!i),i&&!n&&ot(t)}}function Z(t){var e=t.target,i=M().contains(e)||x.contains(e);"mousemove"===t.type&&i||hi(nt().concat(x).map((function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!di.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,i=e.popperOptions,n=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Ti(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==i?void 0:i.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},i,{placement:n,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function it(){var t,e=_.props.appendTo,i=M();(t=_.props.interactive&&e===xi.appendTo||"parent"===e?i.parentNode:We(e,[i])).contains(x)||t.appendChild(x),tt()}function nt(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),n=S(),r=n[0],o=n[1];di.isTouch&&"hold"===r&&o&&(e=o),e?i=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?n=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var i=_.props,n=Ci(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=n,G(),i.interactiveDebounce!==n.interactiveDebounce&&(R(),f=Ge(Z,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?Ke(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(i,n),_.popperInstance&&(tt(),nt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=di.isTouch&&!_.props.touch,r=qe(_.props.duration,0,xi.duration);if(!(t||e||i||n||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();si([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),i=e.box,n=e.content;si([i,n],r),li([i,n],"visible")}O(),P(),Ze(Pi,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},it()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=qe(_.props.duration,1,xi.duration);if(!(t||e||i)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(si([o,a],n),li([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(n,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Oi,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),nt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Pi=Pi.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Ii(t,e){void 0===e&&(e={});var i=xi.plugins.concat(e.plugins||[]);vi();var n=Object.assign({},e,{plugins:i}),r=ai(t).reduce((function(t,e){var i=e&&Ri(e,n);return i&&t.push(i),t}),[]);return ii(t)?r[0]:r}Ii.defaultProps=xi,Ii.setDefaultProps=zi,Ii.currentInput=di;Object.assign({},xt,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});function Ni(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Ii.setDefaultProps({render:Vi});const Fi='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Bi='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',Di="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",ji="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",qi="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var Ui=Object.freeze({__proto__:null,camelize:Ni,base:Fi,lightBorder:Bi,light:Di,material:ji,translucent:qi});function Wi(t,e,i){if(!t.querySelector("#pb-popover-"+e)){const n=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,n);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=i,n.appendChild(r)}}function Gi(t,e){if(Wi(t,"base",Fi),e&&"none"!==e){const i=Ni(e),n=Ui[i];n&&Wi(t,i,n)}}class Xi extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const i=getComputedStyle(this).getPropertyValue(t);if(i)try{return JSON.parse(i)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Gi(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const i={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(i.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(i.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");i.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(i.onCreate=t=>{t.popper.classList.add(this.popupClass)}),i.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Ii(e,i)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
|
|
510
|
+
`}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,n,i=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n&&n(t,r)},{once:i})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(n=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n(t)},{once:!0})})}static emit(t,e=null,n=null){const i=n||{};e&&(i.key=e);const r=new CustomEvent(t,{detail:i});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.30.2";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",nt="right",it="left",rt="auto",ot=[tt,et,nt,it],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});bt(i)&&ft(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function St(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var n=Lt(t);bt(n)&&["html","body"].indexOf(ft(n))<0;){var i=Ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function Vt(t){for(var e=mt(t),n=Ht(t);n&&Et(n)&&"static"===Ct(n).position;)n=Ht(n);return n&&("html"===ft(n)||"body"===ft(n)&&"static"===Ct(n).position)?e:n||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,n){return Ot(t,Pt(e,n))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=kt(n.placement),l=$t(s),c=[it,nt].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,n),p=At(o),d="y"===l?tt:it,u="y"===l?et:nt,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],f=a[l]-n.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;n.modifiersData[i]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&St(e.elements.popper,i)&&(e.elements.arrow=i)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:Rt(Rt(e*i)/i)||0,y:Rt(Rt(n*i)/i)||0}}function Gt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=it,b=tt,y=window;if(l){var _=Vt(n),w="clientHeight",x="clientWidth";_===mt(n)&&"static"!==Ct(_=Mt(n)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-i.height,g*=s?1:-1),r===it&&(v=nt,d-=_[x]-i.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,Kt)})),s&&l.addEventListener("resize",n.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Kt)})),s&&l.removeEventListener("resize",n.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ie(t){var e=mt(t),n=Mt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+ne(t),y:s}}function re(t){var e,n=Mt(t),i=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ne(t),l=-i.scrollTop;return"rtl"===Ct(r||n).direction&&(s+=Ot(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var n;void 0===e&&(e=[]);var i=ae(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=mt(i),a=r?[o].concat(o.visualViewport||[],oe(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ie(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),n=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(n)?e.filter((function(t){return vt(t)&&St(t,n)&&"body"!==ft(t)})):[]}function de(t,e,n){var i="clippingParents"===e?pe(t):[].concat(e),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(e,n){var i=he(t,n);return e.top=Ot(i.top,e.top),e.right=Pt(i.right,e.right),e.bottom=Pt(i.bottom,e.bottom),e.left=Ot(i.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case tt:e={x:s,y:n.y-i.height};break;case et:e={x:s,y:n.y+n.height};break;case nt:e={x:n.x+n.width,y:l};break;case it:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(n[h]/2-i[h]/2);break;case st:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.boundary,a=void 0===o?lt:o,s=n.rootBoundary,l=void 0===s?ct:s,c=n.elementContext,h=void 0===c?ht:c,p=n.altBoundary,d=void 0!==p&&p,u=n.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[nt,et].indexOf(t)>=0?1:-1,n=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e}))}return A}function me(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(i),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,n){return e[n]=fe(t,{placement:n,boundary:r,rootBoundary:o,padding:a})[kt(n)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,h=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,g=void 0===u||u,f=n.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,n){return t.concat(kt(n)===rt?me(e,{placement:n,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):n)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?nt:it:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[i]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _e(t){return[tt,nt,et,it].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,i),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,n){var i=kt(t),r=[it,tt].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[it,nt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,n){return t[n]=xe(n,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}function ze(t){var e=t.state,n=t.name;e.modifiersData[n]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,p=n.padding,d=n.tether,u=void 0===d||d,g=n.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:it,E="y"===_?et:nt,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:it,Q="x"===_?et:nt,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[i]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,n){void 0===n&&(n=!1);var i=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&(("body"!==ft(e)||oe(i))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=ne(i))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function He(t){var e=Le(t);return gt.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){h(),r.options=Object.assign({},o,r.options,n),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(i,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,n=t.popper;if(Oe(e,n)){r.rects={reference:Me(e,Vt(n),"fixed"===r.options.strategy),popper:At(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,i=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:i}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function Ue(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,n){return t.indexOf(e)===n}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function tn(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function en(){return document.createElement("div")}function nn(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function rn(t){return Ue(t,"NodeList")}function on(t){return Ue(t,"MouseEvent")}function an(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function sn(t){return nn(t)?[t]:rn(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function ln(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function cn(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function hn(t){var e,n=Ke(t)[0];return(null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function pn(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-i+l>o,u=i-e.bottom-c>o,g=e.left-n+h>o,f=n-e.right-p>o;return d||u||g||f}))}function dn(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}var un={isTouch:!1},gn=0;function fn(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",mn))}function mn(){var t=performance.now();t-gn<20&&(un.isTouch=!1,document.removeEventListener("mousemove",mn)),gn=t}function vn(){var t=document.activeElement;if(an(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bn(){document.addEventListener("touchstart",fn,je),window.addEventListener("blur",vn)}var yn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",_n=/MSIE |Trident\//.test(yn),wn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xn={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kn=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},wn,{},xn),zn=Object.keys(kn),An=function(t){Object.keys(t).forEach((function(e){kn[e]=t[e]}))};function Sn(t){var e=(t.plugins||[]).reduce((function(e,n){var i=n.name,r=n.defaultValue;return i&&(e[i]=void 0!==t[i]?t[i]:r),e}),{});return Object.assign({},t,{},e)}function Cn(t,e){return(e?Object.keys(Sn(Object.assign({},kn,{plugins:e}))):zn).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(t){e[n]=i}return e}),{})}function En(t,e){var n=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Cn(t,e.plugins));return n.aria=Object.assign({},kn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var Mn=function(){return"innerHTML"};function Ln(t,e){t[Mn()]=e}function Hn(t){var e=en();return!0===t?e.className=Be:(e.className=De,nn(t)?e.appendChild(t):Ln(e,t)),e}function Tn(t,e){nn(e.content)?(Ln(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ln(t,e.content):t.textContent=e.content)}function Vn(t){var e=t.firstElementChild,n=Je(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Ne)})),arrow:n.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:n.find((function(t){return t.classList.contains(Fe)}))}}function $n(t){var e=en(),n=en();n.className=Ie,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=en();function r(n,i){var r=Vn(e),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Tn(a,t.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Hn(i.arrow))):o.appendChild(Hn(i.arrow)):s&&o.removeChild(s)}return i.className=Ne,i.setAttribute("data-state","hidden"),Tn(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}$n.$$tippy=!0;var On=1,Pn=[],Rn=[];function In(t,e){var n,i,r,o,a,s,l,c=En(t,Object.assign({},kn,{},Sn(tn(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=On++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:en(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?hn(t):document}function H(){return Vn(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||un.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,kn.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,n){var i;(void 0===n&&(n=!0),z.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(i=_.props)[t].apply(i,e)}function O(){var e=_.props.aria;if(e.content){var n="aria-"+e.content,i=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(_.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Pn=Pn.filter((function(t){return t!==f}))}function I(t){if(!(un.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(un.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var n=H().box;function i(t){t.target===n&&(dn(n,"remove",i),e())}if(0===t)return e();dn(n,"remove",a),dn(n,"add",i),a=i}function W(e,n,i){void 0===i&&(i=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(_n?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function K(t){var e,n=!1;if(_.state.isEnabled&&!J(t)&&!p){var i="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&on(t)&&Pn.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:rt(t),"click"===t.type&&(h=!n),n&&!i&&ot(t)}}function Z(t){var e=t.target,n=M().contains(e)||x.contains(e);"mousemove"===t.type&&n||pn(it().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!un.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Vn(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var n=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function nt(){var t,e=_.props.appendTo,n=M();(t=_.props.interactive&&e===kn.appendTo||"parent"===e?n.parentNode:We(e,[n])).contains(x)||t.appendChild(x),tt()}function it(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),i=S(),r=i[0],o=i[1];un.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?i=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var n=_.props,i=En(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=i,G(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),f=Ge(Z,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ke(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(n,i),_.popperInstance&&(tt(),it().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=un.isTouch&&!_.props.touch,r=qe(_.props.duration,0,kn.duration);if(!(t||e||n||i||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();ln([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),n=e.box,i=e.content;ln([n,i],r),cn([n,i],"visible")}O(),P(),Ze(Rn,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},nt()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=qe(_.props.duration,1,kn.duration);if(!(t||e||n)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(ln([o,a],i),cn([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(i,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Pn,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),it().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Rn=Rn.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Nn(t,e){void 0===e&&(e={});var n=kn.plugins.concat(e.plugins||[]);bn();var i=Object.assign({},e,{plugins:n}),r=sn(t).reduce((function(t,e){var n=e&&In(e,i);return n&&t.push(n),t}),[]);return nn(t)?r[0]:r}Nn.defaultProps=kn,Nn.setDefaultProps=An,Nn.currentInput=un;Object.assign({},xt,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});function Fn(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Nn.setDefaultProps({render:$n});const Bn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Dn='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',jn="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",qn="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",Un="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var Wn=Object.freeze({__proto__:null,camelize:Fn,base:Bn,lightBorder:Dn,light:jn,material:qn,translucent:Un});function Gn(t,e,n){if(!t.querySelector("#pb-popover-"+e)){const i=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,i);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=n,i.appendChild(r)}}function Xn(t,e){if(Gn(t,"base",Bn),e&&"none"!==e){const n=Fn(e),i=Wn[n];i&&Gn(t,n,i)}}class Kn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Xn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const n={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(n.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(n.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");n.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(n.onCreate=t=>{t.popper.classList.add(this.popupClass)}),n.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Nn(e,n)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
|
|
511
511
|
:host {
|
|
512
512
|
display: inline;
|
|
513
513
|
}
|
|
@@ -525,7 +525,7 @@ const W=i`
|
|
|
525
525
|
#link.persistent {
|
|
526
526
|
cursor: pointer;
|
|
527
527
|
}
|
|
528
|
-
`]}}customElements.define("pb-popover",
|
|
528
|
+
`]}}customElements.define("pb-popover",Kn);class Zn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},duration:{type:Number},scroll:{type:Boolean},highlightSelf:{type:Boolean,attribute:"highlight-self"},_className:{type:String}})}constructor(){super(),this.key=null,this.duration=0,this.scroll=!1,this.highlightSelf=!1,this._className="highlight-off"}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-highlight-on",this._highlightOn.bind(this)),this.subscribeTo("pb-highlight-off",this._highlightOff.bind(this))}command(t,e){super.command(t,e),this.disabled&&(this._className="highlight-off")}_mouseOver(){this.emitTo("pb-highlight-off",{source:this}),this.highlightSelf&&this._highlightOn({detail:{id:this.key}}),this.emitTo("pb-highlight-on",{id:this.key,source:this,scroll:this.scroll})}render(){return this.disabled?$`<slot></slot>`:$`<span id="content" class="${this._className}" @mouseover="${this._mouseOver}"><slot></slot></span>`}static get styles(){return P`
|
|
529
529
|
:host {
|
|
530
530
|
display: inline;
|
|
531
531
|
}
|
|
@@ -555,7 +555,7 @@ const W=i`
|
|
|
555
555
|
.highlight-off {
|
|
556
556
|
background-color: inherit;
|
|
557
557
|
}
|
|
558
|
-
`}_highlightOn(t){t.detail.source!=this&&t.detail.id===this.key&&(this._className="highlight-on",t.detail.scroll&&this.scrollIntoView({behaviour:"smooth"}),this.duration>0&&setTimeout(function(){this._className="highlight-off"}.bind(this),this.duration))}_highlightOff(t){t.detail.source!=this&&(this._className="highlight-off")}}customElements.define("pb-highlight",
|
|
558
|
+
`}_highlightOn(t){t.detail.source!=this&&t.detail.id===this.key&&(this._className="highlight-on",t.detail.scroll&&this.scrollIntoView({behaviour:"smooth"}),this.duration>0&&setTimeout(function(){this._className="highlight-off"}.bind(this),this.duration))}_highlightOff(t){t.detail.source!=this&&(this._className="highlight-off")}}customElements.define("pb-highlight",Zn);class Qn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{xmlId:{type:String,attribute:"xml-id"},nodeId:{type:String,attribute:"node-id",reflect:!0},hash:{type:String,reflect:!0},path:{type:String},odd:{type:String},history:{type:Boolean}})}constructor(){super(),this.history=!0}connectedCallback(){super.connectedCallback(),this._id=this.nodeId,this.subscribeTo("pb-visible",t=>{if(this.nodeId){const[e,n]=t.detail.data.split(/\s*,\s*/);this.nodeId!==e||this.hash&&this.hash!==n?this.classList.remove("active"):(this.classList.add("active"),this.scrollIntoView({block:"nearest"}),this.dispatchEvent(new CustomEvent("pb-collapse-open",{composed:!0,bubbles:!0})))}}),this._content=this.innerHTML}render(){return $`<a href="#" @click="${this._onClick}">${E(this._content)}</a>`}createRenderRoot(){return this}_onClick(t){t.preventDefault();const e={position:null};this.xmlId?(e.id=this.xmlId,this.history&&this.setParameter("id",this.xmlId)):this.nodeId&&(e.position=this.nodeId,this.history&&this.setParameter("root",this.nodeId)),this.path&&(e.path=this.path,this.history&&this.setPath(this.path)),this.odd&&(e.odd=this.odd,this.history&&this.setParameter("odd",this.odd)),this.hash?(e.hash=this.hash,this.history&&(this.getUrl().hash=this.hash)):this.history&&(this.getUrl().hash=""),this.pushHistory("link click"),this.emitTo("pb-refresh",e)}}customElements.define("pb-link",Qn);class Yn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{facs:{type:String},coordinates:{type:Array},trigger:{type:String},emitOnLoad:{type:Boolean,attribute:"emit-on-load"}})}constructor(){super(),this.trigger="mouseover"}connectedCallback(){super.connectedCallback()}firstUpdated(){const t=this.shadowRoot.querySelector("a");switch(this.trigger){case"click":t.addEventListener("click",this._linkListener.bind(this));break;default:t.addEventListener("mouseover",this._linkListener.bind(this))}this.emitOnLoad&&this._trigger()}render(){return $`<a href="#"><slot></slot></a>`}static get styles(){return P`
|
|
559
559
|
:host {
|
|
560
560
|
}
|
|
561
561
|
|
|
@@ -563,12 +563,12 @@ const W=i`
|
|
|
563
563
|
text-decoration: none;
|
|
564
564
|
color: inherit;
|
|
565
565
|
}
|
|
566
|
-
`}_linkListener(t){t.preventDefault(),this._trigger()}_trigger(){console.log("<facs-link> %s %o",this.facs,this.coordinates),this.emitTo("pb-show-annotation",{file:this.facs,coordinates:this.coordinates})}}customElements.define("pb-facs-link",
|
|
566
|
+
`}_linkListener(t){t.preventDefault(),this._trigger()}_trigger(){console.log("<facs-link> %s %o",this.facs,this.coordinates),this.emitTo("pb-show-annotation",{file:this.facs,coordinates:this.coordinates})}}customElements.define("pb-facs-link",Yn);
|
|
567
567
|
/**
|
|
568
568
|
* Copyright 2018 The Pennsylvania State University
|
|
569
569
|
* @license Apache-2.0, see License.md for full text.
|
|
570
570
|
*/
|
|
571
|
-
class
|
|
571
|
+
class Jn{constructor(){this.load=(t,e,n=!1)=>{let i=window.ESGlobalBridge.imports&&window.ESGlobalBridge.imports[t];if(!(!n&&window.ESGlobalBridge.webpack&&window.ESGlobalBridge.webpack[t])&&!i)return new Promise((n,i)=>{const r=document.createElement("script");r.src=e,r.setAttribute("data-name",t),window.ESGlobalBridge.imports[t]=e,r.onload=()=>{n(window.ESGlobalBridge.imports[t]),window.ESGlobalBridge.imports[t]=!0,setTimeout(()=>{const n=new CustomEvent(`es-bridge-${t}-loaded`,{bubbles:!0,cancelable:!0,detail:{name:t,location:e}});document.dispatchEvent(n)},100)},r.onerror=()=>{i(new Error(`Failed to load ${t} script with location ${e}.`)),delete window.ESGlobalBridge.imports[t],window.ESGlobalBridge.imports[t]=!1},document.documentElement.appendChild(r)})}}}window.ESGlobalBridge=window.ESGlobalBridge||{},window.ESGlobalBridge.imports=window.ESGlobalBridge.imports||{},window.ESGlobalBridge.requestAvailability=()=>(window.ESGlobalBridge.instance||(window.ESGlobalBridge.instance=new Jn),window.ESGlobalBridge);window.ESGlobalBridge.requestAvailability();function ti(t,e){return window.ESGlobalBridge.requestAvailability(),new Promise(n=>{window.ESGlobalBridge.instance.load(t,e),window.addEventListener(`es-bridge-${t}-loaded`,()=>n(),{once:!0})})}function ei(t,e){let n=t.getRootNode();n.nodeType===Node.DOCUMENT_NODE&&(n=n.head);const i=n.querySelector("#"+e.id);i&&i.parentNode.removeChild(i),n.appendChild(e)}function ni(t,e){e.forEach(t=>{if(t.hasChildNodes()){const e=t.hasAttribute("display")||!1,n=t.querySelector("math"),i=window.MathJax.getMetricsFor(t.parentNode,e);let r,o;i.display=e,n?(o=n.outerHTML,r=window.MathJax.mathml2chtml(o,i)):(window.MathJax.texReset(),o=t.innerHTML,r=window.MathJax.tex2chtml(o,i)),t.innerHTML="",t.appendChild(r),t.setAttribute("loaded","loaded"),t.setAttribute("source",o)}}),ei(t,window.MathJax.chtmlStylesheet())}function ii(t){const e=t.querySelectorAll("pb-formula");if(console.log(`<pb-formula> Found ${e.length} elements to typeset ...`),e.length>0){if(window.MathJax)return void ni(t,e);const n=t.querySelector("pb-formula[menu]");window.MathJax={startup:{typeset:!1,pageReady:()=>ni(t,e)},options:{enableMenu:null!==n}},ti("MathJax","https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")}}class ri extends V{static get properties(){return Object.assign({display:{type:Boolean},menu:{type:Boolean},loaded:{type:Boolean},source:{type:String}},super.properties)}constructor(){super(),this.display=!1}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"loaded":this.loaded=!0;break;case"source":this.source=n}}render(){return this.hasChildNodes()?this.loaded?$`<div id="content" class="${this.display?"block":""}"><slot></slot></div>`:$`<span class="loading">${r("dialogs.loading")}</span>`:null}static get styles(){return P`
|
|
572
572
|
:host {
|
|
573
573
|
display: inline-block;
|
|
574
574
|
}
|
|
@@ -578,7 +578,7 @@ class Yi{constructor(){this.load=(t,e,i=!1)=>{let n=window.ESGlobalBridge.import
|
|
|
578
578
|
.loading {
|
|
579
579
|
color: #808080;
|
|
580
580
|
}
|
|
581
|
-
`}}customElements.define("pb-formula",
|
|
581
|
+
`}}customElements.define("pb-formula",ri);class oi extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{url:{type:String},expand:{type:Boolean},src:{type:String},container:{type:String},auto:{type:Boolean},loadOnce:{type:Boolean},fixLinks:{type:Boolean,attribute:"fix-links"},start:{type:Number},useLanguage:{type:Boolean,attribute:"use-language"},history:{type:Boolean},event:{type:String},userParams:{type:Object}})}constructor(){super(),this.auto=!1,this.loadOnce=!1,this.history=!1,this.event="pb-load",this.loaded=!1,this.language=null}connectedCallback(){super.connectedCallback(),this.subscribeTo(this.event,t=>{if(this.history&&t.detail&&t.detail.params){const e=t.detail.params.start;e&&(this.setParameter("start",e),this.pushHistory("pagination",{start:e}))}oi.waitOnce("pb-page-ready",()=>{this.load(t)})}),this.history&&window.addEventListener("popstate",t=>{t.preventDefault(),t.state&&t.state.start&&t.state.start!==this.start&&(this.start=t.state.start,this.load())}),this.subscribeTo("pb-toggle",t=>{this.toggleFeature(t)}),this.subscribeTo("pb-i18n-update",t=>{const e=this.language&&this.language!==t.detail.language;this.language=t.detail.language,this.useLanguage&&e&&this.load()},[]),this.signalReady()}firstUpdated(){this.auto?(this.start=this.getParameter("start",this.start),oi.waitOnce("pb-page-ready",t=>{t&&t.language&&(this.language=t.language),this.wait(()=>this.load())})):oi.waitOnce("pb-page-ready",t=>{t&&t.language&&(this.language=t.language)})}render(){return $`
|
|
582
582
|
<slot></slot>
|
|
583
583
|
<iron-ajax
|
|
584
584
|
id="loadContent"
|
|
@@ -601,7 +601,7 @@ class Yi{constructor(){this.load=(t,e,i=!1)=>{let n=window.ESGlobalBridge.import
|
|
|
601
601
|
:host {
|
|
602
602
|
display: block;
|
|
603
603
|
}
|
|
604
|
-
`}toggleFeature(t){this.userParams=t.detail.properties,console.log("<pb-load> toggle feature %o",this.userParams),"refresh"===t.detail.action&&this.load()}getURL(t){let e=this.url;return this.expand&&(e=e.replace(/{([^})]+)}/g,(e,
|
|
604
|
+
`}toggleFeature(t){this.userParams=t.detail.properties,console.log("<pb-load> toggle feature %o",this.userParams),"refresh"===t.detail.action&&this.load()}getURL(t){let e=this.url;return this.expand&&(e=e.replace(/{([^})]+)}/g,(e,n)=>{if(!t[n])return"";const i=encodeURIComponent(t[n]||n);return delete t[n],i})),this.toAbsoluteURL(e)}load(t){if(!this.url)return;if(this.loadOnce&&this.loaded)return;this.emitTo("pb-start-update");let e={};t&&(t instanceof Event?t.detail&&t.detail.params&&(e=t.detail.params):e=t);const n=this.getDocument();n&&(e.doc=n.path),this.start&&!e.start&&(e.start=this.start),this.language&&(e.language=this.language),e=this.prepareParameters(e);const i=this.getURL(e);console.log("<pb-load> Loading %s with parameters %o",i,e);const r=this.shadowRoot.getElementById("loadContent");r.params=e,r.url=i,r.generateRequest(),this.loadOnce&&(this.loaded=!0)}prepareParameters(t){return this.userParams?Object.assign(t,this.userParams):t}_handleContent(t){this._parseHeaders(t.detail.xhr);const e=this.shadowRoot.getElementById("loadContent").lastResponse;if(this.container)this.style.display="none",document.querySelectorAll(this.container).forEach(t=>{t.innerHTML=e,this._fixLinks(t),this._onLoad(t)});else{this.style.display="",this._clearContent();const t=document.createElement("div");t.innerHTML=e,t.slot="",this.appendChild(t),this._fixLinks(t),this._onLoad(t)}this.emitTo("pb-end-update")}_clearContent(){const t=this.shadowRoot.querySelector("slot:not([name])");t&&t.assignedNodes().forEach(t=>t.parentNode.removeChild(t))}_handleError(){this.emitTo("pb-end-update");const t=this.shadowRoot.getElementById("loadContent"),{response:e}=t.lastError;let n;n=e?e.description:'<pb-i18n key="dialogs.serverError"></pb-i18n>';const i=this.shadowRoot.getElementById("errorDialog");i.querySelector("paper-dialog-scrollable").innerHTML=`<p><pb-i18n key="dialogs.serverError"></pb-i18n>: ${n} </p>`,i.open()}_parseHeaders(t){const e=t.getResponseHeader("pb-total"),n=t.getResponseHeader("pb-start");this.start!==n&&(this.start=parseInt(n)),this.emitTo("pb-results-received",{count:e?parseInt(e,10):0,start:this.start,params:this.shadowRoot.getElementById("loadContent").params})}_fixLinks(t){ii(t),this.fixLinks&&(t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src"),n=new URL(e,this.getEndpoint()+"/");t.src=n}),t.querySelectorAll("a").forEach(t=>{const e=t.getAttribute("href"),n=new URL(e,this.getEndpoint()+"/");t.href=n}))}_onLoad(t){}}customElements.define("pb-load",oi);class ai extends oi{static get properties(){return Object.assign(Object.assign({},super.properties),{},{sortBy:{type:String,attribute:"sort-by"},sortOptions:{type:Array,attribute:"sort-options"},sortLabel:{type:String},filter:{type:String},filterBy:{type:String,attribute:"filter-by"},filterOptions:{type:Array,attribute:"filter-options"},filterByLabel:{type:String},filterPlaceholderLabel:{type:String},collection:{type:String},facets:{type:Object},login:{type:String},group:{type:String},subforms:{type:String},_file:{type:String},_selected:{type:Array},_allowModification:{type:Boolean},_suggestions:{type:Array}})}constructor(){super(),this.sortOptions=[],this.sortLabel="browse.sort",this.sortBy="default",this.filter="",this.filterOptions=[{label:"Title",value:"title"}],this.filterByLabel="browse.filter",this.filterPlaceholderLabel="browse.filterPlaceholder",this.filterBy="title",this._allowModification=!1,this._suggestions=[]}connectedCallback(){super.connectedCallback();const t=this.getParameter("sort");t&&(this.sortBy=t);const e=this.getParameter("filter");e&&(this.filter=e,this.filterBy=this.getParameter("filterBy",this.filterBy)),this.facets=this.getParametersMatching(/^facet-.*$/),this.collection=this.getParameter("collection"),this.subscribeTo("pb-search-resubmit",this._facets.bind(this)),this.subscribeTo("pb-login",t=>{t.detail.userChanged&&this._facets(t)},[]),document.addEventListener("pb-i18n-update",()=>{const t=this.shadowRoot.getElementById("sort-list");let e=t.selected;t.selected=void 0,t.selected=e;const n=this.shadowRoot.getElementById("filter-list");e=n.selected,n.selected=void 0,n.selected=e})}firstUpdated(){ai.waitOnce("pb-page-ready",t=>{const e=this.shadowRoot.getElementById("autocompleteLoader");I(t.apiVersion,"1.0.0")>=0?(e.url=t.endpoint+"/api/search/autocomplete",this.url||(this.url="api/collection")):(e.url=t.endpoint+"/modules/autocomplete.xql",this.url||(this.url="collection/"))}),this.shadowRoot.getElementById("autocomplete").addEventListener("autocomplete-change",this._autocomplete.bind(this));const t=document.getElementById(this.login);t?(this.subscribeTo("pb-login",t=>{this._allowModification=this._loggedIn(t.detail.user,t.detail.group)},[]),this._allowModification=t.loggedIn&&this._loggedIn(t.user,t.groups)):console.error("<pb-browse-docs> connected pb-login element not found!"),this.shadowRoot.getElementById("sort-list").addEventListener("selected-item-changed",this._sort.bind(this)),this.shadowRoot.getElementById("delete").addEventListener("click",this._handleDelete.bind(this)),super.firstUpdated()}render(){return $`
|
|
605
605
|
<custom-style>
|
|
606
606
|
<style>
|
|
607
607
|
:host {
|
|
@@ -708,7 +708,7 @@ class Yi{constructor(){this.load=(t,e,i=!1)=>{let n=window.ESGlobalBridge.import
|
|
|
708
708
|
.hidden {
|
|
709
709
|
display: none;
|
|
710
710
|
}
|
|
711
|
-
`}getURL(t){const e=super.getURL(t);return this.collection?`${e}/${this.collection}`:e}prepareParameters(t){return(t=this._paramsFromSubforms(t)).sort=this.sortBy,this.filter&&(t.filter=this.filter,t.browse=this.filterBy),this.facets&&(t=Object.assign(t,this.facets)),t}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}getSelected(){const t=[];return this.container?document.querySelectorAll(this.container).forEach(e=>e.querySelectorAll(".document-select paper-checkbox[checked]").forEach(e=>{t.push(e.value)})):this.querySelectorAll(".document-select paper-checkbox[checked]").forEach(e=>{t.push(e.value)}),t}_filter(){const t=this.shadowRoot.getElementById("filterString").value,e=this.shadowRoot.getElementById("filter-list").selected;void 0!==t&&(console.log("<pb-browse-docs> Filter by %s",t),this.filter=t,this.setParameter("filter",t),this.setParameter("filterBy",e),this.pushHistory("filter docs"),this.load())}_filterChanged(){const t=this.shadowRoot.getElementById("filter-list").selected;t&&t!==this.filterBy&&(console.log("<pb-browse-docs> Filtering on %s",t),this.filterBy=t)}_sort(){const t=this.shadowRoot.getElementById("sort-list").selected;t&&t!==this.sortBy&&(console.log("<pb-browse-docs> Sorting by %s",t),this.sortBy=t,this.setParameter("sort",t),this.pushHistory("sort docs"),this.load())}_facets(t){if(t.detail&&t.detail.params){this.clearParametersMatching(/^(all-|facet-).*/);for(let e in t.detail.params)this.setParameter(e,t.detail.params[e]);this.facets=t.detail.params,this.start=1,this.pushHistory("facets")}this.load()}_onLoad(t){window.scrollTo(0,0);const e=t.querySelector("[data-root]"),
|
|
711
|
+
`}getURL(t){const e=super.getURL(t);return this.collection?`${e}/${this.collection}`:e}prepareParameters(t){return(t=this._paramsFromSubforms(t)).sort=this.sortBy,this.filter&&(t.filter=this.filter,t.browse=this.filterBy),this.facets&&(t=Object.assign(t,this.facets)),t}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}getSelected(){const t=[];return this.container?document.querySelectorAll(this.container).forEach(e=>e.querySelectorAll(".document-select paper-checkbox[checked]").forEach(e=>{t.push(e.value)})):this.querySelectorAll(".document-select paper-checkbox[checked]").forEach(e=>{t.push(e.value)}),t}_filter(){const t=this.shadowRoot.getElementById("filterString").value,e=this.shadowRoot.getElementById("filter-list").selected;void 0!==t&&(console.log("<pb-browse-docs> Filter by %s",t),this.filter=t,this.setParameter("filter",t),this.setParameter("filterBy",e),this.pushHistory("filter docs"),this.load())}_filterChanged(){const t=this.shadowRoot.getElementById("filter-list").selected;t&&t!==this.filterBy&&(console.log("<pb-browse-docs> Filtering on %s",t),this.filterBy=t)}_sort(){const t=this.shadowRoot.getElementById("sort-list").selected;t&&t!==this.sortBy&&(console.log("<pb-browse-docs> Sorting by %s",t),this.sortBy=t,this.setParameter("sort",t),this.pushHistory("sort docs"),this.load())}_facets(t){if(t.detail&&t.detail.params){this.clearParametersMatching(/^(all-|facet-).*/);for(let e in t.detail.params)this.setParameter(e,t.detail.params[e]);this.facets=t.detail.params,this.start=1,this.pushHistory("facets")}this.load()}_onLoad(t){window.scrollTo(0,0);const e=t.querySelector("[data-root]"),n=e&&e.getAttribute("data-root"),i=e&&e.classList.contains("writable");this.emitTo("pb-collection",{writable:i,collection:n}),document.querySelectorAll("[can-write]").forEach(t=>{t.disabled=!i}),t.querySelectorAll("[data-collection]").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),this.collection=t.getAttribute("data-collection"),this.setParameter("collection",this.collection),this.pushHistory("browse collection"),console.log("<pb-browse-docs> loading collection %s",this.collection),this.load()})})}_handleDelete(t,e){const n=this.shadowRoot.getElementById("deleteDialog"),i=this.getSelected();i.length>0&&(this._selected=i,n.open())}_confirmDelete(){if(!this._file&&!this._selected)return;let t;t=this._selected?this._selected:[this._file],console.log("<pb-browse-docs> Deleting %o",this._file);const e={action:"delete","docs[]":t};this._file=null,this._selected=null,this.load(e)}_loggedIn(t,e){return null!=t&&(!this.group||!!e&&e.indexOf(this.group)>-1)}_canModify(t){return t?"":"hidden"}_autocomplete(t){const e=this.shadowRoot.getElementById("autocompleteLoader");e.params={query:t.detail.option.text,field:this.filterBy},e.generateRequest()}_updateSuggestions(){const t=this.shadowRoot.getElementById("autocomplete"),e=this.shadowRoot.getElementById("autocompleteLoader");t.suggestions(e.lastResponse)}_handleEnter(t){13==t.keyCode&&this._filter()}}customElements.define("pb-browse-docs",ai);class si extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{path:{type:String,reflect:!0},rootPath:{type:String,attribute:"root-path"},odd:{type:String,reflect:!0},view:{type:String,reflect:!0},sourceView:{type:String,attribute:"source-view"}})}constructor(){super(),this.path="",this.rootPath=""}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),e&&(console.log("<pb-document> Emit update event"),this.emitTo("pb-document",this))}getFileName(){return this.path.replace(/^.*?([^\/]+)$/,"$1")}getFullPath(){return this.rootPath+"/"+this.path}}customElements.define("pb-document",si);class li extends(M(R(V))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{direction:{type:String},keyboard:{type:String}})}constructor(){super(),this.direction="forward",this.disabled=!0}connectedCallback(){super.connectedCallback(),this.keyboard&&(this.hotkeys={next:this.keyboard}),this.subscribeTo("pb-update",this._update.bind(this)),this.registerHotkey("next",()=>this.emitTo("pb-navigate",{direction:this.direction})),this.signalReady()}_update(t){"forward"===this.direction?t.detail.data.next?this.disabled=!1:this.disabled=!0:t.detail.data.previous?this.disabled=!1:this.disabled=!0}_handleClick(){this.emitTo("pb-navigate",{direction:this.direction})}render(){return $`
|
|
712
712
|
<a id="button" @click="${this._handleClick}"><slot></slot></a>
|
|
713
713
|
`}static get styles(){return P`
|
|
714
714
|
:host {
|
|
@@ -717,7 +717,7 @@ class Yi{constructor(){this.load=(t,e,i=!1)=>{let n=window.ESGlobalBridge.import
|
|
|
717
717
|
:host([disabled]) {
|
|
718
718
|
display: none;
|
|
719
719
|
}
|
|
720
|
-
`}}function cn(t){return(cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hn(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function pn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})))),n.forEach((function(e){hn(t,e,i[e])}))}return t}function dn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function un(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function gn(t,e,i){return e&&un(t.prototype,e),i&&un(t,i),t}function fn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mn(t,e){return!e||"object"!==cn(e)&&"function"!=typeof e?fn(t):e}function vn(t){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bn(t,e){return(bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bn(t,e)}customElements.define("pb-navigation",ln);var _n={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},wn=new(function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dn(this,t),this.init(e,i)}return gn(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||_n,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,i,n){return n&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(i).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,pn({},{prefix:"".concat(this.prefix,":").concat(e,":")},this.options))}}]),t}()),xn=function(){function t(){dn(this,t),this.observers={}}return gn(t,[{key:"on",value:function(t,e){var i=this;return t.split(" ").forEach((function(t){i.observers[t]=i.observers[t]||[],i.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];this.observers[t]&&[].concat(this.observers[t]).forEach((function(t){t.apply(void 0,i)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(e){e.apply(e,[t].concat(i))}))}}]),t}();function kn(){var t,e,i=new Promise((function(i,n){t=i,e=n}));return i.resolve=t,i.reject=e,i}function zn(t){return null==t?"":""+t}function An(t,e,i){t.forEach((function(t){e[t]&&(i[t]=e[t])}))}function Sn(t,e,i){function n(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function r(){return!t||"string"==typeof t}for(var o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(r())return{};var a=n(o.shift());!t[a]&&i&&(t[a]=new i),t=t[a]}return r()?{}:{obj:t,k:n(o.shift())}}function Cn(t,e,i){var n=Sn(t,e,Object);n.obj[n.k]=i}function En(t,e,i,n){var r=Sn(t,e,Object),o=r.obj,a=r.k;o[a]=o[a]||[],n&&(o[a]=o[a].concat(i)),n||o[a].push(i)}function Mn(t,e){var i=Sn(t,e),n=i.obj,r=i.k;if(n)return n[r]}function Ln(t,e,i){var n=Mn(t,i);return void 0!==n?n:Mn(e,i)}function Hn(t,e,i){for(var n in e)"__proto__"!==n&&(n in t?"string"==typeof t[n]||t[n]instanceof String||"string"==typeof e[n]||e[n]instanceof String?i&&(t[n]=e[n]):Hn(t[n],e[n],i):t[n]=e[n]);return t}function Tn(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Vn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function $n(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return Vn[t]})):t}var On="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Pn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return dn(this,e),i=mn(this,vn(e).call(this)),On&&xn.call(fn(i)),i.data=t||{},i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i}return yn(e,xn),gn(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=[t,e];return i&&"string"!=typeof i&&(o=o.concat(i)),i&&"string"==typeof i&&(o=o.concat(r?i.split(r):i)),t.indexOf(".")>-1&&(o=t.split(".")),Mn(this.data,o)}},{key:"addResource",value:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[t,e];i&&(a=a.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(n=e,e=(a=t.split("."))[1]),this.addNamespaces(e),Cn(this.data,a,n),r.silent||this.emit("added",t,e,i,n)}},{key:"addResources",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in i)"string"!=typeof i[r]&&"[object Array]"!==Object.prototype.toString.apply(i[r])||this.addResource(t,e,r,i[r],{silent:!0});n.silent||this.emit("added",t,e,i)}},{key:"addResourceBundle",value:function(t,e,i,n,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(n=i,i=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var s=Mn(this.data,a)||{};n?Hn(s,i,r):s=pn({},s,i),Cn(this.data,a,s),o.silent||this.emit("added",t,e,i)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?pn({},{},this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),e}(),Rn={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,i,n,r){var o=this;return t.forEach((function(t){o.processors[t]&&(e=o.processors[t].process(e,i,n,r))})),e}},In={},Nn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dn(this,e),i=mn(this,vn(e).call(this)),On&&xn.call(fn(i)),An(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,fn(i)),i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=wn.create("translator"),i}return yn(e,xn),gn(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=this.resolve(t,e);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(t,e){var i=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,r=e.ns||this.options.defaultNS;if(i&&t.indexOf(i)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:r};var a=t.split(i);(i!==n||i===n&&this.options.ns.indexOf(a[0])>-1)&&(r=a.shift()),t=a.join(n)}return"string"==typeof r&&(r=[r]),{key:t,namespaces:r}}},{key:"translate",value:function(t,e,i){var n=this;if("object"!==cn(e)&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,o=this.extractFromKey(t[t.length-1],e),a=o.key,s=o.namespaces,l=s[s.length-1],c=e.lng||this.language,h=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(h){var p=e.nsSeparator||this.options.nsSeparator;return l+p+a}return a}var d=this.resolve(t,e),u=d&&d.res,g=d&&d.usedKey||a,f=d&&d.exactUsedKey||a,m=Object.prototype.toString.apply(u),v=["[object Number]","[object Function]","[object RegExp]"],b=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&u&&("string"!=typeof u&&"boolean"!=typeof u&&"number"!=typeof u)&&v.indexOf(m)<0&&("string"!=typeof b||"[object Array]"!==m)){if(!e.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,e):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");if(r){var _="[object Array]"===m,w=_?[]:{},x=_?f:g;for(var k in u)if(Object.prototype.hasOwnProperty.call(u,k)){var z="".concat(x).concat(r).concat(k);w[k]=this.translate(z,pn({},e,{joinArrays:!1,ns:s})),w[k]===z&&(w[k]=u[k])}u=w}}else if(y&&"string"==typeof b&&"[object Array]"===m)(u=u.join(b))&&(u=this.extendTranslation(u,t,e,i));else{var A=!1,S=!1;if(!this.isValidLookup(u)&&void 0!==e.defaultValue){if(A=!0,void 0!==e.count){var C=this.pluralResolver.getSuffix(c,e.count);u=e["defaultValue".concat(C)]}u||(u=e.defaultValue)}this.isValidLookup(u)||(S=!0,u=a);var E=e.defaultValue&&e.defaultValue!==u&&this.options.updateMissing;if(S||A||E){if(this.logger.log(E?"updateKey":"missingKey",c,l,a,E?e.defaultValue:u),r){var M=this.resolve(a,pn({},e,{keySeparator:!1}));M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var L=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&H&&H[0])for(var T=0;T<H.length;T++)L.push(H[T]);else"all"===this.options.saveMissingTo?L=this.languageUtils.toResolveHierarchy(e.lng||this.language):L.push(e.lng||this.language);var V=function(t,i){n.options.missingKeyHandler?n.options.missingKeyHandler(t,l,i,E?e.defaultValue:u,E,e):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(t,l,i,E?e.defaultValue:u,E,e),n.emit("missingKey",t,l,i,u)};if(this.options.saveMissing){var $=void 0!==e.count&&"string"!=typeof e.count;this.options.saveMissingPlurals&&$?L.forEach((function(t){n.pluralResolver.getPluralFormsOfKey(t,a).forEach((function(e){return V([t],e)}))})):V(L,a)}}u=this.extendTranslation(u,t,e,d,i),S&&u===a&&this.options.appendNamespaceToMissingKey&&(u="".concat(l,":").concat(a)),S&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(u))}return u}},{key:"extendTranslation",value:function(t,e,i,n,r){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,i,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(pn({},i,{interpolation:pn({},this.options.interpolation,i.interpolation)}));var a,s=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var l=t.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(c=pn({},this.options.interpolation.defaultVariables,c)),t=this.interpolator.interpolate(t,c,i.lng||this.language,i),s){var h=t.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(i.nest=!1)}!1!==i.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return r&&r[0]===i[0]?(o.logger.warn("It seems you are nesting recursively key: ".concat(i[0]," in key: ").concat(e[0])),null):o.translate.apply(o,i.concat([e]))}),i)),i.interpolation&&this.interpolator.reset()}var p=i.postProcess||this.options.postProcess,d="string"==typeof p?[p]:p;return null!=t&&d&&d.length&&!1!==i.applyPostProcessor&&(t=Rn.handle(d,t,e,this.options&&this.options.postProcessPassResolved?pn({i18nResolved:n},i):i,this)),t}},{key:"resolve",value:function(t){var e,i,n,r,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var l=a.extractFromKey(t,s),c=l.key;i=c;var h=l.namespaces;a.options.fallbackNS&&(h=h.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,u=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);h.forEach((function(t){a.isValidLookup(e)||(o=t,!In["".concat(u[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(In["".concat(u[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(i,'" for languages "').concat(u.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((function(i){if(!a.isValidLookup(e)){r=i;var o,l,h=c,u=[h];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(u,c,i,t,s);else p&&(o=a.pluralResolver.getSuffix(i,s.count)),p&&d&&u.push(h+o),d&&u.push(h+="".concat(a.options.contextSeparator).concat(s.context)),p&&u.push(h+=o);for(;l=u.pop();)a.isValidLookup(e)||(n=l,e=a.getResource(i,t,l,s))}})))}))}})),{res:e,usedKey:i,exactUsedKey:n,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,i,n):this.resourceStore.getResource(t,e,i,n)}}]),e}();function Fn(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Bn=function(){function t(e){dn(this,t),this.options=e,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wn.create("languageUtils")}return gn(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map((function(t){return t.toLowerCase()})):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),e.indexOf(i[1].toLowerCase())>-1&&(i[1]=Fn(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),e.indexOf(i[1].toLowerCase())>-1&&(i[1]=Fn(i[1].toLowerCase())),e.indexOf(i[2].toLowerCase())>-1&&(i[2]=Fn(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,i=this;return t?(t.forEach((function(t){if(!e){var n=i.formatLanguageCode(t);i.options.supportedLngs&&!i.isSupportedCode(n)||(e=n)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var n=i.getLanguagePartFromCode(t);if(i.isSupportedCode(n))return e=n;e=i.options.supportedLngs.find((function(t){if(0===t.indexOf(n))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var i=t[e];return i||(i=t[this.getScriptPartFromCode(e)]),i||(i=t[this.formatLanguageCode(e)]),i||(i=t[this.getLanguagePartFromCode(e)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,e){var i=this,n=this.getFallbackCodes(e||this.options.fallbackLng||[],t),r=[],o=function(t){t&&(i.isSupportedCode(t)?r.push(t):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),n.forEach((function(t){r.indexOf(t)<0&&o(i.formatLanguageCode(t))})),r}}]),t}(),Dn=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],jn={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function qn(){var t={};return Dn.forEach((function(e){e.lngs.forEach((function(i){t[i]={numbers:e.nr,plurals:jn[e.fc]}}))})),t}var Un=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dn(this,t),this.languageUtils=e,this.options=i,this.logger=wn.create("pluralResolver"),this.rules=qn()}return gn(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var i=this,n=[],r=this.getRule(t);return r?(r.numbers.forEach((function(r){var o=i.getSuffix(t,r);n.push("".concat(e).concat(o))})),n):n}},{key:"getSuffix",value:function(t,e){var i=this,n=this.getRule(t);if(n){var r=n.noAbs?n.plurals(e):n.plurals(Math.abs(e)),o=n.numbers[r];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),Wn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};dn(this,t),this.logger=wn.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return gn(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:$n,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?Tn(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?Tn(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?Tn(e.nestingPrefix):e.nestingPrefixEscaped||Tn("$t("),this.nestingSuffix=e.nestingSuffix?Tn(e.nestingSuffix):e.nestingSuffixEscaped||Tn(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(t,e,i,n){var r,o,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var h=function(t){if(t.indexOf(s.formatSeparator)<0){var r=Ln(e,l,t);return s.alwaysFormat?s.format(r,void 0,i):r}var o=t.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(Ln(e,l,a),c,i,n)};this.resetRegExp();var p=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,d=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return s.escapeValue?c(s.escape(t)):c(t)}}].forEach((function(e){for(a=0;r=e.regex.exec(t);){if(void 0===(o=h(r[1].trim())))if("function"==typeof p){var i=p(t,r,n);o="string"==typeof i?i:""}else{if(d){o=r[0];continue}s.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(t)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=zn(o));if(t=t.replace(r[0],e.safeValue(o)),e.regex.lastIndex=0,++a>=s.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var i,n,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=pn({},o);function s(t,e){var i=this.nestingOptionsSeparator;if(t.indexOf(i)<0)return t;var n=t.split(new RegExp("".concat(i,"[ ]*{"))),r="{".concat(n[1]);t=n[0],r=(r=this.interpolate(r,a)).replace(/'/g,'"');try{a=JSON.parse(r),e&&(a=pn({},e,a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(i).concat(r)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;i=this.nestingRegexp.exec(t);){var l=[],c=!1;if(i[0].includes(this.formatSeparator)&&!/{.*}/.test(i[1])){var h=i[1].split(this.formatSeparator).map((function(t){return t.trim()}));i[1]=h.shift(),l=h,c=!0}if((n=e(s.call(this,i[1].trim(),a),a))&&i[0]===t&&"string"!=typeof n)return n;"string"!=typeof n&&(n=zn(n)),n||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),n=""),c&&(n=l.reduce((function(t,e){return r.format(t,e,o.lng,o)}),n.trim())),t=t.replace(i[0],n),this.regexp.lastIndex=0}return t}}]),t}();function Gn(t,e){for(var i=t.indexOf(e);-1!==i;)t.splice(i,1),i=t.indexOf(e)}var Xn=function(t){function e(t,i,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dn(this,e),r=mn(this,vn(e).call(this)),On&&xn.call(fn(r)),r.backend=t,r.store=i,r.services=n,r.languageUtils=n.languageUtils,r.options=o,r.logger=wn.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(n,o.backend,o),r}return yn(e,xn),gn(e,[{key:"queueLoad",value:function(t,e,i,n){var r=this,o=[],a=[],s=[],l=[];return t.forEach((function(t){var n=!0;e.forEach((function(e){var s="".concat(t,"|").concat(e);!i.reload&&r.store.hasResourceBundle(t,e)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?a.indexOf(s)<0&&a.push(s):(r.state[s]=1,n=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),l.indexOf(e)<0&&l.push(e)))})),n||s.push(t)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:n}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(t,e,i){var n=t.split("|"),r=n[0],o=n[1];e&&this.emit("failedLoading",r,o,e),i&&this.store.addResourceBundle(r,o,i),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(i){En(i.loaded,[r],o),Gn(i.pending,t),e&&i.errors.push(e),0!==i.pending.length||i.done||(Object.keys(i.loaded).forEach((function(t){a[t]||(a[t]=[]),i.loaded[t].length&&i.loaded[t].forEach((function(e){a[t].indexOf(e)<0&&a[t].push(e)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[i](t,e,(function(s,l){s&&l&&r<5?setTimeout((function(){n.read.call(n,t,e,i,r+1,2*o,a)}),o):a(s,l)})):a(null,{})}},{key:"prepareLoading",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var o=this.queueLoad(t,e,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(t){i.loadOne(t)}))}},{key:"load",value:function(t,e,i){this.prepareLoading(t,e,{},i)}},{key:"reload",value:function(t,e,i){this.prepareLoading(t,e,{reload:!0},i)}},{key:"loadOne",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(function(n,a){n&&e.logger.warn("".concat(i,"loading namespace ").concat(o," for language ").concat(r," failed"),n),!n&&a&&e.logger.log("".concat(i,"loaded namespace ").concat(o," for language ").concat(r),a),e.loaded(t,n,a)}))}},{key:"saveMissing",value:function(t,e,i,n,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=i&&""!==i&&(this.backend&&this.backend.create&&this.backend.create(t,e,i,n,null,pn({},o,{isUpdate:r})),t&&t[0]&&this.store.addResource(t[0],e,i,n))}}]),e}();function Kn(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===cn(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===cn(t[2])||"object"===cn(t[3])){var i=t[3]||t[2];Object.keys(i).forEach((function(t){e[t]=i[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,i,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Zn(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function Qn(){}var Yn=new(function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(dn(this,e),t=mn(this,vn(e).call(this)),On&&xn.call(fn(t)),t.options=Zn(i),t.services={},t.logger=wn,t.modules={external:[]},n&&!t.isInitialized&&!i.isClone){if(!t.options.initImmediate)return t.init(i,n),mn(t,fn(t));setTimeout((function(){t.init(i,n)}),0)}return t}return yn(e,xn),gn(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function n(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof e&&(i=e,e={}),e.whitelist&&!e.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),e.nonExplicitWhitelist&&!e.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=pn({},Kn(),this.options,Zn(e)),this.format=this.options.interpolation.format,i||(i=Qn),!this.options.isClone){this.modules.logger?wn.init(n(this.modules.logger),this.options):wn.init(null,this.options);var r=new Bn(this.options);this.store=new Pn(this.options.resources,this.options);var o=this.services;o.logger=wn,o.resourceStore=this.store,o.languageUtils=r,o.pluralResolver=new Un(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new Wn(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Xn(n(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];t.emit.apply(t,[e].concat(n))})),this.modules.languageDetector&&(o.languageDetector=n(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=n(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new Nn(this.services,this.options),this.translator.on("*",(function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];t.emit.apply(t,[e].concat(n))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(e){t[e]=function(){var i;return(i=t.store)[e].apply(i,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(e){t[e]=function(){var i;return(i=t.store)[e].apply(i,arguments),t}}));var a=kn(),s=function(){t.changeLanguage(t.options.lng,(function(e,n){t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),a.resolve(n),i(e,n)}))};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}},{key:"loadResources",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qn,n="string"==typeof t?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return i();var r=[],o=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){r.indexOf(t)<0&&r.push(t)}))};if(n)o(n);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return o(t)}));this.options.preload&&this.options.preload.forEach((function(t){return o(t)})),this.services.backendConnector.load(r,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function(t,e,i){var n=kn();return t||(t=this.languages),e||(e=this.options.ns),i||(i=Qn),this.services.backendConnector.reload(t,e,(function(t){n.resolve(),i(t)})),n}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&Rn.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,e){var i=this;this.isLanguageChangingTo=t;var n=kn();this.emit("languageChanging",t);var r=function(t,r){r?(i.language=r,i.languages=i.services.languageUtils.toResolveHierarchy(r),i.translator.changeLanguage(r),i.isLanguageChangingTo=void 0,i.emit("languageChanged",r),i.logger.log("languageChanged",r)):i.isLanguageChangingTo=void 0,n.resolve((function(){return i.t.apply(i,arguments)})),e&&e(t,(function(){return i.t.apply(i,arguments)}))},o=function(t){var e="string"==typeof t?t:i.services.languageUtils.getBestMatchFromCodes(t);e&&(i.language||(i.language=e,i.languages=i.services.languageUtils.toResolveHierarchy(e)),i.translator.language||i.translator.changeLanguage(e),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(e)),i.loadResources(e,(function(t){r(t,e)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(t,e){var i=this,n=function t(e,n){var r;if("object"!==cn(n)){for(var o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];r=i.options.overloadTranslationOptionHandler([e,n].concat(a))}else r=pn({},n);return r.lng=r.lng||t.lng,r.lngs=r.lngs||t.lngs,r.ns=r.ns||t.ns,i.t(e,r)};return"string"==typeof t?n.lng=t:n.lngs=t,n.ns=e,n}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(t,i){var n=e.services.backendConnector.state["".concat(t,"|").concat(i)];return-1===n||2===n};if(i.precheck){var s=i.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(n,t)||(!this.services.backendConnector.backend||!(!a(n,t)||r&&!a(o,t)))}},{key:"loadNamespaces",value:function(t,e){var i=this,n=kn();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){i.options.ns.indexOf(t)<0&&i.options.ns.push(t)})),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var i=kn();"string"==typeof t&&(t=[t]);var n=this.options.preload||[],r=t.filter((function(t){return n.indexOf(t)<0}));return r.length?(this.options.preload=n.concat(r),this.loadResources((function(t){i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){return t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qn,r=pn({},this.options,i,{isClone:!0}),o=new e(r);return["store","services","language"].forEach((function(e){o[e]=t[e]})),o.services=pn({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Nn(o.services,o.options),o.translator.on("*",(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];o.emit.apply(o,[t].concat(i))})),o.init(r,n),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),e}());function Jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function er(t,e,i){return e&&tr(t.prototype,e),i&&tr(t,i),t}var ir=[],nr=ir.forEach,rr=ir.slice;function or(t){return nr.call(rr.call(arguments,1),(function(e){if(e)for(var i in e)void 0===t[i]&&(t[i]=e[i])})),t}var ar=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,sr=function(t,e,i){var n=i||{};n.path=n.path||"/";var r=t+"="+encodeURIComponent(e);if(n.maxAge>0){var o=n.maxAge-0;if(isNaN(o))throw new Error("maxAge should be a Number");r+="; Max-Age="+Math.floor(o)}if(n.domain){if(!ar.test(n.domain))throw new TypeError("option domain is invalid");r+="; Domain="+n.domain}if(n.path){if(!ar.test(n.path))throw new TypeError("option path is invalid");r+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r},lr={create:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*i*1e3)),n&&(r.domain=n),document.cookie=sr(t,encodeURIComponent(e),r)},read:function(t){for(var e=t+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var r=i[n];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return r.substring(e.length,r.length)}return null},remove:function(t){this.create(t,"",-1)}},cr={name:"cookie",lookup:function(t){var e;if(t.lookupCookie&&"undefined"!=typeof document){var i=lr.read(t.lookupCookie);i&&(e=i)}return e},cacheUserLanguage:function(t,e){e.lookupCookie&&"undefined"!=typeof document&&lr.create(e.lookupCookie,t,e.cookieMinutes,e.cookieDomain,e.cookieOptions)}},hr={name:"querystring",lookup:function(t){var e;if("undefined"!=typeof window)for(var i=window.location.search.substring(1).split("&"),n=0;n<i.length;n++){var r=i[n].indexOf("=");if(r>0)i[n].substring(0,r)===t.lookupQuerystring&&(e=i[n].substring(r+1))}return e}},pr=null,dr=function(){if(null!==pr)return pr;try{pr="undefined"!==window&&null!==window.localStorage;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){pr=!1}return pr},ur={name:"localStorage",lookup:function(t){var e;if(t.lookupLocalStorage&&dr()){var i=window.localStorage.getItem(t.lookupLocalStorage);i&&(e=i)}return e},cacheUserLanguage:function(t,e){e.lookupLocalStorage&&dr()&&window.localStorage.setItem(e.lookupLocalStorage,t)}},gr=null,fr=function(){if(null!==gr)return gr;try{gr="undefined"!==window&&null!==window.sessionStorage;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){gr=!1}return gr},mr={name:"sessionStorage",lookup:function(t){var e;if(t.lookupSessionStorage&&fr()){var i=window.sessionStorage.getItem(t.lookupSessionStorage);i&&(e=i)}return e},cacheUserLanguage:function(t,e){e.lookupSessionStorage&&fr()&&window.sessionStorage.setItem(e.lookupSessionStorage,t)}},vr={name:"navigator",lookup:function(t){var e=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)e.push(navigator.languages[i]);navigator.userLanguage&&e.push(navigator.userLanguage),navigator.language&&e.push(navigator.language)}return e.length>0?e:void 0}},br={name:"htmlTag",lookup:function(t){var e,i=t.htmlTag||("undefined"!=typeof document?document.documentElement:null);return i&&"function"==typeof i.getAttribute&&(e=i.getAttribute("lang")),e}},yr={name:"path",lookup:function(t){var e;if("undefined"!=typeof window){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if("number"==typeof t.lookupFromPathIndex){if("string"!=typeof i[t.lookupFromPathIndex])return;e=i[t.lookupFromPathIndex].replace("/","")}else e=i[0].replace("/","")}return e}},_r={name:"subdomain",lookup:function(t){var e;if("undefined"!=typeof window){var i=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);i instanceof Array&&(e="number"==typeof t.lookupFromSubdomainIndex?i[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):i[0].replace("http://","").replace("https://","").replace(".",""))}return e}};function wr(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var xr=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Jn(this,t),this.type="languageDetector",this.detectors={},this.init(e,i)}return er(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=t,this.options=or(e,this.options||{},wr()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(cr),this.addDetector(hr),this.addDetector(ur),this.addDetector(mr),this.addDetector(vr),this.addDetector(br),this.addDetector(yr),this.addDetector(_r)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var e=this;t||(t=this.options.order);var i=[];return t.forEach((function(t){if(e.detectors[t]){var n=e.detectors[t].lookup(e.options);n&&"string"==typeof n&&(n=[n]),n&&(i=i.concat(n))}})),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(t,e){var i=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach((function(e){i.detectors[e]&&i.detectors[e].cacheUserLanguage(t,i.options)})))}}]),t}();xr.type="languageDetector";var kr=[],zr=kr.forEach,Ar=kr.slice;function Sr(t){return zr.call(Ar.call(arguments,1),(function(e){if(e)for(var i in e)void 0===t[i]&&(t[i]=e[i])})),t}function Cr(t,e){if(e&&"object"===cn(e)){var i="",n=encodeURIComponent;for(var r in e)i+="&"+n(r)+"="+n(e[r]);if(!i)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+i.slice(1)}return t}function Er(t,e,i,n,r){n&&"object"===cn(n)&&(r||(n._t=new Date),n=Cr("",n).slice(1)),e.queryStringParams&&(t=Cr(t,e.queryStringParams));try{var o;(o=XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a="function"==typeof a?a():a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i&&i(o.responseText,o)},o.send(n)}catch(t){console&&console.log(t)}}function Mr(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,parsePayload:function(t,e,i){return hn({},e,i||"")},crossDomain:!1,ajax:Er}}var Lr=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dn(this,t),this.init(e,i),this.type="backend"}return gn(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=t,this.options=Sr(e,this.options||{},Mr())}},{key:"readMulti",value:function(t,e,i){var n=this.options.loadPath;"function"==typeof this.options.loadPath&&(n=this.options.loadPath(t,e));var r=this.services.interpolator.interpolate(n,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(r,i)}},{key:"read",value:function(t,e,i){var n=this.options.loadPath;"function"==typeof this.options.loadPath&&(n=this.options.loadPath([t],[e]));var r=this.services.interpolator.interpolate(n,{lng:t,ns:e});this.loadUrl(r,i)}},{key:"loadUrl",value:function(t,e){var i=this;this.options.ajax(t,this.options,(function(n,r){if(r.status>=500&&r.status<600)return e("failed loading "+t,!0);if(r.status>=400&&r.status<500)return e("failed loading "+t,!1);var o,a;try{o=i.options.parse(n,t)}catch(e){a="failed parsing "+t+" to json"}if(a)return e(a,!1);e(null,o)}))}},{key:"create",value:function(t,e,i,n){var r=this;"string"==typeof t&&(t=[t]);var o=this.options.parsePayload(e,i,n);t.forEach((function(t){var i=r.services.interpolator.interpolate(r.options.addPath,{lng:t,ns:e});r.options.ajax(i,r.options,(function(t,e){}),o)}))}}]),t}();function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vr(t,e,i){return e&&Tr(t.prototype,e),i&&Tr(t,i),t}Lr.type="backend";var $r=[],Or=$r.forEach,Pr=$r.slice;function Rr(t){return Or.call(Pr.call(arguments,1),(function(e){if(e)for(var i in e)void 0===t[i]&&(t[i]=e[i])})),t}function Ir(t){return t?"function"==typeof t?new t:t:null}function Nr(){return{}}var Fr=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Hr(this,t),this.backends=[],this.type="backend",this.init(e,i)}return Vr(t,[{key:"init",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.services=t,this.options=Rr(i,this.options||{},Nr()),this.options.backends&&this.options.backends.forEach((function(i,r){e.backends[r]=e.backends[r]||Ir(i),e.backends[r].init(t,e.options.backendOptions[r],n)}))}},{key:"read",value:function(t,e,i){var n=this,r=this.backends.length,o=function o(s){if(s>=r)return i(new Error("non of the backend loaded data;",!0));var l=n.backends[s];l.read?l.read(t,e,(function(t,e){!t&&e&&Object.keys(e).length>-1?(i(null,e,s),a(s-1,e)):o(s+1)})):o(s+1)},a=function i(r,o){if(!(r<0)){var a=n.backends[r];a.save?(a.save(t,e,o),i(r-1,o)):i(r-1,o)}};o(0)}},{key:"create",value:function(t,e,i,n){this.backends.forEach((function(r){r.create&&r.create(t,e,i,n)}))}}]),t}();let Br;Fr.type="backend";class Dr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{appRoot:{type:String,attribute:"app-root"},template:{type:String},endpoint:{type:String,reflect:!0},apiVersion:{type:String,attribute:"api-version",reflect:!0},locales:{type:String},localeFallbackNs:{type:String,attribute:"locale-fallback-ns"},language:{type:String},requireLanguage:{type:Boolean,attribute:"require-language"},unresolved:{type:Boolean,reflect:!0}})}constructor(){super(),this.unresolved=!0,this.endpoint=".",this.apiVersion=void 0,this.requireLanguage=!1,this._localeFallbacks=[],this._i18nInstance=null,Br?this.disabled=!0:(Br=this,N())}set localeFallbackNs(t){t.split(/\s+/).forEach(t=>this._localeFallbacks.push(t))}disconnectedCallback(){super.disconnectedCallback(),this._i18nInstance=null,Br===this&&(Br=null)}async connectedCallback(){if(super.connectedCallback(),this.disabled)return;this.locales&&-1===this._localeFallbacks.indexOf("app")&&this._localeFallbacks.push("app"),this._localeFallbacks.push("common");const t=this.getParameter("_target");t&&(this.endpoint=t);const e=this.getParameter("_api");if(e&&(this.apiVersion=e),!this.apiVersion){const t=await fetch(this.endpoint+"/login").then(t=>t.ok?null:fetch(this.endpoint+"/api/version").then(t=>t.json())).catch(()=>null);t?(this.apiVersion=t.api,console.log(`<pb-page> Server reports API version ${this.apiVersion} with app ${t.app.name}/${t.app.version} running on ${t.engine.name}/${t.engine.version}`)):(console.log("<pb-page> No API version reported by server, assuming 0.9.0"),this.apiVersion="0.9.0")}this.requireLanguage||this.signalReady("pb-page-ready",{endpoint:this.endpoint,template:this.template,apiVersion:this.apiVersion})}firstUpdated(){if(super.firstUpdated(),this.disabled)return;const t=O("../i18n/")+"{{ns}}/{{lng}}.json";console.log("<pb-page> Loading locales. common: %s; additional: %s; namespaces: %o",t,this.locales,this._localeFallbacks);const e=this.locales?[Lr,Lr]:[Lr],i=[{loadPath:t,crossDomain:!0}];this.locales&&i.unshift({loadPath:this.locales,crossDomain:!0});const n={fallbackLng:"en",defaultNS:"common",ns:["common"],debug:!1,load:"languageOnly",detection:{lookupQuerystring:"lang"},backend:{backends:e,backendOptions:i}};if(this.language&&(n.lng=this.language),this._localeFallbacks.length>0){const t=this._localeFallbacks.slice();n.defaultNS=t[0],n.fallbackNS=t.slice(1),n.ns=t}console.log("<pb-page> i18next options: %o",n),this._i18nInstance=Yn.createInstance(),this._i18nInstance.use(xr).use(Fr),this._i18nInstance.init(n).then(t=>{o(t),this._updateI18n(t),this.signalReady("pb-i18n-update",{t:t,language:this._i18nInstance.language}),this.requireLanguage&&this.signalReady("pb-page-ready",{endpoint:this.endpoint,apiVersion:this.apiVersion,template:this.template,language:this._i18nInstance.language})}),this.subscribeTo("pb-i18n-language",t=>{const{language:e}=t.detail;this._i18nInstance.changeLanguage(e).then(t=>{this._updateI18n(t),this.emitTo("pb-i18n-update",{t:t,language:this._i18nInstance.language},[])},[])}),this.subscribeTo("pb-toggle",this._toggleFeatures.bind(this)),this.unresolved=!1,console.log("<pb-page> endpoint: %s; trigger window resize",this.endpoint),this.querySelectorAll("app-header").forEach(t=>t._notifyLayoutChanged()),nn(this)}_updateI18n(t){this.querySelectorAll("[data-i18n]").forEach(e=>{const i=e.getAttribute("data-i18n"),n=/(?:\[([^\]]+)\])?([^;]+)/g;let r=n.exec(i);for(;r;){const o=t(r[2]);r[1]?e.setAttribute(r[1],o):e.innerHTML=o,r=n.exec(i)}})}_toggleFeatures(t){t.detail.selectors&&t.detail.selectors.forEach(t=>{this.querySelectorAll(t.selector).forEach(e=>{const i=t.command||"toggle";e.command&&e.command(i,t.state),t.state?e.classList.add(i):e.classList.remove(i)})})}render(){return $`<slot></slot>`}static get styles(){return P`
|
|
720
|
+
`}}function ci(t){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),i.forEach((function(e){hi(t,e,n[e])}))}return t}function di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ui(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function gi(t,e,n){return e&&ui(t.prototype,e),n&&ui(t,n),t}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mi(t,e){return!e||"object"!==ci(e)&&"function"!=typeof e?fi(t):e}function vi(t){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bi(t,e){return(bi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bi(t,e)}customElements.define("pb-navigation",li);var _i={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},wi=new(function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};di(this,t),this.init(e,n)}return gi(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||_i,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,n,i){return i&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,pi({},{prefix:"".concat(this.prefix,":").concat(e,":")},this.options))}}]),t}()),xi=function(){function t(){di(this,t),this.observers={}}return gi(t,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach((function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach((function(t){t.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(e){e.apply(e,[t].concat(n))}))}}]),t}();function ki(){var t,e,n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n}function zi(t){return null==t?"":""+t}function Ai(t,e,n){t.forEach((function(t){e[t]&&(n[t]=e[t])}))}function Si(t,e,n){function i(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function r(){return!t||"string"==typeof t}for(var o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(r())return{};var a=i(o.shift());!t[a]&&n&&(t[a]=new n),t=t[a]}return r()?{}:{obj:t,k:i(o.shift())}}function Ci(t,e,n){var i=Si(t,e,Object);i.obj[i.k]=n}function Ei(t,e,n,i){var r=Si(t,e,Object),o=r.obj,a=r.k;o[a]=o[a]||[],i&&(o[a]=o[a].concat(n)),i||o[a].push(n)}function Mi(t,e){var n=Si(t,e),i=n.obj,r=n.k;if(i)return i[r]}function Li(t,e,n){var i=Mi(t,n);return void 0!==i?i:Mi(e,n)}function Hi(t,e,n){for(var i in e)"__proto__"!==i&&(i in t?"string"==typeof t[i]||t[i]instanceof String||"string"==typeof e[i]||e[i]instanceof String?n&&(t[i]=e[i]):Hi(t[i],e[i],n):t[i]=e[i]);return t}function Ti(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Vi={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function $i(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return Vi[t]})):t}var Oi="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Pi=function(t){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return di(this,e),n=mi(this,vi(e).call(this)),Oi&&xi.call(fi(n)),n.data=t||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return yi(e,xi),gi(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=[t,e];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(o=t.split(".")),Mi(this.data,o)}},{key:"addResource",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[t,e];n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(i=e,e=(a=t.split("."))[1]),this.addNamespaces(e),Ci(this.data,a,i),r.silent||this.emit("added",t,e,n,i)}},{key:"addResources",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(t,e,r,n[r],{silent:!0});i.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(i=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var s=Mi(this.data,a)||{};i?Hi(s,n,r):s=pi({},s,n),Ci(this.data,a,s),o.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?pi({},{},this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),e}(),Ri={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,i,r){var o=this;return t.forEach((function(t){o.processors[t]&&(e=o.processors[t].process(e,n,i,r))})),e}},Ii={},Ni=function(t){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return di(this,e),n=mi(this,vi(e).call(this)),Oi&&xi.call(fi(n)),Ai(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,fi(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=wi.create("translator"),n}return yi(e,xi),gi(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var i=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,r=e.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:r};var a=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(a[0])>-1)&&(r=a.shift()),t=a.join(i)}return"string"==typeof r&&(r=[r]),{key:t,namespaces:r}}},{key:"translate",value:function(t,e,n){var i=this;if("object"!==ci(e)&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,o=this.extractFromKey(t[t.length-1],e),a=o.key,s=o.namespaces,l=s[s.length-1],c=e.lng||this.language,h=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(h){var p=e.nsSeparator||this.options.nsSeparator;return l+p+a}return a}var d=this.resolve(t,e),u=d&&d.res,g=d&&d.usedKey||a,f=d&&d.exactUsedKey||a,m=Object.prototype.toString.apply(u),v=["[object Number]","[object Function]","[object RegExp]"],b=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&u&&("string"!=typeof u&&"boolean"!=typeof u&&"number"!=typeof u)&&v.indexOf(m)<0&&("string"!=typeof b||"[object Array]"!==m)){if(!e.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,e):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");if(r){var _="[object Array]"===m,w=_?[]:{},x=_?f:g;for(var k in u)if(Object.prototype.hasOwnProperty.call(u,k)){var z="".concat(x).concat(r).concat(k);w[k]=this.translate(z,pi({},e,{joinArrays:!1,ns:s})),w[k]===z&&(w[k]=u[k])}u=w}}else if(y&&"string"==typeof b&&"[object Array]"===m)(u=u.join(b))&&(u=this.extendTranslation(u,t,e,n));else{var A=!1,S=!1;if(!this.isValidLookup(u)&&void 0!==e.defaultValue){if(A=!0,void 0!==e.count){var C=this.pluralResolver.getSuffix(c,e.count);u=e["defaultValue".concat(C)]}u||(u=e.defaultValue)}this.isValidLookup(u)||(S=!0,u=a);var E=e.defaultValue&&e.defaultValue!==u&&this.options.updateMissing;if(S||A||E){if(this.logger.log(E?"updateKey":"missingKey",c,l,a,E?e.defaultValue:u),r){var M=this.resolve(a,pi({},e,{keySeparator:!1}));M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var L=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&H&&H[0])for(var T=0;T<H.length;T++)L.push(H[T]);else"all"===this.options.saveMissingTo?L=this.languageUtils.toResolveHierarchy(e.lng||this.language):L.push(e.lng||this.language);var V=function(t,n){i.options.missingKeyHandler?i.options.missingKeyHandler(t,l,n,E?e.defaultValue:u,E,e):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(t,l,n,E?e.defaultValue:u,E,e),i.emit("missingKey",t,l,n,u)};if(this.options.saveMissing){var $=void 0!==e.count&&"string"!=typeof e.count;this.options.saveMissingPlurals&&$?L.forEach((function(t){i.pluralResolver.getPluralFormsOfKey(t,a).forEach((function(e){return V([t],e)}))})):V(L,a)}}u=this.extendTranslation(u,t,e,d,n),S&&u===a&&this.options.appendNamespaceToMissingKey&&(u="".concat(l,":").concat(a)),S&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(u))}return u}},{key:"extendTranslation",value:function(t,e,n,i,r){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n,i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(pi({},n,{interpolation:pi({},this.options.interpolation,n.interpolation)}));var a,s=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var l=t.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=pi({},this.options.interpolation.defaultVariables,c)),t=this.interpolator.interpolate(t,c,n.lng||this.language,n),s){var h=t.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(n.nest=!1)}!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return r&&r[0]===n[0]?(o.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(e[0])),null):o.translate.apply(o,n.concat([e]))}),n)),n.interpolation&&this.interpolator.reset()}var p=n.postProcess||this.options.postProcess,d="string"==typeof p?[p]:p;return null!=t&&d&&d.length&&!1!==n.applyPostProcessor&&(t=Ri.handle(d,t,e,this.options&&this.options.postProcessPassResolved?pi({i18nResolved:i},n):n,this)),t}},{key:"resolve",value:function(t){var e,n,i,r,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var l=a.extractFromKey(t,s),c=l.key;n=c;var h=l.namespaces;a.options.fallbackNS&&(h=h.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,u=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);h.forEach((function(t){a.isValidLookup(e)||(o=t,!Ii["".concat(u[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(Ii["".concat(u[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(u.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((function(n){if(!a.isValidLookup(e)){r=n;var o,l,h=c,u=[h];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(u,c,n,t,s);else p&&(o=a.pluralResolver.getSuffix(n,s.count)),p&&d&&u.push(h+o),d&&u.push(h+="".concat(a.options.contextSeparator).concat(s.context)),p&&u.push(h+=o);for(;l=u.pop();)a.isValidLookup(e)||(i=l,e=a.getResource(n,t,l,s))}})))}))}})),{res:e,usedKey:n,exactUsedKey:i,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,i):this.resourceStore.getResource(t,e,n,i)}}]),e}();function Fi(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Bi=function(){function t(e){di(this,t),this.options=e,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wi.create("languageUtils")}return gi(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fi(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fi(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fi(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var i=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(i)||(e=i)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var i=n.getLanguagePartFromCode(t);if(n.isSupportedCode(i))return e=i;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(i))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],t),r=[],o=function(t){t&&(n.isSupportedCode(t)?r.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),i.forEach((function(t){r.indexOf(t)<0&&o(n.formatLanguageCode(t))})),r}}]),t}(),Di=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ji={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function qi(){var t={};return Di.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:ji[e.fc]}}))})),t}var Ui=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};di(this,t),this.languageUtils=e,this.options=n,this.logger=wi.create("pluralResolver"),this.rules=qi()}return gi(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var n=this,i=[],r=this.getRule(t);return r?(r.numbers.forEach((function(r){var o=n.getSuffix(t,r);i.push("".concat(e).concat(o))})),i):i}},{key:"getSuffix",value:function(t,e){var n=this,i=this.getRule(t);if(i){var r=i.noAbs?i.plurals(e):i.plurals(Math.abs(e)),o=i.numbers[r];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),Wi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};di(this,t),this.logger=wi.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return gi(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:$i,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?Ti(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?Ti(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?Ti(e.nestingPrefix):e.nestingPrefixEscaped||Ti("$t("),this.nestingSuffix=e.nestingSuffix?Ti(e.nestingSuffix):e.nestingSuffixEscaped||Ti(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,i){var r,o,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var h=function(t){if(t.indexOf(s.formatSeparator)<0){var r=Li(e,l,t);return s.alwaysFormat?s.format(r,void 0,n):r}var o=t.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(Li(e,l,a),c,n,i)};this.resetRegExp();var p=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return s.escapeValue?c(s.escape(t)):c(t)}}].forEach((function(e){for(a=0;r=e.regex.exec(t);){if(void 0===(o=h(r[1].trim())))if("function"==typeof p){var n=p(t,r,i);o="string"==typeof n?n:""}else{if(d){o=r[0];continue}s.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(t)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=zi(o));if(t=t.replace(r[0],e.safeValue(o)),e.regex.lastIndex=0,++a>=s.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,i,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=pi({},o);function s(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var i=t.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(i[1]);t=i[0],r=(r=this.interpolate(r,a)).replace(/'/g,'"');try{a=JSON.parse(r),e&&(a=pi({},e,a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(r)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var l=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=h.shift(),l=h,c=!0}if((i=e(s.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof i)return i;"string"!=typeof i&&(i=zi(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),i=""),c&&(i=l.reduce((function(t,e){return r.format(t,e,o.lng,o)}),i.trim())),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}]),t}();function Gi(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}var Xi=function(t){function e(t,n,i){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return di(this,e),r=mi(this,vi(e).call(this)),Oi&&xi.call(fi(r)),r.backend=t,r.store=n,r.services=i,r.languageUtils=i.languageUtils,r.options=o,r.logger=wi.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(i,o.backend,o),r}return yi(e,xi),gi(e,[{key:"queueLoad",value:function(t,e,n,i){var r=this,o=[],a=[],s=[],l=[];return t.forEach((function(t){var i=!0;e.forEach((function(e){var s="".concat(t,"|").concat(e);!n.reload&&r.store.hasResourceBundle(t,e)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?a.indexOf(s)<0&&a.push(s):(r.state[s]=1,i=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),l.indexOf(e)<0&&l.push(e)))})),i||s.push(t)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:i}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(t,e,n){var i=t.split("|"),r=i[0],o=i[1];e&&this.emit("failedLoading",r,o,e),n&&this.store.addResourceBundle(r,o,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){Ei(n.loaded,[r],o),Gi(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]=[]),n.loaded[t].length&&n.loaded[t].forEach((function(e){a[t].indexOf(e)<0&&a[t].push(e)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[n](t,e,(function(s,l){s&&l&&r<5?setTimeout((function(){i.read.call(i,t,e,n,r+1,2*o,a)}),o):a(s,l)})):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var o=this.queueLoad(t,e,i,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t.split("|"),r=i[0],o=i[1];this.read(r,o,"read",void 0,void 0,(function(i,a){i&&e.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(r," failed"),i),!i&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(r),a),e.loaded(t,i,a)}))}},{key:"saveMissing",value:function(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,i,null,pi({},o,{isUpdate:r})),t&&t[0]&&this.store.addResource(t[0],e,n,i))}}]),e}();function Ki(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===ci(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===ci(t[2])||"object"===ci(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Zi(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function Qi(){}var Yi=new(function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(di(this,e),t=mi(this,vi(e).call(this)),Oi&&xi.call(fi(t)),t.options=Zi(n),t.services={},t.logger=wi,t.modules={external:[]},i&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,i),mi(t,fi(t));setTimeout((function(){t.init(n,i)}),0)}return t}return yi(e,xi),gi(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof e&&(n=e,e={}),e.whitelist&&!e.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),e.nonExplicitWhitelist&&!e.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=pi({},Ki(),this.options,Zi(e)),this.format=this.options.interpolation.format,n||(n=Qi),!this.options.isClone){this.modules.logger?wi.init(i(this.modules.logger),this.options):wi.init(null,this.options);var r=new Bi(this.options);this.store=new Pi(this.options.resources,this.options);var o=this.services;o.logger=wi,o.resourceStore=this.store,o.languageUtils=r,o.pluralResolver=new Ui(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new Wi(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Xi(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];t.emit.apply(t,[e].concat(i))})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new Ni(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];t.emit.apply(t,[e].concat(i))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var a=ki(),s=function(){t.changeLanguage(t.options.lng,(function(e,i){t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),a.resolve(i),n(e,i)}))};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qi,i="string"==typeof t?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var r=[],o=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){r.indexOf(t)<0&&r.push(t)}))};if(i)o(i);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return o(t)}));this.options.preload&&this.options.preload.forEach((function(t){return o(t)})),this.services.backendConnector.load(r,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(t,e,n){var i=ki();return t||(t=this.languages),e||(e=this.options.ns),n||(n=Qi),this.services.backendConnector.reload(t,e,(function(t){i.resolve(),n(t)})),i}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&Ri.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var i=ki();this.emit("languageChanging",t);var r=function(t,r){r?(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r),n.translator.changeLanguage(r),n.isLanguageChangingTo=void 0,n.emit("languageChanged",r),n.logger.log("languageChanged",r)):n.isLanguageChangingTo=void 0,i.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))},o=function(t){var e="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);e&&(n.language||(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e)),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources(e,(function(t){r(t,e)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(t,e){var n=this,i=function t(e,i){var r;if("object"!==ci(i)){for(var o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];r=n.options.overloadTranslationOptionHandler([e,i].concat(a))}else r=pi({},i);return r.lng=r.lng||t.lng,r.lngs=r.lngs||t.lngs,r.ns=r.ns||t.ns,n.t(e,r)};return"string"==typeof t?i.lng=t:i.lngs=t,i.ns=e,i}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var i=this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function(t,n){var i=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===i||2===i};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(i,t)||(!this.services.backendConnector.backend||!(!a(i,t)||r&&!a(o,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,i=ki();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=ki();"string"==typeof t&&(t=[t]);var i=this.options.preload||[],r=t.filter((function(t){return i.indexOf(t)<0}));return r.length?(this.options.preload=i.concat(r),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){return t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qi,r=pi({},this.options,n,{isClone:!0}),o=new e(r);return["store","services","language"].forEach((function(e){o[e]=t[e]})),o.services=pi({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Ni(o.services,o.options),o.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];o.emit.apply(o,[t].concat(n))})),o.init(r,i),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),e}());function Ji(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function er(t,e,n){return e&&tr(t.prototype,e),n&&tr(t,n),t}var nr=[],ir=nr.forEach,rr=nr.slice;function or(t){return ir.call(rr.call(arguments,1),(function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])})),t}var ar=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,sr=function(t,e,n){var i=n||{};i.path=i.path||"/";var r=t+"="+encodeURIComponent(e);if(i.maxAge>0){var o=i.maxAge-0;if(isNaN(o))throw new Error("maxAge should be a Number");r+="; Max-Age="+Math.floor(o)}if(i.domain){if(!ar.test(i.domain))throw new TypeError("option domain is invalid");r+="; Domain="+i.domain}if(i.path){if(!ar.test(i.path))throw new TypeError("option path is invalid");r+="; Path="+i.path}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(r+="; HttpOnly"),i.secure&&(r+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r},lr={create:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*n*1e3)),i&&(r.domain=i),document.cookie=sr(t,encodeURIComponent(e),r)},read:function(t){for(var e=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return r.substring(e.length,r.length)}return null},remove:function(t){this.create(t,"",-1)}},cr={name:"cookie",lookup:function(t){var e;if(t.lookupCookie&&"undefined"!=typeof document){var n=lr.read(t.lookupCookie);n&&(e=n)}return e},cacheUserLanguage:function(t,e){e.lookupCookie&&"undefined"!=typeof document&&lr.create(e.lookupCookie,t,e.cookieMinutes,e.cookieDomain,e.cookieOptions)}},hr={name:"querystring",lookup:function(t){var e;if("undefined"!=typeof window)for(var n=window.location.search.substring(1).split("&"),i=0;i<n.length;i++){var r=n[i].indexOf("=");if(r>0)n[i].substring(0,r)===t.lookupQuerystring&&(e=n[i].substring(r+1))}return e}},pr=null,dr=function(){if(null!==pr)return pr;try{pr="undefined"!==window&&null!==window.localStorage;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){pr=!1}return pr},ur={name:"localStorage",lookup:function(t){var e;if(t.lookupLocalStorage&&dr()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(e=n)}return e},cacheUserLanguage:function(t,e){e.lookupLocalStorage&&dr()&&window.localStorage.setItem(e.lookupLocalStorage,t)}},gr=null,fr=function(){if(null!==gr)return gr;try{gr="undefined"!==window&&null!==window.sessionStorage;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){gr=!1}return gr},mr={name:"sessionStorage",lookup:function(t){var e;if(t.lookupSessionStorage&&fr()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(e=n)}return e},cacheUserLanguage:function(t,e){e.lookupSessionStorage&&fr()&&window.sessionStorage.setItem(e.lookupSessionStorage,t)}},vr={name:"navigator",lookup:function(t){var e=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)e.push(navigator.languages[n]);navigator.userLanguage&&e.push(navigator.userLanguage),navigator.language&&e.push(navigator.language)}return e.length>0?e:void 0}},br={name:"htmlTag",lookup:function(t){var e,n=t.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(e=n.getAttribute("lang")),e}},yr={name:"path",lookup:function(t){var e;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof t.lookupFromPathIndex){if("string"!=typeof n[t.lookupFromPathIndex])return;e=n[t.lookupFromPathIndex].replace("/","")}else e=n[0].replace("/","")}return e}},_r={name:"subdomain",lookup:function(t){var e;if("undefined"!=typeof window){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(e="number"==typeof t.lookupFromSubdomainIndex?n[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n[0].replace("http://","").replace("https://","").replace(".",""))}return e}};function wr(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var xr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ji(this,t),this.type="languageDetector",this.detectors={},this.init(e,n)}return er(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=t,this.options=or(e,this.options||{},wr()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(cr),this.addDetector(hr),this.addDetector(ur),this.addDetector(mr),this.addDetector(vr),this.addDetector(br),this.addDetector(yr),this.addDetector(_r)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var e=this;t||(t=this.options.order);var n=[];return t.forEach((function(t){if(e.detectors[t]){var i=e.detectors[t].lookup(e.options);i&&"string"==typeof i&&(i=[i]),i&&(n=n.concat(i))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(t,e){var n=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach((function(e){n.detectors[e]&&n.detectors[e].cacheUserLanguage(t,n.options)})))}}]),t}();xr.type="languageDetector";var kr=[],zr=kr.forEach,Ar=kr.slice;function Sr(t){return zr.call(Ar.call(arguments,1),(function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])})),t}function Cr(t,e){if(e&&"object"===ci(e)){var n="",i=encodeURIComponent;for(var r in e)n+="&"+i(r)+"="+i(e[r]);if(!n)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+n.slice(1)}return t}function Er(t,e,n,i,r){i&&"object"===ci(i)&&(r||(i._t=new Date),i=Cr("",i).slice(1)),e.queryStringParams&&(t=Cr(t,e.queryStringParams));try{var o;(o=XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0")).open(i?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,i&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a="function"==typeof a?a():a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&n&&n(o.responseText,o)},o.send(i)}catch(t){console&&console.log(t)}}function Mr(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,parsePayload:function(t,e,n){return hi({},e,n||"")},crossDomain:!1,ajax:Er}}var Lr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};di(this,t),this.init(e,n),this.type="backend"}return gi(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=t,this.options=Sr(e,this.options||{},Mr())}},{key:"readMulti",value:function(t,e,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath(t,e));var r=this.services.interpolator.interpolate(i,{lng:t.join("+"),ns:e.join("+")});this.loadUrl(r,n)}},{key:"read",value:function(t,e,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath([t],[e]));var r=this.services.interpolator.interpolate(i,{lng:t,ns:e});this.loadUrl(r,n)}},{key:"loadUrl",value:function(t,e){var n=this;this.options.ajax(t,this.options,(function(i,r){if(r.status>=500&&r.status<600)return e("failed loading "+t,!0);if(r.status>=400&&r.status<500)return e("failed loading "+t,!1);var o,a;try{o=n.options.parse(i,t)}catch(e){a="failed parsing "+t+" to json"}if(a)return e(a,!1);e(null,o)}))}},{key:"create",value:function(t,e,n,i){var r=this;"string"==typeof t&&(t=[t]);var o=this.options.parsePayload(e,n,i);t.forEach((function(t){var n=r.services.interpolator.interpolate(r.options.addPath,{lng:t,ns:e});r.options.ajax(n,r.options,(function(t,e){}),o)}))}}]),t}();function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Vr(t,e,n){return e&&Tr(t.prototype,e),n&&Tr(t,n),t}Lr.type="backend";var $r=[],Or=$r.forEach,Pr=$r.slice;function Rr(t){return Or.call(Pr.call(arguments,1),(function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])})),t}function Ir(t){return t?"function"==typeof t?new t:t:null}function Nr(){return{}}var Fr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Hr(this,t),this.backends=[],this.type="backend",this.init(e,n)}return Vr(t,[{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;this.services=t,this.options=Rr(n,this.options||{},Nr()),this.options.backends&&this.options.backends.forEach((function(n,r){e.backends[r]=e.backends[r]||Ir(n),e.backends[r].init(t,e.options.backendOptions[r],i)}))}},{key:"read",value:function(t,e,n){var i=this,r=this.backends.length,o=function o(s){if(s>=r)return n(new Error("non of the backend loaded data;",!0));var l=i.backends[s];l.read?l.read(t,e,(function(t,e){!t&&e&&Object.keys(e).length>-1?(n(null,e,s),a(s-1,e)):o(s+1)})):o(s+1)},a=function n(r,o){if(!(r<0)){var a=i.backends[r];a.save?(a.save(t,e,o),n(r-1,o)):n(r-1,o)}};o(0)}},{key:"create",value:function(t,e,n,i){this.backends.forEach((function(r){r.create&&r.create(t,e,n,i)}))}}]),t}();let Br;Fr.type="backend";class Dr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{appRoot:{type:String,attribute:"app-root"},template:{type:String},endpoint:{type:String,reflect:!0},apiVersion:{type:String,attribute:"api-version",reflect:!0},locales:{type:String},localeFallbackNs:{type:String,attribute:"locale-fallback-ns"},language:{type:String},requireLanguage:{type:Boolean,attribute:"require-language"},unresolved:{type:Boolean,reflect:!0}})}constructor(){super(),this.unresolved=!0,this.endpoint=".",this.apiVersion=void 0,this.requireLanguage=!1,this._localeFallbacks=[],this._i18nInstance=null,Br?this.disabled=!0:(Br=this,N())}set localeFallbackNs(t){t.split(/\s+/).forEach(t=>this._localeFallbacks.push(t))}disconnectedCallback(){super.disconnectedCallback(),this._i18nInstance=null,Br===this&&(Br=null)}async connectedCallback(){if(super.connectedCallback(),this.disabled)return;this.locales&&-1===this._localeFallbacks.indexOf("app")&&this._localeFallbacks.push("app"),this._localeFallbacks.push("common");const t=this.getParameter("_target");t&&(this.endpoint=t);const e=this.getParameter("_api");if(e&&(this.apiVersion=e),!this.apiVersion){const t=await fetch(this.endpoint+"/login").then(t=>t.ok?null:fetch(this.endpoint+"/api/version").then(t=>t.json())).catch(()=>null);t?(this.apiVersion=t.api,console.log(`<pb-page> Server reports API version ${this.apiVersion} with app ${t.app.name}/${t.app.version} running on ${t.engine.name}/${t.engine.version}`)):(console.log("<pb-page> No API version reported by server, assuming 0.9.0"),this.apiVersion="0.9.0")}this.requireLanguage||this.signalReady("pb-page-ready",{endpoint:this.endpoint,template:this.template,apiVersion:this.apiVersion})}firstUpdated(){if(super.firstUpdated(),this.disabled)return;const t=O("../i18n/")+"{{ns}}/{{lng}}.json";console.log("<pb-page> Loading locales. common: %s; additional: %s; namespaces: %o",t,this.locales,this._localeFallbacks);const e=this.locales?[Lr,Lr]:[Lr],n=[{loadPath:t,crossDomain:!0}];this.locales&&n.unshift({loadPath:this.locales,crossDomain:!0});const i={fallbackLng:"en",defaultNS:"common",ns:["common"],debug:!1,load:"languageOnly",detection:{lookupQuerystring:"lang"},backend:{backends:e,backendOptions:n}};if(this.language&&(i.lng=this.language),this._localeFallbacks.length>0){const t=this._localeFallbacks.slice();i.defaultNS=t[0],i.fallbackNS=t.slice(1),i.ns=t}console.log("<pb-page> i18next options: %o",i),this._i18nInstance=Yi.createInstance(),this._i18nInstance.use(xr).use(Fr),this._i18nInstance.init(i).then(t=>{o(t),this._updateI18n(t),this.signalReady("pb-i18n-update",{t:t,language:this._i18nInstance.language}),this.requireLanguage&&this.signalReady("pb-page-ready",{endpoint:this.endpoint,apiVersion:this.apiVersion,template:this.template,language:this._i18nInstance.language})}),this.subscribeTo("pb-i18n-language",t=>{const{language:e}=t.detail;this._i18nInstance.changeLanguage(e).then(t=>{this._updateI18n(t),this.emitTo("pb-i18n-update",{t:t,language:this._i18nInstance.language},[])},[])}),this.subscribeTo("pb-toggle",this._toggleFeatures.bind(this)),this.unresolved=!1,console.log("<pb-page> endpoint: %s; trigger window resize",this.endpoint),this.querySelectorAll("app-header").forEach(t=>t._notifyLayoutChanged()),ii(this)}_updateI18n(t){this.querySelectorAll("[data-i18n]").forEach(e=>{const n=e.getAttribute("data-i18n"),i=/(?:\[([^\]]+)\])?([^;]+)/g;let r=i.exec(n);for(;r;){const o=t(r[2]);r[1]?e.setAttribute(r[1],o):e.innerHTML=o,r=i.exec(n)}})}_toggleFeatures(t){t.detail.selectors&&t.detail.selectors.forEach(t=>{this.querySelectorAll(t.selector).forEach(e=>{const n=t.command||"toggle";e.command&&e.command(n,t.state),t.state?e.classList.add(n):e.classList.remove(n)})})}render(){return $`<slot></slot>`}static get styles(){return P`
|
|
721
721
|
:host {
|
|
722
722
|
display: block;
|
|
723
723
|
}
|
|
@@ -761,7 +761,7 @@ class Yi{constructor(){this.load=(t,e,i=!1)=>{let n=window.ESGlobalBridge.import
|
|
|
761
761
|
.found {
|
|
762
762
|
padding-left: 20px;
|
|
763
763
|
}
|
|
764
|
-
`}_update(t,e){if(!e||!t)return;this.pageCount=Math.ceil(e/this.perPage),this.page=Math.ceil(t/this.perPage);let
|
|
764
|
+
`}_update(t,e){if(!e||!t)return;this.pageCount=Math.ceil(e/this.perPage),this.page=Math.ceil(t/this.perPage);let n=Math.max(this.page-Math.ceil(this.range/2)+1,1),i=Math.min(n+this.range-1,this.pageCount);n=Math.max(i-this.range+1,1),console.log("<pb-paginate> start: %d, total: %d, perPage: %d, pageCount: %s, page: %d, lower: %d, upper: %d",t,e,this.perPage,this.pageCount,this.page,n,i);const r=[];for(let t=n;t<=i;t++)r.push({label:t,class:t===this.page?"active":""});this.pages=r}_refresh(t){this.start=Number(t.detail.start),this.total=t.detail.count,this._update(this.start,this.total)}_handleClick(t,e){this.start=(this.pages[e].label-1)*this.perPage+1,this.emitTo("pb-load",{params:{start:this.start,"per-page":this.perPage,page:e}})}_handleFirst(t){this.start=1,this.emitTo("pb-load",{params:{start:1,"per-page":this.perPage,page:0}})}_handleLast(t){this.start=(this.pageCount-1)*this.perPage+1,this.emitTo("pb-load",{params:{start:this.start,"per-page":this.perPage,page:this.pageCount-1}})}}customElements.define("pb-paginate",jr);
|
|
765
765
|
/**
|
|
766
766
|
@license
|
|
767
767
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -772,7 +772,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
772
772
|
part of the polymer project is also subject to an additional IP rights grant
|
|
773
773
|
found at http://polymer.github.io/PATENTS.txt
|
|
774
774
|
*/
|
|
775
|
-
e({_template:
|
|
775
|
+
e({_template:n`
|
|
776
776
|
<style>
|
|
777
777
|
:host {
|
|
778
778
|
display: block;
|
|
@@ -936,7 +936,7 @@ e({_template:i`
|
|
|
936
936
|
<div id="secondaryProgress" hidden\$="[[_hideSecondaryProgress(secondaryRatio)]]"></div>
|
|
937
937
|
<div id="primaryProgress"></div>
|
|
938
938
|
</div>
|
|
939
|
-
`,is:"paper-progress",behaviors:[{properties:{value:{type:Number,value:0,notify:!0,reflectToAttribute:!0},min:{type:Number,value:0,notify:!0},max:{type:Number,value:100,notify:!0},step:{type:Number,value:1,notify:!0},ratio:{type:Number,value:0,readOnly:!0,notify:!0}},observers:["_update(value, min, max, step)"],_calcRatio:function(t){return(this._clampValue(t)-this.min)/(this.max-this.min)},_clampValue:function(t){return Math.min(this.max,Math.max(this.min,this._calcStep(t)))},_calcStep:function(t){if(t=parseFloat(t),!this.step)return t;var e=Math.round((t-this.min)/this.step);return this.step<1?e/(1/this.step)+this.min:e*this.step+this.min},_validateValue:function(){var t=this._clampValue(this.value);return this.value=this.oldValue=isNaN(t)?this.oldValue:t,this.value!==t},_update:function(){this._validateValue(),this._setRatio(100*this._calcRatio(this.value))}}],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Number,value:0,readOnly:!0},indeterminate:{type:Boolean,value:!1,observer:"_toggleIndeterminate"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, value, min, max, indeterminate)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function(t){this.toggleClass("indeterminate",t,this.$.primaryProgress)},_transformProgress:function(t,e){var
|
|
939
|
+
`,is:"paper-progress",behaviors:[{properties:{value:{type:Number,value:0,notify:!0,reflectToAttribute:!0},min:{type:Number,value:0,notify:!0},max:{type:Number,value:100,notify:!0},step:{type:Number,value:1,notify:!0},ratio:{type:Number,value:0,readOnly:!0,notify:!0}},observers:["_update(value, min, max, step)"],_calcRatio:function(t){return(this._clampValue(t)-this.min)/(this.max-this.min)},_clampValue:function(t){return Math.min(this.max,Math.max(this.min,this._calcStep(t)))},_calcStep:function(t){if(t=parseFloat(t),!this.step)return t;var e=Math.round((t-this.min)/this.step);return this.step<1?e/(1/this.step)+this.min:e*this.step+this.min},_validateValue:function(){var t=this._clampValue(this.value);return this.value=this.oldValue=isNaN(t)?this.oldValue:t,this.value!==t},_update:function(){this._validateValue(),this._setRatio(100*this._calcRatio(this.value))}}],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Number,value:0,readOnly:!0},indeterminate:{type:Boolean,value:!1,observer:"_toggleIndeterminate"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, value, min, max, indeterminate)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function(t){this.toggleClass("indeterminate",t,this.$.primaryProgress)},_transformProgress:function(t,e){var n="scaleX("+e/100+")";t.style.transform=t.style.webkitTransform=n},_mainRatioChanged:function(t){this._transformProgress(this.$.primaryProgress,t)},_progressChanged:function(t,e,n,i,r){t=this._clampValue(t),e=this._clampValue(e);var o=100*this._calcRatio(t),a=100*this._calcRatio(e);this._setSecondaryRatio(o),this._transformProgress(this.$.secondaryProgress,o),this._transformProgress(this.$.primaryProgress,a),this.secondaryProgress=t,r?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",e),this.setAttribute("aria-valuemin",n),this.setAttribute("aria-valuemax",i)},_disabledChanged:function(t){this.setAttribute("aria-disabled",t?"true":"false")},_hideSecondaryProgress:function(t){return 0===t}});class qr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{_disabled:{type:Boolean}})}constructor(){super(),this._disabled=!0}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-start-update",this._startUpdate.bind(this)),this.subscribeTo("pb-end-update",this._endUpdate.bind(this))}render(){return this.style.visibility=this._disabled?"hidden":"visible",$`
|
|
940
940
|
<paper-progress id="progress" indeterminate ?disabled="${this._disabled}"></paper-progress>
|
|
941
941
|
`}static get styles(){return P`
|
|
942
942
|
:host {
|
|
@@ -995,9 +995,9 @@ e({_template:i`
|
|
|
995
995
|
.buttons{
|
|
996
996
|
margin-top:1rem;
|
|
997
997
|
}
|
|
998
|
-
`}_doSearch(){let t=this.shadowRoot.getElementById("ironform").serializeForm();t=this._paramsFromSubforms(t),this.redirect?window.location.href=`${this.action}?${new URLSearchParams(t)}`:(this.setParameters(t),this.pushHistory("search"),t.start=1,this.emitTo("pb-load",{url:this.action,params:t}))}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}_handleEnter(t){13===t.keyCode&&this._doSearch()}_doSubmit(){this.shadowRoot.getElementById("ironform").submit()}_reset(){this.shadowRoot.getElementById("ironform").reset()}_autocomplete(t){const e=this.shadowRoot.getElementById("ironform").serializeForm(),
|
|
998
|
+
`}_doSearch(){let t=this.shadowRoot.getElementById("ironform").serializeForm();t=this._paramsFromSubforms(t),this.redirect?window.location.href=`${this.action}?${new URLSearchParams(t)}`:(this.setParameters(t),this.pushHistory("search"),t.start=1,this.emitTo("pb-load",{url:this.action,params:t}))}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}_handleEnter(t){13===t.keyCode&&this._doSearch()}_doSubmit(){this.shadowRoot.getElementById("ironform").submit()}_reset(){this.shadowRoot.getElementById("ironform").reset()}_autocomplete(t){const e=this.shadowRoot.getElementById("ironform").serializeForm(),n=this.shadowRoot.getElementById("autocompleteLoader");n.params=e,n.generateRequest()}_updateSuggestions(){const t=this.shadowRoot.getElementById("autocomplete"),e=this.shadowRoot.getElementById("autocompleteLoader");e.lastResponse&&t.suggestions(e.lastResponse)}}customElements.define("pb-search",Ur);class Wr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},selector:{type:String},action:{type:String},on:{type:String},off:{type:String},default:{type:String},propertiesOn:{type:Object,attribute:"properties-on"},propertiesOff:{type:Object,attribute:"properties-off"},checked:{type:Boolean},initFromView:{type:Boolean,attribute:"init-from-view"}})}constructor(){super(),this.default="on",this.action="toggle",this.propertiesOn={},this.propertiesOff={},this.initFromView=!1}render(){return $`
|
|
999
999
|
<paper-checkbox id="checkbox" @change="${this._changed}" .checked="${this.checked}" .disabled="${this.disabled}"><slot></slot></paper-checkbox>
|
|
1000
|
-
`}connectedCallback(){if(super.connectedCallback(),this.initFromView){const t=this.subscribeTo("pb-update",e=>{"infiniteScroll"===this.name?this.checked=e.detail.infiniteScroll===this.propertiesOn[this.name]:"view"!==this.name&&"odd"!==this.name&&"xpath"!==this.name||(this.checked=e.detail.data[this.name]===this.propertiesOn[this.name]),t.forEach(t=>document.removeEventListener("pb-update",t))});this.waitForChannel(()=>{const t={selectors:[{selector:this.selector,command:this.action,state:this.checked}],properties:{},action:"init"};this.emitTo("pb-toggle",t),this.signalReady()})}else{const t=this.getParameter(this.name);this.checked=void 0!==t?"on"===t:"on"===this.default,this.waitForChannel(()=>{const t={selectors:[{selector:this.selector,command:this.action,state:this.checked}],properties:this.checked?this.propertiesOn:this.propertiesOff,action:"init"};this.emitTo("pb-toggle",t),this.signalReady()})}}attributeChangedCallback(t,e,
|
|
1000
|
+
`}connectedCallback(){if(super.connectedCallback(),this.initFromView){const t=this.subscribeTo("pb-update",e=>{"infiniteScroll"===this.name?this.checked=e.detail.infiniteScroll===this.propertiesOn[this.name]:"view"!==this.name&&"odd"!==this.name&&"xpath"!==this.name||(this.checked=e.detail.data[this.name]===this.propertiesOn[this.name]),t.forEach(t=>document.removeEventListener("pb-update",t))});this.waitForChannel(()=>{const t={selectors:[{selector:this.selector,command:this.action,state:this.checked}],properties:{},action:"init"};this.emitTo("pb-toggle",t),this.signalReady()})}else{const t=this.getParameter(this.name);this.checked=void 0!==t?"on"===t:"on"===this.default,this.waitForChannel(()=>{const t={selectors:[{selector:this.selector,command:this.action,state:this.checked}],properties:this.checked?this.propertiesOn:this.propertiesOff,action:"init"};this.emitTo("pb-toggle",t),this.signalReady()})}}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"on":this.propertiesOn[this.name]=n;break;case"off":this.propertiesOff[this.name]=n}}_changed(){this.checked=this.shadowRoot.getElementById("checkbox").checked,this.name&&(this.setParameter(this.name,this.checked?"on":"off"),this.pushHistory("toggle feature "+this.name));const t={selectors:[{selector:this.selector,command:this.action,state:this.checked}],properties:this.checked?this.propertiesOn:this.propertiesOff,action:"refresh"};this.emitTo("pb-toggle",t)}}customElements.define("pb-toggle-feature",Wr),
|
|
1001
1001
|
/**
|
|
1002
1002
|
@license
|
|
1003
1003
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -1008,7 +1008,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
1008
1008
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1009
1009
|
found at http://polymer.github.io/PATENTS.txt
|
|
1010
1010
|
*/
|
|
1011
|
-
e({_template:
|
|
1011
|
+
e({_template:n`
|
|
1012
1012
|
<style>
|
|
1013
1013
|
:host {
|
|
1014
1014
|
overflow: hidden; /* needed for text-overflow: ellipsis to work on ff */
|
|
@@ -1052,7 +1052,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
1052
1052
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1053
1053
|
found at http://polymer.github.io/PATENTS.txt
|
|
1054
1054
|
*/
|
|
1055
|
-
e({_template:
|
|
1055
|
+
e({_template:n`
|
|
1056
1056
|
<style include="paper-item-shared-styles"></style>
|
|
1057
1057
|
<style>
|
|
1058
1058
|
:host {
|
|
@@ -1077,7 +1077,7 @@ e({_template:i`
|
|
|
1077
1077
|
<slot name="item-icon"></slot>
|
|
1078
1078
|
</div>
|
|
1079
1079
|
<slot></slot>
|
|
1080
|
-
`,is:"paper-icon-item",behaviors:[L]});class Gr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},label:{type:String},selected:{type:Number},items:{type:Array}})}constructor(){super(),this.initializing=!0,this.items=[],this.label="document.selectFeature"}connectedCallback(){super.connectedCallback();const t=this.getParameter(this.name);void 0!==t?this.selected=parseInt(t,10):this.items.length>0&&(this.selected=0),this.waitForChannel(()=>{this.selected&&this.selected<this.items.length&&this._emit("init",this.selected),this.initializing=!1,this.signalReady()})}firstUpdated(){super.firstUpdated(),this.shadowRoot.getElementById("menu").addEventListener("selected-item-changed",this._selectionChanged.bind(this))}_selectionChanged(){const t=this.shadowRoot.getElementById("list").selected;this.setParameter(this.name,t),this.pushHistory("toggle feature "+this.name),console.log("<pb-select-feature> Setting features: %o",this.items[t]),this._emit("refresh",t)}_emit(t,e){const
|
|
1080
|
+
`,is:"paper-icon-item",behaviors:[L]});class Gr extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},label:{type:String},selected:{type:Number},items:{type:Array}})}constructor(){super(),this.initializing=!0,this.items=[],this.label="document.selectFeature"}connectedCallback(){super.connectedCallback();const t=this.getParameter(this.name);void 0!==t?this.selected=parseInt(t,10):this.items.length>0&&(this.selected=0),this.waitForChannel(()=>{this.selected&&this.selected<this.items.length&&this._emit("init",this.selected),this.initializing=!1,this.signalReady()})}firstUpdated(){super.firstUpdated(),this.shadowRoot.getElementById("menu").addEventListener("selected-item-changed",this._selectionChanged.bind(this))}_selectionChanged(){const t=this.shadowRoot.getElementById("list").selected;this.setParameter(this.name,t),this.pushHistory("toggle feature "+this.name),console.log("<pb-select-feature> Setting features: %o",this.items[t]),this._emit("refresh",t)}_emit(t,e){const n=this.items[e],i={properties:n.properties||{},selectors:n.selectors,action:t};this.emitTo("pb-toggle",i)}render(){return $`
|
|
1081
1081
|
<paper-dropdown-menu id="menu" label="${r(this.label)}" .disabled="${this.disabled}">
|
|
1082
1082
|
<paper-listbox id="list" slot="dropdown-content" selected="${this.selected}">
|
|
1083
1083
|
${this.items.map(t=>$`<paper-item>${t.name}</paper-item>`)}
|
|
@@ -1087,7 +1087,7 @@ e({_template:i`
|
|
|
1087
1087
|
:host {
|
|
1088
1088
|
display: block;
|
|
1089
1089
|
}
|
|
1090
|
-
`}}customElements.define("pb-select-feature",Gr);var Xr={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Kr={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Zr=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Qr={CSS:{},springs:{}};function Yr(t,e,i){return Math.min(Math.max(t,e),i)}function Jr(t,e){return t.indexOf(e)>-1}function to(t,e){return t.apply(null,e)}var eo={arr:function(t){return Array.isArray(t)},obj:function(t){return Jr(Object.prototype.toString.call(t),"Object")},pth:function(t){return eo.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||eo.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return eo.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return eo.hex(t)||eo.rgb(t)||eo.hsl(t)},key:function(t){return!Xr.hasOwnProperty(t)&&!Kr.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function io(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function no(t,e){var i=io(t),n=Yr(eo.und(i[0])?1:i[0],.1,100),r=Yr(eo.und(i[1])?100:i[1],.1,100),o=Yr(eo.und(i[2])?10:i[2],.1,100),a=Yr(eo.und(i[3])?0:i[3],.1,100),s=Math.sqrt(r/n),l=o/(2*Math.sqrt(r*n)),c=l<1?s*Math.sqrt(1-l*l):0,h=1,p=l<1?(l*s-a)/c:-a+s;function d(t){var i=e?e*t/1e3:t;return i=l<1?Math.exp(-i*l*s)*(h*Math.cos(c*i)+p*Math.sin(c*i)):(h+p*i)*Math.exp(-i*s),0===t||1===t?t:1-i}function u(){var e=Qr.springs[t];if(e)return e;for(var i=1/6,n=0,r=0;;)if(1===d(n+=i)){if(++r>=16)break}else r=0;var o=n*i*1e3;return Qr.springs[t]=o,o}return e?d:u}function ro(t){return void 0===t&&(t=10),function(e){return Math.ceil(Yr(e,1e-6,1)*t)*(1/t)}}var oo,ao,so=function(){var t=11,e=1/(t-1);function i(t,e){return 1-3*e+3*t}function n(t,e){return 3*e-6*t}function r(t){return 3*t}function o(t,e,o){return((i(e,o)*t+n(e,o))*t+r(e))*t}function a(t,e,o){return 3*i(e,o)*t*t+2*n(e,o)*t+r(e)}function s(t,e,i,n,r){var a,s,l=0;do{(a=o(s=e+(i-e)/2,n,r)-t)>0?i=s:e=s}while(Math.abs(a)>1e-7&&++l<10);return s}function l(t,e,i,n){for(var r=0;r<4;++r){var s=a(e,i,n);if(0===s)return e;e-=(o(e,i,n)-t)/s}return e}function c(i,n,r,c){if(0<=i&&i<=1&&0<=r&&r<=1){var h=new Float32Array(t);if(i!==n||r!==c)for(var p=0;p<t;++p)h[p]=o(p*e,i,r);return function(t){return i===n&&r===c||0===t||1===t?t:o(d(t),n,c)}}function d(n){for(var o=0,c=1,p=t-1;c!==p&&h[c]<=n;++c)o+=e;--c;var d=o+(n-h[c])/(h[c+1]-h[c])*e,u=a(d,i,r);return u>=.001?l(n,d,i,r):0===u?d:s(n,o,o+e,i,r)}}return c}(),lo=(oo={linear:function(){return function(t){return t}}},ao={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var i=Yr(t,1,10),n=Yr(e,.1,2);return function(t){return 0===t||1===t?t:-i*Math.pow(2,10*(t-1))*Math.sin((t-1-n/(2*Math.PI)*Math.asin(1/i))*(2*Math.PI)/n)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){ao[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(ao).forEach((function(t){var e=ao[t];oo["easeIn"+t]=e,oo["easeOut"+t]=function(t,i){return function(n){return 1-e(t,i)(1-n)}},oo["easeInOut"+t]=function(t,i){return function(n){return n<.5?e(t,i)(2*n)/2:1-e(t,i)(-2*n+2)/2}},oo["easeOutIn"+t]=function(t,i){return function(n){return n<.5?(1-e(t,i)(1-2*n))/2:(e(t,i)(2*n-1)+1)/2}}})),oo);function co(t,e){if(eo.fnc(t))return t;var i=t.split("(")[0],n=lo[i],r=io(t);switch(i){case"spring":return no(t,e);case"cubicBezier":return to(so,r);case"steps":return to(ro,r);default:return to(n,r)}}function ho(t){try{return document.querySelectorAll(t)}catch(t){return}}function po(t,e){for(var i=t.length,n=arguments.length>=2?arguments[1]:void 0,r=[],o=0;o<i;o++)if(o in t){var a=t[o];e.call(n,a,o,t)&&r.push(a)}return r}function uo(t){return t.reduce((function(t,e){return t.concat(eo.arr(e)?uo(e):e)}),[])}function go(t){return eo.arr(t)?t:(eo.str(t)&&(t=ho(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function fo(t,e){return t.some((function(t){return t===e}))}function mo(t){var e={};for(var i in t)e[i]=t[i];return e}function vo(t,e){var i=mo(t);for(var n in t)i[n]=e.hasOwnProperty(n)?e[n]:t[n];return i}function bo(t,e){var i=mo(t);for(var n in e)i[n]=eo.und(t[n])?e[n]:t[n];return i}function yo(t){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);return e?"rgba("+e[1]+",1)":t}function _o(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,i=t.replace(e,(function(t,e,i,n){return e+e+i+i+n+n})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);return"rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",1)"}function wo(t){var e,i,n,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),o=parseInt(r[1],10)/360,a=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100,l=r[4]||1;function c(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(0==a)e=i=n=s;else{var h=s<.5?s*(1+a):s+a-s*a,p=2*s-h;e=c(p,h,o+1/3),i=c(p,h,o),n=c(p,h,o-1/3)}return"rgba("+255*e+","+255*i+","+255*n+","+l+")"}function xo(t){return eo.rgb(t)?yo(t):eo.hex(t)?_o(t):eo.hsl(t)?wo(t):void 0}function ko(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function zo(t){return Jr(t,"translate")||"perspective"===t?"px":Jr(t,"rotate")||Jr(t,"skew")?"deg":void 0}function Ao(t,e){return eo.fnc(t)?t(e.target,e.id,e.total):t}function So(t,e){return t.getAttribute(e)}function Co(t,e,i){if(fo([i,"deg","rad","turn"],ko(e)))return e;var n=Qr.CSS[e+i];if(!eo.und(n))return n;var r=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=r+i;var s=r/o.offsetWidth;a.removeChild(o);var l=s*parseFloat(e);return Qr.CSS[e+i]=l,l}function Eo(t,e,i){if(e in t.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=t.style[e]||getComputedStyle(t).getPropertyValue(n)||"0";return i?Co(t,r,i):r}}function Mo(t,e){return eo.dom(t)&&!eo.inp(t)&&(!eo.nil(So(t,e))||eo.svg(t)&&t[e])?"attribute":eo.dom(t)&&fo(Zr,e)?"transform":eo.dom(t)&&"transform"!==e&&Eo(t,e)?"css":null!=t[e]?"object":void 0}function Lo(t){if(eo.dom(t)){for(var e,i=t.style.transform||"",n=/(\w+)\(([^)]*)\)/g,r=new Map;e=n.exec(i);)r.set(e[1],e[2]);return r}}function Ho(t,e,i,n){var r=Jr(e,"scale")?1:0+zo(e),o=Lo(t).get(e)||r;return i&&(i.transforms.list.set(e,o),i.transforms.last=e),n?Co(t,o,n):o}function To(t,e,i,n){switch(Mo(t,e)){case"transform":return Ho(t,e,n,i);case"css":return Eo(t,e,i);case"attribute":return So(t,e);default:return t[e]||0}}function Vo(t,e){var i=/^(\*=|\+=|-=)/.exec(t);if(!i)return t;var n=ko(t)||0,r=parseFloat(e),o=parseFloat(t.replace(i[0],""));switch(i[0][0]){case"+":return r+o+n;case"-":return r-o+n;case"*":return r*o+n}}function $o(t,e){if(eo.col(t))return xo(t);if(/\s/g.test(t))return t;var i=ko(t),n=i?t.substr(0,t.length-i.length):t;return e?n+e:n}function Oo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Po(t){return 2*Math.PI*So(t,"r")}function Ro(t){return 2*So(t,"width")+2*So(t,"height")}function Io(t){return Oo({x:So(t,"x1"),y:So(t,"y1")},{x:So(t,"x2"),y:So(t,"y2")})}function No(t){for(var e,i=t.points,n=0,r=0;r<i.numberOfItems;r++){var o=i.getItem(r);r>0&&(n+=Oo(e,o)),e=o}return n}function Fo(t){var e=t.points;return No(t)+Oo(e.getItem(e.numberOfItems-1),e.getItem(0))}function Bo(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return Po(t);case"rect":return Ro(t);case"line":return Io(t);case"polyline":return No(t);case"polygon":return Fo(t)}}function Do(t){var e=Bo(t);return t.setAttribute("stroke-dasharray",e),e}function jo(t){for(var e=t.parentNode;eo.svg(e)&&eo.svg(e.parentNode);)e=e.parentNode;return e}function qo(t,e){var i=e||{},n=i.el||jo(t),r=n.getBoundingClientRect(),o=So(n,"viewBox"),a=r.width,s=r.height,l=i.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:s,vW:l[2],vH:l[3]}}function Uo(t,e){var i=eo.str(t)?ho(t)[0]:t,n=e||100;return function(t){return{property:t,el:i,svg:qo(i),totalLength:Bo(i)*(n/100)}}}function Wo(t,e,i){function n(i){void 0===i&&(i=0);var n=e+i>=1?e+i:0;return t.el.getPointAtLength(n)}var r=qo(t.el,t.svg),o=n(),a=n(-1),s=n(1),l=i?1:r.w/r.vW,c=i?1:r.h/r.vH;switch(t.property){case"x":return(o.x-r.x)*l;case"y":return(o.y-r.y)*c;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function Go(t,e){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=$o(eo.pth(t)?t.totalLength:t,e)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:eo.str(t)||e?n.split(i):[]}}function Xo(t){return po(t?uo(eo.arr(t)?t.map(go):go(t)):[],(function(t,e,i){return i.indexOf(t)===e}))}function Ko(t){var e=Xo(t);return e.map((function(t,i){return{target:t,id:i,total:e.length,transforms:{list:Lo(t)}}}))}function Zo(t,e){var i=mo(e);if(/^spring/.test(i.easing)&&(i.duration=no(i.easing)),eo.arr(t)){var n=t.length;2===n&&!eo.obj(t[0])?t={value:t}:eo.fnc(e.duration)||(i.duration=e.duration/n)}var r=eo.arr(t)?t:[t];return r.map((function(t,i){var n=eo.obj(t)&&!eo.pth(t)?t:{value:t};return eo.und(n.delay)&&(n.delay=i?0:e.delay),eo.und(n.endDelay)&&(n.endDelay=i===r.length-1?e.endDelay:0),n})).map((function(t){return bo(t,i)}))}function Qo(t){for(var e=po(uo(t.map((function(t){return Object.keys(t)}))),(function(t){return eo.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),i={},n=function(n){var r=e[n];i[r]=t.map((function(t){var e={};for(var i in t)eo.key(i)?i==r&&(e.value=t[i]):e[i]=t[i];return e}))},r=0;r<e.length;r++)n(r);return i}function Yo(t,e){var i=[],n=e.keyframes;for(var r in n&&(e=bo(Qo(n),e)),e)eo.key(r)&&i.push({name:r,tweens:Zo(e[r],t)});return i}function Jo(t,e){var i={};for(var n in t){var r=Ao(t[n],e);eo.arr(r)&&1===(r=r.map((function(t){return Ao(t,e)}))).length&&(r=r[0]),i[n]=r}return i.duration=parseFloat(i.duration),i.delay=parseFloat(i.delay),i}function ta(t,e){var i;return t.tweens.map((function(n){var r=Jo(n,e),o=r.value,a=eo.arr(o)?o[1]:o,s=ko(a),l=To(e.target,t.name,s,e),c=i?i.to.original:l,h=eo.arr(o)?o[0]:c,p=ko(h)||ko(l),d=s||p;return eo.und(a)&&(a=c),r.from=Go(h,d),r.to=Go(Vo(a,h),d),r.start=i?i.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=co(r.easing,r.duration),r.isPath=eo.pth(o),r.isPathTargetInsideSVG=r.isPath&&eo.svg(e.target),r.isColor=eo.col(r.from.original),r.isColor&&(r.round=1),i=r,r}))}var ea={css:function(t,e,i){return t.style[e]=i},attribute:function(t,e,i){return t.setAttribute(e,i)},object:function(t,e,i){return t[e]=i},transform:function(t,e,i,n,r){if(n.list.set(e,i),e===n.last||r){var o="";n.list.forEach((function(t,e){o+=e+"("+t+") "})),t.style.transform=o}}};function ia(t,e){Ko(t).forEach((function(t){for(var i in e){var n=Ao(e[i],t),r=t.target,o=ko(n),a=To(r,i,o,t),s=Vo($o(n,o||ko(a)),a),l=Mo(r,i);ea[l](r,i,s,t.transforms,!0)}}))}function na(t,e){var i=Mo(t.target,e.name);if(i){var n=ta(e,t),r=n[n.length-1];return{type:i,property:e.name,animatable:t,tweens:n,duration:r.end,delay:n[0].delay,endDelay:r.endDelay}}}function ra(t,e){return po(uo(t.map((function(t){return e.map((function(e){return na(t,e)}))}))),(function(t){return!eo.und(t)}))}function oa(t,e){var i=t.length,n=function(t){return t.timelineOffset?t.timelineOffset:0},r={};return r.duration=i?Math.max.apply(Math,t.map((function(t){return n(t)+t.duration}))):e.duration,r.delay=i?Math.min.apply(Math,t.map((function(t){return n(t)+t.delay}))):e.delay,r.endDelay=i?r.duration-Math.max.apply(Math,t.map((function(t){return n(t)+t.duration-t.endDelay}))):e.endDelay,r}var aa=0;function sa(t){var e=vo(Xr,t),i=vo(Kr,t),n=Yo(i,t),r=Ko(t.targets),o=ra(r,n),a=oa(o,i),s=aa;return aa++,bo(e,{id:s,children:[],animatables:r,animations:o,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}var la=[],ca=function(){var t;function e(){t||ha()&&pa.suspendWhenDocumentHidden||!(la.length>0)||(t=requestAnimationFrame(i))}function i(e){for(var n=la.length,r=0;r<n;){var o=la[r];o.paused?(la.splice(r,1),n--):(o.tick(e),r++)}t=r>0?requestAnimationFrame(i):void 0}function n(){pa.suspendWhenDocumentHidden&&(ha()?t=cancelAnimationFrame(t):(la.forEach((function(t){return t._onDocumentVisibility()})),ca()))}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",n),e}();function ha(){return!!document&&document.hidden}function pa(t){void 0===t&&(t={});var e,i=0,n=0,r=0,o=0,a=null;function s(t){var e=window.Promise&&new Promise((function(t){return a=t}));return t.finished=e,e}var l=sa(t);s(l);function c(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(t){return t.reversed=l.reversed}))}function h(t){return l.reversed?l.duration-t:t}function p(){i=0,n=h(l.currentTime)*(1/pa.speed)}function d(t,e){e&&e.seek(t-e.timelineOffset)}function u(t){if(l.reversePlayback)for(var i=o;i--;)d(t,e[i]);else for(var n=0;n<o;n++)d(t,e[n])}function g(t){for(var e=0,i=l.animations,n=i.length;e<n;){var r=i[e],o=r.animatable,a=r.tweens,s=a.length-1,c=a[s];s&&(c=po(a,(function(e){return t<e.end}))[0]||c);for(var h=Yr(t-c.start-c.delay,0,c.duration)/c.duration,p=isNaN(h)?1:c.easing(h),d=c.to.strings,u=c.round,g=[],f=c.to.numbers.length,m=void 0,v=0;v<f;v++){var b=void 0,y=c.to.numbers[v],_=c.from.numbers[v]||0;b=c.isPath?Wo(c.value,p*y,c.isPathTargetInsideSVG):_+p*(y-_),u&&(c.isColor&&v>2||(b=Math.round(b*u)/u)),g.push(b)}var w=d.length;if(w){m=d[0];for(var x=0;x<w;x++){d[x];var k=d[x+1],z=g[x];isNaN(z)||(m+=k?z+k:z+" ")}}else m=g[0];ea[r.type](o.target,r.property,m,o.transforms),r.currentValue=m,e++}}function f(t){l[t]&&!l.passThrough&&l[t](l)}function m(){l.remaining&&!0!==l.remaining&&l.remaining--}function v(t){var o=l.duration,p=l.delay,d=o-l.endDelay,v=h(t);l.progress=Yr(v/o*100,0,100),l.reversePlayback=v<l.currentTime,e&&u(v),!l.began&&l.currentTime>0&&(l.began=!0,f("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,f("loopBegin")),v<=p&&0!==l.currentTime&&g(0),(v>=d&&l.currentTime!==o||!o)&&g(o),v>p&&v<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,f("changeBegin")),f("change"),g(v)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,f("changeComplete")),l.currentTime=Yr(v,0,o),l.began&&f("update"),t>=o&&(n=0,m(),l.remaining?(i=r,f("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&c()):(l.paused=!0,l.completed||(l.completed=!0,f("loopComplete"),f("complete"),!l.passThrough&&"Promise"in window&&(a(),s(l)))))}return l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop,e=l.children;for(var i=o=e.length;i--;)l.children[i].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,g(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(t,e){return ia(t,e),l},l.tick=function(t){r=t,i||(i=r),v((r+(n-i))*pa.speed)},l.seek=function(t){v(h(t))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,la.push(l),p(),ca())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){ua(Xo(t),l)},l.reset(),l.autoplay&&l.play(),l}function da(t,e){for(var i=e.length;i--;)fo(t,e[i].animatable.target)&&e.splice(i,1)}function ua(t,e){var i=e.animations,n=e.children;da(t,i);for(var r=n.length;r--;){var o=n[r],a=o.animations;da(t,a),a.length||o.children.length||n.splice(r,1)}i.length||n.length||e.pause()}function ga(t){for(var e=Xo(t),i=la.length;i--;){ua(e,la[i])}}function fa(t,e){void 0===e&&(e={});var i=e.direction||"normal",n=e.easing?co(e.easing):null,r=e.grid,o=e.axis,a=e.from||0,s="first"===a,l="center"===a,c="last"===a,h=eo.arr(t),p=h?parseFloat(t[0]):parseFloat(t),d=h?parseFloat(t[1]):0,u=ko(h?t[1]:t)||0,g=e.start||0+(h?p:0),f=[],m=0;return function(t,e,v){if(s&&(a=0),l&&(a=(v-1)/2),c&&(a=v-1),!f.length){for(var b=0;b<v;b++){if(r){var y=l?(r[0]-1)/2:a%r[0],_=l?(r[1]-1)/2:Math.floor(a/r[0]),w=y-b%r[0],x=_-Math.floor(b/r[0]),k=Math.sqrt(w*w+x*x);"x"===o&&(k=-w),"y"===o&&(k=-x),f.push(k)}else f.push(Math.abs(a-b));m=Math.max.apply(Math,f)}n&&(f=f.map((function(t){return n(t/m)*m}))),"reverse"===i&&(f=f.map((function(t){return o?t<0?-1*t:-t:Math.abs(m-t)})))}return g+(h?(d-p)/m:p)*(Math.round(100*f[e])/100)+u}}function ma(t){void 0===t&&(t={});var e=pa(t);return e.duration=0,e.add=function(i,n){var r=la.indexOf(e),o=e.children;function a(t){t.passThrough=!0}r>-1&&la.splice(r,1);for(var s=0;s<o.length;s++)a(o[s]);var l=bo(i,vo(Kr,t));l.targets=l.targets||t.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=eo.und(n)?c:Vo(n,c),a(e),e.seek(l.timelineOffset);var h=pa(l);a(h),o.push(h);var p=oa(o,t);return e.delay=p.delay,e.endDelay=p.endDelay,e.duration=p.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}pa.version="3.2.1",pa.speed=1,pa.suspendWhenDocumentHidden=!0,pa.running=la,pa.remove=ga,pa.get=To,pa.set=ia,pa.convertPx=Co,pa.path=Uo,pa.setDashoffset=Do,pa.stagger=fa,pa.timeline=ma,pa.easing=co,pa.penner=lo,pa.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t};class va extends(R(V)){static get properties(){return Object.assign({src:{type:String},odd:{type:String,reflect:!0},view:{type:String,reflect:!0},nodeId:{type:String,reflect:!0,attribute:"node-id"},xmlId:{type:Array,reflect:!0,attribute:"xml-id"},xpath:{type:String,reflect:!0},map:{type:String},onUpdate:{type:Boolean,attribute:"on-update"},notFound:{type:String,attribute:"not-found"},url:{type:String},appendFootnotes:{type:Boolean,attribute:"append-footnotes"},suppressHighlight:{type:Boolean,attribute:"suppress-highlight",reflect:!0},columnSeparator:{type:String,attribute:"column-separator"},direction:{type:String},loadCss:{type:String,attribute:"load-css"},fixLinks:{type:Boolean,attribute:"fix-links"},useLanguage:{type:Boolean,attribute:"use-language"},animation:{type:Boolean},infiniteScroll:{type:Boolean,attribute:"infinite-scroll"},infiniteScrollMax:{type:Number,attribute:"infinite-scroll-max"},waitFor:{type:String,attribute:"wait-for"},disableHistory:{type:Boolean,attribute:"disable-history"},_features:{type:Object},_content:{type:Node,attribute:!1},_column1:{type:Node,attribute:!1},_column2:{type:Node,attribute:!1},_footnotes:{type:Node,attribute:!1},_style:{type:Node,attribute:!1}},super.properties)}constructor(){super(),this.src=null,this.url=null,this.onUpdate=!1,this.appendFootnotes=!1,this.notFound="the server did not return any content",this.animation=!1,this.direction="ltr",this.suppressHighlight=!1,this.highlight=!1,this.infiniteScrollMax=10,this.disableHistory=!1,this._features={},this._selector=new Map,this._chunks=[],this._scrollTarget=null}attributeChangedCallback(t,e,i){switch(super.attributeChangedCallback(t,e,i),t){case"src":this._updateSource(i,e)}}connectedCallback(){if(super.connectedCallback(),this.infiniteScroll&&(this.columnSeparator=null,this.animation=!1,this._content=document.createElement("div"),this._content.className="infinite-content"),!this.disableHistory){const t=this.getParameter("id");t&&!this.xmlId&&(this.xmlId=t);const e=this.getParameter("action");e&&"search"===e&&(this.highlight=!0);const i=this.getParameter("root");"single"===this.view?this.nodeId=null:i&&!this.nodeId&&(this.nodeId=i)}this.waitFor||(this.waitFor="pb-toggle-feature,pb-select-feature,pb-navigation"),this.subscribeTo("pb-navigate",t=>{t.detail.source&&t.detail.source===this||this.navigate(t.detail.direction)}),this.subscribeTo("pb-refresh",this._refresh.bind(this)),this.subscribeTo("pb-toggle",t=>{this.toggleFeature(t)}),this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)}),this.subscribeTo("pb-i18n-update",t=>{const e=this._features.language&&this._features.language!==t.detail.language;this._features.language=t.detail.language,this.useLanguage&&e&&this._refresh()},[]),this.signalReady(),this.onUpdate&&this.subscribeTo("pb-update",this._refresh.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this._scrollObserver&&this._scrollObserver.disconnect()}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!0),this.infiniteScroll&&(this._topObserver=this.shadowRoot.getElementById("top-observer"),this._bottomObserver=this.shadowRoot.getElementById("bottom-observer"),this._bottomObserver.style.display="none",this._topObserver.style.display="none",this._scrollObserver=new IntersectionObserver(t=>{this._content&&t.forEach(t=>{if(t.isIntersecting)if("bottom-observer"===t.target.id){const t=this._content.lastElementChild;if(t){const e=t.getAttribute("data-next");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(console.log("<pb-view> Loading next page: %s",e),this._checkChunks("forward"),this._load(e,"forward"))}}else{const t=this._content.firstElementChild;if(t){const e=t.getAttribute("data-previous");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(this._checkChunks("backward"),this._load(e,"backward"))}}})})),this.onUpdate||va.waitOnce("pb-page-ready",t=>{t&&t.language&&(this._features.language=t.language),this.wait(()=>this._refresh())})}getOdd(){return this.odd||this.getDocument().odd||"teipublisher"}getView(){return this.view||this.getDocument().view||"single"}forceUpdate(){this._load(this.nodeId)}animate(){this.animation&&("forward"===this.lastDirection?pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[1e3,0],duration:300,easing:"linear"}):pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[-1e3,0],duration:300,easing:"linear"}))}enableScrollbar(t){t?this.classList.add("noscroll"):this.classList.remove("noscroll")}_refresh(t){if(t&&t.detail){if(t.detail.hash&&!(t.detail.id||t.detail.path||t.detail.odd||t.detail.view||t.detail.position)){this._scrollTarget=t.detail.hash;const e=this.shadowRoot.getElementById(this._scrollTarget);return void(e&&setTimeout(()=>e.scrollIntoView()))}if(t.detail.path){this.getDocument().path=t.detail.path}t.detail.id&&(this.xmlId=t.detail.id),this.odd=t.detail.odd||this.odd,void 0!==t.detail.columnSeparator&&(this.columnSeparator=t.detail.columnSeparator),this.view=t.detail.view||this.view,null===t.detail.position?this.nodeId=null:this.nodeId=t.detail.position||this.nodeId,this._scrollTarget=t.detail.hash}this._updateStyles(),this.infiniteScroll&&this._clear(),this._load(this.nodeId)}_load(t,e){if(!this.getDocument().path)return void console.log("No path");if(this._loading)return;this._loading=!0;const i=this.getParameters(t);e&&(i._dir=e),this._doLoad(i)}_doLoad(t){this.emitTo("pb-start-update",t),console.log("<pb-view> Loading view with params %o",t),this.infiniteScroll||this._clear(),this._scrollObserver&&(this._bottomObserver&&this._scrollObserver.unobserve(this._bottomObserver),this._topObserver&&this._scrollObserver.unobserve(this._topObserver));const e=this.shadowRoot.getElementById("loadContent");this.url||(this.minApiVersion("1.0.0")?this.url="api/parts":this.url="modules/lib/components.xql"),this.minApiVersion("1.0.0")?e.url=`${this.getEndpoint()}/${this.url}/${encodeURIComponent(this.getDocument().path)}/json`:e.url=`${this.getEndpoint()}/${this.url}`,e.params=t,e.generateRequest()}_clear(){this.infiniteScroll?(this._content=document.createElement("div"),this._content.className="infinite-content"):this._content=null,this._column1=null,this._column2=null,this._footnotes=null,this._chunks=[]}_handleError(){this._clear();const t=this.shadowRoot.getElementById("loadContent");let e;const{response:i}=t.lastError;e=i?i.description:'<pb-i18n key="dialogs.serverError"></pb-i18n>';const n=`\n <p>${this.notFound}</p>\n <p><pb-i18n key="dialogs.serverError"></pb-i18n>: ${e} </p>\n `;this._replaceContent({content:n}),this.emitTo("pb-end-update")}_handleContent(){const t=this.shadowRoot.getElementById("loadContent"),e=t.lastResponse;if(e){if(e.error)return this.notFound&&(this._content=this.notFound),void this.emitTo("pb-end-update",null);this._replaceContent(e,t.params._dir),this.animate(),this._scrollTarget&&this.updateComplete.then(()=>{const t=this.shadowRoot.getElementById(this._scrollTarget)||this.shadowRoot.querySelector(`[node-id="${this._scrollTarget}"]`);t&&setTimeout(()=>{t.scrollIntoView()},100),this._scrollTarget=null}),this.next=e.next,this.nextId=e.nextId,this.previous=e.previous,this.previousId=e.previousId,this.nodeId=e.root,this.switchView=e.switchView,this.disableHistory||!this.xmlId||this.map||(this.setParameter("id",this.xmlId),this.pushHistory("Navigate to xml:id")),this.xmlId=null,this.updateComplete.then(()=>{const i=this.shadowRoot.getElementById("view");this._applyToggles(i),this._fixLinks(i),nn(i);const n={data:e,root:i,params:t.params,id:this.xmlId,position:this.nodeId};this.emitTo("pb-update",n),this._scroll()}),this.emitTo("pb-end-update",null)}else console.error("<pb-view> No response received")}_replaceContent(t,e){const i=document.createDocumentFragment(),n=document.createElement("div");if(i.appendChild(n),n.innerHTML=t.content,this.columnSeparator)this._replaceColumns(n),this._loading=!1;else if(this.infiniteScroll){let i;switch(n.className="scroll-fragment",n.setAttribute("data-root",t.root),t.next&&n.setAttribute("data-next",t.next),t.previous&&n.setAttribute("data-previous",t.previous),e){case"backward":i=this._content.firstElementChild,this._chunks.unshift(n),this.updateComplete.then(()=>{i.scrollIntoView(!0),this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._content.insertBefore(n,i);break;default:this.updateComplete.then(()=>{this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._chunks.push(n),this._content.appendChild(n)}}else this._content=n,this._loading=!1;if(this.appendFootnotes){const e=document.createElement("div");t.footnotes&&(e.innerHTML=t.footnotes),this._footnotes=e}return this._initFootnotes(this._footnotes),n}_checkVisibility(){const t=this._chunks[this._chunks.length-1].hasAttribute("data-next");this._bottomObserver.style.display=t?"":"none";const e=this._chunks[0].hasAttribute("data-previous");this._topObserver.style.display=e?"":"none"}_replaceColumns(t){let e;if(this.columnSeparator){const i=t.querySelectorAll(this.columnSeparator);i.length>0&&(e=i[i.length-1])}if(e){const i=this._getFragmentBefore(t,e),n=this._getFragmentAfter(t,e);"ltr"===this.direction?(this._column1=i,this._column2=n):(this._column2=i,this._column1=n)}else this._content=t}_scroll(){const{hash:t}=this.getUrl();if(t){const e=this.shadowRoot.getElementById(t.substring(1));console.log("hash target: %o",e),e&&e.scrollIntoView({block:"center",inline:"nearest"})}}_scrollToElement(t,e){const i=this.shadowRoot.getElementById(e.hash.substring(1));i&&(t.preventDefault(),console.log("<pb-view> Scrolling to element %s",i.id),i.scrollIntoView({block:"center",inline:"nearest"}))}_updateStyles(){const t=[];let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/transform/${this.getOdd()}.css`),t.push(e),this.loadCss&&(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/${this.loadCss}`),t.push(e)),this._style=t}_fixLinks(t){if(this.fixLinks){const e=this.getDocument(),i=this.toAbsoluteURL(e.path);t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src"),n=new URL(e,i);t.src=n}),t.querySelectorAll("a").forEach(t=>{const e=t.getAttribute("href");if(e===t.hash)t.addEventListener("click",e=>this._scrollToElement(e,t));else{const n=new URL(e,i);t.href=n}})}else t.querySelectorAll("a").forEach(t=>{t.getAttribute("href")===t.hash&&t.addEventListener("click",e=>this._scrollToElement(e,t))})}_initFootnotes(t){t&&t.querySelectorAll(".note, .fn-back").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const i=this.shadowRoot.getElementById("content").querySelector(t.hash);i&&i.scrollIntoView()})})}_getParameters(){const t=[];this.querySelectorAll("pb-param").forEach((function(e){t["user."+e.getAttribute("name")]=e.getAttribute("value")}));for(const[e,i]of Object.entries(this._features))t["user."+e]=i;return t}getParameters(t){t=t||this.nodeId;const e=this.getDocument(),i=this._getParameters();return this.minApiVersion("1.0.0")||(i.doc=e.path),i.odd=this.getOdd()+".odd",i.view=this.getView(),t&&(i.root=t),this.xpath&&(i.xpath=this.xpath),this.xmlId&&(i.id=this.xmlId),!this.suppressHighlight&&this.highlight&&(i.highlight="yes"),this.map&&(i.map=this.map),i}_applyToggles(t){0!==this._selector.size&&this._selector.forEach((e,i)=>{t.querySelectorAll(i).forEach(t=>{const i=e.command||"toggle";t.command&&t.command(i,e.state),e.state?t.classList.add(i):t.classList.remove(i)})})}goto(t){this._load(t)}gotoId(t){this.xmlId=t,this._load()}navigate(t){this.lastDirection=t,"backward"===t?this.previous&&(this.disableHistory||this.map||(this.previousId?this.setParameter("id",this.previousId):this.setParameter("root",this.previous),this.pushHistory("Navigate backward")),this._load(this.previous,t)):this.next&&(this.disableHistory||this.map||(this.nextId?this.setParameter("id",this.nextId):this.setParameter("root",this.next),this.pushHistory("Navigate forward")),this._load(this.next,t))}_checkChunks(t){if(this.infiniteScroll&&0!==this.infiniteScrollMax){if(this._chunks.length===this.infiniteScrollMax)switch(t){case"forward":this._content.removeChild(this._chunks.shift());break;default:this._content.removeChild(this._chunks.pop())}this.emitTo("pb-navigate",{direction:t,source:this})}}zoom(t){const e=this.shadowRoot.getElementById("view"),i=window.getComputedStyle(e).getPropertyValue("font-size"),n=parseInt(i.replace(/^(\d+)px/,"$1"));e.style.fontSize="in"===t?n+1+"px":n-1+"px"}toggleFeature(t){const e=()=>{const t=this.shadowRoot.getElementById("view");this._applyToggles(t)},i=t.detail.properties;for(const[t,e]of Object.entries(i))switch(t){case"odd":case"view":case"columnSeparator":case"xpath":case"nodeId":break;default:this._features[t]=e}i&&(i.odd&&(this.odd=i.odd),i.view&&(this.view=i.view,"single"===this.view?this.nodeId=null:this.nodeId=this.switchView),i.xpath&&(this.xpath=i.xpath),i.hasOwnProperty("columnSeparator")&&(this.columnSeparator=i.columnSeparator)),t.detail.selectors&&t.detail.selectors.forEach(t=>{this._selector.set(t.selector,{state:t.state,command:t.command||"toggle"})}),"refresh"===t.detail.action&&(Object.keys(i).length>0?(this._updateStyles(),this._load()):e())}_getFragmentBefore(t,e){const i=document.createRange();return i.setStartBefore(t),i.setEndBefore(e),i.cloneContents()}_getFragmentAfter(t,e){const i=document.createRange();return i.setStartBefore(e),i.setEndAfter(t),i.cloneContents()}_updateSource(t,e){void 0!==e&&t!==e&&(this.xpath=null,this.odd=null,this.xmlId=null,this.nodeId=null)}static get styles(){return P`
|
|
1090
|
+
`}}customElements.define("pb-select-feature",Gr);var Xr={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Kr={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Zr=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Qr={CSS:{},springs:{}};function Yr(t,e,n){return Math.min(Math.max(t,e),n)}function Jr(t,e){return t.indexOf(e)>-1}function to(t,e){return t.apply(null,e)}var eo={arr:function(t){return Array.isArray(t)},obj:function(t){return Jr(Object.prototype.toString.call(t),"Object")},pth:function(t){return eo.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||eo.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return eo.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return eo.hex(t)||eo.rgb(t)||eo.hsl(t)},key:function(t){return!Xr.hasOwnProperty(t)&&!Kr.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function no(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function io(t,e){var n=no(t),i=Yr(eo.und(n[0])?1:n[0],.1,100),r=Yr(eo.und(n[1])?100:n[1],.1,100),o=Yr(eo.und(n[2])?10:n[2],.1,100),a=Yr(eo.und(n[3])?0:n[3],.1,100),s=Math.sqrt(r/i),l=o/(2*Math.sqrt(r*i)),c=l<1?s*Math.sqrt(1-l*l):0,h=1,p=l<1?(l*s-a)/c:-a+s;function d(t){var n=e?e*t/1e3:t;return n=l<1?Math.exp(-n*l*s)*(h*Math.cos(c*n)+p*Math.sin(c*n)):(h+p*n)*Math.exp(-n*s),0===t||1===t?t:1-n}function u(){var e=Qr.springs[t];if(e)return e;for(var n=1/6,i=0,r=0;;)if(1===d(i+=n)){if(++r>=16)break}else r=0;var o=i*n*1e3;return Qr.springs[t]=o,o}return e?d:u}function ro(t){return void 0===t&&(t=10),function(e){return Math.ceil(Yr(e,1e-6,1)*t)*(1/t)}}var oo,ao,so=function(){var t=11,e=1/(t-1);function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function r(t){return 3*t}function o(t,e,o){return((n(e,o)*t+i(e,o))*t+r(e))*t}function a(t,e,o){return 3*n(e,o)*t*t+2*i(e,o)*t+r(e)}function s(t,e,n,i,r){var a,s,l=0;do{(a=o(s=e+(n-e)/2,i,r)-t)>0?n=s:e=s}while(Math.abs(a)>1e-7&&++l<10);return s}function l(t,e,n,i){for(var r=0;r<4;++r){var s=a(e,n,i);if(0===s)return e;e-=(o(e,n,i)-t)/s}return e}function c(n,i,r,c){if(0<=n&&n<=1&&0<=r&&r<=1){var h=new Float32Array(t);if(n!==i||r!==c)for(var p=0;p<t;++p)h[p]=o(p*e,n,r);return function(t){return n===i&&r===c||0===t||1===t?t:o(d(t),i,c)}}function d(i){for(var o=0,c=1,p=t-1;c!==p&&h[c]<=i;++c)o+=e;--c;var d=o+(i-h[c])/(h[c+1]-h[c])*e,u=a(d,n,r);return u>=.001?l(i,d,n,r):0===u?d:s(i,o,o+e,n,r)}}return c}(),lo=(oo={linear:function(){return function(t){return t}}},ao={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var n=Yr(t,1,10),i=Yr(e,.1,2);return function(t){return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-i/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/i)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){ao[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(ao).forEach((function(t){var e=ao[t];oo["easeIn"+t]=e,oo["easeOut"+t]=function(t,n){return function(i){return 1-e(t,n)(1-i)}},oo["easeInOut"+t]=function(t,n){return function(i){return i<.5?e(t,n)(2*i)/2:1-e(t,n)(-2*i+2)/2}},oo["easeOutIn"+t]=function(t,n){return function(i){return i<.5?(1-e(t,n)(1-2*i))/2:(e(t,n)(2*i-1)+1)/2}}})),oo);function co(t,e){if(eo.fnc(t))return t;var n=t.split("(")[0],i=lo[n],r=no(t);switch(n){case"spring":return io(t,e);case"cubicBezier":return to(so,r);case"steps":return to(ro,r);default:return to(i,r)}}function ho(t){try{return document.querySelectorAll(t)}catch(t){return}}function po(t,e){for(var n=t.length,i=arguments.length>=2?arguments[1]:void 0,r=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(i,a,o,t)&&r.push(a)}return r}function uo(t){return t.reduce((function(t,e){return t.concat(eo.arr(e)?uo(e):e)}),[])}function go(t){return eo.arr(t)?t:(eo.str(t)&&(t=ho(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function fo(t,e){return t.some((function(t){return t===e}))}function mo(t){var e={};for(var n in t)e[n]=t[n];return e}function vo(t,e){var n=mo(t);for(var i in t)n[i]=e.hasOwnProperty(i)?e[i]:t[i];return n}function bo(t,e){var n=mo(t);for(var i in e)n[i]=eo.und(t[i])?e[i]:t[i];return n}function yo(t){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);return e?"rgba("+e[1]+",1)":t}function _o(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=t.replace(e,(function(t,e,n,i){return e+e+n+n+i+i})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}function wo(t){var e,n,i,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),o=parseInt(r[1],10)/360,a=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100,l=r[4]||1;function c(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0==a)e=n=i=s;else{var h=s<.5?s*(1+a):s+a-s*a,p=2*s-h;e=c(p,h,o+1/3),n=c(p,h,o),i=c(p,h,o-1/3)}return"rgba("+255*e+","+255*n+","+255*i+","+l+")"}function xo(t){return eo.rgb(t)?yo(t):eo.hex(t)?_o(t):eo.hsl(t)?wo(t):void 0}function ko(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function zo(t){return Jr(t,"translate")||"perspective"===t?"px":Jr(t,"rotate")||Jr(t,"skew")?"deg":void 0}function Ao(t,e){return eo.fnc(t)?t(e.target,e.id,e.total):t}function So(t,e){return t.getAttribute(e)}function Co(t,e,n){if(fo([n,"deg","rad","turn"],ko(e)))return e;var i=Qr.CSS[e+n];if(!eo.und(i))return i;var r=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=r+n;var s=r/o.offsetWidth;a.removeChild(o);var l=s*parseFloat(e);return Qr.CSS[e+n]=l,l}function Eo(t,e,n){if(e in t.style){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=t.style[e]||getComputedStyle(t).getPropertyValue(i)||"0";return n?Co(t,r,n):r}}function Mo(t,e){return eo.dom(t)&&!eo.inp(t)&&(!eo.nil(So(t,e))||eo.svg(t)&&t[e])?"attribute":eo.dom(t)&&fo(Zr,e)?"transform":eo.dom(t)&&"transform"!==e&&Eo(t,e)?"css":null!=t[e]?"object":void 0}function Lo(t){if(eo.dom(t)){for(var e,n=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map;e=i.exec(n);)r.set(e[1],e[2]);return r}}function Ho(t,e,n,i){var r=Jr(e,"scale")?1:0+zo(e),o=Lo(t).get(e)||r;return n&&(n.transforms.list.set(e,o),n.transforms.last=e),i?Co(t,o,i):o}function To(t,e,n,i){switch(Mo(t,e)){case"transform":return Ho(t,e,i,n);case"css":return Eo(t,e,n);case"attribute":return So(t,e);default:return t[e]||0}}function Vo(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var i=ko(t)||0,r=parseFloat(e),o=parseFloat(t.replace(n[0],""));switch(n[0][0]){case"+":return r+o+i;case"-":return r-o+i;case"*":return r*o+i}}function $o(t,e){if(eo.col(t))return xo(t);if(/\s/g.test(t))return t;var n=ko(t),i=n?t.substr(0,t.length-n.length):t;return e?i+e:i}function Oo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Po(t){return 2*Math.PI*So(t,"r")}function Ro(t){return 2*So(t,"width")+2*So(t,"height")}function Io(t){return Oo({x:So(t,"x1"),y:So(t,"y1")},{x:So(t,"x2"),y:So(t,"y2")})}function No(t){for(var e,n=t.points,i=0,r=0;r<n.numberOfItems;r++){var o=n.getItem(r);r>0&&(i+=Oo(e,o)),e=o}return i}function Fo(t){var e=t.points;return No(t)+Oo(e.getItem(e.numberOfItems-1),e.getItem(0))}function Bo(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return Po(t);case"rect":return Ro(t);case"line":return Io(t);case"polyline":return No(t);case"polygon":return Fo(t)}}function Do(t){var e=Bo(t);return t.setAttribute("stroke-dasharray",e),e}function jo(t){for(var e=t.parentNode;eo.svg(e)&&eo.svg(e.parentNode);)e=e.parentNode;return e}function qo(t,e){var n=e||{},i=n.el||jo(t),r=i.getBoundingClientRect(),o=So(i,"viewBox"),a=r.width,s=r.height,l=n.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:i,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:s,vW:l[2],vH:l[3]}}function Uo(t,e){var n=eo.str(t)?ho(t)[0]:t,i=e||100;return function(t){return{property:t,el:n,svg:qo(n),totalLength:Bo(n)*(i/100)}}}function Wo(t,e,n){function i(n){void 0===n&&(n=0);var i=e+n>=1?e+n:0;return t.el.getPointAtLength(i)}var r=qo(t.el,t.svg),o=i(),a=i(-1),s=i(1),l=n?1:r.w/r.vW,c=n?1:r.h/r.vH;switch(t.property){case"x":return(o.x-r.x)*l;case"y":return(o.y-r.y)*c;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function Go(t,e){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,i=$o(eo.pth(t)?t.totalLength:t,e)+"";return{original:i,numbers:i.match(n)?i.match(n).map(Number):[0],strings:eo.str(t)||e?i.split(n):[]}}function Xo(t){return po(t?uo(eo.arr(t)?t.map(go):go(t)):[],(function(t,e,n){return n.indexOf(t)===e}))}function Ko(t){var e=Xo(t);return e.map((function(t,n){return{target:t,id:n,total:e.length,transforms:{list:Lo(t)}}}))}function Zo(t,e){var n=mo(e);if(/^spring/.test(n.easing)&&(n.duration=io(n.easing)),eo.arr(t)){var i=t.length;2===i&&!eo.obj(t[0])?t={value:t}:eo.fnc(e.duration)||(n.duration=e.duration/i)}var r=eo.arr(t)?t:[t];return r.map((function(t,n){var i=eo.obj(t)&&!eo.pth(t)?t:{value:t};return eo.und(i.delay)&&(i.delay=n?0:e.delay),eo.und(i.endDelay)&&(i.endDelay=n===r.length-1?e.endDelay:0),i})).map((function(t){return bo(t,n)}))}function Qo(t){for(var e=po(uo(t.map((function(t){return Object.keys(t)}))),(function(t){return eo.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),n={},i=function(i){var r=e[i];n[r]=t.map((function(t){var e={};for(var n in t)eo.key(n)?n==r&&(e.value=t[n]):e[n]=t[n];return e}))},r=0;r<e.length;r++)i(r);return n}function Yo(t,e){var n=[],i=e.keyframes;for(var r in i&&(e=bo(Qo(i),e)),e)eo.key(r)&&n.push({name:r,tweens:Zo(e[r],t)});return n}function Jo(t,e){var n={};for(var i in t){var r=Ao(t[i],e);eo.arr(r)&&1===(r=r.map((function(t){return Ao(t,e)}))).length&&(r=r[0]),n[i]=r}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function ta(t,e){var n;return t.tweens.map((function(i){var r=Jo(i,e),o=r.value,a=eo.arr(o)?o[1]:o,s=ko(a),l=To(e.target,t.name,s,e),c=n?n.to.original:l,h=eo.arr(o)?o[0]:c,p=ko(h)||ko(l),d=s||p;return eo.und(a)&&(a=c),r.from=Go(h,d),r.to=Go(Vo(a,h),d),r.start=n?n.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=co(r.easing,r.duration),r.isPath=eo.pth(o),r.isPathTargetInsideSVG=r.isPath&&eo.svg(e.target),r.isColor=eo.col(r.from.original),r.isColor&&(r.round=1),n=r,r}))}var ea={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,i,r){if(i.list.set(e,n),e===i.last||r){var o="";i.list.forEach((function(t,e){o+=e+"("+t+") "})),t.style.transform=o}}};function na(t,e){Ko(t).forEach((function(t){for(var n in e){var i=Ao(e[n],t),r=t.target,o=ko(i),a=To(r,n,o,t),s=Vo($o(i,o||ko(a)),a),l=Mo(r,n);ea[l](r,n,s,t.transforms,!0)}}))}function ia(t,e){var n=Mo(t.target,e.name);if(n){var i=ta(e,t),r=i[i.length-1];return{type:n,property:e.name,animatable:t,tweens:i,duration:r.end,delay:i[0].delay,endDelay:r.endDelay}}}function ra(t,e){return po(uo(t.map((function(t){return e.map((function(e){return ia(t,e)}))}))),(function(t){return!eo.und(t)}))}function oa(t,e){var n=t.length,i=function(t){return t.timelineOffset?t.timelineOffset:0},r={};return r.duration=n?Math.max.apply(Math,t.map((function(t){return i(t)+t.duration}))):e.duration,r.delay=n?Math.min.apply(Math,t.map((function(t){return i(t)+t.delay}))):e.delay,r.endDelay=n?r.duration-Math.max.apply(Math,t.map((function(t){return i(t)+t.duration-t.endDelay}))):e.endDelay,r}var aa=0;function sa(t){var e=vo(Xr,t),n=vo(Kr,t),i=Yo(n,t),r=Ko(t.targets),o=ra(r,i),a=oa(o,n),s=aa;return aa++,bo(e,{id:s,children:[],animatables:r,animations:o,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}var la=[],ca=function(){var t;function e(){t||ha()&&pa.suspendWhenDocumentHidden||!(la.length>0)||(t=requestAnimationFrame(n))}function n(e){for(var i=la.length,r=0;r<i;){var o=la[r];o.paused?(la.splice(r,1),i--):(o.tick(e),r++)}t=r>0?requestAnimationFrame(n):void 0}function i(){pa.suspendWhenDocumentHidden&&(ha()?t=cancelAnimationFrame(t):(la.forEach((function(t){return t._onDocumentVisibility()})),ca()))}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",i),e}();function ha(){return!!document&&document.hidden}function pa(t){void 0===t&&(t={});var e,n=0,i=0,r=0,o=0,a=null;function s(t){var e=window.Promise&&new Promise((function(t){return a=t}));return t.finished=e,e}var l=sa(t);s(l);function c(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(t){return t.reversed=l.reversed}))}function h(t){return l.reversed?l.duration-t:t}function p(){n=0,i=h(l.currentTime)*(1/pa.speed)}function d(t,e){e&&e.seek(t-e.timelineOffset)}function u(t){if(l.reversePlayback)for(var n=o;n--;)d(t,e[n]);else for(var i=0;i<o;i++)d(t,e[i])}function g(t){for(var e=0,n=l.animations,i=n.length;e<i;){var r=n[e],o=r.animatable,a=r.tweens,s=a.length-1,c=a[s];s&&(c=po(a,(function(e){return t<e.end}))[0]||c);for(var h=Yr(t-c.start-c.delay,0,c.duration)/c.duration,p=isNaN(h)?1:c.easing(h),d=c.to.strings,u=c.round,g=[],f=c.to.numbers.length,m=void 0,v=0;v<f;v++){var b=void 0,y=c.to.numbers[v],_=c.from.numbers[v]||0;b=c.isPath?Wo(c.value,p*y,c.isPathTargetInsideSVG):_+p*(y-_),u&&(c.isColor&&v>2||(b=Math.round(b*u)/u)),g.push(b)}var w=d.length;if(w){m=d[0];for(var x=0;x<w;x++){d[x];var k=d[x+1],z=g[x];isNaN(z)||(m+=k?z+k:z+" ")}}else m=g[0];ea[r.type](o.target,r.property,m,o.transforms),r.currentValue=m,e++}}function f(t){l[t]&&!l.passThrough&&l[t](l)}function m(){l.remaining&&!0!==l.remaining&&l.remaining--}function v(t){var o=l.duration,p=l.delay,d=o-l.endDelay,v=h(t);l.progress=Yr(v/o*100,0,100),l.reversePlayback=v<l.currentTime,e&&u(v),!l.began&&l.currentTime>0&&(l.began=!0,f("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,f("loopBegin")),v<=p&&0!==l.currentTime&&g(0),(v>=d&&l.currentTime!==o||!o)&&g(o),v>p&&v<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,f("changeBegin")),f("change"),g(v)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,f("changeComplete")),l.currentTime=Yr(v,0,o),l.began&&f("update"),t>=o&&(i=0,m(),l.remaining?(n=r,f("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&c()):(l.paused=!0,l.completed||(l.completed=!0,f("loopComplete"),f("complete"),!l.passThrough&&"Promise"in window&&(a(),s(l)))))}return l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop,e=l.children;for(var n=o=e.length;n--;)l.children[n].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,g(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(t,e){return na(t,e),l},l.tick=function(t){r=t,n||(n=r),v((r+(i-n))*pa.speed)},l.seek=function(t){v(h(t))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,la.push(l),p(),ca())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){ua(Xo(t),l)},l.reset(),l.autoplay&&l.play(),l}function da(t,e){for(var n=e.length;n--;)fo(t,e[n].animatable.target)&&e.splice(n,1)}function ua(t,e){var n=e.animations,i=e.children;da(t,n);for(var r=i.length;r--;){var o=i[r],a=o.animations;da(t,a),a.length||o.children.length||i.splice(r,1)}n.length||i.length||e.pause()}function ga(t){for(var e=Xo(t),n=la.length;n--;){ua(e,la[n])}}function fa(t,e){void 0===e&&(e={});var n=e.direction||"normal",i=e.easing?co(e.easing):null,r=e.grid,o=e.axis,a=e.from||0,s="first"===a,l="center"===a,c="last"===a,h=eo.arr(t),p=h?parseFloat(t[0]):parseFloat(t),d=h?parseFloat(t[1]):0,u=ko(h?t[1]:t)||0,g=e.start||0+(h?p:0),f=[],m=0;return function(t,e,v){if(s&&(a=0),l&&(a=(v-1)/2),c&&(a=v-1),!f.length){for(var b=0;b<v;b++){if(r){var y=l?(r[0]-1)/2:a%r[0],_=l?(r[1]-1)/2:Math.floor(a/r[0]),w=y-b%r[0],x=_-Math.floor(b/r[0]),k=Math.sqrt(w*w+x*x);"x"===o&&(k=-w),"y"===o&&(k=-x),f.push(k)}else f.push(Math.abs(a-b));m=Math.max.apply(Math,f)}i&&(f=f.map((function(t){return i(t/m)*m}))),"reverse"===n&&(f=f.map((function(t){return o?t<0?-1*t:-t:Math.abs(m-t)})))}return g+(h?(d-p)/m:p)*(Math.round(100*f[e])/100)+u}}function ma(t){void 0===t&&(t={});var e=pa(t);return e.duration=0,e.add=function(n,i){var r=la.indexOf(e),o=e.children;function a(t){t.passThrough=!0}r>-1&&la.splice(r,1);for(var s=0;s<o.length;s++)a(o[s]);var l=bo(n,vo(Kr,t));l.targets=l.targets||t.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=eo.und(i)?c:Vo(i,c),a(e),e.seek(l.timelineOffset);var h=pa(l);a(h),o.push(h);var p=oa(o,t);return e.delay=p.delay,e.endDelay=p.endDelay,e.duration=p.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}pa.version="3.2.1",pa.speed=1,pa.suspendWhenDocumentHidden=!0,pa.running=la,pa.remove=ga,pa.get=To,pa.set=na,pa.convertPx=Co,pa.path=Uo,pa.setDashoffset=Do,pa.stagger=fa,pa.timeline=ma,pa.easing=co,pa.penner=lo,pa.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t};class va extends(R(V)){static get properties(){return Object.assign({src:{type:String},odd:{type:String,reflect:!0},view:{type:String,reflect:!0},nodeId:{type:String,reflect:!0,attribute:"node-id"},xmlId:{type:Array,reflect:!0,attribute:"xml-id"},xpath:{type:String,reflect:!0},map:{type:String},onUpdate:{type:Boolean,attribute:"on-update"},notFound:{type:String,attribute:"not-found"},url:{type:String},appendFootnotes:{type:Boolean,attribute:"append-footnotes"},suppressHighlight:{type:Boolean,attribute:"suppress-highlight",reflect:!0},columnSeparator:{type:String,attribute:"column-separator"},direction:{type:String},loadCss:{type:String,attribute:"load-css"},fixLinks:{type:Boolean,attribute:"fix-links"},useLanguage:{type:Boolean,attribute:"use-language"},animation:{type:Boolean},infiniteScroll:{type:Boolean,attribute:"infinite-scroll"},infiniteScrollMax:{type:Number,attribute:"infinite-scroll-max"},waitFor:{type:String,attribute:"wait-for"},disableHistory:{type:Boolean,attribute:"disable-history"},beforeUpdate:{type:String,attribute:"before-update-event"},_features:{type:Object},_content:{type:Node,attribute:!1},_column1:{type:Node,attribute:!1},_column2:{type:Node,attribute:!1},_footnotes:{type:Node,attribute:!1},_style:{type:Node,attribute:!1}},super.properties)}constructor(){super(),this.src=null,this.url=null,this.onUpdate=!1,this.appendFootnotes=!1,this.notFound="the server did not return any content",this.animation=!1,this.direction="ltr",this.suppressHighlight=!1,this.highlight=!1,this.infiniteScrollMax=10,this.disableHistory=!1,this.beforeUpdate=null,this._features={},this._selector=new Map,this._chunks=[],this._scrollTarget=null}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"src":this._updateSource(n,e)}}connectedCallback(){if(super.connectedCallback(),this.infiniteScroll&&(this.columnSeparator=null,this.animation=!1,this._content=document.createElement("div"),this._content.className="infinite-content"),!this.disableHistory){const t=this.getParameter("id");t&&!this.xmlId&&(this.xmlId=t);const e=this.getParameter("action");e&&"search"===e&&(this.highlight=!0);const n=this.getParameter("root");"single"===this.view?this.nodeId=null:n&&!this.nodeId&&(this.nodeId=n)}this.waitFor||(this.waitFor="pb-toggle-feature,pb-select-feature,pb-navigation"),this.subscribeTo("pb-navigate",t=>{t.detail.source&&t.detail.source===this||this.navigate(t.detail.direction)}),this.subscribeTo("pb-refresh",this._refresh.bind(this)),this.subscribeTo("pb-toggle",t=>{this.toggleFeature(t)}),this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)}),this.subscribeTo("pb-i18n-update",t=>{const e=this._features.language&&this._features.language!==t.detail.language;this._features.language=t.detail.language,this.useLanguage&&e&&this._refresh()},[]),this.signalReady(),this.onUpdate&&this.subscribeTo("pb-update",this._refresh.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this._scrollObserver&&this._scrollObserver.disconnect()}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!0),this.infiniteScroll&&(this._topObserver=this.shadowRoot.getElementById("top-observer"),this._bottomObserver=this.shadowRoot.getElementById("bottom-observer"),this._bottomObserver.style.display="none",this._topObserver.style.display="none",this._scrollObserver=new IntersectionObserver(t=>{this._content&&t.forEach(t=>{if(t.isIntersecting)if("bottom-observer"===t.target.id){const t=this._content.lastElementChild;if(t){const e=t.getAttribute("data-next");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(console.log("<pb-view> Loading next page: %s",e),this._checkChunks("forward"),this._load(e,"forward"))}}else{const t=this._content.firstElementChild;if(t){const e=t.getAttribute("data-previous");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(this._checkChunks("backward"),this._load(e,"backward"))}}})})),this.onUpdate||va.waitOnce("pb-page-ready",t=>{t&&t.language&&(this._features.language=t.language),this.wait(()=>this._refresh())})}getOdd(){return this.odd||this.getDocument().odd||"teipublisher"}getView(){return this.view||this.getDocument().view||"single"}forceUpdate(){this._load(this.nodeId)}animate(){this.animation&&("forward"===this.lastDirection?pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[1e3,0],duration:300,easing:"linear"}):pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[-1e3,0],duration:300,easing:"linear"}))}enableScrollbar(t){t?this.classList.add("noscroll"):this.classList.remove("noscroll")}_refresh(t){if(t&&t.detail){if(t.detail.hash&&!(t.detail.id||t.detail.path||t.detail.odd||t.detail.view||t.detail.position)){this._scrollTarget=t.detail.hash;const e=this.shadowRoot.getElementById(this._scrollTarget);return void(e&&setTimeout(()=>e.scrollIntoView()))}if(t.detail.path){this.getDocument().path=t.detail.path}t.detail.id&&(this.xmlId=t.detail.id),this.odd=t.detail.odd||this.odd,void 0!==t.detail.columnSeparator&&(this.columnSeparator=t.detail.columnSeparator),this.view=t.detail.view||this.view,null===t.detail.position?this.nodeId=null:this.nodeId=t.detail.position||this.nodeId,this._scrollTarget=t.detail.hash}this._updateStyles(),this.infiniteScroll&&this._clear(),this._load(this.nodeId)}_load(t,e){if(!this.getDocument().path)return void console.log("No path");if(this._loading)return;this._loading=!0;const n=this.getParameters(t);e&&(n._dir=e),this._doLoad(n)}_doLoad(t){this.emitTo("pb-start-update",t),console.log("<pb-view> Loading view with params %o",t),this.infiniteScroll||this._clear(),this._scrollObserver&&(this._bottomObserver&&this._scrollObserver.unobserve(this._bottomObserver),this._topObserver&&this._scrollObserver.unobserve(this._topObserver));const e=this.shadowRoot.getElementById("loadContent");this.url||(this.minApiVersion("1.0.0")?this.url="api/parts":this.url="modules/lib/components.xql"),this.minApiVersion("1.0.0")?e.url=`${this.getEndpoint()}/${this.url}/${encodeURIComponent(this.getDocument().path)}/json`:e.url=`${this.getEndpoint()}/${this.url}`,e.params=t,e.generateRequest()}_clear(){this.infiniteScroll?(this._content=document.createElement("div"),this._content.className="infinite-content"):this._content=null,this._column1=null,this._column2=null,this._footnotes=null,this._chunks=[]}_handleError(){this._clear();const t=this.shadowRoot.getElementById("loadContent");let e;const{response:n}=t.lastError;e=n?n.description:'<pb-i18n key="dialogs.serverError"></pb-i18n>';const i=`\n <p>${this.notFound}</p>\n <p><pb-i18n key="dialogs.serverError"></pb-i18n>: ${e} </p>\n `;this._replaceContent({content:i}),this.emitTo("pb-end-update")}_handleContent(){const t=this.shadowRoot.getElementById("loadContent"),e=t.lastResponse;if(e){if(e.error)return this.notFound&&(this._content=this.notFound),void this.emitTo("pb-end-update",null);this._replaceContent(e,t.params._dir),this.animate(),this._scrollTarget&&this.updateComplete.then(()=>{const t=this.shadowRoot.getElementById(this._scrollTarget)||this.shadowRoot.querySelector(`[node-id="${this._scrollTarget}"]`);t&&setTimeout(()=>{t.scrollIntoView()},100),this._scrollTarget=null}),this.next=e.next,this.nextId=e.nextId,this.previous=e.previous,this.previousId=e.previousId,this.nodeId=e.root,this.switchView=e.switchView,this.disableHistory||!this.xmlId||this.map||(this.setParameter("id",this.xmlId),this.pushHistory("Navigate to xml:id")),this.xmlId=null,this.updateComplete.then(()=>{const n=this.shadowRoot.getElementById("view");this._applyToggles(n),this._fixLinks(n),ii(n);const i={data:e,root:n,params:t.params,id:this.xmlId,position:this.nodeId};this.emitTo("pb-update",i),this._scroll()}),this.emitTo("pb-end-update",null)}else console.error("<pb-view> No response received")}_replaceContent(t,e){const n=document.createDocumentFragment(),i=document.createElement("div");n.appendChild(i),i.innerHTML=t.content,this.beforeUpdate?this.emitTo(this.beforeUpdate,{data:t,root:i,render:n=>{this._doReplaceContent(n,t,e)}}):this._doReplaceContent(i,t,e)}_doReplaceContent(t,e,n){if(this.columnSeparator)this._replaceColumns(t),this._loading=!1;else if(this.infiniteScroll){let i;switch(t.className="scroll-fragment",t.setAttribute("data-root",e.root),e.next&&t.setAttribute("data-next",e.next),e.previous&&t.setAttribute("data-previous",e.previous),n){case"backward":i=this._content.firstElementChild,this._chunks.unshift(t),this.updateComplete.then(()=>{i.scrollIntoView(!0),this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._content.insertBefore(t,i);break;default:this.updateComplete.then(()=>{this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._chunks.push(t),this._content.appendChild(t)}}else this._content=t,this._loading=!1;if(this.appendFootnotes){const t=document.createElement("div");e.footnotes&&(t.innerHTML=e.footnotes),this._footnotes=t}return this._initFootnotes(this._footnotes),t}_checkVisibility(){const t=this._chunks[this._chunks.length-1].hasAttribute("data-next");this._bottomObserver.style.display=t?"":"none";const e=this._chunks[0].hasAttribute("data-previous");this._topObserver.style.display=e?"":"none"}_replaceColumns(t){let e;if(this.columnSeparator){const n=t.querySelectorAll(this.columnSeparator);n.length>0&&(e=n[n.length-1])}if(e){const n=this._getFragmentBefore(t,e),i=this._getFragmentAfter(t,e);"ltr"===this.direction?(this._column1=n,this._column2=i):(this._column2=n,this._column1=i)}else this._content=t}_scroll(){const{hash:t}=this.getUrl();if(t){const e=this.shadowRoot.getElementById(t.substring(1));console.log("hash target: %o",e),e&&e.scrollIntoView({block:"center",inline:"nearest"})}}_scrollToElement(t,e){const n=this.shadowRoot.getElementById(e.hash.substring(1));n&&(t.preventDefault(),console.log("<pb-view> Scrolling to element %s",n.id),n.scrollIntoView({block:"center",inline:"nearest"}))}_updateStyles(){const t=[];let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/transform/${this.getOdd()}.css`),t.push(e),this.loadCss&&(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/${this.loadCss}`),t.push(e)),this._style=t}_fixLinks(t){if(this.fixLinks){const e=this.getDocument(),n=this.toAbsoluteURL(e.path);t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src"),i=new URL(e,n);t.src=i}),t.querySelectorAll("a").forEach(t=>{const e=t.getAttribute("href");if(e===t.hash)t.addEventListener("click",e=>this._scrollToElement(e,t));else{const i=new URL(e,n);t.href=i}})}else t.querySelectorAll("a").forEach(t=>{t.getAttribute("href")===t.hash&&t.addEventListener("click",e=>this._scrollToElement(e,t))})}_initFootnotes(t){t&&t.querySelectorAll(".note, .fn-back").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const n=this.shadowRoot.getElementById("content").querySelector(t.hash);n&&n.scrollIntoView()})})}_getParameters(){const t=[];this.querySelectorAll("pb-param").forEach((function(e){t["user."+e.getAttribute("name")]=e.getAttribute("value")}));for(const[e,n]of Object.entries(this._features))t["user."+e]=n;return t}getParameters(t){t=t||this.nodeId;const e=this.getDocument(),n=this._getParameters();return this.minApiVersion("1.0.0")||(n.doc=e.path),n.odd=this.getOdd()+".odd",n.view=this.getView(),t&&(n.root=t),this.xpath&&(n.xpath=this.xpath),this.xmlId&&(n.id=this.xmlId),!this.suppressHighlight&&this.highlight&&(n.highlight="yes"),this.map&&(n.map=this.map),n}_applyToggles(t){0!==this._selector.size&&this._selector.forEach((e,n)=>{t.querySelectorAll(n).forEach(t=>{const n=e.command||"toggle";t.command&&t.command(n,e.state),e.state?t.classList.add(n):t.classList.remove(n)})})}goto(t){this._load(t)}gotoId(t){this.xmlId=t,this._load()}navigate(t){this.lastDirection=t,"backward"===t?this.previous&&(this.disableHistory||this.map||(this.previousId?this.setParameter("id",this.previousId):this.setParameter("root",this.previous),this.pushHistory("Navigate backward")),this._load(this.previous,t)):this.next&&(this.disableHistory||this.map||(this.nextId?this.setParameter("id",this.nextId):this.setParameter("root",this.next),this.pushHistory("Navigate forward")),this._load(this.next,t))}_checkChunks(t){if(this.infiniteScroll&&0!==this.infiniteScrollMax){if(this._chunks.length===this.infiniteScrollMax)switch(t){case"forward":this._content.removeChild(this._chunks.shift());break;default:this._content.removeChild(this._chunks.pop())}this.emitTo("pb-navigate",{direction:t,source:this})}}zoom(t){const e=this.shadowRoot.getElementById("view"),n=window.getComputedStyle(e).getPropertyValue("font-size"),i=parseInt(n.replace(/^(\d+)px/,"$1"));e.style.fontSize="in"===t?i+1+"px":i-1+"px"}toggleFeature(t){const e=()=>{const t=this.shadowRoot.getElementById("view");this._applyToggles(t)},n=t.detail.properties;for(const[t,e]of Object.entries(n))switch(t){case"odd":case"view":case"columnSeparator":case"xpath":case"nodeId":break;default:this._features[t]=e}n&&(n.odd&&(this.odd=n.odd),n.view&&(this.view=n.view,"single"===this.view?this.nodeId=null:this.nodeId=this.switchView),n.xpath&&(this.xpath=n.xpath),n.hasOwnProperty("columnSeparator")&&(this.columnSeparator=n.columnSeparator)),t.detail.selectors&&t.detail.selectors.forEach(t=>{this._selector.set(t.selector,{state:t.state,command:t.command||"toggle"})}),"refresh"===t.detail.action&&(Object.keys(n).length>0?(this._updateStyles(),this._load()):e())}_getFragmentBefore(t,e){const n=document.createRange();return n.setStartBefore(t),n.setEndBefore(e),n.cloneContents()}_getFragmentAfter(t,e){const n=document.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.cloneContents()}_updateSource(t,e){void 0!==e&&t!==e&&(this.xpath=null,this.odd=null,this.xmlId=null,this.nodeId=null)}static get styles(){return P`
|
|
1091
1091
|
:host {
|
|
1092
1092
|
display: block;
|
|
1093
1093
|
background: transparent;
|
|
@@ -1219,7 +1219,7 @@ e({_template:i`
|
|
|
1219
1219
|
with-credentials
|
|
1220
1220
|
@response="${this._handleContent}"
|
|
1221
1221
|
@error="${this._handleError}"></iron-ajax>
|
|
1222
|
-
`]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,i)=>Math.max(Math.min(t,i),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let i=0;for(let n=0;n<e;n++)i=(i<<5)-i+t.charCodeAt(n),i&=i;return i},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,i)=>(i<0?i+=1:i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t),Ca=(t,e,i)=>{let n,r,o;if(t/=360,i/=100,0===(e/=100))n=r=o=i;else{const a=i<.5?i*(1+e):i+e-i*e,s=2*i-a;n=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*n),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,i,n)=>(299*t+587*e+114*i)/1e3>=n,Ma=(t,e,i)=>`hsl(${t}, ${e}%, ${i}%)`,La=(t,e,i,n)=>{switch(n){case"rgb":return`rgb(${t}, ${e}, ${i})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(i.toString(16))}`}},Ha=(t,{format:e="hex",saturation:i=[50,55],lightness:n=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(i,ba)),l=za(o,Aa(n,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let i=t;for(;i.parentNode!==e;)i=i.parentElement;return i}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const i=e.getAttribute("href");return i&&/^#fn_.*$/.test(i)}function $a(t,e,i){const n=document.createTreeWalker(t);for(n.currentNode=e;n.previousNode();){const t=n.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(i+=t.textContent.length)}return i}function Oa(t,e,i="start"){if(t.nodeType===Node.ELEMENT_NODE){const n=t.closest("[data-tei]");if(0===e)return{parent:n.getAttribute("data-tei"),offset:0};const r=n.childNodes[e];return{parent:n.getAttribute("data-tei"),offset:"end"===i?$a(n,r,0)-1:$a(n,r,0)}}const n=t.parentNode.closest("[data-tei]");if(n)return{parent:n.getAttribute("data-tei"),offset:$a(n,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let i=0,n=t.parentNode;for(;n&&n!==t.getRootNode();)n.classList.contains(e)&&(i+=1),n=n.parentNode;return i}function Ra(t){let e=t.nextSibling;for(;e.hasChildNodes();)e=e.firstChild;return e.nodeType===Node.TEXT_NODE?e:t}function Ia(t,e){let i=e;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();)if(!Va(n.currentNode)&&n.currentNode.textContent.length>0){if(i-n.currentNode.textContent.length<=0)return[n.currentNode,i];i-=n.currentNode.textContent.length}return null}function Na(t,e,i,n=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===n)break}r-=1}let a=i+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===n)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,i)}</mark>${t.substring(i,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=0,r=0;const o=[];for(;i.nextNode();)i.currentNode===t&&(r=n),n+=i.currentNode.textContent.length,o.push(i.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(i=>{const n=t.properties[i];n&&n.length>0&&(e[i]=n)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:i=[50,60],differencePoint:n=130}={})=>{e=Aa(e,ba),i=Aa(i,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof i?i:xa(...i),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,n)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=i=>{if("selectionchange"===i.type&&this._inHandler)return;if("mousedown"===i.type&&(t=!0),"mouseup"===i.type&&(t=!1),t)return;this._cancelPendingCallback();const n="mouseup"===i.type?10:100;e(n)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Gi(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1){const i=this.shadowRoot.getElementById("view"),n=Array.from(i.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!n)return null;const r=document.createRange(),o=Ia(n,t.start),a=Ia(n,t.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",n),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const t=Ra(o[0]);t===a[0]?r.setStart(t,0):r.setStartBefore(o[0].nextSibling)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(Ta(o[0],n)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(Ta(a[0],n)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const s=document.createElement("span"),l=""===t.properties[this.key]?"incomplete":"";s.className=`annotation annotation-${t.type} ${t.type} ${l}`,s.dataset.type=t.type,s.dataset.annotation=JSON.stringify(t.properties);try{r.surroundContents(s)}catch(t){throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(s,t),e||this.refreshMarkers(),s}updateAnnotations(){this._ranges.forEach(t=>{let e;switch(t.type){case"delete":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e?this._deleteAnnotation(e):console.error("Annotation %s not found",t.context);break;case"modify":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let i=!1;const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==n){const t=Ta(e.startContainer,n);e.setStartBefore(t),i=!0}if(e.endContainer.parentElement!==n){const t=Ta(e.endContainer,n);e.setEndAfter(t),i=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),i&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const i=this._updateAnnotation(t,e);return i&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),i}addAnnotation(t){const e=t.range||this._currentSelection,i=Oa(e.startContainer,e.startOffset),n=Oa(e.endContainer,e.endOffset,"end"),r={context:i.parent,start:i.offset,end:n.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const i=t.parentNode.closest("[data-tei]"),n={type:"delete",node:t.dataset.tei,context:i.dataset.tei};this._ranges.push(n)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const i=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(i,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i].cloneNode(!0);t.parentNode.insertBefore(n,t),0===i&&e.setStartBefore(n),i===t.childNodes.length-1&&e.setEndAfter(n)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const i=this._getSelection();i.removeAllRanges(),i.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let i=this._rangesMap.get(t);i?(i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const i=t.closest("[data-tei]");let n=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);n||(n={type:"modify",node:t.dataset.tei,context:i.dataset.tei},this._ranges.push(n)),n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const i=JSON.parse(t.dataset.annotation),n=Object.assign(i||{},e);t.dataset.annotation=JSON.stringify(n),""!==n[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const i=document.createElement("div");i.className="info",e.appendChild(i);const n=document.createElement("div");n.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",n.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),n.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),n.appendChild(o),e.appendChild(n);const s=this.shadowRoot.getElementById("view");Ii(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,n)=>{n.preventDefault(),n.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:i,span:t});else{i.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),i.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const i=document.createElement("tr"),n=document.createElement("td");n.innerHTML=t,i.appendChild(n);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),i.appendChild(r),e.appendChild(i)}),i.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,i,n=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-i.left+"px",s.style.top=a.top-i.top+a.height+"px",s.style.marginTop=n+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");i.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,i,e,5*Pa(t,"annotation"))}),i.style.display="block"}search(t,e){function i(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function n(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}n.acceptNode=n;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>i(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,n);for(;s.nextNode();){let e=s.currentNode;const i=Array.from(e.textContent.matchAll(a));for(const n of i){const i=n.index+n[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,n.index),h=Oa(e,i,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+n.index,d+i)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),i=document.createRange();if(t.annotated)i.selectNode(t.textNode);else{const n=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(n,t.start),o=Ia(n,t.end);i.setStart(r[0],r[1]),i.setEnd(o[0],o[1])}const n=e.getBoundingClientRect(),r=i.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-n.left-4+"px",o.style.top=r.top-n.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",i.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles())}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const i=[],n=[];this._annotationColors.forEach((t,e)=>{i.push(`--pb-annotation-${e}: ${t.color};`),i.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),n.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${i.join("\n")}\n }\n\n ${n.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
|
|
1222
|
+
`]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,n)=>Math.max(Math.min(t,n),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let n=0;for(let i=0;i<e;i++)n=(n<<5)-n+t.charCodeAt(i),n&=n;return n},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,n)=>(n<0?n+=1:n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Ca=(t,e,n)=>{let i,r,o;if(t/=360,n/=100,0===(e/=100))i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;i=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,n,i)=>(299*t+587*e+114*n)/1e3>=i,Ma=(t,e,n)=>`hsl(${t}, ${e}%, ${n}%)`,La=(t,e,n,i)=>{switch(i){case"rgb":return`rgb(${t}, ${e}, ${n})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(n.toString(16))}`}},Ha=(t,{format:e="hex",saturation:n=[50,55],lightness:i=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(n,ba)),l=za(o,Aa(i,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let n=t;for(;n.parentNode!==e;)n=n.parentElement;return n}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const n=e.getAttribute("href");return n&&/^#fn_.*$/.test(n)}function $a(t,e,n){const i=document.createTreeWalker(t);for(i.currentNode=e;i.previousNode();){const t=i.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(n+=t.textContent.length)}return n}function Oa(t,e,n="start"){if(t.nodeType===Node.ELEMENT_NODE){const i=t.closest("[data-tei]");if(0===e)return{parent:i.getAttribute("data-tei"),offset:0};const r=i.childNodes[e];return{parent:i.getAttribute("data-tei"),offset:"end"===n?$a(i,r,0)-1:$a(i,r,0)}}const i=t.parentNode.closest("[data-tei]");if(i)return{parent:i.getAttribute("data-tei"),offset:$a(i,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let n=0,i=t.parentNode;for(;i&&i!==t.getRootNode();)i.classList.contains(e)&&(n+=1),i=i.parentNode;return n}function Ra(t,e){const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return n.currentNode=e,n.nextNode()?n.currentNode:e}function Ia(t,e){let n=e;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();)if(!Va(i.currentNode)&&i.currentNode.textContent.length>0){if(n-i.currentNode.textContent.length<=0)return[i.currentNode,n];n-=i.currentNode.textContent.length}return null}function Na(t,e,n,i=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===i)break}r-=1}let a=n+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===i)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,n)}</mark>${t.substring(n,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i=0,r=0;const o=[];for(;n.nextNode();)n.currentNode===t&&(r=i),i+=n.currentNode.textContent.length,o.push(n.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(n=>{const i=t.properties[n];i&&i.length>0&&(e[n]=i)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:n=[50,60],differencePoint:i=130}={})=>{e=Aa(e,ba),n=Aa(n,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof n?n:xa(...n),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,i)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=n=>{if("selectionchange"===n.type&&this._inHandler)return;if("mousedown"===n.type&&(t=!0),"mouseup"===n.type&&(t=!1),t)return;this._cancelPendingCallback();const i="mouseup"===n.type?10:100;e(i)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(!0),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Xn(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1,n=!1){const i=this.shadowRoot.getElementById("view"),r=Array.from(i.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!r)return null;const o=document.createRange(),a=Ia(r,t.start),s=Ia(r,t.end);if(!a||!s)return console.error("<pb-view-annotate> Invalid range for %o",r),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",a,s),a[1]===a[0].textContent.length){const t=Ra(r,a[0]);t===s[0]?(o.setStart(t,0),a[0]=t,a[1]=0):o.setStartBefore(a[0].nextSibling||t)}else a[0]!==s[0]&&0===a[1]?o.setStartBefore(Ta(a[0],r)):o.setStart(a[0],a[1]);a[0]!==s[0]&&s[0].textContent.length-1===s[1]?o.setEndAfter(Ta(s[0],r)):o.setEnd(s[0],s[1]),console.log("<pb-view-annotate> Range: %o",o);const l=document.createElement("span"),c=""===t.properties[this.key]?"incomplete":"";l.className=`annotation annotation-${t.type} ${t.type} ${c}`,l.dataset.type=t.type,l.dataset.annotation=JSON.stringify(t.properties);try{o.surroundContents(l)}catch(t){if(e)return null;throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(l,t),n||this.refreshMarkers(),l}updateAnnotations(t=!1){this._ranges.forEach(e=>{let n;switch(e.type){case"delete":n=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),n?this._deleteAnnotation(n):console.error("Annotation %s not found",e.context);break;case"modify":n=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),n.dataset.annotation=JSON.stringify(e.properties);break;default:this._updateAnnotation(e,t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let n=!1;const i=e.commonAncestorContainer;if(i.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==i){const t=Ta(e.startContainer,i);e.setStartBefore(t),n=!0}if(e.endContainer.parentElement!==i){const t=Ta(e.endContainer,i);e.setEndAfter(t),n=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),n&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const n=this._updateAnnotation(t,e);return n&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),n}addAnnotation(t){const e=t.range||this._currentSelection,n=Oa(e.startContainer,e.startOffset),i=Oa(e.endContainer,e.endOffset,"end"),r={context:n.parent,start:n.offset,end:i.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const n=t.parentNode.closest("[data-tei]"),i={type:"delete",node:t.dataset.tei,context:n.dataset.tei};this._ranges.push(i)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const n=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(n,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n].cloneNode(!0);t.parentNode.insertBefore(i,t),0===n&&e.setStartBefore(i),n===t.childNodes.length-1&&e.setEndAfter(i)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const n=this._getSelection();n.removeAllRanges(),n.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let n=this._rangesMap.get(t);n?(n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const n=t.closest("[data-tei]");let i=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);i||(i={type:"modify",node:t.dataset.tei,context:n.dataset.tei},this._ranges.push(i)),i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const n=JSON.parse(t.dataset.annotation),i=Object.assign(n||{},e);t.dataset.annotation=JSON.stringify(i),""!==i[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const n=document.createElement("div");n.className="info",e.appendChild(n);const i=document.createElement("div");i.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",i.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),i.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),i.appendChild(o),e.appendChild(i);const s=this.shadowRoot.getElementById("view");Nn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,i)=>{i.preventDefault(),i.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:n,span:t});else{n.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),n.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const n=document.createElement("tr"),i=document.createElement("td");i.innerHTML=t,n.appendChild(i);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),n.appendChild(r),e.appendChild(n)}),n.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,n,i=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-n.left+"px",s.style.top=a.top-n.top+a.height+"px",s.style.marginTop=i+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),n=this.shadowRoot.getElementById("marker-layer");n.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,n,e,5*Pa(t,"annotation"))}),n.style.display="block"}search(t,e){function n(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function i(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}i.acceptNode=i;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>n(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,i);for(;s.nextNode();){let e=s.currentNode;const n=Array.from(e.textContent.matchAll(a));for(const i of n){const n=i.index+i[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,i.index),h=Oa(e,n,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+i.index,d+n)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),n=document.createRange();if(t.annotated)n.selectNode(t.textNode);else{const i=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(i,t.start),o=Ia(i,t.end);n.setStart(r[0],r[1]),n.setEnd(o[0],o[1])}const i=e.getBoundingClientRect(),r=n.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-i.left-4+"px",o.style.top=r.top-i.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",n.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const n=[],i=[];this._annotationColors.forEach((t,e)=>{n.push(`--pb-annotation-${e}: ${t.color};`),n.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),i.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${n.join("\n")}\n }\n\n ${i.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
|
|
1223
1223
|
.annotation-type {
|
|
1224
1224
|
display: inline-block;
|
|
1225
1225
|
text-align: right;
|
|
@@ -1307,7 +1307,7 @@ e({_template:i`
|
|
|
1307
1307
|
:host {
|
|
1308
1308
|
display: inherit;
|
|
1309
1309
|
}
|
|
1310
|
-
`}}customElements.define("pb-media-query",Ua);class Wa extends
|
|
1310
|
+
`}}customElements.define("pb-media-query",Ua);class Wa extends oi{firstUpdated(){this.shadowRoot.getElementById("ironform").addEventListener("iron-form-presubmit",t=>{t.preventDefault(),this._submit()}),this.addEventListener("click",t=>{"searchButtonTop"===t.target.slot&&this.submit(),"searchButtonBottom"===t.target.slot&&this.submit(),"resetButton"===t.target.slot&&this._reset()})}render(){return $`
|
|
1311
1311
|
<iron-form id="ironform">
|
|
1312
1312
|
<form action="" accept="text/html" method="GET">
|
|
1313
1313
|
<slot name="searchButtonTop"></slot>
|
|
@@ -1346,7 +1346,7 @@ e({_template:i`
|
|
|
1346
1346
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
1347
1347
|
* Released under the MIT license
|
|
1348
1348
|
*/
|
|
1349
|
-
function(t){var e;if("function"==typeof define&&define.amd&&(define(t),e=!0),"object"==typeof exports&&(module.exports=t(),e=!0),!e){var
|
|
1349
|
+
function(t){var e;if("function"==typeof define&&define.amd&&(define(t),e=!0),"object"==typeof exports&&(module.exports=t(),e=!0),!e){var n=window.Cookies,i=window.Cookies=t();i.noConflict=function(){return window.Cookies=n,i}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(i){function r(){}function o(e,n,o){if("undefined"!=typeof document){"number"==typeof(o=t({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(t){}n=i.write?i.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,!0!==o[l]&&(s+="="+o[l].split(";")[0]));return document.cookie=e+"="+n+s}}function a(t,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),l=s.slice(1).join("=");n||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=e(s[0]);if(l=(i.read||i)(l,c)||e(l),n)try{l=JSON.parse(l)}catch(t){}if(r[c]=l,t===c)break}catch(t){}}return t?r[t]:r}}return r.set=o,r.get=function(t){return a(t,!1)},r.getJSON=function(t){return a(t,!0)},r.remove=function(e,n){o(e,"",t(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}return n((function(){}))}));class Ga extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{src:{type:String},url:{type:String},type:{type:String},odd:{type:String},dialog:{type:String},title:{type:String},source:{type:Boolean},params:{type:String},_target:{type:String,reflect:!0},_href:{type:String,reflect:!0},_token:{type:String}})}constructor(){super(),this.source=!1,this._target="_self",this.type=""}firstUpdated(){this.src&&this.subscribeTo("pb-document",t=>{t.detail.id===this.src&&(this.odd=t.detail.odd)}),this.subscribeTo("pb-refresh",t=>{t.detail.odd&&(this.odd=t.detail.odd,this._href=this._computeURL())}),Ga.waitOnce("pb-page-ready",()=>{this._target=this._computeTarget(),this._href=this._computeURL()})}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e)switch(t){case"source":this._target=this._computeTarget();break;case"src":case"type":case"file":case"odd":case"params":case"url":this._href=this._computeURL()}}render(){return $`
|
|
1350
1350
|
<a id="button" @click="${this._handleClick}" title="${this.title}" target="${this._target}" href="${this._href}"><slot></slot></a>
|
|
1351
1351
|
`}static get styles(){return P`
|
|
1352
1352
|
:host {
|
|
@@ -1357,7 +1357,7 @@ function(t){var e;if("function"==typeof define&&define.amd&&(define(t),e=!0),"ob
|
|
|
1357
1357
|
text-decoration: var(--pb-download-text-decoration, none);
|
|
1358
1358
|
color: var(--pb-download-color);
|
|
1359
1359
|
}
|
|
1360
|
-
`}_computeTarget(){return this.source?"_blank":"_self"}_computeURL(){let t;this._token=797*(new Date).getTime();const e=this.getDocument();if(e)if(this.url)t=`${this.toAbsoluteURL(this.url)}?odd=${this.odd?this.odd:e.odd}.odd`;else{const
|
|
1360
|
+
`}_computeTarget(){return this.source?"_blank":"_self"}_computeURL(){let t;this._token=797*(new Date).getTime();const e=this.getDocument();if(e)if(this.url)t=`${this.toAbsoluteURL(this.url)}?odd=${this.odd?this.odd:e.odd}.odd`;else{const n=this.getEndpoint()+"/";t=this.lessThanApiVersion("1.0.0")?`${e.getFileName()}${this.type?"."+this.type:""}?odd=${this.odd?this.odd:e.odd}.odd&cache=no&token=${this._token}`:`${n}api/document/${encodeURIComponent(e.path)}/${this.type||"html"}?odd=${this.odd?this.odd:e.odd}.odd&token=${this._token}`}else t=/^(?:[a-z]+:)?\/\//i.test(this.url)?this.url:`${this.getEndpoint()}/${this.url}`,t=this.lessThanApiVersion("1.0.0")?`${t}${this.type?"."+this.type:""}?odd=${this.odd}&cache=no&token='${this._token}`:`${t}/${this.type}?odd=${this.odd}&token='${this._token}`;return this.params&&(t+="&"+this.params),this.source&&(t+="&source=true"),t}_handleClick(t){if(this.dialog){const t=document.getElementById(this.dialog);t.open();const e=this._token,n=window.setInterval(()=>{Cookies.get("simple.token")===e&&(window.clearInterval(n),Cookies.remove("simple.token"),t.close())})}"_self"===this._target&&(t.preventDefault(),window.location=this._href)}}customElements.define("pb-download",Ga);class Xa extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{loggedIn:{type:Boolean,attribute:"logged-in",reflect:!0},user:{type:String},password:{type:String},group:{type:String},groups:{type:Array},auto:{type:Boolean},loginLabel:{type:String,reflect:!0,attribute:"login-label"},logoutLabel:{type:String,reflect:!0,attribute:"logout-label"},loginIcon:{type:String,attribute:"login-icon"},logoutIcon:{type:String,attribute:"logout-icon"},_invalid:{type:Boolean},_hasFocus:{type:Boolean}})}constructor(){super(),this.loggedIn=!1,this.loginLabel="login.login",this.logoutLabel="login.as",this.user="",this.groups=[],this.loginIcon="account-circle",this.logoutIcon="supervisor-account",this._hasFocus=!0}firstUpdated(){super.firstUpdated(),this._checkLogin=this.shadowRoot.getElementById("checkLogin"),this._loginDialog=this.shadowRoot.getElementById("loginDialog"),window.addEventListener("blur",()=>{this._hasFocus=!1}),window.addEventListener("focus",()=>{this._hasFocus||(this._hasFocus=!0,this._checkLogin.body=null,this._checkLogin.generateRequest())}),Xa.waitOnce("pb-page-ready",t=>{F(t.apiVersion,"1.0.0")?this._checkLogin.url=t.endpoint+"/api/login/":this._checkLogin.url=t.endpoint+"/login",this._checkLogin.body={user:this.user,password:this.password},this._checkLogin.generateRequest()})}render(){return $`
|
|
1361
1361
|
<a href="#" @click="${this._show}" title="${this.user}">
|
|
1362
1362
|
${this.loggedIn?$`<iron-icon icon="${this.logoutIcon}"></iron-icon> <span class="label">${r(this.logoutLabel,{user:this.user})}</span>`:$`<iron-icon icon="${this.loginIcon}"></iron-icon> <span class="label">${r(this.loginLabel)}</span>`}
|
|
1363
1363
|
</a>
|
|
@@ -1475,7 +1475,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
1475
1475
|
Code distributed by Google as part of the polymer project is also
|
|
1476
1476
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1477
1477
|
*/
|
|
1478
|
-
const Qa=
|
|
1478
|
+
const Qa=n`<iron-iconset-svg name="paper-tabs" size="24">
|
|
1479
1479
|
<svg><defs>
|
|
1480
1480
|
<g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g>
|
|
1481
1481
|
<g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g>
|
|
@@ -1490,7 +1490,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
1490
1490
|
Code distributed by Google as part of the polymer project is also
|
|
1491
1491
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1492
1492
|
*/
|
|
1493
|
-
e({_template:
|
|
1493
|
+
e({_template:n`
|
|
1494
1494
|
<style>
|
|
1495
1495
|
:host {
|
|
1496
1496
|
@apply --layout-inline;
|
|
@@ -1564,7 +1564,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
1564
1564
|
Code distributed by Google as part of the polymer project is also
|
|
1565
1565
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1566
1566
|
*/
|
|
1567
|
-
e({_template:
|
|
1567
|
+
e({_template:n`
|
|
1568
1568
|
<style>
|
|
1569
1569
|
:host {
|
|
1570
1570
|
@apply --layout;
|
|
@@ -1691,7 +1691,7 @@ e({_template:i`
|
|
|
1691
1691
|
</div>
|
|
1692
1692
|
|
|
1693
1693
|
<paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button>
|
|
1694
|
-
`,is:"paper-tabs",behaviors:[p,[h,{hostAttributes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(t){this.focusedItem.click(),t.detail.keyboardEvent.preventDefault()},_onDownKey:function(t){this.focusedItem.click(),t.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:function(t){this._isRTL?this._focusNext():this._focusPrevious(),t.detail.keyboardEvent.preventDefault()},_onRightKey:function(t){this._isRTL?this._focusPrevious():this._focusNext(),t.detail.keyboardEvent.preventDefault()},_onKeydown:function(t){this.keyboardEventMatchesKeys(t,"up down left right esc")||this._focusWithKeyboardEvent(t)}}]],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},noBar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boolean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,value:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,value:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value:!1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDelay:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:Boolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},listeners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingChanged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindings:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob=null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,this._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this.addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){this.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancelPendingActivation()},_noinkChanged:function(e){t(this).querySelectorAll("paper-tab").forEach(e?this._setNoinkAttribute:this._removeNoinkAttribute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAttribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:function(t,e,
|
|
1694
|
+
`,is:"paper-tabs",behaviors:[p,[h,{hostAttributes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(t){this.focusedItem.click(),t.detail.keyboardEvent.preventDefault()},_onDownKey:function(t){this.focusedItem.click(),t.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:function(t){this._isRTL?this._focusNext():this._focusPrevious(),t.detail.keyboardEvent.preventDefault()},_onRightKey:function(t){this._isRTL?this._focusPrevious():this._focusNext(),t.detail.keyboardEvent.preventDefault()},_onKeydown:function(t){this.keyboardEventMatchesKeys(t,"up down left right esc")||this._focusWithKeyboardEvent(t)}}]],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},noBar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boolean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,value:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,value:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value:!1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDelay:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:Boolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},listeners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingChanged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindings:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob=null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,this._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this.addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){this.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancelPendingActivation()},_noinkChanged:function(e){t(this).querySelectorAll("paper-tab").forEach(e?this._setNoinkAttribute:this._removeNoinkAttribute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAttribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:function(t,e,n){return!e||n?"hidden":t?"not-visible":""},_computeTabsContentClass:function(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_computeSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSizingChanged:function(){this.debounce("_onTabSizingChanged",(function(){this._scroll(),this._tabChanged(this.selectedItem)}),10)},_onIronSelect:function(t){this._tabChanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this.cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-changed",(function(){this._tabChanged(null,this._previousTab),this._previousTab=null}),1)},_activateHandler:function(){this._cancelPendingActivation(),d._activateHandler.apply(this,arguments)},_scheduleActivation:function(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.async(this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){var t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable:!0})},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeout&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.autoselect&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onBlurCapture:function(t){t.target===this._pendingActivationItem&&this._cancelPendingActivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsContainer.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(this.scrollable){var n=e&&-e.ddx||0;this._affectScroll(n)}},_down:function(t){this.async((function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null)}),1)},_affectScroll:function(t){this.$.tabsContainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0===e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:function(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind(this),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight(),this._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_onScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scrollToLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){this._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._positionBar(0,0);var n=this.$.tabsContent.getBoundingClientRect(),i=n.width,r=t.getBoundingClientRect(),o=r.left-n.left;if(this._pos={width:this._calcPercent(r.width,i),left:this._calcPercent(o,i)},this.noSlide||null==e)return this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._positionBar(this._pos.width,this._pos.left);var a=e.getBoundingClientRect(),s=this.items.indexOf(e),l=this.items.indexOf(t),c=5;this.$.selectionBar.classList.add("expand");var h=s<l;this._isRTL&&(h=!h),h?this._positionBar(this._calcPercent(r.left+r.width-a.left,i)-c,this._left):this._positionBar(this._calcPercent(a.left+a.width-r.left,i)-c,this._calcPercent(o,i)+c),this.scrollable&&this._scrollToSelectedIfNeeded(r.width,o)},_scrollToSelectedIfNeeded:function(t,e){var n=e-this.$.tabsContainer.scrollLeft;(n<0||(n+=t-this.$.tabsContainer.offsetWidth)>0)&&(this.$.tabsContainer.scrollLeft+=n)},_calcPercent:function(t,e){return 100*t/e},_positionBar:function(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transform("translateX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function(t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand"),e.add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains("contract")&&e.remove("contract")}}),
|
|
1695
1695
|
/**
|
|
1696
1696
|
@license
|
|
1697
1697
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -1702,7 +1702,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
1702
1702
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1703
1703
|
found at http://polymer.github.io/PATENTS.txt
|
|
1704
1704
|
*/
|
|
1705
|
-
e({_template:
|
|
1705
|
+
e({_template:n`
|
|
1706
1706
|
<style>
|
|
1707
1707
|
:host {
|
|
1708
1708
|
display: block;
|
|
@@ -1736,7 +1736,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
1736
1736
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1737
1737
|
found at http://polymer.github.io/PATENTS.txt
|
|
1738
1738
|
*/
|
|
1739
|
-
e({_template:
|
|
1739
|
+
e({_template:n`
|
|
1740
1740
|
<style>
|
|
1741
1741
|
:host {
|
|
1742
1742
|
position: fixed;
|
|
@@ -1851,7 +1851,7 @@ e({_template:i`
|
|
|
1851
1851
|
<div id="contentContainer" opened\$="[[opened]]" persistent\$="[[persistent]]" position\$="[[position]]" swipe-open\$="[[swipeOpen]]">
|
|
1852
1852
|
<slot></slot>
|
|
1853
1853
|
</div>
|
|
1854
|
-
`,is:"app-drawer",properties:{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0},persistent:{type:Boolean,value:!1,reflectToAttribute:!0},transitionDuration:{type:Number,value:200},align:{type:String,value:"left"},position:{type:String,readOnly:!0,reflectToAttribute:!0},swipeOpen:{type:Boolean,value:!1,reflectToAttribute:!0},noFocusTrap:{type:Boolean,value:!1},disableSwipe:{type:Boolean,value:!1}},observers:["resetLayout(position, isAttached)","_resetPosition(align, isAttached)","_styleTransitionDuration(transitionDuration)","_openedPersistentChanged(opened, persistent)"],_translateOffset:0,_trackDetails:null,_drawerState:0,_boundEscKeydownHandler:null,_firstTabStop:null,_lastTabStop:null,attached:function(){g(this,(function(){this._boundEscKeydownHandler=this._escKeydownHandler.bind(this),this.addEventListener("keydown",this._tabKeydownHandler.bind(this)),this.listen(this,"track","_track"),this.setScrollDirection("y")})),this.fire("app-reset-layout")},detached:function(){document.removeEventListener("keydown",this._boundEscKeydownHandler)},open:function(){this.opened=!0},close:function(){this.opened=!1},toggle:function(){this.opened=!this.opened},getWidth:function(){return this._savedWidth||this.$.contentContainer.offsetWidth},_isRTL:function(){return"rtl"===window.getComputedStyle(this).direction},_resetPosition:function(){switch(this.align){case"start":return void this._setPosition(this._isRTL()?"right":"left");case"end":return void this._setPosition(this._isRTL()?"left":"right")}this._setPosition(this.align)},_escKeydownHandler:function(t){var e=27;t.keyCode===e&&(t.preventDefault(),this.close())},_track:function(t){if(!this.persistent&&!this.disableSwipe)switch(t.preventDefault(),t.detail.state){case"start":this._trackStart(t);break;case"track":this._trackMove(t);break;case"end":this._trackEnd(t)}},_trackStart:function(t){this._drawerState=this._DRAWER_STATE.TRACKING;var e=this.$.contentContainer.getBoundingClientRect();this._savedWidth=e.width,"left"===this.position?this._translateOffset=e.left:this._translateOffset=e.right-window.innerWidth,this._trackDetails=[],this._styleTransitionDuration(0),this.style.visibility="visible"},_trackMove:function(t){this._translateDrawer(t.detail.dx+this._translateOffset),this._trackDetails.push({dx:t.detail.dx,timeStamp:Date.now()})},_trackEnd:function(t){var e=t.detail.dx+this._translateOffset,
|
|
1854
|
+
`,is:"app-drawer",properties:{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0},persistent:{type:Boolean,value:!1,reflectToAttribute:!0},transitionDuration:{type:Number,value:200},align:{type:String,value:"left"},position:{type:String,readOnly:!0,reflectToAttribute:!0},swipeOpen:{type:Boolean,value:!1,reflectToAttribute:!0},noFocusTrap:{type:Boolean,value:!1},disableSwipe:{type:Boolean,value:!1}},observers:["resetLayout(position, isAttached)","_resetPosition(align, isAttached)","_styleTransitionDuration(transitionDuration)","_openedPersistentChanged(opened, persistent)"],_translateOffset:0,_trackDetails:null,_drawerState:0,_boundEscKeydownHandler:null,_firstTabStop:null,_lastTabStop:null,attached:function(){g(this,(function(){this._boundEscKeydownHandler=this._escKeydownHandler.bind(this),this.addEventListener("keydown",this._tabKeydownHandler.bind(this)),this.listen(this,"track","_track"),this.setScrollDirection("y")})),this.fire("app-reset-layout")},detached:function(){document.removeEventListener("keydown",this._boundEscKeydownHandler)},open:function(){this.opened=!0},close:function(){this.opened=!1},toggle:function(){this.opened=!this.opened},getWidth:function(){return this._savedWidth||this.$.contentContainer.offsetWidth},_isRTL:function(){return"rtl"===window.getComputedStyle(this).direction},_resetPosition:function(){switch(this.align){case"start":return void this._setPosition(this._isRTL()?"right":"left");case"end":return void this._setPosition(this._isRTL()?"left":"right")}this._setPosition(this.align)},_escKeydownHandler:function(t){var e=27;t.keyCode===e&&(t.preventDefault(),this.close())},_track:function(t){if(!this.persistent&&!this.disableSwipe)switch(t.preventDefault(),t.detail.state){case"start":this._trackStart(t);break;case"track":this._trackMove(t);break;case"end":this._trackEnd(t)}},_trackStart:function(t){this._drawerState=this._DRAWER_STATE.TRACKING;var e=this.$.contentContainer.getBoundingClientRect();this._savedWidth=e.width,"left"===this.position?this._translateOffset=e.left:this._translateOffset=e.right-window.innerWidth,this._trackDetails=[],this._styleTransitionDuration(0),this.style.visibility="visible"},_trackMove:function(t){this._translateDrawer(t.detail.dx+this._translateOffset),this._trackDetails.push({dx:t.detail.dx,timeStamp:Date.now()})},_trackEnd:function(t){var e=t.detail.dx+this._translateOffset,n=this.getWidth(),i="left"===this.position?e>=0||e<=-n:e<=0||e>=n;if(!i){var r=this._trackDetails;if(this._trackDetails=null,this._flingDrawer(t,r),this._drawerState===this._DRAWER_STATE.FLINGING)return}var o=n/2;t.detail.dx<-o?this.opened="right"===this.position:t.detail.dx>o&&(this.opened="left"===this.position),i?this.debounce("_resetDrawerState",this._resetDrawerState):this.debounce("_resetDrawerState",this._resetDrawerState,this.transitionDuration),this._styleTransitionDuration(this.transitionDuration),this._resetDrawerTranslate(),this.style.visibility=""},_calculateVelocity:function(t,e){for(var n,i=Date.now(),r=i-100,o=0,a=e.length-1;o<=a;){var s=o+a>>1,l=e[s];l.timeStamp>=r?(n=l,a=s-1):o=s+1}return n?(t.detail.dx-n.dx)/(i-n.timeStamp||1):0},_flingDrawer:function(t,e){var n=this._calculateVelocity(t,e);if(!(Math.abs(n)<this._MIN_FLING_THRESHOLD)){this._drawerState=this._DRAWER_STATE.FLINGING;var i,r=t.detail.dx+this._translateOffset,o=this.getWidth(),a="left"===this.position,s=n>0;i=!s&&a?-(r+o):s&&!a?o-r:-r,s?(n=Math.max(n,this._MIN_TRANSITION_VELOCITY),this.opened="left"===this.position):(n=Math.min(n,-this._MIN_TRANSITION_VELOCITY),this.opened="right"===this.position);var l=this._FLING_INITIAL_SLOPE*i/n;this._styleTransitionDuration(l),this._styleTransitionTimingFunction(this._FLING_TIMING_FUNCTION),this._resetDrawerTranslate(),this.debounce("_resetDrawerState",this._resetDrawerState,l)}},_styleTransitionDuration:function(t){this.style.transitionDuration=t+"ms",this.$.contentContainer.style.transitionDuration=t+"ms",this.$.scrim.style.transitionDuration=t+"ms"},_styleTransitionTimingFunction:function(t){this.$.contentContainer.style.transitionTimingFunction=t,this.$.scrim.style.transitionTimingFunction=t},_translateDrawer:function(t){var e=this.getWidth();"left"===this.position?(t=Math.max(-e,Math.min(t,0)),this.$.scrim.style.opacity=1+t/e):(t=Math.max(0,Math.min(t,e)),this.$.scrim.style.opacity=1-t/e),this.translate3d(t+"px","0","0",this.$.contentContainer)},_resetDrawerTranslate:function(){this.$.scrim.style.opacity="",this.transform("",this.$.contentContainer)},_resetDrawerState:function(){var t=this._drawerState;t===this._DRAWER_STATE.FLINGING&&(this._styleTransitionDuration(this.transitionDuration),this._styleTransitionTimingFunction(""),this.style.visibility=""),this._savedWidth=null,this.opened?this._drawerState=this.persistent?this._DRAWER_STATE.OPENED_PERSISTENT:this._DRAWER_STATE.OPENED:this._drawerState=this._DRAWER_STATE.CLOSED,t!==this._drawerState&&(this._drawerState===this._DRAWER_STATE.OPENED?(this._setKeyboardFocusTrap(),document.addEventListener("keydown",this._boundEscKeydownHandler),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",this._boundEscKeydownHandler),document.body.style.overflow=""),t!==this._DRAWER_STATE.INIT&&this.fire("app-drawer-transitioned"))},resetLayout:function(){this.fire("app-reset-layout")},_setKeyboardFocusTrap:function(){if(!this.noFocusTrap){var e=['a[href]:not([tabindex="-1"])','area[href]:not([tabindex="-1"])','input:not([disabled]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','iframe:not([tabindex="-1"])','[tabindex]:not([tabindex="-1"])','[contentEditable=true]:not([tabindex="-1"])'].join(","),n=t(this).querySelectorAll(e);n.length>0?(this._firstTabStop=n[0],this._lastTabStop=n[n.length-1]):(this._firstTabStop=null,this._lastTabStop=null);var i=this.getAttribute("tabindex");i&&parseInt(i,10)>-1?this.focus():this._firstTabStop&&this._firstTabStop.focus()}},_tabKeydownHandler:function(e){if(!this.noFocusTrap){var n=9;this._drawerState===this._DRAWER_STATE.OPENED&&e.keyCode===n&&(e.shiftKey?this._firstTabStop&&t(e).localTarget===this._firstTabStop&&(e.preventDefault(),this._lastTabStop.focus()):this._lastTabStop&&t(e).localTarget===this._lastTabStop&&(e.preventDefault(),this._firstTabStop.focus()))}},_openedPersistentChanged:function(t,e){this.toggleClass("visible",t&&!e,this.$.scrim),this.debounce("_resetDrawerState",this._resetDrawerState,this.transitionDuration)},_MIN_FLING_THRESHOLD:.2,_MIN_TRANSITION_VELOCITY:1.2,_FLING_TIMING_FUNCTION:"cubic-bezier(0.667, 1, 0.667, 1)",_FLING_INITIAL_SLOPE:1.5,_DRAWER_STATE:{INIT:0,OPENED:1,OPENED_PERSISTENT:2,CLOSED:3,TRACKING:4,FLINGING:5}}),
|
|
1855
1855
|
/**
|
|
1856
1856
|
@license
|
|
1857
1857
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -1883,7 +1883,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
|
1883
1883
|
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
1884
1884
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1885
1885
|
found at http://polymer.github.io/PATENTS.txt
|
|
1886
|
-
*/e({_template:
|
|
1886
|
+
*/e({_template:n`
|
|
1887
1887
|
<style>
|
|
1888
1888
|
:host {
|
|
1889
1889
|
display: block;
|
|
@@ -1927,7 +1927,7 @@ found at http://polymer.github.io/PATENTS.txt
|
|
|
1927
1927
|
</div>
|
|
1928
1928
|
|
|
1929
1929
|
<iron-media-query query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]" on-query-matches-changed="_onQueryMatchesChanged"></iron-media-query>
|
|
1930
|
-
`,is:"app-drawer-layout",behaviors:[Ja],properties:{forceNarrow:{type:Boolean,value:!1},responsiveWidth:{type:String,value:"640px"},narrow:{type:Boolean,reflectToAttribute:!0,readOnly:!0,notify:!0},openedWhenNarrow:{type:Boolean,value:!1},_drawerPosition:{type:String}},listeners:{click:"_clickHandler"},observers:["_narrowChanged(narrow)"],get drawer(){return t(this.$.drawerSlot).getDistributedNodes()[0]},attached:function(){var t=this.drawer;t&&t.setAttribute("no-transition","")},_clickHandler:function(e){var
|
|
1930
|
+
`,is:"app-drawer-layout",behaviors:[Ja],properties:{forceNarrow:{type:Boolean,value:!1},responsiveWidth:{type:String,value:"640px"},narrow:{type:Boolean,reflectToAttribute:!0,readOnly:!0,notify:!0},openedWhenNarrow:{type:Boolean,value:!1},_drawerPosition:{type:String}},listeners:{click:"_clickHandler"},observers:["_narrowChanged(narrow)"],get drawer(){return t(this.$.drawerSlot).getDistributedNodes()[0]},attached:function(){var t=this.drawer;t&&t.setAttribute("no-transition","")},_clickHandler:function(e){var n=t(e).localTarget;if(n&&n.hasAttribute("drawer-toggle")){var i=this.drawer;i&&!i.persistent&&i.toggle()}},_updateLayoutStates:function(){var t=this.drawer;this.isAttached&&t&&(this._drawerPosition=this.narrow?null:t.position,this._drawerNeedsReset&&(this.narrow?(t.opened=this.openedWhenNarrow,t.persistent=!1):t.opened=t.persistent=!0,t.hasAttribute("no-transition")&&g(this,(function(){t.removeAttribute("no-transition")})),this._drawerNeedsReset=!1))},_narrowChanged:function(){this._drawerNeedsReset=!0,this.resetLayout()},_onQueryMatchesChanged:function(t){this._setNarrow(t.detail.value)},_computeMediaQuery:function(t,e){return t?"(min-width: 0px)":"(max-width: "+e+")"}});
|
|
1931
1931
|
/**
|
|
1932
1932
|
@license
|
|
1933
1933
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -1949,7 +1949,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
1949
1949
|
part of the polymer project is also subject to an additional IP rights grant
|
|
1950
1950
|
found at http://polymer.github.io/PATENTS.txt
|
|
1951
1951
|
*/
|
|
1952
|
-
e({_template:
|
|
1952
|
+
e({_template:n`
|
|
1953
1953
|
<style>
|
|
1954
1954
|
:host {
|
|
1955
1955
|
position: relative;
|
|
@@ -2031,7 +2031,7 @@ e({_template:i`
|
|
|
2031
2031
|
<div id="contentContainer">
|
|
2032
2032
|
<slot id="slot"></slot>
|
|
2033
2033
|
</div>
|
|
2034
|
-
`,is:"app-header",behaviors:[q,Ja],properties:{condenses:{type:Boolean,value:!1},fixed:{type:Boolean,value:!1},reveals:{type:Boolean,value:!1},shadow:{type:Boolean,reflectToAttribute:!0,value:!1}},observers:["_configChanged(isAttached, condenses, fixed)"],_height:0,_dHeight:0,_stickyElTop:0,_stickyElRef:null,_top:0,_progress:0,_wasScrollingDown:!1,_initScrollTop:0,_initTimestamp:0,_lastTimestamp:0,_lastScrollTop:0,get _maxHeaderTop(){return this.fixed?this._dHeight:this._height+5},get _stickyEl(){if(this._stickyElRef)return this._stickyElRef;for(var e,
|
|
2034
|
+
`,is:"app-header",behaviors:[q,Ja],properties:{condenses:{type:Boolean,value:!1},fixed:{type:Boolean,value:!1},reveals:{type:Boolean,value:!1},shadow:{type:Boolean,reflectToAttribute:!0,value:!1}},observers:["_configChanged(isAttached, condenses, fixed)"],_height:0,_dHeight:0,_stickyElTop:0,_stickyElRef:null,_top:0,_progress:0,_wasScrollingDown:!1,_initScrollTop:0,_initTimestamp:0,_lastTimestamp:0,_lastScrollTop:0,get _maxHeaderTop(){return this.fixed?this._dHeight:this._height+5},get _stickyEl(){if(this._stickyElRef)return this._stickyElRef;for(var e,n=t(this.$.slot).getDistributedNodes(),i=0;e=n[i];i++)if(e.nodeType===Node.ELEMENT_NODE){if(e.hasAttribute("sticky")){this._stickyElRef=e;break}this._stickyElRef||(this._stickyElRef=e)}return this._stickyElRef},_configChanged:function(){this.resetLayout(),this._notifyLayoutChanged()},_updateLayoutStates:function(){if(0!==this.offsetWidth||0!==this.offsetHeight){var t=this._clampedScrollTop,e=0===this._height||0===t,n=this.disabled;this._height=this.offsetHeight,this._stickyElRef=null,this.disabled=!0,e||this._updateScrollState(0,!0),this._mayMove()?this._dHeight=this._stickyEl?this._height-this._stickyEl.offsetHeight:0:this._dHeight=0,this._stickyElTop=this._stickyEl?this._stickyEl.offsetTop:0,this._setUpEffect(),e?this._updateScrollState(t,!0):(this._updateScrollState(this._lastScrollTop,!0),this._layoutIfDirty()),this.disabled=n}},_updateScrollState:function(t,e){if(0!==this._height){var n=0,i=0,r=this._top,o=(this._lastScrollTop,this._maxHeaderTop),a=t-this._lastScrollTop,s=Math.abs(a),l=t>this._lastScrollTop,c=performance.now();if(this._mayMove()&&(i=this._clamp(this.reveals?r+a:t,0,o)),t>=this._dHeight&&(i=this.condenses&&!this.fixed?Math.max(this._dHeight,i):i,this.style.transitionDuration="0ms"),this.reveals&&!this.disabled&&s<100&&((c-this._initTimestamp>300||this._wasScrollingDown!==l)&&(this._initScrollTop=t,this._initTimestamp=c),t>=o))if(Math.abs(this._initScrollTop-t)>30||s>10){l&&t>=o?i=o:!l&&t>=this._dHeight&&(i=this.condenses&&!this.fixed?this._dHeight:0);var h=a/(c-this._lastTimestamp);this.style.transitionDuration=this._clamp((i-r)/h,0,300)+"ms"}else i=this._top;n=0===this._dHeight?t>0?1:0:i/this._dHeight,e||(this._lastScrollTop=t,this._top=i,this._wasScrollingDown=l,this._lastTimestamp=c),(e||n!==this._progress||r!==i||0===t)&&(this._progress=n,this._runEffects(n,i),this._transformHeader(i))}},_mayMove:function(){return this.condenses||!this.fixed},willCondense:function(){return this._dHeight>0&&this.condenses},isOnScreen:function(){return 0!==this._height&&this._top<this._height},isContentBelow:function(){return 0===this._top?this._clampedScrollTop>0:this._clampedScrollTop-this._maxHeaderTop>=0},_transformHeader:function(t){this.translate3d(0,-t+"px",0),this._stickyEl&&this.translate3d(0,this.condenses&&t>=this._stickyElTop?Math.min(t,this._dHeight)-this._stickyElTop+"px":0,0,this._stickyEl)},_clamp:function(t,e,n){return Math.min(n,Math.max(e,t))},_ensureBgContainers:function(){this._bgContainer||(this._bgContainer=document.createElement("div"),this._bgContainer.id="background",this._bgRear=document.createElement("div"),this._bgRear.id="backgroundRearLayer",this._bgContainer.appendChild(this._bgRear),this._bgFront=document.createElement("div"),this._bgFront.id="backgroundFrontLayer",this._bgContainer.appendChild(this._bgFront),t(this.root).insertBefore(this._bgContainer,this.$.contentContainer))},_getDOMRef:function(e){switch(e){case"backgroundFrontLayer":return this._ensureBgContainers(),this._bgFront;case"backgroundRearLayer":return this._ensureBgContainers(),this._bgRear;case"background":return this._ensureBgContainers(),this._bgContainer;case"mainTitle":return t(this).querySelector("[main-title]");case"condensedTitle":return t(this).querySelector("[condensed-title]")}return null},getScrollState:function(){return{progress:this._progress,top:this._top}}}),
|
|
2035
2035
|
/**
|
|
2036
2036
|
@license
|
|
2037
2037
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -2042,7 +2042,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
2042
2042
|
part of the polymer project is also subject to an additional IP rights grant
|
|
2043
2043
|
found at http://polymer.github.io/PATENTS.txt
|
|
2044
2044
|
*/
|
|
2045
|
-
e({_template:
|
|
2045
|
+
e({_template:n`
|
|
2046
2046
|
<style>
|
|
2047
2047
|
:host {
|
|
2048
2048
|
display: block;
|
|
@@ -2119,7 +2119,7 @@ e({_template:i`
|
|
|
2119
2119
|
<slot></slot>
|
|
2120
2120
|
</div>
|
|
2121
2121
|
</div>
|
|
2122
|
-
`,is:"app-header-layout",behaviors:[Ja],properties:{hasScrollingRegion:{type:Boolean,value:!1,reflectToAttribute:!0}},observers:["resetLayout(isAttached, hasScrollingRegion)"],get header(){return t(this.$.headerSlot).getDistributedNodes()[0]},_updateLayoutStates:function(){var t=this.header;if(this.isAttached&&t){this.$.wrapper.classList.remove("initializing"),t.scrollTarget=this.hasScrollingRegion?this.$.contentContainer:this.ownerDocument.documentElement;var e=t.offsetHeight;this.hasScrollingRegion?(t.style.left="",t.style.right=""):requestAnimationFrame(function(){var e=this.getBoundingClientRect(),
|
|
2122
|
+
`,is:"app-header-layout",behaviors:[Ja],properties:{hasScrollingRegion:{type:Boolean,value:!1,reflectToAttribute:!0}},observers:["resetLayout(isAttached, hasScrollingRegion)"],get header(){return t(this.$.headerSlot).getDistributedNodes()[0]},_updateLayoutStates:function(){var t=this.header;if(this.isAttached&&t){this.$.wrapper.classList.remove("initializing"),t.scrollTarget=this.hasScrollingRegion?this.$.contentContainer:this.ownerDocument.documentElement;var e=t.offsetHeight;this.hasScrollingRegion?(t.style.left="",t.style.right=""):requestAnimationFrame(function(){var e=this.getBoundingClientRect(),n=document.documentElement.clientWidth-e.right;t.style.left=e.left+"px",t.style.right=n+"px"}.bind(this));var n=this.$.contentContainer.style;t.fixed&&!t.condenses&&this.hasScrollingRegion?(n.marginTop=e+"px",n.paddingTop=""):(n.paddingTop=e+"px",n.marginTop="")}}}),
|
|
2123
2123
|
/**
|
|
2124
2124
|
@license
|
|
2125
2125
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -2130,7 +2130,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
2130
2130
|
part of the polymer project is also subject to an additional IP rights grant
|
|
2131
2131
|
found at http://polymer.github.io/PATENTS.txt
|
|
2132
2132
|
*/
|
|
2133
|
-
e({_template:
|
|
2133
|
+
e({_template:n`
|
|
2134
2134
|
<style>
|
|
2135
2135
|
|
|
2136
2136
|
:host {
|
|
@@ -2189,7 +2189,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
2189
2189
|
part of the polymer project is also subject to an additional IP rights grant
|
|
2190
2190
|
found at http://polymer.github.io/PATENTS.txt
|
|
2191
2191
|
*/
|
|
2192
|
-
e({_template:
|
|
2192
|
+
e({_template:n`
|
|
2193
2193
|
<style>
|
|
2194
2194
|
:host {
|
|
2195
2195
|
position: relative;
|
|
@@ -2258,20 +2258,20 @@ e({_template:i`
|
|
|
2258
2258
|
app-toolbar {
|
|
2259
2259
|
font-size: 75%;
|
|
2260
2260
|
}
|
|
2261
|
-
`}_update(){const t=this.shadowRoot.getElementById("panels").selected;this.active!==t&&(this.active=t,this._show())}_show(){const t=this.querySelectorAll("template");this.active>=t.length&&(this.active=t.length-1),console.log("<pb-panel> showing panel %s",this.active),this.querySelectorAll("._pb_panel").forEach(t=>t.style.display="none");const e=this.querySelector("._pb_panel"+this.active);if(e)e.style.display="";else{const e=t[this.active],
|
|
2261
|
+
`}_update(){const t=this.shadowRoot.getElementById("panels").selected;this.active!==t&&(this.active=t,this._show())}_show(){const t=this.querySelectorAll("template");this.active>=t.length&&(this.active=t.length-1),console.log("<pb-panel> showing panel %s",this.active),this.querySelectorAll("._pb_panel").forEach(t=>t.style.display="none");const e=this.querySelector("._pb_panel"+this.active);if(e)e.style.display="";else{const e=t[this.active],n=document.importNode(e.content,!0),i=document.createElement("div");i.className="_pb_panel _pb_panel"+this.active,i.appendChild(n),this.appendChild(i),this.emitTo("pb-panel",{panel:this,active:this.active})}}refresh(){this.emitTo("pb-refresh",null)}}customElements.define("pb-panel",es);class ns extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{panels:{type:Array},direction:{type:String},_columns:{type:Number},animated:{type:String},animation:{type:Boolean}})}constructor(){super(),this.direction="ltr",this.animated="pb-view",this.animation=!1}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-panel",t=>{const e=Array.from(this.shadowRoot.querySelectorAll("._grid_panel")).indexOf(t.detail.panel);e>0&&(console.log("<pb-grid> Updating panel %d to show %s",e,t.detail.active),this.panels[e]=t.detail.active,localStorage.setItem("pb-grid.panels",this.panels.join(".")),this.setParameter("panels",this.panels.join(".")),this.pushHistory("added panel"))});const t=this.getParameter("panels");if(t)this.panels=t.split(".").map(t=>parseInt(t)),localStorage.setItem("pb-grid.panels",this.panels.join("."));else{const t=localStorage.getItem("pb-grid.panels");t&&(this.panels=t.split(".").map(t=>parseInt(t)))}this._columns=this.panels.length,this.template=this.querySelector("template")}firstUpdated(){this.panels.forEach(t=>this._insertPanel(t)),this._animate(),this._update()}_animate(){if(this.animation&&"anime"in window){const t=document.querySelectorAll(this.animated),e=anime.timeline({easing:"linear",duration:400});e.add({targets:t,opacity:{value:[0,.6],duration:200,delay:100,easing:"linear"},translateX:[2e3,0],duration:400,delay:anime.stagger(100,{start:100})}),e.add({targets:t,opacity:[.6,1],duration:200,delay:anime.stagger(50)}),e.play()}}addPanel(t){if(!t)if(this.panels.length>0){t=this.panels.reduce((function(t,e){return Math.max(t,e)}))+1}else t=0;this._columns++,this.panels.push(t),localStorage.setItem("pb-grid.panels",this.panels.join(".")),this.setParameter("panels",this.panels.join(".")),this.pushHistory("added panel"),this._insertPanel(t),this._update(),this.emitTo("pb-refresh",null)}removePanel(t){const e=Array.from(this.querySelectorAll("._grid_panel")).indexOf(t);console.log("<pb-grid> Removing panel %d",e),this.panels.splice(e,1),this.setParameter("panels",this.panels.join(".")),localStorage.setItem("pb-grid.panels",this.panels.join(".")),this.pushHistory("removed panel"),t.parentNode.removeChild(t),this._columns--,this._update()}_insertPanel(t){const e=document.importNode(this.template.content.firstElementChild,!0);e.setAttribute("active",t),"ltr"===this.direction||0===this.querySelectorAll("._grid_panel").length?this.appendChild(e):this.insertBefore(e,this.firstElementChild),e.classList.add("_grid_panel")}_update(){const t=[];Array.from(this.children).forEach(e=>{if(e instanceof HTMLTemplateElement)return;const n=window.getComputedStyle(e).getPropertyValue("max-width");n&&"none"!==n?t.push(n):t.push("1fr")}),this.style.setProperty("--pb-computed-column-widths",t.join(" "))}render(){return $`<slot></slot>`}static get styles(){return P`
|
|
2262
2262
|
:host {
|
|
2263
2263
|
display: grid;
|
|
2264
2264
|
grid-template-columns: var(--pb-grid-column-widths, var(--pb-computed-column-widths));
|
|
2265
2265
|
grid-column-gap: var(--pb-grid-column-gap, 20px);
|
|
2266
2266
|
justify-content: space-between;
|
|
2267
2267
|
}
|
|
2268
|
-
`}}customElements.define("pb-grid",
|
|
2268
|
+
`}}customElements.define("pb-grid",ns);class is extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{action:{type:String},grid:{type:String},initial:{type:Number}})}constructor(){super(),this.action="add",this.initial=0}connectedCallback(){super.connectedCallback()}render(){return $`
|
|
2269
2269
|
<a @click="${this._click}"><slot></slot></a>
|
|
2270
2270
|
`}static get styles(){return P`
|
|
2271
2271
|
:host {
|
|
2272
2272
|
display: block;
|
|
2273
2273
|
}
|
|
2274
|
-
`}_click(){const t=document.querySelector(this.grid);if(!t||!t.addPanel)return console.error("<pb-grid-action> grid not found: %s",this.grid);"add"===this.action?t.addPanel(this.initial):t.removePanel(this.parentNode)}}customElements.define("pb-grid-action",
|
|
2274
|
+
`}_click(){const t=document.querySelector(this.grid);if(!t||!t.addPanel)return console.error("<pb-grid-action> grid not found: %s",this.grid);"add"===this.action?t.addPanel(this.initial):t.removePanel(this.parentNode)}}customElements.define("pb-grid-action",is);class rs extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{login:{type:String},show:{type:Boolean,reflect:!0},group:{type:String}})}constructor(){super(),this.show=!1}firstUpdated(){this.shadowRoot.querySelector("slot[name=fallback]").assignedNodes().length>0&&(console.log(this),this.classList.add("fallback"));const t=document.getElementById(this.login);t?(this.subscribeTo("pb-login",t=>{this.show=this._loggedIn(t.detail.user,t.detail.groups)},[]),this.show=t.loggedIn&&this._loggedIn(t.user,t.groups)):console.error("<pb-restricted> connected pb-login element not found!")}render(){return $`
|
|
2275
2275
|
${this.show&&!this.disabled?$`<slot></slot>`:$`<slot name="fallback"></slot>`}
|
|
2276
2276
|
`}static get styles(){return P`
|
|
2277
2277
|
:host {
|
|
@@ -2281,7 +2281,7 @@ e({_template:i`
|
|
|
2281
2281
|
:host(.fallback), :host([show]) {
|
|
2282
2282
|
display: block;
|
|
2283
2283
|
}
|
|
2284
|
-
`}_loggedIn(t,e){return null!=t&&(!this.group||!!e&&e.indexOf(this.group)>-1)}}customElements.define("pb-restricted",rs);class os extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{odds:{type:Array},target:{type:String},_valid:{type:Boolean},_current:{type:String}})}constructor(){super(),this.odds=[]}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-login",()=>this._refresh(),[]),this.subscribeTo("pb-refresh-odds",t=>{this._refresh();const e=this.shadowRoot.getElementById("regenerate"),
|
|
2284
|
+
`}_loggedIn(t,e){return null!=t&&(!this.group||!!e&&e.indexOf(this.group)>-1)}}customElements.define("pb-restricted",rs);class os extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{odds:{type:Array},target:{type:String},_valid:{type:Boolean},_current:{type:String}})}constructor(){super(),this.odds=[]}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-login",()=>this._refresh(),[]),this.subscribeTo("pb-refresh-odds",t=>{this._refresh();const e=this.shadowRoot.getElementById("regenerate"),n=t.detail.odds.map(t=>"odd="+t).join("&");this.minApiVersion("1.0.0")?e.url="api/odd?"+n:e.url="modules/lib/regenerate.xql?"+n,e.trigger()})}firstUpdated(){super.firstUpdated(),this._loader=this.shadowRoot.getElementById("load"),os.waitOnce("pb-page-ready",t=>{I(t.apiVersion,"1.0.0")<0?this._loader.url=t.endpoint+"/modules/lib/components-odd.xql":this._loader.url=t.endpoint+"/api/odd",this._refresh()})}_refresh(t){this.emitTo("pb-start-update"),this._loader.params=t,this._loader.generateRequest()}_update(){this.emitTo("pb-end-update"),this.odds=this._loader.lastResponse}_selectODD(t){const e=t.model.itemsIndex;this.odds.forEach((t,n)=>{n!==e&&t.current&&(this.set("odds."+n+".current",!1),this.set("odds."+e+".current",!0))});const n={odd:t.model.item.name+".odd"};console.log("<pb-manage-odds> selected ODD: %o",n),this.emitTo("pb-load",{params:n})}_createODD(){const t=this.shadowRoot.querySelector('paper-input[name="new_odd"]').value,e=this.shadowRoot.querySelector('paper-input[name="title"]').value;if(console.log("<pb-manage-odds> create ODD: %s, %s",t,e),this.lessThanApiVersion("1.0.0"))this._refresh({new_odd:t,title:e});else{const n=this.shadowRoot.getElementById("create");n.url=`${this.getEndpoint()}/api/odd/${t}`,n.params={title:e},this.emitTo("pb-start-update"),n.generateRequest()}}_created(t){this.emitTo("pb-end-update"),201===t.detail.status?this._refresh():console.log("<pb-manage-odds> unexpected response for create odd: %o",t.detail)}_createByExample(){const t={new_odd:this.shadowRoot.querySelector('paper-input[name="new_odd"]').value,title:this.shadowRoot.querySelector('paper-input[name="title"]').value},e=document.getElementById(this.target);e||e.getSelected||console.error("<pb-manage-odds> target %s not found",this.target);const n=e.getSelected();document.querySelectorAll(".document-select paper-checkbox[checked]").forEach(t=>{n.push(t.value)}),console.log("<pb-manage-odds> create ODD by example: %o",n),t.byExample=n,this._refresh(t)}_delete(t){this._current=t,this.shadowRoot.getElementById("deleteDialog").open()}_confirmDelete(){if(this._current){if(console.log("<pb-manage-odds> deleting ODD: %s",this._current),this.lessThanApiVersion("1.0.0"))this._refresh({delete:this._current});else{this.emitTo("pb-start-update");const t=this.shadowRoot.getElementById("delete");t.url=`${this.getEndpoint()}/api/odd/${this._current}`,t.generateRequest()}this._current=null}else console.error("<pb-manage-odds> no file marked for deletion")}_deleted(){const t=this.shadowRoot.getElementById("delete").lastError;410===t.status?this._refresh():(console.error("<pb-manage-odds> failed to delete odd: %d %o",t.status,t.response),this.emitTo("pb-end-update"))}_validate(){const t=this.shadowRoot.getElementById("ironform").validate();this.shadowRoot.getElementById("createBtn").disabled=!t,this.shadowRoot.getElementById("createByEx").disabled=!t}render(){if(!this.odds)return null;const t=this.lessThanApiVersion("1.0.0")?"modules/lib/regenerate.xql":"api/odd";return $`
|
|
2285
2285
|
<pb-restricted login="login">
|
|
2286
2286
|
<pb-ajax id="regenerateAll" url="${t}" method="post" title="${r("odd.manage.regenerate-all")}"
|
|
2287
2287
|
emit="${this.emit?this.emit:""}" .emitConfig="${this.emitConfig}">
|
|
@@ -2395,7 +2395,7 @@ e({_template:i`
|
|
|
2395
2395
|
margin-top: 10px;
|
|
2396
2396
|
text-align: right;
|
|
2397
2397
|
}
|
|
2398
|
-
`}}customElements.define("pb-manage-odds",os);const as=document.createElement("template");as.innerHTML='<dom-module id="lumo-field-button">\n <template>\n <style>\n [part$="button"] {\n flex: none;\n width: 1em;\n height: 1em;\n line-height: 1;\n font-size: var(--lumo-icon-size-m);\n text-align: center;\n color: var(--lumo-contrast-60pct);\n transition: 0.2s color;\n cursor: var(--lumo-clickable-cursor);\n }\n\n :host(:not([readonly])) [part$="button"]:hover {\n color: var(--lumo-contrast-90pct);\n }\n\n :host([disabled]) [part$="button"],\n :host([readonly]) [part$="button"] {\n color: var(--lumo-contrast-20pct);\n }\n\n [part$="button"]::before {\n font-family: "lumo-icons";\n display: block;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(as.content);const ss=
|
|
2398
|
+
`}}customElements.define("pb-manage-odds",os);const as=document.createElement("template");as.innerHTML='<dom-module id="lumo-field-button">\n <template>\n <style>\n [part$="button"] {\n flex: none;\n width: 1em;\n height: 1em;\n line-height: 1;\n font-size: var(--lumo-icon-size-m);\n text-align: center;\n color: var(--lumo-contrast-60pct);\n transition: 0.2s color;\n cursor: var(--lumo-clickable-cursor);\n }\n\n :host(:not([readonly])) [part$="button"]:hover {\n color: var(--lumo-contrast-90pct);\n }\n\n :host([disabled]) [part$="button"],\n :host([readonly]) [part$="button"] {\n color: var(--lumo-contrast-20pct);\n }\n\n [part$="button"]::before {\n font-family: "lumo-icons";\n display: block;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(as.content);const ss=n`<dom-module id="lumo-button" theme-for="vaadin-button">
|
|
2399
2399
|
<template>
|
|
2400
2400
|
<style>
|
|
2401
2401
|
:host {
|
|
@@ -2689,7 +2689,7 @@ let ls=!1;window.addEventListener("keydown",()=>{ls=!0},{capture:!0}),window.add
|
|
|
2689
2689
|
@license
|
|
2690
2690
|
Copyright (c) 2017 Vaadin Ltd.
|
|
2691
2691
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2692
|
-
*/;class ps extends(H(hs(T(b(y))))){static get template(){return
|
|
2692
|
+
*/;class ps extends(H(hs(T(b(y))))){static get template(){return n`
|
|
2693
2693
|
<style>
|
|
2694
2694
|
:host {
|
|
2695
2695
|
display: inline-block;
|
|
@@ -2757,7 +2757,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
2757
2757
|
</div>
|
|
2758
2758
|
</div>
|
|
2759
2759
|
<button id="button" type="button"></button>
|
|
2760
|
-
`}static get is(){return"vaadin-button"}static get version(){return"2.4.0"}ready(){super.ready(),this.setAttribute("role","button"),this.$.button.setAttribute("role","presentation"),this._addActiveListeners(),window.ShadyDOM&&window.ShadyDOM.flush()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this.removeAttribute("active")}_addActiveListeners(){_(this,"down",()=>!this.disabled&&this.setAttribute("active","")),_(this,"up",()=>this.removeAttribute("active")),this.addEventListener("keydown",t=>!this.disabled&&[13,32].indexOf(t.keyCode)>=0&&this.setAttribute("active","")),this.addEventListener("keyup",()=>this.removeAttribute("active")),this.addEventListener("blur",()=>this.removeAttribute("active"))}get focusElement(){return this.$.button}}customElements.define(ps.is,ps);const ds=
|
|
2760
|
+
`}static get is(){return"vaadin-button"}static get version(){return"2.4.0"}ready(){super.ready(),this.setAttribute("role","button"),this.$.button.setAttribute("role","presentation"),this._addActiveListeners(),window.ShadyDOM&&window.ShadyDOM.flush()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("active")&&this.removeAttribute("active")}_addActiveListeners(){_(this,"down",()=>!this.disabled&&this.setAttribute("active","")),_(this,"up",()=>this.removeAttribute("active")),this.addEventListener("keydown",t=>!this.disabled&&[13,32].indexOf(t.keyCode)>=0&&this.setAttribute("active","")),this.addEventListener("keyup",()=>this.removeAttribute("active")),this.addEventListener("blur",()=>this.removeAttribute("active"))}get focusElement(){return this.$.button}}customElements.define(ps.is,ps);const ds=n`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
|
|
2761
2761
|
<template>
|
|
2762
2762
|
<style>
|
|
2763
2763
|
:host {
|
|
@@ -2966,12 +2966,12 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
2966
2966
|
Copyright (c) 2017 Vaadin Ltd.
|
|
2967
2967
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2968
2968
|
*/
|
|
2969
|
-
const us=t=>class extends t{static get properties(){return{value:{type:Number,observer:"_valueChanged"},min:{type:Number,value:0,observer:"_minChanged"},max:{type:Number,value:1,observer:"_maxChanged"},indeterminate:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_normalizedValueChanged(value, min, max)"]}ready(){super.ready(),this.setAttribute("role","progressbar")}_normalizedValueChanged(t,e,
|
|
2969
|
+
const us=t=>class extends t{static get properties(){return{value:{type:Number,observer:"_valueChanged"},min:{type:Number,value:0,observer:"_minChanged"},max:{type:Number,value:1,observer:"_maxChanged"},indeterminate:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_normalizedValueChanged(value, min, max)"]}ready(){super.ready(),this.setAttribute("role","progressbar")}_normalizedValueChanged(t,e,n){const i=this._normalizeValue(t,e,n);this.style.setProperty("--vaadin-progress-value",i),this.updateStyles({"--vaadin-progress-value":String(i)})}_valueChanged(t,e){this.setAttribute("aria-valuenow",t)}_minChanged(t,e){this.setAttribute("aria-valuemin",t)}_maxChanged(t,e){this.setAttribute("aria-valuemax",t)}_normalizeValue(t,e,n){let i;return t||0==t?e>=n?i=1:(i=(t-e)/(n-e),i=Math.min(Math.max(i,0),1)):i=0,i}}
|
|
2970
2970
|
/**
|
|
2971
2971
|
@license
|
|
2972
2972
|
Copyright (c) 2017 Vaadin Ltd.
|
|
2973
2973
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2974
|
-
*/;class gs extends(H(T(us(y)))){static get template(){return
|
|
2974
|
+
*/;class gs extends(H(T(us(y)))){static get template(){return n`
|
|
2975
2975
|
<style>
|
|
2976
2976
|
:host {
|
|
2977
2977
|
display: block;
|
|
@@ -3003,7 +3003,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
3003
3003
|
<div part="bar">
|
|
3004
3004
|
<div part="value"></div>
|
|
3005
3005
|
</div>
|
|
3006
|
-
`}static get is(){return"vaadin-progress-bar"}static get version(){return"1.3.0"}}customElements.define(gs.is,gs);const fs=
|
|
3006
|
+
`}static get is(){return"vaadin-progress-bar"}static get version(){return"1.3.0"}}customElements.define(gs.is,gs);const fs=n`<dom-module id="lumo-upload" theme-for="vaadin-upload">
|
|
3007
3007
|
<template>
|
|
3008
3008
|
<style>
|
|
3009
3009
|
:host {
|
|
@@ -3178,7 +3178,7 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
3178
3178
|
Copyright (c) 2017 Vaadin Ltd.
|
|
3179
3179
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3180
3180
|
*/
|
|
3181
|
-
class vs extends(T(y)){static get template(){return
|
|
3181
|
+
class vs extends(T(y)){static get template(){return n`
|
|
3182
3182
|
<style>
|
|
3183
3183
|
:host {
|
|
3184
3184
|
display: block;
|
|
@@ -3209,13 +3209,13 @@ class vs extends(T(y)){static get template(){return i`
|
|
|
3209
3209
|
|
|
3210
3210
|
<vaadin-progress-bar part="progress" id="progress" value\$="[[_formatProgressValue(file.progress)]]" error\$="[[file.error]]" indeterminate\$="[[file.indeterminate]]" uploading\$="[[file.uploading]]" complete\$="[[file.complete]]">
|
|
3211
3211
|
</vaadin-progress-bar>
|
|
3212
|
-
`}static get is(){return"vaadin-upload-file"}static get properties(){return{file:Object}}static get observers(){return["_fileAborted(file.abort)",'_toggleHostAttribute(file.error, "error")','_toggleHostAttribute(file.indeterminate, "indeterminate")','_toggleHostAttribute(file.uploading, "uploading")','_toggleHostAttribute(file.complete, "complete")']}_fileAborted(t){t&&this._remove()}_remove(){this.dispatchEvent(new CustomEvent("file-remove",{detail:{file:this.file},bubbles:!0,composed:!0}))}_formatProgressValue(t){return t/100}_fireFileEvent(t){return t.preventDefault(),this.dispatchEvent(new CustomEvent(t.target.getAttribute("file-event"),{detail:{file:this.file},bubbles:!0,composed:!0}))}_toggleHostAttribute(t,e){const
|
|
3212
|
+
`}static get is(){return"vaadin-upload-file"}static get properties(){return{file:Object}}static get observers(){return["_fileAborted(file.abort)",'_toggleHostAttribute(file.error, "error")','_toggleHostAttribute(file.indeterminate, "indeterminate")','_toggleHostAttribute(file.uploading, "uploading")','_toggleHostAttribute(file.complete, "complete")']}_fileAborted(t){t&&this._remove()}_remove(){this.dispatchEvent(new CustomEvent("file-remove",{detail:{file:this.file},bubbles:!0,composed:!0}))}_formatProgressValue(t){return t/100}_fireFileEvent(t){return t.preventDefault(),this.dispatchEvent(new CustomEvent(t.target.getAttribute("file-event"),{detail:{file:this.file},bubbles:!0,composed:!0}))}_toggleHostAttribute(t,e){const n=Boolean(t);this.hasAttribute(e)!==n&&(n?this.setAttribute(e,""):this.removeAttribute(e))}}customElements.define(vs.is,vs);
|
|
3213
3213
|
/**
|
|
3214
3214
|
@license
|
|
3215
3215
|
Copyright (c) 2017 Vaadin Ltd.
|
|
3216
3216
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3217
3217
|
*/
|
|
3218
|
-
class bs extends(H(T(y))){static get template(){return
|
|
3218
|
+
class bs extends(H(T(y))){static get template(){return n`
|
|
3219
3219
|
<style>
|
|
3220
3220
|
:host {
|
|
3221
3221
|
display: block;
|
|
@@ -3257,7 +3257,7 @@ class bs extends(H(T(y))){static get template(){return i`
|
|
|
3257
3257
|
</slot>
|
|
3258
3258
|
<slot></slot>
|
|
3259
3259
|
<input type="file" id="fileInput" on-change="_onFileInputChange" hidden="" accept\$="{{accept}}" multiple\$="[[_isMultiple(maxFiles)]]" capture\$="[[capture]]">
|
|
3260
|
-
`}static get is(){return"vaadin-upload"}static get version(){return"4.4.2"}static get properties(){return{nodrop:{type:Boolean,reflectToAttribute:!0,value:function(){try{return!!document.createEvent("TouchEvent")}catch(t){return!1}}},target:{type:String,value:""},method:{type:String,value:"POST"},headers:{type:Object,value:{}},timeout:{type:Number,value:0},_dragover:{type:Boolean,value:!1,observer:"_dragoverChanged"},files:{type:Array,notify:!0,value:function(){return[]}},maxFiles:{type:Number,value:1/0},maxFilesReached:{type:Boolean,value:!1,notify:!0,readOnly:!0,computed:"_maxFilesAdded(maxFiles, files.length)"},accept:{type:String,value:""},maxFileSize:{type:Number,value:1/0},_dragoverValid:{type:Boolean,value:!1,observer:"_dragoverValidChanged"},formDataName:{type:String,value:"file"},noAuto:{type:Boolean,value:!1},withCredentials:{type:Boolean,value:!1},capture:String,i18n:{type:Object,value:function(){return{dropFiles:{one:"Drop file here",many:"Drop files here"},addFiles:{one:"Upload File...",many:"Upload Files..."},cancel:"Cancel",error:{tooManyFiles:"Too Many Files.",fileIsTooBig:"File is Too Big.",incorrectFileType:"Incorrect File Type."},uploading:{status:{connecting:"Connecting...",stalled:"Stalled.",processing:"Processing File...",held:"Queued"},remainingTime:{prefix:"remaining time: ",unknown:"unknown remaining time"},error:{serverUnavailable:"Server Unavailable",unexpectedServerError:"Unexpected Server Error",forbidden:"Forbidden"}},units:{size:["B","kB","MB","GB","TB","PB","EB","ZB","YB"]}}}}}}ready(){super.ready(),this.addEventListener("dragover",this._onDragover.bind(this)),this.addEventListener("dragleave",this._onDragleave.bind(this)),this.addEventListener("drop",this._onDrop.bind(this)),this.addEventListener("file-retry",this._onFileRetry.bind(this)),this.addEventListener("file-abort",this._onFileAbort.bind(this)),this.addEventListener("file-remove",this._onFileRemove.bind(this)),this.addEventListener("file-start",this._onFileStart.bind(this))}_formatSize(t){if("function"==typeof this.i18n.formatSize)return this.i18n.formatSize(t);const e=this.i18n.units.sizeBase||1e3,
|
|
3260
|
+
`}static get is(){return"vaadin-upload"}static get version(){return"4.4.2"}static get properties(){return{nodrop:{type:Boolean,reflectToAttribute:!0,value:function(){try{return!!document.createEvent("TouchEvent")}catch(t){return!1}}},target:{type:String,value:""},method:{type:String,value:"POST"},headers:{type:Object,value:{}},timeout:{type:Number,value:0},_dragover:{type:Boolean,value:!1,observer:"_dragoverChanged"},files:{type:Array,notify:!0,value:function(){return[]}},maxFiles:{type:Number,value:1/0},maxFilesReached:{type:Boolean,value:!1,notify:!0,readOnly:!0,computed:"_maxFilesAdded(maxFiles, files.length)"},accept:{type:String,value:""},maxFileSize:{type:Number,value:1/0},_dragoverValid:{type:Boolean,value:!1,observer:"_dragoverValidChanged"},formDataName:{type:String,value:"file"},noAuto:{type:Boolean,value:!1},withCredentials:{type:Boolean,value:!1},capture:String,i18n:{type:Object,value:function(){return{dropFiles:{one:"Drop file here",many:"Drop files here"},addFiles:{one:"Upload File...",many:"Upload Files..."},cancel:"Cancel",error:{tooManyFiles:"Too Many Files.",fileIsTooBig:"File is Too Big.",incorrectFileType:"Incorrect File Type."},uploading:{status:{connecting:"Connecting...",stalled:"Stalled.",processing:"Processing File...",held:"Queued"},remainingTime:{prefix:"remaining time: ",unknown:"unknown remaining time"},error:{serverUnavailable:"Server Unavailable",unexpectedServerError:"Unexpected Server Error",forbidden:"Forbidden"}},units:{size:["B","kB","MB","GB","TB","PB","EB","ZB","YB"]}}}}}}ready(){super.ready(),this.addEventListener("dragover",this._onDragover.bind(this)),this.addEventListener("dragleave",this._onDragleave.bind(this)),this.addEventListener("drop",this._onDrop.bind(this)),this.addEventListener("file-retry",this._onFileRetry.bind(this)),this.addEventListener("file-abort",this._onFileAbort.bind(this)),this.addEventListener("file-remove",this._onFileRemove.bind(this)),this.addEventListener("file-start",this._onFileStart.bind(this))}_formatSize(t){if("function"==typeof this.i18n.formatSize)return this.i18n.formatSize(t);const e=this.i18n.units.sizeBase||1e3,n=~~(Math.log(t)/Math.log(e)),i=Math.max(0,Math.min(3,n-1));return parseFloat((t/Math.pow(e,n)).toFixed(i))+" "+this.i18n.units.size[n]}_splitTimeByUnits(t){const e=[60,60,24,1/0],n=[0];for(var i=0;i<e.length&&t>0;i++)n[i]=t%e[i],t=Math.floor(t/e[i]);return n}_formatTime(t,e){if("function"==typeof this.i18n.formatTime)return this.i18n.formatTime(t,e);for(;e.length<3;)e.push(0);return e.reverse().map(t=>(t<10?"0":"")+t).join(":")}_formatFileProgress(t){return t.totalStr+": "+t.progress+"% ("+(t.loaded>0?this.i18n.uploading.remainingTime.prefix+t.remainingStr:this.i18n.uploading.remainingTime.unknown)+")"}_maxFilesAdded(t,e){return t>=0&&e>=t}_onDragover(t){t.preventDefault(),this.nodrop||this._dragover||(this._dragoverValid=!this.maxFilesReached,this._dragover=!0),t.dataTransfer.dropEffect=!this._dragoverValid||this.nodrop?"none":"copy"}_onDragleave(t){t.preventDefault(),this._dragover&&!this.nodrop&&(this._dragover=this._dragoverValid=!1)}_onDrop(t){this.nodrop||(t.preventDefault(),this._dragover=this._dragoverValid=!1,this._addFiles(t.dataTransfer.files))}_createXhr(){return new XMLHttpRequest}_configureXhr(t){if("string"==typeof this.headers)try{this.headers=JSON.parse(this.headers)}catch(t){this.headers=void 0}for(var e in this.headers)t.setRequestHeader(e,this.headers[e]);this.timeout&&(t.timeout=this.timeout),t.withCredentials=this.withCredentials}_setStatus(t,e,n,i){t.elapsed=i,t.elapsedStr=this._formatTime(t.elapsed,this._splitTimeByUnits(t.elapsed)),t.remaining=Math.ceil(i*(e/n-1)),t.remainingStr=this._formatTime(t.remaining,this._splitTimeByUnits(t.remaining)),t.speed=~~(e/i/1024),t.totalStr=this._formatSize(e),t.loadedStr=this._formatSize(n),t.status=this._formatFileProgress(t)}uploadFiles(t){t&&!Array.isArray(t)&&(t=[t]),t=(t=t||this.files).filter(t=>!t.complete),Array.prototype.forEach.call(t,this._uploadFile.bind(this))}_uploadFile(t){if(t.uploading)return;const e=Date.now(),n=t.xhr=this._createXhr();let i,r;n.upload.onprogress=o=>{clearTimeout(i),r=Date.now();const a=(r-e)/1e3,s=o.loaded,l=o.total,c=~~(s/l*100);t.loaded=s,t.progress=c,t.indeterminate=s<=0||s>=l,t.error?t.indeterminate=t.status=void 0:t.abort||(c<100?(this._setStatus(t,l,s,a),i=setTimeout(()=>{t.status=this.i18n.uploading.status.stalled,this._notifyFileChanges(t)},2e3)):(t.loadedStr=t.totalStr,t.status=this.i18n.uploading.status.processing)),this._notifyFileChanges(t),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{file:t,xhr:n}}))},n.onreadystatechange=()=>{if(4==n.readyState){if(clearTimeout(i),t.indeterminate=t.uploading=!1,t.abort)return void this._notifyFileChanges(t);t.status="";if(!this.dispatchEvent(new CustomEvent("upload-response",{detail:{file:t,xhr:n},cancelable:!0})))return;0===n.status?t.error=this.i18n.uploading.error.serverUnavailable:n.status>=500?t.error=this.i18n.uploading.error.unexpectedServerError:n.status>=400&&(t.error=this.i18n.uploading.error.forbidden),t.complete=!t.error,this.dispatchEvent(new CustomEvent("upload-"+(t.error?"error":"success"),{detail:{file:t,xhr:n}})),this._notifyFileChanges(t)}};const o=new FormData;t.uploadTarget=t.uploadTarget||this.target||"",t.formDataName=this.formDataName;if(!this.dispatchEvent(new CustomEvent("upload-before",{detail:{file:t,xhr:n},cancelable:!0})))return;o.append(t.formDataName,t,t.name),n.open(this.method,t.uploadTarget,!0),this._configureXhr(n),t.status=this.i18n.uploading.status.connecting,t.uploading=t.indeterminate=!0,t.complete=t.abort=t.error=t.held=!1,n.upload.onloadstart=()=>{this.dispatchEvent(new CustomEvent("upload-start",{detail:{file:t,xhr:n}})),this._notifyFileChanges(t)};this.dispatchEvent(new CustomEvent("upload-request",{detail:{file:t,xhr:n,formData:o},cancelable:!0}))&&n.send(o)}_retryFileUpload(t){this.dispatchEvent(new CustomEvent("upload-retry",{detail:{file:t,xhr:t.xhr},cancelable:!0}))&&this._uploadFile(t)}_abortFileUpload(t){this.dispatchEvent(new CustomEvent("upload-abort",{detail:{file:t,xhr:t.xhr},cancelable:!0}))&&(t.abort=!0,t.xhr&&t.xhr.abort(),this._notifyFileChanges(t))}_notifyFileChanges(t){var e="files."+this.files.indexOf(t)+".";for(var n in t)t.hasOwnProperty(n)&&this.notifyPath(e+n,t[n])}_addFiles(t){Array.prototype.forEach.call(t,this._addFile.bind(this))}_addFile(t){if(this.maxFilesReached)return void this.dispatchEvent(new CustomEvent("file-reject",{detail:{file:t,error:this.i18n.error.tooManyFiles}}));if(this.maxFileSize>=0&&t.size>this.maxFileSize)return void this.dispatchEvent(new CustomEvent("file-reject",{detail:{file:t,error:this.i18n.error.fileIsTooBig}}));const e=t.name.match(/\.[^\.]*$|$/)[0],n=new RegExp("^("+this.accept.replace(/[, ]+/g,"|").replace(/\/\*/g,"/.*")+")$","i");!this.accept||n.test(t.type)||n.test(e)?(t.loaded=0,t.held=!0,t.status=this.i18n.uploading.status.held,this.unshift("files",t),this.noAuto||this._uploadFile(t)):this.dispatchEvent(new CustomEvent("file-reject",{detail:{file:t,error:this.i18n.error.incorrectFileType}}))}_removeFile(t){this.files.indexOf(t)>-1&&this.splice("files",this.files.indexOf(t),1)}_onAddFilesTouchEnd(t){t.preventDefault(),this.__resetMouseCanceller(),this._onAddFilesClick()}__resetMouseCanceller(){w()}_onAddFilesClick(){this.maxFilesReached||(this.$.fileInput.value="",this.$.fileInput.click())}_onFileInputChange(t){this._addFiles(t.target.files)}_onFileStart(t){this._uploadFile(t.detail.file)}_onFileRetry(t){this._retryFileUpload(t.detail.file)}_onFileAbort(t){this._abortFileUpload(t.detail.file)}_onFileRemove(t){this._removeFile(t.detail.file)}_dragoverChanged(t){t?this.setAttribute("dragover",t):this.removeAttribute("dragover")}_dragoverValidChanged(t){t?this.setAttribute("dragover-valid",t):this.removeAttribute("dragover-valid")}_i18nPlural(t,e){return 1==t?e.one:e.many}_isMultiple(t){return 1!=t}}customElements.define(bs.is,bs);class ys extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{target:{type:String},accept:{type:String},_files:{type:Object}})}constructor(){super(),this._files=new Map}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.subscribeTo("pb-collection",t=>{this.target=t.detail.collection})}firstUpdated(){super.firstUpdated();const t=this.shadowRoot.getElementById("uploader");t.addEventListener("upload-before",e=>{this.emitTo("pb-start-update");const{file:n}=e.detail;this._files.set(n.name,n),this.requestUpdate(),this.minApiVersion("1.0.0")&&this.target&&(n.uploadTarget=`${t.target}${encodeURIComponent(this.target)}`)}),t.addEventListener("upload-request",t=>{this.target&&this.lessThanApiVersion("1.0.0")&&t.detail.formData.append("root",this.target)}),t.addEventListener("upload-error",t=>{this.emitTo("pb-end-update"),t.detail.file.error=t.detail.xhr.responseText,this.requestUpdate()}),t.addEventListener("upload-success",()=>{let e=!0;const n=[];t.files.forEach(t=>{t.complete||t.error||t.aborted?/^.*\.odd$/.test(t.name)&&n.push(t.name):e=!1,this.requestUpdate()}),e&&(this.emitTo("pb-end-update"),this.emitTo("pb-load"),n.length>0&&this.emitTo("pb-refresh-odds",{odds:n}))}),ys.waitOnce("pb-page-ready",()=>{this.minApiVersion("1.0.0")?t.target=this.getEndpoint()+"/api/upload/":t.target=this.getEndpoint()+"/modules/lib/upload.xql"})}render(){const t=this._getCSSProperty("--pb-upload-button-icon","icons:file-upload"),e=this._getCSSProperty("--pb-upload-drop-icon",null);return $`
|
|
3261
3261
|
<vaadin-upload id="uploader" accept="${this.accept}" method="post" tabindex="-1" form-data-name="files[]"
|
|
3262
3262
|
with-credentials>
|
|
3263
3263
|
${e?$`<iron-icon slot="drop-label-icon" icon="${e}"></iron-icon>`:$`<span slot="drop-label-icon"></span>`}
|
|
@@ -3276,14 +3276,14 @@ class bs extends(H(T(y))){static get template(){return i`
|
|
|
3276
3276
|
</ul>
|
|
3277
3277
|
</div>
|
|
3278
3278
|
</vaadin-upload>
|
|
3279
|
-
`}renderFiles(){const t=[];for(const e of this._files.values()){let
|
|
3279
|
+
`}renderFiles(){const t=[];for(const e of this._files.values()){let n="icons:hourglass-empty";e.complete?n="icons:check":(e.error||e.aborted)&&(n="icons:error-outline");const i=/.docx/.test(e.name)?e.name+".xml":e.name;let r;r=this.target?`${this.target}/${i}`:i,t.push($`
|
|
3280
3280
|
<li>
|
|
3281
|
-
<iron-icon icon="${
|
|
3281
|
+
<iron-icon icon="${n}"></iron-icon>
|
|
3282
3282
|
${e.error?e.name:$`<a href="${r}">${e.name}</a>`}
|
|
3283
3283
|
</li>
|
|
3284
3284
|
`),e.error&&t.push($`
|
|
3285
3285
|
<li class="error" part="error">${JSON.parse(e.error).description}</li>
|
|
3286
|
-
`)}return t}clearList(){this._files.clear(),this.requestUpdate()}_getCSSProperty(t,e){const
|
|
3286
|
+
`)}return t}clearList(){this._files.clear(),this.requestUpdate()}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}static get styles(){return P`
|
|
3287
3287
|
ul {
|
|
3288
3288
|
list-style: none;
|
|
3289
3289
|
margin: 0;
|
|
@@ -3301,7 +3301,7 @@ class bs extends(H(T(y))){static get template(){return i`
|
|
|
3301
3301
|
#uploadBtn iron-icon {
|
|
3302
3302
|
padding-right: 8px;
|
|
3303
3303
|
}
|
|
3304
|
-
`}}customElements.define("pb-upload",ys),function(){var t={},e={};!function(t,e){function i(t){if("number"==typeof t)return t;var e={};for(var i in t)e[i]=t[i];return e}function n(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=k}function r(){return t.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function o(e,i,r){var o=new n;return i&&(o.fill="both",o.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.getOwnPropertyNames(e).forEach((function(i){if("auto"!=e[i]){if(("number"==typeof o[i]||"duration"==i)&&("number"!=typeof e[i]||isNaN(e[i])))return;if("fill"==i&&-1==w.indexOf(e[i]))return;if("direction"==i&&-1==x.indexOf(e[i]))return;if("playbackRate"==i&&1!==e[i]&&t.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;o[i]=e[i]}})):o.duration=e,o}function a(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t}function s(e,i){return o(e=t.numericTimingToObject(e),i)}function l(t,e,i,n){return t<0||t>1||i<0||i>1?k:function(r){function o(t,e,i){return 3*t*(1-i)*(1-i)*i+3*e*(1-i)*i*i+i*i*i}if(r<=0){var a=0;return t>0?a=e/t:!e&&i>0&&(a=n/i),a*r}if(r>=1){var s=0;return i<1?s=(n-1)/(i-1):1==i&&t<1&&(s=(e-1)/(t-1)),1+s*(r-1)}for(var l=0,c=1;l<c;){var h=(l+c)/2,p=o(t,i,h);if(Math.abs(r-p)<1e-5)return o(e,n,h);p<r?l=h:c=h}return o(e,n,h)}}function c(t,e){return function(i){if(i>=1)return 1;var n=1/t;return(i+=e*n)-i%n}}function h(t){E||(E=document.createElement("div").style),E.animationTimingFunction="",E.animationTimingFunction=t;var e=E.animationTimingFunction;if(""==e&&r())throw new TypeError(t+" is not a valid value for easing");return e}function p(t){if("linear"==t)return k;var e=L.exec(t);if(e)return l.apply(this,e.slice(1).map(Number));var i=H.exec(t);if(i)return c(Number(i[1]),S);var n=T.exec(t);return n?c(Number(n[1]),{start:z,middle:A,end:S}[n[2]]):C[t]||k}function d(t){return Math.abs(u(t)/t.playbackRate)}function u(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}function g(t,e,i){if(null==e)return V;var n=i.delay+t+i.endDelay;return e<Math.min(i.delay,n)?$:e>=Math.min(i.delay+t,n)?O:P}function f(t,e,i,n,r){switch(n){case $:return"backwards"==e||"both"==e?0:null;case P:return i-r;case O:return"forwards"==e||"both"==e?t:null;case V:return null}}function m(t,e,i,n,r){var o=r;return 0===t?e!==$&&(o+=i):o+=n/t,o}function v(t,e,i,n,r,o){var a=t===1/0?e%1:t%1;return 0!==a||i!==O||0===n||0===r&&0!==o||(a=1),a}function b(t,e,i,n){return t===O&&e===1/0?1/0:1===i?Math.floor(n)-1:Math.floor(n)}function y(t,e,i){var n=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?i:1-i}function _(t,e,i){var n=g(t,e,i),r=f(t,i.fill,e,n,i.delay);if(null===r)return null;var o=m(i.duration,n,i.iterations,r,i.iterationStart),a=v(o,i.iterationStart,n,i.iterations,r,i.duration),s=b(n,i.iterations,a,o),l=y(i.direction,s,a);return i._easingFunction(l)}var w="backwards|forwards|both|none".split("|"),x="reverse|alternate|alternate-reverse".split("|"),k=function(t){return t};n.prototype={_setMember:function(e,i){this["_"+e]=i,this._effect&&(this._effect._timingInput[e]=i,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&r())throw new TypeError("iterationStart must be a non-negative number, received: "+t);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&r())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=p(h(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&r())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var z=1,A=.5,S=0,C={ease:l(.25,.1,.25,1),"ease-in":l(.42,0,1,1),"ease-out":l(0,0,.58,1),"ease-in-out":l(.42,0,.58,1),"step-start":c(1,z),"step-middle":c(1,A),"step-end":c(1,S)},E=null,M="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",L=new RegExp("cubic-bezier\\("+M+","+M+","+M+","+M+"\\)"),H=/steps\(\s*(\d+)\s*\)/,T=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,V=0,$=1,O=2,P=3;t.cloneTimingInput=i,t.makeTiming=o,t.numericTimingToObject=a,t.normalizeTimingInput=s,t.calculateActiveDuration=d,t.calculateIterationProgress=_,t.calculatePhase=g,t.normalizeEasing=h,t.parseEasingFunction=p}(t),function(t,e){function i(t,e){return t in h&&h[t][e]||e}function n(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}function r(t,e,r){if(!n(t)){var o=s[t];if(o)for(var a in l.style[t]=e,o){var c=o[a],h=l.style[c];r[c]=i(c,h)}else r[t]=i(t,e)}}function o(t){var e=[];for(var i in t)if(!(i in["easing","offset","composite"])){var n=t[i];Array.isArray(n)||(n=[n]);for(var r,o=n.length,a=0;a<o;a++)(r={}).offset="offset"in t?t.offset:1==o?1:a/(o-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[i]=n[a],e.push(r)}return e.sort((function(t,e){return t.offset-e.offset})),e}function a(e){function i(){var t=n.length;null==n[t-1].offset&&(n[t-1].offset=1),t>1&&null==n[0].offset&&(n[0].offset=0);for(var e=0,i=n[0].offset,r=1;r<t;r++){var o=n[r].offset;if(null!=o){for(var a=1;a<r-e;a++)n[e+a].offset=i+(o-i)*a/(r-e);e=r,i=o}}}if(null==e)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||(e=o(e));for(var n=e.map((function(e){var i={};for(var n in e){var o=e[n];if("offset"==n){if(null!=o){if(o=Number(o),!isFinite(o))throw new TypeError("Keyframe offsets must be numbers.");if(o<0||o>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==n){if("add"==o||"accumulate"==o)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=o)throw new TypeError("Invalid composite mode "+o+".")}else o="easing"==n?t.normalizeEasing(o):""+o;r(n,o,i)}return null==i.offset&&(i.offset=null),null==i.easing&&(i.easing="linear"),i})),a=!0,s=-1/0,l=0;l<n.length;l++){var c=n[l].offset;if(null!=c){if(c<s)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");s=c}else a=!1}return n=n.filter((function(t){return t.offset>=0&&t.offset<=1})),a||i(),n}var s={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},l=document.createElementNS("http://www.w3.org/1999/xhtml","div"),c={thin:"1px",medium:"3px",thick:"5px"},h={borderBottomWidth:c,borderLeftWidth:c,borderRightWidth:c,borderTopWidth:c,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:c,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};t.convertToArrayForm=o,t.normalizeKeyframes=a}(t),function(t){var e={};t.isDeprecated=function(t,i,n,r){var o=r?"are":"is",a=new Date,s=new Date(i);return s.setMonth(s.getMonth()+3),!(a<s&&(t in e||console.warn("Web Animations: "+t+" "+o+" deprecated and will stop working on "+s.toDateString()+". "+n),e[t]=!0,1))},t.deprecated=function(e,i,n,r){var o=r?"are":"is";if(t.isDeprecated(e,i,n,r))throw new Error(e+" "+o+" no longer supported. "+n)}}(t),function(){if(document.documentElement.animate){var i=document.documentElement.animate([],0),n=!0;if(i&&(n=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach((function(t){void 0===i[t]&&(n=!0)}))),!n)return}!function(t,e,i){function n(t){for(var e={},i=0;i<t.length;i++)for(var n in t[i])if("offset"!=n&&"easing"!=n&&"composite"!=n){var r={offset:t[i].offset,easing:t[i].easing,value:t[i][n]};e[n]=e[n]||[],e[n].push(r)}for(var o in e){var a=e[o];if(0!=a[0].offset||1!=a[a.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return e}function r(i){var n=[];for(var r in i)for(var o=i[r],a=0;a<o.length-1;a++){var s=a,l=a+1,c=o[s].offset,h=o[l].offset,p=c,d=h;0==a&&(p=-1/0,0==h&&(l=s)),a==o.length-2&&(d=1/0,1==c&&(s=l)),n.push({applyFrom:p,applyTo:d,startOffset:o[s].offset,endOffset:o[l].offset,easingFunction:t.parseEasingFunction(o[s].easing),property:r,interpolation:e.propertyInterpolation(r,o[s].value,o[l].value)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}e.convertEffectInput=function(i){var o=n(t.normalizeKeyframes(i)),a=r(o);return function(t,i){if(null!=i)a.filter((function(t){return i>=t.applyFrom&&i<t.applyTo})).forEach((function(n){var r=i-n.startOffset,o=n.endOffset-n.startOffset,a=0==o?0:n.easingFunction(r/o);e.apply(t,n.property,n.interpolation(a))}));else for(var n in o)"offset"!=n&&"easing"!=n&&"composite"!=n&&e.clear(t,n)}}}(t,e),function(t,e,i){function n(t){return t.replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function r(t,e,i){s[i]=s[i]||[],s[i].push([t,e])}function o(t,e,i){for(var o=0;o<i.length;o++)r(t,e,n(i[o]))}function a(i,r,o){var a=i;/-/.test(i)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(a=n(i)),"initial"!=r&&"initial"!=o||("initial"==r&&(r=l[a]),"initial"==o&&(o=l[a]));for(var c=r==o?[]:s[a],h=0;c&&h<c.length;h++){var p=c[h][0](r),d=c[h][0](o);if(void 0!==p&&void 0!==d){var u=c[h][1](p,d);if(u){var g=e.Interpolation.apply(null,u);return function(t){return 0==t?r:1==t?o:g(t)}}}}return e.Interpolation(!1,!0,(function(t){return t?o:r}))}var s={};e.addPropertiesHandler=o;var l={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};e.propertyInterpolation=a}(t,e),function(t,e,i){function n(e){var i=t.calculateActiveDuration(e),n=function(n){return t.calculateIterationProgress(i,n,e)};return n._totalDuration=e.delay+i+e.endDelay,n}e.KeyframeEffect=function(i,r,o,a){var s,l=n(t.normalizeTimingInput(o)),c=e.convertEffectInput(r),h=function(){c(i,s)};return h._update=function(t){return null!==(s=l(t))},h._clear=function(){c(i,null)},h._hasSameTarget=function(t){return i===t},h._target=i,h._totalDuration=l._totalDuration,h._id=a,h}}(t,e),function(t,e){function i(t,e){return!(!e.namespaceURI||-1==e.namespaceURI.indexOf("/svg"))&&(a in t||(t[a]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(t.navigator.userAgent)),t[a])}function n(t,e,i){i.enumerable=!0,i.configurable=!0,Object.defineProperty(t,e,i)}function r(t){this._element=t,this._surrogateStyle=document.createElementNS("http://www.w3.org/1999/xhtml","div").style,this._style=t.style,this._length=0,this._isAnimatedProperty={},this._updateSvgTransformAttr=i(window,t),this._savedTransformAttr=null;for(var e=0;e<this._style.length;e++){var n=this._style[e];this._surrogateStyle[n]=this._style[n]}this._updateIndices()}function o(t){if(!t._webAnimationsPatchedStyle){var e=new r(t);try{n(t,"style",{get:function(){return e}})}catch(e){t.style._set=function(e,i){t.style[e]=i},t.style._clear=function(e){t.style[e]=""}}t._webAnimationsPatchedStyle=t.style}}var a="_webAnimationsUpdateSvgTransformAttr",s={cssText:1,length:1,parentRule:1},l={getPropertyCSSValue:1,getPropertyPriority:1,getPropertyValue:1,item:1,removeProperty:1,setProperty:1},c={removeProperty:1,setProperty:1};for(var h in r.prototype={get cssText(){return this._surrogateStyle.cssText},set cssText(t){for(var e={},i=0;i<this._surrogateStyle.length;i++)e[this._surrogateStyle[i]]=!0;this._surrogateStyle.cssText=t,this._updateIndices();for(i=0;i<this._surrogateStyle.length;i++)e[this._surrogateStyle[i]]=!0;for(var n in e)this._isAnimatedProperty[n]||this._style.setProperty(n,this._surrogateStyle.getPropertyValue(n))},get length(){return this._surrogateStyle.length},get parentRule(){return this._style.parentRule},_updateIndices:function(){for(;this._length<this._surrogateStyle.length;)Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,get:function(t){return function(){return this._surrogateStyle[t]}}(this._length)}),this._length++;for(;this._length>this._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(e,i){this._style[e]=i,this._isAnimatedProperty[e]=!0,this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",t.transformToSvgMatrix(i)))},_clear:function(e){this._style[e]=this._surrogateStyle[e],this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[e]}},l)r.prototype[h]=function(t,e){return function(){var i=this._surrogateStyle[t].apply(this._surrogateStyle,arguments);return e&&(this._isAnimatedProperty[arguments[0]]||this._style[t].apply(this._style,arguments),this._updateIndices()),i}}(h,h in c);for(var p in document.documentElement.style)p in s||p in l||function(t){n(r.prototype,t,{get:function(){return this._surrogateStyle[t]},set:function(e){this._surrogateStyle[t]=e,this._updateIndices(),this._isAnimatedProperty[t]||(this._style[t]=e)}})}(p);t.apply=function(e,i,n){o(e),e.style._set(t.propertyName(i),n)},t.clear=function(e,i){e._webAnimationsPatchedStyle&&e.style._clear(t.propertyName(i))}}(e),function(t){window.Element.prototype.animate=function(e,i){var n="";return i&&i.id&&(n=i.id),t.timeline._play(t.KeyframeEffect(this,e,i,n))}}(e),function(t,e){function i(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e)return n<.5?t:e;if(t.length==e.length){for(var r=[],o=0;o<t.length;o++)r.push(i(t[o],e[o],n));return r}throw"Mismatched interpolation arguments "+t+":"+e}t.Interpolation=function(t,e,n){return function(r){return n(i(t,e,r))}}}(e),function(t,e){function i(t,e,i){return Math.max(Math.min(t,i),e)}function n(e,n,r){var o=t.dot(e,n),a=[];if(1===(o=i(o,-1,1)))a=e;else for(var s=Math.acos(o),l=1*Math.sin(r*s)/Math.sqrt(1-o*o),c=0;c<4;c++)a.push(e[c]*(Math.cos(r*s)-o*l)+n[c]*l);return a}var r=function(){function t(t,e){for(var i=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],n=0;n<4;n++)for(var r=0;r<4;r++)for(var o=0;o<4;o++)i[n][r]+=e[n][o]*t[o][r];return i}function e(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}function i(i,n,r,o,a){for(var s=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],l=0;l<4;l++)s[l][3]=a[l];for(l=0;l<3;l++)for(var c=0;c<3;c++)s[3][l]+=i[c]*s[c][l];var h=o[0],p=o[1],d=o[2],u=o[3],g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];g[0][0]=1-2*(p*p+d*d),g[0][1]=2*(h*p-d*u),g[0][2]=2*(h*d+p*u),g[1][0]=2*(h*p+d*u),g[1][1]=1-2*(h*h+d*d),g[1][2]=2*(p*d-h*u),g[2][0]=2*(h*d-p*u),g[2][1]=2*(p*d+h*u),g[2][2]=1-2*(h*h+p*p),s=t(s,g);var f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(f[2][1]=r[2],s=t(s,f)),r[1]&&(f[2][1]=0,f[2][0]=r[0],s=t(s,f)),r[0]&&(f[2][0]=0,f[1][0]=r[0],s=t(s,f));for(l=0;l<3;l++)for(c=0;c<3;c++)s[l][c]*=n[l];return e(s)?[s[0][0],s[0][1],s[1][0],s[1][1],s[3][0],s[3][1]]:s[0].concat(s[1],s[2],s[3])}return i}();t.composeMatrix=r,t.quat=n}(e),function(t,e,i){t.sequenceNumber=0;var n=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};e.Animation=function(e){this.id="",e&&e._id&&(this.id=e._id),this._sequenceNumber=t.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=e,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},e.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,e.timeline._animations.push(this))},_tickCurrentTime:function(t,e){t!=this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var i=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=i&&(this.currentTime=i)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var i=this._finishHandlers.indexOf(e);i>=0&&this._finishHandlers.splice(i,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new n(this,this._currentTime,t),i=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){i.forEach((function(t){t.call(e.target,e)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(t,e),function(t,e,i){function n(t){var e=c;c=[],t<f.currentTime&&(t=f.currentTime),f._animations.sort(r),f._animations=s(t,!0,f._animations)[0],e.forEach((function(e){e[1](t)})),a(),void 0}function r(t,e){return t._sequenceNumber-e._sequenceNumber}function o(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function a(){u.forEach((function(t){t()})),u.length=0}function s(t,i,n){g=!0,d=!1,e.timeline.currentTime=t,p=!1;var r=[],o=[],a=[],s=[];return n.forEach((function(e){e._tick(t,i),e._inEffect?(o.push(e._effect),e._markTarget()):(r.push(e._effect),e._unmarkTarget()),e._needsTick&&(p=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?a.push(e):s.push(e)})),u.push.apply(u,r),u.push.apply(u,o),p&&requestAnimationFrame((function(){})),g=!1,[a,s]}var l=window.requestAnimationFrame,c=[],h=0;window.requestAnimationFrame=function(t){var e=h++;return 0==c.length&&l(n),c.push([e,t]),e},window.cancelAnimationFrame=function(t){c.forEach((function(e){e[0]==t&&(e[1]=function(){})}))},o.prototype={_play:function(i){i._timing=t.normalizeTimingInput(i.timing);var n=new e.Animation(i);return n._idle=!1,n._timeline=this,this._animations.push(n),e.restart(),e.applyDirtiedAnimation(n),n}};var p=!1,d=!1;e.restart=function(){return p||(p=!0,requestAnimationFrame((function(){})),d=!0),d},e.applyDirtiedAnimation=function(t){if(!g){t._markTarget();var i=t._targetAnimations();i.sort(r),s(e.timeline.currentTime,!1,i.slice())[1].forEach((function(t){var e=f._animations.indexOf(t);-1!==e&&f._animations.splice(e,1)})),a()}};var u=[],g=!1,f=new o;e.timeline=f}(t,e),function(t,e){function i(t,e){for(var i=0,n=0;n<t.length;n++)i+=t[n]*e[n];return i}function n(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function r(t){var e=t.rad||0;return((t.deg||0)/360+(t.grad||0)/400+(t.turn||0))*(2*Math.PI)+e}function o(t){switch(t.t){case"rotatex":var e=r(t.d[0]);return[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1];case"rotatey":e=r(t.d[0]);return[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1];case"rotate":case"rotatez":e=r(t.d[0]);return[Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var i=t.d[0],n=t.d[1],o=t.d[2],a=(e=r(t.d[3]),i*i+n*n+o*o);if(0===a)i=1,n=0,o=0;else if(1!==a){var s=Math.sqrt(a);i/=s,n/=s,o/=s}var l=Math.sin(e/2),c=l*Math.cos(e/2),h=l*l;return[1-2*(n*n+o*o)*h,2*(i*n*h+o*c),2*(i*o*h-n*c),0,2*(i*n*h-o*c),1-2*(i*i+o*o)*h,2*(n*o*h+i*c),0,2*(i*o*h+n*c),2*(n*o*h-i*c),1-2*(i*i+n*n)*h,0,0,0,0,1];case"scale":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0],0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0],0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0],0,0,0,0,1];case"scale3d":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,t.d[2],0,0,0,0,1];case"skew":var p=r(t.d[0]),d=r(t.d[1]);return[1,Math.tan(d),0,0,Math.tan(p),1,0,0,0,0,1,0,0,0,0,1];case"skewx":e=r(t.d[0]);return[1,0,0,0,Math.tan(e),1,0,0,0,0,1,0,0,0,0,1];case"skewy":e=r(t.d[0]);return[1,Math.tan(e),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,i=t.d[0].px||0,n=t.d[1].px||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,i=t.d[0].px||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=t.d[0].px||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,o=t.d[0].px||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,i=t.d[0].px||0,n=t.d[1].px||0,o=t.d[2].px||0,1];case"perspective":return[1,0,0,0,0,1,0,0,0,0,1,t.d[0].px?-1/t.d[0].px:0,0,0,0,1];case"matrix":return[t.d[0],t.d[1],0,0,t.d[2],t.d[3],0,0,0,0,1,0,t.d[4],t.d[5],0,1];case"matrix3d":return t.d}}function a(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(o).reduce(n)}function s(t){return[l(a(t))]}var l=function(){function t(t){return t[0][0]*t[1][1]*t[2][2]+t[1][0]*t[2][1]*t[0][2]+t[2][0]*t[0][1]*t[1][2]-t[0][2]*t[1][1]*t[2][0]-t[1][2]*t[2][1]*t[0][0]-t[2][2]*t[0][1]*t[1][0]}function e(e){for(var i=1/t(e),n=e[0][0],r=e[0][1],o=e[0][2],a=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],h=e[2][1],p=e[2][2],d=[[(s*p-l*h)*i,(o*h-r*p)*i,(r*l-o*s)*i,0],[(l*c-a*p)*i,(n*p-o*c)*i,(o*a-n*l)*i,0],[(a*h-s*c)*i,(c*r-n*h)*i,(n*s-r*a)*i,0]],u=[],g=0;g<3;g++){for(var f=0,m=0;m<3;m++)f+=e[3][m]*d[m][g];u.push(f)}return u.push(1),d.push(u),d}function n(t){return[[t[0][0],t[1][0],t[2][0],t[3][0]],[t[0][1],t[1][1],t[2][1],t[3][1]],[t[0][2],t[1][2],t[2][2],t[3][2]],[t[0][3],t[1][3],t[2][3],t[3][3]]]}function r(t,e){for(var i=[],n=0;n<4;n++){for(var r=0,o=0;o<4;o++)r+=t[o]*e[o][n];i.push(r)}return i}function o(t){var e=a(t);return[t[0]/e,t[1]/e,t[2]/e]}function a(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function s(t,e,i,n){return[i*t[0]+n*e[0],i*t[1]+n*e[1],i*t[2]+n*e[2]]}function l(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function c(c){var h=[c.slice(0,4),c.slice(4,8),c.slice(8,12),c.slice(12,16)];if(1!==h[3][3])return null;for(var p=[],d=0;d<4;d++)p.push(h[d].slice());for(d=0;d<3;d++)p[d][3]=0;if(0===t(p))return null;var u,g=[];h[0][3]||h[1][3]||h[2][3]?(g.push(h[0][3]),g.push(h[1][3]),g.push(h[2][3]),g.push(h[3][3]),u=r(g,n(e(p)))):u=[0,0,0,1];var f=h[3].slice(0,3),m=[];m.push(h[0].slice(0,3));var v=[];v.push(a(m[0])),m[0]=o(m[0]);var b=[];m.push(h[1].slice(0,3)),b.push(i(m[0],m[1])),m[1]=s(m[1],m[0],1,-b[0]),v.push(a(m[1])),m[1]=o(m[1]),b[0]/=v[1],m.push(h[2].slice(0,3)),b.push(i(m[0],m[2])),m[2]=s(m[2],m[0],1,-b[1]),b.push(i(m[1],m[2])),m[2]=s(m[2],m[1],1,-b[2]),v.push(a(m[2])),m[2]=o(m[2]),b[1]/=v[2],b[2]/=v[2];var y=l(m[1],m[2]);if(i(m[0],y)<0)for(d=0;d<3;d++)v[d]*=-1,m[d][0]*=-1,m[d][1]*=-1,m[d][2]*=-1;var _,w,x=m[0][0]+m[1][1]+m[2][2]+1;return x>1e-4?(_=.5/Math.sqrt(x),w=[(m[2][1]-m[1][2])*_,(m[0][2]-m[2][0])*_,(m[1][0]-m[0][1])*_,.25/_]):m[0][0]>m[1][1]&&m[0][0]>m[2][2]?w=[.25*(_=2*Math.sqrt(1+m[0][0]-m[1][1]-m[2][2])),(m[0][1]+m[1][0])/_,(m[0][2]+m[2][0])/_,(m[2][1]-m[1][2])/_]:m[1][1]>m[2][2]?(_=2*Math.sqrt(1+m[1][1]-m[0][0]-m[2][2]),w=[(m[0][1]+m[1][0])/_,.25*_,(m[1][2]+m[2][1])/_,(m[0][2]-m[2][0])/_]):(_=2*Math.sqrt(1+m[2][2]-m[0][0]-m[1][1]),w=[(m[0][2]+m[2][0])/_,(m[1][2]+m[2][1])/_,.25*_,(m[1][0]-m[0][1])/_]),[f,v,b,w,u]}return c}();t.dot=i,t.makeMatrixDecomposition=s,t.transformListToMatrix=a}(e),function(t){function e(t,e){var i=t.exec(e);if(i)return[i=t.ignoreCase?i[0].toLowerCase():i[0],e.substr(i.length)]}function i(t,e){var i=t(e=e.replace(/^\s*/,""));if(i)return[i[0],i[1].replace(/^\s*/,"")]}function n(t,n,r){t=i.bind(null,t);for(var o=[];;){var a=t(r);if(!a)return[o,r];if(o.push(a[0]),!(a=e(n,r=a[1]))||""==a[1])return[o,r];r=a[1]}}function r(t,e){for(var i=0,n=0;n<e.length&&(!/\s|,/.test(e[n])||0!=i);n++)if("("==e[n])i++;else if(")"==e[n]&&(0==--i&&n++,i<=0))break;var r=t(e.substr(0,n));return null==r?void 0:[r,e.substr(n)]}function o(t,e){for(var i=t,n=e;i&&n;)i>n?i%=n:n%=i;return t*e/(i+n)}function a(t){return function(e){var i=t(e);return i&&(i[0]=void 0),i}}function s(t,e){return function(i){return t(i)||[e,i]}}function l(e,i){for(var n=[],r=0;r<e.length;r++){var o=t.consumeTrimmed(e[r],i);if(!o||""==o[0])return;void 0!==o[0]&&n.push(o[0]),i=o[1]}if(""==i)return n}function c(t,e,i,n,r){for(var a=[],s=[],l=[],c=o(n.length,r.length),h=0;h<c;h++){var p=e(n[h%n.length],r[h%r.length]);if(!p)return;a.push(p[0]),s.push(p[1]),l.push(p[2])}return[a,s,function(e){var n=e.map((function(t,e){return l[e](t)})).join(i);return t?t(n):n}]}function h(t,e,i){for(var n=[],r=[],o=[],a=0,s=0;s<i.length;s++)if("function"==typeof i[s]){var l=i[s](t[a],e[a++]);n.push(l[0]),r.push(l[1]),o.push(l[2])}else!function(t){n.push(!1),r.push(!1),o.push((function(){return i[t]}))}(s);return[n,r,function(t){for(var e="",i=0;i<t.length;i++)e+=o[i](t[i]);return e}]}t.consumeToken=e,t.consumeTrimmed=i,t.consumeRepeated=n,t.consumeParenthesised=r,t.ignore=a,t.optional=s,t.consumeList=l,t.mergeNestedRepeated=c.bind(null,null),t.mergeWrappedNestedRepeated=c,t.mergeList=h}(e),function(t){function e(e){function i(e){var i=t.consumeToken(/^inset/i,e);return i?(n.inset=!0,i):(i=t.consumeLengthOrPercent(e))?(n.lengths.push(i[0]),i):(i=t.consumeColor(e))?(n.color=i[0],i):void 0}var n={inset:!1,lengths:[],color:null},r=t.consumeRepeated(i,/^/,e);if(r&&r[0].length)return[n,r[1]]}function i(i){var n=t.consumeRepeated(e,/^,/,i);if(n&&""==n[1])return n[0]}function n(e,i){for(;e.lengths.length<Math.max(e.lengths.length,i.lengths.length);)e.lengths.push({px:0});for(;i.lengths.length<Math.max(e.lengths.length,i.lengths.length);)i.lengths.push({px:0});if(e.inset==i.inset&&!!e.color==!!i.color){for(var n,r=[],o=[[],0],a=[[],0],s=0;s<e.lengths.length;s++){var l=t.mergeDimensions(e.lengths[s],i.lengths[s],2==s);o[0].push(l[0]),a[0].push(l[1]),r.push(l[2])}if(e.color&&i.color){var c=t.mergeColors(e.color,i.color);o[1]=c[0],a[1]=c[1],n=c[2]}return[o,a,function(t){for(var i=e.inset?"inset ":" ",o=0;o<r.length;o++)i+=r[o](t[0][o])+" ";return n&&(i+=n(t[1])),i}]}}function r(e,i,n,r){function o(t){return{inset:t,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var a=[],s=[],l=0;l<n.length||l<r.length;l++){var c=n[l]||o(r[l].inset),h=r[l]||o(n[l].inset);a.push(c),s.push(h)}return t.mergeNestedRepeated(e,i,a,s)}var o=r.bind(null,n,", ");t.addPropertiesHandler(i,o,["box-shadow","text-shadow"])}(e),function(t,e){function i(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function n(t,e,i){return Math.min(e,Math.max(t,i))}function r(t){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t))return Number(t)}function o(t,e){return[t,e,i]}function a(t,e){if(0!=t)return l(0,1/0)(t,e)}function s(t,e){return[t,e,function(t){return Math.round(n(1,1/0,t))}]}function l(t,e){return function(r,o){return[r,o,function(r){return i(n(t,e,r))}]}}function c(t){var e=t.trim().split(/\s*[\s,]\s*/);if(0!==e.length){for(var i=[],n=0;n<e.length;n++){var o=r(e[n]);if(void 0===o)return;i.push(o)}return i}}function h(t,e){if(t.length==e.length)return[t,e,function(t){return t.map(i).join(" ")}]}function p(t,e){return[t,e,Math.round]}t.clamp=n,t.addPropertiesHandler(c,h,["stroke-dasharray"]),t.addPropertiesHandler(r,l(0,1/0),["border-image-width","line-height"]),t.addPropertiesHandler(r,l(0,1),["opacity","shape-image-threshold"]),t.addPropertiesHandler(r,a,["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,s,["orphans","widows"]),t.addPropertiesHandler(r,p,["z-index"]),t.parseNumber=r,t.parseNumberList=c,t.mergeNumbers=o,t.numberToString=i}(e),function(t,e){function i(t,e){if("visible"==t||"visible"==e)return[0,1,function(i){return i<=0?t:i>=1?e:"visible"}]}t.addPropertiesHandler(String,i,["visibility"])}(e),function(t,e){function i(t){t=t.trim(),o.fillStyle="#000",o.fillStyle=t;var e=o.fillStyle;if(o.fillStyle="#fff",o.fillStyle=t,e==o.fillStyle){o.fillRect(0,0,1,1);var i=o.getImageData(0,0,1,1).data;o.clearRect(0,0,1,1);var n=i[3]/255;return[i[0]*n,i[1]*n,i[2]*n,n]}}function n(e,i){return[e,i,function(e){function i(t){return Math.max(0,Math.min(255,t))}if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(i(e[n]/e[3]));return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=r.height=1;var o=r.getContext("2d");t.addPropertiesHandler(i,n,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,i),t.mergeColors=n}(e),function(t,e){function i(t){function e(){var e=s.exec(t);a=e?e[0]:void 0}function i(){var t=Number(a);return e(),t}function n(){if("("!==a)return i();e();var t=o();return")"!==a?NaN:(e(),t)}function r(){for(var t=n();"*"===a||"/"===a;){var i=a;e();var r=n();"*"===i?t*=r:t/=r}return t}function o(){for(var t=r();"+"===a||"-"===a;){var i=a;e();var n=r();"+"===i?t+=n:t-=n}return t}var a,s=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),o()}function n(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){e=e.replace(/calc\(/g,"(");var n={};e=e.replace(t,(function(t){return n[t]=null,"U"+t}));for(var r="U("+t.source+")",o=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+r,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),a=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s<a.length;)a[s].test(o)?(o=o.replace(a[s],"$1"),s=0):s++;if("D"==o){for(var l in n){var c=i(e.replace(new RegExp("U"+l,"g"),"").replace(new RegExp(r,"g"),"*0"));if(!isFinite(c))return;n[l]=c}return n}}}function r(t,e){return o(t,e,!0)}function o(e,i,n){var r,o=[];for(r in e)o.push(r);for(r in i)o.indexOf(r)<0&&o.push(r);return e=o.map((function(t){return e[t]||0})),i=o.map((function(t){return i[t]||0})),[e,i,function(e){var i=e.map((function(i,r){return 1==e.length&&n&&(i=Math.max(i,0)),t.numberToString(i)+o[r]})).join(" + ");return e.length>1?"calc("+i+")":i}]}var a="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=n.bind(null,new RegExp(a,"g")),l=n.bind(null,new RegExp(a+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=l,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,l),t.parseAngle=c,t.mergeDimensions=o;var h=t.consumeParenthesised.bind(null,s),p=t.consumeRepeated.bind(void 0,h,/^/),d=t.consumeRepeated.bind(void 0,p,/^,/);t.consumeSizePairList=d;var u=function(t){var e=d(t);if(e&&""==e[1])return e[0]},g=t.mergeNestedRepeated.bind(void 0,r," "),f=t.mergeNestedRepeated.bind(void 0,g,",");t.mergeNonNegativeSizePair=g,t.addPropertiesHandler(u,f,["background-size"]),t.addPropertiesHandler(l,r,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(l,o,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(e),function(t,e){function i(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function n(e){var n=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,i,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(n&&4==n[0].length)return n[0]}function r(e,i){return"auto"==e||"auto"==i?[!0,!1,function(n){var r=n?e:i;if("auto"==r)return"auto";var o=t.mergeDimensions(r,r);return o[2](o[0])}]:t.mergeDimensions(e,i)}function o(t){return"rect("+t+")"}var a=t.mergeWrappedNestedRepeated.bind(null,o,r,", ");t.parseBox=n,t.mergeBoxes=a,t.addPropertiesHandler(n,a,["clip"])}(e),function(t,e){function i(t){return function(e){var i=0;return t.map((function(t){return t===h?e[i++]:t}))}}function n(t){return t}function r(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var i,n=/\s*(\w+)\(([^)]*)\)/g,r=[],o=0;i=n.exec(e);){if(i.index!=o)return;o=i.index+i[0].length;var a=i[1],s=u[a];if(!s)return;var l=i[2].split(","),c=s[0];if(c.length<l.length)return;for(var h=[],g=0;g<c.length;g++){var f,m=l[g],v=c[g];if(void 0===(f=m?{A:function(e){return"0"==e.trim()?d:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[v.toUpperCase()](m):{a:d,n:h[0],t:p}[v]))return;h.push(f)}if(r.push({t:a,d:h}),n.lastIndex==e.length)return r}}function o(t){return t.toFixed(6).replace(".000000","")}function a(e,i){if(e.decompositionPair!==i){e.decompositionPair=i;var n=t.makeMatrixDecomposition(e)}if(i.decompositionPair!==e){i.decompositionPair=e;var r=t.makeMatrixDecomposition(i)}return null==n[0]||null==r[0]?[[!1],[!0],function(t){return t?i[0].d:e[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(e){var i=t.quat(n[0][3],r[0][3],e[5]);return t.composeMatrix(e[0],e[1],e[2],i,e[4]).map(o).join(",")}])}function s(t){return t.replace(/[xy]/,"")}function l(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function c(e,i){var n=t.makeMatrixDecomposition&&!0,r=!1;if(!e.length||!i.length){e.length||(r=!0,e=i,i=[]);for(var o=0;o<e.length;o++){var c=e[o].t,h=e[o].d,p="scale"==c.substr(0,5)?1:0;i.push({t:c,d:h.map((function(t){if("number"==typeof t)return p;var e={};for(var i in t)e[i]=p;return e}))})}}var d=function(t,e){return"perspective"==t&&"perspective"==e||("matrix"==t||"matrix3d"==t)&&("matrix"==e||"matrix3d"==e)},g=[],f=[],m=[];if(e.length!=i.length){if(!n)return;g=[(k=a(e,i))[0]],f=[k[1]],m=[["matrix",[k[2]]]]}else for(o=0;o<e.length;o++){var v=e[o].t,b=i[o].t,y=e[o].d,_=i[o].d,w=u[v],x=u[b];if(d(v,b)){if(!n)return;var k=a([e[o]],[i[o]]);g.push(k[0]),f.push(k[1]),m.push(["matrix",[k[2]]])}else{if(v==b)c=v;else if(w[2]&&x[2]&&s(v)==s(b))c=s(v),y=w[2](y),_=x[2](_);else{if(!w[1]||!x[1]||l(v)!=l(b)){if(!n)return;g=[(k=a(e,i))[0]],f=[k[1]],m=[["matrix",[k[2]]]];break}c=l(v),y=w[1](y),_=x[1](_)}for(var z=[],A=[],S=[],C=0;C<y.length;C++){k=("number"==typeof y[C]?t.mergeNumbers:t.mergeDimensions)(y[C],_[C]);z[C]=k[0],A[C]=k[1],S.push(k[2])}g.push(z),f.push(A),m.push([c,S])}}if(r){var E=g;g=f,f=E}return[g,f,function(t){return t.map((function(t,e){var i=t.map((function(t,i){return m[e][1][i](t)})).join(",");return"matrix"==m[e][0]&&16==i.split(",").length&&(m[e][0]="matrix3d"),m[e][0]+"("+i+")"})).join(" ")}]}var h=null,p={px:0},d={deg:0},u={matrix:["NNNNNN",[h,h,0,0,h,h,0,0,0,0,1,0,h,h,0,1],n],matrix3d:["NNNNNNNNNNNNNNNN",n],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",i([h,h,1]),n],scalex:["N",i([h,1,1]),i([h,1])],scaley:["N",i([1,h,1]),i([1,h])],scalez:["N",i([1,1,h])],scale3d:["NNN",n],skew:["Aa",null,n],skewx:["A",null,i([h,d])],skewy:["A",null,i([d,h])],translate:["Tt",i([h,h,p]),n],translatex:["T",i([h,p,p]),i([h,p])],translatey:["T",i([p,h,p]),i([p,h])],translatez:["L",i([p,p,h])],translate3d:["TTL",n]};t.addPropertiesHandler(r,c,["transform"]),t.transformToSvgMatrix=function(e){var i=t.transformListToMatrix(r(e));return"matrix("+o(i[0])+" "+o(i[1])+" "+o(i[4])+" "+o(i[5])+" "+o(i[12])+" "+o(i[13])+")"}}(e),function(t){function e(t){var e=Number(t);if(!(isNaN(e)||e<100||e>900||e%100!=0))return e}function i(e){return e=100*Math.round(e/100),400===(e=t.clamp(100,900,e))?"normal":700===e?"bold":String(e)}function n(t,e){return[t,e,i]}t.addPropertiesHandler(e,n,["font-weight"])}(e),function(t){function e(t){var e={};for(var i in t)e[i]=-t[i];return e}function i(e){return t.consumeToken(/^(left|center|right|top|bottom)\b/i,e)||t.consumeLengthOrPercent(e)}function n(e,n){var r=t.consumeRepeated(i,/^/,n);if(r&&""==r[1]){var o=r[0];if(o[0]=o[0]||"center",o[1]=o[1]||"center",3==e&&(o[2]=o[2]||{px:0}),o.length==e){if(/top|bottom/.test(o[0])||/left|right/.test(o[1])){var s=o[0];o[0]=o[1],o[1]=s}if(/left|right|center|Object/.test(o[0])&&/top|bottom|center|Object/.test(o[1]))return o.map((function(t){return"object"==typeof t?t:a[t]}))}}}function r(n){var r=t.consumeRepeated(i,/^/,n);if(r){for(var o=r[0],s=[{"%":50},{"%":50}],l=0,c=!1,h=0;h<o.length;h++){var p=o[h];"string"==typeof p?(c=/bottom|right/.test(p),s[l={left:0,right:0,center:l,top:1,bottom:1}[p]]=a[p],"center"==p&&l++):(c&&((p=e(p))["%"]=(p["%"]||0)+100),s[l]=p,l++,c=!1)}return[s,r[1]]}}function o(e){var i=t.consumeRepeated(r,/^,/,e);if(i&&""==i[1])return i[0]}var a={left:{"%":0},center:{"%":50},right:{"%":100},top:{"%":0},bottom:{"%":100}},s=t.mergeNestedRepeated.bind(null,t.mergeDimensions," ");t.addPropertiesHandler(n.bind(null,3),s,["transform-origin"]),t.addPropertiesHandler(n.bind(null,2),s,["perspective-origin"]),t.consumePosition=r,t.mergeOffsetList=s;var l=t.mergeNestedRepeated.bind(null,s,", ");t.addPropertiesHandler(o,l,["background-position","object-position"])}(e),function(t){function e(e){var i=t.consumeToken(/^circle/,e);if(i&&i[0])return["circle"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),n,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],i[1]));var o=t.consumeToken(/^ellipse/,e);if(o&&o[0])return["ellipse"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),r,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],o[1]));var a=t.consumeToken(/^polygon/,e);return a&&a[0]?["polygon"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),t.optional(t.consumeToken.bind(void 0,/^nonzero\s*,|^evenodd\s*,/),"nonzero,"),t.consumeSizePairList,t.ignore(t.consumeToken.bind(void 0,/^\)/))],a[1])):void 0}function i(e,i){if(e[0]===i[0])return"circle"==e[0]?t.mergeList(e.slice(1),i.slice(1),["circle(",t.mergeDimensions," at ",t.mergeOffsetList,")"]):"ellipse"==e[0]?t.mergeList(e.slice(1),i.slice(1),["ellipse(",t.mergeNonNegativeSizePair," at ",t.mergeOffsetList,")"]):"polygon"==e[0]&&e[1]==i[1]?t.mergeList(e.slice(2),i.slice(2),["polygon(",e[1],a,")"]):void 0}var n=t.consumeParenthesised.bind(null,t.parseLengthOrPercent),r=t.consumeRepeated.bind(void 0,n,/^/),o=t.mergeNestedRepeated.bind(void 0,t.mergeDimensions," "),a=t.mergeNestedRepeated.bind(void 0,o,",");t.addPropertiesHandler(e,i,["shape-outside"])}(e),function(t,e){function i(t,e){e.concat([t]).forEach((function(e){e in document.documentElement.style&&(n[t]=e),r[e]=t}))}var n={},r={};i("transform",["webkitTransform","msTransform"]),i("transformOrigin",["webkitTransformOrigin"]),i("perspective",["webkitPerspective"]),i("perspectiveOrigin",["webkitPerspectiveOrigin"]),t.propertyName=function(t){return n[t]||t},t.unprefixedPropertyName=function(t){return r[t]||t}}(e)}(),function(){if(void 0===document.createElement("div").animate([]).oncancel){if(window.performance&&performance.now)var t=function(){return performance.now()};else t=function(){return Date.now()};var e=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},i=window.Element.prototype.animate;window.Element.prototype.animate=function(n,r){var o=i.call(this,n,r);o._cancelHandlers=[],o.oncancel=null;var a=o.cancel;o.cancel=function(){a.call(this);var i=new e(this,null,t()),n=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout((function(){n.forEach((function(t){t.call(i.target,i)}))}),0)};var s=o.addEventListener;o.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):s.call(this,t,e)};var l=o.removeEventListener;return o.removeEventListener=function(t,e){if("cancel"==t){var i=this._cancelHandlers.indexOf(e);i>=0&&this._cancelHandlers.splice(i,1)}else l.call(this,t,e)},o}}}(),function(t){var e=document.documentElement,i=null,n=!1;try{var r="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(i=e.animate({opacity:[r,r]},{duration:1})).currentTime=0,n=getComputedStyle(e).getPropertyValue("opacity")==r}catch(t){}finally{i&&i.cancel()}if(!n){var o=window.Element.prototype.animate;window.Element.prototype.animate=function(e,i){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),o.call(this,e,i)}}}(t)}(),
|
|
3304
|
+
`}}customElements.define("pb-upload",ys),function(){var t={},e={};!function(t,e){function n(t){if("number"==typeof t)return t;var e={};for(var n in t)e[n]=t[n];return e}function i(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=k}function r(){return t.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function o(e,n,r){var o=new i;return n&&(o.fill="both",o.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.getOwnPropertyNames(e).forEach((function(n){if("auto"!=e[n]){if(("number"==typeof o[n]||"duration"==n)&&("number"!=typeof e[n]||isNaN(e[n])))return;if("fill"==n&&-1==w.indexOf(e[n]))return;if("direction"==n&&-1==x.indexOf(e[n]))return;if("playbackRate"==n&&1!==e[n]&&t.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;o[n]=e[n]}})):o.duration=e,o}function a(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t}function s(e,n){return o(e=t.numericTimingToObject(e),n)}function l(t,e,n,i){return t<0||t>1||n<0||n>1?k:function(r){function o(t,e,n){return 3*t*(1-n)*(1-n)*n+3*e*(1-n)*n*n+n*n*n}if(r<=0){var a=0;return t>0?a=e/t:!e&&n>0&&(a=i/n),a*r}if(r>=1){var s=0;return n<1?s=(i-1)/(n-1):1==n&&t<1&&(s=(e-1)/(t-1)),1+s*(r-1)}for(var l=0,c=1;l<c;){var h=(l+c)/2,p=o(t,n,h);if(Math.abs(r-p)<1e-5)return o(e,i,h);p<r?l=h:c=h}return o(e,i,h)}}function c(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}function h(t){E||(E=document.createElement("div").style),E.animationTimingFunction="",E.animationTimingFunction=t;var e=E.animationTimingFunction;if(""==e&&r())throw new TypeError(t+" is not a valid value for easing");return e}function p(t){if("linear"==t)return k;var e=L.exec(t);if(e)return l.apply(this,e.slice(1).map(Number));var n=H.exec(t);if(n)return c(Number(n[1]),S);var i=T.exec(t);return i?c(Number(i[1]),{start:z,middle:A,end:S}[i[2]]):C[t]||k}function d(t){return Math.abs(u(t)/t.playbackRate)}function u(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}function g(t,e,n){if(null==e)return V;var i=n.delay+t+n.endDelay;return e<Math.min(n.delay,i)?$:e>=Math.min(n.delay+t,i)?O:P}function f(t,e,n,i,r){switch(i){case $:return"backwards"==e||"both"==e?0:null;case P:return n-r;case O:return"forwards"==e||"both"==e?t:null;case V:return null}}function m(t,e,n,i,r){var o=r;return 0===t?e!==$&&(o+=n):o+=i/t,o}function v(t,e,n,i,r,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==O||0===i||0===r&&0!==o||(a=1),a}function b(t,e,n,i){return t===O&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}function y(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}function _(t,e,n){var i=g(t,e,n),r=f(t,n.fill,e,i,n.delay);if(null===r)return null;var o=m(n.duration,i,n.iterations,r,n.iterationStart),a=v(o,n.iterationStart,i,n.iterations,r,n.duration),s=b(i,n.iterations,a,o),l=y(n.direction,s,a);return n._easingFunction(l)}var w="backwards|forwards|both|none".split("|"),x="reverse|alternate|alternate-reverse".split("|"),k=function(t){return t};i.prototype={_setMember:function(e,n){this["_"+e]=n,this._effect&&(this._effect._timingInput[e]=n,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&r())throw new TypeError("iterationStart must be a non-negative number, received: "+t);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&r())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=p(h(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&r())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var z=1,A=.5,S=0,C={ease:l(.25,.1,.25,1),"ease-in":l(.42,0,1,1),"ease-out":l(0,0,.58,1),"ease-in-out":l(.42,0,.58,1),"step-start":c(1,z),"step-middle":c(1,A),"step-end":c(1,S)},E=null,M="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",L=new RegExp("cubic-bezier\\("+M+","+M+","+M+","+M+"\\)"),H=/steps\(\s*(\d+)\s*\)/,T=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,V=0,$=1,O=2,P=3;t.cloneTimingInput=n,t.makeTiming=o,t.numericTimingToObject=a,t.normalizeTimingInput=s,t.calculateActiveDuration=d,t.calculateIterationProgress=_,t.calculatePhase=g,t.normalizeEasing=h,t.parseEasingFunction=p}(t),function(t,e){function n(t,e){return t in h&&h[t][e]||e}function i(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}function r(t,e,r){if(!i(t)){var o=s[t];if(o)for(var a in l.style[t]=e,o){var c=o[a],h=l.style[c];r[c]=n(c,h)}else r[t]=n(t,e)}}function o(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var i=t[n];Array.isArray(i)||(i=[i]);for(var r,o=i.length,a=0;a<o;a++)(r={}).offset="offset"in t?t.offset:1==o?1:a/(o-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[n]=i[a],e.push(r)}return e.sort((function(t,e){return t.offset-e.offset})),e}function a(e){function n(){var t=i.length;null==i[t-1].offset&&(i[t-1].offset=1),t>1&&null==i[0].offset&&(i[0].offset=0);for(var e=0,n=i[0].offset,r=1;r<t;r++){var o=i[r].offset;if(null!=o){for(var a=1;a<r-e;a++)i[e+a].offset=n+(o-n)*a/(r-e);e=r,n=o}}}if(null==e)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||(e=o(e));for(var i=e.map((function(e){var n={};for(var i in e){var o=e[i];if("offset"==i){if(null!=o){if(o=Number(o),!isFinite(o))throw new TypeError("Keyframe offsets must be numbers.");if(o<0||o>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==i){if("add"==o||"accumulate"==o)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=o)throw new TypeError("Invalid composite mode "+o+".")}else o="easing"==i?t.normalizeEasing(o):""+o;r(i,o,n)}return null==n.offset&&(n.offset=null),null==n.easing&&(n.easing="linear"),n})),a=!0,s=-1/0,l=0;l<i.length;l++){var c=i[l].offset;if(null!=c){if(c<s)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");s=c}else a=!1}return i=i.filter((function(t){return t.offset>=0&&t.offset<=1})),a||n(),i}var s={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},l=document.createElementNS("http://www.w3.org/1999/xhtml","div"),c={thin:"1px",medium:"3px",thick:"5px"},h={borderBottomWidth:c,borderLeftWidth:c,borderRightWidth:c,borderTopWidth:c,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:c,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};t.convertToArrayForm=o,t.normalizeKeyframes=a}(t),function(t){var e={};t.isDeprecated=function(t,n,i,r){var o=r?"are":"is",a=new Date,s=new Date(n);return s.setMonth(s.getMonth()+3),!(a<s&&(t in e||console.warn("Web Animations: "+t+" "+o+" deprecated and will stop working on "+s.toDateString()+". "+i),e[t]=!0,1))},t.deprecated=function(e,n,i,r){var o=r?"are":"is";if(t.isDeprecated(e,n,i,r))throw new Error(e+" "+o+" no longer supported. "+i)}}(t),function(){if(document.documentElement.animate){var n=document.documentElement.animate([],0),i=!0;if(n&&(i=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach((function(t){void 0===n[t]&&(i=!0)}))),!i)return}!function(t,e,n){function i(t){for(var e={},n=0;n<t.length;n++)for(var i in t[n])if("offset"!=i&&"easing"!=i&&"composite"!=i){var r={offset:t[n].offset,easing:t[n].easing,value:t[n][i]};e[i]=e[i]||[],e[i].push(r)}for(var o in e){var a=e[o];if(0!=a[0].offset||1!=a[a.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return e}function r(n){var i=[];for(var r in n)for(var o=n[r],a=0;a<o.length-1;a++){var s=a,l=a+1,c=o[s].offset,h=o[l].offset,p=c,d=h;0==a&&(p=-1/0,0==h&&(l=s)),a==o.length-2&&(d=1/0,1==c&&(s=l)),i.push({applyFrom:p,applyTo:d,startOffset:o[s].offset,endOffset:o[l].offset,easingFunction:t.parseEasingFunction(o[s].easing),property:r,interpolation:e.propertyInterpolation(r,o[s].value,o[l].value)})}return i.sort((function(t,e){return t.startOffset-e.startOffset})),i}e.convertEffectInput=function(n){var o=i(t.normalizeKeyframes(n)),a=r(o);return function(t,n){if(null!=n)a.filter((function(t){return n>=t.applyFrom&&n<t.applyTo})).forEach((function(i){var r=n-i.startOffset,o=i.endOffset-i.startOffset,a=0==o?0:i.easingFunction(r/o);e.apply(t,i.property,i.interpolation(a))}));else for(var i in o)"offset"!=i&&"easing"!=i&&"composite"!=i&&e.clear(t,i)}}}(t,e),function(t,e,n){function i(t){return t.replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function r(t,e,n){s[n]=s[n]||[],s[n].push([t,e])}function o(t,e,n){for(var o=0;o<n.length;o++)r(t,e,i(n[o]))}function a(n,r,o){var a=n;/-/.test(n)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(a=i(n)),"initial"!=r&&"initial"!=o||("initial"==r&&(r=l[a]),"initial"==o&&(o=l[a]));for(var c=r==o?[]:s[a],h=0;c&&h<c.length;h++){var p=c[h][0](r),d=c[h][0](o);if(void 0!==p&&void 0!==d){var u=c[h][1](p,d);if(u){var g=e.Interpolation.apply(null,u);return function(t){return 0==t?r:1==t?o:g(t)}}}}return e.Interpolation(!1,!0,(function(t){return t?o:r}))}var s={};e.addPropertiesHandler=o;var l={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};e.propertyInterpolation=a}(t,e),function(t,e,n){function i(e){var n=t.calculateActiveDuration(e),i=function(i){return t.calculateIterationProgress(n,i,e)};return i._totalDuration=e.delay+n+e.endDelay,i}e.KeyframeEffect=function(n,r,o,a){var s,l=i(t.normalizeTimingInput(o)),c=e.convertEffectInput(r),h=function(){c(n,s)};return h._update=function(t){return null!==(s=l(t))},h._clear=function(){c(n,null)},h._hasSameTarget=function(t){return n===t},h._target=n,h._totalDuration=l._totalDuration,h._id=a,h}}(t,e),function(t,e){function n(t,e){return!(!e.namespaceURI||-1==e.namespaceURI.indexOf("/svg"))&&(a in t||(t[a]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(t.navigator.userAgent)),t[a])}function i(t,e,n){n.enumerable=!0,n.configurable=!0,Object.defineProperty(t,e,n)}function r(t){this._element=t,this._surrogateStyle=document.createElementNS("http://www.w3.org/1999/xhtml","div").style,this._style=t.style,this._length=0,this._isAnimatedProperty={},this._updateSvgTransformAttr=n(window,t),this._savedTransformAttr=null;for(var e=0;e<this._style.length;e++){var i=this._style[e];this._surrogateStyle[i]=this._style[i]}this._updateIndices()}function o(t){if(!t._webAnimationsPatchedStyle){var e=new r(t);try{i(t,"style",{get:function(){return e}})}catch(e){t.style._set=function(e,n){t.style[e]=n},t.style._clear=function(e){t.style[e]=""}}t._webAnimationsPatchedStyle=t.style}}var a="_webAnimationsUpdateSvgTransformAttr",s={cssText:1,length:1,parentRule:1},l={getPropertyCSSValue:1,getPropertyPriority:1,getPropertyValue:1,item:1,removeProperty:1,setProperty:1},c={removeProperty:1,setProperty:1};for(var h in r.prototype={get cssText(){return this._surrogateStyle.cssText},set cssText(t){for(var e={},n=0;n<this._surrogateStyle.length;n++)e[this._surrogateStyle[n]]=!0;this._surrogateStyle.cssText=t,this._updateIndices();for(n=0;n<this._surrogateStyle.length;n++)e[this._surrogateStyle[n]]=!0;for(var i in e)this._isAnimatedProperty[i]||this._style.setProperty(i,this._surrogateStyle.getPropertyValue(i))},get length(){return this._surrogateStyle.length},get parentRule(){return this._style.parentRule},_updateIndices:function(){for(;this._length<this._surrogateStyle.length;)Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,get:function(t){return function(){return this._surrogateStyle[t]}}(this._length)}),this._length++;for(;this._length>this._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(e,n){this._style[e]=n,this._isAnimatedProperty[e]=!0,this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",t.transformToSvgMatrix(n)))},_clear:function(e){this._style[e]=this._surrogateStyle[e],this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[e]}},l)r.prototype[h]=function(t,e){return function(){var n=this._surrogateStyle[t].apply(this._surrogateStyle,arguments);return e&&(this._isAnimatedProperty[arguments[0]]||this._style[t].apply(this._style,arguments),this._updateIndices()),n}}(h,h in c);for(var p in document.documentElement.style)p in s||p in l||function(t){i(r.prototype,t,{get:function(){return this._surrogateStyle[t]},set:function(e){this._surrogateStyle[t]=e,this._updateIndices(),this._isAnimatedProperty[t]||(this._style[t]=e)}})}(p);t.apply=function(e,n,i){o(e),e.style._set(t.propertyName(n),i)},t.clear=function(e,n){e._webAnimationsPatchedStyle&&e.style._clear(t.propertyName(n))}}(e),function(t){window.Element.prototype.animate=function(e,n){var i="";return n&&n.id&&(i=n.id),t.timeline._play(t.KeyframeEffect(this,e,n,i))}}(e),function(t,e){function n(t,e,i){if("number"==typeof t&&"number"==typeof e)return t*(1-i)+e*i;if("boolean"==typeof t&&"boolean"==typeof e)return i<.5?t:e;if(t.length==e.length){for(var r=[],o=0;o<t.length;o++)r.push(n(t[o],e[o],i));return r}throw"Mismatched interpolation arguments "+t+":"+e}t.Interpolation=function(t,e,i){return function(r){return i(n(t,e,r))}}}(e),function(t,e){function n(t,e,n){return Math.max(Math.min(t,n),e)}function i(e,i,r){var o=t.dot(e,i),a=[];if(1===(o=n(o,-1,1)))a=e;else for(var s=Math.acos(o),l=1*Math.sin(r*s)/Math.sqrt(1-o*o),c=0;c<4;c++)a.push(e[c]*(Math.cos(r*s)-o*l)+i[c]*l);return a}var r=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;i<4;i++)for(var r=0;r<4;r++)for(var o=0;o<4;o++)n[i][r]+=e[i][o]*t[o][r];return n}function e(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}function n(n,i,r,o,a){for(var s=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],l=0;l<4;l++)s[l][3]=a[l];for(l=0;l<3;l++)for(var c=0;c<3;c++)s[3][l]+=n[c]*s[c][l];var h=o[0],p=o[1],d=o[2],u=o[3],g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];g[0][0]=1-2*(p*p+d*d),g[0][1]=2*(h*p-d*u),g[0][2]=2*(h*d+p*u),g[1][0]=2*(h*p+d*u),g[1][1]=1-2*(h*h+d*d),g[1][2]=2*(p*d-h*u),g[2][0]=2*(h*d-p*u),g[2][1]=2*(p*d+h*u),g[2][2]=1-2*(h*h+p*p),s=t(s,g);var f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(f[2][1]=r[2],s=t(s,f)),r[1]&&(f[2][1]=0,f[2][0]=r[0],s=t(s,f)),r[0]&&(f[2][0]=0,f[1][0]=r[0],s=t(s,f));for(l=0;l<3;l++)for(c=0;c<3;c++)s[l][c]*=i[l];return e(s)?[s[0][0],s[0][1],s[1][0],s[1][1],s[3][0],s[3][1]]:s[0].concat(s[1],s[2],s[3])}return n}();t.composeMatrix=r,t.quat=i}(e),function(t,e,n){t.sequenceNumber=0;var i=function(t,e,n){this.target=t,this.currentTime=e,this.timelineTime=n,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};e.Animation=function(e){this.id="",e&&e._id&&(this.id=e._id),this._sequenceNumber=t.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=e,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},e.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,e.timeline._animations.push(this))},_tickCurrentTime:function(t,e){t!=this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var n=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=n&&(this.currentTime=n)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var n=this._finishHandlers.indexOf(e);n>=0&&this._finishHandlers.splice(n,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new i(this,this._currentTime,t),n=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){n.forEach((function(t){t.call(e.target,e)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(t,e),function(t,e,n){function i(t){var e=c;c=[],t<f.currentTime&&(t=f.currentTime),f._animations.sort(r),f._animations=s(t,!0,f._animations)[0],e.forEach((function(e){e[1](t)})),a(),void 0}function r(t,e){return t._sequenceNumber-e._sequenceNumber}function o(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function a(){u.forEach((function(t){t()})),u.length=0}function s(t,n,i){g=!0,d=!1,e.timeline.currentTime=t,p=!1;var r=[],o=[],a=[],s=[];return i.forEach((function(e){e._tick(t,n),e._inEffect?(o.push(e._effect),e._markTarget()):(r.push(e._effect),e._unmarkTarget()),e._needsTick&&(p=!0);var i=e._inEffect||e._needsTick;e._inTimeline=i,i?a.push(e):s.push(e)})),u.push.apply(u,r),u.push.apply(u,o),p&&requestAnimationFrame((function(){})),g=!1,[a,s]}var l=window.requestAnimationFrame,c=[],h=0;window.requestAnimationFrame=function(t){var e=h++;return 0==c.length&&l(i),c.push([e,t]),e},window.cancelAnimationFrame=function(t){c.forEach((function(e){e[0]==t&&(e[1]=function(){})}))},o.prototype={_play:function(n){n._timing=t.normalizeTimingInput(n.timing);var i=new e.Animation(n);return i._idle=!1,i._timeline=this,this._animations.push(i),e.restart(),e.applyDirtiedAnimation(i),i}};var p=!1,d=!1;e.restart=function(){return p||(p=!0,requestAnimationFrame((function(){})),d=!0),d},e.applyDirtiedAnimation=function(t){if(!g){t._markTarget();var n=t._targetAnimations();n.sort(r),s(e.timeline.currentTime,!1,n.slice())[1].forEach((function(t){var e=f._animations.indexOf(t);-1!==e&&f._animations.splice(e,1)})),a()}};var u=[],g=!1,f=new o;e.timeline=f}(t,e),function(t,e){function n(t,e){for(var n=0,i=0;i<t.length;i++)n+=t[i]*e[i];return n}function i(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function r(t){var e=t.rad||0;return((t.deg||0)/360+(t.grad||0)/400+(t.turn||0))*(2*Math.PI)+e}function o(t){switch(t.t){case"rotatex":var e=r(t.d[0]);return[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1];case"rotatey":e=r(t.d[0]);return[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1];case"rotate":case"rotatez":e=r(t.d[0]);return[Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var n=t.d[0],i=t.d[1],o=t.d[2],a=(e=r(t.d[3]),n*n+i*i+o*o);if(0===a)n=1,i=0,o=0;else if(1!==a){var s=Math.sqrt(a);n/=s,i/=s,o/=s}var l=Math.sin(e/2),c=l*Math.cos(e/2),h=l*l;return[1-2*(i*i+o*o)*h,2*(n*i*h+o*c),2*(n*o*h-i*c),0,2*(n*i*h-o*c),1-2*(n*n+o*o)*h,2*(i*o*h+n*c),0,2*(n*o*h+i*c),2*(i*o*h-n*c),1-2*(n*n+i*i)*h,0,0,0,0,1];case"scale":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0],0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0],0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0],0,0,0,0,1];case"scale3d":return[t.d[0],0,0,0,0,t.d[1],0,0,0,0,t.d[2],0,0,0,0,1];case"skew":var p=r(t.d[0]),d=r(t.d[1]);return[1,Math.tan(d),0,0,Math.tan(p),1,0,0,0,0,1,0,0,0,0,1];case"skewx":e=r(t.d[0]);return[1,0,0,0,Math.tan(e),1,0,0,0,0,1,0,0,0,0,1];case"skewy":e=r(t.d[0]);return[1,Math.tan(e),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,n=t.d[0].px||0,i=t.d[1].px||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,n=t.d[0].px||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,i=t.d[0].px||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,o=t.d[0].px||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,n=t.d[0].px||0,i=t.d[1].px||0,o=t.d[2].px||0,1];case"perspective":return[1,0,0,0,0,1,0,0,0,0,1,t.d[0].px?-1/t.d[0].px:0,0,0,0,1];case"matrix":return[t.d[0],t.d[1],0,0,t.d[2],t.d[3],0,0,0,0,1,0,t.d[4],t.d[5],0,1];case"matrix3d":return t.d}}function a(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(o).reduce(i)}function s(t){return[l(a(t))]}var l=function(){function t(t){return t[0][0]*t[1][1]*t[2][2]+t[1][0]*t[2][1]*t[0][2]+t[2][0]*t[0][1]*t[1][2]-t[0][2]*t[1][1]*t[2][0]-t[1][2]*t[2][1]*t[0][0]-t[2][2]*t[0][1]*t[1][0]}function e(e){for(var n=1/t(e),i=e[0][0],r=e[0][1],o=e[0][2],a=e[1][0],s=e[1][1],l=e[1][2],c=e[2][0],h=e[2][1],p=e[2][2],d=[[(s*p-l*h)*n,(o*h-r*p)*n,(r*l-o*s)*n,0],[(l*c-a*p)*n,(i*p-o*c)*n,(o*a-i*l)*n,0],[(a*h-s*c)*n,(c*r-i*h)*n,(i*s-r*a)*n,0]],u=[],g=0;g<3;g++){for(var f=0,m=0;m<3;m++)f+=e[3][m]*d[m][g];u.push(f)}return u.push(1),d.push(u),d}function i(t){return[[t[0][0],t[1][0],t[2][0],t[3][0]],[t[0][1],t[1][1],t[2][1],t[3][1]],[t[0][2],t[1][2],t[2][2],t[3][2]],[t[0][3],t[1][3],t[2][3],t[3][3]]]}function r(t,e){for(var n=[],i=0;i<4;i++){for(var r=0,o=0;o<4;o++)r+=t[o]*e[o][i];n.push(r)}return n}function o(t){var e=a(t);return[t[0]/e,t[1]/e,t[2]/e]}function a(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function s(t,e,n,i){return[n*t[0]+i*e[0],n*t[1]+i*e[1],n*t[2]+i*e[2]]}function l(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function c(c){var h=[c.slice(0,4),c.slice(4,8),c.slice(8,12),c.slice(12,16)];if(1!==h[3][3])return null;for(var p=[],d=0;d<4;d++)p.push(h[d].slice());for(d=0;d<3;d++)p[d][3]=0;if(0===t(p))return null;var u,g=[];h[0][3]||h[1][3]||h[2][3]?(g.push(h[0][3]),g.push(h[1][3]),g.push(h[2][3]),g.push(h[3][3]),u=r(g,i(e(p)))):u=[0,0,0,1];var f=h[3].slice(0,3),m=[];m.push(h[0].slice(0,3));var v=[];v.push(a(m[0])),m[0]=o(m[0]);var b=[];m.push(h[1].slice(0,3)),b.push(n(m[0],m[1])),m[1]=s(m[1],m[0],1,-b[0]),v.push(a(m[1])),m[1]=o(m[1]),b[0]/=v[1],m.push(h[2].slice(0,3)),b.push(n(m[0],m[2])),m[2]=s(m[2],m[0],1,-b[1]),b.push(n(m[1],m[2])),m[2]=s(m[2],m[1],1,-b[2]),v.push(a(m[2])),m[2]=o(m[2]),b[1]/=v[2],b[2]/=v[2];var y=l(m[1],m[2]);if(n(m[0],y)<0)for(d=0;d<3;d++)v[d]*=-1,m[d][0]*=-1,m[d][1]*=-1,m[d][2]*=-1;var _,w,x=m[0][0]+m[1][1]+m[2][2]+1;return x>1e-4?(_=.5/Math.sqrt(x),w=[(m[2][1]-m[1][2])*_,(m[0][2]-m[2][0])*_,(m[1][0]-m[0][1])*_,.25/_]):m[0][0]>m[1][1]&&m[0][0]>m[2][2]?w=[.25*(_=2*Math.sqrt(1+m[0][0]-m[1][1]-m[2][2])),(m[0][1]+m[1][0])/_,(m[0][2]+m[2][0])/_,(m[2][1]-m[1][2])/_]:m[1][1]>m[2][2]?(_=2*Math.sqrt(1+m[1][1]-m[0][0]-m[2][2]),w=[(m[0][1]+m[1][0])/_,.25*_,(m[1][2]+m[2][1])/_,(m[0][2]-m[2][0])/_]):(_=2*Math.sqrt(1+m[2][2]-m[0][0]-m[1][1]),w=[(m[0][2]+m[2][0])/_,(m[1][2]+m[2][1])/_,.25*_,(m[1][0]-m[0][1])/_]),[f,v,b,w,u]}return c}();t.dot=n,t.makeMatrixDecomposition=s,t.transformListToMatrix=a}(e),function(t){function e(t,e){var n=t.exec(e);if(n)return[n=t.ignoreCase?n[0].toLowerCase():n[0],e.substr(n.length)]}function n(t,e){var n=t(e=e.replace(/^\s*/,""));if(n)return[n[0],n[1].replace(/^\s*/,"")]}function i(t,i,r){t=n.bind(null,t);for(var o=[];;){var a=t(r);if(!a)return[o,r];if(o.push(a[0]),!(a=e(i,r=a[1]))||""==a[1])return[o,r];r=a[1]}}function r(t,e){for(var n=0,i=0;i<e.length&&(!/\s|,/.test(e[i])||0!=n);i++)if("("==e[i])n++;else if(")"==e[i]&&(0==--n&&i++,n<=0))break;var r=t(e.substr(0,i));return null==r?void 0:[r,e.substr(i)]}function o(t,e){for(var n=t,i=e;n&&i;)n>i?n%=i:i%=n;return t*e/(n+i)}function a(t){return function(e){var n=t(e);return n&&(n[0]=void 0),n}}function s(t,e){return function(n){return t(n)||[e,n]}}function l(e,n){for(var i=[],r=0;r<e.length;r++){var o=t.consumeTrimmed(e[r],n);if(!o||""==o[0])return;void 0!==o[0]&&i.push(o[0]),n=o[1]}if(""==n)return i}function c(t,e,n,i,r){for(var a=[],s=[],l=[],c=o(i.length,r.length),h=0;h<c;h++){var p=e(i[h%i.length],r[h%r.length]);if(!p)return;a.push(p[0]),s.push(p[1]),l.push(p[2])}return[a,s,function(e){var i=e.map((function(t,e){return l[e](t)})).join(n);return t?t(i):i}]}function h(t,e,n){for(var i=[],r=[],o=[],a=0,s=0;s<n.length;s++)if("function"==typeof n[s]){var l=n[s](t[a],e[a++]);i.push(l[0]),r.push(l[1]),o.push(l[2])}else!function(t){i.push(!1),r.push(!1),o.push((function(){return n[t]}))}(s);return[i,r,function(t){for(var e="",n=0;n<t.length;n++)e+=o[n](t[n]);return e}]}t.consumeToken=e,t.consumeTrimmed=n,t.consumeRepeated=i,t.consumeParenthesised=r,t.ignore=a,t.optional=s,t.consumeList=l,t.mergeNestedRepeated=c.bind(null,null),t.mergeWrappedNestedRepeated=c,t.mergeList=h}(e),function(t){function e(e){function n(e){var n=t.consumeToken(/^inset/i,e);return n?(i.inset=!0,n):(n=t.consumeLengthOrPercent(e))?(i.lengths.push(n[0]),n):(n=t.consumeColor(e))?(i.color=n[0],n):void 0}var i={inset:!1,lengths:[],color:null},r=t.consumeRepeated(n,/^/,e);if(r&&r[0].length)return[i,r[1]]}function n(n){var i=t.consumeRepeated(e,/^,/,n);if(i&&""==i[1])return i[0]}function i(e,n){for(;e.lengths.length<Math.max(e.lengths.length,n.lengths.length);)e.lengths.push({px:0});for(;n.lengths.length<Math.max(e.lengths.length,n.lengths.length);)n.lengths.push({px:0});if(e.inset==n.inset&&!!e.color==!!n.color){for(var i,r=[],o=[[],0],a=[[],0],s=0;s<e.lengths.length;s++){var l=t.mergeDimensions(e.lengths[s],n.lengths[s],2==s);o[0].push(l[0]),a[0].push(l[1]),r.push(l[2])}if(e.color&&n.color){var c=t.mergeColors(e.color,n.color);o[1]=c[0],a[1]=c[1],i=c[2]}return[o,a,function(t){for(var n=e.inset?"inset ":" ",o=0;o<r.length;o++)n+=r[o](t[0][o])+" ";return i&&(n+=i(t[1])),n}]}}function r(e,n,i,r){function o(t){return{inset:t,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var a=[],s=[],l=0;l<i.length||l<r.length;l++){var c=i[l]||o(r[l].inset),h=r[l]||o(i[l].inset);a.push(c),s.push(h)}return t.mergeNestedRepeated(e,n,a,s)}var o=r.bind(null,i,", ");t.addPropertiesHandler(n,o,["box-shadow","text-shadow"])}(e),function(t,e){function n(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function i(t,e,n){return Math.min(e,Math.max(t,n))}function r(t){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t))return Number(t)}function o(t,e){return[t,e,n]}function a(t,e){if(0!=t)return l(0,1/0)(t,e)}function s(t,e){return[t,e,function(t){return Math.round(i(1,1/0,t))}]}function l(t,e){return function(r,o){return[r,o,function(r){return n(i(t,e,r))}]}}function c(t){var e=t.trim().split(/\s*[\s,]\s*/);if(0!==e.length){for(var n=[],i=0;i<e.length;i++){var o=r(e[i]);if(void 0===o)return;n.push(o)}return n}}function h(t,e){if(t.length==e.length)return[t,e,function(t){return t.map(n).join(" ")}]}function p(t,e){return[t,e,Math.round]}t.clamp=i,t.addPropertiesHandler(c,h,["stroke-dasharray"]),t.addPropertiesHandler(r,l(0,1/0),["border-image-width","line-height"]),t.addPropertiesHandler(r,l(0,1),["opacity","shape-image-threshold"]),t.addPropertiesHandler(r,a,["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,s,["orphans","widows"]),t.addPropertiesHandler(r,p,["z-index"]),t.parseNumber=r,t.parseNumberList=c,t.mergeNumbers=o,t.numberToString=n}(e),function(t,e){function n(t,e){if("visible"==t||"visible"==e)return[0,1,function(n){return n<=0?t:n>=1?e:"visible"}]}t.addPropertiesHandler(String,n,["visibility"])}(e),function(t,e){function n(t){t=t.trim(),o.fillStyle="#000",o.fillStyle=t;var e=o.fillStyle;if(o.fillStyle="#fff",o.fillStyle=t,e==o.fillStyle){o.fillRect(0,0,1,1);var n=o.getImageData(0,0,1,1).data;o.clearRect(0,0,1,1);var i=n[3]/255;return[n[0]*i,n[1]*i,n[2]*i,i]}}function i(e,n){return[e,n,function(e){function n(t){return Math.max(0,Math.min(255,t))}if(e[3])for(var i=0;i<3;i++)e[i]=Math.round(n(e[i]/e[3]));return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=r.height=1;var o=r.getContext("2d");t.addPropertiesHandler(n,i,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,n),t.mergeColors=i}(e),function(t,e){function n(t){function e(){var e=s.exec(t);a=e?e[0]:void 0}function n(){var t=Number(a);return e(),t}function i(){if("("!==a)return n();e();var t=o();return")"!==a?NaN:(e(),t)}function r(){for(var t=i();"*"===a||"/"===a;){var n=a;e();var r=i();"*"===n?t*=r:t/=r}return t}function o(){for(var t=r();"+"===a||"-"===a;){var n=a;e();var i=r();"+"===n?t+=i:t-=i}return t}var a,s=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),o()}function i(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){e=e.replace(/calc\(/g,"(");var i={};e=e.replace(t,(function(t){return i[t]=null,"U"+t}));for(var r="U("+t.source+")",o=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+r,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),a=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s<a.length;)a[s].test(o)?(o=o.replace(a[s],"$1"),s=0):s++;if("D"==o){for(var l in i){var c=n(e.replace(new RegExp("U"+l,"g"),"").replace(new RegExp(r,"g"),"*0"));if(!isFinite(c))return;i[l]=c}return i}}}function r(t,e){return o(t,e,!0)}function o(e,n,i){var r,o=[];for(r in e)o.push(r);for(r in n)o.indexOf(r)<0&&o.push(r);return e=o.map((function(t){return e[t]||0})),n=o.map((function(t){return n[t]||0})),[e,n,function(e){var n=e.map((function(n,r){return 1==e.length&&i&&(n=Math.max(n,0)),t.numberToString(n)+o[r]})).join(" + ");return e.length>1?"calc("+n+")":n}]}var a="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=i.bind(null,new RegExp(a,"g")),l=i.bind(null,new RegExp(a+"|%","g")),c=i.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=l,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,l),t.parseAngle=c,t.mergeDimensions=o;var h=t.consumeParenthesised.bind(null,s),p=t.consumeRepeated.bind(void 0,h,/^/),d=t.consumeRepeated.bind(void 0,p,/^,/);t.consumeSizePairList=d;var u=function(t){var e=d(t);if(e&&""==e[1])return e[0]},g=t.mergeNestedRepeated.bind(void 0,r," "),f=t.mergeNestedRepeated.bind(void 0,g,",");t.mergeNonNegativeSizePair=g,t.addPropertiesHandler(u,f,["background-size"]),t.addPropertiesHandler(l,r,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(l,o,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(e),function(t,e){function n(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function i(e){var i=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,n,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(i&&4==i[0].length)return i[0]}function r(e,n){return"auto"==e||"auto"==n?[!0,!1,function(i){var r=i?e:n;if("auto"==r)return"auto";var o=t.mergeDimensions(r,r);return o[2](o[0])}]:t.mergeDimensions(e,n)}function o(t){return"rect("+t+")"}var a=t.mergeWrappedNestedRepeated.bind(null,o,r,", ");t.parseBox=i,t.mergeBoxes=a,t.addPropertiesHandler(i,a,["clip"])}(e),function(t,e){function n(t){return function(e){var n=0;return t.map((function(t){return t===h?e[n++]:t}))}}function i(t){return t}function r(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var n,i=/\s*(\w+)\(([^)]*)\)/g,r=[],o=0;n=i.exec(e);){if(n.index!=o)return;o=n.index+n[0].length;var a=n[1],s=u[a];if(!s)return;var l=n[2].split(","),c=s[0];if(c.length<l.length)return;for(var h=[],g=0;g<c.length;g++){var f,m=l[g],v=c[g];if(void 0===(f=m?{A:function(e){return"0"==e.trim()?d:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[v.toUpperCase()](m):{a:d,n:h[0],t:p}[v]))return;h.push(f)}if(r.push({t:a,d:h}),i.lastIndex==e.length)return r}}function o(t){return t.toFixed(6).replace(".000000","")}function a(e,n){if(e.decompositionPair!==n){e.decompositionPair=n;var i=t.makeMatrixDecomposition(e)}if(n.decompositionPair!==e){n.decompositionPair=e;var r=t.makeMatrixDecomposition(n)}return null==i[0]||null==r[0]?[[!1],[!0],function(t){return t?n[0].d:e[0].d}]:(i[0].push(0),r[0].push(1),[i,r,function(e){var n=t.quat(i[0][3],r[0][3],e[5]);return t.composeMatrix(e[0],e[1],e[2],n,e[4]).map(o).join(",")}])}function s(t){return t.replace(/[xy]/,"")}function l(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function c(e,n){var i=t.makeMatrixDecomposition&&!0,r=!1;if(!e.length||!n.length){e.length||(r=!0,e=n,n=[]);for(var o=0;o<e.length;o++){var c=e[o].t,h=e[o].d,p="scale"==c.substr(0,5)?1:0;n.push({t:c,d:h.map((function(t){if("number"==typeof t)return p;var e={};for(var n in t)e[n]=p;return e}))})}}var d=function(t,e){return"perspective"==t&&"perspective"==e||("matrix"==t||"matrix3d"==t)&&("matrix"==e||"matrix3d"==e)},g=[],f=[],m=[];if(e.length!=n.length){if(!i)return;g=[(k=a(e,n))[0]],f=[k[1]],m=[["matrix",[k[2]]]]}else for(o=0;o<e.length;o++){var v=e[o].t,b=n[o].t,y=e[o].d,_=n[o].d,w=u[v],x=u[b];if(d(v,b)){if(!i)return;var k=a([e[o]],[n[o]]);g.push(k[0]),f.push(k[1]),m.push(["matrix",[k[2]]])}else{if(v==b)c=v;else if(w[2]&&x[2]&&s(v)==s(b))c=s(v),y=w[2](y),_=x[2](_);else{if(!w[1]||!x[1]||l(v)!=l(b)){if(!i)return;g=[(k=a(e,n))[0]],f=[k[1]],m=[["matrix",[k[2]]]];break}c=l(v),y=w[1](y),_=x[1](_)}for(var z=[],A=[],S=[],C=0;C<y.length;C++){k=("number"==typeof y[C]?t.mergeNumbers:t.mergeDimensions)(y[C],_[C]);z[C]=k[0],A[C]=k[1],S.push(k[2])}g.push(z),f.push(A),m.push([c,S])}}if(r){var E=g;g=f,f=E}return[g,f,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return m[e][1][n](t)})).join(",");return"matrix"==m[e][0]&&16==n.split(",").length&&(m[e][0]="matrix3d"),m[e][0]+"("+n+")"})).join(" ")}]}var h=null,p={px:0},d={deg:0},u={matrix:["NNNNNN",[h,h,0,0,h,h,0,0,0,0,1,0,h,h,0,1],i],matrix3d:["NNNNNNNNNNNNNNNN",i],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",n([h,h,1]),i],scalex:["N",n([h,1,1]),n([h,1])],scaley:["N",n([1,h,1]),n([1,h])],scalez:["N",n([1,1,h])],scale3d:["NNN",i],skew:["Aa",null,i],skewx:["A",null,n([h,d])],skewy:["A",null,n([d,h])],translate:["Tt",n([h,h,p]),i],translatex:["T",n([h,p,p]),n([h,p])],translatey:["T",n([p,h,p]),n([p,h])],translatez:["L",n([p,p,h])],translate3d:["TTL",i]};t.addPropertiesHandler(r,c,["transform"]),t.transformToSvgMatrix=function(e){var n=t.transformListToMatrix(r(e));return"matrix("+o(n[0])+" "+o(n[1])+" "+o(n[4])+" "+o(n[5])+" "+o(n[12])+" "+o(n[13])+")"}}(e),function(t){function e(t){var e=Number(t);if(!(isNaN(e)||e<100||e>900||e%100!=0))return e}function n(e){return e=100*Math.round(e/100),400===(e=t.clamp(100,900,e))?"normal":700===e?"bold":String(e)}function i(t,e){return[t,e,n]}t.addPropertiesHandler(e,i,["font-weight"])}(e),function(t){function e(t){var e={};for(var n in t)e[n]=-t[n];return e}function n(e){return t.consumeToken(/^(left|center|right|top|bottom)\b/i,e)||t.consumeLengthOrPercent(e)}function i(e,i){var r=t.consumeRepeated(n,/^/,i);if(r&&""==r[1]){var o=r[0];if(o[0]=o[0]||"center",o[1]=o[1]||"center",3==e&&(o[2]=o[2]||{px:0}),o.length==e){if(/top|bottom/.test(o[0])||/left|right/.test(o[1])){var s=o[0];o[0]=o[1],o[1]=s}if(/left|right|center|Object/.test(o[0])&&/top|bottom|center|Object/.test(o[1]))return o.map((function(t){return"object"==typeof t?t:a[t]}))}}}function r(i){var r=t.consumeRepeated(n,/^/,i);if(r){for(var o=r[0],s=[{"%":50},{"%":50}],l=0,c=!1,h=0;h<o.length;h++){var p=o[h];"string"==typeof p?(c=/bottom|right/.test(p),s[l={left:0,right:0,center:l,top:1,bottom:1}[p]]=a[p],"center"==p&&l++):(c&&((p=e(p))["%"]=(p["%"]||0)+100),s[l]=p,l++,c=!1)}return[s,r[1]]}}function o(e){var n=t.consumeRepeated(r,/^,/,e);if(n&&""==n[1])return n[0]}var a={left:{"%":0},center:{"%":50},right:{"%":100},top:{"%":0},bottom:{"%":100}},s=t.mergeNestedRepeated.bind(null,t.mergeDimensions," ");t.addPropertiesHandler(i.bind(null,3),s,["transform-origin"]),t.addPropertiesHandler(i.bind(null,2),s,["perspective-origin"]),t.consumePosition=r,t.mergeOffsetList=s;var l=t.mergeNestedRepeated.bind(null,s,", ");t.addPropertiesHandler(o,l,["background-position","object-position"])}(e),function(t){function e(e){var n=t.consumeToken(/^circle/,e);if(n&&n[0])return["circle"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),i,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],n[1]));var o=t.consumeToken(/^ellipse/,e);if(o&&o[0])return["ellipse"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),r,t.ignore(t.consumeToken.bind(void 0,/^at/)),t.consumePosition,t.ignore(t.consumeToken.bind(void 0,/^\)/))],o[1]));var a=t.consumeToken(/^polygon/,e);return a&&a[0]?["polygon"].concat(t.consumeList([t.ignore(t.consumeToken.bind(void 0,/^\(/)),t.optional(t.consumeToken.bind(void 0,/^nonzero\s*,|^evenodd\s*,/),"nonzero,"),t.consumeSizePairList,t.ignore(t.consumeToken.bind(void 0,/^\)/))],a[1])):void 0}function n(e,n){if(e[0]===n[0])return"circle"==e[0]?t.mergeList(e.slice(1),n.slice(1),["circle(",t.mergeDimensions," at ",t.mergeOffsetList,")"]):"ellipse"==e[0]?t.mergeList(e.slice(1),n.slice(1),["ellipse(",t.mergeNonNegativeSizePair," at ",t.mergeOffsetList,")"]):"polygon"==e[0]&&e[1]==n[1]?t.mergeList(e.slice(2),n.slice(2),["polygon(",e[1],a,")"]):void 0}var i=t.consumeParenthesised.bind(null,t.parseLengthOrPercent),r=t.consumeRepeated.bind(void 0,i,/^/),o=t.mergeNestedRepeated.bind(void 0,t.mergeDimensions," "),a=t.mergeNestedRepeated.bind(void 0,o,",");t.addPropertiesHandler(e,n,["shape-outside"])}(e),function(t,e){function n(t,e){e.concat([t]).forEach((function(e){e in document.documentElement.style&&(i[t]=e),r[e]=t}))}var i={},r={};n("transform",["webkitTransform","msTransform"]),n("transformOrigin",["webkitTransformOrigin"]),n("perspective",["webkitPerspective"]),n("perspectiveOrigin",["webkitPerspectiveOrigin"]),t.propertyName=function(t){return i[t]||t},t.unprefixedPropertyName=function(t){return r[t]||t}}(e)}(),function(){if(void 0===document.createElement("div").animate([]).oncancel){if(window.performance&&performance.now)var t=function(){return performance.now()};else t=function(){return Date.now()};var e=function(t,e,n){this.target=t,this.currentTime=e,this.timelineTime=n,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},n=window.Element.prototype.animate;window.Element.prototype.animate=function(i,r){var o=n.call(this,i,r);o._cancelHandlers=[],o.oncancel=null;var a=o.cancel;o.cancel=function(){a.call(this);var n=new e(this,null,t()),i=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout((function(){i.forEach((function(t){t.call(n.target,n)}))}),0)};var s=o.addEventListener;o.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):s.call(this,t,e)};var l=o.removeEventListener;return o.removeEventListener=function(t,e){if("cancel"==t){var n=this._cancelHandlers.indexOf(e);n>=0&&this._cancelHandlers.splice(n,1)}else l.call(this,t,e)},o}}}(),function(t){var e=document.documentElement,n=null,i=!1;try{var r="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(n=e.animate({opacity:[r,r]},{duration:1})).currentTime=0,i=getComputedStyle(e).getPropertyValue("opacity")==r}catch(t){}finally{n&&n.cancel()}if(!i){var o=window.Element.prototype.animate;window.Element.prototype.animate=function(e,n){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),o.call(this,e,n)}}}(t)}(),
|
|
3305
3305
|
/**
|
|
3306
3306
|
@license
|
|
3307
3307
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3312,7 +3312,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3312
3312
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3313
3313
|
found at http://polymer.github.io/PATENTS.txt
|
|
3314
3314
|
*/
|
|
3315
|
-
e({_template:
|
|
3315
|
+
e({_template:n`
|
|
3316
3316
|
<style>
|
|
3317
3317
|
:host {
|
|
3318
3318
|
display: block;
|
|
@@ -3338,7 +3338,7 @@ e({_template:i`
|
|
|
3338
3338
|
</style>
|
|
3339
3339
|
|
|
3340
3340
|
<slot id="content"></slot>
|
|
3341
|
-
`,is:"neon-animated-pages",behaviors:[p,u,x],properties:{activateEvent:{type:String,value:""},animateInitialSelection:{type:Boolean,value:!1}},listeners:{"iron-select":"_onIronSelect","neon-animation-finish":"_onNeonAnimationFinish"},_onIronSelect:function(t){var e=t.detail.item;if(!(this.items.indexOf(e)<0)){var
|
|
3341
|
+
`,is:"neon-animated-pages",behaviors:[p,u,x],properties:{activateEvent:{type:String,value:""},animateInitialSelection:{type:Boolean,value:!1}},listeners:{"iron-select":"_onIronSelect","neon-animation-finish":"_onNeonAnimationFinish"},_onIronSelect:function(t){var e=t.detail.item;if(!(this.items.indexOf(e)<0)){var n=this._valueToItem(this._prevSelected)||!1;this._prevSelected=this.selected,n||this.animateInitialSelection?(this.animationConfig=[],this.entryAnimation?this.animationConfig.push({name:this.entryAnimation,node:e}):e.getAnimationConfig&&this.animationConfig.push({animatable:e,type:"entry"}),n&&(n.classList.contains("neon-animating")&&(this._squelchNextFinishEvent=!0,this.cancelAnimation(),this._completeSelectedChanged(),this._squelchNextFinishEvent=!1),this.exitAnimation?this.animationConfig.push({name:this.exitAnimation,node:n}):n.getAnimationConfig&&this.animationConfig.push({animatable:n,type:"exit"}),n.classList.add("neon-animating")),e.classList.add("neon-animating"),this.animationConfig.length>=1?this.isAttached?this.playAnimation(void 0,{fromPage:n,toPage:e}):this.async((function(){this.playAnimation(void 0,{fromPage:null,toPage:e})})):this._completeSelectedChanged(n,e)):this._completeSelectedChanged()}},_completeSelectedChanged:function(e,n){if(n&&n.classList.remove("neon-animating"),e&&e.classList.remove("neon-animating"),!n||!e)for(var i,r=t(this.$.content).getDistributedNodes(),o=0;i=r[o];o++)i.classList&&i.classList.remove("neon-animating");this.async(this._notifyPageResize)},_onNeonAnimationFinish:function(t){this._squelchNextFinishEvent?this._squelchNextFinishEvent=!1:this._completeSelectedChanged(t.detail.fromPage,t.detail.toPage)},_notifyPageResize:function(){var t=this.selectedItem||this._valueToItem(this.selected);this.resizerShouldNotify=function(e){return e==t},this.notifyResize()}}),
|
|
3342
3342
|
/**
|
|
3343
3343
|
@license
|
|
3344
3344
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3349,7 +3349,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3349
3349
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3350
3350
|
found at http://polymer.github.io/PATENTS.txt
|
|
3351
3351
|
*/
|
|
3352
|
-
e({_template:
|
|
3352
|
+
e({_template:n`
|
|
3353
3353
|
<style>
|
|
3354
3354
|
:host {
|
|
3355
3355
|
display: block;
|
|
@@ -3368,7 +3368,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3368
3368
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3369
3369
|
found at http://polymer.github.io/PATENTS.txt
|
|
3370
3370
|
*/
|
|
3371
|
-
e({is:"cascaded-animation",behaviors:[z],configure:function(t){this._animations=[];var e=t.nodes,
|
|
3371
|
+
e({is:"cascaded-animation",behaviors:[z],configure:function(t){this._animations=[];var e=t.nodes,n=[],i=t.nodeDelay||50;t.timing=t.timing||{},t.timing.delay=t.timing.delay||0;for(var r,o,a=t.timing.delay,s=0;o=e[s];s++){t.timing.delay+=i,t.node=o;var l=document.createElement(t.animation);if(!l.isNeonAnimation){console.warn(this.is+":",t.animation,"not found!"),r=!0;break}var c=l.configure(t);this._animations.push(l),n.push(c)}if(t.timing.delay=a,t.node=null,!r)return this._effect=new GroupEffect(n),this._effect},complete:function(){for(var t,e=0;t=this._animations[e];e++)t.complete(t.config)}});
|
|
3372
3372
|
/**
|
|
3373
3373
|
@license
|
|
3374
3374
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3379,7 +3379,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3379
3379
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3380
3380
|
found at http://polymer.github.io/PATENTS.txt
|
|
3381
3381
|
*/
|
|
3382
|
-
const _s=[z,{properties:{sharedElements:{type:Object}},findSharedElements:function(t){var e=t.fromPage,
|
|
3382
|
+
const _s=[z,{properties:{sharedElements:{type:Object}},findSharedElements:function(t){var e=t.fromPage,n=t.toPage;if(!e||!n)return console.warn(this.is+":",e?"toPage":"fromPage","is undefined!"),null;if(!e.sharedElements||!n.sharedElements)return console.warn(this.is+":","sharedElements are undefined for",e.sharedElements?n:e),null;var i=e.sharedElements[t.id],r=n.sharedElements[t.id];return i&&r?(this.sharedElements={from:i,to:r},this.sharedElements):(console.warn(this.is+":","sharedElement with id",t.id,"not found in",i?n:e),null)}}];
|
|
3383
3383
|
/**
|
|
3384
3384
|
@license
|
|
3385
3385
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3390,7 +3390,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3390
3390
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3391
3391
|
found at http://polymer.github.io/PATENTS.txt
|
|
3392
3392
|
*/
|
|
3393
|
-
e({is:"hero-animation",behaviors:[_s],configure:function(t){var e=this.findSharedElements(t);if(e){var
|
|
3393
|
+
e({is:"hero-animation",behaviors:[_s],configure:function(t){var e=this.findSharedElements(t);if(e){var n=e.from.getBoundingClientRect(),i=e.to.getBoundingClientRect(),r=n.left-i.left,o=n.top-i.top,a=n.width/i.width,s=n.height/i.height;return this._effect=new KeyframeEffect(e.to,[{transform:"translate("+r+"px,"+o+"px) scale("+a+","+s+")"},{transform:"none"}],this.timingFromConfig(t)),this.setPrefixedProperty(e.to,"transformOrigin","0 0"),e.to.style.zIndex=1e4,e.from.style.visibility="hidden",this._effect}},complete:function(t){var e=this.findSharedElements(t);if(!e)return null;e.to.style.zIndex="",e.from.style.visibility=""}}),
|
|
3394
3394
|
/**
|
|
3395
3395
|
@license
|
|
3396
3396
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3412,7 +3412,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3412
3412
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3413
3413
|
found at http://polymer.github.io/PATENTS.txt
|
|
3414
3414
|
*/
|
|
3415
|
-
e({is:"ripple-animation",behaviors:[_s],configure:function(t){var e,i
|
|
3415
|
+
e({is:"ripple-animation",behaviors:[_s],configure:function(t){var e,n,i=this.findSharedElements(t);if(!i)return null;var r=i.to.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),n=t.gesture.y-(r.top+r.height/2);else{var o=i.from.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),n=o.top+o.height/2-(r.top+r.height/2)}var a="translate("+e+"px,"+n+"px)",s=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(n)),l=Math.sqrt(2*s*s),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(i.to,[{transform:a+" scale(0)"},{transform:a+" "+c}],this.timingFromConfig(t)),this.setPrefixedProperty(i.to,"transformOrigin","50% 50%"),i.to.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.to,"transformOrigin",""),this.sharedElements.to.style.borderRadius="")}}),
|
|
3416
3416
|
/**
|
|
3417
3417
|
@license
|
|
3418
3418
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3423,7 +3423,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3423
3423
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3424
3424
|
found at http://polymer.github.io/PATENTS.txt
|
|
3425
3425
|
*/
|
|
3426
|
-
e({is:"reverse-ripple-animation",behaviors:[_s],configure:function(t){var e,i
|
|
3426
|
+
e({is:"reverse-ripple-animation",behaviors:[_s],configure:function(t){var e,n,i=this.findSharedElements(t);if(!i)return null;var r=i.from.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),n=t.gesture.y-(r.top+r.height/2);else{var o=i.to.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),n=o.top+o.height/2-(r.top+r.height/2)}var a="translate("+e+"px,"+n+"px)",s=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(n)),l=Math.sqrt(2*s*s),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(i.from,[{transform:a+" "+c},{transform:a+" scale(0)"}],this.timingFromConfig(t)),this.setPrefixedProperty(i.from,"transformOrigin","50% 50%"),i.from.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.from,"transformOrigin",""),this.sharedElements.from.style.borderRadius="")}}),
|
|
3427
3427
|
/**
|
|
3428
3428
|
@license
|
|
3429
3429
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3434,7 +3434,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3434
3434
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3435
3435
|
found at http://polymer.github.io/PATENTS.txt
|
|
3436
3436
|
*/
|
|
3437
|
-
e({is:"scale-down-animation",behaviors:[z],configure:function(t){var e=t.node,
|
|
3437
|
+
e({is:"scale-down-animation",behaviors:[z],configure:function(t){var e=t.node,n="scale(0, 0)";return"x"===t.axis?n="scale(0, 1)":"y"===t.axis&&(n="scale(1, 0)"),this._effect=new KeyframeEffect(e,[{transform:"scale(1,1)"},{transform:n}],this.timingFromConfig(t)),t.transformOrigin&&this.setPrefixedProperty(e,"transformOrigin",t.transformOrigin),this._effect}}),
|
|
3438
3438
|
/**
|
|
3439
3439
|
@license
|
|
3440
3440
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3445,7 +3445,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3445
3445
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3446
3446
|
found at http://polymer.github.io/PATENTS.txt
|
|
3447
3447
|
*/
|
|
3448
|
-
e({is:"scale-up-animation",behaviors:[z],configure:function(t){var e=t.node,
|
|
3448
|
+
e({is:"scale-up-animation",behaviors:[z],configure:function(t){var e=t.node,n="scale(0)";return"x"===t.axis?n="scale(0, 1)":"y"===t.axis&&(n="scale(1, 0)"),this._effect=new KeyframeEffect(e,[{transform:n},{transform:"scale(1, 1)"}],this.timingFromConfig(t)),t.transformOrigin&&this.setPrefixedProperty(e,"transformOrigin",t.transformOrigin),this._effect}}),
|
|
3449
3449
|
/**
|
|
3450
3450
|
@license
|
|
3451
3451
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3544,7 +3544,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3544
3544
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3545
3545
|
found at http://polymer.github.io/PATENTS.txt
|
|
3546
3546
|
*/
|
|
3547
|
-
e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,
|
|
3547
|
+
e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,n=t.transformFrom||"none",i=t.transformTo||"none";return this._effect=new KeyframeEffect(e,[{transform:n},{transform:i}],this.timingFromConfig(t)),t.transformOrigin&&this.setPrefixedProperty(e,"transformOrigin",t.transformOrigin),this._effect}});class ws extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{label:{type:String},odds:{type:Array},name:{type:String},odd:{type:String,notify:!0}})}constructor(){super(),this.label="document.selectODD",this.odds=[]}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-update",this._onTargetUpdate.bind(this))}firstUpdated(){super.firstUpdated(),ws.waitOnce("pb-page-ready",()=>{this._refresh()})}render(){return $`
|
|
3548
3548
|
<paper-dropdown-menu id="menu" label="${r(this.label)}" name="${this.name}">
|
|
3549
3549
|
<paper-listbox id="odds" slot="dropdown-content" class="dropdown-content" selected="${this.odd}"
|
|
3550
3550
|
attr-for-selected="value" @selected-item-changed="${this._selected}">
|
|
@@ -3588,7 +3588,7 @@ e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,i=t
|
|
|
3588
3588
|
--paper-listbox-background-color: white;
|
|
3589
3589
|
width: 100%;
|
|
3590
3590
|
}
|
|
3591
|
-
`}_selected(){const t=this.shadowRoot.getElementById("templates").selected;t!==this.template&&(this.setParameter("template",t),window.location=this.getUrl().toString())}_handleTemplatesResponse(){const t=this.shadowRoot.getElementById("getTemplates");this._templates=t.lastResponse}}customElements.define("pb-select-template",xs);class ks extends
|
|
3591
|
+
`}_selected(){const t=this.shadowRoot.getElementById("templates").selected;t!==this.template&&(this.setParameter("template",t),window.location=this.getUrl().toString())}_handleTemplatesResponse(){const t=this.shadowRoot.getElementById("getTemplates");this._templates=t.lastResponse}}customElements.define("pb-select-template",xs);class ks extends Zn{static get properties(){return Object.assign(Object.assign({},super.properties),{},{longitude:{type:Number},latitude:{type:Number},label:{type:String},event:{type:String}})}constructor(){super(),this.event="mouseover"}connectedCallback(){super.connectedCallback(),this.addEventListener(this.event,()=>this.emitTo("pb-geolocation",{coordinates:{latitude:this.latitude,longitude:this.longitude},label:this.label,popup:this.popup,element:this}))}render(){return $`<span id="content"><slot></slot></span>`}get popup(){const t=this.querySelector("template");if(t){const e=document.createElement("div");return e.appendChild(t.content.cloneNode(!0)),e}return null}static get styles(){return P`
|
|
3592
3592
|
:host {
|
|
3593
3593
|
display: inline;
|
|
3594
3594
|
cursor: pointer;
|
|
@@ -3623,7 +3623,7 @@ e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,i=t
|
|
|
3623
3623
|
.highlight-off {
|
|
3624
3624
|
background-color: inherit;
|
|
3625
3625
|
}
|
|
3626
|
-
`}}customElements.define("pb-geolocation",ks);class zs extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{initial:{type:Number},_instances:{type:Array}})}constructor(){super(),this.initial=1,this._instances=[]}connectedCallback(){super.connectedCallback(),this.template=this.querySelector("template");const t=this.getParameters();if(this._computeInitial(t),0===this._instances.length)for(let e=0;e<this.initial;e++)this._add(t)}_computeInitial(t){const e=Object.keys(t).filter(t=>/\[\d+\]$/.test(t)).sort();if(e.length>0){const t=e[e.length-1].replace(/^.*\[(\d+)\]$/,"$1");this.initial=parseInt(t,10)}}setData(t){this._instances=[],this._computeInitial(t);for(let e=0;e<this.initial;e++)this._add(t);this.requestUpdate()}add(){this._add(),this.requestUpdate()}_add(t){const e=this._instances.length+1,
|
|
3626
|
+
`}}customElements.define("pb-geolocation",ks);class zs extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{initial:{type:Number},_instances:{type:Array}})}constructor(){super(),this.initial=1,this._instances=[]}connectedCallback(){super.connectedCallback(),this.template=this.querySelector("template");const t=this.getParameters();if(this._computeInitial(t),0===this._instances.length)for(let e=0;e<this.initial;e++)this._add(t)}_computeInitial(t){const e=Object.keys(t).filter(t=>/\[\d+\]$/.test(t)).sort();if(e.length>0){const t=e[e.length-1].replace(/^.*\[(\d+)\]$/,"$1");this.initial=parseInt(t,10)}}setData(t){this._instances=[],this._computeInitial(t);for(let e=0;e<this.initial;e++)this._add(t);this.requestUpdate()}add(){this._add(),this.requestUpdate()}_add(t){const e=this._instances.length+1,n=document.importNode(this.template.content,!0),i=document.createElement("div");i.appendChild(n),i.querySelectorAll("[name]").forEach(n=>{const i=`${n.name}[${e}]`;t&&t[i]&&("checkbox"===n.type||"radio"===n.type?n.checked=t[i]===n.value:n.value=t[i]),n.name=i}),this._instances.push(i)}_renumber(){this._instances.forEach((t,e)=>{t.querySelectorAll("[name]").forEach(t=>{const n=t.name.replace(/^(.*)\[\d+\]$/,"$1");t.name=`${n}[${e+1}]`})})}delete(t){this._instances.splice(t,1),this._renumber(),this.requestUpdate()}render(){return $`
|
|
3627
3627
|
<div class="instances">${this._instances.map(this.renderInstance.bind(this))}</div>
|
|
3628
3628
|
<paper-icon-button icon="add" @click="${this.add}"></paper-icon-button>
|
|
3629
3629
|
`}renderInstance(t,e){return $`
|
|
@@ -3662,7 +3662,7 @@ e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,i=t
|
|
|
3662
3662
|
max-height: var(--pb-facsimile-height, auto);
|
|
3663
3663
|
width: 100%;
|
|
3664
3664
|
}
|
|
3665
|
-
`}_initOpenSeadragon(){const t=O(this.prefixUrl+(this.prefixUrl.endsWith("/")?"":"/"));this.viewer=OpenSeadragon({element:this.shadowRoot.getElementById("viewer"),prefixUrl:t,preserveViewport:!0,sequenceMode:!0,showZoomControl:!0,showHomeControl:this.showHomeControl,showFullPageControl:this.showFullPageControl,showNavigator:this.showNavigator,showNavigationControl:this.showNavigationControl,showRotationControl:this.showRotationControl,autoHideControls:!1,visibilityRatio:1,minZoomLevel:1,defaultZoomLevel:this.defaultZoomLevel,constrainDuringPan:!0}),this.viewer.addHandler("open",()=>{this.resetZoom(),this.emitTo("pb-facsimile-status",{status:"loaded"})}),this.viewer.addHandler("open-failed",t=>{console.error("<pb-facsimile> open failed: %s",t.message),this.loaded=!1,this.emitTo("pb-facsimile-status",{status:"fail"})}),this._facsimileObserver(),this.signalReady()}_facsimileObserver(){if(!this.viewer)return;if(0===this._facsimiles.length)return this.viewer.close();const t=this._facsimiles.map(t=>"iiif"===this.type?`${this.baseUri}${t}/info.json`:{tileSource:{type:"image",url:`${this.baseUri}${t}`,buildPyramid:!1}});this.viewer.open(t),this.viewer.goToPage(0)}_clearAll(){this.viewer&&(this.resetZoom(),this.viewer.clearOverlays(),this.facsimiles=[])}_fragmentUpdateListener(t){this.facsimiles=this._getFacsimilesFromData(t.detail.root),this._facsimileObserver()}_getFacsimilesFromData(t){const e=[];return t.querySelectorAll("pb-facs-link").forEach(t=>{t.facs&&e.push(t.facs)}),console.log("<pb-facsimile> _getFacsimilesFromData",e),e}_showAnnotationListener(t){if(!this.viewer)return;const e="runtime-overlay";if(this.viewer.removeOverlay(this.overlay),!t.detail.file||0===t.detail.file)return console.error("file missing",t.detail);if(t.detail.coordinates&&(!t.detail.coordinates[0]||4!==t.detail.coordinates.length))return console.error("coords incomplete or missing",t.detail);const
|
|
3665
|
+
`}_initOpenSeadragon(){const t=O(this.prefixUrl+(this.prefixUrl.endsWith("/")?"":"/"));this.viewer=OpenSeadragon({element:this.shadowRoot.getElementById("viewer"),prefixUrl:t,preserveViewport:!0,sequenceMode:!0,showZoomControl:!0,showHomeControl:this.showHomeControl,showFullPageControl:this.showFullPageControl,showNavigator:this.showNavigator,showNavigationControl:this.showNavigationControl,showRotationControl:this.showRotationControl,autoHideControls:!1,visibilityRatio:1,minZoomLevel:1,defaultZoomLevel:this.defaultZoomLevel,constrainDuringPan:!0}),this.viewer.addHandler("open",()=>{this.resetZoom(),this.emitTo("pb-facsimile-status",{status:"loaded"})}),this.viewer.addHandler("open-failed",t=>{console.error("<pb-facsimile> open failed: %s",t.message),this.loaded=!1,this.emitTo("pb-facsimile-status",{status:"fail"})}),this._facsimileObserver(),this.signalReady()}_facsimileObserver(){if(!this.viewer)return;if(0===this._facsimiles.length)return this.viewer.close();const t=this._facsimiles.map(t=>"iiif"===this.type?`${this.baseUri}${t}/info.json`:{tileSource:{type:"image",url:`${this.baseUri}${t}`,buildPyramid:!1}});this.viewer.open(t),this.viewer.goToPage(0)}_clearAll(){this.viewer&&(this.resetZoom(),this.viewer.clearOverlays(),this.facsimiles=[])}_fragmentUpdateListener(t){this.facsimiles=this._getFacsimilesFromData(t.detail.root),this._facsimileObserver()}_getFacsimilesFromData(t){const e=[];return t.querySelectorAll("pb-facs-link").forEach(t=>{t.facs&&e.push(t.facs)}),console.log("<pb-facsimile> _getFacsimilesFromData",e),e}_showAnnotationListener(t){if(!this.viewer)return;const e="runtime-overlay";if(this.viewer.removeOverlay(this.overlay),!t.detail.file||0===t.detail.file)return console.error("file missing",t.detail);if(t.detail.coordinates&&(!t.detail.coordinates[0]||4!==t.detail.coordinates.length))return console.error("coords incomplete or missing",t.detail);const n=this._pageIndexByUrl(t.detail.file);if(n<0)return console.error("page not found",t.detail);if(this.viewer.currentPage()!==n&&this.viewer.goToPage(n),t.detail.coordinates){const[n,i,r,o]=t.detail.coordinates,a=this.viewer.viewport.viewportToImageRectangle(this.viewer.viewport.getBounds(!0));a.containsPoint(new OpenSeadragon.Point(n,i))||this.viewer.viewport.fitBoundsWithConstraints(this.viewer.viewport.imageToViewportRectangle(n,i,a.width,a.height));const s=this.overlay=document.createElement("div");s.id=e;const l=this.viewer.viewport.imageToViewportRectangle(n,i,r,o);this.viewer.addOverlay({element:s,location:l})}}_pageIndexByUrl(t){return this._facsimiles.indexOf(t)}resetZoom(){this.viewer&&this.viewer.viewport.goHome()}}customElements.define("pb-facsimile",Ss);class Cs extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{endpoint:{type:String},label:{type:String},endpoints:{type:Array},auto:{type:Boolean}})}constructor(){super(),this.endpoints=[],this.label="dts.endpoint"}connectedCallback(){super.connectedCallback(),this.endpoint=this.getParameter("endpoint")}updated(t){if(super.updated(),t.has("endpoints")){!this.shadowRoot.getElementById("endpoints").selectedItem&&this.auto&&this.endpoints.length>0&&(this.endpoint=this.endpoints[0].url)}}render(){return $`
|
|
3666
3666
|
<paper-dropdown-menu id="menu" label="${r(this.label)}">
|
|
3667
3667
|
<paper-listbox id="endpoints" slot="dropdown-content" class="dropdown-content" selected="${this.endpoint}" attr-for-selected="value"
|
|
3668
3668
|
@selected-item-changed="${this._selected}">
|
|
@@ -3673,7 +3673,7 @@ e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,i=t
|
|
|
3673
3673
|
:host {
|
|
3674
3674
|
display: block;
|
|
3675
3675
|
}
|
|
3676
|
-
`}_selected(){const t=this.shadowRoot.getElementById("endpoints").selectedItem;if(!t)return;const e=t.getAttribute("value");if(!e)return;const
|
|
3676
|
+
`}_selected(){const t=this.shadowRoot.getElementById("endpoints").selectedItem;if(!t)return;const e=t.getAttribute("value");if(!e)return;const n=this.endpoints.find(t=>t.url===e);this.setParameter("endpoint",n.url),this.pushHistory("dts-endpoint"),console.log("<dts-select-endpoint> Setting endpoint to %s",e),this.emitTo("dts-endpoint",{endpoint:n.url,collection:n.collection,reload:!this.endpoint}),this.endpoint=n.url}}customElements.define("dts-select-endpoint",Cs);class Es extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{baseUri:{type:String},data:{type:Object},collection:{type:String},page:{type:Number},perPage:{type:Number},_collectionEndpoint:{type:String}})}constructor(){super(),this._parentCollections=[],this.collection="default"}connectedCallback(){super.connectedCallback(),this.collection=this.getParameter("id"),this.page=this.getParameter("page"),this.subscribeTo("dts-endpoint",t=>{this._setEndpoint(t.detail.endpoint,t.detail.collection,t.detail.reload)}),this.subscribeTo("pb-load",t=>{this.page=t.detail.params.page,console.log("<dts-client> Loading page %d",this.page),this._update()})}firstUpdated(){super.firstUpdated(),this.queryAPI=this.shadowRoot.getElementById("queryAPI"),this.documentsAPI=this.shadowRoot.getElementById("documentsAPI"),this.signalReady()}_setEndpoint(t,e,n){n||(this.page=null),this.collection=e,this._configureEndpoint(t),this.baseUri=t}_configureEndpoint(t){t&&(console.log("<dts-client> initializing connection to endpoint %s",t),this.emitTo("pb-start-update"),this.queryAPI.url=t,this.queryAPI.generateRequest())}_navigate(t,e,n=!0){t.preventDefault(),n&&this._parentCollections.push(this.collection),this.collection=e&&"object"==typeof e?e["@id"]:e,this.page=null,console.log("<dts-client> navigating to collection %s",this.collection),this._update()}_navigateUp(t){0!==this._parentCollections.length&&this._navigate(t,this._parentCollections.pop(),!1)}_preview(t,e){t.preventDefault(),this.emitTo("pb-start-update");const n=e["dts:passage"]||e["dts:download"],i=new URL(n,this.baseUri).toString();console.log("<dts-client> downloading %s",i),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={preview:i,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:i,temp:!0}),this.documentsAPI.generateRequest()}_download(t,e){this.emitTo("pb-start-update");const n=e["dts:passage"]||e["dts:download"],i=new URL(n,this.baseUri).toString();console.log("<dts-client> importing %s",i),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={import:i,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:i,temp:!1}),this.documentsAPI.generateRequest()}_update(){this.emitTo("pb-start-update");const t={};this.collection&&(t.id=this.collection,this.setParameter("id",this.collection)),this.page&&(t.page=this.page+1,this.setParameter("page",this.page)),this.pushHistory("dts-client-navigate"),this.queryAPI.params=t,this.queryAPI.url=this._collectionEndpoint,this.queryAPI.generateRequest()}_handleResponse(){const t=this.queryAPI.lastResponse;"EntryPoint"===t["@type"]?(this._collectionEndpoint=new URL(t.collections,this.baseUri).toString(),console.log("<dts-client> configured collection endpoint: %s",this._collectionEndpoint),this._update()):(this.data=t,console.log("<dts-client> received collection data: %o",t),!this.page&&t.totalItems>t.member.length&&(this.perPage=t.member.length),this.emitTo("pb-results-received",{start:this.page&&this.page>0?this.page*this.perPage+1:1,count:t.totalItems})),this.emitTo("pb-end-update")}_handlePreview(){const t=this.documentsAPI.lastResponse;this.emitTo("pb-end-update");const e=new URL(t.path,window.location.href);window.location=e}_handleError(t){this.emitTo("pb-end-update");const e=t.target.lastError.response,n=(new DOMParser).parseFromString(e,"application/xml").querySelector("message"),i=document.getElementById("errorDialog"),r=i.querySelector("paper-dialog-scrollable");r.innerHTML=n?n.textContent:t.detail.error.message,i.open()}static _getCreator(t){const e=t["dts:dublincore"];return e?e["dc:creator"]:null}static _getLicense(t){const e=t["dts:dublincore"];return e?e["dc:license"]:null}render(){return $`
|
|
3677
3677
|
<slot name="toolbar"></slot>
|
|
3678
3678
|
${this.baseUri?this._renderClient():""}
|
|
3679
3679
|
|
|
@@ -3777,7 +3777,7 @@ e({is:"transform-animation",behaviors:[z],configure:function(t){var e=t.node,i=t
|
|
|
3777
3777
|
iframe {
|
|
3778
3778
|
width: 100%;
|
|
3779
3779
|
}
|
|
3780
|
-
`}}customElements.define("pb-codepen",Ms),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).marked=e()}(void 0,(function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}function i(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var a=o((function(t){function e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function i(e){t.exports.defaults=e}t.exports={defaults:e(),getDefaults:e,changeDefaults:i}})),s=/[&<>"']/,l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(t){return p[t]};function u(t,e){if(e){if(s.test(t))return t.replace(l,d)}else if(c.test(t))return t.replace(h,d);return t}var g=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function f(t){return t.replace(g,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var m=/(^|[^\[])\^/g;function v(t,e){t=t.source||t,e=e||"";var i={replace:function(e,n){return n=(n=n.source||n).replace(m,"$1"),t=t.replace(e,n),i},getRegex:function(){return new RegExp(t,e)}};return i}var b=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(t,e,i){if(t){var n;try{n=decodeURIComponent(f(i)).replace(b,"").toLowerCase()}catch(t){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}e&&!y.test(i)&&(i=A(e,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(t){return null}return i}var w={},x=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,z=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(t,e){w[" "+t]||(x.test(t)?w[" "+t]=t+"/":w[" "+t]=E(t,"/",!0));var i=-1===(t=w[" "+t]).indexOf(":");return"//"===e.substring(0,2)?i?e:t.replace(k,"$1")+e:"/"===e.charAt(0)?i?e:t.replace(z,"$1")+e:t+e}function S(t){for(var e,i,n=1;n<arguments.length;n++)for(i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}function C(t,e){var i=t.replace(/\|/g,(function(t,e,i){for(var n=!1,r=e;--r>=0&&"\\"===i[r];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function E(t,e,i){var n=t.length;if(0===n)return"";for(var r=0;r<n;){var o=t.charAt(n-r-1);if(o!==e||i){if(o===e||!i)break;r++}else r++}return t.substr(0,n-r)}function M(t,e){if(-1===t.indexOf(e[1]))return-1;for(var i=t.length,n=0,r=0;r<i;r++)if("\\"===t[r])r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&--n<0)return r;return-1}function L(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function H(t,e){if(e<1)return"";for(var i="";e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+t}var T={escape:u,unescape:f,edit:v,cleanUrl:_,resolveUrl:A,noopTest:{exec:function(){}},merge:S,splitCells:C,rtrim:E,findClosingBracket:M,checkSanitizeDeprecation:L,repeatString:H},V=a.defaults,$=T.rtrim,O=T.splitCells,P=T.escape,R=T.findClosingBracket;function I(t,e,i){var n=e.href,r=e.title?P(e.title):null,o=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:i,href:n,title:r,text:o}:{type:"image",raw:i,href:n,title:r,text:P(o)}}function N(t,e){var i=t.match(/^(\s+)(?:```)/);if(null===i)return e;var n=i[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=n.length?t.slice(n.length):t})).join("\n")}var F=function(){function t(t){this.options=t||V}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var i=this.rules.block.code.exec(t);if(i){var n=e[e.length-1];if(n&&"paragraph"===n.type)return{raw:i[0],text:i[0].trimRight()};var r=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:$(r,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var i=e[0],n=N(i,e[3]||"");return{type:"code",raw:i,lang:e[2]?e[2].trim():e[2],text:n}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var i=e[2].trim();if(/#$/.test(i)){var n=$(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:i}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var i={type:"table",header:O(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(i.header.length===i.align.length){var n,r=i.align.length;for(n=0;n<r;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(r=i.cells.length,n=0;n<r;n++)i.cells[n]=O(i.cells[n],i.header.length);return i}}},e.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},e.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var i=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],text:i}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var i,n,r,o,a,s,l,c,h=e[0],p=e[2],d=p.length>1,u={type:"list",raw:h,ordered:d,start:d?+p.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),f=!1,m=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var v=0;v<m;v++){if(h=i=g[v],v!==m-1){if(o=this.rules.block.listItemStart.exec(g[v+1]),this.options.pedantic?o[1].length>r[1].length:o[1].length>r[0].length||o[1].length>3){g.splice(v,2,g[v]+"\n"+g[v+1]),v--,m--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==p[p.length-1]:d===(1===o[2].length))&&(a=g.slice(v+1).join("\n"),u.raw=u.raw.substring(0,u.raw.length-a.length),v=m-1),r=o}n=i.length,~(i=i.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(n-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+n+"}","gm"),"")),s=f||/\n\n(?!\s*$)/.test(i),v!==m-1&&(f="\n"===i.charAt(i.length-1),s||(s=f)),s&&(u.loose=!0),this.options.gfm&&(c=void 0,(l=/^\[[ xX]\] /.test(i))&&(c=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,""))),u.items.push({type:"list_item",raw:h,task:l,checked:c,loose:s,text:i})}return u}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):P(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var i={type:"table",header:O(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=e[0];var n,r=i.align.length;for(n=0;n<r;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(r=i.cells.length,n=0;n<r;n++)i.cells[n]=O(i.cells[n].replace(/^ *\| *| *\| *$/g,""),i.header.length);return i}}},e.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1]}},e.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e)return{type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1]}},e.text=function(t,e){var i=this.rules.block.text.exec(t);if(i){var n=e[e.length-1];return n&&"text"===n.type?{raw:i[0],text:i[0]}:{type:"text",raw:i[0],text:i[0]}}},e.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:P(e[1])}},e.tag=function(t,e,i){var n=this.rules.inline.tag.exec(t);if(n)return!e&&/^<a /i.test(n[0])?e=!0:e&&/^<\/a>/i.test(n[0])&&(e=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:e,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):P(n[0]):n[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var i=e[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=$(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var o=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}var a=e[2],s="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(a=this.options.pedantic&&!/>$/.test(i)?a.slice(1):a.slice(1,-1)),I(e,{href:a?a.replace(this.rules.inline._escapes,"$1"):a,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0])}},e.reflink=function(t,e){var i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=e[n.toLowerCase()])||!n.href){var r=i[0].charAt(0);return{type:"text",raw:r,text:r}}return I(i,n,i[0])}},e.strong=function(t,e,i){void 0===i&&(i="");var n=this.rules.inline.strong.start.exec(t);if(n&&(!n[1]||n[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var r,o="**"===n[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(n=o.exec(e));)if(r=this.rules.inline.strong.middle.exec(e.slice(0,n.index+3)))return{type:"strong",raw:t.slice(0,r[0].length),text:t.slice(2,r[0].length-2)}}},e.em=function(t,e,i){void 0===i&&(i="");var n=this.rules.inline.em.start.exec(t);if(n&&(!n[1]||n[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var r,o="*"===n[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(n=o.exec(e));)if(r=this.rules.inline.em.middle.exec(e.slice(0,n.index+2)))return{type:"em",raw:t.slice(0,r[0].length),text:t.slice(1,r[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var i=e[2].replace(/\n/g," "),n=/[^ ]/.test(i),r=/^ /.test(i)&&/ $/.test(i);return n&&r&&(i=i.substring(1,i.length-1)),i=P(i,!0),{type:"codespan",raw:e[0],text:i}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var i,n,r=this.rules.inline.autolink.exec(t);if(r)return n="@"===r[2]?"mailto:"+(i=P(this.options.mangle?e(r[1]):r[1])):i=P(r[1]),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},e.url=function(t,e){var i;if(i=this.rules.inline.url.exec(t)){var n,r;if("@"===i[2])r="mailto:"+(n=P(this.options.mangle?e(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=P(i[0]),r="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},e.inlineText=function(t,e,i){var n,r=this.rules.inline.text.exec(t);if(r)return n=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):P(r[0]):r[0]:P(this.options.smartypants?i(r[0]):r[0]),{type:"text",raw:r[0],text:n}},t}(),B=T.noopTest,D=T.edit,j=T.merge,q={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};q.def=D(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,q.item=D(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.listItemStart=D(/^( *)(bull)/).replace("bull",q.bullet).getRegex(),q.list=D(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",q._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,q.html=D(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=D(q._paragraph).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.blockquote=D(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=j({},q),q.gfm=j({},q.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),q.gfm.nptable=D(q.gfm.nptable).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.gfm.table=D(q.gfm.table).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.pedantic=j({},q.normal,{html:D("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,paragraph:D(q.normal._paragraph).replace("hr",q.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var U={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};U.punctuation=D(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U._comment=D(q._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),U.em.start=D(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=D(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=D(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=D(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=D(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=D(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.strong.endAst=D(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=D(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=D(U._blockSkip,"g").getRegex(),U.overlapSkip=D(U._overlapSkip,"g").getRegex(),U._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,U._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,U._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,U.autolink=D(U.autolink).replace("scheme",U._scheme).replace("email",U._email).getRegex(),U._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,U.tag=D(U.tag).replace("comment",U._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=D(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=D(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=D(U.reflinkSearch,"g").replace("reflink",U.reflink).replace("nolink",U.nolink).getRegex(),U.normal=j({},U),U.pedantic=j({},U.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=j({},U.normal,{escape:D(U.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),U.gfm.url=D(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=j({},U.gfm,{br:D(U.br).replace("{2,}","*").getRegex(),text:D(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var W={block:q,inline:U},G=a.defaults,X=W.block,K=W.inline,Z=T.repeatString;function Q(t){return t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Y(t){var e,i,n="",r=t.length;for(e=0;e<r;e++)i=t.charCodeAt(e),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}var J=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||G,this.options.tokenizer=this.options.tokenizer||new F,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:X.normal,inline:K.normal};this.options.pedantic?(e.block=X.pedantic,e.inline=K.pedantic):this.options.gfm&&(e.block=X.gfm,this.options.breaks?e.inline=K.breaks:e.inline=K.gfm),this.tokenizer.rules=e}t.lex=function(e,i){return new t(i).lex(e)},t.lexInline=function(e,i){return new t(i).inlineTokens(e)};var i=t.prototype;return i.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},i.blockTokens=function(t,e,i){var n,r,o,a;for(void 0===e&&(e=[]),void 0===i&&(i=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(n=this.tokenizer.space(t))t=t.substring(n.raw.length),n.type&&e.push(n);else if(n=this.tokenizer.code(t,e))t=t.substring(n.raw.length),n.type?e.push(n):((a=e[e.length-1]).raw+="\n"+n.raw,a.text+="\n"+n.text);else if(n=this.tokenizer.fences(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.heading(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.nptable(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.hr(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.blockquote(t))t=t.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),e.push(n);else if(n=this.tokenizer.list(t)){for(t=t.substring(n.raw.length),o=n.items.length,r=0;r<o;r++)n.items[r].tokens=this.blockTokens(n.items[r].text,[],!1);e.push(n)}else if(n=this.tokenizer.html(t))t=t.substring(n.raw.length),e.push(n);else if(i&&(n=this.tokenizer.def(t)))t=t.substring(n.raw.length),this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});else if(n=this.tokenizer.table(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.lheading(t))t=t.substring(n.raw.length),e.push(n);else if(i&&(n=this.tokenizer.paragraph(t)))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.text(t,e))t=t.substring(n.raw.length),n.type?e.push(n):((a=e[e.length-1]).raw+="\n"+n.raw,a.text+="\n"+n.text);else if(t){var s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return e},i.inline=function(t){var e,i,n,r,o,a,s=t.length;for(e=0;e<s;e++)switch((a=t[e]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},r=a.header.length,i=0;i<r;i++)a.tokens.header[i]=[],this.inlineTokens(a.header[i],a.tokens.header[i]);for(r=a.cells.length,i=0;i<r;i++)for(o=a.cells[i],a.tokens.cells[i]=[],n=0;n<o.length;n++)a.tokens.cells[i][n]=[],this.inlineTokens(o[n],a.tokens.cells[i][n]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(r=a.items.length,i=0;i<r;i++)this.inline(a.items[i].tokens)}return t},i.inlineTokens=function(t,e,i,n){var r;void 0===e&&(e=[]),void 0===i&&(i=!1),void 0===n&&(n=!1);var o,a,s,l=t;if(this.tokens.links){var c=Object.keys(this.tokens.links);if(c.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+Z("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+Z("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(a||(s=""),a=!1,r=this.tokenizer.escape(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.tag(t,i,n))t=t.substring(r.raw.length),i=r.inLink,n=r.inRawBlock,e.push(r);else if(r=this.tokenizer.link(t))t=t.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,n)),e.push(r);else if(r=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,n)),e.push(r);else if(r=this.tokenizer.strong(t,l,s))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],i,n),e.push(r);else if(r=this.tokenizer.em(t,l,s))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],i,n),e.push(r);else if(r=this.tokenizer.codespan(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.br(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.del(t))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],i,n),e.push(r);else if(r=this.tokenizer.autolink(t,Y))t=t.substring(r.raw.length),e.push(r);else if(i||!(r=this.tokenizer.url(t,Y))){if(r=this.tokenizer.inlineText(t,n,Q))t=t.substring(r.raw.length),s=r.raw.slice(-1),a=!0,e.push(r);else if(t){var h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}throw new Error(h)}}else t=t.substring(r.raw.length),e.push(r);return e},e(t,null,[{key:"rules",get:function(){return{block:X,inline:K}}}]),t}(),tt=a.defaults,et=T.cleanUrl,it=T.escape,nt=function(){function t(t){this.options=t||tt}var e=t.prototype;return e.code=function(t,e,i){var n=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,n);null!=r&&r!==t&&(i=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+it(n,!0)+'">'+(i?t:it(t,!0))+"</code></pre>\n":"<pre><code>"+(i?t:it(t,!0))+"</code></pre>\n"},e.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},e.html=function(t){return t},e.heading=function(t,e,i,n){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+n.slug(i)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},e.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.list=function(t,e,i){var n=e?"ol":"ul";return"<"+n+(e&&1!==i?' start="'+i+'"':"")+">\n"+t+"</"+n+">\n"},e.listitem=function(t){return"<li>"+t+"</li>\n"},e.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},e.paragraph=function(t){return"<p>"+t+"</p>\n"},e.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},e.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},e.tablecell=function(t,e){var i=e.header?"th":"td";return(e.align?"<"+i+' align="'+e.align+'">':"<"+i+">")+t+"</"+i+">\n"},e.strong=function(t){return"<strong>"+t+"</strong>"},e.em=function(t){return"<em>"+t+"</em>"},e.codespan=function(t){return"<code>"+t+"</code>"},e.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.del=function(t){return"<del>"+t+"</del>"},e.link=function(t,e,i){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return i;var n='<a href="'+it(t)+'"';return e&&(n+=' title="'+e+'"'),n+=">"+i+"</a>"},e.image=function(t,e,i){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return i;var n='<img src="'+t+'" alt="'+i+'"';return e&&(n+=' title="'+e+'"'),n+=this.options.xhtml?"/>":">"},e.text=function(t){return t},t}(),rt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,i){return""+i},e.image=function(t,e,i){return""+i},e.br=function(){return""},t}(),ot=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var i=t,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[t];do{i=t+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return e||(this.seen[t]=n,this.seen[i]=0),i},e.slug=function(t,e){void 0===e&&(e={});var i=this.serialize(t);return this.getNextSafeSlug(i,e.dryrun)},t}(),at=a.defaults,st=T.unescape,lt=function(){function t(t){this.options=t||at,this.options.renderer=this.options.renderer||new nt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new ot}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var i,n,r,o,a,s,l,c,h,p,d,u,g,f,m,v,b,y,_="",w=t.length;for(i=0;i<w;i++)switch((p=t[i]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(p.tokens),p.depth,st(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(c="",l="",o=p.header.length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(p.tokens.header[n]),{header:!0,align:p.align[n]});for(c+=this.renderer.tablerow(l),h="",o=p.cells.length,n=0;n<o;n++){for(l="",a=(s=p.tokens.cells[n]).length,r=0;r<a;r++)l+=this.renderer.tablecell(this.parseInline(s[r]),{header:!1,align:p.align[r]});h+=this.renderer.tablerow(l)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(p.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(d=p.ordered,u=p.start,g=p.loose,o=p.items.length,h="",n=0;n<o;n++)v=(m=p.items[n]).checked,b=m.task,f="",m.task&&(y=this.renderer.checkbox(v),g?m.tokens.length>0&&"text"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):f+=y),f+=this.parse(m.tokens,g),h+=this.renderer.listitem(f,b,v);_+=this.renderer.list(h,d,u);continue;case"html":_+=this.renderer.html(p.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(h=p.tokens?this.parseInline(p.tokens):p.text;i+1<w&&"text"===t[i+1].type;)h+="\n"+((p=t[++i]).tokens?this.parseInline(p.tokens):p.text);_+=e?this.renderer.paragraph(h):h;continue;default:var x='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(x);throw new Error(x)}return _},e.parseInline=function(t,e){e=e||this.renderer;var i,n,r="",o=t.length;for(i=0;i<o;i++)switch((n=t[i]).type){case"escape":r+=e.text(n.text);break;case"html":r+=e.html(n.text);break;case"link":r+=e.link(n.href,n.title,this.parseInline(n.tokens,e));break;case"image":r+=e.image(n.href,n.title,n.text);break;case"strong":r+=e.strong(this.parseInline(n.tokens,e));break;case"em":r+=e.em(this.parseInline(n.tokens,e));break;case"codespan":r+=e.codespan(n.text);break;case"br":r+=e.br();break;case"del":r+=e.del(this.parseInline(n.tokens,e));break;case"text":r+=e.text(n.text);break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return r},t}(),ct=T.merge,ht=T.checkSanitizeDeprecation,pt=T.escape,dt=a.getDefaults,ut=a.changeDefaults,gt=a.defaults;function ft(t,e,i){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(i=e,e=null),e=ct({},ft.defaults,e||{}),ht(e),i){var n,r=e.highlight;try{n=J.lex(t,e)}catch(t){return i(t)}var o=function(t){var o;if(!t)try{o=lt.parse(n,e)}catch(e){t=e}return e.highlight=r,t?i(t):i(null,o)};if(!r||r.length<3)return o();if(delete e.highlight,!n.length)return o();var a=0;return ft.walkTokens(n,(function(t){"code"===t.type&&(a++,setTimeout((function(){r(t.text,t.lang,(function(e,i){if(e)return o(e);null!=i&&i!==t.text&&(t.text=i,t.escaped=!0),0===--a&&o()}))}),0))})),void(0===a&&o())}try{var s=J.lex(t,e);return e.walkTokens&&ft.walkTokens(s,e.walkTokens),lt.parse(s,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+pt(t.message+"",!0)+"</pre>";throw t}}return ft.options=ft.setOptions=function(t){return ct(ft.defaults,t),ut(ft.defaults),ft},ft.getDefaults=dt,ft.defaults=gt,ft.use=function(t){var e=ct({},t);if(t.renderer&&function(){var i=ft.defaults.renderer||new nt,n=function(e){var n=i[e];i[e]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.renderer[e].apply(i,o);return!1===s&&(s=n.apply(i,o)),s}};for(var r in t.renderer)n(r);e.renderer=i}(),t.tokenizer&&function(){var i=ft.defaults.tokenizer||new F,n=function(e){var n=i[e];i[e]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.tokenizer[e].apply(i,o);return!1===s&&(s=n.apply(i,o)),s}};for(var r in t.tokenizer)n(r);e.tokenizer=i}(),t.walkTokens){var i=ft.defaults.walkTokens;e.walkTokens=function(e){t.walkTokens(e),i&&i(e)}}ft.setOptions(e)},ft.walkTokens=function(t,e){for(var i,n=r(t);!(i=n()).done;){var o=i.value;switch(e(o),o.type){case"table":for(var a,s=r(o.tokens.header);!(a=s()).done;){var l=a.value;ft.walkTokens(l,e)}for(var c,h=r(o.tokens.cells);!(c=h()).done;)for(var p,d=r(c.value);!(p=d()).done;){var u=p.value;ft.walkTokens(u,e)}break;case"list":ft.walkTokens(o.items,e);break;default:o.tokens&&ft.walkTokens(o.tokens,e)}}},ft.parseInline=function(t,e){if(null==t)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=ct({},ft.defaults,e||{}),ht(e);try{var i=J.lexInline(t,e);return e.walkTokens&&ft.walkTokens(i,e.walkTokens),lt.parseInline(i,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+pt(t.message+"",!0)+"</pre>";throw t}},ft.Parser=lt,ft.parser=lt.parse,ft.Renderer=nt,ft.TextRenderer=rt,ft.Lexer=J,ft.lexer=J.lex,ft.Tokenizer=F,ft.Slugger=ot,ft.parse=ft,ft}));const Ls=new window.marked.Renderer;function Hs(t){const e=t.match(/^[^\S]*(?=\S)/gm);return e&&e[0].length?(e.sort((t,e)=>t.length-e.length),e[0].length?t.replace(RegExp("^"+e[0],"gm"),""):t):t}Ls.code=function(t,e,i){return`<pb-code-highlight language="${e}" line-numbers>\n <template>${t}</template>\n </pb-code-highlight>`},window.marked.setOptions({renderer:Ls});class Ts extends(R(V)){static get properties(){return Object.assign({content:{type:String},url:{type:String}},super.properties)}constructor(){super(),this._url=null}set url(t){this._url=t,Ts.waitOnce("pb-page-ready",t=>{this._load(t.endpoint)})}connectedCallback(){if(super.connectedCallback(),this.style.display="block",!this.content){const t=document.createElement("div");for(let e=0;e<this.childNodes.length;e++){const i=this.childNodes[e];t.appendChild(document.importNode(i.content||i,!0))}this.content=Hs(t.innerHTML)}this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)})}_load(t){const e=this.toAbsoluteURL(this._url,t);fetch(e,{credentials:"same-origin"}).then(t=>t.text()).catch(()=>(console.error("<pb-markdown> failed to load content from %s",e.toString()),Promise.resolve(this.content))).then(t=>{this.content=t})}createRenderRoot(){return this}render(){return this.content?$`<div>${E(window.marked(this.content))}</div>`:null}zoom(t){const e=window.getComputedStyle(this).getPropertyValue("font-size"),i=parseInt(e.replace(/^(\d+)px/,"$1"));this.style.fontSize="in"===t?i+1+"px":i-1+"px"}}customElements.define("pb-markdown",Ts);const Vs=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const e=t.target;e.emitTo("pb-visible",{data:e.data})}})});class $s extends(R(V)){static get properties(){return Object.assign({data:{type:String}},super.properties)}disconnectedCallback(){super.disconnectedCallback(),Vs&&Vs.unobserve(this)}firstUpdated(){Vs.observe(this)}render(){return $`<slot></slot>`}static get styles(){return P`
|
|
3780
|
+
`}}customElements.define("pb-codepen",Ms),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).marked=e()}(void 0,(function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}function n(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function r(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=n(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=t[Symbol.iterator]()).next.bind(i)}function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var a=o((function(t){function e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function n(e){t.exports.defaults=e}t.exports={defaults:e(),getDefaults:e,changeDefaults:n}})),s=/[&<>"']/,l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(t){return p[t]};function u(t,e){if(e){if(s.test(t))return t.replace(l,d)}else if(c.test(t))return t.replace(h,d);return t}var g=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function f(t){return t.replace(g,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var m=/(^|[^\[])\^/g;function v(t,e){t=t.source||t,e=e||"";var n={replace:function(e,i){return i=(i=i.source||i).replace(m,"$1"),t=t.replace(e,i),n},getRegex:function(){return new RegExp(t,e)}};return n}var b=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(t,e,n){if(t){var i;try{i=decodeURIComponent(f(n)).replace(b,"").toLowerCase()}catch(t){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}e&&!y.test(n)&&(n=A(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}var w={},x=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,z=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(t,e){w[" "+t]||(x.test(t)?w[" "+t]=t+"/":w[" "+t]=E(t,"/",!0));var n=-1===(t=w[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(k,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(z,"$1")+e:t+e}function S(t){for(var e,n,i=1;i<arguments.length;i++)for(n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function C(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function E(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r<i;){var o=t.charAt(i-r-1);if(o!==e||n){if(o===e||!n)break;r++}else r++}return t.substr(0,i-r)}function M(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,i=0,r=0;r<n;r++)if("\\"===t[r])r++;else if(t[r]===e[0])i++;else if(t[r]===e[1]&&--i<0)return r;return-1}function L(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function H(t,e){if(e<1)return"";for(var n="";e>1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}var T={escape:u,unescape:f,edit:v,cleanUrl:_,resolveUrl:A,noopTest:{exec:function(){}},merge:S,splitCells:C,rtrim:E,findClosingBracket:M,checkSanitizeDeprecation:L,repeatString:H},V=a.defaults,$=T.rtrim,O=T.splitCells,P=T.escape,R=T.findClosingBracket;function I(t,e,n){var i=e.href,r=e.title?P(e.title):null,o=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:P(o)}}function N(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t})).join("\n")}var F=function(){function t(t){this.options=t||V}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var n=this.rules.block.code.exec(t);if(n){var i=e[e.length-1];if(i&&"paragraph"===i.type)return{raw:n[0],text:n[0].trimRight()};var r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:$(r,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=N(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=$(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:O(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=O(n.cells[i],n.header.length);return n}}},e.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},e.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,o,a,s,l,c,h=e[0],p=e[2],d=p.length>1,u={type:"list",raw:h,ordered:d,start:d?+p.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),f=!1,m=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var v=0;v<m;v++){if(h=n=g[v],v!==m-1){if(o=this.rules.block.listItemStart.exec(g[v+1]),this.options.pedantic?o[1].length>r[1].length:o[1].length>r[0].length||o[1].length>3){g.splice(v,2,g[v]+"\n"+g[v+1]),v--,m--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==p[p.length-1]:d===(1===o[2].length))&&(a=g.slice(v+1).join("\n"),u.raw=u.raw.substring(0,u.raw.length-a.length),v=m-1),r=o}i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),s=f||/\n\n(?!\s*$)/.test(n),v!==m-1&&(f="\n"===n.charAt(n.length-1),s||(s=f)),s&&(u.loose=!0),this.options.gfm&&(c=void 0,(l=/^\[[ xX]\] /.test(n))&&(c=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),u.items.push({type:"list_item",raw:h,task:l,checked:c,loose:s,text:n})}return u}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):P(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:O(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=O(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},e.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1]}},e.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e)return{type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1]}},e.text=function(t,e){var n=this.rules.block.text.exec(t);if(n){var i=e[e.length-1];return i&&"text"===i.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}},e.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:P(e[1])}},e.tag=function(t,e,n){var i=this.rules.inline.tag.exec(t);if(i)return!e&&/^<a /i.test(i[0])?e=!0:e&&/^<\/a>/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):P(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=$(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=R(e[2],"()");if(r>-1){var o=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}var a=e[2],s="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(a=this.options.pedantic&&!/>$/.test(n)?a.slice(1):a.slice(1,-1)),I(e,{href:a?a.replace(this.rules.inline._escapes,"$1"):a,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return I(n,i,n[0])}},e.strong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.strong.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.strong.middle.exec(e.slice(0,i.index+3)))return{type:"strong",raw:t.slice(0,r[0].length),text:t.slice(2,r[0].length-2)}}},e.em=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.em.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.em.middle.exec(e.slice(0,i.index+2)))return{type:"em",raw:t.slice(0,r[0].length),text:t.slice(1,r[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=P(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=P(this.options.mangle?e(r[1]):r[1])):n=P(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=P(this.options.mangle?e(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=P(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):P(r[0]):r[0]:P(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),B=T.noopTest,D=T.edit,j=T.merge,q={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};q.def=D(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,q.item=D(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.listItemStart=D(/^( *)(bull)/).replace("bull",q.bullet).getRegex(),q.list=D(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",q._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,q.html=D(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=D(q._paragraph).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.blockquote=D(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=j({},q),q.gfm=j({},q.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),q.gfm.nptable=D(q.gfm.nptable).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.gfm.table=D(q.gfm.table).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.pedantic=j({},q.normal,{html:D("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,paragraph:D(q.normal._paragraph).replace("hr",q.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var U={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};U.punctuation=D(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U._comment=D(q._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),U.em.start=D(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=D(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=D(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=D(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=D(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=D(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.strong.endAst=D(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=D(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=D(U._blockSkip,"g").getRegex(),U.overlapSkip=D(U._overlapSkip,"g").getRegex(),U._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,U._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,U._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,U.autolink=D(U.autolink).replace("scheme",U._scheme).replace("email",U._email).getRegex(),U._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,U.tag=D(U.tag).replace("comment",U._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=D(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=D(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=D(U.reflinkSearch,"g").replace("reflink",U.reflink).replace("nolink",U.nolink).getRegex(),U.normal=j({},U),U.pedantic=j({},U.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=j({},U.normal,{escape:D(U.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),U.gfm.url=D(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=j({},U.gfm,{br:D(U.br).replace("{2,}","*").getRegex(),text:D(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var W={block:q,inline:U},G=a.defaults,X=W.block,K=W.inline,Z=T.repeatString;function Q(t){return t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Y(t){var e,n,i="",r=t.length;for(e=0;e<r;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var J=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||G,this.options.tokenizer=this.options.tokenizer||new F,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:X.normal,inline:K.normal};this.options.pedantic?(e.block=X.pedantic,e.inline=K.pedantic):this.options.gfm&&(e.block=X.gfm,this.options.breaks?e.inline=K.breaks:e.inline=K.gfm),this.tokenizer.rules=e}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n=t.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var i,r,o,a;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(i=this.tokenizer.space(t))t=t.substring(i.raw.length),i.type&&e.push(i);else if(i=this.tokenizer.code(t,e))t=t.substring(i.raw.length),i.type?e.push(i):((a=e[e.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(i=this.tokenizer.fences(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.heading(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.nptable(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.hr(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.blockquote(t))t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);else if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),o=i.items.length,r=0;r<o;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);e.push(i)}else if(i=this.tokenizer.html(t))t=t.substring(i.raw.length),e.push(i);else if(n&&(i=this.tokenizer.def(t)))t=t.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.lheading(t))t=t.substring(i.raw.length),e.push(i);else if(n&&(i=this.tokenizer.paragraph(t)))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.text(t,e))t=t.substring(i.raw.length),i.type?e.push(i):((a=e[e.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(t){var s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return e},n.inline=function(t){var e,n,i,r,o,a,s=t.length;for(e=0;e<s;e++)switch((a=t[e]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},r=a.header.length,n=0;n<r;n++)a.tokens.header[n]=[],this.inlineTokens(a.header[n],a.tokens.header[n]);for(r=a.cells.length,n=0;n<r;n++)for(o=a.cells[n],a.tokens.cells[n]=[],i=0;i<o.length;i++)a.tokens.cells[n][i]=[],this.inlineTokens(o[i],a.tokens.cells[n][i]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(r=a.items.length,n=0;n<r;n++)this.inline(a.items[n].tokens)}return t},n.inlineTokens=function(t,e,n,i){var r;void 0===e&&(e=[]),void 0===n&&(n=!1),void 0===i&&(i=!1);var o,a,s,l=t;if(this.tokens.links){var c=Object.keys(this.tokens.links);if(c.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+Z("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+Z("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(a||(s=""),a=!1,r=this.tokenizer.escape(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.tag(t,n,i))t=t.substring(r.raw.length),n=r.inLink,i=r.inRawBlock,e.push(r);else if(r=this.tokenizer.link(t))t=t.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),e.push(r);else if(r=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),e.push(r);else if(r=this.tokenizer.strong(t,l,s))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),e.push(r);else if(r=this.tokenizer.em(t,l,s))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),e.push(r);else if(r=this.tokenizer.codespan(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.br(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.del(t))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),e.push(r);else if(r=this.tokenizer.autolink(t,Y))t=t.substring(r.raw.length),e.push(r);else if(n||!(r=this.tokenizer.url(t,Y))){if(r=this.tokenizer.inlineText(t,i,Q))t=t.substring(r.raw.length),s=r.raw.slice(-1),a=!0,e.push(r);else if(t){var h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}throw new Error(h)}}else t=t.substring(r.raw.length),e.push(r);return e},e(t,null,[{key:"rules",get:function(){return{block:X,inline:K}}}]),t}(),tt=a.defaults,et=T.cleanUrl,nt=T.escape,it=function(){function t(t){this.options=t||tt}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+nt(i,!0)+'">'+(n?t:nt(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:nt(t,!0))+"</code></pre>\n"},e.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+i.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},e.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+i+">\n"},e.listitem=function(t){return"<li>"+t+"</li>\n"},e.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},e.paragraph=function(t){return"<p>"+t+"</p>\n"},e.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},e.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},e.strong=function(t){return"<strong>"+t+"</strong>"},e.em=function(t){return"<em>"+t+"</em>"},e.codespan=function(t){return"<code>"+t+"</code>"},e.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.del=function(t){return"<del>"+t+"</del>"},e.link=function(t,e,n){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<a href="'+nt(t)+'"';return e&&(i+=' title="'+e+'"'),i+=">"+n+"</a>"},e.image=function(t,e,n){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<img src="'+t+'" alt="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">"},e.text=function(t){return t},t}(),rt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),ot=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),at=a.defaults,st=T.unescape,lt=function(){function t(t){this.options=t||at,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new ot}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,o,a,s,l,c,h,p,d,u,g,f,m,v,b,y,_="",w=t.length;for(n=0;n<w;n++)switch((p=t[n]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(p.tokens),p.depth,st(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(c="",l="",o=p.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(p.tokens.header[i]),{header:!0,align:p.align[i]});for(c+=this.renderer.tablerow(l),h="",o=p.cells.length,i=0;i<o;i++){for(l="",a=(s=p.tokens.cells[i]).length,r=0;r<a;r++)l+=this.renderer.tablecell(this.parseInline(s[r]),{header:!1,align:p.align[r]});h+=this.renderer.tablerow(l)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(p.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(d=p.ordered,u=p.start,g=p.loose,o=p.items.length,h="",i=0;i<o;i++)v=(m=p.items[i]).checked,b=m.task,f="",m.task&&(y=this.renderer.checkbox(v),g?m.tokens.length>0&&"text"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):f+=y),f+=this.parse(m.tokens,g),h+=this.renderer.listitem(f,b,v);_+=this.renderer.list(h,d,u);continue;case"html":_+=this.renderer.html(p.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(h=p.tokens?this.parseInline(p.tokens):p.text;n+1<w&&"text"===t[n+1].type;)h+="\n"+((p=t[++n]).tokens?this.parseInline(p.tokens):p.text);_+=e?this.renderer.paragraph(h):h;continue;default:var x='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(x);throw new Error(x)}return _},e.parseInline=function(t,e){e=e||this.renderer;var n,i,r="",o=t.length;for(n=0;n<o;n++)switch((i=t[n]).type){case"escape":r+=e.text(i.text);break;case"html":r+=e.html(i.text);break;case"link":r+=e.link(i.href,i.title,this.parseInline(i.tokens,e));break;case"image":r+=e.image(i.href,i.title,i.text);break;case"strong":r+=e.strong(this.parseInline(i.tokens,e));break;case"em":r+=e.em(this.parseInline(i.tokens,e));break;case"codespan":r+=e.codespan(i.text);break;case"br":r+=e.br();break;case"del":r+=e.del(this.parseInline(i.tokens,e));break;case"text":r+=e.text(i.text);break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return r},t}(),ct=T.merge,ht=T.checkSanitizeDeprecation,pt=T.escape,dt=a.getDefaults,ut=a.changeDefaults,gt=a.defaults;function ft(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),e=ct({},ft.defaults,e||{}),ht(e),n){var i,r=e.highlight;try{i=J.lex(t,e)}catch(t){return n(t)}var o=function(t){var o;if(!t)try{o=lt.parse(i,e)}catch(e){t=e}return e.highlight=r,t?n(t):n(null,o)};if(!r||r.length<3)return o();if(delete e.highlight,!i.length)return o();var a=0;return ft.walkTokens(i,(function(t){"code"===t.type&&(a++,setTimeout((function(){r(t.text,t.lang,(function(e,n){if(e)return o(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0===--a&&o()}))}),0))})),void(0===a&&o())}try{var s=J.lex(t,e);return e.walkTokens&&ft.walkTokens(s,e.walkTokens),lt.parse(s,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+pt(t.message+"",!0)+"</pre>";throw t}}return ft.options=ft.setOptions=function(t){return ct(ft.defaults,t),ut(ft.defaults),ft},ft.getDefaults=dt,ft.defaults=gt,ft.use=function(t){var e=ct({},t);if(t.renderer&&function(){var n=ft.defaults.renderer||new it,i=function(e){var i=n[e];n[e]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.renderer[e].apply(n,o);return!1===s&&(s=i.apply(n,o)),s}};for(var r in t.renderer)i(r);e.renderer=n}(),t.tokenizer&&function(){var n=ft.defaults.tokenizer||new F,i=function(e){var i=n[e];n[e]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.tokenizer[e].apply(n,o);return!1===s&&(s=i.apply(n,o)),s}};for(var r in t.tokenizer)i(r);e.tokenizer=n}(),t.walkTokens){var n=ft.defaults.walkTokens;e.walkTokens=function(e){t.walkTokens(e),n&&n(e)}}ft.setOptions(e)},ft.walkTokens=function(t,e){for(var n,i=r(t);!(n=i()).done;){var o=n.value;switch(e(o),o.type){case"table":for(var a,s=r(o.tokens.header);!(a=s()).done;){var l=a.value;ft.walkTokens(l,e)}for(var c,h=r(o.tokens.cells);!(c=h()).done;)for(var p,d=r(c.value);!(p=d()).done;){var u=p.value;ft.walkTokens(u,e)}break;case"list":ft.walkTokens(o.items,e);break;default:o.tokens&&ft.walkTokens(o.tokens,e)}}},ft.parseInline=function(t,e){if(null==t)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=ct({},ft.defaults,e||{}),ht(e);try{var n=J.lexInline(t,e);return e.walkTokens&&ft.walkTokens(n,e.walkTokens),lt.parseInline(n,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+pt(t.message+"",!0)+"</pre>";throw t}},ft.Parser=lt,ft.parser=lt.parse,ft.Renderer=it,ft.TextRenderer=rt,ft.Lexer=J,ft.lexer=J.lex,ft.Tokenizer=F,ft.Slugger=ot,ft.parse=ft,ft}));const Ls=new window.marked.Renderer;function Hs(t){const e=t.match(/^[^\S]*(?=\S)/gm);return e&&e[0].length?(e.sort((t,e)=>t.length-e.length),e[0].length?t.replace(RegExp("^"+e[0],"gm"),""):t):t}Ls.code=function(t,e,n){return`<pb-code-highlight language="${e}" line-numbers>\n <template>${t}</template>\n </pb-code-highlight>`},window.marked.setOptions({renderer:Ls});class Ts extends(R(V)){static get properties(){return Object.assign({content:{type:String},url:{type:String}},super.properties)}constructor(){super(),this._url=null}set url(t){this._url=t,Ts.waitOnce("pb-page-ready",t=>{this._load(t.endpoint)})}connectedCallback(){if(super.connectedCallback(),this.style.display="block",!this.content){const t=document.createElement("div");for(let e=0;e<this.childNodes.length;e++){const n=this.childNodes[e];t.appendChild(document.importNode(n.content||n,!0))}this.content=Hs(t.innerHTML)}this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)})}_load(t){const e=this.toAbsoluteURL(this._url,t);fetch(e,{credentials:"same-origin"}).then(t=>t.text()).catch(()=>(console.error("<pb-markdown> failed to load content from %s",e.toString()),Promise.resolve(this.content))).then(t=>{this.content=t})}createRenderRoot(){return this}render(){return this.content?$`<div>${E(window.marked(this.content))}</div>`:null}zoom(t){const e=window.getComputedStyle(this).getPropertyValue("font-size"),n=parseInt(e.replace(/^(\d+)px/,"$1"));this.style.fontSize="in"===t?n+1+"px":n-1+"px"}}customElements.define("pb-markdown",Ts);const Vs=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const e=t.target;e.emitTo("pb-visible",{data:e.data})}})});class $s extends(R(V)){static get properties(){return Object.assign({data:{type:String}},super.properties)}disconnectedCallback(){super.disconnectedCallback(),Vs&&Vs.unobserve(this)}firstUpdated(){Vs.observe(this)}render(){return $`<slot></slot>`}static get styles(){return P`
|
|
3781
3781
|
:host {
|
|
3782
3782
|
display: inline;
|
|
3783
3783
|
}
|
|
@@ -3792,7 +3792,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3792
3792
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3793
3793
|
found at http://polymer.github.io/PATENTS.txt
|
|
3794
3794
|
*/
|
|
3795
|
-
const Os=
|
|
3795
|
+
const Os=n`<iron-iconset-svg name="av" size="24">
|
|
3796
3796
|
<svg><defs>
|
|
3797
3797
|
<g id="add-to-queue"><path d="M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2zm0 14H3V5h18v12zm-5-7v2h-3v3h-2v-3H8v-2h3V7h2v3h3z"></path></g>
|
|
3798
3798
|
<g id="airplay"><path d="M6 22h12l-6-6zM21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V5h18v12h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"></path></g>
|
|
@@ -3875,7 +3875,7 @@ const Os=i`<iron-iconset-svg name="av" size="24">
|
|
|
3875
3875
|
<g id="web"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"></path></g>
|
|
3876
3876
|
<g id="web-asset"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H5V8h14v10z"></path></g>
|
|
3877
3877
|
</defs></svg>
|
|
3878
|
-
</iron-iconset-svg>`;function Ps(t,e){return window.ESGlobalBridge.requestAvailability(),new Promise(
|
|
3878
|
+
</iron-iconset-svg>`;function Ps(t,e){return window.ESGlobalBridge.requestAvailability(),new Promise(n=>{window.ESGlobalBridge.instance.load(t,e),window.addEventListener(`es-bridge-${t}-loaded`,()=>n(),{once:!0})})}document.head.appendChild(Os.content);class Rs extends(R(V)){static get properties(){return Object.assign({url:{type:String},player:{type:Boolean},header:{type:String},footer:{type:String},breaks:{type:String},appXPath:{type:String,attribute:"app-xpath"},choiceXPath:{type:String,attribute:"choice-xpath"},mdivXPath:{type:String,attribute:"mdiv-xpath"},substXPath:{type:String,attribute:"subst-xpath"},_svg:{type:String}},super.properties)}constructor(){super(),this._data=null,this._svg=null,this._pages=0,this._page=0,this._midiPlayer=null,this._verovio=null,this.footer="auto",this.header="auto",this.breaks="auto",this.appXPath=null,this.choiceXPath=null,this.mdivXPath=null,this.substXPath=null,this._options=[]}connectedCallback(){super.connectedCallback(),this.querySelectorAll("pb-option").forEach(t=>{this._options.push({name:t.getAttribute("name"),on:t.getAttribute("on"),off:t.getAttribute("off"),label:t.innerHTML})})}firstUpdated(){super.firstUpdated(),this.player&&Ps("midiPlayer","https://cdn.jsdelivr.net/npm/web-midi-player@latest/index.js").then(()=>{const{"web-midi-player":{default:t}}=window;this._midiPlayer=new t}),Ps("verovio","https://www.verovio.org/javascript/latest/verovio-toolkit.js").then(()=>{this._verovio=new window.verovio.toolkit,Rs.waitOnce("pb-page-ready",()=>{this.load()})})}update(t){super.update(t),t.get("url")?this.load():(t.has("appXPath")||t.has("choiceXPath")||t.has("mdivXPath")||t.has("substXPath"))&&this._verovio&&(this._verovio.setOptions(this._getOptions()),this._verovio.loadData(this._data),this.showPage())}load(){const t=this.toAbsoluteURL(this.url);fetch(t).then(t=>t.text()).then(async t=>{this._data=t,this._verovio.setOptions(this._getOptions()),this._verovio.loadData(this._data),this._pages=this._verovio.getPageCount(),this._page=1,console.log("<pb-mei> Loaded %d pages",this._pages),this.showPage()})}showPage(){this._svg=this._verovio.renderToSVG(this._page,{})}async play(){const t=this.shadowRoot.getElementById("play");if(t.active)if(t.icon="av:stop",this._midiPaused)this._midiPaused=!1,this._midiPlayer.resume();else{this._verovio.loadData(this._data);const t=this._verovio.renderToMIDI(),e=window.atob(t),n=e.length,i=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t+=1)i[t]=e.charCodeAt(t);this._midiPlayer.play({arrayBuffer:i})}else this._midiPlayer.stop(),t.icon="av:play-arrow"}pause(){const t=this.shadowRoot.getElementById("play");t.active&&(this._midiPaused=this._midiPlayer.pause(),this._midiPaused&&(t.icon="av:play-arrow",t.active=!1))}render(){return $`
|
|
3879
3879
|
<div id="toolbar">
|
|
3880
3880
|
<div class="${1===this._pages?"hidden":""}">
|
|
3881
3881
|
<paper-icon-button id="pageLeft" icon="icons:chevron-left" @click="${this._previousPage}"
|
|
@@ -3892,7 +3892,7 @@ const Os=i`<iron-iconset-svg name="av" size="24">
|
|
|
3892
3892
|
<paper-icon-button id="play" icon="av:play-arrow" toggles @click="${this.play}"></paper-icon-button>
|
|
3893
3893
|
<paper-icon-button icon="av:pause" @click="${this.pause}"></paper-icon-button>
|
|
3894
3894
|
</div>
|
|
3895
|
-
`:null}_renderOptions(){return this._options.map(t=>$`<paper-checkbox @change="${e=>this._setOption(t,e.target.checked)}">${t.label}</paper-checkbox>`)}_setOption(t,e){let
|
|
3895
|
+
`:null}_renderOptions(){return this._options.map(t=>$`<paper-checkbox @change="${e=>this._setOption(t,e.target.checked)}">${t.label}</paper-checkbox>`)}_setOption(t,e){let n;n=e?t.on&&t.on.length>0?t.on:null:t.off&&t.off.length>0?t.off:null,this[t.name]=n}_nextPage(t){t.preventDefault(),this._page<this._pages&&(this._page+=1,this.showPage())}_previousPage(t){t.preventDefault(),this._page>1&&(this._page-=1,this.showPage())}_getOptions(){const t={svgViewBox:!0,adjustPageHeight:!0,footer:this.footer,header:this.header,breaks:this.breaks,appXPathQuery:[this.appXPath],substXPathQuery:[this.substXPath],choiceXPathQuery:[this.choiceXPath]};return this.mdivXPath&&(t.mdivXPathQuery=this.mdivXPath),t}static get styles(){return P`
|
|
3896
3896
|
:host {
|
|
3897
3897
|
display: grid;
|
|
3898
3898
|
grid-template-rows: auto 1fr;
|
|
@@ -3963,7 +3963,7 @@ const Os=i`<iron-iconset-svg name="av" size="24">
|
|
|
3963
3963
|
display: block;
|
|
3964
3964
|
margin-left: 10px;
|
|
3965
3965
|
}
|
|
3966
|
-
`}_autocomplete(t){const e=this.shadowRoot.getElementById("search");this._sendRequest(e.value)}_sendRequest(t){const e=this.shadowRoot.getElementById("autocompleteLoader");e.url=this.toAbsoluteURL(this.source);const
|
|
3966
|
+
`}_autocomplete(t){const e=this.shadowRoot.getElementById("search");this._sendRequest(e.value)}_sendRequest(t){const e=this.shadowRoot.getElementById("autocompleteLoader");e.url=this.toAbsoluteURL(this.source);const n=this._getParameters();n.query=t,e.params=n,e.generateRequest()}_updateSuggestions(){const t=this.shadowRoot.getElementById("autocompleteLoader");if(this._initialized){const e=this.shadowRoot.getElementById("autocomplete");t.lastResponse&&(this.suggestions=t.lastResponse,e.suggestions(this.suggestions))}else if(t.lastResponse){let e=t.lastResponse;const n=this.shadowRoot.getElementById("search"),i=e.find(t=>t.text?t.value===this.value:t===this.value);i?(n.value=i.text||i,this._hiddenInput&&(this._hiddenInput.value=i.value||i)):this._hiddenInput&&(this._hiddenInput.value=this.value)}this._initialized=!0}_getParameters(){const t={};return this.querySelectorAll("[name]").forEach(e=>{t[e.name]=e.value}),t}_autocompleteSelected(t){this.lastSelected=t.detail.text;const e=this.shadowRoot.getElementById("search");console.log("autocomplete selected %s",t.detail.text),e.value=t.detail.text,this.value=t.detail.value,this._hiddenInput&&(this._hiddenInput.value=this.value)}_setInput(t){const e=this.shadowRoot.getElementById("search");console.log("Autocomplete set manually to %s",e.value),this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value)}}customElements.define("pb-autocomplete",Is);
|
|
3967
3967
|
/**
|
|
3968
3968
|
@license
|
|
3969
3969
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -3974,7 +3974,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
3974
3974
|
part of the polymer project is also subject to an additional IP rights grant
|
|
3975
3975
|
found at http://polymer.github.io/PATENTS.txt
|
|
3976
3976
|
*/
|
|
3977
|
-
const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:String,value:"",reflectToAttribute:!0,observer:"_forChanged"},_forElement:Object},attached:function(){this._forChanged()},ready:function(){this._generateLabelId()},_generateLabelId:function(){if(!this.id){var e="iron-label-"+Ns._labelNumber++;t(this).setAttribute("id",e)}},_findTarget:function(){if(this.for){var e=t(this).getOwnerRoot();return t(e).querySelector("#"+this.for)}var
|
|
3977
|
+
const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:String,value:"",reflectToAttribute:!0,observer:"_forChanged"},_forElement:Object},attached:function(){this._forChanged()},ready:function(){this._generateLabelId()},_generateLabelId:function(){if(!this.id){var e="iron-label-"+Ns._labelNumber++;t(this).setAttribute("id",e)}},_findTarget:function(){if(this.for){var e=t(this).getOwnerRoot();return t(e).querySelector("#"+this.for)}var n=t(this).querySelector("[iron-label-target]");return n||(n=t(this).firstElementChild),n},_tapHandler:function(e){this._forElement&&(t(e).localTarget!==this._forElement&&(this._forElement.focus(),this._forElement.click()))},_applyLabelledBy:function(){this._forElement&&t(this._forElement).setAttribute("aria-labelledby",this.id)},_forChanged:function(){this._forElement&&t(this._forElement).removeAttribute("aria-labelledby"),this._forElement=this._findTarget(),this._applyLabelledBy()}});Ns._labelNumber=0;class Fs extends(R(V)){static get properties(){return Object.assign({label:{type:String},value:{type:String,reflect:!0},values:{type:Array,reflect:!0},name:{type:String},source:{type:String},multi:{type:Boolean},_items:{type:Array},_selected:{type:Array}},super.properties)}constructor(){super(),this.value=null,this.values=[],this._items=[],this._selected=[],this._inIronForm=!1}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-i18n-update",this._refresh.bind(this)),this.multi&&(0===this.values.length&&this.value&&(this.values=[this.value]),this.value=void 0)}firstUpdated(){super.firstUpdated(),this._inIronForm=this.closest("iron-form, pb-search,pb-custom-form");const t=this.shadowRoot.querySelector('[name="subform"]');t&&t.assignedNodes().forEach(t=>{this.name&&t.addEventListener("change",this._loadRemote.bind(this));t.querySelectorAll("[name]").forEach(t=>{t.addEventListener("change",this._loadRemote.bind(this))})}),Fs.waitOnce("pb-page-ready",()=>{this._loadRemote()})}_refresh(){const t=this.shadowRoot.getElementById("list");t&&setTimeout(()=>{const e=t.selected;t.selected=void 0,t.selected=e})}_clear(t){const e=this.shadowRoot.querySelector(t);e&&e.assignedNodes().forEach(t=>{t.parentNode.removeChild(t)})}_loadRemote(){if(this.source){let t=this.toAbsoluteURL(this.source);t=t.indexOf("?")>-1?`${t}&${this._getParameters()}`:`${t}?${this._getParameters()}`,console.log("<pb-select> loading items from %s",t),fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{this._clear("slot:not([name])");const e=[];t.forEach(t=>{e.push({label:t.text,value:t.value})}),console.log("<pb-select> loaded %d items",e.length),this._items=e}).catch(()=>{console.error("<pb-select> request to %s failed",t)})}}_getParameters(){const t=this.shadowRoot.querySelector('[name="subform"]'),e=[];return t&&t.assignedNodes().forEach(t=>{t.querySelectorAll("[name]").forEach(t=>{e.push(`${t.name}=${encodeURIComponent(t.value)}`)})}),e.join("&")}render(){return this.multi?$`
|
|
3978
3978
|
<slot name="subform"></slot>
|
|
3979
3979
|
<iron-label for="list" part="label">${r(this.label)}</iron-label>
|
|
3980
3980
|
${this.multi?$`<paper-listbox id="list" slot="dropdown-content" class="dropdown-content"
|
|
@@ -3999,7 +3999,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
3999
3999
|
</paper-listbox>
|
|
4000
4000
|
</paper-dropdown-menu>
|
|
4001
4001
|
<slot name="output"></slot>
|
|
4002
|
-
`}_changed(){const t=this.shadowRoot.getElementById("list"),e=Array.of(this._selected);if(this.multi?(this._selected=t.selectedValues,this.values=this._selected):(this._selected=[t.selected],this.value=t.selected),this._selected.length!==e.length||!this._selected.every((t,
|
|
4002
|
+
`}_changed(){const t=this.shadowRoot.getElementById("list"),e=Array.of(this._selected);if(this.multi?(this._selected=t.selectedValues,this.values=this._selected):(this._selected=[t.selected],this.value=t.selected),this._selected.length!==e.length||!this._selected.every((t,n)=>t===e[n])){if(!this._inIronForm||this.multi){this._clear('[name="output"]');(this.multi?this.values:[this.value]).forEach(t=>{const e=document.createElement("input");e.type="hidden",e.name=this.name,e.value=t,e.slot="output",this.appendChild(e)})}this.dispatchEvent(new CustomEvent("change"))}}static get styles(){return P`
|
|
4003
4003
|
:host {
|
|
4004
4004
|
display: flex;
|
|
4005
4005
|
flex-direction: column;
|
|
@@ -4039,7 +4039,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4039
4039
|
align-items: center;
|
|
4040
4040
|
padding: 0 16px;
|
|
4041
4041
|
}
|
|
4042
|
-
`}}customElements.define("pb-clipboard",Bs);class Ds{constructor(t){this._prefix=t.getAttribute("prefix"),this._config={name:t.getAttribute("name"),properties:{}},this._register=this._config.name}get register(){return this._register}get name(){return this._register}set name(t){this._register=t}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}select(t){}async getRecord(t){return Promise.reject()}}class js extends Ds{async query(t){const e=t.replace(/[^\w\s]+/g,""),i=[],n="https://api.metagrid.ch/search?query="+encodeURIComponent(e);return new Promise(t=>{fetch(n).then(t=>t.json()).then(e=>{e.resources.forEach(t=>{const e=`${t.metadata.last_name}, ${t.metadata.first_name} `,n={register:this._register,id:`${t.provider.slug}-${t.identifier}`,label:e,details:`${t.metadata.birth_date} - ${t.metadata.death_date}`,link:t.link.uri,provider:t.provider.slug};i.push(n)}),t({totalItems:e.meta.total,items:i})})})}info(t,e){const i=t.indexOf("-"),n=t.substring(0,i);return new Promise(i=>{this.getRecord(t).then(t=>{const r=`\n <h3 class="label">\n <a href="https://${t.link.uri}" target="_blank">\n ${t.metadata.last_name}, ${t.metadata.first_name}\n </a>\n </h3>\n <p>${t.metadata.birth_date} - ${t.metadata.death_date}</p>\n `;e.innerHTML=r,i({id:`${n}-${t.identifier}`,strings:[`${t.metadata.first_name} ${t.metadata.last_name}`]})})})}async getRecord(t){const e=t.indexOf("-"),i=t.substring(0,e),n=t.substring(e+1);return fetch(`https://api.metagrid.ch/search?slug=${i}&query=${n}`).then(t=>t.json()).then(t=>{const e=t.resources[0],i=Object.assign({},e);return i.name=`${e.metadata.first_name} ${e.metadata.last_name}`,i.links=["https://"+e.link.uri],e.metadata.birth_date&&e.metadata.birth_date.length>0&&(i.birth=e.metadata.birth_date),e.metadata.death_date&&e.metadata.death_date.length>0&&(i.death=e.metadata.death_date),i}).catch(t=>Promise.reject(t))}}class qs extends Ds{constructor(t){super(t),this.user=t.getAttribute("user")}async query(t){const e=[];return new Promise(i=>{fetch(`https://secure.geonames.org/searchJSON?formatted=true&q=${encodeURIComponent(t)}&maxRows=100&&username=${this.user}&style=full`).then(t=>t.json()).then(t=>{t.geonames.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,label:t.toponymName,details:`${t.fcodeName} - ${t.adminName1}, ${t.countryName}`,link:"https://www.geonames.org/"+t.geonameId,strings:[t.toponymName],provider:"geonames.org"};e.push(i)}),i({totalItems:t.totalResultsCount,items:e})})})}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{if(t.status)return void n(t.status.message);const r=`\n <h3 class="label">\n <a href="${t.link}" target="_blank">${t.name}</a>\n </h3>\n <p class="fcode">${t.note} - ${t.region}, ${t.country}</p>\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,strings:[t.name]})}).catch(()=>n())}):Promise.resolve({})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://secure.geonames.org/getJSON?geonameId=${encodeURIComponent(e)}&username=${this.user}`).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{const e=Object.assign({},t);return e.name=t.toponymName,e.country=t.countryName,e.region=t.adminName1,e.note=t.fcodeName,e.links=["https://www.geonames.org/"+t.geonameId,"https://"+t.wikipediaURL],e}).catch(()=>Promise.reject())}}function Us(t="",e){return t.replace(/\${([^}]+)}/g,(t,i)=>{let n;return e[i]&&(n=e[i]),n||""})}function Ws(t,e){const i=t.querySelector(e);if(i instanceof HTMLTemplateElement){const t=document.createElement("div");return t.appendChild(i.content.cloneNode(!0)),t.innerHTML}return""}class Gs extends Ds{constructor(t){super(t),this.apiKey=t.getAttribute("api-key"),this.baseKey=t.getAttribute("base"),this.table=t.getAttribute("table"),this.view=t.getAttribute("view"),this.filterExpr=t.getAttribute("filter"),this.labelExpr=t.getAttribute("label");const e=t.getAttribute("fields");this.fields=e?e.split(/\s*,\s*/):["ID"];const i=t.getAttribute("tokenize");this.tokenize=i?i.split(/\s*,\s*/):[this.fields[0]],this.tokenizeChars=t.getAttribute("tokenize-regex")||"\\W",this.infoExpr=Ws(t,".info"),this.detailExpr=Ws(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=O("https://unpkg.com/airtable@0.11.1/build/airtable.browser.js");window.ESGlobalBridge.instance.load("airtable",t),window.addEventListener("es-bridge-airtable-loaded",this._initAirtable.bind(this),{once:!0})}_initAirtable(){const t=require("airtable");this.base=new t({apiKey:this.apiKey}).base(this.baseKey)}async query(t){t=t.toLowerCase();const e=[],i=this.filterExpr?Us(this.filterExpr,{key:t}):null,n={fields:this.fields,maxRecords:100};return this.view&&(n.view=this.view),i&&(n.filterByFormula=i),new Promise((t,i)=>{this.base(this.table).select(n).firstPage((n,r)=>{if(n)return console.error(n),void i(n);r.forEach(t=>{const i={};this.fields.forEach(e=>{i[e]=t.get(e)});const n={register:this._register,id:t.id,label:Us(this.labelExpr,i),details:Us(this.detailExpr,i),provider:"airtable"};e.push(n)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((i,n)=>{const r={fields:this.fields,filterByFormula:`RECORD_ID()='${t}'`};this.base(this.table).select(r).firstPage((r,o)=>{if(r){switch(r.statusCode){case 404:n(`No record found for ${t} in table ${this.table}`);break;default:n(`${r.statusCode}: ${r.message}`)}return}const a=o[0];if(0===Object.keys(a.fields).length)return void console.warn("Retrieved an empty record for %s from table %s",t,this.table);let s=[];const l={};this.fields.forEach(t=>{const e=a.get(t);e&&(l[t]=e,s.push(e))});const c=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{s=s.concat(l[t].split(c))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),console.log(s),e.innerHTML=Us(this.infoExpr,l),i({id:a.id,strings:s})})})}}function Xs(t){let e="";t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e=t.professionOrOccupation.map(t=>t.label).join(", ")),t.biographicalOrHistoricalInformation&&(e=`${e}; ${t.biographicalOrHistoricalInformation.join(", ")}`);const i=[];return t.dateOfBirth&&t.dateOfBirth.length>0&&i.push(t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(i.push(" - "),i.push(t.dateOfDeath[0])),i.length>0?`${i.join("")}${e?"; "+e:""}`:e}class Ks extends Ds{query(t){const e=[];let i;switch(this._register){case"place":i="PlaceOrGeographicName";break;case"term":i="SubjectHeading";break;case"organization":i="CorporateBody";break;default:i="Person"}return new Promise(n=>{fetch(`https://lobid.org/gnd/search?q=${encodeURIComponent(t)}&filter=%2B%28type%3A${i}%29&format=json&size=100`).then(t=>t.json()).then(t=>{t.member.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,label:t.preferredName,link:t.id,details:Xs(t),strings:[t.preferredName].concat(t.variantName),provider:"GND"};e.push(i)}),n({totalItems:t.totalItems,items:e})})})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://lobid.org/gnd/${e}.json`).then(t=>t.ok?t.json():Promise.reject()).then(t=>{const e=Object.assign({},t);return e.name=t.preferredName,e.link=t.id,t.dateOfBirth&&t.dateOfBirth.length>0&&(e.birth=t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(e.death=t.dateOfDeath[0]),t.biographicalOrHistoricalInformation&&(e.note=t.biographicalOrHistoricalInformation.join("; ")),t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e.profession=t.professionOrOccupation.map(t=>t.label)),e}).catch(()=>Promise.reject())}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{let n;t.type.indexOf("SubjectHeading")>-1?n=this.infoSubject(t):t.type.indexOf("AuthorityResource")>-1&&(n=this.infoPerson(t));const r=`\n <h3 class="label">\n <a href="https://${t.id}" target="_blank"> ${t.preferredName} </a>\n </h3>\n ${n}\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,strings:[t.preferredName].concat(t.variantName)})}).catch(()=>n())}):Promise.resolve()}infoPerson(t){const e=t.professionOrOccuption?t.professionOrOccupation.map(t=>t.label):[];return`<p>${t.dateOfBirth} - ${t.dateOfDeath}</p>\n <p>${e.join(" ")}</p>`}infoSubject(t){if(t.broaderTermGeneral){return`<p>${t.broaderTermGeneral.map(t=>t.label).join(", ")}</p>`}return""}}class Zs extends Ds{constructor(t){super(t),this._api=t.getAttribute("api")}async query(t){const e=[],i=this.getRegister(),n=`https://meta.karl-barth.ch/api/${i}?search=${encodeURIComponent(t)}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data.forEach(t=>{if("organization"===this._register&&"organisation"!==t.authority_type||"person"===this._register&&"person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}:${t["full-id"]}`:t["full-id"],label:t[r],details:""+t["full-id"],link:`https://meta.karl-barth.ch/${i}/${t.id}`,strings:[t[r]],provider:"KBGA"};e.push(n)}),t({totalItems:n.meta.total,items:e})})})}info(t,e){if(!t)return Promise.resolve({});const i=this.getLabelField();return new Promise(n=>{this.getRecord(t).then(t=>{const r=t.data.death?"† "+t.data.death:"",o=t.data.birth?`<p>* ${t.data.birth} ${r}</p>`:"",a=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",s=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${t.data[i]}</a></h3>\n ${o}\n ${a}\n `;e.innerHTML=s,n({id:t.data["full-id"],strings:[t.data[i]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1");return fetch(`https://meta.karl-barth.ch/api/${this.getRegister()}/${e}`).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"place":t="placeName_full";break;case"term":t="fullLabel";break;case"abbreviation":t="label";break;default:t="persName_full"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="terms";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}class Qs extends Ds{constructor(t){super(t),this._api=t.getAttribute("api")}async query(t){const e=[],i=this.getRegister(),n=`https://archives.georgfischer.com/api/${i}?search=${encodeURIComponent(t)}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data?(n.data.forEach(t=>{if("organization"===this._register&&"Person"===t.authority_type||"person"===this._register&&"Person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t[r],details:""+t.id,link:`https://archives.georgfischer.com/api/${i}/${t.id}`,strings:[t[r]],provider:"GF"};e.push(n)}),t({totalItems:n.meta.total,items:e})):t({totalItems:0,items:[]})}).catch(t=>Promise.reject(t))})}info(t,e){if(!t)return Promise.resolve({});const i=this._prefix?t.substring(this._prefix.length+1):t,n=this.getLabelField();return new Promise(t=>{this.getRecord(i).then(i=>{const r=i.data.death?"† "+i.data.death:"",o=i.data.birth?`<p>* ${i.data.birth} ${r}</p>`:"",a=i.data.note_bio?`<p>${i.data.note_bio}</p>`:"",s=`\n <h3 class="label"><a href="https://${i.wikipediaURL}" target="_blank">${i.data[n]}</a></h3>\n ${o}\n ${a}\n `;e.innerHTML=s,t({id:this._prefix?`${this._prefix}-${i.data.id}`:i.data.id,strings:[i.data[n]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1"),i=`https://archives.georgfischer.com/api/${this.getRegister()}/${e}`;return fetch(i).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"term":t="label";break;default:t="fullname"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Ys(t){const e=await fetch(t);return await e.json()}class Js extends Ds{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Ys(this.endpoint).then(t=>{this.ORConfig=t,this.debug&&console.log("OpenReconcile connector for register '%s' at endpoint <%s>. Using config: %o",this._register,this.endpoint,this.ORConfig)})}async query(t){const e=[],i={q1:{query:t}};return new Promise(t=>{fetch(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"queries=".concat(JSON.stringify(i))}).then(t=>t.json()).then(i=>{i.q1.result.forEach(t=>{this.ORConfig.view?this.view=this.ORConfig.view.url.replace("{{id}}",t.id):this.view=t.id,t.description?this.description=t.description:t.type?this.description=t.type.map(t=>t.name.toString()).join(", "):this.description="";const i={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t.name,link:this.view,details:this.description,provider:"OpenReconcile"};e.push(i)}),this.debug&&console.log("OpenReconcile results: %o",e),t({totalItems:i.q1.result.length,items:e})})})}info(t,e){return t?this.ORConfig.preview?new Promise((i,n)=>{const r=this._prefix?t.substring(this._prefix.length+1):t,o=this.ORConfig.preview.url.replace("{{id}}",encodeURIComponent(r));fetch(o).then(t=>t.text()).then(t=>{e.innerHTML=t,i({id:this._prefix?`${this._prefix}-${r}`:r})}).catch(()=>n())}):(e.innerHTML="no 'preview' information in endpoint's manifest",Promise.resolve()):Promise.resolve({})}}class tl extends Ds{constructor(t,e){super(e),this._endpoint=t,this._connectors=el(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}async query(t){return new Promise(e=>{fetch(`${this._endpoint}/api/register/search/${this._register}?query=${encodeURIComponent(t)}`).then(t=>t.json()).then(async i=>{let n=[];const r=new Set;i.forEach(t=>{n.push({register:this._register,id:t.id,label:t.label,link:t.link,details:t.details,provider:"local"}),r.add(t.id)});let o=i.length;for(const e of this._connectors){const i=await e.query(t);n=n.concat(i.items.filter(t=>!r.has(t.id))),o+=i.totalItems}e({totalItems:o,items:n})})})}info(t,e){if(!t)return Promise.resolve({});const i=t;return new Promise((n,r)=>{fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(i)}`).then(async i=>{if(i.ok){const t=await i.json();return e.innerHTML=t.details,void n({id:t.id,strings:t.strings})}if(404===i.status)for(const i of this._connectors)try{const r=await i.info(t,e);r&&n(r)}catch(t){}r()})})}async select(t){let e;for(const i of this._connectors)if(e=await i.getRecord(t.id),e)break;return e?fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(t.id)}`,{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()):Promise.reject("No record found for ID "+t.id)}}function el(t,e){const i=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let n;switch(e.getAttribute("connector")){case"GND":n=new Ks(e);break;case"GeoNames":n=new qs(e);break;case"Airtable":n=new Gs(e);break;case"KBGA":n=new Zs(e);break;case"GF":n=new Qs(e);break;case"ReconciliationService":n=new Js(e);break;case"Custom":n=new tl(t,e);break;default:n=new js(e)}i.push(n)}),i}class il extends(R(V)){static get properties(){return Object.assign({query:{type:String,reflect:!0},sortByLabel:{type:Boolean,attribute:"sort-by-label"},stopwords:{type:String},_results:{type:Array}},super.properties)}constructor(){super(),this.query="",this.type=null,this.sortByLabel=!1,this._results=[],this._authorities={}}connectedCallback(){super.connectedCallback(),this._stopwordSet=new Set,this.stopwords&&this.stopwords.split(/\s*,\s*/).forEach(t=>this._stopwordSet.add(t.toLowerCase())),this.subscribeTo("pb-authority-lookup",t=>{this.query=t.detail.query,this.type=t.detail.type,this._results=[],this._query()}),il.waitOnce("pb-page-ready",()=>{el(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return $`
|
|
4042
|
+
`}}customElements.define("pb-clipboard",Bs);class Ds{constructor(t){this._prefix=t.getAttribute("prefix"),this._config={name:t.getAttribute("name"),properties:{}},this._register=this._config.name}get register(){return this._register}get name(){return this._register}set name(t){this._register=t}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}select(t){}async getRecord(t){return Promise.reject()}}class js extends Ds{async query(t){const e=t.replace(/[^\w\s]+/g,""),n=[],i="https://api.metagrid.ch/search?query="+encodeURIComponent(e);return new Promise(t=>{fetch(i).then(t=>t.json()).then(e=>{e.resources.forEach(t=>{const e=`${t.metadata.last_name}, ${t.metadata.first_name} `,i={register:this._register,id:`${t.provider.slug}-${t.identifier}`,label:e,details:`${t.metadata.birth_date} - ${t.metadata.death_date}`,link:t.link.uri,provider:t.provider.slug};n.push(i)}),t({totalItems:e.meta.total,items:n})})})}info(t,e){const n=t.indexOf("-"),i=t.substring(0,n);return new Promise(n=>{this.getRecord(t).then(t=>{const r=`\n <h3 class="label">\n <a href="https://${t.link.uri}" target="_blank">\n ${t.metadata.last_name}, ${t.metadata.first_name}\n </a>\n </h3>\n <p>${t.metadata.birth_date} - ${t.metadata.death_date}</p>\n `;e.innerHTML=r,n({id:`${i}-${t.identifier}`,strings:[`${t.metadata.first_name} ${t.metadata.last_name}`]})})})}async getRecord(t){const e=t.indexOf("-"),n=t.substring(0,e),i=t.substring(e+1);return fetch(`https://api.metagrid.ch/search?slug=${n}&query=${i}`).then(t=>t.json()).then(t=>{const e=t.resources[0],n=Object.assign({},e);return n.name=`${e.metadata.first_name} ${e.metadata.last_name}`,n.links=["https://"+e.link.uri],e.metadata.birth_date&&e.metadata.birth_date.length>0&&(n.birth=e.metadata.birth_date),e.metadata.death_date&&e.metadata.death_date.length>0&&(n.death=e.metadata.death_date),n}).catch(t=>Promise.reject(t))}}class qs extends Ds{constructor(t){super(t),this.user=t.getAttribute("user")}async query(t){const e=[];return new Promise(n=>{fetch(`https://secure.geonames.org/searchJSON?formatted=true&q=${encodeURIComponent(t)}&maxRows=100&&username=${this.user}&style=full`).then(t=>t.json()).then(t=>{t.geonames.forEach(t=>{const n={register:this._register,id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,label:t.toponymName,details:`${t.fcodeName} - ${t.adminName1}, ${t.countryName}`,link:"https://www.geonames.org/"+t.geonameId,strings:[t.toponymName],provider:"geonames.org"};e.push(n)}),n({totalItems:t.totalResultsCount,items:e})})})}info(t,e){return t?new Promise((n,i)=>{this.getRecord(t).then(t=>{if(t.status)return void i(t.status.message);const r=`\n <h3 class="label">\n <a href="${t.link}" target="_blank">${t.name}</a>\n </h3>\n <p class="fcode">${t.note} - ${t.region}, ${t.country}</p>\n `;e.innerHTML=r,n({id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,strings:[t.name]})}).catch(()=>i())}):Promise.resolve({})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://secure.geonames.org/getJSON?geonameId=${encodeURIComponent(e)}&username=${this.user}`).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{const e=Object.assign({},t);return e.name=t.toponymName,e.country=t.countryName,e.region=t.adminName1,e.note=t.fcodeName,e.links=["https://www.geonames.org/"+t.geonameId,"https://"+t.wikipediaURL],e}).catch(()=>Promise.reject())}}function Us(t="",e){return t.replace(/\${([^}]+)}/g,(t,n)=>{let i;return e[n]&&(i=e[n]),i||""})}function Ws(t,e){const n=t.querySelector(e);if(n instanceof HTMLTemplateElement){const t=document.createElement("div");return t.appendChild(n.content.cloneNode(!0)),t.innerHTML}return""}class Gs extends Ds{constructor(t){super(t),this.apiKey=t.getAttribute("api-key"),this.baseKey=t.getAttribute("base"),this.table=t.getAttribute("table"),this.view=t.getAttribute("view"),this.filterExpr=t.getAttribute("filter"),this.labelExpr=t.getAttribute("label");const e=t.getAttribute("fields");this.fields=e?e.split(/\s*,\s*/):["ID"];const n=t.getAttribute("tokenize");this.tokenize=n?n.split(/\s*,\s*/):[this.fields[0]],this.tokenizeChars=t.getAttribute("tokenize-regex")||"\\W",this.infoExpr=Ws(t,".info"),this.detailExpr=Ws(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=O("https://unpkg.com/airtable@0.11.1/build/airtable.browser.js");window.ESGlobalBridge.instance.load("airtable",t),window.addEventListener("es-bridge-airtable-loaded",this._initAirtable.bind(this),{once:!0})}_initAirtable(){const t=require("airtable");this.base=new t({apiKey:this.apiKey}).base(this.baseKey)}async query(t){t=t.toLowerCase();const e=[],n=this.filterExpr?Us(this.filterExpr,{key:t}):null,i={fields:this.fields,maxRecords:100};return this.view&&(i.view=this.view),n&&(i.filterByFormula=n),new Promise((t,n)=>{this.base(this.table).select(i).firstPage((i,r)=>{if(i)return console.error(i),void n(i);r.forEach(t=>{const n={};this.fields.forEach(e=>{n[e]=t.get(e)});const i={register:this._register,id:t.id,label:Us(this.labelExpr,n),details:Us(this.detailExpr,n),provider:"airtable"};e.push(i)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((n,i)=>{const r={fields:this.fields,filterByFormula:`RECORD_ID()='${t}'`};this.base(this.table).select(r).firstPage((r,o)=>{if(r){switch(r.statusCode){case 404:i(`No record found for ${t} in table ${this.table}`);break;default:i(`${r.statusCode}: ${r.message}`)}return}const a=o[0];if(0===Object.keys(a.fields).length)return void console.warn("Retrieved an empty record for %s from table %s",t,this.table);let s=[];const l={};this.fields.forEach(t=>{const e=a.get(t);e&&(l[t]=e,s.push(e))});const c=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{s=s.concat(l[t].split(c))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),console.log(s),e.innerHTML=Us(this.infoExpr,l),n({id:a.id,strings:s})})})}}function Xs(t){let e="";t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e=t.professionOrOccupation.map(t=>t.label).join(", ")),t.biographicalOrHistoricalInformation&&(e=`${e}; ${t.biographicalOrHistoricalInformation.join(", ")}`);const n=[];return t.dateOfBirth&&t.dateOfBirth.length>0&&n.push(t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(n.push(" - "),n.push(t.dateOfDeath[0])),n.length>0?`${n.join("")}${e?"; "+e:""}`:e}class Ks extends Ds{query(t){const e=[];let n;switch(this._register){case"place":n="PlaceOrGeographicName";break;case"term":n="SubjectHeading";break;case"organization":n="CorporateBody";break;default:n="Person"}return new Promise(i=>{fetch(`https://lobid.org/gnd/search?q=${encodeURIComponent(t)}&filter=%2B%28type%3A${n}%29&format=json&size=100`).then(t=>t.json()).then(t=>{t.member.forEach(t=>{const n={register:this._register,id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,label:t.preferredName,link:t.id,details:Xs(t),strings:[t.preferredName].concat(t.variantName),provider:"GND"};e.push(n)}),i({totalItems:t.totalItems,items:e})})})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://lobid.org/gnd/${e}.json`).then(t=>t.ok?t.json():Promise.reject()).then(t=>{const e=Object.assign({},t);return e.name=t.preferredName,e.link=t.id,t.dateOfBirth&&t.dateOfBirth.length>0&&(e.birth=t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(e.death=t.dateOfDeath[0]),t.biographicalOrHistoricalInformation&&(e.note=t.biographicalOrHistoricalInformation.join("; ")),t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e.profession=t.professionOrOccupation.map(t=>t.label)),e}).catch(()=>Promise.reject())}info(t,e){return t?new Promise((n,i)=>{this.getRecord(t).then(t=>{let i;t.type.indexOf("SubjectHeading")>-1?i=this.infoSubject(t):t.type.indexOf("AuthorityResource")>-1&&(i=this.infoPerson(t));const r=`\n <h3 class="label">\n <a href="https://${t.id}" target="_blank"> ${t.preferredName} </a>\n </h3>\n ${i}\n `;e.innerHTML=r,n({id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,strings:[t.preferredName].concat(t.variantName)})}).catch(()=>i())}):Promise.resolve()}infoPerson(t){const e=t.professionOrOccuption?t.professionOrOccupation.map(t=>t.label):[];return`<p>${t.dateOfBirth} - ${t.dateOfDeath}</p>\n <p>${e.join(" ")}</p>`}infoSubject(t){if(t.broaderTermGeneral){return`<p>${t.broaderTermGeneral.map(t=>t.label).join(", ")}</p>`}return""}}class Zs extends Ds{constructor(t){super(t),this._api=t.getAttribute("api")}async query(t){const e=[],n=this.getRegister(),i=`https://meta.karl-barth.ch/api/${n}?search=${encodeURIComponent(t)}`,r=this.getLabelField();return new Promise(t=>{fetch(i).then(t=>t.json()).then(i=>{i.data.forEach(t=>{if("organization"===this._register&&"organisation"!==t.authority_type||"person"===this._register&&"person"!==t.authority_type)return;const i={register:this._register,id:this._prefix?`${this._prefix}:${t["full-id"]}`:t["full-id"],label:t[r],details:""+t["full-id"],link:`https://meta.karl-barth.ch/${n}/${t.id}`,strings:[t[r]],provider:"KBGA"};e.push(i)}),t({totalItems:i.meta.total,items:e})})})}info(t,e){if(!t)return Promise.resolve({});const n=this.getLabelField();return new Promise(i=>{this.getRecord(t).then(t=>{const r=t.data.death?"† "+t.data.death:"",o=t.data.birth?`<p>* ${t.data.birth} ${r}</p>`:"",a=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",s=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${t.data[n]}</a></h3>\n ${o}\n ${a}\n `;e.innerHTML=s,i({id:t.data["full-id"],strings:[t.data[n]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1");return fetch(`https://meta.karl-barth.ch/api/${this.getRegister()}/${e}`).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"place":t="placeName_full";break;case"term":t="fullLabel";break;case"abbreviation":t="label";break;default:t="persName_full"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="terms";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}class Qs extends Ds{constructor(t){super(t),this._api=t.getAttribute("api")}async query(t){const e=[],n=this.getRegister(),i=`https://archives.georgfischer.com/api/${n}?search=${encodeURIComponent(t)}`,r=this.getLabelField();return new Promise(t=>{fetch(i).then(t=>t.json()).then(i=>{i.data?(i.data.forEach(t=>{if("organization"===this._register&&"Person"===t.authority_type||"person"===this._register&&"Person"!==t.authority_type)return;const i={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t[r],details:""+t.id,link:`https://archives.georgfischer.com/api/${n}/${t.id}`,strings:[t[r]],provider:"GF"};e.push(i)}),t({totalItems:i.meta.total,items:e})):t({totalItems:0,items:[]})}).catch(t=>Promise.reject(t))})}info(t,e){if(!t)return Promise.resolve({});const n=this._prefix?t.substring(this._prefix.length+1):t,i=this.getLabelField();return new Promise(t=>{this.getRecord(n).then(n=>{const r=n.data.death?"† "+n.data.death:"",o=n.data.birth?`<p>* ${n.data.birth} ${r}</p>`:"",a=n.data.note_bio?`<p>${n.data.note_bio}</p>`:"",s=`\n <h3 class="label"><a href="https://${n.wikipediaURL}" target="_blank">${n.data[i]}</a></h3>\n ${o}\n ${a}\n `;e.innerHTML=s,t({id:this._prefix?`${this._prefix}-${n.data.id}`:n.data.id,strings:[n.data[i]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1"),n=`https://archives.georgfischer.com/api/${this.getRegister()}/${e}`;return fetch(n).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"term":t="label";break;default:t="fullname"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Ys(t){const e=await fetch(t);return await e.json()}class Js extends Ds{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Ys(this.endpoint).then(t=>{this.ORConfig=t,this.debug&&console.log("OpenReconcile connector for register '%s' at endpoint <%s>. Using config: %o",this._register,this.endpoint,this.ORConfig)})}async query(t){const e=[],n={q1:{query:t}};return new Promise(t=>{fetch(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"queries=".concat(JSON.stringify(n))}).then(t=>t.json()).then(n=>{n.q1.result.forEach(t=>{this.ORConfig.view?this.view=this.ORConfig.view.url.replace("{{id}}",t.id):this.view=t.id,t.description?this.description=t.description:t.type?this.description=t.type.map(t=>t.name.toString()).join(", "):this.description="";const n={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t.name,link:this.view,details:this.description,provider:"OpenReconcile"};e.push(n)}),this.debug&&console.log("OpenReconcile results: %o",e),t({totalItems:n.q1.result.length,items:e})})})}info(t,e){return t?this.ORConfig.preview?new Promise((n,i)=>{const r=this._prefix?t.substring(this._prefix.length+1):t,o=this.ORConfig.preview.url.replace("{{id}}",encodeURIComponent(r));fetch(o).then(t=>t.text()).then(t=>{e.innerHTML=t,n({id:this._prefix?`${this._prefix}-${r}`:r})}).catch(()=>i())}):(e.innerHTML="no 'preview' information in endpoint's manifest",Promise.resolve()):Promise.resolve({})}}class tl extends Ds{constructor(t,e){super(e),this._endpoint=t,this._connectors=el(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}async query(t){return new Promise(e=>{fetch(`${this._endpoint}/api/register/search/${this._register}?query=${encodeURIComponent(t)}`).then(t=>t.json()).then(async n=>{let i=[];const r=new Set;n.forEach(t=>{i.push({register:this._register,id:t.id,label:t.label,link:t.link,details:t.details,provider:"local"}),r.add(t.id)});let o=n.length;for(const e of this._connectors){const n=await e.query(t);i=i.concat(n.items.filter(t=>!r.has(t.id))),o+=n.totalItems}e({totalItems:o,items:i})})})}info(t,e){if(!t)return Promise.resolve({});const n=t;return new Promise((i,r)=>{fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(n)}`).then(async n=>{if(n.ok){const t=await n.json();return e.innerHTML=t.details,void i({id:t.id,strings:t.strings})}if(404===n.status)for(const n of this._connectors)try{const r=await n.info(t,e);r&&i(r)}catch(t){}r()})})}async select(t){let e;for(const n of this._connectors)if(e=await n.getRecord(t.id),e)break;return e?fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(t.id)}`,{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()):Promise.reject("No record found for ID "+t.id)}}function el(t,e){const n=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let i;switch(e.getAttribute("connector")){case"GND":i=new Ks(e);break;case"GeoNames":i=new qs(e);break;case"Airtable":i=new Gs(e);break;case"KBGA":i=new Zs(e);break;case"GF":i=new Qs(e);break;case"ReconciliationService":i=new Js(e);break;case"Custom":i=new tl(t,e);break;default:i=new js(e)}n.push(i)}),n}class nl extends(R(V)){static get properties(){return Object.assign({query:{type:String,reflect:!0},sortByLabel:{type:Boolean,attribute:"sort-by-label"},stopwords:{type:String},_results:{type:Array}},super.properties)}constructor(){super(),this.query="",this.type=null,this.sortByLabel=!1,this._results=[],this._authorities={}}connectedCallback(){super.connectedCallback(),this._stopwordSet=new Set,this.stopwords&&this.stopwords.split(/\s*,\s*/).forEach(t=>this._stopwordSet.add(t.toLowerCase())),this.subscribeTo("pb-authority-lookup",t=>{this.query=t.detail.query,this.type=t.detail.type,this._results=[],this._query()}),nl.waitOnce("pb-page-ready",()=>{el(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return $`
|
|
4043
4043
|
<paper-input
|
|
4044
4044
|
id="query"
|
|
4045
4045
|
label="${r("Search for")}"
|
|
@@ -4054,7 +4054,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4054
4054
|
${this._results.map(t=>this._formatItem(t))}
|
|
4055
4055
|
</table>
|
|
4056
4056
|
</div>
|
|
4057
|
-
`}async lookup(t,e,
|
|
4057
|
+
`}async lookup(t,e,n){if(!e||""===e)return console.log("<pb-authority-lookup> Key is empty"),n.innerHTML="",Promise.resolve();const i=this._authorities[t];console.log("<pb-authority-lookup> Retrieving info for %s from %s",e,t);let r=await i.info(e,n);return r.strings&&(r=Object.assign(r,{strings:r.strings.filter(t=>t&&!this._stopwordSet.has(t.toLowerCase()))})),r}_formatItem(t){return $`
|
|
4058
4058
|
<tr>
|
|
4059
4059
|
<td>
|
|
4060
4060
|
<paper-icon-button
|
|
@@ -4072,7 +4072,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4072
4072
|
<td>${t.provider?$`<div><span class="source" part="source">${t.provider}</span></div>`:null}</td>
|
|
4073
4073
|
<td><span class="register" part="register">${t.register}</span></td>
|
|
4074
4074
|
</tr>
|
|
4075
|
-
`}_select(t){const e=this._authorities[t.register];e&&e.select(t);const
|
|
4075
|
+
`}_select(t){const e=this._authorities[t.register];e&&e.select(t);const n={strings:t.strings,properties:{ref:t.id}};this.emitTo("pb-authority-select",n)}_queryChanged(){this._results=[],this.query=this.shadowRoot.getElementById("query").value,this._query()}_query(){this.emitTo("pb-start-update"),this._authorities[this.type].query(this.query).then(t=>{this._occurrences(t.items).then(t=>{this._results=t}),this.emitTo("pb-end-update"),this.shadowRoot.getElementById("query").focus()})}_occurrences(t){const e=new FormData;return e.append("register",this.type),t.forEach(t=>{e.append("id",t.id)}),new Promise(n=>{fetch(this.getEndpoint()+"/api/annotations/occurrences",{method:"POST",body:e}).then(t=>{if(t.ok)return t.json()}).then(e=>{t.forEach(t=>{e[t.id]?t.occurrences=e[t.id]:t.occurrences=0}),t.sort((t,e)=>{const n=e.occurrences-t.occurrences;return 0===n?"local"===t.provider&&"local"!==e.provider?-1:"local"===e.provider&&"local"!==t.provider?1:this.sortByLabel?t.label.localeCompare(e.label):0:n}),n(t)})})}static get styles(){return P`
|
|
4076
4076
|
:host {
|
|
4077
4077
|
display: flex;
|
|
4078
4078
|
flex-direction: column;
|
|
@@ -4114,7 +4114,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4114
4114
|
.occurrences {
|
|
4115
4115
|
background-color: var(--pb-color-focus);
|
|
4116
4116
|
}
|
|
4117
|
-
`}}customElements.define("pb-authority-lookup",
|
|
4117
|
+
`}}customElements.define("pb-authority-lookup",nl);class il extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{data:{type:Object},documents:{type:Array},doc:{type:String},perPage:{type:Number,attribute:"per-page"},pattern:{type:String},first:{type:Number},sort:{type:String},target:{type:String,attribute:"target"}})}constructor(){super(),this.data={documents:[]},this.documents=[],this.first=1,this.doc=null,this.sort=null}static get styles(){return P`
|
|
4118
4118
|
:host {
|
|
4119
4119
|
display: block;
|
|
4120
4120
|
max-width:100%;
|
|
@@ -4206,14 +4206,14 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4206
4206
|
`)}
|
|
4207
4207
|
`)}
|
|
4208
4208
|
</table>
|
|
4209
|
-
`}async load(){if(!this.getEndpoint())return;if(!this.pattern)return;let t=`${this.getEndpoint()}/api/blacklab/search?pattern=${this.pattern}&start=${this.first}&per-page=${this.perPage}`;this.doc&&(t+="&doc="+this.doc),this.sort&&(t+="&sort="+this.sort),await fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{this.data=t,localStorage.setItem("pb-kwic-results",JSON.stringify(this.data)),this.emitTo("pb-results-received",{count:t.docs?parseInt(t.docs,10):0,start:t.start,params:t.params,data:t},[])}).catch(t=>{alert("Error retrieving remote content: "+t)})}_animate(){pa({targets:this.shadowRoot.querySelector("table"),opacity:[0,1],duration:200,delay:200,easing:"linear"})}}customElements.define("pb-blacklab-results",
|
|
4209
|
+
`}async load(){if(!this.getEndpoint())return;if(!this.pattern)return;let t=`${this.getEndpoint()}/api/blacklab/search?pattern=${this.pattern}&start=${this.first}&per-page=${this.perPage}`;this.doc&&(t+="&doc="+this.doc),this.sort&&(t+="&sort="+this.sort),await fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{this.data=t,localStorage.setItem("pb-kwic-results",JSON.stringify(this.data)),this.emitTo("pb-results-received",{count:t.docs?parseInt(t.docs,10):0,start:t.start,params:t.params,data:t},[])}).catch(t=>{alert("Error retrieving remote content: "+t)})}_animate(){pa({targets:this.shadowRoot.querySelector("table"),opacity:[0,1],duration:200,delay:200,easing:"linear"})}}customElements.define("pb-blacklab-results",il);class rl extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{current:{type:Number},view:{type:String},pattern:{type:String},match:{type:String},docid:{type:String},hits:{type:Array},kwicData:{type:Object},matchParam:{type:String},pageId:{type:String},perDocument:{type:Number,attribute:"per-document"}})}connectedCallback(){super.connectedCallback(),this.current=1,this.perDocument=100,this.hits=[],this.kwicData={},rl.waitOnce("pb-page-ready",()=>{this.viewElement=document.getElementById(this.view),this.viewElement?this.shadow=this.viewElement.shadowRoot:console.error(`${this}: view element with id ${this.view} does not exist`)}),this.subscribeTo("pb-update",()=>{this._loadDocResults()}),this.subscribeTo("pb-refresh",t=>{this.dynMatch=t.detail.match})}render(){return $`
|
|
4210
4210
|
${0!==this.hits.length?$`
|
|
4211
4211
|
<section class="kwic-display">
|
|
4212
4212
|
<paper-icon-button icon="icons:arrow-back" @click="${this._handlePrev}" ?disabled="${1===this.current}"></paper-icon-button>
|
|
4213
4213
|
<span class="current">${this.current}</span> / <span class="counter">${this.count}</span>
|
|
4214
4214
|
<paper-icon-button icon="icons:arrow-forward" @click="${this._handleNext}" ?disabled="${this.current===this.hits.length}"></paper-icon-button>
|
|
4215
4215
|
</section>`:""}
|
|
4216
|
-
`}async _loadDocResults(){if(!this.getEndpoint())return;const t=new URLSearchParams(window.location.search);this.pattern=t.get("pattern"),this.dynMatch?this.matchParam=this.dynMatch:this.matchParam=t.get("match"),this.pageId=t.get("id"),this.docId=t.get("doc");const e=`${this.getEndpoint()}/api/blacklab/doc?pattern=${this.pattern}&doc=${this.docId}&per-document=${this.perDocument}&format=json`;await fetch(e,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{this.kwicData=t}).then(()=>{this._markAllMatches(),this._showMatch(this.matchParam)}).catch(t=>{console.error("Error retrieving remote content: ",t)})}_markAllMatches(){const t=this.kwicData.documents;if(this.count=this.kwicData.hits,this.hits=t[Object.keys(t)[0]].hits,Array.isArray(this.hits))this.hits.forEach(t=>{const e=t.match.words[0],
|
|
4216
|
+
`}async _loadDocResults(){if(!this.getEndpoint())return;const t=new URLSearchParams(window.location.search);this.pattern=t.get("pattern"),this.dynMatch?this.matchParam=this.dynMatch:this.matchParam=t.get("match"),this.pageId=t.get("id"),this.docId=t.get("doc");const e=`${this.getEndpoint()}/api/blacklab/doc?pattern=${this.pattern}&doc=${this.docId}&per-document=${this.perDocument}&format=json`;await fetch(e,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{this.kwicData=t}).then(()=>{this._markAllMatches(),this._showMatch(this.matchParam)}).catch(t=>{console.error("Error retrieving remote content: ",t)})}_markAllMatches(){const t=this.kwicData.documents;if(this.count=this.kwicData.hits,this.hits=t[Object.keys(t)[0]].hits,Array.isArray(this.hits))this.hits.forEach(t=>{const e=t.match.words[0],n=t.match.words[1];this._addMarkerClasses(e,n)});else{const t=this.hits.match.words[0],e=this.hits.match.words[1];this._addMarkerClasses(t,e)}this.requestUpdate()}_showMatch(t){const e=this._getMatchObject(t);this._navigateToMatch(e)}_getMatchObject(t){if(!t)return Array.isArray(this.hits)?this.hits[this.current-1]:this.hits;if(Array.isArray(this.hits)){const e=this.hits.find(e=>e.match.words[0]===t);return this.current=this.hits.findIndex(t=>t===e)+1,e}return this.current=1,this.hits}_navigateToMatch(t){const e=t.page[0],n=t.match.words[0],i=`${this._endpoint}/${this.docId}.xml?doc=${this.docId}&pattern=${this.pattern}&match=${t.match.words[0]}&id=${e}`;this.pageId!==e?this.emitTo("pb-refresh",{id:e,match:n}):(this._highlight(t),window.history.replaceState({},"",i))}_highlight(t){this._resetCurrentMarker();const e=t.match.words[0],n=t.match.words[1],i=this.shadow.querySelector("#"+e);i&&i.parentNode.classList.add("kwic-current");const r=this.shadow.querySelector("#"+n);r&&r.parentNode.classList.add("kwic-current"),i.scrollIntoView({block:"center",inline:"nearest"})}_resetCurrentMarker(){const t=this.shadow.querySelectorAll(".kwic-current");Array.from(t).forEach(t=>{t.classList.remove("kwic-current")})}_addMarkerClasses(t,e){const n=this.shadow.querySelector("#"+t);if(!n)return;n.parentNode.classList.add("kwic-start");const i=this.shadow.getElementById(e);i?i.parentNode.classList.add("kwic-end"):n.classList.add("kwic-end")}_handlePrev(){this.current-=1;const t=this.hits[this.current-1];this._navigateToMatch(t)}_handleNext(){const t=this.hits[this.current];this._navigateToMatch(t),this.current+=1}static get styles(){return P`
|
|
4217
4217
|
:host {
|
|
4218
4218
|
display: block;
|
|
4219
4219
|
}
|
|
@@ -4221,7 +4221,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4221
4221
|
padding:0 0.5rem;
|
|
4222
4222
|
}
|
|
4223
4223
|
|
|
4224
|
-
`}}function ol(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function al(t,e,i){return e&&ol(t.prototype,e),i&&ol(t,i),t}function sl(){return(sl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function ll(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cl(t,e)}function cl(t,e){return(cl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function dl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return pl(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}customElements.define("pb-blacklab-highlight",rl);var ul,gl,fl,ml,vl,bl,yl={},_l=[],wl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xl(t,e){for(var i in e)t[i]=e[i];return t}function kl(t){var e=t.parentNode;e&&e.removeChild(t)}function zl(t,e,i){var n,r,o,a=arguments,s={};for(o in e)"key"==o?n=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>3)for(i=[i],o=3;o<arguments.length;o++)i.push(a[o]);if(null!=i&&(s.children=i),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Al(t,s,n,r,null)}function Al(t,e,i,n,r){var o={type:t,props:e,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++ul.__v:r};return null!=ul.vnode&&ul.vnode(o),o}function Sl(t){return t.children}function Cl(t,e){this.props=t,this.context=e}function El(t,e){if(null==e)return t.__?El(t.__,t.__.__k.indexOf(t)+1):null;for(var i;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?El(t):null}function Ml(t){var e,i;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e){t.__e=t.__c.base=i.__e;break}return Ml(t)}}function Ll(t){(!t.__d&&(t.__d=!0)&&fl.push(t)&&!Hl.__r++||vl!==ul.debounceRendering)&&((vl=ul.debounceRendering)||ml)(Hl)}function Hl(){for(var t;Hl.__r=fl.length;)t=fl.sort((function(t,e){return t.__v.__b-e.__v.__b})),fl=[],t.some((function(t){var e,i,n,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(i=[],(n=xl({},r)).__v=r.__v+1,Nl(a,r,n,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,i,null==o?El(r):o,r.__h),Fl(i,r),r.__e!=o&&Ml(r)))}))}function Tl(t,e,i,n,r,o,a,s,l,c){var h,p,d,u,g,f,m,v=n&&n.__k||_l,b=v.length;for(i.__k=[],h=0;h<e.length;h++)if(null!=(u=i.__k[h]=null==(u=e[h])||"boolean"==typeof u?null:"string"==typeof u||"number"==typeof u||"bigint"==typeof u?Al(null,u,null,null,u):Array.isArray(u)?Al(Sl,{children:u},null,null,null):u.__b>0?Al(u.type,u.props,u.key,null,u.__v):u)){if(u.__=i,u.__b=i.__b+1,null===(d=v[h])||d&&u.key==d.key&&u.type===d.type)v[h]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&u.key==d.key&&u.type===d.type){v[p]=void 0;break}d=null}Nl(t,u,d=d||yl,r,o,a,s,l,c),g=u.__e,(p=u.ref)&&d.ref!=p&&(m||(m=[]),d.ref&&m.push(d.ref,null,u),m.push(p,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&null!=u.__k&&u.__k===d.__k?u.__d=l=Vl(u,l,t):l=$l(t,u,d,v,g,l),c||"option"!==i.type?"function"==typeof i.type&&(i.__d=l):t.value=""):l&&d.__e==l&&l.parentNode!=t&&(l=El(d))}for(i.__e=f,h=b;h--;)null!=v[h]&&("function"==typeof i.type&&null!=v[h].__e&&v[h].__e==i.__d&&(i.__d=El(n,h+1)),Dl(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Bl(m[h],m[++h],m[++h])}function Vl(t,e,i){var n,r;for(n=0;n<t.__k.length;n++)(r=t.__k[n])&&(r.__=t,e="function"==typeof r.type?Vl(r,e,i):$l(i,r,r,t.__k,r.__e,e));return e}function $l(t,e,i,n,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==i||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<n.length;l+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Ol(t,e,i){"-"===e[0]?t.setProperty(e,i):t[e]=null==i?"":"number"!=typeof i||wl.test(e)?i:i+"px"}function Pl(t,e,i,n,r){var o;t:if("style"===e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)i&&e in i||Ol(t.style,e,"");if(i)for(e in i)n&&i[e]===n[e]||Ol(t.style,e,i[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=i,i?n||t.addEventListener(e,o?Il:Rl,o):t.removeEventListener(e,o?Il:Rl,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null!=i&&(!1!==i||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,i):t.removeAttribute(e))}}function Rl(t){this.l[t.type+!1](ul.event?ul.event(t):t)}function Il(t){this.l[t.type+!0](ul.event?ul.event(t):t)}function Nl(t,e,i,n,r,o,a,s,l){var c,h,p,d,u,g,f,m,v,b,y,_=e.type;if(void 0!==e.constructor)return null;null!=i.__h&&(l=i.__h,s=e.__e=i.__e,e.__h=null,o=[s]),(c=ul.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,v=(c=_.contextType)&&n[c.__c],b=c?v?v.props.value:c.__:n,i.__c?f=(h=e.__c=i.__c).__=h.__E:("prototype"in _&&_.prototype.render?e.__c=h=new _(m,b):(e.__c=h=new Cl(m,b),h.constructor=_,h.render=jl),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=n,p=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=_.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=xl({},h.__s)),xl(h.__s,_.getDerivedStateFromProps(m,h.__s))),d=h.props,u=h.state,p)null==_.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===i.__v){h.props=m,h.state=h.__s,e.__v!==i.__v&&(h.__d=!1),h.__v=e,e.__e=i.__e,e.__k=i.__k,e.__k.forEach((function(t){t&&(t.__=e)})),h.__h.length&&a.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,u,g)}))}h.context=b,h.props=m,h.state=h.__s,(c=ul.__r)&&c(e),h.__d=!1,h.__v=e,h.__P=t,c=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(n=xl(xl({},n),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(d,u)),y=null!=c&&c.type===Sl&&null==c.key?c.props.children:c,Tl(t,Array.isArray(y)?y:[y],e,i,n,r,o,a,s,l),h.base=e.__e,e.__h=null,h.__h.length&&a.push(h),f&&(h.__E=h.__=null),h.__e=!1}else null==o&&e.__v===i.__v?(e.__k=i.__k,e.__e=i.__e):e.__e=function(t,e,i,n,r,o,a,s){var l,c,h,p,d=i.props,u=e.props,g=e.type,f=0;if("svg"===g&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&(l===t||(g?l.localName==g:3==l.nodeType))){t=l,o[f]=null;break}if(null==t){if(null===g)return document.createTextNode(u);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,u.is&&u),o=null,s=!1}if(null===g)d===u||s&&t.data===u||(t.data=u);else{if(o=o&&_l.slice.call(t.childNodes),c=(d=i.props||yl).dangerouslySetInnerHTML,h=u.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<t.attributes.length;p++)d[t.attributes[p].name]=t.attributes[p].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,i,n,r){var o;for(o in i)"children"===o||"key"===o||o in e||Pl(t,o,null,i[o],n);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||i[o]===e[o]||Pl(t,o,e[o],i[o],n)}(t,u,d,r,s),h)e.__k=[];else if(f=e.props.children,Tl(t,Array.isArray(f)?f:[f],e,i,n,r&&"foreignObject"!==g,o,a,t.firstChild,s),null!=o)for(f=o.length;f--;)null!=o[f]&&kl(o[f]);s||("value"in u&&void 0!==(f=u.value)&&(f!==t.value||"progress"===g&&!f)&&Pl(t,"value",f,d.value,!1),"checked"in u&&void 0!==(f=u.checked)&&f!==t.checked&&Pl(t,"checked",f,d.checked,!1))}return t}(i.__e,e,i,n,r,o,a,l);(c=ul.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),ul.__e(t,e,i)}}function Fl(t,e){ul.__c&&ul.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ul.__e(t,e.__v)}}))}function Bl(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){ul.__e(t,i)}}function Dl(t,e,i){var n,r,o;if(ul.unmount&&ul.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Bl(n,null,e)),i||"function"==typeof t.type||(i=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){ul.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(o=0;o<n.length;o++)n[o]&&Dl(n[o],e,i);null!=r&&kl(r)}function jl(t,e,i){return this.constructor(t,i)}function ql(t,e,i){var n,r,o;ul.__&&ul.__(t,e),r=(n="function"==typeof i)?null:i&&i.__k||e.__k,o=[],Nl(e,t=(!n&&i||e).__k=zl(Sl,null,[t]),r||yl,yl,void 0!==e.ownerSVGElement,!n&&i?[i]:r?null:e.firstChild?_l.slice.call(e.childNodes):null,o,!n&&i?i:r?r.__e:e.firstChild,n),Fl(o,t)}function Ul(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}ul={__e:function(t,e){for(var i,n,r;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&null!=n.getDerivedStateFromError&&(i.setState(n.getDerivedStateFromError(t)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t),r=i.__d),r)return i.__E=i}catch(e){t=e}throw t},__v:0},gl=function(t){return null!=t&&void 0===t.constructor},Cl.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xl({},this.state),"function"==typeof t&&(t=t(xl({},i),this.props)),t&&xl(i,t),null!=t&&this.__v&&(e&&this.__h.push(e),Ll(this))},Cl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ll(this))},Cl.prototype.render=Sl,fl=[],ml="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hl.__r=0,bl=0;var Wl=function(){function t(t){this._id=void 0,this._id=t||Ul()}return al(t,[{key:"id",get:function(){return this._id}}]),t}(),Gl={search:{placeholder:"Type a keyword..."},sort:{sortAsc:"Sort column ascending",sortDesc:"Sort column descending"},pagination:{previous:"Previous",next:"Next",navigate:function(t,e){return"Page "+t+" of "+e},page:function(t){return"Page "+t},showing:"Showing",of:"of",to:"to",results:"results"},loading:"Loading...",noRecordsFound:"No matching records found",error:"An error happened while fetching the data"},Xl=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Gl}var e=t.prototype;return e.getString=function(t,e){if(!e||!t)return null;var i=t.split("."),n=i[0];if(e[n]){var r=e[n];return"string"==typeof r?function(){return r}:"function"==typeof r?r:this.getString(i.slice(1).join("."),r)}return null},e.translate=function(t){var e;return(e=this.getString(t,this._language)||this.getString(t,this._defaultLanguage))?e.apply(void 0,[].slice.call(arguments,1)):t},t}(),Kl=function(t){function e(e,i){var n,r;return(n=t.call(this,e,i)||this).config=void 0,n._=void 0,n.config=function(t){if(!t)return null;var e=Object.keys(t);return e.length?t[e[0]].props.value:null}(i),n.config&&(n._=(r=n.config.translator,function(t){return r.translate.apply(r,[t].concat([].slice.call(arguments,1)))})),n}return ll(e,t),e}(Cl),Zl=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Kl);function Ql(t,e){return zl(Zl,{content:t,parentElement:e})}Zl.defaultProps={parentElement:"span"};var Yl,Jl=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.update(e),i}ll(e,t);var i=e.prototype;return i.cast=function(t){return t instanceof HTMLElement?Ql(t.outerHTML):t},i.update=function(t){return this.data=this.cast(t),this},e}(Wl),tc=function(t){function e(e){var i;return(i=t.call(this)||this)._cells=void 0,i.cells=e||[],i}ll(e,t);var i=e.prototype;return i.cell=function(t){return this._cells[t]},i.toArray=function(){return this.cells.map((function(t){return t.data}))},e.fromCells=function(t){return new e(t.map((function(t){return new Jl(t.data)})))},al(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(Wl),ec=function(t){function e(e){var i;return(i=t.call(this)||this)._rows=void 0,i._length=void 0,i.rows=e instanceof Array?e:e instanceof tc?[e]:[],i}return ll(e,t),e.prototype.toArray=function(){return this.rows.map((function(t){return t.toArray()}))},e.fromRows=function(t){return new e(t.map((function(t){return tc.fromCells(t.cells)})))},e.fromArray=function(t){return new e((t=function(t){return!t[0]||t[0]instanceof Array?t:[t]}(t)).map((function(t){return new tc(t.map((function(t){return new Jl(t)})))})))},al(e,[{key:"rows",get:function(){return this._rows},set:function(t){this._rows=t}},{key:"length",get:function(){return this._length||this.rows.length},set:function(t){this._length=t}}]),e}(Wl),ic=function(){function t(){this.callbacks=void 0}var e=t.prototype;return e.init=function(t){this.callbacks||(this.callbacks={}),t&&!this.callbacks[t]&&(this.callbacks[t]=[])},e.on=function(t,e){return this.init(t),this.callbacks[t].push(e),this},e.off=function(t,e){var i=t;return this.init(),this.callbacks[i]&&0!==this.callbacks[i].length?(this.callbacks[i]=this.callbacks[i].filter((function(t){return t!=e})),this):this},e.emit=function(t){var e=arguments,i=t;return this.init(i),this.callbacks[i].length>0&&(this.callbacks[i].forEach((function(t){return t.apply(void 0,[].slice.call(e,1))})),!0)},t}();!function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(Yl||(Yl={}));var nc=function(t){function e(e){var i;return(i=t.call(this)||this).id=void 0,i._props=void 0,i._props={},i.id=Ul(),e&&i.setProps(e),i}ll(e,t);var i=e.prototype;return i.process=function(){var t=[].slice.call(arguments);this.validateProps instanceof Function&&this.validateProps.apply(this,t),this.emit.apply(this,["beforeProcess"].concat(t));var e=this._process.apply(this,t);return this.emit.apply(this,["afterProcess"].concat(t)),e},i.setProps=function(t){return Object.assign(this._props,t),this.emit("propsUpdated",this),this},al(e,[{key:"props",get:function(){return this._props}}]),e}(ic),rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){return this.props.keyword?(e=String(this.props.keyword).trim(),i=this.props.columns,n=this.props.ignoreHiddenColumns,r=t,o=this.props.selector,e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new ec(r.rows.filter((function(t,r){return t.cells.some((function(t,a){if(!t)return!1;if(n&&i&&i[a]&&"object"==typeof i[a]&&i[a].hidden)return!1;var s="";if("function"==typeof o)s=o(t.data,r,a);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(s=l.props.content)}else s=String(t.data);return new RegExp(e,"gi").test(s)}))})))):t;var e,i,n,r,o},al(e,[{key:"type",get:function(){return Yl.Filter}}]),e}(nc);function oc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function ac(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var sc,lc=function(t){function e(e){var i;return(i=t.call(this)||this)._state=void 0,i.dispatcher=void 0,i.dispatcher=e,i._state=i.getInitialState(),e.register(i._handle.bind(hl(i))),i}ll(e,t);var i=e.prototype;return i._handle=function(t){this.handle(t.type,t.payload)},i.setState=function(t){var e=this._state;this._state=t,this.emit("updated",t,e)},al(e,[{key:"state",get:function(){return this._state}}]),e}(ic),cc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.getInitialState=function(){return{keyword:null}},i.handle=function(t,e){"SEARCH_KEYWORD"===t&&this.search(e.keyword)},i.search=function(t){this.setState({keyword:t})},e}(lc),hc=function(){function t(t){this.dispatcher=void 0,this.dispatcher=t}return t.prototype.dispatch=function(t,e){this.dispatcher.dispatch({type:t,payload:e})},t}(),pc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(hc),dc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){if(!this.props.keyword)return t;var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.keyword)),this.props.body&&(e.body=this.props.body(t.body,this.props.keyword)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerFilter}}]),e}(nc),uc=new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var i=this.format(t,"error");if(e)throw Error(i);console.error(i)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e}(Kl);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(sc||(sc={}));var fc=function(){function t(){this.plugins=void 0,this.plugins=[]}var e=t.prototype;return e.get=function(t){var e=this.plugins.filter((function(e){return e.id===t}));return e.length>0?e[0]:null},e.add=function(t){return t.id?null!==this.get(t.id)?(uc.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(uc.error("Plugin ID cannot be empty"),this)},e.remove=function(t){return this.plugins.splice(this.plugins.indexOf(this.get(t)),1),this},e.list=function(t){return(null!=t||null!=t?this.plugins.filter((function(e){return e.position===t})):this.plugins).sort((function(t,e){return t.order-e.order}))},t}(),mc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?zl(Sl,{},zl(e.component,sl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?zl(Sl,{},this.config.plugin.list(this.props.position).map((function(e){return zl(e.component,sl({plugin:e},e.props,t.props.props))}))):null},e}(Kl),vc=function(t){function e(e,i){var n;(n=t.call(this,e,i)||this).searchProcessor=void 0,n.actions=void 0,n.store=void 0,n.storeUpdatedFn=void 0,n.actions=new pc(n.config.dispatcher),n.store=new cc(n.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&n.actions.search(o),n.storeUpdatedFn=n.storeUpdated.bind(hl(n)),n.store.on("updated",n.storeUpdatedFn),r=e.server?new dc({keyword:e.keyword,url:e.server.url,body:e.server.body}):new rc({keyword:e.keyword,columns:n.config.header&&n.config.header.columns,ignoreHiddenColumns:e.ignoreHiddenColumns||void 0===e.ignoreHiddenColumns,selector:e.selector}),n.searchProcessor=r,n.config.pipeline.register(r)),n}ll(e,t);var i=e.prototype;return i.componentWillUnmount=function(){this.config.pipeline.unregister(this.searchProcessor),this.store.off("updated",this.storeUpdatedFn)},i.storeUpdated=function(t){this.searchProcessor.setProps({keyword:t.keyword})},i.onChange=function(t){this.actions.search(t.target.value)},i.render=function(){if(!this.props.enabled)return null;var t,e,i,n=this.onChange.bind(this);return this.searchProcessor instanceof dc&&(t=n,e=this.props.debounceTimeout,n=function(){var n=arguments;return new Promise((function(r){i&&clearTimeout(i),i=setTimeout((function(){return r(t.apply(void 0,[].slice.call(n)))}),e)}))}),zl("div",{className:oc(ac("search",this.config.className.search))},zl("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:n,className:ac(oc("input"),oc("search","input")),value:this.store.state.keyword}))},e}(gc);vc.defaultProps={debounceTimeout:250};var bc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.validateProps=function(){if(isNaN(Number(this.props.limit))||isNaN(Number(this.props.page)))throw Error("Invalid parameters passed")},i._process=function(t){var e=this.props.page;return new ec(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},al(e,[{key:"type",get:function(){return Yl.Limit}}]),e}(nc),yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.page,this.props.limit)),this.props.body&&(e.body=this.props.body(t.body,this.props.page,this.props.limit)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerLimit}}]),e}(nc),_c=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).processor=void 0,n.onUpdateFn=void 0,n.setTotalFromTabularFn=void 0,n.state={limit:e.limit,page:e.page||0,total:0},n}ll(e,t);var i=e.prototype;return i.componentWillMount=function(){var t,e=this;this.props.enabled&&(this.setTotalFromTabularFn=this.setTotalFromTabular.bind(this),this.props.server?(t=new yc({limit:this.state.limit,page:this.state.page,url:this.props.server.url,body:this.props.server.body}),this.config.pipeline.on("afterProcess",this.setTotalFromTabularFn)):(t=new bc({limit:this.state.limit,page:this.state.page})).on("beforeProcess",this.setTotalFromTabularFn),this.processor=t,this.config.pipeline.register(t),this.config.pipeline.on("error",(function(){e.setState({total:0,page:0})})))},i.setTotalFromTabular=function(t){this.setTotal(t.length)},i.onUpdate=function(t){this.props.resetPageOnUpdate&&t!==this.processor&&this.setPage(0)},i.componentDidMount=function(){this.onUpdateFn=this.onUpdate.bind(this),this.config.pipeline.on("updated",this.onUpdateFn)},i.componentWillUnmount=function(){this.config.pipeline.unregister(this.processor),this.config.pipeline.off("updated",this.onUpdateFn)},i.setPage=function(t){if(t>=this.pages||t<0||t===this.state.page)return null;this.setState({page:t}),this.processor.setProps({page:t})},i.setTotal=function(t){this.setState({total:t})},i.renderPages=function(){var t=this;if(this.props.buttonsCount<=0)return null;var e=Math.min(this.pages,this.props.buttonsCount),i=Math.min(this.state.page,Math.floor(e/2));return this.state.page+Math.floor(e/2)>=this.pages&&(i=e-(this.pages-this.state.page)),zl(Sl,null,this.pages>e&&this.state.page-i>0&&zl(Sl,null,zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,0),title:this._("pagination.firstPage"),"aria-label":this._("pagination.firstPage"),className:this.config.className.paginationButton},this._("1")),zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-i)})).map((function(e){return zl("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:ac(t.state.page===e?ac(oc("currentPage"),t.config.className.paginationButtonCurrent):null,t.config.className.paginationButton),title:t._("pagination.page",e+1),"aria-label":t._("pagination.page",e+1)},t._(""+(e+1)))})),this.pages>e&&this.pages>this.state.page+i+1&&zl(Sl,null,zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"..."),zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,this.pages-1),title:this._("pagination.page",this.pages),"aria-label":this._("pagination.page",this.pages),className:this.config.className.paginationButton},this._(""+this.pages))))},i.renderSummary=function(){return zl(Sl,null,this.props.summary&&this.state.total>0&&zl("div",{role:"status","aria-live":"polite",className:ac(oc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",zl("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",zl("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",zl("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},i.render=function(){return this.props.enabled?zl("div",{className:ac(oc("pagination"),this.config.className.pagination)},this.renderSummary(),zl("div",{className:oc("pages")},this.props.prevButton&&zl("button",{tabIndex:0,role:"button",disabled:0===this.state.page,onClick:this.setPage.bind(this,this.state.page-1),title:this._("pagination.previous"),"aria-label":this._("pagination.previous"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&zl("button",{tabIndex:0,role:"button",disabled:this.pages===this.state.page+1||0===this.pages,onClick:this.setPage.bind(this,this.state.page+1),title:this._("pagination.next"),"aria-label":this._("pagination.next"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},al(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(gc);function wc(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function xc(t){return t?Math.floor(t)+"px":""}_c.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var kc=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).tableElement=void 0,n.tableClassName=void 0,n.tableStyle=void 0,n.tableElement=n.props.tableRef.current.base.cloneNode(!0),n.tableElement.style.position="absolute",n.tableElement.style.width="100%",n.tableElement.style.zIndex="-2147483640",n.tableElement.style.visibility="hidden",n.tableClassName=n.tableElement.className,n.tableStyle=n.tableElement.style.cssText,n}ll(e,t);var i=e.prototype;return i.widths=function(){this.tableElement.className=this.tableClassName+" "+oc("shadowTable"),this.tableElement.style.tableLayout="auto",this.tableElement.style.width="auto",this.tableElement.style.padding="0",this.tableElement.style.margin="0",this.tableElement.style.border="none",this.tableElement.style.outline="none";var t=Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){var i;return e.style.width=e.clientWidth+"px",sl(((i={})[e.getAttribute("data-column-id")]={minWidth:e.clientWidth},i),t)}),{});return this.tableElement.className=this.tableClassName,this.tableElement.style.cssText=this.tableStyle,this.tableElement.style.tableLayout="auto",Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){return t[e.getAttribute("data-column-id")].width=e.clientWidth,t}),t)},i.render=function(){var t=this;return this.props.tableRef.current?zl("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Kl);function zc(t){if(!t)return"";var e=t.split(" ");return 1===e.length&&/([a-z][A-Z])+/g.test(t)?t:e.map((function(t,e){return 0==e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()})).join("")}var Ac=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}ll(e,t);var i=e.prototype;return i.adjustWidth=function(t){var i=t.container,n=t.tableRef,r=t.tempRef,o=t.tempRef||!0;if(!i)return this;var a=i.clientWidth,s={current:null},l={};if(n.current&&o){var c=zl(kc,{tableRef:n});c.ref=s,ql(c,r.current),l=s.current.widths()}for(var h,p=dl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=p()).done;){var d=h.value;d.columns&&d.columns.length>0||(!d.width&&o?d.id in l&&(d.width=xc(l[d.id].width),d.minWidth=xc(l[d.id].minWidth)):d.width=xc(wc(d.width,a)))}return n.current&&o&&ql(null,r.current),this},i.setSort=function(t,e){for(var i,n=dl(e||this.columns||[]);!(i=n()).done;){var r=i.value;r.columns&&r.columns.length>0&&(r.sort={enabled:!1}),void 0===r.sort&&t.sort&&(r.sort={enabled:!0}),r.sort?"object"==typeof r.sort&&(r.sort=sl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},i.setFixedHeader=function(t,e){for(var i,n=dl(e||this.columns||[]);!(i=n()).done;){var r=i.value;void 0===r.fixedHeader&&(r.fixedHeader=t.fixedHeader),r.columns&&this.setFixedHeader(t,r.columns)}},i.setResizable=function(t,e){for(var i,n=dl(e||this.columns||[]);!(i=n()).done;){var r=i.value;void 0===r.resizable&&(r.resizable=t.resizable),r.columns&&this.setResizable(t,r.columns)}},i.setID=function(t){for(var e,i=dl(t||this.columns||[]);!(e=i()).done;){var n=e.value;n.id||"string"!=typeof n.name||(n.id=zc(n.name)),n.id||uc.error('Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.'),n.columns&&this.setID(n.columns)}},i.populatePlugins=function(t,e){for(var i,n=dl(e);!(i=n()).done;){var r=i.value;void 0!==r.plugin&&t.plugin.add(sl({id:r.id,props:{}},r.plugin,{position:sc.Cell}))}},e.fromColumns=function(t){for(var i,n=new e,r=dl(t);!(i=r()).done;){var o=i.value;if("string"==typeof o||gl(o))n.columns.push({name:o});else if("object"==typeof o){var a=o;a.columns&&(a.columns=e.fromColumns(a.columns).columns),"object"==typeof a.plugin&&void 0===a.data&&(a.data=null),n.columns.push(o)}}return n},e.fromUserConfig=function(t){var i=new e;return t.from?i.columns=e.fromHTMLTable(t.from).columns:t.columns?i.columns=e.fromColumns(t.columns).columns:!t.data||"object"!=typeof t.data[0]||t.data[0]instanceof Array||(i.columns=Object.keys(t.data[0]).map((function(t){return{name:t}}))),i.columns.length?(i.setID(),i.setSort(t),i.setFixedHeader(t),i.setResizable(t),i.populatePlugins(t,i.columns),i):null},e.fromHTMLTable=function(t){for(var i,n=new e,r=dl(t.querySelector("thead").querySelectorAll("th"));!(i=r()).done;){var o=i.value;n.columns.push({name:o.innerHTML,width:o.width})}return n},e.tabularFormat=function(t){var e=[],i=t||[],n=[];if(i&&i.length){e.push(i);for(var r,o=dl(i);!(r=o()).done;){var a=r.value;a.columns&&a.columns.length&&(n=n.concat(a.columns))}n.length&&(e=e.concat(this.tabularFormat(n)))}return e},e.leafColumns=function(t){var e=[],i=t||[];if(i&&i.length)for(var n,r=dl(i);!(n=r()).done;){var o=n.value;o.columns&&0!==o.columns.length||e.push(o),o.columns&&(e=e.concat(this.leafColumns(o.columns)))}return e},e.maximumDepth=function(t){return this.tabularFormat([t]).length-1},al(e,[{key:"columns",get:function(){return this._columns},set:function(t){this._columns=t}},{key:"visibleColumns",get:function(){return this._columns.filter((function(t){return!t.hidden}))}}]),e}(Wl),Sc=function(){function t(){this._callbacks=void 0,this._isDispatching=void 0,this._isHandled=void 0,this._isPending=void 0,this._lastID=void 0,this._pendingPayload=void 0,this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}var e=t.prototype;return e.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},e.unregister=function(t){if(!this._callbacks[t])throw Error("Dispatcher.unregister(...): "+t+" does not map to a registered callback.");delete this._callbacks[t]},e.waitFor=function(t){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var i=t[e];if(this._isPending[i]){if(!this._isHandled[i])throw Error("Dispatcher.waitFor(...): Circular dependency detected while ' +\n 'waiting for "+i+".")}else{if(!this._callbacks[i])throw Error("Dispatcher.waitFor(...): "+i+" does not map to a registered callback.");this._invokeCallback(i)}}},e.dispatch=function(t){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},e.isDispatching=function(){return this._isDispatching},e._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},e._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},e._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}(),Cc=function(){},Ec=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.set(e),i}ll(e,t);var i=e.prototype;return i.get=function(){try{return Promise.resolve(this.data()).then((function(t){return{data:t,total:t.length}}))}catch(t){return Promise.reject(t)}},i.set=function(t){return t instanceof Array?this.data=function(){return t}:t instanceof Function&&(this.data=t),this},e}(Cc),Mc=function(t){function e(e){var i;return(i=t.call(this)||this).options=void 0,i.options=e,i}ll(e,t);var i=e.prototype;return i.handler=function(t){return"function"==typeof this.options.handle?this.options.handle(t):t.ok?t.json():(uc.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},i.get=function(t){var e=sl({},this.options,t);return"function"==typeof e.data?e.data(e):fetch(e.url,e).then(this.handler.bind(this)).then((function(t){return{data:e.then(t),total:"function"==typeof e.total?e.total(t):void 0}}))},e}(Cc),Lc=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new Ec(t.data)),t.from&&(e=new Ec(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new Mc(t.server)),e||uc.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,i,n=[],r=dl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,a=[],s=dl(e.value.querySelectorAll("td"));!(o=s()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?a.push((i=l.innerHTML,(new DOMParser).parseFromString(i,"text/html").documentElement.textContent)):a.push(Ql(l.innerHTML))}n.push(a)}return n},t}(),Hc="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Tc(t,e,i){if(!t.s){if(i instanceof Vc){if(!i.s)return void(i.o=Tc.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(Tc.bind(null,t,e),Tc.bind(null,t,2));t.s=e,t.v=i;var n=t.o;n&&n(t)}}var Vc=function(){function t(){}return t.prototype.then=function(e,i){var n=new t,r=this.s;if(r){var o=1&r?e:i;if(o){try{Tc(n,1,o(this.v))}catch(t){Tc(n,2,t)}return n}return this}return this.o=function(t){try{var r=t.v;1&t.s?Tc(n,1,e?e(r):r):i?Tc(n,1,i(r)):Tc(n,2,r)}catch(t){Tc(n,2,t)}},n},t}();function $c(t){return t instanceof Vc&&1&t.s}var Oc,Pc=function(t){function e(e){var i;return(i=t.call(this)||this)._steps=new Map,i.cache=new Map,i.lastProcessorIndexUpdated=-1,e&&e.forEach((function(t){return i.register(t)})),i}ll(e,t);var i=e.prototype;return i.clearCache=function(){this.cache=new Map,this.lastProcessorIndexUpdated=-1},i.register=function(t,e){if(void 0===e&&(e=null),null===t.type)throw Error("Processor type is not defined");t.on("propsUpdated",this.processorPropsUpdated.bind(this)),this.addProcessorByPriority(t,e),this.afterRegistered(t)},i.unregister=function(t){if(t){var e=this._steps.get(t.type);e&&e.length&&(this._steps.set(t.type,e.filter((function(e){return e!=t}))),this.emit("updated",t))}},i.addProcessorByPriority=function(t,e){var i=this._steps.get(t.type);if(!i){var n=[];this._steps.set(t.type,n),i=n}if(null===e||e<0)i.push(t);else if(i[e]){var r=i.slice(0,e-1),o=i.slice(e+1);this._steps.set(t.type,r.concat(t).concat(o))}else i[e]=t},i.getStepsByType=function(t){return this.steps.filter((function(e){return e.type===t}))},i.getSortedProcessorTypes=function(){return Object.keys(Yl).filter((function(t){return!isNaN(Number(t))})).map((function(t){return Number(t)}))},i.process=function(t){try{var e=this,i=function(t){return e.lastProcessorIndexUpdated=r.length,e.emit("afterProcess",o),o},n=e.lastProcessorIndexUpdated,r=e.steps,o=t,a=function(t,i){try{var a=function(t,e,i){if("function"==typeof t[Hc]){var n,r,o,a=t[Hc]();if(function t(i){try{for(;!(n=a.next()).done;)if((i=e(n.value))&&i.then){if(!$c(i))return void i.then(t,o||(o=Tc.bind(null,r=new Vc,2)));i=i.v}r?Tc(r,1,i):r=i}catch(t){Tc(r||(r=new Vc),2,t)}}(),a.return){var s=function(t){try{n.done||a.return()}catch(t){}return t};if(r&&r.then)return r.then(s,(function(t){throw s(t)}));s()}return r}if(!("length"in t))throw new TypeError("Object is not iterable");for(var l=[],c=0;c<t.length;c++)l.push(t[c]);return function(t,e,i){var n,r,o=-1;return function i(a){try{for(;++o<t.length;)if((a=e(o))&&a.then){if(!$c(a))return void a.then(i,r||(r=Tc.bind(null,n=new Vc,2)));a=a.v}n?Tc(n,1,a):n=a}catch(t){Tc(n||(n=new Vc),2,t)}}(),n}(l,(function(t){return e(l[t])}))}(r,(function(t){var i=e.findProcessorIndexByID(t.id),r=function(){if(i>=n)return Promise.resolve(t.process(o)).then((function(i){e.cache.set(t.id,o=i)}));o=e.cache.get(t.id)}();if(r&&r.then)return r.then((function(){}))}))}catch(t){return i(t)}return a&&a.then?a.then(void 0,i):a}(0,(function(t){throw uc.error(t),e.emit("error",o),t}));return Promise.resolve(a&&a.then?a.then(i):i())}catch(t){return Promise.reject(t)}},i.findProcessorIndexByID=function(t){return this.steps.findIndex((function(e){return e.id==t}))},i.setLastProcessorIndex=function(t){var e=this.findProcessorIndexByID(t.id);this.lastProcessorIndexUpdated>e&&(this.lastProcessorIndexUpdated=e)},i.processorPropsUpdated=function(t){this.setLastProcessorIndex(t),this.emit("propsUpdated"),this.emit("updated",t)},i.afterRegistered=function(t){this.setLastProcessorIndex(t),this.emit("afterRegister"),this.emit("updated",t)},al(e,[{key:"steps",get:function(){for(var t,e=[],i=dl(this.getSortedProcessorTypes());!(t=i()).done;){var n=this._steps.get(t.value);n&&n.length&&(e=e.concat(n))}return e.filter((function(t){return t}))}}]),e}(ic),Rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},al(e,[{key:"type",get:function(){return Yl.Extractor}}]),e}(nc),Ic=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e=ec.fromArray(t.data);return e.length=t.total,e},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(nc),Nc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(){return Object.entries(this.props.serverStorageOptions).filter((function(t){return"function"!=typeof t[1]})).reduce((function(t,e){var i;return sl({},t,((i={})[e[0]]=e[1],i))}),{})},al(e,[{key:"type",get:function(){return Yl.Initiator}}]),e}(nc),Fc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.castData=function(t){if(!t||!t.length)return[];if(!this.props.header||!this.props.header.columns)return t;var e=Ac.leafColumns(this.props.header.columns);return t[0]instanceof Array?t.map((function(t){var i=0;return e.map((function(e,n){return void 0!==e.data?(i++,"function"==typeof e.data?e.data(t):e.data):t[n-i]}))})):"object"!=typeof t[0]||t[0]instanceof Array?[]:t.map((function(t){return e.map((function(e,i){return void 0!==e.data?"function"==typeof e.data?e.data(t):e.data:e.id?t[e.id]:(uc.error("Could not find the correct cell for column at position "+i+".\n Make sure either 'id' or 'selector' is defined for all columns."),null)}))}))},i._process=function(t){return{data:this.castData(t.data),total:t.total}},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(nc),Bc=function(){function t(){}return t.createFromConfig=function(t){var e=new Pc;return t.storage instanceof Mc&&e.register(new Nc({serverStorageOptions:t.server})),e.register(new Rc({storage:t.storage})),e.register(new Fc({header:t.header})),e.register(new Ic),e},t}(),Dc=function(){function t(e){this._userConfig=void 0,Object.assign(this,sl({},t.defaultConfig(),e)),this._userConfig={}}var e=t.prototype;return e.assign=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var n=i[e];"_userConfig"!==n&&(this[n]=t[n])}return this},e.update=function(e){return e?(this._userConfig=sl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new fc,dispatcher:new Sc,tableRef:{current:null},tempRef:{current:null},width:"100%",height:"auto",autoWidth:!0,style:{},className:{}}},t.fromUserConfig=function(e){var i=new t(e);return i._userConfig=e,"boolean"==typeof e.sort&&e.sort&&i.assign({sort:{multiColumn:!0}}),i.assign({header:Ac.fromUserConfig(i)}),i.assign({storage:Lc.createFromUserConfig(e)}),i.assign({pipeline:Bc.createFromConfig(i)}),i.assign({translator:new Xl(e.language)}),i.plugin.add({id:"search",position:sc.Header,component:vc,props:sl({enabled:!0===e.search||e.search instanceof Object},e.search)}),i.plugin.add({id:"pagination",position:sc.Footer,component:_c,props:sl({enabled:!0===e.pagination||e.pagination instanceof Object},e.pagination)}),e.plugins&&e.plugins.forEach((function(t){return i.plugin.add(t)})),i},t}();!function(t){t[t.Init=0]="Init",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Rendered=3]="Rendered",t[t.Error=4]="Error"}(Oc||(Oc={}));var jc,qc,Uc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.content=function(){return this.props.column&&"function"==typeof this.props.column.formatter?this.props.column.formatter(this.props.cell.data,this.props.row,this.props.column):this.props.column&&this.props.column.plugin?zl(mc,{pluginId:this.props.column.id,props:{column:this.props.column,cell:this.props.cell,row:this.props.row}}):this.props.cell.data},i.handleClick=function(t){this.props.messageCell||this.config.eventEmitter.emit("cellClick",t,this.props.cell,this.props.column,this.props.row)},i.getCustomAttributes=function(t){return t?"function"==typeof t.attributes?t.attributes(this.props.cell.data,this.props.row,this.props.column):t.attributes:{}},i.render=function(){return zl("td",sl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("td"),this.props.className,this.config.className.td),style:sl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Kl),Wc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.getColumn=function(t){if(this.props.header){var e=Ac.leafColumns(this.props.header.columns);if(e)return e[t]}return null},i.handleClick=function(t){this.props.messageRow||this.config.eventEmitter.emit("rowClick",t,this.props.row)},i.getChildren=function(){var t=this;return this.props.children?this.props.children:zl(Sl,null,this.props.row.cells.map((function(e,i){var n=t.getColumn(i);return n&&n.hidden?null:zl(Uc,{key:e.id,cell:e,row:t.props.row,column:n})})))},i.render=function(){return zl("tr",{className:ac(oc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Kl),Gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(Wc,{messageRow:!0},zl(Uc,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Jl(this.props.message),className:ac(oc("message"),this.props.className?this.props.className:null)}))},e}(Kl),Xc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.headerLength=function(){return this.props.header?this.props.header.visibleColumns.length:0},i.render=function(){var t=this;return zl("tbody",{className:ac(oc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return zl(Wc,{key:e.id,row:e,header:t.props.header})})),this.props.status===Oc.Loading&&(!this.props.data||0===this.props.data.length)&&zl(Gc,{message:this._("loading"),colSpan:this.headerLength(),className:ac(oc("loading"),this.config.className.loading)}),this.props.status===Oc.Rendered&&this.props.data&&0===this.props.data.length&&zl(Gc,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:ac(oc("notfound"),this.config.className.notfound)}),this.props.status===Oc.Error&&zl(Gc,{message:this._("error"),colSpan:this.headerLength(),className:ac(oc("error"),this.config.className.error)}))},e}(Kl),Kc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.validateProps=function(){for(var t,e=dl(this.props.columns);!(t=e()).done;){var i=t.value;void 0===i.direction&&(i.direction=1),1!==i.direction&&-1!==i.direction&&uc.error("Invalid sort direction "+i.direction)}},i.compare=function(t,e){return t>e?1:t<e?-1:0},i.compareWrapper=function(t,e){for(var i,n=0,r=dl(this.props.columns);!(i=r()).done;){var o=i.value;if(0!==n)break;var a=t.cells[o.index].data,s=e.cells[o.index].data;n|="function"==typeof o.compare?o.compare(a,s)*o.direction:this.compare(a,s)*o.direction}return n},i._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var i=new ec(e);return i.length=t.length,i},al(e,[{key:"type",get:function(){return Yl.Sort}}]),e}(nc),Zc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.getInitialState=function(){return[]},i.handle=function(t,e){"SORT_COLUMN"===t?this.sortColumn(e.index,e.direction,e.multi,e.compare):"SORT_COLUMN_TOGGLE"===t&&this.sortToggle(e.index,e.multi,e.compare)},i.sortToggle=function(t,e,i){var n=[].concat(this.state).find((function(e){return e.index===t}));this.sortColumn(t,n&&1===n.direction?-1:1,e,i)},i.sortColumn=function(t,e,i,n){var r=[].concat(this.state),o=r.length,a=r.find((function(e){return e.index===t})),s=!1,l=!1,c=!1,h=!1;if(void 0!==a?i?-1===a.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,s=!0):0===o?s=!0:o>0&&!i?(s=!0,l=!0):o>0&&i&&(s=!0),l&&(r=[]),s)r.push({index:t,direction:e,compare:n});else if(h){var p=r.indexOf(a);r[p].direction=e}else if(c){var d=r.indexOf(a);r.splice(d,1)}this.setState(r)},e}(lc),Qc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.sortColumn=function(t,e,i,n){this.dispatch("SORT_COLUMN",{index:t,direction:e,multi:i,compare:n})},i.sortToggle=function(t,e,i){this.dispatch("SORT_COLUMN_TOGGLE",{index:t,multi:e,compare:i})},e}(hc),Yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.columns)),this.props.body&&(e.body=this.props.body(t.body,this.props.columns)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerSort}}]),e}(nc),Jc=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).sortProcessor=void 0,n.actions=void 0,n.store=void 0,n.updateStateFn=void 0,n.updateSortProcessorFn=void 0,n.actions=new Qc(n.config.dispatcher),n.store=new Zc(n.config.dispatcher),e.enabled&&(n.sortProcessor=n.getOrCreateSortProcessor(),n.updateStateFn=n.updateState.bind(hl(n)),n.store.on("updated",n.updateStateFn),n.state={direction:0}),n}ll(e,t);var i=e.prototype;return i.componentWillUnmount=function(){this.config.pipeline.unregister(this.sortProcessor),this.store.off("updated",this.updateStateFn),this.updateSortProcessorFn&&this.store.off("updated",this.updateSortProcessorFn)},i.updateState=function(){var t=this,e=this.store.state.find((function(e){return e.index===t.props.index}));this.setState(e?{direction:e.direction}:{direction:0})},i.updateSortProcessor=function(t){this.sortProcessor.setProps({columns:t})},i.getOrCreateSortProcessor=function(){var t=Yl.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Yl.ServerSort);var e,i=this.config.pipeline.getStepsByType(t);return i.length>0?e=i[0]:(this.updateSortProcessorFn=this.updateSortProcessor.bind(this),this.store.on("updated",this.updateSortProcessorFn),e=t===Yl.ServerSort?new Yc(sl({columns:this.store.state},this.config.sort.server)):new Kc({columns:this.store.state}),this.config.pipeline.register(e)),e},i.changeDirection=function(t){t.preventDefault(),t.stopPropagation(),this.actions.sortToggle(this.props.index,!0===t.shiftKey&&this.config.sort.multiColumn,this.props.compare)},i.render=function(){if(!this.props.enabled)return null;var t=this.state.direction,e="neutral";return 1===t?e="asc":-1===t&&(e="desc"),zl("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:ac(oc("sort"),oc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Kl),th=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).moveFn=void 0,e.upFn=void 0,e}ll(e,t);var i=e.prototype;return i.getPageX=function(t){return t instanceof MouseEvent?Math.floor(t.pageX):Math.floor(t.changedTouches[0].pageX)},i.start=function(t){var e,i,n,r,o;t.stopPropagation(),this.setState({offsetStart:parseInt(this.props.thRef.current.style.width,10)-this.getPageX(t)}),this.upFn=this.end.bind(this),this.moveFn=(e=this.move.bind(this),void 0===(i=10)&&(i=100),function(){var t=[].slice.call(arguments);n?(clearTimeout(r),r=setTimeout((function(){Date.now()-o>=i&&(e.apply(void 0,t),o=Date.now())}),Math.max(i-(Date.now()-o),0))):(e.apply(void 0,t),o=Date.now(),n=!0)}),document.addEventListener("mouseup",this.upFn),document.addEventListener("touchend",this.upFn),document.addEventListener("mousemove",this.moveFn),document.addEventListener("touchmove",this.moveFn)},i.move=function(t){t.stopPropagation();var e=this.props.thRef.current;this.state.offsetStart+this.getPageX(t)>=parseInt(e.style.minWidth,10)&&(e.style.width=this.state.offsetStart+this.getPageX(t)+"px")},i.end=function(t){t.stopPropagation(),document.removeEventListener("mouseup",this.upFn),document.removeEventListener("mousemove",this.moveFn),document.removeEventListener("touchmove",this.moveFn),document.removeEventListener("touchend",this.upFn)},i.render=function(){return zl("div",{className:ac(oc("th"),oc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Kl),eh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).sortRef={current:null},n.thRef={current:null},n.state={style:{}},n}ll(e,t);var i=e.prototype;return i.isSortable=function(){return this.props.column.sort.enabled},i.isResizable=function(){return this.props.column.resizable},i.onClick=function(t){t.stopPropagation(),this.isSortable()&&this.sortRef.current.changeDirection(t)},i.keyDown=function(t){this.isSortable()&&13===t.which&&this.onClick(t)},i.componentDidMount=function(){var t=this;setTimeout((function(){if(t.props.column.fixedHeader&&t.thRef.current){var e=t.thRef.current.offsetTop;"number"==typeof e&&t.setState({style:{top:e}})}}),0)},i.content=function(){return void 0!==this.props.column.name?this.props.column.name:void 0!==this.props.column.plugin?zl(mc,{pluginId:this.props.column.plugin.id,props:{column:this.props.column}}):null},i.getCustomAttributes=function(){var t=this.props.column;return t?"function"==typeof t.attributes?t.attributes(null,null,this.props.column):t.attributes:{}},i.render=function(){var t={};return this.isSortable()&&(t.tabIndex=0),zl("th",sl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("th"),this.isSortable()?oc("th","sort"):null,this.props.column.fixedHeader?oc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:sl({},this.config.style.th,{minWidth:this.props.column.minWidth,width:this.props.column.width},this.state.style,this.props.style),onKeyDown:this.keyDown.bind(this),rowSpan:this.props.rowSpan>1?this.props.rowSpan:void 0,colSpan:this.props.colSpan>1?this.props.colSpan:void 0},this.getCustomAttributes(),t),zl("div",{className:oc("th","content")},this.content()),this.isSortable()&&zl(Jc,sl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&zl(th,{column:this.props.column,thRef:this.thRef}))},e}(Kl),ih=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var i=e.prototype;return i.renderColumn=function(t,e,i,n){var r=function(t,e,i){var n=Ac.maximumDepth(t),r=i-e;return{rowSpan:Math.floor(r-n-n/r),colSpan:t.columns&&t.columns.length||1}}(t,e,n);return zl(eh,{column:t,index:i,colSpan:r.colSpan,rowSpan:r.rowSpan})},i.renderRow=function(t,e,i){var n=this,r=Ac.leafColumns(this.props.header.columns);return zl(Wc,null,t.map((function(t){return t.hidden?null:n.renderColumn(t,e,r.indexOf(t),i)})))},i.renderRows=function(){var t=this,e=Ac.tabularFormat(this.props.header.columns);return e.map((function(i,n){return t.renderRow(i,n,e.length)}))},i.render=function(){return this.props.header?zl("thead",{key:this.props.header.id,className:ac(oc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Kl),nh=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl("table",{role:"grid",className:ac(oc("table"),this.config.className.table),style:sl({},this.config.style.table,{height:this.props.height})},zl(ih,{header:this.props.header}),zl(Xc,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Kl),rh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).headerRef={current:null},n.state={isActive:!0},n}ll(e,t);var i=e.prototype;return i.componentDidMount=function(){0===this.headerRef.current.children.length&&this.setState({isActive:!1})},i.render=function(){return this.state.isActive?zl("div",{ref:this.headerRef,className:ac(oc("head"),this.config.className.header),style:sl({},this.config.style.header)},zl(mc,{position:sc.Header})):null},e}(Kl),oh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).footerRef={current:null},n.state={isActive:!0},n}ll(e,t);var i=e.prototype;return i.componentDidMount=function(){0===this.footerRef.current.children.length&&this.setState({isActive:!1})},i.render=function(){return this.state.isActive?zl("div",{ref:this.footerRef,className:ac(oc("footer"),this.config.className.footer),style:sl({},this.config.style.footer)},zl(mc,{position:sc.Footer})):null},e}(Kl),ah=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).configContext=void 0,n.processPipelineFn=void 0,n.configContext=function(t,e){var i={__c:e="__cC"+bl++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,n;return this.getChildContext||(i=[],(n={})[e]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some(Ll)},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}(),n.state={status:Oc.Loading,header:e.header,data:null},n}ll(e,t);var i=e.prototype;return i.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Oc.Loading});var e=function(e,i){try{var n=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Oc.Loaded}),t.props.config.eventEmitter.emit("load",e)}))}catch(t){return i(t)}return n&&n.then?n.then(void 0,i):n}(0,(function(e){uc.error(e),t.setState({status:Oc.Error,data:null})}));return Promise.resolve(e&&e.then?e.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},i.componentDidMount=function(){try{var t=this,e=t.props.config;return Promise.resolve(t.processPipeline()).then((function(){e.header&&t.state.data&&t.state.data.length&&t.setState({header:e.header.adjustWidth(e)}),t.processPipelineFn=t.processPipeline.bind(t),t.props.pipeline.on("updated",t.processPipelineFn)}))}catch(t){return Promise.reject(t)}},i.componentWillUnmount=function(){this.props.pipeline.off("updated",this.processPipelineFn)},i.componentDidUpdate=function(t,e){e.status!=Oc.Rendered&&this.state.status==Oc.Loaded&&(this.setState({status:Oc.Rendered}),this.props.config.eventEmitter.emit("ready"))},i.render=function(){return zl(this.configContext.Provider,{value:this.props.config},zl("div",{role:"complementary",className:ac("gridjs",oc("container"),this.state.status===Oc.Loading?oc("loading"):null,this.props.config.className.container),style:sl({},this.props.config.style.container,{width:this.props.width})},this.state.status===Oc.Loading&&zl("div",{className:oc("loading-bar")}),zl(rh,null),zl("div",{className:oc("wrapper"),style:{height:this.props.height}},zl(nh,{ref:this.props.config.tableRef,data:this.state.data,header:this.state.header,width:this.props.width,height:this.props.height,status:this.state.status})),zl(oh,null),zl("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:oc("temp")})))},e}(Kl),sh=function(t){function e(e){var i;return(i=t.call(this)||this).config=void 0,i.plugin=void 0,i.config=new Dc({instance:hl(i),eventEmitter:hl(i)}).update(e),i.plugin=i.config.plugin,i}ll(e,t);var i=e.prototype;return i.updateConfig=function(t){return this.config.update(t),this},i.createElement=function(){return zl(ah,{config:this.config,pipeline:this.config.pipeline,header:this.config.header,width:this.config.width,height:this.config.height})},i.forceRender=function(){return this.config&&this.config.container||uc.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),ql(null,this.config.container),ql(this.createElement(),this.config.container),this},i.render=function(t){return t||uc.error("Container element cannot be null",!0),t.childNodes.length>0?(uc.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,ql(this.createElement(),t),this)},e}(ic),lh=[],ch=ul.__b,hh=ul.__r,ph=ul.diffed,dh=ul.__c,uh=ul.unmount;function gh(){lh.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(mh),t.__H.__h.forEach(vh),t.__H.__h=[]}catch(e){t.__H.__h=[],ul.__e(e,t.__v)}})),lh=[]}ul.__b=function(t){jc=null,ch&&ch(t)},ul.__r=function(t){hh&&hh(t),0;var e=(jc=t.__c).__H;e&&(e.__h.forEach(mh),e.__h.forEach(vh),e.__h=[])},ul.diffed=function(t){ph&&ph(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==lh.push(e)&&qc===ul.requestAnimationFrame||((qc=ul.requestAnimationFrame)||function(t){var e,i=function(){clearTimeout(n),fh&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,100);fh&&(e=requestAnimationFrame(i))})(gh)),jc=void 0},ul.__c=function(t,e){e.some((function(t){try{t.__h.forEach(mh),t.__h=t.__h.filter((function(t){return!t.__||vh(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ul.__e(i,t.__v)}})),dh&&dh(t,e)},ul.unmount=function(t){uh&&uh(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(mh)}catch(t){ul.__e(t,e.__v)}};var fh="function"==typeof requestAnimationFrame;function mh(t){var e=jc;"function"==typeof t.__c&&t.__c(),jc=e}function vh(t){var e=jc;t.__c=t.__(),jc=e}class bh extends V{static get properties(){return Object.assign({label:{type:String},property:{type:String},sort:{type:Boolean},width:{type:String}},super.properties)}constructor(){super(),this.label="no-label",this.property=null,this.sort=!1,this.width=null}connectedCallback(){super.connectedCallback()}data(){const t={name:this.label,sort:{enabled:this.sort},formatter:t=>Ql(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",bh);class yh extends(R(V)){static get properties(){return Object.assign({source:{type:String},cssPath:{type:String,attribute:"css-path"},resizable:{type:Boolean},perPage:{type:Number,attribute:"per-page"},height:{type:String},search:{type:Boolean},_params:{type:Object}},super.properties)}constructor(){super(),this.cssPath="../css/gridjs",this._params={},this.resizable=!1,this.search=!1,this.perPage=10,this.height=null,this.fixedHeader=!1}connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),window.addEventListener("popstate",t=>{this._params=t.state,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),i=[];e.forEach(t=>i.push(t.data())),yh.waitOnce("pb-page-ready",()=>{this._params=this.getParameters();const e=this.toAbsoluteURL(this.source),n={height:this.height,fixedHeader:!0,columns:i,resizable:this.resizable,server:{url:e,then:t=>t.results,total:t=>t.count},sort:{multiColumn:!1,enabled:!0,server:{url:(t,e)=>{if(!e.length)return t;const n=e[0];return`${t}${t.indexOf("?")>-1?"&":"?"}order=${i[n.index].id}&dir=${1===n.direction?"asc":"desc"}`}}},pagination:{enabled:!0,limit:this.perPage,server:{url:(t,e,i)=>{const n=this.shadowRoot.getElementById("form");return n&&Object.assign(this._params,n.serializeForm()),this._params.limit=i,this._params.start=e*i+1,this.setParameters(this._params),this.pushHistory("grid",this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new sh(n),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){const t=O(this.cssPath);return $`
|
|
4224
|
+
`}}function ol(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function al(t,e,n){return e&&ol(t.prototype,e),n&&ol(t,n),t}function sl(){return(sl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function ll(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cl(t,e)}function cl(t,e){return(cl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function dl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}customElements.define("pb-blacklab-highlight",rl);var ul,gl,fl,ml,vl,bl,yl={},_l=[],wl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xl(t,e){for(var n in e)t[n]=e[n];return t}function kl(t){var e=t.parentNode;e&&e.removeChild(t)}function zl(t,e,n){var i,r,o,a=arguments,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>3)for(n=[n],o=3;o<arguments.length;o++)n.push(a[o]);if(null!=n&&(s.children=n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Al(t,s,i,r,null)}function Al(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++ul.__v:r};return null!=ul.vnode&&ul.vnode(o),o}function Sl(t){return t.children}function Cl(t,e){this.props=t,this.context=e}function El(t,e){if(null==e)return t.__?El(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?El(t):null}function Ml(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Ml(t)}}function Ll(t){(!t.__d&&(t.__d=!0)&&fl.push(t)&&!Hl.__r++||vl!==ul.debounceRendering)&&((vl=ul.debounceRendering)||ml)(Hl)}function Hl(){for(var t;Hl.__r=fl.length;)t=fl.sort((function(t,e){return t.__v.__b-e.__v.__b})),fl=[],t.some((function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=xl({},r)).__v=r.__v+1,Nl(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?El(r):o,r.__h),Fl(n,r),r.__e!=o&&Ml(r)))}))}function Tl(t,e,n,i,r,o,a,s,l,c){var h,p,d,u,g,f,m,v=i&&i.__k||_l,b=v.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(u=n.__k[h]=null==(u=e[h])||"boolean"==typeof u?null:"string"==typeof u||"number"==typeof u||"bigint"==typeof u?Al(null,u,null,null,u):Array.isArray(u)?Al(Sl,{children:u},null,null,null):u.__b>0?Al(u.type,u.props,u.key,null,u.__v):u)){if(u.__=n,u.__b=n.__b+1,null===(d=v[h])||d&&u.key==d.key&&u.type===d.type)v[h]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&u.key==d.key&&u.type===d.type){v[p]=void 0;break}d=null}Nl(t,u,d=d||yl,r,o,a,s,l,c),g=u.__e,(p=u.ref)&&d.ref!=p&&(m||(m=[]),d.ref&&m.push(d.ref,null,u),m.push(p,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&null!=u.__k&&u.__k===d.__k?u.__d=l=Vl(u,l,t):l=$l(t,u,d,v,g,l),c||"option"!==n.type?"function"==typeof n.type&&(n.__d=l):t.value=""):l&&d.__e==l&&l.parentNode!=t&&(l=El(d))}for(n.__e=f,h=b;h--;)null!=v[h]&&("function"==typeof n.type&&null!=v[h].__e&&v[h].__e==n.__d&&(n.__d=El(i,h+1)),Dl(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Bl(m[h],m[++h],m[++h])}function Vl(t,e,n){var i,r;for(i=0;i<t.__k.length;i++)(r=t.__k[i])&&(r.__=t,e="function"==typeof r.type?Vl(r,e,n):$l(n,r,r,t.__k,r.__e,e));return e}function $l(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Ol(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||wl.test(e)?n:n+"px"}function Pl(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ol(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||Ol(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?Il:Rl,o):t.removeEventListener(e,o?Il:Rl,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function Rl(t){this.l[t.type+!1](ul.event?ul.event(t):t)}function Il(t){this.l[t.type+!0](ul.event?ul.event(t):t)}function Nl(t,e,n,i,r,o,a,s,l){var c,h,p,d,u,g,f,m,v,b,y,_=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=ul.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,v=(c=_.contextType)&&i[c.__c],b=c?v?v.props.value:c.__:i,n.__c?f=(h=e.__c=n.__c).__=h.__E:("prototype"in _&&_.prototype.render?e.__c=h=new _(m,b):(e.__c=h=new Cl(m,b),h.constructor=_,h.render=jl),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=i,p=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=_.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=xl({},h.__s)),xl(h.__s,_.getDerivedStateFromProps(m,h.__s))),d=h.props,u=h.state,p)null==_.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===n.__v){h.props=m,h.state=h.__s,e.__v!==n.__v&&(h.__d=!1),h.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),h.__h.length&&a.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,u,g)}))}h.context=b,h.props=m,h.state=h.__s,(c=ul.__r)&&c(e),h.__d=!1,h.__v=e,h.__P=t,c=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(i=xl(xl({},i),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(d,u)),y=null!=c&&c.type===Sl&&null==c.key?c.props.children:c,Tl(t,Array.isArray(y)?y:[y],e,n,i,r,o,a,s,l),h.base=e.__e,e.__h=null,h.__h.length&&a.push(h),f&&(h.__E=h.__=null),h.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,i,r,o,a,s){var l,c,h,p,d=n.props,u=e.props,g=e.type,f=0;if("svg"===g&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&(l===t||(g?l.localName==g:3==l.nodeType))){t=l,o[f]=null;break}if(null==t){if(null===g)return document.createTextNode(u);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,u.is&&u),o=null,s=!1}if(null===g)d===u||s&&t.data===u||(t.data=u);else{if(o=o&&_l.slice.call(t.childNodes),c=(d=n.props||yl).dangerouslySetInnerHTML,h=u.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<t.attributes.length;p++)d[t.attributes[p].name]=t.attributes[p].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||Pl(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||Pl(t,o,e[o],n[o],i)}(t,u,d,r,s),h)e.__k=[];else if(f=e.props.children,Tl(t,Array.isArray(f)?f:[f],e,n,i,r&&"foreignObject"!==g,o,a,t.firstChild,s),null!=o)for(f=o.length;f--;)null!=o[f]&&kl(o[f]);s||("value"in u&&void 0!==(f=u.value)&&(f!==t.value||"progress"===g&&!f)&&Pl(t,"value",f,d.value,!1),"checked"in u&&void 0!==(f=u.checked)&&f!==t.checked&&Pl(t,"checked",f,d.checked,!1))}return t}(n.__e,e,n,i,r,o,a,l);(c=ul.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),ul.__e(t,e,n)}}function Fl(t,e){ul.__c&&ul.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ul.__e(t,e.__v)}}))}function Bl(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){ul.__e(t,n)}}function Dl(t,e,n){var i,r,o;if(ul.unmount&&ul.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Bl(i,null,e)),n||"function"==typeof t.type||(n=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ul.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&Dl(i[o],e,n);null!=r&&kl(r)}function jl(t,e,n){return this.constructor(t,n)}function ql(t,e,n){var i,r,o;ul.__&&ul.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],Nl(e,t=(!i&&n||e).__k=zl(Sl,null,[t]),r||yl,yl,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?_l.slice.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),Fl(o,t)}function Ul(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}ul={__e:function(t,e){for(var n,i,r;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),r=n.__d),r)return n.__E=n}catch(e){t=e}throw t},__v:0},gl=function(t){return null!=t&&void 0===t.constructor},Cl.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xl({},this.state),"function"==typeof t&&(t=t(xl({},n),this.props)),t&&xl(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),Ll(this))},Cl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ll(this))},Cl.prototype.render=Sl,fl=[],ml="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hl.__r=0,bl=0;var Wl=function(){function t(t){this._id=void 0,this._id=t||Ul()}return al(t,[{key:"id",get:function(){return this._id}}]),t}(),Gl={search:{placeholder:"Type a keyword..."},sort:{sortAsc:"Sort column ascending",sortDesc:"Sort column descending"},pagination:{previous:"Previous",next:"Next",navigate:function(t,e){return"Page "+t+" of "+e},page:function(t){return"Page "+t},showing:"Showing",of:"of",to:"to",results:"results"},loading:"Loading...",noRecordsFound:"No matching records found",error:"An error happened while fetching the data"},Xl=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Gl}var e=t.prototype;return e.getString=function(t,e){if(!e||!t)return null;var n=t.split("."),i=n[0];if(e[i]){var r=e[i];return"string"==typeof r?function(){return r}:"function"==typeof r?r:this.getString(n.slice(1).join("."),r)}return null},e.translate=function(t){var e;return(e=this.getString(t,this._language)||this.getString(t,this._defaultLanguage))?e.apply(void 0,[].slice.call(arguments,1)):t},t}(),Kl=function(t){function e(e,n){var i,r;return(i=t.call(this,e,n)||this).config=void 0,i._=void 0,i.config=function(t){if(!t)return null;var e=Object.keys(t);return e.length?t[e[0]].props.value:null}(n),i.config&&(i._=(r=i.config.translator,function(t){return r.translate.apply(r,[t].concat([].slice.call(arguments,1)))})),i}return ll(e,t),e}(Cl),Zl=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Kl);function Ql(t,e){return zl(Zl,{content:t,parentElement:e})}Zl.defaultProps={parentElement:"span"};var Yl,Jl=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.update(e),n}ll(e,t);var n=e.prototype;return n.cast=function(t){return t instanceof HTMLElement?Ql(t.outerHTML):t},n.update=function(t){return this.data=this.cast(t),this},e}(Wl),tc=function(t){function e(e){var n;return(n=t.call(this)||this)._cells=void 0,n.cells=e||[],n}ll(e,t);var n=e.prototype;return n.cell=function(t){return this._cells[t]},n.toArray=function(){return this.cells.map((function(t){return t.data}))},e.fromCells=function(t){return new e(t.map((function(t){return new Jl(t.data)})))},al(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(Wl),ec=function(t){function e(e){var n;return(n=t.call(this)||this)._rows=void 0,n._length=void 0,n.rows=e instanceof Array?e:e instanceof tc?[e]:[],n}return ll(e,t),e.prototype.toArray=function(){return this.rows.map((function(t){return t.toArray()}))},e.fromRows=function(t){return new e(t.map((function(t){return tc.fromCells(t.cells)})))},e.fromArray=function(t){return new e((t=function(t){return!t[0]||t[0]instanceof Array?t:[t]}(t)).map((function(t){return new tc(t.map((function(t){return new Jl(t)})))})))},al(e,[{key:"rows",get:function(){return this._rows},set:function(t){this._rows=t}},{key:"length",get:function(){return this._length||this.rows.length},set:function(t){this._length=t}}]),e}(Wl),nc=function(){function t(){this.callbacks=void 0}var e=t.prototype;return e.init=function(t){this.callbacks||(this.callbacks={}),t&&!this.callbacks[t]&&(this.callbacks[t]=[])},e.on=function(t,e){return this.init(t),this.callbacks[t].push(e),this},e.off=function(t,e){var n=t;return this.init(),this.callbacks[n]&&0!==this.callbacks[n].length?(this.callbacks[n]=this.callbacks[n].filter((function(t){return t!=e})),this):this},e.emit=function(t){var e=arguments,n=t;return this.init(n),this.callbacks[n].length>0&&(this.callbacks[n].forEach((function(t){return t.apply(void 0,[].slice.call(e,1))})),!0)},t}();!function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(Yl||(Yl={}));var ic=function(t){function e(e){var n;return(n=t.call(this)||this).id=void 0,n._props=void 0,n._props={},n.id=Ul(),e&&n.setProps(e),n}ll(e,t);var n=e.prototype;return n.process=function(){var t=[].slice.call(arguments);this.validateProps instanceof Function&&this.validateProps.apply(this,t),this.emit.apply(this,["beforeProcess"].concat(t));var e=this._process.apply(this,t);return this.emit.apply(this,["afterProcess"].concat(t)),e},n.setProps=function(t){return Object.assign(this._props,t),this.emit("propsUpdated",this),this},al(e,[{key:"props",get:function(){return this._props}}]),e}(nc),rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){return this.props.keyword?(e=String(this.props.keyword).trim(),n=this.props.columns,i=this.props.ignoreHiddenColumns,r=t,o=this.props.selector,e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new ec(r.rows.filter((function(t,r){return t.cells.some((function(t,a){if(!t)return!1;if(i&&n&&n[a]&&"object"==typeof n[a]&&n[a].hidden)return!1;var s="";if("function"==typeof o)s=o(t.data,r,a);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(s=l.props.content)}else s=String(t.data);return new RegExp(e,"gi").test(s)}))})))):t;var e,n,i,r,o},al(e,[{key:"type",get:function(){return Yl.Filter}}]),e}(ic);function oc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function ac(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var sc,lc=function(t){function e(e){var n;return(n=t.call(this)||this)._state=void 0,n.dispatcher=void 0,n.dispatcher=e,n._state=n.getInitialState(),e.register(n._handle.bind(hl(n))),n}ll(e,t);var n=e.prototype;return n._handle=function(t){this.handle(t.type,t.payload)},n.setState=function(t){var e=this._state;this._state=t,this.emit("updated",t,e)},al(e,[{key:"state",get:function(){return this._state}}]),e}(nc),cc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return{keyword:null}},n.handle=function(t,e){"SEARCH_KEYWORD"===t&&this.search(e.keyword)},n.search=function(t){this.setState({keyword:t})},e}(lc),hc=function(){function t(t){this.dispatcher=void 0,this.dispatcher=t}return t.prototype.dispatch=function(t,e){this.dispatcher.dispatch({type:t,payload:e})},t}(),pc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(hc),dc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){if(!this.props.keyword)return t;var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.keyword)),this.props.body&&(e.body=this.props.body(t.body,this.props.keyword)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerFilter}}]),e}(ic),uc=new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var n=this.format(t,"error");if(e)throw Error(n);console.error(n)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e}(Kl);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(sc||(sc={}));var fc=function(){function t(){this.plugins=void 0,this.plugins=[]}var e=t.prototype;return e.get=function(t){var e=this.plugins.filter((function(e){return e.id===t}));return e.length>0?e[0]:null},e.add=function(t){return t.id?null!==this.get(t.id)?(uc.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(uc.error("Plugin ID cannot be empty"),this)},e.remove=function(t){return this.plugins.splice(this.plugins.indexOf(this.get(t)),1),this},e.list=function(t){return(null!=t||null!=t?this.plugins.filter((function(e){return e.position===t})):this.plugins).sort((function(t,e){return t.order-e.order}))},t}(),mc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?zl(Sl,{},zl(e.component,sl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?zl(Sl,{},this.config.plugin.list(this.props.position).map((function(e){return zl(e.component,sl({plugin:e},e.props,t.props.props))}))):null},e}(Kl),vc=function(t){function e(e,n){var i;(i=t.call(this,e,n)||this).searchProcessor=void 0,i.actions=void 0,i.store=void 0,i.storeUpdatedFn=void 0,i.actions=new pc(i.config.dispatcher),i.store=new cc(i.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&i.actions.search(o),i.storeUpdatedFn=i.storeUpdated.bind(hl(i)),i.store.on("updated",i.storeUpdatedFn),r=e.server?new dc({keyword:e.keyword,url:e.server.url,body:e.server.body}):new rc({keyword:e.keyword,columns:i.config.header&&i.config.header.columns,ignoreHiddenColumns:e.ignoreHiddenColumns||void 0===e.ignoreHiddenColumns,selector:e.selector}),i.searchProcessor=r,i.config.pipeline.register(r)),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.searchProcessor),this.store.off("updated",this.storeUpdatedFn)},n.storeUpdated=function(t){this.searchProcessor.setProps({keyword:t.keyword})},n.onChange=function(t){this.actions.search(t.target.value)},n.render=function(){if(!this.props.enabled)return null;var t,e,n,i=this.onChange.bind(this);return this.searchProcessor instanceof dc&&(t=i,e=this.props.debounceTimeout,i=function(){var i=arguments;return new Promise((function(r){n&&clearTimeout(n),n=setTimeout((function(){return r(t.apply(void 0,[].slice.call(i)))}),e)}))}),zl("div",{className:oc(ac("search",this.config.className.search))},zl("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:i,className:ac(oc("input"),oc("search","input")),value:this.store.state.keyword}))},e}(gc);vc.defaultProps={debounceTimeout:250};var bc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){if(isNaN(Number(this.props.limit))||isNaN(Number(this.props.page)))throw Error("Invalid parameters passed")},n._process=function(t){var e=this.props.page;return new ec(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},al(e,[{key:"type",get:function(){return Yl.Limit}}]),e}(ic),yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.page,this.props.limit)),this.props.body&&(e.body=this.props.body(t.body,this.props.page,this.props.limit)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerLimit}}]),e}(ic),_c=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).processor=void 0,i.onUpdateFn=void 0,i.setTotalFromTabularFn=void 0,i.state={limit:e.limit,page:e.page||0,total:0},i}ll(e,t);var n=e.prototype;return n.componentWillMount=function(){var t,e=this;this.props.enabled&&(this.setTotalFromTabularFn=this.setTotalFromTabular.bind(this),this.props.server?(t=new yc({limit:this.state.limit,page:this.state.page,url:this.props.server.url,body:this.props.server.body}),this.config.pipeline.on("afterProcess",this.setTotalFromTabularFn)):(t=new bc({limit:this.state.limit,page:this.state.page})).on("beforeProcess",this.setTotalFromTabularFn),this.processor=t,this.config.pipeline.register(t),this.config.pipeline.on("error",(function(){e.setState({total:0,page:0})})))},n.setTotalFromTabular=function(t){this.setTotal(t.length)},n.onUpdate=function(t){this.props.resetPageOnUpdate&&t!==this.processor&&this.setPage(0)},n.componentDidMount=function(){this.onUpdateFn=this.onUpdate.bind(this),this.config.pipeline.on("updated",this.onUpdateFn)},n.componentWillUnmount=function(){this.config.pipeline.unregister(this.processor),this.config.pipeline.off("updated",this.onUpdateFn)},n.setPage=function(t){if(t>=this.pages||t<0||t===this.state.page)return null;this.setState({page:t}),this.processor.setProps({page:t})},n.setTotal=function(t){this.setState({total:t})},n.renderPages=function(){var t=this;if(this.props.buttonsCount<=0)return null;var e=Math.min(this.pages,this.props.buttonsCount),n=Math.min(this.state.page,Math.floor(e/2));return this.state.page+Math.floor(e/2)>=this.pages&&(n=e-(this.pages-this.state.page)),zl(Sl,null,this.pages>e&&this.state.page-n>0&&zl(Sl,null,zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,0),title:this._("pagination.firstPage"),"aria-label":this._("pagination.firstPage"),className:this.config.className.paginationButton},this._("1")),zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-n)})).map((function(e){return zl("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:ac(t.state.page===e?ac(oc("currentPage"),t.config.className.paginationButtonCurrent):null,t.config.className.paginationButton),title:t._("pagination.page",e+1),"aria-label":t._("pagination.page",e+1)},t._(""+(e+1)))})),this.pages>e&&this.pages>this.state.page+n+1&&zl(Sl,null,zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"..."),zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,this.pages-1),title:this._("pagination.page",this.pages),"aria-label":this._("pagination.page",this.pages),className:this.config.className.paginationButton},this._(""+this.pages))))},n.renderSummary=function(){return zl(Sl,null,this.props.summary&&this.state.total>0&&zl("div",{role:"status","aria-live":"polite",className:ac(oc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",zl("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",zl("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",zl("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},n.render=function(){return this.props.enabled?zl("div",{className:ac(oc("pagination"),this.config.className.pagination)},this.renderSummary(),zl("div",{className:oc("pages")},this.props.prevButton&&zl("button",{tabIndex:0,role:"button",disabled:0===this.state.page,onClick:this.setPage.bind(this,this.state.page-1),title:this._("pagination.previous"),"aria-label":this._("pagination.previous"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&zl("button",{tabIndex:0,role:"button",disabled:this.pages===this.state.page+1||0===this.pages,onClick:this.setPage.bind(this,this.state.page+1),title:this._("pagination.next"),"aria-label":this._("pagination.next"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},al(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(gc);function wc(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function xc(t){return t?Math.floor(t)+"px":""}_c.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var kc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).tableElement=void 0,i.tableClassName=void 0,i.tableStyle=void 0,i.tableElement=i.props.tableRef.current.base.cloneNode(!0),i.tableElement.style.position="absolute",i.tableElement.style.width="100%",i.tableElement.style.zIndex="-2147483640",i.tableElement.style.visibility="hidden",i.tableClassName=i.tableElement.className,i.tableStyle=i.tableElement.style.cssText,i}ll(e,t);var n=e.prototype;return n.widths=function(){this.tableElement.className=this.tableClassName+" "+oc("shadowTable"),this.tableElement.style.tableLayout="auto",this.tableElement.style.width="auto",this.tableElement.style.padding="0",this.tableElement.style.margin="0",this.tableElement.style.border="none",this.tableElement.style.outline="none";var t=Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){var n;return e.style.width=e.clientWidth+"px",sl(((n={})[e.getAttribute("data-column-id")]={minWidth:e.clientWidth},n),t)}),{});return this.tableElement.className=this.tableClassName,this.tableElement.style.cssText=this.tableStyle,this.tableElement.style.tableLayout="auto",Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){return t[e.getAttribute("data-column-id")].width=e.clientWidth,t}),t)},n.render=function(){var t=this;return this.props.tableRef.current?zl("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Kl);function zc(t){if(!t)return"";var e=t.split(" ");return 1===e.length&&/([a-z][A-Z])+/g.test(t)?t:e.map((function(t,e){return 0==e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()})).join("")}var Ac=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}ll(e,t);var n=e.prototype;return n.adjustWidth=function(t){var n=t.container,i=t.tableRef,r=t.tempRef,o=t.tempRef||!0;if(!n)return this;var a=n.clientWidth,s={current:null},l={};if(i.current&&o){var c=zl(kc,{tableRef:i});c.ref=s,ql(c,r.current),l=s.current.widths()}for(var h,p=dl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=p()).done;){var d=h.value;d.columns&&d.columns.length>0||(!d.width&&o?d.id in l&&(d.width=xc(l[d.id].width),d.minWidth=xc(l[d.id].minWidth)):d.width=xc(wc(d.width,a)))}return i.current&&o&&ql(null,r.current),this},n.setSort=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;r.columns&&r.columns.length>0&&(r.sort={enabled:!1}),void 0===r.sort&&t.sort&&(r.sort={enabled:!0}),r.sort?"object"==typeof r.sort&&(r.sort=sl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},n.setFixedHeader=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.fixedHeader&&(r.fixedHeader=t.fixedHeader),r.columns&&this.setFixedHeader(t,r.columns)}},n.setResizable=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.resizable&&(r.resizable=t.resizable),r.columns&&this.setResizable(t,r.columns)}},n.setID=function(t){for(var e,n=dl(t||this.columns||[]);!(e=n()).done;){var i=e.value;i.id||"string"!=typeof i.name||(i.id=zc(i.name)),i.id||uc.error('Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.'),i.columns&&this.setID(i.columns)}},n.populatePlugins=function(t,e){for(var n,i=dl(e);!(n=i()).done;){var r=n.value;void 0!==r.plugin&&t.plugin.add(sl({id:r.id,props:{}},r.plugin,{position:sc.Cell}))}},e.fromColumns=function(t){for(var n,i=new e,r=dl(t);!(n=r()).done;){var o=n.value;if("string"==typeof o||gl(o))i.columns.push({name:o});else if("object"==typeof o){var a=o;a.columns&&(a.columns=e.fromColumns(a.columns).columns),"object"==typeof a.plugin&&void 0===a.data&&(a.data=null),i.columns.push(o)}}return i},e.fromUserConfig=function(t){var n=new e;return t.from?n.columns=e.fromHTMLTable(t.from).columns:t.columns?n.columns=e.fromColumns(t.columns).columns:!t.data||"object"!=typeof t.data[0]||t.data[0]instanceof Array||(n.columns=Object.keys(t.data[0]).map((function(t){return{name:t}}))),n.columns.length?(n.setID(),n.setSort(t),n.setFixedHeader(t),n.setResizable(t),n.populatePlugins(t,n.columns),n):null},e.fromHTMLTable=function(t){for(var n,i=new e,r=dl(t.querySelector("thead").querySelectorAll("th"));!(n=r()).done;){var o=n.value;i.columns.push({name:o.innerHTML,width:o.width})}return i},e.tabularFormat=function(t){var e=[],n=t||[],i=[];if(n&&n.length){e.push(n);for(var r,o=dl(n);!(r=o()).done;){var a=r.value;a.columns&&a.columns.length&&(i=i.concat(a.columns))}i.length&&(e=e.concat(this.tabularFormat(i)))}return e},e.leafColumns=function(t){var e=[],n=t||[];if(n&&n.length)for(var i,r=dl(n);!(i=r()).done;){var o=i.value;o.columns&&0!==o.columns.length||e.push(o),o.columns&&(e=e.concat(this.leafColumns(o.columns)))}return e},e.maximumDepth=function(t){return this.tabularFormat([t]).length-1},al(e,[{key:"columns",get:function(){return this._columns},set:function(t){this._columns=t}},{key:"visibleColumns",get:function(){return this._columns.filter((function(t){return!t.hidden}))}}]),e}(Wl),Sc=function(){function t(){this._callbacks=void 0,this._isDispatching=void 0,this._isHandled=void 0,this._isPending=void 0,this._lastID=void 0,this._pendingPayload=void 0,this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}var e=t.prototype;return e.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},e.unregister=function(t){if(!this._callbacks[t])throw Error("Dispatcher.unregister(...): "+t+" does not map to a registered callback.");delete this._callbacks[t]},e.waitFor=function(t){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];if(this._isPending[n]){if(!this._isHandled[n])throw Error("Dispatcher.waitFor(...): Circular dependency detected while ' +\n 'waiting for "+n+".")}else{if(!this._callbacks[n])throw Error("Dispatcher.waitFor(...): "+n+" does not map to a registered callback.");this._invokeCallback(n)}}},e.dispatch=function(t){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},e.isDispatching=function(){return this._isDispatching},e._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},e._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},e._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}(),Cc=function(){},Ec=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.set(e),n}ll(e,t);var n=e.prototype;return n.get=function(){try{return Promise.resolve(this.data()).then((function(t){return{data:t,total:t.length}}))}catch(t){return Promise.reject(t)}},n.set=function(t){return t instanceof Array?this.data=function(){return t}:t instanceof Function&&(this.data=t),this},e}(Cc),Mc=function(t){function e(e){var n;return(n=t.call(this)||this).options=void 0,n.options=e,n}ll(e,t);var n=e.prototype;return n.handler=function(t){return"function"==typeof this.options.handle?this.options.handle(t):t.ok?t.json():(uc.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},n.get=function(t){var e=sl({},this.options,t);return"function"==typeof e.data?e.data(e):fetch(e.url,e).then(this.handler.bind(this)).then((function(t){return{data:e.then(t),total:"function"==typeof e.total?e.total(t):void 0}}))},e}(Cc),Lc=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new Ec(t.data)),t.from&&(e=new Ec(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new Mc(t.server)),e||uc.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,n,i=[],r=dl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,a=[],s=dl(e.value.querySelectorAll("td"));!(o=s()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?a.push((n=l.innerHTML,(new DOMParser).parseFromString(n,"text/html").documentElement.textContent)):a.push(Ql(l.innerHTML))}i.push(a)}return i},t}(),Hc="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Tc(t,e,n){if(!t.s){if(n instanceof Vc){if(!n.s)return void(n.o=Tc.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(Tc.bind(null,t,e),Tc.bind(null,t,2));t.s=e,t.v=n;var i=t.o;i&&i(t)}}var Vc=function(){function t(){}return t.prototype.then=function(e,n){var i=new t,r=this.s;if(r){var o=1&r?e:n;if(o){try{Tc(i,1,o(this.v))}catch(t){Tc(i,2,t)}return i}return this}return this.o=function(t){try{var r=t.v;1&t.s?Tc(i,1,e?e(r):r):n?Tc(i,1,n(r)):Tc(i,2,r)}catch(t){Tc(i,2,t)}},i},t}();function $c(t){return t instanceof Vc&&1&t.s}var Oc,Pc=function(t){function e(e){var n;return(n=t.call(this)||this)._steps=new Map,n.cache=new Map,n.lastProcessorIndexUpdated=-1,e&&e.forEach((function(t){return n.register(t)})),n}ll(e,t);var n=e.prototype;return n.clearCache=function(){this.cache=new Map,this.lastProcessorIndexUpdated=-1},n.register=function(t,e){if(void 0===e&&(e=null),null===t.type)throw Error("Processor type is not defined");t.on("propsUpdated",this.processorPropsUpdated.bind(this)),this.addProcessorByPriority(t,e),this.afterRegistered(t)},n.unregister=function(t){if(t){var e=this._steps.get(t.type);e&&e.length&&(this._steps.set(t.type,e.filter((function(e){return e!=t}))),this.emit("updated",t))}},n.addProcessorByPriority=function(t,e){var n=this._steps.get(t.type);if(!n){var i=[];this._steps.set(t.type,i),n=i}if(null===e||e<0)n.push(t);else if(n[e]){var r=n.slice(0,e-1),o=n.slice(e+1);this._steps.set(t.type,r.concat(t).concat(o))}else n[e]=t},n.getStepsByType=function(t){return this.steps.filter((function(e){return e.type===t}))},n.getSortedProcessorTypes=function(){return Object.keys(Yl).filter((function(t){return!isNaN(Number(t))})).map((function(t){return Number(t)}))},n.process=function(t){try{var e=this,n=function(t){return e.lastProcessorIndexUpdated=r.length,e.emit("afterProcess",o),o},i=e.lastProcessorIndexUpdated,r=e.steps,o=t,a=function(t,n){try{var a=function(t,e,n){if("function"==typeof t[Hc]){var i,r,o,a=t[Hc]();if(function t(n){try{for(;!(i=a.next()).done;)if((n=e(i.value))&&n.then){if(!$c(n))return void n.then(t,o||(o=Tc.bind(null,r=new Vc,2)));n=n.v}r?Tc(r,1,n):r=n}catch(t){Tc(r||(r=new Vc),2,t)}}(),a.return){var s=function(t){try{i.done||a.return()}catch(t){}return t};if(r&&r.then)return r.then(s,(function(t){throw s(t)}));s()}return r}if(!("length"in t))throw new TypeError("Object is not iterable");for(var l=[],c=0;c<t.length;c++)l.push(t[c]);return function(t,e,n){var i,r,o=-1;return function n(a){try{for(;++o<t.length;)if((a=e(o))&&a.then){if(!$c(a))return void a.then(n,r||(r=Tc.bind(null,i=new Vc,2)));a=a.v}i?Tc(i,1,a):i=a}catch(t){Tc(i||(i=new Vc),2,t)}}(),i}(l,(function(t){return e(l[t])}))}(r,(function(t){var n=e.findProcessorIndexByID(t.id),r=function(){if(n>=i)return Promise.resolve(t.process(o)).then((function(n){e.cache.set(t.id,o=n)}));o=e.cache.get(t.id)}();if(r&&r.then)return r.then((function(){}))}))}catch(t){return n(t)}return a&&a.then?a.then(void 0,n):a}(0,(function(t){throw uc.error(t),e.emit("error",o),t}));return Promise.resolve(a&&a.then?a.then(n):n())}catch(t){return Promise.reject(t)}},n.findProcessorIndexByID=function(t){return this.steps.findIndex((function(e){return e.id==t}))},n.setLastProcessorIndex=function(t){var e=this.findProcessorIndexByID(t.id);this.lastProcessorIndexUpdated>e&&(this.lastProcessorIndexUpdated=e)},n.processorPropsUpdated=function(t){this.setLastProcessorIndex(t),this.emit("propsUpdated"),this.emit("updated",t)},n.afterRegistered=function(t){this.setLastProcessorIndex(t),this.emit("afterRegister"),this.emit("updated",t)},al(e,[{key:"steps",get:function(){for(var t,e=[],n=dl(this.getSortedProcessorTypes());!(t=n()).done;){var i=this._steps.get(t.value);i&&i.length&&(e=e.concat(i))}return e.filter((function(t){return t}))}}]),e}(nc),Rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},al(e,[{key:"type",get:function(){return Yl.Extractor}}]),e}(ic),Ic=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e=ec.fromArray(t.data);return e.length=t.total,e},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Nc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(){return Object.entries(this.props.serverStorageOptions).filter((function(t){return"function"!=typeof t[1]})).reduce((function(t,e){var n;return sl({},t,((n={})[e[0]]=e[1],n))}),{})},al(e,[{key:"type",get:function(){return Yl.Initiator}}]),e}(ic),Fc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.castData=function(t){if(!t||!t.length)return[];if(!this.props.header||!this.props.header.columns)return t;var e=Ac.leafColumns(this.props.header.columns);return t[0]instanceof Array?t.map((function(t){var n=0;return e.map((function(e,i){return void 0!==e.data?(n++,"function"==typeof e.data?e.data(t):e.data):t[i-n]}))})):"object"!=typeof t[0]||t[0]instanceof Array?[]:t.map((function(t){return e.map((function(e,n){return void 0!==e.data?"function"==typeof e.data?e.data(t):e.data:e.id?t[e.id]:(uc.error("Could not find the correct cell for column at position "+n+".\n Make sure either 'id' or 'selector' is defined for all columns."),null)}))}))},n._process=function(t){return{data:this.castData(t.data),total:t.total}},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Bc=function(){function t(){}return t.createFromConfig=function(t){var e=new Pc;return t.storage instanceof Mc&&e.register(new Nc({serverStorageOptions:t.server})),e.register(new Rc({storage:t.storage})),e.register(new Fc({header:t.header})),e.register(new Ic),e},t}(),Dc=function(){function t(e){this._userConfig=void 0,Object.assign(this,sl({},t.defaultConfig(),e)),this._userConfig={}}var e=t.prototype;return e.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var i=n[e];"_userConfig"!==i&&(this[i]=t[i])}return this},e.update=function(e){return e?(this._userConfig=sl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new fc,dispatcher:new Sc,tableRef:{current:null},tempRef:{current:null},width:"100%",height:"auto",autoWidth:!0,style:{},className:{}}},t.fromUserConfig=function(e){var n=new t(e);return n._userConfig=e,"boolean"==typeof e.sort&&e.sort&&n.assign({sort:{multiColumn:!0}}),n.assign({header:Ac.fromUserConfig(n)}),n.assign({storage:Lc.createFromUserConfig(e)}),n.assign({pipeline:Bc.createFromConfig(n)}),n.assign({translator:new Xl(e.language)}),n.plugin.add({id:"search",position:sc.Header,component:vc,props:sl({enabled:!0===e.search||e.search instanceof Object},e.search)}),n.plugin.add({id:"pagination",position:sc.Footer,component:_c,props:sl({enabled:!0===e.pagination||e.pagination instanceof Object},e.pagination)}),e.plugins&&e.plugins.forEach((function(t){return n.plugin.add(t)})),n},t}();!function(t){t[t.Init=0]="Init",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Rendered=3]="Rendered",t[t.Error=4]="Error"}(Oc||(Oc={}));var jc,qc,Uc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.content=function(){return this.props.column&&"function"==typeof this.props.column.formatter?this.props.column.formatter(this.props.cell.data,this.props.row,this.props.column):this.props.column&&this.props.column.plugin?zl(mc,{pluginId:this.props.column.id,props:{column:this.props.column,cell:this.props.cell,row:this.props.row}}):this.props.cell.data},n.handleClick=function(t){this.props.messageCell||this.config.eventEmitter.emit("cellClick",t,this.props.cell,this.props.column,this.props.row)},n.getCustomAttributes=function(t){return t?"function"==typeof t.attributes?t.attributes(this.props.cell.data,this.props.row,this.props.column):t.attributes:{}},n.render=function(){return zl("td",sl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("td"),this.props.className,this.config.className.td),style:sl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Kl),Wc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getColumn=function(t){if(this.props.header){var e=Ac.leafColumns(this.props.header.columns);if(e)return e[t]}return null},n.handleClick=function(t){this.props.messageRow||this.config.eventEmitter.emit("rowClick",t,this.props.row)},n.getChildren=function(){var t=this;return this.props.children?this.props.children:zl(Sl,null,this.props.row.cells.map((function(e,n){var i=t.getColumn(n);return i&&i.hidden?null:zl(Uc,{key:e.id,cell:e,row:t.props.row,column:i})})))},n.render=function(){return zl("tr",{className:ac(oc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Kl),Gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(Wc,{messageRow:!0},zl(Uc,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Jl(this.props.message),className:ac(oc("message"),this.props.className?this.props.className:null)}))},e}(Kl),Xc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.headerLength=function(){return this.props.header?this.props.header.visibleColumns.length:0},n.render=function(){var t=this;return zl("tbody",{className:ac(oc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return zl(Wc,{key:e.id,row:e,header:t.props.header})})),this.props.status===Oc.Loading&&(!this.props.data||0===this.props.data.length)&&zl(Gc,{message:this._("loading"),colSpan:this.headerLength(),className:ac(oc("loading"),this.config.className.loading)}),this.props.status===Oc.Rendered&&this.props.data&&0===this.props.data.length&&zl(Gc,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:ac(oc("notfound"),this.config.className.notfound)}),this.props.status===Oc.Error&&zl(Gc,{message:this._("error"),colSpan:this.headerLength(),className:ac(oc("error"),this.config.className.error)}))},e}(Kl),Kc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){for(var t,e=dl(this.props.columns);!(t=e()).done;){var n=t.value;void 0===n.direction&&(n.direction=1),1!==n.direction&&-1!==n.direction&&uc.error("Invalid sort direction "+n.direction)}},n.compare=function(t,e){return t>e?1:t<e?-1:0},n.compareWrapper=function(t,e){for(var n,i=0,r=dl(this.props.columns);!(n=r()).done;){var o=n.value;if(0!==i)break;var a=t.cells[o.index].data,s=e.cells[o.index].data;i|="function"==typeof o.compare?o.compare(a,s)*o.direction:this.compare(a,s)*o.direction}return i},n._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var n=new ec(e);return n.length=t.length,n},al(e,[{key:"type",get:function(){return Yl.Sort}}]),e}(ic),Zc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return[]},n.handle=function(t,e){"SORT_COLUMN"===t?this.sortColumn(e.index,e.direction,e.multi,e.compare):"SORT_COLUMN_TOGGLE"===t&&this.sortToggle(e.index,e.multi,e.compare)},n.sortToggle=function(t,e,n){var i=[].concat(this.state).find((function(e){return e.index===t}));this.sortColumn(t,i&&1===i.direction?-1:1,e,n)},n.sortColumn=function(t,e,n,i){var r=[].concat(this.state),o=r.length,a=r.find((function(e){return e.index===t})),s=!1,l=!1,c=!1,h=!1;if(void 0!==a?n?-1===a.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,s=!0):0===o?s=!0:o>0&&!n?(s=!0,l=!0):o>0&&n&&(s=!0),l&&(r=[]),s)r.push({index:t,direction:e,compare:i});else if(h){var p=r.indexOf(a);r[p].direction=e}else if(c){var d=r.indexOf(a);r.splice(d,1)}this.setState(r)},e}(lc),Qc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.sortColumn=function(t,e,n,i){this.dispatch("SORT_COLUMN",{index:t,direction:e,multi:n,compare:i})},n.sortToggle=function(t,e,n){this.dispatch("SORT_COLUMN_TOGGLE",{index:t,multi:e,compare:n})},e}(hc),Yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.columns)),this.props.body&&(e.body=this.props.body(t.body,this.props.columns)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerSort}}]),e}(ic),Jc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortProcessor=void 0,i.actions=void 0,i.store=void 0,i.updateStateFn=void 0,i.updateSortProcessorFn=void 0,i.actions=new Qc(i.config.dispatcher),i.store=new Zc(i.config.dispatcher),e.enabled&&(i.sortProcessor=i.getOrCreateSortProcessor(),i.updateStateFn=i.updateState.bind(hl(i)),i.store.on("updated",i.updateStateFn),i.state={direction:0}),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.sortProcessor),this.store.off("updated",this.updateStateFn),this.updateSortProcessorFn&&this.store.off("updated",this.updateSortProcessorFn)},n.updateState=function(){var t=this,e=this.store.state.find((function(e){return e.index===t.props.index}));this.setState(e?{direction:e.direction}:{direction:0})},n.updateSortProcessor=function(t){this.sortProcessor.setProps({columns:t})},n.getOrCreateSortProcessor=function(){var t=Yl.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Yl.ServerSort);var e,n=this.config.pipeline.getStepsByType(t);return n.length>0?e=n[0]:(this.updateSortProcessorFn=this.updateSortProcessor.bind(this),this.store.on("updated",this.updateSortProcessorFn),e=t===Yl.ServerSort?new Yc(sl({columns:this.store.state},this.config.sort.server)):new Kc({columns:this.store.state}),this.config.pipeline.register(e)),e},n.changeDirection=function(t){t.preventDefault(),t.stopPropagation(),this.actions.sortToggle(this.props.index,!0===t.shiftKey&&this.config.sort.multiColumn,this.props.compare)},n.render=function(){if(!this.props.enabled)return null;var t=this.state.direction,e="neutral";return 1===t?e="asc":-1===t&&(e="desc"),zl("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:ac(oc("sort"),oc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Kl),th=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).moveFn=void 0,e.upFn=void 0,e}ll(e,t);var n=e.prototype;return n.getPageX=function(t){return t instanceof MouseEvent?Math.floor(t.pageX):Math.floor(t.changedTouches[0].pageX)},n.start=function(t){var e,n,i,r,o;t.stopPropagation(),this.setState({offsetStart:parseInt(this.props.thRef.current.style.width,10)-this.getPageX(t)}),this.upFn=this.end.bind(this),this.moveFn=(e=this.move.bind(this),void 0===(n=10)&&(n=100),function(){var t=[].slice.call(arguments);i?(clearTimeout(r),r=setTimeout((function(){Date.now()-o>=n&&(e.apply(void 0,t),o=Date.now())}),Math.max(n-(Date.now()-o),0))):(e.apply(void 0,t),o=Date.now(),i=!0)}),document.addEventListener("mouseup",this.upFn),document.addEventListener("touchend",this.upFn),document.addEventListener("mousemove",this.moveFn),document.addEventListener("touchmove",this.moveFn)},n.move=function(t){t.stopPropagation();var e=this.props.thRef.current;this.state.offsetStart+this.getPageX(t)>=parseInt(e.style.minWidth,10)&&(e.style.width=this.state.offsetStart+this.getPageX(t)+"px")},n.end=function(t){t.stopPropagation(),document.removeEventListener("mouseup",this.upFn),document.removeEventListener("mousemove",this.moveFn),document.removeEventListener("touchmove",this.moveFn),document.removeEventListener("touchend",this.upFn)},n.render=function(){return zl("div",{className:ac(oc("th"),oc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Kl),eh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortRef={current:null},i.thRef={current:null},i.state={style:{}},i}ll(e,t);var n=e.prototype;return n.isSortable=function(){return this.props.column.sort.enabled},n.isResizable=function(){return this.props.column.resizable},n.onClick=function(t){t.stopPropagation(),this.isSortable()&&this.sortRef.current.changeDirection(t)},n.keyDown=function(t){this.isSortable()&&13===t.which&&this.onClick(t)},n.componentDidMount=function(){var t=this;setTimeout((function(){if(t.props.column.fixedHeader&&t.thRef.current){var e=t.thRef.current.offsetTop;"number"==typeof e&&t.setState({style:{top:e}})}}),0)},n.content=function(){return void 0!==this.props.column.name?this.props.column.name:void 0!==this.props.column.plugin?zl(mc,{pluginId:this.props.column.plugin.id,props:{column:this.props.column}}):null},n.getCustomAttributes=function(){var t=this.props.column;return t?"function"==typeof t.attributes?t.attributes(null,null,this.props.column):t.attributes:{}},n.render=function(){var t={};return this.isSortable()&&(t.tabIndex=0),zl("th",sl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("th"),this.isSortable()?oc("th","sort"):null,this.props.column.fixedHeader?oc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:sl({},this.config.style.th,{minWidth:this.props.column.minWidth,width:this.props.column.width},this.state.style,this.props.style),onKeyDown:this.keyDown.bind(this),rowSpan:this.props.rowSpan>1?this.props.rowSpan:void 0,colSpan:this.props.colSpan>1?this.props.colSpan:void 0},this.getCustomAttributes(),t),zl("div",{className:oc("th","content")},this.content()),this.isSortable()&&zl(Jc,sl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&zl(th,{column:this.props.column,thRef:this.thRef}))},e}(Kl),nh=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.renderColumn=function(t,e,n,i){var r=function(t,e,n){var i=Ac.maximumDepth(t),r=n-e;return{rowSpan:Math.floor(r-i-i/r),colSpan:t.columns&&t.columns.length||1}}(t,e,i);return zl(eh,{column:t,index:n,colSpan:r.colSpan,rowSpan:r.rowSpan})},n.renderRow=function(t,e,n){var i=this,r=Ac.leafColumns(this.props.header.columns);return zl(Wc,null,t.map((function(t){return t.hidden?null:i.renderColumn(t,e,r.indexOf(t),n)})))},n.renderRows=function(){var t=this,e=Ac.tabularFormat(this.props.header.columns);return e.map((function(n,i){return t.renderRow(n,i,e.length)}))},n.render=function(){return this.props.header?zl("thead",{key:this.props.header.id,className:ac(oc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Kl),ih=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl("table",{role:"grid",className:ac(oc("table"),this.config.className.table),style:sl({},this.config.style.table,{height:this.props.height})},zl(nh,{header:this.props.header}),zl(Xc,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Kl),rh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).headerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.headerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.headerRef,className:ac(oc("head"),this.config.className.header),style:sl({},this.config.style.header)},zl(mc,{position:sc.Header})):null},e}(Kl),oh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).footerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.footerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.footerRef,className:ac(oc("footer"),this.config.className.footer),style:sl({},this.config.style.footer)},zl(mc,{position:sc.Footer})):null},e}(Kl),ah=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).configContext=void 0,i.processPipelineFn=void 0,i.configContext=function(t,e){var n={__c:e="__cC"+bl++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(Ll)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}(),i.state={status:Oc.Loading,header:e.header,data:null},i}ll(e,t);var n=e.prototype;return n.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Oc.Loading});var e=function(e,n){try{var i=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Oc.Loaded}),t.props.config.eventEmitter.emit("load",e)}))}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}(0,(function(e){uc.error(e),t.setState({status:Oc.Error,data:null})}));return Promise.resolve(e&&e.then?e.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},n.componentDidMount=function(){try{var t=this,e=t.props.config;return Promise.resolve(t.processPipeline()).then((function(){e.header&&t.state.data&&t.state.data.length&&t.setState({header:e.header.adjustWidth(e)}),t.processPipelineFn=t.processPipeline.bind(t),t.props.pipeline.on("updated",t.processPipelineFn)}))}catch(t){return Promise.reject(t)}},n.componentWillUnmount=function(){this.props.pipeline.off("updated",this.processPipelineFn)},n.componentDidUpdate=function(t,e){e.status!=Oc.Rendered&&this.state.status==Oc.Loaded&&(this.setState({status:Oc.Rendered}),this.props.config.eventEmitter.emit("ready"))},n.render=function(){return zl(this.configContext.Provider,{value:this.props.config},zl("div",{role:"complementary",className:ac("gridjs",oc("container"),this.state.status===Oc.Loading?oc("loading"):null,this.props.config.className.container),style:sl({},this.props.config.style.container,{width:this.props.width})},this.state.status===Oc.Loading&&zl("div",{className:oc("loading-bar")}),zl(rh,null),zl("div",{className:oc("wrapper"),style:{height:this.props.height}},zl(ih,{ref:this.props.config.tableRef,data:this.state.data,header:this.state.header,width:this.props.width,height:this.props.height,status:this.state.status})),zl(oh,null),zl("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:oc("temp")})))},e}(Kl),sh=function(t){function e(e){var n;return(n=t.call(this)||this).config=void 0,n.plugin=void 0,n.config=new Dc({instance:hl(n),eventEmitter:hl(n)}).update(e),n.plugin=n.config.plugin,n}ll(e,t);var n=e.prototype;return n.updateConfig=function(t){return this.config.update(t),this},n.createElement=function(){return zl(ah,{config:this.config,pipeline:this.config.pipeline,header:this.config.header,width:this.config.width,height:this.config.height})},n.forceRender=function(){return this.config&&this.config.container||uc.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),ql(null,this.config.container),ql(this.createElement(),this.config.container),this},n.render=function(t){return t||uc.error("Container element cannot be null",!0),t.childNodes.length>0?(uc.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,ql(this.createElement(),t),this)},e}(nc),lh=[],ch=ul.__b,hh=ul.__r,ph=ul.diffed,dh=ul.__c,uh=ul.unmount;function gh(){lh.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(mh),t.__H.__h.forEach(vh),t.__H.__h=[]}catch(e){t.__H.__h=[],ul.__e(e,t.__v)}})),lh=[]}ul.__b=function(t){jc=null,ch&&ch(t)},ul.__r=function(t){hh&&hh(t),0;var e=(jc=t.__c).__H;e&&(e.__h.forEach(mh),e.__h.forEach(vh),e.__h=[])},ul.diffed=function(t){ph&&ph(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==lh.push(e)&&qc===ul.requestAnimationFrame||((qc=ul.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),fh&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);fh&&(e=requestAnimationFrame(n))})(gh)),jc=void 0},ul.__c=function(t,e){e.some((function(t){try{t.__h.forEach(mh),t.__h=t.__h.filter((function(t){return!t.__||vh(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ul.__e(n,t.__v)}})),dh&&dh(t,e)},ul.unmount=function(t){uh&&uh(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(mh)}catch(t){ul.__e(t,e.__v)}};var fh="function"==typeof requestAnimationFrame;function mh(t){var e=jc;"function"==typeof t.__c&&t.__c(),jc=e}function vh(t){var e=jc;t.__c=t.__(),jc=e}class bh extends V{static get properties(){return Object.assign({label:{type:String},property:{type:String},sort:{type:Boolean},width:{type:String}},super.properties)}constructor(){super(),this.label="no-label",this.property=null,this.sort=!1,this.width=null}connectedCallback(){super.connectedCallback()}data(){const t={name:this.label,sort:{enabled:this.sort},formatter:t=>Ql(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",bh);class yh extends(R(V)){static get properties(){return Object.assign({source:{type:String},cssPath:{type:String,attribute:"css-path"},resizable:{type:Boolean},perPage:{type:Number,attribute:"per-page"},height:{type:String},search:{type:Boolean},_params:{type:Object}},super.properties)}constructor(){super(),this.cssPath="../css/gridjs",this._params={},this.resizable=!1,this.search=!1,this.perPage=10,this.height=null,this.fixedHeader=!1}connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),window.addEventListener("popstate",t=>{this._params=t.state,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),n=[];e.forEach(t=>n.push(t.data())),yh.waitOnce("pb-page-ready",()=>{this._params=this.getParameters();const e=this.toAbsoluteURL(this.source),i={height:this.height,fixedHeader:!0,columns:n,resizable:this.resizable,server:{url:e,then:t=>t.results,total:t=>t.count},sort:{multiColumn:!1,enabled:!0,server:{url:(t,e)=>{if(!e.length)return t;const i=e[0];return`${t}${t.indexOf("?")>-1?"&":"?"}order=${n[i.index].id}&dir=${1===i.direction?"asc":"desc"}`}}},pagination:{enabled:!0,limit:this.perPage,server:{url:(t,e,n)=>{const i=this.shadowRoot.getElementById("form");return i&&Object.assign(this._params,i.serializeForm()),this._params.limit=n,this._params.start=e*n+1,this.setParameters(this._params),this.pushHistory("grid",this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new sh(i),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){const t=O(this.cssPath);return $`
|
|
4225
4225
|
<link href="${t}/mermaid.min.css" rel="stylesheet">
|
|
4226
4226
|
${this.search?$`
|
|
4227
4227
|
<iron-form id="form">
|
|
@@ -4251,7 +4251,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4251
4251
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4252
4252
|
found at http://polymer.github.io/PATENTS.txt
|
|
4253
4253
|
*/
|
|
4254
|
-
const _h=
|
|
4254
|
+
const _h=n`<iron-iconset-svg name="editor" size="24">
|
|
4255
4255
|
<svg><defs>
|
|
4256
4256
|
<g id="attach-file"><path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"></path></g>
|
|
4257
4257
|
<g id="attach-money"><path d="M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"></path></g>
|
|
@@ -4333,7 +4333,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4333
4333
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4334
4334
|
found at http://polymer.github.io/PATENTS.txt
|
|
4335
4335
|
*/
|
|
4336
|
-
const wh=
|
|
4336
|
+
const wh=n`<iron-iconset-svg name="social" size="24">
|
|
4337
4337
|
<svg><defs>
|
|
4338
4338
|
<g id="cake"><path d="M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9z"></path></g>
|
|
4339
4339
|
<g id="domain"><path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"></path></g>
|
|
@@ -4377,7 +4377,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4377
4377
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4378
4378
|
found at http://polymer.github.io/PATENTS.txt
|
|
4379
4379
|
*/
|
|
4380
|
-
const xh=
|
|
4380
|
+
const xh=n`<iron-iconset-svg name="maps" size="24">
|
|
4381
4381
|
<svg><defs>
|
|
4382
4382
|
<g id="add-location"><path d="M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7zm4 8h-3v3h-2v-3H8V8h3V5h2v3h3v2z"></path></g>
|
|
4383
4383
|
<g id="beenhere"><path d="M19 1H5c-1.1 0-1.99.9-1.99 2L3 15.93c0 .69.35 1.3.88 1.66L12 23l8.11-5.41c.53-.36.88-.97.88-1.66L21 3c0-1.1-.9-2-2-2zm-9 15l-5-5 1.41-1.41L10 13.17l7.59-7.59L19 7l-9 9z"></path></g>
|
|
@@ -4459,7 +4459,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4459
4459
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4460
4460
|
found at http://polymer.github.io/PATENTS.txt
|
|
4461
4461
|
*/
|
|
4462
|
-
const kh=
|
|
4462
|
+
const kh=n`<iron-iconset-svg name="image" size="24">
|
|
4463
4463
|
<svg><defs>
|
|
4464
4464
|
<g id="add-a-photo"><path d="M3 4V1h2v3h3v2H5v3H3V6H0V4h3zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10h3zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2z"></path></g>
|
|
4465
4465
|
<g id="add-to-photos"><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"></path></g>
|
|
@@ -4628,7 +4628,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4628
4628
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4629
4629
|
found at http://polymer.github.io/PATENTS.txt
|
|
4630
4630
|
*/
|
|
4631
|
-
e({_template:
|
|
4631
|
+
e({_template:n`
|
|
4632
4632
|
<style>
|
|
4633
4633
|
:host {
|
|
4634
4634
|
display: inline-block;
|
|
@@ -4693,7 +4693,7 @@ e({_template:i`
|
|
|
4693
4693
|
<div class="textarea-container fit">
|
|
4694
4694
|
<textarea id="textarea" name$="[[name]]" aria-label$="[[label]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" autocapitalize$="[[autocapitalize]]" inputmode$="[[inputmode]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" disabled$="[[disabled]]" rows$="[[rows]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]"></textarea>
|
|
4695
4695
|
</div>
|
|
4696
|
-
`,is:"iron-autogrow-textarea",behaviors:[A,s],properties:{value:{observer:"_valueChanged",type:String,notify:!0},bindValue:{observer:"_bindValueChanged",type:String,notify:!0},rows:{type:Number,value:1,observer:"_updateCached"},maxRows:{type:Number,value:0,observer:"_updateCached"},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,value:!1},autocapitalize:{type:String,value:"none"},inputmode:{type:String},placeholder:{type:String},readonly:{type:String},required:{type:Boolean},minlength:{type:Number},maxlength:{type:Number},label:{type:String}},listeners:{input:"_onInput"},get textarea(){return this.$.textarea},get selectionStart(){return this.$.textarea.selectionStart},get selectionEnd(){return this.$.textarea.selectionEnd},set selectionStart(t){this.$.textarea.selectionStart=t},set selectionEnd(t){this.$.textarea.selectionEnd=t},attached:function(){navigator.userAgent.match(/iP(?:[oa]d|hone)/)&&!navigator.userAgent.match(/OS 1[3456789]/)&&(this.$.textarea.style.marginLeft="-3px")},validate:function(){var t=this.$.textarea.validity.valid;return t&&(this.required&&""===this.value?t=!1:this.hasValidator()&&(t=A.validate.call(this,this.value))),this.invalid=!t,this.fire("iron-input-validate"),t},_bindValueChanged:function(t){this.value=t},_valueChanged:function(t){var e=this.textarea;e&&(e.value!==t&&(e.value=t||0===t?t:""),this.bindValue=t,this.$.mirror.innerHTML=this._valueForMirror(),this.fire("bind-value-changed",{value:this.bindValue}))},_onInput:function(e){var
|
|
4696
|
+
`,is:"iron-autogrow-textarea",behaviors:[A,s],properties:{value:{observer:"_valueChanged",type:String,notify:!0},bindValue:{observer:"_bindValueChanged",type:String,notify:!0},rows:{type:Number,value:1,observer:"_updateCached"},maxRows:{type:Number,value:0,observer:"_updateCached"},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,value:!1},autocapitalize:{type:String,value:"none"},inputmode:{type:String},placeholder:{type:String},readonly:{type:String},required:{type:Boolean},minlength:{type:Number},maxlength:{type:Number},label:{type:String}},listeners:{input:"_onInput"},get textarea(){return this.$.textarea},get selectionStart(){return this.$.textarea.selectionStart},get selectionEnd(){return this.$.textarea.selectionEnd},set selectionStart(t){this.$.textarea.selectionStart=t},set selectionEnd(t){this.$.textarea.selectionEnd=t},attached:function(){navigator.userAgent.match(/iP(?:[oa]d|hone)/)&&!navigator.userAgent.match(/OS 1[3456789]/)&&(this.$.textarea.style.marginLeft="-3px")},validate:function(){var t=this.$.textarea.validity.valid;return t&&(this.required&&""===this.value?t=!1:this.hasValidator()&&(t=A.validate.call(this,this.value))),this.invalid=!t,this.fire("iron-input-validate"),t},_bindValueChanged:function(t){this.value=t},_valueChanged:function(t){var e=this.textarea;e&&(e.value!==t&&(e.value=t||0===t?t:""),this.bindValue=t,this.$.mirror.innerHTML=this._valueForMirror(),this.fire("bind-value-changed",{value:this.bindValue}))},_onInput:function(e){var n=t(e).path;this.value=n?n[0].value:e.target.value},_constrain:function(t){var e;for(t=t||[""],e=this.maxRows>0&&t.length>this.maxRows?t.slice(0,this.maxRows):t.slice(0);this.rows>0&&e.length<this.rows;)e.push("");return e.join("<br/>")+" "},_valueForMirror:function(){var t=this.textarea;if(t)return this.tokens=t&&t.value?t.value.replace(/&/gm,"&").replace(/"/gm,""").replace(/'/gm,"'").replace(/</gm,"<").replace(/>/gm,">").split("\n"):[""],this._constrain(this.tokens)},_updateCached:function(){this.$.mirror.innerHTML=this._constrain(this.tokens)}}),
|
|
4697
4697
|
/**
|
|
4698
4698
|
@license
|
|
4699
4699
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -4704,7 +4704,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
4704
4704
|
part of the polymer project is also subject to an additional IP rights grant
|
|
4705
4705
|
found at http://polymer.github.io/PATENTS.txt
|
|
4706
4706
|
*/
|
|
4707
|
-
e({_template:
|
|
4707
|
+
e({_template:n`
|
|
4708
4708
|
<style>
|
|
4709
4709
|
:host {
|
|
4710
4710
|
display: block;
|