@teipublisher/pb-components 1.28.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/demo/demos.json +2 -1
- package/dist/demo/pb-view3.html +90 -0
- package/dist/pb-components-bundle.js +4 -4
- package/dist/pb-elements.json +22 -0
- package/package.json +1 -1
- package/pb-elements.json +22 -0
- package/src/pb-table-grid.js +1 -1
- package/src/pb-view-annotate.js +14 -7
- package/src/pb-view.js +38 -1
|
@@ -507,7 +507,7 @@ const W=n`
|
|
|
507
507
|
border-color: #999;
|
|
508
508
|
color: #999;
|
|
509
509
|
}
|
|
510
|
-
`}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,n,i=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n&&n(t,r)},{once:i})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(n=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n(t)},{once:!0})})}static emit(t,e=null,n=null){const i=n||{};e&&(i.key=e);const r=new CustomEvent(t,{detail:i});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.28.0";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",nt="right",it="left",rt="auto",ot=[tt,et,nt,it],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});bt(i)&&ft(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function St(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var n=Lt(t);bt(n)&&["html","body"].indexOf(ft(n))<0;){var i=Ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function Vt(t){for(var e=mt(t),n=Ht(t);n&&Et(n)&&"static"===Ct(n).position;)n=Ht(n);return n&&("html"===ft(n)||"body"===ft(n)&&"static"===Ct(n).position)?e:n||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,n){return Ot(t,Pt(e,n))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=kt(n.placement),l=$t(s),c=[it,nt].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,n),p=At(o),d="y"===l?tt:it,u="y"===l?et:nt,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],f=a[l]-n.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;n.modifiersData[i]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&St(e.elements.popper,i)&&(e.elements.arrow=i)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:Rt(Rt(e*i)/i)||0,y:Rt(Rt(n*i)/i)||0}}function Gt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=it,b=tt,y=window;if(l){var _=Vt(n),w="clientHeight",x="clientWidth";_===mt(n)&&"static"!==Ct(_=Mt(n)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-i.height,g*=s?1:-1),r===it&&(v=nt,d-=_[x]-i.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,Kt)})),s&&l.addEventListener("resize",n.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Kt)})),s&&l.removeEventListener("resize",n.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ie(t){var e=mt(t),n=Mt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+ne(t),y:s}}function re(t){var e,n=Mt(t),i=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ne(t),l=-i.scrollTop;return"rtl"===Ct(r||n).direction&&(s+=Ot(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var n;void 0===e&&(e=[]);var i=ae(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=mt(i),a=r?[o].concat(o.visualViewport||[],oe(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ie(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),n=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(n)?e.filter((function(t){return vt(t)&&St(t,n)&&"body"!==ft(t)})):[]}function de(t,e,n){var i="clippingParents"===e?pe(t):[].concat(e),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(e,n){var i=he(t,n);return e.top=Ot(i.top,e.top),e.right=Pt(i.right,e.right),e.bottom=Pt(i.bottom,e.bottom),e.left=Ot(i.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case tt:e={x:s,y:n.y-i.height};break;case et:e={x:s,y:n.y+n.height};break;case nt:e={x:n.x+n.width,y:l};break;case it:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(n[h]/2-i[h]/2);break;case st:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.boundary,a=void 0===o?lt:o,s=n.rootBoundary,l=void 0===s?ct:s,c=n.elementContext,h=void 0===c?ht:c,p=n.altBoundary,d=void 0!==p&&p,u=n.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[nt,et].indexOf(t)>=0?1:-1,n=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e}))}return A}function me(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(i),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,n){return e[n]=fe(t,{placement:n,boundary:r,rootBoundary:o,padding:a})[kt(n)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,h=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,g=void 0===u||u,f=n.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,n){return t.concat(kt(n)===rt?me(e,{placement:n,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):n)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?nt:it:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[i]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _e(t){return[tt,nt,et,it].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,i),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,n){var i=kt(t),r=[it,tt].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[it,nt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,n){return t[n]=xe(n,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}function ze(t){var e=t.state,n=t.name;e.modifiersData[n]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,p=n.padding,d=n.tether,u=void 0===d||d,g=n.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:it,E="y"===_?et:nt,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:it,Q="x"===_?et:nt,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[i]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,n){void 0===n&&(n=!1);var i=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&(("body"!==ft(e)||oe(i))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=ne(i))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function He(t){var e=Le(t);return gt.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){h(),r.options=Object.assign({},o,r.options,n),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(i,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,n=t.popper;if(Oe(e,n)){r.rects={reference:Me(e,Vt(n),"fixed"===r.options.strategy),popper:At(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,i=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:i}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function Ue(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,n){return t.indexOf(e)===n}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function tn(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function en(){return document.createElement("div")}function nn(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function rn(t){return Ue(t,"NodeList")}function on(t){return Ue(t,"MouseEvent")}function an(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function sn(t){return nn(t)?[t]:rn(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function ln(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function cn(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function hn(t){var e,n=Ke(t)[0];return(null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function pn(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-i+l>o,u=i-e.bottom-c>o,g=e.left-n+h>o,f=n-e.right-p>o;return d||u||g||f}))}function dn(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}var un={isTouch:!1},gn=0;function fn(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",mn))}function mn(){var t=performance.now();t-gn<20&&(un.isTouch=!1,document.removeEventListener("mousemove",mn)),gn=t}function vn(){var t=document.activeElement;if(an(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bn(){document.addEventListener("touchstart",fn,je),window.addEventListener("blur",vn)}var yn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",_n=/MSIE |Trident\//.test(yn),wn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xn={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kn=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},wn,{},xn),zn=Object.keys(kn),An=function(t){Object.keys(t).forEach((function(e){kn[e]=t[e]}))};function Sn(t){var e=(t.plugins||[]).reduce((function(e,n){var i=n.name,r=n.defaultValue;return i&&(e[i]=void 0!==t[i]?t[i]:r),e}),{});return Object.assign({},t,{},e)}function Cn(t,e){return(e?Object.keys(Sn(Object.assign({},kn,{plugins:e}))):zn).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(t){e[n]=i}return e}),{})}function En(t,e){var n=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Cn(t,e.plugins));return n.aria=Object.assign({},kn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var Mn=function(){return"innerHTML"};function Ln(t,e){t[Mn()]=e}function Hn(t){var e=en();return!0===t?e.className=Be:(e.className=De,nn(t)?e.appendChild(t):Ln(e,t)),e}function Tn(t,e){nn(e.content)?(Ln(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ln(t,e.content):t.textContent=e.content)}function Vn(t){var e=t.firstElementChild,n=Je(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Ne)})),arrow:n.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:n.find((function(t){return t.classList.contains(Fe)}))}}function $n(t){var e=en(),n=en();n.className=Ie,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=en();function r(n,i){var r=Vn(e),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Tn(a,t.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Hn(i.arrow))):o.appendChild(Hn(i.arrow)):s&&o.removeChild(s)}return i.className=Ne,i.setAttribute("data-state","hidden"),Tn(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}$n.$$tippy=!0;var On=1,Pn=[],Rn=[];function In(t,e){var n,i,r,o,a,s,l,c=En(t,Object.assign({},kn,{},Sn(tn(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=On++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:en(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?hn(t):document}function H(){return Vn(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||un.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,kn.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,n){var i;(void 0===n&&(n=!0),z.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(i=_.props)[t].apply(i,e)}function O(){var e=_.props.aria;if(e.content){var n="aria-"+e.content,i=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(_.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Pn=Pn.filter((function(t){return t!==f}))}function I(t){if(!(un.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(un.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var n=H().box;function i(t){t.target===n&&(dn(n,"remove",i),e())}if(0===t)return e();dn(n,"remove",a),dn(n,"add",i),a=i}function W(e,n,i){void 0===i&&(i=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(_n?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function K(t){var e,n=!1;if(_.state.isEnabled&&!J(t)&&!p){var i="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&on(t)&&Pn.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:rt(t),"click"===t.type&&(h=!n),n&&!i&&ot(t)}}function Z(t){var e=t.target,n=M().contains(e)||x.contains(e);"mousemove"===t.type&&n||pn(it().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!un.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Vn(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var n=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function nt(){var t,e=_.props.appendTo,n=M();(t=_.props.interactive&&e===kn.appendTo||"parent"===e?n.parentNode:We(e,[n])).contains(x)||t.appendChild(x),tt()}function it(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),i=S(),r=i[0],o=i[1];un.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?i=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var n=_.props,i=En(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=i,G(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),f=Ge(Z,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ke(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(n,i),_.popperInstance&&(tt(),it().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=un.isTouch&&!_.props.touch,r=qe(_.props.duration,0,kn.duration);if(!(t||e||n||i||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();ln([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),n=e.box,i=e.content;ln([n,i],r),cn([n,i],"visible")}O(),P(),Ze(Rn,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},nt()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=qe(_.props.duration,1,kn.duration);if(!(t||e||n)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(ln([o,a],i),cn([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(i,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Pn,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),it().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Rn=Rn.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Nn(t,e){void 0===e&&(e={});var n=kn.plugins.concat(e.plugins||[]);bn();var i=Object.assign({},e,{plugins:n}),r=sn(t).reduce((function(t,e){var n=e&&In(e,i);return n&&t.push(n),t}),[]);return nn(t)?r[0]:r}Nn.defaultProps=kn,Nn.setDefaultProps=An,Nn.currentInput=un;Object.assign({},xt,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});function Fn(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Nn.setDefaultProps({render:$n});const Bn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Dn='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',jn="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",qn="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",Un="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var Wn=Object.freeze({__proto__:null,camelize:Fn,base:Bn,lightBorder:Dn,light:jn,material:qn,translucent:Un});function Gn(t,e,n){if(!t.querySelector("#pb-popover-"+e)){const i=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,i);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=n,i.appendChild(r)}}function Xn(t,e){if(Gn(t,"base",Bn),e&&"none"!==e){const n=Fn(e),i=Wn[n];i&&Gn(t,n,i)}}class Kn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Xn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const n={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(n.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(n.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");n.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(n.onCreate=t=>{t.popper.classList.add(this.popupClass)}),n.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Nn(e,n)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
|
|
510
|
+
`}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,n,i=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n&&n(t,r)},{once:i})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(n=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n(t)},{once:!0})})}static emit(t,e=null,n=null){const i=n||{};e&&(i.key=e);const r=new CustomEvent(t,{detail:i});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.30.0";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",nt="right",it="left",rt="auto",ot=[tt,et,nt,it],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});bt(i)&&ft(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function St(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var n=Lt(t);bt(n)&&["html","body"].indexOf(ft(n))<0;){var i=Ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function Vt(t){for(var e=mt(t),n=Ht(t);n&&Et(n)&&"static"===Ct(n).position;)n=Ht(n);return n&&("html"===ft(n)||"body"===ft(n)&&"static"===Ct(n).position)?e:n||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,n){return Ot(t,Pt(e,n))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=kt(n.placement),l=$t(s),c=[it,nt].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,n),p=At(o),d="y"===l?tt:it,u="y"===l?et:nt,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],f=a[l]-n.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;n.modifiersData[i]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&St(e.elements.popper,i)&&(e.elements.arrow=i)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:Rt(Rt(e*i)/i)||0,y:Rt(Rt(n*i)/i)||0}}function Gt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=it,b=tt,y=window;if(l){var _=Vt(n),w="clientHeight",x="clientWidth";_===mt(n)&&"static"!==Ct(_=Mt(n)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-i.height,g*=s?1:-1),r===it&&(v=nt,d-=_[x]-i.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,Kt)})),s&&l.addEventListener("resize",n.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Kt)})),s&&l.removeEventListener("resize",n.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ie(t){var e=mt(t),n=Mt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+ne(t),y:s}}function re(t){var e,n=Mt(t),i=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ne(t),l=-i.scrollTop;return"rtl"===Ct(r||n).direction&&(s+=Ot(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var n;void 0===e&&(e=[]);var i=ae(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=mt(i),a=r?[o].concat(o.visualViewport||[],oe(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ie(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),n=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(n)?e.filter((function(t){return vt(t)&&St(t,n)&&"body"!==ft(t)})):[]}function de(t,e,n){var i="clippingParents"===e?pe(t):[].concat(e),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(e,n){var i=he(t,n);return e.top=Ot(i.top,e.top),e.right=Pt(i.right,e.right),e.bottom=Pt(i.bottom,e.bottom),e.left=Ot(i.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case tt:e={x:s,y:n.y-i.height};break;case et:e={x:s,y:n.y+n.height};break;case nt:e={x:n.x+n.width,y:l};break;case it:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(n[h]/2-i[h]/2);break;case st:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.boundary,a=void 0===o?lt:o,s=n.rootBoundary,l=void 0===s?ct:s,c=n.elementContext,h=void 0===c?ht:c,p=n.altBoundary,d=void 0!==p&&p,u=n.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[nt,et].indexOf(t)>=0?1:-1,n=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e}))}return A}function me(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(i),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,n){return e[n]=fe(t,{placement:n,boundary:r,rootBoundary:o,padding:a})[kt(n)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,h=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,g=void 0===u||u,f=n.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,n){return t.concat(kt(n)===rt?me(e,{placement:n,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):n)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?nt:it:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[i]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _e(t){return[tt,nt,et,it].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,i),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,n){var i=kt(t),r=[it,tt].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[it,nt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,n){return t[n]=xe(n,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}function ze(t){var e=t.state,n=t.name;e.modifiersData[n]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,p=n.padding,d=n.tether,u=void 0===d||d,g=n.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:it,E="y"===_?et:nt,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:it,Q="x"===_?et:nt,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[i]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,n){void 0===n&&(n=!1);var i=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&(("body"!==ft(e)||oe(i))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=ne(i))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function He(t){var e=Le(t);return gt.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){h(),r.options=Object.assign({},o,r.options,n),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(i,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,n=t.popper;if(Oe(e,n)){r.rects={reference:Me(e,Vt(n),"fixed"===r.options.strategy),popper:At(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,i=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:i}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function Ue(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,n){return t.indexOf(e)===n}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function tn(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function en(){return document.createElement("div")}function nn(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function rn(t){return Ue(t,"NodeList")}function on(t){return Ue(t,"MouseEvent")}function an(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function sn(t){return nn(t)?[t]:rn(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function ln(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function cn(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function hn(t){var e,n=Ke(t)[0];return(null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function pn(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-i+l>o,u=i-e.bottom-c>o,g=e.left-n+h>o,f=n-e.right-p>o;return d||u||g||f}))}function dn(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}var un={isTouch:!1},gn=0;function fn(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",mn))}function mn(){var t=performance.now();t-gn<20&&(un.isTouch=!1,document.removeEventListener("mousemove",mn)),gn=t}function vn(){var t=document.activeElement;if(an(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bn(){document.addEventListener("touchstart",fn,je),window.addEventListener("blur",vn)}var yn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",_n=/MSIE |Trident\//.test(yn),wn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xn={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kn=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},wn,{},xn),zn=Object.keys(kn),An=function(t){Object.keys(t).forEach((function(e){kn[e]=t[e]}))};function Sn(t){var e=(t.plugins||[]).reduce((function(e,n){var i=n.name,r=n.defaultValue;return i&&(e[i]=void 0!==t[i]?t[i]:r),e}),{});return Object.assign({},t,{},e)}function Cn(t,e){return(e?Object.keys(Sn(Object.assign({},kn,{plugins:e}))):zn).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(t){e[n]=i}return e}),{})}function En(t,e){var n=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Cn(t,e.plugins));return n.aria=Object.assign({},kn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var Mn=function(){return"innerHTML"};function Ln(t,e){t[Mn()]=e}function Hn(t){var e=en();return!0===t?e.className=Be:(e.className=De,nn(t)?e.appendChild(t):Ln(e,t)),e}function Tn(t,e){nn(e.content)?(Ln(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ln(t,e.content):t.textContent=e.content)}function Vn(t){var e=t.firstElementChild,n=Je(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Ne)})),arrow:n.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:n.find((function(t){return t.classList.contains(Fe)}))}}function $n(t){var e=en(),n=en();n.className=Ie,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=en();function r(n,i){var r=Vn(e),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Tn(a,t.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Hn(i.arrow))):o.appendChild(Hn(i.arrow)):s&&o.removeChild(s)}return i.className=Ne,i.setAttribute("data-state","hidden"),Tn(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}$n.$$tippy=!0;var On=1,Pn=[],Rn=[];function In(t,e){var n,i,r,o,a,s,l,c=En(t,Object.assign({},kn,{},Sn(tn(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=On++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:en(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?hn(t):document}function H(){return Vn(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||un.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,kn.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,n){var i;(void 0===n&&(n=!0),z.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(i=_.props)[t].apply(i,e)}function O(){var e=_.props.aria;if(e.content){var n="aria-"+e.content,i=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(_.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Pn=Pn.filter((function(t){return t!==f}))}function I(t){if(!(un.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(un.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var n=H().box;function i(t){t.target===n&&(dn(n,"remove",i),e())}if(0===t)return e();dn(n,"remove",a),dn(n,"add",i),a=i}function W(e,n,i){void 0===i&&(i=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(_n?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function K(t){var e,n=!1;if(_.state.isEnabled&&!J(t)&&!p){var i="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&on(t)&&Pn.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:rt(t),"click"===t.type&&(h=!n),n&&!i&&ot(t)}}function Z(t){var e=t.target,n=M().contains(e)||x.contains(e);"mousemove"===t.type&&n||pn(it().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!un.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Vn(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var n=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function nt(){var t,e=_.props.appendTo,n=M();(t=_.props.interactive&&e===kn.appendTo||"parent"===e?n.parentNode:We(e,[n])).contains(x)||t.appendChild(x),tt()}function it(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),i=S(),r=i[0],o=i[1];un.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?i=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var n=_.props,i=En(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=i,G(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),f=Ge(Z,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ke(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(n,i),_.popperInstance&&(tt(),it().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=un.isTouch&&!_.props.touch,r=qe(_.props.duration,0,kn.duration);if(!(t||e||n||i||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();ln([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),n=e.box,i=e.content;ln([n,i],r),cn([n,i],"visible")}O(),P(),Ze(Rn,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},nt()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=qe(_.props.duration,1,kn.duration);if(!(t||e||n)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(ln([o,a],i),cn([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(i,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Pn,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),it().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Rn=Rn.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Nn(t,e){void 0===e&&(e={});var n=kn.plugins.concat(e.plugins||[]);bn();var i=Object.assign({},e,{plugins:n}),r=sn(t).reduce((function(t,e){var n=e&&In(e,i);return n&&t.push(n),t}),[]);return nn(t)?r[0]:r}Nn.defaultProps=kn,Nn.setDefaultProps=An,Nn.currentInput=un;Object.assign({},xt,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});function Fn(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Nn.setDefaultProps({render:$n});const Bn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Dn='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',jn="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",qn="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",Un="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var Wn=Object.freeze({__proto__:null,camelize:Fn,base:Bn,lightBorder:Dn,light:jn,material:qn,translucent:Un});function Gn(t,e,n){if(!t.querySelector("#pb-popover-"+e)){const i=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,i);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=n,i.appendChild(r)}}function Xn(t,e){if(Gn(t,"base",Bn),e&&"none"!==e){const n=Fn(e),i=Wn[n];i&&Gn(t,n,i)}}class Kn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Xn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const n={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(n.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(n.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");n.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(n.onCreate=t=>{t.popper.classList.add(this.popupClass)}),n.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Nn(e,n)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
|
|
511
511
|
:host {
|
|
512
512
|
display: inline;
|
|
513
513
|
}
|
|
@@ -1087,7 +1087,7 @@ e({_template:n`
|
|
|
1087
1087
|
:host {
|
|
1088
1088
|
display: block;
|
|
1089
1089
|
}
|
|
1090
|
-
`}}customElements.define("pb-select-feature",Gr);var Xr={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Kr={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Zr=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Qr={CSS:{},springs:{}};function Yr(t,e,n){return Math.min(Math.max(t,e),n)}function Jr(t,e){return t.indexOf(e)>-1}function to(t,e){return t.apply(null,e)}var eo={arr:function(t){return Array.isArray(t)},obj:function(t){return Jr(Object.prototype.toString.call(t),"Object")},pth:function(t){return eo.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||eo.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return eo.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return eo.hex(t)||eo.rgb(t)||eo.hsl(t)},key:function(t){return!Xr.hasOwnProperty(t)&&!Kr.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function no(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function io(t,e){var n=no(t),i=Yr(eo.und(n[0])?1:n[0],.1,100),r=Yr(eo.und(n[1])?100:n[1],.1,100),o=Yr(eo.und(n[2])?10:n[2],.1,100),a=Yr(eo.und(n[3])?0:n[3],.1,100),s=Math.sqrt(r/i),l=o/(2*Math.sqrt(r*i)),c=l<1?s*Math.sqrt(1-l*l):0,h=1,p=l<1?(l*s-a)/c:-a+s;function d(t){var n=e?e*t/1e3:t;return n=l<1?Math.exp(-n*l*s)*(h*Math.cos(c*n)+p*Math.sin(c*n)):(h+p*n)*Math.exp(-n*s),0===t||1===t?t:1-n}function u(){var e=Qr.springs[t];if(e)return e;for(var n=1/6,i=0,r=0;;)if(1===d(i+=n)){if(++r>=16)break}else r=0;var o=i*n*1e3;return Qr.springs[t]=o,o}return e?d:u}function ro(t){return void 0===t&&(t=10),function(e){return Math.ceil(Yr(e,1e-6,1)*t)*(1/t)}}var oo,ao,so=function(){var t=11,e=1/(t-1);function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function r(t){return 3*t}function o(t,e,o){return((n(e,o)*t+i(e,o))*t+r(e))*t}function a(t,e,o){return 3*n(e,o)*t*t+2*i(e,o)*t+r(e)}function s(t,e,n,i,r){var a,s,l=0;do{(a=o(s=e+(n-e)/2,i,r)-t)>0?n=s:e=s}while(Math.abs(a)>1e-7&&++l<10);return s}function l(t,e,n,i){for(var r=0;r<4;++r){var s=a(e,n,i);if(0===s)return e;e-=(o(e,n,i)-t)/s}return e}function c(n,i,r,c){if(0<=n&&n<=1&&0<=r&&r<=1){var h=new Float32Array(t);if(n!==i||r!==c)for(var p=0;p<t;++p)h[p]=o(p*e,n,r);return function(t){return n===i&&r===c||0===t||1===t?t:o(d(t),i,c)}}function d(i){for(var o=0,c=1,p=t-1;c!==p&&h[c]<=i;++c)o+=e;--c;var d=o+(i-h[c])/(h[c+1]-h[c])*e,u=a(d,n,r);return u>=.001?l(i,d,n,r):0===u?d:s(i,o,o+e,n,r)}}return c}(),lo=(oo={linear:function(){return function(t){return t}}},ao={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var n=Yr(t,1,10),i=Yr(e,.1,2);return function(t){return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-i/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/i)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){ao[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(ao).forEach((function(t){var e=ao[t];oo["easeIn"+t]=e,oo["easeOut"+t]=function(t,n){return function(i){return 1-e(t,n)(1-i)}},oo["easeInOut"+t]=function(t,n){return function(i){return i<.5?e(t,n)(2*i)/2:1-e(t,n)(-2*i+2)/2}},oo["easeOutIn"+t]=function(t,n){return function(i){return i<.5?(1-e(t,n)(1-2*i))/2:(e(t,n)(2*i-1)+1)/2}}})),oo);function co(t,e){if(eo.fnc(t))return t;var n=t.split("(")[0],i=lo[n],r=no(t);switch(n){case"spring":return io(t,e);case"cubicBezier":return to(so,r);case"steps":return to(ro,r);default:return to(i,r)}}function ho(t){try{return document.querySelectorAll(t)}catch(t){return}}function po(t,e){for(var n=t.length,i=arguments.length>=2?arguments[1]:void 0,r=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(i,a,o,t)&&r.push(a)}return r}function uo(t){return t.reduce((function(t,e){return t.concat(eo.arr(e)?uo(e):e)}),[])}function go(t){return eo.arr(t)?t:(eo.str(t)&&(t=ho(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function fo(t,e){return t.some((function(t){return t===e}))}function mo(t){var e={};for(var n in t)e[n]=t[n];return e}function vo(t,e){var n=mo(t);for(var i in t)n[i]=e.hasOwnProperty(i)?e[i]:t[i];return n}function bo(t,e){var n=mo(t);for(var i in e)n[i]=eo.und(t[i])?e[i]:t[i];return n}function yo(t){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);return e?"rgba("+e[1]+",1)":t}function _o(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=t.replace(e,(function(t,e,n,i){return e+e+n+n+i+i})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}function wo(t){var e,n,i,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),o=parseInt(r[1],10)/360,a=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100,l=r[4]||1;function c(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0==a)e=n=i=s;else{var h=s<.5?s*(1+a):s+a-s*a,p=2*s-h;e=c(p,h,o+1/3),n=c(p,h,o),i=c(p,h,o-1/3)}return"rgba("+255*e+","+255*n+","+255*i+","+l+")"}function xo(t){return eo.rgb(t)?yo(t):eo.hex(t)?_o(t):eo.hsl(t)?wo(t):void 0}function ko(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function zo(t){return Jr(t,"translate")||"perspective"===t?"px":Jr(t,"rotate")||Jr(t,"skew")?"deg":void 0}function Ao(t,e){return eo.fnc(t)?t(e.target,e.id,e.total):t}function So(t,e){return t.getAttribute(e)}function Co(t,e,n){if(fo([n,"deg","rad","turn"],ko(e)))return e;var i=Qr.CSS[e+n];if(!eo.und(i))return i;var r=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=r+n;var s=r/o.offsetWidth;a.removeChild(o);var l=s*parseFloat(e);return Qr.CSS[e+n]=l,l}function Eo(t,e,n){if(e in t.style){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=t.style[e]||getComputedStyle(t).getPropertyValue(i)||"0";return n?Co(t,r,n):r}}function Mo(t,e){return eo.dom(t)&&!eo.inp(t)&&(!eo.nil(So(t,e))||eo.svg(t)&&t[e])?"attribute":eo.dom(t)&&fo(Zr,e)?"transform":eo.dom(t)&&"transform"!==e&&Eo(t,e)?"css":null!=t[e]?"object":void 0}function Lo(t){if(eo.dom(t)){for(var e,n=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map;e=i.exec(n);)r.set(e[1],e[2]);return r}}function Ho(t,e,n,i){var r=Jr(e,"scale")?1:0+zo(e),o=Lo(t).get(e)||r;return n&&(n.transforms.list.set(e,o),n.transforms.last=e),i?Co(t,o,i):o}function To(t,e,n,i){switch(Mo(t,e)){case"transform":return Ho(t,e,i,n);case"css":return Eo(t,e,n);case"attribute":return So(t,e);default:return t[e]||0}}function Vo(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var i=ko(t)||0,r=parseFloat(e),o=parseFloat(t.replace(n[0],""));switch(n[0][0]){case"+":return r+o+i;case"-":return r-o+i;case"*":return r*o+i}}function $o(t,e){if(eo.col(t))return xo(t);if(/\s/g.test(t))return t;var n=ko(t),i=n?t.substr(0,t.length-n.length):t;return e?i+e:i}function Oo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Po(t){return 2*Math.PI*So(t,"r")}function Ro(t){return 2*So(t,"width")+2*So(t,"height")}function Io(t){return Oo({x:So(t,"x1"),y:So(t,"y1")},{x:So(t,"x2"),y:So(t,"y2")})}function No(t){for(var e,n=t.points,i=0,r=0;r<n.numberOfItems;r++){var o=n.getItem(r);r>0&&(i+=Oo(e,o)),e=o}return i}function Fo(t){var e=t.points;return No(t)+Oo(e.getItem(e.numberOfItems-1),e.getItem(0))}function Bo(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return Po(t);case"rect":return Ro(t);case"line":return Io(t);case"polyline":return No(t);case"polygon":return Fo(t)}}function Do(t){var e=Bo(t);return t.setAttribute("stroke-dasharray",e),e}function jo(t){for(var e=t.parentNode;eo.svg(e)&&eo.svg(e.parentNode);)e=e.parentNode;return e}function qo(t,e){var n=e||{},i=n.el||jo(t),r=i.getBoundingClientRect(),o=So(i,"viewBox"),a=r.width,s=r.height,l=n.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:i,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:s,vW:l[2],vH:l[3]}}function Uo(t,e){var n=eo.str(t)?ho(t)[0]:t,i=e||100;return function(t){return{property:t,el:n,svg:qo(n),totalLength:Bo(n)*(i/100)}}}function Wo(t,e,n){function i(n){void 0===n&&(n=0);var i=e+n>=1?e+n:0;return t.el.getPointAtLength(i)}var r=qo(t.el,t.svg),o=i(),a=i(-1),s=i(1),l=n?1:r.w/r.vW,c=n?1:r.h/r.vH;switch(t.property){case"x":return(o.x-r.x)*l;case"y":return(o.y-r.y)*c;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function Go(t,e){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,i=$o(eo.pth(t)?t.totalLength:t,e)+"";return{original:i,numbers:i.match(n)?i.match(n).map(Number):[0],strings:eo.str(t)||e?i.split(n):[]}}function Xo(t){return po(t?uo(eo.arr(t)?t.map(go):go(t)):[],(function(t,e,n){return n.indexOf(t)===e}))}function Ko(t){var e=Xo(t);return e.map((function(t,n){return{target:t,id:n,total:e.length,transforms:{list:Lo(t)}}}))}function Zo(t,e){var n=mo(e);if(/^spring/.test(n.easing)&&(n.duration=io(n.easing)),eo.arr(t)){var i=t.length;2===i&&!eo.obj(t[0])?t={value:t}:eo.fnc(e.duration)||(n.duration=e.duration/i)}var r=eo.arr(t)?t:[t];return r.map((function(t,n){var i=eo.obj(t)&&!eo.pth(t)?t:{value:t};return eo.und(i.delay)&&(i.delay=n?0:e.delay),eo.und(i.endDelay)&&(i.endDelay=n===r.length-1?e.endDelay:0),i})).map((function(t){return bo(t,n)}))}function Qo(t){for(var e=po(uo(t.map((function(t){return Object.keys(t)}))),(function(t){return eo.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),n={},i=function(i){var r=e[i];n[r]=t.map((function(t){var e={};for(var n in t)eo.key(n)?n==r&&(e.value=t[n]):e[n]=t[n];return e}))},r=0;r<e.length;r++)i(r);return n}function Yo(t,e){var n=[],i=e.keyframes;for(var r in i&&(e=bo(Qo(i),e)),e)eo.key(r)&&n.push({name:r,tweens:Zo(e[r],t)});return n}function Jo(t,e){var n={};for(var i in t){var r=Ao(t[i],e);eo.arr(r)&&1===(r=r.map((function(t){return Ao(t,e)}))).length&&(r=r[0]),n[i]=r}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function ta(t,e){var n;return t.tweens.map((function(i){var r=Jo(i,e),o=r.value,a=eo.arr(o)?o[1]:o,s=ko(a),l=To(e.target,t.name,s,e),c=n?n.to.original:l,h=eo.arr(o)?o[0]:c,p=ko(h)||ko(l),d=s||p;return eo.und(a)&&(a=c),r.from=Go(h,d),r.to=Go(Vo(a,h),d),r.start=n?n.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=co(r.easing,r.duration),r.isPath=eo.pth(o),r.isPathTargetInsideSVG=r.isPath&&eo.svg(e.target),r.isColor=eo.col(r.from.original),r.isColor&&(r.round=1),n=r,r}))}var ea={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,i,r){if(i.list.set(e,n),e===i.last||r){var o="";i.list.forEach((function(t,e){o+=e+"("+t+") "})),t.style.transform=o}}};function na(t,e){Ko(t).forEach((function(t){for(var n in e){var i=Ao(e[n],t),r=t.target,o=ko(i),a=To(r,n,o,t),s=Vo($o(i,o||ko(a)),a),l=Mo(r,n);ea[l](r,n,s,t.transforms,!0)}}))}function ia(t,e){var n=Mo(t.target,e.name);if(n){var i=ta(e,t),r=i[i.length-1];return{type:n,property:e.name,animatable:t,tweens:i,duration:r.end,delay:i[0].delay,endDelay:r.endDelay}}}function ra(t,e){return po(uo(t.map((function(t){return e.map((function(e){return ia(t,e)}))}))),(function(t){return!eo.und(t)}))}function oa(t,e){var n=t.length,i=function(t){return t.timelineOffset?t.timelineOffset:0},r={};return r.duration=n?Math.max.apply(Math,t.map((function(t){return i(t)+t.duration}))):e.duration,r.delay=n?Math.min.apply(Math,t.map((function(t){return i(t)+t.delay}))):e.delay,r.endDelay=n?r.duration-Math.max.apply(Math,t.map((function(t){return i(t)+t.duration-t.endDelay}))):e.endDelay,r}var aa=0;function sa(t){var e=vo(Xr,t),n=vo(Kr,t),i=Yo(n,t),r=Ko(t.targets),o=ra(r,i),a=oa(o,n),s=aa;return aa++,bo(e,{id:s,children:[],animatables:r,animations:o,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}var la=[],ca=function(){var t;function e(){t||ha()&&pa.suspendWhenDocumentHidden||!(la.length>0)||(t=requestAnimationFrame(n))}function n(e){for(var i=la.length,r=0;r<i;){var o=la[r];o.paused?(la.splice(r,1),i--):(o.tick(e),r++)}t=r>0?requestAnimationFrame(n):void 0}function i(){pa.suspendWhenDocumentHidden&&(ha()?t=cancelAnimationFrame(t):(la.forEach((function(t){return t._onDocumentVisibility()})),ca()))}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",i),e}();function ha(){return!!document&&document.hidden}function pa(t){void 0===t&&(t={});var e,n=0,i=0,r=0,o=0,a=null;function s(t){var e=window.Promise&&new Promise((function(t){return a=t}));return t.finished=e,e}var l=sa(t);s(l);function c(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(t){return t.reversed=l.reversed}))}function h(t){return l.reversed?l.duration-t:t}function p(){n=0,i=h(l.currentTime)*(1/pa.speed)}function d(t,e){e&&e.seek(t-e.timelineOffset)}function u(t){if(l.reversePlayback)for(var n=o;n--;)d(t,e[n]);else for(var i=0;i<o;i++)d(t,e[i])}function g(t){for(var e=0,n=l.animations,i=n.length;e<i;){var r=n[e],o=r.animatable,a=r.tweens,s=a.length-1,c=a[s];s&&(c=po(a,(function(e){return t<e.end}))[0]||c);for(var h=Yr(t-c.start-c.delay,0,c.duration)/c.duration,p=isNaN(h)?1:c.easing(h),d=c.to.strings,u=c.round,g=[],f=c.to.numbers.length,m=void 0,v=0;v<f;v++){var b=void 0,y=c.to.numbers[v],_=c.from.numbers[v]||0;b=c.isPath?Wo(c.value,p*y,c.isPathTargetInsideSVG):_+p*(y-_),u&&(c.isColor&&v>2||(b=Math.round(b*u)/u)),g.push(b)}var w=d.length;if(w){m=d[0];for(var x=0;x<w;x++){d[x];var k=d[x+1],z=g[x];isNaN(z)||(m+=k?z+k:z+" ")}}else m=g[0];ea[r.type](o.target,r.property,m,o.transforms),r.currentValue=m,e++}}function f(t){l[t]&&!l.passThrough&&l[t](l)}function m(){l.remaining&&!0!==l.remaining&&l.remaining--}function v(t){var o=l.duration,p=l.delay,d=o-l.endDelay,v=h(t);l.progress=Yr(v/o*100,0,100),l.reversePlayback=v<l.currentTime,e&&u(v),!l.began&&l.currentTime>0&&(l.began=!0,f("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,f("loopBegin")),v<=p&&0!==l.currentTime&&g(0),(v>=d&&l.currentTime!==o||!o)&&g(o),v>p&&v<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,f("changeBegin")),f("change"),g(v)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,f("changeComplete")),l.currentTime=Yr(v,0,o),l.began&&f("update"),t>=o&&(i=0,m(),l.remaining?(n=r,f("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&c()):(l.paused=!0,l.completed||(l.completed=!0,f("loopComplete"),f("complete"),!l.passThrough&&"Promise"in window&&(a(),s(l)))))}return l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop,e=l.children;for(var n=o=e.length;n--;)l.children[n].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,g(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(t,e){return na(t,e),l},l.tick=function(t){r=t,n||(n=r),v((r+(i-n))*pa.speed)},l.seek=function(t){v(h(t))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,la.push(l),p(),ca())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){ua(Xo(t),l)},l.reset(),l.autoplay&&l.play(),l}function da(t,e){for(var n=e.length;n--;)fo(t,e[n].animatable.target)&&e.splice(n,1)}function ua(t,e){var n=e.animations,i=e.children;da(t,n);for(var r=i.length;r--;){var o=i[r],a=o.animations;da(t,a),a.length||o.children.length||i.splice(r,1)}n.length||i.length||e.pause()}function ga(t){for(var e=Xo(t),n=la.length;n--;){ua(e,la[n])}}function fa(t,e){void 0===e&&(e={});var n=e.direction||"normal",i=e.easing?co(e.easing):null,r=e.grid,o=e.axis,a=e.from||0,s="first"===a,l="center"===a,c="last"===a,h=eo.arr(t),p=h?parseFloat(t[0]):parseFloat(t),d=h?parseFloat(t[1]):0,u=ko(h?t[1]:t)||0,g=e.start||0+(h?p:0),f=[],m=0;return function(t,e,v){if(s&&(a=0),l&&(a=(v-1)/2),c&&(a=v-1),!f.length){for(var b=0;b<v;b++){if(r){var y=l?(r[0]-1)/2:a%r[0],_=l?(r[1]-1)/2:Math.floor(a/r[0]),w=y-b%r[0],x=_-Math.floor(b/r[0]),k=Math.sqrt(w*w+x*x);"x"===o&&(k=-w),"y"===o&&(k=-x),f.push(k)}else f.push(Math.abs(a-b));m=Math.max.apply(Math,f)}i&&(f=f.map((function(t){return i(t/m)*m}))),"reverse"===n&&(f=f.map((function(t){return o?t<0?-1*t:-t:Math.abs(m-t)})))}return g+(h?(d-p)/m:p)*(Math.round(100*f[e])/100)+u}}function ma(t){void 0===t&&(t={});var e=pa(t);return e.duration=0,e.add=function(n,i){var r=la.indexOf(e),o=e.children;function a(t){t.passThrough=!0}r>-1&&la.splice(r,1);for(var s=0;s<o.length;s++)a(o[s]);var l=bo(n,vo(Kr,t));l.targets=l.targets||t.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=eo.und(i)?c:Vo(i,c),a(e),e.seek(l.timelineOffset);var h=pa(l);a(h),o.push(h);var p=oa(o,t);return e.delay=p.delay,e.endDelay=p.endDelay,e.duration=p.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}pa.version="3.2.1",pa.speed=1,pa.suspendWhenDocumentHidden=!0,pa.running=la,pa.remove=ga,pa.get=To,pa.set=na,pa.convertPx=Co,pa.path=Uo,pa.setDashoffset=Do,pa.stagger=fa,pa.timeline=ma,pa.easing=co,pa.penner=lo,pa.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t};class va extends(R(V)){static get properties(){return Object.assign({src:{type:String},odd:{type:String,reflect:!0},view:{type:String,reflect:!0},nodeId:{type:String,reflect:!0,attribute:"node-id"},xmlId:{type:Array,reflect:!0,attribute:"xml-id"},xpath:{type:String,reflect:!0},map:{type:String},onUpdate:{type:Boolean,attribute:"on-update"},notFound:{type:String,attribute:"not-found"},url:{type:String},appendFootnotes:{type:Boolean,attribute:"append-footnotes"},suppressHighlight:{type:Boolean,attribute:"suppress-highlight",reflect:!0},columnSeparator:{type:String,attribute:"column-separator"},direction:{type:String},loadCss:{type:String,attribute:"load-css"},fixLinks:{type:Boolean,attribute:"fix-links"},useLanguage:{type:Boolean,attribute:"use-language"},animation:{type:Boolean},infiniteScroll:{type:Boolean,attribute:"infinite-scroll"},infiniteScrollMax:{type:Number,attribute:"infinite-scroll-max"},waitFor:{type:String,attribute:"wait-for"},disableHistory:{type:Boolean,attribute:"disable-history"},_features:{type:Object},_content:{type:Node,attribute:!1},_column1:{type:Node,attribute:!1},_column2:{type:Node,attribute:!1},_footnotes:{type:Node,attribute:!1},_style:{type:Node,attribute:!1}},super.properties)}constructor(){super(),this.src=null,this.url=null,this.onUpdate=!1,this.appendFootnotes=!1,this.notFound="the server did not return any content",this.animation=!1,this.direction="ltr",this.suppressHighlight=!1,this.highlight=!1,this.infiniteScrollMax=10,this.disableHistory=!1,this._features={},this._selector=new Map,this._chunks=[],this._scrollTarget=null}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"src":this._updateSource(n,e)}}connectedCallback(){if(super.connectedCallback(),this.infiniteScroll&&(this.columnSeparator=null,this.animation=!1,this._content=document.createElement("div"),this._content.className="infinite-content"),!this.disableHistory){const t=this.getParameter("id");t&&!this.xmlId&&(this.xmlId=t);const e=this.getParameter("action");e&&"search"===e&&(this.highlight=!0);const n=this.getParameter("root");"single"===this.view?this.nodeId=null:n&&!this.nodeId&&(this.nodeId=n)}this.waitFor||(this.waitFor="pb-toggle-feature,pb-select-feature,pb-navigation"),this.subscribeTo("pb-navigate",t=>{t.detail.source&&t.detail.source===this||this.navigate(t.detail.direction)}),this.subscribeTo("pb-refresh",this._refresh.bind(this)),this.subscribeTo("pb-toggle",t=>{this.toggleFeature(t)}),this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)}),this.subscribeTo("pb-i18n-update",t=>{const e=this._features.language&&this._features.language!==t.detail.language;this._features.language=t.detail.language,this.useLanguage&&e&&this._refresh()},[]),this.signalReady(),this.onUpdate&&this.subscribeTo("pb-update",this._refresh.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this._scrollObserver&&this._scrollObserver.disconnect()}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!0),this.infiniteScroll&&(this._topObserver=this.shadowRoot.getElementById("top-observer"),this._bottomObserver=this.shadowRoot.getElementById("bottom-observer"),this._bottomObserver.style.display="none",this._topObserver.style.display="none",this._scrollObserver=new IntersectionObserver(t=>{this._content&&t.forEach(t=>{if(t.isIntersecting)if("bottom-observer"===t.target.id){const t=this._content.lastElementChild;if(t){const e=t.getAttribute("data-next");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(console.log("<pb-view> Loading next page: %s",e),this._checkChunks("forward"),this._load(e,"forward"))}}else{const t=this._content.firstElementChild;if(t){const e=t.getAttribute("data-previous");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(this._checkChunks("backward"),this._load(e,"backward"))}}})})),this.onUpdate||va.waitOnce("pb-page-ready",t=>{t&&t.language&&(this._features.language=t.language),this.wait(()=>this._refresh())})}getOdd(){return this.odd||this.getDocument().odd||"teipublisher"}getView(){return this.view||this.getDocument().view||"single"}forceUpdate(){this._load(this.nodeId)}animate(){this.animation&&("forward"===this.lastDirection?pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[1e3,0],duration:300,easing:"linear"}):pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[-1e3,0],duration:300,easing:"linear"}))}enableScrollbar(t){t?this.classList.add("noscroll"):this.classList.remove("noscroll")}_refresh(t){if(t&&t.detail){if(t.detail.path){this.getDocument().path=t.detail.path}t.detail.id&&(this.xmlId=t.detail.id),this.odd=t.detail.odd||this.odd,void 0!==t.detail.columnSeparator&&(this.columnSeparator=t.detail.columnSeparator),this.view=t.detail.view||this.view,null===t.detail.position?this.nodeId=null:this.nodeId=t.detail.position||this.nodeId,this._scrollTarget=t.detail.hash}this._updateStyles(),this.infiniteScroll&&this._clear(),this._load(this.nodeId)}_load(t,e){if(!this.getDocument().path)return void console.log("No path");if(this._loading)return;this._loading=!0;const n=this.getParameters(t);e&&(n._dir=e),this._doLoad(n)}_doLoad(t){this.emitTo("pb-start-update",t),console.log("<pb-view> Loading view with params %o",t),this.infiniteScroll||this._clear(),this._scrollObserver&&(this._bottomObserver&&this._scrollObserver.unobserve(this._bottomObserver),this._topObserver&&this._scrollObserver.unobserve(this._topObserver));const e=this.shadowRoot.getElementById("loadContent");this.url||(this.minApiVersion("1.0.0")?this.url="api/parts":this.url="modules/lib/components.xql"),this.minApiVersion("1.0.0")?e.url=`${this.getEndpoint()}/${this.url}/${encodeURIComponent(this.getDocument().path)}/json`:e.url=`${this.getEndpoint()}/${this.url}`,e.params=t,e.generateRequest()}_clear(){this.infiniteScroll?(this._content=document.createElement("div"),this._content.className="infinite-content"):this._content=null,this._column1=null,this._column2=null,this._footnotes=null,this._chunks=[]}_handleError(){this._clear();const t=this.shadowRoot.getElementById("loadContent");let e;const{response:n}=t.lastError;e=n?n.description:'<pb-i18n key="dialogs.serverError"></pb-i18n>';const i=`\n <p>${this.notFound}</p>\n <p><pb-i18n key="dialogs.serverError"></pb-i18n>: ${e} </p>\n `;this._replaceContent({content:i}),this.emitTo("pb-end-update")}_handleContent(){const t=this.shadowRoot.getElementById("loadContent"),e=t.lastResponse;if(e){if(e.error)return this.notFound&&(this._content=this.notFound),void this.emitTo("pb-end-update",null);this._replaceContent(e,t.params._dir),this.animate(),this._scrollTarget&&this.updateComplete.then(()=>{const t=this.shadowRoot.getElementById(this._scrollTarget)||this.shadowRoot.querySelector(`[node-id="${this._scrollTarget}"]`);t&&setTimeout(()=>{t.scrollIntoView()}),this._scrollTarget=null}),this.next=e.next,this.nextId=e.nextId,this.previous=e.previous,this.previousId=e.previousId,this.nodeId=e.root,this.switchView=e.switchView,this.disableHistory||!this.xmlId||this.map||(this.setParameter("id",this.xmlId),this.pushHistory("Navigate to xml:id")),this.xmlId=null,this.updateComplete.then(()=>{const n=this.shadowRoot.getElementById("view");this._applyToggles(n),this._fixLinks(n),ii(n);const i={data:e,root:n,params:t.params,id:this.xmlId,position:this.nodeId};this.emitTo("pb-update",i),this._scroll()}),this.emitTo("pb-end-update",null)}else console.error("<pb-view> No response received")}_replaceContent(t,e){const n=document.createDocumentFragment(),i=document.createElement("div");if(n.appendChild(i),i.innerHTML=t.content,this.columnSeparator)this._replaceColumns(i),this._loading=!1;else if(this.infiniteScroll){let n;switch(i.className="scroll-fragment",i.setAttribute("data-root",t.root),t.next&&i.setAttribute("data-next",t.next),t.previous&&i.setAttribute("data-previous",t.previous),e){case"backward":n=this._content.firstElementChild,this._chunks.unshift(i),this.updateComplete.then(()=>{n.scrollIntoView(!0),this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._content.insertBefore(i,n);break;default:this.updateComplete.then(()=>{this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._chunks.push(i),this._content.appendChild(i)}}else this._content=i,this._loading=!1;if(this.appendFootnotes){const e=document.createElement("div");t.footnotes&&(e.innerHTML=t.footnotes),this._footnotes=e}return this._initFootnotes(this._footnotes),i}_checkVisibility(){const t=this._chunks[this._chunks.length-1].hasAttribute("data-next");this._bottomObserver.style.display=t?"":"none";const e=this._chunks[0].hasAttribute("data-previous");this._topObserver.style.display=e?"":"none"}_replaceColumns(t){let e;if(this.columnSeparator){const n=t.querySelectorAll(this.columnSeparator);n.length>0&&(e=n[n.length-1])}if(e){const n=this._getFragmentBefore(t,e),i=this._getFragmentAfter(t,e);"ltr"===this.direction?(this._column1=n,this._column2=i):(this._column2=n,this._column1=i)}else this._content=t}_scroll(){const{hash:t}=this.getUrl();if(t){const e=this.shadowRoot.getElementById(t.substring(1));console.log("hash target: %o",e),e&&e.scrollIntoView({block:"center",inline:"nearest"})}}_scrollToElement(t,e){const n=this.shadowRoot.getElementById(e.hash.substring(1));n&&(t.preventDefault(),console.log("<pb-view> Scrolling to element %s",n.id),n.scrollIntoView({block:"center",inline:"nearest"}))}_updateStyles(){const t=[];let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/transform/${this.getOdd()}.css`),t.push(e),this.loadCss&&(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/${this.loadCss}`),t.push(e)),this._style=t}_fixLinks(t){if(this.fixLinks){const e=this.getDocument(),n=this.toAbsoluteURL(e.path);t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src"),i=new URL(e,n);t.src=i}),t.querySelectorAll("a").forEach(t=>{const e=t.getAttribute("href");if(e===t.hash)t.addEventListener("click",e=>this._scrollToElement(e,t));else{const i=new URL(e,n);t.href=i}})}else t.querySelectorAll("a").forEach(t=>{t.getAttribute("href")===t.hash&&t.addEventListener("click",e=>this._scrollToElement(e,t))})}_initFootnotes(t){t&&t.querySelectorAll(".note, .fn-back").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const n=this.shadowRoot.getElementById("content").querySelector(t.hash);n&&n.scrollIntoView()})})}_getParameters(){const t=[];this.querySelectorAll("pb-param").forEach((function(e){t["user."+e.getAttribute("name")]=e.getAttribute("value")}));for(const[e,n]of Object.entries(this._features))t["user."+e]=n;return t}getParameters(t){t=t||this.nodeId;const e=this.getDocument(),n=this._getParameters();return this.minApiVersion("1.0.0")||(n.doc=e.path),n.odd=this.getOdd()+".odd",n.view=this.getView(),t&&(n.root=t),this.xpath&&(n.xpath=this.xpath),this.xmlId&&(n.id=this.xmlId),!this.suppressHighlight&&this.highlight&&(n.highlight="yes"),this.map&&(n.map=this.map),n}_applyToggles(t){0!==this._selector.size&&this._selector.forEach((e,n)=>{t.querySelectorAll(n).forEach(t=>{const n=e.command||"toggle";t.command&&t.command(n,e.state),e.state?t.classList.add(n):t.classList.remove(n)})})}goto(t){this._load(t)}gotoId(t){this.xmlId=t,this._load()}navigate(t){this.lastDirection=t,"backward"===t?this.previous&&(this.disableHistory||this.map||(this.previousId?this.setParameter("id",this.previousId):this.setParameter("root",this.previous),this.pushHistory("Navigate backward")),this._load(this.previous,t)):this.next&&(this.disableHistory||this.map||(this.nextId?this.setParameter("id",this.nextId):this.setParameter("root",this.next),this.pushHistory("Navigate forward")),this._load(this.next,t))}_checkChunks(t){if(this.infiniteScroll&&0!==this.infiniteScrollMax){if(this._chunks.length===this.infiniteScrollMax)switch(t){case"forward":this._content.removeChild(this._chunks.shift());break;default:this._content.removeChild(this._chunks.pop())}this.emitTo("pb-navigate",{direction:t,source:this})}}zoom(t){const e=this.shadowRoot.getElementById("view"),n=window.getComputedStyle(e).getPropertyValue("font-size"),i=parseInt(n.replace(/^(\d+)px/,"$1"));e.style.fontSize="in"===t?i+1+"px":i-1+"px"}toggleFeature(t){const e=()=>{const t=this.shadowRoot.getElementById("view");this._applyToggles(t)},n=t.detail.properties;for(const[t,e]of Object.entries(n))switch(t){case"odd":case"view":case"columnSeparator":case"xpath":case"nodeId":break;default:this._features[t]=e}n&&(n.odd&&(this.odd=n.odd),n.view&&(this.view=n.view,"single"===this.view?this.nodeId=null:this.nodeId=this.switchView),n.xpath&&(this.xpath=n.xpath),n.hasOwnProperty("columnSeparator")&&(this.columnSeparator=n.columnSeparator)),t.detail.selectors&&t.detail.selectors.forEach(t=>{this._selector.set(t.selector,{state:t.state,command:t.command||"toggle"})}),"refresh"===t.detail.action&&(Object.keys(n).length>0?(this._updateStyles(),this._load()):e())}_getFragmentBefore(t,e){const n=document.createRange();return n.setStartBefore(t),n.setEndBefore(e),n.cloneContents()}_getFragmentAfter(t,e){const n=document.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.cloneContents()}_updateSource(t,e){void 0!==e&&t!==e&&(this.xpath=null,this.odd=null,this.xmlId=null,this.nodeId=null)}static get styles(){return P`
|
|
1090
|
+
`}}customElements.define("pb-select-feature",Gr);var Xr={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},Kr={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Zr=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Qr={CSS:{},springs:{}};function Yr(t,e,n){return Math.min(Math.max(t,e),n)}function Jr(t,e){return t.indexOf(e)>-1}function to(t,e){return t.apply(null,e)}var eo={arr:function(t){return Array.isArray(t)},obj:function(t){return Jr(Object.prototype.toString.call(t),"Object")},pth:function(t){return eo.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||eo.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return eo.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return eo.hex(t)||eo.rgb(t)||eo.hsl(t)},key:function(t){return!Xr.hasOwnProperty(t)&&!Kr.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function no(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function io(t,e){var n=no(t),i=Yr(eo.und(n[0])?1:n[0],.1,100),r=Yr(eo.und(n[1])?100:n[1],.1,100),o=Yr(eo.und(n[2])?10:n[2],.1,100),a=Yr(eo.und(n[3])?0:n[3],.1,100),s=Math.sqrt(r/i),l=o/(2*Math.sqrt(r*i)),c=l<1?s*Math.sqrt(1-l*l):0,h=1,p=l<1?(l*s-a)/c:-a+s;function d(t){var n=e?e*t/1e3:t;return n=l<1?Math.exp(-n*l*s)*(h*Math.cos(c*n)+p*Math.sin(c*n)):(h+p*n)*Math.exp(-n*s),0===t||1===t?t:1-n}function u(){var e=Qr.springs[t];if(e)return e;for(var n=1/6,i=0,r=0;;)if(1===d(i+=n)){if(++r>=16)break}else r=0;var o=i*n*1e3;return Qr.springs[t]=o,o}return e?d:u}function ro(t){return void 0===t&&(t=10),function(e){return Math.ceil(Yr(e,1e-6,1)*t)*(1/t)}}var oo,ao,so=function(){var t=11,e=1/(t-1);function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function r(t){return 3*t}function o(t,e,o){return((n(e,o)*t+i(e,o))*t+r(e))*t}function a(t,e,o){return 3*n(e,o)*t*t+2*i(e,o)*t+r(e)}function s(t,e,n,i,r){var a,s,l=0;do{(a=o(s=e+(n-e)/2,i,r)-t)>0?n=s:e=s}while(Math.abs(a)>1e-7&&++l<10);return s}function l(t,e,n,i){for(var r=0;r<4;++r){var s=a(e,n,i);if(0===s)return e;e-=(o(e,n,i)-t)/s}return e}function c(n,i,r,c){if(0<=n&&n<=1&&0<=r&&r<=1){var h=new Float32Array(t);if(n!==i||r!==c)for(var p=0;p<t;++p)h[p]=o(p*e,n,r);return function(t){return n===i&&r===c||0===t||1===t?t:o(d(t),i,c)}}function d(i){for(var o=0,c=1,p=t-1;c!==p&&h[c]<=i;++c)o+=e;--c;var d=o+(i-h[c])/(h[c+1]-h[c])*e,u=a(d,n,r);return u>=.001?l(i,d,n,r):0===u?d:s(i,o,o+e,n,r)}}return c}(),lo=(oo={linear:function(){return function(t){return t}}},ao={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var n=Yr(t,1,10),i=Yr(e,.1,2);return function(t){return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-i/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/i)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){ao[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(ao).forEach((function(t){var e=ao[t];oo["easeIn"+t]=e,oo["easeOut"+t]=function(t,n){return function(i){return 1-e(t,n)(1-i)}},oo["easeInOut"+t]=function(t,n){return function(i){return i<.5?e(t,n)(2*i)/2:1-e(t,n)(-2*i+2)/2}},oo["easeOutIn"+t]=function(t,n){return function(i){return i<.5?(1-e(t,n)(1-2*i))/2:(e(t,n)(2*i-1)+1)/2}}})),oo);function co(t,e){if(eo.fnc(t))return t;var n=t.split("(")[0],i=lo[n],r=no(t);switch(n){case"spring":return io(t,e);case"cubicBezier":return to(so,r);case"steps":return to(ro,r);default:return to(i,r)}}function ho(t){try{return document.querySelectorAll(t)}catch(t){return}}function po(t,e){for(var n=t.length,i=arguments.length>=2?arguments[1]:void 0,r=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(i,a,o,t)&&r.push(a)}return r}function uo(t){return t.reduce((function(t,e){return t.concat(eo.arr(e)?uo(e):e)}),[])}function go(t){return eo.arr(t)?t:(eo.str(t)&&(t=ho(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function fo(t,e){return t.some((function(t){return t===e}))}function mo(t){var e={};for(var n in t)e[n]=t[n];return e}function vo(t,e){var n=mo(t);for(var i in t)n[i]=e.hasOwnProperty(i)?e[i]:t[i];return n}function bo(t,e){var n=mo(t);for(var i in e)n[i]=eo.und(t[i])?e[i]:t[i];return n}function yo(t){var e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);return e?"rgba("+e[1]+",1)":t}function _o(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=t.replace(e,(function(t,e,n,i){return e+e+n+n+i+i})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}function wo(t){var e,n,i,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),o=parseInt(r[1],10)/360,a=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100,l=r[4]||1;function c(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0==a)e=n=i=s;else{var h=s<.5?s*(1+a):s+a-s*a,p=2*s-h;e=c(p,h,o+1/3),n=c(p,h,o),i=c(p,h,o-1/3)}return"rgba("+255*e+","+255*n+","+255*i+","+l+")"}function xo(t){return eo.rgb(t)?yo(t):eo.hex(t)?_o(t):eo.hsl(t)?wo(t):void 0}function ko(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function zo(t){return Jr(t,"translate")||"perspective"===t?"px":Jr(t,"rotate")||Jr(t,"skew")?"deg":void 0}function Ao(t,e){return eo.fnc(t)?t(e.target,e.id,e.total):t}function So(t,e){return t.getAttribute(e)}function Co(t,e,n){if(fo([n,"deg","rad","turn"],ko(e)))return e;var i=Qr.CSS[e+n];if(!eo.und(i))return i;var r=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=r+n;var s=r/o.offsetWidth;a.removeChild(o);var l=s*parseFloat(e);return Qr.CSS[e+n]=l,l}function Eo(t,e,n){if(e in t.style){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=t.style[e]||getComputedStyle(t).getPropertyValue(i)||"0";return n?Co(t,r,n):r}}function Mo(t,e){return eo.dom(t)&&!eo.inp(t)&&(!eo.nil(So(t,e))||eo.svg(t)&&t[e])?"attribute":eo.dom(t)&&fo(Zr,e)?"transform":eo.dom(t)&&"transform"!==e&&Eo(t,e)?"css":null!=t[e]?"object":void 0}function Lo(t){if(eo.dom(t)){for(var e,n=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map;e=i.exec(n);)r.set(e[1],e[2]);return r}}function Ho(t,e,n,i){var r=Jr(e,"scale")?1:0+zo(e),o=Lo(t).get(e)||r;return n&&(n.transforms.list.set(e,o),n.transforms.last=e),i?Co(t,o,i):o}function To(t,e,n,i){switch(Mo(t,e)){case"transform":return Ho(t,e,i,n);case"css":return Eo(t,e,n);case"attribute":return So(t,e);default:return t[e]||0}}function Vo(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var i=ko(t)||0,r=parseFloat(e),o=parseFloat(t.replace(n[0],""));switch(n[0][0]){case"+":return r+o+i;case"-":return r-o+i;case"*":return r*o+i}}function $o(t,e){if(eo.col(t))return xo(t);if(/\s/g.test(t))return t;var n=ko(t),i=n?t.substr(0,t.length-n.length):t;return e?i+e:i}function Oo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Po(t){return 2*Math.PI*So(t,"r")}function Ro(t){return 2*So(t,"width")+2*So(t,"height")}function Io(t){return Oo({x:So(t,"x1"),y:So(t,"y1")},{x:So(t,"x2"),y:So(t,"y2")})}function No(t){for(var e,n=t.points,i=0,r=0;r<n.numberOfItems;r++){var o=n.getItem(r);r>0&&(i+=Oo(e,o)),e=o}return i}function Fo(t){var e=t.points;return No(t)+Oo(e.getItem(e.numberOfItems-1),e.getItem(0))}function Bo(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return Po(t);case"rect":return Ro(t);case"line":return Io(t);case"polyline":return No(t);case"polygon":return Fo(t)}}function Do(t){var e=Bo(t);return t.setAttribute("stroke-dasharray",e),e}function jo(t){for(var e=t.parentNode;eo.svg(e)&&eo.svg(e.parentNode);)e=e.parentNode;return e}function qo(t,e){var n=e||{},i=n.el||jo(t),r=i.getBoundingClientRect(),o=So(i,"viewBox"),a=r.width,s=r.height,l=n.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:i,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:s,vW:l[2],vH:l[3]}}function Uo(t,e){var n=eo.str(t)?ho(t)[0]:t,i=e||100;return function(t){return{property:t,el:n,svg:qo(n),totalLength:Bo(n)*(i/100)}}}function Wo(t,e,n){function i(n){void 0===n&&(n=0);var i=e+n>=1?e+n:0;return t.el.getPointAtLength(i)}var r=qo(t.el,t.svg),o=i(),a=i(-1),s=i(1),l=n?1:r.w/r.vW,c=n?1:r.h/r.vH;switch(t.property){case"x":return(o.x-r.x)*l;case"y":return(o.y-r.y)*c;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function Go(t,e){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,i=$o(eo.pth(t)?t.totalLength:t,e)+"";return{original:i,numbers:i.match(n)?i.match(n).map(Number):[0],strings:eo.str(t)||e?i.split(n):[]}}function Xo(t){return po(t?uo(eo.arr(t)?t.map(go):go(t)):[],(function(t,e,n){return n.indexOf(t)===e}))}function Ko(t){var e=Xo(t);return e.map((function(t,n){return{target:t,id:n,total:e.length,transforms:{list:Lo(t)}}}))}function Zo(t,e){var n=mo(e);if(/^spring/.test(n.easing)&&(n.duration=io(n.easing)),eo.arr(t)){var i=t.length;2===i&&!eo.obj(t[0])?t={value:t}:eo.fnc(e.duration)||(n.duration=e.duration/i)}var r=eo.arr(t)?t:[t];return r.map((function(t,n){var i=eo.obj(t)&&!eo.pth(t)?t:{value:t};return eo.und(i.delay)&&(i.delay=n?0:e.delay),eo.und(i.endDelay)&&(i.endDelay=n===r.length-1?e.endDelay:0),i})).map((function(t){return bo(t,n)}))}function Qo(t){for(var e=po(uo(t.map((function(t){return Object.keys(t)}))),(function(t){return eo.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),n={},i=function(i){var r=e[i];n[r]=t.map((function(t){var e={};for(var n in t)eo.key(n)?n==r&&(e.value=t[n]):e[n]=t[n];return e}))},r=0;r<e.length;r++)i(r);return n}function Yo(t,e){var n=[],i=e.keyframes;for(var r in i&&(e=bo(Qo(i),e)),e)eo.key(r)&&n.push({name:r,tweens:Zo(e[r],t)});return n}function Jo(t,e){var n={};for(var i in t){var r=Ao(t[i],e);eo.arr(r)&&1===(r=r.map((function(t){return Ao(t,e)}))).length&&(r=r[0]),n[i]=r}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}function ta(t,e){var n;return t.tweens.map((function(i){var r=Jo(i,e),o=r.value,a=eo.arr(o)?o[1]:o,s=ko(a),l=To(e.target,t.name,s,e),c=n?n.to.original:l,h=eo.arr(o)?o[0]:c,p=ko(h)||ko(l),d=s||p;return eo.und(a)&&(a=c),r.from=Go(h,d),r.to=Go(Vo(a,h),d),r.start=n?n.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=co(r.easing,r.duration),r.isPath=eo.pth(o),r.isPathTargetInsideSVG=r.isPath&&eo.svg(e.target),r.isColor=eo.col(r.from.original),r.isColor&&(r.round=1),n=r,r}))}var ea={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,i,r){if(i.list.set(e,n),e===i.last||r){var o="";i.list.forEach((function(t,e){o+=e+"("+t+") "})),t.style.transform=o}}};function na(t,e){Ko(t).forEach((function(t){for(var n in e){var i=Ao(e[n],t),r=t.target,o=ko(i),a=To(r,n,o,t),s=Vo($o(i,o||ko(a)),a),l=Mo(r,n);ea[l](r,n,s,t.transforms,!0)}}))}function ia(t,e){var n=Mo(t.target,e.name);if(n){var i=ta(e,t),r=i[i.length-1];return{type:n,property:e.name,animatable:t,tweens:i,duration:r.end,delay:i[0].delay,endDelay:r.endDelay}}}function ra(t,e){return po(uo(t.map((function(t){return e.map((function(e){return ia(t,e)}))}))),(function(t){return!eo.und(t)}))}function oa(t,e){var n=t.length,i=function(t){return t.timelineOffset?t.timelineOffset:0},r={};return r.duration=n?Math.max.apply(Math,t.map((function(t){return i(t)+t.duration}))):e.duration,r.delay=n?Math.min.apply(Math,t.map((function(t){return i(t)+t.delay}))):e.delay,r.endDelay=n?r.duration-Math.max.apply(Math,t.map((function(t){return i(t)+t.duration-t.endDelay}))):e.endDelay,r}var aa=0;function sa(t){var e=vo(Xr,t),n=vo(Kr,t),i=Yo(n,t),r=Ko(t.targets),o=ra(r,i),a=oa(o,n),s=aa;return aa++,bo(e,{id:s,children:[],animatables:r,animations:o,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}var la=[],ca=function(){var t;function e(){t||ha()&&pa.suspendWhenDocumentHidden||!(la.length>0)||(t=requestAnimationFrame(n))}function n(e){for(var i=la.length,r=0;r<i;){var o=la[r];o.paused?(la.splice(r,1),i--):(o.tick(e),r++)}t=r>0?requestAnimationFrame(n):void 0}function i(){pa.suspendWhenDocumentHidden&&(ha()?t=cancelAnimationFrame(t):(la.forEach((function(t){return t._onDocumentVisibility()})),ca()))}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",i),e}();function ha(){return!!document&&document.hidden}function pa(t){void 0===t&&(t={});var e,n=0,i=0,r=0,o=0,a=null;function s(t){var e=window.Promise&&new Promise((function(t){return a=t}));return t.finished=e,e}var l=sa(t);s(l);function c(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(t){return t.reversed=l.reversed}))}function h(t){return l.reversed?l.duration-t:t}function p(){n=0,i=h(l.currentTime)*(1/pa.speed)}function d(t,e){e&&e.seek(t-e.timelineOffset)}function u(t){if(l.reversePlayback)for(var n=o;n--;)d(t,e[n]);else for(var i=0;i<o;i++)d(t,e[i])}function g(t){for(var e=0,n=l.animations,i=n.length;e<i;){var r=n[e],o=r.animatable,a=r.tweens,s=a.length-1,c=a[s];s&&(c=po(a,(function(e){return t<e.end}))[0]||c);for(var h=Yr(t-c.start-c.delay,0,c.duration)/c.duration,p=isNaN(h)?1:c.easing(h),d=c.to.strings,u=c.round,g=[],f=c.to.numbers.length,m=void 0,v=0;v<f;v++){var b=void 0,y=c.to.numbers[v],_=c.from.numbers[v]||0;b=c.isPath?Wo(c.value,p*y,c.isPathTargetInsideSVG):_+p*(y-_),u&&(c.isColor&&v>2||(b=Math.round(b*u)/u)),g.push(b)}var w=d.length;if(w){m=d[0];for(var x=0;x<w;x++){d[x];var k=d[x+1],z=g[x];isNaN(z)||(m+=k?z+k:z+" ")}}else m=g[0];ea[r.type](o.target,r.property,m,o.transforms),r.currentValue=m,e++}}function f(t){l[t]&&!l.passThrough&&l[t](l)}function m(){l.remaining&&!0!==l.remaining&&l.remaining--}function v(t){var o=l.duration,p=l.delay,d=o-l.endDelay,v=h(t);l.progress=Yr(v/o*100,0,100),l.reversePlayback=v<l.currentTime,e&&u(v),!l.began&&l.currentTime>0&&(l.began=!0,f("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,f("loopBegin")),v<=p&&0!==l.currentTime&&g(0),(v>=d&&l.currentTime!==o||!o)&&g(o),v>p&&v<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,f("changeBegin")),f("change"),g(v)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,f("changeComplete")),l.currentTime=Yr(v,0,o),l.began&&f("update"),t>=o&&(i=0,m(),l.remaining?(n=r,f("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&c()):(l.paused=!0,l.completed||(l.completed=!0,f("loopComplete"),f("complete"),!l.passThrough&&"Promise"in window&&(a(),s(l)))))}return l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop,e=l.children;for(var n=o=e.length;n--;)l.children[n].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,g(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(t,e){return na(t,e),l},l.tick=function(t){r=t,n||(n=r),v((r+(i-n))*pa.speed)},l.seek=function(t){v(h(t))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,la.push(l),p(),ca())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){ua(Xo(t),l)},l.reset(),l.autoplay&&l.play(),l}function da(t,e){for(var n=e.length;n--;)fo(t,e[n].animatable.target)&&e.splice(n,1)}function ua(t,e){var n=e.animations,i=e.children;da(t,n);for(var r=i.length;r--;){var o=i[r],a=o.animations;da(t,a),a.length||o.children.length||i.splice(r,1)}n.length||i.length||e.pause()}function ga(t){for(var e=Xo(t),n=la.length;n--;){ua(e,la[n])}}function fa(t,e){void 0===e&&(e={});var n=e.direction||"normal",i=e.easing?co(e.easing):null,r=e.grid,o=e.axis,a=e.from||0,s="first"===a,l="center"===a,c="last"===a,h=eo.arr(t),p=h?parseFloat(t[0]):parseFloat(t),d=h?parseFloat(t[1]):0,u=ko(h?t[1]:t)||0,g=e.start||0+(h?p:0),f=[],m=0;return function(t,e,v){if(s&&(a=0),l&&(a=(v-1)/2),c&&(a=v-1),!f.length){for(var b=0;b<v;b++){if(r){var y=l?(r[0]-1)/2:a%r[0],_=l?(r[1]-1)/2:Math.floor(a/r[0]),w=y-b%r[0],x=_-Math.floor(b/r[0]),k=Math.sqrt(w*w+x*x);"x"===o&&(k=-w),"y"===o&&(k=-x),f.push(k)}else f.push(Math.abs(a-b));m=Math.max.apply(Math,f)}i&&(f=f.map((function(t){return i(t/m)*m}))),"reverse"===n&&(f=f.map((function(t){return o?t<0?-1*t:-t:Math.abs(m-t)})))}return g+(h?(d-p)/m:p)*(Math.round(100*f[e])/100)+u}}function ma(t){void 0===t&&(t={});var e=pa(t);return e.duration=0,e.add=function(n,i){var r=la.indexOf(e),o=e.children;function a(t){t.passThrough=!0}r>-1&&la.splice(r,1);for(var s=0;s<o.length;s++)a(o[s]);var l=bo(n,vo(Kr,t));l.targets=l.targets||t.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=eo.und(i)?c:Vo(i,c),a(e),e.seek(l.timelineOffset);var h=pa(l);a(h),o.push(h);var p=oa(o,t);return e.delay=p.delay,e.endDelay=p.endDelay,e.duration=p.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e}pa.version="3.2.1",pa.speed=1,pa.suspendWhenDocumentHidden=!0,pa.running=la,pa.remove=ga,pa.get=To,pa.set=na,pa.convertPx=Co,pa.path=Uo,pa.setDashoffset=Do,pa.stagger=fa,pa.timeline=ma,pa.easing=co,pa.penner=lo,pa.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t};class va extends(R(V)){static get properties(){return Object.assign({src:{type:String},odd:{type:String,reflect:!0},view:{type:String,reflect:!0},nodeId:{type:String,reflect:!0,attribute:"node-id"},xmlId:{type:Array,reflect:!0,attribute:"xml-id"},xpath:{type:String,reflect:!0},map:{type:String},onUpdate:{type:Boolean,attribute:"on-update"},notFound:{type:String,attribute:"not-found"},url:{type:String},appendFootnotes:{type:Boolean,attribute:"append-footnotes"},suppressHighlight:{type:Boolean,attribute:"suppress-highlight",reflect:!0},columnSeparator:{type:String,attribute:"column-separator"},direction:{type:String},loadCss:{type:String,attribute:"load-css"},fixLinks:{type:Boolean,attribute:"fix-links"},useLanguage:{type:Boolean,attribute:"use-language"},animation:{type:Boolean},infiniteScroll:{type:Boolean,attribute:"infinite-scroll"},infiniteScrollMax:{type:Number,attribute:"infinite-scroll-max"},waitFor:{type:String,attribute:"wait-for"},disableHistory:{type:Boolean,attribute:"disable-history"},beforeUpdate:{type:String,attribute:"before-update-event"},_features:{type:Object},_content:{type:Node,attribute:!1},_column1:{type:Node,attribute:!1},_column2:{type:Node,attribute:!1},_footnotes:{type:Node,attribute:!1},_style:{type:Node,attribute:!1}},super.properties)}constructor(){super(),this.src=null,this.url=null,this.onUpdate=!1,this.appendFootnotes=!1,this.notFound="the server did not return any content",this.animation=!1,this.direction="ltr",this.suppressHighlight=!1,this.highlight=!1,this.infiniteScrollMax=10,this.disableHistory=!1,this.beforeUpdate=null,this._features={},this._selector=new Map,this._chunks=[],this._scrollTarget=null}attributeChangedCallback(t,e,n){switch(super.attributeChangedCallback(t,e,n),t){case"src":this._updateSource(n,e)}}connectedCallback(){if(super.connectedCallback(),this.infiniteScroll&&(this.columnSeparator=null,this.animation=!1,this._content=document.createElement("div"),this._content.className="infinite-content"),!this.disableHistory){const t=this.getParameter("id");t&&!this.xmlId&&(this.xmlId=t);const e=this.getParameter("action");e&&"search"===e&&(this.highlight=!0);const n=this.getParameter("root");"single"===this.view?this.nodeId=null:n&&!this.nodeId&&(this.nodeId=n)}this.waitFor||(this.waitFor="pb-toggle-feature,pb-select-feature,pb-navigation"),this.subscribeTo("pb-navigate",t=>{t.detail.source&&t.detail.source===this||this.navigate(t.detail.direction)}),this.subscribeTo("pb-refresh",this._refresh.bind(this)),this.subscribeTo("pb-toggle",t=>{this.toggleFeature(t)}),this.subscribeTo("pb-zoom",t=>{this.zoom(t.detail.direction)}),this.subscribeTo("pb-i18n-update",t=>{const e=this._features.language&&this._features.language!==t.detail.language;this._features.language=t.detail.language,this.useLanguage&&e&&this._refresh()},[]),this.signalReady(),this.onUpdate&&this.subscribeTo("pb-update",this._refresh.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this._scrollObserver&&this._scrollObserver.disconnect()}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!0),this.infiniteScroll&&(this._topObserver=this.shadowRoot.getElementById("top-observer"),this._bottomObserver=this.shadowRoot.getElementById("bottom-observer"),this._bottomObserver.style.display="none",this._topObserver.style.display="none",this._scrollObserver=new IntersectionObserver(t=>{this._content&&t.forEach(t=>{if(t.isIntersecting)if("bottom-observer"===t.target.id){const t=this._content.lastElementChild;if(t){const e=t.getAttribute("data-next");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(console.log("<pb-view> Loading next page: %s",e),this._checkChunks("forward"),this._load(e,"forward"))}}else{const t=this._content.firstElementChild;if(t){const e=t.getAttribute("data-previous");e&&!this._content.querySelector(`[data-root="${e}"]`)&&(this._checkChunks("backward"),this._load(e,"backward"))}}})})),this.onUpdate||va.waitOnce("pb-page-ready",t=>{t&&t.language&&(this._features.language=t.language),this.wait(()=>this._refresh())})}getOdd(){return this.odd||this.getDocument().odd||"teipublisher"}getView(){return this.view||this.getDocument().view||"single"}forceUpdate(){this._load(this.nodeId)}animate(){this.animation&&("forward"===this.lastDirection?pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[1e3,0],duration:300,easing:"linear"}):pa({targets:this.shadowRoot.getElementById("view"),opacity:[0,1],translateX:[-1e3,0],duration:300,easing:"linear"}))}enableScrollbar(t){t?this.classList.add("noscroll"):this.classList.remove("noscroll")}_refresh(t){if(t&&t.detail){if(t.detail.hash&&!(t.detail.id||t.detail.path||t.detail.odd||t.detail.view||t.detail.position)){this._scrollTarget=t.detail.hash;const e=this.shadowRoot.getElementById(this._scrollTarget);return void(e&&setTimeout(()=>e.scrollIntoView()))}if(t.detail.path){this.getDocument().path=t.detail.path}t.detail.id&&(this.xmlId=t.detail.id),this.odd=t.detail.odd||this.odd,void 0!==t.detail.columnSeparator&&(this.columnSeparator=t.detail.columnSeparator),this.view=t.detail.view||this.view,null===t.detail.position?this.nodeId=null:this.nodeId=t.detail.position||this.nodeId,this._scrollTarget=t.detail.hash}this._updateStyles(),this.infiniteScroll&&this._clear(),this._load(this.nodeId)}_load(t,e){if(!this.getDocument().path)return void console.log("No path");if(this._loading)return;this._loading=!0;const n=this.getParameters(t);e&&(n._dir=e),this._doLoad(n)}_doLoad(t){this.emitTo("pb-start-update",t),console.log("<pb-view> Loading view with params %o",t),this.infiniteScroll||this._clear(),this._scrollObserver&&(this._bottomObserver&&this._scrollObserver.unobserve(this._bottomObserver),this._topObserver&&this._scrollObserver.unobserve(this._topObserver));const e=this.shadowRoot.getElementById("loadContent");this.url||(this.minApiVersion("1.0.0")?this.url="api/parts":this.url="modules/lib/components.xql"),this.minApiVersion("1.0.0")?e.url=`${this.getEndpoint()}/${this.url}/${encodeURIComponent(this.getDocument().path)}/json`:e.url=`${this.getEndpoint()}/${this.url}`,e.params=t,e.generateRequest()}_clear(){this.infiniteScroll?(this._content=document.createElement("div"),this._content.className="infinite-content"):this._content=null,this._column1=null,this._column2=null,this._footnotes=null,this._chunks=[]}_handleError(){this._clear();const t=this.shadowRoot.getElementById("loadContent");let e;const{response:n}=t.lastError;e=n?n.description:'<pb-i18n key="dialogs.serverError"></pb-i18n>';const i=`\n <p>${this.notFound}</p>\n <p><pb-i18n key="dialogs.serverError"></pb-i18n>: ${e} </p>\n `;this._replaceContent({content:i}),this.emitTo("pb-end-update")}_handleContent(){const t=this.shadowRoot.getElementById("loadContent"),e=t.lastResponse;if(e){if(e.error)return this.notFound&&(this._content=this.notFound),void this.emitTo("pb-end-update",null);this._replaceContent(e,t.params._dir),this.animate(),this._scrollTarget&&this.updateComplete.then(()=>{const t=this.shadowRoot.getElementById(this._scrollTarget)||this.shadowRoot.querySelector(`[node-id="${this._scrollTarget}"]`);t&&setTimeout(()=>{t.scrollIntoView()},100),this._scrollTarget=null}),this.next=e.next,this.nextId=e.nextId,this.previous=e.previous,this.previousId=e.previousId,this.nodeId=e.root,this.switchView=e.switchView,this.disableHistory||!this.xmlId||this.map||(this.setParameter("id",this.xmlId),this.pushHistory("Navigate to xml:id")),this.xmlId=null,this.updateComplete.then(()=>{const n=this.shadowRoot.getElementById("view");this._applyToggles(n),this._fixLinks(n),ii(n);const i={data:e,root:n,params:t.params,id:this.xmlId,position:this.nodeId};this.emitTo("pb-update",i),this._scroll()}),this.emitTo("pb-end-update",null)}else console.error("<pb-view> No response received")}_replaceContent(t,e){const n=document.createDocumentFragment(),i=document.createElement("div");n.appendChild(i),i.innerHTML=t.content,this.beforeUpdate?this.emitTo(this.beforeUpdate,{data:t,root:i,render:n=>{this._doReplaceContent(n,t,e)}}):this._doReplaceContent(i,t,e)}_doReplaceContent(t,e,n){if(this.columnSeparator)this._replaceColumns(t),this._loading=!1;else if(this.infiniteScroll){let i;switch(t.className="scroll-fragment",t.setAttribute("data-root",e.root),e.next&&t.setAttribute("data-next",e.next),e.previous&&t.setAttribute("data-previous",e.previous),n){case"backward":i=this._content.firstElementChild,this._chunks.unshift(t),this.updateComplete.then(()=>{i.scrollIntoView(!0),this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._content.insertBefore(t,i);break;default:this.updateComplete.then(()=>{this._loading=!1,this._checkVisibility(),this._scrollObserver.observe(this._bottomObserver),this._scrollObserver.observe(this._topObserver)}),this._chunks.push(t),this._content.appendChild(t)}}else this._content=t,this._loading=!1;if(this.appendFootnotes){const t=document.createElement("div");e.footnotes&&(t.innerHTML=e.footnotes),this._footnotes=t}return this._initFootnotes(this._footnotes),t}_checkVisibility(){const t=this._chunks[this._chunks.length-1].hasAttribute("data-next");this._bottomObserver.style.display=t?"":"none";const e=this._chunks[0].hasAttribute("data-previous");this._topObserver.style.display=e?"":"none"}_replaceColumns(t){let e;if(this.columnSeparator){const n=t.querySelectorAll(this.columnSeparator);n.length>0&&(e=n[n.length-1])}if(e){const n=this._getFragmentBefore(t,e),i=this._getFragmentAfter(t,e);"ltr"===this.direction?(this._column1=n,this._column2=i):(this._column2=n,this._column1=i)}else this._content=t}_scroll(){const{hash:t}=this.getUrl();if(t){const e=this.shadowRoot.getElementById(t.substring(1));console.log("hash target: %o",e),e&&e.scrollIntoView({block:"center",inline:"nearest"})}}_scrollToElement(t,e){const n=this.shadowRoot.getElementById(e.hash.substring(1));n&&(t.preventDefault(),console.log("<pb-view> Scrolling to element %s",n.id),n.scrollIntoView({block:"center",inline:"nearest"}))}_updateStyles(){const t=[];let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/transform/${this.getOdd()}.css`),t.push(e),this.loadCss&&(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",`${this.getEndpoint()}/${this.loadCss}`),t.push(e)),this._style=t}_fixLinks(t){if(this.fixLinks){const e=this.getDocument(),n=this.toAbsoluteURL(e.path);t.querySelectorAll("img").forEach(t=>{const e=t.getAttribute("src"),i=new URL(e,n);t.src=i}),t.querySelectorAll("a").forEach(t=>{const e=t.getAttribute("href");if(e===t.hash)t.addEventListener("click",e=>this._scrollToElement(e,t));else{const i=new URL(e,n);t.href=i}})}else t.querySelectorAll("a").forEach(t=>{t.getAttribute("href")===t.hash&&t.addEventListener("click",e=>this._scrollToElement(e,t))})}_initFootnotes(t){t&&t.querySelectorAll(".note, .fn-back").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const n=this.shadowRoot.getElementById("content").querySelector(t.hash);n&&n.scrollIntoView()})})}_getParameters(){const t=[];this.querySelectorAll("pb-param").forEach((function(e){t["user."+e.getAttribute("name")]=e.getAttribute("value")}));for(const[e,n]of Object.entries(this._features))t["user."+e]=n;return t}getParameters(t){t=t||this.nodeId;const e=this.getDocument(),n=this._getParameters();return this.minApiVersion("1.0.0")||(n.doc=e.path),n.odd=this.getOdd()+".odd",n.view=this.getView(),t&&(n.root=t),this.xpath&&(n.xpath=this.xpath),this.xmlId&&(n.id=this.xmlId),!this.suppressHighlight&&this.highlight&&(n.highlight="yes"),this.map&&(n.map=this.map),n}_applyToggles(t){0!==this._selector.size&&this._selector.forEach((e,n)=>{t.querySelectorAll(n).forEach(t=>{const n=e.command||"toggle";t.command&&t.command(n,e.state),e.state?t.classList.add(n):t.classList.remove(n)})})}goto(t){this._load(t)}gotoId(t){this.xmlId=t,this._load()}navigate(t){this.lastDirection=t,"backward"===t?this.previous&&(this.disableHistory||this.map||(this.previousId?this.setParameter("id",this.previousId):this.setParameter("root",this.previous),this.pushHistory("Navigate backward")),this._load(this.previous,t)):this.next&&(this.disableHistory||this.map||(this.nextId?this.setParameter("id",this.nextId):this.setParameter("root",this.next),this.pushHistory("Navigate forward")),this._load(this.next,t))}_checkChunks(t){if(this.infiniteScroll&&0!==this.infiniteScrollMax){if(this._chunks.length===this.infiniteScrollMax)switch(t){case"forward":this._content.removeChild(this._chunks.shift());break;default:this._content.removeChild(this._chunks.pop())}this.emitTo("pb-navigate",{direction:t,source:this})}}zoom(t){const e=this.shadowRoot.getElementById("view"),n=window.getComputedStyle(e).getPropertyValue("font-size"),i=parseInt(n.replace(/^(\d+)px/,"$1"));e.style.fontSize="in"===t?i+1+"px":i-1+"px"}toggleFeature(t){const e=()=>{const t=this.shadowRoot.getElementById("view");this._applyToggles(t)},n=t.detail.properties;for(const[t,e]of Object.entries(n))switch(t){case"odd":case"view":case"columnSeparator":case"xpath":case"nodeId":break;default:this._features[t]=e}n&&(n.odd&&(this.odd=n.odd),n.view&&(this.view=n.view,"single"===this.view?this.nodeId=null:this.nodeId=this.switchView),n.xpath&&(this.xpath=n.xpath),n.hasOwnProperty("columnSeparator")&&(this.columnSeparator=n.columnSeparator)),t.detail.selectors&&t.detail.selectors.forEach(t=>{this._selector.set(t.selector,{state:t.state,command:t.command||"toggle"})}),"refresh"===t.detail.action&&(Object.keys(n).length>0?(this._updateStyles(),this._load()):e())}_getFragmentBefore(t,e){const n=document.createRange();return n.setStartBefore(t),n.setEndBefore(e),n.cloneContents()}_getFragmentAfter(t,e){const n=document.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.cloneContents()}_updateSource(t,e){void 0!==e&&t!==e&&(this.xpath=null,this.odd=null,this.xmlId=null,this.nodeId=null)}static get styles(){return P`
|
|
1091
1091
|
:host {
|
|
1092
1092
|
display: block;
|
|
1093
1093
|
background: transparent;
|
|
@@ -1219,7 +1219,7 @@ e({_template:n`
|
|
|
1219
1219
|
with-credentials
|
|
1220
1220
|
@response="${this._handleContent}"
|
|
1221
1221
|
@error="${this._handleError}"></iron-ajax>
|
|
1222
|
-
`]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,n)=>Math.max(Math.min(t,n),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let n=0;for(let i=0;i<e;i++)n=(n<<5)-n+t.charCodeAt(i),n&=n;return n},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,n)=>(n<0?n+=1:n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Ca=(t,e,n)=>{let i,r,o;if(t/=360,n/=100,0===(e/=100))i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;i=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,n,i)=>(299*t+587*e+114*n)/1e3>=i,Ma=(t,e,n)=>`hsl(${t}, ${e}%, ${n}%)`,La=(t,e,n,i)=>{switch(i){case"rgb":return`rgb(${t}, ${e}, ${n})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(n.toString(16))}`}},Ha=(t,{format:e="hex",saturation:n=[50,55],lightness:i=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(n,ba)),l=za(o,Aa(i,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let n=t;for(;n.parentNode!==e;)n=n.parentElement;return n}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const n=e.getAttribute("href");return n&&/^#fn_.*$/.test(n)}function $a(t,e,n){const i=document.createTreeWalker(t);for(i.currentNode=e;i.previousNode();){const t=i.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(n+=t.textContent.length)}return n}function Oa(t,e,n="start"){if(t.nodeType===Node.ELEMENT_NODE){const i=t.closest("[data-tei]");if(0===e)return{parent:i.getAttribute("data-tei"),offset:0};const r=i.childNodes[e];return{parent:i.getAttribute("data-tei"),offset:"end"===n?$a(i,r,0)-1:$a(i,r,0)}}const i=t.parentNode.closest("[data-tei]");if(i)return{parent:i.getAttribute("data-tei"),offset:$a(i,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let n=0,i=t.parentNode;for(;i&&i!==t.getRootNode();)i.classList.contains(e)&&(n+=1),i=i.parentNode;return n}function Ra(t){let e=t.nextSibling;for(;e.hasChildNodes();)e=e.firstChild;return e.nodeType===Node.TEXT_NODE?e:t}function Ia(t,e){let n=e;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();)if(!Va(i.currentNode)&&i.currentNode.textContent.length>0){if(n-i.currentNode.textContent.length<=0)return[i.currentNode,n];n-=i.currentNode.textContent.length}return null}function Na(t,e,n,i=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===i)break}r-=1}let a=n+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===i)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,n)}</mark>${t.substring(n,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i=0,r=0;const o=[];for(;n.nextNode();)n.currentNode===t&&(r=i),i+=n.currentNode.textContent.length,o.push(n.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(n=>{const i=t.properties[n];i&&i.length>0&&(e[n]=i)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:n=[50,60],differencePoint:i=130}={})=>{e=Aa(e,ba),n=Aa(n,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof n?n:xa(...n),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,i)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=n=>{if("selectionchange"===n.type&&this._inHandler)return;if("mousedown"===n.type&&(t=!0),"mouseup"===n.type&&(t=!1),t)return;this._cancelPendingCallback();const i="mouseup"===n.type?10:100;e(i)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Xn(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1){const n=this.shadowRoot.getElementById("view"),i=Array.from(n.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!i)return null;const r=document.createRange(),o=Ia(i,t.start),a=Ia(i,t.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",i),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const t=Ra(o[0]);t===a[0]?r.setStart(t,0):r.setStartBefore(o[0].nextSibling)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(Ta(o[0],i)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(Ta(a[0],i)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const s=document.createElement("span"),l=""===t.properties[this.key]?"incomplete":"";s.className=`annotation annotation-${t.type} ${t.type} ${l}`,s.dataset.type=t.type,s.dataset.annotation=JSON.stringify(t.properties);try{r.surroundContents(s)}catch(t){throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(s,t),e||this.refreshMarkers(),s}updateAnnotations(){this._ranges.forEach(t=>{let e;switch(t.type){case"delete":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e?this._deleteAnnotation(e):console.error("Annotation %s not found",t.context);break;case"modify":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let n=!1;const i=e.commonAncestorContainer;if(i.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==i){const t=Ta(e.startContainer,i);e.setStartBefore(t),n=!0}if(e.endContainer.parentElement!==i){const t=Ta(e.endContainer,i);e.setEndAfter(t),n=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),n&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const n=this._updateAnnotation(t,e);return n&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),n}addAnnotation(t){const e=t.range||this._currentSelection,n=Oa(e.startContainer,e.startOffset),i=Oa(e.endContainer,e.endOffset,"end"),r={context:n.parent,start:n.offset,end:i.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const n=t.parentNode.closest("[data-tei]"),i={type:"delete",node:t.dataset.tei,context:n.dataset.tei};this._ranges.push(i)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const n=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(n,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n].cloneNode(!0);t.parentNode.insertBefore(i,t),0===n&&e.setStartBefore(i),n===t.childNodes.length-1&&e.setEndAfter(i)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const n=this._getSelection();n.removeAllRanges(),n.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let n=this._rangesMap.get(t);n?(n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const n=t.closest("[data-tei]");let i=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);i||(i={type:"modify",node:t.dataset.tei,context:n.dataset.tei},this._ranges.push(i)),i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const n=JSON.parse(t.dataset.annotation),i=Object.assign(n||{},e);t.dataset.annotation=JSON.stringify(i),""!==i[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const n=document.createElement("div");n.className="info",e.appendChild(n);const i=document.createElement("div");i.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",i.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),i.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),i.appendChild(o),e.appendChild(i);const s=this.shadowRoot.getElementById("view");Nn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,i)=>{i.preventDefault(),i.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:n,span:t});else{n.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),n.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const n=document.createElement("tr"),i=document.createElement("td");i.innerHTML=t,n.appendChild(i);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),n.appendChild(r),e.appendChild(n)}),n.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,n,i=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-n.left+"px",s.style.top=a.top-n.top+a.height+"px",s.style.marginTop=i+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),n=this.shadowRoot.getElementById("marker-layer");n.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,n,e,5*Pa(t,"annotation"))}),n.style.display="block"}search(t,e){function n(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function i(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}i.acceptNode=i;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>n(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,i);for(;s.nextNode();){let e=s.currentNode;const n=Array.from(e.textContent.matchAll(a));for(const i of n){const n=i.index+i[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,i.index),h=Oa(e,n,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+i.index,d+n)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),n=document.createRange();if(t.annotated)n.selectNode(t.textNode);else{const i=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(i,t.start),o=Ia(i,t.end);n.setStart(r[0],r[1]),n.setEnd(o[0],o[1])}const i=e.getBoundingClientRect(),r=n.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-i.left-4+"px",o.style.top=r.top-i.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",n.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles())}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const n=[],i=[];this._annotationColors.forEach((t,e)=>{n.push(`--pb-annotation-${e}: ${t.color};`),n.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),i.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${n.join("\n")}\n }\n\n ${i.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
|
|
1222
|
+
`]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,n)=>Math.max(Math.min(t,n),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let n=0;for(let i=0;i<e;i++)n=(n<<5)-n+t.charCodeAt(i),n&=n;return n},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,n)=>(n<0?n+=1:n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Ca=(t,e,n)=>{let i,r,o;if(t/=360,n/=100,0===(e/=100))i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;i=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,n,i)=>(299*t+587*e+114*n)/1e3>=i,Ma=(t,e,n)=>`hsl(${t}, ${e}%, ${n}%)`,La=(t,e,n,i)=>{switch(i){case"rgb":return`rgb(${t}, ${e}, ${n})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(n.toString(16))}`}},Ha=(t,{format:e="hex",saturation:n=[50,55],lightness:i=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(n,ba)),l=za(o,Aa(i,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let n=t;for(;n.parentNode!==e;)n=n.parentElement;return n}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const n=e.getAttribute("href");return n&&/^#fn_.*$/.test(n)}function $a(t,e,n){const i=document.createTreeWalker(t);for(i.currentNode=e;i.previousNode();){const t=i.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(n+=t.textContent.length)}return n}function Oa(t,e,n="start"){if(t.nodeType===Node.ELEMENT_NODE){const i=t.closest("[data-tei]");if(0===e)return{parent:i.getAttribute("data-tei"),offset:0};const r=i.childNodes[e];return{parent:i.getAttribute("data-tei"),offset:"end"===n?$a(i,r,0)-1:$a(i,r,0)}}const i=t.parentNode.closest("[data-tei]");if(i)return{parent:i.getAttribute("data-tei"),offset:$a(i,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let n=0,i=t.parentNode;for(;i&&i!==t.getRootNode();)i.classList.contains(e)&&(n+=1),i=i.parentNode;return n}function Ra(t,e){const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return n.currentNode=e,n.nextNode()?n.currentNode:e}function Ia(t,e){let n=e;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();)if(!Va(i.currentNode)&&i.currentNode.textContent.length>0){if(n-i.currentNode.textContent.length<=0)return[i.currentNode,n];n-=i.currentNode.textContent.length}return null}function Na(t,e,n,i=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===i)break}r-=1}let a=n+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===i)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,n)}</mark>${t.substring(n,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i=0,r=0;const o=[];for(;n.nextNode();)n.currentNode===t&&(r=i),i+=n.currentNode.textContent.length,o.push(n.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(n=>{const i=t.properties[n];i&&i.length>0&&(e[n]=i)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:n=[50,60],differencePoint:i=130}={})=>{e=Aa(e,ba),n=Aa(n,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof n?n:xa(...n),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,i)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=n=>{if("selectionchange"===n.type&&this._inHandler)return;if("mousedown"===n.type&&(t=!0),"mouseup"===n.type&&(t=!1),t)return;this._cancelPendingCallback();const i="mouseup"===n.type?10:100;e(i)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Xn(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1){const n=this.shadowRoot.getElementById("view"),i=Array.from(n.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!i)return null;const r=document.createRange(),o=Ia(i,t.start),a=Ia(i,t.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",i),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const t=Ra(i,o[0]);t===a[0]?(r.setStart(t,0),o[0]=t,o[1]=0):r.setStartBefore(o[0].nextSibling||t)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(Ta(o[0],i)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(Ta(a[0],i)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const s=document.createElement("span"),l=""===t.properties[this.key]?"incomplete":"";s.className=`annotation annotation-${t.type} ${t.type} ${l}`,s.dataset.type=t.type,s.dataset.annotation=JSON.stringify(t.properties);try{r.surroundContents(s)}catch(t){throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(s,t),e||this.refreshMarkers(),s}updateAnnotations(){this._ranges.forEach(t=>{let e;switch(t.type){case"delete":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e?this._deleteAnnotation(e):console.error("Annotation %s not found",t.context);break;case"modify":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let n=!1;const i=e.commonAncestorContainer;if(i.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==i){const t=Ta(e.startContainer,i);e.setStartBefore(t),n=!0}if(e.endContainer.parentElement!==i){const t=Ta(e.endContainer,i);e.setEndAfter(t),n=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),n&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const n=this._updateAnnotation(t,e);return n&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),n}addAnnotation(t){const e=t.range||this._currentSelection,n=Oa(e.startContainer,e.startOffset),i=Oa(e.endContainer,e.endOffset,"end"),r={context:n.parent,start:n.offset,end:i.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const n=t.parentNode.closest("[data-tei]"),i={type:"delete",node:t.dataset.tei,context:n.dataset.tei};this._ranges.push(i)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const n=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(n,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n].cloneNode(!0);t.parentNode.insertBefore(i,t),0===n&&e.setStartBefore(i),n===t.childNodes.length-1&&e.setEndAfter(i)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const n=this._getSelection();n.removeAllRanges(),n.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let n=this._rangesMap.get(t);n?(n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const n=t.closest("[data-tei]");let i=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);i||(i={type:"modify",node:t.dataset.tei,context:n.dataset.tei},this._ranges.push(i)),i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const n=JSON.parse(t.dataset.annotation),i=Object.assign(n||{},e);t.dataset.annotation=JSON.stringify(i),""!==i[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const n=document.createElement("div");n.className="info",e.appendChild(n);const i=document.createElement("div");i.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",i.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),i.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),i.appendChild(o),e.appendChild(i);const s=this.shadowRoot.getElementById("view");Nn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,i)=>{i.preventDefault(),i.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:n,span:t});else{n.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),n.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const n=document.createElement("tr"),i=document.createElement("td");i.innerHTML=t,n.appendChild(i);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),n.appendChild(r),e.appendChild(n)}),n.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,n,i=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-n.left+"px",s.style.top=a.top-n.top+a.height+"px",s.style.marginTop=i+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),n=this.shadowRoot.getElementById("marker-layer");n.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,n,e,5*Pa(t,"annotation"))}),n.style.display="block"}search(t,e){function n(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function i(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}i.acceptNode=i;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>n(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,i);for(;s.nextNode();){let e=s.currentNode;const n=Array.from(e.textContent.matchAll(a));for(const i of n){const n=i.index+i[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,i.index),h=Oa(e,n,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+i.index,d+n)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),n=document.createRange();if(t.annotated)n.selectNode(t.textNode);else{const i=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(i,t.start),o=Ia(i,t.end);n.setStart(r[0],r[1]),n.setEnd(o[0],o[1])}const i=e.getBoundingClientRect(),r=n.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-i.left-4+"px",o.style.top=r.top-i.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",n.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const n=[],i=[];this._annotationColors.forEach((t,e)=>{n.push(`--pb-annotation-${e}: ${t.color};`),n.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),i.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${n.join("\n")}\n }\n\n ${i.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
|
|
1223
1223
|
.annotation-type {
|
|
1224
1224
|
display: inline-block;
|
|
1225
1225
|
text-align: right;
|
|
@@ -4221,7 +4221,7 @@ const Ns=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
4221
4221
|
padding:0 0.5rem;
|
|
4222
4222
|
}
|
|
4223
4223
|
|
|
4224
|
-
`}}function ol(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function al(t,e,n){return e&&ol(t.prototype,e),n&&ol(t,n),t}function sl(){return(sl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function ll(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cl(t,e)}function cl(t,e){return(cl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function dl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}customElements.define("pb-blacklab-highlight",rl);var ul,gl,fl,ml,vl,bl,yl={},_l=[],wl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xl(t,e){for(var n in e)t[n]=e[n];return t}function kl(t){var e=t.parentNode;e&&e.removeChild(t)}function zl(t,e,n){var i,r,o,a=arguments,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>3)for(n=[n],o=3;o<arguments.length;o++)n.push(a[o]);if(null!=n&&(s.children=n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Al(t,s,i,r,null)}function Al(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++ul.__v:r};return null!=ul.vnode&&ul.vnode(o),o}function Sl(t){return t.children}function Cl(t,e){this.props=t,this.context=e}function El(t,e){if(null==e)return t.__?El(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?El(t):null}function Ml(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Ml(t)}}function Ll(t){(!t.__d&&(t.__d=!0)&&fl.push(t)&&!Hl.__r++||vl!==ul.debounceRendering)&&((vl=ul.debounceRendering)||ml)(Hl)}function Hl(){for(var t;Hl.__r=fl.length;)t=fl.sort((function(t,e){return t.__v.__b-e.__v.__b})),fl=[],t.some((function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=xl({},r)).__v=r.__v+1,Nl(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?El(r):o,r.__h),Fl(n,r),r.__e!=o&&Ml(r)))}))}function Tl(t,e,n,i,r,o,a,s,l,c){var h,p,d,u,g,f,m,v=i&&i.__k||_l,b=v.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(u=n.__k[h]=null==(u=e[h])||"boolean"==typeof u?null:"string"==typeof u||"number"==typeof u||"bigint"==typeof u?Al(null,u,null,null,u):Array.isArray(u)?Al(Sl,{children:u},null,null,null):u.__b>0?Al(u.type,u.props,u.key,null,u.__v):u)){if(u.__=n,u.__b=n.__b+1,null===(d=v[h])||d&&u.key==d.key&&u.type===d.type)v[h]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&u.key==d.key&&u.type===d.type){v[p]=void 0;break}d=null}Nl(t,u,d=d||yl,r,o,a,s,l,c),g=u.__e,(p=u.ref)&&d.ref!=p&&(m||(m=[]),d.ref&&m.push(d.ref,null,u),m.push(p,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&null!=u.__k&&u.__k===d.__k?u.__d=l=Vl(u,l,t):l=$l(t,u,d,v,g,l),c||"option"!==n.type?"function"==typeof n.type&&(n.__d=l):t.value=""):l&&d.__e==l&&l.parentNode!=t&&(l=El(d))}for(n.__e=f,h=b;h--;)null!=v[h]&&("function"==typeof n.type&&null!=v[h].__e&&v[h].__e==n.__d&&(n.__d=El(i,h+1)),Dl(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Bl(m[h],m[++h],m[++h])}function Vl(t,e,n){var i,r;for(i=0;i<t.__k.length;i++)(r=t.__k[i])&&(r.__=t,e="function"==typeof r.type?Vl(r,e,n):$l(n,r,r,t.__k,r.__e,e));return e}function $l(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Ol(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||wl.test(e)?n:n+"px"}function Pl(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ol(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||Ol(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?Il:Rl,o):t.removeEventListener(e,o?Il:Rl,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function Rl(t){this.l[t.type+!1](ul.event?ul.event(t):t)}function Il(t){this.l[t.type+!0](ul.event?ul.event(t):t)}function Nl(t,e,n,i,r,o,a,s,l){var c,h,p,d,u,g,f,m,v,b,y,_=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=ul.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,v=(c=_.contextType)&&i[c.__c],b=c?v?v.props.value:c.__:i,n.__c?f=(h=e.__c=n.__c).__=h.__E:("prototype"in _&&_.prototype.render?e.__c=h=new _(m,b):(e.__c=h=new Cl(m,b),h.constructor=_,h.render=jl),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=i,p=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=_.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=xl({},h.__s)),xl(h.__s,_.getDerivedStateFromProps(m,h.__s))),d=h.props,u=h.state,p)null==_.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===n.__v){h.props=m,h.state=h.__s,e.__v!==n.__v&&(h.__d=!1),h.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),h.__h.length&&a.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,u,g)}))}h.context=b,h.props=m,h.state=h.__s,(c=ul.__r)&&c(e),h.__d=!1,h.__v=e,h.__P=t,c=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(i=xl(xl({},i),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(d,u)),y=null!=c&&c.type===Sl&&null==c.key?c.props.children:c,Tl(t,Array.isArray(y)?y:[y],e,n,i,r,o,a,s,l),h.base=e.__e,e.__h=null,h.__h.length&&a.push(h),f&&(h.__E=h.__=null),h.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,i,r,o,a,s){var l,c,h,p,d=n.props,u=e.props,g=e.type,f=0;if("svg"===g&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&(l===t||(g?l.localName==g:3==l.nodeType))){t=l,o[f]=null;break}if(null==t){if(null===g)return document.createTextNode(u);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,u.is&&u),o=null,s=!1}if(null===g)d===u||s&&t.data===u||(t.data=u);else{if(o=o&&_l.slice.call(t.childNodes),c=(d=n.props||yl).dangerouslySetInnerHTML,h=u.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<t.attributes.length;p++)d[t.attributes[p].name]=t.attributes[p].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||Pl(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||Pl(t,o,e[o],n[o],i)}(t,u,d,r,s),h)e.__k=[];else if(f=e.props.children,Tl(t,Array.isArray(f)?f:[f],e,n,i,r&&"foreignObject"!==g,o,a,t.firstChild,s),null!=o)for(f=o.length;f--;)null!=o[f]&&kl(o[f]);s||("value"in u&&void 0!==(f=u.value)&&(f!==t.value||"progress"===g&&!f)&&Pl(t,"value",f,d.value,!1),"checked"in u&&void 0!==(f=u.checked)&&f!==t.checked&&Pl(t,"checked",f,d.checked,!1))}return t}(n.__e,e,n,i,r,o,a,l);(c=ul.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),ul.__e(t,e,n)}}function Fl(t,e){ul.__c&&ul.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ul.__e(t,e.__v)}}))}function Bl(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){ul.__e(t,n)}}function Dl(t,e,n){var i,r,o;if(ul.unmount&&ul.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Bl(i,null,e)),n||"function"==typeof t.type||(n=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ul.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&Dl(i[o],e,n);null!=r&&kl(r)}function jl(t,e,n){return this.constructor(t,n)}function ql(t,e,n){var i,r,o;ul.__&&ul.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],Nl(e,t=(!i&&n||e).__k=zl(Sl,null,[t]),r||yl,yl,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?_l.slice.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),Fl(o,t)}function Ul(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}ul={__e:function(t,e){for(var n,i,r;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),r=n.__d),r)return n.__E=n}catch(e){t=e}throw t},__v:0},gl=function(t){return null!=t&&void 0===t.constructor},Cl.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xl({},this.state),"function"==typeof t&&(t=t(xl({},n),this.props)),t&&xl(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),Ll(this))},Cl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ll(this))},Cl.prototype.render=Sl,fl=[],ml="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hl.__r=0,bl=0;var Wl=function(){function t(t){this._id=void 0,this._id=t||Ul()}return al(t,[{key:"id",get:function(){return this._id}}]),t}(),Gl={search:{placeholder:"Type a keyword..."},sort:{sortAsc:"Sort column ascending",sortDesc:"Sort column descending"},pagination:{previous:"Previous",next:"Next",navigate:function(t,e){return"Page "+t+" of "+e},page:function(t){return"Page "+t},showing:"Showing",of:"of",to:"to",results:"results"},loading:"Loading...",noRecordsFound:"No matching records found",error:"An error happened while fetching the data"},Xl=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Gl}var e=t.prototype;return e.getString=function(t,e){if(!e||!t)return null;var n=t.split("."),i=n[0];if(e[i]){var r=e[i];return"string"==typeof r?function(){return r}:"function"==typeof r?r:this.getString(n.slice(1).join("."),r)}return null},e.translate=function(t){var e;return(e=this.getString(t,this._language)||this.getString(t,this._defaultLanguage))?e.apply(void 0,[].slice.call(arguments,1)):t},t}(),Kl=function(t){function e(e,n){var i,r;return(i=t.call(this,e,n)||this).config=void 0,i._=void 0,i.config=function(t){if(!t)return null;var e=Object.keys(t);return e.length?t[e[0]].props.value:null}(n),i.config&&(i._=(r=i.config.translator,function(t){return r.translate.apply(r,[t].concat([].slice.call(arguments,1)))})),i}return ll(e,t),e}(Cl),Zl=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Kl);function Ql(t,e){return zl(Zl,{content:t,parentElement:e})}Zl.defaultProps={parentElement:"span"};var Yl,Jl=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.update(e),n}ll(e,t);var n=e.prototype;return n.cast=function(t){return t instanceof HTMLElement?Ql(t.outerHTML):t},n.update=function(t){return this.data=this.cast(t),this},e}(Wl),tc=function(t){function e(e){var n;return(n=t.call(this)||this)._cells=void 0,n.cells=e||[],n}ll(e,t);var n=e.prototype;return n.cell=function(t){return this._cells[t]},n.toArray=function(){return this.cells.map((function(t){return t.data}))},e.fromCells=function(t){return new e(t.map((function(t){return new Jl(t.data)})))},al(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(Wl),ec=function(t){function e(e){var n;return(n=t.call(this)||this)._rows=void 0,n._length=void 0,n.rows=e instanceof Array?e:e instanceof tc?[e]:[],n}return ll(e,t),e.prototype.toArray=function(){return this.rows.map((function(t){return t.toArray()}))},e.fromRows=function(t){return new e(t.map((function(t){return tc.fromCells(t.cells)})))},e.fromArray=function(t){return new e((t=function(t){return!t[0]||t[0]instanceof Array?t:[t]}(t)).map((function(t){return new tc(t.map((function(t){return new Jl(t)})))})))},al(e,[{key:"rows",get:function(){return this._rows},set:function(t){this._rows=t}},{key:"length",get:function(){return this._length||this.rows.length},set:function(t){this._length=t}}]),e}(Wl),nc=function(){function t(){this.callbacks=void 0}var e=t.prototype;return e.init=function(t){this.callbacks||(this.callbacks={}),t&&!this.callbacks[t]&&(this.callbacks[t]=[])},e.on=function(t,e){return this.init(t),this.callbacks[t].push(e),this},e.off=function(t,e){var n=t;return this.init(),this.callbacks[n]&&0!==this.callbacks[n].length?(this.callbacks[n]=this.callbacks[n].filter((function(t){return t!=e})),this):this},e.emit=function(t){var e=arguments,n=t;return this.init(n),this.callbacks[n].length>0&&(this.callbacks[n].forEach((function(t){return t.apply(void 0,[].slice.call(e,1))})),!0)},t}();!function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(Yl||(Yl={}));var ic=function(t){function e(e){var n;return(n=t.call(this)||this).id=void 0,n._props=void 0,n._props={},n.id=Ul(),e&&n.setProps(e),n}ll(e,t);var n=e.prototype;return n.process=function(){var t=[].slice.call(arguments);this.validateProps instanceof Function&&this.validateProps.apply(this,t),this.emit.apply(this,["beforeProcess"].concat(t));var e=this._process.apply(this,t);return this.emit.apply(this,["afterProcess"].concat(t)),e},n.setProps=function(t){return Object.assign(this._props,t),this.emit("propsUpdated",this),this},al(e,[{key:"props",get:function(){return this._props}}]),e}(nc),rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){return this.props.keyword?(e=String(this.props.keyword).trim(),n=this.props.columns,i=this.props.ignoreHiddenColumns,r=t,o=this.props.selector,e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new ec(r.rows.filter((function(t,r){return t.cells.some((function(t,a){if(!t)return!1;if(i&&n&&n[a]&&"object"==typeof n[a]&&n[a].hidden)return!1;var s="";if("function"==typeof o)s=o(t.data,r,a);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(s=l.props.content)}else s=String(t.data);return new RegExp(e,"gi").test(s)}))})))):t;var e,n,i,r,o},al(e,[{key:"type",get:function(){return Yl.Filter}}]),e}(ic);function oc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function ac(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var sc,lc=function(t){function e(e){var n;return(n=t.call(this)||this)._state=void 0,n.dispatcher=void 0,n.dispatcher=e,n._state=n.getInitialState(),e.register(n._handle.bind(hl(n))),n}ll(e,t);var n=e.prototype;return n._handle=function(t){this.handle(t.type,t.payload)},n.setState=function(t){var e=this._state;this._state=t,this.emit("updated",t,e)},al(e,[{key:"state",get:function(){return this._state}}]),e}(nc),cc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return{keyword:null}},n.handle=function(t,e){"SEARCH_KEYWORD"===t&&this.search(e.keyword)},n.search=function(t){this.setState({keyword:t})},e}(lc),hc=function(){function t(t){this.dispatcher=void 0,this.dispatcher=t}return t.prototype.dispatch=function(t,e){this.dispatcher.dispatch({type:t,payload:e})},t}(),pc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(hc),dc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){if(!this.props.keyword)return t;var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.keyword)),this.props.body&&(e.body=this.props.body(t.body,this.props.keyword)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerFilter}}]),e}(ic),uc=new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var n=this.format(t,"error");if(e)throw Error(n);console.error(n)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e}(Kl);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(sc||(sc={}));var fc=function(){function t(){this.plugins=void 0,this.plugins=[]}var e=t.prototype;return e.get=function(t){var e=this.plugins.filter((function(e){return e.id===t}));return e.length>0?e[0]:null},e.add=function(t){return t.id?null!==this.get(t.id)?(uc.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(uc.error("Plugin ID cannot be empty"),this)},e.remove=function(t){return this.plugins.splice(this.plugins.indexOf(this.get(t)),1),this},e.list=function(t){return(null!=t||null!=t?this.plugins.filter((function(e){return e.position===t})):this.plugins).sort((function(t,e){return t.order-e.order}))},t}(),mc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?zl(Sl,{},zl(e.component,sl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?zl(Sl,{},this.config.plugin.list(this.props.position).map((function(e){return zl(e.component,sl({plugin:e},e.props,t.props.props))}))):null},e}(Kl),vc=function(t){function e(e,n){var i;(i=t.call(this,e,n)||this).searchProcessor=void 0,i.actions=void 0,i.store=void 0,i.storeUpdatedFn=void 0,i.actions=new pc(i.config.dispatcher),i.store=new cc(i.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&i.actions.search(o),i.storeUpdatedFn=i.storeUpdated.bind(hl(i)),i.store.on("updated",i.storeUpdatedFn),r=e.server?new dc({keyword:e.keyword,url:e.server.url,body:e.server.body}):new rc({keyword:e.keyword,columns:i.config.header&&i.config.header.columns,ignoreHiddenColumns:e.ignoreHiddenColumns||void 0===e.ignoreHiddenColumns,selector:e.selector}),i.searchProcessor=r,i.config.pipeline.register(r)),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.searchProcessor),this.store.off("updated",this.storeUpdatedFn)},n.storeUpdated=function(t){this.searchProcessor.setProps({keyword:t.keyword})},n.onChange=function(t){this.actions.search(t.target.value)},n.render=function(){if(!this.props.enabled)return null;var t,e,n,i=this.onChange.bind(this);return this.searchProcessor instanceof dc&&(t=i,e=this.props.debounceTimeout,i=function(){var i=arguments;return new Promise((function(r){n&&clearTimeout(n),n=setTimeout((function(){return r(t.apply(void 0,[].slice.call(i)))}),e)}))}),zl("div",{className:oc(ac("search",this.config.className.search))},zl("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:i,className:ac(oc("input"),oc("search","input")),value:this.store.state.keyword}))},e}(gc);vc.defaultProps={debounceTimeout:250};var bc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){if(isNaN(Number(this.props.limit))||isNaN(Number(this.props.page)))throw Error("Invalid parameters passed")},n._process=function(t){var e=this.props.page;return new ec(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},al(e,[{key:"type",get:function(){return Yl.Limit}}]),e}(ic),yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.page,this.props.limit)),this.props.body&&(e.body=this.props.body(t.body,this.props.page,this.props.limit)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerLimit}}]),e}(ic),_c=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).processor=void 0,i.onUpdateFn=void 0,i.setTotalFromTabularFn=void 0,i.state={limit:e.limit,page:e.page||0,total:0},i}ll(e,t);var n=e.prototype;return n.componentWillMount=function(){var t,e=this;this.props.enabled&&(this.setTotalFromTabularFn=this.setTotalFromTabular.bind(this),this.props.server?(t=new yc({limit:this.state.limit,page:this.state.page,url:this.props.server.url,body:this.props.server.body}),this.config.pipeline.on("afterProcess",this.setTotalFromTabularFn)):(t=new bc({limit:this.state.limit,page:this.state.page})).on("beforeProcess",this.setTotalFromTabularFn),this.processor=t,this.config.pipeline.register(t),this.config.pipeline.on("error",(function(){e.setState({total:0,page:0})})))},n.setTotalFromTabular=function(t){this.setTotal(t.length)},n.onUpdate=function(t){this.props.resetPageOnUpdate&&t!==this.processor&&this.setPage(0)},n.componentDidMount=function(){this.onUpdateFn=this.onUpdate.bind(this),this.config.pipeline.on("updated",this.onUpdateFn)},n.componentWillUnmount=function(){this.config.pipeline.unregister(this.processor),this.config.pipeline.off("updated",this.onUpdateFn)},n.setPage=function(t){if(t>=this.pages||t<0||t===this.state.page)return null;this.setState({page:t}),this.processor.setProps({page:t})},n.setTotal=function(t){this.setState({total:t})},n.renderPages=function(){var t=this;if(this.props.buttonsCount<=0)return null;var e=Math.min(this.pages,this.props.buttonsCount),n=Math.min(this.state.page,Math.floor(e/2));return this.state.page+Math.floor(e/2)>=this.pages&&(n=e-(this.pages-this.state.page)),zl(Sl,null,this.pages>e&&this.state.page-n>0&&zl(Sl,null,zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,0),title:this._("pagination.firstPage"),"aria-label":this._("pagination.firstPage"),className:this.config.className.paginationButton},this._("1")),zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-n)})).map((function(e){return zl("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:ac(t.state.page===e?ac(oc("currentPage"),t.config.className.paginationButtonCurrent):null,t.config.className.paginationButton),title:t._("pagination.page",e+1),"aria-label":t._("pagination.page",e+1)},t._(""+(e+1)))})),this.pages>e&&this.pages>this.state.page+n+1&&zl(Sl,null,zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"..."),zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,this.pages-1),title:this._("pagination.page",this.pages),"aria-label":this._("pagination.page",this.pages),className:this.config.className.paginationButton},this._(""+this.pages))))},n.renderSummary=function(){return zl(Sl,null,this.props.summary&&this.state.total>0&&zl("div",{role:"status","aria-live":"polite",className:ac(oc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",zl("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",zl("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",zl("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},n.render=function(){return this.props.enabled?zl("div",{className:ac(oc("pagination"),this.config.className.pagination)},this.renderSummary(),zl("div",{className:oc("pages")},this.props.prevButton&&zl("button",{tabIndex:0,role:"button",disabled:0===this.state.page,onClick:this.setPage.bind(this,this.state.page-1),title:this._("pagination.previous"),"aria-label":this._("pagination.previous"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&zl("button",{tabIndex:0,role:"button",disabled:this.pages===this.state.page+1||0===this.pages,onClick:this.setPage.bind(this,this.state.page+1),title:this._("pagination.next"),"aria-label":this._("pagination.next"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},al(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(gc);function wc(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function xc(t){return t?Math.floor(t)+"px":""}_c.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var kc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).tableElement=void 0,i.tableClassName=void 0,i.tableStyle=void 0,i.tableElement=i.props.tableRef.current.base.cloneNode(!0),i.tableElement.style.position="absolute",i.tableElement.style.width="100%",i.tableElement.style.zIndex="-2147483640",i.tableElement.style.visibility="hidden",i.tableClassName=i.tableElement.className,i.tableStyle=i.tableElement.style.cssText,i}ll(e,t);var n=e.prototype;return n.widths=function(){this.tableElement.className=this.tableClassName+" "+oc("shadowTable"),this.tableElement.style.tableLayout="auto",this.tableElement.style.width="auto",this.tableElement.style.padding="0",this.tableElement.style.margin="0",this.tableElement.style.border="none",this.tableElement.style.outline="none";var t=Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){var n;return e.style.width=e.clientWidth+"px",sl(((n={})[e.getAttribute("data-column-id")]={minWidth:e.clientWidth},n),t)}),{});return this.tableElement.className=this.tableClassName,this.tableElement.style.cssText=this.tableStyle,this.tableElement.style.tableLayout="auto",Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){return t[e.getAttribute("data-column-id")].width=e.clientWidth,t}),t)},n.render=function(){var t=this;return this.props.tableRef.current?zl("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Kl);function zc(t){if(!t)return"";var e=t.split(" ");return 1===e.length&&/([a-z][A-Z])+/g.test(t)?t:e.map((function(t,e){return 0==e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()})).join("")}var Ac=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}ll(e,t);var n=e.prototype;return n.adjustWidth=function(t){var n=t.container,i=t.tableRef,r=t.tempRef,o=t.tempRef||!0;if(!n)return this;var a=n.clientWidth,s={current:null},l={};if(i.current&&o){var c=zl(kc,{tableRef:i});c.ref=s,ql(c,r.current),l=s.current.widths()}for(var h,p=dl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=p()).done;){var d=h.value;d.columns&&d.columns.length>0||(!d.width&&o?d.id in l&&(d.width=xc(l[d.id].width),d.minWidth=xc(l[d.id].minWidth)):d.width=xc(wc(d.width,a)))}return i.current&&o&&ql(null,r.current),this},n.setSort=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;r.columns&&r.columns.length>0&&(r.sort={enabled:!1}),void 0===r.sort&&t.sort&&(r.sort={enabled:!0}),r.sort?"object"==typeof r.sort&&(r.sort=sl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},n.setFixedHeader=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.fixedHeader&&(r.fixedHeader=t.fixedHeader),r.columns&&this.setFixedHeader(t,r.columns)}},n.setResizable=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.resizable&&(r.resizable=t.resizable),r.columns&&this.setResizable(t,r.columns)}},n.setID=function(t){for(var e,n=dl(t||this.columns||[]);!(e=n()).done;){var i=e.value;i.id||"string"!=typeof i.name||(i.id=zc(i.name)),i.id||uc.error('Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.'),i.columns&&this.setID(i.columns)}},n.populatePlugins=function(t,e){for(var n,i=dl(e);!(n=i()).done;){var r=n.value;void 0!==r.plugin&&t.plugin.add(sl({id:r.id,props:{}},r.plugin,{position:sc.Cell}))}},e.fromColumns=function(t){for(var n,i=new e,r=dl(t);!(n=r()).done;){var o=n.value;if("string"==typeof o||gl(o))i.columns.push({name:o});else if("object"==typeof o){var a=o;a.columns&&(a.columns=e.fromColumns(a.columns).columns),"object"==typeof a.plugin&&void 0===a.data&&(a.data=null),i.columns.push(o)}}return i},e.fromUserConfig=function(t){var n=new e;return t.from?n.columns=e.fromHTMLTable(t.from).columns:t.columns?n.columns=e.fromColumns(t.columns).columns:!t.data||"object"!=typeof t.data[0]||t.data[0]instanceof Array||(n.columns=Object.keys(t.data[0]).map((function(t){return{name:t}}))),n.columns.length?(n.setID(),n.setSort(t),n.setFixedHeader(t),n.setResizable(t),n.populatePlugins(t,n.columns),n):null},e.fromHTMLTable=function(t){for(var n,i=new e,r=dl(t.querySelector("thead").querySelectorAll("th"));!(n=r()).done;){var o=n.value;i.columns.push({name:o.innerHTML,width:o.width})}return i},e.tabularFormat=function(t){var e=[],n=t||[],i=[];if(n&&n.length){e.push(n);for(var r,o=dl(n);!(r=o()).done;){var a=r.value;a.columns&&a.columns.length&&(i=i.concat(a.columns))}i.length&&(e=e.concat(this.tabularFormat(i)))}return e},e.leafColumns=function(t){var e=[],n=t||[];if(n&&n.length)for(var i,r=dl(n);!(i=r()).done;){var o=i.value;o.columns&&0!==o.columns.length||e.push(o),o.columns&&(e=e.concat(this.leafColumns(o.columns)))}return e},e.maximumDepth=function(t){return this.tabularFormat([t]).length-1},al(e,[{key:"columns",get:function(){return this._columns},set:function(t){this._columns=t}},{key:"visibleColumns",get:function(){return this._columns.filter((function(t){return!t.hidden}))}}]),e}(Wl),Sc=function(){function t(){this._callbacks=void 0,this._isDispatching=void 0,this._isHandled=void 0,this._isPending=void 0,this._lastID=void 0,this._pendingPayload=void 0,this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}var e=t.prototype;return e.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},e.unregister=function(t){if(!this._callbacks[t])throw Error("Dispatcher.unregister(...): "+t+" does not map to a registered callback.");delete this._callbacks[t]},e.waitFor=function(t){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];if(this._isPending[n]){if(!this._isHandled[n])throw Error("Dispatcher.waitFor(...): Circular dependency detected while ' +\n 'waiting for "+n+".")}else{if(!this._callbacks[n])throw Error("Dispatcher.waitFor(...): "+n+" does not map to a registered callback.");this._invokeCallback(n)}}},e.dispatch=function(t){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},e.isDispatching=function(){return this._isDispatching},e._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},e._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},e._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}(),Cc=function(){},Ec=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.set(e),n}ll(e,t);var n=e.prototype;return n.get=function(){try{return Promise.resolve(this.data()).then((function(t){return{data:t,total:t.length}}))}catch(t){return Promise.reject(t)}},n.set=function(t){return t instanceof Array?this.data=function(){return t}:t instanceof Function&&(this.data=t),this},e}(Cc),Mc=function(t){function e(e){var n;return(n=t.call(this)||this).options=void 0,n.options=e,n}ll(e,t);var n=e.prototype;return n.handler=function(t){return"function"==typeof this.options.handle?this.options.handle(t):t.ok?t.json():(uc.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},n.get=function(t){var e=sl({},this.options,t);return"function"==typeof e.data?e.data(e):fetch(e.url,e).then(this.handler.bind(this)).then((function(t){return{data:e.then(t),total:"function"==typeof e.total?e.total(t):void 0}}))},e}(Cc),Lc=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new Ec(t.data)),t.from&&(e=new Ec(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new Mc(t.server)),e||uc.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,n,i=[],r=dl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,a=[],s=dl(e.value.querySelectorAll("td"));!(o=s()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?a.push((n=l.innerHTML,(new DOMParser).parseFromString(n,"text/html").documentElement.textContent)):a.push(Ql(l.innerHTML))}i.push(a)}return i},t}(),Hc="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Tc(t,e,n){if(!t.s){if(n instanceof Vc){if(!n.s)return void(n.o=Tc.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(Tc.bind(null,t,e),Tc.bind(null,t,2));t.s=e,t.v=n;var i=t.o;i&&i(t)}}var Vc=function(){function t(){}return t.prototype.then=function(e,n){var i=new t,r=this.s;if(r){var o=1&r?e:n;if(o){try{Tc(i,1,o(this.v))}catch(t){Tc(i,2,t)}return i}return this}return this.o=function(t){try{var r=t.v;1&t.s?Tc(i,1,e?e(r):r):n?Tc(i,1,n(r)):Tc(i,2,r)}catch(t){Tc(i,2,t)}},i},t}();function $c(t){return t instanceof Vc&&1&t.s}var Oc,Pc=function(t){function e(e){var n;return(n=t.call(this)||this)._steps=new Map,n.cache=new Map,n.lastProcessorIndexUpdated=-1,e&&e.forEach((function(t){return n.register(t)})),n}ll(e,t);var n=e.prototype;return n.clearCache=function(){this.cache=new Map,this.lastProcessorIndexUpdated=-1},n.register=function(t,e){if(void 0===e&&(e=null),null===t.type)throw Error("Processor type is not defined");t.on("propsUpdated",this.processorPropsUpdated.bind(this)),this.addProcessorByPriority(t,e),this.afterRegistered(t)},n.unregister=function(t){if(t){var e=this._steps.get(t.type);e&&e.length&&(this._steps.set(t.type,e.filter((function(e){return e!=t}))),this.emit("updated",t))}},n.addProcessorByPriority=function(t,e){var n=this._steps.get(t.type);if(!n){var i=[];this._steps.set(t.type,i),n=i}if(null===e||e<0)n.push(t);else if(n[e]){var r=n.slice(0,e-1),o=n.slice(e+1);this._steps.set(t.type,r.concat(t).concat(o))}else n[e]=t},n.getStepsByType=function(t){return this.steps.filter((function(e){return e.type===t}))},n.getSortedProcessorTypes=function(){return Object.keys(Yl).filter((function(t){return!isNaN(Number(t))})).map((function(t){return Number(t)}))},n.process=function(t){try{var e=this,n=function(t){return e.lastProcessorIndexUpdated=r.length,e.emit("afterProcess",o),o},i=e.lastProcessorIndexUpdated,r=e.steps,o=t,a=function(t,n){try{var a=function(t,e,n){if("function"==typeof t[Hc]){var i,r,o,a=t[Hc]();if(function t(n){try{for(;!(i=a.next()).done;)if((n=e(i.value))&&n.then){if(!$c(n))return void n.then(t,o||(o=Tc.bind(null,r=new Vc,2)));n=n.v}r?Tc(r,1,n):r=n}catch(t){Tc(r||(r=new Vc),2,t)}}(),a.return){var s=function(t){try{i.done||a.return()}catch(t){}return t};if(r&&r.then)return r.then(s,(function(t){throw s(t)}));s()}return r}if(!("length"in t))throw new TypeError("Object is not iterable");for(var l=[],c=0;c<t.length;c++)l.push(t[c]);return function(t,e,n){var i,r,o=-1;return function n(a){try{for(;++o<t.length;)if((a=e(o))&&a.then){if(!$c(a))return void a.then(n,r||(r=Tc.bind(null,i=new Vc,2)));a=a.v}i?Tc(i,1,a):i=a}catch(t){Tc(i||(i=new Vc),2,t)}}(),i}(l,(function(t){return e(l[t])}))}(r,(function(t){var n=e.findProcessorIndexByID(t.id),r=function(){if(n>=i)return Promise.resolve(t.process(o)).then((function(n){e.cache.set(t.id,o=n)}));o=e.cache.get(t.id)}();if(r&&r.then)return r.then((function(){}))}))}catch(t){return n(t)}return a&&a.then?a.then(void 0,n):a}(0,(function(t){throw uc.error(t),e.emit("error",o),t}));return Promise.resolve(a&&a.then?a.then(n):n())}catch(t){return Promise.reject(t)}},n.findProcessorIndexByID=function(t){return this.steps.findIndex((function(e){return e.id==t}))},n.setLastProcessorIndex=function(t){var e=this.findProcessorIndexByID(t.id);this.lastProcessorIndexUpdated>e&&(this.lastProcessorIndexUpdated=e)},n.processorPropsUpdated=function(t){this.setLastProcessorIndex(t),this.emit("propsUpdated"),this.emit("updated",t)},n.afterRegistered=function(t){this.setLastProcessorIndex(t),this.emit("afterRegister"),this.emit("updated",t)},al(e,[{key:"steps",get:function(){for(var t,e=[],n=dl(this.getSortedProcessorTypes());!(t=n()).done;){var i=this._steps.get(t.value);i&&i.length&&(e=e.concat(i))}return e.filter((function(t){return t}))}}]),e}(nc),Rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},al(e,[{key:"type",get:function(){return Yl.Extractor}}]),e}(ic),Ic=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e=ec.fromArray(t.data);return e.length=t.total,e},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Nc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(){return Object.entries(this.props.serverStorageOptions).filter((function(t){return"function"!=typeof t[1]})).reduce((function(t,e){var n;return sl({},t,((n={})[e[0]]=e[1],n))}),{})},al(e,[{key:"type",get:function(){return Yl.Initiator}}]),e}(ic),Fc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.castData=function(t){if(!t||!t.length)return[];if(!this.props.header||!this.props.header.columns)return t;var e=Ac.leafColumns(this.props.header.columns);return t[0]instanceof Array?t.map((function(t){var n=0;return e.map((function(e,i){return void 0!==e.data?(n++,"function"==typeof e.data?e.data(t):e.data):t[i-n]}))})):"object"!=typeof t[0]||t[0]instanceof Array?[]:t.map((function(t){return e.map((function(e,n){return void 0!==e.data?"function"==typeof e.data?e.data(t):e.data:e.id?t[e.id]:(uc.error("Could not find the correct cell for column at position "+n+".\n Make sure either 'id' or 'selector' is defined for all columns."),null)}))}))},n._process=function(t){return{data:this.castData(t.data),total:t.total}},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Bc=function(){function t(){}return t.createFromConfig=function(t){var e=new Pc;return t.storage instanceof Mc&&e.register(new Nc({serverStorageOptions:t.server})),e.register(new Rc({storage:t.storage})),e.register(new Fc({header:t.header})),e.register(new Ic),e},t}(),Dc=function(){function t(e){this._userConfig=void 0,Object.assign(this,sl({},t.defaultConfig(),e)),this._userConfig={}}var e=t.prototype;return e.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var i=n[e];"_userConfig"!==i&&(this[i]=t[i])}return this},e.update=function(e){return e?(this._userConfig=sl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new fc,dispatcher:new Sc,tableRef:{current:null},tempRef:{current:null},width:"100%",height:"auto",autoWidth:!0,style:{},className:{}}},t.fromUserConfig=function(e){var n=new t(e);return n._userConfig=e,"boolean"==typeof e.sort&&e.sort&&n.assign({sort:{multiColumn:!0}}),n.assign({header:Ac.fromUserConfig(n)}),n.assign({storage:Lc.createFromUserConfig(e)}),n.assign({pipeline:Bc.createFromConfig(n)}),n.assign({translator:new Xl(e.language)}),n.plugin.add({id:"search",position:sc.Header,component:vc,props:sl({enabled:!0===e.search||e.search instanceof Object},e.search)}),n.plugin.add({id:"pagination",position:sc.Footer,component:_c,props:sl({enabled:!0===e.pagination||e.pagination instanceof Object},e.pagination)}),e.plugins&&e.plugins.forEach((function(t){return n.plugin.add(t)})),n},t}();!function(t){t[t.Init=0]="Init",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Rendered=3]="Rendered",t[t.Error=4]="Error"}(Oc||(Oc={}));var jc,qc,Uc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.content=function(){return this.props.column&&"function"==typeof this.props.column.formatter?this.props.column.formatter(this.props.cell.data,this.props.row,this.props.column):this.props.column&&this.props.column.plugin?zl(mc,{pluginId:this.props.column.id,props:{column:this.props.column,cell:this.props.cell,row:this.props.row}}):this.props.cell.data},n.handleClick=function(t){this.props.messageCell||this.config.eventEmitter.emit("cellClick",t,this.props.cell,this.props.column,this.props.row)},n.getCustomAttributes=function(t){return t?"function"==typeof t.attributes?t.attributes(this.props.cell.data,this.props.row,this.props.column):t.attributes:{}},n.render=function(){return zl("td",sl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("td"),this.props.className,this.config.className.td),style:sl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Kl),Wc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getColumn=function(t){if(this.props.header){var e=Ac.leafColumns(this.props.header.columns);if(e)return e[t]}return null},n.handleClick=function(t){this.props.messageRow||this.config.eventEmitter.emit("rowClick",t,this.props.row)},n.getChildren=function(){var t=this;return this.props.children?this.props.children:zl(Sl,null,this.props.row.cells.map((function(e,n){var i=t.getColumn(n);return i&&i.hidden?null:zl(Uc,{key:e.id,cell:e,row:t.props.row,column:i})})))},n.render=function(){return zl("tr",{className:ac(oc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Kl),Gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(Wc,{messageRow:!0},zl(Uc,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Jl(this.props.message),className:ac(oc("message"),this.props.className?this.props.className:null)}))},e}(Kl),Xc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.headerLength=function(){return this.props.header?this.props.header.visibleColumns.length:0},n.render=function(){var t=this;return zl("tbody",{className:ac(oc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return zl(Wc,{key:e.id,row:e,header:t.props.header})})),this.props.status===Oc.Loading&&(!this.props.data||0===this.props.data.length)&&zl(Gc,{message:this._("loading"),colSpan:this.headerLength(),className:ac(oc("loading"),this.config.className.loading)}),this.props.status===Oc.Rendered&&this.props.data&&0===this.props.data.length&&zl(Gc,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:ac(oc("notfound"),this.config.className.notfound)}),this.props.status===Oc.Error&&zl(Gc,{message:this._("error"),colSpan:this.headerLength(),className:ac(oc("error"),this.config.className.error)}))},e}(Kl),Kc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){for(var t,e=dl(this.props.columns);!(t=e()).done;){var n=t.value;void 0===n.direction&&(n.direction=1),1!==n.direction&&-1!==n.direction&&uc.error("Invalid sort direction "+n.direction)}},n.compare=function(t,e){return t>e?1:t<e?-1:0},n.compareWrapper=function(t,e){for(var n,i=0,r=dl(this.props.columns);!(n=r()).done;){var o=n.value;if(0!==i)break;var a=t.cells[o.index].data,s=e.cells[o.index].data;i|="function"==typeof o.compare?o.compare(a,s)*o.direction:this.compare(a,s)*o.direction}return i},n._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var n=new ec(e);return n.length=t.length,n},al(e,[{key:"type",get:function(){return Yl.Sort}}]),e}(ic),Zc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return[]},n.handle=function(t,e){"SORT_COLUMN"===t?this.sortColumn(e.index,e.direction,e.multi,e.compare):"SORT_COLUMN_TOGGLE"===t&&this.sortToggle(e.index,e.multi,e.compare)},n.sortToggle=function(t,e,n){var i=[].concat(this.state).find((function(e){return e.index===t}));this.sortColumn(t,i&&1===i.direction?-1:1,e,n)},n.sortColumn=function(t,e,n,i){var r=[].concat(this.state),o=r.length,a=r.find((function(e){return e.index===t})),s=!1,l=!1,c=!1,h=!1;if(void 0!==a?n?-1===a.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,s=!0):0===o?s=!0:o>0&&!n?(s=!0,l=!0):o>0&&n&&(s=!0),l&&(r=[]),s)r.push({index:t,direction:e,compare:i});else if(h){var p=r.indexOf(a);r[p].direction=e}else if(c){var d=r.indexOf(a);r.splice(d,1)}this.setState(r)},e}(lc),Qc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.sortColumn=function(t,e,n,i){this.dispatch("SORT_COLUMN",{index:t,direction:e,multi:n,compare:i})},n.sortToggle=function(t,e,n){this.dispatch("SORT_COLUMN_TOGGLE",{index:t,multi:e,compare:n})},e}(hc),Yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.columns)),this.props.body&&(e.body=this.props.body(t.body,this.props.columns)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerSort}}]),e}(ic),Jc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortProcessor=void 0,i.actions=void 0,i.store=void 0,i.updateStateFn=void 0,i.updateSortProcessorFn=void 0,i.actions=new Qc(i.config.dispatcher),i.store=new Zc(i.config.dispatcher),e.enabled&&(i.sortProcessor=i.getOrCreateSortProcessor(),i.updateStateFn=i.updateState.bind(hl(i)),i.store.on("updated",i.updateStateFn),i.state={direction:0}),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.sortProcessor),this.store.off("updated",this.updateStateFn),this.updateSortProcessorFn&&this.store.off("updated",this.updateSortProcessorFn)},n.updateState=function(){var t=this,e=this.store.state.find((function(e){return e.index===t.props.index}));this.setState(e?{direction:e.direction}:{direction:0})},n.updateSortProcessor=function(t){this.sortProcessor.setProps({columns:t})},n.getOrCreateSortProcessor=function(){var t=Yl.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Yl.ServerSort);var e,n=this.config.pipeline.getStepsByType(t);return n.length>0?e=n[0]:(this.updateSortProcessorFn=this.updateSortProcessor.bind(this),this.store.on("updated",this.updateSortProcessorFn),e=t===Yl.ServerSort?new Yc(sl({columns:this.store.state},this.config.sort.server)):new Kc({columns:this.store.state}),this.config.pipeline.register(e)),e},n.changeDirection=function(t){t.preventDefault(),t.stopPropagation(),this.actions.sortToggle(this.props.index,!0===t.shiftKey&&this.config.sort.multiColumn,this.props.compare)},n.render=function(){if(!this.props.enabled)return null;var t=this.state.direction,e="neutral";return 1===t?e="asc":-1===t&&(e="desc"),zl("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:ac(oc("sort"),oc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Kl),th=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).moveFn=void 0,e.upFn=void 0,e}ll(e,t);var n=e.prototype;return n.getPageX=function(t){return t instanceof MouseEvent?Math.floor(t.pageX):Math.floor(t.changedTouches[0].pageX)},n.start=function(t){var e,n,i,r,o;t.stopPropagation(),this.setState({offsetStart:parseInt(this.props.thRef.current.style.width,10)-this.getPageX(t)}),this.upFn=this.end.bind(this),this.moveFn=(e=this.move.bind(this),void 0===(n=10)&&(n=100),function(){var t=[].slice.call(arguments);i?(clearTimeout(r),r=setTimeout((function(){Date.now()-o>=n&&(e.apply(void 0,t),o=Date.now())}),Math.max(n-(Date.now()-o),0))):(e.apply(void 0,t),o=Date.now(),i=!0)}),document.addEventListener("mouseup",this.upFn),document.addEventListener("touchend",this.upFn),document.addEventListener("mousemove",this.moveFn),document.addEventListener("touchmove",this.moveFn)},n.move=function(t){t.stopPropagation();var e=this.props.thRef.current;this.state.offsetStart+this.getPageX(t)>=parseInt(e.style.minWidth,10)&&(e.style.width=this.state.offsetStart+this.getPageX(t)+"px")},n.end=function(t){t.stopPropagation(),document.removeEventListener("mouseup",this.upFn),document.removeEventListener("mousemove",this.moveFn),document.removeEventListener("touchmove",this.moveFn),document.removeEventListener("touchend",this.upFn)},n.render=function(){return zl("div",{className:ac(oc("th"),oc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Kl),eh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortRef={current:null},i.thRef={current:null},i.state={style:{}},i}ll(e,t);var n=e.prototype;return n.isSortable=function(){return this.props.column.sort.enabled},n.isResizable=function(){return this.props.column.resizable},n.onClick=function(t){t.stopPropagation(),this.isSortable()&&this.sortRef.current.changeDirection(t)},n.keyDown=function(t){this.isSortable()&&13===t.which&&this.onClick(t)},n.componentDidMount=function(){var t=this;setTimeout((function(){if(t.props.column.fixedHeader&&t.thRef.current){var e=t.thRef.current.offsetTop;"number"==typeof e&&t.setState({style:{top:e}})}}),0)},n.content=function(){return void 0!==this.props.column.name?this.props.column.name:void 0!==this.props.column.plugin?zl(mc,{pluginId:this.props.column.plugin.id,props:{column:this.props.column}}):null},n.getCustomAttributes=function(){var t=this.props.column;return t?"function"==typeof t.attributes?t.attributes(null,null,this.props.column):t.attributes:{}},n.render=function(){var t={};return this.isSortable()&&(t.tabIndex=0),zl("th",sl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("th"),this.isSortable()?oc("th","sort"):null,this.props.column.fixedHeader?oc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:sl({},this.config.style.th,{minWidth:this.props.column.minWidth,width:this.props.column.width},this.state.style,this.props.style),onKeyDown:this.keyDown.bind(this),rowSpan:this.props.rowSpan>1?this.props.rowSpan:void 0,colSpan:this.props.colSpan>1?this.props.colSpan:void 0},this.getCustomAttributes(),t),zl("div",{className:oc("th","content")},this.content()),this.isSortable()&&zl(Jc,sl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&zl(th,{column:this.props.column,thRef:this.thRef}))},e}(Kl),nh=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.renderColumn=function(t,e,n,i){var r=function(t,e,n){var i=Ac.maximumDepth(t),r=n-e;return{rowSpan:Math.floor(r-i-i/r),colSpan:t.columns&&t.columns.length||1}}(t,e,i);return zl(eh,{column:t,index:n,colSpan:r.colSpan,rowSpan:r.rowSpan})},n.renderRow=function(t,e,n){var i=this,r=Ac.leafColumns(this.props.header.columns);return zl(Wc,null,t.map((function(t){return t.hidden?null:i.renderColumn(t,e,r.indexOf(t),n)})))},n.renderRows=function(){var t=this,e=Ac.tabularFormat(this.props.header.columns);return e.map((function(n,i){return t.renderRow(n,i,e.length)}))},n.render=function(){return this.props.header?zl("thead",{key:this.props.header.id,className:ac(oc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Kl),ih=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl("table",{role:"grid",className:ac(oc("table"),this.config.className.table),style:sl({},this.config.style.table,{height:this.props.height})},zl(nh,{header:this.props.header}),zl(Xc,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Kl),rh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).headerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.headerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.headerRef,className:ac(oc("head"),this.config.className.header),style:sl({},this.config.style.header)},zl(mc,{position:sc.Header})):null},e}(Kl),oh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).footerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.footerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.footerRef,className:ac(oc("footer"),this.config.className.footer),style:sl({},this.config.style.footer)},zl(mc,{position:sc.Footer})):null},e}(Kl),ah=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).configContext=void 0,i.processPipelineFn=void 0,i.configContext=function(t,e){var n={__c:e="__cC"+bl++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(Ll)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}(),i.state={status:Oc.Loading,header:e.header,data:null},i}ll(e,t);var n=e.prototype;return n.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Oc.Loading});var e=function(e,n){try{var i=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Oc.Loaded}),t.props.config.eventEmitter.emit("load",e)}))}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}(0,(function(e){uc.error(e),t.setState({status:Oc.Error,data:null})}));return Promise.resolve(e&&e.then?e.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},n.componentDidMount=function(){try{var t=this,e=t.props.config;return Promise.resolve(t.processPipeline()).then((function(){e.header&&t.state.data&&t.state.data.length&&t.setState({header:e.header.adjustWidth(e)}),t.processPipelineFn=t.processPipeline.bind(t),t.props.pipeline.on("updated",t.processPipelineFn)}))}catch(t){return Promise.reject(t)}},n.componentWillUnmount=function(){this.props.pipeline.off("updated",this.processPipelineFn)},n.componentDidUpdate=function(t,e){e.status!=Oc.Rendered&&this.state.status==Oc.Loaded&&(this.setState({status:Oc.Rendered}),this.props.config.eventEmitter.emit("ready"))},n.render=function(){return zl(this.configContext.Provider,{value:this.props.config},zl("div",{role:"complementary",className:ac("gridjs",oc("container"),this.state.status===Oc.Loading?oc("loading"):null,this.props.config.className.container),style:sl({},this.props.config.style.container,{width:this.props.width})},this.state.status===Oc.Loading&&zl("div",{className:oc("loading-bar")}),zl(rh,null),zl("div",{className:oc("wrapper"),style:{height:this.props.height}},zl(ih,{ref:this.props.config.tableRef,data:this.state.data,header:this.state.header,width:this.props.width,height:this.props.height,status:this.state.status})),zl(oh,null),zl("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:oc("temp")})))},e}(Kl),sh=function(t){function e(e){var n;return(n=t.call(this)||this).config=void 0,n.plugin=void 0,n.config=new Dc({instance:hl(n),eventEmitter:hl(n)}).update(e),n.plugin=n.config.plugin,n}ll(e,t);var n=e.prototype;return n.updateConfig=function(t){return this.config.update(t),this},n.createElement=function(){return zl(ah,{config:this.config,pipeline:this.config.pipeline,header:this.config.header,width:this.config.width,height:this.config.height})},n.forceRender=function(){return this.config&&this.config.container||uc.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),ql(null,this.config.container),ql(this.createElement(),this.config.container),this},n.render=function(t){return t||uc.error("Container element cannot be null",!0),t.childNodes.length>0?(uc.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,ql(this.createElement(),t),this)},e}(nc),lh=[],ch=ul.__b,hh=ul.__r,ph=ul.diffed,dh=ul.__c,uh=ul.unmount;function gh(){lh.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(mh),t.__H.__h.forEach(vh),t.__H.__h=[]}catch(e){t.__H.__h=[],ul.__e(e,t.__v)}})),lh=[]}ul.__b=function(t){jc=null,ch&&ch(t)},ul.__r=function(t){hh&&hh(t),0;var e=(jc=t.__c).__H;e&&(e.__h.forEach(mh),e.__h.forEach(vh),e.__h=[])},ul.diffed=function(t){ph&&ph(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==lh.push(e)&&qc===ul.requestAnimationFrame||((qc=ul.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),fh&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);fh&&(e=requestAnimationFrame(n))})(gh)),jc=void 0},ul.__c=function(t,e){e.some((function(t){try{t.__h.forEach(mh),t.__h=t.__h.filter((function(t){return!t.__||vh(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ul.__e(n,t.__v)}})),dh&&dh(t,e)},ul.unmount=function(t){uh&&uh(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(mh)}catch(t){ul.__e(t,e.__v)}};var fh="function"==typeof requestAnimationFrame;function mh(t){var e=jc;"function"==typeof t.__c&&t.__c(),jc=e}function vh(t){var e=jc;t.__c=t.__(),jc=e}class bh extends V{static get properties(){return Object.assign({label:{type:String},property:{type:String},sort:{type:Boolean},width:{type:String}},super.properties)}constructor(){super(),this.label="no-label",this.property=null,this.sort=!1,this.width=null}connectedCallback(){super.connectedCallback()}data(){const t={name:this.label,sort:{enabled:this.sort},formatter:t=>Ql(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",bh);class yh extends(R(V)){static get properties(){return Object.assign({source:{type:String},cssPath:{type:String,attribute:"css-path"},resizable:{type:Boolean},perPage:{type:Number,attribute:"per-page"},height:{type:String},search:{type:Boolean},_params:{type:Object}},super.properties)}constructor(){super(),this.cssPath="../css/gridjs",this._params={},this.resizable=!1,this.search=!1,this.perPage=10,this.height=null,this.fixedHeader=!1}connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),window.addEventListener("popstate",t=>{this._params=t.state,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),n=[];e.forEach(t=>n.push(t.data())),yh.waitOnce("pb-page-ready",()=>{this._params=this.getParameters();const e=this.toAbsoluteURL(this.source),i={height:this.height,fixedHeader:!0,columns:n,resizable:this.resizable,server:{url:e,then:t=>t.results,total:t=>t.count},sort:{multiColumn:!1,enabled:!0,server:{url:(t,e)=>{if(!e.length)return t;const i=e[0];return`${t}${t.indexOf("?")>-1?"&":"?"}order=${n[i.index].id}&dir=${1===i.direction?"asc":"desc"}`}}},pagination:{enabled:!0,limit:this.perPage,server:{url:(t,e,n)=>{const i=this.shadowRoot.getElementById("form");return i&&Object.assign(this._params,i.serializeForm()),this._params.limit=n,this._params.start=e*n,this.setParameters(this._params),this.pushHistory("grid",this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new sh(i),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){const t=O(this.cssPath);return $`
|
|
4224
|
+
`}}function ol(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function al(t,e,n){return e&&ol(t.prototype,e),n&&ol(t,n),t}function sl(){return(sl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function ll(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cl(t,e)}function cl(t,e){return(cl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function dl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}customElements.define("pb-blacklab-highlight",rl);var ul,gl,fl,ml,vl,bl,yl={},_l=[],wl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xl(t,e){for(var n in e)t[n]=e[n];return t}function kl(t){var e=t.parentNode;e&&e.removeChild(t)}function zl(t,e,n){var i,r,o,a=arguments,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>3)for(n=[n],o=3;o<arguments.length;o++)n.push(a[o]);if(null!=n&&(s.children=n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Al(t,s,i,r,null)}function Al(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++ul.__v:r};return null!=ul.vnode&&ul.vnode(o),o}function Sl(t){return t.children}function Cl(t,e){this.props=t,this.context=e}function El(t,e){if(null==e)return t.__?El(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?El(t):null}function Ml(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Ml(t)}}function Ll(t){(!t.__d&&(t.__d=!0)&&fl.push(t)&&!Hl.__r++||vl!==ul.debounceRendering)&&((vl=ul.debounceRendering)||ml)(Hl)}function Hl(){for(var t;Hl.__r=fl.length;)t=fl.sort((function(t,e){return t.__v.__b-e.__v.__b})),fl=[],t.some((function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=xl({},r)).__v=r.__v+1,Nl(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?El(r):o,r.__h),Fl(n,r),r.__e!=o&&Ml(r)))}))}function Tl(t,e,n,i,r,o,a,s,l,c){var h,p,d,u,g,f,m,v=i&&i.__k||_l,b=v.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(u=n.__k[h]=null==(u=e[h])||"boolean"==typeof u?null:"string"==typeof u||"number"==typeof u||"bigint"==typeof u?Al(null,u,null,null,u):Array.isArray(u)?Al(Sl,{children:u},null,null,null):u.__b>0?Al(u.type,u.props,u.key,null,u.__v):u)){if(u.__=n,u.__b=n.__b+1,null===(d=v[h])||d&&u.key==d.key&&u.type===d.type)v[h]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&u.key==d.key&&u.type===d.type){v[p]=void 0;break}d=null}Nl(t,u,d=d||yl,r,o,a,s,l,c),g=u.__e,(p=u.ref)&&d.ref!=p&&(m||(m=[]),d.ref&&m.push(d.ref,null,u),m.push(p,u.__c||g,u)),null!=g?(null==f&&(f=g),"function"==typeof u.type&&null!=u.__k&&u.__k===d.__k?u.__d=l=Vl(u,l,t):l=$l(t,u,d,v,g,l),c||"option"!==n.type?"function"==typeof n.type&&(n.__d=l):t.value=""):l&&d.__e==l&&l.parentNode!=t&&(l=El(d))}for(n.__e=f,h=b;h--;)null!=v[h]&&("function"==typeof n.type&&null!=v[h].__e&&v[h].__e==n.__d&&(n.__d=El(i,h+1)),Dl(v[h],v[h]));if(m)for(h=0;h<m.length;h++)Bl(m[h],m[++h],m[++h])}function Vl(t,e,n){var i,r;for(i=0;i<t.__k.length;i++)(r=t.__k[i])&&(r.__=t,e="function"==typeof r.type?Vl(r,e,n):$l(n,r,r,t.__k,r.__e,e));return e}function $l(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Ol(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||wl.test(e)?n:n+"px"}function Pl(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ol(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||Ol(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?Il:Rl,o):t.removeEventListener(e,o?Il:Rl,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function Rl(t){this.l[t.type+!1](ul.event?ul.event(t):t)}function Il(t){this.l[t.type+!0](ul.event?ul.event(t):t)}function Nl(t,e,n,i,r,o,a,s,l){var c,h,p,d,u,g,f,m,v,b,y,_=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=ul.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,v=(c=_.contextType)&&i[c.__c],b=c?v?v.props.value:c.__:i,n.__c?f=(h=e.__c=n.__c).__=h.__E:("prototype"in _&&_.prototype.render?e.__c=h=new _(m,b):(e.__c=h=new Cl(m,b),h.constructor=_,h.render=jl),v&&v.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=i,p=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=_.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=xl({},h.__s)),xl(h.__s,_.getDerivedStateFromProps(m,h.__s))),d=h.props,u=h.state,p)null==_.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===n.__v){h.props=m,h.state=h.__s,e.__v!==n.__v&&(h.__d=!1),h.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),h.__h.length&&a.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,u,g)}))}h.context=b,h.props=m,h.state=h.__s,(c=ul.__r)&&c(e),h.__d=!1,h.__v=e,h.__P=t,c=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(i=xl(xl({},i),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(d,u)),y=null!=c&&c.type===Sl&&null==c.key?c.props.children:c,Tl(t,Array.isArray(y)?y:[y],e,n,i,r,o,a,s,l),h.base=e.__e,e.__h=null,h.__h.length&&a.push(h),f&&(h.__E=h.__=null),h.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,i,r,o,a,s){var l,c,h,p,d=n.props,u=e.props,g=e.type,f=0;if("svg"===g&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&(l===t||(g?l.localName==g:3==l.nodeType))){t=l,o[f]=null;break}if(null==t){if(null===g)return document.createTextNode(u);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,u.is&&u),o=null,s=!1}if(null===g)d===u||s&&t.data===u||(t.data=u);else{if(o=o&&_l.slice.call(t.childNodes),c=(d=n.props||yl).dangerouslySetInnerHTML,h=u.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<t.attributes.length;p++)d[t.attributes[p].name]=t.attributes[p].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||Pl(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||Pl(t,o,e[o],n[o],i)}(t,u,d,r,s),h)e.__k=[];else if(f=e.props.children,Tl(t,Array.isArray(f)?f:[f],e,n,i,r&&"foreignObject"!==g,o,a,t.firstChild,s),null!=o)for(f=o.length;f--;)null!=o[f]&&kl(o[f]);s||("value"in u&&void 0!==(f=u.value)&&(f!==t.value||"progress"===g&&!f)&&Pl(t,"value",f,d.value,!1),"checked"in u&&void 0!==(f=u.checked)&&f!==t.checked&&Pl(t,"checked",f,d.checked,!1))}return t}(n.__e,e,n,i,r,o,a,l);(c=ul.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),ul.__e(t,e,n)}}function Fl(t,e){ul.__c&&ul.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ul.__e(t,e.__v)}}))}function Bl(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){ul.__e(t,n)}}function Dl(t,e,n){var i,r,o;if(ul.unmount&&ul.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Bl(i,null,e)),n||"function"==typeof t.type||(n=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ul.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&Dl(i[o],e,n);null!=r&&kl(r)}function jl(t,e,n){return this.constructor(t,n)}function ql(t,e,n){var i,r,o;ul.__&&ul.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],Nl(e,t=(!i&&n||e).__k=zl(Sl,null,[t]),r||yl,yl,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?_l.slice.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),Fl(o,t)}function Ul(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}ul={__e:function(t,e){for(var n,i,r;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),r=n.__d),r)return n.__E=n}catch(e){t=e}throw t},__v:0},gl=function(t){return null!=t&&void 0===t.constructor},Cl.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xl({},this.state),"function"==typeof t&&(t=t(xl({},n),this.props)),t&&xl(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),Ll(this))},Cl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ll(this))},Cl.prototype.render=Sl,fl=[],ml="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hl.__r=0,bl=0;var Wl=function(){function t(t){this._id=void 0,this._id=t||Ul()}return al(t,[{key:"id",get:function(){return this._id}}]),t}(),Gl={search:{placeholder:"Type a keyword..."},sort:{sortAsc:"Sort column ascending",sortDesc:"Sort column descending"},pagination:{previous:"Previous",next:"Next",navigate:function(t,e){return"Page "+t+" of "+e},page:function(t){return"Page "+t},showing:"Showing",of:"of",to:"to",results:"results"},loading:"Loading...",noRecordsFound:"No matching records found",error:"An error happened while fetching the data"},Xl=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=Gl}var e=t.prototype;return e.getString=function(t,e){if(!e||!t)return null;var n=t.split("."),i=n[0];if(e[i]){var r=e[i];return"string"==typeof r?function(){return r}:"function"==typeof r?r:this.getString(n.slice(1).join("."),r)}return null},e.translate=function(t){var e;return(e=this.getString(t,this._language)||this.getString(t,this._defaultLanguage))?e.apply(void 0,[].slice.call(arguments,1)):t},t}(),Kl=function(t){function e(e,n){var i,r;return(i=t.call(this,e,n)||this).config=void 0,i._=void 0,i.config=function(t){if(!t)return null;var e=Object.keys(t);return e.length?t[e[0]].props.value:null}(n),i.config&&(i._=(r=i.config.translator,function(t){return r.translate.apply(r,[t].concat([].slice.call(arguments,1)))})),i}return ll(e,t),e}(Cl),Zl=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(Kl);function Ql(t,e){return zl(Zl,{content:t,parentElement:e})}Zl.defaultProps={parentElement:"span"};var Yl,Jl=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.update(e),n}ll(e,t);var n=e.prototype;return n.cast=function(t){return t instanceof HTMLElement?Ql(t.outerHTML):t},n.update=function(t){return this.data=this.cast(t),this},e}(Wl),tc=function(t){function e(e){var n;return(n=t.call(this)||this)._cells=void 0,n.cells=e||[],n}ll(e,t);var n=e.prototype;return n.cell=function(t){return this._cells[t]},n.toArray=function(){return this.cells.map((function(t){return t.data}))},e.fromCells=function(t){return new e(t.map((function(t){return new Jl(t.data)})))},al(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(Wl),ec=function(t){function e(e){var n;return(n=t.call(this)||this)._rows=void 0,n._length=void 0,n.rows=e instanceof Array?e:e instanceof tc?[e]:[],n}return ll(e,t),e.prototype.toArray=function(){return this.rows.map((function(t){return t.toArray()}))},e.fromRows=function(t){return new e(t.map((function(t){return tc.fromCells(t.cells)})))},e.fromArray=function(t){return new e((t=function(t){return!t[0]||t[0]instanceof Array?t:[t]}(t)).map((function(t){return new tc(t.map((function(t){return new Jl(t)})))})))},al(e,[{key:"rows",get:function(){return this._rows},set:function(t){this._rows=t}},{key:"length",get:function(){return this._length||this.rows.length},set:function(t){this._length=t}}]),e}(Wl),nc=function(){function t(){this.callbacks=void 0}var e=t.prototype;return e.init=function(t){this.callbacks||(this.callbacks={}),t&&!this.callbacks[t]&&(this.callbacks[t]=[])},e.on=function(t,e){return this.init(t),this.callbacks[t].push(e),this},e.off=function(t,e){var n=t;return this.init(),this.callbacks[n]&&0!==this.callbacks[n].length?(this.callbacks[n]=this.callbacks[n].filter((function(t){return t!=e})),this):this},e.emit=function(t){var e=arguments,n=t;return this.init(n),this.callbacks[n].length>0&&(this.callbacks[n].forEach((function(t){return t.apply(void 0,[].slice.call(e,1))})),!0)},t}();!function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(Yl||(Yl={}));var ic=function(t){function e(e){var n;return(n=t.call(this)||this).id=void 0,n._props=void 0,n._props={},n.id=Ul(),e&&n.setProps(e),n}ll(e,t);var n=e.prototype;return n.process=function(){var t=[].slice.call(arguments);this.validateProps instanceof Function&&this.validateProps.apply(this,t),this.emit.apply(this,["beforeProcess"].concat(t));var e=this._process.apply(this,t);return this.emit.apply(this,["afterProcess"].concat(t)),e},n.setProps=function(t){return Object.assign(this._props,t),this.emit("propsUpdated",this),this},al(e,[{key:"props",get:function(){return this._props}}]),e}(nc),rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){return this.props.keyword?(e=String(this.props.keyword).trim(),n=this.props.columns,i=this.props.ignoreHiddenColumns,r=t,o=this.props.selector,e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new ec(r.rows.filter((function(t,r){return t.cells.some((function(t,a){if(!t)return!1;if(i&&n&&n[a]&&"object"==typeof n[a]&&n[a].hidden)return!1;var s="";if("function"==typeof o)s=o(t.data,r,a);else if("object"==typeof t.data){var l=t.data;l&&l.props&&l.props.content&&(s=l.props.content)}else s=String(t.data);return new RegExp(e,"gi").test(s)}))})))):t;var e,n,i,r,o},al(e,[{key:"type",get:function(){return Yl.Filter}}]),e}(ic);function oc(){return""+"gridjs"+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function ac(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var sc,lc=function(t){function e(e){var n;return(n=t.call(this)||this)._state=void 0,n.dispatcher=void 0,n.dispatcher=e,n._state=n.getInitialState(),e.register(n._handle.bind(hl(n))),n}ll(e,t);var n=e.prototype;return n._handle=function(t){this.handle(t.type,t.payload)},n.setState=function(t){var e=this._state;this._state=t,this.emit("updated",t,e)},al(e,[{key:"state",get:function(){return this._state}}]),e}(nc),cc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return{keyword:null}},n.handle=function(t,e){"SEARCH_KEYWORD"===t&&this.search(e.keyword)},n.search=function(t){this.setState({keyword:t})},e}(lc),hc=function(){function t(t){this.dispatcher=void 0,this.dispatcher=t}return t.prototype.dispatch=function(t,e){this.dispatcher.dispatch({type:t,payload:e})},t}(),pc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(hc),dc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){if(!this.props.keyword)return t;var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.keyword)),this.props.body&&(e.body=this.props.body(t.body,this.props.keyword)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerFilter}}]),e}(ic),uc=new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var n=this.format(t,"error");if(e)throw Error(n);console.error(n)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e}(Kl);!function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(sc||(sc={}));var fc=function(){function t(){this.plugins=void 0,this.plugins=[]}var e=t.prototype;return e.get=function(t){var e=this.plugins.filter((function(e){return e.id===t}));return e.length>0?e[0]:null},e.add=function(t){return t.id?null!==this.get(t.id)?(uc.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(uc.error("Plugin ID cannot be empty"),this)},e.remove=function(t){return this.plugins.splice(this.plugins.indexOf(this.get(t)),1),this},e.list=function(t){return(null!=t||null!=t?this.plugins.filter((function(e){return e.position===t})):this.plugins).sort((function(t,e){return t.order-e.order}))},t}(),mc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?zl(Sl,{},zl(e.component,sl({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?zl(Sl,{},this.config.plugin.list(this.props.position).map((function(e){return zl(e.component,sl({plugin:e},e.props,t.props.props))}))):null},e}(Kl),vc=function(t){function e(e,n){var i;(i=t.call(this,e,n)||this).searchProcessor=void 0,i.actions=void 0,i.store=void 0,i.storeUpdatedFn=void 0,i.actions=new pc(i.config.dispatcher),i.store=new cc(i.config.dispatcher);var r,o=e.keyword;return e.enabled&&(o&&i.actions.search(o),i.storeUpdatedFn=i.storeUpdated.bind(hl(i)),i.store.on("updated",i.storeUpdatedFn),r=e.server?new dc({keyword:e.keyword,url:e.server.url,body:e.server.body}):new rc({keyword:e.keyword,columns:i.config.header&&i.config.header.columns,ignoreHiddenColumns:e.ignoreHiddenColumns||void 0===e.ignoreHiddenColumns,selector:e.selector}),i.searchProcessor=r,i.config.pipeline.register(r)),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.searchProcessor),this.store.off("updated",this.storeUpdatedFn)},n.storeUpdated=function(t){this.searchProcessor.setProps({keyword:t.keyword})},n.onChange=function(t){this.actions.search(t.target.value)},n.render=function(){if(!this.props.enabled)return null;var t,e,n,i=this.onChange.bind(this);return this.searchProcessor instanceof dc&&(t=i,e=this.props.debounceTimeout,i=function(){var i=arguments;return new Promise((function(r){n&&clearTimeout(n),n=setTimeout((function(){return r(t.apply(void 0,[].slice.call(i)))}),e)}))}),zl("div",{className:oc(ac("search",this.config.className.search))},zl("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:i,className:ac(oc("input"),oc("search","input")),value:this.store.state.keyword}))},e}(gc);vc.defaultProps={debounceTimeout:250};var bc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){if(isNaN(Number(this.props.limit))||isNaN(Number(this.props.page)))throw Error("Invalid parameters passed")},n._process=function(t){var e=this.props.page;return new ec(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},al(e,[{key:"type",get:function(){return Yl.Limit}}]),e}(ic),yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.page,this.props.limit)),this.props.body&&(e.body=this.props.body(t.body,this.props.page,this.props.limit)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerLimit}}]),e}(ic),_c=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).processor=void 0,i.onUpdateFn=void 0,i.setTotalFromTabularFn=void 0,i.state={limit:e.limit,page:e.page||0,total:0},i}ll(e,t);var n=e.prototype;return n.componentWillMount=function(){var t,e=this;this.props.enabled&&(this.setTotalFromTabularFn=this.setTotalFromTabular.bind(this),this.props.server?(t=new yc({limit:this.state.limit,page:this.state.page,url:this.props.server.url,body:this.props.server.body}),this.config.pipeline.on("afterProcess",this.setTotalFromTabularFn)):(t=new bc({limit:this.state.limit,page:this.state.page})).on("beforeProcess",this.setTotalFromTabularFn),this.processor=t,this.config.pipeline.register(t),this.config.pipeline.on("error",(function(){e.setState({total:0,page:0})})))},n.setTotalFromTabular=function(t){this.setTotal(t.length)},n.onUpdate=function(t){this.props.resetPageOnUpdate&&t!==this.processor&&this.setPage(0)},n.componentDidMount=function(){this.onUpdateFn=this.onUpdate.bind(this),this.config.pipeline.on("updated",this.onUpdateFn)},n.componentWillUnmount=function(){this.config.pipeline.unregister(this.processor),this.config.pipeline.off("updated",this.onUpdateFn)},n.setPage=function(t){if(t>=this.pages||t<0||t===this.state.page)return null;this.setState({page:t}),this.processor.setProps({page:t})},n.setTotal=function(t){this.setState({total:t})},n.renderPages=function(){var t=this;if(this.props.buttonsCount<=0)return null;var e=Math.min(this.pages,this.props.buttonsCount),n=Math.min(this.state.page,Math.floor(e/2));return this.state.page+Math.floor(e/2)>=this.pages&&(n=e-(this.pages-this.state.page)),zl(Sl,null,this.pages>e&&this.state.page-n>0&&zl(Sl,null,zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,0),title:this._("pagination.firstPage"),"aria-label":this._("pagination.firstPage"),className:this.config.className.paginationButton},this._("1")),zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-n)})).map((function(e){return zl("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:ac(t.state.page===e?ac(oc("currentPage"),t.config.className.paginationButtonCurrent):null,t.config.className.paginationButton),title:t._("pagination.page",e+1),"aria-label":t._("pagination.page",e+1)},t._(""+(e+1)))})),this.pages>e&&this.pages>this.state.page+n+1&&zl(Sl,null,zl("button",{tabIndex:-1,className:ac(oc("spread"),this.config.className.paginationButton)},"..."),zl("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,this.pages-1),title:this._("pagination.page",this.pages),"aria-label":this._("pagination.page",this.pages),className:this.config.className.paginationButton},this._(""+this.pages))))},n.renderSummary=function(){return zl(Sl,null,this.props.summary&&this.state.total>0&&zl("div",{role:"status","aria-live":"polite",className:ac(oc("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",zl("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",zl("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",zl("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},n.render=function(){return this.props.enabled?zl("div",{className:ac(oc("pagination"),this.config.className.pagination)},this.renderSummary(),zl("div",{className:oc("pages")},this.props.prevButton&&zl("button",{tabIndex:0,role:"button",disabled:0===this.state.page,onClick:this.setPage.bind(this,this.state.page-1),title:this._("pagination.previous"),"aria-label":this._("pagination.previous"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&zl("button",{tabIndex:0,role:"button",disabled:this.pages===this.state.page+1||0===this.pages,onClick:this.setPage.bind(this,this.state.page+1),title:this._("pagination.next"),"aria-label":this._("pagination.next"),className:ac(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},al(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(gc);function wc(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function xc(t){return t?Math.floor(t)+"px":""}_c.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var kc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).tableElement=void 0,i.tableClassName=void 0,i.tableStyle=void 0,i.tableElement=i.props.tableRef.current.base.cloneNode(!0),i.tableElement.style.position="absolute",i.tableElement.style.width="100%",i.tableElement.style.zIndex="-2147483640",i.tableElement.style.visibility="hidden",i.tableClassName=i.tableElement.className,i.tableStyle=i.tableElement.style.cssText,i}ll(e,t);var n=e.prototype;return n.widths=function(){this.tableElement.className=this.tableClassName+" "+oc("shadowTable"),this.tableElement.style.tableLayout="auto",this.tableElement.style.width="auto",this.tableElement.style.padding="0",this.tableElement.style.margin="0",this.tableElement.style.border="none",this.tableElement.style.outline="none";var t=Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){var n;return e.style.width=e.clientWidth+"px",sl(((n={})[e.getAttribute("data-column-id")]={minWidth:e.clientWidth},n),t)}),{});return this.tableElement.className=this.tableClassName,this.tableElement.style.cssText=this.tableStyle,this.tableElement.style.tableLayout="auto",Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){return t[e.getAttribute("data-column-id")].width=e.clientWidth,t}),t)},n.render=function(){var t=this;return this.props.tableRef.current?zl("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(Kl);function zc(t){if(!t)return"";var e=t.split(" ");return 1===e.length&&/([a-z][A-Z])+/g.test(t)?t:e.map((function(t,e){return 0==e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()})).join("")}var Ac=function(t){function e(){var e;return(e=t.call(this)||this)._columns=void 0,e._columns=[],e}ll(e,t);var n=e.prototype;return n.adjustWidth=function(t){var n=t.container,i=t.tableRef,r=t.tempRef,o=t.tempRef||!0;if(!n)return this;var a=n.clientWidth,s={current:null},l={};if(i.current&&o){var c=zl(kc,{tableRef:i});c.ref=s,ql(c,r.current),l=s.current.widths()}for(var h,p=dl(e.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(h=p()).done;){var d=h.value;d.columns&&d.columns.length>0||(!d.width&&o?d.id in l&&(d.width=xc(l[d.id].width),d.minWidth=xc(l[d.id].minWidth)):d.width=xc(wc(d.width,a)))}return i.current&&o&&ql(null,r.current),this},n.setSort=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;r.columns&&r.columns.length>0&&(r.sort={enabled:!1}),void 0===r.sort&&t.sort&&(r.sort={enabled:!0}),r.sort?"object"==typeof r.sort&&(r.sort=sl({enabled:!0},r.sort)):r.sort={enabled:!1},r.columns&&this.setSort(t,r.columns)}},n.setFixedHeader=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.fixedHeader&&(r.fixedHeader=t.fixedHeader),r.columns&&this.setFixedHeader(t,r.columns)}},n.setResizable=function(t,e){for(var n,i=dl(e||this.columns||[]);!(n=i()).done;){var r=n.value;void 0===r.resizable&&(r.resizable=t.resizable),r.columns&&this.setResizable(t,r.columns)}},n.setID=function(t){for(var e,n=dl(t||this.columns||[]);!(e=n()).done;){var i=e.value;i.id||"string"!=typeof i.name||(i.id=zc(i.name)),i.id||uc.error('Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.'),i.columns&&this.setID(i.columns)}},n.populatePlugins=function(t,e){for(var n,i=dl(e);!(n=i()).done;){var r=n.value;void 0!==r.plugin&&t.plugin.add(sl({id:r.id,props:{}},r.plugin,{position:sc.Cell}))}},e.fromColumns=function(t){for(var n,i=new e,r=dl(t);!(n=r()).done;){var o=n.value;if("string"==typeof o||gl(o))i.columns.push({name:o});else if("object"==typeof o){var a=o;a.columns&&(a.columns=e.fromColumns(a.columns).columns),"object"==typeof a.plugin&&void 0===a.data&&(a.data=null),i.columns.push(o)}}return i},e.fromUserConfig=function(t){var n=new e;return t.from?n.columns=e.fromHTMLTable(t.from).columns:t.columns?n.columns=e.fromColumns(t.columns).columns:!t.data||"object"!=typeof t.data[0]||t.data[0]instanceof Array||(n.columns=Object.keys(t.data[0]).map((function(t){return{name:t}}))),n.columns.length?(n.setID(),n.setSort(t),n.setFixedHeader(t),n.setResizable(t),n.populatePlugins(t,n.columns),n):null},e.fromHTMLTable=function(t){for(var n,i=new e,r=dl(t.querySelector("thead").querySelectorAll("th"));!(n=r()).done;){var o=n.value;i.columns.push({name:o.innerHTML,width:o.width})}return i},e.tabularFormat=function(t){var e=[],n=t||[],i=[];if(n&&n.length){e.push(n);for(var r,o=dl(n);!(r=o()).done;){var a=r.value;a.columns&&a.columns.length&&(i=i.concat(a.columns))}i.length&&(e=e.concat(this.tabularFormat(i)))}return e},e.leafColumns=function(t){var e=[],n=t||[];if(n&&n.length)for(var i,r=dl(n);!(i=r()).done;){var o=i.value;o.columns&&0!==o.columns.length||e.push(o),o.columns&&(e=e.concat(this.leafColumns(o.columns)))}return e},e.maximumDepth=function(t){return this.tabularFormat([t]).length-1},al(e,[{key:"columns",get:function(){return this._columns},set:function(t){this._columns=t}},{key:"visibleColumns",get:function(){return this._columns.filter((function(t){return!t.hidden}))}}]),e}(Wl),Sc=function(){function t(){this._callbacks=void 0,this._isDispatching=void 0,this._isHandled=void 0,this._isPending=void 0,this._lastID=void 0,this._pendingPayload=void 0,this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}var e=t.prototype;return e.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},e.unregister=function(t){if(!this._callbacks[t])throw Error("Dispatcher.unregister(...): "+t+" does not map to a registered callback.");delete this._callbacks[t]},e.waitFor=function(t){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];if(this._isPending[n]){if(!this._isHandled[n])throw Error("Dispatcher.waitFor(...): Circular dependency detected while ' +\n 'waiting for "+n+".")}else{if(!this._callbacks[n])throw Error("Dispatcher.waitFor(...): "+n+" does not map to a registered callback.");this._invokeCallback(n)}}},e.dispatch=function(t){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},e.isDispatching=function(){return this._isDispatching},e._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},e._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},e._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}(),Cc=function(){},Ec=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.set(e),n}ll(e,t);var n=e.prototype;return n.get=function(){try{return Promise.resolve(this.data()).then((function(t){return{data:t,total:t.length}}))}catch(t){return Promise.reject(t)}},n.set=function(t){return t instanceof Array?this.data=function(){return t}:t instanceof Function&&(this.data=t),this},e}(Cc),Mc=function(t){function e(e){var n;return(n=t.call(this)||this).options=void 0,n.options=e,n}ll(e,t);var n=e.prototype;return n.handler=function(t){return"function"==typeof this.options.handle?this.options.handle(t):t.ok?t.json():(uc.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},n.get=function(t){var e=sl({},this.options,t);return"function"==typeof e.data?e.data(e):fetch(e.url,e).then(this.handler.bind(this)).then((function(t){return{data:e.then(t),total:"function"==typeof e.total?e.total(t):void 0}}))},e}(Cc),Lc=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new Ec(t.data)),t.from&&(e=new Ec(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new Mc(t.server)),e||uc.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,n,i=[],r=dl(t.querySelector("tbody").querySelectorAll("tr"));!(e=r()).done;){for(var o,a=[],s=dl(e.value.querySelectorAll("td"));!(o=s()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?a.push((n=l.innerHTML,(new DOMParser).parseFromString(n,"text/html").documentElement.textContent)):a.push(Ql(l.innerHTML))}i.push(a)}return i},t}(),Hc="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Tc(t,e,n){if(!t.s){if(n instanceof Vc){if(!n.s)return void(n.o=Tc.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(Tc.bind(null,t,e),Tc.bind(null,t,2));t.s=e,t.v=n;var i=t.o;i&&i(t)}}var Vc=function(){function t(){}return t.prototype.then=function(e,n){var i=new t,r=this.s;if(r){var o=1&r?e:n;if(o){try{Tc(i,1,o(this.v))}catch(t){Tc(i,2,t)}return i}return this}return this.o=function(t){try{var r=t.v;1&t.s?Tc(i,1,e?e(r):r):n?Tc(i,1,n(r)):Tc(i,2,r)}catch(t){Tc(i,2,t)}},i},t}();function $c(t){return t instanceof Vc&&1&t.s}var Oc,Pc=function(t){function e(e){var n;return(n=t.call(this)||this)._steps=new Map,n.cache=new Map,n.lastProcessorIndexUpdated=-1,e&&e.forEach((function(t){return n.register(t)})),n}ll(e,t);var n=e.prototype;return n.clearCache=function(){this.cache=new Map,this.lastProcessorIndexUpdated=-1},n.register=function(t,e){if(void 0===e&&(e=null),null===t.type)throw Error("Processor type is not defined");t.on("propsUpdated",this.processorPropsUpdated.bind(this)),this.addProcessorByPriority(t,e),this.afterRegistered(t)},n.unregister=function(t){if(t){var e=this._steps.get(t.type);e&&e.length&&(this._steps.set(t.type,e.filter((function(e){return e!=t}))),this.emit("updated",t))}},n.addProcessorByPriority=function(t,e){var n=this._steps.get(t.type);if(!n){var i=[];this._steps.set(t.type,i),n=i}if(null===e||e<0)n.push(t);else if(n[e]){var r=n.slice(0,e-1),o=n.slice(e+1);this._steps.set(t.type,r.concat(t).concat(o))}else n[e]=t},n.getStepsByType=function(t){return this.steps.filter((function(e){return e.type===t}))},n.getSortedProcessorTypes=function(){return Object.keys(Yl).filter((function(t){return!isNaN(Number(t))})).map((function(t){return Number(t)}))},n.process=function(t){try{var e=this,n=function(t){return e.lastProcessorIndexUpdated=r.length,e.emit("afterProcess",o),o},i=e.lastProcessorIndexUpdated,r=e.steps,o=t,a=function(t,n){try{var a=function(t,e,n){if("function"==typeof t[Hc]){var i,r,o,a=t[Hc]();if(function t(n){try{for(;!(i=a.next()).done;)if((n=e(i.value))&&n.then){if(!$c(n))return void n.then(t,o||(o=Tc.bind(null,r=new Vc,2)));n=n.v}r?Tc(r,1,n):r=n}catch(t){Tc(r||(r=new Vc),2,t)}}(),a.return){var s=function(t){try{i.done||a.return()}catch(t){}return t};if(r&&r.then)return r.then(s,(function(t){throw s(t)}));s()}return r}if(!("length"in t))throw new TypeError("Object is not iterable");for(var l=[],c=0;c<t.length;c++)l.push(t[c]);return function(t,e,n){var i,r,o=-1;return function n(a){try{for(;++o<t.length;)if((a=e(o))&&a.then){if(!$c(a))return void a.then(n,r||(r=Tc.bind(null,i=new Vc,2)));a=a.v}i?Tc(i,1,a):i=a}catch(t){Tc(i||(i=new Vc),2,t)}}(),i}(l,(function(t){return e(l[t])}))}(r,(function(t){var n=e.findProcessorIndexByID(t.id),r=function(){if(n>=i)return Promise.resolve(t.process(o)).then((function(n){e.cache.set(t.id,o=n)}));o=e.cache.get(t.id)}();if(r&&r.then)return r.then((function(){}))}))}catch(t){return n(t)}return a&&a.then?a.then(void 0,n):a}(0,(function(t){throw uc.error(t),e.emit("error",o),t}));return Promise.resolve(a&&a.then?a.then(n):n())}catch(t){return Promise.reject(t)}},n.findProcessorIndexByID=function(t){return this.steps.findIndex((function(e){return e.id==t}))},n.setLastProcessorIndex=function(t){var e=this.findProcessorIndexByID(t.id);this.lastProcessorIndexUpdated>e&&(this.lastProcessorIndexUpdated=e)},n.processorPropsUpdated=function(t){this.setLastProcessorIndex(t),this.emit("propsUpdated"),this.emit("updated",t)},n.afterRegistered=function(t){this.setLastProcessorIndex(t),this.emit("afterRegister"),this.emit("updated",t)},al(e,[{key:"steps",get:function(){for(var t,e=[],n=dl(this.getSortedProcessorTypes());!(t=n()).done;){var i=this._steps.get(t.value);i&&i.length&&(e=e.concat(i))}return e.filter((function(t){return t}))}}]),e}(nc),Rc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},al(e,[{key:"type",get:function(){return Yl.Extractor}}]),e}(ic),Ic=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e=ec.fromArray(t.data);return e.length=t.total,e},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Nc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(){return Object.entries(this.props.serverStorageOptions).filter((function(t){return"function"!=typeof t[1]})).reduce((function(t,e){var n;return sl({},t,((n={})[e[0]]=e[1],n))}),{})},al(e,[{key:"type",get:function(){return Yl.Initiator}}]),e}(ic),Fc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.castData=function(t){if(!t||!t.length)return[];if(!this.props.header||!this.props.header.columns)return t;var e=Ac.leafColumns(this.props.header.columns);return t[0]instanceof Array?t.map((function(t){var n=0;return e.map((function(e,i){return void 0!==e.data?(n++,"function"==typeof e.data?e.data(t):e.data):t[i-n]}))})):"object"!=typeof t[0]||t[0]instanceof Array?[]:t.map((function(t){return e.map((function(e,n){return void 0!==e.data?"function"==typeof e.data?e.data(t):e.data:e.id?t[e.id]:(uc.error("Could not find the correct cell for column at position "+n+".\n Make sure either 'id' or 'selector' is defined for all columns."),null)}))}))},n._process=function(t){return{data:this.castData(t.data),total:t.total}},al(e,[{key:"type",get:function(){return Yl.Transformer}}]),e}(ic),Bc=function(){function t(){}return t.createFromConfig=function(t){var e=new Pc;return t.storage instanceof Mc&&e.register(new Nc({serverStorageOptions:t.server})),e.register(new Rc({storage:t.storage})),e.register(new Fc({header:t.header})),e.register(new Ic),e},t}(),Dc=function(){function t(e){this._userConfig=void 0,Object.assign(this,sl({},t.defaultConfig(),e)),this._userConfig={}}var e=t.prototype;return e.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var i=n[e];"_userConfig"!==i&&(this[i]=t[i])}return this},e.update=function(e){return e?(this._userConfig=sl({},this._userConfig,e),this.assign(t.fromUserConfig(this._userConfig)),this):this},t.defaultConfig=function(){return{plugin:new fc,dispatcher:new Sc,tableRef:{current:null},tempRef:{current:null},width:"100%",height:"auto",autoWidth:!0,style:{},className:{}}},t.fromUserConfig=function(e){var n=new t(e);return n._userConfig=e,"boolean"==typeof e.sort&&e.sort&&n.assign({sort:{multiColumn:!0}}),n.assign({header:Ac.fromUserConfig(n)}),n.assign({storage:Lc.createFromUserConfig(e)}),n.assign({pipeline:Bc.createFromConfig(n)}),n.assign({translator:new Xl(e.language)}),n.plugin.add({id:"search",position:sc.Header,component:vc,props:sl({enabled:!0===e.search||e.search instanceof Object},e.search)}),n.plugin.add({id:"pagination",position:sc.Footer,component:_c,props:sl({enabled:!0===e.pagination||e.pagination instanceof Object},e.pagination)}),e.plugins&&e.plugins.forEach((function(t){return n.plugin.add(t)})),n},t}();!function(t){t[t.Init=0]="Init",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Rendered=3]="Rendered",t[t.Error=4]="Error"}(Oc||(Oc={}));var jc,qc,Uc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.content=function(){return this.props.column&&"function"==typeof this.props.column.formatter?this.props.column.formatter(this.props.cell.data,this.props.row,this.props.column):this.props.column&&this.props.column.plugin?zl(mc,{pluginId:this.props.column.id,props:{column:this.props.column,cell:this.props.cell,row:this.props.row}}):this.props.cell.data},n.handleClick=function(t){this.props.messageCell||this.config.eventEmitter.emit("cellClick",t,this.props.cell,this.props.column,this.props.row)},n.getCustomAttributes=function(t){return t?"function"==typeof t.attributes?t.attributes(this.props.cell.data,this.props.row,this.props.column):t.attributes:{}},n.render=function(){return zl("td",sl({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("td"),this.props.className,this.config.className.td),style:sl({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(Kl),Wc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getColumn=function(t){if(this.props.header){var e=Ac.leafColumns(this.props.header.columns);if(e)return e[t]}return null},n.handleClick=function(t){this.props.messageRow||this.config.eventEmitter.emit("rowClick",t,this.props.row)},n.getChildren=function(){var t=this;return this.props.children?this.props.children:zl(Sl,null,this.props.row.cells.map((function(e,n){var i=t.getColumn(n);return i&&i.hidden?null:zl(Uc,{key:e.id,cell:e,row:t.props.row,column:i})})))},n.render=function(){return zl("tr",{className:ac(oc("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(Kl),Gc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl(Wc,{messageRow:!0},zl(Uc,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new Jl(this.props.message),className:ac(oc("message"),this.props.className?this.props.className:null)}))},e}(Kl),Xc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.headerLength=function(){return this.props.header?this.props.header.visibleColumns.length:0},n.render=function(){var t=this;return zl("tbody",{className:ac(oc("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return zl(Wc,{key:e.id,row:e,header:t.props.header})})),this.props.status===Oc.Loading&&(!this.props.data||0===this.props.data.length)&&zl(Gc,{message:this._("loading"),colSpan:this.headerLength(),className:ac(oc("loading"),this.config.className.loading)}),this.props.status===Oc.Rendered&&this.props.data&&0===this.props.data.length&&zl(Gc,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:ac(oc("notfound"),this.config.className.notfound)}),this.props.status===Oc.Error&&zl(Gc,{message:this._("error"),colSpan:this.headerLength(),className:ac(oc("error"),this.config.className.error)}))},e}(Kl),Kc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.validateProps=function(){for(var t,e=dl(this.props.columns);!(t=e()).done;){var n=t.value;void 0===n.direction&&(n.direction=1),1!==n.direction&&-1!==n.direction&&uc.error("Invalid sort direction "+n.direction)}},n.compare=function(t,e){return t>e?1:t<e?-1:0},n.compareWrapper=function(t,e){for(var n,i=0,r=dl(this.props.columns);!(n=r()).done;){var o=n.value;if(0!==i)break;var a=t.cells[o.index].data,s=e.cells[o.index].data;i|="function"==typeof o.compare?o.compare(a,s)*o.direction:this.compare(a,s)*o.direction}return i},n._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var n=new ec(e);return n.length=t.length,n},al(e,[{key:"type",get:function(){return Yl.Sort}}]),e}(ic),Zc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.getInitialState=function(){return[]},n.handle=function(t,e){"SORT_COLUMN"===t?this.sortColumn(e.index,e.direction,e.multi,e.compare):"SORT_COLUMN_TOGGLE"===t&&this.sortToggle(e.index,e.multi,e.compare)},n.sortToggle=function(t,e,n){var i=[].concat(this.state).find((function(e){return e.index===t}));this.sortColumn(t,i&&1===i.direction?-1:1,e,n)},n.sortColumn=function(t,e,n,i){var r=[].concat(this.state),o=r.length,a=r.find((function(e){return e.index===t})),s=!1,l=!1,c=!1,h=!1;if(void 0!==a?n?-1===a.direction?c=!0:h=!0:1===o?h=!0:o>1&&(l=!0,s=!0):0===o?s=!0:o>0&&!n?(s=!0,l=!0):o>0&&n&&(s=!0),l&&(r=[]),s)r.push({index:t,direction:e,compare:i});else if(h){var p=r.indexOf(a);r[p].direction=e}else if(c){var d=r.indexOf(a);r.splice(d,1)}this.setState(r)},e}(lc),Qc=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.sortColumn=function(t,e,n,i){this.dispatch("SORT_COLUMN",{index:t,direction:e,multi:n,compare:i})},n.sortToggle=function(t,e,n){this.dispatch("SORT_COLUMN_TOGGLE",{index:t,multi:e,compare:n})},e}(hc),Yc=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.columns)),this.props.body&&(e.body=this.props.body(t.body,this.props.columns)),sl({},t,e)},al(e,[{key:"type",get:function(){return Yl.ServerSort}}]),e}(ic),Jc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortProcessor=void 0,i.actions=void 0,i.store=void 0,i.updateStateFn=void 0,i.updateSortProcessorFn=void 0,i.actions=new Qc(i.config.dispatcher),i.store=new Zc(i.config.dispatcher),e.enabled&&(i.sortProcessor=i.getOrCreateSortProcessor(),i.updateStateFn=i.updateState.bind(hl(i)),i.store.on("updated",i.updateStateFn),i.state={direction:0}),i}ll(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.sortProcessor),this.store.off("updated",this.updateStateFn),this.updateSortProcessorFn&&this.store.off("updated",this.updateSortProcessorFn)},n.updateState=function(){var t=this,e=this.store.state.find((function(e){return e.index===t.props.index}));this.setState(e?{direction:e.direction}:{direction:0})},n.updateSortProcessor=function(t){this.sortProcessor.setProps({columns:t})},n.getOrCreateSortProcessor=function(){var t=Yl.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=Yl.ServerSort);var e,n=this.config.pipeline.getStepsByType(t);return n.length>0?e=n[0]:(this.updateSortProcessorFn=this.updateSortProcessor.bind(this),this.store.on("updated",this.updateSortProcessorFn),e=t===Yl.ServerSort?new Yc(sl({columns:this.store.state},this.config.sort.server)):new Kc({columns:this.store.state}),this.config.pipeline.register(e)),e},n.changeDirection=function(t){t.preventDefault(),t.stopPropagation(),this.actions.sortToggle(this.props.index,!0===t.shiftKey&&this.config.sort.multiColumn,this.props.compare)},n.render=function(){if(!this.props.enabled)return null;var t=this.state.direction,e="neutral";return 1===t?e="asc":-1===t&&(e="desc"),zl("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:ac(oc("sort"),oc("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(Kl),th=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).moveFn=void 0,e.upFn=void 0,e}ll(e,t);var n=e.prototype;return n.getPageX=function(t){return t instanceof MouseEvent?Math.floor(t.pageX):Math.floor(t.changedTouches[0].pageX)},n.start=function(t){var e,n,i,r,o;t.stopPropagation(),this.setState({offsetStart:parseInt(this.props.thRef.current.style.width,10)-this.getPageX(t)}),this.upFn=this.end.bind(this),this.moveFn=(e=this.move.bind(this),void 0===(n=10)&&(n=100),function(){var t=[].slice.call(arguments);i?(clearTimeout(r),r=setTimeout((function(){Date.now()-o>=n&&(e.apply(void 0,t),o=Date.now())}),Math.max(n-(Date.now()-o),0))):(e.apply(void 0,t),o=Date.now(),i=!0)}),document.addEventListener("mouseup",this.upFn),document.addEventListener("touchend",this.upFn),document.addEventListener("mousemove",this.moveFn),document.addEventListener("touchmove",this.moveFn)},n.move=function(t){t.stopPropagation();var e=this.props.thRef.current;this.state.offsetStart+this.getPageX(t)>=parseInt(e.style.minWidth,10)&&(e.style.width=this.state.offsetStart+this.getPageX(t)+"px")},n.end=function(t){t.stopPropagation(),document.removeEventListener("mouseup",this.upFn),document.removeEventListener("mousemove",this.moveFn),document.removeEventListener("touchmove",this.moveFn),document.removeEventListener("touchend",this.upFn)},n.render=function(){return zl("div",{className:ac(oc("th"),oc("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(Kl),eh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).sortRef={current:null},i.thRef={current:null},i.state={style:{}},i}ll(e,t);var n=e.prototype;return n.isSortable=function(){return this.props.column.sort.enabled},n.isResizable=function(){return this.props.column.resizable},n.onClick=function(t){t.stopPropagation(),this.isSortable()&&this.sortRef.current.changeDirection(t)},n.keyDown=function(t){this.isSortable()&&13===t.which&&this.onClick(t)},n.componentDidMount=function(){var t=this;setTimeout((function(){if(t.props.column.fixedHeader&&t.thRef.current){var e=t.thRef.current.offsetTop;"number"==typeof e&&t.setState({style:{top:e}})}}),0)},n.content=function(){return void 0!==this.props.column.name?this.props.column.name:void 0!==this.props.column.plugin?zl(mc,{pluginId:this.props.column.plugin.id,props:{column:this.props.column}}):null},n.getCustomAttributes=function(){var t=this.props.column;return t?"function"==typeof t.attributes?t.attributes(null,null,this.props.column):t.attributes:{}},n.render=function(){var t={};return this.isSortable()&&(t.tabIndex=0),zl("th",sl({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:ac(oc("th"),this.isSortable()?oc("th","sort"):null,this.props.column.fixedHeader?oc("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:sl({},this.config.style.th,{minWidth:this.props.column.minWidth,width:this.props.column.width},this.state.style,this.props.style),onKeyDown:this.keyDown.bind(this),rowSpan:this.props.rowSpan>1?this.props.rowSpan:void 0,colSpan:this.props.colSpan>1?this.props.colSpan:void 0},this.getCustomAttributes(),t),zl("div",{className:oc("th","content")},this.content()),this.isSortable()&&zl(Jc,sl({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&zl(th,{column:this.props.column,thRef:this.thRef}))},e}(Kl),nh=function(t){function e(){return t.apply(this,arguments)||this}ll(e,t);var n=e.prototype;return n.renderColumn=function(t,e,n,i){var r=function(t,e,n){var i=Ac.maximumDepth(t),r=n-e;return{rowSpan:Math.floor(r-i-i/r),colSpan:t.columns&&t.columns.length||1}}(t,e,i);return zl(eh,{column:t,index:n,colSpan:r.colSpan,rowSpan:r.rowSpan})},n.renderRow=function(t,e,n){var i=this,r=Ac.leafColumns(this.props.header.columns);return zl(Wc,null,t.map((function(t){return t.hidden?null:i.renderColumn(t,e,r.indexOf(t),n)})))},n.renderRows=function(){var t=this,e=Ac.tabularFormat(this.props.header.columns);return e.map((function(n,i){return t.renderRow(n,i,e.length)}))},n.render=function(){return this.props.header?zl("thead",{key:this.props.header.id,className:ac(oc("thead"),this.config.className.thead)},this.renderRows()):null},e}(Kl),ih=function(t){function e(){return t.apply(this,arguments)||this}return ll(e,t),e.prototype.render=function(){return zl("table",{role:"grid",className:ac(oc("table"),this.config.className.table),style:sl({},this.config.style.table,{height:this.props.height})},zl(nh,{header:this.props.header}),zl(Xc,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(Kl),rh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).headerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.headerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.headerRef,className:ac(oc("head"),this.config.className.header),style:sl({},this.config.style.header)},zl(mc,{position:sc.Header})):null},e}(Kl),oh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).footerRef={current:null},i.state={isActive:!0},i}ll(e,t);var n=e.prototype;return n.componentDidMount=function(){0===this.footerRef.current.children.length&&this.setState({isActive:!1})},n.render=function(){return this.state.isActive?zl("div",{ref:this.footerRef,className:ac(oc("footer"),this.config.className.footer),style:sl({},this.config.style.footer)},zl(mc,{position:sc.Footer})):null},e}(Kl),ah=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).configContext=void 0,i.processPipelineFn=void 0,i.configContext=function(t,e){var n={__c:e="__cC"+bl++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(Ll)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}(),i.state={status:Oc.Loading,header:e.header,data:null},i}ll(e,t);var n=e.prototype;return n.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Oc.Loading});var e=function(e,n){try{var i=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Oc.Loaded}),t.props.config.eventEmitter.emit("load",e)}))}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}(0,(function(e){uc.error(e),t.setState({status:Oc.Error,data:null})}));return Promise.resolve(e&&e.then?e.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},n.componentDidMount=function(){try{var t=this,e=t.props.config;return Promise.resolve(t.processPipeline()).then((function(){e.header&&t.state.data&&t.state.data.length&&t.setState({header:e.header.adjustWidth(e)}),t.processPipelineFn=t.processPipeline.bind(t),t.props.pipeline.on("updated",t.processPipelineFn)}))}catch(t){return Promise.reject(t)}},n.componentWillUnmount=function(){this.props.pipeline.off("updated",this.processPipelineFn)},n.componentDidUpdate=function(t,e){e.status!=Oc.Rendered&&this.state.status==Oc.Loaded&&(this.setState({status:Oc.Rendered}),this.props.config.eventEmitter.emit("ready"))},n.render=function(){return zl(this.configContext.Provider,{value:this.props.config},zl("div",{role:"complementary",className:ac("gridjs",oc("container"),this.state.status===Oc.Loading?oc("loading"):null,this.props.config.className.container),style:sl({},this.props.config.style.container,{width:this.props.width})},this.state.status===Oc.Loading&&zl("div",{className:oc("loading-bar")}),zl(rh,null),zl("div",{className:oc("wrapper"),style:{height:this.props.height}},zl(ih,{ref:this.props.config.tableRef,data:this.state.data,header:this.state.header,width:this.props.width,height:this.props.height,status:this.state.status})),zl(oh,null),zl("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:oc("temp")})))},e}(Kl),sh=function(t){function e(e){var n;return(n=t.call(this)||this).config=void 0,n.plugin=void 0,n.config=new Dc({instance:hl(n),eventEmitter:hl(n)}).update(e),n.plugin=n.config.plugin,n}ll(e,t);var n=e.prototype;return n.updateConfig=function(t){return this.config.update(t),this},n.createElement=function(){return zl(ah,{config:this.config,pipeline:this.config.pipeline,header:this.config.header,width:this.config.width,height:this.config.height})},n.forceRender=function(){return this.config&&this.config.container||uc.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),ql(null,this.config.container),ql(this.createElement(),this.config.container),this},n.render=function(t){return t||uc.error("Container element cannot be null",!0),t.childNodes.length>0?(uc.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,ql(this.createElement(),t),this)},e}(nc),lh=[],ch=ul.__b,hh=ul.__r,ph=ul.diffed,dh=ul.__c,uh=ul.unmount;function gh(){lh.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(mh),t.__H.__h.forEach(vh),t.__H.__h=[]}catch(e){t.__H.__h=[],ul.__e(e,t.__v)}})),lh=[]}ul.__b=function(t){jc=null,ch&&ch(t)},ul.__r=function(t){hh&&hh(t),0;var e=(jc=t.__c).__H;e&&(e.__h.forEach(mh),e.__h.forEach(vh),e.__h=[])},ul.diffed=function(t){ph&&ph(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==lh.push(e)&&qc===ul.requestAnimationFrame||((qc=ul.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),fh&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);fh&&(e=requestAnimationFrame(n))})(gh)),jc=void 0},ul.__c=function(t,e){e.some((function(t){try{t.__h.forEach(mh),t.__h=t.__h.filter((function(t){return!t.__||vh(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ul.__e(n,t.__v)}})),dh&&dh(t,e)},ul.unmount=function(t){uh&&uh(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(mh)}catch(t){ul.__e(t,e.__v)}};var fh="function"==typeof requestAnimationFrame;function mh(t){var e=jc;"function"==typeof t.__c&&t.__c(),jc=e}function vh(t){var e=jc;t.__c=t.__(),jc=e}class bh extends V{static get properties(){return Object.assign({label:{type:String},property:{type:String},sort:{type:Boolean},width:{type:String}},super.properties)}constructor(){super(),this.label="no-label",this.property=null,this.sort=!1,this.width=null}connectedCallback(){super.connectedCallback()}data(){const t={name:this.label,sort:{enabled:this.sort},formatter:t=>Ql(t)};return this.property&&(t.id=this.property),this.width&&(t.width=this.width),t}}customElements.define("pb-table-column",bh);class yh extends(R(V)){static get properties(){return Object.assign({source:{type:String},cssPath:{type:String,attribute:"css-path"},resizable:{type:Boolean},perPage:{type:Number,attribute:"per-page"},height:{type:String},search:{type:Boolean},_params:{type:Object}},super.properties)}constructor(){super(),this.cssPath="../css/gridjs",this._params={},this.resizable=!1,this.search=!1,this.perPage=10,this.height=null,this.fixedHeader=!1}connectedCallback(){if(super.connectedCallback(),this.subscribeTo("pb-search-resubmit",t=>{this._params=Object.assign({},t.detail.params),this._submit()}),window.addEventListener("popstate",t=>{this._params=t.state,this._submit()}),!this.height){const t=getComputedStyle(this).getPropertyValue("--pb-table-grid-height");this.height=t||"auto"}}firstUpdated(){const t=this.shadowRoot.getElementById("table"),e=this.querySelectorAll("pb-table-column"),n=[];e.forEach(t=>n.push(t.data())),yh.waitOnce("pb-page-ready",()=>{this._params=this.getParameters();const e=this.toAbsoluteURL(this.source),i={height:this.height,fixedHeader:!0,columns:n,resizable:this.resizable,server:{url:e,then:t=>t.results,total:t=>t.count},sort:{multiColumn:!1,enabled:!0,server:{url:(t,e)=>{if(!e.length)return t;const i=e[0];return`${t}${t.indexOf("?")>-1?"&":"?"}order=${n[i.index].id}&dir=${1===i.direction?"asc":"desc"}`}}},pagination:{enabled:!0,limit:this.perPage,server:{url:(t,e,n)=>{const i=this.shadowRoot.getElementById("form");return i&&Object.assign(this._params,i.serializeForm()),this._params.limit=n,this._params.start=e*n+1,this.setParameters(this._params),this.pushHistory("grid",this._params),`${t}${t.indexOf("?")>-1?"&":"?"}${new URLSearchParams(this._params).toString()}`}}}};this.grid=new sh(i),this.grid.on("load",()=>{this.emitTo("pb-results-received",{params:this._params})}),this.grid.render(t)})}_submit(){this.grid.forceRender()}render(){const t=O(this.cssPath);return $`
|
|
4225
4225
|
<link href="${t}/mermaid.min.css" rel="stylesheet">
|
|
4226
4226
|
${this.search?$`
|
|
4227
4227
|
<iron-form id="form">
|