@teipublisher/pb-components 2.17.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -507,7 +507,7 @@ const et=n`
507
507
  border-color: #999;
508
508
  color: #999;
509
509
  }
510
- `}}customElements.define("pb-demo-snippet",at);class lt{static subscribe(t,e,i,n=!1){const r=lt._getChannels(e),o=document.addEventListener(t,t=>{i&&t.detail&&t.detail.key&&r.includes(t.detail.key)&&i(t,o)},{once:n})}static subscribeOnce(t,e=null){const i=lt._getChannels(e);return new Promise(e=>{document.addEventListener(t,t=>{t.detail&&t.detail.key&&i.includes(t.detail.key)&&e(t)},{once:!0})})}static _getChannels(t){return null!==t&&t.length?Array.isArray(t)?t:[t]:[N]}static emit(t,e=null,i=null){const n=i||{};n.key=e||N;const r=new CustomEvent(t,{detail:n});document.dispatchEvent(r)}static ifReady(t){return Array.isArray(t)||(t=[t]),new Promise(e=>{const i=t.length;if(0===i)return void e();let n=i;t.forEach(t=>{if(t._isReady)return n-=1,void(0===n&&e());const i=t.addEventListener("pb-ready",()=>{n-=1,0===n&&(t.removeEventListener("pb-ready",i),e())})})})}}window.pbEvents||(window.pbEvents=lt);const ct="2.17.0";class ht extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=ct}connectedCallback(){if(super.connectedCallback(),!this.version){const t=P("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return I`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",ht);var dt="top",pt="bottom",ut="right",gt="left",ft="auto",mt=[dt,pt,ut,gt],vt="start",bt="end",yt="clippingParents",_t="viewport",wt="popper",xt="reference",kt=mt.reduce((function(t,e){return t.concat([e+"-"+vt,e+"-"+bt])}),[]),At=[].concat(mt,[ft]).reduce((function(t,e){return t.concat([e,e+"-"+vt,e+"-"+bt])}),[]),St=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Et(t){return t instanceof Ct(t).Element||t instanceof Element}function Tt(t){return t instanceof Ct(t).HTMLElement||t instanceof HTMLElement}function Lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Ct(t).ShadowRoot||t instanceof ShadowRoot)}function Mt(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];Tt(r)&&zt(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 Ot(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}),{});Tt(n)&&zt(n)&&(Object.assign(n.style,o),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}}var $t={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Ot,requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var It=Math.max,Rt=Math.min,Pt=Math.round;function Vt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Nt(){return!/^((?!chrome|android).)*safari/i.test(Vt())}function Dt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&Tt(t)&&(r=t.offsetWidth>0&&Pt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pt(n.height)/t.offsetHeight||1);var s=(Et(t)?Ct(t):window).visualViewport,a=!Nt()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,c=(n.top+(a&&s?s.offsetTop:0))/o,h=n.width/r,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ft(t){var e=Dt(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 Bt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Lt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function jt(t){return Ct(t).getComputedStyle(t)}function qt(t){return["table","td","th"].indexOf(zt(t))>=0}function Ut(t){return((Et(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wt(t){return"html"===zt(t)?t:t.assignedSlot||t.parentNode||(Lt(t)?t.host:null)||Ut(t)}function Yt(t){return Tt(t)&&"fixed"!==jt(t).position?t.offsetParent:null}function Gt(t){var e=/firefox/i.test(Vt());if(/Trident/i.test(Vt())&&Tt(t)&&"fixed"===jt(t).position)return null;var i=Wt(t);for(Lt(i)&&(i=i.host);Tt(i)&&["html","body"].indexOf(zt(i))<0;){var n=jt(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 Kt(t){for(var e=Ct(t),i=Yt(t);i&&qt(i)&&"static"===jt(i).position;)i=Yt(i);return i&&("html"===zt(i)||"body"===zt(i)&&"static"===jt(i).position)?e:i||Gt(t)||e}function Xt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Zt(t,e,i){return It(t,Rt(e,i))}function Qt(t,e,i){var n=Zt(t,e,i);return n>i?i:n}function Jt(){return{top:0,right:0,bottom:0,left:0}}function te(t){return Object.assign({},Jt(),t)}function ee(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var ie=function(t,e){return te("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ee(t,mt))};function ne(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=Ht(i.placement),l=Xt(a),c=[gt,ut].indexOf(a)>=0?"height":"width";if(o&&s){var h=ie(r.padding,i),d=Ft(o),p="y"===l?dt:gt,u="y"===l?pt:ut,g=i.rects.reference[c]+i.rects.reference[l]-s[l]-i.rects.popper[c],f=s[l]-i.rects.reference[l],m=Kt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[p],_=v-d[c]-h[u],w=v/2-d[c]/2+b,x=Zt(y,w,_),k=l;i.modifiersData[n]=((e={})[k]=x,e.centerOffset=x-w,e)}}function re(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)))&&Bt(e.elements.popper,n)&&(e.elements.arrow=n)}function oe(t){return t.split("-")[1]}var se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Pt(i*r)/r||0,y:Pt(n*r)/r||0}}function le(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,p=s.x,u=void 0===p?0:p,g=s.y,f=void 0===g?0:g,m="function"==typeof h?h({x:u,y:f}):{x:u,y:f};u=m.x,f=m.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=gt,_=dt,w=window;if(c){var x=Kt(i),k="clientHeight",A="clientWidth";if(x===Ct(i)&&"static"!==jt(x=Ut(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),x=x,r===dt||(r===gt||r===ut)&&o===bt)_=pt,f-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(r===gt||(r===dt||r===pt)&&o===bt)y=ut,u-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,u*=l?1:-1}var S,z=Object.assign({position:a},c&&se),C=!0===h?ae({x:u,y:f},Ct(i)):{x:u,y:f};return u=C.x,f=C.y,l?Object.assign({},z,((S={})[_]=b?"0":"",S[y]=v?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",S)):Object.assign({},z,((e={})[_]=b?f+"px":"",e[y]=v?u+"px":"",e.transform="",e))}function ce(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:Ht(e.placement),variation:oe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,le(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,le(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 he={passive:!0};function de(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,he)})),a&&l.addEventListener("resize",i.update,he),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,he)})),a&&l.removeEventListener("resize",i.update,he)}}var pe={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(t){return t.replace(/left|right|bottom|top/g,(function(t){return pe[t]}))}var ge={start:"end",end:"start"};function fe(t){return t.replace(/start|end/g,(function(t){return ge[t]}))}function me(t){var e=Ct(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(t){return Dt(Ut(t)).left+me(t).scrollLeft}function be(t,e){var i=Ct(t),n=Ut(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Nt();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+ve(t),y:l}}function ye(t){var e,i=Ut(t),n=me(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=It(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=It(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ve(t),l=-n.scrollTop;return"rtl"===jt(r||i).direction&&(a+=It(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function _e(t){var e=jt(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function we(t){return["html","body","#document"].indexOf(zt(t))>=0?t.ownerDocument.body:Tt(t)&&_e(t)?t:we(Wt(t))}function xe(t,e){var i;void 0===e&&(e=[]);var n=we(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=Ct(n),s=r?[o].concat(o.visualViewport||[],_e(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(xe(Wt(s)))}function ke(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ae(t,e){var i=Dt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Se(t,e,i){return e===_t?ke(be(t,i)):Et(e)?Ae(e,i):ke(ye(Ut(t)))}function ze(t){var e=xe(Wt(t)),i=["absolute","fixed"].indexOf(jt(t).position)>=0&&Tt(t)?Kt(t):t;return Et(i)?e.filter((function(t){return Et(t)&&Bt(t,i)&&"body"!==zt(t)})):[]}function Ce(t,e,i,n){var r="clippingParents"===e?ze(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce((function(e,i){var r=Se(t,i,n);return e.top=It(r.top,e.top),e.right=Rt(r.right,e.right),e.bottom=Rt(r.bottom,e.bottom),e.left=It(r.left,e.left),e}),Se(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ee(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?Ht(r):null,s=r?oe(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case dt:e={x:a,y:i.y-n.height};break;case pt:e={x:a,y:i.y+i.height};break;case ut:e={x:i.x+i.width,y:l};break;case gt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Xt(o):null;if(null!=c){var h="y"===c?"height":"width";switch(s){case vt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case bt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function Te(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?yt:a,c=i.rootBoundary,h=void 0===c?_t:c,d=i.elementContext,p=void 0===d?wt:d,u=i.altBoundary,g=void 0!==u&&u,f=i.padding,m=void 0===f?0:f,v=te("number"!=typeof m?m:ee(m,mt)),b=p===wt?xt:wt,y=t.rects.popper,_=t.elements[g?b:p],w=Ce(Et(_)?_:_.contextElement||Ut(t.elements.popper),l,h,s),x=Dt(t.elements.reference),k=Ee({reference:x,element:y,strategy:"absolute",placement:r}),A=ke(Object.assign({},y,k)),S=p===wt?A:x,z={top:w.top-S.top+v.top,bottom:S.bottom-w.bottom+v.bottom,left:w.left-S.left+v.left,right:S.right-w.right+v.right},C=t.modifiersData.offset;if(p===wt&&C){var E=C[r];Object.keys(z).forEach((function(t){var e=[ut,pt].indexOf(t)>=0?1:-1,i=[dt,pt].indexOf(t)>=0?"y":"x";z[t]+=E[i]*e}))}return z}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?At:l,h=oe(n),d=h?a?kt:kt.filter((function(t){return oe(t)===h})):mt,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var u=p.reduce((function(e,i){return e[i]=Te(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[Ht(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function Me(t){if(Ht(t)===ft)return[];var e=ue(t);return[fe(t),e,fe(e)]}function Oe(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,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,p=i.altBoundary,u=i.flipVariations,g=void 0===u||u,f=i.allowedAutoPlacements,m=e.options.placement,v=Ht(m),b=l||(v===m||!g?[ue(m)]:Me(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(Ht(i)===ft?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var z=y[S],C=Ht(z),E=oe(z)===vt,T=[dt,pt].indexOf(C)>=0,L=T?"width":"height",M=Te(e,{placement:z,boundary:h,rootBoundary:d,altBoundary:p,padding:c}),O=T?E?ut:gt:E?pt:dt;_[L]>w[L]&&(O=ue(O));var $=ue(O),H=[];if(o&&H.push(M[C]<=0),a&&H.push(M[O]<=0,M[$]<=0),H.every((function(t){return t}))){A=z,k=!1;break}x.set(z,H)}if(k)for(var I=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 A=e,"break"},R=g?3:1;R>0;R--){if("break"===I(R))break}e.placement!==A&&(e.modifiersData[n]._skip=!0,e.placement=A,e.reset=!0)}}function $e(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 He(t){return[dt,ut,pt,gt].some((function(e){return t[e]>=0}))}function Ie(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Te(e,{elementContext:"reference"}),a=Te(e,{altBoundary:!0}),l=$e(s,n),c=$e(a,r,o),h=He(l),d=He(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}function Re(t,e,i){var n=Ht(t),r=[gt,dt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[gt,ut].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function Pe(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=At.reduce((function(t,i){return t[i]=Re(i,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}function Ve(t){var e=t.state,i=t.name;e.modifiersData[i]=Ee({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ne(t){return"x"===t?"y":"x"}function De(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,p=i.tether,u=void 0===p||p,g=i.tetherOffset,f=void 0===g?0:g,m=Te(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=Ht(e.placement),b=oe(e.placement),y=!b,_=Xt(v),w=Ne(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,A=e.rects.popper,S="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,z="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,E={x:0,y:0};if(x){if(o){var T,L="y"===_?dt:gt,M="y"===_?pt:ut,O="y"===_?"height":"width",$=x[_],H=$+m[L],I=$-m[M],R=u?-A[O]/2:0,P=b===vt?k[O]:A[O],V=b===vt?-A[O]:-k[O],N=e.elements.arrow,D=u&&N?Ft(N):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jt(),B=F[L],j=F[M],q=Zt(0,k[O],D[O]),U=y?k[O]/2-R-q-B-z.mainAxis:P-q-B-z.mainAxis,W=y?-k[O]/2+R+q+j+z.mainAxis:V+q+j+z.mainAxis,Y=e.elements.arrow&&Kt(e.elements.arrow),G=Y?"y"===_?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(T=null==C?void 0:C[_])?T:0,X=$+W-K,Z=Zt(u?Rt(H,$+U-K-G):H,$,u?It(I,X):I);x[_]=Z,E[_]=Z-$}if(a){var Q,J="x"===_?dt:gt,tt="x"===_?pt:ut,et=x[w],it="y"===w?"height":"width",nt=et+m[J],rt=et-m[tt],ot=-1!==[dt,gt].indexOf(v),st=null!=(Q=null==C?void 0:C[w])?Q:0,at=ot?nt:et-k[it]-A[it]-st+z.altAxis,lt=ot?et+k[it]+A[it]-st-z.altAxis:rt,ct=u&&ot?Qt(at,et,lt):Zt(u?at:nt,et,u?lt:rt);x[w]=ct,E[w]=ct-et}e.modifiersData[n]=E}}function Fe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Be(t){return t!==Ct(t)&&Tt(t)?Fe(t):me(t)}function je(t){var e=t.getBoundingClientRect(),i=Pt(e.width)/t.offsetWidth||1,n=Pt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function qe(t,e,i){void 0===i&&(i=!1);var n=Tt(e),r=Tt(e)&&je(e),o=Ut(e),s=Dt(t,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==zt(e)||_e(o))&&(a=Be(e)),Tt(e)?((l=Dt(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=ve(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ue(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 We(t){var e=Ue(t);return St.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Ye(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Ge(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 Ke={placement:"bottom",modifiers:[],strategy:"absolute"};function Xe(){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 Ze(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?Ke:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ke,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var s="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,s),r.scrollParents={reference:Et(t)?xe(t):t.contextElement?xe(t.contextElement):[],popper:xe(e)};var a=We(Ge([].concat(n,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(Xe(e,i)){r.rects={reference:qe(e,Kt(i),"fixed"===r.options.strategy),popper:Ft(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],s=o.fn,c=o.options,h=void 0===c?{}:c,d=o.name;"function"==typeof s&&(r=s({state:r,options:h,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:Ye((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),a=!0}};if(!Xe(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 a=o({state:r,name:e,instance:l,options:n}),c=function(){};s.push(a||c)}}))}function h(){s.forEach((function(t){return t()})),s=[]}return l.setOptions(i).then((function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var Qe=Ze({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:de,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:Ve,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ce,data:{}},$t,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pe},{name:"flip",enabled:!0,phase:"main",fn:Oe,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:De,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:ne,effect:re,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ie}]}),Je="tippy-box",ti="tippy-content",ei="tippy-backdrop",ii="tippy-arrow",ni="tippy-svg-arrow",ri={passive:!0,capture:!0},oi=function(){return document.body};function si(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function ai(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function li(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ci(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function hi(t){return t.split(/\s+/).filter(Boolean)}function di(t){return[].concat(t)}function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function ui(t){return t.filter((function(e,i){return t.indexOf(e)===i}))}function gi(t){return t.split("-")[0]}function fi(t){return[].slice.call(t)}function mi(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function vi(){return document.createElement("div")}function bi(t){return["Element","Fragment"].some((function(e){return ai(t,e)}))}function yi(t){return ai(t,"NodeList")}function _i(t){return ai(t,"MouseEvent")}function wi(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function xi(t){return bi(t)?[t]:yi(t)?fi(t):Array.isArray(t)?t:fi(document.querySelectorAll(t))}function ki(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ai(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Si(t){var e,i=di(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function zi(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,s=gi(r.placement),a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,h="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-n+l>o,u=n-e.bottom-c>o,g=e.left-i+h>o,f=i-e.right-d>o;return p||u||g||f}))}function Ci(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Ei(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Ti={isTouch:!1},Li=0;function Mi(){Ti.isTouch||(Ti.isTouch=!0,window.performance&&document.addEventListener("mousemove",Oi))}function Oi(){var t=performance.now();t-Li<20&&(Ti.isTouch=!1,document.removeEventListener("mousemove",Oi)),Li=t}function $i(){var t=document.activeElement;if(wi(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Hi(){document.addEventListener("touchstart",Mi,ri),window.addEventListener("blur",$i)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Ri={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Pi={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Vi=Object.assign({appendTo:oi,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},Ri,Pi),Ni=Object.keys(Vi),Di=function(t){Object.keys(t).forEach((function(e){Vi[e]=t[e]}))};function Fi(t){var e=(t.plugins||[]).reduce((function(e,i){var n,r=i.name,o=i.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(n=Vi[r])?n:o);return e}),{});return Object.assign({},t,e)}function Bi(t,e){return(e?Object.keys(Fi(Object.assign({},Vi,{plugins:e}))):Ni).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 ji(t,e){var i=Object.assign({},e,{content:li(e.content,[t])},e.ignoreAttributes?{}:Bi(t,e.plugins));return i.aria=Object.assign({},Vi.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 qi=function(){return"innerHTML"};function Ui(t,e){t[qi()]=e}function Wi(t){var e=vi();return!0===t?e.className=ii:(e.className=ni,bi(t)?e.appendChild(t):Ui(e,t)),e}function Yi(t,e){bi(e.content)?(Ui(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ui(t,e.content):t.textContent=e.content)}function Gi(t){var e=t.firstElementChild,i=fi(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(ti)})),arrow:i.find((function(t){return t.classList.contains(ii)||t.classList.contains(ni)})),backdrop:i.find((function(t){return t.classList.contains(ei)}))}}function Ki(t){var e=vi(),i=vi();i.className=Je,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=vi();function r(i,n){var r=Gi(e),o=r.box,s=r.content,a=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||Yi(s,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Wi(n.arrow))):o.appendChild(Wi(n.arrow)):a&&o.removeChild(a)}return n.className=ti,n.setAttribute("data-state","hidden"),Yi(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}Ki.$$tippy=!0;var Xi=1,Zi=[],Qi=[];function Ji(t,e){var i,n,r,o,s,a,l,c=ji(t,Object.assign({},Vi,Fi(mi(e)))),h=!1,d=!1,p=!1,u=!1,g=[],f=ci(X,c.interactiveDebounce),m=Xi++,v=null,b=ui(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:vi(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:dt,hide:pt,hideWithInteractivity:ut,enable:st,disable:at,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 A=b.map((function(t){return t.fn(_)})),S=t.hasAttribute("aria-expanded");return Y(),R(),$(),H("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",f)})),_;function z(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===z()[0]}function E(){var t;return!(null==(t=_.props.render)||!t.$$tippy)}function T(){return l||t}function L(){var t=T().parentNode;return t?Si(t):document}function M(){return Gi(x)}function O(t){return _.state.isMounted&&!_.state.isVisible||Ti.isTouch||o&&"focus"===o.type?0:si(_.props.delay,t?0:1,Vi.delay)}function $(t){void 0===t&&(t=!1),x.style.pointerEvents=_.props.interactive&&!t?"":"none",x.style.zIndex=""+_.props.zIndex}function H(t,e,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[t]&&i[t].apply(i,e)})),i)&&(n=_.props)[t].apply(n,e)}function I(){var e=_.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;di(_.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 R(){!S&&_.props.aria.expanded&&di(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function P(){L().removeEventListener("mousemove",f),Zi=Zi.filter((function(t){return t!==f}))}function V(e){if(!Ti.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!_.props.interactive||!Ei(x,i)){if(di(_.props.triggerTarget||t).some((function(t){return Ei(t,i)}))){if(Ti.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||B())}}}function N(){p=!0}function D(){p=!1}function F(){var t=L();t.addEventListener("mousedown",V,!0),t.addEventListener("touchend",V,ri),t.addEventListener("touchstart",D,ri),t.addEventListener("touchmove",N,ri)}function B(){var t=L();t.removeEventListener("mousedown",V,!0),t.removeEventListener("touchend",V,ri),t.removeEventListener("touchstart",D,ri),t.removeEventListener("touchmove",N,ri)}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=M().box;function n(t){t.target===i&&(Ci(i,"remove",n),e())}if(0===t)return e();Ci(i,"remove",s),Ci(i,"add",n),s=n}function W(e,i,n){void 0===n&&(n=!1),di(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})}))}function Y(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Z,{passive:!0})),hi(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Z);break;case"focus":W(Ii?"focusout":"blur",Q);break;case"focusin":W("focusout",Q)}}))}function G(){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)&&!d){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!_.state.isVisible&&_i(t)&&Zi.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 X(t){var e=t.target,i=T().contains(e)||x.contains(e);"mousemove"===t.type&&i||zi(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)&&(P(),ot(t))}function Z(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Q(t){_.props.trigger.indexOf("focusin")<0&&t.target!==T()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!Ti.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,s=e.moveTransition,l=E()?Gi(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||T()}: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:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=M().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=Qe(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function it(){var t,e=_.props.appendTo,i=T();(t=_.props.interactive&&e===oi||"parent"===e?i.parentNode:li(e,[i])).contains(x)||t.appendChild(x),_.state.isMounted=!0,tt()}function nt(){return fi(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&H("onTrigger",[_,t]),F();var e=O(!0),n=z(),r=n[0],o=n[1];Ti.isTouch&&"hold"===r&&o&&(e=o),e?i=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),H("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=O(!1);e?n=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else B()}function st(){_.state.isEnabled=!0}function at(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){H("onBeforeUpdate",[_,e]),G();var i=_.props,n=ji(t,Object.assign({},i,mi(e),{ignoreAttributes:!0}));_.props=n,Y(),i.interactiveDebounce!==n.interactiveDebounce&&(P(),f=ci(X,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?di(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),R(),$(),k&&k(i,n),_.popperInstance&&(tt(),nt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),H("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function dt(){var t=_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=Ti.isTouch&&!_.props.touch,r=si(_.props.duration,0,Vi.duration);if(!(t||e||i||n||T().hasAttribute("disabled")||(H("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),$(),F(),_.state.isMounted||(x.style.transition="none"),E()){var o=M();ki([o.box,o.content],0)}a=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=M(),i=e.box,n=e.content;ki([i,n],r),Ai([i,n],"visible")}I(),R(),pi(Qi,_),null==(t=_.popperInstance)||t.forceUpdate(),H("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,H("onShown",[_])}))}},it()}}function pt(){var t=!_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=si(_.props.duration,1,Vi.duration);if(!(t||e||i)&&(H("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),P(),B(),$(!0),E()){var r=M(),o=r.box,s=r.content;_.props.animation&&(ki([o,s],n),Ai([o,s],"hidden"))}I(),R(),_.props.animation?E()&&j(n,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),pi(Zi,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),nt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Qi=Qi.filter((function(t){return t!==_})),_.state.isMounted=!1,H("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),G(),delete t._tippy,_.state.isDestroyed=!0,H("onDestroy",[_]))}}function tn(t,e){void 0===e&&(e={});var i=Vi.plugins.concat(e.plugins||[]);Hi();var n=Object.assign({},e,{plugins:i}),r=xi(t).reduce((function(t,e){var i=e&&Ji(e,n);return i&&t.push(i),t}),[]);return bi(t)?r[0]:r}tn.defaultProps=Vi,tn.setDefaultProps=Di,tn.currentInput=Ti;Object.assign({},$t,{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 en(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}tn.setDefaultProps({render:Ki});const nn='\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',rn='\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',on="\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 }",sn="\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",an="\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 ln=Object.freeze({__proto__:null,camelize:en,base:nn,lightBorder:rn,light:on,material:sn,translucent:an});function cn(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 hn(t,e){if(cn(t,"base",nn),e&&"none"!==e){const i=en(e),n=ln[i];n&&cn(t,i,n)}}class dn extends(D(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},touch:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String},stopPropagation:{type:Boolean,attribute:"stop-propagation"}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.touch=null,this.fallbackPlacement=null,this.popupClass=null,this.stopPropagation=!1,this._tippy=null,this._content=null}render(){return this.for?I`<div class="hidden"><slot></slot></div>`:I`<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(){if(this.theme||"none"===this.theme||(this.theme=H(this,"--pb-popover-theme","none")),this.placement||(this.placement=H(this,"--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=H(this,"--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=H(this,"--pb-popover-persistent",!1)),this.trigger||(this.trigger=H(this,"--pb-popover-trigger",null)),!this.touch){const t=H(this,"--pb-popover-touch","hold");this.touch="true"===t||t}}_injectStyles(){this._checkCSSProperties(),hn(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:this.touch,hideOnClick:!1,trigger:this.trigger};if(this.stopPropagation&&(i.onTrigger=(t,e)=>{e.stopPropagation()}),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,popup:t})},this._tippy=tn(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[R`
510
+ `}}customElements.define("pb-demo-snippet",at);class lt{static subscribe(t,e,i,n=!1){const r=lt._getChannels(e),o=document.addEventListener(t,t=>{i&&t.detail&&t.detail.key&&r.includes(t.detail.key)&&i(t,o)},{once:n})}static subscribeOnce(t,e=null){const i=lt._getChannels(e);return new Promise(e=>{document.addEventListener(t,t=>{t.detail&&t.detail.key&&i.includes(t.detail.key)&&e(t)},{once:!0})})}static _getChannels(t){return null!==t&&t.length?Array.isArray(t)?t:[t]:[N]}static emit(t,e=null,i=null){const n=i||{};n.key=e||N;const r=new CustomEvent(t,{detail:n});document.dispatchEvent(r)}static ifReady(t){return Array.isArray(t)||(t=[t]),new Promise(e=>{const i=t.length;if(0===i)return void e();let n=i;t.forEach(t=>{if(t._isReady)return n-=1,void(0===n&&e());const i=t.addEventListener("pb-ready",()=>{n-=1,0===n&&(t.removeEventListener("pb-ready",i),e())})})})}}window.pbEvents||(window.pbEvents=lt);const ct="2.18.0";class ht extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=ct}connectedCallback(){if(super.connectedCallback(),!this.version){const t=P("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return I`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",ht);var dt="top",pt="bottom",ut="right",gt="left",ft="auto",mt=[dt,pt,ut,gt],vt="start",bt="end",yt="clippingParents",_t="viewport",wt="popper",xt="reference",kt=mt.reduce((function(t,e){return t.concat([e+"-"+vt,e+"-"+bt])}),[]),At=[].concat(mt,[ft]).reduce((function(t,e){return t.concat([e,e+"-"+vt,e+"-"+bt])}),[]),St=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Et(t){return t instanceof Ct(t).Element||t instanceof Element}function Tt(t){return t instanceof Ct(t).HTMLElement||t instanceof HTMLElement}function Lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Ct(t).ShadowRoot||t instanceof ShadowRoot)}function Mt(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];Tt(r)&&zt(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 Ot(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}),{});Tt(n)&&zt(n)&&(Object.assign(n.style,o),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}}var $t={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Ot,requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var It=Math.max,Rt=Math.min,Pt=Math.round;function Vt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Nt(){return!/^((?!chrome|android).)*safari/i.test(Vt())}function Dt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&Tt(t)&&(r=t.offsetWidth>0&&Pt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pt(n.height)/t.offsetHeight||1);var s=(Et(t)?Ct(t):window).visualViewport,a=!Nt()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,c=(n.top+(a&&s?s.offsetTop:0))/o,h=n.width/r,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ft(t){var e=Dt(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 Bt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Lt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function jt(t){return Ct(t).getComputedStyle(t)}function qt(t){return["table","td","th"].indexOf(zt(t))>=0}function Ut(t){return((Et(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wt(t){return"html"===zt(t)?t:t.assignedSlot||t.parentNode||(Lt(t)?t.host:null)||Ut(t)}function Yt(t){return Tt(t)&&"fixed"!==jt(t).position?t.offsetParent:null}function Gt(t){var e=/firefox/i.test(Vt());if(/Trident/i.test(Vt())&&Tt(t)&&"fixed"===jt(t).position)return null;var i=Wt(t);for(Lt(i)&&(i=i.host);Tt(i)&&["html","body"].indexOf(zt(i))<0;){var n=jt(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 Kt(t){for(var e=Ct(t),i=Yt(t);i&&qt(i)&&"static"===jt(i).position;)i=Yt(i);return i&&("html"===zt(i)||"body"===zt(i)&&"static"===jt(i).position)?e:i||Gt(t)||e}function Xt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Zt(t,e,i){return It(t,Rt(e,i))}function Qt(t,e,i){var n=Zt(t,e,i);return n>i?i:n}function Jt(){return{top:0,right:0,bottom:0,left:0}}function te(t){return Object.assign({},Jt(),t)}function ee(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var ie=function(t,e){return te("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ee(t,mt))};function ne(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=Ht(i.placement),l=Xt(a),c=[gt,ut].indexOf(a)>=0?"height":"width";if(o&&s){var h=ie(r.padding,i),d=Ft(o),p="y"===l?dt:gt,u="y"===l?pt:ut,g=i.rects.reference[c]+i.rects.reference[l]-s[l]-i.rects.popper[c],f=s[l]-i.rects.reference[l],m=Kt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[p],_=v-d[c]-h[u],w=v/2-d[c]/2+b,x=Zt(y,w,_),k=l;i.modifiersData[n]=((e={})[k]=x,e.centerOffset=x-w,e)}}function re(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)))&&Bt(e.elements.popper,n)&&(e.elements.arrow=n)}function oe(t){return t.split("-")[1]}var se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Pt(i*r)/r||0,y:Pt(n*r)/r||0}}function le(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,p=s.x,u=void 0===p?0:p,g=s.y,f=void 0===g?0:g,m="function"==typeof h?h({x:u,y:f}):{x:u,y:f};u=m.x,f=m.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=gt,_=dt,w=window;if(c){var x=Kt(i),k="clientHeight",A="clientWidth";if(x===Ct(i)&&"static"!==jt(x=Ut(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),x=x,r===dt||(r===gt||r===ut)&&o===bt)_=pt,f-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(r===gt||(r===dt||r===pt)&&o===bt)y=ut,u-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,u*=l?1:-1}var S,z=Object.assign({position:a},c&&se),C=!0===h?ae({x:u,y:f},Ct(i)):{x:u,y:f};return u=C.x,f=C.y,l?Object.assign({},z,((S={})[_]=b?"0":"",S[y]=v?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",S)):Object.assign({},z,((e={})[_]=b?f+"px":"",e[y]=v?u+"px":"",e.transform="",e))}function ce(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:Ht(e.placement),variation:oe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,le(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,le(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 he={passive:!0};function de(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,he)})),a&&l.addEventListener("resize",i.update,he),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,he)})),a&&l.removeEventListener("resize",i.update,he)}}var pe={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(t){return t.replace(/left|right|bottom|top/g,(function(t){return pe[t]}))}var ge={start:"end",end:"start"};function fe(t){return t.replace(/start|end/g,(function(t){return ge[t]}))}function me(t){var e=Ct(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(t){return Dt(Ut(t)).left+me(t).scrollLeft}function be(t,e){var i=Ct(t),n=Ut(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Nt();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+ve(t),y:l}}function ye(t){var e,i=Ut(t),n=me(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=It(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=It(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ve(t),l=-n.scrollTop;return"rtl"===jt(r||i).direction&&(a+=It(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function _e(t){var e=jt(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function we(t){return["html","body","#document"].indexOf(zt(t))>=0?t.ownerDocument.body:Tt(t)&&_e(t)?t:we(Wt(t))}function xe(t,e){var i;void 0===e&&(e=[]);var n=we(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=Ct(n),s=r?[o].concat(o.visualViewport||[],_e(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(xe(Wt(s)))}function ke(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ae(t,e){var i=Dt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Se(t,e,i){return e===_t?ke(be(t,i)):Et(e)?Ae(e,i):ke(ye(Ut(t)))}function ze(t){var e=xe(Wt(t)),i=["absolute","fixed"].indexOf(jt(t).position)>=0&&Tt(t)?Kt(t):t;return Et(i)?e.filter((function(t){return Et(t)&&Bt(t,i)&&"body"!==zt(t)})):[]}function Ce(t,e,i,n){var r="clippingParents"===e?ze(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce((function(e,i){var r=Se(t,i,n);return e.top=It(r.top,e.top),e.right=Rt(r.right,e.right),e.bottom=Rt(r.bottom,e.bottom),e.left=It(r.left,e.left),e}),Se(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ee(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?Ht(r):null,s=r?oe(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case dt:e={x:a,y:i.y-n.height};break;case pt:e={x:a,y:i.y+i.height};break;case ut:e={x:i.x+i.width,y:l};break;case gt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Xt(o):null;if(null!=c){var h="y"===c?"height":"width";switch(s){case vt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case bt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function Te(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?yt:a,c=i.rootBoundary,h=void 0===c?_t:c,d=i.elementContext,p=void 0===d?wt:d,u=i.altBoundary,g=void 0!==u&&u,f=i.padding,m=void 0===f?0:f,v=te("number"!=typeof m?m:ee(m,mt)),b=p===wt?xt:wt,y=t.rects.popper,_=t.elements[g?b:p],w=Ce(Et(_)?_:_.contextElement||Ut(t.elements.popper),l,h,s),x=Dt(t.elements.reference),k=Ee({reference:x,element:y,strategy:"absolute",placement:r}),A=ke(Object.assign({},y,k)),S=p===wt?A:x,z={top:w.top-S.top+v.top,bottom:S.bottom-w.bottom+v.bottom,left:w.left-S.left+v.left,right:S.right-w.right+v.right},C=t.modifiersData.offset;if(p===wt&&C){var E=C[r];Object.keys(z).forEach((function(t){var e=[ut,pt].indexOf(t)>=0?1:-1,i=[dt,pt].indexOf(t)>=0?"y":"x";z[t]+=E[i]*e}))}return z}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?At:l,h=oe(n),d=h?a?kt:kt.filter((function(t){return oe(t)===h})):mt,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var u=p.reduce((function(e,i){return e[i]=Te(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[Ht(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function Me(t){if(Ht(t)===ft)return[];var e=ue(t);return[fe(t),e,fe(e)]}function Oe(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,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,p=i.altBoundary,u=i.flipVariations,g=void 0===u||u,f=i.allowedAutoPlacements,m=e.options.placement,v=Ht(m),b=l||(v===m||!g?[ue(m)]:Me(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(Ht(i)===ft?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var z=y[S],C=Ht(z),E=oe(z)===vt,T=[dt,pt].indexOf(C)>=0,L=T?"width":"height",M=Te(e,{placement:z,boundary:h,rootBoundary:d,altBoundary:p,padding:c}),O=T?E?ut:gt:E?pt:dt;_[L]>w[L]&&(O=ue(O));var $=ue(O),H=[];if(o&&H.push(M[C]<=0),a&&H.push(M[O]<=0,M[$]<=0),H.every((function(t){return t}))){A=z,k=!1;break}x.set(z,H)}if(k)for(var I=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 A=e,"break"},R=g?3:1;R>0;R--){if("break"===I(R))break}e.placement!==A&&(e.modifiersData[n]._skip=!0,e.placement=A,e.reset=!0)}}function $e(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 He(t){return[dt,ut,pt,gt].some((function(e){return t[e]>=0}))}function Ie(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Te(e,{elementContext:"reference"}),a=Te(e,{altBoundary:!0}),l=$e(s,n),c=$e(a,r,o),h=He(l),d=He(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}function Re(t,e,i){var n=Ht(t),r=[gt,dt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[gt,ut].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function Pe(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=At.reduce((function(t,i){return t[i]=Re(i,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}function Ve(t){var e=t.state,i=t.name;e.modifiersData[i]=Ee({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ne(t){return"x"===t?"y":"x"}function De(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,p=i.tether,u=void 0===p||p,g=i.tetherOffset,f=void 0===g?0:g,m=Te(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=Ht(e.placement),b=oe(e.placement),y=!b,_=Xt(v),w=Ne(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,A=e.rects.popper,S="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,z="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,E={x:0,y:0};if(x){if(o){var T,L="y"===_?dt:gt,M="y"===_?pt:ut,O="y"===_?"height":"width",$=x[_],H=$+m[L],I=$-m[M],R=u?-A[O]/2:0,P=b===vt?k[O]:A[O],V=b===vt?-A[O]:-k[O],N=e.elements.arrow,D=u&&N?Ft(N):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jt(),B=F[L],j=F[M],q=Zt(0,k[O],D[O]),U=y?k[O]/2-R-q-B-z.mainAxis:P-q-B-z.mainAxis,W=y?-k[O]/2+R+q+j+z.mainAxis:V+q+j+z.mainAxis,Y=e.elements.arrow&&Kt(e.elements.arrow),G=Y?"y"===_?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(T=null==C?void 0:C[_])?T:0,X=$+W-K,Z=Zt(u?Rt(H,$+U-K-G):H,$,u?It(I,X):I);x[_]=Z,E[_]=Z-$}if(a){var Q,J="x"===_?dt:gt,tt="x"===_?pt:ut,et=x[w],it="y"===w?"height":"width",nt=et+m[J],rt=et-m[tt],ot=-1!==[dt,gt].indexOf(v),st=null!=(Q=null==C?void 0:C[w])?Q:0,at=ot?nt:et-k[it]-A[it]-st+z.altAxis,lt=ot?et+k[it]+A[it]-st-z.altAxis:rt,ct=u&&ot?Qt(at,et,lt):Zt(u?at:nt,et,u?lt:rt);x[w]=ct,E[w]=ct-et}e.modifiersData[n]=E}}function Fe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Be(t){return t!==Ct(t)&&Tt(t)?Fe(t):me(t)}function je(t){var e=t.getBoundingClientRect(),i=Pt(e.width)/t.offsetWidth||1,n=Pt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function qe(t,e,i){void 0===i&&(i=!1);var n=Tt(e),r=Tt(e)&&je(e),o=Ut(e),s=Dt(t,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==zt(e)||_e(o))&&(a=Be(e)),Tt(e)?((l=Dt(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=ve(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ue(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 We(t){var e=Ue(t);return St.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Ye(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Ge(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 Ke={placement:"bottom",modifiers:[],strategy:"absolute"};function Xe(){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 Ze(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?Ke:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ke,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var s="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,s),r.scrollParents={reference:Et(t)?xe(t):t.contextElement?xe(t.contextElement):[],popper:xe(e)};var a=We(Ge([].concat(n,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(Xe(e,i)){r.rects={reference:qe(e,Kt(i),"fixed"===r.options.strategy),popper:Ft(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],s=o.fn,c=o.options,h=void 0===c?{}:c,d=o.name;"function"==typeof s&&(r=s({state:r,options:h,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:Ye((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),a=!0}};if(!Xe(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 a=o({state:r,name:e,instance:l,options:n}),c=function(){};s.push(a||c)}}))}function h(){s.forEach((function(t){return t()})),s=[]}return l.setOptions(i).then((function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var Qe=Ze({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:de,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:Ve,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ce,data:{}},$t,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pe},{name:"flip",enabled:!0,phase:"main",fn:Oe,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:De,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:ne,effect:re,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ie}]}),Je="tippy-box",ti="tippy-content",ei="tippy-backdrop",ii="tippy-arrow",ni="tippy-svg-arrow",ri={passive:!0,capture:!0},oi=function(){return document.body};function si(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function ai(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function li(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ci(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function hi(t){return t.split(/\s+/).filter(Boolean)}function di(t){return[].concat(t)}function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function ui(t){return t.filter((function(e,i){return t.indexOf(e)===i}))}function gi(t){return t.split("-")[0]}function fi(t){return[].slice.call(t)}function mi(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function vi(){return document.createElement("div")}function bi(t){return["Element","Fragment"].some((function(e){return ai(t,e)}))}function yi(t){return ai(t,"NodeList")}function _i(t){return ai(t,"MouseEvent")}function wi(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function xi(t){return bi(t)?[t]:yi(t)?fi(t):Array.isArray(t)?t:fi(document.querySelectorAll(t))}function ki(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ai(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Si(t){var e,i=di(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function zi(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,s=gi(r.placement),a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,h="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-n+l>o,u=n-e.bottom-c>o,g=e.left-i+h>o,f=i-e.right-d>o;return p||u||g||f}))}function Ci(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Ei(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Ti={isTouch:!1},Li=0;function Mi(){Ti.isTouch||(Ti.isTouch=!0,window.performance&&document.addEventListener("mousemove",Oi))}function Oi(){var t=performance.now();t-Li<20&&(Ti.isTouch=!1,document.removeEventListener("mousemove",Oi)),Li=t}function $i(){var t=document.activeElement;if(wi(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Hi(){document.addEventListener("touchstart",Mi,ri),window.addEventListener("blur",$i)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Ri={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Pi={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Vi=Object.assign({appendTo:oi,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},Ri,Pi),Ni=Object.keys(Vi),Di=function(t){Object.keys(t).forEach((function(e){Vi[e]=t[e]}))};function Fi(t){var e=(t.plugins||[]).reduce((function(e,i){var n,r=i.name,o=i.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(n=Vi[r])?n:o);return e}),{});return Object.assign({},t,e)}function Bi(t,e){return(e?Object.keys(Fi(Object.assign({},Vi,{plugins:e}))):Ni).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 ji(t,e){var i=Object.assign({},e,{content:li(e.content,[t])},e.ignoreAttributes?{}:Bi(t,e.plugins));return i.aria=Object.assign({},Vi.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 qi=function(){return"innerHTML"};function Ui(t,e){t[qi()]=e}function Wi(t){var e=vi();return!0===t?e.className=ii:(e.className=ni,bi(t)?e.appendChild(t):Ui(e,t)),e}function Yi(t,e){bi(e.content)?(Ui(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ui(t,e.content):t.textContent=e.content)}function Gi(t){var e=t.firstElementChild,i=fi(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(ti)})),arrow:i.find((function(t){return t.classList.contains(ii)||t.classList.contains(ni)})),backdrop:i.find((function(t){return t.classList.contains(ei)}))}}function Ki(t){var e=vi(),i=vi();i.className=Je,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=vi();function r(i,n){var r=Gi(e),o=r.box,s=r.content,a=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||Yi(s,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Wi(n.arrow))):o.appendChild(Wi(n.arrow)):a&&o.removeChild(a)}return n.className=ti,n.setAttribute("data-state","hidden"),Yi(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}Ki.$$tippy=!0;var Xi=1,Zi=[],Qi=[];function Ji(t,e){var i,n,r,o,s,a,l,c=ji(t,Object.assign({},Vi,Fi(mi(e)))),h=!1,d=!1,p=!1,u=!1,g=[],f=ci(X,c.interactiveDebounce),m=Xi++,v=null,b=ui(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:vi(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:dt,hide:pt,hideWithInteractivity:ut,enable:st,disable:at,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 A=b.map((function(t){return t.fn(_)})),S=t.hasAttribute("aria-expanded");return Y(),R(),$(),H("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",f)})),_;function z(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===z()[0]}function E(){var t;return!(null==(t=_.props.render)||!t.$$tippy)}function T(){return l||t}function L(){var t=T().parentNode;return t?Si(t):document}function M(){return Gi(x)}function O(t){return _.state.isMounted&&!_.state.isVisible||Ti.isTouch||o&&"focus"===o.type?0:si(_.props.delay,t?0:1,Vi.delay)}function $(t){void 0===t&&(t=!1),x.style.pointerEvents=_.props.interactive&&!t?"":"none",x.style.zIndex=""+_.props.zIndex}function H(t,e,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[t]&&i[t].apply(i,e)})),i)&&(n=_.props)[t].apply(n,e)}function I(){var e=_.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;di(_.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 R(){!S&&_.props.aria.expanded&&di(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function P(){L().removeEventListener("mousemove",f),Zi=Zi.filter((function(t){return t!==f}))}function V(e){if(!Ti.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!_.props.interactive||!Ei(x,i)){if(di(_.props.triggerTarget||t).some((function(t){return Ei(t,i)}))){if(Ti.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||B())}}}function N(){p=!0}function D(){p=!1}function F(){var t=L();t.addEventListener("mousedown",V,!0),t.addEventListener("touchend",V,ri),t.addEventListener("touchstart",D,ri),t.addEventListener("touchmove",N,ri)}function B(){var t=L();t.removeEventListener("mousedown",V,!0),t.removeEventListener("touchend",V,ri),t.removeEventListener("touchstart",D,ri),t.removeEventListener("touchmove",N,ri)}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=M().box;function n(t){t.target===i&&(Ci(i,"remove",n),e())}if(0===t)return e();Ci(i,"remove",s),Ci(i,"add",n),s=n}function W(e,i,n){void 0===n&&(n=!1),di(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})}))}function Y(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Z,{passive:!0})),hi(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Z);break;case"focus":W(Ii?"focusout":"blur",Q);break;case"focusin":W("focusout",Q)}}))}function G(){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)&&!d){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!_.state.isVisible&&_i(t)&&Zi.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 X(t){var e=t.target,i=T().contains(e)||x.contains(e);"mousemove"===t.type&&i||zi(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)&&(P(),ot(t))}function Z(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Q(t){_.props.trigger.indexOf("focusin")<0&&t.target!==T()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!Ti.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,s=e.moveTransition,l=E()?Gi(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||T()}: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:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=M().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=Qe(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function it(){var t,e=_.props.appendTo,i=T();(t=_.props.interactive&&e===oi||"parent"===e?i.parentNode:li(e,[i])).contains(x)||t.appendChild(x),_.state.isMounted=!0,tt()}function nt(){return fi(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&H("onTrigger",[_,t]),F();var e=O(!0),n=z(),r=n[0],o=n[1];Ti.isTouch&&"hold"===r&&o&&(e=o),e?i=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),H("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=O(!1);e?n=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else B()}function st(){_.state.isEnabled=!0}function at(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){H("onBeforeUpdate",[_,e]),G();var i=_.props,n=ji(t,Object.assign({},i,mi(e),{ignoreAttributes:!0}));_.props=n,Y(),i.interactiveDebounce!==n.interactiveDebounce&&(P(),f=ci(X,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?di(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),R(),$(),k&&k(i,n),_.popperInstance&&(tt(),nt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),H("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function dt(){var t=_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=Ti.isTouch&&!_.props.touch,r=si(_.props.duration,0,Vi.duration);if(!(t||e||i||n||T().hasAttribute("disabled")||(H("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),$(),F(),_.state.isMounted||(x.style.transition="none"),E()){var o=M();ki([o.box,o.content],0)}a=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=M(),i=e.box,n=e.content;ki([i,n],r),Ai([i,n],"visible")}I(),R(),pi(Qi,_),null==(t=_.popperInstance)||t.forceUpdate(),H("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,H("onShown",[_])}))}},it()}}function pt(){var t=!_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=si(_.props.duration,1,Vi.duration);if(!(t||e||i)&&(H("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),P(),B(),$(!0),E()){var r=M(),o=r.box,s=r.content;_.props.animation&&(ki([o,s],n),Ai([o,s],"hidden"))}I(),R(),_.props.animation?E()&&j(n,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),pi(Zi,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),nt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Qi=Qi.filter((function(t){return t!==_})),_.state.isMounted=!1,H("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),G(),delete t._tippy,_.state.isDestroyed=!0,H("onDestroy",[_]))}}function tn(t,e){void 0===e&&(e={});var i=Vi.plugins.concat(e.plugins||[]);Hi();var n=Object.assign({},e,{plugins:i}),r=xi(t).reduce((function(t,e){var i=e&&Ji(e,n);return i&&t.push(i),t}),[]);return bi(t)?r[0]:r}tn.defaultProps=Vi,tn.setDefaultProps=Di,tn.currentInput=Ti;Object.assign({},$t,{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 en(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}tn.setDefaultProps({render:Ki});const nn='\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',rn='\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',on="\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 }",sn="\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",an="\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 ln=Object.freeze({__proto__:null,camelize:en,base:nn,lightBorder:rn,light:on,material:sn,translucent:an});function cn(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 hn(t,e){if(cn(t,"base",nn),e&&"none"!==e){const i=en(e),n=ln[i];n&&cn(t,i,n)}}class dn extends(D(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},touch:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String},stopPropagation:{type:Boolean,attribute:"stop-propagation"}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.touch=null,this.fallbackPlacement=null,this.popupClass=null,this.stopPropagation=!1,this._tippy=null,this._content=null}render(){return this.for?I`<div class="hidden"><slot></slot></div>`:I`<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(){if(this.theme||"none"===this.theme||(this.theme=H(this,"--pb-popover-theme","none")),this.placement||(this.placement=H(this,"--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=H(this,"--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=H(this,"--pb-popover-persistent",!1)),this.trigger||(this.trigger=H(this,"--pb-popover-trigger",null)),!this.touch){const t=H(this,"--pb-popover-touch","hold");this.touch="true"===t||t}}_injectStyles(){this._checkCSSProperties(),hn(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:this.touch,hideOnClick:!1,trigger:this.trigger};if(this.stopPropagation&&(i.onTrigger=(t,e)=>{e.stopPropagation()}),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,popup:t})},this._tippy=tn(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[R`
511
511
  :host {
512
512
  display: inline;
513
513
  }
@@ -555,7 +555,7 @@ const et=n`
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")}}function un(t){for(var e=[],i=0;i<t.length;){var n=t[i];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)e.push({type:"CHAR",index:i,value:t[i++]});else{var r=1,o="";if("?"===t[a=i+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<t.length;)if("\\"!==t[a]){if(")"===t[a]){if(0===--r){a++;break}}else if("("===t[a]&&(r++,"?"!==t[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));o+=t[a++]}else o+=t[a++]+t[a++];if(r)throw new TypeError("Unbalanced pattern at ".concat(i));if(!o)throw new TypeError("Missing pattern at ".concat(i));e.push({type:"PATTERN",index:i,value:o}),i=a}else{for(var s="",a=i+1;a<t.length;){var l=t.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=t[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(i));e.push({type:"NAME",index:i,value:s}),i=a}else e.push({type:"CLOSE",index:i,value:t[i++]});else e.push({type:"OPEN",index:i,value:t[i++]});else e.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});else e.push({type:"MODIFIER",index:i,value:t[i++]})}return e.push({type:"END",index:i,value:""}),e}function gn(t,e){void 0===e&&(e={});for(var i=un(t),n=e.prefixes,r=void 0===n?"./":n,o="[^".concat(yn(e.delimiter||"/#?"),"]+?"),s=[],a=0,l=0,c="",h=function(t){if(l<i.length&&i[l].type===t)return i[l++].value},d=function(t){var e=h(t);if(void 0!==e)return e;var n=i[l],r=n.type,o=n.index;throw new TypeError("Unexpected ".concat(r," at ").concat(o,", expected ").concat(t))},p=function(){for(var t,e="";t=h("CHAR")||h("ESCAPED_CHAR");)e+=t;return e};l<i.length;){var u=h("CHAR"),g=h("NAME"),f=h("PATTERN");if(g||f){var m=u||"";-1===r.indexOf(m)&&(c+=m,m=""),c&&(s.push(c),c=""),s.push({name:g||a++,prefix:m,suffix:"",pattern:f||o,modifier:h("MODIFIER")||""})}else{var v=u||h("ESCAPED_CHAR");if(v)c+=v;else if(c&&(s.push(c),c=""),h("OPEN")){m=p();var b=h("NAME")||"",y=h("PATTERN")||"",_=p();d("CLOSE"),s.push({name:b||(y?a++:""),pattern:b&&!y?o:y,prefix:m,suffix:_,modifier:h("MODIFIER")||""})}else d("END")}}return s}function fn(t,e){return mn(gn(t,e),e)}function mn(t,e){void 0===e&&(e={});var i=_n(e),n=e.encode,r=void 0===n?function(t){return t}:n,o=e.validate,s=void 0===o||o,a=t.map((function(t){if("object"==typeof t)return new RegExp("^(?:".concat(t.pattern,")$"),i)}));return function(e){for(var i="",n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o){var l=e?e[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,h="*"===o.modifier||"+"===o.modifier;if(Array.isArray(l)){if(!h)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===l.length){if(c)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var d=0;d<l.length;d++){var p=r(l[d],o);if(s&&!a[n].test(p))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));i+=o.prefix+p+o.suffix}}else if("string"!=typeof l&&"number"!=typeof l){if(!c){var u=h?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(u))}}else{p=r(String(l),o);if(s&&!a[n].test(p))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));i+=o.prefix+p+o.suffix}}else i+=o}return i}}function vn(t,e){var i=[];return bn(Sn(t,i,e),i,e)}function bn(t,e,i){void 0===i&&(i={});var n=i.decode,r=void 0===n?function(t){return t}:n;return function(i){var n=t.exec(i);if(!n)return!1;for(var o=n[0],s=n.index,a=Object.create(null),l=function(t){if(void 0===n[t])return"continue";var i=e[t-1];"*"===i.modifier||"+"===i.modifier?a[i.name]=n[t].split(i.prefix+i.suffix).map((function(t){return r(t,i)})):a[i.name]=r(n[t],i)},c=1;c<n.length;c++)l(c);return{path:o,index:s,params:a}}}function yn(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _n(t){return t&&t.sensitive?"":"i"}function wn(t,e){if(!e)return t;for(var i=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,r=i.exec(t.source);r;)e.push({name:r[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),r=i.exec(t.source);return t}function xn(t,e,i){var n=t.map((function(t){return Sn(t,e,i).source}));return new RegExp("(?:".concat(n.join("|"),")"),_n(i))}function kn(t,e,i){return An(gn(t,i),e,i)}function An(t,e,i){void 0===i&&(i={});for(var n=i.strict,r=void 0!==n&&n,o=i.start,s=void 0===o||o,a=i.end,l=void 0===a||a,c=i.encode,h=void 0===c?function(t){return t}:c,d=i.delimiter,p=void 0===d?"/#?":d,u=i.endsWith,g="[".concat(yn(void 0===u?"":u),"]|$"),f="[".concat(yn(p),"]"),m=s?"^":"",v=0,b=t;v<b.length;v++){var y=b[v];if("string"==typeof y)m+=yn(h(y));else{var _=yn(h(y.prefix)),w=yn(h(y.suffix));if(y.pattern)if(e&&e.push(y),_||w)if("+"===y.modifier||"*"===y.modifier){var x="*"===y.modifier?"?":"";m+="(?:".concat(_,"((?:").concat(y.pattern,")(?:").concat(w).concat(_,"(?:").concat(y.pattern,"))*)").concat(w,")").concat(x)}else m+="(?:".concat(_,"(").concat(y.pattern,")").concat(w,")").concat(y.modifier);else"+"===y.modifier||"*"===y.modifier?m+="((?:".concat(y.pattern,")").concat(y.modifier,")"):m+="(".concat(y.pattern,")").concat(y.modifier);else m+="(?:".concat(_).concat(w,")").concat(y.modifier)}}if(l)r||(m+="".concat(f,"?")),m+=i.endsWith?"(?=".concat(g,")"):"$";else{var k=t[t.length-1],A="string"==typeof k?f.indexOf(k[k.length-1])>-1:void 0===k;r||(m+="(?:".concat(f,"(?=").concat(g,"))?")),A||(m+="(?=".concat(f,"|").concat(g,")"))}return new RegExp(m,_n(i))}function Sn(t,e,i){return t instanceof RegExp?wn(t,e):Array.isArray(t)?xn(t,e,i):kn(t,e,i)}function zn(...t){t[0]="%c<registry>%c "+t[0],t.splice(1,0,"font-weight: bold; color: #99FF33;","color: inherit; font-weight: normal"),console.log.apply(null,t)}customElements.define("pb-highlight",pn);class Cn{constructor(){this.rootPath="",this.usePath=!1,this.state={},this.channelStates={},this.hash=null,this.idHash=!0,this._listeners=[],this.urlPattern=null,this.urlIgnore=new Set,this.pathParams=new Set}configure(t=!0,e=!1,i="",n,r){if(this.rootPath=i,this.usePath=t,this.idHash=e,this.urlPattern=n,r&&r.split(/\s*,\s*/).forEach(t=>this.urlIgnore.add(t)),this.urlPattern){const t=[];Sn(this.urlPattern,t),t.forEach(t=>this.pathParams.add(t.name)),this._decodePath=vn(this.urlPattern),this._encodePath=fn(this.urlPattern)}const o=this._stateFromURL();o?this.state=o:console.error("<registry> failed to parse URL: %s using template %s",window.location,this.urlTemplate),window.history.replaceState(null,""),window.addEventListener("popstate",t=>{if(t.state){try{this.channelStates=JSON.parse(t.state)}catch(t){return void console.error("<registry> error restoring state: %s",t.toString())}this.state=this._stateFromURL(),zn("popstate: %o",this.channelStates),this._listeners.forEach(t=>{t.callback(this.getState(t.component))}),lt.emit("pb-popstate",null,this.channelStates)}})}subscribe(t,e){this._listeners.push({component:t,callback:e})}_stateFromURL(){const t={};this.hash=window.location.hash,this.idHash&&this.hash.length>0&&!/^#\d+\./.test(this.hash)&&(t.id=this.hash.substring(1));const e=window.location.pathname.replace(new RegExp(`^${this.rootPath}/?`),"");if(this.urlPattern){const i=this._decodePath(e);Object.assign(t,i.params),zn("decoded path %s using template %s: %o",e,this.urlPattern,t)}else this.usePath&&(t.path=e);const i=new URLSearchParams(window.location.search);return i.forEach((e,n)=>{if(this.urlPattern&&this.pathParams.has(n)||this.usePath&&"path"===n)return void console.warn("Found path parameter in query, but usePath is set to true. The path parameter will be ignored.");if(n in t)return;const r=i.getAll(n);1===r.length?t[n]=e:t[n]=r}),t}getState(t){const e=F(t)[0],i=this.channelStates[e];return i||(this.channelStates[e]={},this.channelStates[e])}setState(t,e){const i=F(t)[0];this.channelStates[i]=Object.assign(this.channelStates[i],e)}clearParametersMatching(t,e){const{state:i}=this;for(const t of Object.keys(i))e.test(t)&&(i[t]=null)}get(t,e){if(!this.state)return;return t.split(".").reduce((t,e)=>{if(t[e])return t[e]},this.state)||e}set(t,e){if(!t.contains("."))return void(this.state[t]=e);const i=t.split("."),n=i.pop();i.reduce((t,e)=>(t[e]||(t[e]={}),t[e]),this.state)[n]=e}commit(t,e,i=!1){this._commit(t,e,i,!1)}replace(t,e,i=!1){this._commit(t,e,i,!0)}_commit(t,e,i,n){this.state=i?e:Object.assign(Object.assign({},this.state),e);const r=this.urlFromState();F(t).forEach(t=>{i||!this.channelStates[t]?this.channelStates[t]=e:Object.assign(this.channelStates[t],e)});const o=this.toJSON();n?(window.history.replaceState(o,"",r),zn("replace %s: %o %d",r.toString(),this.channelStates,window.history.length)):(window.history.pushState(o,"",r),zn("commit %s: %o %d",r.toString(),this.channelStates,window.history.length))}urlFromState(){const t=new URL(window.location.href);function e(e,i){if(null===e)t.searchParams.delete(i);else if(Array.isArray(e)){const n=Array.from(e);t.searchParams.set(i,n.pop()),n.forEach(e=>t.searchParams.append(i,e))}else t.searchParams.set(i,e)}for(const[t,i]of Object.entries(this.state))if(this.urlPattern){const n=t.replace(/^(?:user\.)?(.*)$/,"$1");this.pathParams.has(n)||this.urlIgnore.has(n)||e(i,n)}else"path"===t&&this.usePath||"id"===t&&this.idHash||this.urlIgnore.has(t)||e(i,t);if(this.state.path&&this.state.path.length>0)if(this.urlPattern){const e={};for(const[t,i]of Object.entries(this.state))this.pathParams.has(t)&&""===i?e[t]=null:e[t]=i;const i=this._encodePath(e);t.pathname=`${this.rootPath}/${i}`}else this.usePath&&(t.pathname=`${this.rootPath}/${this.state.path}`);return this.state.id&&!this.urlPattern&&(t.hash="#"+this.state.id),t}toJSON(){return JSON.stringify(this.channelStates)}}const En=new Cn;window.pbRegistry||(window.pbRegistry=En);class Tn extends(D(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},xpath:{type:String,reflect:!0},path:{type:String},odd:{type:String},view:{type:String},params:{type:Object},history:{type:Boolean}})}constructor(){super(),this.history=!0,this.params=null}connectedCallback(){super.connectedCallback(),this._id=this.nodeId,this.subscribeTo("pb-visible",t=>{if(this.nodeId){const[e,i]=t.detail.data.split(/\s*,\s*/);this.nodeId!==e||this.hash&&this.hash!==i?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 I`<a href="#" @click="${this._onClick}">${K(this._content)}</a>`}createRenderRoot(){return this}_onClick(t){t.preventDefault();const e={id:null,root:null};this.xmlId?e.id=this.xmlId:this.nodeId&&(e.root=this.nodeId),this.path&&(e.path=this.path),this.odd&&(e.odd=this.odd),this.hash&&(e.hash=this.hash),this.view&&(e.view=this.view),this.xpath&&(e.xpath=this.xpath),this.params&&Object.assign(e,this.params),this.history&&En.commit(this,e),this.emitTo("pb-refresh",e)}}customElements.define("pb-link",Tn);class Ln extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{facs:{type:String},coordinates:{type:Array},label:{type:String},order:{type:Number},trigger:{type:String},emitOnLoad:{type:Boolean,attribute:"emit-on-load"}})}constructor(){super(),this.trigger="mouseover",this.label="",this.order=Number.POSITIVE_INFINITY,this.waitFor="pb-facsimile,pb-image-strip,pb-tify",this.default=""}connectedCallback(){super.connectedCallback(),this.wait(()=>{this.emitTo("pb-load-facsimile",{url:this.getImage(),order:this.getOrder(),element:this})})}getImage(){return this.facs}getLabel(){return this.label}getOrder(){return this.order}firstUpdated(){this.shadowRoot.querySelector("a").addEventListener(this.trigger,this._linkListener.bind(this)),this.emitOnLoad&&this._trigger()}render(){return I`<a href="javascript:;"><slot>${this.default}</slot></a>`}static get styles(){return R`
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")}}function un(t){for(var e=[],i=0;i<t.length;){var n=t[i];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)e.push({type:"CHAR",index:i,value:t[i++]});else{var r=1,o="";if("?"===t[a=i+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<t.length;)if("\\"!==t[a]){if(")"===t[a]){if(0===--r){a++;break}}else if("("===t[a]&&(r++,"?"!==t[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));o+=t[a++]}else o+=t[a++]+t[a++];if(r)throw new TypeError("Unbalanced pattern at ".concat(i));if(!o)throw new TypeError("Missing pattern at ".concat(i));e.push({type:"PATTERN",index:i,value:o}),i=a}else{for(var s="",a=i+1;a<t.length;){var l=t.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=t[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(i));e.push({type:"NAME",index:i,value:s}),i=a}else e.push({type:"CLOSE",index:i,value:t[i++]});else e.push({type:"OPEN",index:i,value:t[i++]});else e.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});else e.push({type:"MODIFIER",index:i,value:t[i++]})}return e.push({type:"END",index:i,value:""}),e}function gn(t,e){void 0===e&&(e={});for(var i=un(t),n=e.prefixes,r=void 0===n?"./":n,o="[^".concat(yn(e.delimiter||"/#?"),"]+?"),s=[],a=0,l=0,c="",h=function(t){if(l<i.length&&i[l].type===t)return i[l++].value},d=function(t){var e=h(t);if(void 0!==e)return e;var n=i[l],r=n.type,o=n.index;throw new TypeError("Unexpected ".concat(r," at ").concat(o,", expected ").concat(t))},p=function(){for(var t,e="";t=h("CHAR")||h("ESCAPED_CHAR");)e+=t;return e};l<i.length;){var u=h("CHAR"),g=h("NAME"),f=h("PATTERN");if(g||f){var m=u||"";-1===r.indexOf(m)&&(c+=m,m=""),c&&(s.push(c),c=""),s.push({name:g||a++,prefix:m,suffix:"",pattern:f||o,modifier:h("MODIFIER")||""})}else{var v=u||h("ESCAPED_CHAR");if(v)c+=v;else if(c&&(s.push(c),c=""),h("OPEN")){m=p();var b=h("NAME")||"",y=h("PATTERN")||"",_=p();d("CLOSE"),s.push({name:b||(y?a++:""),pattern:b&&!y?o:y,prefix:m,suffix:_,modifier:h("MODIFIER")||""})}else d("END")}}return s}function fn(t,e){return mn(gn(t,e),e)}function mn(t,e){void 0===e&&(e={});var i=_n(e),n=e.encode,r=void 0===n?function(t){return t}:n,o=e.validate,s=void 0===o||o,a=t.map((function(t){if("object"==typeof t)return new RegExp("^(?:".concat(t.pattern,")$"),i)}));return function(e){for(var i="",n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o){var l=e?e[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,h="*"===o.modifier||"+"===o.modifier;if(Array.isArray(l)){if(!h)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===l.length){if(c)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var d=0;d<l.length;d++){var p=r(l[d],o);if(s&&!a[n].test(p))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));i+=o.prefix+p+o.suffix}}else if("string"!=typeof l&&"number"!=typeof l){if(!c){var u=h?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(u))}}else{p=r(String(l),o);if(s&&!a[n].test(p))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));i+=o.prefix+p+o.suffix}}else i+=o}return i}}function vn(t,e){var i=[];return bn(Sn(t,i,e),i,e)}function bn(t,e,i){void 0===i&&(i={});var n=i.decode,r=void 0===n?function(t){return t}:n;return function(i){var n=t.exec(i);if(!n)return!1;for(var o=n[0],s=n.index,a=Object.create(null),l=function(t){if(void 0===n[t])return"continue";var i=e[t-1];"*"===i.modifier||"+"===i.modifier?a[i.name]=n[t].split(i.prefix+i.suffix).map((function(t){return r(t,i)})):a[i.name]=r(n[t],i)},c=1;c<n.length;c++)l(c);return{path:o,index:s,params:a}}}function yn(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _n(t){return t&&t.sensitive?"":"i"}function wn(t,e){if(!e)return t;for(var i=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,r=i.exec(t.source);r;)e.push({name:r[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),r=i.exec(t.source);return t}function xn(t,e,i){var n=t.map((function(t){return Sn(t,e,i).source}));return new RegExp("(?:".concat(n.join("|"),")"),_n(i))}function kn(t,e,i){return An(gn(t,i),e,i)}function An(t,e,i){void 0===i&&(i={});for(var n=i.strict,r=void 0!==n&&n,o=i.start,s=void 0===o||o,a=i.end,l=void 0===a||a,c=i.encode,h=void 0===c?function(t){return t}:c,d=i.delimiter,p=void 0===d?"/#?":d,u=i.endsWith,g="[".concat(yn(void 0===u?"":u),"]|$"),f="[".concat(yn(p),"]"),m=s?"^":"",v=0,b=t;v<b.length;v++){var y=b[v];if("string"==typeof y)m+=yn(h(y));else{var _=yn(h(y.prefix)),w=yn(h(y.suffix));if(y.pattern)if(e&&e.push(y),_||w)if("+"===y.modifier||"*"===y.modifier){var x="*"===y.modifier?"?":"";m+="(?:".concat(_,"((?:").concat(y.pattern,")(?:").concat(w).concat(_,"(?:").concat(y.pattern,"))*)").concat(w,")").concat(x)}else m+="(?:".concat(_,"(").concat(y.pattern,")").concat(w,")").concat(y.modifier);else"+"===y.modifier||"*"===y.modifier?m+="((?:".concat(y.pattern,")").concat(y.modifier,")"):m+="(".concat(y.pattern,")").concat(y.modifier);else m+="(?:".concat(_).concat(w,")").concat(y.modifier)}}if(l)r||(m+="".concat(f,"?")),m+=i.endsWith?"(?=".concat(g,")"):"$";else{var k=t[t.length-1],A="string"==typeof k?f.indexOf(k[k.length-1])>-1:void 0===k;r||(m+="(?:".concat(f,"(?=").concat(g,"))?")),A||(m+="(?=".concat(f,"|").concat(g,")"))}return new RegExp(m,_n(i))}function Sn(t,e,i){return t instanceof RegExp?wn(t,e):Array.isArray(t)?xn(t,e,i):kn(t,e,i)}function zn(...t){t[0]="%c<registry>%c "+t[0],t.splice(1,0,"font-weight: bold; color: #99FF33;","color: inherit; font-weight: normal"),console.log.apply(null,t)}customElements.define("pb-highlight",pn);class Cn{constructor(){this.rootPath="",this.usePath=!1,this.state={},this.channelStates={},this.hash=null,this.idHash=!0,this._listeners=[],this.urlPattern=null,this.urlIgnore=new Set,this.pathParams=new Set,this.currentUser=null}configure(t=!0,e=!1,i="",n,r){if(this.rootPath=i,this.usePath=t,this.idHash=e,this.urlPattern=n,r&&r.split(/\s*,\s*/).forEach(t=>this.urlIgnore.add(t)),this.urlPattern){const t=[];Sn(this.urlPattern,t),t.forEach(t=>this.pathParams.add(t.name)),this._decodePath=vn(this.urlPattern),this._encodePath=fn(this.urlPattern)}const o=this._stateFromURL();o?this.state=o:console.error("<registry> failed to parse URL: %s using template %s",window.location,this.urlTemplate),window.history.replaceState(null,""),window.addEventListener("popstate",t=>{if(t.state){try{this.channelStates=JSON.parse(t.state)}catch(t){return void console.error("<registry> error restoring state: %s",t.toString())}this.state=this._stateFromURL(),zn("popstate: %o",this.channelStates),this._listeners.forEach(t=>{t.callback(this.getState(t.component))}),lt.emit("pb-popstate",null,this.channelStates)}})}subscribe(t,e){this._listeners.push({component:t,callback:e})}_stateFromURL(){const t={};this.hash=window.location.hash,this.idHash&&this.hash.length>0&&!/^#\d+\./.test(this.hash)&&(t.id=this.hash.substring(1));const e=window.location.pathname.replace(new RegExp(`^${this.rootPath}/?`),"");if(this.urlPattern){const i=this._decodePath(e);Object.assign(t,i.params),zn("decoded path %s using template %s: %o",e,this.urlPattern,t)}else this.usePath&&(t.path=e);const i=new URLSearchParams(window.location.search);return i.forEach((e,n)=>{if(this.urlPattern&&this.pathParams.has(n)||this.usePath&&"path"===n)return void console.warn("Found path parameter in query, but usePath is set to true. The path parameter will be ignored.");if(n in t)return;const r=i.getAll(n);1===r.length?t[n]=e:t[n]=r}),t}getState(t){const e=F(t)[0],i=this.channelStates[e];return i||(this.channelStates[e]={},this.channelStates[e])}setState(t,e){const i=F(t)[0];this.channelStates[i]=Object.assign(this.channelStates[i],e)}clearParametersMatching(t,e){const{state:i}=this;for(const t of Object.keys(i))e.test(t)&&(i[t]=null)}get(t,e){if(!this.state)return;return t.split(".").reduce((t,e)=>{if(t[e])return t[e]},this.state)||e}set(t,e){if(!t.contains("."))return void(this.state[t]=e);const i=t.split("."),n=i.pop();i.reduce((t,e)=>(t[e]||(t[e]={}),t[e]),this.state)[n]=e}commit(t,e,i=!1){this._commit(t,e,i,!1)}replace(t,e,i=!1){this._commit(t,e,i,!0)}_commit(t,e,i,n){this.state=i?e:Object.assign(Object.assign({},this.state),e);const r=this.urlFromState();F(t).forEach(t=>{i||!this.channelStates[t]?this.channelStates[t]=e:Object.assign(this.channelStates[t],e)});const o=this.toJSON();n?(window.history.replaceState(o,"",r),zn("replace %s: %o %d",r.toString(),this.channelStates,window.history.length)):(window.history.pushState(o,"",r),zn("commit %s: %o %d",r.toString(),this.channelStates,window.history.length))}urlFromState(){const t=new URL(window.location.href);function e(e,i){if(null===e)t.searchParams.delete(i);else if(Array.isArray(e)){const n=Array.from(e);t.searchParams.set(i,n.pop()),n.forEach(e=>t.searchParams.append(i,e))}else t.searchParams.set(i,e)}for(const[t,i]of Object.entries(this.state))if(this.urlPattern){const n=t.replace(/^(?:user\.)?(.*)$/,"$1");this.pathParams.has(n)||this.urlIgnore.has(n)||e(i,n)}else"path"===t&&this.usePath||"id"===t&&this.idHash||this.urlIgnore.has(t)||e(i,t);if(this.state.path&&this.state.path.length>0)if(this.urlPattern){const e={};for(const[t,i]of Object.entries(this.state))this.pathParams.has(t)&&""===i?e[t]=null:e[t]=i;const i=this._encodePath(e);t.pathname=`${this.rootPath}/${i}`}else this.usePath&&(t.pathname=`${this.rootPath}/${this.state.path}`);return this.state.id&&!this.urlPattern&&(t.hash="#"+this.state.id),t}toJSON(){return JSON.stringify(this.channelStates)}}const En=new Cn;window.pbRegistry||(window.pbRegistry=En);class Tn extends(D(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},xpath:{type:String,reflect:!0},path:{type:String},odd:{type:String},view:{type:String},params:{type:Object},history:{type:Boolean}})}constructor(){super(),this.history=!0,this.params=null}connectedCallback(){super.connectedCallback(),this._id=this.nodeId,this.subscribeTo("pb-visible",t=>{if(this.nodeId){const[e,i]=t.detail.data.split(/\s*,\s*/);this.nodeId!==e||this.hash&&this.hash!==i?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 I`<a href="#" @click="${this._onClick}">${K(this._content)}</a>`}createRenderRoot(){return this}_onClick(t){t.preventDefault();const e={id:null,root:null};this.xmlId?e.id=this.xmlId:this.nodeId&&(e.root=this.nodeId),this.path&&(e.path=this.path),this.odd&&(e.odd=this.odd),this.hash&&(e.hash=this.hash),this.view&&(e.view=this.view),this.xpath&&(e.xpath=this.xpath),this.params&&Object.assign(e,this.params),this.history&&En.commit(this,e),this.emitTo("pb-refresh",e)}}customElements.define("pb-link",Tn);class Ln extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{facs:{type:String},coordinates:{type:Array},label:{type:String},order:{type:Number},trigger:{type:String},emitOnLoad:{type:Boolean,attribute:"emit-on-load"}})}constructor(){super(),this.trigger="mouseover",this.label="",this.order=Number.POSITIVE_INFINITY,this.waitFor="pb-facsimile,pb-image-strip,pb-tify",this.default=""}connectedCallback(){super.connectedCallback(),this.wait(()=>{this.emitTo("pb-load-facsimile",{url:this.getImage(),order:this.getOrder(),element:this})})}getImage(){return this.facs}getLabel(){return this.label}getOrder(){return this.order}firstUpdated(){this.shadowRoot.querySelector("a").addEventListener(this.trigger,this._linkListener.bind(this)),this.emitOnLoad&&this._trigger()}render(){return I`<a href="javascript:;"><slot>${this.default}</slot></a>`}static get styles(){return R`
559
559
  :host {
560
560
  }
561
561
 
@@ -1441,7 +1441,7 @@ function(t){var e;if("function"==typeof define&&define.amd&&(define(t),e=!0),"ob
1441
1441
  #message {
1442
1442
  color: var(--paper-red-800);
1443
1443
  }
1444
- `}_show(t){t.preventDefault(),this.loggedIn?(this._checkLogin.body={logout:this.user},this._checkLogin.generateRequest()):this._loginDialog.open()}_confirmLogin(){this.user=this.shadowRoot.getElementById("user").value,this.password=this.shadowRoot.getElementById("password").value,this._checkLogin.body={user:this.user,password:this.password},this._checkLogin.generateRequest()}_handleResponse(){const t=this._checkLogin.lastResponse;t.user&&this._checkGroup(t)?(t.userChanged=!this.loggedIn||this.user!==t.user,this.loggedIn=!0,this.user=t.user,this.groups=t.groups,this._invalid=!1,this._loginDialog.close()):(t.userChanged=this.loggedIn,this.loggedIn=!1,this.password=null,this._loginDialog.opened?this._invalid=!0:this.auto&&this._loginDialog.open()),this.emitTo("pb-login",t)}_handleError(){this.loggedIn=!1,this.password=null;const t={userChanged:this.loggedIn,user:null};this._loginDialog.opened?this._invalid=!0:this.auto&&this._loginDialog.open(),this.emitTo("pb-login",t)}_isItemInArray(t,e){return t.some(t=>e===t)}_checkGroup(t){if(this.group){let e=this.group.split(/[\s+,]+/),i=!1;return t.groups&&e.forEach(async e=>{i=this._isItemInArray(t.groups,e)||i}),i}return!0}}customElements.define("pb-login",Ia);class Ra extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{url:{type:String},title:{type:String},method:{type:String},event:{type:String},confirm:{type:String},quiet:{type:Boolean},_message:{type:String}})}constructor(){super(),this.method="get",this.confirm=null,this.quiet=!1}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-update",this._onUpdate.bind(this))}render(){return I`
1444
+ `}_show(t){t.preventDefault(),this.loggedIn?(this._checkLogin.body={logout:this.user},this._checkLogin.generateRequest()):this._loginDialog.open()}_confirmLogin(){this.user=this.shadowRoot.getElementById("user").value,this.password=this.shadowRoot.getElementById("password").value,this._checkLogin.body={user:this.user,password:this.password},this._checkLogin.generateRequest()}_handleResponse(){const t=this._checkLogin.lastResponse;t.user&&this._checkGroup(t)?(t.userChanged=!this.loggedIn||this.user!==t.user,this.loggedIn=!0,this.user=t.user,this.groups=t.groups,this._invalid=!1,this._loginDialog.close()):(t.userChanged=this.loggedIn,this.loggedIn=!1,this.password=null,this._loginDialog.opened?this._invalid=!0:this.auto&&this._loginDialog.open()),this.emitTo("pb-login",t),this.loggedIn?En.currentUser={user:this.user,groups:this.groups}:En.currentUser=null}_handleError(){this.loggedIn=!1,this.password=null;const t={userChanged:this.loggedIn,user:null};this._loginDialog.opened?this._invalid=!0:this.auto&&this._loginDialog.open(),En.currentUser=null,this.emitTo("pb-login",t)}_isItemInArray(t,e){return t.some(t=>e===t)}_checkGroup(t){if(this.group){let e=this.group.split(/[\s+,]+/),i=!1;return t.groups&&e.forEach(async e=>{i=this._isItemInArray(t.groups,e)||i}),i}return!0}}customElements.define("pb-login",Ia);class Ra extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{url:{type:String},title:{type:String},method:{type:String},event:{type:String},confirm:{type:String},quiet:{type:Boolean},_message:{type:String}})}constructor(){super(),this.method="get",this.confirm=null,this.quiet=!1}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-update",this._onUpdate.bind(this))}render(){return I`
1445
1445
  <a id="button" @click="${this._handleClick}" title="${this.title}"><slot></slot></a>
1446
1446
  <iron-ajax
1447
1447
  id="loadContent"
@@ -2294,7 +2294,7 @@ e({_template:n`
2294
2294
  :host {
2295
2295
  display: block;
2296
2296
  }
2297
- `}_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",qa);class Ua extends(D(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 I`
2297
+ `}_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)}}function Ua(t,e){return t.some(t=>e===t)}function Wa(t,e,i){if(null==t)return!1;if(i){if(!e)return!1;const t=i.split(/[\s+,]+/);let n=!1;return t.forEach(async t=>{n=Ua(e,t)||n}),n}return!0}customElements.define("pb-grid-action",qa);class Ya extends(D(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")),this.subscribeTo("pb-login",t=>{this.show=this._loggedIn(t.detail.user,t.detail.groups)},[]),this.show=En.currentUser&&this._loggedIn(En.currentUser.user,En.currentUser.groups)}render(){return I`
2298
2298
  ${this.show&&!this.disabled?I`<slot></slot>`:I`<slot name="fallback"></slot>`}
2299
2299
  `}static get styles(){return R`
2300
2300
  :host {
@@ -2302,9 +2302,9 @@ e({_template:n`
2302
2302
  }
2303
2303
 
2304
2304
  :host(.fallback), :host([show]) {
2305
- display: block;
2305
+ display: inherit;
2306
2306
  }
2307
- `}_isItemInArray(t,e){return t.some(t=>e===t)}_loggedIn(t,e){if(null==t)return!1;if(this.group){if(!e)return!1;let t=this.group.split(/[\s+,]+/),i=!1;return t.forEach(async t=>{i=this._isItemInArray(e,t)||i}),i}return!0}}customElements.define("pb-restricted",Ua);class Wa extends(D(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-refresh-odds",t=>{this._refresh();const e=this.shadowRoot.getElementById("regenerate"),i=t.detail.odds.map(t=>"odd="+t).join("&");this.minApiVersion("1.0.0")?e.url="api/odd?"+i:e.url="modules/lib/regenerate.xql?"+i,e.trigger()})}firstUpdated(){super.firstUpdated(),this._loader=this.shadowRoot.getElementById("load"),B("pb-page-ready",t=>{j(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,this.requestUpdate()}_selectODD(t){const e=t.model.itemsIndex;this.odds.forEach((t,i)=>{i!==e&&t.current&&(this.set("odds."+i+".current",!1),this.set("odds."+e+".current",!0))});const i={odd:t.model.item.name+".odd"};console.log("<pb-manage-odds> selected ODD: %o",i),this.emitTo("pb-load",{params:i})}_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 i=this.shadowRoot.getElementById("create");i.url=`${this.getEndpoint()}/api/odd/${t}`,i.params={title:e},this.emitTo("pb-start-update"),i.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 i=e.getSelected();document.querySelectorAll(".document-select paper-checkbox[checked]").forEach(t=>{i.push(t.value)}),console.log("<pb-manage-odds> create ODD by example: %o",i),t.byExample=i,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 I`
2307
+ `}_loggedIn(t,e){return Wa(t,e,this.group)}}customElements.define("pb-restricted",Ya);class Ga extends(D(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-refresh-odds",t=>{this._refresh();const e=this.shadowRoot.getElementById("regenerate"),i=t.detail.odds.map(t=>"odd="+t).join("&");this.minApiVersion("1.0.0")?e.url="api/odd?"+i:e.url="modules/lib/regenerate.xql?"+i,e.trigger()})}firstUpdated(){super.firstUpdated(),this._loader=this.shadowRoot.getElementById("load"),B("pb-page-ready",t=>{j(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,this.requestUpdate()}_selectODD(t){const e=t.model.itemsIndex;this.odds.forEach((t,i)=>{i!==e&&t.current&&(this.set("odds."+i+".current",!1),this.set("odds."+e+".current",!0))});const i={odd:t.model.item.name+".odd"};console.log("<pb-manage-odds> selected ODD: %o",i),this.emitTo("pb-load",{params:i})}_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 i=this.shadowRoot.getElementById("create");i.url=`${this.getEndpoint()}/api/odd/${t}`,i.params={title:e},this.emitTo("pb-start-update"),i.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 i=e.getSelected();document.querySelectorAll(".document-select paper-checkbox[checked]").forEach(t=>{i.push(t.value)}),console.log("<pb-manage-odds> create ODD by example: %o",i),t.byExample=i,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 I`
2308
2308
  <pb-restricted login="login">
2309
2309
  <pb-ajax id="regenerateAll" url="${t}" method="post" title="${W("odd.manage.regenerate-all")}"
2310
2310
  emit="${this.emit?this.emit:""}" .emitConfig="${this.emitConfig}">
@@ -2451,7 +2451,7 @@ e({_template:n`
2451
2451
  transition: opacity 0.6s;
2452
2452
  }
2453
2453
  } */
2454
- `}}customElements.get("pb-manage-odds")||customElements.define("pb-manage-odds",Wa);const Ya=document.createElement("template");Ya.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(Ya.content);const Ga=n`<dom-module id="lumo-button" theme-for="vaadin-button">
2454
+ `}}customElements.get("pb-manage-odds")||customElements.define("pb-manage-odds",Ga);const Ka=document.createElement("template");Ka.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(Ka.content);const Xa=n`<dom-module id="lumo-button" theme-for="vaadin-button">
2455
2455
  <template>
2456
2456
  <style>
2457
2457
  :host {
@@ -2734,18 +2734,18 @@ e({_template:n`
2734
2734
  }
2735
2735
  </style>
2736
2736
  </template>
2737
- </dom-module>`;document.head.appendChild(Ga.content);
2737
+ </dom-module>`;document.head.appendChild(Xa.content);
2738
2738
  /**
2739
2739
  @license
2740
2740
  Copyright (c) 2017 Vaadin Ltd.
2741
2741
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
2742
2742
  */
2743
- let Ka=!1;window.addEventListener("keydown",()=>{Ka=!0},{capture:!0}),window.addEventListener("mousedown",()=>{Ka=!1},{capture:!0});const Xa=t=>class extends t{static get properties(){var t={tabindex:{type:Number,value:0,reflectToAttribute:!0,observer:"_tabindexChanged"}};return window.ShadyDOM&&(t.tabIndex=t.tabindex),t}},Za=t=>class extends(Xa(t)){static get properties(){return{autofocus:{type:Boolean},_previousTabIndex:{type:Number},disabled:{type:Boolean,observer:"_disabledChanged",reflectToAttribute:!0},_isShiftTabbing:{type:Boolean}}}get _keyboardActive(){return Ka}ready(){this.addEventListener("focusin",t=>{t.composedPath()[0]===this?this.contains(t.relatedTarget)||this._focus():-1===t.composedPath().indexOf(this.focusElement)||this.disabled||this._setFocused(!0)}),this.addEventListener("focusout",t=>this._setFocused(!1)),super.ready();const t=t=>{t.composed||t.target.dispatchEvent(new CustomEvent(t.type,{bubbles:!0,composed:!0,cancelable:!1}))};this.shadowRoot.addEventListener("focusin",t),this.shadowRoot.addEventListener("focusout",t),this.addEventListener("keydown",t=>{if(!t.defaultPrevented&&9===t.keyCode)if(t.shiftKey)this._isShiftTabbing=!0,HTMLElement.prototype.focus.apply(this),this._setFocused(!1),setTimeout(()=>this._isShiftTabbing=!1,0);else{const t=window.navigator.userAgent.match(/Firefox\/(\d\d\.\d)/);if(t&&parseFloat(t[1])>=63&&parseFloat(t[1])<66&&this.parentNode&&this.nextSibling){const t=document.createElement("input");t.style.position="absolute",t.style.opacity="0",t.tabIndex=this.tabIndex,this.parentNode.insertBefore(t,this.nextSibling),t.focus(),t.addEventListener("focusout",()=>this.parentNode.removeChild(t))}}}),this.autofocus&&!this.disabled&&window.requestAnimationFrame(()=>{this._focus(),this._setFocused(!0),this.setAttribute("focus-ring","")})}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){t?this.setAttribute("focused",""):this.removeAttribute("focused"),t&&Ka?this.setAttribute("focus-ring",""):this.removeAttribute("focus-ring")}get focusElement(){return window.console.warn(`Please implement the 'focusElement' property in <${this.localName}>`),this}_focus(){this.focusElement&&!this._isShiftTabbing&&(this.focusElement.focus(),this._setFocused(!0))}focus(){this.focusElement&&!this.disabled&&(this.focusElement.focus(),this._setFocused(!0))}blur(){this.focusElement&&(this.focusElement.blur(),this._setFocused(!1))}_disabledChanged(t){this.focusElement.disabled=t,t?(this.blur(),this._previousTabIndex=this.tabindex,this.tabindex=-1,this.setAttribute("aria-disabled","true")):(void 0!==this._previousTabIndex&&(this.tabindex=this._previousTabIndex),this.removeAttribute("aria-disabled"))}_tabindexChanged(t){void 0!==t&&(this.focusElement.tabIndex=t),this.disabled&&this.tabindex&&(-1!==this.tabindex&&(this._previousTabIndex=this.tabindex),this.tabindex=t=void 0),window.ShadyDOM&&this.setProperties({tabIndex:t,tabindex:t})}click(){this.disabled||super.click()}}
2743
+ let Za=!1;window.addEventListener("keydown",()=>{Za=!0},{capture:!0}),window.addEventListener("mousedown",()=>{Za=!1},{capture:!0});const Qa=t=>class extends t{static get properties(){var t={tabindex:{type:Number,value:0,reflectToAttribute:!0,observer:"_tabindexChanged"}};return window.ShadyDOM&&(t.tabIndex=t.tabindex),t}},Ja=t=>class extends(Qa(t)){static get properties(){return{autofocus:{type:Boolean},_previousTabIndex:{type:Number},disabled:{type:Boolean,observer:"_disabledChanged",reflectToAttribute:!0},_isShiftTabbing:{type:Boolean}}}get _keyboardActive(){return Za}ready(){this.addEventListener("focusin",t=>{t.composedPath()[0]===this?this.contains(t.relatedTarget)||this._focus():-1===t.composedPath().indexOf(this.focusElement)||this.disabled||this._setFocused(!0)}),this.addEventListener("focusout",t=>this._setFocused(!1)),super.ready();const t=t=>{t.composed||t.target.dispatchEvent(new CustomEvent(t.type,{bubbles:!0,composed:!0,cancelable:!1}))};this.shadowRoot.addEventListener("focusin",t),this.shadowRoot.addEventListener("focusout",t),this.addEventListener("keydown",t=>{if(!t.defaultPrevented&&9===t.keyCode)if(t.shiftKey)this._isShiftTabbing=!0,HTMLElement.prototype.focus.apply(this),this._setFocused(!1),setTimeout(()=>this._isShiftTabbing=!1,0);else{const t=window.navigator.userAgent.match(/Firefox\/(\d\d\.\d)/);if(t&&parseFloat(t[1])>=63&&parseFloat(t[1])<66&&this.parentNode&&this.nextSibling){const t=document.createElement("input");t.style.position="absolute",t.style.opacity="0",t.tabIndex=this.tabIndex,this.parentNode.insertBefore(t,this.nextSibling),t.focus(),t.addEventListener("focusout",()=>this.parentNode.removeChild(t))}}}),this.autofocus&&!this.disabled&&window.requestAnimationFrame(()=>{this._focus(),this._setFocused(!0),this.setAttribute("focus-ring","")})}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){t?this.setAttribute("focused",""):this.removeAttribute("focused"),t&&Za?this.setAttribute("focus-ring",""):this.removeAttribute("focus-ring")}get focusElement(){return window.console.warn(`Please implement the 'focusElement' property in <${this.localName}>`),this}_focus(){this.focusElement&&!this._isShiftTabbing&&(this.focusElement.focus(),this._setFocused(!0))}focus(){this.focusElement&&!this.disabled&&(this.focusElement.focus(),this._setFocused(!0))}blur(){this.focusElement&&(this.focusElement.blur(),this._setFocused(!1))}_disabledChanged(t){this.focusElement.disabled=t,t?(this.blur(),this._previousTabIndex=this.tabindex,this.tabindex=-1,this.setAttribute("aria-disabled","true")):(void 0!==this._previousTabIndex&&(this.tabindex=this._previousTabIndex),this.removeAttribute("aria-disabled"))}_tabindexChanged(t){void 0!==t&&(this.focusElement.tabIndex=t),this.disabled&&this.tabindex&&(-1!==this.tabindex&&(this._previousTabIndex=this.tabindex),this.tabindex=t=void 0),window.ShadyDOM&&this.setProperties({tabIndex:t,tabindex:t})}click(){this.disabled||super.click()}}
2744
2744
  /**
2745
2745
  @license
2746
2746
  Copyright (c) 2017 Vaadin Ltd.
2747
2747
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
2748
- */;class Qa extends(L(Za(M(d(p))))){static get template(){return n`
2748
+ */;class tl extends(L(Ja(M(d(p))))){static get template(){return n`
2749
2749
  <style>
2750
2750
  :host {
2751
2751
  display: inline-block;
@@ -2813,7 +2813,7 @@ This program is available under Apache License Version 2.0, available at https:/
2813
2813
  </div>
2814
2814
  </div>
2815
2815
  <button id="button" type="button"></button>
2816
- `}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(){u(this,"down",()=>!this.disabled&&this.setAttribute("active","")),u(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(Qa.is,Qa);const Ja=n`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
2816
+ `}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(){u(this,"down",()=>!this.disabled&&this.setAttribute("active","")),u(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(tl.is,tl);const el=n`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
2817
2817
  <template>
2818
2818
  <style>
2819
2819
  :host {
@@ -3016,18 +3016,18 @@ This program is available under Apache License Version 2.0, available at https:/
3016
3016
  100% { opacity: 1; }
3017
3017
  }
3018
3018
  </style>
3019
- </custom-style>`;document.head.appendChild(Ja.content);
3019
+ </custom-style>`;document.head.appendChild(el.content);
3020
3020
  /**
3021
3021
  @license
3022
3022
  Copyright (c) 2017 Vaadin Ltd.
3023
3023
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3024
3024
  */
3025
- const tl=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,i){const n=this._normalizeValue(t,e,i);this.style.setProperty("--vaadin-progress-value",n),this.updateStyles({"--vaadin-progress-value":String(n)})}_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,i){let n;return t||0==t?e>=i?n=1:(n=(t-e)/(i-e),n=Math.min(Math.max(n,0),1)):n=0,n}}
3025
+ const il=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,i){const n=this._normalizeValue(t,e,i);this.style.setProperty("--vaadin-progress-value",n),this.updateStyles({"--vaadin-progress-value":String(n)})}_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,i){let n;return t||0==t?e>=i?n=1:(n=(t-e)/(i-e),n=Math.min(Math.max(n,0),1)):n=0,n}}
3026
3026
  /**
3027
3027
  @license
3028
3028
  Copyright (c) 2017 Vaadin Ltd.
3029
3029
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3030
- */;class el extends(L(M(tl(p)))){static get template(){return n`
3030
+ */;class nl extends(L(M(il(p)))){static get template(){return n`
3031
3031
  <style>
3032
3032
  :host {
3033
3033
  display: block;
@@ -3059,7 +3059,7 @@ This program is available under Apache License Version 2.0, available at https:/
3059
3059
  <div part="bar">
3060
3060
  <div part="value"></div>
3061
3061
  </div>
3062
- `}static get is(){return"vaadin-progress-bar"}static get version(){return"1.3.0"}}customElements.define(el.is,el);const il=n`<dom-module id="lumo-upload" theme-for="vaadin-upload">
3062
+ `}static get is(){return"vaadin-progress-bar"}static get version(){return"1.3.0"}}customElements.define(nl.is,nl);const rl=n`<dom-module id="lumo-upload" theme-for="vaadin-upload">
3063
3063
  <template>
3064
3064
  <style>
3065
3065
  :host {
@@ -3232,13 +3232,13 @@ This program is available under Apache License Version 2.0, available at https:/
3232
3232
 
3233
3233
  </style>
3234
3234
  </template>
3235
- </dom-module>`;document.head.appendChild(il.content);const nl=document.createElement("template");nl.innerHTML="<custom-style>\n <style>\n @font-face {\n font-family: 'vaadin-upload-icons';\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAasAAsAAAAABmAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIF5mNtYXAAAAFoAAAAVAAAAFQXVtKMZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAfQAAAH0bBJxYWhlYWQAAAO4AAAANgAAADYPD267aGhlYQAAA/AAAAAkAAAAJAfCA8tobXR4AAAEFAAAACgAAAAoHgAAx2xvY2EAAAQ8AAAAFgAAABYCSgHsbWF4cAAABFQAAAAgAAAAIAAOADVuYW1lAAAEdAAAAhYAAAIWmmcHf3Bvc3QAAAaMAAAAIAAAACAAAwAAAAMDtwGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QUDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkF//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAgAA/8AEAAPAABkAMgAAEz4DMzIeAhczLgMjIg4CBycRIScFIRcOAyMiLgInIx4DMzI+AjcXphZGWmo6SH9kQwyADFiGrmJIhXJbIEYBAFoDWv76YBZGXGw8Rn5lRQyADFmIrWBIhHReIkYCWjJVPSIyVnVDXqN5RiVEYTxG/wBa2loyVT0iMlZ1Q16jeUYnRWE5RgAAAAABAIAAAAOAA4AAAgAAExEBgAMAA4D8gAHAAAAAAwAAAAAEAAOAAAIADgASAAAJASElIiY1NDYzMhYVFAYnETMRAgD+AAQA/gAdIyMdHSMjXYADgPyAgCMdHSMjHR0jwAEA/wAAAQANADMD5gNaAAUAACUBNwUBFwHT/jptATMBppMzAU2a4AIgdAAAAAEAOv/6A8YDhgALAAABJwkBBwkBFwkBNwEDxoz+xv7GjAFA/sCMAToBOoz+wAL6jP7AAUCM/sb+xowBQP7AjAE6AAAAAwAA/8AEAAPAAAcACwASAAABFSE1IREhEQEjNTMJAjMRIRECwP6A/sAEAP0AgIACQP7A/sDAAQABQICA/oABgP8AgAHAAUD+wP6AAYAAAAABAAAAAQAAdhiEdV8PPPUACwQAAAAAANX4FR8AAAAA1fgVHwAA/8AEAAPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAQAAAEAAAAAAAAAAAAAAAAAAAAKBAAAAAAAAAAAAAAAAgAAAAQAAAAEAACABAAAAAQAAA0EAAA6BAAAAAAAAAAACgAUAB4AagB4AJwAsADSAPoAAAABAAAACgAzAAMAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEAEwAAAAEAAAAAAAIABwDMAAEAAAAAAAMAEwBaAAEAAAAAAAQAEwDhAAEAAAAAAAUACwA5AAEAAAAAAAYAEwCTAAEAAAAAAAoAGgEaAAMAAQQJAAEAJgATAAMAAQQJAAIADgDTAAMAAQQJAAMAJgBtAAMAAQQJAAQAJgD0AAMAAQQJAAUAFgBEAAMAAQQJAAYAJgCmAAMAAQQJAAoANAE0dmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwdmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzdmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQBydmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n </style>\n</custom-style>",document.head.appendChild(nl.content);
3235
+ </dom-module>`;document.head.appendChild(rl.content);const ol=document.createElement("template");ol.innerHTML="<custom-style>\n <style>\n @font-face {\n font-family: 'vaadin-upload-icons';\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAasAAsAAAAABmAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIF5mNtYXAAAAFoAAAAVAAAAFQXVtKMZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAfQAAAH0bBJxYWhlYWQAAAO4AAAANgAAADYPD267aGhlYQAAA/AAAAAkAAAAJAfCA8tobXR4AAAEFAAAACgAAAAoHgAAx2xvY2EAAAQ8AAAAFgAAABYCSgHsbWF4cAAABFQAAAAgAAAAIAAOADVuYW1lAAAEdAAAAhYAAAIWmmcHf3Bvc3QAAAaMAAAAIAAAACAAAwAAAAMDtwGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QUDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkF//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAgAA/8AEAAPAABkAMgAAEz4DMzIeAhczLgMjIg4CBycRIScFIRcOAyMiLgInIx4DMzI+AjcXphZGWmo6SH9kQwyADFiGrmJIhXJbIEYBAFoDWv76YBZGXGw8Rn5lRQyADFmIrWBIhHReIkYCWjJVPSIyVnVDXqN5RiVEYTxG/wBa2loyVT0iMlZ1Q16jeUYnRWE5RgAAAAABAIAAAAOAA4AAAgAAExEBgAMAA4D8gAHAAAAAAwAAAAAEAAOAAAIADgASAAAJASElIiY1NDYzMhYVFAYnETMRAgD+AAQA/gAdIyMdHSMjXYADgPyAgCMdHSMjHR0jwAEA/wAAAQANADMD5gNaAAUAACUBNwUBFwHT/jptATMBppMzAU2a4AIgdAAAAAEAOv/6A8YDhgALAAABJwkBBwkBFwkBNwEDxoz+xv7GjAFA/sCMAToBOoz+wAL6jP7AAUCM/sb+xowBQP7AjAE6AAAAAwAA/8AEAAPAAAcACwASAAABFSE1IREhEQEjNTMJAjMRIRECwP6A/sAEAP0AgIACQP7A/sDAAQABQICA/oABgP8AgAHAAUD+wP6AAYAAAAABAAAAAQAAdhiEdV8PPPUACwQAAAAAANX4FR8AAAAA1fgVHwAA/8AEAAPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAQAAAEAAAAAAAAAAAAAAAAAAAAKBAAAAAAAAAAAAAAAAgAAAAQAAAAEAACABAAAAAQAAA0EAAA6BAAAAAAAAAAACgAUAB4AagB4AJwAsADSAPoAAAABAAAACgAzAAMAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEAEwAAAAEAAAAAAAIABwDMAAEAAAAAAAMAEwBaAAEAAAAAAAQAEwDhAAEAAAAAAAUACwA5AAEAAAAAAAYAEwCTAAEAAAAAAAoAGgEaAAMAAQQJAAEAJgATAAMAAQQJAAIADgDTAAMAAQQJAAMAJgBtAAMAAQQJAAQAJgD0AAMAAQQJAAUAFgBEAAMAAQQJAAYAJgCmAAMAAQQJAAoANAE0dmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwdmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzdmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQBydmFhZGluLXVwbG9hZC1pY29ucwB2AGEAYQBkAGkAbgAtAHUAcABsAG8AYQBkAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n </style>\n</custom-style>",document.head.appendChild(ol.content);
3236
3236
  /**
3237
3237
  @license
3238
3238
  Copyright (c) 2017 Vaadin Ltd.
3239
3239
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3240
3240
  */
3241
- class rl extends(M(p)){static get template(){return n`
3241
+ class sl extends(M(p)){static get template(){return n`
3242
3242
  <style>
3243
3243
  :host {
3244
3244
  display: block;
@@ -3269,13 +3269,13 @@ class rl extends(M(p)){static get template(){return n`
3269
3269
 
3270
3270
  <vaadin-progress-bar part="progress" id="progress" value\$="[[_formatProgressValue(file.progress)]]" error\$="[[file.error]]" indeterminate\$="[[file.indeterminate]]" uploading\$="[[file.uploading]]" complete\$="[[file.complete]]">
3271
3271
  </vaadin-progress-bar>
3272
- `}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 i=Boolean(t);this.hasAttribute(e)!==i&&(i?this.setAttribute(e,""):this.removeAttribute(e))}}customElements.define(rl.is,rl);
3272
+ `}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 i=Boolean(t);this.hasAttribute(e)!==i&&(i?this.setAttribute(e,""):this.removeAttribute(e))}}customElements.define(sl.is,sl);
3273
3273
  /**
3274
3274
  @license
3275
3275
  Copyright (c) 2017 Vaadin Ltd.
3276
3276
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3277
3277
  */
3278
- class ol extends(L(M(p))){static get template(){return n`
3278
+ class al extends(L(M(p))){static get template(){return n`
3279
3279
  <style>
3280
3280
  :host {
3281
3281
  display: block;
@@ -3317,7 +3317,7 @@ class ol extends(L(M(p))){static get template(){return n`
3317
3317
  </slot>
3318
3318
  <slot></slot>
3319
3319
  <input type="file" id="fileInput" on-change="_onFileInputChange" hidden="" accept\$="{{accept}}" multiple\$="[[_isMultiple(maxFiles)]]" capture\$="[[capture]]">
3320
- `}static get is(){return"vaadin-upload"}static get version(){return"4.4.3"}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,reflectToAttribute:!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,i=~~(Math.log(t)/Math.log(e)),n=Math.max(0,Math.min(3,i-1));return parseFloat((t/Math.pow(e,i)).toFixed(n))+" "+this.i18n.units.size[i]}_splitTimeByUnits(t){const e=[60,60,24,1/0],i=[0];for(var n=0;n<e.length&&t>0;n++)i[n]=t%e[n],t=Math.floor(t/e[n]);return i}_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,i,n){t.elapsed=n,t.elapsedStr=this._formatTime(t.elapsed,this._splitTimeByUnits(t.elapsed)),t.remaining=Math.ceil(n*(e/i-1)),t.remainingStr=this._formatTime(t.remaining,this._splitTimeByUnits(t.remaining)),t.speed=~~(e/n/1024),t.totalStr=this._formatSize(e),t.loadedStr=this._formatSize(i),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(),i=t.xhr=this._createXhr();let n,r;i.upload.onprogress=o=>{clearTimeout(n),r=Date.now();const s=(r-e)/1e3,a=o.loaded,l=o.total,c=~~(a/l*100);t.loaded=a,t.progress=c,t.indeterminate=a<=0||a>=l,t.error?t.indeterminate=t.status=void 0:t.abort||(c<100?(this._setStatus(t,l,a,s),n=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:i}}))},i.onreadystatechange=()=>{if(4==i.readyState){if(clearTimeout(n),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:i},cancelable:!0})))return;0===i.status?t.error=this.i18n.uploading.error.serverUnavailable:i.status>=500?t.error=this.i18n.uploading.error.unexpectedServerError:i.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:i}})),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:i},cancelable:!0})))return;o.append(t.formDataName,t,t.name),i.open(this.method,t.uploadTarget,!0),this._configureXhr(i),t.status=this.i18n.uploading.status.connecting,t.uploading=t.indeterminate=!0,t.complete=t.abort=t.error=t.held=!1,i.upload.onloadstart=()=>{this.dispatchEvent(new CustomEvent("upload-start",{detail:{file:t,xhr:i}})),this._notifyFileChanges(t)};this.dispatchEvent(new CustomEvent("upload-request",{detail:{file:t,xhr:i,formData:o},cancelable:!0}))&&i.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 i in t)t.hasOwnProperty(i)&&this.notifyPath(e+i,t[i])}_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],i=new RegExp("^("+this.accept.replace(/[, ]+/g,"|").replace(/\/\*/g,"/.*")+")$","i");!this.accept||i.test(t.type)||i.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(){g()}_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(ol.is,ol);class sl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{target:{type:String},accept:{type:String},_files:{type:Object},event:{type:String}})}constructor(){super(),this._files=new Map,this.event="pb-load"}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:i}=e.detail;this._files.set(i.name,i),this.requestUpdate(),this.minApiVersion("1.0.0")&&this.target&&(i.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 i=[];t.files.forEach(t=>{t.complete||t.error||t.aborted?/^.*\.odd$/.test(t.name)&&i.push(t.name):e=!1,this.requestUpdate()}),e&&(this.emitTo("pb-end-update"),this.emitTo(this.event),i.length>0&&this.emitTo("pb-refresh-odds",{odds:i}))}),B("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=H(this,"--pb-upload-button-icon","icons:file-upload"),e=H(this,"--pb-upload-drop-icon",null);return I`
3320
+ `}static get is(){return"vaadin-upload"}static get version(){return"4.4.3"}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,reflectToAttribute:!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,i=~~(Math.log(t)/Math.log(e)),n=Math.max(0,Math.min(3,i-1));return parseFloat((t/Math.pow(e,i)).toFixed(n))+" "+this.i18n.units.size[i]}_splitTimeByUnits(t){const e=[60,60,24,1/0],i=[0];for(var n=0;n<e.length&&t>0;n++)i[n]=t%e[n],t=Math.floor(t/e[n]);return i}_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,i,n){t.elapsed=n,t.elapsedStr=this._formatTime(t.elapsed,this._splitTimeByUnits(t.elapsed)),t.remaining=Math.ceil(n*(e/i-1)),t.remainingStr=this._formatTime(t.remaining,this._splitTimeByUnits(t.remaining)),t.speed=~~(e/n/1024),t.totalStr=this._formatSize(e),t.loadedStr=this._formatSize(i),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(),i=t.xhr=this._createXhr();let n,r;i.upload.onprogress=o=>{clearTimeout(n),r=Date.now();const s=(r-e)/1e3,a=o.loaded,l=o.total,c=~~(a/l*100);t.loaded=a,t.progress=c,t.indeterminate=a<=0||a>=l,t.error?t.indeterminate=t.status=void 0:t.abort||(c<100?(this._setStatus(t,l,a,s),n=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:i}}))},i.onreadystatechange=()=>{if(4==i.readyState){if(clearTimeout(n),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:i},cancelable:!0})))return;0===i.status?t.error=this.i18n.uploading.error.serverUnavailable:i.status>=500?t.error=this.i18n.uploading.error.unexpectedServerError:i.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:i}})),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:i},cancelable:!0})))return;o.append(t.formDataName,t,t.name),i.open(this.method,t.uploadTarget,!0),this._configureXhr(i),t.status=this.i18n.uploading.status.connecting,t.uploading=t.indeterminate=!0,t.complete=t.abort=t.error=t.held=!1,i.upload.onloadstart=()=>{this.dispatchEvent(new CustomEvent("upload-start",{detail:{file:t,xhr:i}})),this._notifyFileChanges(t)};this.dispatchEvent(new CustomEvent("upload-request",{detail:{file:t,xhr:i,formData:o},cancelable:!0}))&&i.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 i in t)t.hasOwnProperty(i)&&this.notifyPath(e+i,t[i])}_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],i=new RegExp("^("+this.accept.replace(/[, ]+/g,"|").replace(/\/\*/g,"/.*")+")$","i");!this.accept||i.test(t.type)||i.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(){g()}_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(al.is,al);class ll extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{target:{type:String},accept:{type:String},_files:{type:Object},event:{type:String}})}constructor(){super(),this._files=new Map,this.event="pb-load"}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:i}=e.detail;this._files.set(i.name,i),this.requestUpdate(),this.minApiVersion("1.0.0")&&this.target&&(i.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 i=[];t.files.forEach(t=>{t.complete||t.error||t.aborted?/^.*\.odd$/.test(t.name)&&i.push(t.name):e=!1,this.requestUpdate()}),e&&(this.emitTo("pb-end-update"),this.emitTo(this.event),i.length>0&&this.emitTo("pb-refresh-odds",{odds:i}))}),B("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=H(this,"--pb-upload-button-icon","icons:file-upload"),e=H(this,"--pb-upload-drop-icon",null);return I`
3321
3321
  <vaadin-upload id="uploader" accept="${this.accept}" method="post" tabindex="-1" form-data-name="files[]"
3322
3322
  with-credentials>
3323
3323
  ${e?I`<iron-icon slot="drop-label-icon" icon="${e}"></iron-icon>`:I`<span slot="drop-label-icon"></span>`}
@@ -3361,7 +3361,7 @@ class ol extends(L(M(p))){static get template(){return n`
3361
3361
  #uploadBtn iron-icon {
3362
3362
  padding-right: 8px;
3363
3363
  }
3364
- `}}customElements.define("pb-upload",sl),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 s(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t}function a(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 s=0;return t>0?s=e/t:!e&&i>0&&(s=n/i),s*r}if(r>=1){var a=0;return i<1?a=(n-1)/(i-1):1==i&&t<1&&(a=(e-1)/(t-1)),1+a*(r-1)}for(var l=0,c=1;l<c;){var h=(l+c)/2,d=o(t,i,h);if(Math.abs(r-d)<1e-5)return o(e,n,h);d<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 d(t){if("linear"==t)return k;var e=L.exec(t);if(e)return l.apply(this,e.slice(1).map(Number));var i=M.exec(t);if(i)return c(Number(i[1]),z);var n=O.exec(t);return n?c(Number(n[1]),{start:A,middle:S,end:z}[n[2]]):C[t]||k}function p(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 $;var n=i.delay+t+i.endDelay;return e<Math.min(i.delay,n)?H:e>=Math.min(i.delay+t,n)?I:R}function f(t,e,i,n,r){switch(n){case H:return"backwards"==e||"both"==e?0:null;case R:return i-r;case I:return"forwards"==e||"both"==e?t:null;case $:return null}}function m(t,e,i,n,r){var o=r;return 0===t?e!==H&&(o+=i):o+=n/t,o}function v(t,e,i,n,r,o){var s=t===1/0?e%1:t%1;return 0!==s||i!==I||0===n||0===r&&0!==o||(s=1),s}function b(t,e,i,n){return t===I&&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),s=v(o,i.iterationStart,n,i.iterations,r,i.duration),a=b(n,i.iterations,s,o),l=y(i.direction,a,s);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=d(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 A=1,S=.5,z=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,A),"step-middle":c(1,S),"step-end":c(1,z)},E=null,T="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",L=new RegExp("cubic-bezier\\("+T+","+T+","+T+","+T+"\\)"),M=/steps\(\s*(\d+)\s*\)/,O=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,$=0,H=1,I=2,R=3;t.cloneTimingInput=i,t.makeTiming=o,t.numericTimingToObject=s,t.normalizeTimingInput=a,t.calculateActiveDuration=p,t.calculateIterationProgress=_,t.calculatePhase=g,t.normalizeEasing=h,t.parseEasingFunction=d}(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=a[t];if(o)for(var s in l.style[t]=e,o){var c=o[s],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,s=0;s<o;s++)(r={}).offset="offset"in t?t.offset:1==o?1:s/(o-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[i]=n[s],e.push(r)}return e.sort((function(t,e){return t.offset-e.offset})),e}function s(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 s=1;s<r-e;s++)n[e+s].offset=i+(o-i)*s/(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})),s=!0,a=-1/0,l=0;l<n.length;l++){var c=n[l].offset;if(null!=c){if(c<a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");a=c}else s=!1}return n=n.filter((function(t){return t.offset>=0&&t.offset<=1})),s||i(),n}var a={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=s}(t),function(t){var e={};t.isDeprecated=function(t,i,n,r){var o=r?"are":"is",s=new Date,a=new Date(i);return a.setMonth(a.getMonth()+3),!(s<a&&(t in e||console.warn("Web Animations: "+t+" "+o+" deprecated and will stop working on "+a.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 s=e[o];if(0!=s[0].offset||1!=s[s.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],s=0;s<o.length-1;s++){var a=s,l=s+1,c=o[a].offset,h=o[l].offset,d=c,p=h;0==s&&(d=-1/0,0==h&&(l=a)),s==o.length-2&&(p=1/0,1==c&&(a=l)),n.push({applyFrom:d,applyTo:p,startOffset:o[a].offset,endOffset:o[l].offset,easingFunction:t.parseEasingFunction(o[a].easing),property:r,interpolation:e.propertyInterpolation(r,o[a].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)),s=r(o);return function(t,i){if(null!=i)s.filter((function(t){return i>=t.applyFrom&&i<t.applyTo})).forEach((function(n){var r=i-n.startOffset,o=n.endOffset-n.startOffset,s=0==o?0:n.easingFunction(r/o);e.apply(t,n.property,n.interpolation(s))}));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){a[i]=a[i]||[],a[i].push([t,e])}function o(t,e,i){for(var o=0;o<i.length;o++)r(t,e,n(i[o]))}function s(i,r,o){var s=i;/-/.test(i)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(s=n(i)),"initial"!=r&&"initial"!=o||("initial"==r&&(r=l[s]),"initial"==o&&(o=l[s]));for(var c=r==o?[]:a[s],h=0;c&&h<c.length;h++){var d=c[h][0](r),p=c[h][0](o);if(void 0!==d&&void 0!==p){var u=c[h][1](d,p);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 a={};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=s}(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,s){var a,l=n(t.normalizeTimingInput(o)),c=e.convertEffectInput(r),h=function(){c(i,a)};return h._update=function(t){return null!==(a=l(t))},h._clear=function(){c(i,null)},h._hasSameTarget=function(t){return i===t},h._target=i,h._totalDuration=l._totalDuration,h._id=s,h}}(t,e),function(t,e){function i(t,e){return!(!e.namespaceURI||-1==e.namespaceURI.indexOf("/svg"))&&(s in t||(t[s]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(t.navigator.userAgent)),t[s])}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 s="_webAnimationsUpdateSvgTransformAttr",a={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 d in document.documentElement.style)d in a||d 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)}})}(d);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),s=[];if(1===(o=i(o,-1,1)))s=e;else for(var a=Math.acos(o),l=1*Math.sin(r*a)/Math.sqrt(1-o*o),c=0;c<4;c++)s.push(e[c]*(Math.cos(r*a)-o*l)+n[c]*l);return s}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,s){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],l=0;l<4;l++)a[l][3]=s[l];for(l=0;l<3;l++)for(var c=0;c<3;c++)a[3][l]+=i[c]*a[c][l];var h=o[0],d=o[1],p=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*(d*d+p*p),g[0][1]=2*(h*d-p*u),g[0][2]=2*(h*p+d*u),g[1][0]=2*(h*d+p*u),g[1][1]=1-2*(h*h+p*p),g[1][2]=2*(d*p-h*u),g[2][0]=2*(h*p-d*u),g[2][1]=2*(d*p+h*u),g[2][2]=1-2*(h*h+d*d),a=t(a,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],a=t(a,f)),r[1]&&(f[2][1]=0,f[2][0]=r[0],a=t(a,f)),r[0]&&(f[2][0]=0,f[1][0]=r[0],a=t(a,f));for(l=0;l<3;l++)for(c=0;c<3;c++)a[l][c]*=n[l];return e(a)?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[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=a(t,!0,f._animations)[0],e.forEach((function(e){e[1](t)})),s(),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 s(){u.forEach((function(t){t()})),u.length=0}function a(t,i,n){g=!0,p=!1,e.timeline.currentTime=t,d=!1;var r=[],o=[],s=[],a=[];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&&(d=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?s.push(e):a.push(e)})),u.push.apply(u,r),u.push.apply(u,o),d&&requestAnimationFrame((function(){})),g=!1,[s,a]}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 d=!1,p=!1;e.restart=function(){return d||(d=!0,requestAnimationFrame((function(){})),p=!0),p},e.applyDirtiedAnimation=function(t){if(!g){t._markTarget();var i=t._targetAnimations();i.sort(r),a(e.timeline.currentTime,!1,i.slice())[1].forEach((function(t){var e=f._animations.indexOf(t);-1!==e&&f._animations.splice(e,1)})),s()}};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],s=(e=r(t.d[3]),i*i+n*n+o*o);if(0===s)i=1,n=0,o=0;else if(1!==s){var a=Math.sqrt(s);i/=a,n/=a,o/=a}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 d=r(t.d[0]),p=r(t.d[1]);return[1,Math.tan(p),0,0,Math.tan(d),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 s(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 a(t){return[l(s(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],s=e[1][0],a=e[1][1],l=e[1][2],c=e[2][0],h=e[2][1],d=e[2][2],p=[[(a*d-l*h)*i,(o*h-r*d)*i,(r*l-o*a)*i,0],[(l*c-s*d)*i,(n*d-o*c)*i,(o*s-n*l)*i,0],[(s*h-a*c)*i,(c*r-n*h)*i,(n*a-r*s)*i,0]],u=[],g=0;g<3;g++){for(var f=0,m=0;m<3;m++)f+=e[3][m]*p[m][g];u.push(f)}return u.push(1),p.push(u),p}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=s(t);return[t[0]/e,t[1]/e,t[2]/e]}function s(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function a(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 d=[],p=0;p<4;p++)d.push(h[p].slice());for(p=0;p<3;p++)d[p][3]=0;if(0===t(d))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(d)))):u=[0,0,0,1];var f=h[3].slice(0,3),m=[];m.push(h[0].slice(0,3));var v=[];v.push(s(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]=a(m[1],m[0],1,-b[0]),v.push(s(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]=a(m[2],m[0],1,-b[1]),b.push(i(m[1],m[2])),m[2]=a(m[2],m[1],1,-b[2]),v.push(s(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(p=0;p<3;p++)v[p]*=-1,m[p][0]*=-1,m[p][1]*=-1,m[p][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=a,t.transformListToMatrix=s}(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 s=t(r);if(!s)return[o,r];if(o.push(s[0]),!(s=e(n,r=s[1]))||""==s[1])return[o,r];r=s[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 s(t){return function(e){var i=t(e);return i&&(i[0]=void 0),i}}function a(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 s=[],a=[],l=[],c=o(n.length,r.length),h=0;h<c;h++){var d=e(n[h%n.length],r[h%r.length]);if(!d)return;s.push(d[0]),a.push(d[1]),l.push(d[2])}return[s,a,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=[],s=0,a=0;a<i.length;a++)if("function"==typeof i[a]){var l=i[a](t[s],e[s++]);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]}))}(a);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=s,t.optional=a,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],s=[[],0],a=0;a<e.lengths.length;a++){var l=t.mergeDimensions(e.lengths[a],i.lengths[a],2==a);o[0].push(l[0]),s[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],s[1]=c[1],n=c[2]}return[o,s,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 s=[],a=[],l=0;l<n.length||l<r.length;l++){var c=n[l]||o(r[l].inset),h=r[l]||o(n[l].inset);s.push(c),a.push(h)}return t.mergeNestedRepeated(e,i,s,a)}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 s(t,e){if(0!=t)return l(0,1/0)(t,e)}function a(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 d(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,s,["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,a,["orphans","widows"]),t.addPropertiesHandler(r,d,["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=a.exec(t);s=e?e[0]:void 0}function i(){var t=Number(s);return e(),t}function n(){if("("!==s)return i();e();var t=o();return")"!==s?NaN:(e(),t)}function r(){for(var t=n();"*"===s||"/"===s;){var i=s;e();var r=n();"*"===i?t*=r:t/=r}return t}function o(){for(var t=r();"+"===s||"-"===s;){var i=s;e();var n=r();"+"===i?t+=n:t-=n}return t}var s,a=/([\+\-\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,""),s=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],a=0;a<s.length;)s[a].test(o)?(o=o.replace(s[a],"$1"),a=0):a++;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 s="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",a=n.bind(null,new RegExp(s,"g")),l=n.bind(null,new RegExp(s+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=a,t.parseLengthOrPercent=l,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,l),t.parseAngle=c,t.mergeDimensions=o;var h=t.consumeParenthesised.bind(null,a),d=t.consumeRepeated.bind(void 0,h,/^/),p=t.consumeRepeated.bind(void 0,d,/^,/);t.consumeSizePairList=p;var u=function(t){var e=p(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 s=t.mergeWrappedNestedRepeated.bind(null,o,r,", ");t.parseBox=n,t.mergeBoxes=s,t.addPropertiesHandler(n,s,["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 s=i[1],a=u[s];if(!a)return;var l=i[2].split(","),c=a[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()?p:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[v.toUpperCase()](m):{a:p,n:h[0],t:d}[v]))return;h.push(f)}if(r.push({t:s,d:h}),n.lastIndex==e.length)return r}}function o(t){return t.toFixed(6).replace(".000000","")}function s(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 a(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,d="scale"==c.substr(0,5)?1:0;i.push({t:c,d:h.map((function(t){if("number"==typeof t)return d;var e={};for(var i in t)e[i]=d;return e}))})}}var p=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=s(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(p(v,b)){if(!n)return;var k=s([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]&&a(v)==a(b))c=a(v),y=w[2](y),_=x[2](_);else{if(!w[1]||!x[1]||l(v)!=l(b)){if(!n)return;g=[(k=s(e,i))[0]],f=[k[1]],m=[["matrix",[k[2]]]];break}c=l(v),y=w[1](y),_=x[1](_)}for(var A=[],S=[],z=[],C=0;C<y.length;C++){k=("number"==typeof y[C]?t.mergeNumbers:t.mergeDimensions)(y[C],_[C]);A[C]=k[0],S[C]=k[1],z.push(k[2])}g.push(A),f.push(S),m.push([c,z])}}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,d={px:0},p={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,p])],skewy:["A",null,i([p,h])],translate:["Tt",i([h,h,d]),n],translatex:["T",i([h,d,d]),i([h,d])],translatey:["T",i([d,h,d]),i([d,h])],translatez:["L",i([d,d,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 a=o[0];o[0]=o[1],o[1]=a}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:s[t]}))}}}function r(n){var r=t.consumeRepeated(i,/^/,n);if(r){for(var o=r[0],a=[{"%":50},{"%":50}],l=0,c=!1,h=0;h<o.length;h++){var d=o[h];"string"==typeof d?(c=/bottom|right/.test(d),a[l={left:0,right:0,center:l,top:1,bottom:1}[d]]=s[d],"center"==d&&l++):(c&&((d=e(d))["%"]=(d["%"]||0)+100),a[l]=d,l++,c=!1)}return[a,r[1]]}}function o(e){var i=t.consumeRepeated(r,/^,/,e);if(i&&""==i[1])return i[0]}var s={left:{"%":0},center:{"%":50},right:{"%":100},top:{"%":0},bottom:{"%":100}},a=t.mergeNestedRepeated.bind(null,t.mergeDimensions," ");t.addPropertiesHandler(n.bind(null,3),a,["transform-origin"]),t.addPropertiesHandler(n.bind(null,2),a,["perspective-origin"]),t.consumePosition=r,t.mergeOffsetList=a;var l=t.mergeNestedRepeated.bind(null,a,", ");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 s=t.consumeToken(/^polygon/,e);return s&&s[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,/^\)/))],s[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],s,")"]):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," "),s=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 s=o.cancel;o.cancel=function(){s.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 a=o.addEventListener;o.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):a.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)}(),
3364
+ `}}customElements.define("pb-upload",ll),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 s(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t}function a(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 s=0;return t>0?s=e/t:!e&&i>0&&(s=n/i),s*r}if(r>=1){var a=0;return i<1?a=(n-1)/(i-1):1==i&&t<1&&(a=(e-1)/(t-1)),1+a*(r-1)}for(var l=0,c=1;l<c;){var h=(l+c)/2,d=o(t,i,h);if(Math.abs(r-d)<1e-5)return o(e,n,h);d<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 d(t){if("linear"==t)return k;var e=L.exec(t);if(e)return l.apply(this,e.slice(1).map(Number));var i=M.exec(t);if(i)return c(Number(i[1]),z);var n=O.exec(t);return n?c(Number(n[1]),{start:A,middle:S,end:z}[n[2]]):C[t]||k}function p(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 $;var n=i.delay+t+i.endDelay;return e<Math.min(i.delay,n)?H:e>=Math.min(i.delay+t,n)?I:R}function f(t,e,i,n,r){switch(n){case H:return"backwards"==e||"both"==e?0:null;case R:return i-r;case I:return"forwards"==e||"both"==e?t:null;case $:return null}}function m(t,e,i,n,r){var o=r;return 0===t?e!==H&&(o+=i):o+=n/t,o}function v(t,e,i,n,r,o){var s=t===1/0?e%1:t%1;return 0!==s||i!==I||0===n||0===r&&0!==o||(s=1),s}function b(t,e,i,n){return t===I&&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),s=v(o,i.iterationStart,n,i.iterations,r,i.duration),a=b(n,i.iterations,s,o),l=y(i.direction,a,s);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=d(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 A=1,S=.5,z=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,A),"step-middle":c(1,S),"step-end":c(1,z)},E=null,T="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",L=new RegExp("cubic-bezier\\("+T+","+T+","+T+","+T+"\\)"),M=/steps\(\s*(\d+)\s*\)/,O=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,$=0,H=1,I=2,R=3;t.cloneTimingInput=i,t.makeTiming=o,t.numericTimingToObject=s,t.normalizeTimingInput=a,t.calculateActiveDuration=p,t.calculateIterationProgress=_,t.calculatePhase=g,t.normalizeEasing=h,t.parseEasingFunction=d}(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=a[t];if(o)for(var s in l.style[t]=e,o){var c=o[s],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,s=0;s<o;s++)(r={}).offset="offset"in t?t.offset:1==o?1:s/(o-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[i]=n[s],e.push(r)}return e.sort((function(t,e){return t.offset-e.offset})),e}function s(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 s=1;s<r-e;s++)n[e+s].offset=i+(o-i)*s/(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})),s=!0,a=-1/0,l=0;l<n.length;l++){var c=n[l].offset;if(null!=c){if(c<a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");a=c}else s=!1}return n=n.filter((function(t){return t.offset>=0&&t.offset<=1})),s||i(),n}var a={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=s}(t),function(t){var e={};t.isDeprecated=function(t,i,n,r){var o=r?"are":"is",s=new Date,a=new Date(i);return a.setMonth(a.getMonth()+3),!(s<a&&(t in e||console.warn("Web Animations: "+t+" "+o+" deprecated and will stop working on "+a.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 s=e[o];if(0!=s[0].offset||1!=s[s.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],s=0;s<o.length-1;s++){var a=s,l=s+1,c=o[a].offset,h=o[l].offset,d=c,p=h;0==s&&(d=-1/0,0==h&&(l=a)),s==o.length-2&&(p=1/0,1==c&&(a=l)),n.push({applyFrom:d,applyTo:p,startOffset:o[a].offset,endOffset:o[l].offset,easingFunction:t.parseEasingFunction(o[a].easing),property:r,interpolation:e.propertyInterpolation(r,o[a].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)),s=r(o);return function(t,i){if(null!=i)s.filter((function(t){return i>=t.applyFrom&&i<t.applyTo})).forEach((function(n){var r=i-n.startOffset,o=n.endOffset-n.startOffset,s=0==o?0:n.easingFunction(r/o);e.apply(t,n.property,n.interpolation(s))}));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){a[i]=a[i]||[],a[i].push([t,e])}function o(t,e,i){for(var o=0;o<i.length;o++)r(t,e,n(i[o]))}function s(i,r,o){var s=i;/-/.test(i)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(s=n(i)),"initial"!=r&&"initial"!=o||("initial"==r&&(r=l[s]),"initial"==o&&(o=l[s]));for(var c=r==o?[]:a[s],h=0;c&&h<c.length;h++){var d=c[h][0](r),p=c[h][0](o);if(void 0!==d&&void 0!==p){var u=c[h][1](d,p);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 a={};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=s}(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,s){var a,l=n(t.normalizeTimingInput(o)),c=e.convertEffectInput(r),h=function(){c(i,a)};return h._update=function(t){return null!==(a=l(t))},h._clear=function(){c(i,null)},h._hasSameTarget=function(t){return i===t},h._target=i,h._totalDuration=l._totalDuration,h._id=s,h}}(t,e),function(t,e){function i(t,e){return!(!e.namespaceURI||-1==e.namespaceURI.indexOf("/svg"))&&(s in t||(t[s]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(t.navigator.userAgent)),t[s])}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 s="_webAnimationsUpdateSvgTransformAttr",a={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 d in document.documentElement.style)d in a||d 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)}})}(d);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),s=[];if(1===(o=i(o,-1,1)))s=e;else for(var a=Math.acos(o),l=1*Math.sin(r*a)/Math.sqrt(1-o*o),c=0;c<4;c++)s.push(e[c]*(Math.cos(r*a)-o*l)+n[c]*l);return s}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,s){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],l=0;l<4;l++)a[l][3]=s[l];for(l=0;l<3;l++)for(var c=0;c<3;c++)a[3][l]+=i[c]*a[c][l];var h=o[0],d=o[1],p=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*(d*d+p*p),g[0][1]=2*(h*d-p*u),g[0][2]=2*(h*p+d*u),g[1][0]=2*(h*d+p*u),g[1][1]=1-2*(h*h+p*p),g[1][2]=2*(d*p-h*u),g[2][0]=2*(h*p-d*u),g[2][1]=2*(d*p+h*u),g[2][2]=1-2*(h*h+d*d),a=t(a,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],a=t(a,f)),r[1]&&(f[2][1]=0,f[2][0]=r[0],a=t(a,f)),r[0]&&(f[2][0]=0,f[1][0]=r[0],a=t(a,f));for(l=0;l<3;l++)for(c=0;c<3;c++)a[l][c]*=n[l];return e(a)?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[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=a(t,!0,f._animations)[0],e.forEach((function(e){e[1](t)})),s(),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 s(){u.forEach((function(t){t()})),u.length=0}function a(t,i,n){g=!0,p=!1,e.timeline.currentTime=t,d=!1;var r=[],o=[],s=[],a=[];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&&(d=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?s.push(e):a.push(e)})),u.push.apply(u,r),u.push.apply(u,o),d&&requestAnimationFrame((function(){})),g=!1,[s,a]}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 d=!1,p=!1;e.restart=function(){return d||(d=!0,requestAnimationFrame((function(){})),p=!0),p},e.applyDirtiedAnimation=function(t){if(!g){t._markTarget();var i=t._targetAnimations();i.sort(r),a(e.timeline.currentTime,!1,i.slice())[1].forEach((function(t){var e=f._animations.indexOf(t);-1!==e&&f._animations.splice(e,1)})),s()}};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],s=(e=r(t.d[3]),i*i+n*n+o*o);if(0===s)i=1,n=0,o=0;else if(1!==s){var a=Math.sqrt(s);i/=a,n/=a,o/=a}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 d=r(t.d[0]),p=r(t.d[1]);return[1,Math.tan(p),0,0,Math.tan(d),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 s(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 a(t){return[l(s(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],s=e[1][0],a=e[1][1],l=e[1][2],c=e[2][0],h=e[2][1],d=e[2][2],p=[[(a*d-l*h)*i,(o*h-r*d)*i,(r*l-o*a)*i,0],[(l*c-s*d)*i,(n*d-o*c)*i,(o*s-n*l)*i,0],[(s*h-a*c)*i,(c*r-n*h)*i,(n*a-r*s)*i,0]],u=[],g=0;g<3;g++){for(var f=0,m=0;m<3;m++)f+=e[3][m]*p[m][g];u.push(f)}return u.push(1),p.push(u),p}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=s(t);return[t[0]/e,t[1]/e,t[2]/e]}function s(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function a(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 d=[],p=0;p<4;p++)d.push(h[p].slice());for(p=0;p<3;p++)d[p][3]=0;if(0===t(d))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(d)))):u=[0,0,0,1];var f=h[3].slice(0,3),m=[];m.push(h[0].slice(0,3));var v=[];v.push(s(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]=a(m[1],m[0],1,-b[0]),v.push(s(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]=a(m[2],m[0],1,-b[1]),b.push(i(m[1],m[2])),m[2]=a(m[2],m[1],1,-b[2]),v.push(s(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(p=0;p<3;p++)v[p]*=-1,m[p][0]*=-1,m[p][1]*=-1,m[p][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=a,t.transformListToMatrix=s}(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 s=t(r);if(!s)return[o,r];if(o.push(s[0]),!(s=e(n,r=s[1]))||""==s[1])return[o,r];r=s[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 s(t){return function(e){var i=t(e);return i&&(i[0]=void 0),i}}function a(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 s=[],a=[],l=[],c=o(n.length,r.length),h=0;h<c;h++){var d=e(n[h%n.length],r[h%r.length]);if(!d)return;s.push(d[0]),a.push(d[1]),l.push(d[2])}return[s,a,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=[],s=0,a=0;a<i.length;a++)if("function"==typeof i[a]){var l=i[a](t[s],e[s++]);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]}))}(a);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=s,t.optional=a,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],s=[[],0],a=0;a<e.lengths.length;a++){var l=t.mergeDimensions(e.lengths[a],i.lengths[a],2==a);o[0].push(l[0]),s[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],s[1]=c[1],n=c[2]}return[o,s,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 s=[],a=[],l=0;l<n.length||l<r.length;l++){var c=n[l]||o(r[l].inset),h=r[l]||o(n[l].inset);s.push(c),a.push(h)}return t.mergeNestedRepeated(e,i,s,a)}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 s(t,e){if(0!=t)return l(0,1/0)(t,e)}function a(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 d(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,s,["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,a,["orphans","widows"]),t.addPropertiesHandler(r,d,["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=a.exec(t);s=e?e[0]:void 0}function i(){var t=Number(s);return e(),t}function n(){if("("!==s)return i();e();var t=o();return")"!==s?NaN:(e(),t)}function r(){for(var t=n();"*"===s||"/"===s;){var i=s;e();var r=n();"*"===i?t*=r:t/=r}return t}function o(){for(var t=r();"+"===s||"-"===s;){var i=s;e();var n=r();"+"===i?t+=n:t-=n}return t}var s,a=/([\+\-\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,""),s=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],a=0;a<s.length;)s[a].test(o)?(o=o.replace(s[a],"$1"),a=0):a++;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 s="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",a=n.bind(null,new RegExp(s,"g")),l=n.bind(null,new RegExp(s+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=a,t.parseLengthOrPercent=l,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,l),t.parseAngle=c,t.mergeDimensions=o;var h=t.consumeParenthesised.bind(null,a),d=t.consumeRepeated.bind(void 0,h,/^/),p=t.consumeRepeated.bind(void 0,d,/^,/);t.consumeSizePairList=p;var u=function(t){var e=p(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 s=t.mergeWrappedNestedRepeated.bind(null,o,r,", ");t.parseBox=n,t.mergeBoxes=s,t.addPropertiesHandler(n,s,["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 s=i[1],a=u[s];if(!a)return;var l=i[2].split(","),c=a[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()?p:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[v.toUpperCase()](m):{a:p,n:h[0],t:d}[v]))return;h.push(f)}if(r.push({t:s,d:h}),n.lastIndex==e.length)return r}}function o(t){return t.toFixed(6).replace(".000000","")}function s(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 a(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,d="scale"==c.substr(0,5)?1:0;i.push({t:c,d:h.map((function(t){if("number"==typeof t)return d;var e={};for(var i in t)e[i]=d;return e}))})}}var p=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=s(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(p(v,b)){if(!n)return;var k=s([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]&&a(v)==a(b))c=a(v),y=w[2](y),_=x[2](_);else{if(!w[1]||!x[1]||l(v)!=l(b)){if(!n)return;g=[(k=s(e,i))[0]],f=[k[1]],m=[["matrix",[k[2]]]];break}c=l(v),y=w[1](y),_=x[1](_)}for(var A=[],S=[],z=[],C=0;C<y.length;C++){k=("number"==typeof y[C]?t.mergeNumbers:t.mergeDimensions)(y[C],_[C]);A[C]=k[0],S[C]=k[1],z.push(k[2])}g.push(A),f.push(S),m.push([c,z])}}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,d={px:0},p={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,p])],skewy:["A",null,i([p,h])],translate:["Tt",i([h,h,d]),n],translatex:["T",i([h,d,d]),i([h,d])],translatey:["T",i([d,h,d]),i([d,h])],translatez:["L",i([d,d,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 a=o[0];o[0]=o[1],o[1]=a}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:s[t]}))}}}function r(n){var r=t.consumeRepeated(i,/^/,n);if(r){for(var o=r[0],a=[{"%":50},{"%":50}],l=0,c=!1,h=0;h<o.length;h++){var d=o[h];"string"==typeof d?(c=/bottom|right/.test(d),a[l={left:0,right:0,center:l,top:1,bottom:1}[d]]=s[d],"center"==d&&l++):(c&&((d=e(d))["%"]=(d["%"]||0)+100),a[l]=d,l++,c=!1)}return[a,r[1]]}}function o(e){var i=t.consumeRepeated(r,/^,/,e);if(i&&""==i[1])return i[0]}var s={left:{"%":0},center:{"%":50},right:{"%":100},top:{"%":0},bottom:{"%":100}},a=t.mergeNestedRepeated.bind(null,t.mergeDimensions," ");t.addPropertiesHandler(n.bind(null,3),a,["transform-origin"]),t.addPropertiesHandler(n.bind(null,2),a,["perspective-origin"]),t.consumePosition=r,t.mergeOffsetList=a;var l=t.mergeNestedRepeated.bind(null,a,", ");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 s=t.consumeToken(/^polygon/,e);return s&&s[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,/^\)/))],s[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],s,")"]):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," "),s=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 s=o.cancel;o.cancel=function(){s.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 a=o.addEventListener;o.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):a.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)}(),
3365
3365
  /**
3366
3366
  @license
3367
3367
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3439,7 +3439,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3439
3439
  part of the polymer project is also subject to an additional IP rights grant
3440
3440
  found at http://polymer.github.io/PATENTS.txt
3441
3441
  */
3442
- const al=[A,{properties:{sharedElements:{type:Object}},findSharedElements:function(t){var e=t.fromPage,i=t.toPage;if(!e||!i)return console.warn(this.is+":",e?"toPage":"fromPage","is undefined!"),null;if(!e.sharedElements||!i.sharedElements)return console.warn(this.is+":","sharedElements are undefined for",e.sharedElements?i:e),null;var n=e.sharedElements[t.id],r=i.sharedElements[t.id];return n&&r?(this.sharedElements={from:n,to:r},this.sharedElements):(console.warn(this.is+":","sharedElement with id",t.id,"not found in",n?i:e),null)}}];
3442
+ const cl=[A,{properties:{sharedElements:{type:Object}},findSharedElements:function(t){var e=t.fromPage,i=t.toPage;if(!e||!i)return console.warn(this.is+":",e?"toPage":"fromPage","is undefined!"),null;if(!e.sharedElements||!i.sharedElements)return console.warn(this.is+":","sharedElements are undefined for",e.sharedElements?i:e),null;var n=e.sharedElements[t.id],r=i.sharedElements[t.id];return n&&r?(this.sharedElements={from:n,to:r},this.sharedElements):(console.warn(this.is+":","sharedElement with id",t.id,"not found in",n?i:e),null)}}];
3443
3443
  /**
3444
3444
  @license
3445
3445
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3450,7 +3450,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3450
3450
  part of the polymer project is also subject to an additional IP rights grant
3451
3451
  found at http://polymer.github.io/PATENTS.txt
3452
3452
  */
3453
- e({is:"hero-animation",behaviors:[al],configure:function(t){var e=this.findSharedElements(t);if(e){var i=e.from.getBoundingClientRect(),n=e.to.getBoundingClientRect(),r=i.left-n.left,o=i.top-n.top,s=i.width/n.width,a=i.height/n.height;return this._effect=new KeyframeEffect(e.to,[{transform:"translate("+r+"px,"+o+"px) scale("+s+","+a+")"},{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=""}}),
3453
+ e({is:"hero-animation",behaviors:[cl],configure:function(t){var e=this.findSharedElements(t);if(e){var i=e.from.getBoundingClientRect(),n=e.to.getBoundingClientRect(),r=i.left-n.left,o=i.top-n.top,s=i.width/n.width,a=i.height/n.height;return this._effect=new KeyframeEffect(e.to,[{transform:"translate("+r+"px,"+o+"px) scale("+s+","+a+")"},{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=""}}),
3454
3454
  /**
3455
3455
  @license
3456
3456
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3472,7 +3472,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3472
3472
  part of the polymer project is also subject to an additional IP rights grant
3473
3473
  found at http://polymer.github.io/PATENTS.txt
3474
3474
  */
3475
- e({is:"ripple-animation",behaviors:[al],configure:function(t){var e,i,n=this.findSharedElements(t);if(!n)return null;var r=n.to.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),i=t.gesture.y-(r.top+r.height/2);else{var o=n.from.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),i=o.top+o.height/2-(r.top+r.height/2)}var s="translate("+e+"px,"+i+"px)",a=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(i)),l=Math.sqrt(2*a*a),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(n.to,[{transform:s+" scale(0)"},{transform:s+" "+c}],this.timingFromConfig(t)),this.setPrefixedProperty(n.to,"transformOrigin","50% 50%"),n.to.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.to,"transformOrigin",""),this.sharedElements.to.style.borderRadius="")}}),
3475
+ e({is:"ripple-animation",behaviors:[cl],configure:function(t){var e,i,n=this.findSharedElements(t);if(!n)return null;var r=n.to.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),i=t.gesture.y-(r.top+r.height/2);else{var o=n.from.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),i=o.top+o.height/2-(r.top+r.height/2)}var s="translate("+e+"px,"+i+"px)",a=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(i)),l=Math.sqrt(2*a*a),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(n.to,[{transform:s+" scale(0)"},{transform:s+" "+c}],this.timingFromConfig(t)),this.setPrefixedProperty(n.to,"transformOrigin","50% 50%"),n.to.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.to,"transformOrigin",""),this.sharedElements.to.style.borderRadius="")}}),
3476
3476
  /**
3477
3477
  @license
3478
3478
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3483,7 +3483,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3483
3483
  part of the polymer project is also subject to an additional IP rights grant
3484
3484
  found at http://polymer.github.io/PATENTS.txt
3485
3485
  */
3486
- e({is:"reverse-ripple-animation",behaviors:[al],configure:function(t){var e,i,n=this.findSharedElements(t);if(!n)return null;var r=n.from.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),i=t.gesture.y-(r.top+r.height/2);else{var o=n.to.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),i=o.top+o.height/2-(r.top+r.height/2)}var s="translate("+e+"px,"+i+"px)",a=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(i)),l=Math.sqrt(2*a*a),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(n.from,[{transform:s+" "+c},{transform:s+" scale(0)"}],this.timingFromConfig(t)),this.setPrefixedProperty(n.from,"transformOrigin","50% 50%"),n.from.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.from,"transformOrigin",""),this.sharedElements.from.style.borderRadius="")}}),
3486
+ e({is:"reverse-ripple-animation",behaviors:[cl],configure:function(t){var e,i,n=this.findSharedElements(t);if(!n)return null;var r=n.from.getBoundingClientRect();if(t.gesture)e=t.gesture.x-(r.left+r.width/2),i=t.gesture.y-(r.top+r.height/2);else{var o=n.to.getBoundingClientRect();e=o.left+o.width/2-(r.left+r.width/2),i=o.top+o.height/2-(r.top+r.height/2)}var s="translate("+e+"px,"+i+"px)",a=Math.max(r.width+2*Math.abs(e),r.height+2*Math.abs(i)),l=Math.sqrt(2*a*a),c="scale("+l/r.width+","+l/r.height+")";return this._effect=new KeyframeEffect(n.from,[{transform:s+" "+c},{transform:s+" scale(0)"}],this.timingFromConfig(t)),this.setPrefixedProperty(n.from,"transformOrigin","50% 50%"),n.from.style.borderRadius="50%",this._effect},complete:function(){this.sharedElements&&(this.setPrefixedProperty(this.sharedElements.from,"transformOrigin",""),this.sharedElements.from.style.borderRadius="")}}),
3487
3487
  /**
3488
3488
  @license
3489
3489
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3604,7 +3604,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3604
3604
  part of the polymer project is also subject to an additional IP rights grant
3605
3605
  found at http://polymer.github.io/PATENTS.txt
3606
3606
  */
3607
- e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t.transformFrom||"none",n=t.transformTo||"none";return this._effect=new KeyframeEffect(e,[{transform:i},{transform:n}],this.timingFromConfig(t)),t.transformOrigin&&this.setPrefixedProperty(e,"transformOrigin",t.transformOrigin),this._effect}});class ll extends(D(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(),B("pb-page-ready",()=>{this._refresh()})}render(){return I`
3607
+ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t.transformFrom||"none",n=t.transformTo||"none";return this._effect=new KeyframeEffect(e,[{transform:i},{transform:n}],this.timingFromConfig(t)),t.transformOrigin&&this.setPrefixedProperty(e,"transformOrigin",t.transformOrigin),this._effect}});class hl extends(D(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(),B("pb-page-ready",()=>{this._refresh()})}render(){return I`
3608
3608
  <paper-dropdown-menu id="menu" label="${W(this.label)}" name="${this.name}">
3609
3609
  <paper-listbox id="odds" slot="dropdown-content" class="dropdown-content" selected="${this.odd}"
3610
3610
  attr-for-selected="value" @selected-item-changed="${this._selected}">
@@ -3628,7 +3628,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3628
3628
  --paper-listbox-background-color: white;
3629
3629
  width: 100%;
3630
3630
  }
3631
- `}_selected(){const t=this.shadowRoot.getElementById("odds").selected;if(t===this.odd)return;this.odd=t,console.log("<pb-select-odd> Switching to ODD %s",this.odd);const e=this.getDocument();e&&(e.odd=this.odd),En.commit(this,{odd:this.odd}),this.emitTo("pb-refresh",{odd:this.odd})}_refresh(){const t=this.shadowRoot.getElementById("load");this.minApiVersion("1.0.0")?t.url=this.getEndpoint()+"/api/odd":t.url=this.getEndpoint()+"/modules/lib/components-list-odds.xql",t.params={odd:this.odd},t.generateRequest()}_update(){const t=this.shadowRoot.getElementById("load");this.odds=t.lastResponse}_onTargetUpdate(t){let e=t.detail.data.odd;e&&(e=e.replace(/^(.*?)\.[^\.]+$/,"$1")),e!==this.odd&&console.log("<pb-select-odd> Set current ODD from %s to %s",this.odd,e),this.odd=e}}customElements.define("pb-select-odd",ll);class cl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{label:{type:String},template:{type:String},_templates:{type:Array}})}constructor(){super(),this.label="document.selectTemplate",this._templates=[]}firstUpdated(){B("pb-page-ready",t=>{this.template=t.template;const e=this.shadowRoot.getElementById("getTemplates");this.minApiVersion("1.0.0")?e.url=t.endpoint+"/api/templates":e.url=t.endpoint+"/modules/lib/components-list-templates.xql",e.generateRequest()})}render(){return I`
3631
+ `}_selected(){const t=this.shadowRoot.getElementById("odds").selected;if(t===this.odd)return;this.odd=t,console.log("<pb-select-odd> Switching to ODD %s",this.odd);const e=this.getDocument();e&&(e.odd=this.odd),En.commit(this,{odd:this.odd}),this.emitTo("pb-refresh",{odd:this.odd})}_refresh(){const t=this.shadowRoot.getElementById("load");this.minApiVersion("1.0.0")?t.url=this.getEndpoint()+"/api/odd":t.url=this.getEndpoint()+"/modules/lib/components-list-odds.xql",t.params={odd:this.odd},t.generateRequest()}_update(){const t=this.shadowRoot.getElementById("load");this.odds=t.lastResponse}_onTargetUpdate(t){let e=t.detail.data.odd;e&&(e=e.replace(/^(.*?)\.[^\.]+$/,"$1")),e!==this.odd&&console.log("<pb-select-odd> Set current ODD from %s to %s",this.odd,e),this.odd=e}}customElements.define("pb-select-odd",hl);class dl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{label:{type:String},template:{type:String},_templates:{type:Array}})}constructor(){super(),this.label="document.selectTemplate",this._templates=[]}firstUpdated(){B("pb-page-ready",t=>{this.template=t.template;const e=this.shadowRoot.getElementById("getTemplates");this.minApiVersion("1.0.0")?e.url=t.endpoint+"/api/templates":e.url=t.endpoint+"/modules/lib/components-list-templates.xql",e.generateRequest()})}render(){return I`
3632
3632
  <paper-dropdown-menu id="menu" label="${W(this.label)}" name="${this.name}">
3633
3633
  <paper-listbox id="templates" slot="dropdown-content" class="dropdown-content"
3634
3634
  selected="${this.template}" attr-for-selected="value"
@@ -3648,7 +3648,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3648
3648
  --paper-listbox-background-color: white;
3649
3649
  width: 100%;
3650
3650
  }
3651
- `}_selected(){const t=this.shadowRoot.getElementById("templates").selected;t!==this.template&&(En.replace(this,{template:t}),window.location.reload())}_handleTemplatesResponse(){const t=this.shadowRoot.getElementById("getTemplates");this._templates=t.lastResponse}}customElements.define("pb-select-template",cl);class hl extends pn{static get properties(){return Object.assign(Object.assign({},super.properties),{},{longitude:{type:Number},latitude:{type:Number},label:{type:String},event:{type:String},zoom:{type:Number},auto:{type:Boolean}})}constructor(){super(),this.event="mouseover",this.auto=!1,this.zoom=null}connectedCallback(){super.connectedCallback(),this.event&&this.addEventListener(this.event,()=>this.emitTo("pb-geolocation",{coordinates:{latitude:this.latitude,longitude:this.longitude},label:this.label,zoom:this.zoom,popup:this.popup,element:this,event:this.event})),this.auto&&this.waitForChannel(()=>{this.emitTo("pb-geolocation",{coordinates:{latitude:this.latitude,longitude:this.longitude},label:this.label,popup:this.popup,fitBounds:!0,element:this})})}render(){return I`<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 R`
3651
+ `}_selected(){const t=this.shadowRoot.getElementById("templates").selected;t!==this.template&&(En.replace(this,{template:t}),window.location.reload())}_handleTemplatesResponse(){const t=this.shadowRoot.getElementById("getTemplates");this._templates=t.lastResponse}}customElements.define("pb-select-template",dl);class pl extends pn{static get properties(){return Object.assign(Object.assign({},super.properties),{},{longitude:{type:Number},latitude:{type:Number},label:{type:String},event:{type:String},zoom:{type:Number},auto:{type:Boolean}})}constructor(){super(),this.event="mouseover",this.auto=!1,this.zoom=null}connectedCallback(){super.connectedCallback(),this.event&&this.addEventListener(this.event,()=>this.emitTo("pb-geolocation",{coordinates:{latitude:this.latitude,longitude:this.longitude},label:this.label,zoom:this.zoom,popup:this.popup,element:this,event:this.event})),this.auto&&this.waitForChannel(()=>{this.emitTo("pb-geolocation",{coordinates:{latitude:this.latitude,longitude:this.longitude},label:this.label,popup:this.popup,fitBounds:!0,element:this})})}render(){return I`<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 R`
3652
3652
  :host {
3653
3653
  display: inline;
3654
3654
  cursor: pointer;
@@ -3683,14 +3683,14 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3683
3683
  .highlight-off {
3684
3684
  background-color: inherit;
3685
3685
  }
3686
- `}}customElements.define("pb-geolocation",hl);class dl extends(D(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=En.state;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,i=document.importNode(this.template.content,!0),n=document.createElement("div");n.appendChild(i),n.querySelectorAll("[name]").forEach(i=>{const n=void 0===i.name?`${i.attributes.getNamedItem("name").nodeValue}[${e}]`:`${i.name}[${e}]`;t&&t[n]&&("checkbox"===i.type||"radio"===i.type?i.checked=t[n]===i.value:i.value=t[n]),i.name=n}),this._instances.push(n)}_renumber(){this._instances.forEach((t,e)=>{t.querySelectorAll("[name]").forEach(t=>{const i=t.name.replace(/^(.*)\[\d+\]$/,"$1");t.name=`${i}[${e+1}]`})})}delete(t){this._instances.splice(t,1),this._renumber(),this.requestUpdate()}render(){return I`
3686
+ `}}customElements.define("pb-geolocation",pl);class ul extends(D(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=En.state;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,i=document.importNode(this.template.content,!0),n=document.createElement("div");n.appendChild(i),n.querySelectorAll("[name]").forEach(i=>{const n=void 0===i.name?`${i.attributes.getNamedItem("name").nodeValue}[${e}]`:`${i.name}[${e}]`;t&&t[n]&&("checkbox"===i.type||"radio"===i.type?i.checked=t[n]===i.value:i.value=t[n]),i.name=n}),this._instances.push(n)}_renumber(){this._instances.forEach((t,e)=>{t.querySelectorAll("[name]").forEach(t=>{const i=t.name.replace(/^(.*)\[\d+\]$/,"$1");t.name=`${i}[${e+1}]`})})}delete(t){this._instances.splice(t,1),this._renumber(),this.requestUpdate()}render(){return I`
3687
3687
  <div class="instances">${this._instances.map(this.renderInstance.bind(this))}</div>
3688
3688
  <paper-icon-button icon="add" @click="${this.add}"></paper-icon-button>
3689
3689
  `}renderInstance(t,e){return I`
3690
3690
  <div class="instance">
3691
3691
  ${t}
3692
3692
  <paper-icon-button icon="delete" @click="${()=>this.delete(e)}"></paper-icon-button>
3693
- </div>`}createRenderRoot(){return this}}customElements.define("pb-repeat",dl);class pl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{url:{type:String}})}constructor(){super(),this._pan=null}connectedCallback(){super.connectedCallback(),window.ESGlobalBridge.requestAvailability(),window.ESGlobalBridge.instance.load("svg-pan-zoom","https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"),this.subscribeTo("pb-show-annotation",t=>{this.url!==t.detail.file&&(this.url=t.detail.file)})}firstUpdated(){super.firstUpdated(),this.container=this.shadowRoot.getElementById("image")}updated(t){t.has("url")&&this.url&&this.url!==t.get("url")&&this.load()}load(){if(!this.url)return;const t=this.toAbsoluteURL(this.url);console.log("<pb-svg> Loading %s",t),this._pan&&(this._pan.destroy(),this._pan=null,this.container.innerHTML=""),fetch(t).then(t=>t.text()).then(t=>{if(!window.svgPanZoom)return void console.error("<pb-svg> svgPanZoom not available");const e=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;this.container.appendChild(e),this._pan=window.svgPanZoom(e,{controlIconsEnabled:!0,fit:!0,center:!0})})}render(){return I`<div id="image"></div>`}static get styles(){return R`
3693
+ </div>`}createRenderRoot(){return this}}customElements.define("pb-repeat",ul);class gl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{url:{type:String}})}constructor(){super(),this._pan=null}connectedCallback(){super.connectedCallback(),window.ESGlobalBridge.requestAvailability(),window.ESGlobalBridge.instance.load("svg-pan-zoom","https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"),this.subscribeTo("pb-show-annotation",t=>{this.url!==t.detail.file&&(this.url=t.detail.file)})}firstUpdated(){super.firstUpdated(),this.container=this.shadowRoot.getElementById("image")}updated(t){t.has("url")&&this.url&&this.url!==t.get("url")&&this.load()}load(){if(!this.url)return;const t=this.toAbsoluteURL(this.url);console.log("<pb-svg> Loading %s",t),this._pan&&(this._pan.destroy(),this._pan=null,this.container.innerHTML=""),fetch(t).then(t=>t.text()).then(t=>{if(!window.svgPanZoom)return void console.error("<pb-svg> svgPanZoom not available");const e=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;this.container.appendChild(e),this._pan=window.svgPanZoom(e,{controlIconsEnabled:!0,fit:!0,center:!0})})}render(){return I`<div id="image"></div>`}static get styles(){return R`
3694
3694
  :host {
3695
3695
  display: block;
3696
3696
  }
@@ -3699,7 +3699,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3699
3699
  height: var(--pb-svg-height, 100%);
3700
3700
  width: var(--pb-svg-width, 100%);
3701
3701
  }
3702
- `}}customElements.define("pb-svg",pl);class ul extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{showNavigationControl:{type:Boolean,attribute:"show-navigation-control"},showNavigator:{type:Boolean,attribute:"show-navigator"},showSequenceMode:{type:Boolean,attribute:"show-sequence-control"},showHomeControl:{type:Boolean,attribute:"show-home-control"},showFullPageControl:{type:Boolean,attribute:"show-full-page-control"},defaultZoomLevel:{type:Number,attribute:"default-zoom-level"},showRotationControl:{type:Boolean,attribute:"show-rotation-control"},constrainDuringPan:{type:Boolean,attribute:"contrain-during-pan"},visibilityRatio:{type:Number,attribute:"visibility-ratio"},referenceStrip:{type:Boolean,attribute:"reference-strip"},referenceStripSizeRatio:{type:Number,attribute:"reference-strip-size-ratio"},type:{type:String},baseUri:{type:String,attribute:"base-uri"},prefixUrl:{type:String,attribute:"prefix-url"},facsimiles:{type:Array},loaded:{type:Boolean,reflect:!0}})}constructor(){super(),this._facsimiles=[],this.baseUri="",this.type="iiif",this.visibilityRatio=1,this.defaultZoomLevel=0,this.sequenceMode=!1,this.showHomeControl=!1,this.showNavigator=!1,this.showNavigationControl=!1,this.showFullPageControl=!1,this.showRotationControl=!1,this.constrainDuringPan=!1,this.referenceStrip=!1,this.referenceStripSizeRatio=.2,this.prefixUrl="../images/openseadragon/",this.loaded=!1}set facsimiles(t){this._facsimiles=t||[],this.loaded=this._facsimiles.length>0,this.emitTo("pb-facsimile-status",{status:"loading"})}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-start-update",this._clearAll.bind(this)),this.subscribeTo("pb-load-facsimile",t=>{const{element:e,order:i}=t.detail,n=this._facsimiles.map(t=>t.getOrder?t.getOrder():Number.POSITIVE_INFINITY).reduce((t,e,n)=>i<e?t:i===e?n:n+1,0);this._facsimiles.splice(n,0,e),this.loaded=this._facsimiles.length>0,this._facsimileObserver()}),this.subscribeTo("pb-show-annotation",this._showAnnotationListener.bind(this))}firstUpdated(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/openseadragon.min.js");window.ESGlobalBridge.instance.load("openseadragon",t),window.addEventListener("es-bridge-openseadragon-loaded",this._initOpenSeadragon.bind(this),{once:!0})}render(){return I`
3702
+ `}}customElements.define("pb-svg",gl);class fl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{showNavigationControl:{type:Boolean,attribute:"show-navigation-control"},showNavigator:{type:Boolean,attribute:"show-navigator"},showSequenceMode:{type:Boolean,attribute:"show-sequence-control"},showHomeControl:{type:Boolean,attribute:"show-home-control"},showFullPageControl:{type:Boolean,attribute:"show-full-page-control"},defaultZoomLevel:{type:Number,attribute:"default-zoom-level"},showRotationControl:{type:Boolean,attribute:"show-rotation-control"},constrainDuringPan:{type:Boolean,attribute:"contrain-during-pan"},visibilityRatio:{type:Number,attribute:"visibility-ratio"},referenceStrip:{type:Boolean,attribute:"reference-strip"},referenceStripSizeRatio:{type:Number,attribute:"reference-strip-size-ratio"},type:{type:String},baseUri:{type:String,attribute:"base-uri"},prefixUrl:{type:String,attribute:"prefix-url"},facsimiles:{type:Array},loaded:{type:Boolean,reflect:!0}})}constructor(){super(),this._facsimiles=[],this.baseUri="",this.type="iiif",this.visibilityRatio=1,this.defaultZoomLevel=0,this.sequenceMode=!1,this.showHomeControl=!1,this.showNavigator=!1,this.showNavigationControl=!1,this.showFullPageControl=!1,this.showRotationControl=!1,this.constrainDuringPan=!1,this.referenceStrip=!1,this.referenceStripSizeRatio=.2,this.prefixUrl="../images/openseadragon/",this.loaded=!1}set facsimiles(t){this._facsimiles=t||[],this.loaded=this._facsimiles.length>0,this.emitTo("pb-facsimile-status",{status:"loading"})}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-start-update",this._clearAll.bind(this)),this.subscribeTo("pb-load-facsimile",t=>{const{element:e,order:i}=t.detail,n=this._facsimiles.map(t=>t.getOrder?t.getOrder():Number.POSITIVE_INFINITY).reduce((t,e,n)=>i<e?t:i===e?n:n+1,0);this._facsimiles.splice(n,0,e),this.loaded=this._facsimiles.length>0,this._facsimileObserver()}),this.subscribeTo("pb-show-annotation",this._showAnnotationListener.bind(this))}firstUpdated(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/openseadragon.min.js");window.ESGlobalBridge.instance.load("openseadragon",t),window.addEventListener("es-bridge-openseadragon-loaded",this._initOpenSeadragon.bind(this),{once:!0})}render(){return I`
3703
3703
  <slot name="before"></slot>
3704
3704
  <!-- Openseadragon -->
3705
3705
  <div id="viewer" part="image"></div>
@@ -3722,7 +3722,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3722
3722
  max-height: var(--pb-facsimile-height, auto);
3723
3723
  width: 100%;
3724
3724
  }
3725
- `}_initOpenSeadragon(){const t=P(this.prefixUrl+(this.prefixUrl.endsWith("/")?"":"/")),e={element:this.shadowRoot.getElementById("viewer"),prefixUrl:t,preserveViewport:!0,showZoomControl:!0,sequenceMode:this.showSequenceMode,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.referenceStrip&&(e.showReferenceStrip=!0,e.referenceStripSizeRatio=this.referenceStripSizeRatio),this.viewer=OpenSeadragon(e),this.viewer.addHandler("open",()=>{this.resetZoom(),this.emitTo("pb-facsimile-status",{status:"loaded",facsimiles:this._facsimiles})}),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.ownerPage=this.closest("pb-page"),this.ownerPage&&(this.pbPageDisplay=window.getComputedStyle(this.ownerPage).getPropertyValue("display"),this.viewer.addHandler("full-screen",t=>{t.fullScreen?this.ownerPage.style.display="none":(this.viewer.clearOverlays(),this.emitTo("pb-refresh"),this.ownerPage.style.display=this.pbPageDisplay)})),this._facsimileObserver(),this.signalReady()}_facsimileObserver(){if(!this.viewer)return;if(0===this._facsimiles.length)return this.viewer.close();const t=this._facsimiles.map(t=>{const e=this.baseUri+(t.getImage?t.getImage():t);return"iiif"===this.type?e+"/info.json":{tileSource:{type:"image",url:e,buildPyramid:!1}}});this.viewer.open(t),this.viewer.goToPage(0)}_clearAll(){this.viewer&&(this.resetZoom(),this.viewer.clearOverlays(),this.facsimiles=[])}_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 i=t.detail.element?this._pageByElement(t.detail.element):this._pageIndexByUrl(t.detail.file);if(i<0)return console.error("page not found",t.detail);if(this.viewer.currentPage()!==i&&this.viewer.goToPage(i),t.detail.coordinates){const[i,n,r,o]=t.detail.coordinates,s=this.viewer.world.getItemAt(0),a=s.viewportToImageRectangle(s.getBounds(!0));a.containsPoint(new OpenSeadragon.Point(i,n))||this.viewer.viewport.fitBoundsWithConstraints(s.imageToViewportRectangle(i,n,a.width,a.height));const l=document.createElement("div");this.overlay=l,l.id=e;const c=s.imageToViewportRectangle(i,n,r,o);this.viewer.addOverlay({element:l,location:c})}}_pageByElement(t){return this._facsimiles.indexOf(t)}_pageIndexByUrl(t){return this._facsimiles.findIndex(e=>e.getImage()===t)}resetZoom(){this.viewer&&this.viewer.viewport.goHome()}}customElements.get("pb-facsimile")||customElements.define("pb-facsimile",ul);class gl extends(D(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=En.state.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 I`
3725
+ `}_initOpenSeadragon(){const t=P(this.prefixUrl+(this.prefixUrl.endsWith("/")?"":"/")),e={element:this.shadowRoot.getElementById("viewer"),prefixUrl:t,preserveViewport:!0,showZoomControl:!0,sequenceMode:this.showSequenceMode,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.referenceStrip&&(e.showReferenceStrip=!0,e.referenceStripSizeRatio=this.referenceStripSizeRatio),this.viewer=OpenSeadragon(e),this.viewer.addHandler("open",()=>{this.resetZoom(),this.emitTo("pb-facsimile-status",{status:"loaded",facsimiles:this._facsimiles})}),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.ownerPage=this.closest("pb-page"),this.ownerPage&&(this.pbPageDisplay=window.getComputedStyle(this.ownerPage).getPropertyValue("display"),this.viewer.addHandler("full-screen",t=>{t.fullScreen?this.ownerPage.style.display="none":(this.viewer.clearOverlays(),this.emitTo("pb-refresh"),this.ownerPage.style.display=this.pbPageDisplay)})),this._facsimileObserver(),this.signalReady()}_facsimileObserver(){if(!this.viewer)return;if(0===this._facsimiles.length)return this.viewer.close();const t=this._facsimiles.map(t=>{const e=this.baseUri+(t.getImage?t.getImage():t);return"iiif"===this.type?e+"/info.json":{tileSource:{type:"image",url:e,buildPyramid:!1}}});this.viewer.open(t),this.viewer.goToPage(0)}_clearAll(){this.viewer&&(this.resetZoom(),this.viewer.clearOverlays(),this.facsimiles=[])}_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 i=t.detail.element?this._pageByElement(t.detail.element):this._pageIndexByUrl(t.detail.file);if(i<0)return console.error("page not found",t.detail);if(this.viewer.currentPage()!==i&&this.viewer.goToPage(i),t.detail.coordinates){const[i,n,r,o]=t.detail.coordinates,s=this.viewer.world.getItemAt(0),a=s.viewportToImageRectangle(s.getBounds(!0));a.containsPoint(new OpenSeadragon.Point(i,n))||this.viewer.viewport.fitBoundsWithConstraints(s.imageToViewportRectangle(i,n,a.width,a.height));const l=document.createElement("div");this.overlay=l,l.id=e;const c=s.imageToViewportRectangle(i,n,r,o);this.viewer.addOverlay({element:l,location:c})}}_pageByElement(t){return this._facsimiles.indexOf(t)}_pageIndexByUrl(t){return this._facsimiles.findIndex(e=>e.getImage()===t)}resetZoom(){this.viewer&&this.viewer.viewport.goHome()}}customElements.get("pb-facsimile")||customElements.define("pb-facsimile",fl);class ml extends(D(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=En.state.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 I`
3726
3726
  <paper-dropdown-menu id="menu" label="${W(this.label)}">
3727
3727
  <paper-listbox id="endpoints" slot="dropdown-content" class="dropdown-content" selected="${this.endpoint}" attr-for-selected="value"
3728
3728
  @selected-item-changed="${this._selected}">
@@ -3733,7 +3733,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3733
3733
  :host {
3734
3734
  display: block;
3735
3735
  }
3736
- `}_selected(){const t=this.shadowRoot.getElementById("endpoints").selectedItem;if(!t)return;const e=t.getAttribute("value");if(!e)return;const i=this.endpoints.find(t=>t.url===e);En.commit(this,{endpoint:i.url}),console.log("<dts-select-endpoint> Setting endpoint to %s",e),this.emitTo("dts-endpoint",{endpoint:i.url,collection:i.collection,reload:!this.endpoint}),this.endpoint=i.url}}customElements.define("dts-select-endpoint",gl);class fl extends(D(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=En.state.id,this.page=En.state.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,i){i||(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,i=!0){t.preventDefault(),i&&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 i=e["dts:passage"]||e["dts:download"],n=new URL(i,this.baseUri).toString();console.log("<dts-client> downloading %s",n),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={preview:n,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:n,temp:!0}),this.documentsAPI.generateRequest()}_download(t,e){this.emitTo("pb-start-update");const i=e["dts:passage"]||e["dts:download"],n=new URL(i,this.baseUri).toString();console.log("<dts-client> importing %s",n),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={import:n,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:n,temp:!1}),this.documentsAPI.generateRequest()}_update(){this.emitTo("pb-start-update");const t={};this.collection&&(t.id=this.collection),this.page&&(t.page=this.page+1),En.commit(this,t),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.replace(e)}_handleError(t){this.emitTo("pb-end-update");const e=t.target.lastError.response,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("message"),n=document.getElementById("errorDialog"),r=n.querySelector("paper-dialog-scrollable");r.innerHTML=i?i.textContent:t.detail.error.message,n.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 I`
3736
+ `}_selected(){const t=this.shadowRoot.getElementById("endpoints").selectedItem;if(!t)return;const e=t.getAttribute("value");if(!e)return;const i=this.endpoints.find(t=>t.url===e);En.commit(this,{endpoint:i.url}),console.log("<dts-select-endpoint> Setting endpoint to %s",e),this.emitTo("dts-endpoint",{endpoint:i.url,collection:i.collection,reload:!this.endpoint}),this.endpoint=i.url}}customElements.define("dts-select-endpoint",ml);class vl extends(D(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=En.state.id,this.page=En.state.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,i){i||(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,i=!0){t.preventDefault(),i&&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 i=e["dts:passage"]||e["dts:download"],n=new URL(i,this.baseUri).toString();console.log("<dts-client> downloading %s",n),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={preview:n,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:n,temp:!0}),this.documentsAPI.generateRequest()}_download(t,e){this.emitTo("pb-start-update");const i=e["dts:passage"]||e["dts:download"],n=new URL(i,this.baseUri).toString();console.log("<dts-client> importing %s",n),this.lessThanApiVersion("1.0.0")?(this.documentsAPI.url=this.getEndpoint()+"/modules/lib/dts.xql",this.documentsAPI.params={import:n,id:e["@id"]}):(this.documentsAPI.url=this.getEndpoint()+"/api/dts/import",this.documentsAPI.params={uri:n,temp:!1}),this.documentsAPI.generateRequest()}_update(){this.emitTo("pb-start-update");const t={};this.collection&&(t.id=this.collection),this.page&&(t.page=this.page+1),En.commit(this,t),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.replace(e)}_handleError(t){this.emitTo("pb-end-update");const e=t.target.lastError.response,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("message"),n=document.getElementById("errorDialog"),r=n.querySelector("paper-dialog-scrollable");r.innerHTML=i?i.textContent:t.detail.error.message,n.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 I`
3737
3737
  <slot name="toolbar"></slot>
3738
3738
  ${this.baseUri?this._renderClient():""}
3739
3739
 
@@ -3770,7 +3770,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3770
3770
  </h4>
3771
3771
  </a>
3772
3772
  </div>
3773
- `;const e=fl._getLicense(t);return I`
3773
+ `;const e=vl._getLicense(t);return I`
3774
3774
  <iron-icon icon="icons:code"></iron-icon>
3775
3775
  <div class="details">
3776
3776
  <div>
@@ -3779,7 +3779,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3779
3779
  ${t.title}
3780
3780
  </h4>
3781
3781
  </a>
3782
- <p part="creator" class="creator">${fl._getCreator(t)}</p>
3782
+ <p part="creator" class="creator">${vl._getCreator(t)}</p>
3783
3783
  ${e?I`<p part="license" class="license"><a href="${e}">${W("dts.licence")}</a></p>`:""}
3784
3784
  </div>
3785
3785
  <iron-icon title="${W("dts.import")}" icon="icons:file-download"
@@ -3824,7 +3824,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3824
3824
  color: #f6a622;
3825
3825
  font-size: 85%;
3826
3826
  }
3827
- `}}customElements.define("dts-client",fl);class ml extends V{static get properties(){return Object.assign(Object.assign({},super.properties),{},{user:{type:String},hash:{type:String},height:{type:Number},theme:{type:String},preview:{type:Boolean},editable:{type:Boolean}})}constructor(){super(),this.height=256,this.theme="light"}render(){let t=`height=${this.height}&theme-id=${this.theme}&default-tab=html,result`;this.editable&&(t+="&editable=true");const e=`https://codepen.io/${this.user}/embed/${this.preview?"preview/":""}${this.hash}?${t}`;return I`
3827
+ `}}customElements.define("dts-client",vl);class bl extends V{static get properties(){return Object.assign(Object.assign({},super.properties),{},{user:{type:String},hash:{type:String},height:{type:Number},theme:{type:String},preview:{type:Boolean},editable:{type:Boolean}})}constructor(){super(),this.height=256,this.theme="light"}render(){let t=`height=${this.height}&theme-id=${this.theme}&default-tab=html,result`;this.editable&&(t+="&editable=true");const e=`https://codepen.io/${this.user}/embed/${this.preview?"preview/":""}${this.hash}?${t}`;return I`
3828
3828
  <iframe height="${this.height}" scrolling="no" title="${this.labe}l"
3829
3829
  src="${e}" frameborder="no" allowtransparency="true" allowfullscreen>
3830
3830
  Loading codepen ...
@@ -3837,11 +3837,11 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3837
3837
  iframe {
3838
3838
  width: 100%;
3839
3839
  }
3840
- `}}customElements.define("pb-codepen",ml),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 s=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}})),a=/[&<>"']/,l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(t){return d[t]};function u(t,e){if(e){if(a.test(t))return t.replace(l,p)}else if(c.test(t))return t.replace(h,p);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=S(e,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(t){return null}return i}var w={},x=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(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(A,"$1")+e:t+e}function z(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 T(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 M(t,e){if(e<1)return"";for(var i="";e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+t}var O={escape:u,unescape:f,edit:v,cleanUrl:_,resolveUrl:S,noopTest:{exec:function(){}},merge:z,splitCells:C,rtrim:E,findClosingBracket:T,checkSanitizeDeprecation:L,repeatString:M},$=s.defaults,H=O.rtrim,I=O.splitCells,R=O.escape,P=O.findClosingBracket;function V(t,e,i){var n=e.href,r=e.title?R(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:R(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 D=function(){function t(t){this.options=t||$}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:H(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=H(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:I(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]=I(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,s,a,l,c,h=e[0],d=e[2],p=d.length>1,u={type:"list",raw:h,ordered:p,start:p?+d.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]!==d[d.length-1]:p===(1===o[2].length))&&(s=g.slice(v+1).join("\n"),u.raw=u.raw.substring(0,u.raw.length-s.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"),"")),a=f||/\n\n(?!\s*$)/.test(i),v!==m-1&&(f="\n"===i.charAt(i.length-1),a||(a=f)),a&&(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:a,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]):R(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:I(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]=I(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:R(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]):R(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=H(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var r=P(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 s=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(i)?s.slice(1):s.slice(1,-1)),V(e,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},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 V(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=R(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=R(this.options.mangle?e(r[1]):r[1])):i=R(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=R(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=R(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]):R(r[0]):r[0]:R(this.options.smartypants?i(r[0]):r[0]),{type:"text",raw:r[0],text:n}},t}(),F=O.noopTest,B=O.edit,j=O.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:F,table:F,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=B(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=B(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.listItemStart=B(/^( *)(bull)/).replace("bull",q.bullet).getRegex(),q.list=B(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=B(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=B(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=B(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=B(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=B(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:B("^ *(?: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:F,paragraph:B(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:F,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:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};U.punctuation=B(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U._comment=B(q._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),U.em.start=B(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=B(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=B(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=B(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=B(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=B(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.strong.endAst=B(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=B(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=B(U._blockSkip,"g").getRegex(),U.overlapSkip=B(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=B(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=B(U.tag).replace("comment",U._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=B(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=B(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=B(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:B(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=j({},U.normal,{escape:B(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=B(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=j({},U.gfm,{br:B(U.br).replace("{2,}","*").getRegex(),text:B(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var W={block:q,inline:U},Y=s.defaults,G=W.block,K=W.inline,X=O.repeatString;function Z(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 Q(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||Y,this.options.tokenizer=this.options.tokenizer||new D,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:K.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=K.pedantic):this.options.gfm&&(e.block=G.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,s;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):((s=e[e.length-1]).raw+="\n"+n.raw,s.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):((s=e[e.length-1]).raw+="\n"+n.raw,s.text+="\n"+n.text);else if(t){var a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return e},i.inline=function(t){var e,i,n,r,o,s,a=t.length;for(e=0;e<a;e++)switch((s=t[e]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,i=0;i<r;i++)s.tokens.header[i]=[],this.inlineTokens(s.header[i],s.tokens.header[i]);for(r=s.cells.length,i=0;i<r;i++)for(o=s.cells[i],s.tokens.cells[i]=[],n=0;n<o.length;n++)s.tokens.cells[i][n]=[],this.inlineTokens(o[n],s.tokens.cells[i][n]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,i=0;i<r;i++)this.inline(s.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,s,a,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)+"["+X("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)+"["+X("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(s||(a=""),s=!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,a))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,a))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,Q))t=t.substring(r.raw.length),e.push(r);else if(i||!(r=this.tokenizer.url(t,Q))){if(r=this.tokenizer.inlineText(t,n,Z))t=t.substring(r.raw.length),a=r.raw.slice(-1),s=!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:G,inline:K}}}]),t}(),tt=s.defaults,et=O.cleanUrl,it=O.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}(),st=s.defaults,at=O.unescape,lt=function(){function t(t){this.options=t||st,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,s,a,l,c,h,d,p,u,g,f,m,v,b,y,_="",w=t.length;for(i=0;i<w;i++)switch((d=t[i]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(d.tokens),d.depth,at(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",o=d.header.length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(d.tokens.header[n]),{header:!0,align:d.align[n]});for(c+=this.renderer.tablerow(l),h="",o=d.cells.length,n=0;n<o;n++){for(l="",s=(a=d.tokens.cells[n]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:d.align[r]});h+=this.renderer.tablerow(l)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(d.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(p=d.ordered,u=d.start,g=d.loose,o=d.items.length,h="",n=0;n<o;n++)v=(m=d.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,p,u);continue;case"html":_+=this.renderer.html(d.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1<w&&"text"===t[i+1].type;)h+="\n"+((d=t[++i]).tokens?this.parseInline(d.tokens):d.text);_+=e?this.renderer.paragraph(h):h;continue;default:var x='Token with "'+d.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 s='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(s);throw new Error(s)}return r},t}(),ct=O.merge,ht=O.checkSanitizeDeprecation,dt=O.escape,pt=s.getDefaults,ut=s.changeDefaults,gt=s.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 s=0;return ft.walkTokens(n,(function(t){"code"===t.type&&(s++,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===--s&&o()}))}),0))})),void(0===s&&o())}try{var a=J.lex(t,e);return e.walkTokens&&ft.walkTokens(a,e.walkTokens),lt.parse(a,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+dt(t.message+"",!0)+"</pre>";throw t}}return ft.options=ft.setOptions=function(t){return ct(ft.defaults,t),ut(ft.defaults),ft},ft.getDefaults=pt,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),s=0;s<r;s++)o[s]=arguments[s];var a=t.renderer[e].apply(i,o);return!1===a&&(a=n.apply(i,o)),a}};for(var r in t.renderer)n(r);e.renderer=i}(),t.tokenizer&&function(){var i=ft.defaults.tokenizer||new D,n=function(e){var n=i[e];i[e]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.tokenizer[e].apply(i,o);return!1===a&&(a=n.apply(i,o)),a}};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 s,a=r(o.tokens.header);!(s=a()).done;){var l=s.value;ft.walkTokens(l,e)}for(var c,h=r(o.tokens.cells);!(c=h()).done;)for(var d,p=r(c.value);!(d=p()).done;){var u=d.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>"+dt(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=D,ft.Slugger=ot,ft.parse=ft,ft}));const vl=new window.marked.Renderer;function bl(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}vl.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:vl});class yl extends(D(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,B("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=bl(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?I`<div>${K(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",yl);const _l=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const e=t.target;e.emitTo("pb-visible",{data:e.data})}})});class wl extends(D(V)){static get properties(){return Object.assign({data:{type:String}},super.properties)}disconnectedCallback(){super.disconnectedCallback(),_l&&_l.unobserve(this)}firstUpdated(){_l.observe(this)}render(){return I`<slot></slot>`}static get styles(){return R`
3840
+ `}}customElements.define("pb-codepen",bl),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 s=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}})),a=/[&<>"']/,l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(t){return d[t]};function u(t,e){if(e){if(a.test(t))return t.replace(l,p)}else if(c.test(t))return t.replace(h,p);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=S(e,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(t){return null}return i}var w={},x=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(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(A,"$1")+e:t+e}function z(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 T(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 M(t,e){if(e<1)return"";for(var i="";e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+t}var O={escape:u,unescape:f,edit:v,cleanUrl:_,resolveUrl:S,noopTest:{exec:function(){}},merge:z,splitCells:C,rtrim:E,findClosingBracket:T,checkSanitizeDeprecation:L,repeatString:M},$=s.defaults,H=O.rtrim,I=O.splitCells,R=O.escape,P=O.findClosingBracket;function V(t,e,i){var n=e.href,r=e.title?R(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:R(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 D=function(){function t(t){this.options=t||$}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:H(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=H(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:I(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]=I(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,s,a,l,c,h=e[0],d=e[2],p=d.length>1,u={type:"list",raw:h,ordered:p,start:p?+d.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]!==d[d.length-1]:p===(1===o[2].length))&&(s=g.slice(v+1).join("\n"),u.raw=u.raw.substring(0,u.raw.length-s.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"),"")),a=f||/\n\n(?!\s*$)/.test(i),v!==m-1&&(f="\n"===i.charAt(i.length-1),a||(a=f)),a&&(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:a,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]):R(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:I(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]=I(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:R(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]):R(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=H(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var r=P(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 s=e[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(i)?s.slice(1):s.slice(1,-1)),V(e,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},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 V(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=R(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=R(this.options.mangle?e(r[1]):r[1])):i=R(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=R(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=R(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]):R(r[0]):r[0]:R(this.options.smartypants?i(r[0]):r[0]),{type:"text",raw:r[0],text:n}},t}(),F=O.noopTest,B=O.edit,j=O.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:F,table:F,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=B(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=B(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.listItemStart=B(/^( *)(bull)/).replace("bull",q.bullet).getRegex(),q.list=B(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=B(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=B(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=B(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=B(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=B(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:B("^ *(?: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:F,paragraph:B(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:F,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:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};U.punctuation=B(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U._comment=B(q._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),U.em.start=B(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=B(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=B(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=B(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=B(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=B(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.strong.endAst=B(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=B(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=B(U._blockSkip,"g").getRegex(),U.overlapSkip=B(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=B(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=B(U.tag).replace("comment",U._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=B(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=B(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=B(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:B(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=j({},U.normal,{escape:B(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=B(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=j({},U.gfm,{br:B(U.br).replace("{2,}","*").getRegex(),text:B(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var W={block:q,inline:U},Y=s.defaults,G=W.block,K=W.inline,X=O.repeatString;function Z(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 Q(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||Y,this.options.tokenizer=this.options.tokenizer||new D,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:G.normal,inline:K.normal};this.options.pedantic?(e.block=G.pedantic,e.inline=K.pedantic):this.options.gfm&&(e.block=G.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,s;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):((s=e[e.length-1]).raw+="\n"+n.raw,s.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):((s=e[e.length-1]).raw+="\n"+n.raw,s.text+="\n"+n.text);else if(t){var a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return e},i.inline=function(t){var e,i,n,r,o,s,a=t.length;for(e=0;e<a;e++)switch((s=t[e]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,i=0;i<r;i++)s.tokens.header[i]=[],this.inlineTokens(s.header[i],s.tokens.header[i]);for(r=s.cells.length,i=0;i<r;i++)for(o=s.cells[i],s.tokens.cells[i]=[],n=0;n<o.length;n++)s.tokens.cells[i][n]=[],this.inlineTokens(o[n],s.tokens.cells[i][n]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,i=0;i<r;i++)this.inline(s.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,s,a,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)+"["+X("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)+"["+X("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(s||(a=""),s=!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,a))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,a))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,Q))t=t.substring(r.raw.length),e.push(r);else if(i||!(r=this.tokenizer.url(t,Q))){if(r=this.tokenizer.inlineText(t,n,Z))t=t.substring(r.raw.length),a=r.raw.slice(-1),s=!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:G,inline:K}}}]),t}(),tt=s.defaults,et=O.cleanUrl,it=O.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}(),st=s.defaults,at=O.unescape,lt=function(){function t(t){this.options=t||st,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,s,a,l,c,h,d,p,u,g,f,m,v,b,y,_="",w=t.length;for(i=0;i<w;i++)switch((d=t[i]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(d.tokens),d.depth,at(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",o=d.header.length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(d.tokens.header[n]),{header:!0,align:d.align[n]});for(c+=this.renderer.tablerow(l),h="",o=d.cells.length,n=0;n<o;n++){for(l="",s=(a=d.tokens.cells[n]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:d.align[r]});h+=this.renderer.tablerow(l)}_+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(d.tokens),_+=this.renderer.blockquote(h);continue;case"list":for(p=d.ordered,u=d.start,g=d.loose,o=d.items.length,h="",n=0;n<o;n++)v=(m=d.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,p,u);continue;case"html":_+=this.renderer.html(d.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1<w&&"text"===t[i+1].type;)h+="\n"+((d=t[++i]).tokens?this.parseInline(d.tokens):d.text);_+=e?this.renderer.paragraph(h):h;continue;default:var x='Token with "'+d.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 s='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(s);throw new Error(s)}return r},t}(),ct=O.merge,ht=O.checkSanitizeDeprecation,dt=O.escape,pt=s.getDefaults,ut=s.changeDefaults,gt=s.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 s=0;return ft.walkTokens(n,(function(t){"code"===t.type&&(s++,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===--s&&o()}))}),0))})),void(0===s&&o())}try{var a=J.lex(t,e);return e.walkTokens&&ft.walkTokens(a,e.walkTokens),lt.parse(a,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+dt(t.message+"",!0)+"</pre>";throw t}}return ft.options=ft.setOptions=function(t){return ct(ft.defaults,t),ut(ft.defaults),ft},ft.getDefaults=pt,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),s=0;s<r;s++)o[s]=arguments[s];var a=t.renderer[e].apply(i,o);return!1===a&&(a=n.apply(i,o)),a}};for(var r in t.renderer)n(r);e.renderer=i}(),t.tokenizer&&function(){var i=ft.defaults.tokenizer||new D,n=function(e){var n=i[e];i[e]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.tokenizer[e].apply(i,o);return!1===a&&(a=n.apply(i,o)),a}};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 s,a=r(o.tokens.header);!(s=a()).done;){var l=s.value;ft.walkTokens(l,e)}for(var c,h=r(o.tokens.cells);!(c=h()).done;)for(var d,p=r(c.value);!(d=p()).done;){var u=d.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>"+dt(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=D,ft.Slugger=ot,ft.parse=ft,ft}));const yl=new window.marked.Renderer;function _l(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}yl.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:yl});class wl extends(D(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,B("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=_l(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?I`<div>${K(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",wl);const xl=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const e=t.target;e.emitTo("pb-visible",{data:e.data})}})});class kl extends(D(V)){static get properties(){return Object.assign({data:{type:String}},super.properties)}disconnectedCallback(){super.disconnectedCallback(),xl&&xl.unobserve(this)}firstUpdated(){xl.observe(this)}render(){return I`<slot></slot>`}static get styles(){return R`
3841
3841
  :host {
3842
3842
  display: inline;
3843
3843
  }
3844
- `}}function xl(t,e){const i=[];return t.forEach(t=>{let n,r;if("object"==typeof t?(n=t.text,r=t.value):(n=t.toString(),r=n),n.toLowerCase().indexOf(e)>-1){const t={};t.text=n,t.value=r,i.push(t)}}),i}customElements.define("pb-observable",wl);class kl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String}})}constructor(){super(),this.placeholder="search.placeholder",this.suggestions=[],this.lastSelected=null,this.preload=!1,this.substring=!1,this._hiddenInput=null,this._initialized=!1}connectedCallback(){super.connectedCallback()}firstUpdated(){this.closest("iron-form,pb-search,pb-custom-form")||(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this.appendChild(this._hiddenInput));const t=this.shadowRoot.getElementById("autocomplete");if(t.addEventListener("autocomplete-change",this._autocomplete.bind(this)),this.preload&&this.source)this.substring&&(t.queryFn=xl),B("pb-page-ready",()=>{this._sendRequest()});else if(this.value)if(this.source)B("pb-page-ready",()=>{this._sendRequest(this.value)});else{const t=this.shadowRoot.getElementById("search"),e=this.suggestions.find(t=>t.text?t.value===this.value:t===this.value);e&&(t.value=e.text||e,this._hiddenInput&&(this._hiddenInput.value=e.value||e)),this._hiddenInput&&(this._hiddenInput.value=this.value)}}render(){return I`
3844
+ `}}function Al(t,e){const i=[];return t.forEach(t=>{let n,r;if("object"==typeof t?(n=t.text,r=t.value):(n=t.toString(),r=n),n.toLowerCase().indexOf(e)>-1){const t={};t.text=n,t.value=r,i.push(t)}}),i}customElements.define("pb-observable",kl);class Sl extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String}})}constructor(){super(),this.placeholder="search.placeholder",this.suggestions=[],this.lastSelected=null,this.preload=!1,this.substring=!1,this._hiddenInput=null,this._initialized=!1}connectedCallback(){super.connectedCallback()}firstUpdated(){this.closest("iron-form,pb-search,pb-custom-form")||(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this.appendChild(this._hiddenInput));const t=this.shadowRoot.getElementById("autocomplete");if(t.addEventListener("autocomplete-change",this._autocomplete.bind(this)),this.preload&&this.source)this.substring&&(t.queryFn=Al),B("pb-page-ready",()=>{this._sendRequest()});else if(this.value)if(this.source)B("pb-page-ready",()=>{this._sendRequest(this.value)});else{const t=this.shadowRoot.getElementById("search"),e=this.suggestions.find(t=>t.text?t.value===this.value:t===this.value);e&&(t.value=e.text||e,this._hiddenInput&&(this._hiddenInput.value=e.value||e)),this._hiddenInput&&(this._hiddenInput.value=this.value)}}render(){return I`
3845
3845
  <custom-style>
3846
3846
  <style>
3847
3847
  :host {
@@ -3885,7 +3885,7 @@ e({is:"transform-animation",behaviors:[A],configure:function(t){var e=t.node,i=t
3885
3885
  display: block;
3886
3886
  margin-left: 10px;
3887
3887
  }
3888
- `}_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 i=this._getParameters();i.query=t,e.params=i,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){const e=t.lastResponse,i=this.shadowRoot.getElementById("search"),n=e.find(t=>t.text?t.value===this.value:t===this.value);n?(i.value=n.text||n,this._hiddenInput&&(this._hiddenInput.value=n.value||n)):this._hiddenInput&&(this._hiddenInput.value=this.value),this.preload&&(this.suggestions=e)}this._initialized=!0}_getParameters(){const t={};return this.querySelectorAll("[name]").forEach(e=>{t[e.name]=e.value}),t}_autocompleteSelected(t){const{text:e,value:i}=t.detail;this.lastSelected=e;this.shadowRoot.getElementById("search").value=e,this.value=i,this._hiddenInput&&(this._hiddenInput.value=this.value),this.emitTo("pb-autocomplete-selected",{text:e,value:i})}_setInput(t){const e=this.shadowRoot.getElementById("search");if(this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),13===t.keyCode){const t=this.suggestions.find(t=>t.text?t.value===this.value:t===this.value);if(!t)return;t.value?this.emitTo("pb-autocomplete-selected",{text:t.text,value:t.value}):this.emitTo("pb-autocomplete-selected",{text:t,value:t})}}}customElements.define("pb-autocomplete",kl);
3888
+ `}_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 i=this._getParameters();i.query=t,e.params=i,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){const e=t.lastResponse,i=this.shadowRoot.getElementById("search"),n=e.find(t=>t.text?t.value===this.value:t===this.value);n?(i.value=n.text||n,this._hiddenInput&&(this._hiddenInput.value=n.value||n)):this._hiddenInput&&(this._hiddenInput.value=this.value),this.preload&&(this.suggestions=e)}this._initialized=!0}_getParameters(){const t={};return this.querySelectorAll("[name]").forEach(e=>{t[e.name]=e.value}),t}_autocompleteSelected(t){const{text:e,value:i}=t.detail;this.lastSelected=e;this.shadowRoot.getElementById("search").value=e,this.value=i,this._hiddenInput&&(this._hiddenInput.value=this.value),this.emitTo("pb-autocomplete-selected",{text:e,value:i})}_setInput(t){const e=this.shadowRoot.getElementById("search");if(this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),13===t.keyCode){const t=this.suggestions.find(t=>t.text?t.value===this.value:t===this.value);if(!t)return;t.value?this.emitTo("pb-autocomplete-selected",{text:t.text,value:t.value}):this.emitTo("pb-autocomplete-selected",{text:t,value:t})}}}customElements.define("pb-autocomplete",Sl);
3889
3889
  /**
3890
3890
  @license
3891
3891
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -3896,7 +3896,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
3896
3896
  part of the polymer project is also subject to an additional IP rights grant
3897
3897
  found at http://polymer.github.io/PATENTS.txt
3898
3898
  */
3899
- const Al=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-"+Al._labelNumber++;t(this).setAttribute("id",e)}},_findTarget:function(){if(this.for){var e=t(this).getOwnerRoot();return t(e).querySelector("#"+this.for)}var i=t(this).querySelector("[iron-label-target]");return i||(i=t(this).firstElementChild),i},_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()}});Al._labelNumber=0;class Sl extends(D(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))})}),B("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)return;let t=this.toAbsoluteURL(this.source);t+=t.includes("?")?"&":"?",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.map(Sl.jsonEntry2item);console.log("<pb-select> loaded %d items",e.length),this._items=e}).catch(()=>console.error("<pb-select> request to %s failed",t))}static jsonEntry2item(t){return{label:t.text,value:t.value}}_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?I`
3899
+ const zl=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-"+zl._labelNumber++;t(this).setAttribute("id",e)}},_findTarget:function(){if(this.for){var e=t(this).getOwnerRoot();return t(e).querySelector("#"+this.for)}var i=t(this).querySelector("[iron-label-target]");return i||(i=t(this).firstElementChild),i},_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()}});zl._labelNumber=0;class Cl extends(D(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))})}),B("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)return;let t=this.toAbsoluteURL(this.source);t+=t.includes("?")?"&":"?",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.map(Cl.jsonEntry2item);console.log("<pb-select> loaded %d items",e.length),this._items=e}).catch(()=>console.error("<pb-select> request to %s failed",t))}static jsonEntry2item(t){return{label:t.text,value:t.value}}_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?I`
3900
3900
  <slot name="subform"></slot>
3901
3901
  <iron-label for="list" part="label">${W(this.label)}</iron-label>
3902
3902
  ${this.multi?I`<paper-listbox id="list" slot="dropdown-content" class="dropdown-content"
@@ -3939,7 +3939,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
3939
3939
  paper-listbox{
3940
3940
  overflow:auto;
3941
3941
  }
3942
- `}}customElements.define("pb-select",Sl);class zl extends(z(D(V))){static get properties(){return Object.assign({label:{type:String}},super.properties)}constructor(){super(),this.label="clipboard.label"}render(){return I`
3942
+ `}}customElements.define("pb-select",Cl);class El extends(z(D(V))){static get properties(){return Object.assign({label:{type:String}},super.properties)}constructor(){super(),this.label="clipboard.label"}render(){return I`
3943
3943
  <h3>${W(this.label)}</h3>
3944
3944
  <div>
3945
3945
  <slot></slot>
@@ -3961,7 +3961,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
3961
3961
  align-items: center;
3962
3962
  padding: 0 16px;
3963
3963
  }
3964
- `}}customElements.define("pb-clipboard",zl);class Cl{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}get editable(){return!1}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}async select(t){return Promise.resolve(t)}async getRecord(t){return Promise.reject()}}class El extends Cl{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 Tl extends Cl{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 Ll(t="",e){return t.replace(/\${([^}]+)}/g,(t,i)=>{let n;return e[i]&&(n=e[i]),n||""})}function Ml(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 Ol extends Cl{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=Ml(t,".info"),this.detailExpr=Ml(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/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?Ll(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:Ll(this.labelExpr,i),details:Ll(this.detailExpr,i),provider:"airtable"};e.push(n)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((i,n)=>{this.base(this.table).find(t,(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}if(0===Object.keys(o.fields).length)return void n(`No record found for ${t} in table ${this.table}`);let s=[];const a={};this.fields.forEach(t=>{const e=o.get(t);e&&(a[t]=e,s.push(e))});const l=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{a[t]&&(s=s.concat(a[t].split(l)))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),e.innerHTML=Ll(this.infoExpr,a),i({id:o.id,strings:s})})})}}function $l(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 Hl extends Cl{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:$l(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 Il extends Cl{constructor(t){super(t),this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999}async query(t){const e=[],i=this.getRegister(),n=`https://meta.karl-barth.ch/api/${i}?${"bibls"===i?"biblsearch":"search"}=${encodeURIComponent(t)}&perPage=${this._limit}`,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:"string"==typeof r?t[r]:r(t),details:""+t["full-id"],link:`https://meta.karl-barth.ch/${i}/${t.id}`,strings:["string"==typeof r?t[r]:r(t)],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>`:"",s=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${"string"==typeof i?t.data[i]:i(t.data)}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,n({id:t.data["full-id"],strings:["string"==typeof i?t.data[i]:i(t.data)]})})})}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;case"bibl":case"songs":t="asHtml";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;case"bibl":t="bibls";break;default:t=this._register}return t}}class Rl extends Cl{constructor(t){super(t),this._url=t.getAttribute("url")||"https://archives.georgfischer.com/api",this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999,this._provider=t.getAttribute("provider")||t.getAttribute("connector")}async query(t){const e=[],i=this.getRegister(),n=`${this._url}/${i}?search=${encodeURIComponent(t)}&perPage=${this._limit}`,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:`${this._url}/${i}/${t.id}`,strings:[t[r]],provider:this._provider};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>`:"",s=i.data.note_bio?`<p>${i.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${i.wikipediaURL}" target="_blank">${i.data[n]}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,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=`${this._url}/${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"origPlace":case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Pl(t){const e=await fetch(t);return await e.json()}class Vl extends Cl{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Pl(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 Nl extends Cl{constructor(t,e){super(e),this._editable=e.hasAttribute("edit"),this._endpoint=t,this._connectors=Dl(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}get editable(){return this._editable}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,editable:this._editable})}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).catch(()=>null),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.ok?t.json():Promise.reject(Error(t.status.toString()))):Promise.resolve(t)}}function Dl(t,e){const i=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let n;switch(e.getAttribute("connector")){case"GND":n=new Hl(e);break;case"GeoNames":n=new Tl(e);break;case"Airtable":n=new Ol(e);break;case"KBGA":n=new Il(e);break;case"Anton":case"GF":n=new Rl(e);break;case"ReconciliationService":n=new Vl(e);break;case"Custom":n=new Nl(t,e);break;default:n=new El(e)}i.push(n)}),i}class Fl extends(D(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()}),B("pb-page-ready",()=>{Dl(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return I`
3964
+ `}}customElements.define("pb-clipboard",El);class Tl{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}get editable(){return!1}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}async select(t){return Promise.resolve(t)}async getRecord(t){return Promise.reject()}}class Ll extends Tl{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 Ml extends Tl{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 Ol(t="",e){return t.replace(/\${([^}]+)}/g,(t,i)=>{let n;return e[i]&&(n=e[i]),n||""})}function $l(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 Hl extends Tl{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=$l(t,".info"),this.detailExpr=$l(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/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?Ol(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:Ol(this.labelExpr,i),details:Ol(this.detailExpr,i),provider:"airtable"};e.push(n)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((i,n)=>{this.base(this.table).find(t,(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}if(0===Object.keys(o.fields).length)return void n(`No record found for ${t} in table ${this.table}`);let s=[];const a={};this.fields.forEach(t=>{const e=o.get(t);e&&(a[t]=e,s.push(e))});const l=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{a[t]&&(s=s.concat(a[t].split(l)))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),e.innerHTML=Ol(this.infoExpr,a),i({id:o.id,strings:s})})})}}function Il(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 Rl extends Tl{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:Il(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 Pl extends Tl{constructor(t){super(t),this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999}async query(t){const e=[],i=this.getRegister(),n=`https://meta.karl-barth.ch/api/${i}?${"bibls"===i?"biblsearch":"search"}=${encodeURIComponent(t)}&perPage=${this._limit}`,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:"string"==typeof r?t[r]:r(t),details:""+t["full-id"],link:`https://meta.karl-barth.ch/${i}/${t.id}`,strings:["string"==typeof r?t[r]:r(t)],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>`:"",s=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${"string"==typeof i?t.data[i]:i(t.data)}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,n({id:t.data["full-id"],strings:["string"==typeof i?t.data[i]:i(t.data)]})})})}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;case"bibl":case"songs":t="asHtml";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;case"bibl":t="bibls";break;default:t=this._register}return t}}class Vl extends Tl{constructor(t){super(t),this._url=t.getAttribute("url")||"https://archives.georgfischer.com/api",this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999,this._provider=t.getAttribute("provider")||t.getAttribute("connector")}async query(t){const e=[],i=this.getRegister(),n=`${this._url}/${i}?search=${encodeURIComponent(t)}&perPage=${this._limit}`,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:`${this._url}/${i}/${t.id}`,strings:[t[r]],provider:this._provider};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>`:"",s=i.data.note_bio?`<p>${i.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${i.wikipediaURL}" target="_blank">${i.data[n]}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,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=`${this._url}/${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"origPlace":case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Nl(t){const e=await fetch(t);return await e.json()}class Dl extends Tl{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Nl(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 Fl extends Tl{constructor(t,e){super(e),this._editable=e.hasAttribute("edit"),this._endpoint=t,this._connectors=Bl(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}get editable(){return this._editable}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,editable:this._editable})}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).catch(()=>null),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.ok?t.json():Promise.reject(Error(t.status.toString()))):Promise.resolve(t)}}function Bl(t,e){const i=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let n;switch(e.getAttribute("connector")){case"GND":n=new Rl(e);break;case"GeoNames":n=new Ml(e);break;case"Airtable":n=new Hl(e);break;case"KBGA":n=new Pl(e);break;case"Anton":case"GF":n=new Vl(e);break;case"ReconciliationService":n=new Dl(e);break;case"Custom":n=new Fl(t,e);break;default:n=new Ll(e)}i.push(n)}),i}class jl extends(D(V)){static get properties(){return Object.assign({query:{type:String,reflect:!0},sortByLabel:{type:Boolean,attribute:"sort-by-label"},stopwords:{type:String},group:{type:String},_results:{type:Array}},super.properties)}constructor(){super(),this.query="",this.type=null,this.sortByLabel=!1,this._results=[],this._authorities={},this.group="tei"}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()}),B("pb-page-ready",()=>{Bl(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return I`
3965
3965
  <paper-input
3966
3966
  id="query"
3967
3967
  label="${W("annotations.lookup")}"
@@ -3970,7 +3970,11 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
3970
3970
  @change="${this._queryChanged}"
3971
3971
  >
3972
3972
  <iron-icon icon="icons:search" slot="prefix"></iron-icon>
3973
- ${this._authorities[this.type]&&this._authorities[this.type].editable?I`<paper-icon-button icon="icons:add" @click="${this._addEntity}" title="${W("annotations.add-entity")}" slot="suffix"></paper-icon-button>`:null}
3973
+ ${this._authorities[this.type]&&this._authorities[this.type].editable?I`
3974
+ <pb-restricted group="${this.group}" slot="suffix">
3975
+ <paper-icon-button icon="icons:add" @click="${this._addEntity}" title="${W("annotations.add-entity")}"></paper-icon-button>
3976
+ </pb-restricted>
3977
+ `:null}
3974
3978
  </paper-input>
3975
3979
  <slot name="authform"></slot>
3976
3980
  <div id="output">
@@ -3994,13 +3998,16 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
3994
3998
  ${t.provider?I`<div><span class="source" part="source">${t.provider}</span></div>`:null}
3995
3999
  <div><span class="register" part="register">${t.register}</span></div>
3996
4000
 
3997
- ${this._authorities[this.type]&&this._authorities[this.type].editable?I`<div class="icons">
3998
- <paper-icon-button
3999
- icon="editor:mode-edit"
4000
- @click="${()=>this._editEntity(t)}"
4001
- title="${W("annotations.edit-entity")}"
4002
- ></paper-icon-button>
4003
- </div>`:null}
4001
+ ${this._authorities[this.type]&&this._authorities[this.type].editable?I`
4002
+ <pb-restricted group="${this.group}">
4003
+ <div class="icons">
4004
+ <paper-icon-button
4005
+ icon="editor:mode-edit"
4006
+ @click="${()=>this._editEntity(t)}"
4007
+ title="${W("annotations.edit-entity")}"
4008
+ ></paper-icon-button>
4009
+ </div>
4010
+ </pb-restricted>`:null}
4004
4011
  ${t.details?I`<div class="details" part="details">${t.details}</div>`:null}
4005
4012
 
4006
4013
  </li>
@@ -4010,6 +4017,11 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4010
4017
  flex-direction: column;
4011
4018
  }
4012
4019
 
4020
+ header {
4021
+ display: flex;
4022
+ align-items: center;
4023
+ }
4024
+
4013
4025
  .link {
4014
4026
  flex-grow: 2;
4015
4027
  }
@@ -4068,7 +4080,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4068
4080
  .occurrences {
4069
4081
  background-color: var(--pb-color-focus);
4070
4082
  }
4071
- `}}customElements.define("pb-authority-lookup",Fl);class Bl extends(D(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 R`
4083
+ `}}customElements.define("pb-authority-lookup",jl);class ql extends(D(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 R`
4072
4084
  :host {
4073
4085
  display: block;
4074
4086
  max-width:100%;
@@ -4160,7 +4172,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4160
4172
  `)}
4161
4173
  `)}
4162
4174
  </table>
4163
- `}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(){Zs({targets:this.shadowRoot.querySelector("table"),opacity:[0,1],duration:200,delay:200,easing:"linear"})}}customElements.define("pb-blacklab-results",Bl);class jl extends(D(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={},B("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 I`
4175
+ `}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(){Zs({targets:this.shadowRoot.querySelector("table"),opacity:[0,1],duration:200,delay:200,easing:"linear"})}}customElements.define("pb-blacklab-results",ql);class Ul extends(D(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={},B("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 I`
4164
4176
  ${0!==this.hits.length?I`
4165
4177
  <section class="kwic-display">
4166
4178
  <paper-icon-button icon="icons:arrow-back" @click="${this._handlePrev}" ?disabled="${1===this.current}"></paper-icon-button>
@@ -4175,7 +4187,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4175
4187
  padding:0 0.5rem;
4176
4188
  }
4177
4189
 
4178
- `}}function ql(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 Ul(t,e,i){return e&&ql(t.prototype,e),i&&ql(t,i),t}function Wl(){return(Wl=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 Yl(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Gl(t,e)}function Gl(t,e){return(Gl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xl(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 Zl(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 Xl(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)?Xl(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",jl);var Ql,Jl,tc,ec,ic,nc,rc,oc={},sc=[],ac=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function lc(t,e){for(var i in e)t[i]=e[i];return t}function cc(t){var e=t.parentNode;e&&e.removeChild(t)}function hc(t,e,i){var n,r,o,s={};for(o in e)"key"==o?n=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Ql.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return dc(t,s,n,r,null)}function dc(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?++tc:r};return null==r&&null!=Jl.vnode&&Jl.vnode(o),o}function pc(t){return t.children}function uc(t,e){this.props=t,this.context=e}function gc(t,e){if(null==e)return t.__?gc(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?gc(t):null}function fc(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 fc(t)}}function mc(t){(!t.__d&&(t.__d=!0)&&ic.push(t)&&!vc.__r++||nc!==Jl.debounceRendering)&&((nc=Jl.debounceRendering)||setTimeout)(vc)}function vc(){for(var t;vc.__r=ic.length;)t=ic.sort((function(t,e){return t.__v.__b-e.__v.__b})),ic=[],t.some((function(t){var e,i,n,r,o,s;t.__d&&(o=(r=(e=t).__v).__e,(s=e.__P)&&(i=[],(n=lc({},r)).__v=r.__v+1,Sc(s,r,n,e.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,i,null==o?gc(r):o,r.__h),zc(i,r),r.__e!=o&&fc(r)))}))}function bc(t,e,i,n,r,o,s,a,l,c){var h,d,p,u,g,f,m,v=n&&n.__k||sc,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?dc(null,u,null,null,u):Array.isArray(u)?dc(pc,{children:u},null,null,null):u.__b>0?dc(u.type,u.props,u.key,null,u.__v):u)){if(u.__=i,u.__b=i.__b+1,null===(p=v[h])||p&&u.key==p.key&&u.type===p.type)v[h]=void 0;else for(d=0;d<b;d++){if((p=v[d])&&u.key==p.key&&u.type===p.type){v[d]=void 0;break}p=null}Sc(t,u,p=p||oc,r,o,s,a,l,c),g=u.__e,(d=u.ref)&&p.ref!=d&&(m||(m=[]),p.ref&&m.push(p.ref,null,u),m.push(d,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&u.__k===p.__k?u.__d=l=yc(u,l,t):l=_c(t,u,p,v,g,l),"function"==typeof i.type&&(i.__d=l)):l&&p.__e==l&&l.parentNode!=t&&(l=gc(p))}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=gc(n,h+1)),Tc(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Ec(m[h],m[++h],m[++h])}function yc(t,e,i){for(var n,r=t.__k,o=0;r&&o<r.length;o++)(n=r[o])&&(n.__=t,e="function"==typeof n.type?yc(n,e,i):_c(i,n,n,r,n.__e,e));return e}function _c(t,e,i,n,r,o){var s,a,l;if(void 0!==e.__d)s=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),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<n.length;l+=2)if(a==r)break t;t.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function wc(t,e,i){"-"===e[0]?t.setProperty(e,i):t[e]=null==i?"":"number"!=typeof i||ac.test(e)?i:i+"px"}function xc(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||wc(t.style,e,"");if(i)for(e in i)n&&i[e]===n[e]||wc(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?Ac:kc,o):t.removeEventListener(e,o?Ac:kc,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 kc(t){this.l[t.type+!1](Jl.event?Jl.event(t):t)}function Ac(t){this.l[t.type+!0](Jl.event?Jl.event(t):t)}function Sc(t,e,i,n,r,o,s,a,l){var c,h,d,p,u,g,f,m,v,b,y,_,w,x=e.type;if(void 0!==e.constructor)return null;null!=i.__h&&(l=i.__h,a=e.__e=i.__e,e.__h=null,o=[a]),(c=Jl.__b)&&c(e);try{t:if("function"==typeof x){if(m=e.props,v=(c=x.contextType)&&n[c.__c],b=c?v?v.props.value:c.__:n,i.__c?f=(h=e.__c=i.__c).__=h.__E:("prototype"in x&&x.prototype.render?e.__c=h=new x(m,b):(e.__c=h=new uc(m,b),h.constructor=x,h.render=Lc),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=n,d=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=x.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=lc({},h.__s)),lc(h.__s,x.getDerivedStateFromProps(m,h.__s))),p=h.props,u=h.state,d)null==x.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==x.getDerivedStateFromProps&&m!==p&&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&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,u,g)}))}if(h.context=b,h.props=m,h.__v=e,h.__P=t,y=Jl.__r,_=0,"prototype"in x&&x.prototype.render)h.state=h.__s,h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context);else do{h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++_<25);h.state=h.__s,null!=h.getChildContext&&(n=lc(lc({},n),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(p,u)),w=null!=c&&c.type===pc&&null==c.key?c.props.children:c,bc(t,Array.isArray(w)?w:[w],e,i,n,r,o,s,a,l),h.base=e.__e,e.__h=null,h.__h.length&&s.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=Cc(i.__e,e,i,n,r,o,s,l);(c=Jl.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=a,e.__h=!!l,o[o.indexOf(a)]=null),Jl.__e(t,e,i)}}function zc(t,e){Jl.__c&&Jl.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Jl.__e(t,e.__v)}}))}function Cc(t,e,i,n,r,o,s,a){var l,c,h,d=i.props,p=e.props,u=e.type,g=0;if("svg"===u&&(r=!0),null!=o)for(;g<o.length;g++)if((l=o[g])&&"setAttribute"in l==!!u&&(u?l.localName===u:3===l.nodeType)){t=l,o[g]=null;break}if(null==t){if(null===u)return document.createTextNode(p);t=r?document.createElementNS("http://www.w3.org/2000/svg",u):document.createElement(u,p.is&&p),o=null,a=!1}if(null===u)d===p||a&&t.data===p||(t.data=p);else{if(o=o&&Ql.call(t.childNodes),c=(d=i.props||oc).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},g=0;g<t.attributes.length;g++)d[t.attributes[g].name]=t.attributes[g].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||xc(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]||xc(t,o,e[o],i[o],n)}(t,p,d,r,a),h)e.__k=[];else if(g=e.props.children,bc(t,Array.isArray(g)?g:[g],e,i,n,r&&"foreignObject"!==u,o,s,o?o[0]:i.__k&&gc(i,0),a),null!=o)for(g=o.length;g--;)null!=o[g]&&cc(o[g]);a||("value"in p&&void 0!==(g=p.value)&&(g!==t.value||"progress"===u&&!g||"option"===u&&g!==d.value)&&xc(t,"value",g,d.value,!1),"checked"in p&&void 0!==(g=p.checked)&&g!==t.checked&&xc(t,"checked",g,d.checked,!1))}return t}function Ec(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){Jl.__e(t,i)}}function Tc(t,e,i){var n,r;if(Jl.unmount&&Jl.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Ec(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){Jl.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&Tc(n[r],e,"function"!=typeof t.type);i||null==t.__e||cc(t.__e),t.__e=t.__d=void 0}function Lc(t,e,i){return this.constructor(t,i)}function Mc(t,e,i){var n,r,o;Jl.__&&Jl.__(t,e),r=(n="function"==typeof i)?null:i&&i.__k||e.__k,o=[],Sc(e,t=(!n&&i||e).__k=hc(pc,null,[t]),r||oc,oc,void 0!==e.ownerSVGElement,!n&&i?[i]:r?null:e.firstChild?Ql.call(e.childNodes):null,o,!n&&i?i:r?r.__e:e.firstChild,n),zc(o,t)}function Oc(){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)}))}Ql=sc.slice,Jl={__e:function(t,e,i,n){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,n||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},tc=0,ec=function(t){return null!=t&&void 0===t.constructor},uc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=lc({},this.state),"function"==typeof t&&(t=t(lc({},i),this.props)),t&&lc(i,t),null!=t&&this.__v&&(e&&this.__h.push(e),mc(this))},uc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),mc(this))},uc.prototype.render=pc,ic=[],vc.__r=0,rc=0;var $c=function(){function t(t){this._id=void 0,this._id=t||Oc()}return Ul(t,[{key:"id",get:function(){return this._id}}]),t}(),Hc={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"},Ic=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Hc}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}(),Rc=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 Yl(e,t),e}(uc),Pc=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype.render=function(){return hc(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Rc);function Vc(t,e){return hc(Pc,{content:t,parentElement:e})}Pc.defaultProps={parentElement:"span"};var Nc,Dc=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.update(e),i}Yl(e,t);var i=e.prototype;return i.cast=function(t){return t instanceof HTMLElement?Vc(t.outerHTML):t},i.update=function(t){return this.data=this.cast(t),this},e}($c),Fc=function(t){function e(e){var i;return(i=t.call(this)||this)._cells=void 0,i.cells=e||[],i}Yl(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 Dc(t.data)})))},Ul(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}($c),Bc=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 Fc?[e]:[],i}return Yl(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 Fc.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 Fc(t.map((function(t){return new Dc(t)})))})))},Ul(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}($c),jc=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"}(Nc||(Nc={}));var qc=function(t){function e(e){var i;return(i=t.call(this)||this).id=void 0,i._props=void 0,i._props={},i.id=Oc(),e&&i.setProps(e),i}Yl(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},Ul(e,[{key:"props",get:function(){return this._props}}]),e}(jc),Uc=function(t){function e(){return t.apply(this,arguments)||this}return Yl(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 Bc(r.rows.filter((function(t,r){return t.cells.some((function(t,s){if(!t)return!1;if(n&&i&&i[s]&&"object"==typeof i[s]&&i[s].hidden)return!1;var a="";if("function"==typeof o)a=o(t.data,r,s);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(a=l.props.content)}else a=String(t.data);return new RegExp(e,"gi").test(a)}))})))):t;var e,i,n,r,o},Ul(e,[{key:"type",get:function(){return Nc.Filter}}]),e}(qc);function Wc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function Yc(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var Gc,Kc=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(Kl(i))),i}Yl(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)},Ul(e,[{key:"state",get:function(){return this._state}}]),e}(jc),Xc=function(t){function e(){return t.apply(this,arguments)||this}Yl(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}(Kc),Zc=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}(),Qc=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(Zc),Jc=function(t){function e(){return t.apply(this,arguments)||this}return Yl(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)),Wl({},t,e)},Ul(e,[{key:"type",get:function(){return Nc.ServerFilter}}]),e}(qc),th=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}()),eh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e}(Rc);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(Gc||(Gc={}));var ih=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)?(th.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(th.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}(),nh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?hc(pc,{},hc(e.component,Wl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?hc(pc,{},this.config.plugin.list(this.props.position).map((function(e){return hc(e.component,Wl({plugin:e},e.props,t.props.props))}))):null},e}(Rc),rh=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 Qc(n.config.dispatcher),n.store=new Xc(n.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&n.actions.search(o),n.storeUpdatedFn=n.storeUpdated.bind(Kl(n)),n.store.on("updated",n.storeUpdatedFn),r=e.server?new Jc({keyword:e.keyword,url:e.server.url,body:e.server.body}):new Uc({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}Yl(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 Jc&&(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)}))}),hc("div",{className:Wc(Yc("search",this.config.className.search))},hc("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:n,className:Yc(Wc("input"),Wc("search","input")),value:this.store.state.keyword}))},e}(eh);rh.defaultProps={debounceTimeout:250};var oh=function(t){function e(){return t.apply(this,arguments)||this}Yl(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 Bc(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},Ul(e,[{key:"type",get:function(){return Nc.Limit}}]),e}(qc),sh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(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)),Wl({},t,e)},Ul(e,[{key:"type",get:function(){return Nc.ServerLimit}}]),e}(qc),ah=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}Yl(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 sh({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 oh({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)),hc(pc,null,this.pages>e&&this.state.page-i>0&&hc(pc,null,hc("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")),hc("button",{tabIndex:-1,className:Yc(Wc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-i)})).map((function(e){return hc("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:Yc(t.state.page===e?Yc(Wc("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&&hc(pc,null,hc("button",{tabIndex:-1,className:Yc(Wc("spread"),this.config.className.paginationButton)},"..."),hc("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 hc(pc,null,this.props.summary&&this.state.total>0&&hc("div",{role:"status","aria-live":"polite",className:Yc(Wc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",hc("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",hc("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",hc("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},i.render=function(){return this.props.enabled?hc("div",{className:Yc(Wc("pagination"),this.config.className.pagination)},this.renderSummary(),hc("div",{className:Wc("pages")},this.props.prevButton&&hc("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:Yc(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&hc("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:Yc(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},Ul(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(eh);function lh(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function ch(t){return t?Math.floor(t)+"px":""}ah.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var hh=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}Yl(e,t);var i=e.prototype;return i.widths=function(){this.tableElement.className=this.tableClassName+" "+Wc("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",Wl(((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?hc("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Rc);function dh(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 ph=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}Yl(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 s=i.clientWidth,a={current:null},l={};if(n.current&&o){var c=hc(hh,{tableRef:n});c.ref=a,Mc(c,r.current),l=a.current.widths()}for(var h,d=Zl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=d()).done;){var p=h.value;p.columns&&p.columns.length>0||(!p.width&&o?p.id in l&&(p.width=ch(l[p.id].width),p.minWidth=ch(l[p.id].minWidth)):p.width=ch(lh(p.width,s)))}return n.current&&o&&Mc(null,r.current),this},i.setSort=function(t,e){for(var i,n=Zl(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=Wl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},i.setFixedHeader=function(t,e){for(var i,n=Zl(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=Zl(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=Zl(t||this.columns||[]);!(e=i()).done;){var n=e.value;n.id||"string"!=typeof n.name||(n.id=dh(n.name)),n.id||th.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=Zl(e);!(i=n()).done;){var r=i.value;void 0!==r.plugin&&t.plugin.add(Wl({id:r.id,props:{}},r.plugin,{position:Gc.Cell}))}},e.fromColumns=function(t){for(var i,n=new e,r=Zl(t);!(i=r()).done;){var o=i.value;if("string"==typeof o||ec(o))n.columns.push({name:o});else if("object"==typeof o){var s=o;s.columns&&(s.columns=e.fromColumns(s.columns).columns),"object"==typeof s.plugin&&void 0===s.data&&(s.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=Zl(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=Zl(i);!(r=o()).done;){var s=r.value;s.columns&&s.columns.length&&(n=n.concat(s.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=Zl(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},Ul(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}($c),uh=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}(),gh=function(){},fh=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.set(e),i}Yl(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}(gh),mh=function(t){function e(e){var i;return(i=t.call(this)||this).options=void 0,i.options=e,i}Yl(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():(th.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},i.get=function(t){var e=Wl({},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}(gh),vh=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new fh(t.data)),t.from&&(e=new fh(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new mh(t.server)),e||th.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,i,n=[],r=Zl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,s=[],a=Zl(e.value.querySelectorAll("td"));!(o=a()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?s.push((i=l.innerHTML,(new DOMParser).parseFromString(i,"text/html").documentElement.textContent)):s.push(Vc(l.innerHTML))}n.push(s)}return n},t}(),bh="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function yh(t,e,i){if(!t.s){if(i instanceof _h){if(!i.s)return void(i.o=yh.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(yh.bind(null,t,e),yh.bind(null,t,2));t.s=e,t.v=i;var n=t.o;n&&n(t)}}var _h=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{yh(n,1,o(this.v))}catch(t){yh(n,2,t)}return n}return this}return this.o=function(t){try{var r=t.v;1&t.s?yh(n,1,e?e(r):r):i?yh(n,1,i(r)):yh(n,2,r)}catch(t){yh(n,2,t)}},n},t}();function wh(t){return t instanceof _h&&1&t.s}var xh,kh=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}Yl(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(Nc).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,s=function(t,i){try{var s=function(t,e,i){if("function"==typeof t[bh]){var n,r,o,s=t[bh]();if(function t(i){try{for(;!(n=s.next()).done;)if((i=e(n.value))&&i.then){if(!wh(i))return void i.then(t,o||(o=yh.bind(null,r=new _h,2)));i=i.v}r?yh(r,1,i):r=i}catch(t){yh(r||(r=new _h),2,t)}}(),s.return){var a=function(t){try{n.done||s.return()}catch(t){}return t};if(r&&r.then)return r.then(a,(function(t){throw a(t)}));a()}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(s){try{for(;++o<t.length;)if((s=e(o))&&s.then){if(!wh(s))return void s.then(i,r||(r=yh.bind(null,n=new _h,2)));s=s.v}n?yh(n,1,s):n=s}catch(t){yh(n||(n=new _h),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 s&&s.then?s.then(void 0,i):s}(0,(function(t){throw th.error(t),e.emit("error",o),t}));return Promise.resolve(s&&s.then?s.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)},Ul(e,[{key:"steps",get:function(){for(var t,e=[],i=Zl(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}(jc),Ah=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},Ul(e,[{key:"type",get:function(){return Nc.Extractor}}]),e}(qc),Sh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype._process=function(t){var e=Bc.fromArray(t.data);return e.length=t.total,e},Ul(e,[{key:"type",get:function(){return Nc.Transformer}}]),e}(qc),zh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(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 Wl({},t,((i={})[e[0]]=e[1],i))}),{})},Ul(e,[{key:"type",get:function(){return Nc.Initiator}}]),e}(qc),Ch=function(t){function e(){return t.apply(this,arguments)||this}Yl(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=ph.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]:(th.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}},Ul(e,[{key:"type",get:function(){return Nc.Transformer}}]),e}(qc),Eh=function(){function t(){}return t.createFromConfig=function(t){var e=new kh;return t.storage instanceof mh&&e.register(new zh({serverStorageOptions:t.server})),e.register(new Ah({storage:t.storage})),e.register(new Ch({header:t.header})),e.register(new Sh),e},t}(),Th=function(){function t(e){this._userConfig=void 0,Object.assign(this,Wl({},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=Wl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new ih,dispatcher:new uh,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:ph.fromUserConfig(i)}),i.assign({storage:vh.createFromUserConfig(e)}),i.assign({pipeline:Eh.createFromConfig(i)}),i.assign({translator:new Ic(e.language)}),i.plugin.add({id:"search",position:Gc.Header,component:rh,props:Wl({enabled:!0===e.search||e.search instanceof Object},e.search)}),i.plugin.add({id:"pagination",position:Gc.Footer,component:ah,props:Wl({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"}(xh||(xh={}));var Lh,Mh,Oh,$h=function(t){function e(){return t.apply(this,arguments)||this}Yl(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?hc(nh,{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 hc("td",Wl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:Yc(Wc("td"),this.props.className,this.config.className.td),style:Wl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Rc),Hh=function(t){function e(){return t.apply(this,arguments)||this}Yl(e,t);var i=e.prototype;return i.getColumn=function(t){if(this.props.header){var e=ph.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:hc(pc,null,this.props.row.cells.map((function(e,i){var n=t.getColumn(i);return n&&n.hidden?null:hc($h,{key:e.id,cell:e,row:t.props.row,column:n})})))},i.render=function(){return hc("tr",{className:Yc(Wc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Rc),Ih=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype.render=function(){return hc(Hh,{messageRow:!0},hc($h,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Dc(this.props.message),className:Yc(Wc("message"),this.props.className?this.props.className:null)}))},e}(Rc),Rh=function(t){function e(){return t.apply(this,arguments)||this}Yl(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 hc("tbody",{className:Yc(Wc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return hc(Hh,{key:e.id,row:e,header:t.props.header})})),this.props.status===xh.Loading&&(!this.props.data||0===this.props.data.length)&&hc(Ih,{message:this._("loading"),colSpan:this.headerLength(),className:Yc(Wc("loading"),this.config.className.loading)}),this.props.status===xh.Rendered&&this.props.data&&0===this.props.data.length&&hc(Ih,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:Yc(Wc("notfound"),this.config.className.notfound)}),this.props.status===xh.Error&&hc(Ih,{message:this._("error"),colSpan:this.headerLength(),className:Yc(Wc("error"),this.config.className.error)}))},e}(Rc),Ph=function(t){function e(){return t.apply(this,arguments)||this}Yl(e,t);var i=e.prototype;return i.validateProps=function(){for(var t,e=Zl(this.props.columns);!(t=e()).done;){var i=t.value;void 0===i.direction&&(i.direction=1),1!==i.direction&&-1!==i.direction&&th.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=Zl(this.props.columns);!(i=r()).done;){var o=i.value;if(0!==n)break;var s=t.cells[o.index].data,a=e.cells[o.index].data;n|="function"==typeof o.compare?o.compare(s,a)*o.direction:this.compare(s,a)*o.direction}return n},i._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var i=new Bc(e);return i.length=t.length,i},Ul(e,[{key:"type",get:function(){return Nc.Sort}}]),e}(qc),Vh=function(t){function e(){return t.apply(this,arguments)||this}Yl(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,s=r.find((function(e){return e.index===t})),a=!1,l=!1,c=!1,h=!1;if(void 0!==s?i?-1===s.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,a=!0):0===o?a=!0:o>0&&!i?(a=!0,l=!0):o>0&&i&&(a=!0),l&&(r=[]),a)r.push({index:t,direction:e,compare:n});else if(h){var d=r.indexOf(s);r[d].direction=e}else if(c){var p=r.indexOf(s);r.splice(p,1)}this.setState(r)},e}(Kc),Nh=function(t){function e(){return t.apply(this,arguments)||this}Yl(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}(Zc),Dh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(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)),Wl({},t,e)},Ul(e,[{key:"type",get:function(){return Nc.ServerSort}}]),e}(qc),Fh=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 Nh(n.config.dispatcher),n.store=new Vh(n.config.dispatcher),e.enabled&&(n.sortProcessor=n.getOrCreateSortProcessor(),n.updateStateFn=n.updateState.bind(Kl(n)),n.store.on("updated",n.updateStateFn),n.state={direction:0}),n}Yl(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=Nc.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Nc.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===Nc.ServerSort?new Dh(Wl({columns:this.store.state},this.config.sort.server)):new Ph({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"),hc("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:Yc(Wc("sort"),Wc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Rc),Bh=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}Yl(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 hc("div",{className:Yc(Wc("th"),Wc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Rc),jh=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}Yl(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?hc(nh,{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),hc("th",Wl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:Yc(Wc("th"),this.isSortable()?Wc("th","sort"):null,this.props.column.fixedHeader?Wc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:Wl({},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),hc("div",{className:Wc("th","content")},this.content()),this.isSortable()&&hc(Fh,Wl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&hc(Bh,{column:this.props.column,thRef:this.thRef}))},e}(Rc),qh=function(t){function e(){return t.apply(this,arguments)||this}Yl(e,t);var i=e.prototype;return i.renderColumn=function(t,e,i,n){var r=function(t,e,i){var n=ph.maximumDepth(t),r=i-e;return{rowSpan:Math.floor(r-n-n/r),colSpan:t.columns&&t.columns.length||1}}(t,e,n);return hc(jh,{column:t,index:i,colSpan:r.colSpan,rowSpan:r.rowSpan})},i.renderRow=function(t,e,i){var n=this,r=ph.leafColumns(this.props.header.columns);return hc(Hh,null,t.map((function(t){return t.hidden?null:n.renderColumn(t,e,r.indexOf(t),i)})))},i.renderRows=function(){var t=this,e=ph.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?hc("thead",{key:this.props.header.id,className:Yc(Wc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Rc),Uh=function(t){function e(){return t.apply(this,arguments)||this}return Yl(e,t),e.prototype.render=function(){return hc("table",{role:"grid",className:Yc(Wc("table"),this.config.className.table),style:Wl({},this.config.style.table,{height:this.props.height})},hc(qh,{header:this.props.header}),hc(Rh,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Rc),Wh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).headerRef={current:null},n.state={isActive:!0},n}Yl(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?hc("div",{ref:this.headerRef,className:Yc(Wc("head"),this.config.className.header),style:Wl({},this.config.style.header)},hc(nh,{position:Gc.Header})):null},e}(Rc),Yh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).footerRef={current:null},n.state={isActive:!0},n}Yl(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?hc("div",{ref:this.footerRef,className:Yc(Wc("footer"),this.config.className.footer),style:Wl({},this.config.style.footer)},hc(nh,{position:Gc.Footer})):null},e}(Rc),Gh=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"+rc++,__: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(mc)},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:xh.Loading,header:e.header,data:null},n}Yl(e,t);var i=e.prototype;return i.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:xh.Loading});var e=function(e,i){try{var n=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:xh.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){th.error(e),t.setState({status:xh.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!=xh.Rendered&&this.state.status==xh.Loaded&&(this.setState({status:xh.Rendered}),this.props.config.eventEmitter.emit("ready"))},i.render=function(){return hc(this.configContext.Provider,{value:this.props.config},hc("div",{role:"complementary",className:Yc("gridjs",Wc("container"),this.state.status===xh.Loading?Wc("loading"):null,this.props.config.className.container),style:Wl({},this.props.config.style.container,{width:this.props.width})},this.state.status===xh.Loading&&hc("div",{className:Wc("loading-bar")}),hc(Wh,null),hc("div",{className:Wc("wrapper"),style:{height:this.props.height}},hc(Uh,{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})),hc(Yh,null),hc("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:Wc("temp")})))},e}(Rc),Kh=function(t){function e(e){var i;return(i=t.call(this)||this).config=void 0,i.plugin=void 0,i.config=new Th({instance:Kl(i),eventEmitter:Kl(i)}).update(e),i.plugin=i.config.plugin,i}Yl(e,t);var i=e.prototype;return i.updateConfig=function(t){return this.config.update(t),this},i.createElement=function(){return hc(Gh,{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||th.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),Mc(null,this.config.container),Mc(this.createElement(),this.config.container),this},i.render=function(t){return t||th.error("Container element cannot be null",!0),t.childNodes.length>0?(th.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,Mc(this.createElement(),t),this)},e}(jc),Xh=[],Zh=[],Qh=Jl.__b,Jh=Jl.__r,td=Jl.diffed,ed=Jl.__c,id=Jl.unmount;function nd(){for(var t;t=Xh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(od),t.__H.__h.forEach(sd),t.__H.__h=[]}catch(e){t.__H.__h=[],Jl.__e(e,t.__v)}}Jl.__b=function(t){Lh=null,Qh&&Qh(t)},Jl.__r=function(t){Jh&&Jh(t),0;var e=(Lh=t.__c).__H;e&&(Mh===Lh?(e.__h=[],Lh.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Zh,t.__N=t.i=void 0}))):(e.__h.forEach(od),e.__h.forEach(sd),e.__h=[])),Mh=Lh},Jl.diffed=function(t){td&&td(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Xh.push(e)&&Oh===Jl.requestAnimationFrame||((Oh=Jl.requestAnimationFrame)||function(t){var e,i=function(){clearTimeout(n),rd&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,100);rd&&(e=requestAnimationFrame(i))})(nd)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Zh&&(t.__=t.__V),t.i=void 0,t.__V=Zh}))),Mh=Lh=null},Jl.__c=function(t,e){e.some((function(t){try{t.__h.forEach(od),t.__h=t.__h.filter((function(t){return!t.__||sd(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Jl.__e(i,t.__v)}})),ed&&ed(t,e)},Jl.unmount=function(t){id&&id(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{od(t)}catch(t){e=t}})),e&&Jl.__e(e,i.__v))};var rd="function"==typeof requestAnimationFrame;function od(t){var e=Lh,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Lh=e}function sd(t){var e=Lh;t.__c=t.__(),Lh=e}class ad 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=>Vc(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",ad);class ld extends(D(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}async connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),En.subscribe(this,t=>{this._params=t,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}const t=await E([P(this.cssPath)+"/mermaid.min.css"]),e=O(this),i=[...this.shadowRoot.adoptedStyleSheets,t];e&&i.push(e),this.shadowRoot.adoptedStyleSheets=i}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),i=[];e.forEach(t=>i.push(t.data())),B("pb-page-ready",()=>{this._params=En.state;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,En.commit(this,this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new Kh(n),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){return I`
4190
+ `}}function Wl(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 Yl(t,e,i){return e&&Wl(t.prototype,e),i&&Wl(t,i),t}function Gl(){return(Gl=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 Kl(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Xl(t,e)}function Xl(t,e){return(Xl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ql(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 Jl(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 Ql(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)?Ql(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",Ul);var tc,ec,ic,nc,rc,oc,sc,ac={},lc=[],cc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function hc(t,e){for(var i in e)t[i]=e[i];return t}function dc(t){var e=t.parentNode;e&&e.removeChild(t)}function pc(t,e,i){var n,r,o,s={};for(o in e)"key"==o?n=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?tc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return uc(t,s,n,r,null)}function uc(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?++ic:r};return null==r&&null!=ec.vnode&&ec.vnode(o),o}function gc(t){return t.children}function fc(t,e){this.props=t,this.context=e}function mc(t,e){if(null==e)return t.__?mc(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?mc(t):null}function vc(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 vc(t)}}function bc(t){(!t.__d&&(t.__d=!0)&&rc.push(t)&&!yc.__r++||oc!==ec.debounceRendering)&&((oc=ec.debounceRendering)||setTimeout)(yc)}function yc(){for(var t;yc.__r=rc.length;)t=rc.sort((function(t,e){return t.__v.__b-e.__v.__b})),rc=[],t.some((function(t){var e,i,n,r,o,s;t.__d&&(o=(r=(e=t).__v).__e,(s=e.__P)&&(i=[],(n=hc({},r)).__v=r.__v+1,Cc(s,r,n,e.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,i,null==o?mc(r):o,r.__h),Ec(i,r),r.__e!=o&&vc(r)))}))}function _c(t,e,i,n,r,o,s,a,l,c){var h,d,p,u,g,f,m,v=n&&n.__k||lc,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?uc(null,u,null,null,u):Array.isArray(u)?uc(gc,{children:u},null,null,null):u.__b>0?uc(u.type,u.props,u.key,null,u.__v):u)){if(u.__=i,u.__b=i.__b+1,null===(p=v[h])||p&&u.key==p.key&&u.type===p.type)v[h]=void 0;else for(d=0;d<b;d++){if((p=v[d])&&u.key==p.key&&u.type===p.type){v[d]=void 0;break}p=null}Cc(t,u,p=p||ac,r,o,s,a,l,c),g=u.__e,(d=u.ref)&&p.ref!=d&&(m||(m=[]),p.ref&&m.push(p.ref,null,u),m.push(d,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&u.__k===p.__k?u.__d=l=wc(u,l,t):l=xc(t,u,p,v,g,l),"function"==typeof i.type&&(i.__d=l)):l&&p.__e==l&&l.parentNode!=t&&(l=mc(p))}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=mc(n,h+1)),Mc(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Lc(m[h],m[++h],m[++h])}function wc(t,e,i){for(var n,r=t.__k,o=0;r&&o<r.length;o++)(n=r[o])&&(n.__=t,e="function"==typeof n.type?wc(n,e,i):xc(i,n,n,r,n.__e,e));return e}function xc(t,e,i,n,r,o){var s,a,l;if(void 0!==e.__d)s=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),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<n.length;l+=2)if(a==r)break t;t.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function kc(t,e,i){"-"===e[0]?t.setProperty(e,i):t[e]=null==i?"":"number"!=typeof i||cc.test(e)?i:i+"px"}function Ac(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||kc(t.style,e,"");if(i)for(e in i)n&&i[e]===n[e]||kc(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?zc:Sc,o):t.removeEventListener(e,o?zc:Sc,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 Sc(t){this.l[t.type+!1](ec.event?ec.event(t):t)}function zc(t){this.l[t.type+!0](ec.event?ec.event(t):t)}function Cc(t,e,i,n,r,o,s,a,l){var c,h,d,p,u,g,f,m,v,b,y,_,w,x=e.type;if(void 0!==e.constructor)return null;null!=i.__h&&(l=i.__h,a=e.__e=i.__e,e.__h=null,o=[a]),(c=ec.__b)&&c(e);try{t:if("function"==typeof x){if(m=e.props,v=(c=x.contextType)&&n[c.__c],b=c?v?v.props.value:c.__:n,i.__c?f=(h=e.__c=i.__c).__=h.__E:("prototype"in x&&x.prototype.render?e.__c=h=new x(m,b):(e.__c=h=new fc(m,b),h.constructor=x,h.render=Oc),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=n,d=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=x.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=hc({},h.__s)),hc(h.__s,x.getDerivedStateFromProps(m,h.__s))),p=h.props,u=h.state,d)null==x.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==x.getDerivedStateFromProps&&m!==p&&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&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,u,g)}))}if(h.context=b,h.props=m,h.__v=e,h.__P=t,y=ec.__r,_=0,"prototype"in x&&x.prototype.render)h.state=h.__s,h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context);else do{h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++_<25);h.state=h.__s,null!=h.getChildContext&&(n=hc(hc({},n),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(p,u)),w=null!=c&&c.type===gc&&null==c.key?c.props.children:c,_c(t,Array.isArray(w)?w:[w],e,i,n,r,o,s,a,l),h.base=e.__e,e.__h=null,h.__h.length&&s.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=Tc(i.__e,e,i,n,r,o,s,l);(c=ec.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=a,e.__h=!!l,o[o.indexOf(a)]=null),ec.__e(t,e,i)}}function Ec(t,e){ec.__c&&ec.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ec.__e(t,e.__v)}}))}function Tc(t,e,i,n,r,o,s,a){var l,c,h,d=i.props,p=e.props,u=e.type,g=0;if("svg"===u&&(r=!0),null!=o)for(;g<o.length;g++)if((l=o[g])&&"setAttribute"in l==!!u&&(u?l.localName===u:3===l.nodeType)){t=l,o[g]=null;break}if(null==t){if(null===u)return document.createTextNode(p);t=r?document.createElementNS("http://www.w3.org/2000/svg",u):document.createElement(u,p.is&&p),o=null,a=!1}if(null===u)d===p||a&&t.data===p||(t.data=p);else{if(o=o&&tc.call(t.childNodes),c=(d=i.props||ac).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},g=0;g<t.attributes.length;g++)d[t.attributes[g].name]=t.attributes[g].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||Ac(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]||Ac(t,o,e[o],i[o],n)}(t,p,d,r,a),h)e.__k=[];else if(g=e.props.children,_c(t,Array.isArray(g)?g:[g],e,i,n,r&&"foreignObject"!==u,o,s,o?o[0]:i.__k&&mc(i,0),a),null!=o)for(g=o.length;g--;)null!=o[g]&&dc(o[g]);a||("value"in p&&void 0!==(g=p.value)&&(g!==t.value||"progress"===u&&!g||"option"===u&&g!==d.value)&&Ac(t,"value",g,d.value,!1),"checked"in p&&void 0!==(g=p.checked)&&g!==t.checked&&Ac(t,"checked",g,d.checked,!1))}return t}function Lc(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){ec.__e(t,i)}}function Mc(t,e,i){var n,r;if(ec.unmount&&ec.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Lc(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){ec.__e(t,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&Mc(n[r],e,"function"!=typeof t.type);i||null==t.__e||dc(t.__e),t.__e=t.__d=void 0}function Oc(t,e,i){return this.constructor(t,i)}function $c(t,e,i){var n,r,o;ec.__&&ec.__(t,e),r=(n="function"==typeof i)?null:i&&i.__k||e.__k,o=[],Cc(e,t=(!n&&i||e).__k=pc(gc,null,[t]),r||ac,ac,void 0!==e.ownerSVGElement,!n&&i?[i]:r?null:e.firstChild?tc.call(e.childNodes):null,o,!n&&i?i:r?r.__e:e.firstChild,n),Ec(o,t)}function Hc(){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)}))}tc=lc.slice,ec={__e:function(t,e,i,n){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,n||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},ic=0,nc=function(t){return null!=t&&void 0===t.constructor},fc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=hc({},this.state),"function"==typeof t&&(t=t(hc({},i),this.props)),t&&hc(i,t),null!=t&&this.__v&&(e&&this.__h.push(e),bc(this))},fc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),bc(this))},fc.prototype.render=gc,rc=[],yc.__r=0,sc=0;var Ic=function(){function t(t){this._id=void 0,this._id=t||Hc()}return Yl(t,[{key:"id",get:function(){return this._id}}]),t}(),Rc={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"},Pc=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Rc}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}(),Vc=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 Kl(e,t),e}(fc),Nc=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype.render=function(){return pc(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Vc);function Dc(t,e){return pc(Nc,{content:t,parentElement:e})}Nc.defaultProps={parentElement:"span"};var Fc,Bc=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.update(e),i}Kl(e,t);var i=e.prototype;return i.cast=function(t){return t instanceof HTMLElement?Dc(t.outerHTML):t},i.update=function(t){return this.data=this.cast(t),this},e}(Ic),jc=function(t){function e(e){var i;return(i=t.call(this)||this)._cells=void 0,i.cells=e||[],i}Kl(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 Bc(t.data)})))},Yl(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(Ic),qc=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 jc?[e]:[],i}return Kl(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 jc.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 jc(t.map((function(t){return new Bc(t)})))})))},Yl(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}(Ic),Uc=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"}(Fc||(Fc={}));var Wc=function(t){function e(e){var i;return(i=t.call(this)||this).id=void 0,i._props=void 0,i._props={},i.id=Hc(),e&&i.setProps(e),i}Kl(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},Yl(e,[{key:"props",get:function(){return this._props}}]),e}(Uc),Yc=function(t){function e(){return t.apply(this,arguments)||this}return Kl(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 qc(r.rows.filter((function(t,r){return t.cells.some((function(t,s){if(!t)return!1;if(n&&i&&i[s]&&"object"==typeof i[s]&&i[s].hidden)return!1;var a="";if("function"==typeof o)a=o(t.data,r,s);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(a=l.props.content)}else a=String(t.data);return new RegExp(e,"gi").test(a)}))})))):t;var e,i,n,r,o},Yl(e,[{key:"type",get:function(){return Fc.Filter}}]),e}(Wc);function Gc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function Kc(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var Xc,Zc=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(Zl(i))),i}Kl(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)},Yl(e,[{key:"state",get:function(){return this._state}}]),e}(Uc),Qc=function(t){function e(){return t.apply(this,arguments)||this}Kl(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}(Zc),Jc=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}(),th=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(Jc),eh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(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)),Gl({},t,e)},Yl(e,[{key:"type",get:function(){return Fc.ServerFilter}}]),e}(Wc),ih=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}()),nh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e}(Vc);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(Xc||(Xc={}));var rh=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)?(ih.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(ih.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}(),oh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?pc(gc,{},pc(e.component,Gl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?pc(gc,{},this.config.plugin.list(this.props.position).map((function(e){return pc(e.component,Gl({plugin:e},e.props,t.props.props))}))):null},e}(Vc),sh=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 th(n.config.dispatcher),n.store=new Qc(n.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&n.actions.search(o),n.storeUpdatedFn=n.storeUpdated.bind(Zl(n)),n.store.on("updated",n.storeUpdatedFn),r=e.server?new eh({keyword:e.keyword,url:e.server.url,body:e.server.body}):new Yc({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}Kl(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 eh&&(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)}))}),pc("div",{className:Gc(Kc("search",this.config.className.search))},pc("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:n,className:Kc(Gc("input"),Gc("search","input")),value:this.store.state.keyword}))},e}(nh);sh.defaultProps={debounceTimeout:250};var ah=function(t){function e(){return t.apply(this,arguments)||this}Kl(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 qc(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},Yl(e,[{key:"type",get:function(){return Fc.Limit}}]),e}(Wc),lh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(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)),Gl({},t,e)},Yl(e,[{key:"type",get:function(){return Fc.ServerLimit}}]),e}(Wc),ch=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}Kl(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 lh({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 ah({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)),pc(gc,null,this.pages>e&&this.state.page-i>0&&pc(gc,null,pc("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")),pc("button",{tabIndex:-1,className:Kc(Gc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-i)})).map((function(e){return pc("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:Kc(t.state.page===e?Kc(Gc("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&&pc(gc,null,pc("button",{tabIndex:-1,className:Kc(Gc("spread"),this.config.className.paginationButton)},"..."),pc("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 pc(gc,null,this.props.summary&&this.state.total>0&&pc("div",{role:"status","aria-live":"polite",className:Kc(Gc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",pc("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",pc("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",pc("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},i.render=function(){return this.props.enabled?pc("div",{className:Kc(Gc("pagination"),this.config.className.pagination)},this.renderSummary(),pc("div",{className:Gc("pages")},this.props.prevButton&&pc("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:Kc(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&pc("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:Kc(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},Yl(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(nh);function hh(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function dh(t){return t?Math.floor(t)+"px":""}ch.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var ph=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}Kl(e,t);var i=e.prototype;return i.widths=function(){this.tableElement.className=this.tableClassName+" "+Gc("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",Gl(((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?pc("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Vc);function uh(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 gh=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}Kl(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 s=i.clientWidth,a={current:null},l={};if(n.current&&o){var c=pc(ph,{tableRef:n});c.ref=a,$c(c,r.current),l=a.current.widths()}for(var h,d=Jl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=d()).done;){var p=h.value;p.columns&&p.columns.length>0||(!p.width&&o?p.id in l&&(p.width=dh(l[p.id].width),p.minWidth=dh(l[p.id].minWidth)):p.width=dh(hh(p.width,s)))}return n.current&&o&&$c(null,r.current),this},i.setSort=function(t,e){for(var i,n=Jl(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=Gl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},i.setFixedHeader=function(t,e){for(var i,n=Jl(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=Jl(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=Jl(t||this.columns||[]);!(e=i()).done;){var n=e.value;n.id||"string"!=typeof n.name||(n.id=uh(n.name)),n.id||ih.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=Jl(e);!(i=n()).done;){var r=i.value;void 0!==r.plugin&&t.plugin.add(Gl({id:r.id,props:{}},r.plugin,{position:Xc.Cell}))}},e.fromColumns=function(t){for(var i,n=new e,r=Jl(t);!(i=r()).done;){var o=i.value;if("string"==typeof o||nc(o))n.columns.push({name:o});else if("object"==typeof o){var s=o;s.columns&&(s.columns=e.fromColumns(s.columns).columns),"object"==typeof s.plugin&&void 0===s.data&&(s.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=Jl(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=Jl(i);!(r=o()).done;){var s=r.value;s.columns&&s.columns.length&&(n=n.concat(s.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=Jl(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},Yl(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}(Ic),fh=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}(),mh=function(){},vh=function(t){function e(e){var i;return(i=t.call(this)||this).data=void 0,i.set(e),i}Kl(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}(mh),bh=function(t){function e(e){var i;return(i=t.call(this)||this).options=void 0,i.options=e,i}Kl(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():(ih.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},i.get=function(t){var e=Gl({},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}(mh),yh=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new vh(t.data)),t.from&&(e=new vh(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new bh(t.server)),e||ih.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,i,n=[],r=Jl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,s=[],a=Jl(e.value.querySelectorAll("td"));!(o=a()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?s.push((i=l.innerHTML,(new DOMParser).parseFromString(i,"text/html").documentElement.textContent)):s.push(Dc(l.innerHTML))}n.push(s)}return n},t}(),_h="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function wh(t,e,i){if(!t.s){if(i instanceof xh){if(!i.s)return void(i.o=wh.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(wh.bind(null,t,e),wh.bind(null,t,2));t.s=e,t.v=i;var n=t.o;n&&n(t)}}var xh=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{wh(n,1,o(this.v))}catch(t){wh(n,2,t)}return n}return this}return this.o=function(t){try{var r=t.v;1&t.s?wh(n,1,e?e(r):r):i?wh(n,1,i(r)):wh(n,2,r)}catch(t){wh(n,2,t)}},n},t}();function kh(t){return t instanceof xh&&1&t.s}var Ah,Sh=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}Kl(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(Fc).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,s=function(t,i){try{var s=function(t,e,i){if("function"==typeof t[_h]){var n,r,o,s=t[_h]();if(function t(i){try{for(;!(n=s.next()).done;)if((i=e(n.value))&&i.then){if(!kh(i))return void i.then(t,o||(o=wh.bind(null,r=new xh,2)));i=i.v}r?wh(r,1,i):r=i}catch(t){wh(r||(r=new xh),2,t)}}(),s.return){var a=function(t){try{n.done||s.return()}catch(t){}return t};if(r&&r.then)return r.then(a,(function(t){throw a(t)}));a()}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(s){try{for(;++o<t.length;)if((s=e(o))&&s.then){if(!kh(s))return void s.then(i,r||(r=wh.bind(null,n=new xh,2)));s=s.v}n?wh(n,1,s):n=s}catch(t){wh(n||(n=new xh),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 s&&s.then?s.then(void 0,i):s}(0,(function(t){throw ih.error(t),e.emit("error",o),t}));return Promise.resolve(s&&s.then?s.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)},Yl(e,[{key:"steps",get:function(){for(var t,e=[],i=Jl(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}(Uc),zh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},Yl(e,[{key:"type",get:function(){return Fc.Extractor}}]),e}(Wc),Ch=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype._process=function(t){var e=qc.fromArray(t.data);return e.length=t.total,e},Yl(e,[{key:"type",get:function(){return Fc.Transformer}}]),e}(Wc),Eh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(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 Gl({},t,((i={})[e[0]]=e[1],i))}),{})},Yl(e,[{key:"type",get:function(){return Fc.Initiator}}]),e}(Wc),Th=function(t){function e(){return t.apply(this,arguments)||this}Kl(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=gh.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]:(ih.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}},Yl(e,[{key:"type",get:function(){return Fc.Transformer}}]),e}(Wc),Lh=function(){function t(){}return t.createFromConfig=function(t){var e=new Sh;return t.storage instanceof bh&&e.register(new Eh({serverStorageOptions:t.server})),e.register(new zh({storage:t.storage})),e.register(new Th({header:t.header})),e.register(new Ch),e},t}(),Mh=function(){function t(e){this._userConfig=void 0,Object.assign(this,Gl({},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=Gl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new rh,dispatcher:new fh,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:gh.fromUserConfig(i)}),i.assign({storage:yh.createFromUserConfig(e)}),i.assign({pipeline:Lh.createFromConfig(i)}),i.assign({translator:new Pc(e.language)}),i.plugin.add({id:"search",position:Xc.Header,component:sh,props:Gl({enabled:!0===e.search||e.search instanceof Object},e.search)}),i.plugin.add({id:"pagination",position:Xc.Footer,component:ch,props:Gl({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"}(Ah||(Ah={}));var Oh,$h,Hh,Ih=function(t){function e(){return t.apply(this,arguments)||this}Kl(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?pc(oh,{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 pc("td",Gl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:Kc(Gc("td"),this.props.className,this.config.className.td),style:Gl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Vc),Rh=function(t){function e(){return t.apply(this,arguments)||this}Kl(e,t);var i=e.prototype;return i.getColumn=function(t){if(this.props.header){var e=gh.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:pc(gc,null,this.props.row.cells.map((function(e,i){var n=t.getColumn(i);return n&&n.hidden?null:pc(Ih,{key:e.id,cell:e,row:t.props.row,column:n})})))},i.render=function(){return pc("tr",{className:Kc(Gc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Vc),Ph=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype.render=function(){return pc(Rh,{messageRow:!0},pc(Ih,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Bc(this.props.message),className:Kc(Gc("message"),this.props.className?this.props.className:null)}))},e}(Vc),Vh=function(t){function e(){return t.apply(this,arguments)||this}Kl(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 pc("tbody",{className:Kc(Gc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return pc(Rh,{key:e.id,row:e,header:t.props.header})})),this.props.status===Ah.Loading&&(!this.props.data||0===this.props.data.length)&&pc(Ph,{message:this._("loading"),colSpan:this.headerLength(),className:Kc(Gc("loading"),this.config.className.loading)}),this.props.status===Ah.Rendered&&this.props.data&&0===this.props.data.length&&pc(Ph,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:Kc(Gc("notfound"),this.config.className.notfound)}),this.props.status===Ah.Error&&pc(Ph,{message:this._("error"),colSpan:this.headerLength(),className:Kc(Gc("error"),this.config.className.error)}))},e}(Vc),Nh=function(t){function e(){return t.apply(this,arguments)||this}Kl(e,t);var i=e.prototype;return i.validateProps=function(){for(var t,e=Jl(this.props.columns);!(t=e()).done;){var i=t.value;void 0===i.direction&&(i.direction=1),1!==i.direction&&-1!==i.direction&&ih.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=Jl(this.props.columns);!(i=r()).done;){var o=i.value;if(0!==n)break;var s=t.cells[o.index].data,a=e.cells[o.index].data;n|="function"==typeof o.compare?o.compare(s,a)*o.direction:this.compare(s,a)*o.direction}return n},i._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var i=new qc(e);return i.length=t.length,i},Yl(e,[{key:"type",get:function(){return Fc.Sort}}]),e}(Wc),Dh=function(t){function e(){return t.apply(this,arguments)||this}Kl(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,s=r.find((function(e){return e.index===t})),a=!1,l=!1,c=!1,h=!1;if(void 0!==s?i?-1===s.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,a=!0):0===o?a=!0:o>0&&!i?(a=!0,l=!0):o>0&&i&&(a=!0),l&&(r=[]),a)r.push({index:t,direction:e,compare:n});else if(h){var d=r.indexOf(s);r[d].direction=e}else if(c){var p=r.indexOf(s);r.splice(p,1)}this.setState(r)},e}(Zc),Fh=function(t){function e(){return t.apply(this,arguments)||this}Kl(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}(Jc),Bh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(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)),Gl({},t,e)},Yl(e,[{key:"type",get:function(){return Fc.ServerSort}}]),e}(Wc),jh=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 Fh(n.config.dispatcher),n.store=new Dh(n.config.dispatcher),e.enabled&&(n.sortProcessor=n.getOrCreateSortProcessor(),n.updateStateFn=n.updateState.bind(Zl(n)),n.store.on("updated",n.updateStateFn),n.state={direction:0}),n}Kl(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=Fc.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Fc.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===Fc.ServerSort?new Bh(Gl({columns:this.store.state},this.config.sort.server)):new Nh({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"),pc("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:Kc(Gc("sort"),Gc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Vc),qh=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}Kl(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 pc("div",{className:Kc(Gc("th"),Gc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Vc),Uh=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}Kl(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?pc(oh,{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),pc("th",Gl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:Kc(Gc("th"),this.isSortable()?Gc("th","sort"):null,this.props.column.fixedHeader?Gc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:Gl({},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),pc("div",{className:Gc("th","content")},this.content()),this.isSortable()&&pc(jh,Gl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&pc(qh,{column:this.props.column,thRef:this.thRef}))},e}(Vc),Wh=function(t){function e(){return t.apply(this,arguments)||this}Kl(e,t);var i=e.prototype;return i.renderColumn=function(t,e,i,n){var r=function(t,e,i){var n=gh.maximumDepth(t),r=i-e;return{rowSpan:Math.floor(r-n-n/r),colSpan:t.columns&&t.columns.length||1}}(t,e,n);return pc(Uh,{column:t,index:i,colSpan:r.colSpan,rowSpan:r.rowSpan})},i.renderRow=function(t,e,i){var n=this,r=gh.leafColumns(this.props.header.columns);return pc(Rh,null,t.map((function(t){return t.hidden?null:n.renderColumn(t,e,r.indexOf(t),i)})))},i.renderRows=function(){var t=this,e=gh.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?pc("thead",{key:this.props.header.id,className:Kc(Gc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Vc),Yh=function(t){function e(){return t.apply(this,arguments)||this}return Kl(e,t),e.prototype.render=function(){return pc("table",{role:"grid",className:Kc(Gc("table"),this.config.className.table),style:Gl({},this.config.style.table,{height:this.props.height})},pc(Wh,{header:this.props.header}),pc(Vh,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Vc),Gh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).headerRef={current:null},n.state={isActive:!0},n}Kl(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?pc("div",{ref:this.headerRef,className:Kc(Gc("head"),this.config.className.header),style:Gl({},this.config.style.header)},pc(oh,{position:Xc.Header})):null},e}(Vc),Kh=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).footerRef={current:null},n.state={isActive:!0},n}Kl(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?pc("div",{ref:this.footerRef,className:Kc(Gc("footer"),this.config.className.footer),style:Gl({},this.config.style.footer)},pc(oh,{position:Xc.Footer})):null},e}(Vc),Xh=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"+sc++,__: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(bc)},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:Ah.Loading,header:e.header,data:null},n}Kl(e,t);var i=e.prototype;return i.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Ah.Loading});var e=function(e,i){try{var n=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Ah.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){ih.error(e),t.setState({status:Ah.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!=Ah.Rendered&&this.state.status==Ah.Loaded&&(this.setState({status:Ah.Rendered}),this.props.config.eventEmitter.emit("ready"))},i.render=function(){return pc(this.configContext.Provider,{value:this.props.config},pc("div",{role:"complementary",className:Kc("gridjs",Gc("container"),this.state.status===Ah.Loading?Gc("loading"):null,this.props.config.className.container),style:Gl({},this.props.config.style.container,{width:this.props.width})},this.state.status===Ah.Loading&&pc("div",{className:Gc("loading-bar")}),pc(Gh,null),pc("div",{className:Gc("wrapper"),style:{height:this.props.height}},pc(Yh,{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})),pc(Kh,null),pc("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:Gc("temp")})))},e}(Vc),Zh=function(t){function e(e){var i;return(i=t.call(this)||this).config=void 0,i.plugin=void 0,i.config=new Mh({instance:Zl(i),eventEmitter:Zl(i)}).update(e),i.plugin=i.config.plugin,i}Kl(e,t);var i=e.prototype;return i.updateConfig=function(t){return this.config.update(t),this},i.createElement=function(){return pc(Xh,{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||ih.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),$c(null,this.config.container),$c(this.createElement(),this.config.container),this},i.render=function(t){return t||ih.error("Container element cannot be null",!0),t.childNodes.length>0?(ih.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,$c(this.createElement(),t),this)},e}(Uc),Qh=[],Jh=[],td=ec.__b,ed=ec.__r,id=ec.diffed,nd=ec.__c,rd=ec.unmount;function od(){for(var t;t=Qh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ad),t.__H.__h.forEach(ld),t.__H.__h=[]}catch(e){t.__H.__h=[],ec.__e(e,t.__v)}}ec.__b=function(t){Oh=null,td&&td(t)},ec.__r=function(t){ed&&ed(t),0;var e=(Oh=t.__c).__H;e&&($h===Oh?(e.__h=[],Oh.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Jh,t.__N=t.i=void 0}))):(e.__h.forEach(ad),e.__h.forEach(ld),e.__h=[])),$h=Oh},ec.diffed=function(t){id&&id(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Qh.push(e)&&Hh===ec.requestAnimationFrame||((Hh=ec.requestAnimationFrame)||function(t){var e,i=function(){clearTimeout(n),sd&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,100);sd&&(e=requestAnimationFrame(i))})(od)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Jh&&(t.__=t.__V),t.i=void 0,t.__V=Jh}))),$h=Oh=null},ec.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ad),t.__h=t.__h.filter((function(t){return!t.__||ld(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ec.__e(i,t.__v)}})),nd&&nd(t,e)},ec.unmount=function(t){rd&&rd(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{ad(t)}catch(t){e=t}})),e&&ec.__e(e,i.__v))};var sd="function"==typeof requestAnimationFrame;function ad(t){var e=Oh,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Oh=e}function ld(t){var e=Oh;t.__c=t.__(),Oh=e}class cd 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=>Dc(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",cd);class hd extends(D(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}async connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),En.subscribe(this,t=>{this._params=t,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}const t=await E([P(this.cssPath)+"/mermaid.min.css"]),e=O(this),i=[...this.shadowRoot.adoptedStyleSheets,t];e&&i.push(e),this.shadowRoot.adoptedStyleSheets=i}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),i=[];e.forEach(t=>i.push(t.data())),B("pb-page-ready",()=>{this._params=En.state;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,En.commit(this,this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new Zh(n),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){return I`
4179
4191
  ${this.search?I`
4180
4192
  <iron-form id="form">
4181
4193
  <form action="">
@@ -4193,7 +4205,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4193
4205
  button {
4194
4206
  border: 0;
4195
4207
  }
4196
- `}}customElements.define("pb-table-grid",ld);class cd extends(z(D(V))){static get properties(){return Object.assign({url:{type:String},selected:{type:String},subforms:{type:String},_categories:{type:Array}},super.properties)}constructor(){super(),this._categories=[],this._params={},this.selected=null,this.subforms=null,this._initialized=!1}connectedCallback(){super.connectedCallback(),B("pb-page-ready",()=>{this.selected=En.state.category||this.selected,En.subscribe(this,t=>{console.log("<pb-split-list> popstate: %o",t),this.selected=t.category,this.submit(!1)})}),this.subscribeTo("pb-submit",this.load.bind(this))}firstUpdated(){super.firstUpdated(),B("pb-page-ready",()=>{this.load()})}submit(t=!0){this.load(t)}load(t=!0){const e=this._paramsFromSubforms({});this.selected&&(e.category=this.selected),t&&(this._initialized?En.commit(this,e):En.replace(this,e)),this._initialized=!0;const i=new URLSearchParams(e),n=`${this.toAbsoluteURL(this.url)}?${i.toString()}`;console.log("<pb-split-list> Fetching from URL: "+n),this.emitTo("pb-start-update"),fetch(n).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{this._categories=t.categories,this.innerHTML=t.items.join(""),this.emitTo("pb-end-update")}).catch(t=>{console.error("<pb-split-list> Error caught: "+t),this.emitTo("pb-end-update")})}_selectCategory(t,e){t.preventDefault(),this.selected=e,this.load()}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}render(){return I`
4208
+ `}}customElements.define("pb-table-grid",hd);class dd extends(z(D(V))){static get properties(){return Object.assign({url:{type:String},selected:{type:String},subforms:{type:String},_categories:{type:Array}},super.properties)}constructor(){super(),this._categories=[],this._params={},this.selected=null,this.subforms=null,this._initialized=!1}connectedCallback(){super.connectedCallback(),B("pb-page-ready",()=>{this.selected=En.state.category||this.selected,En.subscribe(this,t=>{console.log("<pb-split-list> popstate: %o",t),this.selected=t.category,this.submit(!1)})}),this.subscribeTo("pb-submit",this.load.bind(this))}firstUpdated(){super.firstUpdated(),B("pb-page-ready",()=>{this.load()})}submit(t=!0){this.load(t)}load(t=!0){const e=this._paramsFromSubforms({});this.selected&&(e.category=this.selected),t&&(this._initialized?En.commit(this,e):En.replace(this,e)),this._initialized=!0;const i=new URLSearchParams(e),n=`${this.toAbsoluteURL(this.url)}?${i.toString()}`;console.log("<pb-split-list> Fetching from URL: "+n),this.emitTo("pb-start-update"),fetch(n).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{this._categories=t.categories,this.innerHTML=t.items.join(""),this.emitTo("pb-end-update")}).catch(t=>{console.error("<pb-split-list> Error caught: "+t),this.emitTo("pb-end-update")})}_selectCategory(t,e){t.preventDefault(),this.selected=e,this.load()}_paramsFromSubforms(t){return this.subforms&&document.querySelectorAll(this.subforms).forEach(e=>{e.serializeForm&&Object.assign(t,e.serializeForm())}),t}render(){return I`
4197
4209
  <header>
4198
4210
  ${this._categories.map(t=>I`
4199
4211
  <a part="${this.selected===t.category?"active-category":"category"}" href="#${t.category}" title="${t.count}" class="${this.selected===t.category?"active":""}"
@@ -4232,7 +4244,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4232
4244
  text-decoration: none;
4233
4245
  color: var(--pb-highlight-color);
4234
4246
  }
4235
- `}}customElements.define("pb-split-list",cd);class hd{constructor(t={},e=60,i=["D","W","M","Y","5Y","10Y"]){this.data={invalid:{},valid:{}},this.maxInterval=e,this.scopes=i,this._validateJsonData(t)}getMinDateStr(){return Object.keys(this.data.valid).sort()[0]}getMaxDateStr(){let t=Object.keys(this.data.valid);return t.sort()[t.length-1]}getMinDate(){return this._dateStrToUTCDate(this.getMinDateStr())}getMaxDate(){return this._dateStrToUTCDate(this.getMaxDateStr())}getEndOfRangeDate(t,e){return this._UTCDateToDateStr(this._increaseDateBy(t,e))}export(t){if(t=t||this._autoAssignScope(),!this.scopes.includes(t))throw new Error(`invalid scope provided, expected: ["10Y", "5Y", "Y", "M", "W", "D"]. Got: "${t}"`);const e={data:[],scope:t,binTitleRotated:this._binTitleRotatedLookup(t)};if(0===Object.keys(this.data.valid).length)return e;const i=this._classify(this.getMinDateStr(),t),n=this._getFirstDay(i);let r=this._dateStrToUTCDate(n);const o=this.getMaxDate();for(;r<=o;){const i=this._UTCDateToDateStr(r),n=this._classify(i,t);e.data.push(this._buildBinObject(i,n,t)),r=this._increaseDateBy(t,r)}if(Object.keys(this.data.valid).sort().forEach(i=>{const n=this._classify(i,t),r=e.data.find(t=>t.category===n);try{const t=this.data.valid[i];"object"==typeof t?(r.value+=t.count||0,t.info&&(r.info=r.info.concat(t.info))):r.value+=this.data.valid[i]||0}catch(t){console.log(t),console.log("currentCategory"),console.log(n)}}),this.data.invalid){let t=0,i=[];Object.values(this.data.invalid).forEach(e=>{"object"==typeof e?(t+=e.count||0,i=i.concat(e.info)):t+=e}),t>0&&e.data.push({tooltip:G("timeline.unknown"),title:G("timeline.unknown"),category:"?",separator:!0,value:t,info:i})}return e}_autoAssignScope(){for(let t=0;t<this.scopes.length;t++)if(this._computeIntervalSize(this.scopes[t])<=this.maxInterval)return this.scopes[t];throw new Error(`Interval too big! Computed: ${this._computeIntervalSize(this.scopes[i])}. Allowed: ${this.maxInterval}. Try to increase maxInterval.`)}_validateJsonData(t){Object.keys(t).sort().forEach(e=>{this._isValidDateStr(e)?this.data.valid[e]=t[e]:this.data.invalid[e]=t[e]})}_binTitleRotatedLookup(t){return{"10Y":!0,"5Y":!0,Y:!0,M:!1,W:!0,D:!0}[t]}_buildBinObject(t,e,i){const n=t.split("-"),r=n[0],o=n[1],s=n[2],a={dateStr:t,category:e,value:0,info:[]};if("10Y"===i)a.tooltip=`${e} - ${Number(e)+9}`,a.selectionStart=""+e,a.selectionEnd=""+(Number(e)+9),Number(e)%100==0&&(a.title=`${e} - ${Number(e)+99}`,a.binTitle=e,a.seperator=!0);else if("5Y"===i)a.tooltip=`${e} - ${Number(e)+4}`,a.selectionStart=""+e,a.selectionEnd=""+(Number(e)+4),Number(e)%50==0&&(a.title=`${e} - ${Number(e)+49}`,a.binTitle=e,a.seperator=!0);else if("Y"===i)a.tooltip=e,a.selectionStart=e,a.selectionEnd=e,Number(e)%10==0&&(a.title=`${e} - ${Number(e)+9}`,a.binTitle=""+e,a.seperator=!0);else if("M"===i){const t=Number(o),e=this._monthLookup(t);a.binTitle=e[0],a.tooltip=`${e} ${r}`,a.selectionStart=`${e} ${r}`,a.selectionEnd=`${e} ${r}`,1===t&&(a.title=r,a.seperator=!0)}else if("W"===i){const i=e.split("-")[1];a.tooltip=`${r} ${i}`,a.selectionStart=`${r} ${i}`,a.selectionEnd=`${r} ${i}`;let n=this._dateStrToUTCDate(t),o=this._addDays(n,-7);n.getUTCMonth()!==o.getUTCMonth()&&(a.binTitle=i,a.title=this._monthLookup(n.getUTCMonth()+1)),a.seperator="W1"===i}else{if("D"!==i)throw new Error(`invalid scope provided, expected: ["10Y", "5Y", "Y", "M", "W", "D"]. Got: "${i}"`);a.tooltip=t,a.selectionStart=t,a.selectionEnd=t,1===this._dateStrToUTCDate(t).getUTCDay()&&(a.binTitle=`${Number(s)}.${Number(o)}`,a.title=""+this._classify(t,"W").replace("-"," "),a.seperator=!0)}return a}_classify(t,e){if(!t.match(/^\d{4}-\d{2}-\d{2}$/))throw new Error(`invalid dateStr format, expected "YYYY-MM-DD", got: "${t}".`);if(!t||!e)throw new Error(`both inputs must be provided. Got dateStr=${t}, scope=${e}`);switch(e){case"10Y":case"5Y":const i=Number(e.replace("Y",""));return(Math.floor(Number(t.split("-")[0])/i)*i).toString();case"Y":return t.substr(0,4);case"M":return t.substr(0,7);case"W":const n=this._dateStrToUTCDate(t);return this._UTCDateToWeekFormat(n);case"D":return t}}_getFirstDay(t){if(t.match(/^\d{4}-\d{2}-\d{2}$/))return t;if(t.match(/^\d{4}-\d{2}$/))return t+"-01";if(t.match(/^\d{4}$/))return t+"-01-01";if(t.match(/^\d{4}-W([1-9]|[1-4][0-9]|5[0-3])$/)){const e=t.split("-"),i=Number(e[0]),n=Number(e[1].replace("W",""));return this._getDateStrOfISOWeek(i,n)}throw new Error("invalid categoryStr")}_dateStrToUTCDate(t){if(!this._isValidDateStr(t))throw new Error(`invalid dateStr, expected "YYYY-MM-DD" with month[1-12] and day[1-31], got: "${t}".`);const e=t.split("-"),i=Number(e[0]),n=Number(e[1]),r=Number(e[2]);return new Date(Date.UTC(i,n-1,r))}_UTCDateToDateStr(t){return t.toISOString().split("T")[0]}_UTCDateToWeekFormat(t){return`${this._getISOWeekYear(t)}-W${this._getISOWeek(t)}`}_getISOWeek(t){let e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);let i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)}_getISOWeekYear(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+3-(e.getDay()+6)%7),e.getFullYear()}_getDateStrOfISOWeek(t,e){let i=new Date(Date.UTC(t,0,1+7*(e-1))),n=i.getUTCDay(),r=i;return n<=4?r.setDate(i.getDate()-i.getUTCDay()+1):r.setDate(i.getDate()+8-i.getUTCDay()),r.toISOString().split("T")[0]}getIntervalSizes(){return{D:this._computeIntervalSize("D"),W:this._computeIntervalSize("W"),M:this._computeIntervalSize("M"),Y:this._computeIntervalSize("Y"),"5Y":this._computeIntervalSize("5Y"),"10Y":this._computeIntervalSize("10Y")}}_computeIntervalSize(t){const e=this.getMaxDateStr();if(!e)return 0;const i=this._dateStrToUTCDate(e),n=this._getFirstDay(this._classify(this.getMinDateStr(),t));let r=this._dateStrToUTCDate(n),o=0;for(;r<=i;)o++,r=this._increaseDateBy(t,r);return o}_increaseDateBy(t,e){switch(t){case"D":return this._addDays(e,1);case"W":return this._addDays(e,7);case"M":return this._addMonths(e,1);case"Y":return this._addYears(e,1);case"5Y":return this._addYears(e,5);case"10Y":return this._addYears(e,10)}}_addDays(t,e){let i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i}_addMonths(t,e){let i=new Date(t.valueOf()),n=i.getUTCDate();return i.setUTCMonth(i.getUTCMonth()+ +e),i.getUTCDate()!=n&&i.setUTCDate(0),i}_addYears(t,e){let i=new Date(t.valueOf());return i.setUTCFullYear(i.getUTCFullYear()+e),i}_isValidDateStr(t){if(!t)return!1;let e=t.split("-");if(3!==e.length)return!1;let i=e[0],n=e[1],r=e[2];return"0000"!==i&&"00"!==r&&"00"!==n&&(!(Number(r)<1||Number(r)>31)&&!(Number(n)<1||Number(n)>12))}_monthLookup(t){if(t>12||t<1)throw new Error("invalid 'num' provided, expected 1-12. Got: "+t);return{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"}[t.toString()]}}class dd{constructor(){}run(t){this.input=t,this.day="??",this.month="??",this.year="????";const e=this.input.match(this._isoMatchRegex()),i=this.input.match(this._customRegex()),n=this.input.match(this._weekMatchRegex()),r=this.input.match(this._yearAndMonthRegex());if(e){const t=e[1].split(/-|\/|\s/);this.year=t[0],this.month=this._setWithLeadingZero(t[1]),this.day=this._setWithLeadingZero(t[2])}else if(r){const t=r[1].split("-");this.year=t[0],this.month=this._setWithLeadingZero(t[1]),this.day="01"}else if(i){const t=i[0].split(/\.|\s|\/|-/);this.day=this._setWithLeadingZero(t[0]),this.month=this._setWithLeadingZero(t[1]),this.year=t[2]}else{if(n){const t=n[0].split(/\.|\s|\/|-/),e=Number(t[0]),i=Number(t[1].replace("W0","").replace("W",""));return this._getDateStrOfISOWeek(e,i)}this._findYear(),this._findMonth(),this._findDay()}return this._buildResult()}_buildResult(){return"????"!=this.year&&"??"===this.month&&(this.month="01"),"??"!=this.month&&"??"===this.day&&(this.day="01"),`${this.year}-${this.month}-${this.day}`}_isoMatchRegex(){return/(?:\s|^)(\d{4}(-|\s|\/)([0][1-9]|[1-9]|10|11|12)(-|\s|\/)([0][1-9]|[1-2][0-9]|3[01]|[1-9]))(?=\s|$|\.)/}_customRegex(){return/\d{1,2}(\.|\s|\/|-)\d{1,2}(\.|\s|\/|-)\d{4}/}_weekMatchRegex(){return/\d{4}(\.|\s|\/|-)W\d{1,2}(?=\s|$|\.)/}_yearAndMonthRegex(){return/(?:\s|^)(\d{4}-([0][1-9]|[1-9]|10|11|12))(?=\s|$)/}_findYear(){let t=/[1-9]{1}[0-9]{3}/;const e=this.input.match(t);e&&(this.year=e[0],this._removeMatchFromInput(e))}_findMonth(){this._monthDictionaryValues().forEach(t=>{const e=new RegExp(`(?:\\s|^)(${t})(?=\\s|$|\\.)`,"i"),i=this.input.match(e);if(i)return this.month=this._monthDictionary()[i[1].toLowerCase()],this._removeMatchFromInput(i),this.month})}_findDay(){const t=/(?:\s|^)([0][1-9]|[1-2][0-9]|3[01]|[1-9])(?=\s|$|\.|st|nd|rd|th)/,e=this.input.match(t);e&&(this.day=this._setWithLeadingZero(e[1]))}_setWithLeadingZero(t){return 1==(t=t.toString()).length?"0"+t:t}_removeMatchFromInput(t){if(t&&t[0]&&t.index){let e=t[0].length,i=this.input.split("");i.splice(t.index,e),this.input=i.join("")}}_monthDictionaryValues(){return Object.keys(this._monthDictionary())}_monthDictionary(){return{jan:"01",januar:"01",feb:"02",februar:"02","mär":"03","märz":"03",apr:"04",april:"04",mai:"05",mai:"05",jun:"06",juni:"06",jul:"07",juli:"07",aug:"08",august:"08",sep:"09",september:"09",okt:"10",oktober:"10",nov:"11",november:"11",dez:"12",dezember:"12",jan:"01",january:"01",feb:"02",february:"02",mar:"03",march:"03",apr:"04",april:"04",may:"05",may:"05",jun:"06",june:"06",jul:"07",july:"07",aug:"08",august:"08",sep:"09",september:"09",oct:"10",october:"10",nov:"11",november:"11",dec:"12",december:"12",janv:"01",janvier:"01","févr":"02","février'":"02",mars:"03",mars:"03",avr:"04",avril:"04",mai:"05",mai:"05",juin:"06",juin:"06",juil:"07",juillet:"07","août":"08","août":"08",sept:"09",septembre:"09",oct:"10",octobre:"10",nov:"11",novembre:"11","déc":"12","décembre":"12",gen:"01",gennaio:"01",feb:"02",febbraio:"02",mar:"03",marzo:"03",apr:"04",aprile:"04",mag:"05",maggio:"05",giu:"06",giugno:"06",lug:"07",luglio:"07",ago:"08",agosto:"08",set:"09",settembre:"09",ott:"10",ottobre:"10",nov:"11",novembre:"11",dic:"12",dicembre:"12"}}_getDateStrOfISOWeek(t,e){let i=new Date(t,0,1+7*(e-1)),n=i.getDay(),r=i;return n<=4?r.setDate(i.getDate()-i.getDay()+1):r.setDate(i.getDate()+8-i.getDay()),r.getFullYear()>t?t+"-12-31":r.getFullYear()<t?t+"-01-01":this._dateToDateStr(r)}_dateToDateStr(t){let e=new Date(t),i=this._setWithLeadingZero(e.getMonth()+1),n=this._setWithLeadingZero(e.getDate());return`${e.getFullYear()}-${i}-${n}`}}class pd extends(D(V)){static get styles(){return R`
4247
+ `}}customElements.define("pb-split-list",dd);class pd{constructor(t={},e=60,i=["D","W","M","Y","5Y","10Y"]){this.data={invalid:{},valid:{}},this.maxInterval=e,this.scopes=i,this._validateJsonData(t)}getMinDateStr(){return Object.keys(this.data.valid).sort()[0]}getMaxDateStr(){let t=Object.keys(this.data.valid);return t.sort()[t.length-1]}getMinDate(){return this._dateStrToUTCDate(this.getMinDateStr())}getMaxDate(){return this._dateStrToUTCDate(this.getMaxDateStr())}getEndOfRangeDate(t,e){return this._UTCDateToDateStr(this._increaseDateBy(t,e))}export(t){if(t=t||this._autoAssignScope(),!this.scopes.includes(t))throw new Error(`invalid scope provided, expected: ["10Y", "5Y", "Y", "M", "W", "D"]. Got: "${t}"`);const e={data:[],scope:t,binTitleRotated:this._binTitleRotatedLookup(t)};if(0===Object.keys(this.data.valid).length)return e;const i=this._classify(this.getMinDateStr(),t),n=this._getFirstDay(i);let r=this._dateStrToUTCDate(n);const o=this.getMaxDate();for(;r<=o;){const i=this._UTCDateToDateStr(r),n=this._classify(i,t);e.data.push(this._buildBinObject(i,n,t)),r=this._increaseDateBy(t,r)}if(Object.keys(this.data.valid).sort().forEach(i=>{const n=this._classify(i,t),r=e.data.find(t=>t.category===n);try{const t=this.data.valid[i];"object"==typeof t?(r.value+=t.count||0,t.info&&(r.info=r.info.concat(t.info))):r.value+=this.data.valid[i]||0}catch(t){console.log(t),console.log("currentCategory"),console.log(n)}}),this.data.invalid){let t=0,i=[];Object.values(this.data.invalid).forEach(e=>{"object"==typeof e?(t+=e.count||0,i=i.concat(e.info)):t+=e}),t>0&&e.data.push({tooltip:G("timeline.unknown"),title:G("timeline.unknown"),category:"?",separator:!0,value:t,info:i})}return e}_autoAssignScope(){for(let t=0;t<this.scopes.length;t++)if(this._computeIntervalSize(this.scopes[t])<=this.maxInterval)return this.scopes[t];throw new Error(`Interval too big! Computed: ${this._computeIntervalSize(this.scopes[i])}. Allowed: ${this.maxInterval}. Try to increase maxInterval.`)}_validateJsonData(t){Object.keys(t).sort().forEach(e=>{this._isValidDateStr(e)?this.data.valid[e]=t[e]:this.data.invalid[e]=t[e]})}_binTitleRotatedLookup(t){return{"10Y":!0,"5Y":!0,Y:!0,M:!1,W:!0,D:!0}[t]}_buildBinObject(t,e,i){const n=t.split("-"),r=n[0],o=n[1],s=n[2],a={dateStr:t,category:e,value:0,info:[]};if("10Y"===i)a.tooltip=`${e} - ${Number(e)+9}`,a.selectionStart=""+e,a.selectionEnd=""+(Number(e)+9),Number(e)%100==0&&(a.title=`${e} - ${Number(e)+99}`,a.binTitle=e,a.seperator=!0);else if("5Y"===i)a.tooltip=`${e} - ${Number(e)+4}`,a.selectionStart=""+e,a.selectionEnd=""+(Number(e)+4),Number(e)%50==0&&(a.title=`${e} - ${Number(e)+49}`,a.binTitle=e,a.seperator=!0);else if("Y"===i)a.tooltip=e,a.selectionStart=e,a.selectionEnd=e,Number(e)%10==0&&(a.title=`${e} - ${Number(e)+9}`,a.binTitle=""+e,a.seperator=!0);else if("M"===i){const t=Number(o),e=this._monthLookup(t);a.binTitle=e[0],a.tooltip=`${e} ${r}`,a.selectionStart=`${e} ${r}`,a.selectionEnd=`${e} ${r}`,1===t&&(a.title=r,a.seperator=!0)}else if("W"===i){const i=e.split("-")[1];a.tooltip=`${r} ${i}`,a.selectionStart=`${r} ${i}`,a.selectionEnd=`${r} ${i}`;let n=this._dateStrToUTCDate(t),o=this._addDays(n,-7);n.getUTCMonth()!==o.getUTCMonth()&&(a.binTitle=i,a.title=this._monthLookup(n.getUTCMonth()+1)),a.seperator="W1"===i}else{if("D"!==i)throw new Error(`invalid scope provided, expected: ["10Y", "5Y", "Y", "M", "W", "D"]. Got: "${i}"`);a.tooltip=t,a.selectionStart=t,a.selectionEnd=t,1===this._dateStrToUTCDate(t).getUTCDay()&&(a.binTitle=`${Number(s)}.${Number(o)}`,a.title=""+this._classify(t,"W").replace("-"," "),a.seperator=!0)}return a}_classify(t,e){if(!t.match(/^\d{4}-\d{2}-\d{2}$/))throw new Error(`invalid dateStr format, expected "YYYY-MM-DD", got: "${t}".`);if(!t||!e)throw new Error(`both inputs must be provided. Got dateStr=${t}, scope=${e}`);switch(e){case"10Y":case"5Y":const i=Number(e.replace("Y",""));return(Math.floor(Number(t.split("-")[0])/i)*i).toString();case"Y":return t.substr(0,4);case"M":return t.substr(0,7);case"W":const n=this._dateStrToUTCDate(t);return this._UTCDateToWeekFormat(n);case"D":return t}}_getFirstDay(t){if(t.match(/^\d{4}-\d{2}-\d{2}$/))return t;if(t.match(/^\d{4}-\d{2}$/))return t+"-01";if(t.match(/^\d{4}$/))return t+"-01-01";if(t.match(/^\d{4}-W([1-9]|[1-4][0-9]|5[0-3])$/)){const e=t.split("-"),i=Number(e[0]),n=Number(e[1].replace("W",""));return this._getDateStrOfISOWeek(i,n)}throw new Error("invalid categoryStr")}_dateStrToUTCDate(t){if(!this._isValidDateStr(t))throw new Error(`invalid dateStr, expected "YYYY-MM-DD" with month[1-12] and day[1-31], got: "${t}".`);const e=t.split("-"),i=Number(e[0]),n=Number(e[1]),r=Number(e[2]);return new Date(Date.UTC(i,n-1,r))}_UTCDateToDateStr(t){return t.toISOString().split("T")[0]}_UTCDateToWeekFormat(t){return`${this._getISOWeekYear(t)}-W${this._getISOWeek(t)}`}_getISOWeek(t){let e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);let i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)}_getISOWeekYear(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+3-(e.getDay()+6)%7),e.getFullYear()}_getDateStrOfISOWeek(t,e){let i=new Date(Date.UTC(t,0,1+7*(e-1))),n=i.getUTCDay(),r=i;return n<=4?r.setDate(i.getDate()-i.getUTCDay()+1):r.setDate(i.getDate()+8-i.getUTCDay()),r.toISOString().split("T")[0]}getIntervalSizes(){return{D:this._computeIntervalSize("D"),W:this._computeIntervalSize("W"),M:this._computeIntervalSize("M"),Y:this._computeIntervalSize("Y"),"5Y":this._computeIntervalSize("5Y"),"10Y":this._computeIntervalSize("10Y")}}_computeIntervalSize(t){const e=this.getMaxDateStr();if(!e)return 0;const i=this._dateStrToUTCDate(e),n=this._getFirstDay(this._classify(this.getMinDateStr(),t));let r=this._dateStrToUTCDate(n),o=0;for(;r<=i;)o++,r=this._increaseDateBy(t,r);return o}_increaseDateBy(t,e){switch(t){case"D":return this._addDays(e,1);case"W":return this._addDays(e,7);case"M":return this._addMonths(e,1);case"Y":return this._addYears(e,1);case"5Y":return this._addYears(e,5);case"10Y":return this._addYears(e,10)}}_addDays(t,e){let i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i}_addMonths(t,e){let i=new Date(t.valueOf()),n=i.getUTCDate();return i.setUTCMonth(i.getUTCMonth()+ +e),i.getUTCDate()!=n&&i.setUTCDate(0),i}_addYears(t,e){let i=new Date(t.valueOf());return i.setUTCFullYear(i.getUTCFullYear()+e),i}_isValidDateStr(t){if(!t)return!1;let e=t.split("-");if(3!==e.length)return!1;let i=e[0],n=e[1],r=e[2];return"0000"!==i&&"00"!==r&&"00"!==n&&(!(Number(r)<1||Number(r)>31)&&!(Number(n)<1||Number(n)>12))}_monthLookup(t){if(t>12||t<1)throw new Error("invalid 'num' provided, expected 1-12. Got: "+t);return{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"}[t.toString()]}}class ud{constructor(){}run(t){this.input=t,this.day="??",this.month="??",this.year="????";const e=this.input.match(this._isoMatchRegex()),i=this.input.match(this._customRegex()),n=this.input.match(this._weekMatchRegex()),r=this.input.match(this._yearAndMonthRegex());if(e){const t=e[1].split(/-|\/|\s/);this.year=t[0],this.month=this._setWithLeadingZero(t[1]),this.day=this._setWithLeadingZero(t[2])}else if(r){const t=r[1].split("-");this.year=t[0],this.month=this._setWithLeadingZero(t[1]),this.day="01"}else if(i){const t=i[0].split(/\.|\s|\/|-/);this.day=this._setWithLeadingZero(t[0]),this.month=this._setWithLeadingZero(t[1]),this.year=t[2]}else{if(n){const t=n[0].split(/\.|\s|\/|-/),e=Number(t[0]),i=Number(t[1].replace("W0","").replace("W",""));return this._getDateStrOfISOWeek(e,i)}this._findYear(),this._findMonth(),this._findDay()}return this._buildResult()}_buildResult(){return"????"!=this.year&&"??"===this.month&&(this.month="01"),"??"!=this.month&&"??"===this.day&&(this.day="01"),`${this.year}-${this.month}-${this.day}`}_isoMatchRegex(){return/(?:\s|^)(\d{4}(-|\s|\/)([0][1-9]|[1-9]|10|11|12)(-|\s|\/)([0][1-9]|[1-2][0-9]|3[01]|[1-9]))(?=\s|$|\.)/}_customRegex(){return/\d{1,2}(\.|\s|\/|-)\d{1,2}(\.|\s|\/|-)\d{4}/}_weekMatchRegex(){return/\d{4}(\.|\s|\/|-)W\d{1,2}(?=\s|$|\.)/}_yearAndMonthRegex(){return/(?:\s|^)(\d{4}-([0][1-9]|[1-9]|10|11|12))(?=\s|$)/}_findYear(){let t=/[1-9]{1}[0-9]{3}/;const e=this.input.match(t);e&&(this.year=e[0],this._removeMatchFromInput(e))}_findMonth(){this._monthDictionaryValues().forEach(t=>{const e=new RegExp(`(?:\\s|^)(${t})(?=\\s|$|\\.)`,"i"),i=this.input.match(e);if(i)return this.month=this._monthDictionary()[i[1].toLowerCase()],this._removeMatchFromInput(i),this.month})}_findDay(){const t=/(?:\s|^)([0][1-9]|[1-2][0-9]|3[01]|[1-9])(?=\s|$|\.|st|nd|rd|th)/,e=this.input.match(t);e&&(this.day=this._setWithLeadingZero(e[1]))}_setWithLeadingZero(t){return 1==(t=t.toString()).length?"0"+t:t}_removeMatchFromInput(t){if(t&&t[0]&&t.index){let e=t[0].length,i=this.input.split("");i.splice(t.index,e),this.input=i.join("")}}_monthDictionaryValues(){return Object.keys(this._monthDictionary())}_monthDictionary(){return{jan:"01",januar:"01",feb:"02",februar:"02","mär":"03","märz":"03",apr:"04",april:"04",mai:"05",mai:"05",jun:"06",juni:"06",jul:"07",juli:"07",aug:"08",august:"08",sep:"09",september:"09",okt:"10",oktober:"10",nov:"11",november:"11",dez:"12",dezember:"12",jan:"01",january:"01",feb:"02",february:"02",mar:"03",march:"03",apr:"04",april:"04",may:"05",may:"05",jun:"06",june:"06",jul:"07",july:"07",aug:"08",august:"08",sep:"09",september:"09",oct:"10",october:"10",nov:"11",november:"11",dec:"12",december:"12",janv:"01",janvier:"01","févr":"02","février'":"02",mars:"03",mars:"03",avr:"04",avril:"04",mai:"05",mai:"05",juin:"06",juin:"06",juil:"07",juillet:"07","août":"08","août":"08",sept:"09",septembre:"09",oct:"10",octobre:"10",nov:"11",novembre:"11","déc":"12","décembre":"12",gen:"01",gennaio:"01",feb:"02",febbraio:"02",mar:"03",marzo:"03",apr:"04",aprile:"04",mag:"05",maggio:"05",giu:"06",giugno:"06",lug:"07",luglio:"07",ago:"08",agosto:"08",set:"09",settembre:"09",ott:"10",ottobre:"10",nov:"11",novembre:"11",dic:"12",dicembre:"12"}}_getDateStrOfISOWeek(t,e){let i=new Date(t,0,1+7*(e-1)),n=i.getDay(),r=i;return n<=4?r.setDate(i.getDate()-i.getDay()+1):r.setDate(i.getDate()+8-i.getDay()),r.getFullYear()>t?t+"-12-31":r.getFullYear()<t?t+"-01-01":this._dateToDateStr(r)}_dateToDateStr(t){let e=new Date(t),i=this._setWithLeadingZero(e.getMonth()+1),n=this._setWithLeadingZero(e.getDate());return`${e.getFullYear()}-${i}-${n}`}}class gd extends(D(V)){static get styles(){return R`
4236
4248
  :host{
4237
4249
  display: block;
4238
4250
  }
@@ -4425,7 +4437,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4425
4437
  .close.rounded::before, .close.rounded::after {
4426
4438
  border-radius: 5px;
4427
4439
  }
4428
- `}static get properties(){return Object.assign(Object.assign({},super.properties),{},{startDate:{type:String,reflect:!0,attribute:"start-date"},endDate:{type:String,reflect:!0,attribute:"end-date"},scope:{type:String},scopes:{type:Array},maxInterval:{type:Number,attribute:"max-interval"},url:{type:String},auto:{type:Boolean},resettable:{type:Boolean},_language:{type:String}})}constructor(){super(),this.maxHeight=80,this.multiplier=.75,this.mousedown=!1,this.startDate="",this.endDate="",this.scope="",this.scopes=["D","W","M","Y","5Y","10Y"],this.maxInterval=60,this.url="",this.auto=!1,this.resettable=!1,this._language="en",this._resetSelectionProperty()}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-results-received",()=>{const t=this.shadowRoot.getElementById("loadData"),e=this.toAbsoluteURL(this.url,this.getEndpoint());t.url=e,t.generateRequest()}),this.subscribeTo("pb-i18n-update",t=>{this._language=t.detail.language})}firstUpdated(){this.bins=this.shadowRoot.querySelectorAll(".bin-container"),this.tooltip=this.shadowRoot.getElementById("tooltip"),document.addEventListener("mouseup",()=>{this._mouseUp()}),document.addEventListener("pb-timeline-daterange-changed",t=>{const e=t.detail.startDateStr,i=t.detail.endDateStr;if(this._fullRangeSelected(e,i))return console.log("_fullRangeSelected() is true"),void this.resetSelection();this.select(e,i)}),document.addEventListener("pb-timeline-reset-selection",()=>{this.resetSelection(),this._hideTooltip()})}updated(t){t.has("scope")&&this.searchResult&&(this.scopes.includes(this.scope)?this.setData(this.searchResult.export(this.scope)):console.error("unknown scope ",this.scope))}setData(t){this.dataObj=t,this.maxValue=Math.max(...this.dataObj.data.map(t=>t.value)),this.requestUpdate(),this.updateComplete.then(()=>{this.bins=this.shadowRoot.querySelectorAll(".bin-container"),this.resetSelection(),this._resetTooltip()})}get label(){return this.dataObj&&0!==this.dataObj.data.length?1===this.dataObj.data.length?this.dataObj.data[0].category:`${this.dataObj.data[0].category} – ${this.dataObj.data[this.dataObj.data.length-1].category}`:""}getSelectedStartDateStr(){return this.shadowRoot.querySelectorAll(".bin-container.selected")[0].dataset.selectionstart}getSelectedEndDateStr(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected");return t[t.length-1].dataset.selectionend}getSelectedCategories(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected"),e=[];return t.forEach(t=>e.push(t.dataset.category)),e}getSelectedItemCount(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected");let e=0;return t.forEach(t=>{e+=parseInt(t.dataset.value)}),e}resetSelection(){this.bins.forEach(t=>{t.classList.remove("selected")}),this._resetSelectionProperty(),this._hideTooltip()}select(t,e){this.bins.forEach(i=>{i.dataset.isodatestr>=t&&i.dataset.isodatestr<=e?i.classList.add("selected"):i.classList.remove("selected")}),this._displayTooltip(),this._showtooltipSelection()}_fullRangeSelected(t,e){const i=this.bins[0].dataset.isodatestr,n=e===this.bins[this.bins.length-1].dataset.isodatestr;return i&&n}_mouseDown(t){this.resetSelection(),this.mousedown=!0,this.selection.start=this._getMousePosition(t).x,this._applySelectionToBins()}_mouseUp(){if(this.mousedown){this.mousedown=!1;const t=this.getSelectedStartDateStr(),e=this.getSelectedEndDateStr();if(t){const i=(new dd).run(t),n=(new dd).run(e),r=this.getSelectedItemCount();this._dispatchTimelineDaterangeChangedEvent(i,n,this.getSelectedCategories(),r)}}}_mouseMove(t){this.mousedown?(this._brushing(t),this._showtooltipSelection()):void 0===this.selection.start&&this._showtooltip(t)}_mouseenter(){this.dataObj&&this._displayTooltip()}_getMousePosition(t){let e=this.shadowRoot.querySelector(".wrapper").getBoundingClientRect();return{x:t.clientX-e.left+1,y:t.clientY-e.top+1}}_brushing(t){this.selection.end=this._getMousePosition(t).x,this._applySelectionToBins()}_dispatchTimelineDaterangeChangedEvent(t,e,i,n){"????-??-??"===t?this.emitTo("pb-timeline-date-changed",{startDateStr:null,endDateStr:null,categories:["?"],count:n}):t===e?"D"!==this.dataObj.scope?this.emitTo("pb-timeline-daterange-changed",{startDateStr:t,endDateStr:this.searchResult.getEndOfRangeDate(this.dataObj.scope,e),scope:this.dataObj.scope,categories:i,count:n,label:this.label}):this.emitTo("pb-timeline-date-changed",{startDateStr:t,endDateStr:null,scope:this.dataObj.scope,categories:i,count:n,label:this.label}):this.emitTo("pb-timeline-daterange-changed",{startDateStr:t,endDateStr:e,categories:i,scope:this.dataObj.scope,count:n,label:this.label})}_dispatchPbTimelineResetSelectionEvent(){this.emitTo("pb-timeline-reset-selection")}_showtooltip(t){const e=this._getElementInterval(t.currentTarget);let i;e[0]<e[2]?(i=Math.round((e[0]+e[1])/2-10),this.tooltip.classList.remove("right")):(i=Math.round((e[0]+e[1])/2-this.tooltip.offsetWidth)+10,this.tooltip.classList.add("right")),this.tooltip.style.left=i+"px";const n=t.currentTarget.dataset.tooltip,r=this._numberWithCommas(t.currentTarget.dataset.value),o=t.currentTarget.querySelector(".info");this.tooltip.querySelector("#tooltip-text").innerHTML=`<div><strong>${n}</strong>: ${r}</div><ul>${o?o.innerHTML:""}</ul>`}_showtooltipSelection(){const t=this._getSelectedBins(),e=[this._getElementInterval(t[0])[0],this._getElementInterval(t[t.length-1])[1]],i=`${t[0].dataset.selectionstart} - ${t[t.length-1].dataset.selectionend}`,n=t.map(t=>Number(t.dataset.value)).reduce((t,e)=>t+e),r=this._numberWithCommas(n);this.tooltip.querySelector("#tooltip-text").innerHTML=`<strong>${i}</strong>: ${r}`,this.tooltip.querySelector("#tooltip-close").classList.remove("hidden"),this.tooltip.classList.add("draggable");const o=Math.round((e[0]+e[1])/2-this.tooltip.offsetWidth/2);this.tooltip.style.left=o+"px"}_resetTooltip(){this._hideTooltip(),this.tooltip.style.left="-1000px",this.tooltip.querySelector("#tooltip-text").innerHTML=""}_hideTooltip(){void 0===this.selection.start&&(this.tooltip.classList.add("hidden"),this.tooltip.classList.remove("draggable"),this.tooltip.querySelector("#tooltip-close").classList.add("hidden"))}_displayTooltip(){this.tooltip.classList.remove("hidden")}_getElementInterval(t){let e=this.shadowRoot.querySelector(".wrapper").getBoundingClientRect(),i=t,n=[i.getBoundingClientRect().x,i.getBoundingClientRect().x+i.getBoundingClientRect().width];return[n[0]-e.left+1,n[1]-e.left+1,e.width/2]}_getSelectionInterval(){return[this.selection.start,this.selection.end].sort((t,e)=>t-e)}_getSelectedBins(){return Array.prototype.slice.call(this.bins).filter(t=>t.classList.contains("selected"))}_resetSelectionProperty(){this.selection={start:void 0,end:void 0}}_applySelectionToBins(){const t=this._getSelectionInterval();this.bins.forEach(e=>{const i=this._getElementInterval(e);this._areOverlapping(i,t)?e.classList.add("selected"):e.classList.remove("selected")})}_numberWithCommas(t){return new Intl.NumberFormat(this._language,{style:"decimal"}).format(t)}_areOverlapping(t,e){return e[0]<t[0]?e[1]>t[0]:e[0]<t[1]}render(){return I`
4440
+ `}static get properties(){return Object.assign(Object.assign({},super.properties),{},{startDate:{type:String,reflect:!0,attribute:"start-date"},endDate:{type:String,reflect:!0,attribute:"end-date"},scope:{type:String},scopes:{type:Array},maxInterval:{type:Number,attribute:"max-interval"},url:{type:String},auto:{type:Boolean},resettable:{type:Boolean},_language:{type:String}})}constructor(){super(),this.maxHeight=80,this.multiplier=.75,this.mousedown=!1,this.startDate="",this.endDate="",this.scope="",this.scopes=["D","W","M","Y","5Y","10Y"],this.maxInterval=60,this.url="",this.auto=!1,this.resettable=!1,this._language="en",this._resetSelectionProperty()}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-results-received",()=>{const t=this.shadowRoot.getElementById("loadData"),e=this.toAbsoluteURL(this.url,this.getEndpoint());t.url=e,t.generateRequest()}),this.subscribeTo("pb-i18n-update",t=>{this._language=t.detail.language})}firstUpdated(){this.bins=this.shadowRoot.querySelectorAll(".bin-container"),this.tooltip=this.shadowRoot.getElementById("tooltip"),document.addEventListener("mouseup",()=>{this._mouseUp()}),document.addEventListener("pb-timeline-daterange-changed",t=>{const e=t.detail.startDateStr,i=t.detail.endDateStr;if(this._fullRangeSelected(e,i))return console.log("_fullRangeSelected() is true"),void this.resetSelection();this.select(e,i)}),document.addEventListener("pb-timeline-reset-selection",()=>{this.resetSelection(),this._hideTooltip()})}updated(t){t.has("scope")&&this.searchResult&&(this.scopes.includes(this.scope)?this.setData(this.searchResult.export(this.scope)):console.error("unknown scope ",this.scope))}setData(t){this.dataObj=t,this.maxValue=Math.max(...this.dataObj.data.map(t=>t.value)),this.requestUpdate(),this.updateComplete.then(()=>{this.bins=this.shadowRoot.querySelectorAll(".bin-container"),this.resetSelection(),this._resetTooltip()})}get label(){return this.dataObj&&0!==this.dataObj.data.length?1===this.dataObj.data.length?this.dataObj.data[0].category:`${this.dataObj.data[0].category} – ${this.dataObj.data[this.dataObj.data.length-1].category}`:""}getSelectedStartDateStr(){return this.shadowRoot.querySelectorAll(".bin-container.selected")[0].dataset.selectionstart}getSelectedEndDateStr(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected");return t[t.length-1].dataset.selectionend}getSelectedCategories(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected"),e=[];return t.forEach(t=>e.push(t.dataset.category)),e}getSelectedItemCount(){const t=this.shadowRoot.querySelectorAll(".bin-container.selected");let e=0;return t.forEach(t=>{e+=parseInt(t.dataset.value)}),e}resetSelection(){this.bins.forEach(t=>{t.classList.remove("selected")}),this._resetSelectionProperty(),this._hideTooltip()}select(t,e){this.bins.forEach(i=>{i.dataset.isodatestr>=t&&i.dataset.isodatestr<=e?i.classList.add("selected"):i.classList.remove("selected")}),this._displayTooltip(),this._showtooltipSelection()}_fullRangeSelected(t,e){const i=this.bins[0].dataset.isodatestr,n=e===this.bins[this.bins.length-1].dataset.isodatestr;return i&&n}_mouseDown(t){this.resetSelection(),this.mousedown=!0,this.selection.start=this._getMousePosition(t).x,this._applySelectionToBins()}_mouseUp(){if(this.mousedown){this.mousedown=!1;const t=this.getSelectedStartDateStr(),e=this.getSelectedEndDateStr();if(t){const i=(new ud).run(t),n=(new ud).run(e),r=this.getSelectedItemCount();this._dispatchTimelineDaterangeChangedEvent(i,n,this.getSelectedCategories(),r)}}}_mouseMove(t){this.mousedown?(this._brushing(t),this._showtooltipSelection()):void 0===this.selection.start&&this._showtooltip(t)}_mouseenter(){this.dataObj&&this._displayTooltip()}_getMousePosition(t){let e=this.shadowRoot.querySelector(".wrapper").getBoundingClientRect();return{x:t.clientX-e.left+1,y:t.clientY-e.top+1}}_brushing(t){this.selection.end=this._getMousePosition(t).x,this._applySelectionToBins()}_dispatchTimelineDaterangeChangedEvent(t,e,i,n){"????-??-??"===t?this.emitTo("pb-timeline-date-changed",{startDateStr:null,endDateStr:null,categories:["?"],count:n}):t===e?"D"!==this.dataObj.scope?this.emitTo("pb-timeline-daterange-changed",{startDateStr:t,endDateStr:this.searchResult.getEndOfRangeDate(this.dataObj.scope,e),scope:this.dataObj.scope,categories:i,count:n,label:this.label}):this.emitTo("pb-timeline-date-changed",{startDateStr:t,endDateStr:null,scope:this.dataObj.scope,categories:i,count:n,label:this.label}):this.emitTo("pb-timeline-daterange-changed",{startDateStr:t,endDateStr:e,categories:i,scope:this.dataObj.scope,count:n,label:this.label})}_dispatchPbTimelineResetSelectionEvent(){this.emitTo("pb-timeline-reset-selection")}_showtooltip(t){const e=this._getElementInterval(t.currentTarget);let i;e[0]<e[2]?(i=Math.round((e[0]+e[1])/2-10),this.tooltip.classList.remove("right")):(i=Math.round((e[0]+e[1])/2-this.tooltip.offsetWidth)+10,this.tooltip.classList.add("right")),this.tooltip.style.left=i+"px";const n=t.currentTarget.dataset.tooltip,r=this._numberWithCommas(t.currentTarget.dataset.value),o=t.currentTarget.querySelector(".info");this.tooltip.querySelector("#tooltip-text").innerHTML=`<div><strong>${n}</strong>: ${r}</div><ul>${o?o.innerHTML:""}</ul>`}_showtooltipSelection(){const t=this._getSelectedBins(),e=[this._getElementInterval(t[0])[0],this._getElementInterval(t[t.length-1])[1]],i=`${t[0].dataset.selectionstart} - ${t[t.length-1].dataset.selectionend}`,n=t.map(t=>Number(t.dataset.value)).reduce((t,e)=>t+e),r=this._numberWithCommas(n);this.tooltip.querySelector("#tooltip-text").innerHTML=`<strong>${i}</strong>: ${r}`,this.tooltip.querySelector("#tooltip-close").classList.remove("hidden"),this.tooltip.classList.add("draggable");const o=Math.round((e[0]+e[1])/2-this.tooltip.offsetWidth/2);this.tooltip.style.left=o+"px"}_resetTooltip(){this._hideTooltip(),this.tooltip.style.left="-1000px",this.tooltip.querySelector("#tooltip-text").innerHTML=""}_hideTooltip(){void 0===this.selection.start&&(this.tooltip.classList.add("hidden"),this.tooltip.classList.remove("draggable"),this.tooltip.querySelector("#tooltip-close").classList.add("hidden"))}_displayTooltip(){this.tooltip.classList.remove("hidden")}_getElementInterval(t){let e=this.shadowRoot.querySelector(".wrapper").getBoundingClientRect(),i=t,n=[i.getBoundingClientRect().x,i.getBoundingClientRect().x+i.getBoundingClientRect().width];return[n[0]-e.left+1,n[1]-e.left+1,e.width/2]}_getSelectionInterval(){return[this.selection.start,this.selection.end].sort((t,e)=>t-e)}_getSelectedBins(){return Array.prototype.slice.call(this.bins).filter(t=>t.classList.contains("selected"))}_resetSelectionProperty(){this.selection={start:void 0,end:void 0}}_applySelectionToBins(){const t=this._getSelectionInterval();this.bins.forEach(e=>{const i=this._getElementInterval(e);this._areOverlapping(i,t)?e.classList.add("selected"):e.classList.remove("selected")})}_numberWithCommas(t){return new Intl.NumberFormat(this._language,{style:"decimal"}).format(t)}_areOverlapping(t,e){return e[0]<t[0]?e[1]>t[0]:e[0]<t[1]}render(){return I`
4429
4441
  <div class="label" part="label">
4430
4442
  <span class="label"><slot name="label"></slot>${this.label}</span>
4431
4443
  ${this.resettable?I`
@@ -4487,12 +4499,12 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
4487
4499
  <ul class="info">
4488
4500
  ${t.info.map(t=>I`<li>${K(t)}</li>`)}
4489
4501
  </ul>
4490
- `:null}async _handleResponse(){await this.updateComplete;const t=this.shadowRoot.getElementById("loadData").lastResponse;let e={};this.startDate&&this.endDate?Object.keys(t).filter(t=>t>=this.startDate&&t<this.endDate).forEach(i=>{e[i]=t[i]}):e=t,this.searchResult=new hd(e,this.maxInterval,this.scopes),this.setData(this.searchResult.export(this.scope)),this.emitTo("pb-timeline-loaded",{value:!0,label:this.label})}}function ud(t,e){t.split(/\s+/).forEach(t=>{e(t)})}customElements.define("pb-timeline",pd);class gd{constructor(){this._events=void 0,this._events={}}on(t,e){ud(t,t=>{const i=this._events[t]||[];i.push(e),this._events[t]=i})}off(t,e){var i=arguments.length;0!==i?ud(t,t=>{if(1===i)return void delete this._events[t];const n=this._events[t];void 0!==n&&(n.splice(n.indexOf(e),1),this._events[t]=n)}):this._events={}}trigger(t,...e){var i=this;ud(t,t=>{const n=i._events[t];void 0!==n&&n.forEach(t=>{t.apply(i,e)})})}}function fd(t){return t.plugins={},class extends t{constructor(...t){super(...t),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,i){t.plugins[e]={name:e,fn:i}}initializePlugins(t){var e,i;const n=this,r=[];if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?r.push(t):(n.plugins.settings[t.name]=t.options,r.push(t.name))});else if(t)for(e in t)t.hasOwnProperty(e)&&(n.plugins.settings[e]=t[e],r.push(e));for(;i=r.shift();)n.require(i)}loadPlugin(e){var i=this,n=i.plugins,r=t.plugins[e];if(!t.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');n.requested[e]=!0,n.loaded[e]=r.fn.apply(i,[i.plugins.settings[e]||{}]),n.names.push(e)}require(t){var e=this,i=e.plugins;if(!e.plugins.loaded.hasOwnProperty(t)){if(i.requested[t])throw new Error('Plugin has circular dependency ("'+t+'")');e.loadPlugin(t)}return i.loaded[t]}}}
4491
- /*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const md=t=>(t=t.filter(Boolean)).length<2?t[0]||"":1==wd(t)?"["+t.join("")+"]":"(?:"+t.join("|")+")",vd=t=>{if(!yd(t))return t.join("");let e="",i=0;const n=()=>{i>1&&(e+="{"+i+"}")};return t.forEach((r,o)=>{r!==t[o-1]?(n(),e+=r,i=1):i++}),n(),e},bd=t=>{let e=kd(t);return md(e)},yd=t=>new Set(t).size!==t.length,_d=t=>(t+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),wd=t=>t.reduce((t,e)=>Math.max(t,xd(e)),0),xd=t=>kd(t).length,kd=t=>Array.from(t)
4492
- /*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */,Ad=t=>{if(1===t.length)return[[t]];let e=[];const i=t.substring(1);return Ad(i).forEach((function(i){let n=i.slice(0);n[0]=t.charAt(0)+n[0],e.push(n),n=i.slice(0),n.unshift(t.charAt(0)),e.push(n)})),e},Sd=[[0,65535]],zd="[̀-ͯ·ʾʼ]";let Cd,Ed;const Td=3,Ld={},Md={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in Md){let e=Md[t]||"";for(let i=0;i<e.length;i++){let n=e.substring(i,i+1);Ld[n]=t}}const Od=new RegExp(Object.keys(Ld).join("|")+"|"+zd,"gu"),$d=t=>{void 0===Cd&&(Cd=Nd(t||Sd))},Hd=(t,e="NFKD")=>t.normalize(e),Id=t=>kd(t).reduce((t,e)=>t+Rd(e),""),Rd=t=>(t=Hd(t).toLowerCase().replace(Od,t=>Ld[t]||""),Hd(t,"NFC"));function*Pd(t){for(const[e,i]of t)for(let t=e;t<=i;t++){let e=String.fromCharCode(t),i=Id(e);i!=e.toLowerCase()&&(i.length>Td||0!=i.length&&(yield{folded:i,composed:e,code_point:t}))}}const Vd=t=>{const e={},i=(t,i)=>{const n=e[t]||new Set,r=new RegExp("^"+bd(n)+"$","iu");i.match(r)||(n.add(_d(i)),e[t]=n)};for(let e of Pd(t))i(e.folded,e.folded),i(e.folded,e.composed);return e},Nd=t=>{const e=Vd(t),i={};let n=[];for(let t in e){let r=e[t];r&&(i[t]=bd(r)),t.length>1&&n.push(_d(t))}n.sort((t,e)=>e.length-t.length);const r=md(n);return Ed=new RegExp("^"+r,"u"),i},Dd=(t,e=1)=>{let i=0;return t=t.map(t=>(Cd[t]&&(i+=t.length),Cd[t]||t)),i>=e?vd(t):""},Fd=(t,e=1)=>(e=Math.max(e,t.length-1),md(Ad(t).map(t=>Dd(t,e)))),Bd=(t,e=!0)=>{let i=t.length>1?1:0;return md(t.map(t=>{let n=[];const r=e?t.length():t.length()-1;for(let e=0;e<r;e++)n.push(Fd(t.substrs[e]||"",i));return vd(n)}))},jd=(t,e)=>{for(const i of e){if(i.start!=t.start||i.end!=t.end)continue;if(i.substrs.join("")!==t.substrs.join(""))continue;let e=t.parts;const n=t=>{for(const i of e){if(i.start===t.start&&i.substr===t.substr)return!1;if(1!=t.length&&1!=i.length){if(t.start<i.start&&t.end>i.start)return!0;if(i.start<t.start&&i.end>t.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class qd{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(t){t&&(this.parts.push(t),this.substrs.push(t.substr),this.start=Math.min(t.start,this.start),this.end=Math.max(t.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let i=new qd,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const t of n)i.add(t);let o=e.substr.substring(0,t-r.start),s=o.length;return i.add({start:r.start,end:r.start+s,length:s,substr:o}),i}}const Ud=t=>{$d(),t=Id(t);let e="",i=[new qd];for(let n=0;n<t.length;n++){let r=t.substring(n).match(Ed);const o=t.substring(n,n+1),s=r?r[0]:null;let a=[],l=new Set;for(const t of i){const e=t.last();if(!e||1==e.length||e.end<=n)if(s){const e=s.length;t.add({start:n,end:n+e,length:e,substr:s}),l.add("1")}else t.add({start:n,end:n+1,length:1,substr:o}),l.add("2");else if(s){let i=t.clone(n,e);const r=s.length;i.add({start:n,end:n+r,length:r,substr:s}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort((t,e)=>t.length()-e.length());for(let t of a)jd(t,i)||i.push(t)}else if(n>0&&1==l.size&&!l.has("3")){e+=Bd(i,!1);let t=new qd;const n=i[0];n&&t.add(n.last()),i=[t]}}return e+=Bd(i,!0),e},Wd=(t,e)=>{if(t)return t[e]},Yd=(t,e)=>{if(t){for(var i,n=e.split(".");(i=n.shift())&&(t=t[i]););return t}},Gd=(t,e,i)=>{var n,r;return t?(t+="",null==e.regex||-1===(r=t.search(e.regex))?0:(n=e.string.length/t.length,0===r&&(n+=.5),n*i)):0},Kd=(t,e)=>{var i=t[e];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(t[e]=[i])},Xd=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},Zd=(t,e)=>"number"==typeof t&&"number"==typeof e?t>e?1:t<e?-1:0:(t=Id(t+"").toLowerCase())>(e=Id(e+"").toLowerCase())?1:e>t?-1:0;
4502
+ `:null}async _handleResponse(){await this.updateComplete;const t=this.shadowRoot.getElementById("loadData").lastResponse;let e={};this.startDate&&this.endDate?Object.keys(t).filter(t=>t>=this.startDate&&t<this.endDate).forEach(i=>{e[i]=t[i]}):e=t,this.searchResult=new pd(e,this.maxInterval,this.scopes),this.setData(this.searchResult.export(this.scope)),this.emitTo("pb-timeline-loaded",{value:!0,label:this.label})}}function fd(t,e){t.split(/\s+/).forEach(t=>{e(t)})}customElements.define("pb-timeline",gd);class md{constructor(){this._events=void 0,this._events={}}on(t,e){fd(t,t=>{const i=this._events[t]||[];i.push(e),this._events[t]=i})}off(t,e){var i=arguments.length;0!==i?fd(t,t=>{if(1===i)return void delete this._events[t];const n=this._events[t];void 0!==n&&(n.splice(n.indexOf(e),1),this._events[t]=n)}):this._events={}}trigger(t,...e){var i=this;fd(t,t=>{const n=i._events[t];void 0!==n&&n.forEach(t=>{t.apply(i,e)})})}}function vd(t){return t.plugins={},class extends t{constructor(...t){super(...t),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,i){t.plugins[e]={name:e,fn:i}}initializePlugins(t){var e,i;const n=this,r=[];if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?r.push(t):(n.plugins.settings[t.name]=t.options,r.push(t.name))});else if(t)for(e in t)t.hasOwnProperty(e)&&(n.plugins.settings[e]=t[e],r.push(e));for(;i=r.shift();)n.require(i)}loadPlugin(e){var i=this,n=i.plugins,r=t.plugins[e];if(!t.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');n.requested[e]=!0,n.loaded[e]=r.fn.apply(i,[i.plugins.settings[e]||{}]),n.names.push(e)}require(t){var e=this,i=e.plugins;if(!e.plugins.loaded.hasOwnProperty(t)){if(i.requested[t])throw new Error('Plugin has circular dependency ("'+t+'")');e.loadPlugin(t)}return i.loaded[t]}}}
4503
+ /*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const bd=t=>(t=t.filter(Boolean)).length<2?t[0]||"":1==kd(t)?"["+t.join("")+"]":"(?:"+t.join("|")+")",yd=t=>{if(!wd(t))return t.join("");let e="",i=0;const n=()=>{i>1&&(e+="{"+i+"}")};return t.forEach((r,o)=>{r!==t[o-1]?(n(),e+=r,i=1):i++}),n(),e},_d=t=>{let e=Sd(t);return bd(e)},wd=t=>new Set(t).size!==t.length,xd=t=>(t+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),kd=t=>t.reduce((t,e)=>Math.max(t,Ad(e)),0),Ad=t=>Sd(t).length,Sd=t=>Array.from(t)
4504
+ /*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */,zd=t=>{if(1===t.length)return[[t]];let e=[];const i=t.substring(1);return zd(i).forEach((function(i){let n=i.slice(0);n[0]=t.charAt(0)+n[0],e.push(n),n=i.slice(0),n.unshift(t.charAt(0)),e.push(n)})),e},Cd=[[0,65535]],Ed="[̀-ͯ·ʾʼ]";let Td,Ld;const Md=3,Od={},$d={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in $d){let e=$d[t]||"";for(let i=0;i<e.length;i++){let n=e.substring(i,i+1);Od[n]=t}}const Hd=new RegExp(Object.keys(Od).join("|")+"|"+Ed,"gu"),Id=t=>{void 0===Td&&(Td=Fd(t||Cd))},Rd=(t,e="NFKD")=>t.normalize(e),Pd=t=>Sd(t).reduce((t,e)=>t+Vd(e),""),Vd=t=>(t=Rd(t).toLowerCase().replace(Hd,t=>Od[t]||""),Rd(t,"NFC"));function*Nd(t){for(const[e,i]of t)for(let t=e;t<=i;t++){let e=String.fromCharCode(t),i=Pd(e);i!=e.toLowerCase()&&(i.length>Md||0!=i.length&&(yield{folded:i,composed:e,code_point:t}))}}const Dd=t=>{const e={},i=(t,i)=>{const n=e[t]||new Set,r=new RegExp("^"+_d(n)+"$","iu");i.match(r)||(n.add(xd(i)),e[t]=n)};for(let e of Nd(t))i(e.folded,e.folded),i(e.folded,e.composed);return e},Fd=t=>{const e=Dd(t),i={};let n=[];for(let t in e){let r=e[t];r&&(i[t]=_d(r)),t.length>1&&n.push(xd(t))}n.sort((t,e)=>e.length-t.length);const r=bd(n);return Ld=new RegExp("^"+r,"u"),i},Bd=(t,e=1)=>{let i=0;return t=t.map(t=>(Td[t]&&(i+=t.length),Td[t]||t)),i>=e?yd(t):""},jd=(t,e=1)=>(e=Math.max(e,t.length-1),bd(zd(t).map(t=>Bd(t,e)))),qd=(t,e=!0)=>{let i=t.length>1?1:0;return bd(t.map(t=>{let n=[];const r=e?t.length():t.length()-1;for(let e=0;e<r;e++)n.push(jd(t.substrs[e]||"",i));return yd(n)}))},Ud=(t,e)=>{for(const i of e){if(i.start!=t.start||i.end!=t.end)continue;if(i.substrs.join("")!==t.substrs.join(""))continue;let e=t.parts;const n=t=>{for(const i of e){if(i.start===t.start&&i.substr===t.substr)return!1;if(1!=t.length&&1!=i.length){if(t.start<i.start&&t.end>i.start)return!0;if(i.start<t.start&&i.end>t.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class Wd{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(t){t&&(this.parts.push(t),this.substrs.push(t.substr),this.start=Math.min(t.start,this.start),this.end=Math.max(t.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let i=new Wd,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const t of n)i.add(t);let o=e.substr.substring(0,t-r.start),s=o.length;return i.add({start:r.start,end:r.start+s,length:s,substr:o}),i}}const Yd=t=>{Id(),t=Pd(t);let e="",i=[new Wd];for(let n=0;n<t.length;n++){let r=t.substring(n).match(Ld);const o=t.substring(n,n+1),s=r?r[0]:null;let a=[],l=new Set;for(const t of i){const e=t.last();if(!e||1==e.length||e.end<=n)if(s){const e=s.length;t.add({start:n,end:n+e,length:e,substr:s}),l.add("1")}else t.add({start:n,end:n+1,length:1,substr:o}),l.add("2");else if(s){let i=t.clone(n,e);const r=s.length;i.add({start:n,end:n+r,length:r,substr:s}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort((t,e)=>t.length()-e.length());for(let t of a)Ud(t,i)||i.push(t)}else if(n>0&&1==l.size&&!l.has("3")){e+=qd(i,!1);let t=new Wd;const n=i[0];n&&t.add(n.last()),i=[t]}}return e+=qd(i,!0),e},Gd=(t,e)=>{if(t)return t[e]},Kd=(t,e)=>{if(t){for(var i,n=e.split(".");(i=n.shift())&&(t=t[i]););return t}},Xd=(t,e,i)=>{var n,r;return t?(t+="",null==e.regex||-1===(r=t.search(e.regex))?0:(n=e.string.length/t.length,0===r&&(n+=.5),n*i)):0},Zd=(t,e)=>{var i=t[e];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(t[e]=[i])},Qd=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},Jd=(t,e)=>"number"==typeof t&&"number"==typeof e?t>e?1:t<e?-1:0:(t=Pd(t+"").toLowerCase())>(e=Pd(e+"").toLowerCase())?1:e>t?-1:0;
4493
4505
  /*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) */
4494
4506
  /*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) */
4495
- class Qd{constructor(t,e){this.items=void 0,this.settings=void 0,this.items=t,this.settings=e||{diacritics:!0}}tokenize(t,e,i){if(!t||!t.length)return[];const n=[],r=t.split(/\s+/);var o;return i&&(o=new RegExp("^("+Object.keys(i).map(_d).join("|")+"):(.*)$")),r.forEach(t=>{let i,r=null,s=null;o&&(i=t.match(o))&&(r=i[1],t=i[2]),t.length>0&&(s=this.settings.diacritics?Ud(t)||null:_d(t),s&&e&&(s="\\b"+s)),n.push({string:t,regex:s?new RegExp(s,"iu"):null,field:r})}),n}getScoreFunction(t,e){var i=this.prepareSearch(t,e);return this._getScoreFunction(i)}_getScoreFunction(t){const e=t.tokens,i=e.length;if(!i)return function(){return 0};const n=t.options.fields,r=t.weights,o=n.length,s=t.getAttrFn;if(!o)return function(){return 1};const a=1===o?function(t,e){const i=n[0].field;return Gd(s(e,i),t,r[i]||1)}:function(t,e){var i=0;if(t.field){const n=s(e,t.field);!t.regex&&n?i+=1/o:i+=Gd(n,t,1)}else Xd(r,(n,r)=>{i+=Gd(s(e,r),t,n)});return i/o};return 1===i?function(t){return a(e[0],t)}:"and"===t.options.conjunction?function(t){var n,r=0;for(let i of e){if((n=a(i,t))<=0)return 0;r+=n}return r/i}:function(t){var n=0;return Xd(e,e=>{n+=a(e,t)}),n/i}}getSortFunction(t,e){var i=this.prepareSearch(t,e);return this._getSortFunction(i)}_getSortFunction(t){var e,i=[];const n=this,r=t.options,o=!t.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof o)return o.bind(this);const s=function(e,i){return"$score"===e?i.score:t.getAttrFn(n.items[i.id],e)};if(o)for(let e of o)(t.query||"$score"!==e.field)&&i.push(e);if(t.query){e=!0;for(let t of i)if("$score"===t.field){e=!1;break}e&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(t=>"$score"!==t.field);return i.length?function(t,e){var n,r;for(let o of i){if(r=o.field,n=("desc"===o.direction?-1:1)*Zd(s(r,t),s(r,e)))return n}return 0}:null}prepareSearch(t,e){const i={};var n=Object.assign({},e);if(Kd(n,"sort"),Kd(n,"sort_empty"),n.fields){Kd(n,"fields");const t=[];n.fields.forEach(e=>{"string"==typeof e&&(e={field:e,weight:1}),t.push(e),i[e.field]="weight"in e?e.weight:1}),n.fields=t}return{options:n,query:t.toLowerCase().trim(),tokens:this.tokenize(t,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?Yd:Wd}}search(t,e){var i,n,r=this;n=this.prepareSearch(t,e),e=n.options,t=n.query;const o=e.score||r._getScoreFunction(n);t.length?Xd(r.items,(t,r)=>{i=o(t),(!1===e.filter||i>0)&&n.items.push({score:i,id:r})}):Xd(r.items,(t,e)=>{n.items.push({score:1,id:e})});const s=r._getSortFunction(n);return s&&n.items.sort(s),n.total=n.items.length,"number"==typeof e.limit&&(n.items=n.items.slice(0,e.limit)),n}}const Jd=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},tp=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(ep(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},ep=t=>"string"==typeof t&&t.indexOf("<")>-1,ip=t=>t.replace(/['"\\]/g,"\\$&"),np=(t,e)=>{var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!1),t.dispatchEvent(i)},rp=(t,e)=>{Object.assign(t.style,e)},op=(t,...e)=>{var i=ap(e);(t=lp(t)).map(t=>{i.map(e=>{t.classList.add(e)})})},sp=(t,...e)=>{var i=ap(e);(t=lp(t)).map(t=>{i.map(e=>{t.classList.remove(e)})})},ap=t=>{var e=[];return Jd(t,t=>{"string"==typeof t&&(t=t.trim().split(/[\11\12\14\15\40]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},lp=t=>(Array.isArray(t)||(t=[t]),t),cp=(t,e,i)=>{if(!i||i.contains(t))for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}},hp=(t,e=0)=>e>0?t[t.length-1]:t[0],dp=t=>0===Object.keys(t).length,pp=(t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var i=0;t=t.previousElementSibling;)t.matches(e)&&i++;return i},up=(t,e)=>{Jd(e,(e,i)=>{null==e?t.removeAttribute(i):t.setAttribute(i,""+e)})},gp=(t,e)=>{t.parentNode&&t.parentNode.replaceChild(e,t)},fp=(t,e)=>{if(null===e)return;if("string"==typeof e){if(!e.length)return;e=new RegExp(e,"i")}const i=t=>{var i=t.data.match(e);if(i&&t.data.length>0){var n=document.createElement("span");n.className="highlight";var r=t.splitText(i.index);r.splitText(i[0].length);var o=r.cloneNode(!0);return n.appendChild(o),gp(r,n),1}return 0},n=t=>{1!==t.nodeType||!t.childNodes||/(script|style)/i.test(t.tagName)||"highlight"===t.className&&"SPAN"===t.tagName||Array.from(t.childNodes).forEach(t=>{r(t)})},r=t=>3===t.nodeType?i(t):(n(t),0);r(t)},mp=t=>{var e=t.querySelectorAll("span.highlight");Array.prototype.forEach.call(e,(function(t){var e=t.parentNode;e.replaceChild(t.firstChild,t),e.normalize()}))},vp=65,bp=13,yp=27,_p=37,wp=38,xp=39,kp=40,Ap=8,Sp=46,zp=9,Cp="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var Ep={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(t){return t.length>0},render:{}};const Tp=t=>null==t?null:Lp(t),Lp=t=>"boolean"==typeof t?t?"1":"0":t+"",Mp=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Op=(t,e)=>{var i;return function(n,r){var o=this;i&&(o.loading=Math.max(o.loading-1,0),clearTimeout(i)),i=setTimeout((function(){i=null,o.loadedSearches[n]=!0,t.call(o,n,r)}),e)}},$p=(t,e,i)=>{var n,r=t.trigger,o={};for(n of(t.trigger=function(){var i=arguments[0];if(-1===e.indexOf(i))return r.apply(t,arguments);o[i]=arguments},i.apply(t,[]),t.trigger=r,e))n in o&&r.apply(t,o[n])},Hp=t=>({start:t.selectionStart||0,length:(t.selectionEnd||0)-(t.selectionStart||0)}),Ip=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},Rp=(t,e,i,n)=>{t.addEventListener(e,i,n)},Pp=(t,e)=>!!e&&(!!e[t]&&1===(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0)),Vp=(t,e)=>{const i=t.getAttribute("id");return i||(t.setAttribute("id",e),e)},Np=t=>t.replace(/[\\"']/g,"\\$&"),Dp=(t,e)=>{e&&t.append(e)};function Fp(t,e){var i=Object.assign({},Ep,e),n=i.dataAttr,r=i.labelField,o=i.valueField,s=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,h=t.tagName.toLowerCase(),d=t.getAttribute("placeholder")||t.getAttribute("data-placeholder");if(!d&&!i.allowEmptyOption){let e=t.querySelector('option[value=""]');e&&(d=e.textContent)}var p={placeholder:d,options:[],optgroups:[],items:[],maxItems:null},u=()=>{const e=t.getAttribute(n);if(e)p.options=JSON.parse(e),Jd(p.options,t=>{p.items.push(t[o])});else{var s=t.value.trim()||"";if(!i.allowEmptyOption&&!s.length)return;const e=s.split(i.delimiter);Jd(e,t=>{const e={};e[r]=t,e[o]=t,p.options.push(e)}),p.items=e}};return"select"===h?(()=>{var e,h=p.options,d={},u=1,g=t=>{var e=Object.assign({},t.dataset),i=n&&e[n];return"string"==typeof i&&i.length&&(e=Object.assign(e,JSON.parse(i))),e},f=(t,e)=>{var n=Tp(t.value);if(null!=n&&(n||i.allowEmptyOption)){if(d.hasOwnProperty(n)){if(e){var l=d[n][a];l?Array.isArray(l)?l.push(e):d[n][a]=[l,e]:d[n][a]=e}}else{var c=g(t);c[r]=c[r]||t.textContent,c[o]=c[o]||n,c[s]=c[s]||t.disabled,c[a]=c[a]||e,c.$option=t,d[n]=c,h.push(c)}t.selected&&p.items.push(n)}},m=t=>{var e,i;(i=g(t))[l]=i[l]||t.getAttribute("label")||"",i[c]=i[c]||u++,i[s]=i[s]||t.disabled,p.optgroups.push(i),e=i[c],Jd(t.children,t=>{f(t,e)})};p.maxItems=t.hasAttribute("multiple")?null:1,Jd(t.children,t=>{"optgroup"===(e=t.tagName.toLowerCase())?m(t):"option"===e&&f(t)})})():u(),Object.assign({},Ep,p,e)}var Bp=0;class jp extends(fd(gd)){constructor(t,e){var i;super(),this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isRequired=void 0,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.currentResults=void 0,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],Bp++;var n=tp(t);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=Fp(n,e);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=Vp(n,"tomselect-"+Bp),this.isRequired=n.required,this.sifter=new Qd(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var o=r.createFilter;"function"!=typeof o&&("string"==typeof o&&(o=new RegExp(o)),o instanceof RegExp?r.createFilter=t=>o.test(t):r.createFilter=t=>this.settings.duplicates||!this.options[t]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const s=tp("<div>"),a=tp("<div>"),l=this._render("dropdown"),c=tp('<div role="listbox" tabindex="-1">'),h=this.input.getAttribute("class")||"",d=r.mode;var p;(op(s,r.wrapperClass,h,d),op(a,r.controlClass),Dp(s,a),op(l,r.dropdownClass,d),r.copyClassesToDropdown&&op(l,h),op(c,r.dropdownContentClass),Dp(l,c),tp(r.dropdownParent||s).appendChild(l),ep(r.controlInput))?(p=tp(r.controlInput),Xd(["autocorrect","autocapitalize","autocomplete"],t=>{n.getAttribute(t)&&up(p,{[t]:n.getAttribute(t)})}),p.tabIndex=-1,a.appendChild(p),this.focus_node=p):r.controlInput?(p=tp(r.controlInput),this.focus_node=p):(p=tp("<input/>"),this.focus_node=a);this.wrapper=s,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=p,this.setup()}setup(){const t=this,e=t.settings,i=t.control_input,n=t.dropdown,r=t.dropdown_content,o=t.wrapper,s=t.control,a=t.input,l=t.focus_node,c={passive:!0},h=t.inputId+"-ts-dropdown";up(r,{id:h}),up(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":h});const d=Vp(l,t.inputId+"-ts-control"),p="label[for='"+ip(t.inputId)+"']",u=document.querySelector(p),g=t.focus.bind(t);if(u){Rp(u,"click",g),up(u,{for:d});const e=Vp(u,t.inputId+"-ts-label");up(l,{"aria-labelledby":e}),up(r,{"aria-labelledby":e})}if(o.style.width=a.style.width,t.plugins.names.length){const e="plugin-"+t.plugins.names.join(" plugin-");op([o,n],e)}(null===e.maxItems||e.maxItems>1)&&t.is_select_tag&&up(a,{multiple:"multiple"}),e.placeholder&&up(i,{placeholder:e.placeholder}),!e.splitOn&&e.delimiter&&(e.splitOn=new RegExp("\\s*"+_d(e.delimiter)+"+\\s*")),e.load&&e.loadThrottle&&(e.load=Op(e.load,e.loadThrottle)),t.control_input.type=a.type,Rp(n,"mousemove",()=>{t.ignoreHover=!1}),Rp(n,"mouseenter",e=>{var i=cp(e.target,"[data-selectable]",n);i&&t.onOptionHover(e,i)},{capture:!0}),Rp(n,"click",e=>{const i=cp(e.target,"[data-selectable]");i&&(t.onOptionSelect(e,i),Ip(e,!0))}),Rp(s,"click",e=>{var n=cp(e.target,"[data-ts-item]",s);n&&t.onItemSelect(e,n)?Ip(e,!0):""==i.value&&(t.onClick(),Ip(e,!0))}),Rp(l,"keydown",e=>t.onKeyDown(e)),Rp(i,"keypress",e=>t.onKeyPress(e)),Rp(i,"input",e=>t.onInput(e)),Rp(l,"blur",e=>t.onBlur(e)),Rp(l,"focus",e=>t.onFocus(e)),Rp(i,"paste",e=>t.onPaste(e));const f=e=>{const r=e.composedPath()[0];if(!o.contains(r)&&!n.contains(r))return t.isFocused&&t.blur(),void t.inputState();r==i&&t.isOpen?e.stopPropagation():Ip(e,!0)},m=()=>{t.isOpen&&t.positionDropdown()};Rp(document,"mousedown",f),Rp(window,"scroll",m,c),Rp(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",f),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),u&&u.removeEventListener("click",g)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",t.wrapper),t.sync(!1),e.items=[],delete e.optgroups,delete e.options,Rp(a,"invalid",()=>{t.isValid&&(t.isValid=!1,t.isInvalid=!0,t.refreshState())}),t.updateOriginalInput(),t.refreshItems(),t.close(!1),t.inputState(),t.isSetup=!0,a.disabled?t.disable():t.enable(),t.on("change",this.onChange),op(a,"tomselected","ts-hidden-accessible"),t.trigger("initialize"),!0===e.preload&&t.preload()}setupOptions(t=[],e=[]){this.addOptions(t),Xd(e,t=>{this.registerOptionGroup(t)})}setupTemplates(){var t=this,e=t.settings.labelField,i=t.settings.optgroupLabelField,n={optgroup:t=>{let e=document.createElement("div");return e.className="optgroup",e.appendChild(t.options),e},optgroup_header:(t,e)=>'<div class="optgroup-header">'+e(t[i])+"</div>",option:(t,i)=>"<div>"+i(t[e])+"</div>",item:(t,i)=>"<div>"+i(t[e])+"</div>",option_create:(t,e)=>'<div class="create">Add <strong>'+e(t.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};t.settings.render=Object.assign({},n,t.settings.render)}setupCallbacks(){var t,e,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(t in i)(e=this.settings[i[t]])&&this.on(t,e)}sync(t=!0){const e=this,i=t?Fp(e.input,{delimiter:e.settings.delimiter}):e.settings;e.setupOptions(i.options,i.optgroups),e.setValue(i.items||[],!0),e.lastQuery=null}onClick(){var t=this;if(t.activeItems.length>0)return t.clearActiveItems(),void t.focus();t.isFocused&&t.isOpen?t.blur():t.focus()}onMouseDown(){}onChange(){np(this.input,"input"),np(this.input,"change")}onPaste(t){var e=this;e.isInputHidden||e.isLocked?Ip(t):e.settings.splitOn&&setTimeout(()=>{var t=e.inputValue();if(t.match(e.settings.splitOn)){var i=t.trim().split(e.settings.splitOn);Xd(i,t=>{Tp(t)&&(this.options[t]?e.addItem(t):e.createItem(t))})}},0)}onKeyPress(t){var e=this;if(!e.isLocked){var i=String.fromCharCode(t.keyCode||t.which);return e.settings.create&&"multi"===e.settings.mode&&i===e.settings.delimiter?(e.createItem(),void Ip(t)):void 0}Ip(t)}onKeyDown(t){var e=this;if(e.ignoreHover=!0,e.isLocked)t.keyCode!==zp&&Ip(t);else{switch(t.keyCode){case vp:if(Pp(Cp,t)&&""==e.control_input.value)return Ip(t),void e.selectAll();break;case yp:return e.isOpen&&(Ip(t,!0),e.close()),void e.clearActiveItems();case kp:if(!e.isOpen&&e.hasOptions)e.open();else if(e.activeOption){let t=e.getAdjacent(e.activeOption,1);t&&e.setActiveOption(t)}return void Ip(t);case wp:if(e.activeOption){let t=e.getAdjacent(e.activeOption,-1);t&&e.setActiveOption(t)}return void Ip(t);case bp:return void(e.canSelect(e.activeOption)?(e.onOptionSelect(t,e.activeOption),Ip(t)):(e.settings.create&&e.createItem()||document.activeElement==e.control_input&&e.isOpen)&&Ip(t));case _p:return void e.advanceSelection(-1,t);case xp:return void e.advanceSelection(1,t);case zp:return void(e.settings.selectOnTab&&(e.canSelect(e.activeOption)&&(e.onOptionSelect(t,e.activeOption),Ip(t)),e.settings.create&&e.createItem()&&Ip(t)));case Ap:case Sp:return void e.deleteSelection(t)}e.isInputHidden&&!Pp(Cp,t)&&Ip(t)}}onInput(t){var e=this;if(!e.isLocked){var i=e.inputValue();e.lastValue!==i&&(e.lastValue=i,e.settings.shouldLoad.call(e,i)&&e.load(i),e.refreshOptions(),e.trigger("type",i))}}onOptionHover(t,e){this.ignoreHover||this.setActiveOption(e,!1)}onFocus(t){var e=this,i=e.isFocused;if(e.isDisabled)return e.blur(),void Ip(t);e.ignoreFocus||(e.isFocused=!0,"focus"===e.settings.preload&&e.preload(),i||e.trigger("focus"),e.activeItems.length||(e.showInput(),e.refreshOptions(!!e.settings.openOnFocus)),e.refreshState())}onBlur(t){if(!1!==document.hasFocus()){var e=this;if(e.isFocused){e.isFocused=!1,e.ignoreFocus=!1;var i=()=>{e.close(),e.setActiveItem(),e.setCaret(e.items.length),e.trigger("blur")};e.settings.create&&e.settings.createOnBlur?e.createItem(null,i):i()}}}onOptionSelect(t,e){var i,n=this;e.parentElement&&e.parentElement.matches("[data-disabled]")||(e.classList.contains("create")?n.createItem(null,()=>{n.settings.closeAfterSelect&&n.close()}):void 0!==(i=e.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&t.type&&/click/.test(t.type)&&n.setActiveOption(e)))}canSelect(t){return!!(this.isOpen&&t&&this.dropdown_content.contains(t))}onItemSelect(t,e){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(Ip(t),i.setActiveItem(e,t),!0)}canLoad(t){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(t)}load(t){const e=this;if(!e.canLoad(t))return;op(e.wrapper,e.settings.loadingClass),e.loading++;const i=e.loadCallback.bind(e);e.settings.load.call(e,t,i)}loadCallback(t,e){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(t,e),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||sp(i.wrapper,i.settings.loadingClass),i.trigger("load",t,e)}preload(){var t=this.wrapper.classList;t.contains("preloaded")||(t.add("preloaded"),this.load(""))}setTextboxValue(t=""){var e=this.control_input;e.value!==t&&(e.value=t,np(e,"update"),this.lastValue=t)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(t,e){$p(this,e?[]:["change"],()=>{this.clear(e),this.addItems(t,e)})}setMaxItems(t){0===t&&(t=null),this.settings.maxItems=t,this.refreshState()}setActiveItem(t,e){var i,n,r,o,s,a,l=this;if("single"!==l.settings.mode){if(!t)return l.clearActiveItems(),void(l.isFocused&&l.showInput());if("click"===(i=e&&e.type.toLowerCase())&&Pp("shiftKey",e)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(o=Array.prototype.indexOf.call(l.control.children,t))&&(s=r,r=o,o=s),n=r;n<=o;n++)t=l.control.children[n],-1===l.activeItems.indexOf(t)&&l.setActiveItemClass(t);Ip(e)}else"click"===i&&Pp(Cp,e)||"keydown"===i&&Pp("shiftKey",e)?t.classList.contains("active")?l.removeActiveItem(t):l.setActiveItemClass(t):(l.clearActiveItems(),l.setActiveItemClass(t));l.hideInput(),l.isFocused||l.focus()}}setActiveItemClass(t){const e=this,i=e.control.querySelector(".last-active");i&&sp(i,"last-active"),op(t,"active last-active"),e.trigger("item_select",t),-1==e.activeItems.indexOf(t)&&e.activeItems.push(t)}removeActiveItem(t){var e=this.activeItems.indexOf(t);this.activeItems.splice(e,1),sp(t,"active")}clearActiveItems(){sp(this.activeItems,"active"),this.activeItems=[]}setActiveOption(t,e=!0){t!==this.activeOption&&(this.clearActiveOption(),t&&(this.activeOption=t,up(this.focus_node,{"aria-activedescendant":t.getAttribute("id")}),up(t,{"aria-selected":"true"}),op(t,"active"),e&&this.scrollToOption(t)))}scrollToOption(t,e){if(!t)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,o=t.offsetHeight,s=t.getBoundingClientRect().top-i.getBoundingClientRect().top+r;s+o>n+r?this.scroll(s-n+o,e):s<r&&this.scroll(s,e)}scroll(t,e){const i=this.dropdown_content;e&&(i.style.scrollBehavior=e),i.scrollTop=t,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(sp(this.activeOption,"active"),up(this.activeOption,{"aria-selected":null})),this.activeOption=null,up(this.focus_node,{"aria-activedescendant":null})}selectAll(){const t=this;if("single"===t.settings.mode)return;const e=t.controlChildren();e.length&&(t.hideInput(),t.close(),t.activeItems=e,Xd(e,e=>{t.setActiveItemClass(e)}))}inputState(){var t=this;t.control.contains(t.control_input)&&(up(t.control_input,{placeholder:t.settings.placeholder}),t.activeItems.length>0||!t.isFocused&&t.settings.hidePlaceholder&&t.items.length>0?(t.setTextboxValue(),t.isInputHidden=!0):(t.settings.hidePlaceholder&&t.items.length>0&&up(t.control_input,{placeholder:""}),t.isInputHidden=!1),t.wrapper.classList.toggle("input-hidden",t.isInputHidden))}hideInput(){this.inputState()}showInput(){this.inputState()}inputValue(){return this.control_input.value.trim()}focus(){var t=this;t.isDisabled||(t.ignoreFocus=!0,t.control_input.offsetWidth?t.control_input.focus():t.focus_node.focus(),setTimeout(()=>{t.ignoreFocus=!1,t.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())}getSearchOptions(){var t=this.settings,e=t.sortField;return"string"==typeof t.sortField&&(e=[{field:t.sortField}]),{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}}search(t){var e,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,t)))throw new Error('Tom Select "score" setting must be a function that returns a function');return t!==n.lastQuery?(n.lastQuery=t,e=n.sifter.search(t,Object.assign(r,{score:i})),n.currentResults=e):e=Object.assign({},n.currentResults),n.settings.hideSelected&&(e.items=e.items.filter(t=>{let e=Tp(t.id);return!(e&&-1!==n.items.indexOf(e))})),e}refreshOptions(t=!0){var e,i,n,r,o,s,a,l,c,h;const d={},p=[];var u=this,g=u.inputValue();const f=g===u.lastQuery||""==g&&null==u.lastQuery;var m=u.search(g),v=null,b=u.settings.shouldOpen||!1,y=u.dropdown_content;for(f&&(v=u.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof u.settings.maxOptions&&(r=Math.min(r,u.settings.maxOptions)),r>0&&(b=!0),e=0;e<r;e++){let t=m.items[e];if(!t)continue;let r=t.id,a=u.options[r];if(void 0===a)continue;let l=Lp(r),h=u.getOption(l,!0);for(u.settings.hideSelected||h.classList.toggle("selected",u.items.includes(l)),o=a[u.settings.optgroupField]||"",i=0,n=(s=Array.isArray(o)?o:[o])&&s.length;i<n;i++){o=s[i],u.optgroups.hasOwnProperty(o)||(o="");let t=d[o];void 0===t&&(t=document.createDocumentFragment(),p.push(o)),i>0&&(h=h.cloneNode(!0),up(h,{id:a.$id+"-clone-"+i,"aria-selected":null}),h.classList.add("ts-cloned"),sp(h,"active"),u.activeOption&&u.activeOption.dataset.value==r&&c&&c.dataset.group===o.toString()&&(v=h)),t.appendChild(h),d[o]=t}}u.settings.lockOptgroupOrder&&p.sort((t,e)=>{const i=u.optgroups[t],n=u.optgroups[e];return(i&&i.$order||0)-(n&&n.$order||0)}),a=document.createDocumentFragment(),Xd(p,t=>{let e=d[t];if(!e||!e.children.length)return;let i=u.optgroups[t];if(void 0!==i){let t=document.createDocumentFragment(),n=u.render("optgroup_header",i);Dp(t,n),Dp(t,e);let r=u.render("optgroup",{group:i,options:t});Dp(a,r)}else Dp(a,e)}),y.innerHTML="",Dp(y,a),u.settings.highlight&&(mp(y),m.query.length&&m.tokens.length&&Xd(m.tokens,t=>{fp(y,t.regex)}));var _=t=>{let e=u.render(t,{input:g});return e&&(b=!0,y.insertBefore(e,y.firstChild)),e};if(u.loading?_("loading"):u.settings.shouldLoad.call(u,g)?0===m.items.length&&_("no_results"):_("not_loading"),(l=u.canCreate(g))&&(h=_("option_create")),u.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==u.settings.mode||null==u.items[0]||(v=u.getOption(u.items[0])),!y.contains(v)){let t=0;h&&!u.settings.addPrecedence&&(t=1),v=u.selectable()[t]}}else h&&(v=h);t&&!u.isOpen&&(u.open(),u.scrollToOption(v,"auto")),u.setActiveOption(v)}else u.clearActiveOption(),t&&u.isOpen&&u.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(t,e=!1){const i=this;if(Array.isArray(t))return i.addOptions(t,e),!1;const n=Tp(t[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(t.$order=t.$order||++i.order,t.$id=i.inputId+"-opt-"+t.$order,i.options[n]=t,i.lastQuery=null,e&&(i.userOptions[n]=e,i.trigger("option_add",n,t)),n)}addOptions(t,e=!1){Xd(t,t=>{this.addOption(t,e)})}registerOption(t){return this.addOption(t)}registerOptionGroup(t){var e=Tp(t[this.settings.optgroupValueField]);return null!==e&&(t.$order=t.$order||++this.order,this.optgroups[e]=t,e)}addOptionGroup(t,e){var i;e[this.settings.optgroupValueField]=t,(i=this.registerOptionGroup(e))&&this.trigger("optgroup_add",i,e)}removeOptionGroup(t){this.optgroups.hasOwnProperty(t)&&(delete this.optgroups[t],this.clearCache(),this.trigger("optgroup_remove",t))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(t,e){const i=this;var n,r;const o=Tp(t),s=Tp(e[i.settings.valueField]);if(null===o)return;const a=i.options[o];if(null==a)return;if("string"!=typeof s)throw new Error("Value must be set in option data");const l=i.getOption(o),c=i.getItem(o);if(e.$order=e.$order||a.$order,delete i.options[o],i.uncacheValue(s),i.options[s]=e,l){if(i.dropdown_content.contains(l)){const t=i._render("option",e);gp(l,t),i.activeOption===l&&i.setActiveOption(t)}l.remove()}c&&(-1!==(r=i.items.indexOf(o))&&i.items.splice(r,1,s),n=i._render("item",e),c.classList.contains("active")&&op(n,"active"),gp(c,n)),i.lastQuery=null}removeOption(t,e){const i=this;t=Lp(t),i.uncacheValue(t),delete i.userOptions[t],delete i.options[t],i.lastQuery=null,i.trigger("option_remove",t),i.removeItem(t,e)}clearOptions(t){const e=(t||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};Xd(this.options,(t,n)=>{e(t,n)&&(i[n]=t)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(t,e){return this.items.indexOf(e)>=0}getOption(t,e=!1){const i=Tp(t);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(e)return this._render("option",n)}return null}getAdjacent(t,e,i="option"){var n,r=this;if(!t)return null;n="item"==i?r.controlChildren():r.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==t)return e>0?n[i+1]:n[i-1];return null}getItem(t){if("object"==typeof t)return t;var e=Tp(t);return null!==e?this.control.querySelector(`[data-value="${Np(e)}"]`):null}addItems(t,e){var i=this,n=Array.isArray(t)?t:[t];const r=(n=n.filter(t=>-1===i.items.indexOf(t)))[n.length-1];n.forEach(t=>{i.isPending=t!==r,i.addItem(t,e)})}addItem(t,e){$p(this,e?[]:["change","dropdown_close"],()=>{var i,n;const r=this,o=r.settings.mode,s=Tp(t);if((!s||-1===r.items.indexOf(s)||("single"===o&&r.close(),"single"!==o&&r.settings.duplicates))&&null!==s&&r.options.hasOwnProperty(s)&&("single"===o&&r.clear(e),"multi"!==o||!r.isFull())){if(i=r._render("item",r.options[s]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,s),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let t=r.getOption(s),e=r.getAdjacent(t,1);e&&r.setActiveOption(e)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==o),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",s,i),r.isPending||r.updateOriginalInput({silent:e})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}})}removeItem(t=null,e){const i=this;if(!(t=i.getItem(t)))return;var n,r;const o=t.dataset.value;n=pp(t),t.remove(),t.classList.contains("active")&&(r=i.activeItems.indexOf(t),i.activeItems.splice(r,1),sp(t,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(o)&&i.removeOption(o,e),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:e}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",o,t)}createItem(t=null,e=(()=>{})){3===arguments.length&&(e=arguments[2]),"function"!=typeof e&&(e=()=>{});var i,n=this,r=n.caretPos;if(t=t||n.inputValue(),!n.canCreate(t))return e(),!1;n.lock();var o=!1,s=t=>{if(n.unlock(),!t||"object"!=typeof t)return e();var i=Tp(t[n.settings.valueField]);if("string"!=typeof i)return e();n.setTextboxValue(),n.addOption(t,!0),n.setCaret(r),n.addItem(i),e(t),o=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,t,s):{[n.settings.labelField]:t,[n.settings.valueField]:t},o||s(i),!0}refreshItems(){var t=this;t.lastQuery=null,t.isSetup&&t.addItems(t.items),t.updateOriginalInput(),t.refreshState()}refreshState(){const t=this;t.refreshValidityState();const e=t.isFull(),i=t.isLocked;t.wrapper.classList.toggle("rtl",t.rtl);const n=t.wrapper.classList;n.toggle("focus",t.isFocused),n.toggle("disabled",t.isDisabled),n.toggle("required",t.isRequired),n.toggle("invalid",!t.isValid),n.toggle("locked",i),n.toggle("full",e),n.toggle("input-active",t.isFocused&&!t.isInputHidden),n.toggle("dropdown-active",t.isOpen),n.toggle("has-options",dp(t.options)),n.toggle("has-items",t.items.length>0)}refreshValidityState(){var t=this;t.input.validity&&(t.isValid=t.input.validity.valid,t.isInvalid=!t.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(t={}){const e=this;var i,n;const r=e.input.querySelector('option[value=""]');if(e.is_select_tag){const t=[],s=e.input.querySelectorAll("option:checked").length;function o(i,n,o){return i||(i=tp('<option value="'+Mp(n)+'">'+Mp(o)+"</option>")),i!=r&&e.input.append(i),t.push(i),(i!=r||s>0)&&(i.selected=!0),i}e.input.querySelectorAll("option:checked").forEach(t=>{t.selected=!1}),0==e.items.length&&"single"==e.settings.mode?o(r,"",""):e.items.forEach(r=>{if(i=e.options[r],n=i[e.settings.labelField]||"",t.includes(i.$option)){o(e.input.querySelector(`option[value="${Np(r)}"]:not(:checked)`),r,n)}else i.$option=o(i.$option,r,n)})}else e.input.value=e.getValue();e.isSetup&&(t.silent||e.trigger("change",e.getValue()))}open(){var t=this;t.isLocked||t.isOpen||"multi"===t.settings.mode&&t.isFull()||(t.isOpen=!0,up(t.focus_node,{"aria-expanded":"true"}),t.refreshState(),rp(t.dropdown,{visibility:"hidden",display:"block"}),t.positionDropdown(),rp(t.dropdown,{visibility:"visible",display:"block"}),t.focus(),t.trigger("dropdown_open",t.dropdown))}close(t=!0){var e=this,i=e.isOpen;t&&(e.setTextboxValue(),"single"===e.settings.mode&&e.items.length&&e.hideInput()),e.isOpen=!1,up(e.focus_node,{"aria-expanded":"false"}),rp(e.dropdown,{display:"none"}),e.settings.hideSelected&&e.clearActiveOption(),e.refreshState(),i&&e.trigger("dropdown_close",e.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var t=this.control,e=t.getBoundingClientRect(),i=t.offsetHeight+e.top+window.scrollY,n=e.left+window.scrollX;rp(this.dropdown,{width:e.width+"px",top:i+"px",left:n+"px"})}}clear(t){var e=this;if(e.items.length){var i=e.controlChildren();Xd(i,t=>{e.removeItem(t,!0)}),e.showInput(),t||e.updateOriginalInput(),e.trigger("clear")}}insertAtCaret(t){const e=this,i=e.caretPos,n=e.control;n.insertBefore(t,n.children[i]||null),e.setCaret(i+1)}deleteSelection(t){var e,i,n,r,o=this;e=t&&t.keyCode===Ap?-1:1,i=Hp(o.control_input);const s=[];if(o.activeItems.length)r=hp(o.activeItems,e),n=pp(r),e>0&&n++,Xd(o.activeItems,t=>s.push(t));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const t=o.controlChildren();let n;e<0&&0===i.start&&0===i.length?n=t[o.caretPos-1]:e>0&&i.start===o.inputValue().length&&(n=t[o.caretPos]),void 0!==n&&s.push(n)}if(!o.shouldDelete(s,t))return!1;for(Ip(t,!0),void 0!==n&&o.setCaret(n);s.length;)o.removeItem(s.pop());return o.showInput(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(t,e){const i=t.map(t=>t.dataset.value);return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,e))}advanceSelection(t,e){var i,n,r=this;r.rtl&&(t*=-1),r.inputValue().length||(Pp(Cp,e)||Pp("shiftKey",e)?(n=(i=r.getLastActive(t))?i.classList.contains("active")?r.getAdjacent(i,t,"item"):i:t>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(t))}moveCaret(t){}getLastActive(t){let e=this.control.querySelector(".last-active");if(e)return e;var i=this.control.querySelectorAll(".active");return i?hp(i,t):void 0}setCaret(t){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.isLocked=!0,this.refreshState()}unlock(){this.isLocked=!1,this.refreshState()}disable(){var t=this;t.input.disabled=!0,t.control_input.disabled=!0,t.focus_node.tabIndex=-1,t.isDisabled=!0,this.close(),t.lock()}enable(){var t=this;t.input.disabled=!1,t.control_input.disabled=!1,t.focus_node.tabIndex=t.tabIndex,t.isDisabled=!1,t.unlock()}destroy(){var t=this,e=t.revertSettings;t.trigger("destroy"),t.off(),t.wrapper.remove(),t.dropdown.remove(),t.input.innerHTML=e.innerHTML,t.input.tabIndex=e.tabIndex,sp(t.input,"tomselected","ts-hidden-accessible"),t._destroy(),delete t.input.tomselect}render(t,e){var i,n;const r=this;if("function"!=typeof this.settings.render[t])return null;if(!(n=r.settings.render[t].call(this,e,Mp)))return null;if(n=tp(n),"option"===t||"option_create"===t?e[r.settings.disabledField]?up(n,{"aria-disabled":"true"}):up(n,{"data-selectable":""}):"optgroup"===t&&(i=e.group[r.settings.optgroupValueField],up(n,{"data-group":i}),e.group[r.settings.disabledField]&&up(n,{"data-disabled":""})),"option"===t||"item"===t){const i=Lp(e[r.settings.valueField]);up(n,{"data-value":i}),"item"===t?(op(n,r.settings.itemClass),up(n,{"data-ts-item":""})):(op(n,r.settings.optionClass),up(n,{role:"option",id:e.$id}),e.$div=n,r.options[i]=e)}return n}_render(t,e){const i=this.render(t,e);if(null==i)throw"HTMLElement expected";return i}clearCache(){Xd(this.options,t=>{t.$div&&(t.$div.remove(),delete t.$div)})}uncacheValue(t){const e=this.getOption(t);e&&e.remove()}canCreate(t){return this.settings.create&&t.length>0&&this.settings.createFilter.call(this,t)}hook(t,e,i){var n=this,r=n[e];n[e]=function(){var e,o;return"after"===t&&(e=r.apply(n,arguments)),o=i.apply(n,arguments),"instead"===t?o:("before"===t&&(e=r.apply(n,arguments)),e)}}}function qp(){Rp(this.input,"change",()=>{this.sync()})}function Up(){var t=this,e=t.onOptionSelect;t.settings.hideSelected=!1;var i=function(t){setTimeout(()=>{var e=t.querySelector("input");e instanceof HTMLInputElement&&(t.classList.contains("selected")?e.checked=!0:e.checked=!1)},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(i,n)=>{var r=tp(e.call(t,i,n)),o=document.createElement("input");o.addEventListener("click",(function(t){Ip(t)})),o.type="checkbox";const s=Tp(i[t.settings.valueField]);return s&&t.items.indexOf(s)>-1&&(o.checked=!0),r.prepend(o),r}}),t.on("item_remove",e=>{var n=t.getOption(e);n&&(n.classList.remove("selected"),i(n))}),t.on("item_add",e=>{var n=t.getOption(e);n&&i(n)}),t.hook("instead","onOptionSelect",(n,r)=>{if(r.classList.contains("selected"))return r.classList.remove("selected"),t.removeItem(r.dataset.value),t.refreshOptions(),void Ip(n,!0);e.call(t,n,r),i(r)})}function Wp(t){const e=this,i=Object.assign({className:"clear-button",title:"Clear All",html:t=>`<div class="${t.className}" title="${t.title}">&#10799;</div>`},t);e.on("initialize",()=>{var t=tp(i.html(i));t.addEventListener("click",t=>{e.isDisabled||(e.clear(),"single"===e.settings.mode&&e.settings.allowEmptyOption&&e.addItem(""),t.preventDefault(),t.stopPropagation())}),e.control.appendChild(t)})}function Yp(){var t=this;if(!$.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===t.settings.mode){var e=t.lock,i=t.unlock;t.hook("instead","lock",()=>{var i=$(t.control).data("sortable");return i&&i.disable(),e.call(t)}),t.hook("instead","unlock",()=>{var e=$(t.control).data("sortable");return e&&e.enable(),i.call(t)}),t.on("initialize",()=>{var e=$(t.control).sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:t.isLocked,start:(t,i)=>{i.placeholder.css("width",i.helper.css("width")),e.css({overflow:"visible"})},stop:()=>{e.css({overflow:"hidden"});var i=[];e.children("[data-value]").each((function(){this.dataset.value&&i.push(this.dataset.value)})),t.setValue(i)}})})}}function Gp(t){const e=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:t=>'<div class="'+t.headerClass+'"><div class="'+t.titleRowClass+'"><span class="'+t.labelClass+'">'+t.title+'</span><a class="'+t.closeClass+'">&times;</a></div></div>'},t);e.on("initialize",()=>{var t=tp(i.html(i)),n=t.querySelector("."+i.closeClass);n&&n.addEventListener("click",t=>{Ip(t,!0),e.close()}),e.dropdown.insertBefore(t,e.dropdown.firstChild)})}function Kp(){var t=this;t.hook("instead","setCaret",e=>{"single"!==t.settings.mode&&t.control.contains(t.control_input)?(e=Math.max(0,Math.min(t.items.length,e)))==t.caretPos||t.isPending||t.controlChildren().forEach((i,n)=>{n<e?t.control_input.insertAdjacentElement("beforebegin",i):t.control.appendChild(i)}):e=t.items.length,t.caretPos=e}),t.hook("instead","moveCaret",e=>{if(!t.isFocused)return;const i=t.getLastActive(e);if(i){const n=pp(i);t.setCaret(e>0?n+1:n),t.setActiveItem(),sp(i,"last-active")}else t.setCaret(t.caretPos+e)})}function Xp(){const t=this;t.settings.shouldOpen=!0,t.hook("before","setup",()=>{t.focus_node=t.control,op(t.control_input,"dropdown-input");const e=tp('<div class="dropdown-input-wrap">');e.append(t.control_input),t.dropdown.insertBefore(e,t.dropdown.firstChild);const i=tp('<input class="items-placeholder" tabindex="-1" />');i.placeholder=t.settings.placeholder||"",t.control.append(i)}),t.on("initialize",()=>{t.control_input.addEventListener("keydown",e=>{switch(e.keyCode){case yp:return t.isOpen&&(Ip(e,!0),t.close()),void t.clearActiveItems();case zp:t.focus_node.tabIndex=-1}return t.onKeyDown.call(t,e)}),t.on("blur",()=>{t.focus_node.tabIndex=t.isDisabled?-1:t.tabIndex}),t.on("dropdown_open",()=>{t.control_input.focus()});const e=t.onBlur;t.hook("instead","onBlur",i=>{if(!i||i.relatedTarget!=t.control_input)return e.call(t)}),Rp(t.control_input,"blur",()=>t.onBlur()),t.hook("before","close",()=>{t.isOpen&&t.focus_node.focus({preventScroll:!0})})})}function Zp(){var t=this;t.on("initialize",()=>{var e=document.createElement("span"),i=t.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",t.wrapper.appendChild(e);var n=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(const t of n)e.style[t]=i.style[t];var r=()=>{e.textContent=i.value,i.style.width=e.clientWidth+"px"};r(),t.on("update item_add item_remove",r),Rp(i,"input",r),Rp(i,"keyup",r),Rp(i,"blur",r),Rp(i,"update",r)})}function Qp(){var t=this,e=t.deleteSelection;this.hook("instead","deleteSelection",i=>!!t.activeItems.length&&e.call(t,i))}function Jp(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}function tu(){var t=this,e=t.onKeyDown;t.hook("instead","onKeyDown",i=>{var n,r,o,s;if(!t.isOpen||i.keyCode!==_p&&i.keyCode!==xp)return e.call(t,i);t.ignoreHover=!0,s=cp(t.activeOption,"[data-group]"),n=pp(t.activeOption,"[data-selectable]"),s&&(s=i.keyCode===_p?s.previousSibling:s.nextSibling)&&(r=(o=s.querySelectorAll("[data-selectable]"))[Math.min(o.length-1,n)])&&t.setActiveOption(r)})}function eu(t){const e=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},t);var i=this;if(e.append){var n='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+Mp(e.title)+'">'+e.label+"</a>";i.hook("after","setupTemplates",()=>{var t=i.settings.render.item;i.settings.render.item=(e,r)=>{var o=tp(t.call(i,e,r)),s=tp(n);return o.appendChild(s),Rp(s,"mousedown",t=>{Ip(t,!0)}),Rp(s,"click",t=>{Ip(t,!0),i.isLocked||i.shouldDelete([o],t)&&(i.removeItem(o),i.refreshOptions(!1),i.inputState())}),o}})}}function iu(t){const e=this,i=Object.assign({text:t=>t[e.settings.labelField]},t);e.on("item_remove",(function(t){if(e.isFocused&&""===e.control_input.value.trim()){var n=e.options[t];n&&e.setTextboxValue(i.text.call(e,n))}}))}function nu(){const t=this,e=t.canLoad,i=t.clearActiveOption,n=t.loadCallback;var r,o,s={},a=!1,l=[];if(t.settings.shouldLoadMore||(t.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(t.activeOption){var e=t.selectable();if(Array.from(e).indexOf(t.activeOption)>=e.length-2)return!0}return!1}),!t.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";t.settings.sortField=[{field:"$order"},{field:"$score"}];const c=e=>!("number"==typeof t.settings.maxOptions&&r.children.length>=t.settings.maxOptions)&&!(!(e in s)||!s[e]),h=(e,i)=>t.items.indexOf(i)>=0||l.indexOf(i)>=0;t.setNextUrl=(t,e)=>{s[t]=e},t.getUrl=e=>{if(e in s){const t=s[e];return s[e]=!1,t}return s={},t.settings.firstUrl.call(t,e)},t.hook("instead","clearActiveOption",()=>{if(!a)return i.call(t)}),t.hook("instead","canLoad",i=>i in s?c(i):e.call(t,i)),t.hook("instead","loadCallback",(e,i)=>{if(a){if(o){const i=e[0];void 0!==i&&(o.dataset.value=i[t.settings.valueField])}}else t.clearOptions(h);n.call(t,e,i),a=!1}),t.hook("after","refreshOptions",()=>{const e=t.lastValue;var i;c(e)?(i=t.render("loading_more",{query:e}))&&(i.setAttribute("data-selectable",""),o=i):e in s&&!r.querySelector(".no-results")&&(i=t.render("no_more_results",{query:e})),i&&(op(i,t.settings.optionClass),r.append(i))}),t.on("initialize",()=>{l=Object.keys(t.options),r=t.dropdown_content,t.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},t.settings.render),r.addEventListener("scroll",()=>{t.settings.shouldLoadMore.call(t)&&c(t.lastValue)&&(a||(a=!0,t.load.call(t,t.lastValue)))})})}function ru(t){if(document.getElementById("__pb-multi-select-css"))return;const e=P("../css/tom-select"),i=document.createElement("link");i.id="__pb-multi-select-css",i.href=`${e}/tom-select.${t}.min.css`,i.rel="stylesheet",document.head.appendChild(i)}jp.define("change_listener",qp),jp.define("checkbox_options",Up),jp.define("clear_button",Wp),jp.define("drag_drop",Yp),jp.define("dropdown_header",Gp),jp.define("caret_position",Kp),jp.define("dropdown_input",Xp),jp.define("input_autogrow",Zp),jp.define("no_backspace_delete",Qp),jp.define("no_active_items",Jp),jp.define("optgroup_columns",tu),jp.define("remove_button",eu),jp.define("restore_on_backspace",iu),jp.define("virtual_scroll",nu);const ou=t=>t?`<div>${G(t.text)}</div>`:"";class su extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{placeholder:{type:String},source:{type:String},closeAfterSelect:{type:Boolean,attribute:"close-after-select"},preload:{type:Boolean},onBlur:{type:String,attribute:"on-blur"},onChange:{type:String,attribute:"on-change"}})}get value(){return this._select?this._select.getValue():null}set value(t){this._select&&(this._select.clear(!0),this._select.sync(),this._select.setValue(t,!1),this._select.sync())}set renderItem(t){this.renderFunction=t}constructor(){super(),this.theme="default",this.source=null,this.closeAfterSelect=!1,this.preload=!1,this.renderFunction=ou,this.onBlur="pb-combo-box-blur",this.onChange="pb-combo-box-change",this.placeholder=""}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-i18n-update",()=>{this._select&&(this._select.settings.placeholder=G(this.placeholder),this._select.inputState(),this.source?this._select.refreshOptions(!1):(this._select.clearOptions(),this._select.sync()))})}firstUpdated(){ru(this.theme);let t=this.querySelector("select,input");t||(t=document.createElement("input"),this.appendChild(t)),t.autocomplete=!1,B("pb-page-ready",()=>{const e={};if(this.source){const t=this.toAbsoluteURL(this.source);e.labelField="text",e.valueField="value",e.searchField=[],e.preload=this.preload,e.load=(e,i)=>{fetch(`${t}?query=${encodeURIComponent(e)}`,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{i(t)}).catch(()=>{i()})},e.render={option:this.renderFunction,item:this.renderFunction}}e.placeholder=G(this.placeholder),e.closeAfterSelect=this.closeAfterSelect,e.onBlur=()=>this.emitTo(this.onBlur,{value:this.value}),e.onChange=()=>this.emitTo(this.onChange,{value:this.value}),this._select=new jp(t,e)})}createRenderRoot(){return this}}customElements.define("pb-combo-box",su);class au extends(D(V)){static get properties(){return Object.assign({src:{type:String},styles:{type:String},url:{type:String,reflect:!0,readOnly:!0},raw:{type:Boolean}},super.properties)}constructor(){super(),this.url="about:blank",this.raw=!1}firstUpdated(){super.firstUpdated(),this._iframe=this.shadowRoot.querySelector("iframe"),this._iframe.addEventListener("load",()=>{"about:blank"!==this._iframe.src&&(this._iframe.className="",this.emitTo("pb-end-update"))}),B("pb-page-ready",()=>{this.refresh()})}print(){this._iframe.contentWindow.print()}refresh(){this.emitTo("pb-start-update"),this._iframe.className="hidden",this._iframe.src="about:blank";const t=this.getDocument(),e=new URLSearchParams;t.odd&&e.set("odd",t.odd+".odd"),e.set("base",`${this.getEndpoint()}/${t.getCollection()}/`),this._getCustomStyles().forEach(t=>e.append("style",t));const i=e.toString();this.url=`${this.getEndpoint()}/api/document/${encodeURIComponent(t.path)}/print?${i}`;const n=new URLSearchParams(i);n.set("wc","true"),this.raw||(n.set("script",P("../lib/paged.polyfill.js")),n.append("style",P("../css/pagedjs/interface.css"))),this._iframe.src=`${this.getEndpoint()}/api/document/${encodeURIComponent(t.path)}/print?${n.toString()}`}render(){return I`
4507
+ class tp{constructor(t,e){this.items=void 0,this.settings=void 0,this.items=t,this.settings=e||{diacritics:!0}}tokenize(t,e,i){if(!t||!t.length)return[];const n=[],r=t.split(/\s+/);var o;return i&&(o=new RegExp("^("+Object.keys(i).map(xd).join("|")+"):(.*)$")),r.forEach(t=>{let i,r=null,s=null;o&&(i=t.match(o))&&(r=i[1],t=i[2]),t.length>0&&(s=this.settings.diacritics?Yd(t)||null:xd(t),s&&e&&(s="\\b"+s)),n.push({string:t,regex:s?new RegExp(s,"iu"):null,field:r})}),n}getScoreFunction(t,e){var i=this.prepareSearch(t,e);return this._getScoreFunction(i)}_getScoreFunction(t){const e=t.tokens,i=e.length;if(!i)return function(){return 0};const n=t.options.fields,r=t.weights,o=n.length,s=t.getAttrFn;if(!o)return function(){return 1};const a=1===o?function(t,e){const i=n[0].field;return Xd(s(e,i),t,r[i]||1)}:function(t,e){var i=0;if(t.field){const n=s(e,t.field);!t.regex&&n?i+=1/o:i+=Xd(n,t,1)}else Qd(r,(n,r)=>{i+=Xd(s(e,r),t,n)});return i/o};return 1===i?function(t){return a(e[0],t)}:"and"===t.options.conjunction?function(t){var n,r=0;for(let i of e){if((n=a(i,t))<=0)return 0;r+=n}return r/i}:function(t){var n=0;return Qd(e,e=>{n+=a(e,t)}),n/i}}getSortFunction(t,e){var i=this.prepareSearch(t,e);return this._getSortFunction(i)}_getSortFunction(t){var e,i=[];const n=this,r=t.options,o=!t.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof o)return o.bind(this);const s=function(e,i){return"$score"===e?i.score:t.getAttrFn(n.items[i.id],e)};if(o)for(let e of o)(t.query||"$score"!==e.field)&&i.push(e);if(t.query){e=!0;for(let t of i)if("$score"===t.field){e=!1;break}e&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(t=>"$score"!==t.field);return i.length?function(t,e){var n,r;for(let o of i){if(r=o.field,n=("desc"===o.direction?-1:1)*Jd(s(r,t),s(r,e)))return n}return 0}:null}prepareSearch(t,e){const i={};var n=Object.assign({},e);if(Zd(n,"sort"),Zd(n,"sort_empty"),n.fields){Zd(n,"fields");const t=[];n.fields.forEach(e=>{"string"==typeof e&&(e={field:e,weight:1}),t.push(e),i[e.field]="weight"in e?e.weight:1}),n.fields=t}return{options:n,query:t.toLowerCase().trim(),tokens:this.tokenize(t,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?Kd:Gd}}search(t,e){var i,n,r=this;n=this.prepareSearch(t,e),e=n.options,t=n.query;const o=e.score||r._getScoreFunction(n);t.length?Qd(r.items,(t,r)=>{i=o(t),(!1===e.filter||i>0)&&n.items.push({score:i,id:r})}):Qd(r.items,(t,e)=>{n.items.push({score:1,id:e})});const s=r._getSortFunction(n);return s&&n.items.sort(s),n.total=n.items.length,"number"==typeof e.limit&&(n.items=n.items.slice(0,e.limit)),n}}const ep=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},ip=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(np(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},np=t=>"string"==typeof t&&t.indexOf("<")>-1,rp=t=>t.replace(/['"\\]/g,"\\$&"),op=(t,e)=>{var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!1),t.dispatchEvent(i)},sp=(t,e)=>{Object.assign(t.style,e)},ap=(t,...e)=>{var i=cp(e);(t=hp(t)).map(t=>{i.map(e=>{t.classList.add(e)})})},lp=(t,...e)=>{var i=cp(e);(t=hp(t)).map(t=>{i.map(e=>{t.classList.remove(e)})})},cp=t=>{var e=[];return ep(t,t=>{"string"==typeof t&&(t=t.trim().split(/[\11\12\14\15\40]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},hp=t=>(Array.isArray(t)||(t=[t]),t),dp=(t,e,i)=>{if(!i||i.contains(t))for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}},pp=(t,e=0)=>e>0?t[t.length-1]:t[0],up=t=>0===Object.keys(t).length,gp=(t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var i=0;t=t.previousElementSibling;)t.matches(e)&&i++;return i},fp=(t,e)=>{ep(e,(e,i)=>{null==e?t.removeAttribute(i):t.setAttribute(i,""+e)})},mp=(t,e)=>{t.parentNode&&t.parentNode.replaceChild(e,t)},vp=(t,e)=>{if(null===e)return;if("string"==typeof e){if(!e.length)return;e=new RegExp(e,"i")}const i=t=>{var i=t.data.match(e);if(i&&t.data.length>0){var n=document.createElement("span");n.className="highlight";var r=t.splitText(i.index);r.splitText(i[0].length);var o=r.cloneNode(!0);return n.appendChild(o),mp(r,n),1}return 0},n=t=>{1!==t.nodeType||!t.childNodes||/(script|style)/i.test(t.tagName)||"highlight"===t.className&&"SPAN"===t.tagName||Array.from(t.childNodes).forEach(t=>{r(t)})},r=t=>3===t.nodeType?i(t):(n(t),0);r(t)},bp=t=>{var e=t.querySelectorAll("span.highlight");Array.prototype.forEach.call(e,(function(t){var e=t.parentNode;e.replaceChild(t.firstChild,t),e.normalize()}))},yp=65,_p=13,wp=27,xp=37,kp=38,Ap=39,Sp=40,zp=8,Cp=46,Ep=9,Tp="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var Lp={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(t){return t.length>0},render:{}};const Mp=t=>null==t?null:Op(t),Op=t=>"boolean"==typeof t?t?"1":"0":t+"",$p=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Hp=(t,e)=>{var i;return function(n,r){var o=this;i&&(o.loading=Math.max(o.loading-1,0),clearTimeout(i)),i=setTimeout((function(){i=null,o.loadedSearches[n]=!0,t.call(o,n,r)}),e)}},Ip=(t,e,i)=>{var n,r=t.trigger,o={};for(n of(t.trigger=function(){var i=arguments[0];if(-1===e.indexOf(i))return r.apply(t,arguments);o[i]=arguments},i.apply(t,[]),t.trigger=r,e))n in o&&r.apply(t,o[n])},Rp=t=>({start:t.selectionStart||0,length:(t.selectionEnd||0)-(t.selectionStart||0)}),Pp=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},Vp=(t,e,i,n)=>{t.addEventListener(e,i,n)},Np=(t,e)=>!!e&&(!!e[t]&&1===(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0)),Dp=(t,e)=>{const i=t.getAttribute("id");return i||(t.setAttribute("id",e),e)},Fp=t=>t.replace(/[\\"']/g,"\\$&"),Bp=(t,e)=>{e&&t.append(e)};function jp(t,e){var i=Object.assign({},Lp,e),n=i.dataAttr,r=i.labelField,o=i.valueField,s=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,h=t.tagName.toLowerCase(),d=t.getAttribute("placeholder")||t.getAttribute("data-placeholder");if(!d&&!i.allowEmptyOption){let e=t.querySelector('option[value=""]');e&&(d=e.textContent)}var p={placeholder:d,options:[],optgroups:[],items:[],maxItems:null},u=()=>{const e=t.getAttribute(n);if(e)p.options=JSON.parse(e),ep(p.options,t=>{p.items.push(t[o])});else{var s=t.value.trim()||"";if(!i.allowEmptyOption&&!s.length)return;const e=s.split(i.delimiter);ep(e,t=>{const e={};e[r]=t,e[o]=t,p.options.push(e)}),p.items=e}};return"select"===h?(()=>{var e,h=p.options,d={},u=1,g=t=>{var e=Object.assign({},t.dataset),i=n&&e[n];return"string"==typeof i&&i.length&&(e=Object.assign(e,JSON.parse(i))),e},f=(t,e)=>{var n=Mp(t.value);if(null!=n&&(n||i.allowEmptyOption)){if(d.hasOwnProperty(n)){if(e){var l=d[n][a];l?Array.isArray(l)?l.push(e):d[n][a]=[l,e]:d[n][a]=e}}else{var c=g(t);c[r]=c[r]||t.textContent,c[o]=c[o]||n,c[s]=c[s]||t.disabled,c[a]=c[a]||e,c.$option=t,d[n]=c,h.push(c)}t.selected&&p.items.push(n)}},m=t=>{var e,i;(i=g(t))[l]=i[l]||t.getAttribute("label")||"",i[c]=i[c]||u++,i[s]=i[s]||t.disabled,p.optgroups.push(i),e=i[c],ep(t.children,t=>{f(t,e)})};p.maxItems=t.hasAttribute("multiple")?null:1,ep(t.children,t=>{"optgroup"===(e=t.tagName.toLowerCase())?m(t):"option"===e&&f(t)})})():u(),Object.assign({},Lp,p,e)}var qp=0;class Up extends(vd(md)){constructor(t,e){var i;super(),this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isRequired=void 0,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.currentResults=void 0,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],qp++;var n=ip(t);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=jp(n,e);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=Dp(n,"tomselect-"+qp),this.isRequired=n.required,this.sifter=new tp(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var o=r.createFilter;"function"!=typeof o&&("string"==typeof o&&(o=new RegExp(o)),o instanceof RegExp?r.createFilter=t=>o.test(t):r.createFilter=t=>this.settings.duplicates||!this.options[t]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const s=ip("<div>"),a=ip("<div>"),l=this._render("dropdown"),c=ip('<div role="listbox" tabindex="-1">'),h=this.input.getAttribute("class")||"",d=r.mode;var p;(ap(s,r.wrapperClass,h,d),ap(a,r.controlClass),Bp(s,a),ap(l,r.dropdownClass,d),r.copyClassesToDropdown&&ap(l,h),ap(c,r.dropdownContentClass),Bp(l,c),ip(r.dropdownParent||s).appendChild(l),np(r.controlInput))?(p=ip(r.controlInput),Qd(["autocorrect","autocapitalize","autocomplete"],t=>{n.getAttribute(t)&&fp(p,{[t]:n.getAttribute(t)})}),p.tabIndex=-1,a.appendChild(p),this.focus_node=p):r.controlInput?(p=ip(r.controlInput),this.focus_node=p):(p=ip("<input/>"),this.focus_node=a);this.wrapper=s,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=p,this.setup()}setup(){const t=this,e=t.settings,i=t.control_input,n=t.dropdown,r=t.dropdown_content,o=t.wrapper,s=t.control,a=t.input,l=t.focus_node,c={passive:!0},h=t.inputId+"-ts-dropdown";fp(r,{id:h}),fp(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":h});const d=Dp(l,t.inputId+"-ts-control"),p="label[for='"+rp(t.inputId)+"']",u=document.querySelector(p),g=t.focus.bind(t);if(u){Vp(u,"click",g),fp(u,{for:d});const e=Dp(u,t.inputId+"-ts-label");fp(l,{"aria-labelledby":e}),fp(r,{"aria-labelledby":e})}if(o.style.width=a.style.width,t.plugins.names.length){const e="plugin-"+t.plugins.names.join(" plugin-");ap([o,n],e)}(null===e.maxItems||e.maxItems>1)&&t.is_select_tag&&fp(a,{multiple:"multiple"}),e.placeholder&&fp(i,{placeholder:e.placeholder}),!e.splitOn&&e.delimiter&&(e.splitOn=new RegExp("\\s*"+xd(e.delimiter)+"+\\s*")),e.load&&e.loadThrottle&&(e.load=Hp(e.load,e.loadThrottle)),t.control_input.type=a.type,Vp(n,"mousemove",()=>{t.ignoreHover=!1}),Vp(n,"mouseenter",e=>{var i=dp(e.target,"[data-selectable]",n);i&&t.onOptionHover(e,i)},{capture:!0}),Vp(n,"click",e=>{const i=dp(e.target,"[data-selectable]");i&&(t.onOptionSelect(e,i),Pp(e,!0))}),Vp(s,"click",e=>{var n=dp(e.target,"[data-ts-item]",s);n&&t.onItemSelect(e,n)?Pp(e,!0):""==i.value&&(t.onClick(),Pp(e,!0))}),Vp(l,"keydown",e=>t.onKeyDown(e)),Vp(i,"keypress",e=>t.onKeyPress(e)),Vp(i,"input",e=>t.onInput(e)),Vp(l,"blur",e=>t.onBlur(e)),Vp(l,"focus",e=>t.onFocus(e)),Vp(i,"paste",e=>t.onPaste(e));const f=e=>{const r=e.composedPath()[0];if(!o.contains(r)&&!n.contains(r))return t.isFocused&&t.blur(),void t.inputState();r==i&&t.isOpen?e.stopPropagation():Pp(e,!0)},m=()=>{t.isOpen&&t.positionDropdown()};Vp(document,"mousedown",f),Vp(window,"scroll",m,c),Vp(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",f),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),u&&u.removeEventListener("click",g)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",t.wrapper),t.sync(!1),e.items=[],delete e.optgroups,delete e.options,Vp(a,"invalid",()=>{t.isValid&&(t.isValid=!1,t.isInvalid=!0,t.refreshState())}),t.updateOriginalInput(),t.refreshItems(),t.close(!1),t.inputState(),t.isSetup=!0,a.disabled?t.disable():t.enable(),t.on("change",this.onChange),ap(a,"tomselected","ts-hidden-accessible"),t.trigger("initialize"),!0===e.preload&&t.preload()}setupOptions(t=[],e=[]){this.addOptions(t),Qd(e,t=>{this.registerOptionGroup(t)})}setupTemplates(){var t=this,e=t.settings.labelField,i=t.settings.optgroupLabelField,n={optgroup:t=>{let e=document.createElement("div");return e.className="optgroup",e.appendChild(t.options),e},optgroup_header:(t,e)=>'<div class="optgroup-header">'+e(t[i])+"</div>",option:(t,i)=>"<div>"+i(t[e])+"</div>",item:(t,i)=>"<div>"+i(t[e])+"</div>",option_create:(t,e)=>'<div class="create">Add <strong>'+e(t.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};t.settings.render=Object.assign({},n,t.settings.render)}setupCallbacks(){var t,e,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(t in i)(e=this.settings[i[t]])&&this.on(t,e)}sync(t=!0){const e=this,i=t?jp(e.input,{delimiter:e.settings.delimiter}):e.settings;e.setupOptions(i.options,i.optgroups),e.setValue(i.items||[],!0),e.lastQuery=null}onClick(){var t=this;if(t.activeItems.length>0)return t.clearActiveItems(),void t.focus();t.isFocused&&t.isOpen?t.blur():t.focus()}onMouseDown(){}onChange(){op(this.input,"input"),op(this.input,"change")}onPaste(t){var e=this;e.isInputHidden||e.isLocked?Pp(t):e.settings.splitOn&&setTimeout(()=>{var t=e.inputValue();if(t.match(e.settings.splitOn)){var i=t.trim().split(e.settings.splitOn);Qd(i,t=>{Mp(t)&&(this.options[t]?e.addItem(t):e.createItem(t))})}},0)}onKeyPress(t){var e=this;if(!e.isLocked){var i=String.fromCharCode(t.keyCode||t.which);return e.settings.create&&"multi"===e.settings.mode&&i===e.settings.delimiter?(e.createItem(),void Pp(t)):void 0}Pp(t)}onKeyDown(t){var e=this;if(e.ignoreHover=!0,e.isLocked)t.keyCode!==Ep&&Pp(t);else{switch(t.keyCode){case yp:if(Np(Tp,t)&&""==e.control_input.value)return Pp(t),void e.selectAll();break;case wp:return e.isOpen&&(Pp(t,!0),e.close()),void e.clearActiveItems();case Sp:if(!e.isOpen&&e.hasOptions)e.open();else if(e.activeOption){let t=e.getAdjacent(e.activeOption,1);t&&e.setActiveOption(t)}return void Pp(t);case kp:if(e.activeOption){let t=e.getAdjacent(e.activeOption,-1);t&&e.setActiveOption(t)}return void Pp(t);case _p:return void(e.canSelect(e.activeOption)?(e.onOptionSelect(t,e.activeOption),Pp(t)):(e.settings.create&&e.createItem()||document.activeElement==e.control_input&&e.isOpen)&&Pp(t));case xp:return void e.advanceSelection(-1,t);case Ap:return void e.advanceSelection(1,t);case Ep:return void(e.settings.selectOnTab&&(e.canSelect(e.activeOption)&&(e.onOptionSelect(t,e.activeOption),Pp(t)),e.settings.create&&e.createItem()&&Pp(t)));case zp:case Cp:return void e.deleteSelection(t)}e.isInputHidden&&!Np(Tp,t)&&Pp(t)}}onInput(t){var e=this;if(!e.isLocked){var i=e.inputValue();e.lastValue!==i&&(e.lastValue=i,e.settings.shouldLoad.call(e,i)&&e.load(i),e.refreshOptions(),e.trigger("type",i))}}onOptionHover(t,e){this.ignoreHover||this.setActiveOption(e,!1)}onFocus(t){var e=this,i=e.isFocused;if(e.isDisabled)return e.blur(),void Pp(t);e.ignoreFocus||(e.isFocused=!0,"focus"===e.settings.preload&&e.preload(),i||e.trigger("focus"),e.activeItems.length||(e.showInput(),e.refreshOptions(!!e.settings.openOnFocus)),e.refreshState())}onBlur(t){if(!1!==document.hasFocus()){var e=this;if(e.isFocused){e.isFocused=!1,e.ignoreFocus=!1;var i=()=>{e.close(),e.setActiveItem(),e.setCaret(e.items.length),e.trigger("blur")};e.settings.create&&e.settings.createOnBlur?e.createItem(null,i):i()}}}onOptionSelect(t,e){var i,n=this;e.parentElement&&e.parentElement.matches("[data-disabled]")||(e.classList.contains("create")?n.createItem(null,()=>{n.settings.closeAfterSelect&&n.close()}):void 0!==(i=e.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&t.type&&/click/.test(t.type)&&n.setActiveOption(e)))}canSelect(t){return!!(this.isOpen&&t&&this.dropdown_content.contains(t))}onItemSelect(t,e){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(Pp(t),i.setActiveItem(e,t),!0)}canLoad(t){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(t)}load(t){const e=this;if(!e.canLoad(t))return;ap(e.wrapper,e.settings.loadingClass),e.loading++;const i=e.loadCallback.bind(e);e.settings.load.call(e,t,i)}loadCallback(t,e){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(t,e),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||lp(i.wrapper,i.settings.loadingClass),i.trigger("load",t,e)}preload(){var t=this.wrapper.classList;t.contains("preloaded")||(t.add("preloaded"),this.load(""))}setTextboxValue(t=""){var e=this.control_input;e.value!==t&&(e.value=t,op(e,"update"),this.lastValue=t)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(t,e){Ip(this,e?[]:["change"],()=>{this.clear(e),this.addItems(t,e)})}setMaxItems(t){0===t&&(t=null),this.settings.maxItems=t,this.refreshState()}setActiveItem(t,e){var i,n,r,o,s,a,l=this;if("single"!==l.settings.mode){if(!t)return l.clearActiveItems(),void(l.isFocused&&l.showInput());if("click"===(i=e&&e.type.toLowerCase())&&Np("shiftKey",e)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(o=Array.prototype.indexOf.call(l.control.children,t))&&(s=r,r=o,o=s),n=r;n<=o;n++)t=l.control.children[n],-1===l.activeItems.indexOf(t)&&l.setActiveItemClass(t);Pp(e)}else"click"===i&&Np(Tp,e)||"keydown"===i&&Np("shiftKey",e)?t.classList.contains("active")?l.removeActiveItem(t):l.setActiveItemClass(t):(l.clearActiveItems(),l.setActiveItemClass(t));l.hideInput(),l.isFocused||l.focus()}}setActiveItemClass(t){const e=this,i=e.control.querySelector(".last-active");i&&lp(i,"last-active"),ap(t,"active last-active"),e.trigger("item_select",t),-1==e.activeItems.indexOf(t)&&e.activeItems.push(t)}removeActiveItem(t){var e=this.activeItems.indexOf(t);this.activeItems.splice(e,1),lp(t,"active")}clearActiveItems(){lp(this.activeItems,"active"),this.activeItems=[]}setActiveOption(t,e=!0){t!==this.activeOption&&(this.clearActiveOption(),t&&(this.activeOption=t,fp(this.focus_node,{"aria-activedescendant":t.getAttribute("id")}),fp(t,{"aria-selected":"true"}),ap(t,"active"),e&&this.scrollToOption(t)))}scrollToOption(t,e){if(!t)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,o=t.offsetHeight,s=t.getBoundingClientRect().top-i.getBoundingClientRect().top+r;s+o>n+r?this.scroll(s-n+o,e):s<r&&this.scroll(s,e)}scroll(t,e){const i=this.dropdown_content;e&&(i.style.scrollBehavior=e),i.scrollTop=t,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(lp(this.activeOption,"active"),fp(this.activeOption,{"aria-selected":null})),this.activeOption=null,fp(this.focus_node,{"aria-activedescendant":null})}selectAll(){const t=this;if("single"===t.settings.mode)return;const e=t.controlChildren();e.length&&(t.hideInput(),t.close(),t.activeItems=e,Qd(e,e=>{t.setActiveItemClass(e)}))}inputState(){var t=this;t.control.contains(t.control_input)&&(fp(t.control_input,{placeholder:t.settings.placeholder}),t.activeItems.length>0||!t.isFocused&&t.settings.hidePlaceholder&&t.items.length>0?(t.setTextboxValue(),t.isInputHidden=!0):(t.settings.hidePlaceholder&&t.items.length>0&&fp(t.control_input,{placeholder:""}),t.isInputHidden=!1),t.wrapper.classList.toggle("input-hidden",t.isInputHidden))}hideInput(){this.inputState()}showInput(){this.inputState()}inputValue(){return this.control_input.value.trim()}focus(){var t=this;t.isDisabled||(t.ignoreFocus=!0,t.control_input.offsetWidth?t.control_input.focus():t.focus_node.focus(),setTimeout(()=>{t.ignoreFocus=!1,t.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())}getSearchOptions(){var t=this.settings,e=t.sortField;return"string"==typeof t.sortField&&(e=[{field:t.sortField}]),{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}}search(t){var e,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,t)))throw new Error('Tom Select "score" setting must be a function that returns a function');return t!==n.lastQuery?(n.lastQuery=t,e=n.sifter.search(t,Object.assign(r,{score:i})),n.currentResults=e):e=Object.assign({},n.currentResults),n.settings.hideSelected&&(e.items=e.items.filter(t=>{let e=Mp(t.id);return!(e&&-1!==n.items.indexOf(e))})),e}refreshOptions(t=!0){var e,i,n,r,o,s,a,l,c,h;const d={},p=[];var u=this,g=u.inputValue();const f=g===u.lastQuery||""==g&&null==u.lastQuery;var m=u.search(g),v=null,b=u.settings.shouldOpen||!1,y=u.dropdown_content;for(f&&(v=u.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof u.settings.maxOptions&&(r=Math.min(r,u.settings.maxOptions)),r>0&&(b=!0),e=0;e<r;e++){let t=m.items[e];if(!t)continue;let r=t.id,a=u.options[r];if(void 0===a)continue;let l=Op(r),h=u.getOption(l,!0);for(u.settings.hideSelected||h.classList.toggle("selected",u.items.includes(l)),o=a[u.settings.optgroupField]||"",i=0,n=(s=Array.isArray(o)?o:[o])&&s.length;i<n;i++){o=s[i],u.optgroups.hasOwnProperty(o)||(o="");let t=d[o];void 0===t&&(t=document.createDocumentFragment(),p.push(o)),i>0&&(h=h.cloneNode(!0),fp(h,{id:a.$id+"-clone-"+i,"aria-selected":null}),h.classList.add("ts-cloned"),lp(h,"active"),u.activeOption&&u.activeOption.dataset.value==r&&c&&c.dataset.group===o.toString()&&(v=h)),t.appendChild(h),d[o]=t}}u.settings.lockOptgroupOrder&&p.sort((t,e)=>{const i=u.optgroups[t],n=u.optgroups[e];return(i&&i.$order||0)-(n&&n.$order||0)}),a=document.createDocumentFragment(),Qd(p,t=>{let e=d[t];if(!e||!e.children.length)return;let i=u.optgroups[t];if(void 0!==i){let t=document.createDocumentFragment(),n=u.render("optgroup_header",i);Bp(t,n),Bp(t,e);let r=u.render("optgroup",{group:i,options:t});Bp(a,r)}else Bp(a,e)}),y.innerHTML="",Bp(y,a),u.settings.highlight&&(bp(y),m.query.length&&m.tokens.length&&Qd(m.tokens,t=>{vp(y,t.regex)}));var _=t=>{let e=u.render(t,{input:g});return e&&(b=!0,y.insertBefore(e,y.firstChild)),e};if(u.loading?_("loading"):u.settings.shouldLoad.call(u,g)?0===m.items.length&&_("no_results"):_("not_loading"),(l=u.canCreate(g))&&(h=_("option_create")),u.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==u.settings.mode||null==u.items[0]||(v=u.getOption(u.items[0])),!y.contains(v)){let t=0;h&&!u.settings.addPrecedence&&(t=1),v=u.selectable()[t]}}else h&&(v=h);t&&!u.isOpen&&(u.open(),u.scrollToOption(v,"auto")),u.setActiveOption(v)}else u.clearActiveOption(),t&&u.isOpen&&u.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(t,e=!1){const i=this;if(Array.isArray(t))return i.addOptions(t,e),!1;const n=Mp(t[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(t.$order=t.$order||++i.order,t.$id=i.inputId+"-opt-"+t.$order,i.options[n]=t,i.lastQuery=null,e&&(i.userOptions[n]=e,i.trigger("option_add",n,t)),n)}addOptions(t,e=!1){Qd(t,t=>{this.addOption(t,e)})}registerOption(t){return this.addOption(t)}registerOptionGroup(t){var e=Mp(t[this.settings.optgroupValueField]);return null!==e&&(t.$order=t.$order||++this.order,this.optgroups[e]=t,e)}addOptionGroup(t,e){var i;e[this.settings.optgroupValueField]=t,(i=this.registerOptionGroup(e))&&this.trigger("optgroup_add",i,e)}removeOptionGroup(t){this.optgroups.hasOwnProperty(t)&&(delete this.optgroups[t],this.clearCache(),this.trigger("optgroup_remove",t))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(t,e){const i=this;var n,r;const o=Mp(t),s=Mp(e[i.settings.valueField]);if(null===o)return;const a=i.options[o];if(null==a)return;if("string"!=typeof s)throw new Error("Value must be set in option data");const l=i.getOption(o),c=i.getItem(o);if(e.$order=e.$order||a.$order,delete i.options[o],i.uncacheValue(s),i.options[s]=e,l){if(i.dropdown_content.contains(l)){const t=i._render("option",e);mp(l,t),i.activeOption===l&&i.setActiveOption(t)}l.remove()}c&&(-1!==(r=i.items.indexOf(o))&&i.items.splice(r,1,s),n=i._render("item",e),c.classList.contains("active")&&ap(n,"active"),mp(c,n)),i.lastQuery=null}removeOption(t,e){const i=this;t=Op(t),i.uncacheValue(t),delete i.userOptions[t],delete i.options[t],i.lastQuery=null,i.trigger("option_remove",t),i.removeItem(t,e)}clearOptions(t){const e=(t||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};Qd(this.options,(t,n)=>{e(t,n)&&(i[n]=t)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(t,e){return this.items.indexOf(e)>=0}getOption(t,e=!1){const i=Mp(t);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(e)return this._render("option",n)}return null}getAdjacent(t,e,i="option"){var n,r=this;if(!t)return null;n="item"==i?r.controlChildren():r.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==t)return e>0?n[i+1]:n[i-1];return null}getItem(t){if("object"==typeof t)return t;var e=Mp(t);return null!==e?this.control.querySelector(`[data-value="${Fp(e)}"]`):null}addItems(t,e){var i=this,n=Array.isArray(t)?t:[t];const r=(n=n.filter(t=>-1===i.items.indexOf(t)))[n.length-1];n.forEach(t=>{i.isPending=t!==r,i.addItem(t,e)})}addItem(t,e){Ip(this,e?[]:["change","dropdown_close"],()=>{var i,n;const r=this,o=r.settings.mode,s=Mp(t);if((!s||-1===r.items.indexOf(s)||("single"===o&&r.close(),"single"!==o&&r.settings.duplicates))&&null!==s&&r.options.hasOwnProperty(s)&&("single"===o&&r.clear(e),"multi"!==o||!r.isFull())){if(i=r._render("item",r.options[s]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,s),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let t=r.getOption(s),e=r.getAdjacent(t,1);e&&r.setActiveOption(e)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==o),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",s,i),r.isPending||r.updateOriginalInput({silent:e})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}})}removeItem(t=null,e){const i=this;if(!(t=i.getItem(t)))return;var n,r;const o=t.dataset.value;n=gp(t),t.remove(),t.classList.contains("active")&&(r=i.activeItems.indexOf(t),i.activeItems.splice(r,1),lp(t,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(o)&&i.removeOption(o,e),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:e}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",o,t)}createItem(t=null,e=(()=>{})){3===arguments.length&&(e=arguments[2]),"function"!=typeof e&&(e=()=>{});var i,n=this,r=n.caretPos;if(t=t||n.inputValue(),!n.canCreate(t))return e(),!1;n.lock();var o=!1,s=t=>{if(n.unlock(),!t||"object"!=typeof t)return e();var i=Mp(t[n.settings.valueField]);if("string"!=typeof i)return e();n.setTextboxValue(),n.addOption(t,!0),n.setCaret(r),n.addItem(i),e(t),o=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,t,s):{[n.settings.labelField]:t,[n.settings.valueField]:t},o||s(i),!0}refreshItems(){var t=this;t.lastQuery=null,t.isSetup&&t.addItems(t.items),t.updateOriginalInput(),t.refreshState()}refreshState(){const t=this;t.refreshValidityState();const e=t.isFull(),i=t.isLocked;t.wrapper.classList.toggle("rtl",t.rtl);const n=t.wrapper.classList;n.toggle("focus",t.isFocused),n.toggle("disabled",t.isDisabled),n.toggle("required",t.isRequired),n.toggle("invalid",!t.isValid),n.toggle("locked",i),n.toggle("full",e),n.toggle("input-active",t.isFocused&&!t.isInputHidden),n.toggle("dropdown-active",t.isOpen),n.toggle("has-options",up(t.options)),n.toggle("has-items",t.items.length>0)}refreshValidityState(){var t=this;t.input.validity&&(t.isValid=t.input.validity.valid,t.isInvalid=!t.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(t={}){const e=this;var i,n;const r=e.input.querySelector('option[value=""]');if(e.is_select_tag){const t=[],s=e.input.querySelectorAll("option:checked").length;function o(i,n,o){return i||(i=ip('<option value="'+$p(n)+'">'+$p(o)+"</option>")),i!=r&&e.input.append(i),t.push(i),(i!=r||s>0)&&(i.selected=!0),i}e.input.querySelectorAll("option:checked").forEach(t=>{t.selected=!1}),0==e.items.length&&"single"==e.settings.mode?o(r,"",""):e.items.forEach(r=>{if(i=e.options[r],n=i[e.settings.labelField]||"",t.includes(i.$option)){o(e.input.querySelector(`option[value="${Fp(r)}"]:not(:checked)`),r,n)}else i.$option=o(i.$option,r,n)})}else e.input.value=e.getValue();e.isSetup&&(t.silent||e.trigger("change",e.getValue()))}open(){var t=this;t.isLocked||t.isOpen||"multi"===t.settings.mode&&t.isFull()||(t.isOpen=!0,fp(t.focus_node,{"aria-expanded":"true"}),t.refreshState(),sp(t.dropdown,{visibility:"hidden",display:"block"}),t.positionDropdown(),sp(t.dropdown,{visibility:"visible",display:"block"}),t.focus(),t.trigger("dropdown_open",t.dropdown))}close(t=!0){var e=this,i=e.isOpen;t&&(e.setTextboxValue(),"single"===e.settings.mode&&e.items.length&&e.hideInput()),e.isOpen=!1,fp(e.focus_node,{"aria-expanded":"false"}),sp(e.dropdown,{display:"none"}),e.settings.hideSelected&&e.clearActiveOption(),e.refreshState(),i&&e.trigger("dropdown_close",e.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var t=this.control,e=t.getBoundingClientRect(),i=t.offsetHeight+e.top+window.scrollY,n=e.left+window.scrollX;sp(this.dropdown,{width:e.width+"px",top:i+"px",left:n+"px"})}}clear(t){var e=this;if(e.items.length){var i=e.controlChildren();Qd(i,t=>{e.removeItem(t,!0)}),e.showInput(),t||e.updateOriginalInput(),e.trigger("clear")}}insertAtCaret(t){const e=this,i=e.caretPos,n=e.control;n.insertBefore(t,n.children[i]||null),e.setCaret(i+1)}deleteSelection(t){var e,i,n,r,o=this;e=t&&t.keyCode===zp?-1:1,i=Rp(o.control_input);const s=[];if(o.activeItems.length)r=pp(o.activeItems,e),n=gp(r),e>0&&n++,Qd(o.activeItems,t=>s.push(t));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const t=o.controlChildren();let n;e<0&&0===i.start&&0===i.length?n=t[o.caretPos-1]:e>0&&i.start===o.inputValue().length&&(n=t[o.caretPos]),void 0!==n&&s.push(n)}if(!o.shouldDelete(s,t))return!1;for(Pp(t,!0),void 0!==n&&o.setCaret(n);s.length;)o.removeItem(s.pop());return o.showInput(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(t,e){const i=t.map(t=>t.dataset.value);return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,e))}advanceSelection(t,e){var i,n,r=this;r.rtl&&(t*=-1),r.inputValue().length||(Np(Tp,e)||Np("shiftKey",e)?(n=(i=r.getLastActive(t))?i.classList.contains("active")?r.getAdjacent(i,t,"item"):i:t>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(t))}moveCaret(t){}getLastActive(t){let e=this.control.querySelector(".last-active");if(e)return e;var i=this.control.querySelectorAll(".active");return i?pp(i,t):void 0}setCaret(t){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.isLocked=!0,this.refreshState()}unlock(){this.isLocked=!1,this.refreshState()}disable(){var t=this;t.input.disabled=!0,t.control_input.disabled=!0,t.focus_node.tabIndex=-1,t.isDisabled=!0,this.close(),t.lock()}enable(){var t=this;t.input.disabled=!1,t.control_input.disabled=!1,t.focus_node.tabIndex=t.tabIndex,t.isDisabled=!1,t.unlock()}destroy(){var t=this,e=t.revertSettings;t.trigger("destroy"),t.off(),t.wrapper.remove(),t.dropdown.remove(),t.input.innerHTML=e.innerHTML,t.input.tabIndex=e.tabIndex,lp(t.input,"tomselected","ts-hidden-accessible"),t._destroy(),delete t.input.tomselect}render(t,e){var i,n;const r=this;if("function"!=typeof this.settings.render[t])return null;if(!(n=r.settings.render[t].call(this,e,$p)))return null;if(n=ip(n),"option"===t||"option_create"===t?e[r.settings.disabledField]?fp(n,{"aria-disabled":"true"}):fp(n,{"data-selectable":""}):"optgroup"===t&&(i=e.group[r.settings.optgroupValueField],fp(n,{"data-group":i}),e.group[r.settings.disabledField]&&fp(n,{"data-disabled":""})),"option"===t||"item"===t){const i=Op(e[r.settings.valueField]);fp(n,{"data-value":i}),"item"===t?(ap(n,r.settings.itemClass),fp(n,{"data-ts-item":""})):(ap(n,r.settings.optionClass),fp(n,{role:"option",id:e.$id}),e.$div=n,r.options[i]=e)}return n}_render(t,e){const i=this.render(t,e);if(null==i)throw"HTMLElement expected";return i}clearCache(){Qd(this.options,t=>{t.$div&&(t.$div.remove(),delete t.$div)})}uncacheValue(t){const e=this.getOption(t);e&&e.remove()}canCreate(t){return this.settings.create&&t.length>0&&this.settings.createFilter.call(this,t)}hook(t,e,i){var n=this,r=n[e];n[e]=function(){var e,o;return"after"===t&&(e=r.apply(n,arguments)),o=i.apply(n,arguments),"instead"===t?o:("before"===t&&(e=r.apply(n,arguments)),e)}}}function Wp(){Vp(this.input,"change",()=>{this.sync()})}function Yp(){var t=this,e=t.onOptionSelect;t.settings.hideSelected=!1;var i=function(t){setTimeout(()=>{var e=t.querySelector("input");e instanceof HTMLInputElement&&(t.classList.contains("selected")?e.checked=!0:e.checked=!1)},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(i,n)=>{var r=ip(e.call(t,i,n)),o=document.createElement("input");o.addEventListener("click",(function(t){Pp(t)})),o.type="checkbox";const s=Mp(i[t.settings.valueField]);return s&&t.items.indexOf(s)>-1&&(o.checked=!0),r.prepend(o),r}}),t.on("item_remove",e=>{var n=t.getOption(e);n&&(n.classList.remove("selected"),i(n))}),t.on("item_add",e=>{var n=t.getOption(e);n&&i(n)}),t.hook("instead","onOptionSelect",(n,r)=>{if(r.classList.contains("selected"))return r.classList.remove("selected"),t.removeItem(r.dataset.value),t.refreshOptions(),void Pp(n,!0);e.call(t,n,r),i(r)})}function Gp(t){const e=this,i=Object.assign({className:"clear-button",title:"Clear All",html:t=>`<div class="${t.className}" title="${t.title}">&#10799;</div>`},t);e.on("initialize",()=>{var t=ip(i.html(i));t.addEventListener("click",t=>{e.isDisabled||(e.clear(),"single"===e.settings.mode&&e.settings.allowEmptyOption&&e.addItem(""),t.preventDefault(),t.stopPropagation())}),e.control.appendChild(t)})}function Kp(){var t=this;if(!$.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===t.settings.mode){var e=t.lock,i=t.unlock;t.hook("instead","lock",()=>{var i=$(t.control).data("sortable");return i&&i.disable(),e.call(t)}),t.hook("instead","unlock",()=>{var e=$(t.control).data("sortable");return e&&e.enable(),i.call(t)}),t.on("initialize",()=>{var e=$(t.control).sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:t.isLocked,start:(t,i)=>{i.placeholder.css("width",i.helper.css("width")),e.css({overflow:"visible"})},stop:()=>{e.css({overflow:"hidden"});var i=[];e.children("[data-value]").each((function(){this.dataset.value&&i.push(this.dataset.value)})),t.setValue(i)}})})}}function Xp(t){const e=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:t=>'<div class="'+t.headerClass+'"><div class="'+t.titleRowClass+'"><span class="'+t.labelClass+'">'+t.title+'</span><a class="'+t.closeClass+'">&times;</a></div></div>'},t);e.on("initialize",()=>{var t=ip(i.html(i)),n=t.querySelector("."+i.closeClass);n&&n.addEventListener("click",t=>{Pp(t,!0),e.close()}),e.dropdown.insertBefore(t,e.dropdown.firstChild)})}function Zp(){var t=this;t.hook("instead","setCaret",e=>{"single"!==t.settings.mode&&t.control.contains(t.control_input)?(e=Math.max(0,Math.min(t.items.length,e)))==t.caretPos||t.isPending||t.controlChildren().forEach((i,n)=>{n<e?t.control_input.insertAdjacentElement("beforebegin",i):t.control.appendChild(i)}):e=t.items.length,t.caretPos=e}),t.hook("instead","moveCaret",e=>{if(!t.isFocused)return;const i=t.getLastActive(e);if(i){const n=gp(i);t.setCaret(e>0?n+1:n),t.setActiveItem(),lp(i,"last-active")}else t.setCaret(t.caretPos+e)})}function Qp(){const t=this;t.settings.shouldOpen=!0,t.hook("before","setup",()=>{t.focus_node=t.control,ap(t.control_input,"dropdown-input");const e=ip('<div class="dropdown-input-wrap">');e.append(t.control_input),t.dropdown.insertBefore(e,t.dropdown.firstChild);const i=ip('<input class="items-placeholder" tabindex="-1" />');i.placeholder=t.settings.placeholder||"",t.control.append(i)}),t.on("initialize",()=>{t.control_input.addEventListener("keydown",e=>{switch(e.keyCode){case wp:return t.isOpen&&(Pp(e,!0),t.close()),void t.clearActiveItems();case Ep:t.focus_node.tabIndex=-1}return t.onKeyDown.call(t,e)}),t.on("blur",()=>{t.focus_node.tabIndex=t.isDisabled?-1:t.tabIndex}),t.on("dropdown_open",()=>{t.control_input.focus()});const e=t.onBlur;t.hook("instead","onBlur",i=>{if(!i||i.relatedTarget!=t.control_input)return e.call(t)}),Vp(t.control_input,"blur",()=>t.onBlur()),t.hook("before","close",()=>{t.isOpen&&t.focus_node.focus({preventScroll:!0})})})}function Jp(){var t=this;t.on("initialize",()=>{var e=document.createElement("span"),i=t.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",t.wrapper.appendChild(e);var n=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(const t of n)e.style[t]=i.style[t];var r=()=>{e.textContent=i.value,i.style.width=e.clientWidth+"px"};r(),t.on("update item_add item_remove",r),Vp(i,"input",r),Vp(i,"keyup",r),Vp(i,"blur",r),Vp(i,"update",r)})}function tu(){var t=this,e=t.deleteSelection;this.hook("instead","deleteSelection",i=>!!t.activeItems.length&&e.call(t,i))}function eu(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}function iu(){var t=this,e=t.onKeyDown;t.hook("instead","onKeyDown",i=>{var n,r,o,s;if(!t.isOpen||i.keyCode!==xp&&i.keyCode!==Ap)return e.call(t,i);t.ignoreHover=!0,s=dp(t.activeOption,"[data-group]"),n=gp(t.activeOption,"[data-selectable]"),s&&(s=i.keyCode===xp?s.previousSibling:s.nextSibling)&&(r=(o=s.querySelectorAll("[data-selectable]"))[Math.min(o.length-1,n)])&&t.setActiveOption(r)})}function nu(t){const e=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},t);var i=this;if(e.append){var n='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+$p(e.title)+'">'+e.label+"</a>";i.hook("after","setupTemplates",()=>{var t=i.settings.render.item;i.settings.render.item=(e,r)=>{var o=ip(t.call(i,e,r)),s=ip(n);return o.appendChild(s),Vp(s,"mousedown",t=>{Pp(t,!0)}),Vp(s,"click",t=>{Pp(t,!0),i.isLocked||i.shouldDelete([o],t)&&(i.removeItem(o),i.refreshOptions(!1),i.inputState())}),o}})}}function ru(t){const e=this,i=Object.assign({text:t=>t[e.settings.labelField]},t);e.on("item_remove",(function(t){if(e.isFocused&&""===e.control_input.value.trim()){var n=e.options[t];n&&e.setTextboxValue(i.text.call(e,n))}}))}function ou(){const t=this,e=t.canLoad,i=t.clearActiveOption,n=t.loadCallback;var r,o,s={},a=!1,l=[];if(t.settings.shouldLoadMore||(t.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(t.activeOption){var e=t.selectable();if(Array.from(e).indexOf(t.activeOption)>=e.length-2)return!0}return!1}),!t.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";t.settings.sortField=[{field:"$order"},{field:"$score"}];const c=e=>!("number"==typeof t.settings.maxOptions&&r.children.length>=t.settings.maxOptions)&&!(!(e in s)||!s[e]),h=(e,i)=>t.items.indexOf(i)>=0||l.indexOf(i)>=0;t.setNextUrl=(t,e)=>{s[t]=e},t.getUrl=e=>{if(e in s){const t=s[e];return s[e]=!1,t}return s={},t.settings.firstUrl.call(t,e)},t.hook("instead","clearActiveOption",()=>{if(!a)return i.call(t)}),t.hook("instead","canLoad",i=>i in s?c(i):e.call(t,i)),t.hook("instead","loadCallback",(e,i)=>{if(a){if(o){const i=e[0];void 0!==i&&(o.dataset.value=i[t.settings.valueField])}}else t.clearOptions(h);n.call(t,e,i),a=!1}),t.hook("after","refreshOptions",()=>{const e=t.lastValue;var i;c(e)?(i=t.render("loading_more",{query:e}))&&(i.setAttribute("data-selectable",""),o=i):e in s&&!r.querySelector(".no-results")&&(i=t.render("no_more_results",{query:e})),i&&(ap(i,t.settings.optionClass),r.append(i))}),t.on("initialize",()=>{l=Object.keys(t.options),r=t.dropdown_content,t.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},t.settings.render),r.addEventListener("scroll",()=>{t.settings.shouldLoadMore.call(t)&&c(t.lastValue)&&(a||(a=!0,t.load.call(t,t.lastValue)))})})}function su(t){if(document.getElementById("__pb-multi-select-css"))return;const e=P("../css/tom-select"),i=document.createElement("link");i.id="__pb-multi-select-css",i.href=`${e}/tom-select.${t}.min.css`,i.rel="stylesheet",document.head.appendChild(i)}Up.define("change_listener",Wp),Up.define("checkbox_options",Yp),Up.define("clear_button",Gp),Up.define("drag_drop",Kp),Up.define("dropdown_header",Xp),Up.define("caret_position",Zp),Up.define("dropdown_input",Qp),Up.define("input_autogrow",Jp),Up.define("no_backspace_delete",tu),Up.define("no_active_items",eu),Up.define("optgroup_columns",iu),Up.define("remove_button",nu),Up.define("restore_on_backspace",ru),Up.define("virtual_scroll",ou);const au=t=>t?`<div>${G(t.text)}</div>`:"";class lu extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{placeholder:{type:String},source:{type:String},closeAfterSelect:{type:Boolean,attribute:"close-after-select"},preload:{type:Boolean},onBlur:{type:String,attribute:"on-blur"},onChange:{type:String,attribute:"on-change"}})}get value(){return this._select?this._select.getValue():null}set value(t){this._select&&(this._select.clear(!0),this._select.sync(),this._select.setValue(t,!1),this._select.sync())}set renderItem(t){this.renderFunction=t}constructor(){super(),this.theme="default",this.source=null,this.closeAfterSelect=!1,this.preload=!1,this.renderFunction=au,this.onBlur="pb-combo-box-blur",this.onChange="pb-combo-box-change",this.placeholder=""}connectedCallback(){super.connectedCallback(),this.subscribeTo("pb-i18n-update",()=>{this._select&&(this._select.settings.placeholder=G(this.placeholder),this._select.inputState(),this.source?this._select.refreshOptions(!1):(this._select.clearOptions(),this._select.sync()))})}firstUpdated(){su(this.theme);let t=this.querySelector("select,input");t||(t=document.createElement("input"),this.appendChild(t)),t.autocomplete=!1,B("pb-page-ready",()=>{const e={};if(this.source){const t=this.toAbsoluteURL(this.source);e.labelField="text",e.valueField="value",e.searchField=[],e.preload=this.preload,e.load=(e,i)=>{fetch(`${t}?query=${encodeURIComponent(e)}`,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.json()).then(t=>{i(t)}).catch(()=>{i()})},e.render={option:this.renderFunction,item:this.renderFunction}}e.placeholder=G(this.placeholder),e.closeAfterSelect=this.closeAfterSelect,e.onBlur=()=>this.emitTo(this.onBlur,{value:this.value}),e.onChange=()=>this.emitTo(this.onChange,{value:this.value}),this._select=new Up(t,e)})}createRenderRoot(){return this}}customElements.define("pb-combo-box",lu);class cu extends(D(V)){static get properties(){return Object.assign({src:{type:String},styles:{type:String},url:{type:String,reflect:!0,readOnly:!0},raw:{type:Boolean}},super.properties)}constructor(){super(),this.url="about:blank",this.raw=!1}firstUpdated(){super.firstUpdated(),this._iframe=this.shadowRoot.querySelector("iframe"),this._iframe.addEventListener("load",()=>{"about:blank"!==this._iframe.src&&(this._iframe.className="",this.emitTo("pb-end-update"))}),B("pb-page-ready",()=>{this.refresh()})}print(){this._iframe.contentWindow.print()}refresh(){this.emitTo("pb-start-update"),this._iframe.className="hidden",this._iframe.src="about:blank";const t=this.getDocument(),e=new URLSearchParams;t.odd&&e.set("odd",t.odd+".odd"),e.set("base",`${this.getEndpoint()}/${t.getCollection()}/`),this._getCustomStyles().forEach(t=>e.append("style",t));const i=e.toString();this.url=`${this.getEndpoint()}/api/document/${encodeURIComponent(t.path)}/print?${i}`;const n=new URLSearchParams(i);n.set("wc","true"),this.raw||(n.set("script",P("../lib/paged.polyfill.js")),n.append("style",P("../css/pagedjs/interface.css"))),this._iframe.src=`${this.getEndpoint()}/api/document/${encodeURIComponent(t.path)}/print?${n.toString()}`}render(){return I`
4496
4508
  <iframe title="Preview" src="about:blank"></iframe>
4497
4509
  `}_getCustomStyles(){let t=[];return this.styles&&(t=this.styles.split(/\s*,\s*/)),t}static get styles(){return R`
4498
4510
  :host {
@@ -4512,7 +4524,7 @@ class Qd{constructor(t,e){this.items=void 0,this.settings=void 0,this.items=t,th
4512
4524
  transition: opacity 0.5s ease-out;
4513
4525
  }
4514
4526
 
4515
- `}}customElements.define("pb-print-preview",au);
4527
+ `}}customElements.define("pb-print-preview",cu);
4516
4528
  /**
4517
4529
  @license
4518
4530
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -4523,7 +4535,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
4523
4535
  part of the polymer project is also subject to an additional IP rights grant
4524
4536
  found at http://polymer.github.io/PATENTS.txt
4525
4537
  */
4526
- const lu=n`<iron-iconset-svg name="editor" size="24">
4538
+ const hu=n`<iron-iconset-svg name="editor" size="24">
4527
4539
  <svg><defs>
4528
4540
  <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>
4529
4541
  <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>
@@ -4594,7 +4606,7 @@ const lu=n`<iron-iconset-svg name="editor" size="24">
4594
4606
  <g id="vertical-align-top"><path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"></path></g>
4595
4607
  <g id="wrap-text"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3 3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"></path></g>
4596
4608
  </defs></svg>
4597
- </iron-iconset-svg>`;document.head.appendChild(lu.content);
4609
+ </iron-iconset-svg>`;document.head.appendChild(hu.content);
4598
4610
  /**
4599
4611
  @license
4600
4612
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -4605,7 +4617,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
4605
4617
  part of the polymer project is also subject to an additional IP rights grant
4606
4618
  found at http://polymer.github.io/PATENTS.txt
4607
4619
  */
4608
- const cu=n`<iron-iconset-svg name="social" size="24">
4620
+ const du=n`<iron-iconset-svg name="social" size="24">
4609
4621
  <svg><defs>
4610
4622
  <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>
4611
4623
  <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>
@@ -4638,7 +4650,7 @@ const cu=n`<iron-iconset-svg name="social" size="24">
4638
4650
  <g id="share"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"></path></g>
4639
4651
  <g id="whatshot"><path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"></path></g>
4640
4652
  </defs></svg>
4641
- </iron-iconset-svg>`;document.head.appendChild(cu.content);
4653
+ </iron-iconset-svg>`;document.head.appendChild(du.content);
4642
4654
  /**
4643
4655
  @license
4644
4656
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -4649,7 +4661,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
4649
4661
  part of the polymer project is also subject to an additional IP rights grant
4650
4662
  found at http://polymer.github.io/PATENTS.txt
4651
4663
  */
4652
- const hu=n`<iron-iconset-svg name="maps" size="24">
4664
+ const pu=n`<iron-iconset-svg name="maps" size="24">
4653
4665
  <svg><defs>
4654
4666
  <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>
4655
4667
  <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>
@@ -4720,7 +4732,7 @@ const hu=n`<iron-iconset-svg name="maps" size="24">
4720
4732
  <g id="transfer-within-a-station"><path d="M16.49 15.5v-1.75L14 16.25l2.49 2.5V17H22v-1.5zm3.02 4.25H14v1.5h5.51V23L22 20.5 19.51 18zM9.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM5.75 8.9L3 23h2.1l1.75-8L9 17v6h2v-7.55L8.95 13.4l.6-3C10.85 12 12.8 13 15 13v-2c-1.85 0-3.45-1-4.35-2.45l-.95-1.6C9.35 6.35 8.7 6 8 6c-.25 0-.5.05-.75.15L2 8.3V13h2V9.65l1.75-.75"></path></g>
4721
4733
  <g id="zoom-out-map"><path d="M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6z"></path></g>
4722
4734
  </defs></svg>
4723
- </iron-iconset-svg>`;document.head.appendChild(hu.content);
4735
+ </iron-iconset-svg>`;document.head.appendChild(pu.content);
4724
4736
  /**
4725
4737
  @license
4726
4738
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -4731,7 +4743,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
4731
4743
  part of the polymer project is also subject to an additional IP rights grant
4732
4744
  found at http://polymer.github.io/PATENTS.txt
4733
4745
  */
4734
- const du=n`<iron-iconset-svg name="image" size="24">
4746
+ const uu=n`<iron-iconset-svg name="image" size="24">
4735
4747
  <svg><defs>
4736
4748
  <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>
4737
4749
  <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>
@@ -4889,7 +4901,7 @@ const du=n`<iron-iconset-svg name="image" size="24">
4889
4901
  <g id="wb-iridescent"><path d="M5 14.5h14v-6H5v6zM11 .55V3.5h2V.55h-2zm8.04 2.5l-1.79 1.79 1.41 1.41 1.8-1.79-1.42-1.41zM13 22.45V19.5h-2v2.95h2zm7.45-3.91l-1.8-1.79-1.41 1.41 1.79 1.8 1.42-1.42zM3.55 4.46l1.79 1.79 1.41-1.41-1.79-1.79-1.41 1.41zm1.41 15.49l1.79-1.8-1.41-1.41-1.79 1.79 1.41 1.42z"></path></g>
4890
4902
  <g id="wb-sunny"><path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"></path></g>
4891
4903
  </defs></svg>
4892
- </iron-iconset-svg>`;document.head.appendChild(du.content),
4904
+ </iron-iconset-svg>`;document.head.appendChild(uu.content),
4893
4905
  /**
4894
4906
  @license
4895
4907
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.