(function(br,Vn){typeof exports=="object"&&typeof module<"u"?module.exports=Vn():typeof define=="function"&&define.amd?define(Vn):(br=typeof globalThis<"u"?globalThis:br||self,br.GlycerineEditor=Vn())})(this,function(){"use strict";var j4=br=>{throw TypeError(br)};var ax=(br,Vn,vs)=>Vn.has(br)||j4("Cannot "+vs);var qg=(br,Vn,vs)=>(ax(br,Vn,"read from private field"),vs?vs.call(br):Vn.get(br)),Lh=(br,Vn,vs)=>Vn.has(br)?j4("Cannot add the same private member more than once"):Vn instanceof WeakSet?Vn.add(br):Vn.set(br,vs),lx=(br,Vn,vs,_a)=>(ax(br,Vn,"write to private field"),_a?_a.call(br,vs):Vn.set(br,vs),vs),ts=(br,Vn,vs)=>(ax(br,Vn,"access private method"),vs);/** * @vue/shared v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **//*! #__NO_SIDE_EFFECTS__ */var Sh,bg,Fs,q4,cx,G4,K4,dx,hx,Wye,ef,V0,Pa,Y4,px,If,Ob,X4;function br(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Vn={},vs=[],_a=()=>{},Z4=()=>!1,Gg=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),W0=t=>t.startsWith("onUpdate:"),bs=Object.assign,q0=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Q4=Object.prototype.hasOwnProperty,Gi=(t,e)=>Q4.call(t,e),Cn=Array.isArray,Mh=t=>Kg(t)==="[object Map]",fx=t=>Kg(t)==="[object Set]",Kn=t=>typeof t=="function",xr=t=>typeof t=="string",Zu=t=>typeof t=="symbol",wr=t=>t!==null&&typeof t=="object",mx=t=>(wr(t)||Kn(t))&&Kn(t.then)&&Kn(t.catch),gx=Object.prototype.toString,Kg=t=>gx.call(t),J4=t=>Kg(t).slice(8,-1),yx=t=>Kg(t)==="[object Object]",G0=t=>xr(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Of=br(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yg=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},$4=/-(\w)/g,Ka=Yg(t=>t.replace($4,(e,n)=>n?n.toUpperCase():"")),e3=/\B([A-Z])/g,qc=Yg(t=>t.replace(e3,"-$1").toLowerCase()),Xg=Yg(t=>t.charAt(0).toUpperCase()+t.slice(1)),Zg=Yg(t=>t?`on${Xg(t)}`:""),Gc=(t,e)=>!Object.is(t,e),Qg=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},K0=t=>{const e=parseFloat(t);return isNaN(e)?t:e},t3=t=>{const e=xr(t)?Number(t):NaN;return isNaN(e)?t:e};let bx;const Jg=()=>bx||(bx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function hi(t){if(Cn(t)){const e={};for(let n=0;n{if(n){const i=n.split(i3);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Lt(t){let e="";if(xr(t))e=t;else if(Cn(t))for(let n=0;n!!(t&&t.__v_isRef===!0),lt=t=>xr(t)?t:t==null?"":Cn(t)||wr(t)&&(t.toString===gx||!Kn(t.toString))?_x(t)?lt(t.value):JSON.stringify(t,Sx,2):String(t),Sx=(t,e)=>_x(e)?Sx(t,e.value):Mh(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],s)=>(n[Y0(i,s)+" =>"]=r,n),{})}:fx(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Y0(n))}:Zu(e)?Y0(e):wr(e)&&!Cn(e)&&!yx(e)?String(e):e,Y0=(t,e="")=>{var n;return Zu(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** * @vue/reactivity v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let uo;class Tx{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=uo,!e&&uo&&(this.index=(uo.scopes||(uo.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(uo=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Lf){let e=Lf;for(Lf=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Rf;){let e=Rf;for(Rf=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function kx(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Px(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),ew(i),l3(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function $0(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Dx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Dx(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Mf)||(t.globalVersion=Mf,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!$0(t))))return;t.flags|=2;const e=t.dep,n=cr,i=El;cr=t,El=!0;try{kx(t);const r=t.fn(t._value);(e.version===0||Gc(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{cr=n,El=i,Px(t),t.flags&=-3}}function ew(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ew(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function l3(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let El=!0;const Ix=[];function iu(){Ix.push(El),El=!1}function ru(){const t=Ix.pop();El=t===void 0?!0:t}function Ox(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=cr;cr=void 0;try{e()}finally{cr=n}}}let Mf=0;class u3{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class tw{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!cr||!El||cr===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==cr)n=this.activeLink=new u3(cr,this),cr.deps?(n.prevDep=cr.depsTail,cr.depsTail.nextDep=n,cr.depsTail=n):cr.deps=cr.depsTail=n,Rx(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=cr.depsTail,n.nextDep=void 0,cr.depsTail.nextDep=n,cr.depsTail=n,cr.deps===n&&(cr.deps=i)}return n}trigger(e){this.version++,Mf++,this.notify(e)}notify(e){Q0();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{J0()}}}function Rx(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)Rx(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const $g=new WeakMap,zd=Symbol(""),nw=Symbol(""),Nf=Symbol("");function co(t,e,n){if(El&&cr){let i=$g.get(t);i||$g.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new tw),r.map=i,r.key=n),r.track()}}function Qu(t,e,n,i,r,s){const o=$g.get(t);if(!o){Mf++;return}const u=d=>{d&&d.trigger()};if(Q0(),e==="clear")o.forEach(u);else{const d=Cn(t),h=d&&G0(n);if(d&&n==="length"){const g=Number(i);o.forEach((y,w)=>{(w==="length"||w===Nf||!Zu(w)&&w>=g)&&u(y)})}else switch((n!==void 0||o.has(void 0))&&u(o.get(n)),h&&u(o.get(Nf)),e){case"add":d?h&&u(o.get("length")):(u(o.get(zd)),Mh(t)&&u(o.get(nw)));break;case"delete":d||(u(o.get(zd)),Mh(t)&&u(o.get(nw)));break;case"set":Mh(t)&&u(o.get(zd));break}}J0()}function c3(t,e){const n=$g.get(t);return n&&n.get(e)}function Nh(t){const e=Rn(t);return e===t?e:(co(e,"iterate",Nf),Ya(t)?e:e.map(Ys))}function ey(t){return co(t=Rn(t),"iterate",Nf),t}const d3={__proto__:null,[Symbol.iterator](){return iw(this,Symbol.iterator,Ys)},concat(...t){return Nh(this).concat(...t.map(e=>Cn(e)?Nh(e):e))},entries(){return iw(this,"entries",t=>(t[1]=Ys(t[1]),t))},every(t,e){return Ju(this,"every",t,e,void 0,arguments)},filter(t,e){return Ju(this,"filter",t,e,n=>n.map(Ys),arguments)},find(t,e){return Ju(this,"find",t,e,Ys,arguments)},findIndex(t,e){return Ju(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Ju(this,"findLast",t,e,Ys,arguments)},findLastIndex(t,e){return Ju(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Ju(this,"forEach",t,e,void 0,arguments)},includes(...t){return rw(this,"includes",t)},indexOf(...t){return rw(this,"indexOf",t)},join(t){return Nh(this).join(t)},lastIndexOf(...t){return rw(this,"lastIndexOf",t)},map(t,e){return Ju(this,"map",t,e,void 0,arguments)},pop(){return Ff(this,"pop")},push(...t){return Ff(this,"push",t)},reduce(t,...e){return Lx(this,"reduce",t,e)},reduceRight(t,...e){return Lx(this,"reduceRight",t,e)},shift(){return Ff(this,"shift")},some(t,e){return Ju(this,"some",t,e,void 0,arguments)},splice(...t){return Ff(this,"splice",t)},toReversed(){return Nh(this).toReversed()},toSorted(t){return Nh(this).toSorted(t)},toSpliced(...t){return Nh(this).toSpliced(...t)},unshift(...t){return Ff(this,"unshift",t)},values(){return iw(this,"values",Ys)}};function iw(t,e,n){const i=ey(t),r=i[e]();return i!==t&&!Ya(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=n(s.value)),s}),r}const h3=Array.prototype;function Ju(t,e,n,i,r,s){const o=ey(t),u=o!==t&&!Ya(t),d=o[e];if(d!==h3[e]){const y=d.apply(t,s);return u?Ys(y):y}let h=n;o!==t&&(u?h=function(y,w){return n.call(this,Ys(y),w,t)}:n.length>2&&(h=function(y,w){return n.call(this,y,w,t)}));const g=d.call(o,h,i);return u&&r?r(g):g}function Lx(t,e,n,i){const r=ey(t);let s=n;return r!==t&&(Ya(t)?n.length>3&&(s=function(o,u,d){return n.call(this,o,u,d,t)}):s=function(o,u,d){return n.call(this,o,Ys(u),d,t)}),r[e](s,...i)}function rw(t,e,n){const i=Rn(t);co(i,"iterate",Nf);const r=i[e](...n);return(r===-1||r===!1)&&ow(n[0])?(n[0]=Rn(n[0]),i[e](...n)):r}function Ff(t,e,n=[]){iu(),Q0();const i=Rn(t)[e].apply(t,n);return J0(),ru(),i}const p3=br("__proto__,__v_isRef,__isVue"),Mx=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Zu));function f3(t){Zu(t)||(t=String(t));const e=Rn(this);return co(e,"has",t),e.hasOwnProperty(t)}class Nx{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?jx:zx:s?Hx:Ux).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Cn(e);if(!r){let d;if(o&&(d=d3[n]))return d;if(n==="hasOwnProperty")return f3}const u=Reflect.get(e,n,Mr(e)?e:i);return(Zu(n)?Mx.has(n):p3(n))||(r||co(e,"get",n),s)?u:Mr(u)?o&&G0(n)?u:u.value:wr(u)?r?Vx(u):Fh(u):u}}class Fx extends Nx{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];if(!this._isShallow){const d=Yc(s);if(!Ya(i)&&!Yc(i)&&(s=Rn(s),i=Rn(i)),!Cn(e)&&Mr(s)&&!Mr(i))return d?!1:(s.value=i,!0)}const o=Cn(e)&&G0(n)?Number(n)t,ty=t=>Reflect.getPrototypeOf(t);function b3(t,e,n){return function(...i){const r=this.__v_raw,s=Rn(r),o=Mh(s),u=t==="entries"||t===Symbol.iterator&&o,d=t==="keys"&&o,h=r[t](...i),g=n?sw:e?sy:Ys;return!e&&co(s,"iterate",d?nw:zd),{next(){const{value:y,done:w}=h.next();return w?{value:y,done:w}:{value:u?[g(y[0]),g(y[1])]:g(y),done:w}},[Symbol.iterator](){return this}}}}function ny(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function w3(t,e){const n={get(r){const s=this.__v_raw,o=Rn(s),u=Rn(r);t||(Gc(r,u)&&co(o,"get",r),co(o,"get",u));const{has:d}=ty(o),h=e?sw:t?sy:Ys;if(d.call(o,r))return h(s.get(r));if(d.call(o,u))return h(s.get(u));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&co(Rn(r),"iterate",zd),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=Rn(s),u=Rn(r);return t||(Gc(r,u)&&co(o,"has",r),co(o,"has",u)),r===u?s.has(r):s.has(r)||s.has(u)},forEach(r,s){const o=this,u=o.__v_raw,d=Rn(u),h=e?sw:t?sy:Ys;return!t&&co(d,"iterate",zd),u.forEach((g,y)=>r.call(s,h(g),h(y),o))}};return bs(n,t?{add:ny("add"),set:ny("set"),delete:ny("delete"),clear:ny("clear")}:{add(r){!e&&!Ya(r)&&!Yc(r)&&(r=Rn(r));const s=Rn(this);return ty(s).has.call(s,r)||(s.add(r),Qu(s,"add",r,r)),this},set(r,s){!e&&!Ya(s)&&!Yc(s)&&(s=Rn(s));const o=Rn(this),{has:u,get:d}=ty(o);let h=u.call(o,r);h||(r=Rn(r),h=u.call(o,r));const g=d.call(o,r);return o.set(r,s),h?Gc(s,g)&&Qu(o,"set",r,s):Qu(o,"add",r,s),this},delete(r){const s=Rn(this),{has:o,get:u}=ty(s);let d=o.call(s,r);d||(r=Rn(r),d=o.call(s,r)),u&&u.call(s,r);const h=s.delete(r);return d&&Qu(s,"delete",r,void 0),h},clear(){const r=Rn(this),s=r.size!==0,o=r.clear();return s&&Qu(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=b3(r,t,e)}),n}function iy(t,e){const n=w3(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(Gi(n,r)&&r in i?n:i,r,s)}const _3={get:iy(!1,!1)},S3={get:iy(!1,!0)},T3={get:iy(!0,!1)},E3={get:iy(!0,!0)},Ux=new WeakMap,Hx=new WeakMap,zx=new WeakMap,jx=new WeakMap;function x3(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function C3(t){return t.__v_skip||!Object.isExtensible(t)?0:x3(J4(t))}function Fh(t){return Yc(t)?t:ry(t,!1,m3,_3,Ux)}function A3(t){return ry(t,!1,y3,S3,Hx)}function Vx(t){return ry(t,!0,g3,T3,zx)}function Gye(t){return ry(t,!0,v3,E3,jx)}function ry(t,e,n,i,r){if(!wr(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=C3(t);if(s===0)return t;const o=r.get(t);if(o)return o;const u=new Proxy(t,s===2?i:n);return r.set(t,u),u}function Kc(t){return Yc(t)?Kc(t.__v_raw):!!(t&&t.__v_isReactive)}function Yc(t){return!!(t&&t.__v_isReadonly)}function Ya(t){return!!(t&&t.__v_isShallow)}function ow(t){return t?!!t.__v_raw:!1}function Rn(t){const e=t&&t.__v_raw;return e?Rn(e):t}function aw(t){return!Gi(t,"__v_skip")&&Object.isExtensible(t)&&vx(t,"__v_skip",!0),t}const Ys=t=>wr(t)?Fh(t):t,sy=t=>wr(t)?Vx(t):t;function Mr(t){return t?t.__v_isRef===!0:!1}function lw(t){return Wx(t,!1)}function k3(t){return Wx(t,!0)}function Wx(t,e){return Mr(t)?t:new P3(t,e)}class P3{constructor(e,n){this.dep=new tw,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Rn(e),this._value=n?e:Ys(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||Ya(e)||Yc(e);e=i?e:Rn(e),Gc(e,n)&&(this._rawValue=e,this._value=i?e:Ys(e),this.dep.trigger())}}function D3(t){return Mr(t)?t.value:t}const I3={get:(t,e,n)=>e==="__v_raw"?t:D3(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return Mr(r)&&!Mr(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function qx(t){return Kc(t)?t:new Proxy(t,I3)}function O3(t){const e=Cn(t)?new Array(t.length):{};for(const n in t)e[n]=L3(t,n);return e}class R3{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return c3(Rn(this._object),this._key)}}function L3(t,e,n){const i=t[e];return Mr(i)?i:new R3(t,e,n)}class M3{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new tw(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mf-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&cr!==this)return Ax(this,!0),!0}get value(){const e=this.dep.track();return Dx(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function N3(t,e,n=!1){let i,r;return Kn(t)?i=t:(i=t.get,r=t.set),new M3(i,r,n)}const oy={},ay=new WeakMap;let jd;function F3(t,e=!1,n=jd){if(n){let i=ay.get(n);i||ay.set(n,i=[]),i.push(t)}}function B3(t,e,n=Vn){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:u,call:d}=n,h=ee=>r?ee:Ya(ee)||r===!1||r===0?$u(ee,1):$u(ee);let g,y,w,C,D=!1,P=!1;if(Mr(t)?(y=()=>t.value,D=Ya(t)):Kc(t)?(y=()=>h(t),D=!0):Cn(t)?(P=!0,D=t.some(ee=>Kc(ee)||Ya(ee)),y=()=>t.map(ee=>{if(Mr(ee))return ee.value;if(Kc(ee))return h(ee);if(Kn(ee))return d?d(ee,2):ee()})):Kn(t)?e?y=d?()=>d(t,2):t:y=()=>{if(w){iu();try{w()}finally{ru()}}const ee=jd;jd=g;try{return d?d(t,3,[C]):t(C)}finally{jd=ee}}:y=_a,e&&r){const ee=y,he=r===!0?1/0:r;y=()=>$u(ee(),he)}const M=Ex(),F=()=>{g.stop(),M&&M.active&&q0(M.effects,g)};if(s&&e){const ee=e;e=(...he)=>{ee(...he),F()}}let K=P?new Array(t.length).fill(oy):oy;const $=ee=>{if(!(!(g.flags&1)||!g.dirty&&!ee))if(e){const he=g.run();if(r||D||(P?he.some((ve,fe)=>Gc(ve,K[fe])):Gc(he,K))){w&&w();const ve=jd;jd=g;try{const fe=[he,K===oy?void 0:P&&K[0]===oy?[]:K,C];K=he,d?d(e,3,fe):e(...fe)}finally{jd=ve}}}else g.run()};return u&&u($),g=new xx(y),g.scheduler=o?()=>o($,!1):$,C=ee=>F3(ee,!1,g),w=g.onStop=()=>{const ee=ay.get(g);if(ee){if(d)d(ee,4);else for(const he of ee)he();ay.delete(g)}},e?i?$(!0):K=g.run():o?o($.bind(null,!0),!0):g.run(),F.pause=g.pause.bind(g),F.resume=g.resume.bind(g),F.stop=F,F}function $u(t,e=1/0,n){if(e<=0||!wr(t)||t.__v_skip||(n=n||new Set,n.has(t)))return t;if(n.add(t),e--,Mr(t))$u(t.value,e,n);else if(Cn(t))for(let i=0;i{$u(i,e,n)});else if(yx(t)){for(const i in t)$u(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&$u(t[i],e,n)}return t}/** * @vue/runtime-core v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/const Bf=[];let uw=!1;function Kye(t,...e){if(uw)return;uw=!0,iu();const n=Bf.length?Bf[Bf.length-1].component:null,i=n&&n.appContext.config.warnHandler,r=U3();if(i)Bh(i,n,11,[t+e.map(s=>{var o,u;return(u=(o=s.toString)==null?void 0:o.call(s))!=null?u:JSON.stringify(s)}).join(""),n&&n.proxy,r.map(({vnode:s})=>`at <${JC(n,s.type)}>`).join(` `),r]);else{const s=[`[Vue warn]: ${t}`,...e];r.length&&s.push(` `,...H3(r)),console.warn(...s)}ru(),uw=!1}function U3(){let t=Bf[Bf.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const i=t.component&&t.component.parent;t=i&&i.vnode}return e}function H3(t){const e=[];return t.forEach((n,i)=>{e.push(...i===0?[]:[` `],...z3(n))}),e}function z3({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",i=t.component?t.component.parent==null:!1,r=` at <${JC(t.component,t.type,i)}`,s=">"+n;return t.props?[r,...j3(t.props),s]:[r+s]}function j3(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(i=>{e.push(...Gx(i,t[i]))}),n.length>3&&e.push(" ..."),e}function Gx(t,e,n){return xr(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:Mr(e)?(e=Gx(t,Rn(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):Kn(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Rn(e),n?e:[`${t}=`,e])}function Bh(t,e,n,i){try{return i?t(...i):t()}catch(r){ly(r,e,n)}}function xl(t,e,n,i){if(Kn(t)){const r=Bh(t,e,n,i);return r&&mx(r)&&r.catch(s=>{ly(s,e,n)}),r}if(Cn(t)){const r=[];for(let s=0;s>>1,r=Io[i],s=Uf(r);s=Uf(n)?Io.push(t):Io.splice(W3(e),0,t),t.flags|=1,Xx()}}function Xx(){uy||(uy=Kx.then(Jx))}function q3(t){Cn(t)?Uh.push(...t):Xc&&t.id===-1?Xc.splice(Hh+1,0,t):t.flags&1||(Uh.push(t),t.flags|=1),Xx()}function Zx(t,e,n=su+1){for(;nUf(n)-Uf(i));if(Uh.length=0,Xc){Xc.push(...e);return}for(Xc=e,Hh=0;Hht.id==null?t.flags&2?-1:1/0:t.id;function Jx(t){try{for(su=0;su{i._d&&WC(-1);const s=cy(e);let o;try{o=t(...r)}finally{cy(s),i._d&&WC(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function ei(t,e){if(ws===null)return t;const n=Ty(ws),i=t.dirs||(t.dirs=[]);for(let r=0;rt.__isTeleport,Hf=t=>t&&(t.disabled||t.disabled===""),nC=t=>t&&(t.defer||t.defer===""),iC=t=>typeof SVGElement<"u"&&t instanceof SVGElement,rC=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,dw=(t,e)=>{const n=t&&t.to;return xr(n)?e?e(n):null:n},sC={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,s,o,u,d,h){const{mc:g,pc:y,pbc:w,o:{insert:C,querySelector:D,createText:P,createComment:M}}=h,F=Hf(e.props);let{shapeFlag:K,children:$,dynamicChildren:ee}=e;if(t==null){const he=e.el=P(""),ve=e.anchor=P("");C(he,n,i),C(ve,n,i);const fe=(xe,Qe)=>{K&16&&(r&&r.isCE&&(r.ce._teleportTarget=xe),g($,xe,Qe,r,s,o,u,d))},ae=()=>{const xe=e.target=dw(e.props,D),Qe=oC(xe,e,P,C);xe&&(o!=="svg"&&iC(xe)?o="svg":o!=="mathml"&&rC(xe)&&(o="mathml"),F||(fe(xe,Qe),hy(e,!1)))};F&&(fe(n,ve),hy(e,!0)),nC(e.props)?(e.el.__isMounted=!1,Ro(()=>{ae(),delete e.el.__isMounted},s)):ae()}else{if(nC(e.props)&&t.el.__isMounted===!1){Ro(()=>{sC.process(t,e,n,i,r,s,o,u,d,h)},s);return}e.el=t.el,e.targetStart=t.targetStart;const he=e.anchor=t.anchor,ve=e.target=t.target,fe=e.targetAnchor=t.targetAnchor,ae=Hf(t.props),xe=ae?n:ve,Qe=ae?he:fe;if(o==="svg"||iC(ve)?o="svg":(o==="mathml"||rC(ve))&&(o="mathml"),ee?(w(t.dynamicChildren,ee,xe,r,s,o,u),Aw(t,e,!0)):d||y(t,e,xe,Qe,r,s,o,u,!1),F)ae?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):dy(e,n,he,h,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const ot=e.target=dw(e.props,D);ot&&dy(e,ot,null,h,0)}else ae&&dy(e,ve,fe,h,1);hy(e,F)}},remove(t,e,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:u,anchor:d,targetStart:h,targetAnchor:g,target:y,props:w}=t;if(y&&(r(h),r(g)),s&&r(d),o&16){const C=s||!Hf(w);for(let D=0;D{t.isMounted=!0}),gC(()=>{t.isUnmounting=!0}),t}const Xa=[Function,Array],lC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Xa,onEnter:Xa,onAfterEnter:Xa,onEnterCancelled:Xa,onBeforeLeave:Xa,onLeave:Xa,onAfterLeave:Xa,onLeaveCancelled:Xa,onBeforeAppear:Xa,onAppear:Xa,onAfterAppear:Xa,onAppearCancelled:Xa},uC=t=>{const e=t.subTree;return e.component?uC(e.component):e},Y3={name:"BaseTransition",props:lC,setup(t,{slots:e}){const n=Vh(),i=aC();return()=>{const r=e.default&&pw(e.default(),!0);if(!r||!r.length)return;const s=cC(r),o=Rn(t),{mode:u}=o;if(i.isLeaving)return hw(s);const d=hC(s);if(!d)return hw(s);let h=zf(d,o,i,n,y=>h=y);d.type!==ho&&Wd(d,h);let g=n.subTree&&hC(n.subTree);if(g&&g.type!==ho&&!Yd(d,g)&&uC(n).type!==ho){let y=zf(g,o,i,n);if(Wd(g,y),u==="out-in"&&d.type!==ho)return i.isLeaving=!0,y.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete y.afterLeave,g=void 0},hw(s);u==="in-out"&&d.type!==ho?y.delayLeave=(w,C,D)=>{const P=dC(i,g);P[String(g.key)]=g,w[Zc]=()=>{C(),w[Zc]=void 0,delete h.delayedLeave,g=void 0},h.delayedLeave=()=>{D(),delete h.delayedLeave,g=void 0}}:g=void 0}else g&&(g=void 0);return s}}};function cC(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==ho){e=n;break}}return e}const X3=Y3;function dC(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function zf(t,e,n,i,r){const{appear:s,mode:o,persisted:u=!1,onBeforeEnter:d,onEnter:h,onAfterEnter:g,onEnterCancelled:y,onBeforeLeave:w,onLeave:C,onAfterLeave:D,onLeaveCancelled:P,onBeforeAppear:M,onAppear:F,onAfterAppear:K,onAppearCancelled:$}=e,ee=String(t.key),he=dC(n,t),ve=(xe,Qe)=>{xe&&xl(xe,i,9,Qe)},fe=(xe,Qe)=>{const ot=Qe[1];ve(xe,Qe),Cn(xe)?xe.every(et=>et.length<=1)&&ot():xe.length<=1&&ot()},ae={mode:o,persisted:u,beforeEnter(xe){let Qe=d;if(!n.isMounted)if(s)Qe=M||d;else return;xe[Zc]&&xe[Zc](!0);const ot=he[ee];ot&&Yd(t,ot)&&ot.el[Zc]&&ot.el[Zc](),ve(Qe,[xe])},enter(xe){let Qe=h,ot=g,et=y;if(!n.isMounted)if(s)Qe=F||h,ot=K||g,et=$||y;else return;let pt=!1;const Wt=xe[py]=pn=>{pt||(pt=!0,pn?ve(et,[xe]):ve(ot,[xe]),ae.delayedLeave&&ae.delayedLeave(),xe[py]=void 0)};Qe?fe(Qe,[xe,Wt]):Wt()},leave(xe,Qe){const ot=String(t.key);if(xe[py]&&xe[py](!0),n.isUnmounting)return Qe();ve(w,[xe]);let et=!1;const pt=xe[Zc]=Wt=>{et||(et=!0,Qe(),Wt?ve(P,[xe]):ve(D,[xe]),xe[Zc]=void 0,he[ot]===t&&delete he[ot])};he[ot]=t,C?fe(C,[xe,pt]):pt()},clone(xe){const Qe=zf(xe,e,n,i,r);return r&&r(Qe),Qe}};return ae}function hw(t){if(my(t))return t=Qc(t),t.children=null,t}function hC(t){if(!my(t))return tC(t.type)&&t.children?cC(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&Kn(n.default))return n.default()}}function Wd(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Wd(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function pw(t,e=!1,n){let i=[],r=0;for(let s=0;s1)for(let s=0;sfy(D,e&&(Cn(e)?e[P]:e),n,i,r));return}if(zh(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&fy(t,e,n,i.component.subTree);return}const s=i.shapeFlag&4?Ty(i.component):i.el,o=r?null:s,{i:u,r:d}=t,h=e&&e.r,g=u.refs===Vn?u.refs={}:u.refs,y=u.setupState,w=Rn(y),C=y===Vn?()=>!1:D=>Gi(w,D);if(h!=null&&h!==d&&(xr(h)?(g[h]=null,C(h)&&(y[h]=null)):Mr(h)&&(h.value=null)),Kn(d))Bh(d,u,12,[o,g]);else{const D=xr(d),P=Mr(d);if(D||P){const M=()=>{if(t.f){const F=D?C(d)?y[d]:g[d]:d.value;r?Cn(F)&&q0(F,s):Cn(F)?F.includes(s)||F.push(s):D?(g[d]=[s],C(d)&&(y[d]=g[d])):(d.value=[s],t.k&&(g[t.k]=d.value))}else D?(g[d]=o,C(d)&&(y[d]=o)):P&&(d.value=o,t.k&&(g[t.k]=o))};o?(M.id=-1,Ro(M,n)):M()}}}Jg().requestIdleCallback,Jg().cancelIdleCallback;const zh=t=>!!t.type.__asyncLoader,my=t=>t.type.__isKeepAlive;function Z3(t,e){fC(t,"a",e)}function Q3(t,e){fC(t,"da",e)}function fC(t,e,n=Is){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(gy(e,i,n),n){let r=n.parent;for(;r&&r.parent;)my(r.parent.vnode)&&J3(i,e,n,r),r=r.parent}}function J3(t,e,n,i){const r=gy(e,t,i,!0);gw(()=>{q0(i[e],r)},n)}function gy(t,e,n=Is,i=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{iu();const u=Yf(n),d=xl(e,n,t,o);return u(),ru(),d});return i?r.unshift(s):r.push(s),s}}const ec=t=>(e,n=Is)=>{(!Xf||t==="sp")&&gy(t,(...i)=>e(...i),n)},$3=ec("bm"),mw=ec("m"),e6=ec("bu"),mC=ec("u"),gC=ec("bum"),gw=ec("um"),t6=ec("sp"),n6=ec("rtg"),i6=ec("rtc");function r6(t,e=Is){gy("ec",t,e)}const yw="components",s6="directives";function Bt(t,e){return vw(yw,t,!0,e)||t}const yC=Symbol.for("v-ndc");function us(t){return xr(t)?vw(yw,t,!1)||t:t||yC}function _s(t){return vw(s6,t)}function vw(t,e,n=!0,i=!1){const r=ws||Is;if(r){const s=r.type;if(t===yw){const u=QC(s,!1);if(u&&(u===e||u===Ka(e)||u===Xg(Ka(e))))return s}const o=vC(r[t]||s[t],e)||vC(r.appContext[t],e);return!o&&i?s:o}}function vC(t,e){return t&&(t[e]||t[Ka(e)]||t[Xg(Ka(e))])}function hn(t,e,n,i){let r;const s=n,o=Cn(t);if(o||xr(t)){const u=o&&Kc(t);let d=!1,h=!1;u&&(d=!Ya(t),h=Yc(t),t=ey(t)),r=new Array(t.length);for(let g=0,y=t.length;ge(u,d,void 0,s));else{const u=Object.keys(t);r=new Array(u.length);for(let d=0,h=u.length;d{const s=i.fn(...r);return s&&(s.key=i.key),s}:i.fn)}return t}function En(t,e,n={},i,r){if(ws.ce||ws.parent&&zh(ws.parent)&&ws.parent.ce)return e!=="default"&&(n.name=e),G(),Ct(xt,null,[gt("slot",n,i&&i())],64);let s=t[e];s&&s._c&&(s._d=!1),G();const o=s&&bC(s(n)),u=n.key||o&&o.key,d=Ct(xt,{key:(u&&!Zu(u)?u:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&t._===1?64:-2);return d.scopeId&&(d.slotScopeIds=[d.scopeId+"-s"]),s&&s._c&&(s._d=!0),d}function bC(t){return t.some(e=>Kf(e)?!(e.type===ho||e.type===xt&&!bC(e.children)):!0)?t:null}function vy(t,e){const n={};for(const i in t)n[Zg(i)]=t[i];return n}const bw=t=>t?YC(t)?Ty(t):bw(t.parent):null,jf=bs(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>bw(t.parent),$root:t=>bw(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>TC(t),$forceUpdate:t=>t.f||(t.f=()=>{cw(t.update)}),$nextTick:t=>t.n||(t.n=Yx.bind(t.proxy)),$watch:t=>k6.bind(t)}),ww=(t,e)=>t!==Vn&&!t.__isScriptSetup&&Gi(t,e),o6={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:u,appContext:d}=t;let h;if(e[0]!=="$"){const C=o[e];if(C!==void 0)switch(C){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return s[e]}else{if(ww(i,e))return o[e]=1,i[e];if(r!==Vn&&Gi(r,e))return o[e]=2,r[e];if((h=t.propsOptions[0])&&Gi(h,e))return o[e]=3,s[e];if(n!==Vn&&Gi(n,e))return o[e]=4,n[e];_w&&(o[e]=0)}}const g=jf[e];let y,w;if(g)return e==="$attrs"&&co(t.attrs,"get",""),g(t);if((y=u.__cssModules)&&(y=y[e]))return y;if(n!==Vn&&Gi(n,e))return o[e]=4,n[e];if(w=d.config.globalProperties,Gi(w,e))return w[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:s}=t;return ww(r,e)?(r[e]=n,!0):i!==Vn&&Gi(i,e)?(i[e]=n,!0):Gi(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,propsOptions:s}},o){let u;return!!n[o]||t!==Vn&&Gi(t,o)||ww(e,o)||(u=s[0])&&Gi(u,o)||Gi(i,o)||Gi(jf,o)||Gi(r.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Gi(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function wC(t){return Cn(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let _w=!0;function a6(t){const e=TC(t),n=t.proxy,i=t.ctx;_w=!1,e.beforeCreate&&_C(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:u,provide:d,inject:h,created:g,beforeMount:y,mounted:w,beforeUpdate:C,updated:D,activated:P,deactivated:M,beforeDestroy:F,beforeUnmount:K,destroyed:$,unmounted:ee,render:he,renderTracked:ve,renderTriggered:fe,errorCaptured:ae,serverPrefetch:xe,expose:Qe,inheritAttrs:ot,components:et,directives:pt,filters:Wt}=e;if(h&&l6(h,i,null),o)for(const Xt in o){const cn=o[Xt];Kn(cn)&&(i[Xt]=cn.bind(n))}if(r){const Xt=r.call(n,n);wr(Xt)&&(t.data=Fh(Xt))}if(_w=!0,s)for(const Xt in s){const cn=s[Xt],ai=Kn(cn)?cn.bind(n,n):Kn(cn.get)?cn.get.bind(n,n):_a,Qt=!Kn(cn)&&Kn(cn.set)?cn.set.bind(n):_a,xn=$c({get:ai,set:Qt});Object.defineProperty(i,Xt,{enumerable:!0,configurable:!0,get:()=>xn.value,set:ii=>xn.value=ii})}if(u)for(const Xt in u)SC(u[Xt],i,n,Xt);if(d){const Xt=Kn(d)?d.call(n):d;Reflect.ownKeys(Xt).forEach(cn=>{f6(cn,Xt[cn])})}g&&_C(g,t,"c");function Ut(Xt,cn){Cn(cn)?cn.forEach(ai=>Xt(ai.bind(n))):cn&&Xt(cn.bind(n))}if(Ut($3,y),Ut(mw,w),Ut(e6,C),Ut(mC,D),Ut(Z3,P),Ut(Q3,M),Ut(r6,ae),Ut(i6,ve),Ut(n6,fe),Ut(gC,K),Ut(gw,ee),Ut(t6,xe),Cn(Qe))if(Qe.length){const Xt=t.exposed||(t.exposed={});Qe.forEach(cn=>{Object.defineProperty(Xt,cn,{get:()=>n[cn],set:ai=>n[cn]=ai})})}else t.exposed||(t.exposed={});he&&t.render===_a&&(t.render=he),ot!=null&&(t.inheritAttrs=ot),et&&(t.components=et),pt&&(t.directives=pt),xe&&pC(t)}function l6(t,e,n=_a){Cn(t)&&(t=Sw(t));for(const i in t){const r=t[i];let s;wr(r)?"default"in r?s=jh(r.from||i,r.default,!0):s=jh(r.from||i):s=jh(r),Mr(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function _C(t,e,n){xl(Cn(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function SC(t,e,n,i){let r=i.includes(".")?UC(n,i):()=>n[i];if(xr(t)){const s=e[t];Kn(s)&&Kd(r,s)}else if(Kn(t))Kd(r,t.bind(n));else if(wr(t))if(Cn(t))t.forEach(s=>SC(s,e,n,i));else{const s=Kn(t.handler)?t.handler.bind(n):e[t.handler];Kn(s)&&Kd(r,s,t)}}function TC(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,u=s.get(e);let d;return u?d=u:!r.length&&!n&&!i?d=e:(d={},r.length&&r.forEach(h=>by(d,h,o,!0)),by(d,e,o)),wr(e)&&s.set(e,d),d}function by(t,e,n,i=!1){const{mixins:r,extends:s}=e;s&&by(t,s,n,!0),r&&r.forEach(o=>by(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const u=u6[o]||n&&n[o];t[o]=u?u(t[o],e[o]):e[o]}return t}const u6={data:EC,props:xC,emits:xC,methods:Vf,computed:Vf,beforeCreate:Oo,created:Oo,beforeMount:Oo,mounted:Oo,beforeUpdate:Oo,updated:Oo,beforeDestroy:Oo,beforeUnmount:Oo,destroyed:Oo,unmounted:Oo,activated:Oo,deactivated:Oo,errorCaptured:Oo,serverPrefetch:Oo,components:Vf,directives:Vf,watch:d6,provide:EC,inject:c6};function EC(t,e){return e?t?function(){return bs(Kn(t)?t.call(this,this):t,Kn(e)?e.call(this,this):e)}:e:t}function c6(t,e){return Vf(Sw(t),Sw(e))}function Sw(t){if(Cn(t)){const e={};for(let n=0;n1)return n&&Kn(e)?e.call(i&&i.proxy):e}}function m6(){return!!(Is||ws||qd)}const AC={},kC=()=>Object.create(AC),PC=t=>Object.getPrototypeOf(t)===AC;function g6(t,e,n,i=!1){const r={},s=kC();t.propsDefaults=Object.create(null),DC(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=i?r:A3(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function y6(t,e,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,u=Rn(r),[d]=t.propsOptions;let h=!1;if((i||o>0)&&!(o&16)){if(o&8){const g=t.vnode.dynamicProps;for(let y=0;y{d=!0;const[w,C]=IC(y,e,!0);bs(o,w),C&&u.push(...C)};!n&&e.mixins.length&&e.mixins.forEach(g),t.extends&&g(t.extends),t.mixins&&t.mixins.forEach(g)}if(!s&&!d)return wr(t)&&i.set(t,vs),vs;if(Cn(s))for(let g=0;gt[0]==="_"||t==="$stable",xw=t=>Cn(t)?t.map(ou):[ou(t)],b6=(t,e,n)=>{if(e._n)return e;const i=jt((...r)=>xw(e(...r)),n);return i._c=!1,i},RC=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Ew(r))continue;const s=t[r];if(Kn(s))e[r]=b6(r,s,i);else if(s!=null){const o=xw(s);e[r]=()=>o}}},LC=(t,e)=>{const n=xw(e);t.slots.default=()=>n},MC=(t,e,n)=>{for(const i in e)(n||!Ew(i))&&(t[i]=e[i])},w6=(t,e,n)=>{const i=t.slots=kC();if(t.vnode.shapeFlag&32){const r=e._;r?(MC(i,e,n),n&&vx(i,"_",r,!0)):RC(e,i)}else e&&LC(t,e)},_6=(t,e,n)=>{const{vnode:i,slots:r}=t;let s=!0,o=Vn;if(i.shapeFlag&32){const u=e._;u?n&&u===1?s=!1:MC(r,e,n):(s=!e.$stable,RC(e,r)),o=e}else e&&(LC(t,e),o={default:1});if(s)for(const u in r)!Ew(u)&&o[u]==null&&delete r[u]},Ro=M6;function S6(t){return T6(t)}function T6(t,e){const n=Jg();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:u,createComment:d,setText:h,setElementText:g,parentNode:y,nextSibling:w,setScopeId:C=_a,insertStaticContent:D}=t,P=(Fe,Ke,N,ce=null,Re=null,Ye=null,re=void 0,ge=null,Ce=!!Ke.dynamicChildren)=>{if(Fe===Ke)return;Fe&&!Yd(Fe,Ke)&&(ce=or(Fe),ii(Fe,Re,Ye,!0),Fe=null),Ke.patchFlag===-2&&(Ce=!1,Ke.dynamicChildren=null);const{type:Ge,ref:Ue,shapeFlag:We}=Ke;switch(Ge){case Wf:M(Fe,Ke,N,ce);break;case ho:F(Fe,Ke,N,ce);break;case kw:Fe==null&&K(Ke,N,ce,re);break;case xt:et(Fe,Ke,N,ce,Re,Ye,re,ge,Ce);break;default:We&1?he(Fe,Ke,N,ce,Re,Ye,re,ge,Ce):We&6?pt(Fe,Ke,N,ce,Re,Ye,re,ge,Ce):(We&64||We&128)&&Ge.process(Fe,Ke,N,ce,Re,Ye,re,ge,Ce,Hn)}Ue!=null&&Re&&fy(Ue,Fe&&Fe.ref,Ye,Ke||Fe,!Ke)},M=(Fe,Ke,N,ce)=>{if(Fe==null)i(Ke.el=u(Ke.children),N,ce);else{const Re=Ke.el=Fe.el;Ke.children!==Fe.children&&h(Re,Ke.children)}},F=(Fe,Ke,N,ce)=>{Fe==null?i(Ke.el=d(Ke.children||""),N,ce):Ke.el=Fe.el},K=(Fe,Ke,N,ce)=>{[Fe.el,Fe.anchor]=D(Fe.children,Ke,N,ce,Fe.el,Fe.anchor)},$=({el:Fe,anchor:Ke},N,ce)=>{let Re;for(;Fe&&Fe!==Ke;)Re=w(Fe),i(Fe,N,ce),Fe=Re;i(Ke,N,ce)},ee=({el:Fe,anchor:Ke})=>{let N;for(;Fe&&Fe!==Ke;)N=w(Fe),r(Fe),Fe=N;r(Ke)},he=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce)=>{Ke.type==="svg"?re="svg":Ke.type==="math"&&(re="mathml"),Fe==null?ve(Ke,N,ce,Re,Ye,re,ge,Ce):xe(Fe,Ke,Re,Ye,re,ge,Ce)},ve=(Fe,Ke,N,ce,Re,Ye,re,ge)=>{let Ce,Ge;const{props:Ue,shapeFlag:We,transition:rt,dirs:kt}=Fe;if(Ce=Fe.el=o(Fe.type,Ye,Ue&&Ue.is,Ue),We&8?g(Ce,Fe.children):We&16&&ae(Fe.children,Ce,null,ce,Re,Cw(Fe,Ye),re,ge),kt&&Vd(Fe,null,ce,"created"),fe(Ce,Fe,Fe.scopeId,re,ce),Ue){for(const tn in Ue)tn!=="value"&&!Of(tn)&&s(Ce,tn,null,Ue[tn],Ye,ce);"value"in Ue&&s(Ce,"value",null,Ue.value,Ye),(Ge=Ue.onVnodeBeforeMount)&&au(Ge,ce,Fe)}kt&&Vd(Fe,null,ce,"beforeMount");const Dt=E6(Re,rt);Dt&&rt.beforeEnter(Ce),i(Ce,Ke,N),((Ge=Ue&&Ue.onVnodeMounted)||Dt||kt)&&Ro(()=>{Ge&&au(Ge,ce,Fe),Dt&&rt.enter(Ce),kt&&Vd(Fe,null,ce,"mounted")},Re)},fe=(Fe,Ke,N,ce,Re)=>{if(N&&C(Fe,N),ce)for(let Ye=0;Ye{for(let Ge=Ce;Ge{const ge=Ke.el=Fe.el;let{patchFlag:Ce,dynamicChildren:Ge,dirs:Ue}=Ke;Ce|=Fe.patchFlag&16;const We=Fe.props||Vn,rt=Ke.props||Vn;let kt;if(N&&Gd(N,!1),(kt=rt.onVnodeBeforeUpdate)&&au(kt,N,Ke,Fe),Ue&&Vd(Ke,Fe,N,"beforeUpdate"),N&&Gd(N,!0),(We.innerHTML&&rt.innerHTML==null||We.textContent&&rt.textContent==null)&&g(ge,""),Ge?Qe(Fe.dynamicChildren,Ge,ge,N,ce,Cw(Ke,Re),Ye):re||cn(Fe,Ke,ge,null,N,ce,Cw(Ke,Re),Ye,!1),Ce>0){if(Ce&16)ot(ge,We,rt,N,Re);else if(Ce&2&&We.class!==rt.class&&s(ge,"class",null,rt.class,Re),Ce&4&&s(ge,"style",We.style,rt.style,Re),Ce&8){const Dt=Ke.dynamicProps;for(let tn=0;tn{kt&&au(kt,N,Ke,Fe),Ue&&Vd(Ke,Fe,N,"updated")},ce)},Qe=(Fe,Ke,N,ce,Re,Ye,re)=>{for(let ge=0;ge{if(Ke!==N){if(Ke!==Vn)for(const Ye in Ke)!Of(Ye)&&!(Ye in N)&&s(Fe,Ye,Ke[Ye],null,Re,ce);for(const Ye in N){if(Of(Ye))continue;const re=N[Ye],ge=Ke[Ye];re!==ge&&Ye!=="value"&&s(Fe,Ye,ge,re,Re,ce)}"value"in N&&s(Fe,"value",Ke.value,N.value,Re)}},et=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce)=>{const Ge=Ke.el=Fe?Fe.el:u(""),Ue=Ke.anchor=Fe?Fe.anchor:u("");let{patchFlag:We,dynamicChildren:rt,slotScopeIds:kt}=Ke;kt&&(ge=ge?ge.concat(kt):kt),Fe==null?(i(Ge,N,ce),i(Ue,N,ce),ae(Ke.children||[],N,Ue,Re,Ye,re,ge,Ce)):We>0&&We&64&&rt&&Fe.dynamicChildren?(Qe(Fe.dynamicChildren,rt,N,Re,Ye,re,ge),(Ke.key!=null||Re&&Ke===Re.subTree)&&Aw(Fe,Ke,!0)):cn(Fe,Ke,N,Ue,Re,Ye,re,ge,Ce)},pt=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce)=>{Ke.slotScopeIds=ge,Fe==null?Ke.shapeFlag&512?Re.ctx.activate(Ke,N,ce,re,Ce):Wt(Ke,N,ce,Re,Ye,re,Ce):pn(Fe,Ke,Ce)},Wt=(Fe,Ke,N,ce,Re,Ye,re)=>{const ge=Fe.component=z6(Fe,ce,Re);if(my(Fe)&&(ge.ctx.renderer=Hn),j6(ge,!1,re),ge.asyncDep){if(Re&&Re.registerDep(ge,Ut,re),!Fe.el){const Ce=ge.subTree=gt(ho);F(null,Ce,Ke,N)}}else Ut(ge,Fe,Ke,N,Re,Ye,re)},pn=(Fe,Ke,N)=>{const ce=Ke.component=Fe.component;if(R6(Fe,Ke,N))if(ce.asyncDep&&!ce.asyncResolved){Xt(ce,Ke,N);return}else ce.next=Ke,ce.update();else Ke.el=Fe.el,ce.vnode=Ke},Ut=(Fe,Ke,N,ce,Re,Ye,re)=>{const ge=()=>{if(Fe.isMounted){let{next:We,bu:rt,u:kt,parent:Dt,vnode:tn}=Fe;{const we=NC(Fe);if(we){We&&(We.el=tn.el,Xt(Fe,We,re)),we.asyncDep.then(()=>{Fe.isUnmounted||ge()});return}}let dn=We,te;Gd(Fe,!1),We?(We.el=tn.el,Xt(Fe,We,re)):We=tn,rt&&Qg(rt),(te=We.props&&We.props.onVnodeBeforeUpdate)&&au(te,Dt,We,tn),Gd(Fe,!0);const Z=zC(Fe),be=Fe.subTree;Fe.subTree=Z,P(be,Z,y(be.el),or(be),Fe,Re,Ye),We.el=Z.el,dn===null&&L6(Fe,Z.el),kt&&Ro(kt,Re),(te=We.props&&We.props.onVnodeUpdated)&&Ro(()=>au(te,Dt,We,tn),Re)}else{let We;const{el:rt,props:kt}=Ke,{bm:Dt,m:tn,parent:dn,root:te,type:Z}=Fe,be=zh(Ke);Gd(Fe,!1),Dt&&Qg(Dt),!be&&(We=kt&&kt.onVnodeBeforeMount)&&au(We,dn,Ke),Gd(Fe,!0);{te.ce&&te.ce._injectChildStyle(Z);const we=Fe.subTree=zC(Fe);P(null,we,N,ce,Fe,Re,Ye),Ke.el=we.el}if(tn&&Ro(tn,Re),!be&&(We=kt&&kt.onVnodeMounted)){const we=Ke;Ro(()=>au(We,dn,we),Re)}(Ke.shapeFlag&256||dn&&zh(dn.vnode)&&dn.vnode.shapeFlag&256)&&Fe.a&&Ro(Fe.a,Re),Fe.isMounted=!0,Ke=N=ce=null}};Fe.scope.on();const Ce=Fe.effect=new xx(ge);Fe.scope.off();const Ge=Fe.update=Ce.run.bind(Ce),Ue=Fe.job=Ce.runIfDirty.bind(Ce);Ue.i=Fe,Ue.id=Fe.uid,Ce.scheduler=()=>cw(Ue),Gd(Fe,!0),Ge()},Xt=(Fe,Ke,N)=>{Ke.component=Fe;const ce=Fe.vnode.props;Fe.vnode=Ke,Fe.next=null,y6(Fe,Ke.props,ce,N),_6(Fe,Ke.children,N),iu(),Zx(Fe),ru()},cn=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce=!1)=>{const Ge=Fe&&Fe.children,Ue=Fe?Fe.shapeFlag:0,We=Ke.children,{patchFlag:rt,shapeFlag:kt}=Ke;if(rt>0){if(rt&128){Qt(Ge,We,N,ce,Re,Ye,re,ge,Ce);return}else if(rt&256){ai(Ge,We,N,ce,Re,Ye,re,ge,Ce);return}}kt&8?(Ue&16&&ui(Ge,Re,Ye),We!==Ge&&g(N,We)):Ue&16?kt&16?Qt(Ge,We,N,ce,Re,Ye,re,ge,Ce):ui(Ge,Re,Ye,!0):(Ue&8&&g(N,""),kt&16&&ae(We,N,ce,Re,Ye,re,ge,Ce))},ai=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce)=>{Fe=Fe||vs,Ke=Ke||vs;const Ge=Fe.length,Ue=Ke.length,We=Math.min(Ge,Ue);let rt;for(rt=0;rtUe?ui(Fe,Re,Ye,!0,!1,We):ae(Ke,N,ce,Re,Ye,re,ge,Ce,We)},Qt=(Fe,Ke,N,ce,Re,Ye,re,ge,Ce)=>{let Ge=0;const Ue=Ke.length;let We=Fe.length-1,rt=Ue-1;for(;Ge<=We&&Ge<=rt;){const kt=Fe[Ge],Dt=Ke[Ge]=Ce?Jc(Ke[Ge]):ou(Ke[Ge]);if(Yd(kt,Dt))P(kt,Dt,N,null,Re,Ye,re,ge,Ce);else break;Ge++}for(;Ge<=We&&Ge<=rt;){const kt=Fe[We],Dt=Ke[rt]=Ce?Jc(Ke[rt]):ou(Ke[rt]);if(Yd(kt,Dt))P(kt,Dt,N,null,Re,Ye,re,ge,Ce);else break;We--,rt--}if(Ge>We){if(Ge<=rt){const kt=rt+1,Dt=ktrt)for(;Ge<=We;)ii(Fe[Ge],Re,Ye,!0),Ge++;else{const kt=Ge,Dt=Ge,tn=new Map;for(Ge=Dt;Ge<=rt;Ge++){const Zt=Ke[Ge]=Ce?Jc(Ke[Ge]):ou(Ke[Ge]);Zt.key!=null&&tn.set(Zt.key,Ge)}let dn,te=0;const Z=rt-Dt+1;let be=!1,we=0;const at=new Array(Z);for(Ge=0;Ge=Z){ii(Zt,Re,Ye,!0);continue}let gn;if(Zt.key!=null)gn=tn.get(Zt.key);else for(dn=Dt;dn<=rt;dn++)if(at[dn-Dt]===0&&Yd(Zt,Ke[dn])){gn=dn;break}gn===void 0?ii(Zt,Re,Ye,!0):(at[gn-Dt]=Ge+1,gn>=we?we=gn:be=!0,P(Zt,Ke[gn],N,null,Re,Ye,re,ge,Ce),te++)}const Et=be?x6(at):vs;for(dn=Et.length-1,Ge=Z-1;Ge>=0;Ge--){const Zt=Dt+Ge,gn=Ke[Zt],nn=Zt+1{const{el:Ye,type:re,transition:ge,children:Ce,shapeFlag:Ge}=Fe;if(Ge&6){xn(Fe.component.subTree,Ke,N,ce);return}if(Ge&128){Fe.suspense.move(Ke,N,ce);return}if(Ge&64){re.move(Fe,Ke,N,Hn);return}if(re===xt){i(Ye,Ke,N);for(let We=0;Wege.enter(Ye),Re);else{const{leave:We,delayLeave:rt,afterLeave:kt}=ge,Dt=()=>{Fe.ctx.isUnmounted?r(Ye):i(Ye,Ke,N)},tn=()=>{We(Ye,()=>{Dt(),kt&&kt()})};rt?rt(Ye,Dt,tn):tn()}else i(Ye,Ke,N)},ii=(Fe,Ke,N,ce=!1,Re=!1)=>{const{type:Ye,props:re,ref:ge,children:Ce,dynamicChildren:Ge,shapeFlag:Ue,patchFlag:We,dirs:rt,cacheIndex:kt}=Fe;if(We===-2&&(Re=!1),ge!=null&&(iu(),fy(ge,null,N,Fe,!0),ru()),kt!=null&&(Ke.renderCache[kt]=void 0),Ue&256){Ke.ctx.deactivate(Fe);return}const Dt=Ue&1&&rt,tn=!zh(Fe);let dn;if(tn&&(dn=re&&re.onVnodeBeforeUnmount)&&au(dn,Ke,Fe),Ue&6)Ft(Fe.component,N,ce);else{if(Ue&128){Fe.suspense.unmount(N,ce);return}Dt&&Vd(Fe,null,Ke,"beforeUnmount"),Ue&64?Fe.type.remove(Fe,Ke,N,Hn,ce):Ge&&!Ge.hasOnce&&(Ye!==xt||We>0&&We&64)?ui(Ge,Ke,N,!1,!0):(Ye===xt&&We&384||!Re&&Ue&16)&&ui(Ce,Ke,N),ce&&Zn(Fe)}(tn&&(dn=re&&re.onVnodeUnmounted)||Dt)&&Ro(()=>{dn&&au(dn,Ke,Fe),Dt&&Vd(Fe,null,Ke,"unmounted")},N)},Zn=Fe=>{const{type:Ke,el:N,anchor:ce,transition:Re}=Fe;if(Ke===xt){li(N,ce);return}if(Ke===kw){ee(Fe);return}const Ye=()=>{r(N),Re&&!Re.persisted&&Re.afterLeave&&Re.afterLeave()};if(Fe.shapeFlag&1&&Re&&!Re.persisted){const{leave:re,delayLeave:ge}=Re,Ce=()=>re(N,Ye);ge?ge(Fe.el,Ye,Ce):Ce()}else Ye()},li=(Fe,Ke)=>{let N;for(;Fe!==Ke;)N=w(Fe),r(Fe),Fe=N;r(Ke)},Ft=(Fe,Ke,N)=>{const{bum:ce,scope:Re,job:Ye,subTree:re,um:ge,m:Ce,a:Ge,parent:Ue,slots:{__:We}}=Fe;FC(Ce),FC(Ge),ce&&Qg(ce),Ue&&Cn(We)&&We.forEach(rt=>{Ue.renderCache[rt]=void 0}),Re.stop(),Ye&&(Ye.flags|=8,ii(re,Fe,Ke,N)),ge&&Ro(ge,Ke),Ro(()=>{Fe.isUnmounted=!0},Ke),Ke&&Ke.pendingBranch&&!Ke.isUnmounted&&Fe.asyncDep&&!Fe.asyncResolved&&Fe.suspenseId===Ke.pendingId&&(Ke.deps--,Ke.deps===0&&Ke.resolve())},ui=(Fe,Ke,N,ce=!1,Re=!1,Ye=0)=>{for(let re=Ye;re{if(Fe.shapeFlag&6)return or(Fe.component.subTree);if(Fe.shapeFlag&128)return Fe.suspense.next();const Ke=w(Fe.anchor||Fe.el),N=Ke&&Ke[eC];return N?w(N):Ke};let ji=!1;const Vi=(Fe,Ke,N)=>{Fe==null?Ke._vnode&&ii(Ke._vnode,null,null,!0):P(Ke._vnode||null,Fe,Ke,null,null,null,N),Ke._vnode=Fe,ji||(ji=!0,Zx(),Qx(),ji=!1)},Hn={p:P,um:ii,m:xn,r:Zn,mt:Wt,mc:ae,pc:cn,pbc:Qe,n:or,o:t};return{render:Vi,hydrate:void 0,createApp:p6(Vi)}}function Cw({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Gd({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function E6(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Aw(t,e,n=!1){const i=t.children,r=e.children;if(Cn(i)&&Cn(r))for(let s=0;s>1,t[n[u]]0&&(e[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function NC(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:NC(e)}function FC(t){if(t)for(let e=0;ejh(C6);function Kd(t,e,n){return BC(t,e,n)}function BC(t,e,n=Vn){const{immediate:i,deep:r,flush:s,once:o}=n,u=bs({},n),d=e&&i||!e&&s!=="post";let h;if(Xf){if(s==="sync"){const C=A6();h=C.__watcherHandles||(C.__watcherHandles=[])}else if(!d){const C=()=>{};return C.stop=_a,C.resume=_a,C.pause=_a,C}}const g=Is;u.call=(C,D,P)=>xl(C,g,D,P);let y=!1;s==="post"?u.scheduler=C=>{Ro(C,g&&g.suspense)}:s!=="sync"&&(y=!0,u.scheduler=(C,D)=>{D?C():cw(C)}),u.augmentJob=C=>{e&&(C.flags|=4),y&&(C.flags|=2,g&&(C.id=g.uid,C.i=g))};const w=B3(t,e,u);return Xf&&(h?h.push(w):d&&w()),w}function k6(t,e,n){const i=this.proxy,r=xr(t)?t.includes(".")?UC(i,t):()=>i[t]:t.bind(i,i);let s;Kn(e)?s=e:(s=e.handler,n=e);const o=Yf(this),u=BC(r,s.bind(i),n);return o(),u}function UC(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;re==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Ka(e)}Modifiers`]||t[`${qc(e)}Modifiers`];function D6(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||Vn;let r=n;const s=e.startsWith("update:"),o=s&&P6(i,e.slice(7));o&&(o.trim&&(r=n.map(g=>xr(g)?g.trim():g)),o.number&&(r=n.map(K0)));let u,d=i[u=Zg(e)]||i[u=Zg(Ka(e))];!d&&s&&(d=i[u=Zg(qc(e))]),d&&xl(d,t,6,r);const h=i[u+"Once"];if(h){if(!t.emitted)t.emitted={};else if(t.emitted[u])return;t.emitted[u]=!0,xl(h,t,6,r)}}function HC(t,e,n=!1){const i=e.emitsCache,r=i.get(t);if(r!==void 0)return r;const s=t.emits;let o={},u=!1;if(!Kn(t)){const d=h=>{const g=HC(h,e,!0);g&&(u=!0,bs(o,g))};!n&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}return!s&&!u?(wr(t)&&i.set(t,null),null):(Cn(s)?s.forEach(d=>o[d]=null):bs(o,s),wr(t)&&i.set(t,o),o)}function wy(t,e){return!t||!Gg(e)?!1:(e=e.slice(2).replace(/Once$/,""),Gi(t,e[0].toLowerCase()+e.slice(1))||Gi(t,qc(e))||Gi(t,e))}function Yye(){}function zC(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:u,emit:d,render:h,renderCache:g,props:y,data:w,setupState:C,ctx:D,inheritAttrs:P}=t,M=cy(t);let F,K;try{if(n.shapeFlag&4){const ee=r||i,he=ee;F=ou(h.call(he,ee,g,y,C,w,D)),K=u}else{const ee=e;F=ou(ee.length>1?ee(y,{attrs:u,slots:o,emit:d}):ee(y,null)),K=e.props?u:I6(u)}}catch(ee){qf.length=0,ly(ee,t,1),F=gt(ho)}let $=F;if(K&&P!==!1){const ee=Object.keys(K),{shapeFlag:he}=$;ee.length&&he&7&&(s&&ee.some(W0)&&(K=O6(K,s)),$=Qc($,K,!1,!0))}return n.dirs&&($=Qc($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&Wd($,n.transition),F=$,cy(M),F}const I6=t=>{let e;for(const n in t)(n==="class"||n==="style"||Gg(n))&&((e||(e={}))[n]=t[n]);return e},O6=(t,e)=>{const n={};for(const i in t)(!W0(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function R6(t,e,n){const{props:i,children:r,component:s}=t,{props:o,children:u,patchFlag:d}=e,h=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return i?jC(i,o,h):!!o;if(d&8){const g=e.dynamicProps;for(let y=0;yt.__isSuspense;function M6(t,e){e&&e.pendingBranch?Cn(t)?e.effects.push(...t):e.effects.push(t):q3(t)}const xt=Symbol.for("v-fgt"),Wf=Symbol.for("v-txt"),ho=Symbol.for("v-cmt"),kw=Symbol.for("v-stc"),qf=[];let Sa=null;function G(t=!1){qf.push(Sa=t?null:[])}function N6(){qf.pop(),Sa=qf[qf.length-1]||null}let Gf=1;function WC(t,e=!1){Gf+=t,t<0&&Sa&&e&&(Sa.hasOnce=!0)}function qC(t){return t.dynamicChildren=Gf>0?Sa||vs:null,N6(),Gf>0&&Sa&&Sa.push(t),t}function se(t,e,n,i,r,s){return qC(ue(t,e,n,i,r,s,!0))}function Ct(t,e,n,i,r){return qC(gt(t,e,n,i,r,!0))}function Kf(t){return t?t.__v_isVNode===!0:!1}function Yd(t,e){return t.type===e.type&&t.key===e.key}const GC=({key:t})=>t??null,_y=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?xr(t)||Mr(t)||Kn(t)?{i:ws,r:t,k:e,f:!!n}:t:null);function ue(t,e=null,n=null,i=0,r=null,s=t===xt?0:1,o=!1,u=!1){const d={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&GC(e),ref:e&&_y(e),scopeId:$x,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ws};return u?(Pw(d,n),s&128&&t.normalize(d)):n&&(d.shapeFlag|=xr(n)?8:16),Gf>0&&!o&&Sa&&(d.patchFlag>0||s&6)&&d.patchFlag!==32&&Sa.push(d),d}const gt=F6;function F6(t,e=null,n=null,i=0,r=null,s=!1){if((!t||t===yC)&&(t=ho),Kf(t)){const u=Qc(t,e,!0);return n&&Pw(u,n),Gf>0&&!s&&Sa&&(u.shapeFlag&6?Sa[Sa.indexOf(t)]=u:Sa.push(u)),u.patchFlag=-2,u}if(Y6(t)&&(t=t.__vccOpts),e){e=B6(e);let{class:u,style:d}=e;u&&!xr(u)&&(e.class=Lt(u)),wr(d)&&(ow(d)&&!Cn(d)&&(d=bs({},d)),e.style=hi(d))}const o=xr(t)?1:VC(t)?128:tC(t)?64:wr(t)?4:Kn(t)?2:0;return ue(t,e,n,i,r,o,s,!0)}function B6(t){return t?ow(t)||PC(t)?bs({},t):t:null}function Qc(t,e,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:u,transition:d}=t,h=e?Ni(r||{},e):r,g={__v_isVNode:!0,__v_skip:!0,type:t.type,props:h,key:h&&GC(h),ref:e&&e.ref?n&&s?Cn(s)?s.concat(_y(e)):[s,_y(e)]:_y(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:u,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==xt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:d,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Qc(t.ssContent),ssFallback:t.ssFallback&&Qc(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return d&&i&&Wd(g,d.clone(g)),g}function Jn(t=" ",e=0){return gt(Wf,null,t,e)}function qe(t="",e=!1){return e?(G(),Ct(ho,null,t)):gt(ho,null,t)}function ou(t){return t==null||typeof t=="boolean"?gt(ho):Cn(t)?gt(xt,null,t.slice()):Kf(t)?Jc(t):gt(Wf,null,String(t))}function Jc(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Qc(t)}function Pw(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Cn(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Pw(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!PC(e)?e._ctx=ws:r===3&&ws&&(ws.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Kn(e)?(e={default:e,_ctx:ws},n=32):(e=String(e),i&64?(n=16,e=[Jn(e)]):n=8);t.children=e,t.shapeFlag|=n}function Ni(...t){const e={};for(let n=0;nIs||ws;let Sy,Dw;{const t=Jg(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Sy=e("__VUE_INSTANCE_SETTERS__",n=>Is=n),Dw=e("__VUE_SSR_SETTERS__",n=>Xf=n)}const Yf=t=>{const e=Is;return Sy(t),t.scope.on(),()=>{t.scope.off(),Sy(e)}},KC=()=>{Is&&Is.scope.off(),Sy(null)};function YC(t){return t.vnode.shapeFlag&4}let Xf=!1;function j6(t,e=!1,n=!1){e&&Dw(e);const{props:i,children:r}=t.vnode,s=YC(t);g6(t,i,s,e),w6(t,r,n||e);const o=s?V6(t,e):void 0;return e&&Dw(!1),o}function V6(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,o6);const{setup:i}=n;if(i){iu();const r=t.setupContext=i.length>1?q6(t):null,s=Yf(t),o=Bh(i,t,0,[t.props,r]),u=mx(o);if(ru(),s(),(u||t.sp)&&!zh(t)&&pC(t),u){if(o.then(KC,KC),e)return o.then(d=>{XC(t,d)}).catch(d=>{ly(d,t,0)});t.asyncDep=o}else XC(t,o)}else ZC(t)}function XC(t,e,n){Kn(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:wr(e)&&(t.setupState=qx(e)),ZC(t)}function ZC(t,e,n){const i=t.type;t.render||(t.render=i.render||_a);{const r=Yf(t);iu();try{a6(t)}finally{ru(),r()}}}const W6={get(t,e){return co(t,"get",""),t[e]}};function q6(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,W6),slots:t.slots,emit:t.emit,expose:e}}function Ty(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(qx(aw(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in jf)return jf[n](t)},has(e,n){return n in e||n in jf}})):t.proxy}const G6=/(?:^|[-_])(\w)/g,K6=t=>t.replace(G6,e=>e.toUpperCase()).replace(/[-_]/g,"");function QC(t,e=!0){return Kn(t)?t.displayName||t.name:t.name||e&&t.__name}function JC(t,e,n=!1){let i=QC(e);if(!i&&e.__file){const r=e.__file.match(/([^/\\]+)\.\w+$/);r&&(i=r[1])}if(!i&&t&&t.parent){const r=s=>{for(const o in s)if(s[o]===e)return o};i=r(t.components||t.parent.type.components)||r(t.appContext.components)}return i?K6(i):n?"App":"Anonymous"}function Y6(t){return Kn(t)&&"__vccOpts"in t}const $c=(t,e)=>N3(t,e,Xf);function Iw(t,e,n){const i=arguments.length;return i===2?wr(e)&&!Cn(e)?Kf(e)?gt(t,null,[e]):gt(t,e):gt(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&Kf(n)&&(n=[n]),gt(t,e,n))}const X6="3.5.16";/** * @vue/runtime-dom v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let Ow;const $C=typeof window<"u"&&window.trustedTypes;if($C)try{Ow=$C.createPolicy("vue",{createHTML:t=>t})}catch{}const eA=Ow?t=>Ow.createHTML(t):t=>t,Z6="http://www.w3.org/2000/svg",Q6="http://www.w3.org/1998/Math/MathML",tc=typeof document<"u"?document:null,tA=tc&&tc.createElement("template"),J6={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?tc.createElementNS(Z6,t):e==="mathml"?tc.createElementNS(Q6,t):n?tc.createElement(t,{is:n}):tc.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>tc.createTextNode(t),createComment:t=>tc.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>tc.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,s){const o=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{tA.innerHTML=eA(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const u=tA.content;if(i==="svg"||i==="mathml"){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}e.insertBefore(u,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},ed="transition",Zf="animation",Wh=Symbol("_vtc"),nA={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},iA=bs({},lC,nA),lu=(t=>(t.displayName="Transition",t.props=iA,t))((t,{slots:e})=>Iw(X3,sA(t),e)),Xd=(t,e=[])=>{Cn(t)?t.forEach(n=>n(...e)):t&&t(...e)},rA=t=>t?Cn(t)?t.some(e=>e.length>1):t.length>1:!1;function sA(t){const e={};for(const et in t)et in nA||(e[et]=t[et]);if(t.css===!1)return e;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:u=`${n}-enter-to`,appearFromClass:d=s,appearActiveClass:h=o,appearToClass:g=u,leaveFromClass:y=`${n}-leave-from`,leaveActiveClass:w=`${n}-leave-active`,leaveToClass:C=`${n}-leave-to`}=t,D=$6(r),P=D&&D[0],M=D&&D[1],{onBeforeEnter:F,onEnter:K,onEnterCancelled:$,onLeave:ee,onLeaveCancelled:he,onBeforeAppear:ve=F,onAppear:fe=K,onAppearCancelled:ae=$}=e,xe=(et,pt,Wt,pn)=>{et._enterCancelled=pn,td(et,pt?g:u),td(et,pt?h:o),Wt&&Wt()},Qe=(et,pt)=>{et._isLeaving=!1,td(et,y),td(et,C),td(et,w),pt&&pt()},ot=et=>(pt,Wt)=>{const pn=et?fe:K,Ut=()=>xe(pt,et,Wt);Xd(pn,[pt,Ut]),oA(()=>{td(pt,et?d:s),uu(pt,et?g:u),rA(pn)||aA(pt,i,P,Ut)})};return bs(e,{onBeforeEnter(et){Xd(F,[et]),uu(et,s),uu(et,o)},onBeforeAppear(et){Xd(ve,[et]),uu(et,d),uu(et,h)},onEnter:ot(!1),onAppear:ot(!0),onLeave(et,pt){et._isLeaving=!0;const Wt=()=>Qe(et,pt);uu(et,y),et._enterCancelled?(uu(et,w),Lw()):(Lw(),uu(et,w)),oA(()=>{et._isLeaving&&(td(et,y),uu(et,C),rA(ee)||aA(et,i,M,Wt))}),Xd(ee,[et,Wt])},onEnterCancelled(et){xe(et,!1,void 0,!0),Xd($,[et])},onAppearCancelled(et){xe(et,!0,void 0,!0),Xd(ae,[et])},onLeaveCancelled(et){Qe(et),Xd(he,[et])}})}function $6(t){if(t==null)return null;if(wr(t))return[Rw(t.enter),Rw(t.leave)];{const e=Rw(t);return[e,e]}}function Rw(t){return t3(t)}function uu(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Wh]||(t[Wh]=new Set)).add(e)}function td(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const n=t[Wh];n&&(n.delete(e),n.size||(t[Wh]=void 0))}function oA(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let e5=0;function aA(t,e,n,i){const r=t._endId=++e5,s=()=>{r===t._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:u,propCount:d}=lA(t,e);if(!o)return i();const h=o+"end";let g=0;const y=()=>{t.removeEventListener(h,w),s()},w=C=>{C.target===t&&++g>=d&&y()};setTimeout(()=>{g(n[D]||"").split(", "),r=i(`${ed}Delay`),s=i(`${ed}Duration`),o=uA(r,s),u=i(`${Zf}Delay`),d=i(`${Zf}Duration`),h=uA(u,d);let g=null,y=0,w=0;e===ed?o>0&&(g=ed,y=o,w=s.length):e===Zf?h>0&&(g=Zf,y=h,w=d.length):(y=Math.max(o,h),g=y>0?o>h?ed:Zf:null,w=g?g===ed?s.length:d.length:0);const C=g===ed&&/\b(transform|all)(,|$)/.test(i(`${ed}Property`).toString());return{type:g,timeout:y,propCount:w,hasTransform:C}}function uA(t,e){for(;t.lengthcA(n)+cA(t[i])))}function cA(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Lw(){return document.body.offsetHeight}function t5(t,e,n){const i=t[Wh];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Ey=Symbol("_vod"),dA=Symbol("_vsh"),Qf={beforeMount(t,{value:e},{transition:n}){t[Ey]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Jf(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:i}){!e!=!n&&(i?e?(i.beforeEnter(t),Jf(t,!0),i.enter(t)):i.leave(t,()=>{Jf(t,!1)}):Jf(t,e))},beforeUnmount(t,{value:e}){Jf(t,e)}};function Jf(t,e){t.style.display=e?t[Ey]:"none",t[dA]=!e}const n5=Symbol(""),i5=/(^|;)\s*display\s*:/;function r5(t,e,n){const i=t.style,r=xr(n);let s=!1;if(n&&!r){if(e)if(xr(e))for(const o of e.split(";")){const u=o.slice(0,o.indexOf(":")).trim();n[u]==null&&xy(i,u,"")}else for(const o in e)n[o]==null&&xy(i,o,"");for(const o in n)o==="display"&&(s=!0),xy(i,o,n[o])}else if(r){if(e!==n){const o=i[n5];o&&(n+=";"+o),i.cssText=n,s=i5.test(n)}}else e&&t.removeAttribute("style");Ey in t&&(t[Ey]=s?i.display:"",t[dA]&&(i.display="none"))}const hA=/\s*!important$/;function xy(t,e,n){if(Cn(n))n.forEach(i=>xy(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=s5(t,e);hA.test(n)?t.setProperty(qc(i),n.replace(hA,""),"important"):t[i]=n}}const pA=["Webkit","Moz","ms"],Mw={};function s5(t,e){const n=Mw[e];if(n)return n;let i=Ka(e);if(i!=="filter"&&i in t)return Mw[e]=i;i=Xg(i);for(let r=0;rNw||(u5.then(()=>Nw=0),Nw=Date.now());function d5(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;xl(h5(i,n.value),e,5,[i])};return n.value=t,n.attached=c5(),n}function h5(t,e){if(Cn(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const bA=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,p5=(t,e,n,i,r,s)=>{const o=r==="svg";e==="class"?t5(t,i,o):e==="style"?r5(t,n,i):Gg(e)?W0(e)||a5(t,e,n,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):f5(t,e,i,o))?(gA(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&mA(t,e,i,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!xr(i))?gA(t,Ka(e),i,s,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),mA(t,e,i,o))};function f5(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&bA(e)&&Kn(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return bA(e)&&xr(n)?!1:e in t}const wA=new WeakMap,_A=new WeakMap,Cy=Symbol("_moveCb"),SA=Symbol("_enterCb"),m5=(t=>(delete t.props.mode,t))({name:"TransitionGroup",props:bs({},iA,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=Vh(),i=aC();let r,s;return mC(()=>{if(!r.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!b5(r[0].el,n.vnode.el,o)){r=[];return}r.forEach(g5),r.forEach(y5);const u=r.filter(v5);Lw(),u.forEach(d=>{const h=d.el,g=h.style;uu(h,o),g.transform=g.webkitTransform=g.transitionDuration="";const y=h[Cy]=w=>{w&&w.target!==h||(!w||/transform$/.test(w.propertyName))&&(h.removeEventListener("transitionend",y),h[Cy]=null,td(h,o))};h.addEventListener("transitionend",y)}),r=[]}),()=>{const o=Rn(t),u=sA(o);let d=o.tag||xt;if(r=[],s)for(let h=0;h{u.split(/\s+/).forEach(d=>d&&i.classList.remove(d))}),n.split(/\s+/).forEach(u=>u&&i.classList.add(u)),i.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(i);const{hasTransform:o}=lA(i);return s.removeChild(i),o}const TA=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Cn(e)?n=>Qg(e,n):e};function w5(t){t.target.composing=!0}function EA(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Fw=Symbol("_assign"),xA={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[Fw]=TA(r);const s=i||r.props&&r.props.type==="number";qh(t,e?"change":"input",o=>{if(o.target.composing)return;let u=t.value;n&&(u=u.trim()),s&&(u=K0(u)),t[Fw](u)}),n&&qh(t,"change",()=>{t.value=t.value.trim()}),e||(qh(t,"compositionstart",w5),qh(t,"compositionend",EA),qh(t,"change",EA))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(t[Fw]=TA(o),t.composing)return;const u=(s||t.type==="number")&&!/^0\d/.test(t.value)?K0(t.value):t.value,d=e??"";u!==d&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===d)||(t.value=d))}},_5=["ctrl","shift","alt","meta"],S5={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>_5.some(n=>t[`${n}Key`]&&!e.includes(n))},$f=(t,e)=>{const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=(r,...s)=>{for(let o=0;o{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=r=>{if(!("key"in r))return;const s=qc(r.key);if(e.some(o=>o===s||T5[o]===s))return t(r)})},E5=bs({patchProp:p5},J6);let CA;function x5(){return CA||(CA=S6(E5))}const C5=(...t)=>{const e=x5().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=k5(i);if(!r)return;const s=e._component;!Kn(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,A5(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function A5(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function k5(t){return xr(t)?document.querySelector(t):t}var Ne={innerWidth(t){if(t){let e=t.offsetWidth,n=getComputedStyle(t);return e+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),e}return 0},width(t){if(t){let e=t.offsetWidth,n=getComputedStyle(t);return e-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),e}return 0},getWindowScrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)},getWindowScrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)},getOuterWidth(t,e){if(t){let n=t.offsetWidth;if(e){let i=getComputedStyle(t);n+=parseFloat(i.marginLeft)+parseFloat(i.marginRight)}return n}return 0},getOuterHeight(t,e){if(t){let n=t.offsetHeight;if(e){let i=getComputedStyle(t);n+=parseFloat(i.marginTop)+parseFloat(i.marginBottom)}return n}return 0},getClientHeight(t,e){if(t){let n=t.clientHeight;if(e){let i=getComputedStyle(t);n+=parseFloat(i.marginTop)+parseFloat(i.marginBottom)}return n}return 0},getViewport(){let t=window,e=document,n=e.documentElement,i=e.getElementsByTagName("body")[0],r=t.innerWidth||n.clientWidth||i.clientWidth,s=t.innerHeight||n.clientHeight||i.clientHeight;return{width:r,height:s}},getOffset(t){if(t){let e=t.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}},index(t){if(t){let e=t.parentNode.childNodes,n=0;for(let i=0;ig.height?(y=u.top+d-i,t.style.transformOrigin="bottom",y<0&&(y=d)):(y=s+u.top+d,t.style.transformOrigin="top"),u.left+r>g.width?w=Math.max(0,u.left+h+o-r):w=u.left+h,t.style.top=y+"px",t.style.left=w+"px"}},relativePosition(t,e){if(t){let n=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t);const i=e.offsetHeight,r=e.getBoundingClientRect(),s=this.getViewport();let o,u;r.top+i+n.height>s.height?(o=-1*n.height,t.style.transformOrigin="bottom",r.top+o<0&&(o=-1*r.top)):(o=i,t.style.transformOrigin="top"),n.width>s.width?u=r.left*-1:r.left+n.width>s.width?u=(r.left+n.width-s.width)*-1:u=0,t.style.top=o+"px",t.style.left=u+"px"}},getParents(t,e=[]){return t.parentNode===null?e:this.getParents(t.parentNode,e.concat([t.parentNode]))},getScrollableParents(t){let e=[];if(t){let n=this.getParents(t);const i=/(auto|scroll)/,r=s=>{let o=window.getComputedStyle(s,null);return i.test(o.getPropertyValue("overflow"))||i.test(o.getPropertyValue("overflowX"))||i.test(o.getPropertyValue("overflowY"))};for(let s of n){let o=s.nodeType===1&&s.dataset.scrollselectors;if(o){let u=o.split(",");for(let d of u){let h=this.findSingle(s,d);h&&r(h)&&e.push(h)}}s.nodeType!==9&&r(s)&&e.push(s)}}return e},getHiddenElementOuterHeight(t){if(t){t.style.visibility="hidden",t.style.display="block";let e=t.offsetHeight;return t.style.display="none",t.style.visibility="visible",e}return 0},getHiddenElementOuterWidth(t){if(t){t.style.visibility="hidden",t.style.display="block";let e=t.offsetWidth;return t.style.display="none",t.style.visibility="visible",e}return 0},getHiddenElementDimensions(t){if(t){let e={};return t.style.visibility="hidden",t.style.display="block",e.width=t.offsetWidth,e.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible",e}return 0},fadeIn(t,e){if(t){t.style.opacity=0;let n=+new Date,i=0,r=function(){i=+t.style.opacity+(new Date().getTime()-n)/e,t.style.opacity=i,n=+new Date,+i<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()}},fadeOut(t,e){if(t){let n=1,i=50,r=e,s=i/r,o=setInterval(()=>{n-=s,n<=0&&(n=0,clearInterval(o)),t.style.opacity=n},i)}},getUserAgent(){return navigator.userAgent},appendChild(t,e){if(this.isElement(e))e.appendChild(t);else if(e.el&&e.elElement)e.elElement.appendChild(t);else throw new Error("Cannot append "+e+" to "+t)},isElement(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"},scrollInView(t,e){let n=getComputedStyle(t).getPropertyValue("borderTopWidth"),i=n?parseFloat(n):0,r=getComputedStyle(t).getPropertyValue("paddingTop"),s=r?parseFloat(r):0,o=t.getBoundingClientRect(),d=e.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-i-s,h=t.scrollTop,g=t.clientHeight,y=this.getOuterHeight(e);d<0?t.scrollTop=h+d:d+y>g&&(t.scrollTop=h+d-g+y)},clearSelection(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}},getSelection(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection().toString():document.selection?document.selection.createRange().text:null},calculateScrollbarWidth(){if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;let t=document.createElement("div");t.className="p-scrollbar-measure",document.body.appendChild(t);let e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),this.calculatedScrollbarWidth=e,e},getBrowser(){if(!this.browser){let t=this.resolveUserAgent();this.browser={},t.browser&&(this.browser[t.browser]=!0,this.browser.version=t.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},resolveUserAgent(){let t=navigator.userAgent.toLowerCase(),e=/(chrome)[ ]([\w.]+)/.exec(t)||/(webkit)[ ]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},isVisible(t){return t&&t.offsetParent!=null},invokeElementMethod(t,e,n){t[e].apply(t,n)},isExist(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&t.parentNode)},isClient(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},focus(t,e){t&&document.activeElement!==t&&t.focus(e)},isFocusableElement(t,e=""){return this.isElement(t)?t.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`):!1},getFocusableElements(t,e=""){let n=this.find(t,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`),i=[];for(let r of n)getComputedStyle(r).display!="none"&&getComputedStyle(r).visibility!="hidden"&&i.push(r);return i},getFirstFocusableElement(t,e){const n=this.getFocusableElements(t,e);return n.length>0?n[0]:null},getLastFocusableElement(t,e){const n=this.getFocusableElements(t,e);return n.length>0?n[n.length-1]:null},getNextFocusableElement(t,e,n){const i=this.getFocusableElements(t,n),r=i.length>0?i.findIndex(o=>o===e):-1,s=r>-1&&i.length>=r+1?r+1:-1;return s>-1?i[s]:null},isClickable(t){if(t){const e=t.nodeName,n=t.parentElement&&t.parentElement.nodeName;return e==="INPUT"||e==="TEXTAREA"||e==="BUTTON"||e==="A"||n==="INPUT"||n==="TEXTAREA"||n==="BUTTON"||n==="A"||!!t.closest(".p-button, .p-checkbox, .p-radiobutton")}return!1},applyStyle(t,e){if(typeof e=="string")t.style.cssText=e;else for(let n in e)t.style[n]=e[n]},isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},isAndroid(){return/(android)/i.test(navigator.userAgent)},isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},exportCSV(t,e){let n=new Blob([t],{type:"application/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(n,e+".csv");else{let i=document.createElement("a");i.download!==void 0?(i.setAttribute("href",URL.createObjectURL(n)),i.setAttribute("download",e+".csv"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)):(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}}};class Ay{constructor(e,n=()=>{}){this.element=e,this.listener=n}bindScrollListener(){this.scrollableParents=Ne.getScrollableParents(this.element);for(let e=0;e>>0,1)},emit(e,n){let i=t.get(e);i&&i.slice().map(r=>{r(n)})}}}var Nt={equals(t,e,n){return n?this.resolveFieldData(t,n)===this.resolveFieldData(e,n):this.deepEquals(t,e)},deepEquals(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var n=Array.isArray(t),i=Array.isArray(e),r,s,o;if(n&&i){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!this.deepEquals(t[r],e[r]))return!1;return!0}if(n!=i)return!1;var u=t instanceof Date,d=e instanceof Date;if(u!=d)return!1;if(u&&d)return t.getTime()==e.getTime();var h=t instanceof RegExp,g=e instanceof RegExp;if(h!=g)return!1;if(h&&g)return t.toString()==e.toString();var y=Object.keys(t);if(s=y.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,y[r]))return!1;for(r=s;r--!==0;)if(o=y[r],!this.deepEquals(t[o],e[o]))return!1;return!0}return t!==t&&e!==e},resolveFieldData(t,e){if(t&&Object.keys(t).length&&e){if(this.isFunction(e))return e(t);if(e.indexOf(".")===-1)return t[e];{let r=e.split("."),s=t;for(var n=0,i=r.length;n-1){i.push(r);break}}return i},reorderArray(t,e,n){t&&e!==n&&(n>=t.length&&(n%=t.length,e%=t.length),t.splice(n,0,t.splice(e,1)[0]))},findIndexInList(t,e){let n=-1;if(e){for(let i=0;i0){let r=!1;for(let s=0;se){n.splice(s,0,t),r=!0;break}r||n.push(t)}else n.push(t)},removeAccents(t){return t&&t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t},getVNodeProp(t,e){let n=t.props;if(n){let i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Object.prototype.hasOwnProperty.call(n,i)?i:e;return t.type.props[e].type===Boolean&&n[r]===""?!0:n[r]}return null},isEmpty(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&typeof t=="object"&&Object.keys(t).length===0},isNotEmpty(t){return!this.isEmpty(t)},isPrintableCharacter(t=""){return this.isNotEmpty(t)&&t.length===1&&t.match(/\S| /)},findLast(t,e){let n;if(this.isNotEmpty(t))try{n=t.findLast(e)}catch{n=[...t].reverse().find(e)}return n},findLastIndex(t,e){let n=-1;if(this.isNotEmpty(t))try{n=t.findLastIndex(e)}catch{n=t.lastIndexOf([...t].reverse().find(e))}return n}},kA=0;function Xs(t="pv_id_"){return kA++,`${t}${kA}`}function P5(){let t=[];const e=(o,u,d=999)=>{const h=r(o,u,d),g=h.value+(h.key===o?0:d)+1;return t.push({key:o,value:g}),g},n=o=>{t=t.filter(u=>u.value!==o)},i=(o,u)=>r(o).value,r=(o,u,d=0)=>[...t].reverse().find(h=>!0)||{key:o,value:d},s=o=>o&&parseInt(o.style.zIndex,10)||0;return{get:s,set:(o,u,d)=>{u&&(u.style.zIndex=String(e(o,!0,d)))},clear:o=>{o&&(n(s(o)),o.style.zIndex="")},getCurrent:o=>i(o)}}var Lo=P5();const Nr={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},ky={AND:"and",OR:"or"},Py={filter(t,e,n,i,r){let s=[];if(t)for(let o of t)for(let u of e){let d=Nt.resolveFieldData(o,u);if(this.filters[i](d,n,r)){s.push(o);break}}return s},filters:{startsWith(t,e,n){if(e==null||e.trim()==="")return!0;if(t==null)return!1;let i=Nt.removeAccents(e.toString()).toLocaleLowerCase(n);return Nt.removeAccents(t.toString()).toLocaleLowerCase(n).slice(0,i.length)===i},contains(t,e,n){if(e==null||typeof e=="string"&&e.trim()==="")return!0;if(t==null)return!1;let i=Nt.removeAccents(e.toString()).toLocaleLowerCase(n);return Nt.removeAccents(t.toString()).toLocaleLowerCase(n).indexOf(i)!==-1},notContains(t,e,n){if(e==null||typeof e=="string"&&e.trim()==="")return!0;if(t==null)return!1;let i=Nt.removeAccents(e.toString()).toLocaleLowerCase(n);return Nt.removeAccents(t.toString()).toLocaleLowerCase(n).indexOf(i)===-1},endsWith(t,e,n){if(e==null||e.trim()==="")return!0;if(t==null)return!1;let i=Nt.removeAccents(e.toString()).toLocaleLowerCase(n),r=Nt.removeAccents(t.toString()).toLocaleLowerCase(n);return r.indexOf(i,r.length-i.length)!==-1},equals(t,e,n){return e==null||typeof e=="string"&&e.trim()===""?!0:t==null?!1:t.getTime&&e.getTime?t.getTime()===e.getTime():Nt.removeAccents(t.toString()).toLocaleLowerCase(n)==Nt.removeAccents(e.toString()).toLocaleLowerCase(n)},notEquals(t,e,n){return e==null||typeof e=="string"&&e.trim()===""?!1:t==null?!0:t.getTime&&e.getTime?t.getTime()!==e.getTime():Nt.removeAccents(t.toString()).toLocaleLowerCase(n)!=Nt.removeAccents(e.toString()).toLocaleLowerCase(n)},in(t,e){if(e==null||e.length===0)return!0;for(let n=0;ne.getTime():t>e},gte(t,e){return e==null?!0:t==null?!1:t.getTime&&e.getTime?t.getTime()>=e.getTime():t>=e},dateIs(t,e){return e==null?!0:t==null?!1:t.toDateString()===e.toDateString()},dateIsNot(t,e){return e==null?!0:t==null?!1:t.toDateString()!==e.toDateString()},dateBefore(t,e){return e==null?!0:t==null?!1:t.getTime()e.getTime()}},register(t,e){this.filters[t]=e}},PA={ripple:!1,inputStyle:"outlined",locale:{startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",completed:"Completed",pending:"Pending",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],chooseYear:"Choose Year",chooseMonth:"Choose Month",chooseDate:"Choose Date",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",prevHour:"Previous Hour",nextHour:"Next Hour",prevMinute:"Previous Minute",nextMinute:"Next Minute",prevSecond:"Previous Second",nextSecond:"Next Second",am:"am",pm:"pm",today:"Today",weekHeader:"Wk",firstDayOfWeek:0,dateFormat:"mm/dd/yy",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyFilterMessage:"No results found",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",emptySelectionMessage:"No selected item",emptySearchMessage:"No results found",emptyMessage:"No available options",aria:{trueLabel:"True",falseLabel:"False",nullLabel:"Not Selected",star:"1 star",stars:"{star} stars",selectAll:"All items selected",unselectAll:"All items unselected",close:"Close",previous:"Previous",next:"Next",navigation:"Navigation",scrollTop:"Scroll Top",moveTop:"Move Top",moveUp:"Move Up",moveDown:"Move Down",moveBottom:"Move Bottom",moveToTarget:"Move to Target",moveToSource:"Move to Source",moveAllToTarget:"Move All to Target",moveAllToSource:"Move All to Source",pageLabel:"{page}",firstPageLabel:"First Page",lastPageLabel:"Last Page",nextPageLabel:"Next Page",prevPageLabel:"Previous Page",rowsPerPageLabel:"Rows per page",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",selectRow:"Row Selected",unselectRow:"Row Unselected",expandRow:"Row Expanded",collapseRow:"Row Collapsed",showFilterMenu:"Show Filter Menu",hideFilterMenu:"Hide Filter Menu",filterOperator:"Filter Operator",filterConstraint:"Filter Constraint",editRow:"Row Edit",saveEdit:"Save Edit",cancelEdit:"Cancel Edit",listView:"List View",gridView:"Grid View",slide:"Slide",slideNumber:"{slideNumber}",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out",rotateRight:"Rotate Right",rotateLeft:"Rotate Left"}},filterMatchModeOptions:{text:[Nr.STARTS_WITH,Nr.CONTAINS,Nr.NOT_CONTAINS,Nr.ENDS_WITH,Nr.EQUALS,Nr.NOT_EQUALS],numeric:[Nr.EQUALS,Nr.NOT_EQUALS,Nr.LESS_THAN,Nr.LESS_THAN_OR_EQUAL_TO,Nr.GREATER_THAN,Nr.GREATER_THAN_OR_EQUAL_TO],date:[Nr.DATE_IS,Nr.DATE_IS_NOT,Nr.DATE_BEFORE,Nr.DATE_AFTER]},zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100}},D5=Symbol();function I5(t,e,n,i){const r=document.getElementById(n),s=r.cloneNode(!0),o=r.getAttribute("href").replace(t,e);s.setAttribute("id",n+"-clone"),s.setAttribute("href",o),s.addEventListener("load",()=>{r.remove(),s.setAttribute("id",n),i&&i()}),r.parentNode&&r.parentNode.insertBefore(s,r.nextSibling)}var O5={install:(t,e)=>{let n=e?{...PA,...e}:{...PA};const i={config:Fh(n),changeTheme:I5};t.config.globalProperties.$primevue=i,t.provide(D5,i)}};let Bw;function R5(t){t.addEventListener("mousedown",DA)}function L5(t){t.removeEventListener("mousedown",DA)}function M5(t){let e=document.createElement("span");e.className="p-ink",e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),t.appendChild(e),e.addEventListener("animationend",IA)}function N5(t){let e=OA(t);e&&(L5(t),e.removeEventListener("animationend",IA),e.remove())}function DA(t){let e=t.currentTarget,n=OA(e);if(!n||getComputedStyle(n,null).display==="none")return;if(Ne.removeClass(n,"p-ink-active"),!Ne.getHeight(n)&&!Ne.getWidth(n)){let o=Math.max(Ne.getOuterWidth(e),Ne.getOuterHeight(e));n.style.height=o+"px",n.style.width=o+"px"}let i=Ne.getOffset(e),r=t.pageX-i.left+document.body.scrollTop-Ne.getWidth(n)/2,s=t.pageY-i.top+document.body.scrollLeft-Ne.getHeight(n)/2;n.style.top=s+"px",n.style.left=r+"px",Ne.addClass(n,"p-ink-active"),Bw=setTimeout(()=>{n&&Ne.removeClass(n,"p-ink-active")},401)}function IA(t){Bw&&clearTimeout(Bw),Ne.removeClass(t.currentTarget,"p-ink-active")}function OA(t){for(let e=0;e[n.loading&&!n.icon?(G(),se("span",{key:0,class:Lt(s.iconStyleClass)},null,2)):qe("",!0),n.icon?(G(),se("span",{key:1,class:Lt(s.iconStyleClass)},null,2)):qe("",!0),ue("span",B5,lt(n.label||" "),1),n.badge?(G(),se("span",{key:2,class:Lt(s.badgeStyleClass)},lt(n.badge),3)):qe("",!0)])],10,F5)),[[o]])}nc.render=U5;var Uw={name:"Checkbox",emits:["click","update:modelValue","change","input","focus","blur"],props:{value:null,modelValue:null,binary:Boolean,name:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{focused:!1}},methods:{onClick(t){if(!this.disabled&&!this.readonly){let e;this.binary?e=this.checked?this.falseValue:this.trueValue:this.checked?e=this.modelValue.filter(n=>!Nt.equals(n,this.value)):e=this.modelValue?[...this.modelValue,this.value]:[this.value],this.$emit("click",t),this.$emit("update:modelValue",e),this.$emit("change",t),this.$emit("input",e),this.$refs.input.focus()}},onFocus(t){this.focused=!0,this.$emit("focus",t)},onBlur(t){this.focused=!1,this.$emit("blur",t)}},computed:{checked(){return this.binary?this.modelValue===this.trueValue:Nt.contains(this.value,this.modelValue)},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.checked,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]}}};const H5={class:"p-hidden-accessible"},z5=["id","value","name","checked","tabindex","disabled","readonly","required","aria-labelledby","aria-label"];function j5(t,e,n,i,r,s){return G(),se("div",{class:Lt(s.containerClass),onClick:e[2]||(e[2]=o=>s.onClick(o))},[ue("div",H5,[ue("input",Ni({ref:"input",id:n.inputId,type:"checkbox",value:n.value,name:n.name,checked:s.checked,tabindex:n.tabindex,disabled:n.disabled,readonly:n.readonly,required:n.required,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},n.inputProps),null,16,z5)]),ue("div",{ref:"box",class:Lt(["p-checkbox-box",n.inputClass,{"p-highlight":s.checked,"p-disabled":n.disabled,"p-focus":r.focused}]),style:hi(n.inputStyle)},[ue("span",{class:Lt(["p-checkbox-icon",{"pi pi-check":s.checked}])},null,2)],6)],2)}Uw.render=j5;var ic=AA(),em={name:"Portal",props:{appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1}},data(){return{mounted:!1}},mounted(){this.mounted=Ne.isClient()},computed:{inline(){return this.disabled||this.appendTo==="self"}}};function V5(t,e,n,i,r,s){return s.inline?En(t.$slots,"default",{key:0}):r.mounted?(G(),Ct(K3,{key:1,to:n.appendTo},[En(t.$slots,"default")],8,["to"])):qe("",!0)}em.render=V5;var Dy={name:"VirtualScroller",emits:["update:numToleratedItems","scroll","scroll-index-change","lazy-load"],props:{id:{type:String,default:null},style:null,class:null,items:{type:Array,default:null},itemSize:{type:[Number,Array],default:0},scrollHeight:null,scrollWidth:null,orientation:{type:String,default:"vertical"},numToleratedItems:{type:Number,default:null},delay:{type:Number,default:0},resizeDelay:{type:Number,default:10},lazy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loaderDisabled:{type:Boolean,default:!1},columns:{type:Array,default:null},loading:{type:Boolean,default:!1},showSpacer:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!1},tabindex:{type:Number,default:0},inline:{type:Boolean,default:!1},step:{type:Number,default:0},appendOnly:{type:Boolean,default:!1},autoSize:{type:Boolean,default:!1}},data(){return{first:this.isBoth()?{rows:0,cols:0}:0,last:this.isBoth()?{rows:0,cols:0}:0,page:this.isBoth()?{rows:0,cols:0}:0,numItemsInViewport:this.isBoth()?{rows:0,cols:0}:0,lastScrollPos:this.isBoth()?{top:0,left:0}:0,d_numToleratedItems:this.numToleratedItems,d_loading:this.loading,loaderArr:[],spacerStyle:{},contentStyle:{}}},element:null,content:null,lastScrollPos:null,scrollTimeout:null,resizeTimeout:null,defaultWidth:0,defaultHeight:0,defaultContentWidth:0,defaultContentHeight:0,isRangeChanged:!1,lazyLoadState:{},resizeListener:null,initialized:!1,watch:{numToleratedItems(t){this.d_numToleratedItems=t},loading(t){this.d_loading=t},items(t,e){(!e||e.length!==(t||[]).length)&&(this.init(),this.calculateAutoSize())},itemSize(){this.init(),this.calculateAutoSize()},orientation(){this.lastScrollPos=this.isBoth()?{top:0,left:0}:0},scrollHeight(){this.init(),this.calculateAutoSize()},scrollWidth(){this.init(),this.calculateAutoSize()}},mounted(){this.viewInit(),this.lastScrollPos=this.isBoth()?{top:0,left:0}:0,this.lazyLoadState=this.lazyLoadState||{}},updated(){!this.initialized&&this.viewInit()},unmounted(){this.unbindResizeListener(),this.initialized=!1},methods:{viewInit(){Ne.isVisible(this.element)&&(this.setContentEl(this.content),this.init(),this.bindResizeListener(),this.defaultWidth=Ne.getWidth(this.element),this.defaultHeight=Ne.getHeight(this.element),this.defaultContentWidth=Ne.getWidth(this.content),this.defaultContentHeight=Ne.getHeight(this.content),this.initialized=!0)},init(){this.disabled||(this.setSize(),this.calculateOptions(),this.setSpacerSize())},isVertical(){return this.orientation==="vertical"},isHorizontal(){return this.orientation==="horizontal"},isBoth(){return this.orientation==="both"},scrollTo(t){this.lastScrollPos=this.both?{top:0,left:0}:0,this.element&&this.element.scrollTo(t)},scrollToIndex(t,e="auto"){const n=this.isBoth(),i=this.isHorizontal(),r=this.first,{numToleratedItems:s}=this.calculateNumItems(),o=this.getContentPosition(),u=this.itemSize,d=(C=0,D)=>C<=D?0:C,h=(C,D,P)=>C*D+P,g=(C=0,D=0)=>this.scrollTo({left:C,top:D,behavior:e});let y=n?{rows:0,cols:0}:0,w=!1;n?(y={rows:d(t[0],s[0]),cols:d(t[1],s[1])},g(h(y.cols,u[1],o.left),h(y.rows,u[0],o.top)),w=y.rows!==r.rows||y.cols!==r.cols):(y=d(t,s),i?g(h(y,u,o.left),0):g(0,h(y,u,o.top)),w=y!==r),this.isRangeChanged=w,this.first=y},scrollInView(t,e,n="auto"){if(e){const i=this.isBoth(),r=this.isHorizontal(),{first:s,viewport:o}=this.getRenderedRange(),u=(g=0,y=0)=>this.scrollTo({left:g,top:y,behavior:n}),d=e==="to-start",h=e==="to-end";if(d){if(i)o.first.rows-s.rows>t[0]?u(o.first.cols*this.itemSize[1],(o.first.rows-1)*this.itemSize[0]):o.first.cols-s.cols>t[1]&&u((o.first.cols-1)*this.itemSize[1],o.first.rows*this.itemSize[0]);else if(o.first-s>t){const g=(o.first-1)*this.itemSize;r?u(g,0):u(0,g)}}else if(h){if(i)o.last.rows-s.rows<=t[0]+1?u(o.first.cols*this.itemSize[1],(o.first.rows+1)*this.itemSize[0]):o.last.cols-s.cols<=t[1]+1&&u((o.first.cols+1)*this.itemSize[1],o.first.rows*this.itemSize[0]);else if(o.last-s<=t+1){const g=(o.first+1)*this.itemSize;r?u(g,0):u(0,g)}}}else this.scrollToIndex(t,n)},getRenderedRange(){const t=(i,r)=>Math.floor(i/(r||i));let e=this.first,n=0;if(this.element){const i=this.isBoth(),r=this.isHorizontal(),{scrollTop:s,scrollLeft:o}=this.element.scrollTop;i?(e={rows:t(s,this.itemSize[0]),cols:t(o,this.itemSize[1])},n={rows:e.rows+this.numItemsInViewport.rows,cols:e.cols+this.numItemsInViewport.cols}):(e=t(r?o:s,this.itemSize),n=e+this.numItemsInViewport)}return{first:this.first,last:this.last,viewport:{first:e,last:n}}},calculateNumItems(){const t=this.isBoth(),e=this.isHorizontal(),n=this.itemSize,i=this.getContentPosition(),r=this.element?this.element.offsetWidth-i.left:0,s=this.element?this.element.offsetHeight-i.top:0,o=(g,y)=>Math.ceil(g/(y||g)),u=g=>Math.ceil(g/2),d=t?{rows:o(s,n[0]),cols:o(r,n[1])}:o(e?r:s,n),h=this.d_numToleratedItems||(t?[u(d.rows),u(d.cols)]:u(d));return{numItemsInViewport:d,numToleratedItems:h}},calculateOptions(){const t=this.isBoth(),e=this.first,{numItemsInViewport:n,numToleratedItems:i}=this.calculateNumItems(),r=(o,u,d,h=!1)=>this.getLast(o+u+(oArray.from({length:n.cols})):Array.from({length:n})),this.lazy&&Promise.resolve().then(()=>{this.lazyLoadState={first:this.step?t?{rows:0,cols:e.cols}:0:e,last:Math.min(this.step?this.step:s,this.items.length)},this.$emit("lazy-load",this.lazyLoadState)})},calculateAutoSize(){this.autoSize&&!this.d_loading&&Promise.resolve().then(()=>{if(this.content){const t=this.isBoth(),e=this.isHorizontal(),n=this.isVertical();this.content.style.minHeight=this.content.style.minWidth="auto",this.content.style.position="relative",this.element.style.contain="none";const[i,r]=[Ne.getWidth(this.content),Ne.getHeight(this.content)];i!==this.defaultContentWidth&&(this.element.style.width=""),r!==this.defaultContentHeight&&(this.element.style.height="");const[s,o]=[Ne.getWidth(this.element),Ne.getHeight(this.element)];(t||e)&&(this.element.style.width=sthis.element.style[o]=u;t||e?(s("height",r),s("width",i)):s("height",r)}},setSpacerSize(){const t=this.items;if(t){const e=this.isBoth(),n=this.isHorizontal(),i=this.getContentPosition(),r=(s,o,u,d=0)=>this.spacerStyle={...this.spacerStyle,[`${s}`]:(o||[]).length*u+d+"px"};e?(r("height",t,this.itemSize[0],i.y),r("width",this.columns||t[1],this.itemSize[1],i.x)):n?r("width",this.columns||t,this.itemSize,i.x):r("height",t,this.itemSize,i.y)}},setContentPosition(t){if(this.content&&!this.appendOnly){const e=this.isBoth(),n=this.isHorizontal(),i=t?t.first:this.first,r=(o,u)=>o*u,s=(o=0,u=0)=>this.contentStyle={...this.contentStyle,transform:`translate3d(${o}px, ${u}px, 0)`};if(e)s(r(i.cols,this.itemSize[1]),r(i.rows,this.itemSize[0]));else{const o=r(i,this.itemSize);n?s(o,0):s(0,o)}}},onScrollPositionChange(t){const e=t.target,n=this.isBoth(),i=this.isHorizontal(),r=this.getContentPosition(),s=(M,F)=>M?M>F?M-F:M:0,o=(M,F)=>Math.floor(M/(F||M)),u=(M,F,K,$,ee,he)=>M<=ee?ee:he?K-$-ee:F+ee-1,d=(M,F,K,$,ee,he,ve)=>M<=he?0:Math.max(0,ve?MF?K:M-2*he),h=(M,F,K,$,ee,he)=>{let ve=F+$+2*ee;return M>=ee&&(ve+=ee+1),this.getLast(ve,he)},g=s(e.scrollTop,r.top),y=s(e.scrollLeft,r.left);let w=n?{rows:0,cols:0}:0,C=this.last,D=!1,P=this.lastScrollPos;if(n){const M=this.lastScrollPos.top<=g,F=this.lastScrollPos.left<=y;if(!this.appendOnly||this.appendOnly&&(M||F)){const K={rows:o(g,this.itemSize[0]),cols:o(y,this.itemSize[1])},$={rows:u(K.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],M),cols:u(K.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],F)};w={rows:d(K.rows,$.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],M),cols:d(K.cols,$.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],F)},C={rows:h(K.rows,w.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0]),cols:h(K.cols,w.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],!0)},D=w.rows!==this.first.rows||C.rows!==this.last.rows||w.cols!==this.first.cols||C.cols!==this.last.cols||this.isRangeChanged,P={top:g,left:y}}}else{const M=i?y:g,F=this.lastScrollPos<=M;if(!this.appendOnly||this.appendOnly&&F){const K=o(M,this.itemSize),$=u(K,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,F);w=d(K,$,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,F),C=h(K,w,this.last,this.numItemsInViewport,this.d_numToleratedItems),D=w!==this.first||C!==this.last||this.isRangeChanged,P=M}}return{first:w,last:C,isRangeChanged:D,scrollPos:P}},onScrollChange(t){const{first:e,last:n,isRangeChanged:i,scrollPos:r}=this.onScrollPositionChange(t);if(i){const s={first:e,last:n};if(this.setContentPosition(s),this.first=e,this.last=n,this.lastScrollPos=r,this.$emit("scroll-index-change",s),this.lazy&&this.isPageChanged(e)){const o={first:this.step?Math.min(this.getPageByFirst(e)*this.step,this.items.length-this.step):e,last:Math.min(this.step?(this.getPageByFirst(e)+1)*this.step:n,this.items.length)};(this.lazyLoadState.first!==o.first||this.lazyLoadState.last!==o.last)&&this.$emit("lazy-load",o),this.lazyLoadState=o}}},onScroll(t){if(this.$emit("scroll",t),this.delay&&this.isPageChanged()){if(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.d_loading&&this.showLoader){const{isRangeChanged:e}=this.onScrollPositionChange(t);(e||(this.step?this.isPageChanged():!1))&&(this.d_loading=!0)}this.scrollTimeout=setTimeout(()=>{this.onScrollChange(t),this.d_loading&&this.showLoader&&(!this.lazy||this.loading===void 0)&&(this.d_loading=!1,this.page=this.getPageByFirst())},this.delay)}else this.onScrollChange(t)},onResize(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{if(Ne.isVisible(this.element)){const t=this.isBoth(),e=this.isVertical(),n=this.isHorizontal(),[i,r]=[Ne.getWidth(this.element),Ne.getHeight(this.element)],[s,o]=[i!==this.defaultWidth,r!==this.defaultHeight];(t?s||o:n?s:e?o:!1)&&(this.d_numToleratedItems=this.numToleratedItems,this.defaultWidth=i,this.defaultHeight=r,this.defaultContentWidth=Ne.getWidth(this.content),this.defaultContentHeight=Ne.getHeight(this.content),this.init())}},this.resizeDelay)},bindResizeListener(){this.resizeListener||(this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),window.addEventListener("orientationchange",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("orientationchange",this.resizeListener),this.resizeListener=null)},getOptions(t){const e=(this.items||[]).length,n=this.isBoth()?this.first.rows+t:this.first+t;return{index:n,count:e,first:n===0,last:n===e-1,even:n%2===0,odd:n%2!==0}},getLoaderOptions(t,e){let n=this.loaderArr.length;return{index:t,count:n,first:t===0,last:t===n-1,even:t%2===0,odd:t%2!==0,...e}},getPageByFirst(t){return Math.floor(((t??this.first)+this.d_numToleratedItems*4)/(this.step||1))},isPageChanged(t){return this.step?this.page!==this.getPageByFirst(t??this.first):!0},setContentEl(t){this.content=t||this.content||Ne.findSingle(this.element,".p-virtualscroller-content")},elementRef(t){this.element=t},contentRef(t){this.content=t}},computed:{containerClass(){return["p-virtualscroller",{"p-virtualscroller-inline":this.inline,"p-virtualscroller-both p-both-scroll":this.isBoth(),"p-virtualscroller-horizontal p-horizontal-scroll":this.isHorizontal()},this.class]},contentClass(){return["p-virtualscroller-content",{"p-virtualscroller-loading":this.d_loading}]},loaderClass(){return["p-virtualscroller-loader",{"p-component-overlay":!this.$slots.loader}]},loadedItems(){return this.items&&!this.d_loading?this.isBoth()?this.items.slice(this.appendOnly?0:this.first.rows,this.last.rows).map(t=>this.columns?t:t.slice(this.appendOnly?0:this.first.cols,this.last.cols)):this.isHorizontal()&&this.columns?this.items:this.items.slice(this.appendOnly?0:this.first,this.last):[]},loadedRows(){return this.d_loading?this.loaderDisabled?this.loaderArr:[]:this.loadedItems},loadedColumns(){if(this.columns){const t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.d_loading&&this.loaderDisabled?t?this.loaderArr[0]:this.loaderArr:this.columns.slice(t?this.first.cols:this.first,t?this.last.cols:this.last)}return this.columns}}};const W5=["tabindex"],q5={key:1,class:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"};function G5(t,e,n,i,r,s){return n.disabled?(G(),se(xt,{key:1},[En(t.$slots,"default"),En(t.$slots,"content",{items:n.items,rows:n.items,columns:s.loadedColumns})],64)):(G(),se("div",{key:0,ref:s.elementRef,class:Lt(s.containerClass),tabindex:n.tabindex,style:hi(n.style),onScroll:e[0]||(e[0]=(...o)=>s.onScroll&&s.onScroll(...o))},[En(t.$slots,"content",{styleClass:s.contentClass,items:s.loadedItems,getItemOptions:s.getOptions,loading:r.d_loading,getLoaderOptions:s.getLoaderOptions,itemSize:n.itemSize,rows:s.loadedRows,columns:s.loadedColumns,contentRef:s.contentRef,spacerStyle:r.spacerStyle,contentStyle:r.contentStyle,vertical:s.isVertical(),horizontal:s.isHorizontal(),both:s.isBoth()},()=>[ue("div",{ref:s.contentRef,class:Lt(s.contentClass),style:hi(r.contentStyle)},[(G(!0),se(xt,null,hn(s.loadedItems,(o,u)=>En(t.$slots,"item",{key:u,item:o,options:s.getOptions(u)})),128))],6)]),n.showSpacer?(G(),se("div",{key:0,class:"p-virtualscroller-spacer",style:hi(r.spacerStyle)},null,4)):qe("",!0),!n.loaderDisabled&&n.showLoader&&r.d_loading?(G(),se("div",{key:1,class:Lt(s.loaderClass)},[t.$slots&&t.$slots.loader?(G(!0),se(xt,{key:0},hn(r.loaderArr,(o,u)=>En(t.$slots,"loader",{key:u,options:s.getLoaderOptions(u,s.isBoth()&&{numCols:t.d_numItemsInViewport.cols})})),128)):(G(),se("i",q5))],2)):qe("",!0)],46,W5))}function K5(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Y5=` .p-virtualscroller { position: relative; overflow: auto; contain: strict; transform: translateZ(0); will-change: scroll-position; outline: 0 none; } .p-virtualscroller-content { position: absolute; top: 0; left: 0; /* contain: content; */ min-height: 100%; min-width: 100%; will-change: transform; } .p-virtualscroller-spacer { position: absolute; top: 0; left: 0; height: 1px; width: 1px; transform-origin: 0 0; pointer-events: none; } .p-virtualscroller .p-virtualscroller-loader { position: sticky; top: 0; left: 0; width: 100%; height: 100%; } .p-virtualscroller-loader.p-component-overlay { display: flex; align-items: center; justify-content: center; } .p-virtualscroller-loading-icon { font-size: 2rem; } .p-virtualscroller-horizontal > .p-virtualscroller-content { display: flex; } /* Inline */ .p-virtualscroller-inline .p-virtualscroller-content { position: static; } `;K5(Y5),Dy.render=G5;var Zd={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(t){this.id=t||Xs()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||Xs(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(Lo.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(t,e){return this.virtualScrollerDisabled?t:e&&e(t).index},getOptionLabel(t){return this.optionLabel?Nt.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?Nt.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,e){return(this.dataKey?Nt.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+e},isOptionDisabled(t){return this.optionDisabled?Nt.resolveFieldData(t,this.optionDisabled):!1},isOptionGroup(t){return this.optionGroupLabel&&t.optionGroup&&t.group},getOptionGroupLabel(t){return Nt.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return Nt.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(t){return(this.optionGroupLabel?t-this.visibleOptions.slice(0,t).filter(e=>this.isOptionGroup(e)).length:t)+1},show(t){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,t&&Ne.focus(this.$refs.focusInput)},hide(t){const e=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),t&&Ne.focus(this.$refs.focusInput)};setTimeout(()=>{e()},0)},onFocus(t){this.disabled||(this.focused=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",t))},onBlur(t){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",t)},onKeyDown(t){if(this.disabled){t.preventDefault();return}const e=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,this.editable);break;case"Home":this.onHomeKey(t,this.editable);break;case"End":this.onEndKey(t,this.editable);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Space":this.onSpaceKey(t,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"Backspace":this.onBackspaceKey(t,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!e&&Nt.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(t,t.key));break}},onEditableInput(t){const e=t.target.value;this.searchValue="",!this.searchOptions(t,e)&&(this.focusedOptionIndex=-1),this.updateModel(t,e)},onContainerClick(t){this.disabled||this.loading||Ne.hasClass(t.target,"p-dropdown-clear-icon")||t.target.tagName==="INPUT"||(!this.overlay||!this.overlay.contains(t.target))&&(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(t){this.updateModel(t,null)},onFirstHiddenFocus(t){const e=t.relatedTarget===this.$refs.focusInput?Ne.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;Ne.focus(e)},onLastHiddenFocus(t){const e=t.relatedTarget===this.$refs.focusInput?Ne.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;Ne.focus(e)},onOptionSelect(t,e,n=!0){const i=this.getOptionValue(e);this.updateModel(t,i),n&&this.hide(!0)},onOptionMouseMove(t,e){this.focusOnHover&&this.changeFocusedOptionIndex(t,e)},onFilterChange(t){const e=t.target.value;this.filterValue=e,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:t,value:e}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,!0);break;case"Home":this.onHomeKey(t,!0);break;case"End":this.onEndKey(t,!0);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t,!0);break}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(t){ic.emit("overlay-click",{originalEvent:t,target:this.$el})},onOverlayKeyDown(t){switch(t.code){case"Escape":this.onEscapeKey(t);break}},onArrowDownKey(t){const e=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(t,e),!this.overlayVisible&&this.show(),t.preventDefault()},onArrowUpKey(t,e=!1){if(t.altKey&&!e)this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),t.preventDefault();else{const n=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(t,n),!this.overlayVisible&&this.show(),t.preventDefault()}},onArrowLeftKey(t,e=!1){e&&(this.focusedOptionIndex=-1)},onHomeKey(t,e=!1){e?(t.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(t,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),t.preventDefault()},onEndKey(t,e=!1){if(e){const n=t.currentTarget,i=n.value.length;n.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(t,this.findLastOptionIndex()),!this.overlayVisible&&this.show();t.preventDefault()},onPageUpKey(t){this.scrollInView(0),t.preventDefault()},onPageDownKey(t){this.scrollInView(this.visibleOptions.length-1),t.preventDefault()},onEnterKey(t){this.overlayVisible?(this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(t),t.preventDefault()},onSpaceKey(t,e=!1){!e&&this.onEnterKey(t)},onEscapeKey(t){this.overlayVisible&&this.hide(!0),t.preventDefault()},onTabKey(t,e=!1){e||(this.overlayVisible&&this.hasFocusableElements()?(Ne.focus(this.$refs.firstHiddenFocusableElementOnOverlay),t.preventDefault()):(this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(t,e=!1){e&&!this.overlayVisible&&this.show()},onOverlayEnter(t){Lo.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&Ne.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){Lo.clear(t)},alignOverlay(){this.appendTo==="self"?Ne.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=Ne.getOuterWidth(this.$el)+"px",Ne.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=t=>{this.overlayVisible&&this.overlay&&!this.$el.contains(t.target)&&!this.overlay.contains(t.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new Ay(this.$refs.container,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!Ne.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return Ne.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(t){return this.isValidOption(t)&&this.getOptionLabel(t).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(t){return t&&!(this.isOptionDisabled(t)||this.isOptionGroup(t))},isValidSelectedOption(t){return this.isValidOption(t)&&this.isSelected(t)},isSelected(t){return this.isValidOption(t)&&Nt.equals(this.modelValue,this.getOptionValue(t),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex(t=>this.isValidOption(t))},findLastOptionIndex(){return Nt.findLastIndex(this.visibleOptions,t=>this.isValidOption(t))},findNextOptionIndex(t){const e=tthis.isValidOption(n)):-1;return e>-1?e+t+1:t},findPrevOptionIndex(t){const e=t>0?Nt.findLastIndex(this.visibleOptions.slice(0,t),n=>this.isValidOption(n)):-1;return e>-1?e:t},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex(t=>this.isValidSelectedOption(t)):-1},findFirstFocusedOptionIndex(){const t=this.findSelectedOptionIndex();return t<0?this.findFirstOptionIndex():t},findLastFocusedOptionIndex(){const t=this.findSelectedOptionIndex();return t<0?this.findLastOptionIndex():t},searchOptions(t,e){this.searchValue=(this.searchValue||"")+e;let n=-1,i=!1;return this.focusedOptionIndex!==-1?(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(r=>this.isOptionMatched(r)),n=n===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(r=>this.isOptionMatched(r)):n+this.focusedOptionIndex):n=this.visibleOptions.findIndex(r=>this.isOptionMatched(r)),n!==-1&&(i=!0),n===-1&&this.focusedOptionIndex===-1&&(n=this.findFirstFocusedOptionIndex()),n!==-1&&this.changeFocusedOptionIndex(t,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),i},changeFocusedOptionIndex(t,e){this.focusedOptionIndex!==e&&(this.focusedOptionIndex=e,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(t,this.visibleOptions[e],!1))},scrollInView(t=-1){const e=t!==-1?`${this.id}_${t}`:this.focusedOptionId,n=Ne.findSingle(this.list,`li[id="${e}"]`);n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout(()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(t!==-1?t:this.focusedOptionIndex)},0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(t,e){this.$emit("update:modelValue",e),this.$emit("change",{originalEvent:t,value:e})},flatOptions(t){return(t||[]).reduce((e,n,i)=>{e.push({optionGroup:n,group:!0,index:i});const r=this.getOptionGroupChildren(n);return r&&r.forEach(s=>e.push(s)),e},[])},overlayRef(t){this.overlay=t},listRef(t,e){this.list=t,e&&e(t)},virtualScrollerRef(t){this.virtualScroller=t}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!this.editable&&!this.$slots.value&&(this.label==="p-emptylabel"||this.label.length===0)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},dropdownIconClass(){return["p-dropdown-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const e=Py.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const n=this.options||[],i=[];return n.forEach(r=>{const o=this.getOptionGroupChildren(r).filter(u=>e.includes(u));o.length>0&&i.push({...r,[typeof this.optionGroupChildren=="string"?this.optionGroupChildren:"items"]:[...o]})}),this.flatOptions(i)}return e}return t},hasSelectedOption(){return Nt.isNotEmpty(this.modelValue)},label(){const t=this.findSelectedOptionIndex();return t!==-1?this.getOptionLabel(this.visibleOptions[t]):this.placeholder||"p-emptylabel"},editableInputValue(){const t=this.findSelectedOptionIndex();return t!==-1?this.getOptionLabel(this.visibleOptions[t]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return Nt.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return this.focusedOptionIndex!==-1?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter(t=>!this.isOptionGroup(t)).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:po},components:{VirtualScroller:Dy,Portal:em}};const X5=["id"],Z5=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],Q5=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],J5={class:"p-dropdown-trigger"},$5={key:0,class:"p-dropdown-header"},e9={class:"p-dropdown-filter-container"},t9=["value","placeholder","aria-owns","aria-activedescendant"],n9={role:"status","aria-live":"polite",class:"p-hidden-accessible"},i9=["id"],r9=["id"],s9=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],o9={key:0,class:"p-dropdown-empty-message",role:"option"},a9={key:1,class:"p-dropdown-empty-message",role:"option"},l9={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},u9={role:"status","aria-live":"polite",class:"p-hidden-accessible"};function c9(t,e,n,i,r,s){const o=Bt("VirtualScroller"),u=Bt("Portal"),d=_s("ripple");return G(),se("div",{ref:"container",id:r.id,class:Lt(s.containerClass),onClick:e[16]||(e[16]=(...h)=>s.onContainerClick&&s.onContainerClick(...h))},[n.editable?(G(),se("input",Ni({key:0,ref:"focusInput",id:n.inputId,type:"text",style:n.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:n.placeholder,tabindex:n.disabled?-1:n.tabindex,disabled:n.disabled,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?s.focusedOptionId:void 0,onFocus:e[0]||(e[0]=(...h)=>s.onFocus&&s.onFocus(...h)),onBlur:e[1]||(e[1]=(...h)=>s.onBlur&&s.onBlur(...h)),onKeydown:e[2]||(e[2]=(...h)=>s.onKeyDown&&s.onKeyDown(...h)),onInput:e[3]||(e[3]=(...h)=>s.onEditableInput&&s.onEditableInput(...h))},n.inputProps),null,16,Z5)):(G(),se("span",Ni({key:1,ref:"focusInput",id:n.inputId,style:n.inputStyle,class:s.inputStyleClass,tabindex:n.disabled?-1:n.tabindex,role:"combobox","aria-label":t.ariaLabel||(s.label==="p-emptylabel"?void 0:s.label),"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?s.focusedOptionId:void 0,"aria-disabled":n.disabled,onFocus:e[4]||(e[4]=(...h)=>s.onFocus&&s.onFocus(...h)),onBlur:e[5]||(e[5]=(...h)=>s.onBlur&&s.onBlur(...h)),onKeydown:e[6]||(e[6]=(...h)=>s.onKeyDown&&s.onKeyDown(...h))},n.inputProps),[En(t.$slots,"value",{value:n.modelValue,placeholder:n.placeholder},()=>[Jn(lt(s.label==="p-emptylabel"?" ":s.label||"empty"),1)])],16,Q5)),n.showClear&&n.modelValue!=null?(G(),se("i",Ni({key:2,class:["p-dropdown-clear-icon",n.clearIcon],onClick:e[7]||(e[7]=(...h)=>s.onClearClick&&s.onClearClick(...h))},n.clearIconProps),null,16)):qe("",!0),ue("div",J5,[En(t.$slots,"indicator",{},()=>[ue("span",{class:Lt(s.dropdownIconClass),"aria-hidden":"true"},null,2)])]),gt(u,{appendTo:n.appendTo},{default:jt(()=>[gt(lu,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:jt(()=>[r.overlayVisible?(G(),se("div",Ni({key:0,ref:s.overlayRef,style:n.panelStyle,class:s.panelStyleClass,onClick:e[14]||(e[14]=(...h)=>s.onOverlayClick&&s.onOverlayClick(...h)),onKeydown:e[15]||(e[15]=(...h)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...h))},n.panelProps),[ue("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[8]||(e[8]=(...h)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...h))},null,544),En(t.$slots,"header",{value:n.modelValue,options:s.visibleOptions}),n.filter?(G(),se("div",$5,[ue("div",e9,[ue("input",Ni({ref:"filterInput",type:"text",value:r.filterValue,onVnodeUpdated:e[9]||(e[9]=(...h)=>s.onFilterUpdated&&s.onFilterUpdated(...h)),class:"p-dropdown-filter p-inputtext p-component",placeholder:n.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:e[10]||(e[10]=(...h)=>s.onFilterKeyDown&&s.onFilterKeyDown(...h)),onBlur:e[11]||(e[11]=(...h)=>s.onFilterBlur&&s.onFilterBlur(...h)),onInput:e[12]||(e[12]=(...h)=>s.onFilterChange&&s.onFilterChange(...h))},n.filterInputProps),null,16,t9),ue("span",{class:Lt(["p-dropdown-filter-icon",n.filterIcon])},null,2)]),ue("span",n9,lt(s.filterResultMessageText),1)])):qe("",!0),ue("div",{class:"p-dropdown-items-wrapper",style:hi({"max-height":s.virtualScrollerDisabled?n.scrollHeight:""})},[gt(o,Ni({ref:s.virtualScrollerRef},n.virtualScrollerOptions,{items:s.visibleOptions,style:{height:n.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),yy({content:jt(({styleClass:h,contentRef:g,items:y,getItemOptions:w,contentStyle:C,itemSize:D})=>[ue("ul",{ref:P=>s.listRef(P,g),id:r.id+"_list",class:Lt(["p-dropdown-items",h]),style:hi(C),role:"listbox"},[(G(!0),se(xt,null,hn(y,(P,M)=>(G(),se(xt,{key:s.getOptionRenderKey(P,s.getOptionIndex(M,w))},[s.isOptionGroup(P)?(G(),se("li",{key:0,id:r.id+"_"+s.getOptionIndex(M,w),style:hi({height:D?D+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[En(t.$slots,"optiongroup",{option:P.optionGroup,index:s.getOptionIndex(M,w)},()=>[Jn(lt(s.getOptionGroupLabel(P.optionGroup)),1)])],12,r9)):ei((G(),se("li",{key:1,id:r.id+"_"+s.getOptionIndex(M,w),style:hi({height:D?D+"px":void 0}),class:Lt(["p-dropdown-item",{"p-highlight":s.isSelected(P),"p-focus":r.focusedOptionIndex===s.getOptionIndex(M,w),"p-disabled":s.isOptionDisabled(P)}]),role:"option","aria-label":s.getOptionLabel(P),"aria-selected":s.isSelected(P),"aria-disabled":s.isOptionDisabled(P),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(M,w)),onClick:F=>s.onOptionSelect(F,P),onMousemove:F=>s.onOptionMouseMove(F,s.getOptionIndex(M,w))},[En(t.$slots,"option",{option:P,index:s.getOptionIndex(M,w)},()=>[Jn(lt(s.getOptionLabel(P)),1)])],46,s9)),[[d]])],64))),128)),r.filterValue&&(!y||y&&y.length===0)?(G(),se("li",o9,[En(t.$slots,"emptyfilter",{},()=>[Jn(lt(s.emptyFilterMessageText),1)])])):!n.options||n.options&&n.options.length===0?(G(),se("li",a9,[En(t.$slots,"empty",{},()=>[Jn(lt(s.emptyMessageText),1)])])):qe("",!0)],14,i9)]),_:2},[t.$slots.loader?{name:"loader",fn:jt(({options:h})=>[En(t.$slots,"loader",{options:h})]),key:"0"}:void 0]),1040,["items","style","disabled"])],4),En(t.$slots,"footer",{value:n.modelValue,options:s.visibleOptions}),!n.options||n.options&&n.options.length===0?(G(),se("span",l9,lt(s.emptyMessageText),1)):qe("",!0),ue("span",u9,lt(s.selectedMessageText),1),ue("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[13]||(e[13]=(...h)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...h))},null,544)],16)):qe("",!0)]),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]),_:3},8,["appendTo"])],10,X5)}function d9(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var h9=` .p-dropdown { display: inline-flex; cursor: pointer; position: relative; user-select: none; } .p-dropdown-clear-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-dropdown-trigger { display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .p-dropdown-label { display: block; white-space: nowrap; overflow: hidden; flex: 1 1 auto; width: 1%; text-overflow: ellipsis; cursor: pointer; } .p-dropdown-label-empty { overflow: hidden; opacity: 0; } input.p-dropdown-label { cursor: default; } .p-dropdown .p-dropdown-panel { min-width: 100%; } .p-dropdown-panel { position: absolute; top: 0; left: 0; } .p-dropdown-items-wrapper { overflow: auto; } .p-dropdown-item { cursor: pointer; font-weight: normal; white-space: nowrap; position: relative; overflow: hidden; } .p-dropdown-item-group { cursor: auto; } .p-dropdown-items { margin: 0; padding: 0; list-style-type: none; } .p-dropdown-filter { width: 100%; } .p-dropdown-filter-container { position: relative; } .p-dropdown-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-fluid .p-dropdown { display: flex; } .p-fluid .p-dropdown .p-dropdown-label { width: 1%; } `;d9(h9),Zd.render=c9;var RA={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{focused:!1}},methods:{onClick(t){if(!this.disabled){const e=this.checked?this.falseValue:this.trueValue;this.$emit("click",t),this.$emit("update:modelValue",e),this.$emit("change",t),this.$emit("input",e),this.$refs.input.focus()}t.preventDefault()},onFocus(t){this.focused=!0,this.$emit("focus",t)},onBlur(t){this.focused=!1,this.$emit("blur",t)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const p9={class:"p-hidden-accessible"},f9=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],m9=ue("span",{class:"p-inputswitch-slider"},null,-1);function g9(t,e,n,i,r,s){return G(),se("div",{class:Lt(s.containerClass),onClick:e[2]||(e[2]=o=>s.onClick(o))},[ue("div",p9,[ue("input",Ni({ref:"input",id:n.inputId,type:"checkbox",role:"switch",class:n.inputClass,style:n.inputStyle,checked:s.checked,disabled:n.disabled,"aria-checked":s.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},n.inputProps),null,16,f9)]),m9],2)}function y9(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var v9=` .p-inputswitch { position: relative; display: inline-block; } .p-inputswitch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; border: 1px solid transparent; } .p-inputswitch-slider:before { position: absolute; content: ''; top: 50%; } `;y9(v9),RA.render=g9;var Iy={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null},closeIcon:{type:String,default:"pi pi-times"},closeButtonProps:{type:null,default:null}},timeout:null,data(){return{visible:!0}},mounted(){this.sticky||this.x()},methods:{close(t){this.visible=!1,this.$emit("close",t)},x(){setTimeout(()=>{this.visible=!1},this.life)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":this.severity==="info","pi-check":this.severity==="success","pi-exclamation-triangle":this.severity==="warn","pi-times-circle":this.severity==="error"}]},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:po}};const b9={class:"p-message-wrapper"},w9={class:"p-message-text"},_9=["aria-label"];function S9(t,e,n,i,r,s){const o=_s("ripple");return G(),Ct(lu,{name:"p-message",appear:""},{default:jt(()=>[ei(ue("div",{class:Lt(s.containerClass),role:"alert","aria-live":"assertive","aria-atomic":"true"},[ue("div",b9,[ue("span",{class:Lt(s.iconClass)},null,2),ue("div",w9,[En(t.$slots,"default")]),n.closable?ei((G(),se("button",Ni({key:0,class:"p-message-close p-link","aria-label":s.closeAriaLabel,type:"button",onClick:e[0]||(e[0]=u=>s.close(u))},n.closeButtonProps),[ue("i",{class:Lt(["p-message-close-icon",n.closeIcon])},null,2)],16,_9)),[[o]]):qe("",!0)])],2),[[Qf,r.visible]])]),_:3})}function T9(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var E9=` .p-message-wrapper { display: flex; align-items: center; } .p-message-close { display: flex; align-items: center; justify-content: center; } .p-message-close.p-link { margin-left: auto; overflow: hidden; position: relative; } .p-message-enter-from { opacity: 0; } .p-message-enter-active { transition: opacity 0.3s; } .p-message.p-message-leave-from { max-height: 1000px; } .p-message.p-message-leave-to { max-height: 0; opacity: 0; margin: 0 !important; } .p-message-leave-active { overflow: hidden; transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin 0.15s; } .p-message-leave-active .p-message-close { display: none; } `;T9(E9),Iy.render=S9;var Hw={name:"Listbox",emits:["update:modelValue","change","focus","blur","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:Boolean,dataKey:null,multiple:Boolean,metaKeySelection:Boolean,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},filterIcon:{type:String,default:"pi pi-search"},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",focusOnHover:!1,data(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||Xs()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||Xs(),this.autoUpdateModel()},methods:{getOptionIndex(t,e){return this.virtualScrollerDisabled?t:e&&e(t).index},getOptionLabel(t){return this.optionLabel?Nt.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?Nt.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,e){return(this.dataKey?Nt.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+e},isOptionDisabled(t){return this.optionDisabled?Nt.resolveFieldData(t,this.optionDisabled):!1},isOptionGroup(t){return this.optionGroupLabel&&t.optionGroup&&t.group},getOptionGroupLabel(t){return Nt.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return Nt.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(t){return(this.optionGroupLabel?t-this.visibleOptions.slice(0,t).filter(e=>this.isOptionGroup(e)).length:t)+1},onFirstHiddenFocus(){Ne.focus(this.list);const t=Ne.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=Nt.isEmpty(t)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(t){if(t.relatedTarget===this.list){const n=Ne.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");Ne.focus(n),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else Ne.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout(t){!this.$el.contains(t.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus(t){this.focused=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.$emit("focus",t)},onListBlur(t){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",t)},onListKeyDown(t){const e=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onSpaceKey(t);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if(this.multiple&&t.code==="KeyA"&&e){const n=this.visibleOptions.filter(i=>this.isValidOption(i)).map(i=>this.getOptionValue(i));this.updateModel(t,n),t.preventDefault();break}!e&&Nt.isPrintableCharacter(t.key)&&(this.searchOptions(t,t.key),t.preventDefault());break}},onOptionSelect(t,e,n=-1){this.disabled||this.isOptionDisabled(e)||(this.multiple?this.onOptionSelectMultiple(t,e):this.onOptionSelectSingle(t,e),this.optionTouched=!1,n!==-1&&(this.focusedOptionIndex=n))},onOptionMouseDown(t,e){this.changeFocusedOptionIndex(t,e)},onOptionMouseMove(t,e){this.focusOnHover&&this.changeFocusedOptionIndex(t,e)},onOptionTouchEnd(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle(t,e){let n=this.isSelected(e),i=!1,r=null;if(this.optionTouched?!1:this.metaKeySelection){let o=t.metaKey||t.ctrlKey;n?o&&(r=null,i=!0):(r=this.getOptionValue(e),i=!0)}else r=n?null:this.getOptionValue(e),i=!0;i&&this.updateModel(t,r)},onOptionSelectMultiple(t,e){let n=this.isSelected(e),i=null;if(this.optionTouched?!1:this.metaKeySelection){let s=t.metaKey||t.ctrlKey;n?i=s?this.removeOption(e):[this.getOptionValue(e)]:(i=s?this.modelValue||[]:[],i=[...i,this.getOptionValue(e)])}else i=n?this.removeOption(e):[...this.modelValue||[],this.getOptionValue(e)];this.updateModel(t,i)},onOptionSelectRange(t,e=-1,n=-1){if(e===-1&&(e=this.findNearestSelectedOptionIndex(n,!0)),n===-1&&(n=this.findNearestSelectedOptionIndex(e)),e!==-1&&n!==-1){const i=Math.min(e,n),r=Math.max(e,n),s=this.visibleOptions.slice(i,r+1).filter(o=>this.isValidOption(o)).map(o=>this.getOptionValue(o));this.updateModel(t,s)}},onFilterChange(t){this.$emit("filter",{originalEvent:t,value:t.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,!0);break;case"Home":this.onHomeKey(t,!0);break;case"End":this.onEndKey(t,!0);break;case"Enter":this.onEnterKey(t);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break}},onArrowDownKey(t){const e=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&t.shiftKey&&this.onOptionSelectRange(t,this.startRangeIndex,e),this.changeFocusedOptionIndex(t,e),t.preventDefault()},onArrowUpKey(t){const e=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&t.shiftKey&&this.onOptionSelectRange(t,e,this.startRangeIndex),this.changeFocusedOptionIndex(t,e),t.preventDefault()},onArrowLeftKey(t,e=!1){e&&(this.focusedOptionIndex=-1)},onHomeKey(t,e=!1){if(e)t.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{let n=t.metaKey||t.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&t.shiftKey&&n&&this.onOptionSelectRange(t,i,this.startRangeIndex),this.changeFocusedOptionIndex(t,i)}t.preventDefault()},onEndKey(t,e=!1){if(e){const n=t.currentTarget,i=n.value.length;n.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{let n=t.metaKey||t.ctrlKey,i=this.findLastOptionIndex();this.multiple&&t.shiftKey&&n&&this.onOptionSelectRange(t,this.startRangeIndex,i),this.changeFocusedOptionIndex(t,i)}t.preventDefault()},onPageUpKey(t){this.scrollInView(0),t.preventDefault()},onPageDownKey(t){this.scrollInView(this.visibleOptions.length-1),t.preventDefault()},onEnterKey(t){this.focusedOptionIndex!==-1&&(this.multiple&&t.shiftKey?this.onOptionSelectRange(t,this.focusedOptionIndex):this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex])),t.preventDefault()},onSpaceKey(t){this.onEnterKey(t)},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched(t){return this.isValidOption(t)&&this.getOptionLabel(t).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(t){return t&&!(this.isOptionDisabled(t)||this.isOptionGroup(t))},isValidSelectedOption(t){return this.isValidOption(t)&&this.isSelected(t)},isSelected(t){const e=this.getOptionValue(t);return this.multiple?(this.modelValue||[]).some(n=>Nt.equals(n,e,this.equalityKey)):Nt.equals(this.modelValue,e,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex(t=>this.isValidOption(t))},findLastOptionIndex(){return Nt.findLastIndex(this.visibleOptions,t=>this.isValidOption(t))},findNextOptionIndex(t){const e=tthis.isValidOption(n)):-1;return e>-1?e+t+1:t},findPrevOptionIndex(t){const e=t>0?Nt.findLastIndex(this.visibleOptions.slice(0,t),n=>this.isValidOption(n)):-1;return e>-1?e:t},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex(t=>this.isValidSelectedOption(t)):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?Nt.findLastIndex(this.visibleOptions,t=>this.isValidSelectedOption(t)):-1},findNextSelectedOptionIndex(t){const e=this.hasSelectedOption&&tthis.isValidSelectedOption(n)):-1;return e>-1?e+t+1:-1},findPrevSelectedOptionIndex(t){const e=this.hasSelectedOption&&t>0?Nt.findLastIndex(this.visibleOptions.slice(0,t),n=>this.isValidSelectedOption(n)):-1;return e>-1?e:-1},findNearestSelectedOptionIndex(t,e=!1){let n=-1;return this.hasSelectedOption&&(e?(n=this.findPrevSelectedOptionIndex(t),n=n===-1?this.findNextSelectedOptionIndex(t):n):(n=this.findNextSelectedOptionIndex(t),n=n===-1?this.findPrevSelectedOptionIndex(t):n)),n>-1?n:t},findFirstFocusedOptionIndex(){const t=this.findFirstSelectedOptionIndex();return t<0?this.findFirstOptionIndex():t},findLastFocusedOptionIndex(){const t=this.findLastSelectedOptionIndex();return t<0?this.findLastOptionIndex():t},searchOptions(t,e){this.searchValue=(this.searchValue||"")+e;let n=-1;this.focusedOptionIndex!==-1?(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(i=>this.isOptionMatched(i)),n=n===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(i=>this.isOptionMatched(i)):n+this.focusedOptionIndex):n=this.visibleOptions.findIndex(i=>this.isOptionMatched(i)),n===-1&&this.focusedOptionIndex===-1&&(n=this.findFirstFocusedOptionIndex()),n!==-1&&this.changeFocusedOptionIndex(t,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500)},removeOption(t){return this.modelValue.filter(e=>!Nt.equals(e,this.getOptionValue(t),this.equalityKey))},changeFocusedOptionIndex(t,e){this.focusedOptionIndex!==e&&(this.focusedOptionIndex=e,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(t,this.visibleOptions[e]))},scrollInView(t=-1){const e=t!==-1?`${this.id}_${t}`:this.focusedOptionId,n=Ne.findSingle(this.list,`li[id="${e}"]`);n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(t!==-1?t:this.focusedOptionIndex)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel(t,e){this.$emit("update:modelValue",e),this.$emit("change",{originalEvent:t,value:e})},flatOptions(t){return(t||[]).reduce((e,n,i)=>{e.push({optionGroup:n,group:!0,index:i});const r=this.getOptionGroupChildren(n);return r&&r.forEach(s=>e.push(s)),e},[])},listRef(t,e){this.list=t,e&&e(t)},virtualScrollerRef(t){this.virtualScroller=t}},computed:{containerClass(){return["p-listbox p-component",{"p-focus":this.focused,"p-disabled":this.disabled}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?Py.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption(){return Nt.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return Nt.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId(){return this.focusedOptionIndex!==-1?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter(t=>!this.isOptionGroup(t)).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:po},components:{VirtualScroller:Dy}};const x9=["id"],C9=["tabindex"],A9={key:0,class:"p-listbox-header"},k9={class:"p-listbox-filter-container"},P9=["placeholder","aria-owns","aria-activedescendant","tabindex"],D9={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I9=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],O9=["id"],R9=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove"],L9={key:0,class:"p-listbox-empty-message",role:"option"},M9={key:1,class:"p-listbox-empty-message",role:"option"},N9={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},F9={role:"status","aria-live":"polite",class:"p-hidden-accessible"},B9=["tabindex"];function U9(t,e,n,i,r,s){const o=Bt("VirtualScroller"),u=_s("ripple");return G(),se("div",{id:r.id,class:Lt(s.containerClass),onFocusout:e[10]||(e[10]=(...d)=>s.onFocusout&&s.onFocusout(...d))},[ue("span",{ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:n.disabled?-1:n.tabindex,onFocus:e[0]||(e[0]=(...d)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...d))},null,40,C9),En(t.$slots,"header",{value:n.modelValue,options:s.visibleOptions}),n.filter?(G(),se("div",A9,[ue("div",k9,[ei(ue("input",Ni({ref:"filterInput","onUpdate:modelValue":e[1]||(e[1]=d=>r.filterValue=d),type:"text",class:"p-listbox-filter p-inputtext p-component",placeholder:n.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:!n.disabled&&!r.focused?n.tabindex:-1,onInput:e[2]||(e[2]=(...d)=>s.onFilterChange&&s.onFilterChange(...d)),onBlur:e[3]||(e[3]=(...d)=>s.onFilterBlur&&s.onFilterBlur(...d)),onKeydown:e[4]||(e[4]=(...d)=>s.onFilterKeyDown&&s.onFilterKeyDown(...d))},n.filterInputProps),null,16,P9),[[xA,r.filterValue]]),ue("span",{class:Lt(["p-listbox-filter-icon",n.filterIcon])},null,2)]),ue("span",D9,lt(s.filterResultMessageText),1)])):qe("",!0),ue("div",{ref:"listWrapper",class:"p-listbox-list-wrapper",style:hi(n.listStyle)},[gt(o,Ni({ref:s.virtualScrollerRef},n.virtualScrollerOptions,{style:n.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),yy({content:jt(({styleClass:d,contentRef:h,items:g,getItemOptions:y,contentStyle:w,itemSize:C})=>[ue("ul",{ref:D=>s.listRef(D,h),id:r.id+"_list",class:Lt(["p-listbox-list",d]),style:hi(w),tabindex:-1,role:"listbox","aria-multiselectable":n.multiple,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-activedescendant":r.focused?s.focusedOptionId:void 0,"aria-disabled":n.disabled,onFocus:e[6]||(e[6]=(...D)=>s.onListFocus&&s.onListFocus(...D)),onBlur:e[7]||(e[7]=(...D)=>s.onListBlur&&s.onListBlur(...D)),onKeydown:e[8]||(e[8]=(...D)=>s.onListKeyDown&&s.onListKeyDown(...D))},[(G(!0),se(xt,null,hn(g,(D,P)=>(G(),se(xt,{key:s.getOptionRenderKey(D,s.getOptionIndex(P,y))},[s.isOptionGroup(D)?(G(),se("li",{key:0,id:r.id+"_"+s.getOptionIndex(P,y),style:hi({height:C?C+"px":void 0}),class:"p-listbox-item-group",role:"option"},[En(t.$slots,"optiongroup",{option:D.optionGroup,index:s.getOptionIndex(P,y)},()=>[Jn(lt(s.getOptionGroupLabel(D.optionGroup)),1)])],12,O9)):ei((G(),se("li",{key:1,id:r.id+"_"+s.getOptionIndex(P,y),style:hi({height:C?C+"px":void 0}),class:Lt(["p-listbox-item",{"p-highlight":s.isSelected(D),"p-focus":r.focusedOptionIndex===s.getOptionIndex(P,y),"p-disabled":s.isOptionDisabled(D)}]),role:"option","aria-label":s.getOptionLabel(D),"aria-selected":s.isSelected(D),"aria-disabled":s.isOptionDisabled(D),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(P,y)),onClick:M=>s.onOptionSelect(M,D,s.getOptionIndex(P,y)),onMousedown:M=>s.onOptionMouseDown(M,s.getOptionIndex(P,y)),onMousemove:M=>s.onOptionMouseMove(M,s.getOptionIndex(P,y)),onTouchend:e[5]||(e[5]=M=>s.onOptionTouchEnd())},[En(t.$slots,"option",{option:D,index:s.getOptionIndex(P,y)},()=>[Jn(lt(s.getOptionLabel(D)),1)])],46,R9)),[[u]])],64))),128)),r.filterValue&&(!g||g&&g.length===0)?(G(),se("li",L9,[En(t.$slots,"emptyfilter",{},()=>[Jn(lt(s.emptyFilterMessageText),1)])])):!n.options||n.options&&n.options.length===0?(G(),se("li",M9,[En(t.$slots,"empty",{},()=>[Jn(lt(s.emptyMessageText),1)])])):qe("",!0)],46,I9)]),_:2},[t.$slots.loader?{name:"loader",fn:jt(({options:d})=>[En(t.$slots,"loader",{options:d})]),key:"0"}:void 0]),1040,["style","items","disabled"])],4),En(t.$slots,"footer",{value:n.modelValue,options:s.visibleOptions}),!n.options||n.options&&n.options.length===0?(G(),se("span",N9,lt(s.emptyMessageText),1)):qe("",!0),ue("span",F9,lt(s.selectedMessageText),1),ue("span",{ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:n.disabled?-1:n.tabindex,onFocus:e[9]||(e[9]=(...d)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...d))},null,40,B9)],42,x9)}function H9(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var z9=` .p-listbox-list-wrapper { overflow: auto; } .p-listbox-list { list-style-type: none; margin: 0; padding: 0; } .p-listbox-item { cursor: pointer; position: relative; overflow: hidden; } .p-listbox-item-group { cursor: auto; } .p-listbox-filter-container { position: relative; } .p-listbox-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-listbox-filter { width: 100%; } `;H9(z9),Hw.render=U9;var LA={name:"Chip",emits:["remove"],props:{label:{type:String,default:null},icon:{type:String,default:null},image:{type:String,default:null},removable:{type:Boolean,default:!1},removeIcon:{type:String,default:"pi pi-times-circle"}},data(){return{visible:!0}},methods:{onKeydown(t){(t.key==="Enter"||t.key==="Backspace")&&this.close(t)},close(t){this.visible=!1,this.$emit("remove",t)}},computed:{containerClass(){return["p-chip p-component",{"p-chip-image":this.image!=null}]},iconClass(){return["p-chip-icon",this.icon]},removeIconClass(){return["p-chip-remove-icon",this.removeIcon]}}};const j9=["aria-label"],V9=["src"],W9={key:2,class:"p-chip-text"};function q9(t,e,n,i,r,s){return r.visible?(G(),se("div",{key:0,class:Lt(s.containerClass),"aria-label":n.label},[En(t.$slots,"default",{},()=>[n.image?(G(),se("img",{key:0,src:n.image},null,8,V9)):n.icon?(G(),se("span",{key:1,class:Lt(s.iconClass)},null,2)):qe("",!0),n.label?(G(),se("div",W9,lt(n.label),1)):qe("",!0)]),n.removable?(G(),se("span",{key:0,tabindex:"0",class:Lt(s.removeIconClass),onClick:e[0]||(e[0]=(...o)=>s.close&&s.close(...o)),onKeydown:e[1]||(e[1]=(...o)=>s.onKeydown&&s.onKeydown(...o))},null,34)):qe("",!0)],10,j9)):qe("",!0)}function G9(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var K9=` .p-chip { display: inline-flex; align-items: center; } .p-chip-text { line-height: 1.5; } .p-chip-icon.pi { line-height: 1.5; } .p-chip-remove-icon { line-height: 1.5; cursor: pointer; } .p-chip img { border-radius: 50%; } `;G9(K9),LA.render=q9;var Oy={name:"TabView",emits:["update:activeIndex","tab-change","tab-click"],props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},data(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(t){this.id=t||Xs()},activeIndex(t){this.d_activeIndex=t,this.scrollInView({index:t})}},mounted(){this.id=this.id||Xs(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated(){this.updateInkBar()},methods:{isTabPanel(t){return t.type.name==="TabPanel"},isTabActive(t){return this.d_activeIndex===t},getTabProp(t,e){return t.props?t.props[e]:void 0},getKey(t,e){return this.getTabProp(t,"header")||e},getTabHeaderActionId(t){return`${this.id}_${t}_header_action`},getTabContentId(t){return`${this.id}_${t}_content`},onScroll(t){this.scrollable&&this.updateButtonState(),t.preventDefault()},onPrevButtonClick(){const t=this.$refs.content,e=Ne.getWidth(t)-this.getVisibleButtonWidths(),n=t.scrollLeft-e;t.scrollLeft=n<=0?0:n},onNextButtonClick(){const t=this.$refs.content,e=Ne.getWidth(t)-this.getVisibleButtonWidths(),n=t.scrollLeft+e,i=t.scrollWidth-e;t.scrollLeft=n>=i?i:n},onTabClick(t,e,n){this.changeActiveIndex(t,e,n),this.$emit("tab-click",{originalEvent:t,index:n})},onTabKeyDown(t,e,n){switch(t.code){case"ArrowLeft":this.onTabArrowLeftKey(t);break;case"ArrowRight":this.onTabArrowRightKey(t);break;case"Home":this.onTabHomeKey(t);break;case"End":this.onTabEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onTabEnterKey(t,e,n);break}},onTabArrowRightKey(t){const e=this.findNextHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabHomeKey(t),t.preventDefault()},onTabArrowLeftKey(t){const e=this.findPrevHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabEndKey(t),t.preventDefault()},onTabHomeKey(t){const e=this.findFirstHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onTabEndKey(t){const e=this.findLastHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onPageDownKey(t){this.scrollInView({index:this.$refs.nav.children.length-2}),t.preventDefault()},onPageUpKey(t){this.scrollInView({index:0}),t.preventDefault()},onTabEnterKey(t,e,n){this.changeActiveIndex(t,e,n),t.preventDefault()},findNextHeaderAction(t,e=!1){const n=e?t:t.nextElementSibling;return n?Ne.hasClass(n,"p-disabled")||Ne.hasClass(n,"p-tabview-ink-bar")?this.findNextHeaderAction(n):Ne.findSingle(n,".p-tabview-header-action"):null},findPrevHeaderAction(t,e=!1){const n=e?t:t.previousElementSibling;return n?Ne.hasClass(n,"p-disabled")||Ne.hasClass(n,"p-tabview-ink-bar")?this.findPrevHeaderAction(n):Ne.findSingle(n,".p-tabview-header-action"):null},findFirstHeaderAction(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex(t,e,n){!this.getTabProp(e,"disabled")&&this.d_activeIndex!==n&&(this.d_activeIndex=n,this.$emit("update:activeIndex",n),this.$emit("tab-change",{originalEvent:t,index:n}),this.scrollInView({index:n}))},changeFocusedTab(t,e){if(e&&(Ne.focus(e),this.scrollInView({element:e}),this.selectOnFocus)){const n=parseInt(e.parentElement.dataset.index,10),i=this.tabs[n];this.changeActiveIndex(t,i,n)}},scrollInView({element:t,index:e=-1}){const n=t||this.$refs.nav.children[e];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})},updateInkBar(){let t=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=Ne.getWidth(t)+"px",this.$refs.inkbar.style.left=Ne.getOffset(t).left-Ne.getOffset(this.$refs.nav).left+"px"},updateButtonState(){const t=this.$refs.content,{scrollLeft:e,scrollWidth:n}=t,i=Ne.getWidth(t);this.isPrevButtonDisabled=e===0,this.isNextButtonDisabled=parseInt(e)===n-i},getVisibleButtonWidths(){const{prevBtn:t,nextBtn:e}=this.$refs;return[t,e].reduce((n,i)=>i?n+Ne.getWidth(i):n,0)},getTabHeaderClass(t,e){return["p-tabview-header",this.getTabProp(t,"headerClass"),{"p-highlight":this.d_activeIndex===e,"p-disabled":this.getTabProp(t,"disabled")}]},getTabContentClass(t){return["p-tabview-panel",this.getTabProp(t,"contentClass")]}},computed:{contentClasses(){return["p-tabview p-component",{"p-tabview-scrollable":this.scrollable}]},tabs(){return this.$slots.default().reduce((t,e)=>(this.isTabPanel(e)?t.push(e):e.children&&e.children instanceof Array&&e.children.forEach(n=>{this.isTabPanel(n)&&t.push(n)}),t),[])},prevButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:po}};const Y9={class:"p-tabview-nav-container"},X9=["tabindex","aria-label"],Z9=[ue("span",{class:"pi pi-chevron-left","aria-hidden":"true"},null,-1)],Q9={ref:"nav",class:"p-tabview-nav",role:"tablist"},J9=["data-index"],$9=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],eU={key:0,class:"p-tabview-title"},tU={ref:"inkbar",class:"p-tabview-ink-bar",role:"presentation","aria-hidden":"true"},nU=["tabindex","aria-label"],iU=[ue("span",{class:"pi pi-chevron-right","aria-hidden":"true"},null,-1)],rU={class:"p-tabview-panels"},sU=["aria-labelledby"];function oU(t,e,n,i,r,s){const o=_s("ripple");return G(),se("div",{class:Lt(s.contentClasses)},[ue("div",Y9,[n.scrollable&&!r.isPrevButtonDisabled?ei((G(),se("button",Ni({key:0,ref:"prevBtn",type:"button",class:"p-tabview-nav-prev p-tabview-nav-btn p-link",tabindex:n.tabindex,"aria-label":s.prevButtonAriaLabel,onClick:e[0]||(e[0]=(...u)=>s.onPrevButtonClick&&s.onPrevButtonClick(...u))},n.previousButtonProps),Z9,16,X9)),[[o]]):qe("",!0),ue("div",{ref:"content",class:"p-tabview-nav-content",onScroll:e[1]||(e[1]=(...u)=>s.onScroll&&s.onScroll(...u))},[ue("ul",Q9,[(G(!0),se(xt,null,hn(s.tabs,(u,d)=>(G(),se("li",Ni({key:s.getKey(u,d),style:s.getTabProp(u,"headerStyle"),class:s.getTabHeaderClass(u,d),role:"presentation","data-index":d},s.getTabProp(u,"headerProps")),[ei((G(),se("a",Ni({id:s.getTabHeaderActionId(d),class:"p-tabview-nav-link p-tabview-header-action",tabindex:s.getTabProp(u,"disabled")||!s.isTabActive(d)?-1:n.tabindex,role:"tab","aria-disabled":s.getTabProp(u,"disabled"),"aria-selected":s.isTabActive(d),"aria-controls":s.getTabContentId(d),onClick:h=>s.onTabClick(h,u,d),onKeydown:h=>s.onTabKeyDown(h,u,d)},s.getTabProp(u,"headerActionProps")),[u.props&&u.props.header?(G(),se("span",eU,lt(u.props.header),1)):qe("",!0),u.children&&u.children.header?(G(),Ct(us(u.children.header),{key:1})):qe("",!0)],16,$9)),[[o]])],16,J9))),128)),ue("li",tU,null,512)],512)],544),n.scrollable&&!r.isNextButtonDisabled?ei((G(),se("button",Ni({key:1,ref:"nextBtn",type:"button",class:"p-tabview-nav-next p-tabview-nav-btn p-link",tabindex:n.tabindex,"aria-label":s.nextButtonAriaLabel,onClick:e[2]||(e[2]=(...u)=>s.onNextButtonClick&&s.onNextButtonClick(...u))},n.nextButtonProps),iU,16,nU)),[[o]]):qe("",!0)]),ue("div",rU,[(G(!0),se(xt,null,hn(s.tabs,(u,d)=>(G(),se(xt,{key:s.getKey(u,d)},[!n.lazy||s.isTabActive(d)?ei((G(),se("div",Ni({key:0,style:s.getTabProp(u,"contentStyle"),class:s.getTabContentClass(u),role:"tabpanel","aria-labelledby":s.getTabHeaderActionId(d)},s.getTabProp(u,"contentProps")),[(G(),Ct(us(u)))],16,sU)),[[Qf,n.lazy?!0:s.isTabActive(d)]]):qe("",!0)],64))),128))])],2)}function aU(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var lU=` .p-tabview-nav-container { position: relative; } .p-tabview-scrollable .p-tabview-nav-container { overflow: hidden; } .p-tabview-nav-content { overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior: contain auto; } .p-tabview-nav { display: flex; margin: 0; padding: 0; list-style-type: none; flex: 1 1 auto; } .p-tabview-header-action { cursor: pointer; user-select: none; display: flex; align-items: center; position: relative; text-decoration: none; overflow: hidden; } .p-tabview-ink-bar { display: none; z-index: 1; } .p-tabview-header-action:focus { z-index: 1; } .p-tabview-title { line-height: 1; white-space: nowrap; } .p-tabview-nav-btn { position: absolute; top: 0; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: center; } .p-tabview-nav-prev { left: 0; } .p-tabview-nav-next { right: 0; } .p-tabview-nav-content::-webkit-scrollbar { display: none; } `;aU(lU),Oy.render=oU;var Ry={name:"TabPanel",props:{header:null,headerStyle:null,headerClass:null,headerProps:null,headerActionProps:null,contentStyle:null,contentClass:null,contentProps:null,disabled:Boolean}};function uU(t,e,n,i,r,s){return En(t.$slots,"default")}Ry.render=uU;var tm={name:"InputText",emits:["update:modelValue"],props:{modelValue:null},methods:{onInput(t){this.$emit("update:modelValue",t.target.value)}},computed:{filled(){return this.modelValue!=null&&this.modelValue.toString().length>0}}};const cU=["value"];function dU(t,e,n,i,r,s){return G(),se("input",{class:Lt(["p-inputtext p-component",{"p-filled":s.filled}]),value:n.modelValue,onInput:e[0]||(e[0]=(...o)=>s.onInput&&s.onInput(...o))},null,42,cU)}tm.render=dU;var MA={name:"InputNumber",emits:["update:modelValue","input","focus","blur"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},highlightOnFocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},incrementButtonProps:{type:null,default:null},decrementButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(t){this.d_modelValue=t},locale(t,e){this.updateConstructParser(t,e)},localeMatcher(t,e){this.updateConstructParser(t,e)},mode(t,e){this.updateConstructParser(t,e)},currency(t,e){this.updateConstructParser(t,e)},currencyDisplay(t,e){this.updateConstructParser(t,e)},useGrouping(t,e){this.updateConstructParser(t,e)},minFractionDigits(t,e){this.updateConstructParser(t,e)},maxFractionDigits(t,e){this.updateConstructParser(t,e)},suffix(t,e){this.updateConstructParser(t,e)},prefix(t,e){this.updateConstructParser(t,e)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),e=new Map(t.map((n,i)=>[n,i]));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=n=>e.get(n)},updateConstructParser(t,e){t!==e&&this.constructParser()},escapeRegExp(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${t.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(t){if(t!=null){if(t==="-")return t;if(this.format){let n=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(n=this.prefix+n),this.suffix&&(n=n+this.suffix),n}return t.toString()}return""},parseValue(t){let e=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(e){if(e==="-")return e;let n=+e;return isNaN(n)?null:n}return null},repeat(t,e,n){if(this.readonly)return;let i=e||500;this.clearTimer(),this.timer=setTimeout(()=>{this.repeat(t,40,n)},i),this.spin(t,n)},spin(t,e){if(this.$refs.input){let n=this.step*e,i=this.parseValue(this.$refs.input.$el.value)||0,r=this.validateValue(i+n);this.updateInput(r,null,"spin"),this.updateModel(t,r),this.handleOnInput(t,i,r)}},onUpButtonMouseDown(t){this.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,1),t.preventDefault())},onUpButtonMouseUp(){this.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.disabled||this.clearTimer()},onUpButtonKeyUp(){this.disabled||this.clearTimer()},onUpButtonKeyDown(t){(t.keyCode===32||t.keyCode===13)&&this.repeat(t,null,1)},onDownButtonMouseDown(t){this.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,-1),t.preventDefault())},onDownButtonMouseUp(){this.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.disabled||this.clearTimer()},onDownButtonKeyUp(){this.disabled||this.clearTimer()},onDownButtonKeyDown(t){(t.keyCode===32||t.keyCode===13)&&this.repeat(t,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(t){if(this.readonly)return;if(this.lastValue=t.target.value,t.shiftKey||t.altKey){this.isSpecialChar=!0;return}let e=t.target.selectionStart,n=t.target.selectionEnd,i=t.target.value,r=null;switch(t.altKey&&t.preventDefault(),t.code){case"ArrowUp":this.spin(t,1),t.preventDefault();break;case"ArrowDown":this.spin(t,-1),t.preventDefault();break;case"ArrowLeft":this.isNumeralChar(i.charAt(e-1))||t.preventDefault();break;case"ArrowRight":this.isNumeralChar(i.charAt(e))||t.preventDefault();break;case"Tab":case"Enter":r=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(r),this.$refs.input.$el.setAttribute("aria-valuenow",r),this.updateModel(t,r);break;case"Backspace":{if(t.preventDefault(),e===n){const s=i.charAt(e-1),{decimalCharIndex:o,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(s)){const d=this.getDecimalLength(i);if(this._group.test(s))this._group.lastIndex=0,r=i.slice(0,e-2)+i.slice(e-1);else if(this._decimal.test(s))this._decimal.lastIndex=0,d?this.$refs.input.$el.setSelectionRange(e-1,e-1):r=i.slice(0,e-1)+i.slice(e);else if(o>0&&e>o){const h=this.isDecimalMode()&&(this.minFractionDigits||0)0?r:""):r=i.slice(0,e-1)+i.slice(e)}this.updateValue(t,r,null,"delete-single")}else r=this.deleteRange(i,e,n),this.updateValue(t,r,null,"delete-range");break}case"Delete":if(t.preventDefault(),e===n){const s=i.charAt(e),{decimalCharIndex:o,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(s)){const d=this.getDecimalLength(i);if(this._group.test(s))this._group.lastIndex=0,r=i.slice(0,e)+i.slice(e+2);else if(this._decimal.test(s))this._decimal.lastIndex=0,d?this.$refs.input.$el.setSelectionRange(e+1,e+1):r=i.slice(0,e)+i.slice(e+1);else if(o>0&&e>o){const h=this.isDecimalMode()&&(this.minFractionDigits||0)0?r:""):r=i.slice(0,e)+i.slice(e+1)}this.updateValue(t,r,null,"delete-back-single")}else r=this.deleteRange(i,e,n),this.updateValue(t,r,null,"delete-range");break;case"Home":this.min&&(this.updateModel(t,this.min),t.preventDefault());break;case"End":this.max&&(this.updateModel(t,this.max),t.preventDefault());break}},onInputKeyPress(t){if(this.readonly)return;t.preventDefault();let e=t.which||t.keyCode,n=String.fromCharCode(e);const i=this.isDecimalSign(n),r=this.isMinusSign(n);(48<=e&&e<=57||r||i)&&this.insert(t,n,{isDecimalSign:i,isMinusSign:r})},onPaste(t){t.preventDefault();let e=(t.clipboardData||window.clipboardData).getData("Text");if(e){let n=this.parseValue(e);n!=null&&this.insert(t,n.toString())}},allowMinusSign(){return this.min===null||this.min<0},isMinusSign(t){return this._minusSign.test(t)||t==="-"?(this._minusSign.lastIndex=0,!0):!1},isDecimalSign(t){return this._decimal.test(t)?(this._decimal.lastIndex=0,!0):!1},isDecimalMode(){return this.mode==="decimal"},getDecimalCharIndexes(t){let e=t.search(this._decimal);this._decimal.lastIndex=0;const i=t.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:e,decimalCharIndexWithoutPrefix:i}},getCharIndexes(t){const e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.search(this._minusSign);this._minusSign.lastIndex=0;const i=t.search(this._suffix);this._suffix.lastIndex=0;const r=t.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:e,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:r}},insert(t,e,n={isDecimalSign:!1,isMinusSign:!1}){const i=e.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&i!==-1)return;const r=this.$refs.input.$el.selectionStart,s=this.$refs.input.$el.selectionEnd;let o=this.$refs.input.$el.value.trim();const{decimalCharIndex:u,minusCharIndex:d,suffixCharIndex:h,currencyCharIndex:g}=this.getCharIndexes(o);let y;if(n.isMinusSign)r===0&&(y=o,(d===-1||s!==0)&&(y=this.insertText(o,e,0,s)),this.updateValue(t,y,e,"insert"));else if(n.isDecimalSign)u>0&&r===u?this.updateValue(t,o,e,"insert"):u>r&&u0&&r>u){if(r+e.length-(u+1)<=w){const D=g>=r?g-1:h>=r?h:o.length;y=o.slice(0,r)+e+o.slice(r+e.length,D)+o.slice(D),this.updateValue(t,y,e,C)}}else y=this.insertText(o,e,r,s),this.updateValue(t,y,e,C)}},insertText(t,e,n,i){if((e==="."?e:e.split(".")).length===2){const s=t.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?t.slice(0,n)+this.formatValue(e)+t.slice(i):t||this.formatValue(e)}else return i-n===t.length?this.formatValue(e):n===0?e+t.slice(i):i===t.length?t.slice(0,n)+e:t.slice(0,n)+e+t.slice(i)},deleteRange(t,e,n){let i;return n-e===t.length?i="":e===0?i=t.slice(n):n===t.length?i=t.slice(0,e):i=t.slice(0,e)+t.slice(n),i},initCursor(){let t=this.$refs.input.$el.selectionStart,e=this.$refs.input.$el.value,n=e.length,i=null,r=(this.prefixChar||"").length;e=e.replace(this._prefix,""),t=t-r;let s=e.charAt(t);if(this.isNumeralChar(s))return t+r;let o=t-1;for(;o>=0;)if(s=e.charAt(o),this.isNumeralChar(s)){i=o+r;break}else o--;if(i!==null)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(o=t;othis.max?this.max:t},updateInput(t,e,n,i){e=e||"";let r=this.$refs.input.$el.value,s=this.formatValue(t),o=r.length;if(s!==i&&(s=this.concatValues(s,i)),o===0){this.$refs.input.$el.value=s,this.$refs.input.$el.setSelectionRange(0,0);const d=this.initCursor()+e.length;this.$refs.input.$el.setSelectionRange(d,d)}else{let u=this.$refs.input.$el.selectionStart,d=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=s;let h=s.length;if(n==="range-insert"){const g=this.parseValue((r||"").slice(0,u)),w=(g!==null?g.toString():"").split("").join(`(${this.groupChar})?`),C=new RegExp(w,"g");C.test(s);const D=e.split("").join(`(${this.groupChar})?`),P=new RegExp(D,"g");P.test(s.slice(C.lastIndex)),d=C.lastIndex+P.lastIndex,this.$refs.input.$el.setSelectionRange(d,d)}else if(h===o)n==="insert"||n==="delete-back-single"?this.$refs.input.$el.setSelectionRange(d+1,d+1):n==="delete-single"?this.$refs.input.$el.setSelectionRange(d-1,d-1):(n==="delete-range"||n==="spin")&&this.$refs.input.$el.setSelectionRange(d,d);else if(n==="delete-back-single"){let g=r.charAt(d-1),y=r.charAt(d),w=o-h,C=this._group.test(y);C&&w===1?d+=1:!C&&this.isNumeralChar(g)&&(d+=-1*w+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(d,d)}else if(r==="-"&&n==="insert"){this.$refs.input.$el.setSelectionRange(0,0);const y=this.initCursor()+e.length+1;this.$refs.input.$el.setSelectionRange(y,y)}else d=d+(h-o),this.$refs.input.$el.setSelectionRange(d,d)}this.$refs.input.$el.setAttribute("aria-valuenow",t)},concatValues(t,e){if(t&&e){let n=e.search(this._decimal);return this._decimal.lastIndex=0,this.suffixChar?t.replace(this.suffixChar,"").split(this._decimal)[0]+e.replace(this.suffixChar,"").slice(n)+this.suffixChar:n!==-1?t.split(this._decimal)[0]+e.slice(n):t}return t},getDecimalLength(t){if(t){const e=t.split(this._decimal);if(e.length===2)return e[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(t,e){this.d_modelValue=e,this.$emit("update:modelValue",e)},onInputFocus(t){this.focused=!0,!this.disabled&&!this.readonly&&this.$refs.input.$el.value!==Ne.getSelection()&&this.highlightOnFocus&&t.target.select(),this.$emit("focus",t)},onInputBlur(t){this.focused=!1;let e=t.target,n=this.validateValue(this.parseValue(e.value));this.$emit("blur",{originalEvent:t,value:e.value}),e.value=this.formatValue(n),e.setAttribute("aria-valuenow",n),this.updateModel(t,n)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&this.buttonLayout==="stacked","p-inputnumber-buttons-horizontal":this.showButtons&&this.buttonLayout==="horizontal","p-inputnumber-buttons-vertical":this.showButtons&&this.buttonLayout==="vertical"}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&this.max!==null&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&this.min!==null&&this.minBoundry()}]},filled(){return this.modelValue!=null&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:t=>this.onUpButtonMouseDown(t),mouseup:t=>this.onUpButtonMouseUp(t),mouseleave:t=>this.onUpButtonMouseLeave(t),keydown:t=>this.onUpButtonKeyDown(t),keyup:t=>this.onUpButtonKeyUp(t)}},downButtonListeners(){return{mousedown:t=>this.onDownButtonMouseDown(t),mouseup:t=>this.onDownButtonMouseUp(t),mouseleave:t=>this.onDownButtonMouseLeave(t),keydown:t=>this.onDownButtonKeyDown(t),keyup:t=>this.onDownButtonKeyUp(t)}},formattedValue(){const t=!this.modelValue&&!this.allowEmpty?0:this.modelValue;return this.formatValue(t)},getFormatter(){return this.numberFormat}},components:{INInputText:tm,INButton:nc}};const hU={key:0,class:"p-inputnumber-button-group"};function pU(t,e,n,i,r,s){const o=Bt("INInputText"),u=Bt("INButton");return G(),se("span",{class:Lt(s.containerClass)},[gt(o,Ni({ref:"input",id:n.inputId,class:["p-inputnumber-input",n.inputClass],role:"spinbutton",style:n.inputStyle,value:s.formattedValue,"aria-valuemin":n.min,"aria-valuemax":n.max,"aria-valuenow":n.modelValue,disabled:n.disabled,readonly:n.readonly,placeholder:n.placeholder,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onInput:s.onUserInput,onKeydown:s.onInputKeyDown,onKeypress:s.onInputKeyPress,onPaste:s.onPaste,onClick:s.onInputClick,onFocus:s.onInputFocus,onBlur:s.onInputBlur},n.inputProps),null,16,["id","class","style","value","aria-valuemin","aria-valuemax","aria-valuenow","disabled","readonly","placeholder","aria-labelledby","aria-label","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),n.showButtons&&n.buttonLayout==="stacked"?(G(),se("span",hU,[gt(u,Ni({class:s.upButtonClass,icon:n.incrementButtonIcon},vy(s.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"]),gt(u,Ni({class:s.downButtonClass,icon:n.decrementButtonIcon},vy(s.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])])):qe("",!0),n.showButtons&&n.buttonLayout!=="stacked"?(G(),Ct(u,Ni({key:1,class:s.upButtonClass,icon:n.incrementButtonIcon},vy(s.upButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.incrementButtonProps),null,16,["class","icon","disabled"])):qe("",!0),n.showButtons&&n.buttonLayout!=="stacked"?(G(),Ct(u,Ni({key:2,class:s.downButtonClass,icon:n.decrementButtonIcon},vy(s.downButtonListeners),{disabled:n.disabled,tabindex:-1,"aria-hidden":"true"},n.decrementButtonProps),null,16,["class","icon","disabled"])):qe("",!0)],2)}function fU(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var mU=` .p-inputnumber { display: inline-flex; } .p-inputnumber-button { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label, .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label { display: none; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up { border-top-left-radius: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-input { border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group { display: flex; flex-direction: column; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button { flex: 1 1 auto; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up { order: 3; border-top-left-radius: 0; border-bottom-left-radius: 0; } .p-inputnumber-buttons-horizontal .p-inputnumber-input { order: 2; border-radius: 0; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down { order: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-vertical { flex-direction: column; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up { order: 1; border-bottom-left-radius: 0; border-bottom-right-radius: 0; width: 100%; } .p-inputnumber-buttons-vertical .p-inputnumber-input { order: 2; border-radius: 0; text-align: center; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down { order: 3; border-top-left-radius: 0; border-top-right-radius: 0; width: 100%; } .p-inputnumber-input { flex: 1 1 auto; } .p-fluid .p-inputnumber { width: 100%; } .p-fluid .p-inputnumber .p-inputnumber-input { width: 1%; } .p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input { width: 100%; } `;fU(mU),MA.render=pU;var NA={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const gU={class:"p-paginator-current"};function yU(t,e,n,i,r,s){return G(),se("span",gU,lt(s.text),1)}NA.render=yU;var FA={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:po}};const vU=[ue("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];function bU(t,e,n,i,r,s){const o=_s("ripple");return ei((G(),se("button",{class:Lt(s.containerClass),type:"button"},vU,2)),[[o]])}FA.render=bU;var BA={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(t){this.$emit("page-change",t)}},computed:{pageOptions(){let t=[];for(let e=0;es.onChange(u)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])}BA.render=wU;var UA={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data(){return{d_page:this.page}},watch:{page(t){this.d_page=t}},methods:{onChange(t){t!==this.page&&(this.d_page=t,this.$emit("page-change",t-1))}},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:MA}};function _U(t,e,n,i,r,s){const o=Bt("JTPInput");return G(),Ct(o,{ref:"jtpInput",modelValue:r.d_page,class:"p-paginator-page-input","aria-label":s.inputArialabel,disabled:n.disabled,"onUpdate:modelValue":s.onChange},null,8,["modelValue","aria-label","disabled","onUpdate:modelValue"])}UA.render=_U;var HA={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:po}};const SU=[ue("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];function TU(t,e,n,i,r,s){const o=_s("ripple");return ei((G(),se("button",{class:Lt(s.containerClass),type:"button"},SU,2)),[[o]])}HA.render=TU;var zA={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:po}};const EU=[ue("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];function xU(t,e,n,i,r,s){const o=_s("ripple");return ei((G(),se("button",{class:Lt(s.containerClass),type:"button"},EU,2)),[[o]])}zA.render=xU;var jA={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(t,e){this.$emit("click",{originalEvent:t,value:e})},ariaPageLabel(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{},directives:{ripple:po}};const CU={class:"p-paginator-pages"},AU=["aria-label","aria-current","onClick"];function kU(t,e,n,i,r,s){const o=_s("ripple");return G(),se("span",CU,[(G(!0),se(xt,null,hn(n.value,u=>ei((G(),se("button",{key:u,class:Lt(["p-paginator-page p-paginator-element p-link",{"p-highlight":u-1===n.page}]),type:"button","aria-label":s.ariaPageLabel(u),"aria-current":u-1===n.page?"page":void 0,onClick:d=>s.onPageLinkClick(d,u)},[Jn(lt(u),1)],10,AU)),[[o]])),128))])}jA.render=kU;var VA={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:po}};const PU=[ue("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];function DU(t,e,n,i,r,s){const o=_s("ripple");return ei((G(),se("button",{class:Lt(s.containerClass),type:"button"},PU,2)),[[o]])}VA.render=DU;var WA={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(t){this.$emit("rows-change",t)}},computed:{rowsOptions(){let t=[];if(this.options)for(let e=0;es.onChange(u)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])}WA.render=IU;var qA={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(t){this.d_first=t},rows(t){this.d_rows=t},totalRecords(t){this.page>0&&t&&this.d_first>=t&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(t){const e=this.pageCount;if(t>=0&&tparseInt(i)-parseInt(r)).forEach(i=>{n[i]=this.template[i]});for(const[i,[r]]of Object.entries(Object.entries(n))){const s=Object.entries(n)[i-1]?`and (min-width:${Object.keys(n)[i-1]})`:"";r==="default"?t+=` @media screen ${s} { .paginator[${this.attributeSelector}], .p-paginator-default{ display: flex !important; } } `:t+=` .paginator[${this.attributeSelector}], .p-paginator-${r} { display: none !important; } @media screen ${s} and (max-width: ${r}) { .paginator[${this.attributeSelector}], .p-paginator-${r} { display: flex !important; } .paginator[${this.attributeSelector}], .p-paginator-default{ display: none !important; } } `}this.styleElement.innerHTML=t}},hasBreakpoints(){return typeof this.template=="object"},getPaginatorClasses(t){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${t}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach(t=>{t.setAttribute(this.attributeSelector,"")})},getAriaLabel(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[t]:void 0}},computed:{templateItems(){let t={};if(this.hasBreakpoints()){t=this.template,t.default||(t.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const e in t)t[e]=this.template[e].split(" ").map(n=>n.trim());return t}return t.default=this.template.split(" ").map(e=>e.trim()),t},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return this.page===0},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const t=this.pageCount,e=Math.min(this.pageLinkSize,t);let n=Math.max(0,Math.ceil(this.page-e/2)),i=Math.min(t-1,n+e-1);const r=this.pageLinkSize-(i-n+1);return n=Math.max(0,n-r),[n,i]},pageLinks(){let t=[],e=this.calculatePageLinkBoundaries,n=e[0],i=e[1];for(var r=n;r<=i;r++)t.push(r+1);return t},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return this.pageCount===0},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector(){return Xs()}},components:{CurrentPageReport:NA,FirstPageLink:FA,LastPageLink:HA,NextPageLink:zA,PageLinks:jA,PrevPageLink:VA,RowsPerPageDropdown:WA,JumpToPageDropdown:BA,JumpToPageInput:UA}};const OU={key:0},RU={key:0,class:"p-paginator-left-content"},LU={key:1,class:"p-paginator-right-content"};function MU(t,e,n,i,r,s){const o=Bt("FirstPageLink"),u=Bt("PrevPageLink"),d=Bt("NextPageLink"),h=Bt("LastPageLink"),g=Bt("PageLinks"),y=Bt("CurrentPageReport"),w=Bt("RowsPerPageDropdown"),C=Bt("JumpToPageDropdown"),D=Bt("JumpToPageInput");return n.alwaysShow||s.pageLinks&&s.pageLinks.length>1?(G(),se("nav",OU,[(G(!0),se(xt,null,hn(s.templateItems,(P,M)=>(G(),se("div",{key:M,ref_for:!0,ref:"paginator",class:Lt(["p-paginator p-component",s.getPaginatorClasses(M)])},[t.$slots.start?(G(),se("div",RU,[En(t.$slots,"start",{state:s.currentState})])):qe("",!0),(G(!0),se(xt,null,hn(P,F=>(G(),se(xt,{key:F},[F==="FirstPageLink"?(G(),Ct(o,{key:0,"aria-label":s.getAriaLabel("firstPageLabel"),onClick:e[0]||(e[0]=K=>s.changePageToFirst(K)),disabled:s.isFirstPage||s.empty},null,8,["aria-label","disabled"])):F==="PrevPageLink"?(G(),Ct(u,{key:1,"aria-label":s.getAriaLabel("prevPageLabel"),onClick:e[1]||(e[1]=K=>s.changePageToPrev(K)),disabled:s.isFirstPage||s.empty},null,8,["aria-label","disabled"])):F==="NextPageLink"?(G(),Ct(d,{key:2,"aria-label":s.getAriaLabel("nextPageLabel"),onClick:e[2]||(e[2]=K=>s.changePageToNext(K)),disabled:s.isLastPage||s.empty},null,8,["aria-label","disabled"])):F==="LastPageLink"?(G(),Ct(h,{key:3,"aria-label":s.getAriaLabel("lastPageLabel"),onClick:e[3]||(e[3]=K=>s.changePageToLast(K)),disabled:s.isLastPage||s.empty},null,8,["aria-label","disabled"])):F==="PageLinks"?(G(),Ct(g,{key:4,"aria-label":s.getAriaLabel("pageLabel"),value:s.pageLinks,page:s.page,onClick:e[4]||(e[4]=K=>s.changePageLink(K))},null,8,["aria-label","value","page"])):F==="CurrentPageReport"?(G(),Ct(y,{key:5,"aria-live":"polite",template:n.currentPageReportTemplate,currentPage:s.currentPage,page:s.page,pageCount:s.pageCount,first:r.d_first,rows:r.d_rows,totalRecords:n.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):F==="RowsPerPageDropdown"&&n.rowsPerPageOptions?(G(),Ct(w,{key:6,"aria-label":s.getAriaLabel("rowsPerPageLabel"),rows:r.d_rows,options:n.rowsPerPageOptions,onRowsChange:e[5]||(e[5]=K=>s.onRowChange(K)),disabled:s.empty},null,8,["aria-label","rows","options","disabled"])):F==="JumpToPageDropdown"?(G(),Ct(C,{key:7,"aria-label":s.getAriaLabel("jumpToPageDropdownLabel"),page:s.page,pageCount:s.pageCount,onPageChange:e[6]||(e[6]=K=>s.changePage(K)),disabled:s.empty},null,8,["aria-label","page","pageCount","disabled"])):F==="JumpToPageInput"?(G(),Ct(D,{key:8,page:s.currentPage,onPageChange:e[7]||(e[7]=K=>s.changePage(K)),disabled:s.empty},null,8,["page","disabled"])):qe("",!0)],64))),128)),t.$slots.end?(G(),se("div",LU,[En(t.$slots,"end",{state:s.currentState})])):qe("",!0)],2))),128))])):qe("",!0)}function NU(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var FU=` .p-paginator-default { display: flex; } .p-paginator { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; } .p-paginator-left-content { margin-right: auto; } .p-paginator-right-content { margin-left: auto; } .p-paginator-page, .p-paginator-next, .p-paginator-last, .p-paginator-first, .p-paginator-prev, .p-paginator-current { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; line-height: 1; user-select: none; overflow: hidden; position: relative; } .p-paginator-element:focus { z-index: 1; position: relative; } `;NU(FU),qA.render=MU;function BU(t,e){const{onFocusIn:n,onFocusOut:i}=e.value||{};t.$_pfocustrap_mutationobserver=new MutationObserver(r=>{r.forEach(s=>{if(s.type==="childList"&&!t.contains(document.activeElement)){const o=u=>{const d=Ne.isFocusableElement(u)?u:Ne.getFirstFocusableElement(u);return Nt.isNotEmpty(d)?d:o(u.nextSibling)};Ne.focus(o(s.nextSibling))}})}),t.$_pfocustrap_mutationobserver.disconnect(),t.$_pfocustrap_mutationobserver.observe(t,{childList:!0}),t.$_pfocustrap_focusinlistener=r=>n&&n(r),t.$_pfocustrap_focusoutlistener=r=>i&&i(r),t.addEventListener("focusin",t.$_pfocustrap_focusinlistener),t.addEventListener("focusout",t.$_pfocustrap_focusoutlistener)}function GA(t){t.$_pfocustrap_mutationobserver&&t.$_pfocustrap_mutationobserver.disconnect(),t.$_pfocustrap_focusinlistener&&t.removeEventListener("focusin",t.$_pfocustrap_focusinlistener)&&(t.$_pfocustrap_focusinlistener=null),t.$_pfocustrap_focusoutlistener&&t.removeEventListener("focusout",t.$_pfocustrap_focusoutlistener)&&(t.$_pfocustrap_focusoutlistener=null)}function UU(t,e){const{autoFocusSelector:n="",firstFocusableSelector:i="",autoFocus:r=!1}=e.value||{};let s=Ne.getFirstFocusableElement(t,`[autofocus]:not(.p-hidden-focusable)${n}`);r&&!s&&(s=Ne.getFirstFocusableElement(t,`:not(.p-hidden-focusable)${i}`)),Ne.focus(s)}function HU(t){const{currentTarget:e,relatedTarget:n}=t,i=n===e.$_pfocustrap_lasthiddenfocusableelement?Ne.getFirstFocusableElement(e.parentElement,`:not(.p-hidden-focusable)${e.$_pfocustrap_focusableselector}`):e.$_pfocustrap_lasthiddenfocusableelement;Ne.focus(i)}function zU(t){const{currentTarget:e,relatedTarget:n}=t,i=n===e.$_pfocustrap_firsthiddenfocusableelement?Ne.getLastFocusableElement(e.parentElement,`:not(.p-hidden-focusable)${e.$_pfocustrap_focusableselector}`):e.$_pfocustrap_firsthiddenfocusableelement;Ne.focus(i)}function jU(t,e){const{tabIndex:n=0,firstFocusableSelector:i="",lastFocusableSelector:r=""}=e.value||{},s=d=>{const h=document.createElement("span");return h.classList="p-hidden-accessible p-hidden-focusable",h.tabIndex=n,h.setAttribute("aria-hidden","true"),h.setAttribute("role","presentation"),h.addEventListener("focus",d),h},o=s(HU),u=s(zU);o.$_pfocustrap_lasthiddenfocusableelement=u,o.$_pfocustrap_focusableselector=i,u.$_pfocustrap_firsthiddenfocusableelement=o,u.$_pfocustrap_focusableselector=r,t.prepend(o),t.append(u)}const KA={mounted(t,e){const{disabled:n}=e.value||{};n||(jU(t,e),BU(t,e),UU(t,e))},updated(t,e){const{disabled:n}=e.value||{};n&&GA(t)},unmounted(t){GA(t)}};var YA={name:"RowCheckbox",emits:["change"],props:{value:null,checked:null},data(){return{focused:!1}},methods:{onClick(t){this.$attrs.disabled||(this.$emit("change",{originalEvent:t,data:this.value}),Ne.focus(this.$refs.input)),t.preventDefault()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeydown(t){switch(t.code){case"Space":{this.onClick(t);break}}}},computed:{checkboxAriaLabel(){return this.$primevue.config.locale.aria?this.checked?this.$primevue.config.locale.aria.selectRow:this.$primevue.config.locale.aria.unselectRow:void 0}}};const VU={class:"p-hidden-accessible"},WU=["checked","disabled","tabindex","aria-label"];function qU(t,e,n,i,r,s){return G(),se("div",{class:Lt(["p-checkbox p-component",{"p-checkbox-focused":r.focused}]),onClick:e[3]||(e[3]=(...o)=>s.onClick&&s.onClick(...o))},[ue("div",VU,[ue("input",{ref:"input",type:"checkbox",checked:n.checked,disabled:t.$attrs.disabled,tabindex:t.$attrs.disabled?null:"0","aria-label":s.checkboxAriaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o)),onKeydown:e[2]||(e[2]=(...o)=>s.onKeydown&&s.onKeydown(...o))},null,40,WU)]),ue("div",{ref:"box",class:Lt(["p-checkbox-box p-component",{"p-highlight":n.checked,"p-disabled":t.$attrs.disabled,"p-focus":r.focused}])},[ue("span",{class:Lt(["p-checkbox-icon",{"pi pi-check":n.checked}])},null,2)],2)],2)}YA.render=qU;var XA={name:"RowRadioButton",inheritAttrs:!1,emits:["change"],props:{value:null,checked:null,name:null},data(){return{focused:!1}},methods:{onClick(t){this.disabled||this.checked||(this.$emit("change",{originalEvent:t,data:this.value}),Ne.focus(this.$refs.input))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}}};const GU={class:"p-hidden-accessible"},KU=["checked","disabled","name"],YU=[ue("div",{class:"p-radiobutton-icon"},null,-1)];function XU(t,e,n,i,r,s){return G(),se("div",{class:Lt(["p-radiobutton p-component",{"p-radiobutton-focused":r.focused}]),onClick:e[3]||(e[3]=(...o)=>s.onClick&&s.onClick(...o))},[ue("div",GU,[ue("input",{ref:"input",type:"radio",checked:n.checked,disabled:t.$attrs.disabled,name:n.name,tabindex:"0",onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o)),onKeydown:e[2]||(e[2]=Ji($f((...o)=>s.onClick&&s.onClick(...o),["prevent"]),["space"]))},null,40,KU)]),ue("div",{ref:"box",class:Lt(["p-radiobutton-box p-component",{"p-highlight":n.checked,"p-disabled":t.$attrs.disabled,"p-focus":r.focused}])},YU,2)],2)}XA.render=XU;var ZA={name:"BodyCell",emits:["cell-edit-init","cell-edit-complete","cell-edit-cancel","row-edit-init","row-edit-save","row-edit-cancel","row-toggle","radio-change","checkbox-change","editing-meta-change"],props:{rowData:{type:Object,default:null},column:{type:Object,default:null},frozenRow:{type:Boolean,default:!1},rowIndex:{type:Number,default:null},index:{type:Number,default:null},rowTogglerIcon:{type:Array,default:null},selected:{type:Boolean,default:!1},editing:{type:Boolean,default:!1},editingMeta:{type:Object,default:null},editMode:{type:String,default:null},responsiveLayout:{type:String,default:"stack"},virtualScrollerContentProps:{type:Object,default:null},ariaControls:{type:String,default:null},name:{type:String,default:null}},documentEditListener:null,selfClick:!1,overlayEventListener:null,data(){return{d_editing:this.editing,styleObject:{},isRowExpanded:!1}},watch:{editing(t){this.d_editing=t},"$data.d_editing":function(t){this.$emit("editing-meta-change",{data:this.rowData,field:this.field||`field_${this.index}`,index:this.rowIndex,editing:t})}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition(),this.d_editing&&(this.editMode==="cell"||this.editMode==="row"&&this.columnProp("rowEditor"))&&setTimeout(()=>{const t=Ne.getFirstFocusableElement(this.$el);t&&t.focus()},1)},beforeUnmount(){this.overlayEventListener&&(ic.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null)},methods:{columnProp(t){return Nt.getVNodeProp(this.column,t)},resolveFieldData(){return Nt.resolveFieldData(this.rowData,this.field)},toggleRow(t){this.isRowExpanded=!this.isRowExpanded,this.$emit("row-toggle",{originalEvent:t,data:this.rowData})},toggleRowWithRadio(t,e){this.$emit("radio-change",{originalEvent:t.originalEvent,index:e,data:t.data})},toggleRowWithCheckbox(t,e){this.$emit("checkbox-change",{originalEvent:t.originalEvent,index:e,data:t.data})},isEditable(){return this.column.children&&this.column.children.editor!=null},bindDocumentEditListener(){this.documentEditListener||(this.documentEditListener=t=>{this.selfClick||this.completeEdit(t,"outside"),this.selfClick=!1},document.addEventListener("click",this.documentEditListener))},unbindDocumentEditListener(){this.documentEditListener&&(document.removeEventListener("click",this.documentEditListener),this.documentEditListener=null,this.selfClick=!1)},switchCellToViewMode(){this.d_editing=!1,this.unbindDocumentEditListener(),ic.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null},onClick(t){this.editMode==="cell"&&this.isEditable()&&(this.selfClick=!0,this.d_editing||(this.d_editing=!0,this.bindDocumentEditListener(),this.$emit("cell-edit-init",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex}),this.overlayEventListener=e=>{this.$el&&this.$el.contains(e.target)&&(this.selfClick=!0)},ic.on("overlay-click",this.overlayEventListener)))},completeEdit(t,e){const n={originalEvent:t,data:this.rowData,newData:this.editingRowData,value:this.rowData[this.field],newValue:this.editingRowData[this.field],field:this.field,index:this.rowIndex,type:e,defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0}};this.$emit("cell-edit-complete",n),n.defaultPrevented||this.switchCellToViewMode()},onKeyDown(t){if(this.editMode==="cell")switch(t.code){case"Enter":this.completeEdit(t,"enter");break;case"Escape":this.switchCellToViewMode(),this.$emit("cell-edit-cancel",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex});break;case"Tab":this.completeEdit(t,"tab"),t.shiftKey?this.moveToPreviousCell(t):this.moveToNextCell(t);break}},moveToPreviousCell(t){let e=this.findCell(t.target),n=this.findPreviousEditableColumn(e);n&&(Ne.invokeElementMethod(n,"click"),t.preventDefault())},moveToNextCell(t){let e=this.findCell(t.target),n=this.findNextEditableColumn(e);n&&(Ne.invokeElementMethod(n,"click"),t.preventDefault())},findCell(t){if(t){let e=t;for(;e&&!Ne.hasClass(e,"p-cell-editing");)e=e.parentElement;return e}else return null},findPreviousEditableColumn(t){let e=t.previousElementSibling;if(!e){let n=t.parentElement.previousElementSibling;n&&(e=n.lastElementChild)}return e?Ne.hasClass(e,"p-editable-column")?e:this.findPreviousEditableColumn(e):null},findNextEditableColumn(t){let e=t.nextElementSibling;if(!e){let n=t.parentElement.nextElementSibling;n&&(e=n.firstElementChild)}return e?Ne.hasClass(e,"p-editable-column")?e:this.findNextEditableColumn(e):null},isEditingCellValid(){return Ne.find(this.$el,".p-invalid").length===0},onRowEditInit(t){this.$emit("row-edit-init",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},onRowEditSave(t){this.$emit("row-edit-save",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},onRowEditCancel(t){this.$emit("row-edit-cancel",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},editorInitCallback(t){this.$emit("row-edit-init",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},editorSaveCallback(t){this.editMode==="row"?this.$emit("row-edit-save",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex}):this.completeEdit(t,"enter")},editorCancelCallback(t){this.editMode==="row"?this.$emit("row-edit-cancel",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex}):(this.switchCellToViewMode(),this.$emit("cell-edit-cancel",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex}))},updateStickyPosition(){if(this.columnProp("frozen"))if(this.columnProp("alignFrozen")==="right"){let e=0,n=this.$el.nextElementSibling;n&&(e=Ne.getOuterWidth(n)+parseFloat(n.style.right||0)),this.styleObject.right=e+"px"}else{let e=0,n=this.$el.previousElementSibling;n&&(e=Ne.getOuterWidth(n)+parseFloat(n.style.left||0)),this.styleObject.left=e+"px"}},getVirtualScrollerProp(t){return this.virtualScrollerContentProps?this.virtualScrollerContentProps[t]:null}},computed:{editingRowData(){return this.editingMeta[this.rowIndex]?this.editingMeta[this.rowIndex].data:this.rowData},field(){return this.columnProp("field")},containerClass(){return[this.columnProp("bodyClass"),this.columnProp("class"),{"p-selection-column":this.columnProp("selectionMode")!=null,"p-editable-column":this.isEditable(),"p-cell-editing":this.d_editing,"p-frozen-column":this.columnProp("frozen")}]},containerStyle(){let t=this.columnProp("bodyStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]},loading(){return this.getVirtualScrollerProp("loading")},loadingOptions(){const t=this.getVirtualScrollerProp("getLoaderOptions");return t&&t(this.rowIndex,{cellIndex:this.index,cellFirst:this.index===0,cellLast:this.index===this.getVirtualScrollerProp("columns").length-1,cellEven:this.index%2===0,cellOdd:this.index%2!==0,column:this.column,field:this.field})},expandButtonAriaLabel(){return this.$primevue.config.locale.aria?this.isRowExpanded?this.$primevue.config.locale.aria.expandRow:this.$primevue.config.locale.aria.collapseRow:void 0},initButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.editRow:void 0},saveButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.saveEdit:void 0},cancelButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.cancelEdit:void 0}},components:{DTRadioButton:XA,DTCheckbox:YA},directives:{ripple:po}};const ZU={key:0,class:"p-column-title"},QU=["aria-expanded","aria-controls","aria-label"],JU=["aria-label"],$U=[ue("span",{class:"p-row-editor-init-icon pi pi-fw pi-pencil"},null,-1)],eH=["aria-label"],tH=[ue("span",{class:"p-row-editor-save-icon pi pi-fw pi-check"},null,-1)],nH=["aria-label"],iH=[ue("span",{class:"p-row-editor-cancel-icon pi pi-fw pi-times"},null,-1)];function rH(t,e,n,i,r,s){const o=Bt("DTRadioButton"),u=Bt("DTCheckbox"),d=_s("ripple");return s.loading?(G(),se("td",{key:0,style:hi(s.containerStyle),class:Lt(s.containerClass)},[(G(),Ct(us(n.column.children.loading),{data:n.rowData,column:n.column,field:s.field,index:n.rowIndex,frozenRow:n.frozenRow,loadingOptions:s.loadingOptions},null,8,["data","column","field","index","frozenRow","loadingOptions"]))],6)):(G(),se("td",{key:1,style:hi(s.containerStyle),class:Lt(s.containerClass),onClick:e[6]||(e[6]=(...h)=>s.onClick&&s.onClick(...h)),onKeydown:e[7]||(e[7]=(...h)=>s.onKeyDown&&s.onKeyDown(...h)),role:"cell"},[n.responsiveLayout==="stack"?(G(),se("span",ZU,lt(s.columnProp("header")),1)):qe("",!0),n.column.children&&n.column.children.body&&!r.d_editing?(G(),Ct(us(n.column.children.body),{key:1,data:n.rowData,column:n.column,field:s.field,index:n.rowIndex,frozenRow:n.frozenRow,editorInitCallback:s.editorInitCallback},null,8,["data","column","field","index","frozenRow","editorInitCallback"])):n.column.children&&n.column.children.editor&&r.d_editing?(G(),Ct(us(n.column.children.editor),{key:2,data:s.editingRowData,column:n.column,field:s.field,index:n.rowIndex,frozenRow:n.frozenRow,editorSaveCallback:s.editorSaveCallback,editorCancelCallback:s.editorCancelCallback},null,8,["data","column","field","index","frozenRow","editorSaveCallback","editorCancelCallback"])):n.column.children&&n.column.children.body&&!n.column.children.editor&&r.d_editing?(G(),Ct(us(n.column.children.body),{key:3,data:s.editingRowData,column:n.column,field:s.field,index:n.rowIndex,frozenRow:n.frozenRow},null,8,["data","column","field","index","frozenRow"])):s.columnProp("selectionMode")?(G(),se(xt,{key:4},[s.columnProp("selectionMode")==="single"?(G(),Ct(o,{key:0,value:n.rowData,name:n.name,checked:n.selected,onChange:e[0]||(e[0]=h=>s.toggleRowWithRadio(h,n.rowIndex))},null,8,["value","name","checked"])):s.columnProp("selectionMode")==="multiple"?(G(),Ct(u,{key:1,value:n.rowData,checked:n.selected,"aria-selected":n.selected?!0:void 0,onChange:e[1]||(e[1]=h=>s.toggleRowWithCheckbox(h,n.rowIndex))},null,8,["value","checked","aria-selected"])):qe("",!0)],64)):s.columnProp("rowReorder")?(G(),se("i",{key:5,class:Lt(["p-datatable-reorderablerow-handle",s.columnProp("rowReorderIcon")||"pi pi-bars"])},null,2)):s.columnProp("expander")?ei((G(),se("button",{key:6,class:"p-row-toggler p-link",type:"button","aria-expanded":r.isRowExpanded,"aria-controls":n.ariaControls,"aria-label":s.expandButtonAriaLabel,onClick:e[2]||(e[2]=(...h)=>s.toggleRow&&s.toggleRow(...h))},[ue("span",{class:Lt(n.rowTogglerIcon)},null,2)],8,QU)),[[d]]):n.editMode==="row"&&s.columnProp("rowEditor")?(G(),se(xt,{key:7},[r.d_editing?qe("",!0):ei((G(),se("button",{key:0,class:"p-row-editor-init p-link",type:"button","aria-label":s.initButtonAriaLabel,onClick:e[3]||(e[3]=(...h)=>s.onRowEditInit&&s.onRowEditInit(...h))},$U,8,JU)),[[d]]),r.d_editing?ei((G(),se("button",{key:1,class:"p-row-editor-save p-link",type:"button","aria-label":s.saveButtonAriaLabel,onClick:e[4]||(e[4]=(...h)=>s.onRowEditSave&&s.onRowEditSave(...h))},tH,8,eH)),[[d]]):qe("",!0),r.d_editing?ei((G(),se("button",{key:2,class:"p-row-editor-cancel p-link",type:"button","aria-label":s.cancelButtonAriaLabel,onClick:e[5]||(e[5]=(...h)=>s.onRowEditCancel&&s.onRowEditCancel(...h))},iH,8,nH)),[[d]]):qe("",!0)],64)):(G(),se(xt,{key:8},[Jn(lt(s.resolveFieldData()),1)],64))],38))}ZA.render=rH;var QA={name:"TableBody",emits:["rowgroup-toggle","row-click","row-dblclick","row-rightclick","row-touchend","row-keydown","row-mousedown","row-dragstart","row-dragover","row-dragleave","row-dragend","row-drop","row-toggle","radio-change","checkbox-change","cell-edit-init","cell-edit-complete","cell-edit-cancel","row-edit-init","row-edit-save","row-edit-cancel","editing-meta-change"],props:{value:{type:Array,default:null},columns:{type:null,default:null},frozenRow:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},expandableRowGroups:{type:Boolean,default:!1},expandedRowGroups:{type:Array,default:null},first:{type:Number,default:0},dataKey:{type:String,default:null},expandedRowIcon:{type:String,default:null},collapsedRowIcon:{type:String,default:null},expandedRows:{type:Array,default:null},expandedRowKeys:{type:null,default:null},selection:{type:[Array,Object],default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},contextMenu:{type:Boolean,default:!1},contextMenuSelection:{type:Object,default:null},rowClass:{type:null,default:null},rowStyle:{type:null,default:null},editMode:{type:String,default:null},compareSelectionBy:{type:String,default:"deepEquals"},editingRows:{type:Array,default:null},editingRowKeys:{type:null,default:null},editingMeta:{type:Object,default:null},templates:{type:null,default:null},scrollable:{type:Boolean,default:!1},responsiveLayout:{type:String,default:"stack"},virtualScrollerContentProps:{type:Object,default:null},isVirtualScrollerDisabled:{type:Boolean,default:!1}},data(){return{rowGroupHeaderStyleObject:{},tabindexArray:[],isARowSelected:!1}},mounted(){this.frozenRow&&this.updateFrozenRowStickyPosition(),this.scrollable&&this.rowGroupMode==="subheader"&&this.updateFrozenRowGroupHeaderStickyPosition()},updated(){this.frozenRow&&this.updateFrozenRowStickyPosition(),this.scrollable&&this.rowGroupMode==="subheader"&&this.updateFrozenRowGroupHeaderStickyPosition()},methods:{columnProp(t,e){return Nt.getVNodeProp(t,e)},shouldRenderRowGroupHeader(t,e,n){let i=Nt.resolveFieldData(e,this.groupRowsBy),r=t[n-1];if(r){let s=Nt.resolveFieldData(r,this.groupRowsBy);return i!==s}else return!0},getRowKey(t,e){return this.dataKey?Nt.resolveFieldData(t,this.dataKey):this.getRowIndex(e)},getRowIndex(t){const e=this.getVirtualScrollerProp("getItemOptions");return e?e(t).index:this.first+t},getRowStyle(t){if(this.rowStyle)return this.rowStyle(t)},getRowClass(t){let e=[];if(this.selectionMode&&e.push("p-selectable-row"),this.selection&&e.push({"p-highlight":this.isSelected(t)}),this.contextMenuSelection&&e.push({"p-highlight-contextmenu":this.isSelectedWithContextMenu(t)}),this.rowClass){let n=this.rowClass(t);n&&e.push(n)}return e},shouldRenderRowGroupFooter(t,e,n){if(this.expandableRowGroups&&!this.isRowGroupExpanded(e))return!1;{let i=Nt.resolveFieldData(e,this.groupRowsBy),r=t[n+1];if(r){let s=Nt.resolveFieldData(r,this.groupRowsBy);return i!==s}else return!0}},shouldRenderBodyCell(t,e,n){if(this.rowGroupMode){if(this.rowGroupMode==="subheader")return this.groupRowsBy!==this.columnProp(e,"field");if(this.rowGroupMode==="rowspan")if(this.isGrouped(e)){let i=t[n-1];if(i){let r=Nt.resolveFieldData(t[n],this.columnProp(e,"field")),s=Nt.resolveFieldData(i,this.columnProp(e,"field"));return r!==s}else return!0}else return!0}else return!this.columnProp(e,"hidden")},calculateRowGroupSize(t,e,n){if(this.isGrouped(e)){let i=Nt.resolveFieldData(t[n],this.columnProp(e,"field")),r=i,s=0;for(;i===r;){s++;let o=t[++n];if(o)r=Nt.resolveFieldData(o,this.columnProp(e,"field"));else break}return s===1?null:s}else return null},rowTogglerIcon(t){return["p-row-toggler-icon pi",this.isRowExpanded(t)?this.expandedRowIcon:this.collapsedRowIcon]},rowGroupTogglerIcon(t){return["p-row-toggler-icon pi",this.isRowGroupExpanded(t)?this.expandedRowIcon:this.collapsedRowIcon]},isGrouped(t){return this.groupRowsBy&&this.columnProp(t,"field")?Array.isArray(this.groupRowsBy)?this.groupRowsBy.indexOf(t.props.field)>-1:this.groupRowsBy===t.props.field:!1},isRowEditing(t){return t&&this.editingRows?this.dataKey?this.editingRowKeys?this.editingRowKeys[Nt.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.findIndex(t,this.editingRows)>-1:!1},isRowExpanded(t){return t&&this.expandedRows?this.dataKey?this.expandedRowKeys?this.expandedRowKeys[Nt.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.findIndex(t,this.expandedRows)>-1:!1},isRowGroupExpanded(t){if(this.expandableRowGroups&&this.expandedRowGroups){let e=Nt.resolveFieldData(t,this.groupRowsBy);return this.expandedRowGroups.indexOf(e)>-1}return!1},isSelected(t){return t&&this.selection?this.dataKey?this.selectionKeys?this.selectionKeys[Nt.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.selection instanceof Array?this.findIndexInSelection(t)>-1:this.equals(t,this.selection):!1},isSelectedWithContextMenu(t){return t&&this.contextMenuSelection?this.equals(t,this.contextMenuSelection,this.dataKey):!1},findIndexInSelection(t){return this.findIndex(t,this.selection)},findIndex(t,e){let n=-1;if(e&&e.length){for(let i=0;i{this.columnProp(e,"selectionMode")==="single"&&t--,this.columnProp(e,"hidden")&&t++}),this.columns?this.columns.length-t:0},rowGroupHeaderStyle(){return this.scrollable?{top:this.rowGroupHeaderStyleObject.top}:null},bodyStyle(){return this.getVirtualScrollerProp("contentStyle")},expandedRowId(){return Xs()},nameAttributeSelector(){return Xs()}},components:{DTBodyCell:ZA}};const sH=["colspan"],oH=["onClick"],aH=["tabindex","aria-selected","onClick","onDblclick","onContextmenu","onKeydown","onDragstart","onDragover"],lH=["id"],uH=["colspan"],cH=["colspan"],dH={key:1,class:"p-datatable-emptymessage",role:"row"},hH=["colspan"];function pH(t,e,n,i,r,s){const o=Bt("DTBodyCell");return G(),se("tbody",{ref:s.bodyRef,class:"p-datatable-tbody",role:"rowgroup",style:hi(s.bodyStyle)},[n.empty?(G(),se("tr",dH,[ue("td",{colspan:s.columnsLength},[n.templates.empty?(G(),Ct(us(n.templates.empty),{key:0})):qe("",!0)],8,hH)])):(G(!0),se(xt,{key:0},hn(n.value,(u,d)=>(G(),se(xt,null,[n.templates.groupheader&&n.rowGroupMode==="subheader"&&s.shouldRenderRowGroupHeader(n.value,u,s.getRowIndex(d))?(G(),se("tr",{key:s.getRowKey(u,s.getRowIndex(d))+"_subheader",class:"p-rowgroup-header",style:hi(s.rowGroupHeaderStyle),role:"row"},[ue("td",{colspan:s.columnsLength-1},[n.expandableRowGroups?(G(),se("button",{key:0,class:"p-row-toggler p-link",onClick:h=>s.onRowGroupToggle(h,u),type:"button"},[ue("span",{class:Lt(s.rowGroupTogglerIcon(u))},null,2)],8,oH)):qe("",!0),(G(),Ct(us(n.templates.groupheader),{data:u,index:s.getRowIndex(d)},null,8,["data","index"]))],8,sH)],4)):qe("",!0),!n.expandableRowGroups||s.isRowGroupExpanded(u)?(G(),se("tr",{key:s.getRowKey(u,s.getRowIndex(d)),class:Lt(s.getRowClass(u)),style:hi(s.getRowStyle(u)),tabindex:s.setRowTabindex(d),role:"row","aria-selected":n.selectionMode?s.isSelected(u):null,onClick:h=>s.onRowClick(h,u,s.getRowIndex(d)),onDblclick:h=>s.onRowDblClick(h,u,s.getRowIndex(d)),onContextmenu:h=>s.onRowRightClick(h,u,s.getRowIndex(d)),onTouchend:e[9]||(e[9]=h=>s.onRowTouchEnd(h)),onKeydown:h=>s.onRowKeyDown(h,u,s.getRowIndex(d)),onMousedown:e[10]||(e[10]=h=>s.onRowMouseDown(h)),onDragstart:h=>s.onRowDragStart(h,s.getRowIndex(d)),onDragover:h=>s.onRowDragOver(h,s.getRowIndex(d)),onDragleave:e[11]||(e[11]=h=>s.onRowDragLeave(h)),onDragend:e[12]||(e[12]=h=>s.onRowDragEnd(h)),onDrop:e[13]||(e[13]=h=>s.onRowDrop(h))},[(G(!0),se(xt,null,hn(n.columns,(h,g)=>(G(),se(xt,null,[s.shouldRenderBodyCell(n.value,h,s.getRowIndex(d))?(G(),Ct(o,{key:s.columnProp(h,"columnKey")||s.columnProp(h,"field")||g,rowData:u,column:h,rowIndex:s.getRowIndex(d),index:g,selected:s.isSelected(u),rowTogglerIcon:s.columnProp(h,"expander")?s.rowTogglerIcon(u):null,frozenRow:n.frozenRow,rowspan:n.rowGroupMode==="rowspan"?s.calculateRowGroupSize(n.value,h,s.getRowIndex(d)):null,editMode:n.editMode,editing:n.editMode==="row"&&s.isRowEditing(u),editingMeta:n.editingMeta,responsiveLayout:n.responsiveLayout,virtualScrollerContentProps:n.virtualScrollerContentProps,ariaControls:s.expandedRowId+"_"+d+"_expansion",name:s.nameAttributeSelector,onRadioChange:e[0]||(e[0]=y=>s.onRadioChange(y)),onCheckboxChange:e[1]||(e[1]=y=>s.onCheckboxChange(y)),onRowToggle:e[2]||(e[2]=y=>s.onRowToggle(y)),onCellEditInit:e[3]||(e[3]=y=>s.onCellEditInit(y)),onCellEditComplete:e[4]||(e[4]=y=>s.onCellEditComplete(y)),onCellEditCancel:e[5]||(e[5]=y=>s.onCellEditCancel(y)),onRowEditInit:e[6]||(e[6]=y=>s.onRowEditInit(y)),onRowEditSave:e[7]||(e[7]=y=>s.onRowEditSave(y)),onRowEditCancel:e[8]||(e[8]=y=>s.onRowEditCancel(y)),onEditingMetaChange:s.onEditingMetaChange},null,8,["rowData","column","rowIndex","index","selected","rowTogglerIcon","frozenRow","rowspan","editMode","editing","editingMeta","responsiveLayout","virtualScrollerContentProps","ariaControls","name","onEditingMetaChange"])):qe("",!0)],64))),256))],46,aH)):qe("",!0),n.templates.expansion&&n.expandedRows&&s.isRowExpanded(u)?(G(),se("tr",{key:s.getRowKey(u,s.getRowIndex(d))+"_expansion",id:s.expandedRowId+"_"+d+"_expansion",class:"p-datatable-row-expansion",role:"row"},[ue("td",{colspan:s.columnsLength},[(G(),Ct(us(n.templates.expansion),{data:u,index:s.getRowIndex(d)},null,8,["data","index"]))],8,uH)],8,lH)):qe("",!0),n.templates.groupfooter&&n.rowGroupMode==="subheader"&&s.shouldRenderRowGroupFooter(n.value,u,s.getRowIndex(d))?(G(),se("tr",{key:s.getRowKey(u,s.getRowIndex(d))+"_subfooter",class:"p-rowgroup-footer",role:"row"},[ue("td",{colspan:s.columnsLength-1},[(G(),Ct(us(n.templates.groupfooter),{data:u,index:s.getRowIndex(d)},null,8,["data","index"]))],8,cH)])):qe("",!0)],64))),256))],4)}QA.render=pH;var JA={name:"FooterCell",props:{column:{type:null,default:null}},data(){return{styleObject:{}}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition()},methods:{columnProp(t){return Nt.getVNodeProp(this.column,t)},updateStickyPosition(){if(this.columnProp("frozen"))if(this.columnProp("alignFrozen")==="right"){let e=0,n=this.$el.nextElementSibling;n&&(e=Ne.getOuterWidth(n)+parseFloat(n.style.right||0)),this.styleObject.right=e+"px"}else{let e=0,n=this.$el.previousElementSibling;n&&(e=Ne.getOuterWidth(n)+parseFloat(n.style.left||0)),this.styleObject.left=e+"px"}}},computed:{containerClass(){return[this.columnProp("footerClass"),this.columnProp("class"),{"p-frozen-column":this.columnProp("frozen")}]},containerStyle(){let t=this.columnProp("footerStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]}}};const fH=["colspan","rowspan"];function mH(t,e,n,i,r,s){return G(),se("td",{style:hi(s.containerStyle),class:Lt(s.containerClass),role:"cell",colspan:s.columnProp("colspan"),rowspan:s.columnProp("rowspan")},[n.column.children&&n.column.children.footer?(G(),Ct(us(n.column.children.footer),{key:0,column:n.column},null,8,["column"])):qe("",!0),Jn(" "+lt(s.columnProp("footer")),1)],14,fH)}JA.render=mH;var $A={name:"TableFooter",props:{columnGroup:{type:null,default:null},columns:{type:null,default:null}},methods:{columnProp(t,e){return Nt.getVNodeProp(t,e)},getFooterRows(){let t=[],e=this.columnGroup;if(e.children&&e.children.default){for(let n of e.children.default())n.type.name==="Row"?t.push(n):n.children&&n.children instanceof Array&&(t=n.children);return t}},getFooterColumns(t){let e=[];if(t.children&&t.children.default)return t.children.default().forEach(n=>{n.children&&n.children instanceof Array?e=[...e,...n.children]:n.type.name==="Column"&&e.push(n)}),e}},computed:{hasFooter(){let t=!1;if(this.columnGroup)t=!0;else if(this.columns){for(let e of this.columns)if(this.columnProp(e,"footer")||e.children&&e.children.footer){t=!0;break}}return t}},components:{DTFooterCell:JA}};const gH={key:0,class:"p-datatable-tfoot",role:"rowgroup"},yH={key:0,role:"row"};function vH(t,e,n,i,r,s){const o=Bt("DTFooterCell");return s.hasFooter?(G(),se("tfoot",gH,[n.columnGroup?(G(!0),se(xt,{key:1},hn(s.getFooterRows(),(u,d)=>(G(),se("tr",{key:d,role:"row"},[(G(!0),se(xt,null,hn(s.getFooterColumns(u),(h,g)=>(G(),se(xt,{key:s.columnProp(h,"columnKey")||s.columnProp(h,"field")||g},[s.columnProp(h,"hidden")?qe("",!0):(G(),Ct(o,{key:0,column:h},null,8,["column"]))],64))),128))]))),128)):(G(),se("tr",yH,[(G(!0),se(xt,null,hn(n.columns,(u,d)=>(G(),se(xt,{key:s.columnProp(u,"columnKey")||s.columnProp(u,"field")||d},[s.columnProp(u,"hidden")?qe("",!0):(G(),Ct(o,{key:0,column:u},null,8,["column"]))],64))),128))]))])):qe("",!0)}$A.render=vH;var zw={name:"ColumnFilter",emits:["filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{field:{type:String,default:null},type:{type:String,default:"text"},display:{type:String,default:null},showMenu:{type:Boolean,default:!0},matchMode:{type:String,default:null},showOperator:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showApplyButton:{type:Boolean,default:!0},showMatchModes:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},matchModeOptions:{type:Array,default:null},maxConstraints:{type:Number,default:2},filterElement:null,filterHeaderTemplate:null,filterFooterTemplate:null,filterClearTemplate:null,filterApplyTemplate:null,filters:{type:Object,default:null},filtersStore:{type:Object,default:null},filterMenuClass:{type:String,default:null},filterMenuStyle:{type:null,default:null},filterInputProps:{type:null,default:null}},data(){return{overlayVisible:!1,defaultMatchMode:null,defaultOperator:null}},overlay:null,selfClick:!1,overlayEventListener:null,beforeUnmount(){this.overlayEventListener&&(ic.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),this.overlay&&(Lo.clear(this.overlay),this.onOverlayHide())},mounted(){if(this.filters&&this.filters[this.field]){let t=this.filters[this.field];t.operator?(this.defaultMatchMode=t.constraints[0].matchMode,this.defaultOperator=t.operator):this.defaultMatchMode=this.filters[this.field].matchMode}},methods:{clearFilter(){let t={...this.filters};t[this.field].operator?(t[this.field].constraints.splice(1),t[this.field].operator=this.defaultOperator,t[this.field].constraints[0]={value:null,matchMode:this.defaultMatchMode}):(t[this.field].value=null,t[this.field].matchMode=this.defaultMatchMode),this.$emit("filter-clear"),this.$emit("filter-change",t),this.$emit("filter-apply"),this.hide()},applyFilter(){this.$emit("apply-click",{field:this.field,constraints:this.filters[this.field]}),this.$emit("filter-apply"),this.hide()},hasFilter(){if(this.filtersStore){let t=this.filtersStore[this.field];if(t)return t.operator?!this.isFilterBlank(t.constraints[0].value):!this.isFilterBlank(t.value)}return!1},hasRowFilter(){return this.filters[this.field]&&!this.isFilterBlank(this.filters[this.field].value)},isFilterBlank(t){return t!=null?typeof t=="string"&&t.trim().length==0||t instanceof Array&&t.length==0:!0},toggleMenu(){this.overlayVisible=!this.overlayVisible},onToggleButtonKeyDown(t){switch(t.code){case"Enter":case"Space":this.toggleMenu(),t.preventDefault();break;case"Escape":this.overlayVisible=!1;break}},onRowMatchModeChange(t){let e={...this.filters};e[this.field].matchMode=t,this.$emit("matchmode-change",{field:this.field,matchMode:t}),this.$emit("filter-change",e),this.$emit("filter-apply"),this.hide()},onRowMatchModeKeyDown(t){let e=t.target;switch(t.code){case"ArrowDown":var n=this.findNextItem(e);n&&(e.removeAttribute("tabindex"),n.tabIndex="0",n.focus()),t.preventDefault();break;case"ArrowUp":var i=this.findPrevItem(e);i&&(e.removeAttribute("tabindex"),i.tabIndex="0",i.focus()),t.preventDefault();break}},isRowMatchModeSelected(t){return this.filters[this.field].matchMode===t},onOperatorChange(t){let e={...this.filters};e[this.field].operator=t,this.$emit("filter-change",e),this.$emit("operator-change",{field:this.field,operator:t}),this.showApplyButton||this.$emit("filter-apply")},onMenuMatchModeChange(t,e){let n={...this.filters};n[this.field].constraints[e].matchMode=t,this.$emit("matchmode-change",{field:this.field,matchMode:t,index:e}),this.showApplyButton||this.$emit("filter-apply")},addConstraint(){let t={...this.filters},e={value:null,matchMode:this.defaultMatchMode};t[this.field].constraints.push(e),this.$emit("constraint-add",{field:this.field,constraing:e}),this.$emit("filter-change",t),this.showApplyButton||this.$emit("filter-apply")},removeConstraint(t){let e={...this.filters},n=e[this.field].constraints.splice(t,1);this.$emit("constraint-remove",{field:this.field,constraing:n}),this.$emit("filter-change",e),this.showApplyButton||this.$emit("filter-apply")},filterCallback(){this.$emit("filter-apply")},findNextItem(t){let e=t.nextElementSibling;return e?Ne.hasClass(e,"p-column-filter-separator")?this.findNextItem(e):e:t.parentElement.firstElementChild},findPrevItem(t){let e=t.previousElementSibling;return e?Ne.hasClass(e,"p-column-filter-separator")?this.findPrevItem(e):e:t.parentElement.lastElementChild},hide(){this.overlayVisible=!1,Ne.focus(this.$refs.icon)},onContentClick(t){this.selfClick=!0,ic.emit("overlay-click",{originalEvent:t,target:this.overlay})},onContentMouseDown(){this.selfClick=!0},onOverlayEnter(t){this.filterMenuStyle&&Ne.applyStyle(this.overlay,this.filterMenuStyle),Lo.set("overlay",t,this.$primevue.config.zIndex.overlay),Ne.absolutePosition(this.overlay,this.$refs.icon),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.overlayEventListener=e=>{this.isOutsideClicked(e.target)||(this.selfClick=!0)},ic.on("overlay-click",this.overlayEventListener)},onOverlayLeave(){this.onOverlayHide()},onOverlayAfterLeave(t){Lo.clear(t)},onOverlayHide(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.overlay=null,ic.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null},overlayRef(t){this.overlay=t},isOutsideClicked(t){return!this.isTargetClicked(t)&&this.overlay&&!(this.overlay.isSameNode(t)||this.overlay.contains(t))},isTargetClicked(t){return this.$refs.icon&&(this.$refs.icon.isSameNode(t)||this.$refs.icon.contains(t))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=t=>{this.overlayVisible&&!this.selfClick&&this.isOutsideClicked(t.target)&&(this.overlayVisible=!1),this.selfClick=!1},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null,this.selfClick=!1)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new Ay(this.$refs.icon,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!Ne.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},computed:{containerClass(){return["p-column-filter p-fluid",{"p-column-filter-row":this.display==="row","p-column-filter-menu":this.display==="menu"}]},overlayClass(){return[this.filterMenuClass,{"p-column-filter-overlay p-component p-fluid":!0,"p-column-filter-overlay-menu":this.display==="menu","p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},showMenuButton(){return this.showMenu&&(this.display==="row"?this.type!=="boolean":!0)},overlayId(){return Xs()},matchModes(){return this.matchModeOptions||this.$primevue.config.filterMatchModeOptions[this.type].map(t=>({label:this.$primevue.config.locale[t],value:t}))},isShowMatchModes(){return this.type!=="boolean"&&this.showMatchModes&&this.matchModes},operatorOptions(){return[{label:this.$primevue.config.locale.matchAll,value:ky.AND},{label:this.$primevue.config.locale.matchAny,value:ky.OR}]},noFilterLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.noFilter:void 0},isShowOperator(){return this.showOperator&&this.filters[this.field].operator},operator(){return this.filters[this.field].operator},fieldConstraints(){return this.filters[this.field].constraints||[this.filters[this.field]]},showRemoveIcon(){return this.fieldConstraints.length>1},removeRuleButtonLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.removeRule:void 0},addRuleButtonLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.addRule:void 0},isShowAddConstraint(){return this.showAddButton&&this.filters[this.field].operator&&this.fieldConstraints&&this.fieldConstraints.lengths.toggleMenu()),onKeydown:e[1]||(e[1]=g=>s.onToggleButtonKeyDown(g))},wH,42,bH)):qe("",!0),n.showClearButton&&n.display==="row"?(G(),se("button",{key:2,class:Lt([{"p-hidden-space":!s.hasRowFilter()},"p-column-filter-clear-button p-link"]),type:"button",onClick:e[2]||(e[2]=g=>s.clearFilter())},_H,2)):qe("",!0),gt(d,null,{default:jt(()=>[gt(lu,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:jt(()=>[r.overlayVisible?ei((G(),se("div",{key:0,ref:s.overlayRef,id:s.overlayId,"aria-modal":r.overlayVisible,role:"dialog",class:Lt(s.overlayClass),onKeydown:e[10]||(e[10]=Ji((...g)=>s.hide&&s.hide(...g),["escape"])),onClick:e[11]||(e[11]=(...g)=>s.onContentClick&&s.onContentClick(...g)),onMousedown:e[12]||(e[12]=(...g)=>s.onContentMouseDown&&s.onContentMouseDown(...g))},[(G(),Ct(us(n.filterHeaderTemplate),{field:n.field,filterModel:n.filters[n.field],filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"])),n.display==="row"?(G(),se("ul",TH,[(G(!0),se(xt,null,hn(s.matchModes,(g,y)=>(G(),se("li",{key:g.label,class:Lt(["p-column-filter-row-item",{"p-highlight":s.isRowMatchModeSelected(g.value)}]),onClick:w=>s.onRowMatchModeChange(g.value),onKeydown:[e[3]||(e[3]=w=>s.onRowMatchModeKeyDown(w)),Ji($f(w=>s.onRowMatchModeChange(g.value),["prevent"]),["enter"])],tabindex:y===0?"0":null},lt(g.label),43,EH))),128)),xH,ue("li",{class:"p-column-filter-row-item",onClick:e[4]||(e[4]=g=>s.clearFilter()),onKeydown:[e[5]||(e[5]=g=>s.onRowMatchModeKeyDown(g)),e[6]||(e[6]=Ji(g=>t.onRowClearItemClick(),["enter"]))]},lt(s.noFilterLabel),33)])):(G(),se(xt,{key:1},[s.isShowOperator?(G(),se("div",CH,[gt(o,{options:s.operatorOptions,modelValue:s.operator,"aria-label":s.filterOperatorAriaLabel,class:"p-column-filter-operator-dropdown",optionLabel:"label",optionValue:"value","onUpdate:modelValue":e[7]||(e[7]=g=>s.onOperatorChange(g))},null,8,["options","modelValue","aria-label"])])):qe("",!0),ue("div",AH,[(G(!0),se(xt,null,hn(s.fieldConstraints,(g,y)=>(G(),se("div",{key:y,class:"p-column-filter-constraint"},[s.isShowMatchModes?(G(),Ct(o,{key:0,options:s.matchModes,modelValue:g.matchMode,class:"p-column-filter-matchmode-dropdown",optionLabel:"label",optionValue:"value","aria-label":s.filterConstraintAriaLabel,"onUpdate:modelValue":w=>s.onMenuMatchModeChange(w,y)},null,8,["options","modelValue","aria-label","onUpdate:modelValue"])):qe("",!0),n.display==="menu"?(G(),Ct(us(n.filterElement),{key:1,field:n.field,filterModel:g,filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"])):qe("",!0),ue("div",null,[s.showRemoveIcon?(G(),Ct(u,{key:0,type:"button",icon:"pi pi-trash",class:"p-column-filter-remove-button p-button-text p-button-danger p-button-sm",onClick:w=>s.removeConstraint(y),label:s.removeRuleButtonLabel},null,8,["onClick","label"])):qe("",!0)])]))),128))]),s.isShowAddConstraint?(G(),se("div",kH,[gt(u,{type:"button",label:s.addRuleButtonLabel,icon:"pi pi-plus",class:"p-column-filter-add-button p-button-text p-button-sm",onClick:e[8]||(e[8]=g=>s.addConstraint())},null,8,["label"])])):qe("",!0),ue("div",PH,[!n.filterClearTemplate&&n.showClearButton?(G(),Ct(u,{key:0,type:"button",class:"p-button-outlined p-button-sm",label:s.clearButtonLabel,onClick:s.clearFilter},null,8,["label","onClick"])):(G(),Ct(us(n.filterClearTemplate),{key:1,field:n.field,filterModel:n.filters[n.field],filterCallback:s.clearFilter},null,8,["field","filterModel","filterCallback"])),n.showApplyButton?(G(),se(xt,{key:2},[n.filterApplyTemplate?(G(),Ct(us(n.filterApplyTemplate),{key:1,field:n.field,filterModel:n.filters[n.field],filterCallback:s.applyFilter},null,8,["field","filterModel","filterCallback"])):(G(),Ct(u,{key:0,type:"button",class:"p-button-sm",label:s.applyButtonLabel,onClick:e[9]||(e[9]=g=>s.applyFilter())},null,8,["label"]))],64)):qe("",!0)])],64)),(G(),Ct(us(n.filterFooterTemplate),{field:n.field,filterModel:n.filters[n.field],filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"]))],42,SH)),[[h,{autoFocus:!0}]]):qe("",!0)]),_:1},8,["onEnter","onLeave","onAfterLeave"])]),_:1})],2)}zw.render=DH;var jw={name:"HeaderCheckbox",emits:["change"],props:{checked:null,disabled:null},data(){return{focused:!1}},methods:{onClick(t){this.disabled||(this.$emit("change",{originalEvent:t,checked:!this.checked}),Ne.focus(this.$refs.input))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{headerCheckboxAriaLabel(){return this.$primevue.config.locale.aria?this.checked?this.$primevue.config.locale.aria.selectAll:this.$primevue.config.locale.aria.unselectAll:void 0}}};const IH={class:"p-hidden-accessible"},OH=["checked","disabled","tabindex","aria-label"];function RH(t,e,n,i,r,s){return G(),se("div",{class:Lt(["p-checkbox p-component",{"p-checkbox-focused":r.focused,"p-disabled":n.disabled}]),onClick:e[2]||(e[2]=(...o)=>s.onClick&&s.onClick(...o)),onKeydown:e[3]||(e[3]=Ji($f((...o)=>s.onClick&&s.onClick(...o),["prevent"]),["space"]))},[ue("div",IH,[ue("input",{ref:"input",type:"checkbox",checked:n.checked,disabled:n.disabled,tabindex:n.disabled?null:"0","aria-label":s.headerCheckboxAriaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},null,40,OH)]),ue("div",{ref:"box",class:Lt(["p-checkbox-box p-component",{"p-highlight":n.checked,"p-disabled":n.disabled,"p-focus":r.focused}])},[ue("span",{class:Lt(["p-checkbox-icon",{"pi pi-check":n.checked}])},null,2)],2)],34)}jw.render=RH;var ek={name:"HeaderCell",emits:["column-click","column-mousedown","column-dragstart","column-dragover","column-dragleave","column-drop","column-resizestart","checkbox-change","filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{column:{type:Object,default:null},resizableColumns:{type:Boolean,default:!1},groupRowsBy:{type:[Array,String,Function],default:null},sortMode:{type:String,default:"single"},groupRowSortField:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},multiSortMeta:{type:Array,default:null},allRowsSelected:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},filterDisplay:{type:String,default:null},filters:{type:Object,default:null},filtersStore:{type:Object,default:null},filterColumn:{type:Boolean,default:!1},reorderableColumns:{type:Boolean,default:!1},filterInputProps:{type:null,default:null}},data(){return{styleObject:{}}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition()},methods:{columnProp(t){return Nt.getVNodeProp(this.column,t)},onClick(t){this.$emit("column-click",{originalEvent:t,column:this.column})},onKeyDown(t){(t.code==="Enter"||t.code==="Space")&&t.currentTarget.nodeName==="TH"&&Ne.hasClass(t.currentTarget,"p-sortable-column")&&(this.$emit("column-click",{originalEvent:t,column:this.column}),t.preventDefault())},onMouseDown(t){this.$emit("column-mousedown",{originalEvent:t,column:this.column})},onDragStart(t){this.$emit("column-dragstart",t)},onDragOver(t){this.$emit("column-dragover",t)},onDragLeave(t){this.$emit("column-dragleave",t)},onDrop(t){this.$emit("column-drop",t)},onResizeStart(t){this.$emit("column-resizestart",t)},getMultiSortMetaIndex(){return this.multiSortMeta.findIndex(t=>t.field===this.columnProp("field")||t.field===this.columnProp("sortField"))},getBadgeValue(){let t=this.getMultiSortMetaIndex();return this.groupRowsBy&&this.groupRowsBy===this.groupRowSortField&&t>-1?t:t+1},isMultiSorted(){return this.sortMode==="multiple"&&this.columnProp("sortable")&&this.getMultiSortMetaIndex()>-1},isColumnSorted(){return this.sortMode==="single"?this.sortField&&(this.sortField===this.columnProp("field")||this.sortField===this.columnProp("sortField")):this.isMultiSorted()},updateStickyPosition(){if(this.columnProp("frozen")){if(this.columnProp("alignFrozen")==="right"){let n=0,i=this.$el.nextElementSibling;i&&(n=Ne.getOuterWidth(i)+parseFloat(i.style.right||0)),this.styleObject.right=n+"px"}else{let n=0,i=this.$el.previousElementSibling;i&&(n=Ne.getOuterWidth(i)+parseFloat(i.style.left||0)),this.styleObject.left=n+"px"}let e=this.$el.parentElement.nextElementSibling;if(e){let n=Ne.index(this.$el);e.children[n].style.left=this.styleObject.left,e.children[n].style.right=this.styleObject.right}}},onHeaderCheckboxChange(t){this.$emit("checkbox-change",t)}},computed:{containerClass(){return[this.filterColumn?this.columnProp("filterHeaderClass"):this.columnProp("headerClass"),this.columnProp("class"),{"p-sortable-column":this.columnProp("sortable"),"p-resizable-column":this.resizableColumns,"p-highlight":this.isColumnSorted(),"p-filter-column":this.filterColumn,"p-frozen-column":this.columnProp("frozen"),"p-reorderable-column":this.reorderableColumns}]},containerStyle(){let t=this.filterColumn?this.columnProp("filterHeaderStyle"):this.columnProp("headerStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]},sortableColumnIcon(){let t=!1,e=null;if(this.sortMode==="single")t=this.sortField&&(this.sortField===this.columnProp("field")||this.sortField===this.columnProp("sortField")),e=t?this.sortOrder:0;else if(this.sortMode==="multiple"){let n=this.getMultiSortMetaIndex();n>-1&&(t=!0,e=this.multiSortMeta[n].order)}return["p-sortable-column-icon pi pi-fw",{"pi-sort-alt":!t,"pi-sort-amount-up-alt":t&&e>0,"pi-sort-amount-down":t&&e<0}]},ariaSort(){if(this.columnProp("sortable")){const t=this.sortableColumnIcon;return t[1]["pi-sort-amount-down"]?"descending":t[1]["pi-sort-amount-up-alt"]?"ascending":"none"}else return null}},components:{DTHeaderCheckbox:jw,DTColumnFilter:zw}};const LH=["tabindex","colspan","rowspan","aria-sort"],MH={class:"p-column-header-content"},NH={key:1,class:"p-column-title"},FH={key:3,class:"p-sortable-column-badge"};function BH(t,e,n,i,r,s){const o=Bt("DTHeaderCheckbox"),u=Bt("DTColumnFilter");return G(),se("th",{style:hi(s.containerStyle),class:Lt(s.containerClass),tabindex:s.columnProp("sortable")?"0":null,role:"columnheader",colspan:s.columnProp("colspan"),rowspan:s.columnProp("rowspan"),"aria-sort":s.ariaSort,onClick:e[8]||(e[8]=(...d)=>s.onClick&&s.onClick(...d)),onKeydown:e[9]||(e[9]=(...d)=>s.onKeyDown&&s.onKeyDown(...d)),onMousedown:e[10]||(e[10]=(...d)=>s.onMouseDown&&s.onMouseDown(...d)),onDragstart:e[11]||(e[11]=(...d)=>s.onDragStart&&s.onDragStart(...d)),onDragover:e[12]||(e[12]=(...d)=>s.onDragOver&&s.onDragOver(...d)),onDragleave:e[13]||(e[13]=(...d)=>s.onDragLeave&&s.onDragLeave(...d)),onDrop:e[14]||(e[14]=(...d)=>s.onDrop&&s.onDrop(...d))},[n.resizableColumns&&!s.columnProp("frozen")?(G(),se("span",{key:0,class:"p-column-resizer",onMousedown:e[0]||(e[0]=(...d)=>s.onResizeStart&&s.onResizeStart(...d))},null,32)):qe("",!0),ue("div",MH,[n.column.children&&n.column.children.header?(G(),Ct(us(n.column.children.header),{key:0,column:n.column},null,8,["column"])):qe("",!0),s.columnProp("header")?(G(),se("span",NH,lt(s.columnProp("header")),1)):qe("",!0),s.columnProp("sortable")?(G(),se("span",{key:2,class:Lt(s.sortableColumnIcon)},null,2)):qe("",!0),s.isMultiSorted()?(G(),se("span",FH,lt(s.getBadgeValue()),1)):qe("",!0),s.columnProp("selectionMode")==="multiple"&&n.filterDisplay!=="row"?(G(),Ct(o,{key:4,checked:n.allRowsSelected,onChange:s.onHeaderCheckboxChange,disabled:n.empty},null,8,["checked","onChange","disabled"])):qe("",!0),n.filterDisplay==="menu"&&n.column.children&&n.column.children.filter?(G(),Ct(u,{key:5,field:s.columnProp("filterField")||s.columnProp("field"),type:s.columnProp("dataType"),display:"menu",showMenu:s.columnProp("showFilterMenu"),filterElement:n.column.children&&n.column.children.filter,filterHeaderTemplate:n.column.children&&n.column.children.filterheader,filterFooterTemplate:n.column.children&&n.column.children.filterfooter,filterClearTemplate:n.column.children&&n.column.children.filterclear,filterApplyTemplate:n.column.children&&n.column.children.filterapply,filters:n.filters,filtersStore:n.filtersStore,filterInputProps:n.filterInputProps,onFilterChange:e[1]||(e[1]=d=>t.$emit("filter-change",d)),onFilterApply:e[2]||(e[2]=d=>t.$emit("filter-apply")),filterMenuStyle:s.columnProp("filterMenuStyle"),filterMenuClass:s.columnProp("filterMenuClass"),showOperator:s.columnProp("showFilterOperator"),showClearButton:s.columnProp("showClearButton"),showApplyButton:s.columnProp("showApplyButton"),showMatchModes:s.columnProp("showFilterMatchModes"),showAddButton:s.columnProp("showAddButton"),matchModeOptions:s.columnProp("filterMatchModeOptions"),maxConstraints:s.columnProp("maxConstraints"),onOperatorChange:e[3]||(e[3]=d=>t.$emit("operator-change",d)),onMatchmodeChange:e[4]||(e[4]=d=>t.$emit("matchmode-change",d)),onConstraintAdd:e[5]||(e[5]=d=>t.$emit("constraint-add",d)),onConstraintRemove:e[6]||(e[6]=d=>t.$emit("constraint-remove",d)),onApplyClick:e[7]||(e[7]=d=>t.$emit("apply-click",d))},null,8,["field","type","showMenu","filterElement","filterHeaderTemplate","filterFooterTemplate","filterClearTemplate","filterApplyTemplate","filters","filtersStore","filterInputProps","filterMenuStyle","filterMenuClass","showOperator","showClearButton","showApplyButton","showMatchModes","showAddButton","matchModeOptions","maxConstraints"])):qe("",!0)])],46,LH)}ek.render=BH;var tk={name:"TableHeader",emits:["column-click","column-mousedown","column-dragstart","column-dragover","column-dragleave","column-drop","column-resizestart","checkbox-change","filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{columnGroup:{type:null,default:null},columns:{type:null,default:null},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},resizableColumns:{type:Boolean,default:!1},allRowsSelected:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},sortMode:{type:String,default:"single"},groupRowSortField:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},multiSortMeta:{type:Array,default:null},filterDisplay:{type:String,default:null},filters:{type:Object,default:null},filtersStore:{type:Object,default:null},reorderableColumns:{type:Boolean,default:!1},filterInputProps:{type:null,default:null}},methods:{columnProp(t,e){return Nt.getVNodeProp(t,e)},getFilterColumnHeaderClass(t){return["p-filter-column",this.columnProp(t,"filterHeaderClass"),this.columnProp(t,"class"),{"p-frozen-column":this.columnProp(t,"frozen")}]},getFilterColumnHeaderStyle(t){return[this.columnProp(t,"filterHeaderStyle"),this.columnProp(t,"style")]},getHeaderRows(){let t=[],e=this.columnGroup;if(e.children&&e.children.default){for(let n of e.children.default())n.type.name==="Row"?t.push(n):n.children&&n.children instanceof Array&&(t=n.children);return t}},getHeaderColumns(t){let e=[];if(t.children&&t.children.default)return t.children.default().forEach(n=>{n.children&&n.children instanceof Array?e=[...e,...n.children]:n.type.name==="Column"&&e.push(n)}),e}},components:{DTHeaderCell:ek,DTHeaderCheckbox:jw,DTColumnFilter:zw}};const UH={class:"p-datatable-thead",role:"rowgroup"},HH={role:"row"},zH={key:0,role:"row"};function jH(t,e,n,i,r,s){const o=Bt("DTHeaderCell"),u=Bt("DTHeaderCheckbox"),d=Bt("DTColumnFilter");return G(),se("thead",UH,[n.columnGroup?(G(!0),se(xt,{key:1},hn(s.getHeaderRows(),(h,g)=>(G(),se("tr",{key:g,role:"row"},[(G(!0),se(xt,null,hn(s.getHeaderColumns(h),(y,w)=>(G(),se(xt,{key:s.columnProp(y,"columnKey")||s.columnProp(y,"field")||w},[!s.columnProp(y,"hidden")&&(n.rowGroupMode!=="subheader"||n.groupRowsBy!==s.columnProp(y,"field"))&&typeof y.children!="string"?(G(),Ct(o,{key:0,column:y,onColumnClick:e[23]||(e[23]=C=>t.$emit("column-click",C)),onColumnMousedown:e[24]||(e[24]=C=>t.$emit("column-mousedown",C)),groupRowsBy:n.groupRowsBy,groupRowSortField:n.groupRowSortField,sortMode:n.sortMode,sortField:n.sortField,sortOrder:n.sortOrder,multiSortMeta:n.multiSortMeta,allRowsSelected:n.allRowsSelected,empty:n.empty,onCheckboxChange:e[25]||(e[25]=C=>t.$emit("checkbox-change",C)),filters:n.filters,filterDisplay:n.filterDisplay,filtersStore:n.filtersStore,onFilterChange:e[26]||(e[26]=C=>t.$emit("filter-change",C)),onFilterApply:e[27]||(e[27]=C=>t.$emit("filter-apply")),onOperatorChange:e[28]||(e[28]=C=>t.$emit("operator-change",C)),onMatchmodeChange:e[29]||(e[29]=C=>t.$emit("matchmode-change",C)),onConstraintAdd:e[30]||(e[30]=C=>t.$emit("constraint-add",C)),onConstraintRemove:e[31]||(e[31]=C=>t.$emit("constraint-remove",C)),onApplyClick:e[32]||(e[32]=C=>t.$emit("apply-click",C))},null,8,["column","groupRowsBy","groupRowSortField","sortMode","sortField","sortOrder","multiSortMeta","allRowsSelected","empty","filters","filterDisplay","filtersStore"])):qe("",!0)],64))),128))]))),128)):(G(),se(xt,{key:0},[ue("tr",HH,[(G(!0),se(xt,null,hn(n.columns,(h,g)=>(G(),se(xt,{key:s.columnProp(h,"columnKey")||s.columnProp(h,"field")||g},[!s.columnProp(h,"hidden")&&(n.rowGroupMode!=="subheader"||n.groupRowsBy!==s.columnProp(h,"field"))?(G(),Ct(o,{key:0,column:h,onColumnClick:e[0]||(e[0]=y=>t.$emit("column-click",y)),onColumnMousedown:e[1]||(e[1]=y=>t.$emit("column-mousedown",y)),onColumnDragstart:e[2]||(e[2]=y=>t.$emit("column-dragstart",y)),onColumnDragover:e[3]||(e[3]=y=>t.$emit("column-dragover",y)),onColumnDragleave:e[4]||(e[4]=y=>t.$emit("column-dragleave",y)),onColumnDrop:e[5]||(e[5]=y=>t.$emit("column-drop",y)),groupRowsBy:n.groupRowsBy,groupRowSortField:n.groupRowSortField,reorderableColumns:n.reorderableColumns,resizableColumns:n.resizableColumns,onColumnResizestart:e[6]||(e[6]=y=>t.$emit("column-resizestart",y)),sortMode:n.sortMode,sortField:n.sortField,sortOrder:n.sortOrder,multiSortMeta:n.multiSortMeta,allRowsSelected:n.allRowsSelected,empty:n.empty,onCheckboxChange:e[7]||(e[7]=y=>t.$emit("checkbox-change",y)),filters:n.filters,filterDisplay:n.filterDisplay,filtersStore:n.filtersStore,filterInputProps:n.filterInputProps,onFilterChange:e[8]||(e[8]=y=>t.$emit("filter-change",y)),onFilterApply:e[9]||(e[9]=y=>t.$emit("filter-apply")),onOperatorChange:e[10]||(e[10]=y=>t.$emit("operator-change",y)),onMatchmodeChange:e[11]||(e[11]=y=>t.$emit("matchmode-change",y)),onConstraintAdd:e[12]||(e[12]=y=>t.$emit("constraint-add",y)),onConstraintRemove:e[13]||(e[13]=y=>t.$emit("constraint-remove",y)),onApplyClick:e[14]||(e[14]=y=>t.$emit("apply-click",y))},null,8,["column","groupRowsBy","groupRowSortField","reorderableColumns","resizableColumns","sortMode","sortField","sortOrder","multiSortMeta","allRowsSelected","empty","filters","filterDisplay","filtersStore","filterInputProps"])):qe("",!0)],64))),128))]),n.filterDisplay==="row"?(G(),se("tr",zH,[(G(!0),se(xt,null,hn(n.columns,(h,g)=>(G(),se(xt,{key:s.columnProp(h,"columnKey")||s.columnProp(h,"field")||g},[!s.columnProp(h,"hidden")&&(n.rowGroupMode!=="subheader"||n.groupRowsBy!==s.columnProp(h,"field"))?(G(),se("th",{key:0,style:hi(s.getFilterColumnHeaderStyle(h)),class:Lt(s.getFilterColumnHeaderClass(h))},[s.columnProp(h,"selectionMode")==="multiple"?(G(),Ct(u,{key:0,checked:n.allRowsSelected,disabled:n.empty,onChange:e[15]||(e[15]=y=>t.$emit("checkbox-change",y))},null,8,["checked","disabled"])):qe("",!0),h.children&&h.children.filter?(G(),Ct(d,{key:1,field:s.columnProp(h,"filterField")||s.columnProp(h,"field"),type:s.columnProp(h,"dataType"),display:"row",showMenu:s.columnProp(h,"showFilterMenu"),filterElement:h.children&&h.children.filter,filterHeaderTemplate:h.children&&h.children.filterheader,filterFooterTemplate:h.children&&h.children.filterfooter,filterClearTemplate:h.children&&h.children.filterclear,filterApplyTemplate:h.children&&h.children.filterapply,filters:n.filters,filtersStore:n.filtersStore,filterInputProps:n.filterInputProps,onFilterChange:e[16]||(e[16]=y=>t.$emit("filter-change",y)),onFilterApply:e[17]||(e[17]=y=>t.$emit("filter-apply")),filterMenuStyle:s.columnProp(h,"filterMenuStyle"),filterMenuClass:s.columnProp(h,"filterMenuClass"),showOperator:s.columnProp(h,"showFilterOperator"),showClearButton:s.columnProp(h,"showClearButton"),showApplyButton:s.columnProp(h,"showApplyButton"),showMatchModes:s.columnProp(h,"showFilterMatchModes"),showAddButton:s.columnProp(h,"showAddButton"),matchModeOptions:s.columnProp(h,"filterMatchModeOptions"),maxConstraints:s.columnProp(h,"maxConstraints"),onOperatorChange:e[18]||(e[18]=y=>t.$emit("operator-change",y)),onMatchmodeChange:e[19]||(e[19]=y=>t.$emit("matchmode-change",y)),onConstraintAdd:e[20]||(e[20]=y=>t.$emit("constraint-add",y)),onConstraintRemove:e[21]||(e[21]=y=>t.$emit("constraint-remove",y)),onApplyClick:e[22]||(e[22]=y=>t.$emit("apply-click",y))},null,8,["field","type","showMenu","filterElement","filterHeaderTemplate","filterFooterTemplate","filterClearTemplate","filterApplyTemplate","filters","filtersStore","filterInputProps","filterMenuStyle","filterMenuClass","showOperator","showClearButton","showApplyButton","showMatchModes","showAddButton","matchModeOptions","maxConstraints"])):qe("",!0)],6)):qe("",!0)],64))),128))])):qe("",!0)],64))])}tk.render=jH;var Ly={name:"DataTable",emits:["value-change","update:first","update:rows","page","update:sortField","update:sortOrder","update:multiSortMeta","sort","filter","row-click","row-dblclick","update:selection","row-select","row-unselect","update:contextMenuSelection","row-contextmenu","row-unselect-all","row-select-all","select-all-change","column-resize-end","column-reorder","row-reorder","update:expandedRows","row-collapse","row-expand","update:expandedRowGroups","rowgroup-collapse","rowgroup-expand","update:filters","state-restore","state-save","cell-edit-init","cell-edit-complete","cell-edit-cancel","update:editingRows","row-edit-init","row-edit-save","row-edit-cancel"],props:{value:{type:Array,default:null},dataKey:{type:[String,Function],default:null},rows:{type:Number,default:0},first:{type:Number,default:0},totalRecords:{type:Number,default:0},paginator:{type:Boolean,default:!1},paginatorPosition:{type:String,default:"bottom"},alwaysShowPaginator:{type:Boolean,default:!0},paginatorTemplate:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},currentPageReportTemplate:{type:String,default:"({currentPage} of {totalPages})"},lazy:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},defaultSortOrder:{type:Number,default:1},multiSortMeta:{type:Array,default:null},sortMode:{type:String,default:"single"},removableSort:{type:Boolean,default:!1},filters:{type:Object,default:null},filterDisplay:{type:String,default:null},globalFilterFields:{type:Array,default:null},filterLocale:{type:String,default:void 0},selection:{type:[Array,Object],default:null},selectionMode:{type:String,default:null},compareSelectionBy:{type:String,default:"deepEquals"},metaKeySelection:{type:Boolean,default:!0},contextMenu:{type:Boolean,default:!1},contextMenuSelection:{type:Object,default:null},selectAll:{type:Boolean,default:null},rowHover:{type:Boolean,default:!1},csvSeparator:{type:String,default:","},exportFilename:{type:String,default:"download"},exportFunction:{type:Function,default:null},resizableColumns:{type:Boolean,default:!1},columnResizeMode:{type:String,default:"fit"},reorderableColumns:{type:Boolean,default:!1},expandedRows:{type:Array,default:null},expandedRowIcon:{type:String,default:"pi-chevron-down"},collapsedRowIcon:{type:String,default:"pi-chevron-right"},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},expandableRowGroups:{type:Boolean,default:!1},expandedRowGroups:{type:Array,default:null},stateStorage:{type:String,default:"session"},stateKey:{type:String,default:null},editMode:{type:String,default:null},editingRows:{type:Array,default:null},rowClass:{type:null,default:null},rowStyle:{type:null,default:null},scrollable:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},scrollHeight:{type:String,default:null},frozenValue:{type:Array,default:null},responsiveLayout:{type:String,default:"scroll"},breakpoint:{type:String,default:"960px"},showGridlines:{type:Boolean,default:!1},stripedRows:{type:Boolean,default:!1},tableStyle:{type:null,default:null},tableClass:{type:String,default:null},tableProps:{type:null,default:null},filterInputProps:{type:null,default:null}},data(){return{d_first:this.first,d_rows:this.rows,d_sortField:this.sortField,d_sortOrder:this.sortOrder,d_multiSortMeta:this.multiSortMeta?[...this.multiSortMeta]:[],d_groupRowsSortMeta:null,d_selectionKeys:null,d_expandedRowKeys:null,d_columnOrder:null,d_editingRowKeys:null,d_editingMeta:{},d_filters:this.cloneFilters(this.filters)}},rowTouched:!1,anchorRowIndex:null,rangeRowIndex:null,documentColumnResizeListener:null,documentColumnResizeEndListener:null,lastResizeHelperX:null,resizeColumnElement:null,columnResizing:!1,colReorderIconWidth:null,colReorderIconHeight:null,draggedColumn:null,draggedRowIndex:null,droppedRowIndex:null,rowDragging:null,columnWidthsState:null,tableWidthState:null,columnWidthsRestored:!1,watch:{first(t){this.d_first=t},rows(t){this.d_rows=t},sortField(t){this.d_sortField=t},sortOrder(t){this.d_sortOrder=t},multiSortMeta(t){this.d_multiSortMeta=t},selection:{immediate:!0,handler(t){this.dataKey&&this.updateSelectionKeys(t)}},expandedRows(t){this.dataKey&&this.updateExpandedRowKeys(t)},editingRows(t){this.dataKey&&this.updateEditingRowKeys(t)},filters:{deep:!0,handler:function(t){this.d_filters=this.cloneFilters(t)}}},beforeMount(){this.isStateful()&&this.restoreState()},mounted(){this.$el.setAttribute(this.attributeSelector,""),this.responsiveLayout==="stack"&&!this.scrollable&&this.createResponsiveStyle(),this.isStateful()&&this.resizableColumns&&this.restoreColumnWidths(),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},beforeUnmount(){this.unbindColumnResizeEvents(),this.destroyStyleElement(),this.destroyResponsiveStyle()},updated(){this.isStateful()&&this.saveState(),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},methods:{columnProp(t,e){return Nt.getVNodeProp(t,e)},onPage(t){this.clearEditingMetaData(),this.d_first=t.first,this.d_rows=t.rows;let e=this.createLazyLoadEvent(t);e.pageCount=t.pageCount,e.page=t.page,this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",e),this.$emit("value-change",this.processedData)},onColumnHeaderClick(t){const e=t.originalEvent,n=t.column;if(this.columnProp(n,"sortable")){const i=e.target,r=this.columnProp(n,"sortField")||this.columnProp(n,"field");(Ne.hasClass(i,"p-sortable-column")||Ne.hasClass(i,"p-column-title")||Ne.hasClass(i,"p-column-header-content")||Ne.hasClass(i,"p-sortable-column-icon")||Ne.hasClass(i.parentElement,"p-sortable-column-icon"))&&(Ne.clearSelection(),this.sortMode==="single"?(this.d_sortField===r?this.removableSort&&this.d_sortOrder*-1===this.defaultSortOrder?(this.d_sortOrder=null,this.d_sortField=null):this.d_sortOrder=this.d_sortOrder*-1:(this.d_sortOrder=this.defaultSortOrder,this.d_sortField=r),this.$emit("update:sortField",this.d_sortField),this.$emit("update:sortOrder",this.d_sortOrder),this.resetPage()):this.sortMode==="multiple"&&(e.metaKey||e.ctrlKey||(this.d_multiSortMeta=this.d_multiSortMeta.filter(o=>o.field===r)),this.addMultiSortField(r),this.$emit("update:multiSortMeta",this.d_multiSortMeta)),this.$emit("sort",this.createLazyLoadEvent(e)),this.$emit("value-change",this.processedData))}},sortSingle(t){if(this.clearEditingMetaData(),this.groupRowsBy&&this.groupRowsBy===this.sortField)return this.d_multiSortMeta=[{field:this.sortField,order:this.sortOrder||this.defaultSortOrder},{field:this.d_sortField,order:this.d_sortOrder}],this.sortMultiple(t);let e=[...t];return e.sort((n,i)=>{let r=Nt.resolveFieldData(n,this.d_sortField),s=Nt.resolveFieldData(i,this.d_sortField),o=null;return r==null&&s!=null?o=-1:r!=null&&s==null?o=1:r==null&&s==null?o=0:typeof r=="string"&&typeof s=="string"?o=r.localeCompare(s,void 0,{numeric:!0}):o=rs?1:0,this.d_sortOrder*o}),e},sortMultiple(t){if(this.clearEditingMetaData(),this.groupRowsBy&&(this.d_groupRowsSortMeta||this.d_multiSortMeta.length&&this.groupRowsBy===this.d_multiSortMeta[0].field)){const n=this.d_multiSortMeta[0];!this.d_groupRowsSortMeta&&(this.d_groupRowsSortMeta=n),n.field!==this.d_groupRowsSortMeta.field&&(this.d_multiSortMeta=[this.d_groupRowsSortMeta,...this.d_multiSortMeta])}let e=[...t];return e.sort((n,i)=>this.multisortField(n,i,0)),e},multisortField(t,e,n){const i=Nt.resolveFieldData(t,this.d_multiSortMeta[n].field),r=Nt.resolveFieldData(e,this.d_multiSortMeta[n].field);let s=null;if(typeof i=="string"||i instanceof String){if(i.localeCompare&&i!==r)return this.d_multiSortMeta[n].order*i.localeCompare(r,void 0,{numeric:!0})}else s=in?this.multisortField(t,e,n+1):0:this.d_multiSortMeta[n].order*s},addMultiSortField(t){let e=this.d_multiSortMeta.findIndex(n=>n.field===t);e>=0?this.removableSort&&this.d_multiSortMeta[e].order*-1===this.defaultSortOrder?this.d_multiSortMeta.splice(e,1):this.d_multiSortMeta[e]={field:t,order:this.d_multiSortMeta[e].order*-1}:this.d_multiSortMeta.push({field:t,order:this.defaultSortOrder}),this.d_multiSortMeta=[...this.d_multiSortMeta]},filter(t){if(!t)return;this.clearEditingMetaData();let e;this.filters.global&&(e=this.globalFilterFields||this.columns.map(r=>this.columnProp(r,"filterField")||this.columnProp(r,"field")));let n=[];for(let r=0;rC!=g);this.$emit("update:selection",y)}this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})}else{if(this.isSingleSelectionMode())this.$emit("update:selection",s);else if(this.isMultipleSelectionMode()){let g=h?this.selection||[]:[];g=[...g,s],this.$emit("update:selection",g)}this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"})}}else if(this.selectionMode==="single")u?(this.$emit("update:selection",null),this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})):(this.$emit("update:selection",s),this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"}));else if(this.selectionMode==="multiple")if(u){const h=this.findIndexInSelection(s),g=this.selection.filter((y,w)=>w!=h);this.$emit("update:selection",g),this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})}else{const h=this.selection?[...this.selection,s]:[s];this.$emit("update:selection",h),this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"})}}}this.rowTouched=!1,r&&(r.tabIndex="-1",Ne.find(i,"tr.p-selectable-row")[n].tabIndex="0")}},onRowDblClick(t){const e=t.originalEvent;Ne.isClickable(e.target)||this.$emit("row-dblclick",t)},onRowRightClick(t){Ne.clearSelection(),t.originalEvent.target.focus(),this.$emit("update:contextMenuSelection",t.data),this.$emit("row-contextmenu",t)},onRowTouchEnd(){this.rowTouched=!0},onRowKeyDown(t,e){const n=t.originalEvent,i=t.data,r=t.index,s=n.metaKey||n.ctrlKey;if(this.selectionMode){const o=n.target;switch(n.code){case"ArrowDown":this.onArrowDownKey(n,o,r,e);break;case"ArrowUp":this.onArrowUpKey(n,o,r,e);break;case"Home":this.onHomeKey(n,o,r,e);break;case"End":this.onEndKey(n,o,r,e);break;case"Enter":this.onEnterKey(n,i,r);break;case"Space":this.onSpaceKey(n,i,r,e);break;case"Tab":this.onTabKey(n,r);break;default:if(n.code==="KeyA"&&s){const u=this.dataToRender(e.rows);this.$emit("update:selection",u)}break}}},onArrowDownKey(t,e,n,i){const r=this.findNextSelectableRow(e);if(r&&this.focusRowChange(e,r),t.shiftKey){const s=this.dataToRender(i.rows),o=n+1>=s.length?s.length-1:n+1;this.onRowClick({originalEvent:t,data:s[o],index:o})}t.preventDefault()},onArrowUpKey(t,e,n,i){const r=this.findPrevSelectableRow(e);if(r&&this.focusRowChange(e,r),t.shiftKey){const s=this.dataToRender(i.rows),o=n-1<=0?0:n-1;this.onRowClick({originalEvent:t,data:s[o],index:o})}t.preventDefault()},onHomeKey(t,e,n,i){const r=this.findFirstSelectableRow();if(r&&this.focusRowChange(e,r),t.ctrlKey&&t.shiftKey){const s=this.dataToRender(i.rows);this.$emit("update:selection",s.slice(0,n+1))}t.preventDefault()},onEndKey(t,e,n,i){const r=this.findLastSelectableRow();if(r&&this.focusRowChange(e,r),t.ctrlKey&&t.shiftKey){const s=this.dataToRender(i.rows);this.$emit("update:selection",s.slice(n,s.length))}t.preventDefault()},onEnterKey(t,e,n){this.onRowClick({originalEvent:t,data:e,index:n}),t.preventDefault()},onSpaceKey(t,e,n,i){if(this.onEnterKey(t,e,n),t.shiftKey&&this.selection!==null){const r=this.dataToRender(i.rows);let s;if(this.selection.length>0){let u,d;u=Nt.findIndexInList(this.selection[0],r),d=Nt.findIndexInList(this.selection[this.selection.length-1],r),s=n<=u?d:u}else s=Nt.findIndexInList(this.selection,r);const o=s!==n?r.slice(Math.min(s,n),Math.max(s,n)+1):e;this.$emit("update:selection",o)}},onTabKey(t,e){const n=this.$refs.bodyRef&&this.$refs.bodyRef.$el,i=Ne.find(n,"tr.p-selectable-row");if(t.code==="Tab"&&i&&i.length>0){const r=Ne.findSingle(n,"tr.p-highlight"),s=Ne.findSingle(n,'tr.p-selectable-row[tabindex="0"]');r?(r.tabIndex="0",s&&s!==r&&(s.tabIndex="-1")):(i[0].tabIndex="0",s!==i[0]&&(i[e].tabIndex="-1"))}},findNextSelectableRow(t){let e=t.nextElementSibling;return e?Ne.hasClass(e,"p-selectable-row")?e:this.findNextSelectableRow(e):null},findPrevSelectableRow(t){let e=t.previousElementSibling;return e?Ne.hasClass(e,"p-selectable-row")?e:this.findPrevSelectableRow(e):null},findFirstSelectableRow(){return Ne.findSingle(this.$refs.table,".p-selectable-row")},findLastSelectableRow(){const t=Ne.find(this.$refs.table,".p-selectable-row");return t?t[t.length-1]:null},focusRowChange(t,e){t.tabIndex="-1",e.tabIndex="0",Ne.focus(e)},toggleRowWithRadio(t){const e=t.data;this.isSelected(e)?(this.$emit("update:selection",null),this.$emit("row-unselect",{originalEvent:t.originalEvent,data:e,index:t.index,type:"radiobutton"})):(this.$emit("update:selection",e),this.$emit("row-select",{originalEvent:t.originalEvent,data:e,index:t.index,type:"radiobutton"}))},toggleRowWithCheckbox(t){const e=t.data;if(this.isSelected(e)){const n=this.findIndexInSelection(e),i=this.selection.filter((r,s)=>s!=n);this.$emit("update:selection",i),this.$emit("row-unselect",{originalEvent:t.originalEvent,data:e,index:t.index,type:"checkbox"})}else{let n=this.selection?[...this.selection]:[];n=[...n,e],this.$emit("update:selection",n),this.$emit("row-select",{originalEvent:t.originalEvent,data:e,index:t.index,type:"checkbox"})}},toggleRowsWithCheckbox(t){if(this.selectAll!==null)this.$emit("select-all-change",t);else{const{originalEvent:e,checked:n}=t;let i=[];n?(i=this.frozenValue?[...this.frozenValue,...this.processedData]:this.processedData,this.$emit("row-select-all",{originalEvent:e,data:i})):this.$emit("row-unselect-all",{originalEvent:e}),this.$emit("update:selection",i)}},isSingleSelectionMode(){return this.selectionMode==="single"},isMultipleSelectionMode(){return this.selectionMode==="multiple"},isSelected(t){return t&&this.selection?this.dataKey?this.d_selectionKeys?this.d_selectionKeys[Nt.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.selection instanceof Array?this.findIndexInSelection(t)>-1:this.equals(t,this.selection):!1},findIndexInSelection(t){return this.findIndex(t,this.selection)},findIndex(t,e){let n=-1;if(e&&e.length){for(let i=0;ithis.anchorRowIndex?(e=this.anchorRowIndex,n=this.rangeRowIndex):this.rangeRowIndex{n+=` `;let o=!1;for(let u=0;uparseInt(i,10)){if(this.columnResizeMode==="fit"){let s=this.resizeColumnElement.nextElementSibling.offsetWidth-t;n>15&&s>15&&this.resizeTableCells(n,s)}else if(this.columnResizeMode==="expand"){const r=this.$refs.table.offsetWidth+t+"px",s=o=>{o&&(o.style.width=o.style.minWidth=r)};if(s(this.$refs.table),!this.virtualScrollerDisabled){const o=this.$refs.bodyRef&&this.$refs.bodyRef.$el,u=this.$refs.frozenBodyRef&&this.$refs.frozenBodyRef.$el;s(o),s(u)}this.resizeTableCells(n)}this.$emit("column-resize-end",{element:this.resizeColumnElement,delta:t})}this.$refs.resizeHelper.style.display="none",this.resizeColumn=null,Ne.removeClass(this.$el,"p-unselectable-text"),this.unbindColumnResizeEvents(),this.isStateful()&&this.saveState()},resizeTableCells(t,e){let n=Ne.index(this.resizeColumnElement),i=[];Ne.find(this.$refs.table,".p-datatable-thead > tr > th").forEach(u=>i.push(Ne.getOuterWidth(u))),this.destroyStyleElement(),this.createStyleElement();let s="",o=`.p-datatable[${this.attributeSelector}] > .p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`;i.forEach((u,d)=>{let h=d===n?t:e&&d===n+1?e:u,g=`width: ${h}px !important; max-width: ${h}px !important`;s+=` ${o} > .p-datatable-thead > tr > th:nth-child(${d+1}), ${o} > .p-datatable-tbody > tr > td:nth-child(${d+1}), ${o} > .p-datatable-tfoot > tr > td:nth-child(${d+1}) { ${g} } `}),this.styleElement.innerHTML=s},bindColumnResizeEvents(){this.documentColumnResizeListener||(this.documentColumnResizeListener=document.addEventListener("mousemove",()=>{this.columnResizing&&this.onColumnResize(event)})),this.documentColumnResizeEndListener||(this.documentColumnResizeEndListener=document.addEventListener("mouseup",()=>{this.columnResizing&&(this.columnResizing=!1,this.onColumnResizeEnd())}))},unbindColumnResizeEvents(){this.documentColumnResizeListener&&(document.removeEventListener("document",this.documentColumnResizeListener),this.documentColumnResizeListener=null),this.documentColumnResizeEndListener&&(document.removeEventListener("document",this.documentColumnResizeEndListener),this.documentColumnResizeEndListener=null)},onColumnHeaderMouseDown(t){const e=t.originalEvent,n=t.column;this.reorderableColumns&&this.columnProp(n,"reorderableColumn")!==!1&&(e.target.nodeName==="INPUT"||e.target.nodeName==="TEXTAREA"||Ne.hasClass(e.target,"p-column-resizer")?e.currentTarget.draggable=!1:e.currentTarget.draggable=!0)},onColumnHeaderDragStart(t){if(this.columnResizing){t.preventDefault();return}this.colReorderIconWidth=Ne.getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp),this.colReorderIconHeight=Ne.getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp),this.draggedColumn=this.findParentHeader(t.target),t.dataTransfer.setData("text","b")},onColumnHeaderDragOver(t){let e=this.findParentHeader(t.target);if(this.reorderableColumns&&this.draggedColumn&&e){t.preventDefault();let n=Ne.getOffset(this.$el),i=Ne.getOffset(e);if(this.draggedColumn!==e){let r=i.left-n.left,s=i.left+e.offsetWidth/2;this.$refs.reorderIndicatorUp.style.top=i.top-n.top-(this.colReorderIconHeight-1)+"px",this.$refs.reorderIndicatorDown.style.top=i.top-n.top+e.offsetHeight+"px",t.pageX>s?(this.$refs.reorderIndicatorUp.style.left=r+e.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=r+e.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=1):(this.$refs.reorderIndicatorUp.style.left=r-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=r-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=-1),this.$refs.reorderIndicatorUp.style.display="block",this.$refs.reorderIndicatorDown.style.display="block"}}},onColumnHeaderDragLeave(t){this.reorderableColumns&&this.draggedColumn&&(t.preventDefault(),this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none")},onColumnHeaderDrop(t){if(t.preventDefault(),this.draggedColumn){let e=Ne.index(this.draggedColumn),n=Ne.index(this.findParentHeader(t.target)),i=e!==n;i&&(n-e===1&&this.dropPosition===-1||n-e===-1&&this.dropPosition===1)&&(i=!1),i&&(Nt.reorderArray(this.columns,e,n),this.updateReorderableColumns(),this.$emit("column-reorder",{originalEvent:t,dragIndex:e,dropIndex:n})),this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}},findParentHeader(t){if(t.nodeName==="TH")return t;{let e=t.parentElement;for(;e.nodeName!=="TH"&&(e=e.parentElement,!!e););return e}},findColumnByKey(t,e){if(t&&t.length)for(let n=0;nthis.droppedRowIndex?this.droppedRowIndex:this.droppedRowIndex===0?0:this.droppedRowIndex-1,n=[...this.processedData];Nt.reorderArray(n,this.draggedRowIndex+this.d_first,e+this.d_first),this.$emit("row-reorder",{originalEvent:t,dragIndex:this.draggedRowIndex,dropIndex:e,value:n})}this.onRowDragLeave(t),this.onRowDragEnd(t),t.preventDefault()},toggleRow(t){let e=t.data,n,i,r=this.expandedRows?[...this.expandedRows]:[];this.dataKey?n=this.d_expandedRowKeys?this.d_expandedRowKeys[Nt.resolveFieldData(e,this.dataKey)]!==void 0:!1:(i=this.findIndex(e,this.expandedRows),n=i>-1),n?(i==null&&(i=this.findIndex(e,this.expandedRows)),r.splice(i,1),this.$emit("update:expandedRows",r),this.$emit("row-collapse",t)):(r.push(e),this.$emit("update:expandedRows",r),this.$emit("row-expand",t))},toggleRowGroup(t){const e=t.originalEvent,n=t.data,i=Nt.resolveFieldData(n,this.groupRowsBy);let r=this.expandedRowGroups?[...this.expandedRowGroups]:[];this.isRowGroupExpanded(n)?(r=r.filter(s=>s!==i),this.$emit("update:expandedRowGroups",r),this.$emit("rowgroup-collapse",{originalEvent:e,data:i})):(r.push(i),this.$emit("update:expandedRowGroups",r),this.$emit("rowgroup-expand",{originalEvent:e,data:i}))},isRowGroupExpanded(t){if(this.expandableRowGroups&&this.expandedRowGroups){let e=Nt.resolveFieldData(t,this.groupRowsBy);return this.expandedRowGroups.indexOf(e)>-1}return!1},isStateful(){return this.stateKey!=null},getStorage(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState(){const t=this.getStorage();let e={};this.paginator&&(e.first=this.d_first,e.rows=this.d_rows),this.d_sortField&&(e.sortField=this.d_sortField,e.sortOrder=this.d_sortOrder),this.d_multiSortMeta&&(e.multiSortMeta=this.d_multiSortMeta),this.hasFilters&&(e.filters=this.filters),this.resizableColumns&&this.saveColumnWidths(e),this.reorderableColumns&&(e.columnOrder=this.d_columnOrder),this.expandedRows&&(e.expandedRows=this.expandedRows,e.expandedRowKeys=this.d_expandedRowKeys),this.expandedRowGroups&&(e.expandedRowGroups=this.expandedRowGroups),this.selection&&(e.selection=this.selection,e.selectionKeys=this.d_selectionKeys),Object.keys(e).length&&t.setItem(this.stateKey,JSON.stringify(e)),this.$emit("state-save",e)},restoreState(){const e=this.getStorage().getItem(this.stateKey),n=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,i=function(r,s){return typeof s=="string"&&n.test(s)?new Date(s):s};if(e){let r=JSON.parse(e,i);this.paginator&&(this.d_first=r.first,this.d_rows=r.rows),r.sortField&&(this.d_sortField=r.sortField,this.d_sortOrder=r.sortOrder),r.multiSortMeta&&(this.d_multiSortMeta=r.multiSortMeta),r.filters&&this.$emit("update:filters",r.filters),this.resizableColumns&&(this.columnWidthsState=r.columnWidths,this.tableWidthState=r.tableWidth),this.reorderableColumns&&(this.d_columnOrder=r.columnOrder),r.expandedRows&&(this.d_expandedRowKeys=r.expandedRowKeys,this.$emit("update:expandedRows",r.expandedRows)),r.expandedRowGroups&&this.$emit("update:expandedRowGroups",r.expandedRowGroups),r.selection&&(this.d_selectionKeys=r.d_selectionKeys,this.$emit("update:selection",r.selection)),this.$emit("state-restore",r)}},saveColumnWidths(t){let e=[];Ne.find(this.$el,".p-datatable-thead > tr > th").forEach(i=>e.push(Ne.getOuterWidth(i))),t.columnWidths=e.join(","),this.columnResizeMode==="expand"&&(t.tableWidth=Ne.getOuterWidth(this.$refs.table)+"px")},restoreColumnWidths(){if(this.columnWidthsState){let t=this.columnWidthsState.split(",");if(this.columnResizeMode==="expand"&&this.tableWidthState&&(this.$refs.table.style.width=this.tableWidthState,this.$refs.table.style.minWidth=this.tableWidthState,this.$el.style.width=this.tableWidthState),Nt.isNotEmpty(t)){this.createStyleElement();let e="",n=`.p-datatable[${this.attributeSelector}] > .p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`;t.forEach((i,r)=>{let s=`width: ${i}px !important; max-width: ${i}px !important`;e+=` ${n} > .p-datatable-thead > tr > th:nth-child(${r+1}), ${n} > .p-datatable-tbody > tr > td:nth-child(${r+1}), ${n} > .p-datatable-tfoot > tr > td:nth-child(${r+1}) { ${s} } `}),this.styleElement.innerHTML=e}}},onCellEditInit(t){this.$emit("cell-edit-init",t)},onCellEditComplete(t){this.$emit("cell-edit-complete",t)},onCellEditCancel(t){this.$emit("cell-edit-cancel",t)},onRowEditInit(t){let e=this.editingRows?[...this.editingRows]:[];e.push(t.data),this.$emit("update:editingRows",e),this.$emit("row-edit-init",t)},onRowEditSave(t){let e=[...this.editingRows];e.splice(this.findIndex(t.data,e),1),this.$emit("update:editingRows",e),this.$emit("row-edit-save",t)},onRowEditCancel(t){let e=[...this.editingRows];e.splice(this.findIndex(t.data,e),1),this.$emit("update:editingRows",e),this.$emit("row-edit-cancel",t)},onEditingMetaChange(t){let{data:e,field:n,index:i,editing:r}=t,s={...this.d_editingMeta},o=s[i];if(r)!o&&(o=s[i]={data:{...e},fields:[]}),o.fields.push(n);else if(o){const u=o.fields.filter(d=>d!==n);u.length?o.fields=u:delete s[i]}this.d_editingMeta=s},clearEditingMetaData(){this.editMode&&(this.d_editingMeta={})},createLazyLoadEvent(t){return{originalEvent:t,first:this.d_first,rows:this.d_rows,sortField:this.d_sortField,sortOrder:this.d_sortOrder,multiSortMeta:this.d_multiSortMeta,filters:this.d_filters}},hasGlobalFilter(){return this.filters&&Object.prototype.hasOwnProperty.call(this.filters,"global")},getChildren(){return this.$slots.default?this.$slots.default():null},onFilterChange(t){this.d_filters=t},onFilterApply(){this.d_first=0,this.$emit("update:first",this.d_first),this.$emit("update:filters",this.d_filters),this.lazy&&this.$emit("filter",this.createLazyLoadEvent())},cloneFilters(){let t={};return this.filters&&Object.entries(this.filters).forEach(([e,n])=>{t[e]=n.operator?{operator:n.operator,constraints:n.constraints.map(i=>({...i}))}:{...n}}),t},updateReorderableColumns(){let t=[];this.columns.forEach(e=>t.push(this.columnProp(e,"columnKey")||this.columnProp(e,"field"))),this.d_columnOrder=t},createStyleElement(){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement)},createResponsiveStyle(){if(!this.responsiveStyleElement){this.responsiveStyleElement=document.createElement("style"),this.responsiveStyleElement.type="text/css",document.head.appendChild(this.responsiveStyleElement);let t=`.p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`,e=`.p-datatable[${this.attributeSelector}] > ${t}`,n=`.p-datatable[${this.attributeSelector}].p-datatable-gridlines > ${t}`,i=` @media screen and (max-width: ${this.breakpoint}) { ${e} > .p-datatable-thead > tr > th, ${e} > .p-datatable-tfoot > tr > td { display: none !important; } ${e} > .p-datatable-tbody > tr > td { display: flex; width: 100% !important; align-items: center; justify-content: space-between; } ${e} > .p-datatable-tbody > tr > td:not(:last-child) { border: 0 none; } ${n} > .p-datatable-tbody > tr > td:last-child { border-top: 0; border-right: 0; border-left: 0; } ${e} > .p-datatable-tbody > tr > td > .p-column-title { display: block; } } `;this.responsiveStyleElement.innerHTML=i}},destroyResponsiveStyle(){this.responsiveStyleElement&&(document.head.removeChild(this.responsiveStyleElement),this.responsiveStyleElement=null)},destroyStyleElement(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},recursiveGetChildren(t,e){return e||(e=[]),t&&t.length&&t.forEach(n=>{n.children instanceof Array?e.concat(this.recursiveGetChildren(n.children,e)):n.type.name=="Column"&&e.push(n)}),e},dataToRender(t){const e=t||this.processedData;if(e&&this.paginator){const n=this.lazy?0:this.d_first;return e.slice(n,n+this.d_rows)}return e},getVirtualScrollerRef(){return this.$refs.virtualScroller},hasSpacerStyle(t){return Nt.isNotEmpty(t)}},computed:{containerClass(){return["p-datatable p-component",{"p-datatable-hoverable-rows":this.rowHover||this.selectionMode,"p-datatable-resizable":this.resizableColumns,"p-datatable-resizable-fit":this.resizableColumns&&this.columnResizeMode==="fit","p-datatable-scrollable":this.scrollable,"p-datatable-flex-scrollable":this.scrollable&&this.scrollHeight==="flex","p-datatable-responsive-stack":this.responsiveLayout==="stack","p-datatable-responsive-scroll":this.responsiveLayout==="scroll","p-datatable-striped":this.stripedRows,"p-datatable-gridlines":this.showGridlines,"p-datatable-grouped-header":this.headerColumnGroup!=null,"p-datatable-grouped-footer":this.footerColumnGroup!=null}]},tableStyleClass(){return["p-datatable-table",{"p-datatable-scrollable-table":this.scrollable,"p-datatable-resizable-table":this.resizableColumns,"p-datatable-resizable-table-fit":this.resizableColumns&&this.columnResizeMode==="fit"},this.tableClass]},columns(){let t=this.getChildren();if(!t)return;const e=this.recursiveGetChildren(t,[]);if(this.reorderableColumns&&this.d_columnOrder){let n=[];for(let i of this.d_columnOrder){let r=this.findColumnByKey(e,i);r&&!this.columnProp(r,"hidden")&&n.push(r)}return[...n,...e.filter(i=>n.indexOf(i)<0)]}return e},headerColumnGroup(){const t=this.getChildren();if(t){for(let e of t)if(e.type.name==="ColumnGroup"&&this.columnProp(e,"type")==="header")return e}return null},footerColumnGroup(){const t=this.getChildren();if(t){for(let e of t)if(e.type.name==="ColumnGroup"&&this.columnProp(e,"type")==="footer")return e}return null},hasFilters(){return this.filters&&Object.keys(this.filters).length>0&&this.filters.constructor===Object},processedData(){let t=this.value||[];return this.lazy||t&&t.length&&(this.hasFilters&&(t=this.filter(t)),this.sorted&&(this.sortMode==="single"?t=this.sortSingle(t):this.sortMode==="multiple"&&(t=this.sortMultiple(t)))),t},totalRecordsLength(){if(this.lazy)return this.totalRecords;{const t=this.processedData;return t?t.length:0}},empty(){const t=this.processedData;return!t||t.length===0},paginatorTop(){return this.paginator&&(this.paginatorPosition!=="bottom"||this.paginatorPosition==="both")},paginatorBottom(){return this.paginator&&(this.paginatorPosition!=="top"||this.paginatorPosition==="both")},sorted(){return this.d_sortField||this.d_multiSortMeta&&this.d_multiSortMeta.length>0},loadingIconClass(){return["p-datatable-loading-icon pi-spin",this.loadingIcon]},allRowsSelected(){if(this.selectAll!==null)return this.selectAll;{const t=this.frozenValue?[...this.frozenValue,...this.processedData]:this.processedData;return Nt.isNotEmpty(t)&&this.selection&&Array.isArray(this.selection)&&t.every(e=>this.selection.some(n=>this.equals(n,e)))}},attributeSelector(){return Xs()},groupRowSortField(){return this.sortMode==="single"?this.sortField:this.d_groupRowsSortMeta?this.d_groupRowsSortMeta.field:null},virtualScrollerDisabled(){return Nt.isEmpty(this.virtualScrollerOptions)||!this.scrollable}},components:{DTPaginator:qA,DTTableHeader:tk,DTTableBody:QA,DTTableFooter:$A,DTVirtualScroller:Dy}};const VH={key:0,class:"p-datatable-loading-overlay p-component-overlay"},WH={key:1,class:"p-datatable-header"},qH={key:3,class:"p-datatable-footer"},GH={ref:"resizeHelper",class:"p-column-resizer-helper",style:{display:"none"}},KH={key:5,ref:"reorderIndicatorUp",class:"pi pi-arrow-down p-datatable-reorder-indicator-up",style:{position:"absolute",display:"none"}},YH={key:6,ref:"reorderIndicatorDown",class:"pi pi-arrow-up p-datatable-reorder-indicator-down",style:{position:"absolute",display:"none"}};function XH(t,e,n,i,r,s){const o=Bt("DTPaginator"),u=Bt("DTTableHeader"),d=Bt("DTTableBody"),h=Bt("DTTableFooter"),g=Bt("DTVirtualScroller");return G(),se("div",{class:Lt(s.containerClass),"data-scrollselectors":".p-datatable-wrapper"},[En(t.$slots,"default"),n.loading?(G(),se("div",VH,[t.$slots.loading?En(t.$slots,"loading",{key:0}):(G(),se("i",{key:1,class:Lt(s.loadingIconClass)},null,2))])):qe("",!0),t.$slots.header?(G(),se("div",WH,[En(t.$slots,"header")])):qe("",!0),s.paginatorTop?(G(),Ct(o,{key:2,rows:r.d_rows,first:r.d_first,totalRecords:s.totalRecordsLength,pageLinkSize:n.pageLinkSize,template:n.paginatorTemplate,rowsPerPageOptions:n.rowsPerPageOptions,currentPageReportTemplate:n.currentPageReportTemplate,class:"p-paginator-top",onPage:e[0]||(e[0]=y=>s.onPage(y)),alwaysShow:n.alwaysShowPaginator},yy({_:2},[t.$slots.paginatorstart?{name:"start",fn:jt(()=>[En(t.$slots,"paginatorstart")]),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:jt(()=>[En(t.$slots,"paginatorend")]),key:"1"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","alwaysShow"])):qe("",!0),ue("div",{class:"p-datatable-wrapper",style:hi({maxHeight:s.virtualScrollerDisabled?n.scrollHeight:""})},[gt(g,Ni({ref:"virtualScroller"},n.virtualScrollerOptions,{items:s.processedData,columns:s.columns,style:n.scrollHeight!=="flex"?{height:n.scrollHeight}:void 0,scrollHeight:n.scrollHeight!=="flex"?void 0:"100%",disabled:s.virtualScrollerDisabled,loaderDisabled:"",inline:"",autoSize:"",showSpacer:!1}),{content:jt(y=>[ue("table",Ni({ref:"table",role:"table",class:s.tableStyleClass,style:[n.tableStyle,y.spacerStyle]},n.tableProps),[gt(u,{columnGroup:s.headerColumnGroup,columns:y.columns,rowGroupMode:n.rowGroupMode,groupRowsBy:n.groupRowsBy,groupRowSortField:s.groupRowSortField,reorderableColumns:n.reorderableColumns,resizableColumns:n.resizableColumns,allRowsSelected:s.allRowsSelected,empty:s.empty,sortMode:n.sortMode,sortField:r.d_sortField,sortOrder:r.d_sortOrder,multiSortMeta:r.d_multiSortMeta,filters:r.d_filters,filtersStore:n.filters,filterDisplay:n.filterDisplay,filterInputProps:n.filterInputProps,onColumnClick:e[1]||(e[1]=w=>s.onColumnHeaderClick(w)),onColumnMousedown:e[2]||(e[2]=w=>s.onColumnHeaderMouseDown(w)),onFilterChange:s.onFilterChange,onFilterApply:s.onFilterApply,onColumnDragstart:e[3]||(e[3]=w=>s.onColumnHeaderDragStart(w)),onColumnDragover:e[4]||(e[4]=w=>s.onColumnHeaderDragOver(w)),onColumnDragleave:e[5]||(e[5]=w=>s.onColumnHeaderDragLeave(w)),onColumnDrop:e[6]||(e[6]=w=>s.onColumnHeaderDrop(w)),onColumnResizestart:e[7]||(e[7]=w=>s.onColumnResizeStart(w)),onCheckboxChange:e[8]||(e[8]=w=>s.toggleRowsWithCheckbox(w))},null,8,["columnGroup","columns","rowGroupMode","groupRowsBy","groupRowSortField","reorderableColumns","resizableColumns","allRowsSelected","empty","sortMode","sortField","sortOrder","multiSortMeta","filters","filtersStore","filterDisplay","filterInputProps","onFilterChange","onFilterApply"]),n.frozenValue?(G(),Ct(d,{key:0,ref:"frozenBodyRef",value:n.frozenValue,frozenRow:!0,class:"p-datatable-frozen-tbody",columns:y.columns,first:r.d_first,dataKey:n.dataKey,selection:n.selection,selectionKeys:r.d_selectionKeys,selectionMode:n.selectionMode,contextMenu:n.contextMenu,contextMenuSelection:n.contextMenuSelection,rowGroupMode:n.rowGroupMode,groupRowsBy:n.groupRowsBy,expandableRowGroups:n.expandableRowGroups,rowClass:n.rowClass,rowStyle:n.rowStyle,editMode:n.editMode,compareSelectionBy:n.compareSelectionBy,scrollable:n.scrollable,expandedRowIcon:n.expandedRowIcon,collapsedRowIcon:n.collapsedRowIcon,expandedRows:n.expandedRows,expandedRowKeys:r.d_expandedRowKeys,expandedRowGroups:n.expandedRowGroups,editingRows:n.editingRows,editingRowKeys:r.d_editingRowKeys,templates:t.$slots,responsiveLayout:n.responsiveLayout,isVirtualScrollerDisabled:!0,onRowgroupToggle:s.toggleRowGroup,onRowClick:e[9]||(e[9]=w=>s.onRowClick(w)),onRowDblclick:e[10]||(e[10]=w=>s.onRowDblClick(w)),onRowRightclick:e[11]||(e[11]=w=>s.onRowRightClick(w)),onRowTouchend:s.onRowTouchEnd,onRowKeydown:s.onRowKeyDown,onRowMousedown:s.onRowMouseDown,onRowDragstart:e[12]||(e[12]=w=>s.onRowDragStart(w)),onRowDragover:e[13]||(e[13]=w=>s.onRowDragOver(w)),onRowDragleave:e[14]||(e[14]=w=>s.onRowDragLeave(w)),onRowDragend:e[15]||(e[15]=w=>s.onRowDragEnd(w)),onRowDrop:e[16]||(e[16]=w=>s.onRowDrop(w)),onRowToggle:e[17]||(e[17]=w=>s.toggleRow(w)),onRadioChange:e[18]||(e[18]=w=>s.toggleRowWithRadio(w)),onCheckboxChange:e[19]||(e[19]=w=>s.toggleRowWithCheckbox(w)),onCellEditInit:e[20]||(e[20]=w=>s.onCellEditInit(w)),onCellEditComplete:e[21]||(e[21]=w=>s.onCellEditComplete(w)),onCellEditCancel:e[22]||(e[22]=w=>s.onCellEditCancel(w)),onRowEditInit:e[23]||(e[23]=w=>s.onRowEditInit(w)),onRowEditSave:e[24]||(e[24]=w=>s.onRowEditSave(w)),onRowEditCancel:e[25]||(e[25]=w=>s.onRowEditCancel(w)),editingMeta:r.d_editingMeta,onEditingMetaChange:s.onEditingMetaChange},null,8,["value","columns","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowKeys","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange"])):qe("",!0),gt(d,{ref:"bodyRef",value:s.dataToRender(y.rows),class:Lt(y.styleClass),columns:y.columns,empty:s.empty,first:r.d_first,dataKey:n.dataKey,selection:n.selection,selectionKeys:r.d_selectionKeys,selectionMode:n.selectionMode,contextMenu:n.contextMenu,contextMenuSelection:n.contextMenuSelection,rowGroupMode:n.rowGroupMode,groupRowsBy:n.groupRowsBy,expandableRowGroups:n.expandableRowGroups,rowClass:n.rowClass,rowStyle:n.rowStyle,editMode:n.editMode,compareSelectionBy:n.compareSelectionBy,scrollable:n.scrollable,expandedRowIcon:n.expandedRowIcon,collapsedRowIcon:n.collapsedRowIcon,expandedRows:n.expandedRows,expandedRowKeys:r.d_expandedRowKeys,expandedRowGroups:n.expandedRowGroups,editingRows:n.editingRows,editingRowKeys:r.d_editingRowKeys,templates:t.$slots,responsiveLayout:n.responsiveLayout,virtualScrollerContentProps:y,isVirtualScrollerDisabled:s.virtualScrollerDisabled,onRowgroupToggle:s.toggleRowGroup,onRowClick:e[26]||(e[26]=w=>s.onRowClick(w)),onRowDblclick:e[27]||(e[27]=w=>s.onRowDblClick(w)),onRowRightclick:e[28]||(e[28]=w=>s.onRowRightClick(w)),onRowTouchend:s.onRowTouchEnd,onRowKeydown:w=>s.onRowKeyDown(w,y),onRowMousedown:s.onRowMouseDown,onRowDragstart:e[29]||(e[29]=w=>s.onRowDragStart(w)),onRowDragover:e[30]||(e[30]=w=>s.onRowDragOver(w)),onRowDragleave:e[31]||(e[31]=w=>s.onRowDragLeave(w)),onRowDragend:e[32]||(e[32]=w=>s.onRowDragEnd(w)),onRowDrop:e[33]||(e[33]=w=>s.onRowDrop(w)),onRowToggle:e[34]||(e[34]=w=>s.toggleRow(w)),onRadioChange:e[35]||(e[35]=w=>s.toggleRowWithRadio(w)),onCheckboxChange:e[36]||(e[36]=w=>s.toggleRowWithCheckbox(w)),onCellEditInit:e[37]||(e[37]=w=>s.onCellEditInit(w)),onCellEditComplete:e[38]||(e[38]=w=>s.onCellEditComplete(w)),onCellEditCancel:e[39]||(e[39]=w=>s.onCellEditCancel(w)),onRowEditInit:e[40]||(e[40]=w=>s.onRowEditInit(w)),onRowEditSave:e[41]||(e[41]=w=>s.onRowEditSave(w)),onRowEditCancel:e[42]||(e[42]=w=>s.onRowEditCancel(w)),editingMeta:r.d_editingMeta,onEditingMetaChange:s.onEditingMetaChange},null,8,["value","class","columns","empty","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowKeys","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","virtualScrollerContentProps","isVirtualScrollerDisabled","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange"]),s.hasSpacerStyle(y.spacerStyle)?(G(),se("tbody",{key:1,style:hi({height:`calc(${y.spacerStyle.height} - ${y.rows.length*y.itemSize}px)`}),class:"p-datatable-virtualscroller-spacer"},null,4)):qe("",!0),gt(h,{columnGroup:s.footerColumnGroup,columns:y.columns},null,8,["columnGroup","columns"])],16)]),_:1},16,["items","columns","style","scrollHeight","disabled"])],4),t.$slots.footer?(G(),se("div",qH,[En(t.$slots,"footer")])):qe("",!0),s.paginatorBottom?(G(),Ct(o,{key:4,rows:r.d_rows,first:r.d_first,totalRecords:s.totalRecordsLength,pageLinkSize:n.pageLinkSize,template:n.paginatorTemplate,rowsPerPageOptions:n.rowsPerPageOptions,currentPageReportTemplate:n.currentPageReportTemplate,class:"p-paginator-bottom",onPage:e[43]||(e[43]=y=>s.onPage(y)),alwaysShow:n.alwaysShowPaginator},yy({_:2},[t.$slots.paginatorstart?{name:"start",fn:jt(()=>[En(t.$slots,"paginatorstart")]),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:jt(()=>[En(t.$slots,"paginatorend")]),key:"1"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","alwaysShow"])):qe("",!0),ue("div",GH,null,512),n.reorderableColumns?(G(),se("span",KH,null,512)):qe("",!0),n.reorderableColumns?(G(),se("span",YH,null,512)):qe("",!0)],2)}function ZH(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var QH=` .p-datatable { position: relative; } .p-datatable > .p-datatable-wrapper { overflow: auto; } .p-datatable-table { border-spacing: 0px; width: 100%; } .p-datatable .p-sortable-column { cursor: pointer; user-select: none; } .p-datatable .p-sortable-column .p-column-title, .p-datatable .p-sortable-column .p-sortable-column-icon, .p-datatable .p-sortable-column .p-sortable-column-badge { vertical-align: middle; } .p-datatable .p-sortable-column .p-sortable-column-badge { display: inline-flex; align-items: center; justify-content: center; } .p-datatable-hoverable-rows .p-selectable-row { cursor: pointer; } /* Scrollable */ .p-datatable-scrollable > .p-datatable-wrapper { position: relative; } .p-datatable-scrollable-table > .p-datatable-thead { position: sticky; top: 0; z-index: 1; } .p-datatable-scrollable-table > .p-datatable-frozen-tbody { position: sticky; z-index: 1; } .p-datatable-scrollable-table > .p-datatable-tfoot { position: sticky; bottom: 0; z-index: 1; } .p-datatable-scrollable .p-frozen-column { position: sticky; background: inherit; } .p-datatable-scrollable th.p-frozen-column { z-index: 1; } .p-datatable-flex-scrollable { display: flex; flex-direction: column; height: 100%; } .p-datatable-flex-scrollable > .p-datatable-wrapper { display: flex; flex-direction: column; flex: 1; height: 100%; } .p-datatable-scrollable-table > .p-datatable-tbody > .p-rowgroup-header { position: sticky; z-index: 1; } /* Resizable */ .p-datatable-resizable-table > .p-datatable-thead > tr > th, .p-datatable-resizable-table > .p-datatable-tfoot > tr > td, .p-datatable-resizable-table > .p-datatable-tbody > tr > td { overflow: hidden; white-space: nowrap; } .p-datatable-resizable-table > .p-datatable-thead > tr > th.p-resizable-column:not(.p-frozen-column) { background-clip: padding-box; position: relative; } .p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-resizable-column:last-child .p-column-resizer { display: none; } .p-datatable .p-column-resizer { display: block; position: absolute !important; top: 0; right: 0; margin: 0; width: 0.5rem; height: 100%; padding: 0px; cursor: col-resize; border: 1px solid transparent; } .p-datatable .p-column-header-content { display: flex; align-items: center; } .p-datatable .p-column-resizer-helper { width: 1px; position: absolute; z-index: 10; display: none; } .p-datatable .p-row-editor-init, .p-datatable .p-row-editor-save, .p-datatable .p-row-editor-cancel { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Expand */ .p-datatable .p-row-toggler { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Reorder */ .p-datatable-reorder-indicator-up, .p-datatable-reorder-indicator-down { position: absolute; display: none; } .p-reorderable-column, .p-datatable-reorderablerow-handle { cursor: move; } /* Loader */ .p-datatable .p-datatable-loading-overlay { position: absolute; display: flex; align-items: center; justify-content: center; z-index: 2; } /* Filter */ .p-column-filter-row { display: flex; align-items: center; width: 100%; } .p-column-filter-menu { display: inline-flex; margin-left: auto; } .p-column-filter-row .p-column-filter-element { flex: 1 1 auto; width: 1%; } .p-column-filter-menu-button, .p-column-filter-clear-button { display: inline-flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; overflow: hidden; position: relative; } .p-column-filter-overlay { position: absolute; top: 0; left: 0; } .p-column-filter-row-items { margin: 0; padding: 0; list-style: none; } .p-column-filter-row-item { cursor: pointer; } .p-column-filter-add-button, .p-column-filter-remove-button { justify-content: center; } .p-column-filter-add-button .p-button-label, .p-column-filter-remove-button .p-button-label { flex-grow: 0; } .p-column-filter-buttonbar { display: flex; align-items: center; justify-content: space-between; } .p-column-filter-buttonbar .p-button:not(.p-button-icon-only) { width: auto; } /* Responsive */ .p-datatable .p-datatable-tbody > tr > td > .p-column-title { display: none; } /* VirtualScroller */ .p-datatable-virtualscroller-spacer { display: flex; } .p-datatable .p-virtualscroller .p-virtualscroller-loading { transform: none !important; min-height: 0; position: sticky; top: 0; left: 0; } `;ZH(QH),Ly.render=XH;var Vw={name:"Column",props:{columnKey:{type:null,default:null},field:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},filterField:{type:[String,Function],default:null},dataType:{type:String,default:"text"},sortable:{type:Boolean,default:!1},header:{type:null,default:null},footer:{type:null,default:null},style:{type:null,default:null},class:{type:String,default:null},headerStyle:{type:null,default:null},headerClass:{type:String,default:null},bodyStyle:{type:null,default:null},bodyClass:{type:String,default:null},footerStyle:{type:null,default:null},footerClass:{type:String,default:null},showFilterMenu:{type:Boolean,default:!0},showFilterOperator:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showApplyButton:{type:Boolean,default:!0},showFilterMatchModes:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},filterMatchModeOptions:{type:Array,default:null},maxConstraints:{type:Number,default:2},excludeGlobalFilter:{type:Boolean,default:!1},filterHeaderClass:{type:String,default:null},filterHeaderStyle:{type:null,default:null},filterMenuClass:{type:String,default:null},filterMenuStyle:{type:null,default:null},selectionMode:{type:String,default:null},expander:{type:Boolean,default:!1},colspan:{type:Number,default:null},rowspan:{type:Number,default:null},rowReorder:{type:Boolean,default:!1},rowReorderIcon:{type:String,default:"pi pi-bars"},reorderableColumn:{type:Boolean,default:!0},rowEditor:{type:Boolean,default:!1},frozen:{type:Boolean,default:!1},alignFrozen:{type:String,default:"left"},exportable:{type:Boolean,default:!0},exportHeader:{type:String,default:null},exportFooter:{type:String,default:null},filterMatchMode:{type:String,default:null},hidden:{type:Boolean,default:!1}},render(){return null}},nk={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null},level:{type:Number,default:null},index:{type:Number,default:null}},nodeTouched:!1,mounted(){this.$refs.currentNode.closest(".p-treeselect-items-wrapper")&&this.setAllNodesTabIndexes()},methods:{toggle(){this.$emit("node-toggle",this.node)},label(t){return typeof t.label=="function"?t.label():t.label},onChildNodeToggle(t){this.$emit("node-toggle",t)},onClick(t){Ne.hasClass(t.target,"p-tree-toggler")||Ne.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(t){this.$emit("node-click",t)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(t){if(this.isSameNode(t))switch(t.code){case"Tab":this.onTabKey(t);break;case"ArrowDown":this.onArrowDown(t);break;case"ArrowUp":this.onArrowUp(t);break;case"ArrowRight":this.onArrowRight(t);break;case"ArrowLeft":this.onArrowLeft(t);break;case"Enter":case"Space":this.onEnterKey(t);break}},onArrowDown(t){const e=t.target,n=e.children[1];if(n)this.focusRowChange(e,n.children[0]);else if(e.nextElementSibling)this.focusRowChange(e,e.nextElementSibling);else{let i=this.findNextSiblingOfAncestor(e);i&&this.focusRowChange(e,i)}t.preventDefault()},onArrowUp(t){const e=t.target;if(e.previousElementSibling)this.focusRowChange(e,e.previousElementSibling,this.findLastVisibleDescendant(e.previousElementSibling));else{let n=this.getParentNodeElement(e);n&&this.focusRowChange(e,n)}t.preventDefault()},onArrowRight(t){this.leaf||this.expanded||(t.currentTarget.tabIndex=-1,this.$emit("node-toggle",this.node),this.$nextTick(()=>{this.onArrowDown(t)}))},onArrowLeft(t){const e=Ne.findSingle(t.currentTarget,".p-tree-toggler");if(this.level===0&&!this.expanded)return!1;if(this.expanded&&!this.leaf)return e.click(),!1;const n=this.findBeforeClickableNode(t.currentTarget);n&&this.focusRowChange(t.currentTarget,n)},onEnterKey(t){this.setTabIndexForSelectionMode(t,this.nodeTouched),this.onClick(t),t.preventDefault()},onTabKey(){this.setAllNodesTabIndexes()},setAllNodesTabIndexes(){const t=Ne.find(this.$refs.currentNode.closest(".p-tree-container"),".p-treenode"),e=[...t].some(n=>n.getAttribute("aria-selected")==="true"||n.getAttribute("aria-checked")==="true");if([...t].forEach(n=>{n.tabIndex=-1}),e){const n=[...t].filter(i=>i.getAttribute("aria-selected")==="true"||i.getAttribute("aria-checked")==="true");n[0].tabIndex=0;return}[...t][0].tabIndex=0},setTabIndexForSelectionMode(t,e){if(this.selectionMode!==null){const n=[...Ne.find(this.$refs.currentNode.parentElement,".p-treenode")];t.currentTarget.tabIndex=e===!1?-1:0,n.every(i=>i.tabIndex===-1)&&(n[0].tabIndex=0)}},focusRowChange(t,e,n){t.tabIndex="-1",e.tabIndex="0",this.focusNode(n||e)},findBeforeClickableNode(t){const e=t.closest("ul").closest("li");if(e){const n=Ne.findSingle(e,"button");return n&&n.style.visibility!=="hidden"?e:this.findBeforeClickableNode(t.previousElementSibling)}return null},toggleCheckbox(){let t=this.selectionKeys?{...this.selectionKeys}:{};const e=!this.checked;this.propagateDown(this.node,e,t),this.$emit("checkbox-change",{node:this.node,check:e,selectionKeys:t})},propagateDown(t,e,n){if(e?n[t.key]={checked:!0,partialChecked:!1}:delete n[t.key],t.children&&t.children.length)for(let i of t.children)this.propagateDown(i,e,n)},propagateUp(t){let e=t.check,n={...t.selectionKeys},i=0,r=!1;for(let s of this.node.children)n[s.key]&&n[s.key].checked?i++:n[s.key]&&n[s.key].partialChecked&&(r=!0);e&&i===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(e||delete n[this.node.key],r||i>0&&i!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:t.node,check:t.check,selectionKeys:n})},onChildCheckboxChange(t){this.$emit("checkbox-change",t)},findNextSiblingOfAncestor(t){let e=this.getParentNodeElement(t);return e?e.nextElementSibling?e.nextElementSibling:this.findNextSiblingOfAncestor(e):null},findLastVisibleDescendant(t){const e=t.children[1];if(e){const n=e.children[e.children.length-1];return this.findLastVisibleDescendant(n)}else return t},getParentNodeElement(t){const e=t.parentElement.parentElement;return Ne.hasClass(e,"p-treenode")?e:null},focusNode(t){t.focus()},isCheckboxSelectionMode(){return this.selectionMode==="checkbox"},isSameNode(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest(".p-treenode")))}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&this.expandedKeys[this.node.key]===!0},leaf(){return this.node.leaf===!1?!1:!(this.node.children&&this.node.children.length)},selectable(){return this.node.selectable===!1?!1:this.selectionMode!=null},selected(){return this.selectionMode&&this.selectionKeys?this.selectionKeys[this.node.key]===!0:!1},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return this.selectionMode==="checkbox"&&this.node.selectable!==!1},checked(){return this.selectionKeys?this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked:!1},partialChecked(){return this.selectionKeys?this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked:!1},ariaChecked(){return this.selectionMode==="single"||this.selectionMode==="multiple"?this.selected:void 0},ariaSelected(){return this.checkboxMode?this.checked:void 0}},directives:{ripple:po}};const JH=["aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level","aria-checked","tabindex"],$H={key:0,class:"p-checkbox p-component","aria-hidden":"true"},e8={class:"p-treenode-label"},t8={key:0,class:"p-treenode-children",role:"group"};function n8(t,e,n,i,r,s){const o=Bt("TreeNode",!0),u=_s("ripple");return G(),se("li",{ref:"currentNode",class:Lt(s.containerClass),role:"treeitem","aria-label":s.label(n.node),"aria-selected":s.ariaSelected,"aria-expanded":s.expanded,"aria-setsize":n.node.children?n.node.children.length:0,"aria-posinset":n.index+1,"aria-level":n.level,"aria-checked":s.ariaChecked,tabindex:n.index===0?0:-1,onKeydown:e[3]||(e[3]=(...d)=>s.onKeyDown&&s.onKeyDown(...d))},[ue("div",{class:Lt(s.contentClass),onClick:e[1]||(e[1]=(...d)=>s.onClick&&s.onClick(...d)),onTouchend:e[2]||(e[2]=(...d)=>s.onTouchEnd&&s.onTouchEnd(...d)),style:hi(n.node.style)},[ei((G(),se("button",{type:"button",class:"p-tree-toggler p-link",onClick:e[0]||(e[0]=(...d)=>s.toggle&&s.toggle(...d)),tabindex:"-1","aria-hidden":"true"},[ue("span",{class:Lt(s.toggleIcon)},null,2)])),[[u]]),s.checkboxMode?(G(),se("div",$H,[ue("div",{class:Lt(s.checkboxClass),role:"checkbox"},[ue("span",{class:Lt(s.checkboxIcon)},null,2)],2)])):qe("",!0),ue("span",{class:Lt(s.icon)},null,2),ue("span",e8,[n.templates[n.node.type]||n.templates.default?(G(),Ct(us(n.templates[n.node.type]||n.templates.default),{key:0,node:n.node},null,8,["node"])):(G(),se(xt,{key:1},[Jn(lt(s.label(n.node)),1)],64))])],38),s.hasChildren&&s.expanded?(G(),se("ul",t8,[(G(!0),se(xt,null,hn(n.node.children,d=>(G(),Ct(o,{key:d.key,node:d,templates:n.templates,level:n.level+1,expandedKeys:n.expandedKeys,onNodeToggle:s.onChildNodeToggle,onNodeClick:s.onChildNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:s.propagateUp},null,8,["node","templates","level","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"]))),128))])):qe("",!0)],42,JH)}nk.render=n8;var Ww={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null},level:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(t){this.d_expandedKeys=t}},methods:{onNodeToggle(t){const e=t.key;this.d_expandedKeys[e]?(delete this.d_expandedKeys[e],this.$emit("node-collapse",t)):(this.d_expandedKeys[e]=!0,this.$emit("node-expand",t)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(t){if(this.selectionMode!=null&&t.node.selectable!==!1){const n=(t.nodeTouched?!1:this.metaKeySelection)?this.handleSelectionWithMetaKey(t):this.handleSelectionWithoutMetaKey(t);this.$emit("update:selectionKeys",n)}},onCheckboxChange(t){this.$emit("update:selectionKeys",t.selectionKeys),t.check?this.$emit("node-select",t.node):this.$emit("node-unselect",t.node)},handleSelectionWithMetaKey(t){const e=t.originalEvent,n=t.node,i=e.metaKey||e.ctrlKey,r=this.isNodeSelected(n);let s;return r&&i?(this.isSingleSelectionMode()?s={}:(s={...this.selectionKeys},delete s[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?s={}:this.isMultipleSelectionMode()&&(s=i?this.selectionKeys?{...this.selectionKeys}:{}:{}),s[n.key]=!0,this.$emit("node-select",n)),s},handleSelectionWithoutMetaKey(t){const e=t.node,n=this.isNodeSelected(e);let i;return this.isSingleSelectionMode()?n?(i={},this.$emit("node-unselect",e)):(i={},i[e.key]=!0,this.$emit("node-select",e)):n?(i={...this.selectionKeys},delete i[e.key],this.$emit("node-unselect",e)):(i=this.selectionKeys?{...this.selectionKeys}:{},i[e.key]=!0,this.$emit("node-select",e)),i},isSingleSelectionMode(){return this.selectionMode==="single"},isMultipleSelectionMode(){return this.selectionMode==="multiple"},isNodeSelected(t){return this.selectionMode&&this.selectionKeys?this.selectionKeys[t.key]===!0:!1},isChecked(t){return this.selectionKeys?this.selectionKeys[t.key]&&this.selectionKeys[t.key].checked:!1},isNodeLeaf(t){return t.leaf===!1?!1:!(t.children&&t.children.length)},onFilterKeydown(t){t.which===13&&t.preventDefault()},findFilteredNodes(t,e){if(t){let n=!1;if(t.children){let i=[...t.children];t.children=[];for(let r of i){let s={...r};this.isFilterMatched(s,e)&&(n=!0,t.children.push(s))}}if(n)return!0}},isFilterMatched(t,{searchFields:e,filterText:n,strict:i}){let r=!1;for(let s of e)String(Nt.resolveFieldData(t,s)).toLocaleLowerCase(this.filterLocale).indexOf(n)>-1&&(r=!0);return(!r||i&&!this.isNodeLeaf(t))&&(r=this.findFilteredNodes(t,{searchFields:e,filterText:n,strict:i})||r),r}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":this.selectionMode!=null,"p-tree-loading":this.loading,"p-tree-flex-scrollable":this.scrollHeight==="flex"}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let t=[];const e=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),i=this.filterMode==="strict";for(let r of this.value){let s={...r},o={searchFields:e,filterText:n,strict:i};(i&&(this.findFilteredNodes(s,o)||this.isFilterMatched(s,o))||!i&&(this.isFilterMatched(s,o)||this.findFilteredNodes(s,o)))&&t.push(s)}return t},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:nk}};const i8={key:0,class:"p-tree-loading-overlay p-component-overlay"},r8={key:1,class:"p-tree-filter-container"},s8=["placeholder"],o8=ue("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),a8=["aria-labelledby","aria-label"];function l8(t,e,n,i,r,s){const o=Bt("TreeNode");return G(),se("div",{class:Lt(s.containerClass)},[n.loading?(G(),se("div",i8,[ue("i",{class:Lt(s.loadingIconClass)},null,2)])):qe("",!0),n.filter?(G(),se("div",r8,[ei(ue("input",{"onUpdate:modelValue":e[0]||(e[0]=u=>r.filterValue=u),type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:n.filterPlaceholder,onKeydown:e[1]||(e[1]=(...u)=>s.onFilterKeydown&&s.onFilterKeydown(...u))},null,40,s8),[[xA,r.filterValue]]),o8])):qe("",!0),ue("div",{class:"p-tree-wrapper",style:hi({maxHeight:n.scrollHeight})},[ue("ul",{class:"p-tree-container",role:"tree","aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel},[(G(!0),se(xt,null,hn(s.valueToRender,(u,d)=>(G(),Ct(o,{key:u.key,node:u,templates:t.$slots,level:n.level+1,index:d,expandedKeys:r.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","level","index","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"]))),128))],8,a8)],4)],2)}function u8(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var c8=` .p-tree-container { margin: 0; padding: 0; list-style-type: none; overflow: auto; } .p-treenode-children { margin: 0; padding: 0; list-style-type: none; } .p-tree-wrapper { overflow: auto; } .p-treenode-selectable { cursor: pointer; user-select: none; } .p-tree-toggler { cursor: pointer; user-select: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; flex-shrink: 0; } .p-treenode-leaf > .p-treenode-content .p-tree-toggler { visibility: hidden; } .p-treenode-content { display: flex; align-items: center; } .p-tree-filter { width: 100%; } .p-tree-filter-container { position: relative; display: block; width: 100%; } .p-tree-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-tree-loading { position: relative; min-height: 4rem; } .p-tree .p-tree-loading-overlay { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; } .p-tree-flex-scrollable { display: flex; flex: 1; height: 100%; flex-direction: column; } .p-tree-flex-scrollable .p-tree-wrapper { flex: 1; } `;u8(c8),Ww.render=l8;var ik={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+Ne.getWindowScrollLeft(),this.initY=t.top+Ne.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(t){let e,n=t.touches?t.touches[0].pageX:t.pageX,i=t.touches?t.touches[0].pageY:t.pageY;this.orientation==="horizontal"?e=(n-this.initX)*100/this.barWidth:e=(this.initY+this.barHeight-i)*100/this.barHeight;let r=(this.max-this.min)*(e/100)+this.min;if(this.step){const s=this.range?this.modelValue[this.handleIndex]:this.modelValue,o=r-s;o<0?r=s+Math.ceil(r/this.step-s/this.step)*this.step:o>0&&(r=s+Math.floor(r/this.step-s/this.step)*this.step)}else r=Math.floor(r);this.updateModel(t,r)},updateModel(t,e){let n=parseFloat(e.toFixed(10)),i;this.range?(i=this.modelValue?[...this.modelValue]:[],this.handleIndex==0?(n=this.max&&(n=this.max),i[0]=n):(n>this.max?n=this.max:n<=this.min&&(n=this.min),i[1]=n)):(nthis.max&&(n=this.max),i=n),this.$emit("update:modelValue",i),this.$emit("change",i)},onDragStart(t,e){this.disabled||(Ne.addClass(this.$el,"p-slider-sliding"),this.dragging=!0,this.updateDomData(),this.range&&this.modelValue[0]===this.max?this.handleIndex=0:this.handleIndex=e,t.currentTarget.focus(),t.preventDefault())},onDrag(t){this.dragging&&(this.setValue(t),t.preventDefault())},onDragEnd(t){this.dragging&&(this.dragging=!1,Ne.removeClass(this.$el,"p-slider-sliding"),this.$emit("slideend",{originalEvent:t,value:this.modelValue}))},onBarClick(t){this.disabled||Ne.hasClass(t.target,"p-slider-handle")||(this.updateDomData(),this.setValue(t))},onMouseDown(t,e){this.bindDragListeners(),this.onDragStart(t,e)},onKeyDown(t,e){switch(this.handleIndex=e,t.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(t,e),t.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(t,e),t.preventDefault();break;case"PageDown":this.decrementValue(t,e,!0),t.preventDefault();break;case"PageUp":this.incrementValue(t,e,!0),t.preventDefault();break;case"Home":this.updateModel(t,this.min),t.preventDefault();break;case"End":this.updateModel(t,this.max),t.preventDefault();break}},decrementValue(t,e,n=!1){let i;this.range?this.step?i=this.modelValue[e]-this.step:i=this.modelValue[e]-1:this.step?i=this.modelValue-this.step:!this.step&&n?i=this.modelValue-10:i=this.modelValue-1,this.updateModel(t,i),t.preventDefault()},incrementValue(t,e,n=!1){let i;this.range?this.step?i=this.modelValue[e]+this.step:i=this.modelValue[e]+1:this.step?i=this.modelValue+this.step:!this.step&&n?i=this.modelValue+10:i=this.modelValue+1,this.updateModel(t,i),t.preventDefault()},bindDragListeners(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{containerClass(){return["p-slider p-component",{"p-disabled":this.disabled,"p-slider-horizontal":this.orientation==="horizontal","p-slider-vertical":this.orientation==="vertical"}]},horizontal(){return this.orientation==="horizontal"},vertical(){return this.orientation==="vertical"},rangeStyle(){if(this.range){const t=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,e=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:e+"%",width:t+"%"}:{bottom:e+"%",height:t+"%"}}else return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition(){return this.modelValuethis.max?100:(this.modelValue-this.min)*100/(this.max-this.min)},rangeStartPosition(){return this.modelValue&&this.modelValue[0]?(this.modelValue[0]this.max?100:this.modelValue[1]-this.min)*100/(this.max-this.min):100},rangeStartHandleStyle(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}};const d8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],h8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],p8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];function f8(t,e,n,i,r,s){return G(),se("div",{class:Lt(s.containerClass),onClick:e[15]||(e[15]=(...o)=>s.onBarClick&&s.onBarClick(...o))},[ue("span",{class:"p-slider-range",style:hi(s.rangeStyle)},null,4),n.range?qe("",!0):(G(),se("span",{key:0,class:"p-slider-handle",style:hi(s.handleStyle),onTouchstart:e[0]||(e[0]=o=>s.onDragStart(o)),onTouchmove:e[1]||(e[1]=o=>s.onDrag(o)),onTouchend:e[2]||(e[2]=o=>s.onDragEnd(o)),onMousedown:e[3]||(e[3]=o=>s.onMouseDown(o)),onKeydown:e[4]||(e[4]=o=>s.onKeyDown(o)),tabindex:n.tabindex,role:"slider","aria-valuemin":n.min,"aria-valuenow":n.modelValue,"aria-valuemax":n.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":n.orientation},null,44,d8)),n.range?(G(),se("span",{key:1,class:"p-slider-handle",style:hi(s.rangeStartHandleStyle),onTouchstart:e[5]||(e[5]=o=>s.onDragStart(o,0)),onTouchmove:e[6]||(e[6]=o=>s.onDrag(o)),onTouchend:e[7]||(e[7]=o=>s.onDragEnd(o)),onMousedown:e[8]||(e[8]=o=>s.onMouseDown(o,0)),onKeydown:e[9]||(e[9]=o=>s.onKeyDown(o,0)),tabindex:n.tabindex,role:"slider","aria-valuemin":n.min,"aria-valuenow":n.modelValue?n.modelValue[0]:null,"aria-valuemax":n.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":n.orientation},null,44,h8)):qe("",!0),n.range?(G(),se("span",{key:2,class:"p-slider-handle",style:hi(s.rangeEndHandleStyle),onTouchstart:e[10]||(e[10]=o=>s.onDragStart(o,1)),onTouchmove:e[11]||(e[11]=o=>s.onDrag(o)),onTouchend:e[12]||(e[12]=o=>s.onDragEnd(o)),onMousedown:e[13]||(e[13]=o=>s.onMouseDown(o,1)),onKeydown:e[14]||(e[14]=o=>s.onKeyDown(o,1)),tabindex:n.tabindex,role:"slider","aria-valuemin":n.min,"aria-valuenow":n.modelValue?n.modelValue[1]:null,"aria-valuemax":n.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":n.orientation},null,44,p8)):qe("",!0)],2)}function m8(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var g8=` .p-slider { position: relative; } .p-slider .p-slider-handle { position: absolute; cursor: grab; touch-action: none; display: block; } .p-slider-range { position: absolute; display: block; } .p-slider-horizontal .p-slider-range { top: 0; left: 0; height: 100%; } .p-slider-horizontal .p-slider-handle { top: 50%; } .p-slider-vertical { height: 100px; } .p-slider-vertical .p-slider-handle { left: 50%; } .p-slider-vertical .p-slider-range { bottom: 0; left: 0; width: 100%; } `;m8(g8),ik.render=f8;var nm={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:$c(()=>this._instance)}},data(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&Lo.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(t){t.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&Lo.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&Ne.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave(){this.autoZIndex&&Lo.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(t){this.dismissableMask&&this.modal&&this.mask===t.target&&this.close()},focus(){const t=n=>n.querySelector("[autofocus]");let e=this.$slots.footer&&t(this.footerContainer);e||(e=this.$slots.header&&t(this.headerContainer),e||(e=this.$slots.default&&t(this.content),e||(this.maximizable?(this.focusableMax=!0,e=this.maximizableButton):(this.focusableClose=!0,e=this.closeButton)))),e&&Ne.focus(e)},maximize(t){this.maximized?(this.maximized=!1,this.$emit("unmaximize",t)):(this.maximized=!0,this.$emit("maximize",t)),this.modal||(this.maximized?Ne.addClass(document.body,"p-overflow-hidden"):Ne.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&Ne.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&Ne.removeClass(document.body,"p-overflow-hidden")},onKeyDown(t){t.code==="Escape"&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(n=>n===this.position);return e?`p-dialog-${e}`:""},containerRef(t){this.container=t},maskRef(t){this.mask=t},contentRef(t){this.content=t},headerContainerRef(t){this.headerContainer=t},footerContainerRef(t){this.footerContainer=t},maximizableRef(t){this.maximizableButton=t},closeButtonRef(t){this.closeButton=t},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let t="";for(let e in this.breakpoints)t+=` @media screen and (max-width: ${e}) { .p-dialog[${this.attributeSelector}] { width: ${this.breakpoints[e]} !important; } } `;this.styleElement.innerHTML=t}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(t){Ne.hasClass(t.target,"p-dialog-header-icon")||Ne.hasClass(t.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,this.container.style.margin="0",Ne.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=t=>{if(this.dragging){let e=Ne.getOuterWidth(this.container),n=Ne.getOuterHeight(this.container),i=t.pageX-this.lastPageX,r=t.pageY-this.lastPageY,s=this.container.getBoundingClientRect(),o=s.left+i,u=s.top+r,d=Ne.getViewport();this.container.style.position="fixed",this.keepInViewport?(o>=this.minX&&o+e=this.minY&&u+n{this.dragging&&(this.dragging=!1,Ne.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",t))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId(){return Xs()},ariaLabelledById(){return this.header!=null||this.$attrs["aria-labelledby"]!==null?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector(){return Xs()},contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:po,focustrap:KA},components:{Portal:em}};const y8=["aria-labelledby","aria-modal"],v8=["id"],b8={class:"p-dialog-header-icons"},w8=["autofocus","tabindex"],_8=["autofocus","aria-label"];function S8(t,e,n,i,r,s){const o=Bt("Portal"),u=_s("ripple"),d=_s("focustrap");return G(),Ct(o,{appendTo:n.appendTo},{default:jt(()=>[r.containerVisible?(G(),se("div",{key:0,ref:s.maskRef,class:Lt(s.maskClass),onClick:e[3]||(e[3]=(...h)=>s.onMaskClick&&s.onMaskClick(...h))},[gt(lu,{name:"p-dialog",onBeforeEnter:s.onBeforeEnter,onEnter:s.onEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},{default:jt(()=>[n.visible?ei((G(),se("div",Ni({key:0,ref:s.containerRef,class:s.dialogClass,role:"dialog","aria-labelledby":s.ariaLabelledById,"aria-modal":n.modal},t.$attrs),[n.showHeader?(G(),se("div",{key:0,ref:s.headerContainerRef,class:"p-dialog-header",onMousedown:e[2]||(e[2]=(...h)=>s.initDrag&&s.initDrag(...h))},[En(t.$slots,"header",{},()=>[n.header?(G(),se("span",{key:0,id:s.ariaLabelledById,class:"p-dialog-title"},lt(n.header),9,v8)):qe("",!0)]),ue("div",b8,[n.maximizable?ei((G(),se("button",{key:0,ref:s.maximizableRef,autofocus:r.focusableMax,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:e[0]||(e[0]=(...h)=>s.maximize&&s.maximize(...h)),type:"button",tabindex:n.maximizable?"0":"-1"},[ue("span",{class:Lt(s.maximizeIconClass)},null,2)],8,w8)),[[u]]):qe("",!0),n.closable?ei((G(),se("button",Ni({key:1,ref:s.closeButtonRef,autofocus:r.focusableClose,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:e[1]||(e[1]=(...h)=>s.close&&s.close(...h)),"aria-label":s.closeAriaLabel,type:"button"},n.closeButtonProps),[ue("span",{class:Lt(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,_8)),[[u]]):qe("",!0)])],544)):qe("",!0),ue("div",Ni({ref:s.contentRef,class:s.contentStyleClass,style:n.contentStyle},n.contentProps),[En(t.$slots,"default")],16),n.footer||t.$slots.footer?(G(),se("div",{key:1,ref:s.footerContainerRef,class:"p-dialog-footer"},[En(t.$slots,"footer",{},()=>[Jn(lt(n.footer),1)])],512)):qe("",!0)],16,y8)),[[d,{disabled:!n.modal}]]):qe("",!0)]),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):qe("",!0)]),_:3},8,["appendTo"])}function T8(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var E8=` .p-dialog-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; pointer-events: none; } .p-dialog-mask.p-component-overlay { pointer-events: auto; } .p-dialog { display: flex; flex-direction: column; pointer-events: auto; max-height: 90%; transform: scale(1); } .p-dialog-content { overflow-y: auto; } .p-dialog-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; } .p-dialog-footer { flex-shrink: 0; } .p-dialog .p-dialog-header-icons { display: flex; align-items: center; } .p-dialog .p-dialog-header-icon { display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Fluid */ .p-fluid .p-dialog-footer .p-button { width: auto; } /* Animation */ /* Center */ .p-dialog-enter-active { transition: all 150ms cubic-bezier(0, 0, 0.2, 1); } .p-dialog-leave-active { transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); } .p-dialog-enter-from, .p-dialog-leave-to { opacity: 0; transform: scale(0.7); } /* Top, Bottom, Left, Right, Top* and Bottom* */ .p-dialog-top .p-dialog, .p-dialog-bottom .p-dialog, .p-dialog-left .p-dialog, .p-dialog-right .p-dialog, .p-dialog-topleft .p-dialog, .p-dialog-topright .p-dialog, .p-dialog-bottomleft .p-dialog, .p-dialog-bottomright .p-dialog { margin: 0.75rem; transform: translate3d(0px, 0px, 0px); } .p-dialog-top .p-dialog-enter-active, .p-dialog-top .p-dialog-leave-active, .p-dialog-bottom .p-dialog-enter-active, .p-dialog-bottom .p-dialog-leave-active, .p-dialog-left .p-dialog-enter-active, .p-dialog-left .p-dialog-leave-active, .p-dialog-right .p-dialog-enter-active, .p-dialog-right .p-dialog-leave-active, .p-dialog-topleft .p-dialog-enter-active, .p-dialog-topleft .p-dialog-leave-active, .p-dialog-topright .p-dialog-enter-active, .p-dialog-topright .p-dialog-leave-active, .p-dialog-bottomleft .p-dialog-enter-active, .p-dialog-bottomleft .p-dialog-leave-active, .p-dialog-bottomright .p-dialog-enter-active, .p-dialog-bottomright .p-dialog-leave-active { transition: all 0.3s ease-out; } .p-dialog-top .p-dialog-enter-from, .p-dialog-top .p-dialog-leave-to { transform: translate3d(0px, -100%, 0px); } .p-dialog-bottom .p-dialog-enter-from, .p-dialog-bottom .p-dialog-leave-to { transform: translate3d(0px, 100%, 0px); } .p-dialog-left .p-dialog-enter-from, .p-dialog-left .p-dialog-leave-to, .p-dialog-topleft .p-dialog-enter-from, .p-dialog-topleft .p-dialog-leave-to, .p-dialog-bottomleft .p-dialog-enter-from, .p-dialog-bottomleft .p-dialog-leave-to { transform: translate3d(-100%, 0px, 0px); } .p-dialog-right .p-dialog-enter-from, .p-dialog-right .p-dialog-leave-to, .p-dialog-topright .p-dialog-enter-from, .p-dialog-topright .p-dialog-leave-to, .p-dialog-bottomright .p-dialog-enter-from, .p-dialog-bottomright .p-dialog-leave-to { transform: translate3d(100%, 0px, 0px); } /* Maximize */ .p-dialog-maximized { -webkit-transition: none; transition: none; transform: none; width: 100vw !important; height: 100vh !important; top: 0px !important; left: 0px !important; max-height: 100%; height: 100%; } .p-dialog-maximized .p-dialog-content { flex-grow: 1; } /* Position */ .p-dialog-left { justify-content: flex-start; } .p-dialog-right { justify-content: flex-end; } .p-dialog-top { align-items: flex-start; } .p-dialog-topleft { justify-content: flex-start; align-items: flex-start; } .p-dialog-topright { justify-content: flex-end; align-items: flex-start; } .p-dialog-bottom { align-items: flex-end; } .p-dialog-bottomleft { justify-content: flex-start; align-items: flex-end; } .p-dialog-bottomright { justify-content: flex-end; align-items: flex-end; } .p-confirm-dialog .p-dialog-content { display: flex; align-items: center; } `;T8(E8),nm.render=S8;var Gh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function My(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function x8(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var rk={exports:{}};(function(t){//! openseadragon 3.1.0 //! Built on 2022-06-07 //! Git commit: v3.1.0-1-c1c380f //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ function e(n){return new e.Viewer(n)}(function(n){n.version={versionStr:"3.1.0",major:parseInt("3",10),minor:parseInt("1",10),revision:parseInt("0",10)};var i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},r=Object.prototype.toString,s=Object.prototype.hasOwnProperty;n.isFunction=function(o){return n.type(o)==="function"},n.isArray=Array.isArray||function(o){return n.type(o)==="array"},n.isWindow=function(o){return o&&typeof o=="object"&&"setInterval"in o},n.type=function(o){return o==null?String(o):i[r.call(o)]||"object"},n.isPlainObject=function(o){if(!o||e.type(o)!=="object"||o.nodeType||n.isWindow(o)||o.constructor&&!s.call(o,"constructor")&&!s.call(o.constructor.prototype,"isPrototypeOf"))return!1;var u;for(var d in o)u=d;return u===void 0||s.call(o,u)},n.isEmptyObject=function(o){for(var u in o)return!1;return!0},n.freezeObject=function(o){return Object.freeze?n.freezeObject=Object.freeze:n.freezeObject=function(u){return u},n.freezeObject(o)},n.supportsCanvas=function(){var o=document.createElement("canvas");return!!(n.isFunction(o.getContext)&&o.getContext("2d"))}(),n.isCanvasTainted=function(o){var u=!1;try{o.getContext("2d").getImageData(0,0,1,1)}catch{u=!0}return u},n.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),n.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),n.supportsEventListenerOptions=function(){var o=0;if(n.supportsAddEventListener)try{var u={get capture(){return o++,!1},get once(){return o++,!1},get passive(){return o++,!1}};window.addEventListener("test",null,u),window.removeEventListener("test",null,u)}catch{o=0}return o>=3}(),n.getCurrentPixelDensityRatio=function(){if(n.supportsCanvas){var o=document.createElement("canvas").getContext("2d"),u=window.devicePixelRatio||1,d=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;return Math.max(u,1)/d}else return 1},n.pixelDensityRatio=n.getCurrentPixelDensityRatio()})(e),function(n){n.extend=function(){var d,h,g,y,w,C,D=arguments[0]||{},P=arguments.length,M=!1,F=1;for(typeof D=="boolean"&&(M=D,D=arguments[1]||{},F=2),typeof D!="object"&&!e.isFunction(D)&&(D={}),P===F&&(D=this,--F);F=g.x&&h.x=g.y},getMousePosition:function(d){if(typeof d.pageX=="number")n.getMousePosition=function(h){var g=new n.Point;return g.x=h.pageX,g.y=h.pageY,g};else if(typeof d.clientX=="number")n.getMousePosition=function(h){var g=new n.Point;return g.x=h.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,g.y=h.clientY+document.body.scrollTop+document.documentElement.scrollTop,g};else throw new Error("Unknown event mouse position, no known technique.");return n.getMousePosition(d)},getPageScroll:function(){var d=document.documentElement||{},h=document.body||{};if(typeof window.pageXOffset=="number")n.getPageScroll=function(){return new n.Point(window.pageXOffset,window.pageYOffset)};else if(h.scrollLeft||h.scrollTop)n.getPageScroll=function(){return new n.Point(document.body.scrollLeft,document.body.scrollTop)};else if(d.scrollLeft||d.scrollTop)n.getPageScroll=function(){return new n.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new n.Point(0,0);return n.getPageScroll()},setPageScroll:function(d){if(typeof window.scrollTo<"u")n.setPageScroll=function(y){window.scrollTo(y.x,y.y)};else{var h=n.getPageScroll();if(h.x===d.x&&h.y===d.y)return;document.body.scrollLeft=d.x,document.body.scrollTop=d.y;var g=n.getPageScroll();if(g.x!==h.x&&g.y!==h.y){n.setPageScroll=function(y){document.body.scrollLeft=y.x,document.body.scrollTop=y.y};return}if(document.documentElement.scrollLeft=d.x,document.documentElement.scrollTop=d.y,g=n.getPageScroll(),g.x!==h.x&&g.y!==h.y){n.setPageScroll=function(y){document.documentElement.scrollLeft=y.x,document.documentElement.scrollTop=y.y};return}n.setPageScroll=function(y){}}n.setPageScroll(d)},getWindowSize:function(){var d=document.documentElement||{},h=document.body||{};if(typeof window.innerWidth=="number")n.getWindowSize=function(){return new n.Point(window.innerWidth,window.innerHeight)};else if(d.clientWidth||d.clientHeight)n.getWindowSize=function(){return new n.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(h.clientWidth||h.clientHeight)n.getWindowSize=function(){return new n.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return n.getWindowSize()},makeCenteredNode:function(d){d=n.getElement(d);var h=[n.makeNeutralElement("div"),n.makeNeutralElement("div"),n.makeNeutralElement("div")];return n.extend(h[0].style,{display:"table",height:"100%",width:"100%"}),n.extend(h[1].style,{display:"table-row"}),n.extend(h[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),h[0].appendChild(h[1]),h[1].appendChild(h[2]),h[2].appendChild(d),h[0]},makeNeutralElement:function(d){var h=document.createElement(d),g=h.style;return g.background="transparent none",g.border="none",g.margin="0px",g.padding="0px",g.position="static",h},now:function(){return Date.now?n.now=Date.now:n.now=function(){return new Date().getTime()},n.now()},makeTransparentImage:function(d){var h=n.makeNeutralElement("img");return h.src=d,h},setElementOpacity:function(d,h,g){var y,w;d=n.getElement(d),g&&!n.Browser.alpha&&(h=Math.round(h)),n.Browser.opacity?d.style.opacity=h<1?h:"":h<1?(y=Math.round(100*h),w="alpha(opacity="+y+")",d.style.filter=w):d.style.filter=""},setElementTouchActionNone:function(d){d=n.getElement(d),typeof d.style.touchAction<"u"?d.style.touchAction="none":typeof d.style.msTouchAction<"u"&&(d.style.msTouchAction="none")},setElementPointerEvents:function(d,h){d=n.getElement(d),typeof d.style<"u"&&typeof d.style.pointerEvents<"u"&&(d.style.pointerEvents=h)},setElementPointerEventsNone:function(d){n.setElementPointerEvents(d,"none")},addClass:function(d,h){d=n.getElement(d),d.className?(" "+d.className+" ").indexOf(" "+h+" ")===-1&&(d.className+=" "+h):d.className=h},indexOf:function(d,h,g){return Array.prototype.indexOf?this.indexOf=function(y,w,C){return y.indexOf(w,C)}:this.indexOf=function(y,w,C){var D,P=C||0,M;if(!y)throw new TypeError;if(M=y.length,M===0||P>=M)return-1;for(P<0&&(P=M-Math.abs(P)),D=P;D=200&&M.status<300||M.status===0&&P!=="http:"&&P!=="https:"?h(M):n.isFunction(g)?g(M):n.console.error("AJAX request returned %d: %s",M.status,d))};var F=D?"POST":"GET";try{if(M.open(F,d,!0),C&&(M.responseType=C),w)for(var K in w)Object.prototype.hasOwnProperty.call(w,K)&&w[K]&&M.setRequestHeader(K,w[K]);y&&(M.withCredentials=!0),M.send(D)}catch($){n.console.error("%s while making AJAX request: %s",$.name,$.message),M.onreadystatechange=function(){},n.isFunction(g)&&g(M,$)}return M},jsonp:function(d){var h,g=d.url,y=document.head||document.getElementsByTagName("head")[0]||document.documentElement,w=d.callbackName||"openseadragon"+n.now(),C=window[w],D="$1"+w+"$2",P=d.param||"callback",M=d.callback;g=g.replace(/(=)\?(&|$)|\?\?/i,D),g+=(/\?/.test(g)?"&":"?")+P+"="+w,window[w]=function(F){if(C)window[w]=C;else try{delete window[w]}catch{}M&&n.isFunction(M)&&M(F)},h=document.createElement("script"),(d.async!==void 0||d.async!==!1)&&(h.async="async"),d.scriptCharset&&(h.charset=d.scriptCharset),h.src=g,h.onload=h.onreadystatechange=function(F,K){(K||!h.readyState||/loaded|complete/.test(h.readyState))&&(h.onload=h.onreadystatechange=null,y&&h.parentNode&&y.removeChild(h),h=void 0)},y.insertBefore(h,y.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(d){if(window.DOMParser)n.parseXml=function(h){var g=null,y;return y=new DOMParser,g=y.parseFromString(h,"text/xml"),g};else if(window.ActiveXObject)n.parseXml=function(h){var g=null;return g=new ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(h),g};else throw new Error("Browser doesn't support XML DOM.");return n.parseXml(d)},parseJSON:function(d){return n.parseJSON=window.JSON.parse,n.parseJSON(d)},imageFormatSupported:function(d){return d=d||"",!!s[d.toLowerCase()]},setImageFormatsSupported:function(d){n.extend(s,d)}});var r=function(d){};n.console=window.console||{log:r,debug:r,info:r,warn:r,error:r,assert:r},n.Browser={vendor:n.BROWSERS.UNKNOWN,version:0,alpha:!0};var s={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},o={};(function(){var d=navigator.appVersion,h=navigator.userAgent,g;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(n.Browser.vendor=n.BROWSERS.IE,n.Browser.version=parseFloat(h.substring(h.indexOf("MSIE")+5,h.indexOf(";",h.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(h.indexOf("Edge")>=0?(n.Browser.vendor=n.BROWSERS.EDGE,n.Browser.version=parseFloat(h.substring(h.indexOf("Edge")+5))):h.indexOf("Edg")>=0?(n.Browser.vendor=n.BROWSERS.CHROMEEDGE,n.Browser.version=parseFloat(h.substring(h.indexOf("Edg")+4))):h.indexOf("Firefox")>=0?(n.Browser.vendor=n.BROWSERS.FIREFOX,n.Browser.version=parseFloat(h.substring(h.indexOf("Firefox")+8))):h.indexOf("Safari")>=0?(n.Browser.vendor=h.indexOf("Chrome")>=0?n.BROWSERS.CHROME:n.BROWSERS.SAFARI,n.Browser.version=parseFloat(h.substring(h.substring(0,h.indexOf("Safari")).lastIndexOf("/")+1,h.indexOf("Safari")))):(g=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),g.exec(h)!==null&&(n.Browser.vendor=n.BROWSERS.IE,n.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":n.Browser.vendor=n.BROWSERS.OPERA,n.Browser.version=parseFloat(d);break}var y=window.location.search.substring(1),w=y.split("&"),C,D,P;for(P=0;P0){var M=C.substring(0,D),F=C.substring(D+1);try{o[M]=decodeURIComponent(F)}catch{n.console.error("Ignoring malformed URL parameter: %s=%s",M,F)}}n.Browser.alpha=!(n.Browser.vendor===n.BROWSERS.CHROME&&n.Browser.version<2),n.Browser.opacity=!0,n.Browser.vendor===n.BROWSERS.IE&&n.Browser.version<11&&n.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(d){var h=d.requestAnimationFrame||d.mozRequestAnimationFrame||d.webkitRequestAnimationFrame||d.msRequestAnimationFrame,g=d.cancelAnimationFrame||d.mozCancelAnimationFrame||d.webkitCancelAnimationFrame||d.msCancelAnimationFrame;if(h&&g)n.requestAnimationFrame=function(){return h.apply(d,arguments)},n.cancelAnimationFrame=function(){return g.apply(d,arguments)};else{var y=[],w=[],C=0,D;n.requestAnimationFrame=function(P){return y.push([++C,P]),D||(D=setInterval(function(){if(y.length){var M=n.now(),F=w;for(w=y,y=F;w.length;)w.shift()[1](M)}else clearInterval(D),D=void 0},1e3/50)),C},n.cancelAnimationFrame=function(P){var M,F;for(M=0,F=y.length;M8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",n.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",n.MouseTracker.wheelEventName],n.MouseTracker.wheelEventName==="DOMMouseScroll"&&n.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(n.MouseTracker.havePointerEvents=!0,n.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),n.MouseTracker.havePointerCapture=function(){var te=document.createElement("div");return n.isFunction(te.setPointerCapture)&&n.isFunction(te.releasePointerCapture)}(),n.MouseTracker.havePointerCapture&&n.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(n.MouseTracker.havePointerEvents=!1,n.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),n.MouseTracker.mousePointerId="legacy-mouse",n.MouseTracker.havePointerCapture=function(){var te=document.createElement("div");return n.isFunction(te.setCapture)&&n.isFunction(te.releaseCapture)}(),n.MouseTracker.havePointerCapture&&n.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&n.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&n.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),n.MouseTracker.GesturePointList=function(te){this._gPoints=[],this.type=te,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},n.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(te){return this._gPoints.push(te)},removeById:function(te){var Z,be=this._gPoints.length;for(Z=0;Z1&&(this.type==="mouse"||this.type==="pen")&&(n.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};function o(te){var Z=i[te.hash],be,we,at,Et,Zt,gn=Z.activePointersLists.length;for(be=0;be0){for(Zt=[],Et=at.asArray(),we=0;weZ.touches.length-at&&n.console.warn("Tracked touch contact count doesn't match event.touches.length");var gn={originalEvent:Z,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(re(te,gn),we=0;we"u"?!0:r.attachToViewer,this.autoFade=typeof r.autoFade>"u"?!0:r.autoFade,this.element=i,this.anchor=r.anchor,this.container=s,this.anchor===n.ControlAnchor.ABSOLUTE?(this.wrapper=n.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof r.top=="number"?r.top+"px":r.top,this.wrapper.style.left=typeof r.left=="number"?r.left+"px":r.left,this.wrapper.style.height=typeof r.height=="number"?r.height+"px":r.height,this.wrapper.style.width=typeof r.width=="number"?r.width+"px":r.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=n.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===n.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),r.attachToViewer?this.anchor===n.ControlAnchor.TOP_RIGHT||this.anchor===n.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):o.appendChild(this.wrapper)},n.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==n.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(i){this.wrapper.style.display=i?this.anchor===n.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(i){this.element[n.SIGNAL]&&n.Browser.vendor===n.BROWSERS.IE?n.setElementOpacity(this.element,i,!0):n.setElementOpacity(this.wrapper,i,!0)}}}(e),function(n){n.ControlDock=function(r){var s=["topleft","topright","bottomright","bottomleft"],o,u;for(n.extend(!0,this,{id:"controldock-"+n.now()+"-"+Math.floor(Math.random()*1e6),container:n.makeNeutralElement("div"),controls:[]},r),this.container.onsubmit=function(){return!1},this.element&&(this.element=n.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),u=0;u=0)){switch(s.anchor){case n.ControlAnchor.TOP_RIGHT:o=this.controls.topright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingTop="0px";break;case n.ControlAnchor.BOTTOM_RIGHT:o=this.controls.bottomright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingBottom="0px";break;case n.ControlAnchor.BOTTOM_LEFT:o=this.controls.bottomleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingBottom="0px";break;case n.ControlAnchor.TOP_LEFT:o=this.controls.topleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingTop="0px";break;case n.ControlAnchor.ABSOLUTE:o=this.container,r.style.margin="0px",r.style.padding="0px";break;default:case n.ControlAnchor.NONE:o=this.container,r.style.margin="0px",r.style.padding="0px";break}this.controls.push(new n.Control(r,s,o)),r.style.display="inline-block"}},removeControl:function(r){r=n.getElement(r);var s=i(this,r);return s>=0&&(this.controls[s].destroy(),this.controls.splice(s,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var r;for(r=this.controls.length-1;r>=0;r--)if(this.controls[r].isVisible())return!0;return!1},setControlsEnabled:function(r){var s;for(s=this.controls.length-1;s>=0;s--)this.controls[s].setVisible(r);return this}};function i(r,s){var o=r.controls,u;for(u=o.length-1;u>=0;u--)if(o[u].element===s)return u;return-1}}(e),function(n){n.Placement=n.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(e),function(n){var i={},r=1;n.Viewer=function(N){var ce=arguments,Re=this,Ye;if(n.isPlainObject(N)||(N={id:ce[0],xmlPath:ce.length>1?ce[1]:void 0,prefixUrl:ce.length>2?ce[2]:void 0,controls:ce.length>3?ce[3]:void 0,overlays:ce.length>4?ce[4]:void 0}),N.config&&(n.extend(!0,N,N.config),delete N.config),n.extend(!0,this,{id:N.id,hash:N.hash||r++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},n.DEFAULT_SETTINGS,N),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof i[this.hash]<"u"&&n.console.warn("Hash "+this.hash+" has already been used."),i[this.hash]={fsBoundsDelta:new n.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=n.now(),n.EventSource.call(this),this.addHandler("open-failed",function(re){var ge=n.getString("Errors.OpenFailed",re.eventSource,re.message);Re._showMessage(ge)}),n.ControlDock.call(this,N),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=n.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(re){re.width="100%",re.height="100%",re.overflow="hidden",re.position="absolute",re.top="0px",re.left="0px"}(this.canvas.style),n.setElementTouchActionNone(this.canvas),N.tabIndex!==""&&(this.canvas.tabIndex=N.tabIndex===void 0?0:N.tabIndex),this.container.className="openseadragon-container",function(re){re.width="100%",re.height="100%",re.position="relative",re.overflow="hidden",re.left="0px",re.top="0px",re.textAlign="left"}(this.container.style),n.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new n.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:n.delegate(this,M),keyDownHandler:n.delegate(this,F),keyHandler:n.delegate(this,K),clickHandler:n.delegate(this,$),dblClickHandler:n.delegate(this,ee),dragHandler:n.delegate(this,he),dragEndHandler:n.delegate(this,ve),enterHandler:n.delegate(this,fe),leaveHandler:n.delegate(this,ae),pressHandler:n.delegate(this,xe),releaseHandler:n.delegate(this,Qe),nonPrimaryPressHandler:n.delegate(this,ot),nonPrimaryReleaseHandler:n.delegate(this,et),scrollHandler:n.delegate(this,Wt),pinchHandler:n.delegate(this,pt)}),this.outerTracker=new n.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:n.delegate(this,pn),leaveHandler:n.delegate(this,Ut)}),this.toolbar&&(this.toolbar=new n.ControlDock({element:this.toolbar})),this.bindStandardControls(),i[this.hash].prevContainerSize=s(this.container),this.world=new n.World({viewer:this}),this.world.addHandler("add-item",function(re){Re.source=Re.world.getItemAt(0).source,i[Re.hash].forceRedraw=!0,Re._updateRequestId||(Re._updateRequestId=h(Re,Xt))}),this.world.addHandler("remove-item",function(re){Re.world.getItemCount()?Re.source=Re.world.getItemAt(0).source:Re.source=null,i[Re.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(re){Re.viewport&&Re.viewport._setContentBounds(Re.world.getHomeBounds(),Re.world.getContentFactor())}),this.world.addHandler("item-index-change",function(re){Re.source=Re.world.getItemAt(0).source}),this.viewport=new n.Viewport({containerSize:i[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins,silenceMultiImageWarnings:this.silenceMultiImageWarnings}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new n.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:N.timeout}),this.tileCache=new n.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new n.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=n.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(Ye=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(Ye,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(Ye=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(Ye,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new n.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),Ye=0;Ye-1&&N.index=0&&N=0)return this;var ge=u(this,re);return this.currentOverlays.push(ge),ge.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:N,location:re.location,placement:re.placement}),this},updateOverlay:function(N,ce,Re){var Ye;return N=n.getElement(N),Ye=d(this.currentOverlays,N),Ye>=0&&(this.currentOverlays[Ye].update(ce,Re),i[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:N,location:ce,placement:Re})),this},removeOverlay:function(N){var ce;return N=n.getElement(N),ce=d(this.currentOverlays,N),ce>=0&&(this.currentOverlays[ce].destroy(),this.currentOverlays.splice(ce,1),i[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:N})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return i[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(N){var ce;return N=n.getElement(N),ce=d(this.currentOverlays,N),ce>=0?this.currentOverlays[ce]:null},_updateSequenceButtons:function(N){this.nextButton&&(!this.tileSources||this.tileSources.length-1===N?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(N>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(N){this._hideMessage();var ce=n.makeNeutralElement("div");ce.appendChild(document.createTextNode(N)),this.messageDiv=n.makeCenteredNode(ce),n.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var N=this.messageDiv;N&&(N.parentNode.removeChild(N),delete this.messageDiv)},gestureSettingsByDeviceType:function(N){switch(N){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var N,ce=this.currentOverlays.length;for(N=0;N1&&(this.referenceStrip=new n.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else n.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),n.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){n.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var N=n.pixelDensityRatio,ce=n.getCurrentPixelDensityRatio();N!==ce&&(n.pixelDensityRatio=ce,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var N=this._sequenceIndex-1;this.navPrevNextWrap&&N<0&&(N+=this.tileSources.length),this.goToPage(N)},goToNextPage:function(){var N=this._sequenceIndex+1;this.navPrevNextWrap&&N>=this.tileSources.length&&(N=0),this.goToPage(N)},isAnimating:function(){return i[this.hash].animating}});function s(N){return N=n.getElement(N),new n.Point(N.clientWidth===0?1:N.clientWidth,N.clientHeight===0?1:N.clientHeight)}function o(N,ce,Re,Ye,re){var ge=N;if(n.type(ce)==="string"){if(ce.match(/^\s*<.*>\s*$/))ce=n.parseXml(ce);else if(ce.match(/^\s*[{[].*[}\]]\s*$/))try{var Ce=n.parseJSON(ce);ce=Ce}catch{}}function Ge(Ue,We){Ue.ready?Ye(Ue):(Ue.addHandler("ready",function(){Ye(Ue)}),Ue.addHandler("open-failed",function(rt){re({message:rt.message,source:We})}))}setTimeout(function(){if(n.type(ce)==="string")ce=new n.TileSource({url:ce,crossOriginPolicy:Re.crossOriginPolicy!==void 0?Re.crossOriginPolicy:N.crossOriginPolicy,ajaxWithCredentials:N.ajaxWithCredentials,ajaxHeaders:Re.ajaxHeaders?Re.ajaxHeaders:N.ajaxHeaders,splitHashDataForPost:N.splitHashDataForPost,useCanvas:N.useCanvas,success:function(kt){Ye(kt.tileSource)}}),ce.addHandler("open-failed",function(kt){re(kt)});else if(n.isPlainObject(ce)||ce.nodeType)if(ce.crossOriginPolicy===void 0&&(Re.crossOriginPolicy!==void 0||N.crossOriginPolicy!==void 0)&&(ce.crossOriginPolicy=Re.crossOriginPolicy!==void 0?Re.crossOriginPolicy:N.crossOriginPolicy),ce.ajaxWithCredentials===void 0&&(ce.ajaxWithCredentials=N.ajaxWithCredentials),ce.useCanvas===void 0&&(ce.useCanvas=N.useCanvas),n.isFunction(ce.getTileUrl)){var Ue=new n.TileSource(ce);Ue.getTileUrl=ce.getTileUrl,Ye(Ue)}else{var We=n.TileSource.determineType(ge,ce);if(!We){re({message:"Unable to load TileSource",source:ce});return}var rt=We.prototype.configure.apply(ge,[ce]);Ge(new We(rt),ce)}else Ge(ce,ce)})}function u(N,ce){if(ce instanceof n.Overlay)return ce;var Re=null;if(ce.element)Re=n.getElement(ce.element);else{var Ye=ce.id?ce.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);Re=n.getElement(ce.id),Re||(Re=document.createElement("a"),Re.href="#/overlay/"+Ye),Re.id=Ye,n.addClass(Re,ce.className?ce.className:"openseadragon-overlay")}var re=ce.location,ge=ce.width,Ce=ce.height;if(!re){var Ge=ce.x,Ue=ce.y;if(ce.px!==void 0){var We=N.viewport.imageToViewportRectangle(new n.Rect(ce.px,ce.py,ge||0,Ce||0));Ge=We.x,Ue=We.y,ge=ge!==void 0?We.width:void 0,Ce=Ce!==void 0?We.height:void 0}re=new n.Point(Ge,Ue)}var rt=ce.placement;return rt&&n.type(rt)==="string"&&(rt=n.Placement[ce.placement.toUpperCase()]),new n.Overlay({element:Re,location:re,placement:rt,onDraw:ce.onDraw,checkResize:ce.checkResize,width:ge,height:Ce,rotationMode:ce.rotationMode})}function d(N,ce){var Re;for(Re=N.length-1;Re>=0;Re--)if(N[Re].element===ce)return Re;return-1}function h(N,ce){return n.requestAnimationFrame(function(){ce(N)})}function g(N){n.requestAnimationFrame(function(){w(N)})}function y(N){N.autoHideControls&&(N.controlsShouldFade=!0,N.controlsFadeBeginTime=n.now()+N.controlsFadeDelay,window.setTimeout(function(){g(N)},N.controlsFadeDelay))}function w(N){var ce,Re,Ye,re;if(N.controlsShouldFade){for(ce=n.now(),Re=ce-N.controlsFadeBeginTime,Ye=1-Re/N.controlsFadeLength,Ye=Math.min(1,Ye),Ye=Math.max(0,Ye),re=N.controls.length-1;re>=0;re--)N.controls[re].autoFade&&N.controls[re].setOpacity(Ye);Ye>0&&g(N)}}function C(N){var ce;for(N.controlsShouldFade=!1,ce=N.controls.length-1;ce>=0;ce--)N.controls[ce].setOpacity(1)}function D(){C(this)}function P(){y(this)}function M(N){var ce={tracker:N.eventSource,position:N.position,originalEvent:N.originalEvent,preventDefault:N.preventDefault};this.raiseEvent("canvas-contextmenu",ce),N.preventDefault=ce.preventDefault}function F(N){var ce={originalEvent:N.originalEvent,preventDefaultAction:!1,preventVerticalPan:N.preventVerticalPan||!this.panVertical,preventHorizontalPan:N.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",ce),!ce.preventDefaultAction&&!N.ctrl&&!N.alt&&!N.meta)switch(N.keyCode){case 38:ce.preventVerticalPan||(N.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 40:ce.preventVerticalPan||(N.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 37:ce.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 39:ce.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),N.preventDefault=!0;break;default:N.preventDefault=!1;break}else N.preventDefault=!1}function K(N){var ce={originalEvent:N.originalEvent,preventDefaultAction:!1,preventVerticalPan:N.preventVerticalPan||!this.panVertical,preventHorizontalPan:N.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",ce),!ce.preventDefaultAction&&!N.ctrl&&!N.alt&&!N.meta)switch(N.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),N.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),N.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),N.preventDefault=!0;break;case 119:case 87:ce.preventVerticalPan||(N.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,-40))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 115:case 83:ce.preventVerticalPan||(N.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,40))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 97:ce.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(-40,0))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 100:ce.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(40,0))),this.viewport.applyConstraints()),N.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(n.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(n.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),N.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(n.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(n.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),N.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),N.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:N.preventDefault=!1;break}else N.preventDefault=!1}function $(N){var ce,Re=document.activeElement===this.canvas;Re||this.canvas.focus(),this.viewport.flipped&&(N.position.x=this.viewport.getContainerSize().x-N.position.x);var Ye={tracker:N.eventSource,position:N.position,quick:N.quick,shift:N.shift,originalEvent:N.originalEvent,originalTarget:N.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",Ye),!Ye.preventDefaultAction&&this.viewport&&N.quick&&(ce=this.gestureSettingsByDeviceType(N.pointerType),ce.clickToZoom&&(this.viewport.zoomBy(N.shift?1/this.zoomPerClick:this.zoomPerClick,ce.zoomToRefPoint?this.viewport.pointFromPixel(N.position,!0):null),this.viewport.applyConstraints()))}function ee(N){var ce,Re={tracker:N.eventSource,position:N.position,shift:N.shift,originalEvent:N.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",Re),!Re.preventDefaultAction&&this.viewport&&(ce=this.gestureSettingsByDeviceType(N.pointerType),ce.dblClickToZoom&&(this.viewport.zoomBy(N.shift?1/this.zoomPerClick:this.zoomPerClick,ce.zoomToRefPoint?this.viewport.pointFromPixel(N.position,!0):null),this.viewport.applyConstraints()))}function he(N){var ce,Re={tracker:N.eventSource,pointerType:N.pointerType,position:N.position,delta:N.delta,speed:N.speed,direction:N.direction,shift:N.shift,originalEvent:N.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",Re),ce=this.gestureSettingsByDeviceType(N.pointerType),ce.dragToPan&&!Re.preventDefaultAction&&this.viewport){if(this.panHorizontal||(N.delta.x=0),this.panVertical||(N.delta.y=0),this.viewport.flipped&&(N.delta.x=-N.delta.x),this.constrainDuringPan){var Ye=this.viewport.deltaPointsFromPixels(N.delta.negate());this.viewport.centerSpringX.target.value+=Ye.x,this.viewport.centerSpringY.target.value+=Ye.y;var re=this.viewport.getBounds(),ge=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=Ye.x,this.viewport.centerSpringY.target.value-=Ye.y,re.x!==ge.x&&(N.delta.x=0),re.y!==ge.y&&(N.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(N.delta.negate()),ce.flickEnabled&&!this.constrainDuringPan)}}function ve(N){var ce={tracker:N.eventSource,pointerType:N.pointerType,position:N.position,speed:N.speed,direction:N.direction,shift:N.shift,originalEvent:N.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",ce),!ce.preventDefaultAction&&this.viewport){var Re=this.gestureSettingsByDeviceType(N.pointerType);if(Re.flickEnabled&&N.speed>=Re.flickMinSpeed){var Ye=0;this.panHorizontal&&(Ye=Re.flickMomentum*N.speed*Math.cos(N.direction));var re=0;this.panVertical&&(re=Re.flickMomentum*N.speed*Math.sin(N.direction));var ge=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),Ce=this.viewport.pointFromPixel(new n.Point(ge.x-Ye,ge.y-re));this.viewport.panTo(Ce,!1)}this.viewport.applyConstraints()}}function fe(N){this.raiseEvent("canvas-enter",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,buttons:N.buttons,pointers:N.pointers,insideElementPressed:N.insideElementPressed,buttonDownAny:N.buttonDownAny,originalEvent:N.originalEvent})}function ae(N){this.raiseEvent("canvas-exit",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,buttons:N.buttons,pointers:N.pointers,insideElementPressed:N.insideElementPressed,buttonDownAny:N.buttonDownAny,originalEvent:N.originalEvent})}function xe(N){this.raiseEvent("canvas-press",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,insideElementPressed:N.insideElementPressed,insideElementReleased:N.insideElementReleased,originalEvent:N.originalEvent})}function Qe(N){this.raiseEvent("canvas-release",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,insideElementPressed:N.insideElementPressed,insideElementReleased:N.insideElementReleased,originalEvent:N.originalEvent})}function ot(N){this.raiseEvent("canvas-nonprimary-press",{tracker:N.eventSource,position:N.position,pointerType:N.pointerType,button:N.button,buttons:N.buttons,originalEvent:N.originalEvent})}function et(N){this.raiseEvent("canvas-nonprimary-release",{tracker:N.eventSource,position:N.position,pointerType:N.pointerType,button:N.button,buttons:N.buttons,originalEvent:N.originalEvent})}function pt(N){var ce,Re,Ye,re,ge={tracker:N.eventSource,pointerType:N.pointerType,gesturePoints:N.gesturePoints,lastCenter:N.lastCenter,center:N.center,lastDistance:N.lastDistance,distance:N.distance,shift:N.shift,originalEvent:N.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",ge),this.viewport&&(ce=this.gestureSettingsByDeviceType(N.pointerType),ce.pinchToZoom&&(!ge.preventDefaultPanAction||!ge.preventDefaultZoomAction)&&(Re=this.viewport.pointFromPixel(N.center,!0),ce.zoomToRefPoint&&!ge.preventDefaultPanAction&&(Ye=this.viewport.pointFromPixel(N.lastCenter,!0),re=Ye.minus(Re),this.panHorizontal||(re.x=0),this.panVertical||(re.y=0),this.viewport.panBy(re,!0)),ge.preventDefaultZoomAction||this.viewport.zoomBy(N.distance/N.lastDistance,Re,!0),this.viewport.applyConstraints()),ce.pinchRotate&&!ge.preventDefaultRotateAction)){var Ce=Math.atan2(N.gesturePoints[0].currentPos.y-N.gesturePoints[1].currentPos.y,N.gesturePoints[0].currentPos.x-N.gesturePoints[1].currentPos.x),Ge=Math.atan2(N.gesturePoints[0].lastPos.y-N.gesturePoints[1].lastPos.y,N.gesturePoints[0].lastPos.x-N.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(Ce-Ge)*(180/Math.PI))}}function Wt(N){var ce,Re,Ye,re,ge;re=n.now(),ge=re-this._lastScrollTime,ge>this.minScrollDeltaTime?(this._lastScrollTime=re,ce={tracker:N.eventSource,position:N.position,scroll:N.scroll,shift:N.shift,originalEvent:N.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",ce),!ce.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(N.position.x=this.viewport.getContainerSize().x-N.position.x),Re=this.gestureSettingsByDeviceType(N.pointerType),Re.scrollToZoom&&(Ye=Math.pow(this.zoomPerScroll,N.scroll),this.viewport.zoomBy(Ye,Re.zoomToRefPoint?this.viewport.pointFromPixel(N.position,!0):null),this.viewport.applyConstraints())),N.preventDefault=ce.preventDefault):N.preventDefault=!0}function pn(N){i[this.hash].mouseInside=!0,C(this),this.raiseEvent("container-enter",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,buttons:N.buttons,pointers:N.pointers,insideElementPressed:N.insideElementPressed,buttonDownAny:N.buttonDownAny,originalEvent:N.originalEvent})}function Ut(N){N.pointers<1&&(i[this.hash].mouseInside=!1,i[this.hash].animating||y(this)),this.raiseEvent("container-exit",{tracker:N.eventSource,pointerType:N.pointerType,position:N.position,buttons:N.buttons,pointers:N.pointers,insideElementPressed:N.insideElementPressed,buttonDownAny:N.buttonDownAny,originalEvent:N.originalEvent})}function Xt(N){cn(N),N.isOpen()?N._updateRequestId=h(N,Xt):N._updateRequestId=!1}function cn(N){if(!(N._opening||!i[N.hash])){if(N.autoResize){var ce=s(N.container),Re=i[N.hash].prevContainerSize;if(!ce.equals(Re)){var Ye=N.viewport;if(N.preserveImageSizeOnResize){var re=Re.x/ce.x,ge=Ye.getZoom()*re,Ce=Ye.getCenter();Ye.resize(ce,!1),Ye.zoomTo(ge,null,!0),Ye.panTo(Ce,!0)}else{var Ge=Ye.getBounds();Ye.resize(ce,!0),Ye.fitBoundsWithConstraints(Ge,!0)}i[N.hash].prevContainerSize=ce,i[N.hash].forceRedraw=!0}}var Ue=N.viewport.update(),We=N.world.update()||Ue;Ue&&N.raiseEvent("viewport-change"),N.referenceStrip&&(We=N.referenceStrip.update(N.viewport)||We);var rt=i[N.hash].animating;!rt&&We&&(N.raiseEvent("animation-start"),C(N));var kt=rt&&!We;kt&&(i[N.hash].animating=!1),(We||kt||i[N.hash].forceRedraw||N.world.needsDraw())&&(ai(N),N._drawOverlays(),N.navigator&&N.navigator.update(N.viewport),i[N.hash].forceRedraw=!1,We&&N.raiseEvent("animation")),kt&&(N.raiseEvent("animation-finish"),i[N.hash].mouseInside||y(N)),i[N.hash].animating=We}}function ai(N){N.imageLoader.clear(),N.drawer.clear(),N.world.draw(),N.raiseEvent("update-viewport",{})}function Qt(N,ce){return N?N+ce:ce}function xn(){i[this.hash].lastZoomTime=n.now(),i[this.hash].zoomFactor=this.zoomPerSecond,i[this.hash].zooming=!0,li(this)}function ii(){i[this.hash].lastZoomTime=n.now(),i[this.hash].zoomFactor=1/this.zoomPerSecond,i[this.hash].zooming=!0,li(this)}function Zn(){i[this.hash].zooming=!1}function li(N){n.requestAnimationFrame(n.delegate(N,Ft))}function Ft(){var N,ce,Re;i[this.hash].zooming&&this.viewport&&(N=n.now(),ce=N-i[this.hash].lastZoomTime,Re=Math.pow(i[this.hash].zoomFactor,ce/1e3),this.viewport.zoomBy(Re),this.viewport.applyConstraints(),i[this.hash].lastZoomTime=N,li(this))}function ui(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function or(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function ji(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Vi(){this.viewport&&this.viewport.goHome()}function Hn(){this.isFullPage()&&!n.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function Ur(){if(this.viewport){var N=this.viewport.getRotation();this.viewport.flipped?N=n.positiveModulo(N+this.rotationIncrement,360):N=n.positiveModulo(N-this.rotationIncrement,360),this.viewport.setRotation(N)}}function Fe(){if(this.viewport){var N=this.viewport.getRotation();this.viewport.flipped?N=n.positiveModulo(N-this.rotationIncrement,360):N=n.positiveModulo(N+this.rotationIncrement,360),this.viewport.setRotation(N)}}function Ke(){this.viewport.toggleFlip()}}(e),function(n){n.Navigator=function(h){var g=h.viewer,y=this,w,C;h.id?(this.element=document.getElementById(h.id),h.controlOptions={anchor:n.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(h.id="navigator-"+n.now(),this.element=n.makeNeutralElement("div"),h.controlOptions={anchor:n.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:h.autoFade},h.position&&(h.position==="BOTTOM_RIGHT"?h.controlOptions.anchor=n.ControlAnchor.BOTTOM_RIGHT:h.position==="BOTTOM_LEFT"?h.controlOptions.anchor=n.ControlAnchor.BOTTOM_LEFT:h.position==="TOP_RIGHT"?h.controlOptions.anchor=n.ControlAnchor.TOP_RIGHT:h.position==="TOP_LEFT"?h.controlOptions.anchor=n.ControlAnchor.TOP_LEFT:h.position==="ABSOLUTE"&&(h.controlOptions.anchor=n.ControlAnchor.ABSOLUTE,h.controlOptions.top=h.top,h.controlOptions.left=h.left,h.controlOptions.height=h.height,h.controlOptions.width=h.width))),this.element.id=h.id,this.element.className+=" navigator",h=n.extend(!0,{sizeRatio:n.DEFAULT_SETTINGS.navigatorSizeRatio},h,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:h.autoResize,minZoomImageRatio:1,background:h.background,opacity:h.opacity,borderColor:h.borderColor,displayRegionColor:h.displayRegionColor}),h.minPixelRatio=this.minPixelRatio=g.minPixelRatio,n.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new n.Point(1,1),this.totalBorderWidths=new n.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),h.controlOptions.anchor!==n.ControlAnchor.NONE&&function(M,F){M.margin="0px",M.border=F+"px solid "+h.borderColor,M.padding="0px",M.background=h.background,M.opacity=h.opacity,M.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=n.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(M,F){M.position="relative",M.top="0px",M.left="0px",M.fontSize="0px",M.overflow="hidden",M.border=F+"px solid "+h.displayRegionColor,M.margin="0px",M.padding="0px",M.background="transparent",M.float="left",M.cssFloat="left",M.styleFloat="left",M.zIndex=999999999,M.cursor="default"}(this.displayRegion.style,this.borderWidth),n.setElementPointerEventsNone(this.displayRegion),n.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=n.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",n.setElementPointerEventsNone(this.displayRegionContainer),n.setElementTouchActionNone(this.displayRegionContainer),g.addControl(this.element,h.controlOptions),this._resizeWithViewer=h.controlOptions.anchor!==n.ControlAnchor.ABSOLUTE&&h.controlOptions.anchor!==n.ControlAnchor.NONE,h.width&&h.height?(this.setWidth(h.width),this.setHeight(h.height)):this._resizeWithViewer&&(w=n.getElementSize(g.element),this.element.style.height=Math.round(w.y*h.sizeRatio)+"px",this.element.style.width=Math.round(w.x*h.sizeRatio)+"px",this.oldViewerSize=w,C=n.getElementSize(this.element),this.elementArea=C.x*C.y),this.oldContainerSize=new n.Point(0,0),n.Viewer.apply(this,[h]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function D(M){u(y.displayRegionContainer,M),u(y.displayRegion,-M),y.viewport.setRotation(M)}if(h.navigatorRotate){var P=h.viewer.viewport?h.viewer.viewport.getRotation():h.viewer.degrees||0;D(P),h.viewer.addHandler("rotate",function(M){D(M.degrees)})}this.innerTracker.destroy(),this.innerTracker=new n.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:n.delegate(this,r),clickHandler:n.delegate(this,i),releaseHandler:n.delegate(this,s),scrollHandler:n.delegate(this,o),preProcessEventHandler:function(M){M.eventType==="wheel"&&(M.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",n.setElementPointerEventsNone(this.canvas),n.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){y.viewport&&y.viewport.goHome(!0)}),g.world.addHandler("item-index-change",function(M){window.setTimeout(function(){var F=y.world.getItemAt(M.previousIndex);y.world.setItemIndex(F,M.newIndex)},1)}),g.world.addHandler("remove-item",function(M){var F=M.item,K=y._getMatchingItem(F);K&&y.world.removeItem(K)}),this.update(g.viewport)},n.extend(n.Navigator.prototype,n.EventSource.prototype,n.Viewer.prototype,{updateSize:function(){if(this.viewport){var h=new n.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);h.equals(this.oldContainerSize)||(this.viewport.resize(h,!0),this.viewport.goHome(!0),this.oldContainerSize=h,this.drawer.clear(),this.world.draw())}},setWidth:function(h){this.width=h,this.element.style.width=typeof h=="number"?h+"px":h,this._resizeWithViewer=!1},setHeight:function(h){this.height=h,this.element.style.height=typeof h=="number"?h+"px":h,this._resizeWithViewer=!1},setFlip:function(h){return this.viewport.setFlip(h),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(h){d(this.displayRegion,h),d(this.canvas,h),d(this.element,h)},update:function(h){var g,y,w,C,D,P;if(g=n.getElementSize(this.viewer.element),this._resizeWithViewer&&g.x&&g.y&&!g.equals(this.oldViewerSize)&&(this.oldViewerSize=g,this.maintainSizeRatio||!this.elementArea?(y=g.x*this.sizeRatio,w=g.y*this.sizeRatio):(y=Math.sqrt(this.elementArea*(g.x/g.y)),w=this.elementArea/y),this.element.style.width=Math.round(y)+"px",this.element.style.height=Math.round(w)+"px",this.elementArea||(this.elementArea=y*w),this.updateSize()),h&&this.viewport){C=h.getBoundsNoRotate(!0),D=this.viewport.pixelFromPointNoRotate(C.getTopLeft(),!1),P=this.viewport.pixelFromPointNoRotate(C.getBottomRight(),!1).minus(this.totalBorderWidths);var M=this.displayRegion.style;M.display=this.world.getItemCount()?"block":"none",M.top=Math.round(D.y)+"px",M.left=Math.round(D.x)+"px";var F=Math.abs(D.x-P.x),K=Math.abs(D.y-P.y);M.width=Math.round(Math.max(F,0))+"px",M.height=Math.round(Math.max(K,0))+"px"}},addTiledImage:function(h){var g=this,y=h.originalTiledImage;delete h.original;var w=n.extend({},h,{success:function(C){var D=C.item;D._originalForNavigator=y,g._matchBounds(D,y,!0),g._matchOpacity(D,y),g._matchCompositeOperation(D,y);function P(){g._matchBounds(D,y)}function M(){g._matchOpacity(D,y)}function F(){g._matchCompositeOperation(D,y)}y.addHandler("bounds-change",P),y.addHandler("clip-change",P),y.addHandler("opacity-change",M),y.addHandler("composite-operation-change",F)}});return n.Viewer.prototype.addTiledImage.apply(this,[w])},destroy:function(){return n.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(h){for(var g=this.world.getItemCount(),y,w=0;w1||s.y>1));r++);return r-1},getTileAtPoint:function(r,s){var o=s.x>=0&&s.x<=1&&s.y>=0&&s.y<=1/this.aspectRatio;n.console.assert(o,"[TileSource.getTileAtPoint] must be called with a valid point.");var u=this.dimensions.x*this.getLevelScale(r),d=s.x*u,h=s.y*u,g=Math.floor(d/this.getTileWidth(r)),y=Math.floor(h/this.getTileHeight(r));s.x>=1&&(g=this.getNumTiles(r).x-1);var w=1e-15;return s.y>=1/this.aspectRatio-w&&(y=this.getNumTiles(r).y-1),new n.Point(g,y)},getTileBounds:function(r,s,o,u){var d=this.dimensions.times(this.getLevelScale(r)),h=this.getTileWidth(r),g=this.getTileHeight(r),y=s===0?0:h*s-this.tileOverlap,w=o===0?0:g*o-this.tileOverlap,C=h+(s===0?1:2)*this.tileOverlap,D=g+(o===0?1:2)*this.tileOverlap,P=1/d.x;return C=Math.min(C,d.x-y),D=Math.min(D,d.y-w),u?new n.Rect(0,0,C,D):new n.Rect(y*P,w*P,C*P,D*P)},getImageInfo:function(r){var s=this,o,u,d,h,g,y,w;r&&(g=r.split("/"),y=g[g.length-1],w=y.lastIndexOf("."),w>-1&&(g[g.length-1]=y.slice(0,w)));var C=null;if(this.splitHashDataForPost){var D=r.indexOf("#");D!==-1&&(C=r.substring(D+1),r=r.substr(0,D))}u=function(P){typeof P=="string"&&(P=n.parseXml(P));var M=n.TileSource.determineType(s,P,r);if(!M){s.raiseEvent("open-failed",{message:"Unable to load TileSource",source:r});return}h=M.prototype.configure.apply(s,[P,r,C]),h.ajaxWithCredentials===void 0&&(h.ajaxWithCredentials=s.ajaxWithCredentials),d=new M(h),s.ready=!0,s.raiseEvent("ready",{tileSource:d})},r.match(/\.js$/)?(o=r.split("/").pop().replace(".js",""),n.jsonp({url:r,async:!1,callbackName:o,callback:u})):n.makeAjaxRequest({url:r,postData:C,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(P){var M=i(P);u(M)},error:function(P,M){var F;try{F="HTTP "+P.status+" attempting to load TileSource: "+r}catch{var K;typeof M>"u"||!M.toString?K="Unknown error":K=M.toString(),F=K+" attempting to load TileSource: "+r}n.console.error(F),s.raiseEvent("open-failed",{message:F,source:r,postData:C})}})},supports:function(r,s){return!1},configure:function(r,s,o){throw new Error("Method not implemented.")},getTileUrl:function(r,s,o){throw new Error("Method not implemented.")},getTilePostData:function(r,s,o){return null},getTileAjaxHeaders:function(r,s,o){return{}},getTileHashKey:function(r,s,o,u,d,h){return d?u+"+"+JSON.stringify(d):u},tileExists:function(r,s,o){var u=this.getNumTiles(r);return r>=this.minLevel&&r<=this.maxLevel&&s>=0&&o>=0&&s=0;D--)for(P=this.displayRects[D],M=P.minLevel;M<=P.maxLevel;M++)this._levelRects[M]||(this._levelRects[M]=[]),this._levelRects[M].push(P);n.TileSource.apply(this,[F])},n.extend(n.DziTileSource.prototype,n.TileSource.prototype,{supports:function(s,o){var u;return s.Image?u=s.Image.xmlns:s.documentElement&&(s.documentElement.localName==="Image"||s.documentElement.tagName==="Image")&&(u=s.documentElement.namespaceURI),u=(u||"").toLowerCase(),u.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||u.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(s,o,u){var d;return n.isPlainObject(s)?d=r(this,s):d=i(this,s),o&&!d.tilesUrl&&(d.tilesUrl=o.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),o.search(/\.(dzi|xml|js)\?/)!==-1?d.queryParams=o.match(/\?.*/):d.queryParams=""),d},getTileUrl:function(s,o,u){return[this.tilesUrl,s,"/",o,"_",u,".",this.fileFormat,this.queryParams].join("")},tileExists:function(s,o,u){var d=this._levelRects[s],h,g,y,w,C,D,P;if(this.minLevel&&sthis.maxLevel)return!1;if(!d||!d.length)return!0;for(P=d.length-1;P>=0;P--)if(h=d[P],!(sh.maxLevel)&&(g=this.getLevelScale(s),y=h.x*g,w=h.y*g,C=y+h.width*g,D=w+h.height*g,y=Math.floor(y/this._tileWidth),w=Math.floor(w/this._tileWidth),C=Math.ceil(C/this._tileWidth),D=Math.ceil(D/this._tileWidth),y<=o&&o0?u.tileSize=Math.max.apply(null,C):u.tileSize=y}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,u.levels=r(this),n.extend(!0,u,{width:u.levels[u.levels.length-1].width,height:u.levels[u.levels.length-1].height,tileSize:Math.max(u.height,u.width),tileOverlap:0,minLevel:0,maxLevel:u.levels.length-1}),this.levels=u.levels):n.console.error("Nothing in the info.json to construct image pyramids from");if(!u.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)u.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var P=Math.max.apply(null,this.scale_factors);u.maxLevel=Math.round(Math.log(P)*Math.LOG2E)}n.TileSource.apply(this,[u])},n.extend(n.IIIFTileSource.prototype,n.TileSource.prototype,{supports:function(u,d){return u.protocol&&u.protocol==="http://iiif.io/api/image"||u["@context"]&&(u["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||u["@context"]==="http://iiif.io/api/image/1/context.json")||u.profile&&u.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||u.identifier&&u.width&&u.height?!0:!!(u.documentElement&&u.documentElement.tagName==="info"&&u.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(u,d,h){if(n.isPlainObject(u)){if(!u["@context"])u["@context"]="http://iiif.io/api/image/1.0/context.json",u["@id"]=d.replace("/info.json",""),u.version=1;else{var y=u["@context"];if(Array.isArray(y)){for(var w=0;w0&&u>=this.minLevel&&u<=this.maxLevel&&(d=this.levels[u].width/this.levels[this.maxLevel].width),d}return n.TileSource.prototype.getLevelScale.call(this,u)},getNumTiles:function(u){if(this.emulateLegacyImagePyramid){var d=this.getLevelScale(u);return d?new n.Point(1,1):new n.Point(0,0)}return n.TileSource.prototype.getNumTiles.call(this,u)},getTileAtPoint:function(u,d){return this.emulateLegacyImagePyramid?new n.Point(0,0):n.TileSource.prototype.getTileAtPoint.call(this,u,d)},getTileUrl:function(u,d,h){if(this.emulateLegacyImagePyramid){var g=null;return this.levels.length>0&&u>=this.minLevel&&u<=this.maxLevel&&(g=this.levels[u].url),g}var y="0",w=Math.pow(.5,this.maxLevel-u),C=Math.ceil(this.width*w),D=Math.ceil(this.height*w),P,M,F,K,$,ee,he,ve,fe,ae,xe,Qe,ot,et;return P=this.getTileWidth(u),M=this.getTileHeight(u),F=Math.ceil(P/w),K=Math.ceil(M/w),this.version===1?ot="native."+this.tileFormat:ot="default."+this.tileFormat,C1&&u.profile[1].supports&&(y=u.profile[1].supports.indexOf("sizeByW")!==-1),u.version===3&&u.extraFeatures&&(y=u.extraFeatures.indexOf("sizeByWh")!==-1),!g||y}function r(u){for(var d=[],h=0;hg?y=h/256:y=g/256,d.maxLevel=Math.ceil(Math.log(y)/Math.log(2))-1,d.tileSize=256,d.width=h,d.height=g,n.TileSource.apply(this,[d])},n.extend(n.TmsTileSource.prototype,n.TileSource.prototype,{supports:function(i,r){return i.type&&i.type==="tiledmapservice"},configure:function(i,r,s){return i},getTileUrl:function(i,r,s){var o=this.getNumTiles(i).y-1;return this.tilesUrl+i+"/"+r+"/"+(o-s)+".png"}})}(e),function(n){n.ZoomifyTileSource=function(i){typeof i.tileSize>"u"&&(i.tileSize=256),typeof i.fileFormat>"u"&&(i.fileFormat="jpg",this.fileFormat=i.fileFormat);var r={x:i.width,y:i.height};for(i.imageSizes=[{x:i.width,y:i.height}],i.gridSize=[this._getGridSize(i.width,i.height,i.tileSize)];parseInt(r.x,10)>i.tileSize||parseInt(r.y,10)>i.tileSize;)r.x=Math.floor(r.x/2),r.y=Math.floor(r.y/2),i.imageSizes.push({x:r.x,y:r.y}),i.gridSize.push(this._getGridSize(r.x,r.y,i.tileSize));i.imageSizes.reverse(),i.gridSize.reverse(),i.minLevel=0,i.maxLevel=i.gridSize.length-1,e.TileSource.apply(this,[i])},n.extend(n.ZoomifyTileSource.prototype,n.TileSource.prototype,{_getGridSize:function(i,r,s){return{x:Math.ceil(i/s),y:Math.ceil(r/s)}},_calculateAbsoluteTileNumber:function(i,r,s){for(var o=0,u={},d=0;d0?(d=u.levels[u.levels.length-1].width,h=u.levels[u.levels.length-1].height):(d=0,h=0,n.console.error("No supported image formats found")),n.extend(!0,u,{width:d,height:h,tileSize:Math.max(h,d),tileOverlap:0,minLevel:0,maxLevel:u.levels.length>0?u.levels.length-1:0}),n.TileSource.apply(this,[u]),this.levels=u.levels},n.extend(n.LegacyTileSource.prototype,n.TileSource.prototype,{supports:function(o,u){return o.type&&o.type==="legacy-image-pyramid"||o.documentElement&&o.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(o,u,d){var h;return n.isPlainObject(o)?h=s(this,o):h=r(this,o),h},getLevelScale:function(o){var u=NaN;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(u=this.levels[o].width/this.levels[this.maxLevel].width),u},getNumTiles:function(o){var u=this.getLevelScale(o);return u?new n.Point(1,1):new n.Point(0,0)},getTileUrl:function(o,u,d){var h=null;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(h=this.levels[o].url),h}});function i(o){var u=[],d,h;for(h=0;h");return u.sort(function(g,y){return g.height-y.height})}function r(o,u){if(!u||!u.documentElement)throw new Error(n.getString("Errors.Xml"));var d=u.documentElement,h=d.tagName,g=null,y=[],w,C;if(h==="image")try{for(g={type:d.getAttribute("type"),levels:[]},y=d.getElementsByTagName("level"),C=0;C=this.minLevel&&i<=this.maxLevel&&(r=this.levels[i].width/this.levels[this.maxLevel].width),r},getNumTiles:function(i){var r=this.getLevelScale(i);return r?new n.Point(1,1):new n.Point(0,0)},getTileUrl:function(i,r,s){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].url),o},getContext2D:function(i,r,s){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].context2D),o},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var i=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!n.supportsCanvas||!this.useCanvas)return delete this._image,i;var r=this._image.naturalWidth,s=this._image.naturalHeight,o=document.createElement("canvas"),u=o.getContext("2d");if(o.width=r,o.height=s,u.drawImage(this._image,0,0,r,s),i[0].context2D=u,delete this._image,n.isCanvasTainted(o))return i;for(;r>=2&&s>=2;){r=Math.floor(r/2),s=Math.floor(s/2);var d=document.createElement("canvas"),h=d.getContext("2d");d.width=r,d.height=s,h.drawImage(o,0,0,r,s),i.splice(0,0,{context2D:h,width:r,height:s}),o=d,u=h}return i},_freeupCanvasMemory:function(){for(var i=0;i0&&i(h))}function s(h){h.shouldFade=!0,h.fadeBeginTime=n.now()+h.fadeDelay,window.setTimeout(function(){i(h)},h.fadeDelay)}function o(h){h.shouldFade=!1,h.imgGroup&&n.setElementOpacity(h.imgGroup,1,!0)}function u(h,g){h.element.disabled||(g>=n.ButtonState.GROUP&&h.currentState===n.ButtonState.REST&&(o(h),h.currentState=n.ButtonState.GROUP),g>=n.ButtonState.HOVER&&h.currentState===n.ButtonState.GROUP&&(h.imgHover&&(h.imgHover.style.visibility=""),h.currentState=n.ButtonState.HOVER),g>=n.ButtonState.DOWN&&h.currentState===n.ButtonState.HOVER&&(h.imgDown&&(h.imgDown.style.visibility=""),h.currentState=n.ButtonState.DOWN))}function d(h,g){h.element.disabled||(g<=n.ButtonState.HOVER&&h.currentState===n.ButtonState.DOWN&&(h.imgDown&&(h.imgDown.style.visibility="hidden"),h.currentState=n.ButtonState.HOVER),g<=n.ButtonState.GROUP&&h.currentState===n.ButtonState.HOVER&&(h.imgHover&&(h.imgHover.style.visibility="hidden"),h.currentState=n.ButtonState.GROUP),g<=n.ButtonState.REST&&h.currentState===n.ButtonState.GROUP&&(s(h),h.currentState=n.ButtonState.REST))}}(e),function(n){n.ButtonGroup=function(i){n.extend(!0,this,{buttons:[],clickTimeThreshold:n.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:n.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},i);var r=this.buttons.concat([]),s=this,o;if(this.element=i.element||n.makeNeutralElement("div"),!i.group)for(this.element.style.display="inline-block",o=0;o=270?(d=this.getTopRight(),this.x=d.x,this.y=d.y,h=this.height,this.height=this.width,this.width=h,this.degrees-=270):this.degrees>=180?(d=this.getBottomRight(),this.x=d.x,this.y=d.y,this.degrees-=180):this.degrees>=90&&(d=this.getBottomLeft(),this.x=d.x,this.y=d.y,h=this.height,this.height=this.width,this.width=h,this.degrees-=90)},n.Rect.fromSummits=function(i,r,s){var o=i.distanceTo(r),u=i.distanceTo(s),d=r.minus(i),h=Math.atan(d.y/d.x);return d.x<0?h+=Math.PI:d.y<0&&(h+=2*Math.PI),new n.Rect(i.x,i.y,o,u,h/Math.PI*180)},n.Rect.prototype={clone:function(){return new n.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new n.Point(this.x,this.y)},getBottomRight:function(){return new n.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new n.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new n.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new n.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new n.Point(this.width,this.height)},equals:function(i){return i instanceof n.Rect&&this.x===i.x&&this.y===i.y&&this.width===i.width&&this.height===i.height&&this.degrees===i.degrees},times:function(i){return new n.Rect(this.x*i,this.y*i,this.width*i,this.height*i,this.degrees)},translate:function(i){return new n.Rect(this.x+i.x,this.y+i.y,this.width,this.height,this.degrees)},union:function(i){var r=this.getBoundingBox(),s=i.getBoundingBox(),o=Math.min(r.x,s.x),u=Math.min(r.y,s.y),d=Math.max(r.x+r.width,s.x+s.width),h=Math.max(r.y+r.height,s.y+s.height);return new n.Rect(o,u,d-o,h-u)},intersection:function(i){var r=1e-10,s=[],o=this.getTopLeft();i.containsPoint(o,r)&&s.push(o);var u=this.getTopRight();i.containsPoint(u,r)&&s.push(u);var d=this.getBottomLeft();i.containsPoint(d,r)&&s.push(d);var h=this.getBottomRight();i.containsPoint(h,r)&&s.push(h);var g=i.getTopLeft();this.containsPoint(g,r)&&s.push(g);var y=i.getTopRight();this.containsPoint(y,r)&&s.push(y);var w=i.getBottomLeft();this.containsPoint(w,r)&&s.push(w);var C=i.getBottomRight();this.containsPoint(C,r)&&s.push(C);for(var D=this._getSegments(),P=i._getSegments(),M=0;Mfe&&(fe=ot.x),ot.yxe&&(xe=ot.y)}return new n.Rect(ve,ae,fe-ve,xe-ae)},_getSegments:function(){var i=this.getTopLeft(),r=this.getTopRight(),s=this.getBottomLeft(),o=this.getBottomRight();return[[i,r],[r,o],[o,s],[s,i]]},rotate:function(i,r){if(i=n.positiveModulo(i,360),i===0)return this.clone();r=r||this.getCenter();var s=this.getTopLeft().rotate(i,r),o=this.getTopRight().rotate(i,r),u=o.minus(s);u=u.apply(function(h){var g=1e-15;return Math.abs(h)=-r&&(i.x-o.x)*d.x+(i.y-o.y)*d.y<=r&&(i.x-s.x)*h.x+(i.y-s.y)*h.y>=-r&&(i.x-u.x)*h.x+(i.y-u.y)*h.y<=r},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(e),function(n){var i={};n.ReferenceStrip=function(w){var C=this,D=w.viewer,P=n.getElementSize(D.element),M,F,K;for(w.id||(w.id="referencestrip-"+n.now(),this.element=n.makeNeutralElement("div"),this.element.id=w.id,this.element.className="referencestrip"),w=n.extend(!0,{sizeRatio:n.DEFAULT_SETTINGS.referenceStripSizeRatio,position:n.DEFAULT_SETTINGS.referenceStripPosition,scroll:n.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:n.DEFAULT_SETTINGS.clickTimeThreshold},w,{element:this.element}),n.extend(this,w),i[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,F=this.element.style,F.marginTop="0px",F.marginRight="0px",F.marginBottom="0px",F.marginLeft="0px",F.left="0px",F.bottom="0px",F.border="0px",F.background="#000",F.position="relative",n.setElementTouchActionNone(this.element),n.setElementOpacity(this.element,.8),this.viewer=D,this.tracker=new n.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:n.delegate(this,r),dragHandler:n.delegate(this,s),scrollHandler:n.delegate(this,o),enterHandler:n.delegate(this,d),leaveHandler:n.delegate(this,h),keyDownHandler:n.delegate(this,g),keyHandler:n.delegate(this,y),preProcessEventHandler:function($){$.eventType==="wheel"&&($.preventDefault=!0)}}),w.width&&w.height?(this.element.style.width=w.width+"px",this.element.style.height=w.height+"px",D.addControl(this.element,{anchor:n.ControlAnchor.BOTTOM_LEFT})):w.scroll==="horizontal"?(this.element.style.width=P.x*w.sizeRatio*D.tileSources.length+12*D.tileSources.length+"px",this.element.style.height=P.y*w.sizeRatio+"px",D.addControl(this.element,{anchor:n.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=P.y*w.sizeRatio*D.tileSources.length+12*D.tileSources.length+"px",this.element.style.width=P.x*w.sizeRatio+"px",D.addControl(this.element,{anchor:n.ControlAnchor.TOP_LEFT})),this.panelWidth=P.x*this.sizeRatio+8,this.panelHeight=P.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},K=0;KF+D.x-this.panelWidth?($=Math.min($,P-D.x),this.element.style.marginLeft=-$+"px",u(this,D.x,-$)):$K+D.y-this.panelHeight?($=Math.min($,M-D.y),this.element.style.marginTop=-$+"px",u(this,D.y,-$)):$0?C>-(P-F.x)&&(this.element.style.marginLeft=C+w.delta.x*2+"px",u(this,F.x,C+w.delta.x*2)):-w.delta.x<0&&C<0&&(this.element.style.marginLeft=C+w.delta.x*2+"px",u(this,F.x,C+w.delta.x*2)):-w.delta.y>0?D>-(M-F.y)&&(this.element.style.marginTop=D+w.delta.y*2+"px",u(this,F.y,D+w.delta.y*2)):-w.delta.y<0&&D<0&&(this.element.style.marginTop=D+w.delta.y*2+"px",u(this,F.y,D+w.delta.y*2))}}function o(w){if(this.element){var C=Number(this.element.style.marginLeft.replace("px","")),D=Number(this.element.style.marginTop.replace("px","")),P=Number(this.element.style.width.replace("px","")),M=Number(this.element.style.height.replace("px","")),F=n.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?w.scroll>0?C>-(P-F.x)&&(this.element.style.marginLeft=C-w.scroll*60+"px",u(this,F.x,C-w.scroll*60)):w.scroll<0&&C<0&&(this.element.style.marginLeft=C-w.scroll*60+"px",u(this,F.x,C-w.scroll*60)):w.scroll<0?D>F.y-M&&(this.element.style.marginTop=D+w.scroll*60+"px",u(this,F.y,D+w.scroll*60)):w.scroll>0&&D<0&&(this.element.style.marginTop=D+w.scroll*60+"px",u(this,F.y,D+w.scroll*60)),w.preventDefault=!0}}function u(w,C,D){var P,M,F,K,$,ee;for(w.scroll==="horizontal"?P=w.panelWidth:P=w.panelHeight,M=Math.ceil(C/P)+5,F=Math.ceil((Math.abs(D)+C)/P)+1,M=F-M,M=M<0?0:M,$=M;$1?s[1].springStiffness:5,animationTime:s.length>1?s[1].animationTime:1.5}),n.console.assert(typeof r.springStiffness=="number"&&r.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),n.console.assert(typeof r.animationTime=="number"&&r.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),r.exponential&&(this._exponential=!0,delete r.exponential),n.extend(!0,this,r),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:n.now()},n.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},n.Spring.prototype={resetTo:function(r){n.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=r,this.start.time=this.target.time=this.current.time=n.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(r){n.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=r,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(r){this.start.value+=r,this.target.value+=r,this._exponential&&(n.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(r){this._exponential=r,this._exponential&&(n.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=n.now();var r,s;this._exponential?(r=this.start._logValue,s=this.target._logValue):(r=this.start.value,s=this.target.value);var o=this.current.time>=this.target.time?s:r+(s-r)*i(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),u=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,u!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function i(r,s){return(1-Math.exp(r*-s))/(1-Math.exp(-r))}}(e),function(n){function i(s){n.extend(!0,this,{timeout:n.DEFAULT_SETTINGS.timeout,jobId:null},s),this.image=null}i.prototype={errorMsg:null,start:function(){var s=this,o=this.abort;this.image=new Image,this.image.onload=function(){s.finish(!0)},this.image.onabort=this.image.onerror=function(){s.errorMsg="Image load aborted",s.finish(!1)},this.jobId=window.setTimeout(function(){s.errorMsg="Image load exceeded timeout ("+s.timeout+" ms)",s.finish(!1)},this.timeout),this.loadWithAjax?(this.request=n.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",postData:this.postData,success:function(u){var d;try{d=new window.Blob([u.response])}catch(w){var h=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(w.name==="TypeError"&&h){var g=new h;g.append(u.response),d=g.getBlob()}}d.size===0&&(s.errorMsg="Empty image response.",s.finish(!1));var y=(window.URL||window.webkitURL).createObjectURL(d);s.image.src=y},error:function(u){s.errorMsg="Image load aborted - XHR error: Ajax returned "+u.status,s.finish(!1)}}),this.abort=function(){s.request.abort(),typeof o=="function"&&o()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(s){this.image.onload=this.image.onerror=this.image.onabort=null,s||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},n.ImageLoader=function(s){n.extend(!0,this,{jobLimit:n.DEFAULT_SETTINGS.imageLoaderLimit,timeout:n.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},s)},n.ImageLoader.prototype={addJob:function(s){var o=this,u=function(g){r(o,g,s.callback)},d={src:s.src,loadWithAjax:s.loadWithAjax,ajaxHeaders:s.loadWithAjax?s.ajaxHeaders:null,crossOriginPolicy:s.crossOriginPolicy,ajaxWithCredentials:s.ajaxWithCredentials,postData:s.postData,callback:u,abort:s.abort,timeout:this.timeout},h=new i(d);!this.jobLimit||this.jobsInProgress0&&(d=s.jobQueue.shift(),d.start(),s.jobsInProgress++),u(o.image,o.errorMsg,o.request)}}(e),function(n){n.Tile=function(i,r,s,o,u,d,h,g,y,w,C,D){this.level=i,this.x=r,this.y=s,this.bounds=o,this.sourceBounds=w,this.exists=u,this.url=d,this.postData=C,this.context2D=h,this.loadWithAjax=g,this.ajaxHeaders=y,D===void 0&&(n.console.error("Tile constructor needs 'cacheKey' variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used."),D=n.TileSource.prototype.getTileHashKey(i,r,s,d,y,C)),this.cacheKey=D,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},n.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(i){if(!this.cacheImageRecord){n.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){n.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=n.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==i&&i.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),n.setElementOpacity(this.element,this.opacity)},drawCanvas:function(i,r,s,o,u){var d=this.position.times(n.pixelDensityRatio),h=this.size.times(n.pixelDensityRatio),g;if(!this.context2D&&!this.cacheImageRecord){n.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(g=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!g){n.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}i.save(),i.globalAlpha=this.opacity,typeof s=="number"&&s!==1&&(d=d.times(s),h=h.times(s)),o instanceof n.Point&&(d=d.plus(o)),i.globalAlpha===1&&this._hasTransparencyChannel()&&(u&&(d.x=Math.round(d.x),d.y=Math.round(d.y),h.x=Math.round(h.x),h.y=Math.round(h.y)),i.clearRect(d.x,d.y,h.x,h.y)),r({context:i,tile:this,rendered:g});var y,w;this.sourceBounds?(y=Math.min(this.sourceBounds.width,g.canvas.width),w=Math.min(this.sourceBounds.height,g.canvas.height)):(y=g.canvas.width,w=g.canvas.height),i.translate(d.x+h.x/2,0),this.flipped&&i.scale(-1,1),i.drawImage(g.canvas,0,0,y,w,-h.x/2,d.y,h.x,h.y),i.restore()},getScaleForEdgeSmoothing:function(){var i;if(this.cacheImageRecord)i=this.cacheImageRecord.getRenderedContext();else if(this.context2D)i=this.context2D;else return n.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return i.canvas.width/(this.size.x*n.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(i,r,s){var o=Math.max(1,Math.ceil((s.x-r.x)/2)),u=Math.max(1,Math.ceil((s.y-r.y)/2));return new n.Point(o,u).minus(this.position.times(n.pixelDensityRatio).times(i||1).apply(function(d){return d%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(e),function(n){n.OverlayPlacement=n.Placement,n.OverlayRotationMode=n.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),n.Overlay=function(i,r,s){var o;n.isPlainObject(i)?o=i:o={element:i,location:r,placement:s},this.element=o.element,this.style=o.element.style,this._init(o)},n.Overlay.prototype={_init:function(i){this.location=i.location,this.placement=i.placement===void 0?n.Placement.TOP_LEFT:i.placement,this.onDraw=i.onDraw,this.checkResize=i.checkResize===void 0?!0:i.checkResize,this.width=i.width===void 0?null:i.width,this.height=i.height===void 0?null:i.height,this.rotationMode=i.rotationMode||n.OverlayRotationMode.EXACT,this.location instanceof n.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=n.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new n.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(i,r){var s=n.Placement.properties[this.placement];s&&(s.isHorizontallyCentered?i.x-=r.x/2:s.isRight&&(i.x-=r.x),s.isVerticallyCentered?i.y-=r.y/2:s.isBottom&&(i.y-=r.y))},destroy:function(){var i=this.element,r=this.style;i.parentNode&&(i.parentNode.removeChild(i),i.prevElementParent&&(r.display="none",document.body.appendChild(i))),this.onDraw=null,r.top="",r.left="",r.position="",this.width!==null&&(r.width=""),this.height!==null&&(r.height="");var s=n.getCssPropertyWithVendorPrefix("transformOrigin"),o=n.getCssPropertyWithVendorPrefix("transform");s&&o&&(r[s]="",r[o]="")},drawHTML:function(i,r){var s=this.element;s.parentNode!==i&&(s.prevElementParent=s.parentNode,s.prevNextSibling=s.nextSibling,i.appendChild(s),this.style.position="absolute",this.size=n.getElementSize(s));var o=this._getOverlayPositionAndSize(r),u=o.position,d=this.size=o.size,h=o.rotate;if(this.onDraw)this.onDraw(u,d,this.element);else{var g=this.style;g.left=u.x+"px",g.top=u.y+"px",this.width!==null&&(g.width=d.x+"px"),this.height!==null&&(g.height=d.y+"px");var y=n.getCssPropertyWithVendorPrefix("transformOrigin"),w=n.getCssPropertyWithVendorPrefix("transform");y&&w&&(h?(g[y]=this._getTransformOrigin(),g[w]="rotate("+h+"deg)"):(g[y]="",g[w]="")),g.display="block"}},_getOverlayPositionAndSize:function(i){var r=i.pixelFromPoint(this.location,!0),s=this._getSizeInPixels(i);this.adjust(r,s);var o=0;if(i.degrees&&this.rotationMode!==n.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===n.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var u=new n.Rect(r.x,r.y,s.x,s.y),d=this._getBoundingBox(u,i.degrees);r=d.getTopLeft(),s=d.getSize()}else o=i.degrees;return{position:r,size:s,rotate:o}},_getSizeInPixels:function(i){var r=this.size.x,s=this.size.y;if(this.width!==null||this.height!==null){var o=i.deltaPixelsFromPointsNoRotate(new n.Point(this.width||0,this.height||0),!0);this.width!==null&&(r=o.x),this.height!==null&&(s=o.y)}if(this.checkResize&&(this.width===null||this.height===null)){var u=this.size=n.getElementSize(this.element);this.width===null&&(r=u.x),this.height===null&&(s=u.y)}return new n.Point(r,s)},_getBoundingBox:function(i,r){var s=this._getPlacementPoint(i);return i.rotate(r,s).getBoundingBox()},_getPlacementPoint:function(i){var r=new n.Point(i.x,i.y),s=n.Placement.properties[this.placement];return s&&(s.isHorizontallyCentered?r.x+=i.width/2:s.isRight&&(r.x+=i.width),s.isVerticallyCentered?r.y+=i.height/2:s.isBottom&&(r.y+=i.height)),r},_getTransformOrigin:function(){var i="",r=n.Placement.properties[this.placement];return r&&(r.isLeft?i="left":r.isRight&&(i="right"),r.isTop?i+=" top":r.isBottom&&(i+=" bottom")),i},update:function(i,r){var s=n.isPlainObject(i)?i:{location:i,placement:r};this._init({location:s.location||this.location,placement:s.placement!==void 0?s.placement:this.placement,onDraw:s.onDraw||this.onDraw,checkResize:s.checkResize||this.checkResize,width:s.width!==void 0?s.width:this.width,height:s.height!==void 0?s.height:this.height,rotationMode:s.rotationMode||this.rotationMode})},getBounds:function(i){n.console.assert(i,"A viewport must now be passed to Overlay.getBounds.");var r=this.width,s=this.height;if(r===null||s===null){var o=i.deltaPointsFromPixelsNoRotate(this.size,!0);r===null&&(r=o.x),s===null&&(s=o.y)}var u=this.location.clone();return this.adjust(u,new n.Point(r,s)),this._adjustBoundsForRotation(i,new n.Rect(u.x,u.y,r,s))},_adjustBoundsForRotation:function(i,r){if(!i||i.degrees===0||this.rotationMode===n.OverlayRotationMode.EXACT)return r;if(this.rotationMode===n.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return r;var s=this._getOverlayPositionAndSize(i);return i.viewerElementToViewportRectangle(new n.Rect(s.position.x,s.position.y,s.size.x,s.size.y))}return r.rotate(-i.degrees,this._getPlacementPoint(r))}}}(e),function(n){n.Drawer=function(i){n.console.assert(i.viewer,"[Drawer] options.viewer is required");var r=arguments;if(n.isPlainObject(i)||(i={source:r[0],viewport:r[1],element:r[2]}),n.console.assert(i.viewport,"[Drawer] options.viewport is required"),n.console.assert(i.element,"[Drawer] options.element is required"),i.source&&n.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=i.viewer,this.viewport=i.viewport,this.debugGridColor=typeof i.debugGridColor=="string"?[i.debugGridColor]:i.debugGridColor||n.DEFAULT_SETTINGS.debugGridColor,i.opacity&&n.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=n.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=n.getElement(i.element),this.canvas=n.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var s=this._calculateCanvasSize();this.canvas.width=s.x,this.canvas.height=s.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",n.setElementOpacity(this.canvas,this.opacity,!0),n.setElementPointerEventsNone(this.canvas),n.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},n.Drawer.prototype={addOverlay:function(i,r,s,o){return n.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(i,r,s,o),this},updateOverlay:function(i,r,s){return n.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(i,r,s),this},removeOverlay:function(i){return n.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(i),this},clearOverlays:function(){return n.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(i){var r=this.viewport.pixelFromPointNoRotate(i,!0);return new n.Point(r.x*n.pixelDensityRatio,r.y*n.pixelDensityRatio)},clipWithPolygons:function(i,r){if(this.useCanvas){var s=this._getContext(r);s.beginPath(),i.forEach(function(o){o.forEach(function(u,d){s[d===0?"moveTo":"lineTo"](u.x,u.y)})}),s.clip()}},setOpacity:function(i){n.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var r=this.viewer.world,s=0;sr&&(r=o)}return r},needsUpdate:function(){return n.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return n.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return n.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return n.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var i=this._calculateCanvasSize();if((this.canvas.width!==i.x||this.canvas.height!==i.y)&&(this.canvas.width=i.x,this.canvas.height=i.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var r=this._calculateSketchCanvasSize();this.sketchCanvas.width=r.x,this.sketchCanvas.height=r.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(i,r){if(this.useCanvas){var s=this._getContext(i);if(r)s.clearRect(r.x,r.y,r.width,r.height);else{var o=s.canvas;s.clearRect(0,0,o.width,o.height)}}},viewportToDrawerRectangle:function(i){var r=this.viewport.pixelFromPointNoRotate(i.getTopLeft(),!0),s=this.viewport.deltaPixelsFromPointsNoRotate(i.getSize(),!0);return new n.Rect(r.x*n.pixelDensityRatio,r.y*n.pixelDensityRatio,s.x*n.pixelDensityRatio,s.y*n.pixelDensityRatio)},drawTile:function(i,r,s,o,u,d){if(n.console.assert(i,"[Drawer.drawTile] tile is required"),n.console.assert(r,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var h=this._getContext(s);o=o||1,i.drawCanvas(h,r,o,u,d)}else i.drawHTML(this.canvas)},_getContext:function(i){var r=this.context;if(i){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var s=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=s.x,this.sketchCanvas.height=s.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var o=this;this.viewer.addHandler("rotate",function u(){if(o.viewport.getRotation()!==0){o.viewer.removeHandler("rotate",u);var d=o._calculateSketchCanvasSize();o.sketchCanvas.width=d.x,o.sketchCanvas.height=d.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}r=this.sketchContext}return r},saveContext:function(i){this.useCanvas&&this._getContext(i).save()},restoreContext:function(i){this.useCanvas&&this._getContext(i).restore()},setClip:function(i,r){if(this.useCanvas){var s=this._getContext(r);s.beginPath(),s.rect(i.x,i.y,i.width,i.height),s.clip()}},drawRectangle:function(i,r,s){if(this.useCanvas){var o=this._getContext(s);o.save(),o.fillStyle=r,o.fillRect(i.x,i.y,i.width,i.height),o.restore()}},blendSketch:function(i,r,s,o){var u=i;if(n.isPlainObject(u)||(u={opacity:i,scale:r,translate:s,compositeOperation:o}),!(!this.useCanvas||!this.sketchCanvas)){i=u.opacity,o=u.compositeOperation;var d=u.bounds;if(this.context.save(),this.context.globalAlpha=i,o&&(this.context.globalCompositeOperation=o),d)d.x<0&&(d.width+=d.x,d.x=0),d.x+d.width>this.canvas.width&&(d.width=this.canvas.width-d.x),d.y<0&&(d.height+=d.y,d.y=0),d.y+d.height>this.canvas.height&&(d.height=this.canvas.height-d.y),this.context.drawImage(this.sketchCanvas,d.x,d.y,d.width,d.height,d.x,d.y,d.width,d.height);else{r=u.scale||1,s=u.translate;var h=s instanceof n.Point?s:new n.Point(0,0),g=0,y=0;if(s){var w=this.sketchCanvas.width-this.canvas.width,C=this.sketchCanvas.height-this.canvas.height;g=Math.round(w/2),y=Math.round(C/2)}this.context.drawImage(this.sketchCanvas,h.x-g*r,h.y-y*r,(this.canvas.width+2*g)*r,(this.canvas.height+2*y)*r,-g,-y,this.canvas.width+2*g,this.canvas.height+2*y)}this.context.restore()}},drawDebugInfo:function(i,r,s,o){if(this.useCanvas){var u=this.viewer.world.getIndexOfItem(o)%this.debugGridColor.length,d=this.context;d.save(),d.lineWidth=2*n.pixelDensityRatio,d.font="small-caps bold "+13*n.pixelDensityRatio+"px arial",d.strokeStyle=this.debugGridColor[u],d.fillStyle=this.debugGridColor[u],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),o.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:o.getRotation(!0),point:o.viewport.pixelFromPointNoRotate(o._getRotationPoint(!0),!0)}),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),d.strokeRect(i.position.x*n.pixelDensityRatio,i.position.y*n.pixelDensityRatio,i.size.x*n.pixelDensityRatio,i.size.y*n.pixelDensityRatio);var h=(i.position.x+i.size.x/2)*n.pixelDensityRatio,g=(i.position.y+i.size.y/2)*n.pixelDensityRatio;d.translate(h,g),d.rotate(Math.PI/180*-this.viewport.degrees),d.translate(-h,-g),i.x===0&&i.y===0&&(d.fillText("Zoom: "+this.viewport.getZoom(),i.position.x*n.pixelDensityRatio,(i.position.y-30)*n.pixelDensityRatio),d.fillText("Pan: "+this.viewport.getBounds().toString(),i.position.x*n.pixelDensityRatio,(i.position.y-20)*n.pixelDensityRatio)),d.fillText("Level: "+i.level,(i.position.x+10)*n.pixelDensityRatio,(i.position.y+20)*n.pixelDensityRatio),d.fillText("Column: "+i.x,(i.position.x+10)*n.pixelDensityRatio,(i.position.y+30)*n.pixelDensityRatio),d.fillText("Row: "+i.y,(i.position.x+10)*n.pixelDensityRatio,(i.position.y+40)*n.pixelDensityRatio),d.fillText("Order: "+s+" of "+r,(i.position.x+10)*n.pixelDensityRatio,(i.position.y+50)*n.pixelDensityRatio),d.fillText("Size: "+i.size.toString(),(i.position.x+10)*n.pixelDensityRatio,(i.position.y+60)*n.pixelDensityRatio),d.fillText("Position: "+i.position.toString(),(i.position.x+10)*n.pixelDensityRatio,(i.position.y+70)*n.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),o.getRotation(!0)%360!==0&&this._restoreRotationChanges(),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),d.restore()}},debugRect:function(i){if(this.useCanvas){var r=this.context;r.save(),r.lineWidth=2*n.pixelDensityRatio,r.strokeStyle=this.debugGridColor[0],r.fillStyle=this.debugGridColor[0],r.strokeRect(i.x*n.pixelDensityRatio,i.y*n.pixelDensityRatio,i.width*n.pixelDensityRatio,i.height*n.pixelDensityRatio),r.restore()}},setImageSmoothingEnabled:function(i){this.useCanvas&&(this._imageSmoothingEnabled=i,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(i){i.msImageSmoothingEnabled=this._imageSmoothingEnabled,i.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(i){var r=this._getContext(i).canvas;return new n.Point(r.width,r.height)},getCanvasCenter:function(){return new n.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(i){var r=i.point?i.point.times(n.pixelDensityRatio):this.getCanvasCenter(),s=this._getContext(i.useSketch);s.save(),s.translate(r.x,r.y),this.viewer.viewport.flipped?(s.rotate(Math.PI/180*-i.degrees),s.scale(-1,1)):s.rotate(Math.PI/180*i.degrees),s.translate(-r.x,-r.y)},_flip:function(i){i=i||{};var r=i.point?i.point.times(n.pixelDensityRatio):this.getCanvasCenter(),s=this._getContext(i.useSketch);s.translate(r.x,0),s.scale(-1,1),s.translate(-r.x,0)},_restoreRotationChanges:function(i){var r=this._getContext(i);r.restore()},_calculateCanvasSize:function(){var i=n.pixelDensityRatio,r=this.viewport.getContainerSize();return{x:Math.round(r.x*i),y:Math.round(r.y*i)}},_calculateSketchCanvasSize:function(){var i=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return i;var r=Math.ceil(Math.sqrt(i.x*i.x+i.y*i.y));return{x:r,y:r}}}}(e),function(n){n.Viewport=function(i){var r=arguments;r.length&&r[0]instanceof n.Point&&(i={containerSize:r[0],contentSize:r[1],config:r[2]}),i.config&&(n.extend(!0,i,i.config),delete i.config),this._margins=n.extend({left:0,top:0,right:0,bottom:0},i.margins||{}),delete i.margins,n.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:n.DEFAULT_SETTINGS.springStiffness,animationTime:n.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:n.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:n.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:n.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:n.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:n.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:n.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:n.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:n.DEFAULT_SETTINGS.maxZoomLevel,degrees:n.DEFAULT_SETTINGS.degrees,flipped:n.DEFAULT_SETTINGS.flipped,homeFillsViewer:n.DEFAULT_SETTINGS.homeFillsViewer,silenceMultiImageWarnings:n.DEFAULT_SETTINGS.silenceMultiImageWarnings},i),this._updateContainerInnerSize(),this.centerSpringX=new n.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new n.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new n.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new n.Rect(0,0,1,1),1),this.goHome(!0),this.update()},n.Viewport.prototype={resetContentSize:function(i){return n.console.assert(i,"[Viewport.resetContentSize] contentSize is required"),n.console.assert(i instanceof n.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),n.console.assert(i.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),n.console.assert(i.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new n.Rect(0,0,1,i.y/i.x),i.x),this},setHomeBounds:function(i,r){n.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(i,r)},_setContentBounds:function(i,r){n.console.assert(i,"[Viewport._setContentBounds] bounds is required"),n.console.assert(i instanceof n.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),n.console.assert(i.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),n.console.assert(i.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=i.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(r),this._contentBounds=i.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(r),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:r,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var i=this._contentAspectRatio/this.getAspectRatio(),r;return this.homeFillsViewer?r=i>=1?i:1:r=i>=1?1:i,r/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var i=this._contentBounds.getCenter(),r=1/this.getHomeZoom(),s=r/this.getAspectRatio();return new n.Rect(i.x-r/2,i.y-s/2,r,s)},goHome:function(i){return this.viewer&&this.viewer.raiseEvent("home",{immediately:i}),this.fitBounds(this.getHomeBounds(),i)},getMinZoom:function(){var i=this.getHomeZoom(),r=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*i;return r},getMaxZoom:function(){var i=this.maxZoomLevel;return i||(i=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,i/=this._contentBounds.width),Math.max(i,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new n.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return n.extend({},this._margins)},setMargins:function(i){n.console.assert(n.type(i)==="object","[Viewport.setMargins] margins must be an object"),this._margins=n.extend({left:0,top:0,right:0,bottom:0},i),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(i){return this.getBoundsNoRotate(i).rotate(-this.getRotation())},getBoundsNoRotate:function(i){var r=this.getCenter(i),s=1/this.getZoom(i),o=s/this.getAspectRatio();return new n.Rect(r.x-s/2,r.y-o/2,s,o)},getBoundsWithMargins:function(i){return this.getBoundsNoRotateWithMargins(i).rotate(-this.getRotation(),this.getCenter(i))},getBoundsNoRotateWithMargins:function(i){var r=this.getBoundsNoRotate(i),s=this._containerInnerSize.x*this.getZoom(i);return r.x-=this._margins.left/s,r.y-=this._margins.top/s,r.width+=(this._margins.left+this._margins.right)/s,r.height+=(this._margins.top+this._margins.bottom)/s,r},getCenter:function(i){var r=new n.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),s=new n.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),o,u,d,h,g,y,w,C;return i?r:this.zoomPoint?(o=this.pixelFromPoint(this.zoomPoint,!0),u=this.getZoom(),d=1/u,h=d/this.getAspectRatio(),g=new n.Rect(r.x-d/2,r.y-h/2,d,h),y=this._pixelFromPoint(this.zoomPoint,g),w=y.minus(o),C=w.divide(this._containerInnerSize.x*u),s.plus(C)):s},getZoom:function(i){return i?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(i){return Math.max(Math.min(i,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(i){var r=new n.Rect(i.x,i.y,i.width,i.height);if(!this.wrapHorizontal){var s=this.visibilityRatio*r.width,o=r.x+r.width,u=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,d=this._contentBoundsNoRotate.x-o+s,h=u-r.x-s;s>this._contentBoundsNoRotate.width?r.x+=(d+h)/2:h<0?r.x+=h:d>0&&(r.x+=d)}if(!this.wrapVertical){var g=this.visibilityRatio*r.height,y=r.y+r.height,w=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,C=this._contentBoundsNoRotate.y-y+g,D=w-r.y-g;g>this._contentBoundsNoRotate.height?r.y+=(C+D)/2:D<0?r.y+=D:C>0&&(r.y+=C)}return r},_raiseConstraintsEvent:function(i){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:i})},applyConstraints:function(i){var r=this.getZoom(),s=this._applyZoomConstraints(r);r!==s&&this.zoomTo(s,this.zoomPoint,i);var o=this.getBoundsNoRotate(),u=this._applyBoundaryConstraints(o);return this._raiseConstraintsEvent(i),(o.x!==u.x||o.y!==u.y||i)&&this.fitBounds(u.rotate(-this.getRotation()),i),this},ensureVisible:function(i){return this.applyConstraints(i)},_fitBounds:function(i,r){r=r||{};var s=r.immediately||!1,o=r.constraints||!1,u=this.getAspectRatio(),d=i.getCenter(),h=new n.Rect(i.x,i.y,i.width,i.height,i.degrees+this.getRotation()).getBoundingBox();h.getAspectRatio()>=u?h.height=h.width/u:h.width=h.height*u,h.x=d.x-h.width/2,h.y=d.y-h.height/2;var g=1/h.width;if(o){var y=h.getAspectRatio(),w=this._applyZoomConstraints(g);g!==w&&(g=w,h.width=1/g,h.x=d.x-h.width/2,h.height=h.width/y,h.y=d.y-h.height/2),h=this._applyBoundaryConstraints(h),d=h.getCenter(),this._raiseConstraintsEvent(s)}if(s)return this.panTo(d,!0),this.zoomTo(g,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var C=this.getBounds(),D=this.getZoom();if(D===0||Math.abs(g/D-1)<1e-8)return this.zoomTo(g,!0),this.panTo(d,s);h=h.rotate(-this.getRotation());var P=h.getTopLeft().times(g).minus(C.getTopLeft().times(D)).divide(g-D);return this.zoomTo(g,P,s)},fitBounds:function(i,r){return this._fitBounds(i,{immediately:r,constraints:!1})},fitBoundsWithConstraints:function(i,r){return this._fitBounds(i,{immediately:r,constraints:!0})},fitVertically:function(i){var r=new n.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(r,i)},fitHorizontally:function(i){var r=new n.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(r,i)},getConstrainedBounds:function(i){var r,s;return r=this.getBounds(i),s=this._applyBoundaryConstraints(r),s},panBy:function(i,r){var s=new n.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(s.plus(i),r)},panTo:function(i,r){return r?(this.centerSpringX.resetTo(i.x),this.centerSpringY.resetTo(i.y)):(this.centerSpringX.springTo(i.x),this.centerSpringY.springTo(i.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:i,immediately:r}),this},zoomBy:function(i,r,s){return this.zoomTo(this.zoomSpring.target.value*i,r,s)},zoomTo:function(i,r,s){var o=this;return this.zoomPoint=r instanceof n.Point&&!isNaN(r.x)&&!isNaN(r.y)?r:null,s?this._adjustCenterSpringsForZoomPoint(function(){o.zoomSpring.resetTo(i)}):this.zoomSpring.springTo(i),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:i,refPoint:r,immediately:s}),this},setRotation:function(i){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=n.positiveModulo(i,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:i}),this)},getRotation:function(){return this.degrees},resize:function(i,r){var s=this.getBoundsNoRotate(),o=s,u;return this.containerSize.x=i.x,this.containerSize.y=i.y,this._updateContainerInnerSize(),r&&(u=i.x/this.containerSize.x,o.width=s.width*u,o.height=o.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:i,maintain:r}),this.fitBounds(o,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new n.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var i=this;this._adjustCenterSpringsForZoomPoint(function(){i.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var r=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,r},_adjustCenterSpringsForZoomPoint:function(i){if(this.zoomPoint){var r=this.pixelFromPoint(this.zoomPoint,!0);i();var s=this.pixelFromPoint(this.zoomPoint,!0),o=s.minus(r),u=this.deltaPointsFromPixels(o,!0);this.centerSpringX.shiftBy(u.x),this.centerSpringY.shiftBy(u.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else i()},deltaPixelsFromPointsNoRotate:function(i,r){return i.times(this._containerInnerSize.x*this.getZoom(r))},deltaPixelsFromPoints:function(i,r){return this.deltaPixelsFromPointsNoRotate(i.rotate(this.getRotation()),r)},deltaPointsFromPixelsNoRotate:function(i,r){return i.divide(this._containerInnerSize.x*this.getZoom(r))},deltaPointsFromPixels:function(i,r){return this.deltaPointsFromPixelsNoRotate(i,r).rotate(-this.getRotation())},pixelFromPointNoRotate:function(i,r){return this._pixelFromPointNoRotate(i,this.getBoundsNoRotate(r))},pixelFromPoint:function(i,r){return this._pixelFromPoint(i,this.getBoundsNoRotate(r))},_pixelFromPointNoRotate:function(i,r){return i.minus(r.getTopLeft()).times(this._containerInnerSize.x/r.width).plus(new n.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(i,r){return this._pixelFromPointNoRotate(i.rotate(this.getRotation(),this.getCenter(!0)),r)},pointFromPixelNoRotate:function(i,r){var s=this.getBoundsNoRotate(r);return i.minus(new n.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/s.width).plus(s.getTopLeft())},pointFromPixel:function(i,r){return this.pointFromPixelNoRotate(i,r).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(i,r){var s=this._contentBoundsNoRotate.width;return new n.Point(i*this._contentSizeNoRotate.x/s,r*this._contentSizeNoRotate.x/s)},viewportToImageCoordinates:function(i,r){if(i instanceof n.Point)return this.viewportToImageCoordinates(i.x,i.y);if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(s===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageCoordinates(i,r,!0)}}return this._viewportToImageDelta(i-this._contentBoundsNoRotate.x,r-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(i,r){var s=this._contentBoundsNoRotate.width;return new n.Point(i/this._contentSizeNoRotate.x*s,r/this._contentSizeNoRotate.x*s)},imageToViewportCoordinates:function(i,r){if(i instanceof n.Point)return this.imageToViewportCoordinates(i.x,i.y);if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(s===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportCoordinates(i,r,!0)}}var u=this._imageToViewportDelta(i,r);return u.x+=this._contentBoundsNoRotate.x,u.y+=this._contentBoundsNoRotate.y,u},imageToViewportRectangle:function(i,r,s,o){var u=i;if(u instanceof n.Rect||(u=new n.Rect(i,r,s,o)),this.viewer){var d=this.viewer.world.getItemCount();if(d>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(d===1){var h=this.viewer.world.getItemAt(0);return h.imageToViewportRectangle(i,r,s,o,!0)}}var g=this.imageToViewportCoordinates(u.x,u.y),y=this._imageToViewportDelta(u.width,u.height);return new n.Rect(g.x,g.y,y.x,y.y,u.degrees)},viewportToImageRectangle:function(i,r,s,o){var u=i;if(u instanceof n.Rect||(u=new n.Rect(i,r,s,o)),this.viewer){var d=this.viewer.world.getItemCount();if(d>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(d===1){var h=this.viewer.world.getItemAt(0);return h.viewportToImageRectangle(i,r,s,o,!0)}}var g=this.viewportToImageCoordinates(u.x,u.y),y=this._viewportToImageDelta(u.width,u.height);return new n.Rect(g.x,g.y,y.x,y.y,u.degrees)},viewerElementToImageCoordinates:function(i){var r=this.pointFromPixel(i,!0);return this.viewportToImageCoordinates(r)},imageToViewerElementCoordinates:function(i){var r=this.imageToViewportCoordinates(i);return this.pixelFromPoint(r,!0)},windowToImageCoordinates:function(i){n.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var r=i.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(r)},imageToWindowCoordinates:function(i){n.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var r=this.imageToViewerElementCoordinates(i);return r.plus(n.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(i){return this.pointFromPixel(i,!0)},viewportToViewerElementCoordinates:function(i){return this.pixelFromPoint(i,!0)},viewerElementToViewportRectangle:function(i){return n.Rect.fromSummits(this.pointFromPixel(i.getTopLeft(),!0),this.pointFromPixel(i.getTopRight(),!0),this.pointFromPixel(i.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(i){return n.Rect.fromSummits(this.pixelFromPoint(i.getTopLeft(),!0),this.pixelFromPoint(i.getTopRight(),!0),this.pixelFromPoint(i.getBottomLeft(),!0))},windowToViewportCoordinates:function(i){n.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var r=i.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(r)},viewportToWindowCoordinates:function(i){n.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var r=this.viewportToViewerElementCoordinates(i);return r.plus(n.getElementPosition(this.viewer.element))},viewportToImageZoom:function(i){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(r===1){var s=this.viewer.world.getItemAt(0);return s.viewportToImageZoom(i)}}var o=this._contentSizeNoRotate.x,u=this._containerInnerSize.x,d=this._contentBoundsNoRotate.width,h=u/o*d;return i*h},imageToViewportZoom:function(i){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(r===1){var s=this.viewer.world.getItemAt(0);return s.imageToViewportZoom(i)}}var o=this._contentSizeNoRotate.x,u=this._containerInnerSize.x,d=this._contentBoundsNoRotate.width,h=o/u/d;return i*h},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(i){return this.flipped===i?this:(this.flipped=i,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:i}),this)}}}(e),function(n){n.TiledImage=function(u){var d=this;n.console.assert(u.tileCache,"[TiledImage] options.tileCache is required"),n.console.assert(u.drawer,"[TiledImage] options.drawer is required"),n.console.assert(u.viewer,"[TiledImage] options.viewer is required"),n.console.assert(u.imageLoader,"[TiledImage] options.imageLoader is required"),n.console.assert(u.source,"[TiledImage] options.source is required"),n.console.assert(!u.clip||u.clip instanceof n.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),n.EventSource.call(this),this._tileCache=u.tileCache,delete u.tileCache,this._drawer=u.drawer,delete u.drawer,this._imageLoader=u.imageLoader,delete u.imageLoader,u.clip instanceof n.Rect&&(this._clip=u.clip.clone()),delete u.clip;var h=u.x||0;delete u.x;var g=u.y||0;delete u.y,this.normHeight=u.source.dimensions.y/u.source.dimensions.x,this.contentAspectX=u.source.dimensions.x/u.source.dimensions.y;var y=1;u.width?(y=u.width,delete u.width,u.height&&(n.console.error("specifying both width and height to a tiledImage is not supported"),delete u.height)):u.height&&(y=u.height/this.normHeight,delete u.height);var w=u.fitBounds;delete u.fitBounds;var C=u.fitBoundsPlacement||e.Placement.CENTER;delete u.fitBoundsPlacement;var D=u.degrees||0;delete u.degrees,n.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:n.DEFAULT_SETTINGS.springStiffness,animationTime:n.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:n.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:n.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:n.DEFAULT_SETTINGS.wrapVertical,immediateRender:n.DEFAULT_SETTINGS.immediateRender,blendTime:n.DEFAULT_SETTINGS.blendTime,alwaysBlend:n.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:n.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:n.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:n.DEFAULT_SETTINGS.iOSDevice,debugMode:n.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:n.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:n.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:n.DEFAULT_SETTINGS.placeholderFillStyle,opacity:n.DEFAULT_SETTINGS.opacity,preload:n.DEFAULT_SETTINGS.preload,compositeOperation:n.DEFAULT_SETTINGS.compositeOperation,subPixelRoundingForTransparency:n.DEFAULT_SETTINGS.subPixelRoundingForTransparency},u),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new n.Spring({initial:h,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new n.Spring({initial:g,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new n.Spring({initial:y,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new n.Spring({initial:D,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),w&&this.fitBounds(w,C,!0),this._drawingHandler=function(P){d.viewer.raiseEvent("tile-drawing",n.extend({tiledImage:d},P))}},n.extend(n.TiledImage.prototype,n.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(u){u!==this._fullyLoaded&&(this._fullyLoaded=u,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=n.now(),this._needsDraw=!0},update:function(){var u=this._xSpring.update(),d=this._ySpring.update(),h=this._scaleSpring.update(),g=this._degreesSpring.update();return u||d||h||g?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(u){return this.getBoundsNoRotate(u).rotate(this.getRotation(u),this._getRotationPoint(u))},getBoundsNoRotate:function(u){return u?new n.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new n.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return n.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(u){var d=this.getBoundsNoRotate(u);if(this._clip){var h=u?this._worldWidthCurrent:this._worldWidthTarget,g=h/this.source.dimensions.x,y=this._clip.times(g);d=new n.Rect(d.x+y.x,d.y+y.y,y.width,y.height)}return d.rotate(this.getRotation(u),this._getRotationPoint(u))},getTileBounds:function(u,d,h){var g=this.source.getNumTiles(u),y=(g.x+d%g.x)%g.x,w=(g.y+h%g.y)%g.y,C=this.source.getTileBounds(u,y,w);return this.getFlip()&&(C.x=1-C.x-C.width),C.x+=(d-y)/g.x,C.y+=this._worldHeightCurrent/this._worldWidthCurrent*((h-w)/g.y),C},getContentSize:function(){return new n.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var u=this.imageToWindowCoordinates(new n.Point(0,0)),d=this.imageToWindowCoordinates(this.getContentSize());return new n.Point(d.x-u.x,d.y-u.y)},_viewportToImageDelta:function(u,d,h){var g=h?this._scaleSpring.current.value:this._scaleSpring.target.value;return new n.Point(u*(this.source.dimensions.x/g),d*(this.source.dimensions.y*this.contentAspectX/g))},viewportToImageCoordinates:function(u,d,h){var g;return u instanceof n.Point?(h=d,g=u):g=new n.Point(u,d),g=g.rotate(-this.getRotation(h),this._getRotationPoint(h)),h?this._viewportToImageDelta(g.x-this._xSpring.current.value,g.y-this._ySpring.current.value):this._viewportToImageDelta(g.x-this._xSpring.target.value,g.y-this._ySpring.target.value)},_imageToViewportDelta:function(u,d,h){var g=h?this._scaleSpring.current.value:this._scaleSpring.target.value;return new n.Point(u/this.source.dimensions.x*g,d/this.source.dimensions.y/this.contentAspectX*g)},imageToViewportCoordinates:function(u,d,h){u instanceof n.Point&&(h=d,d=u.y,u=u.x);var g=this._imageToViewportDelta(u,d);return h?(g.x+=this._xSpring.current.value,g.y+=this._ySpring.current.value):(g.x+=this._xSpring.target.value,g.y+=this._ySpring.target.value),g.rotate(this.getRotation(h),this._getRotationPoint(h))},imageToViewportRectangle:function(u,d,h,g,y){var w=u;w instanceof n.Rect?y=d:w=new n.Rect(u,d,h,g);var C=this.imageToViewportCoordinates(w.getTopLeft(),y),D=this._imageToViewportDelta(w.width,w.height,y);return new n.Rect(C.x,C.y,D.x,D.y,w.degrees+this.getRotation(y))},viewportToImageRectangle:function(u,d,h,g,y){var w=u;u instanceof n.Rect?y=d:w=new n.Rect(u,d,h,g);var C=this.viewportToImageCoordinates(w.getTopLeft(),y),D=this._viewportToImageDelta(w.width,w.height,y);return new n.Rect(C.x,C.y,D.x,D.y,w.degrees-this.getRotation(y))},viewerElementToImageCoordinates:function(u){var d=this.viewport.pointFromPixel(u,!0);return this.viewportToImageCoordinates(d)},imageToViewerElementCoordinates:function(u){var d=this.imageToViewportCoordinates(u);return this.viewport.pixelFromPoint(d,!0)},windowToImageCoordinates:function(u){var d=u.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(d)},imageToWindowCoordinates:function(u){var d=this.imageToViewerElementCoordinates(u);return d.plus(e.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(u){var d=this._scaleSpring.current.value;return u=u.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new n.Rect((u.x-this._xSpring.current.value)/d,(u.y-this._ySpring.current.value)/d,u.width/d,u.height/d,u.degrees)},viewportToImageZoom:function(u){var d=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return d*u},imageToViewportZoom:function(u){var d=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return u/d},setPosition:function(u,d){var h=this._xSpring.target.value===u.x&&this._ySpring.target.value===u.y;if(d){if(h&&this._xSpring.current.value===u.x&&this._ySpring.current.value===u.y)return;this._xSpring.resetTo(u.x),this._ySpring.resetTo(u.y),this._needsDraw=!0}else{if(h)return;this._xSpring.springTo(u.x),this._ySpring.springTo(u.y),this._needsDraw=!0}h||this._raiseBoundsChange()},setWidth:function(u,d){this._setScale(u,d)},setHeight:function(u,d){this._setScale(u/this.normHeight,d)},setCroppingPolygons:function(u){var d=function(g){return g instanceof n.Point||typeof g.x=="number"&&typeof g.y=="number"},h=function(g){return g.map(function(y){try{if(d(y))return{x:y.x,y:y.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!n.isArray(u))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=u.map(function(g){return h(g)})}catch(g){n.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),n.console.error(g),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(u,d,h){d=d||n.Placement.CENTER;var g=n.Placement.properties[d],y=this.contentAspectX,w=0,C=0,D=1,P=1;if(this._clip&&(y=this._clip.getAspectRatio(),D=this._clip.width/this.source.dimensions.x,P=this._clip.height/this.source.dimensions.y,u.getAspectRatio()>y?(w=this._clip.x/this._clip.height*u.height,C=this._clip.y/this._clip.height*u.height):(w=this._clip.x/this._clip.width*u.width,C=this._clip.y/this._clip.width*u.width)),u.getAspectRatio()>y){var M=u.height/P,F=0;g.isHorizontallyCentered?F=(u.width-u.height*y)/2:g.isRight&&(F=u.width-u.height*y),this.setPosition(new n.Point(u.x-w+F,u.y-C),h),this.setHeight(M,h)}else{var K=u.width/D,$=0;g.isVerticallyCentered?$=(u.height-u.width/y)/2:g.isBottom&&($=u.height-u.width/y),this.setPosition(new n.Point(u.x-w,u.y-C+$),h),this.setWidth(K,h)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(u){n.console.assert(!u||u instanceof n.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),u instanceof n.Rect?this._clip=u.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(u){this.flipped=!!u,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(u){u!==this.opacity&&(this.opacity=u,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(u){this._preload=!!u,this._needsDraw=!0},getRotation:function(u){return u?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(u,d){this._degreesSpring.target.value===u&&this._degreesSpring.isAtTargetValue()||(d?this._degreesSpring.resetTo(u):this._degreesSpring.springTo(u),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(u){return this.getBoundsNoRotate(u).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(u){u!==this.compositeOperation&&(this.compositeOperation=u,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(u,d){var h=this._scaleSpring.target.value===u;if(d){if(h&&this._scaleSpring.current.value===u)return;this._scaleSpring.resetTo(u),this._updateForScale(),this._needsDraw=!0}else{if(h)return;this._scaleSpring.springTo(u),this._updateForScale(),this._needsDraw=!0}h||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var u=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),d=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,h=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(d/this.minPixelRatio)/Math.log(2))));return h=Math.max(h,this.source.minLevel||0),u=Math.min(u,h),{lowestLevel:u,highestLevel:h}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var u=this.lastDrawn.pop();u.beingDrawn=!1}var d=this.viewport,h=this._viewportToTiledImageRectangle(d.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var g=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(h=h.intersection(g),h===null)return}for(var y=this._getLevelsInterval(),w=y.lowestLevel,C=y.highestLevel,D=null,P=!1,M=n.now(),F=C;F>=w;F--){var K=!1,$=d.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(F),!0).x*this._scaleSpring.current.value;if(F===w||!P&&$>=this.minPixelRatio)K=!0,P=!0;else if(!P)continue;var ee=d.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(F),!1).x*this._scaleSpring.current.value,he=d.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,ve=this.immediateRender?1:he,fe=Math.min(1,($-.5)/.5),ae=ve/Math.abs(ve-ee);if(D=this._updateLevel(P,K,F,fe,ae,h,M,D),this._providesCoverage(this.coverage,F))break}this._drawTiles(this.lastDrawn),D&&!D.context2D?(this._loadTile(D,M),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(u,d,h){var g,y;this.wrapHorizontal?(g=n.positiveModulo(d.x,1),y=n.positiveModulo(h.x,1)):(g=Math.max(0,d.x),y=Math.min(1,h.x));var w,C,D=1/this.source.aspectRatio;this.wrapVertical?(w=n.positiveModulo(d.y,D),C=n.positiveModulo(h.y,D)):(w=Math.max(0,d.y),C=Math.min(D,h.y));var P=this.source.getTileAtPoint(u,new n.Point(g,w)),M=this.source.getTileAtPoint(u,new n.Point(y,C)),F=this.source.getNumTiles(u);return this.wrapHorizontal&&(P.x+=F.x*Math.floor(d.x),M.x+=F.x*Math.floor(h.x)),this.wrapVertical&&(P.y+=F.y*Math.floor(d.y/D),M.y+=F.y*Math.floor(h.y/D)),{topLeft:P,bottomRight:M}},_updateLevel:function(u,d,h,g,y,w,C,D){var P=w.getBoundingBox().getTopLeft(),M=w.getBoundingBox().getBottomRight();this.viewer&&this.viewer.raiseEvent("update-level",{tiledImage:this,havedrawn:u,level:h,opacity:g,visibility:y,drawArea:w,topleft:P,bottomright:M,currenttime:C,best:D}),this._resetCoverage(this.coverage,h),this._resetCoverage(this.loadingCoverage,h);var F=this._getCornerTiles(h,P,M),K=F.topLeft,$=F.bottomRight,ee=this.source.getNumTiles(h),he=this.viewport.pixelFromPoint(this.viewport.getCenter());this.getFlip()&&($.x+=1,this.wrapHorizontal||($.x=Math.min($.x,ee.x-1)));for(var ve=K.x;ve<=$.x;ve++)for(var fe=K.y;fe<=$.y;fe++){var ae;if(this.getFlip()){var xe=(ee.x+ve%ee.x)%ee.x;ae=ve+ee.x-xe-xe-1}else ae=ve;w.intersection(this.getTileBounds(h,ae,fe))!==null&&(D=this._updateTile(d,u,ae,fe,h,g,y,he,ee,C,D))}return D},_updateTile:function(u,d,h,g,y,w,C,D,P,M,F){var K=this._getTile(h,g,y,M,P,this._worldWidthCurrent,this._worldHeightCurrent),$=d;this.viewer&&this.viewer.raiseEvent("update-tile",{tiledImage:this,tile:K}),this._setCoverage(this.coverage,y,h,g,!1);var ee=K.loaded||K.loading||this._isCovered(this.loadingCoverage,y,h,g);if(this._setCoverage(this.loadingCoverage,y,h,g,ee),!K.exists||(u&&!$&&(this._isCovered(this.coverage,y,h,g)?this._setCoverage(this.coverage,y,h,g,!0):$=!0),!$))return F;if(this._positionTile(K,this.source.tileOverlap,this.viewport,D,C),!K.loaded)if(K.context2D)this._setTileLoaded(K);else{var he=this._tileCache.getImageRecord(K.cacheKey);if(he){var ve=he.getImage();this._setTileLoaded(K,ve)}}if(K.loaded){var fe=this._blendTile(K,h,g,y,w,M);fe&&(this._needsDraw=!0)}else K.loading?this._tilesLoading++:ee||(F=this._compareTiles(F,K));return F},_getTile:function(u,d,h,g,y,w,C){var D,P,M,F,K,$,ee,he,ve,fe,ae=this.tilesMatrix,xe=this.source;return ae[h]||(ae[h]={}),ae[h][u]||(ae[h][u]={}),(!ae[h][u][d]||!ae[h][u][d].flipped!=!this.flipped)&&(D=(y.x+u%y.x)%y.x,P=(y.y+d%y.y)%y.y,M=this.getTileBounds(h,u,d),F=xe.getTileBounds(h,D,P,!0),K=xe.tileExists(h,D,P),$=xe.getTileUrl(h,D,P),ee=xe.getTilePostData(h,D,P),this.loadTilesWithAjax?(he=xe.getTileAjaxHeaders(h,D,P),n.isPlainObject(this.ajaxHeaders)&&(he=n.extend({},this.ajaxHeaders,he))):he=null,ve=xe.getContext2D?xe.getContext2D(h,D,P):void 0,fe=new n.Tile(h,u,d,M,K,$,ve,this.loadTilesWithAjax,he,F,ee,xe.getTileHashKey(h,D,P,$,he,ee)),this.getFlip()?D===0&&(fe.isRightMost=!0):D===y.x-1&&(fe.isRightMost=!0),P===y.y-1&&(fe.isBottomMost=!0),fe.flipped=this.flipped,ae[h][u][d]=fe),fe=ae[h][u][d],fe.lastTouchTime=g,fe},_loadTile:function(u,d){var h=this;u.loading=!0,this._imageLoader.addJob({src:u.url,postData:u.postData,loadWithAjax:u.loadWithAjax,ajaxHeaders:u.ajaxHeaders,crossOriginPolicy:this.crossOriginPolicy,ajaxWithCredentials:this.ajaxWithCredentials,callback:function(g,y,w){h._onTileLoad(u,d,g,y,w)},abort:function(){u.loading=!1}})},_onTileLoad:function(u,d,h,g,y){if(!h){n.console.error("Tile %s failed to load: %s - error: %s",u,u.url,g),this.viewer.raiseEvent("tile-load-failed",{tile:u,tiledImage:this,time:d,message:g,tileRequest:y}),u.loading=!1,u.exists=!1;return}if(du.visibility||d.visibility===u.visibility&&d.squaredDistance1&&C>this.smoothTileEdgesMinZoom&&!this.iOSDevice&&this.getRotation(!0)%360===0&&n.supportsCanvas&&this.viewer.useCanvas&&(h=!0,g=d.getScaleForEdgeSmoothing(),y=d.getTranslationForEdgeSmoothing(g,this._drawer.getCanvasSize(!1),this._drawer.getCanvasSize(!0)));var D;h&&(g||(D=this.viewport.viewportToViewerElementRectangle(this.getClippedBounds(!0)).getIntegerBoundingBox(),this._drawer.viewer.viewport.getFlip()&&(this.viewport.degrees!==0||this.getRotation(!0)%360!==0)&&(D.x=this._drawer.viewer.container.clientWidth-(D.x+D.width)),D=D.times(n.pixelDensityRatio)),this._drawer._clear(!0,D)),g||(this.viewport.degrees!==0&&this._drawer._offsetForRotation({degrees:this.viewport.degrees,useSketch:h}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:h}),this.viewport.degrees===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip());var P=!1;if(this._clip){this._drawer.saveContext(h);var M=this.imageToViewportRectangle(this._clip,!0);M=M.rotate(-this.getRotation(!0),this._getRotationPoint(!0));var F=this._drawer.viewportToDrawerRectangle(M);g&&(F=F.times(g)),y&&(F=F.translate(y)),this._drawer.setClip(F,h),P=!0}if(this._croppingPolygons){this._drawer.saveContext(h);try{var K=this._croppingPolygons.map(function(xe){return xe.map(function(Qe){var ot=this.imageToViewportCoordinates(Qe.x,Qe.y,!0).rotate(-this.getRotation(!0),this._getRotationPoint(!0)),et=this._drawer.viewportCoordToDrawerCoord(ot);return g&&(et=et.times(g)),et})});this._drawer.clipWithPolygons(K,h)}catch(xe){n.console.error(xe)}P=!0}if(this.placeholderFillStyle&&this._hasOpaqueTile===!1){var $=this._drawer.viewportToDrawerRectangle(this.getBounds(!0));g&&($=$.times(g)),y&&($=$.translate(y));var ee=null;typeof this.placeholderFillStyle=="function"?ee=this.placeholderFillStyle(this,this._drawer.context):ee=this.placeholderFillStyle,this._drawer.drawRectangle($,ee,h)}var he=o(this.subPixelRoundingForTransparency),ve=!1;if(he===n.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)ve=!0;else if(he===n.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST){var fe=this.viewer&&this.viewer.isAnimating();ve=!fe}for(var ae=u.length-1;ae>=0;ae--)d=u[ae],this._drawer.drawTile(d,this._drawingHandler,h,g,y,ve),d.beingDrawn=!0,this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:this,tile:d});P&&this._drawer.restoreContext(h),g||(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(h),this.viewport.degrees!==0&&this._drawer._restoreRotationChanges(h)),h&&(g&&(this.viewport.degrees!==0&&this._drawer._offsetForRotation({degrees:this.viewport.degrees,useSketch:!1}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:!1})),this._drawer.blendSketch({opacity:this.opacity,scale:g,translate:y,compositeOperation:this.compositeOperation,bounds:D}),g&&(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(!1),this.viewport.degrees!==0&&this._drawer._restoreRotationChanges(!1))),g||this.viewport.degrees===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip(),this._drawDebugInfo(u)}},_drawDebugInfo:function(u){if(this.debugMode)for(var d=u.length-1;d>=0;d--){var h=u[d];try{this._drawer.drawDebugInfo(h,u.length,d,this)}catch(g){n.console.error(g)}}},_providesCoverage:function(u,d,h,g){var y,w,C,D;if(!u[d])return!1;if(h===void 0||g===void 0){y=u[d];for(C in y)if(Object.prototype.hasOwnProperty.call(y,C)){w=y[C];for(D in w)if(Object.prototype.hasOwnProperty.call(w,D)&&!w[D])return!1}return!0}return u[d][h]===void 0||u[d][h][g]===void 0||u[d][h][g]===!0},_isCovered:function(u,d,h,g){return h===void 0||g===void 0?this._providesCoverage(u,d+1):this._providesCoverage(u,d+1,2*h,2*g)&&this._providesCoverage(u,d+1,2*h,2*g+1)&&this._providesCoverage(u,d+1,2*h+1,2*g)&&this._providesCoverage(u,d+1,2*h+1,2*g+1)},_setCoverage:function(u,d,h,g,y){if(!u[d]){n.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",d);return}u[d][h]||(u[d][h]={}),u[d][h][g]=y},_resetCoverage:function(u,d){u[d]={}}});var i=n.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER;function r(u){return u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS&&u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER}function s(u){return r(u)?i:u}function o(u){if(typeof u=="number")return s(u);if(!u||!n.Browser)return i;var d=u[n.Browser.vendor];return r(d)&&(d=u["*"]),s(d)}}(e),function(n){var i=function(s){n.console.assert(s,"[TileCache.cacheTile] options is required"),n.console.assert(s.tile,"[TileCache.cacheTile] options.tile is required"),n.console.assert(s.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=s.tile,this.tiledImage=s.tiledImage},r=function(s){n.console.assert(s,"[ImageRecord] options is required"),n.console.assert(s.image,"[ImageRecord] options.image is required"),this._image=s.image,this._tiles=[]};r.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var s=document.createElement("canvas");s.width=this._image.width,s.height=this._image.height,this._renderedContext=s.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(s){n.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=s},addTile:function(s){n.console.assert(s,"[ImageRecord.addTile] tile is required"),this._tiles.push(s)},removeTile:function(s){for(var o=0;othis._maxImageCacheCount){for(var h=null,g=-1,y=null,w,C,D,P,M,F,K=this._tilesLoaded.length-1;K>=0;K--)if(F=this._tilesLoaded[K],w=F.tile,!(w.level<=o||w.beingDrawn)){if(!h){h=w,g=K,y=F;continue}P=w.lastTouchTime,C=h.lastTouchTime,M=w.level,D=h.level,(PD)&&(h=w,g=K,y=F)}h&&g>=0&&(this._unloadTile(y),u=g)}this._tilesLoaded[u]=new i({tile:s.tile,tiledImage:s.tiledImage})},clearTilesFor:function(s){n.console.assert(s,"[TileCache.clearTilesFor] tiledImage is required");for(var o,u=0;u=this._items.length)throw new Error("Index bigger than number of layers.");r===s||s===-1||(this._items.splice(s,1),this._items.splice(r,0,i),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:i,previousIndex:s,newIndex:r}))},removeItem:function(i){n.console.assert(i,"[World.removeItem] item is required");var r=n.indexOf(this._items,i);r!==-1&&(i.removeHandler("bounds-change",this._delegatedFigureSizes),i.removeHandler("clip-change",this._delegatedFigureSizes),i.destroy(),this._items.splice(r,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(i))},removeAll:function(){this.viewer._cancelPendingImages();var i,r;for(r=0;rP.height?M=d:M=d*(P.width/P.height),F=M*(P.height/P.width),K=new n.Point(w+(d-M)/2,C+(d-F)/2),D.setPosition(K,r),D.setWidth(M,r),s==="horizontal"?w+=g:C+=g;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var i=this._homeBounds?this._homeBounds.clone():null,r=this._contentSize?this._contentSize.clone():null,s=this._contentFactor||0;if(!this._items.length)this._homeBounds=new n.Rect(0,0,1,1),this._contentSize=new n.Point(1,1),this._contentFactor=1;else{var o=this._items[0],u=o.getBounds();this._contentFactor=o.getContentSize().x/u.width;for(var d=o.getClippedBounds().getBoundingBox(),h=d.x,g=d.y,y=d.x+d.width,w=d.y+d.height,C=1;Cp in l?n(l,p,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[p]=a,r=(l,p,a)=>(i(l,typeof p!="symbol"?p+"":p,a),a),s,o,u,d,h,g,y,w={},C=[],D=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function P(l,p){for(var a in p)l[a]=p[a];return l}function M(l){var p=l.parentNode;p&&p.removeChild(l)}function F(l,p,a){var c,f,m,v={};for(m in p)m=="key"?c=p[m]:m=="ref"?f=p[m]:v[m]=p[m];if(arguments.length>2&&(v.children=arguments.length>3?s.call(arguments,2):a),typeof l=="function"&&l.defaultProps!=null)for(m in l.defaultProps)v[m]===void 0&&(v[m]=l.defaultProps[m]);return K(l,v,c,f,null)}function K(l,p,a,c,f){var m={type:l,props:p,key:a,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:f??++u};return f==null&&o.vnode!=null&&o.vnode(m),m}function $(){return{current:null}}function ee(l){return l.children}function he(l,p){this.props=l,this.context=p}function ve(l,p){if(p==null)return l.__?ve(l.__,l.__.__k.indexOf(l)+1):null;for(var a;p0?K(ie.type,ie.props,ie.key,null,ie.__v):ie)!=null){if(ie.__=a,ie.__b=a.__b+1,(V=Ve[x])===null||V&&ie.key==V.key&&ie.type===V.type)Ve[x]=void 0;else for(U=0;U2&&(v.children=arguments.length>3?s.call(arguments,2):a),K(l.type,v,c||l.key,f||l.ref,null)}function ji(l,p){var a={__c:p="__cC"+y++,__:l,Consumer:function(c,f){return c.children(f)},Provider:function(c){var f,m;return this.getChildContext||(f=[],(m={})[p]=this,this.getChildContext=function(){return m},this.shouldComponentUpdate=function(v){this.props.value!==v.value&&f.some(ae)},this.sub=function(v){f.push(v);var _=v.componentWillUnmount;v.componentWillUnmount=function(){f.splice(f.indexOf(v),1),_&&_.call(v)}}),c.children}};return a.Provider.__=a.Consumer.contextType=a}s=C.slice,o={__e:function(l,p){for(var a,c,f;p=p.__;)if((a=p.__c)&&!a.__)try{if((c=a.constructor)&&c.getDerivedStateFromError!=null&&(a.setState(c.getDerivedStateFromError(l)),f=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(l),f=a.__d),f)return a.__E=a}catch(m){l=m}throw l}},u=0,he.prototype.setState=function(l,p){var a;a=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=P({},this.state),typeof l=="function"&&(l=l(P({},a),this.props)),l&&P(a,l),l!=null&&this.__v&&(p&&this.__h.push(p),ae(this))},he.prototype.forceUpdate=function(l){this.__v&&(this.__e=!0,l&&this.__h.push(l),ae(this))},he.prototype.render=ee,d=[],h=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe.__r=0,y=0;var Vi,Hn,Ur,Fe=0,Ke=[],N=o.__b,ce=o.__r,Re=o.diffed,Ye=o.__c,re=o.unmount;function ge(l,p){o.__h&&o.__h(Hn,l,Fe||p),Fe=0;var a=Hn.__H||(Hn.__H={__:[],__h:[]});return l>=a.__.length&&a.__.push({}),a.__[l]}function Ce(l){return Fe=1,Ge(gn,l)}function Ge(l,p,a){var c=ge(Vi++,2);return c.t=l,c.__c||(c.__=[a?a(p):gn(void 0,p),function(f){var m=c.t(c.__[0],f);c.__[0]!==m&&(c.__=[m,c.__[1]],c.__c.setState({}))}],c.__c=Hn),c.__}function Ue(l,p){var a=ge(Vi++,3);!o.__s&&Zt(a.__H,p)&&(a.__=l,a.__H=p,Hn.__H.__h.push(a))}function We(l,p){var a=ge(Vi++,4);!o.__s&&Zt(a.__H,p)&&(a.__=l,a.__H=p,Hn.__h.push(a))}function rt(l){return Fe=5,Dt(function(){return{current:l}},[])}function kt(l,p,a){Fe=6,We(function(){typeof l=="function"?l(p()):l&&(l.current=p())},a==null?a:a.concat(l))}function Dt(l,p){var a=ge(Vi++,7);return Zt(a.__H,p)&&(a.__=l(),a.__H=p,a.__h=l),a.__}function tn(l,p){return Fe=8,Dt(function(){return l},p)}function dn(l){var p=Hn.context[l.__c],a=ge(Vi++,9);return a.c=l,p?(a.__==null&&(a.__=!0,p.sub(Hn)),p.props.value):l.__}function te(l,p){o.useDebugValue&&o.useDebugValue(p?p(l):l)}function Z(l){var p=ge(Vi++,10),a=Ce();return p.__=l,Hn.componentDidCatch||(Hn.componentDidCatch=function(c){p.__&&p.__(c),a[1](c)}),[a[0],function(){a[1](void 0)}]}function be(){var l;for(Ke.sort(function(p,a){return p.__v.__b-a.__v.__b});l=Ke.pop();)if(l.__P)try{l.__H.__h.forEach(at),l.__H.__h.forEach(Et),l.__H.__h=[]}catch(p){l.__H.__h=[],o.__e(p,l.__v)}}o.__b=function(l){Hn=null,N&&N(l)},o.__r=function(l){ce&&ce(l),Vi=0;var p=(Hn=l.__c).__H;p&&(p.__h.forEach(at),p.__h.forEach(Et),p.__h=[])},o.diffed=function(l){Re&&Re(l);var p=l.__c;p&&p.__H&&p.__H.__h.length&&(Ke.push(p)!==1&&Ur===o.requestAnimationFrame||((Ur=o.requestAnimationFrame)||function(a){var c,f=function(){clearTimeout(m),we&&cancelAnimationFrame(c),setTimeout(a)},m=setTimeout(f,100);we&&(c=requestAnimationFrame(f))})(be)),Hn=null},o.__c=function(l,p){p.some(function(a){try{a.__h.forEach(at),a.__h=a.__h.filter(function(c){return!c.__||Et(c)})}catch(c){p.some(function(f){f.__h&&(f.__h=[])}),p=[],o.__e(c,a.__v)}}),Ye&&Ye(l,p)},o.unmount=function(l){re&&re(l);var p,a=l.__c;a&&a.__H&&(a.__H.__.forEach(function(c){try{at(c)}catch(f){p=f}}),p&&o.__e(p,a.__v))};var we=typeof requestAnimationFrame=="function";function at(l){var p=Hn,a=l.__c;typeof a=="function"&&(l.__c=void 0,a()),Hn=p}function Et(l){var p=Hn;l.__c=l.__(),Hn=p}function Zt(l,p){return!l||l.length!==p.length||p.some(function(a,c){return a!==l[c]})}function gn(l,p){return typeof p=="function"?p(l):p}function nn(l,p){for(var a in p)l[a]=p[a];return l}function ur(l,p){for(var a in l)if(a!=="__source"&&!(a in p))return!0;for(var c in p)if(c!=="__source"&&l[c]!==p[c])return!0;return!1}function ci(l){this.props=l}function os(l,p){function a(f){var m=this.props.ref,v=m==f.ref;return!v&&m&&(m.call?m(null):m.current=null),p?!p(this.props,f)||!v:ur(this.props,f)}function c(f){return this.shouldComponentUpdate=a,F(l,f)}return c.displayName="Memo("+(l.displayName||l.name)+")",c.prototype.isReactComponent=!0,c.__f=!0,c}(ci.prototype=new he).isPureReactComponent=!0,ci.prototype.shouldComponentUpdate=function(l,p){return ur(this.props,l)||ur(this.state,p)};var Hr=o.__b;o.__b=function(l){l.type&&l.type.__f&&l.ref&&(l.props.ref=l.ref,l.ref=null),Hr&&Hr(l)};var kr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ar(l){function p(a,c){var f=nn({},a);return delete f.ref,l(f,(c=a.ref||c)&&(typeof c!="object"||"current"in c)?c:null)}return p.$$typeof=kr,p.render=p,p.prototype.isReactComponent=p.__f=!0,p.displayName="ForwardRef("+(l.displayName||l.name)+")",p}var wo=function(l,p){return l==null?null:et(et(l).map(p))},qt={map:wo,forEach:wo,count:function(l){return l?et(l).length:0},only:function(l){var p=et(l);if(p.length!==1)throw"Children.only";return p[0]},toArray:et},Qs=o.__e;o.__e=function(l,p,a){if(l.then){for(var c,f=p;f=f.__;)if((c=f.__c)&&c.__c)return p.__e==null&&(p.__e=a.__e,p.__k=a.__k),c.__c(l,p)}Qs(l,p,a)};var ca=o.unmount;function Zr(){this.__u=0,this.t=null,this.__b=null}function Pr(l){var p=l.__.__c;return p&&p.__e&&p.__e(l)}function zn(l){var p,a,c;function f(m){if(p||(p=l()).then(function(v){a=v.default||v},function(v){c=v}),c)throw c;if(!a)throw p;return F(a,m)}return f.displayName="Lazy",f.__f=!0,f}function Js(){this.u=null,this.o=null}o.unmount=function(l){var p=l.__c;p&&p.__R&&p.__R(),p&&l.__h===!0&&(l.type=null),ca&&ca(l)},(Zr.prototype=new he).__c=function(l,p){var a=p.__c,c=this;c.t==null&&(c.t=[]),c.t.push(a);var f=Pr(c.__v),m=!1,v=function(){m||(m=!0,a.__R=null,f?f(_):_())};a.__R=v;var _=function(){if(!--c.__u){if(c.state.__e){var E=c.state.__e;c.__v.__k[0]=function U(V,ie,de){return V&&(V.__v=null,V.__k=V.__k&&V.__k.map(function(Ie){return U(Ie,ie,de)}),V.__c&&V.__c.__P===ie&&(V.__e&&de.insertBefore(V.__e,V.__d),V.__c.__e=!0,V.__c.__P=de)),V}(E,E.__c.__P,E.__c.__O)}var x;for(c.setState({__e:c.__b=null});x=c.t.pop();)x.forceUpdate()}},S=p.__h===!0;c.__u++||S||c.setState({__e:c.__b=c.__v.__k[0]}),l.then(v,v)},Zr.prototype.componentWillUnmount=function(){this.t=[]},Zr.prototype.render=function(l,p){if(this.__b){if(this.__v.__k){var a=document.createElement("div"),c=this.__v.__k[0].__c;this.__v.__k[0]=function m(v,_,S){return v&&(v.__c&&v.__c.__H&&(v.__c.__H.__.forEach(function(E){typeof E.__c=="function"&&E.__c()}),v.__c.__H=null),(v=nn({},v)).__c!=null&&(v.__c.__P===S&&(v.__c.__P=_),v.__c=null),v.__k=v.__k&&v.__k.map(function(E){return m(E,_,S)})),v}(this.__b,a,c.__O=c.__P)}this.__b=null}var f=p.__e&&F(ee,null,l.fallback);return f&&(f.__h=null),[F(ee,null,p.__e?null:l.children),f]};var ri=function(l,p,a){if(++a[1]===a[0]&&l.o.delete(p),l.props.revealOrder&&(l.props.revealOrder[0]!=="t"||!l.o.size))for(a=l.u;a;){for(;a.length>3;)a.pop()();if(a[1]>>1,1),p.i.removeChild(c)}}),Ft(F(as,{context:p.context},l.__v),p.l)):p.l&&p.componentWillUnmount()}function Yi(l,p){return F(Bs,{__v:l,i:p})}(Js.prototype=new he).__e=function(l){var p=this,a=Pr(p.__v),c=p.o.get(l);return c[0]++,function(f){var m=function(){p.props.revealOrder?(c.push(f),ri(p,l,c)):f()};a?a(m):m()}},Js.prototype.render=function(l){this.u=null,this.o=new Map;var p=et(l.children);l.revealOrder&&l.revealOrder[0]==="b"&&p.reverse();for(var a=p.length;a--;)this.o.set(p[a],this.u=[1,0,this.u]);return l.children},Js.prototype.componentDidUpdate=Js.prototype.componentDidMount=function(){var l=this;this.o.forEach(function(p,a){ri(l,a,p)})};var pr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ds=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,fr=typeof document<"u",Ln=function(l){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(l)};function mr(l,p,a){return p.__k==null&&(p.textContent=""),Ft(l,p),typeof a=="function"&&a(),l?l.__c:null}function qn(l,p,a){return ui(l,p),typeof a=="function"&&a(),l?l.__c:null}he.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(l){Object.defineProperty(he.prototype,l,{configurable:!0,get:function(){return this["UNSAFE_"+l]},set:function(p){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:p})}})});var Us=o.event;function Da(){}function da(){return this.cancelBubble}function He(){return this.defaultPrevented}o.event=function(l){return Us&&(l=Us(l)),l.persist=Da,l.isPropagationStopped=da,l.isDefaultPrevented=He,l.nativeEvent=l};var Gt,Pt={configurable:!0,get:function(){return this.class}},Pn=o.vnode;o.vnode=function(l){var p=l.type,a=l.props,c=a;if(typeof p=="string"){var f=p.indexOf("-")===-1;for(var m in c={},a){var v=a[m];fr&&m==="children"&&p==="noscript"||m==="value"&&"defaultValue"in a&&v==null||(m==="defaultValue"&&"value"in a&&a.value==null?m="value":m==="download"&&v===!0?v="":/ondoubleclick/i.test(m)?m="ondblclick":/^onchange(textarea|input)/i.test(m+p)&&!Ln(a.type)?m="oninput":/^onfocus$/i.test(m)?m="onfocusin":/^onblur$/i.test(m)?m="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(m)?m=m.toLowerCase():f&&ds.test(m)?m=m.replace(/[A-Z0-9]/,"-$&").toLowerCase():v===null&&(v=void 0),c[m]=v)}p=="select"&&c.multiple&&Array.isArray(c.value)&&(c.value=et(a.children).forEach(function(_){_.props.selected=c.value.indexOf(_.props.value)!=-1})),p=="select"&&c.defaultValue!=null&&(c.value=et(a.children).forEach(function(_){_.props.selected=c.multiple?c.defaultValue.indexOf(_.props.value)!=-1:c.defaultValue==_.props.value})),l.props=c,a.class!=a.className&&(Pt.enumerable="className"in a,a.className!=null&&(c.class=a.className),Object.defineProperty(c,"className",Pt))}l.$$typeof=pr,Pn&&Pn(l)};var Ii=o.__r;o.__r=function(l){Ii&&Ii(l),Gt=l.__c};var Ai={ReactCurrentDispatcher:{current:{readContext:function(l){return Gt.__n[l.__c].props.value}}}},$s="17.0.2";function Qr(l){return F.bind(null,l)}function gr(l){return!!l&&l.$$typeof===pr}function vi(l){return gr(l)?or.apply(null,arguments):l}function Oi(l){return!!l.__k&&(Ft(null,l),!0)}function ha(l){return l&&(l.base||l.nodeType===1&&l)||null}var pa=function(l,p){return l(p)},Sc=function(l,p){return l(p)},rl=ee,yt={useState:Ce,useReducer:Ge,useEffect:Ue,useLayoutEffect:We,useRef:rt,useImperativeHandle:kt,useMemo:Dt,useCallback:tn,useContext:dn,useDebugValue:te,version:"17.0.2",Children:qt,render:mr,hydrate:qn,unmountComponentAtNode:Oi,createPortal:Yi,createElement:F,createContext:ji,createFactory:Qr,cloneElement:vi,createRef:$,Fragment:ee,isValidElement:gr,findDOMNode:ha,Component:he,PureComponent:ci,memo:os,forwardRef:ar,flushSync:Sc,unstable_batchedUpdates:pa,StrictMode:ee,Suspense:Zr,SuspenseList:Js,lazy:zn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ai},Du=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:yt,version:$s,Children:qt,render:mr,hydrate:qn,unmountComponentAtNode:Oi,createPortal:Yi,createFactory:Qr,cloneElement:vi,isValidElement:gr,findDOMNode:ha,PureComponent:ci,memo:os,forwardRef:ar,flushSync:Sc,unstable_batchedUpdates:pa,StrictMode:rl,Suspense:Zr,SuspenseList:Js,lazy:zn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ai,createElement:F,createContext:ji,createRef:$,Fragment:ee,Component:he,useState:Ce,useReducer:Ge,useEffect:Ue,useLayoutEffect:We,useRef:rt,useImperativeHandle:kt,useMemo:Dt,useCallback:tn,useContext:dn,useDebugValue:te,useErrorBoundary:Z}),hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Gh<"u"?Gh:typeof self<"u"?self:{};function sl(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function Ia(l){if(l.__esModule)return l;var p=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(l).forEach(function(a){var c=Object.getOwnPropertyDescriptor(l,a);Object.defineProperty(p,a,c.get?c:{enumerable:!0,get:function(){return l[a]}})}),p}var eo={exports:{}};function Iu(){}Iu.prototype={on:function(l,p,a){var c=this.e||(this.e={});return(c[l]||(c[l]=[])).push({fn:p,ctx:a}),this},once:function(l,p,a){var c=this;function f(){c.off(l,f),p.apply(a,arguments)}return f._=p,this.on(l,f,a)},emit:function(l){var p=[].slice.call(arguments,1),a=((this.e||(this.e={}))[l]||[]).slice(),c=0,f=a.length;for(c;c0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(l=window.document)===null||l===void 0||(l=l.documentElement)===null||l===void 0?void 0:l.style;if(!a||p in a)return"";for(let c=0;cp===a.identifier)||l.changedTouches&&(0,zr.findInArray)(l.changedTouches,a=>p===a.identifier)}function Li(l){if(l.targetTouches&&l.targetTouches[0])return l.targetTouches[0].identifier;if(l.changedTouches&&l.changedTouches[0])return l.changedTouches[0].identifier}function jr(l){if(!l)return;let p=l.getElementById("react-draggable-style-el");p||(p=l.createElement("style"),p.type="text/css",p.id="react-draggable-style-el",p.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,p.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,l.getElementsByTagName("head")[0].appendChild(p)),l.body&&Ed(l.body,"react-draggable-transparent-selection")}function Vl(l){if(l)try{if(l.body&&Dc(l.body,"react-draggable-transparent-selection"),l.selection)l.selection.empty();else{const p=(l.defaultView||window).getSelection();p&&p.type!=="Caret"&&p.removeAllRanges()}}catch{}}function Ed(l,p){l.classList?l.classList.add(p):l.className.match(new RegExp("(?:^|\\s)".concat(p,"(?!\\S)")))||(l.className+=" ".concat(p))}function Dc(l,p){l.classList?l.classList.remove(p):l.className=l.className.replace(new RegExp("(?:^|\\s)".concat(p,"(?!\\S)"),"g"),"")}var xs={};Object.defineProperty(xs,"__esModule",{value:!0}),xs.canDragX=no,xs.canDragY=wi,xs.createCoreData=ma,xs.createDraggableData=Vr,xs.getBoundPosition=Jr,xs.getControlPosition=Lu,xs.snapToGrid=Cs;var Ir=fs,ls=Ri;function Jr(l,p,a){if(!l.props.bounds)return[p,a];let{bounds:c}=l.props;c=typeof c=="string"?c:Wr(c);const f=Mu(l);if(typeof c=="string"){const{ownerDocument:m}=f,v=m.defaultView;let _;if(c==="parent"?_=f.parentNode:_=m.querySelector(c),!(_ instanceof v.HTMLElement))throw new Error('Bounds selector "'+c+'" could not find an element.');const S=_,E=v.getComputedStyle(f),x=v.getComputedStyle(S);c={left:-f.offsetLeft+(0,Ir.int)(x.paddingLeft)+(0,Ir.int)(E.marginLeft),top:-f.offsetTop+(0,Ir.int)(x.paddingTop)+(0,Ir.int)(E.marginTop),right:(0,ls.innerWidth)(S)-(0,ls.outerWidth)(f)-f.offsetLeft+(0,Ir.int)(x.paddingRight)-(0,Ir.int)(E.marginRight),bottom:(0,ls.innerHeight)(S)-(0,ls.outerHeight)(f)-f.offsetTop+(0,Ir.int)(x.paddingBottom)-(0,Ir.int)(E.marginBottom)}}return(0,Ir.isNum)(c.right)&&(p=Math.min(p,c.right)),(0,Ir.isNum)(c.bottom)&&(a=Math.min(a,c.bottom)),(0,Ir.isNum)(c.left)&&(p=Math.max(p,c.left)),(0,Ir.isNum)(c.top)&&(a=Math.max(a,c.top)),[p,a]}function Cs(l,p,a){const c=Math.round(p/l[0])*l[0],f=Math.round(a/l[1])*l[1];return[c,f]}function no(l){return l.props.axis==="both"||l.props.axis==="x"}function wi(l){return l.props.axis==="both"||l.props.axis==="y"}function Lu(l,p,a){const c=typeof p=="number"?(0,ls.getTouch)(l,p):null;if(typeof p=="number"&&!c)return null;const f=Mu(a),m=a.props.offsetParent||f.offsetParent||f.ownerDocument.body;return(0,ls.offsetXYFromParent)(c||l,m,a.props.scale)}function ma(l,p,a){const c=!(0,Ir.isNum)(l.lastX),f=Mu(l);return c?{node:f,deltaX:0,deltaY:0,lastX:p,lastY:a,x:p,y:a}:{node:f,deltaX:p-l.lastX,deltaY:a-l.lastY,lastX:l.lastX,lastY:l.lastY,x:p,y:a}}function Vr(l,p){const a=l.props.scale;return{node:p.node,x:l.state.x+p.deltaX/a,y:l.state.y+p.deltaY/a,deltaX:p.deltaX/a,deltaY:p.deltaY/a,lastX:l.state.x,lastY:l.state.y}}function Wr(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}}function Mu(l){const p=l.findDOMNode();if(!p)throw new Error(": Unmounted during event!");return p}var To={},ga={};Object.defineProperty(ga,"__esModule",{value:!0}),ga.default=Hs;function Hs(){}Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var Fa=xd(ps),Or=fl(_o.exports),ya=fl(ps),Rr=Ri,Xo=xs,pl=fs,$r=fl(ga);function fl(l){return l&&l.__esModule?l:{default:l}}function zs(l){if(typeof WeakMap!="function")return null;var p=new WeakMap,a=new WeakMap;return(zs=function(c){return c?a:p})(l)}function xd(l,p){if(l&&l.__esModule)return l;if(l===null||typeof l!="object"&&typeof l!="function")return{default:l};var a=zs(p);if(a&&a.has(l))return a.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in l)if(m!=="default"&&Object.prototype.hasOwnProperty.call(l,m)){var v=f?Object.getOwnPropertyDescriptor(l,m):null;v&&(v.get||v.set)?Object.defineProperty(c,m,v):c[m]=l[m]}return c.default=l,a&&a.set(l,c),c}function Xi(l,p,a){return p=Cd(p),p in l?Object.defineProperty(l,p,{value:a,enumerable:!0,configurable:!0,writable:!0}):l[p]=a,l}function Cd(l){var p=Nu(l,"string");return typeof p=="symbol"?p:String(p)}function Nu(l,p){if(typeof l!="object"||l===null)return l;var a=l[Symbol.toPrimitive];if(a!==void 0){var c=a.call(l,p);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(l)}const As={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Eo=As.mouse;class ml extends Fa.Component{constructor(){super(...arguments),Xi(this,"dragging",!1),Xi(this,"lastX",NaN),Xi(this,"lastY",NaN),Xi(this,"touchIdentifier",null),Xi(this,"mounted",!1),Xi(this,"handleDragStart",p=>{if(this.props.onMouseDown(p),!this.props.allowAnyClick&&typeof p.button=="number"&&p.button!==0)return!1;const a=this.findDOMNode();if(!a||!a.ownerDocument||!a.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:c}=a;if(this.props.disabled||!(p.target instanceof c.defaultView.Node)||this.props.handle&&!(0,Rr.matchesSelectorAndParentsTo)(p.target,this.props.handle,a)||this.props.cancel&&(0,Rr.matchesSelectorAndParentsTo)(p.target,this.props.cancel,a))return;p.type==="touchstart"&&p.preventDefault();const f=(0,Rr.getTouchIdentifier)(p);this.touchIdentifier=f;const m=(0,Xo.getControlPosition)(p,f,this);if(m==null)return;const{x:v,y:_}=m,S=(0,Xo.createCoreData)(this,v,_);(0,$r.default)("DraggableCore: handleDragStart: %j",S),(0,$r.default)("calling",this.props.onStart),!(this.props.onStart(p,S)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Rr.addUserSelectStyles)(c),this.dragging=!0,this.lastX=v,this.lastY=_,(0,Rr.addEvent)(c,Eo.move,this.handleDrag),(0,Rr.addEvent)(c,Eo.stop,this.handleDragStop))}),Xi(this,"handleDrag",p=>{const a=(0,Xo.getControlPosition)(p,this.touchIdentifier,this);if(a==null)return;let{x:c,y:f}=a;if(Array.isArray(this.props.grid)){let v=c-this.lastX,_=f-this.lastY;if([v,_]=(0,Xo.snapToGrid)(this.props.grid,v,_),!v&&!_)return;c=this.lastX+v,f=this.lastY+_}const m=(0,Xo.createCoreData)(this,c,f);if((0,$r.default)("DraggableCore: handleDrag: %j",m),this.props.onDrag(p,m)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=c,this.lastY=f}),Xi(this,"handleDragStop",p=>{if(!this.dragging)return;const a=(0,Xo.getControlPosition)(p,this.touchIdentifier,this);if(a==null)return;let{x:c,y:f}=a;if(Array.isArray(this.props.grid)){let _=c-this.lastX||0,S=f-this.lastY||0;[_,S]=(0,Xo.snapToGrid)(this.props.grid,_,S),c=this.lastX+_,f=this.lastY+S}const m=(0,Xo.createCoreData)(this,c,f);if(this.props.onStop(p,m)===!1||this.mounted===!1)return!1;const v=this.findDOMNode();v&&this.props.enableUserSelectHack&&(0,Rr.removeUserSelectStyles)(v.ownerDocument),(0,$r.default)("DraggableCore: handleDragStop: %j",m),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,v&&((0,$r.default)("DraggableCore: Removing handlers"),(0,Rr.removeEvent)(v.ownerDocument,Eo.move,this.handleDrag),(0,Rr.removeEvent)(v.ownerDocument,Eo.stop,this.handleDragStop))}),Xi(this,"onMouseDown",p=>(Eo=As.mouse,this.handleDragStart(p))),Xi(this,"onMouseUp",p=>(Eo=As.mouse,this.handleDragStop(p))),Xi(this,"onTouchStart",p=>(Eo=As.touch,this.handleDragStart(p))),Xi(this,"onTouchEnd",p=>(Eo=As.touch,this.handleDragStop(p)))}componentDidMount(){this.mounted=!0;const p=this.findDOMNode();p&&(0,Rr.addEvent)(p,As.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const p=this.findDOMNode();if(p){const{ownerDocument:a}=p;(0,Rr.removeEvent)(a,As.mouse.move,this.handleDrag),(0,Rr.removeEvent)(a,As.touch.move,this.handleDrag),(0,Rr.removeEvent)(a,As.mouse.stop,this.handleDragStop),(0,Rr.removeEvent)(a,As.touch.stop,this.handleDragStop),(0,Rr.removeEvent)(p,As.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Rr.removeUserSelectStyles)(a)}}findDOMNode(){var p,a;return(p=this.props)!==null&&p!==void 0&&p.nodeRef?(a=this.props)===null||a===void 0||(a=a.nodeRef)===null||a===void 0?void 0:a.current:ya.default.findDOMNode(this)}render(){return Fa.cloneElement(Fa.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}To.default=ml,Xi(ml,"displayName","DraggableCore"),Xi(ml,"propTypes",{allowAnyClick:Or.default.bool,children:Or.default.node.isRequired,disabled:Or.default.bool,enableUserSelectHack:Or.default.bool,offsetParent:function(l,p){if(l[p]&&l[p].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Or.default.arrayOf(Or.default.number),handle:Or.default.string,cancel:Or.default.string,nodeRef:Or.default.object,onStart:Or.default.func,onDrag:Or.default.func,onStop:Or.default.func,onMouseDown:Or.default.func,scale:Or.default.number,className:pl.dontSetMe,style:pl.dontSetMe,transform:pl.dontSetMe}),Xi(ml,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(l){Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"DraggableCore",{enumerable:!0,get:function(){return S.default}}),l.default=void 0;var p=V(ps),a=x(_o.exports),c=x(ps),f=x(ll),m=Ri,v=xs,_=fs,S=x(To),E=x(ga);function x(W){return W&&W.__esModule?W:{default:W}}function U(W){if(typeof WeakMap!="function")return null;var Te=new WeakMap,je=new WeakMap;return(U=function(Be){return Be?je:Te})(W)}function V(W,Te){if(W&&W.__esModule)return W;if(W===null||typeof W!="object"&&typeof W!="function")return{default:W};var je=U(Te);if(je&&je.has(W))return je.get(W);var Be={},tt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $e in W)if($e!=="default"&&Object.prototype.hasOwnProperty.call(W,$e)){var It=tt?Object.getOwnPropertyDescriptor(W,$e):null;It&&(It.get||It.set)?Object.defineProperty(Be,$e,It):Be[$e]=W[$e]}return Be.default=W,je&&je.set(W,Be),Be}function ie(){return ie=Object.assign?Object.assign.bind():function(W){for(var Te=1;Te{if((0,E.default)("Draggable: onDragStart: %j",Be),this.props.onStart(je,(0,v.createDraggableData)(this,Be))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),de(this,"onDrag",(je,Be)=>{if(!this.state.dragging)return!1;(0,E.default)("Draggable: onDrag: %j",Be);const tt=(0,v.createDraggableData)(this,Be),$e={x:tt.x,y:tt.y,slackX:0,slackY:0};if(this.props.bounds){const{x:It,y:Ht}=$e;$e.x+=this.state.slackX,$e.y+=this.state.slackY;const[en,ln]=(0,v.getBoundPosition)(this,$e.x,$e.y);$e.x=en,$e.y=ln,$e.slackX=this.state.slackX+(It-$e.x),$e.slackY=this.state.slackY+(Ht-$e.y),tt.x=$e.x,tt.y=$e.y,tt.deltaX=$e.x-this.state.x,tt.deltaY=$e.y-this.state.y}if(this.props.onDrag(je,tt)===!1)return!1;this.setState($e)}),de(this,"onDragStop",(je,Be)=>{if(!this.state.dragging||this.props.onStop(je,(0,v.createDraggableData)(this,Be))===!1)return!1;(0,E.default)("Draggable: onDragStop: %j",Be);const tt={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:$e,y:It}=this.props.position;tt.x=$e,tt.y=It}this.setState(tt)}),this.state={dragging:!1,dragged:!1,x:Te.position?Te.position.x:Te.defaultPosition.x,y:Te.position?Te.position.y:Te.defaultPosition.y,prevPropsPosition:{...Te.position},slackX:0,slackY:0,isElementSVG:!1},Te.position&&!(Te.onDrag||Te.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var Te,je;return(Te=(je=this.props)===null||je===void 0||(je=je.nodeRef)===null||je===void 0?void 0:je.current)!==null&&Te!==void 0?Te:c.default.findDOMNode(this)}render(){const{axis:Te,bounds:je,children:Be,defaultPosition:tt,defaultClassName:$e,defaultClassNameDragging:It,defaultClassNameDragged:Ht,position:en,positionOffset:ln,scale:rn,...wn}=this.props;let _n={},Xn=null;const Gn=!en||this.state.dragging,Ti=en||tt,Mi={x:(0,v.canDragX)(this)&&Gn?this.state.x:Ti.x,y:(0,v.canDragY)(this)&&Gn?this.state.y:Ti.y};this.state.isElementSVG?Xn=(0,m.createSVGTransform)(Mi,ln):_n=(0,m.createCSSTransform)(Mi,ln);const yr=(0,f.default)(Be.props.className||"",$e,{[It]:this.state.dragging,[Ht]:this.state.dragged});return p.createElement(S.default,ie({},wn,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),p.cloneElement(p.Children.only(Be),{className:yr,style:{...Be.props.style,..._n},transform:Xn}))}}l.default=Ve,de(Ve,"displayName","Draggable"),de(Ve,"propTypes",{...S.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:_.dontSetMe,style:_.dontSetMe,transform:_.dontSetMe}),de(Ve,"defaultProps",{...S.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Tc);const{default:Wl,DraggableCore:Ad}=Tc;Ml.exports=Wl,Ml.exports.default=Wl,Ml.exports.DraggableCore=Ad;var kd=Ml.exports,Fu=["second","minute","hour","day","week","month","year"];function Ic(l,p){if(p===0)return["just now","right now"];var a=Fu[Math.floor(p/2)];return l>1&&(a+="s"),[l+" "+a+" ago","in "+l+" "+a]}var xo=["秒","分钟","小时","天","周","个月","年"];function Bi(l,p){if(p===0)return["刚刚","片刻后"];var a=xo[~~(p/2)];return[l+" "+a+"前",l+" "+a+"后"]}var ql={},Zi=function(l,p){ql[l]=p},Bu=function(l){return ql[l]||ql.en_US},Zo=[60,60,24,7,365/7/12,12];function io(l){return l instanceof Date?l:!isNaN(l)||/^\d+$/.test(l)?new Date(parseInt(l)):(l=(l||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(l))}function Gl(l,p){var a=l<0?1:0;l=Math.abs(l);for(var c=l,f=0;l>=Zo[f]&&f(f===0?9:1)&&(f+=1),p(l,f,c)[a].replace("%s",l.toString())}function js(l,p){var a=p?io(p):new Date;return(+a-+io(l))/1e3}function Ba(l){for(var p=1,a=0,c=Math.abs(l);l>=Zo[a]&&a{l.current&&!l.current.contains(event.target)&&p()};Ue(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)))}var Xe=Object.prototype.toString,Je=function(l){var p=Xe.call(l),a=p==="[object Arguments]";return a||(a=p!=="[object Array]"&&l!==null&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&Xe.call(l.callee)==="[object Function]"),a},Se;if(!Object.keys){var ye=Object.prototype.hasOwnProperty,me=Object.prototype.toString,nt=Je,le=Object.prototype.propertyIsEnumerable,j=!le.call({toString:null},"toString"),Q=le.call(function(){},"prototype"),dt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ht=function(l){var p=l.constructor;return p&&p.prototype===l},At={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Tt=function(){if(typeof window>"u")return!1;for(var l in window)try{if(!At["$"+l]&&ye.call(window,l)&&window[l]!==null&&typeof window[l]=="object")try{ht(window[l])}catch{return!0}}catch{return!0}return!1}(),it=function(l){if(typeof window>"u"||!Tt)return ht(l);try{return ht(l)}catch{return!1}};Se=function(l){var p=l!==null&&typeof l=="object",a=me.call(l)==="[object Function]",c=nt(l),f=p&&me.call(l)==="[object String]",m=[];if(!p&&!a&&!c)throw new TypeError("Object.keys called on a non-object");var v=Q&&a;if(f&&l.length>0&&!ye.call(l,0))for(var _=0;_0)for(var S=0;S"u"||!Dn?di:Dn(Uint8Array),gs={"%AggregateError%":typeof AggregateError>"u"?di:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?di:ArrayBuffer,"%ArrayIteratorPrototype%":Ql&&Dn?Dn([][Symbol.iterator]()):di,"%AsyncFromSyncIteratorPrototype%":di,"%AsyncFunction%":Co,"%AsyncGenerator%":Co,"%AsyncGeneratorFunction%":Co,"%AsyncIteratorPrototype%":Co,"%Atomics%":typeof Atomics>"u"?di:Atomics,"%BigInt%":typeof BigInt>"u"?di:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?di:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?di:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?di:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?di:Float32Array,"%Float64Array%":typeof Float64Array>"u"?di:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?di:FinalizationRegistry,"%Function%":Zl,"%GeneratorFunction%":Co,"%Int8Array%":typeof Int8Array>"u"?di:Int8Array,"%Int16Array%":typeof Int16Array>"u"?di:Int16Array,"%Int32Array%":typeof Int32Array>"u"?di:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ql&&Dn?Dn(Dn([][Symbol.iterator]())):di,"%JSON%":typeof JSON=="object"?JSON:di,"%Map%":typeof Map>"u"?di:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ql||!Dn?di:Dn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?di:Promise,"%Proxy%":typeof Proxy>"u"?di:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?di:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?di:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ql||!Dn?di:Dn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?di:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ql&&Dn?Dn(""[Symbol.iterator]()):di,"%Symbol%":Ql?Symbol:di,"%SyntaxError%":Ha,"%ThrowTypeError%":nf,"%TypedArray%":ks,"%TypeError%":za,"%Uint8Array%":typeof Uint8Array>"u"?di:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?di:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?di:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?di:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?di:WeakMap,"%WeakRef%":typeof WeakRef>"u"?di:WeakRef,"%WeakSet%":typeof WeakSet>"u"?di:WeakSet};if(Dn)try{null.error}catch(l){var wg=Dn(Dn(l));gs["%Error.prototype%"]=wg}var rf=function l(p){var a;if(p==="%AsyncFunction%")a=Pd("async function () {}");else if(p==="%GeneratorFunction%")a=Pd("function* () {}");else if(p==="%AsyncGeneratorFunction%")a=Pd("async function* () {}");else if(p==="%AsyncGenerator%"){var c=l("%AsyncGeneratorFunction%");c&&(a=c.prototype)}else if(p==="%AsyncIteratorPrototype%"){var f=l("%AsyncGenerator%");f&&Dn&&(a=Dn(f.prototype))}return gs[p]=a,a},sf={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Nc=bl,Id=Mc,_g=Nc.call(Function.call,Array.prototype.concat),Sg=Nc.call(Function.apply,Array.prototype.splice),of=Nc.call(Function.call,String.prototype.replace),Od=Nc.call(Function.call,String.prototype.slice),af=Nc.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,O=function(l){var p=Od(l,0,1),a=Od(l,-1);if(p==="%"&&a!=="%")throw new Ha("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&p!=="%")throw new Ha("invalid intrinsic syntax, expected opening `%`");var c=[];return of(l,T,function(f,m,v,_){c[c.length]=v?of(_,k,"$1"):m||f}),c},I=function(l,p){var a=l,c;if(Id(sf,a)&&(c=sf[a],a="%"+c[0]+"%"),Id(gs,a)){var f=gs[a];if(f===Co&&(f=rf(a)),typeof f>"u"&&!p)throw new za("intrinsic "+l+" exists, but is not available. Please file an issue!");return{alias:c,name:a,value:f}}throw new Ha("intrinsic "+l+" does not exist!")},B=function(l,p){if(typeof l!="string"||l.length===0)throw new za("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof p!="boolean")throw new za('"allowMissing" argument must be a boolean');if(af(/^%?[^%]*%?$/,l)===null)throw new Ha("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=O(l),c=a.length>0?a[0]:"",f=I("%"+c+"%",p),m=f.name,v=f.value,_=!1,S=f.alias;S&&(c=S[0],Sg(a,_g([0,1],S)));for(var E=1,x=!0;E=a.length){var de=Ws(v,U);x=!!de,x&&"get"in de&&!("originalValue"in de.get)?v=de.get:v=v[U]}else x=Id(v,U),v=v[U];x&&!_&&(gs[m]=v)}}return v},Y=B,_e=Y("%Object.defineProperty%",!0),Ae=function(){if(_e)try{return _e({},"a",{value:1}),!0}catch{return!1}return!1};Ae.hasArrayLengthDefineBug=function(){if(!Ae())return null;try{return _e([],"length",{value:1}).length!==1}catch{return!0}};var De=Ae,Le=yn,Ze=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",ut=Object.prototype.toString,Jt=Array.prototype.concat,_t=Object.defineProperty,vn=function(l){return typeof l=="function"&&ut.call(l)==="[object Function]"},Yn=De(),qr=_t&&Yn,Ps=function(l,p,a,c){if(p in l){if(c===!0){if(l[p]===a)return}else if(!vn(c)||!c())return}qr?_t(l,p,{configurable:!0,enumerable:!1,value:a,writable:!0}):l[p]=a},Ao=function(l,p){var a=arguments.length>2?arguments[2]:{},c=Le(p);Ze&&(c=Jt.call(c,Object.getOwnPropertySymbols(p)));for(var f=0;f3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Rd("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Rd("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Rd("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Rd("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,m=arguments.length>5?arguments[5]:null,v=arguments.length>6?arguments[6]:!1,_=!!Rb&&Rb(l,p);if(ko)ko(l,p,{configurable:m===null&&_?_.configurable:!m,enumerable:c===null&&_?_.enumerable:!c,value:a,writable:f===null&&_?_.writable:!f});else if(v||!c&&!f&&!m)l[p]=a;else throw new x1("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Lb=B,Mb=zt,Nb=De(),Ci=Vu,Eh=Lb("%TypeError%"),Fb=Lb("%Math.floor%"),Tg=function(l,p){if(typeof l!="function")throw new Eh("`fn` is not a function");if(typeof p!="number"||p<0||p>4294967295||Fb(p)!==p)throw new Eh("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],c=!0,f=!0;if("length"in l&&Ci){var m=Ci(l,"length");m&&!m.configurable&&(c=!1),m&&!m.writable&&(f=!1)}return(c||f||!a)&&(Nb?Mb(l,"length",p,!0,!0):Mb(l,"length",p)),l};(function(l){var p=bl,a=B,c=Tg,f=a("%TypeError%"),m=a("%Function.prototype.apply%"),v=a("%Function.prototype.call%"),_=a("%Reflect.apply%",!0)||p.call(v,m),S=a("%Object.defineProperty%",!0),E=a("%Math.max%");if(S)try{S({},"a",{value:1})}catch{S=null}l.exports=function(U){if(typeof U!="function")throw new f("a function is required");var V=_(p,v,arguments);return c(V,1+E(0,U.length-(arguments.length-1)),!0)};var x=function(){return _(p,m,arguments)};S?S(l.exports,"apply",{value:x}):l.exports.apply=x})(wl);var Bb=B,Ub=wl.exports,C1=Ub(Bb("String.prototype.indexOf")),Jl=function(l,p){var a=Bb(l,!!p);return typeof a=="function"&&C1(l,".prototype.")>-1?Ub(a):a},A1=B,$l=A1("%TypeError%"),k1=function(l,p){if(l==null)throw new $l(p||"Cannot call method on "+l);return l},Ld=k1,P1=B,Hb=P1("%Array%"),zb=!Hb.isArray&&Jl("Object.prototype.toString"),D1=Hb.isArray||function(l){return zb(l)==="[object Array]"},jb=D1,lf=B,I1=Jl,eu=lf("%TypeError%"),Vb=jb,O1=lf("%Reflect.apply%",!0)||I1("Function.prototype.apply"),R1=function(l,p){var a=arguments.length>2?arguments[2]:[];if(!Vb(a))throw new eu("Assertion failed: optional `argumentsList`, if provided, must be a List");return O1(l,p,a)},L1={},M1=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:L1}),N1=Ia(M1),Eg=typeof Map=="function"&&Map.prototype,xg=Object.getOwnPropertyDescriptor&&Eg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,uf=Eg&&xg&&typeof xg.get=="function"?xg.get:null,Wb=Eg&&Map.prototype.forEach,Cg=typeof Set=="function"&&Set.prototype,Ag=Object.getOwnPropertyDescriptor&&Cg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_l=Cg&&Ag&&typeof Ag.get=="function"?Ag.get:null,qb=Cg&&Set.prototype.forEach,F1=typeof WeakMap=="function"&&WeakMap.prototype,xh=F1?WeakMap.prototype.has:null,B1=typeof WeakSet=="function"&&WeakSet.prototype,Ch=B1?WeakSet.prototype.has:null,U1=typeof WeakRef=="function"&&WeakRef.prototype,Gb=U1?WeakRef.prototype.deref:null,H1=Boolean.prototype.valueOf,tu=Object.prototype.toString,Md=Function.prototype.toString,z1=String.prototype.match,kg=String.prototype.slice,Wu=String.prototype.replace,j1=String.prototype.toUpperCase,Kb=String.prototype.toLowerCase,cf=RegExp.prototype.test,Bc=Array.prototype.concat,Jo=Array.prototype.join,Si=Array.prototype.slice,b=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,H=Object.getOwnPropertySymbols,X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ze=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pe||!0)?Symbol.toStringTag:null,vt=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(l){return l.__proto__}:null);function Nn(l,p){if(l===1/0||l===-1/0||l!==l||l&&l>-1e3&&l<1e3||cf.call(/e/,p))return p;var a=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof l=="number"){var c=l<0?-b(-l):b(l);if(c!==l){var f=String(c),m=kg.call(p,f.length+1);return Wu.call(f,a,"$&_")+"."+Wu.call(Wu.call(m,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Wu.call(p,a,"$&_")}var mi=N1,qs=mi.custom,Sl=oN(qs)?qs:null,qu=function l(p,a,c,f){var m=a||{};if(Nd(m,"quoteStyle")&&m.quoteStyle!=="single"&&m.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Nd(m,"maxStringLength")&&(typeof m.maxStringLength=="number"?m.maxStringLength<0&&m.maxStringLength!==1/0:m.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var v=Nd(m,"customInspect")?m.customInspect:!0;if(typeof v!="boolean"&&v!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Nd(m,"indent")&&m.indent!==null&&m.indent!==" "&&!(parseInt(m.indent,10)===m.indent&&m.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Nd(m,"numericSeparator")&&typeof m.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var _=m.numericSeparator;if(typeof p>"u")return"undefined";if(p===null)return"null";if(typeof p=="boolean")return p?"true":"false";if(typeof p=="string")return lN(p,m);if(typeof p=="number"){if(p===0)return 1/0/p>0?"0":"-0";var S=String(p);return _?Nn(p,S):S}if(typeof p=="bigint"){var E=String(p)+"n";return _?Nn(p,E):E}var x=typeof m.depth>"u"?5:m.depth;if(typeof c>"u"&&(c=0),c>=x&&x>0&&typeof p=="object")return V1(p)?"[Array]":"[Object]";var U=Ple(m,c);if(typeof f>"u")f=[];else if(aN(f,p)>=0)return"[Circular]";function V(wn,_n,Xn){if(_n&&(f=Si.call(f),f.push(_n)),Xn){var Gn={depth:m.depth};return Nd(m,"quoteStyle")&&(Gn.quoteStyle=m.quoteStyle),l(wn,Gn,c+1,f)}return l(wn,m,c+1,f)}if(typeof p=="function"&&!sN(p)){var ie=wle(p),de=Yb(p,V);return"[Function"+(ie?": "+ie:" (anonymous)")+"]"+(de.length>0?" { "+Jo.call(de,", ")+" }":"")}if(oN(p)){var Ie=pe?Wu.call(String(p),/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(p);return typeof p=="object"&&!pe?Pg(Ie):Ie}if(Cle(p)){for(var ke="<"+Kb.call(String(p.nodeName)),Ve=p.attributes||[],W=0;W",ke}if(V1(p)){if(p.length===0)return"[]";var Te=Yb(p,V);return U&&!kle(Te)?"["+q1(Te,U)+"]":"[ "+Jo.call(Te,", ")+" ]"}if(fle(p)){var je=Yb(p,V);return!("cause"in Error.prototype)&&"cause"in p&&!vt.call(p,"cause")?"{ ["+String(p)+"] "+Jo.call(Bc.call("[cause]: "+V(p.cause),je),", ")+" }":je.length===0?"["+String(p)+"]":"{ ["+String(p)+"] "+Jo.call(je,", ")+" }"}if(typeof p=="object"&&v){if(Sl&&typeof p[Sl]=="function"&&mi)return mi(p,{depth:x-c});if(v!=="symbol"&&typeof p.inspect=="function")return p.inspect()}if(_le(p)){var Be=[];return Wb&&Wb.call(p,function(wn,_n){Be.push(V(_n,p,!0)+" => "+V(wn,p))}),uN("Map",uf.call(p),Be,U)}if(Ele(p)){var tt=[];return qb&&qb.call(p,function(wn){tt.push(V(wn,p))}),uN("Set",_l.call(p),tt,U)}if(Sle(p))return W1("WeakMap");if(xle(p))return W1("WeakSet");if(Tle(p))return W1("WeakRef");if(gle(p))return Pg(V(Number(p)));if(vle(p))return Pg(V(A.call(p)));if(yle(p))return Pg(H1.call(p));if(mle(p))return Pg(V(String(p)));if(typeof window<"u"&&p===window)return"{ [object Window] }";if(p===hs)return"{ [object globalThis] }";if(!ple(p)&&!sN(p)){var $e=Yb(p,V),It=on?on(p)===Object.prototype:p instanceof Object||p.constructor===Object,Ht=p instanceof Object?"":"null prototype",en=!It&&ze&&Object(p)===p&&ze in p?kg.call(Fd(p),8,-1):Ht?"Object":"",ln=It||typeof p.constructor!="function"?"":p.constructor.name?p.constructor.name+" ":"",rn=ln+(en||Ht?"["+Jo.call(Bc.call([],en||[],Ht||[]),": ")+"] ":"");return $e.length===0?rn+"{}":U?rn+"{"+q1($e,U)+"}":rn+"{ "+Jo.call($e,", ")+" }"}return String(p)};function rN(l,p,a){var c=(a.quoteStyle||p)==="double"?'"':"'";return c+l+c}function hle(l){return Wu.call(String(l),/"/g,""")}function V1(l){return Fd(l)==="[object Array]"&&(!ze||!(typeof l=="object"&&ze in l))}function ple(l){return Fd(l)==="[object Date]"&&(!ze||!(typeof l=="object"&&ze in l))}function sN(l){return Fd(l)==="[object RegExp]"&&(!ze||!(typeof l=="object"&&ze in l))}function fle(l){return Fd(l)==="[object Error]"&&(!ze||!(typeof l=="object"&&ze in l))}function mle(l){return Fd(l)==="[object String]"&&(!ze||!(typeof l=="object"&&ze in l))}function gle(l){return Fd(l)==="[object Number]"&&(!ze||!(typeof l=="object"&&ze in l))}function yle(l){return Fd(l)==="[object Boolean]"&&(!ze||!(typeof l=="object"&&ze in l))}function oN(l){if(pe)return l&&typeof l=="object"&&l instanceof Symbol;if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||!X)return!1;try{return X.call(l),!0}catch{}return!1}function vle(l){if(!l||typeof l!="object"||!A)return!1;try{return A.call(l),!0}catch{}return!1}var ble=Object.prototype.hasOwnProperty||function(l){return l in this};function Nd(l,p){return ble.call(l,p)}function Fd(l){return tu.call(l)}function wle(l){if(l.name)return l.name;var p=z1.call(Md.call(l),/^function\s*([\w$]+)/);return p?p[1]:null}function aN(l,p){if(l.indexOf)return l.indexOf(p);for(var a=0,c=l.length;ap.maxStringLength){var a=l.length-p.maxStringLength,c="... "+a+" more character"+(a>1?"s":"");return lN(kg.call(l,0,p.maxStringLength),p)+c}var f=Wu.call(Wu.call(l,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ale);return rN(f,"single",p)}function Ale(l){var p=l.charCodeAt(0),a={8:"b",9:"t",10:"n",12:"f",13:"r"}[p];return a?"\\"+a:"\\x"+(p<16?"0":"")+j1.call(p.toString(16))}function Pg(l){return"Object("+l+")"}function W1(l){return l+" { ? }"}function uN(l,p,a,c){var f=c?q1(a,c):Jo.call(a,", ");return l+" ("+p+") {"+f+"}"}function kle(l){for(var p=0;p=0)return!1;return!0}function Ple(l,p){var a;if(l.indent===" ")a=" ";else if(typeof l.indent=="number"&&l.indent>0)a=Jo.call(Array(l.indent+1)," ");else return null;return{base:a,prev:Jo.call(Array(p+1),a)}}function q1(l,p){if(l.length===0)return"";var a=` `+p.prev+p.base;return a+Jo.call(l,","+a)+` `+p.prev}function Yb(l,p){var a=V1(l),c=[];if(a){c.length=l.length;for(var f=0;f"u")return"Undefined";if(typeof l=="function"||typeof l=="object")return"Object";if(typeof l=="number")return"Number";if(typeof l=="boolean")return"Boolean";if(typeof l=="string")return"String"},Ile=Dle,Dg=function(l){return typeof l=="symbol"?"Symbol":typeof l=="bigint"?"BigInt":Ile(l)},Ole=B,dN=Ole("%TypeError%"),Rle=qu,Lle=cN,Mle=Dg,hN=function(l,p){if(Mle(l)!=="Object")throw new dN("Assertion failed: Type(O) is not Object");if(!Lle(p))throw new dN("Assertion failed: IsPropertyKey(P) is not true, got "+Rle(p));return l[p]},Nle=B,pN=Nle("%TypeError%"),Fle=cN,Ble=Dg,Ule=function(l,p){if(Ble(l)!=="Object")throw new pN("Assertion failed: `O` must be an Object");if(!Fle(p))throw new pN("Assertion failed: `P` must be a Property Key");return p in l},fN=Function.prototype.toString,df=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,G1,Xb;if(typeof df=="function"&&typeof Object.defineProperty=="function")try{G1=Object.defineProperty({},"length",{get:function(){throw Xb}}),Xb={},df(function(){throw 42},null,G1)}catch(l){l!==Xb&&(df=null)}else df=null;var Hle=/^\s*class\b/,K1=function(l){try{var p=fN.call(l);return Hle.test(p)}catch{return!1}},Y1=function(l){try{return K1(l)?!1:(fN.call(l),!0)}catch{return!1}},Zb=Object.prototype.toString,zle="[object Object]",jle="[object Function]",Vle="[object GeneratorFunction]",Wle="[object HTMLAllCollection]",qle="[object HTML document.all class]",Gle="[object HTMLCollection]",Kle=typeof Symbol=="function"&&!!Symbol.toStringTag,Yle=!(0 in[,]),X1=function(){return!1};if(typeof document=="object"){var Xle=document.all;Zb.call(Xle)===Zb.call(document.all)&&(X1=function(l){if((Yle||!l)&&(typeof l>"u"||typeof l=="object"))try{var p=Zb.call(l);return(p===Wle||p===qle||p===Gle||p===zle)&&l("")==null}catch{}return!1})}var mN=df?function(l){if(X1(l))return!0;if(!l||typeof l!="function"&&typeof l!="object")return!1;try{df(l,null,G1)}catch(p){if(p!==Xb)return!1}return!K1(l)&&Y1(l)}:function(l){if(X1(l))return!0;if(!l||typeof l!="function"&&typeof l!="object")return!1;if(Kle)return Y1(l);if(K1(l))return!1;var p=Zb.call(l);return p!==jle&&p!==Vle&&!/^\[object HTML/.test(p)?!1:Y1(l)},Zle=mN,Qle=Number.MAX_SAFE_INTEGER||9007199254740991,Jle=function(l){return l===null||typeof l!="function"&&typeof l!="object"},$le=function(l){return l===null||typeof l!="function"&&typeof l!="object"},eue=An,Z1=function(){return eue()&&!!Symbol.toStringTag},tue=Date.prototype.getDay,nue=function(l){try{return tue.call(l),!0}catch{return!1}},iue=Object.prototype.toString,rue="[object Date]",sue=Z1(),oue=function(l){return typeof l!="object"||l===null?!1:sue?nue(l):iue.call(l)===rue},Q1={exports:{}},aue=Object.prototype.toString,lue=Un();if(lue){var uue=Symbol.prototype.toString,cue=/^Symbol\(.*\)$/,due=function(l){return typeof l.valueOf()!="symbol"?!1:cue.test(uue.call(l))};Q1.exports=function(l){if(typeof l=="symbol")return!0;if(aue.call(l)!=="[object Symbol]")return!1;try{return due(l)}catch{return!1}}}else Q1.exports=function(l){return!1};var hue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",J1=$le,gN=mN,pue=oue,yN=Q1.exports,fue=function(l,p){if(typeof l>"u"||l===null)throw new TypeError("Cannot call method on "+l);if(typeof p!="string"||p!=="number"&&p!=="string")throw new TypeError('hint must be "string" or "number"');var a=p==="string"?["toString","valueOf"]:["valueOf","toString"],c,f,m;for(m=0;m1&&(arguments[1]===String?p="string":arguments[1]===Number&&(p="number"));var a;if(hue&&(Symbol.toPrimitive?a=mue(l,Symbol.toPrimitive):yN(l)&&(a=Symbol.prototype.valueOf)),typeof a<"u"){var c=a.call(l,p);if(J1(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return p==="default"&&(pue(l)||yN(l))&&(p="string"),fue(l,p==="default"?"number":p)},vN=gue,yue=function(l){return arguments.length>1?vN(l,arguments[1]):vN(l)},$1=Jl,bN=Z1(),wN,_N,eE,tE;if(bN){wN=$1("Object.prototype.hasOwnProperty"),_N=$1("RegExp.prototype.exec"),eE={};var nE=function(){throw eE};tE={toString:nE,valueOf:nE},typeof Symbol.toPrimitive=="symbol"&&(tE[Symbol.toPrimitive]=nE)}var vue=$1("Object.prototype.toString"),bue=Object.getOwnPropertyDescriptor,wue="[object RegExp]",_ue=bN?function(l){if(!l||typeof l!="object")return!1;var p=bue(l,"lastIndex"),a=p&&wN(p,"value");if(!a)return!1;try{_N(l,tE)}catch(c){return c===eE}}:function(l){return!l||typeof l!="object"&&typeof l!="function"?!1:vue(l)===wue},Sue=Jl,Tue=B,Eue=_ue,xue=Sue("RegExp.prototype.exec"),Cue=Tue("%TypeError%"),Aue=function(l){if(!Eue(l))throw new Cue("`regex` must be a RegExp");return function(p){return xue(l,p)!==null}},SN=B,kue=SN("%String%"),Pue=SN("%TypeError%"),TN=function(l){if(typeof l=="symbol")throw new Pue("Cannot convert a Symbol value to a string");return kue(l)},Due=Ld,Iue=TN,Oue=Jl,EN=Oue("String.prototype.replace"),xN=/^\s$/.test("᠎"),Rue=xN?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Lue=xN?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,CN=function(){var l=Iue(Due(this));return EN(EN(l,Rue,""),Lue,"")},Mue=CN,AN="​",hf="᠎",kN=function(){return String.prototype.trim&&AN.trim()===AN&&hf.trim()===hf&&("_"+hf).trim()==="_"+hf&&(hf+"_").trim()===hf+"_"?String.prototype.trim:Mue},Nue=va,Fue=kN,Bue=function(){var l=Fue();return Nue(String.prototype,{trim:l},{trim:function(){return String.prototype.trim!==l}}),l},Uue=wl.exports,Hue=va,zue=Ld,jue=CN,PN=kN,Vue=Bue,Wue=Uue(PN()),DN=function(l){return zue(l),Wue(l)};Hue(DN,{getPolyfill:PN,implementation:jue,shim:Vue});var IN=DN,Qb=B,iE=Qb("%Number%"),que=Qb("%RegExp%"),Gue=Qb("%TypeError%"),ON=Qb("%parseInt%"),Kue=Jl,Jb=Aue,RN=Kue("String.prototype.slice"),Yue=Jb(/^0b[01]+$/i),Xue=Jb(/^0o[0-7]+$/i),Zue=Jb(/^[-+]0x[0-9a-f]+$/i),Que=["…","​","￾"].join(""),Jue=new que("["+Que+"]","g"),$ue=Jb(Jue),ece=IN,tce=Dg,nce=function l(p){if(tce(p)!=="String")throw new Gue("Assertion failed: `argument` is not a String");if(Yue(p))return iE(ON(RN(p,2),2));if(Xue(p))return iE(ON(RN(p,2),8));if($ue(p)||Zue(p))return NaN;var a=ece(p);return a!==p?l(a):iE(p)},LN=B,MN=LN("%TypeError%"),NN=LN("%Number%"),ice=Jle,rce=yue,sce=nce,oce=function(l){var p=ice(l)?l:rce(l,NN);if(typeof p=="symbol")throw new MN("Cannot convert a Symbol value to a number");if(typeof p=="bigint")throw new MN("Conversion from 'BigInt' to 'number' is not allowed.");return typeof p=="string"?sce(p):NN(p)},ace=Dg,lce=Math.floor,uce=function(l){return ace(l)==="BigInt"?l:lce(l)},cce=B,FN=uce,dce=cce("%TypeError%"),hce=function(l){if(typeof l!="number"&&typeof l!="bigint")throw new dce("argument must be a Number or a BigInt");var p=l<0?-FN(-l):FN(l);return p===0?0:p},BN=Number.isNaN||function(l){return l!==l},pce=BN,fce=function(l){return(typeof l=="number"||typeof l=="bigint")&&!pce(l)&&l!==1/0&&l!==-1/0},mce=oce,gce=hce,yce=BN,vce=fce,bce=function(l){var p=mce(l);return yce(p)||p===0?0:vce(p)?gce(p):p},UN=Qle,wce=bce,_ce=function(l){var p=wce(l);return p<=0?0:p>UN?UN:p},Sce=B,Tce=Sce("%TypeError%"),Ece=hN,xce=_ce,Cce=Dg,Ace=function(l){if(Cce(l)!=="Object")throw new Tce("Assertion failed: `obj` must be an Object");return xce(Ece(l,"length"))},kce=B,Pce=kce("%Object%"),Dce=Ld,Ice=function(l){return Dce(l),Pce(l)},Oce=String.prototype.valueOf,Rce=function(l){try{return Oce.call(l),!0}catch{return!1}},Lce=Object.prototype.toString,Mce="[object String]",Nce=Z1(),Fce=function(l){return typeof l=="string"?!0:typeof l!="object"?!1:Nce?Rce(l):Lce.call(l)===Mce},Bce=B,Uce=Jl,Hce=Bce("%TypeError%"),zce=R1,jce=hN,Vce=Ule,Wce=Zle,qce=Ace,Gce=Ice,Kce=TN,Yce=Fce,Xce=Uce("String.prototype.split"),HN=Object("a"),Zce=HN[0]!=="a"||!(0 in HN),zN=function(l){var p=Gce(this),a=Zce&&Yce(this)?Xce(this,""):p,c=qce(a);if(!Wce(l))throw new Hce("Array.prototype.forEach callback must be a function");var f;arguments.length>1&&(f=arguments[1]);for(var m=0;m=12&&p<=14)?1:2},$N={pluralTypes:{arabic:function(l){if(l<3)return l;var p=l%100;return p>=3&&p<=10?3:p>=11?4:5},bosnian_serbian:sE,chinese:function(){return 0},croatian:sE,french:function(l){return l>=2?1:0},german:function(l){return l!==1?1:0},russian:sE,lithuanian:function(l){return l%10===1&&l%100!==11?0:l%10>=2&&l%10<=9&&(l%100<11||l%100>19)?1:2},czech:function(l){return l===1?0:l>=2&&l<=4?1:2},polish:function(l){if(l===1)return 0;var p=l%10;return 2<=p&&p<=4&&(l%100<10||l%100>=20)?1:2},icelandic:function(l){return l%10!==1||l%100===11?1:0},slovenian:function(l){var p=l%100;return p===1?0:p===2?1:p===3||p===4?2:3},romanian:function(l){if(l===1)return 0;var p=l%100;return l===0||p>=2&&p<=19?1:2}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is","mk"],slovenian:["sl-SL"],romanian:["ro"]}};function Pde(l){var p={};return $b(rE(l),function(a){var c=a[0],f=a[1];$b(f,function(m){p[m]=c})}),p}function Dde(l,p){var a=Pde(l.pluralTypeToLanguages);return a[p]||a[JN.call(p,/-/,1)[0]]||a.en}function Ide(l,p,a){return l.pluralTypes[p](a)}function Ode(){var l={};return function(p,a){var c=l[a];return c&&!p.pluralTypes[c]&&(c=null,l[a]=c),c||(c=Dde(p,a),c&&(l[a]=c)),c}}function eF(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rde(l){var p=l&&l.prefix||"%{",a=l&&l.suffix||"}";if(p===e0||a===e0)throw new RangeError('"'+e0+'" token is reserved for pluralization');return new RegExp(eF(p)+"(.*?)"+eF(a),"g")}var Lde=Ode(),Mde=/%\{(.*?)\}/g;function oE(l,p,a,c,f,m){if(typeof l!="string")throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(p==null)return l;var v=l,_=c||Mde,S=m||QN,E=typeof p=="number"?{smart_count:p}:p;if(E.smart_count!=null&&l){var x=f||$N,U=JN.call(l,e0),V=a||"en",ie=Lde(x,V),de=Ide(x,ie,E.smart_count);v=Ade(U[de]||U[0])}return v=S.call(v,_,function(Ie,ke){return!ZN(E,ke)||E[ke]==null?Ie:E[ke]}),v}function Uc(l){var p=l||{};this.phrases={},this.extend(p.phrases||{}),this.currentLocale=p.locale||"en";var a=p.allowMissing?oE:null;this.onMissingKey=typeof p.onMissingKey=="function"?p.onMissingKey:a,this.warn=p.warn||kde,this.replaceImplementation=p.replace||QN,this.tokenRegex=Rde(p.interpolation),this.pluralRules=p.pluralRules||$N}Uc.prototype.locale=function(l){return l&&(this.currentLocale=l),this.currentLocale},Uc.prototype.extend=function(l,p){$b(rE(l||{}),function(a){var c=a[0],f=a[1],m=p?p+"."+c:c;typeof f=="object"?this.extend(f,m):this.phrases[m]=f},this)},Uc.prototype.unset=function(l,p){typeof l=="string"?delete this.phrases[l]:$b(rE(l||{}),function(a){var c=a[0],f=a[1],m=p?p+"."+c:c;typeof f=="object"?this.unset(f,m):delete this.phrases[m]},this)},Uc.prototype.clear=function(){this.phrases={}},Uc.prototype.replace=function(l){this.clear(),this.extend(l)},Uc.prototype.t=function(l,p){var a,c,f=p??{};if(typeof this.phrases[l]=="string")a=this.phrases[l];else if(typeof f._=="string")a=f._;else if(this.onMissingKey){var m=this.onMissingKey;c=m(l,f,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)}else this.warn('Missing translation for key: "'+l+'"'),c=l;return typeof a=="string"&&(c=oE(a,f,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)),c},Uc.prototype.has=function(l){return ZN(this.phrases,l)},Uc.transformPhrase=function(l,p,a){return oE(l,p,a)};var Nde=Uc,Fde={"Add a comment...":"إضافة تعليق","Add a reply...":"إضافة رد","Add tag...":"إضافة علامة",Cancel:"إلغاء",Close:"إغلاق",Edit:"Edit",Delete:"Delete",Ok:"تم"},Bde={"Add a comment...":"Napsat komentář...","Add a reply...":"Odpovědět...","Add tag...":"Přidat štítek...",Cancel:"Zrušit",Close:"Zavřít",Edit:"Upravit",Delete:"Smazat",Ok:"Ok"},Ude={"Add a comment...":"Kommentar schreiben...","Add a reply...":"Antwort schreiben...","Add tag...":"Tag...",Cancel:"Abbrechen",Close:"Schliessen",Edit:"Bearbeiten",Delete:"Löschen",Ok:"Ok"},Hde={"Add a comment...":"Σχολίασε...","Add a reply...":"Απάντησε...","Add tag...":"Πρόσθεσε tag...",Cancel:"Άκυρο",Close:"Κλείσιμο",Edit:"Επεξεργασία",Delete:"Διαγραφή",Ok:"Ok"},zde={"Add a comment...":"Agregar un comentario...","Add a reply...":"Agregar una respuesta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Cerrar",Edit:"Editar",Delete:"Eliminar",Ok:"Ok"},jde={"Add a comment...":"Lisää kommentti","Add a reply...":"Lisää vastaus","Add tag...":"Lisää tunniste",Cancel:"Peruuta",Close:"Sulje",Edit:"Muokkaa",Delete:"Poista",Ok:"Ok"},Vde={"Add a comment...":"Ajouter un commentaire...","Add a reply...":"Ajouter une réponse...","Add tag...":"Ajouter une étiquette...",Cancel:"Annuler",Close:"Fermer",Edit:"Éditer",Delete:"Supprimer",Ok:"Ok"},Wde={"Add a comment...":"Engadir un comentario...","Add a reply...":"Engadir unha resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Pechar",Edit:"Edit",Delete:"Delete",Ok:"Ok"},qde={"Add a comment...":"टिप्पणी जोड़ें","Add a reply...":"जवाब दें","Add tag...":"टैग लगाएँ",Cancel:"रद्द करें",Close:"बंद करें",Edit:"संपादित करें",Delete:"हटाएँ",Ok:"ठीक है"},Gde={"Add a comment...":"Commenta...","Add a reply...":"Rispondi...","Add tag...":"Aggiungi tag...",Cancel:"Annulla",Close:"Chiudi",Edit:"Edit",Delete:"Delete",Ok:"Ok"},Kde={"Add a comment...":"コメントを追加する...","Add a reply...":"返信する...","Add tag...":"タグを追加する...",Cancel:"キャンセル",Close:"閉じる",Edit:"編集",Delete:"削除",Ok:"Ok"},Yde={"Add a comment...":"댓글 추가","Add a reply...":"답글 추가","Add tag...":"태그 추가",Cancel:"취소",Close:"닫기",Edit:"수정",Delete:"삭제",Ok:"확인"},Xde={"Add a comment...":"Commentaar toevoegen...","Add a reply...":"Antwoord toevoegen...","Add tag...":"Tag toevoegen...",Cancel:"Afbreken",Close:"Sluiten",Edit:"Bewerken",Delete:"Verwijderen",Ok:"Ok"},Zde={"Add a comment...":"Adicionar um comentário...","Add a reply...":"Adicionar uma resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Fechar",Edit:"Editar",Delete:"Apagar",Ok:"Ok"},Qde={"Add a comment...":"Добавить комментарий...","Add a reply...":"Добавить ответ...","Add tag...":"Добавить тэг...",Cancel:"Отмена",Close:"Закрыть",Edit:"Редактировать",Delete:"Удалить",Ok:"Ок"},Jde={"Add a comment...":"Skriv en kommentar...","Add a reply...":"Skriv ett svar...","Add tag...":"Tagg...",Cancel:"Cancel",Close:"Stäng",Edit:"Edit",Delete:"Delete",Ok:"Ok"},$de={"Add a comment...":"เพิ่มคอมเมนต์...","Add a reply...":"ตอบกลับ...","Add tag...":"เพิ่มแท็ก...",Cancel:"ยกเลิก",Close:"ปิด",Edit:"แก้ไข",Delete:"ลบ",Ok:"ตกลง"},ehe={"Add a comment...":"Yorum ekle...","Add a reply...":"Cevap ekle...","Add tag...":"Tag Ekle...",Cancel:"İptal",Close:"Kapat",Edit:"Düzenle",Delete:"Sil",Ok:"Tamam"},the={"Add a comment...":"تبصرہ کریں","Add a reply...":"جواب دیں","Add tag...":"ٹیگ لگائیں",Cancel:"منسوخ کریں",Close:"بند کریں",Edit:"ترمیم کریں",Delete:"ہٹائیں",Ok:"ٹھیک ہے"},nhe={"Add a comment...":"添加注释...","Add a reply...":"添加回复...","Add tag...":"标签...",Cancel:"取消",Close:"关闭",Edit:"编辑",Delete:"删除",Ok:"确认"},ihe={"Add a comment...":"添加评论...","Add a reply...":"添加回复...","Add tag...":"添加标签...",Cancel:"取消",Close:"关闭",Edit:"编辑",Delete:"删除",Ok:"确认"},rhe={"Add a comment...":"添加評論...","Add a reply...":"添加回覆...","Add tag...":"添加標籤...",Cancel:"取消",Close:"關閉",Edit:"編輯",Delete:"刪除",Ok:"確認"},tF={};Object.defineProperty(tF,"__esModule",{value:!0});var aE=[["ثانية","ثانيتين","%s ثوان","%s ثانية"],["دقيقة","دقيقتين","%s دقائق","%s دقيقة"],["ساعة","ساعتين","%s ساعات","%s ساعة"],["يوم","يومين","%s أيام","%s يوماً"],["أسبوع","أسبوعين","%s أسابيع","%s أسبوعاً"],["شهر","شهرين","%s أشهر","%s شهراً"],["عام","عامين","%s أعوام","%s عاماً"]];function she(l,p){return p<3?aE[l][p-1]:p>=3&&p<=10?aE[l][2]:aE[l][3]}function ohe(l,p){if(p===0)return["منذ لحظات","بعد لحظات"];var a=she(Math.floor(p/2),l);return["منذ "+a,"بعد "+a]}var ahe=tF.default=ohe,nF={};Object.defineProperty(nF,"__esModule",{value:!0});function lhe(l,p){var a=0,c=p==1||p==3||p==5||p==7||p==9||p==11||p==13;return c&&l>=5&&(a=1),[[["právě teď","právě teď"]],[["před %s vteřinami","za %s vteřiny"],["před %s vteřinami","za %s vteřin"]],[["před minutou","za minutu"]],[["před %s minutami","za %s minuty"],["před %s minutami","za %s minut"]],[["před hodinou","za hodinu"]],[["před %s hodinami","za %s hodiny"],["před %s hodinami","za %s hodin"]],[["včera","zítra"]],[["před %s dny","za %s dny"],["před %s dny","za %s dnů"]],[["minulý týden","příští týden"]],[["před %s týdny","za %s týdny"],["před %s týdny","za %s týdnů"]],[["minulý měsíc","přístí měsíc"]],[["před %s měsíci","za %s měsíce"],["před %s měsíci","za %s měsíců"]],[["před rokem","přístí rok"]],[["před %s lety","za %s roky"],["před %s lety","za %s let"]]][p][a]}var uhe=nF.default=lhe,iF={};Object.defineProperty(iF,"__esModule",{value:!0});function che(l,p){return[["gerade eben","vor einer Weile"],["vor %s Sekunden","in %s Sekunden"],["vor 1 Minute","in 1 Minute"],["vor %s Minuten","in %s Minuten"],["vor 1 Stunde","in 1 Stunde"],["vor %s Stunden","in %s Stunden"],["vor 1 Tag","in 1 Tag"],["vor %s Tagen","in %s Tagen"],["vor 1 Woche","in 1 Woche"],["vor %s Wochen","in %s Wochen"],["vor 1 Monat","in 1 Monat"],["vor %s Monaten","in %s Monaten"],["vor 1 Jahr","in 1 Jahr"],["vor %s Jahren","in %s Jahren"]][p]}var dhe=iF.default=che,rF={};Object.defineProperty(rF,"__esModule",{value:!0});function hhe(l,p){return[["μόλις τώρα","σε λίγο"],["%s δευτερόλεπτα πριν","σε %s δευτερόλεπτα"],["1 λεπτό πριν","σε 1 λεπτό"],["%s λεπτά πριν","σε %s λεπτά"],["1 ώρα πριν","σε 1 ώρα"],["%s ώρες πριν","σε %s ώρες"],["1 μέρα πριν","σε 1 μέρα"],["%s μέρες πριν","σε %s μέρες"],["1 εβδομάδα πριν","σε 1 εβδομάδα"],["%s εβδομάδες πριν","σε %s εβδομάδες"],["1 μήνα πριν","σε 1 μήνα"],["%s μήνες πριν","σε %s μήνες"],["1 χρόνο πριν","σε 1 χρόνο"],["%s χρόνια πριν","σε %s χρόνια"]][p]}var phe=rF.default=hhe,sF={};Object.defineProperty(sF,"__esModule",{value:!0});function fhe(l,p){return[["justo ahora","en un rato"],["hace %s segundos","en %s segundos"],["hace 1 minuto","en 1 minuto"],["hace %s minutos","en %s minutos"],["hace 1 hora","en 1 hora"],["hace %s horas","en %s horas"],["hace 1 día","en 1 día"],["hace %s días","en %s días"],["hace 1 semana","en 1 semana"],["hace %s semanas","en %s semanas"],["hace 1 mes","en 1 mes"],["hace %s meses","en %s meses"],["hace 1 año","en 1 año"],["hace %s años","en %s años"]][p]}var mhe=sF.default=fhe,oF={};Object.defineProperty(oF,"__esModule",{value:!0});function ghe(l,p){return[["juuri äsken","juuri nyt"],["%s sekuntia sitten","%s sekunnin päästä"],["minuutti sitten","minuutin päästä"],["%s minuuttia sitten","%s minuutin päästä"],["tunti sitten","tunnin päästä"],["%s tuntia sitten","%s tunnin päästä"],["päivä sitten","päivän päästä"],["%s päivää sitten","%s päivän päästä"],["viikko sitten","viikon päästä"],["%s viikkoa sitten","%s viikon päästä"],["kuukausi sitten","kuukauden päästä"],["%s kuukautta sitten","%s kuukauden päästä"],["vuosi sitten","vuoden päästä"],["%s vuotta sitten","%s vuoden päästä"]][p]}var yhe=oF.default=ghe,aF={};Object.defineProperty(aF,"__esModule",{value:!0});function vhe(l,p){return[["à l'instant","dans un instant"],["il y a %s secondes","dans %s secondes"],["il y a 1 minute","dans 1 minute"],["il y a %s minutes","dans %s minutes"],["il y a 1 heure","dans 1 heure"],["il y a %s heures","dans %s heures"],["il y a 1 jour","dans 1 jour"],["il y a %s jours","dans %s jours"],["il y a 1 semaine","dans 1 semaine"],["il y a %s semaines","dans %s semaines"],["il y a 1 mois","dans 1 mois"],["il y a %s mois","dans %s mois"],["il y a 1 an","dans 1 an"],["il y a %s ans","dans %s ans"]][p]}var bhe=aF.default=vhe,lF={};Object.defineProperty(lF,"__esModule",{value:!0});function whe(l,p){return[["xusto agora","daquí a un pouco"],["hai %s segundos","en %s segundos"],["hai 1 minuto","nun minuto"],["hai %s minutos","en %s minutos"],["hai 1 hora","nunha hora"],["hai %s horas","en %s horas"],["hai 1 día","nun día"],["hai %s días","en %s días"],["hai 1 semana","nunha semana"],["hai %s semanas","en %s semanas"],["hai 1 mes","nun mes"],["hai %s meses","en %s meses"],["hai 1 ano","nun ano"],["hai %s anos","en %s anos"]][p]}var _he=lF.default=whe,uF={};Object.defineProperty(uF,"__esModule",{value:!0});function She(l,p){return[["अभी","कुछ समय"],["%s सेकंड पहले","%s सेकंड में"],["1 मिनट पहले","1 मिनट में"],["%s मिनट पहले","%s मिनट में"],["1 घंटे पहले","1 घंटे में"],["%s घंटे पहले","%s घंटे में"],["1 दिन पहले","1 दिन में"],["%s दिन पहले","%s दिनों में"],["1 सप्ताह पहले","1 सप्ताह में"],["%s हफ्ते पहले","%s हफ्तों में"],["1 महीने पहले","1 महीने में"],["%s महीने पहले","%s महीनों में"],["1 साल पहले","1 साल में"],["%s साल पहले","%s साल में"]][p]}var The=uF.default=She,cF={};Object.defineProperty(cF,"__esModule",{value:!0});function Ehe(l,p){return[["poco fa","fra poco"],["%s secondi fa","fra %s secondi"],["un minuto fa","fra un minuto"],["%s minuti fa","fra %s minuti"],["un'ora fa","fra un'ora"],["%s ore fa","fra %s ore"],["un giorno fa","fra un giorno"],["%s giorni fa","fra %s giorni"],["una settimana fa","fra una settimana"],["%s settimane fa","fra %s settimane"],["un mese fa","fra un mese"],["%s mesi fa","fra %s mesi"],["un anno fa","fra un anno"],["%s anni fa","fra %s anni"]][p]}var xhe=cF.default=Ehe,dF={};Object.defineProperty(dF,"__esModule",{value:!0});function Che(l,p){return[["すこし前","すぐに"],["%s秒前","%s秒以内"],["1分前","1分以内"],["%s分前","%s分以内"],["1時間前","1時間以内"],["%s時間前","%s時間以内"],["1日前","1日以内"],["%s日前","%s日以内"],["1週間前","1週間以内"],["%s週間前","%s週間以内"],["1ヶ月前","1ヶ月以内"],["%sヶ月前","%sヶ月以内"],["1年前","1年以内"],["%s年前","%s年以内"]][p]}var Ahe=dF.default=Che,hF={};Object.defineProperty(hF,"__esModule",{value:!0});function khe(l,p){return[["방금","곧"],["%s초 전","%s초 후"],["1분 전","1분 후"],["%s분 전","%s분 후"],["1시간 전","1시간 후"],["%s시간 전","%s시간 후"],["1일 전","1일 후"],["%s일 전","%s일 후"],["1주일 전","1주일 후"],["%s주일 전","%s주일 후"],["1개월 전","1개월 후"],["%s개월 전","%s개월 후"],["1년 전","1년 후"],["%s년 전","%s년 후"]][p]}var Phe=hF.default=khe,pF={};Object.defineProperty(pF,"__esModule",{value:!0});function Dhe(l,p){return[["recent","binnenkort"],["%s seconden geleden","binnen %s seconden"],["1 minuut geleden","binnen 1 minuut"],["%s minuten geleden","binnen %s minuten"],["1 uur geleden","binnen 1 uur"],["%s uur geleden","binnen %s uur"],["1 dag geleden","binnen 1 dag"],["%s dagen geleden","binnen %s dagen"],["1 week geleden","binnen 1 week"],["%s weken geleden","binnen %s weken"],["1 maand geleden","binnen 1 maand"],["%s maanden geleden","binnen %s maanden"],["1 jaar geleden","binnen 1 jaar"],["%s jaar geleden","binnen %s jaar"]][p]}var Ihe=pF.default=Dhe,fF={};Object.defineProperty(fF,"__esModule",{value:!0});function Ohe(l,p){return[["agora mesmo","agora"],["há %s segundos","em %s segundos"],["há um minuto","em um minuto"],["há %s minutos","em %s minutos"],["há uma hora","em uma hora"],["há %s horas","em %s horas"],["há um dia","em um dia"],["há %s dias","em %s dias"],["há uma semana","em uma semana"],["há %s semanas","em %s semanas"],["há um mês","em um mês"],["há %s meses","em %s meses"],["há um ano","em um ano"],["há %s anos","em %s anos"]][p]}var Rhe=fF.default=Ohe,mF={};Object.defineProperty(mF,"__esModule",{value:!0});function Ah(l,p,a,c,f){var m=f%10,v=c;return f===1?v=l:m===1&&f>20?v=p:m>1&&m<5&&(f>20||f<10)&&(v=a),v}var gF=Ah.bind(null,"секунду","%s секунду","%s секунды","%s секунд"),yF=Ah.bind(null,"минуту","%s минуту","%s минуты","%s минут"),vF=Ah.bind(null,"час","%s час","%s часа","%s часов"),bF=Ah.bind(null,"день","%s день","%s дня","%s дней"),wF=Ah.bind(null,"неделю","%s неделю","%s недели","%s недель"),_F=Ah.bind(null,"месяц","%s месяц","%s месяца","%s месяцев"),SF=Ah.bind(null,"год","%s год","%s года","%s лет");function Lhe(l,p){switch(p){case 0:return["только что","через несколько секунд"];case 1:return[gF(l)+" назад","через "+gF(l)];case 2:case 3:return[yF(l)+" назад","через "+yF(l)];case 4:case 5:return[vF(l)+" назад","через "+vF(l)];case 6:return["вчера","завтра"];case 7:return[bF(l)+" назад","через "+bF(l)];case 8:case 9:return[wF(l)+" назад","через "+wF(l)];case 10:case 11:return[_F(l)+" назад","через "+_F(l)];case 12:case 13:return[SF(l)+" назад","через "+SF(l)];default:return["",""]}}var Mhe=mF.default=Lhe,TF={};Object.defineProperty(TF,"__esModule",{value:!0});function Nhe(l,p){return[["just nu","om en stund"],["%s sekunder sedan","om %s sekunder"],["1 minut sedan","om 1 minut"],["%s minuter sedan","om %s minuter"],["1 timme sedan","om 1 timme"],["%s timmar sedan","om %s timmar"],["1 dag sedan","om 1 dag"],["%s dagar sedan","om %s dagar"],["1 vecka sedan","om 1 vecka"],["%s veckor sedan","om %s veckor"],["1 månad sedan","om 1 månad"],["%s månader sedan","om %s månader"],["1 år sedan","om 1 år"],["%s år sedan","om %s år"]][p]}var Fhe=TF.default=Nhe,EF={};Object.defineProperty(EF,"__esModule",{value:!0});function Bhe(l,p){return[["เมื่อสักครู่นี้","อีกสักครู่"],["%s วินาทีที่แล้ว","ใน %s วินาที"],["1 นาทีที่แล้ว","ใน 1 นาที"],["%s นาทีที่แล้ว","ใน %s นาที"],["1 ชั่วโมงที่แล้ว","ใน 1 ชั่วโมง"],["%s ชั่วโมงที่แล้ว","ใน %s ชั่วโมง"],["1 วันที่แล้ว","ใน 1 วัน"],["%s วันที่แล้ว","ใน %s วัน"],["1 อาทิตย์ที่แล้ว","ใน 1 อาทิตย์"],["%s อาทิตย์ที่แล้ว","ใน %s อาทิตย์"],["1 เดือนที่แล้ว","ใน 1 เดือน"],["%s เดือนที่แล้ว","ใน %s เดือน"],["1 ปีที่แล้ว","ใน 1 ปี"],["%s ปีที่แล้ว","ใน %s ปี"]][p]}var Uhe=EF.default=Bhe,xF={};Object.defineProperty(xF,"__esModule",{value:!0});function Hhe(l,p){return[["az önce","şimdi"],["%s saniye önce","%s saniye içinde"],["1 dakika önce","1 dakika içinde"],["%s dakika önce","%s dakika içinde"],["1 saat önce","1 saat içinde"],["%s saat önce","%s saat içinde"],["1 gün önce","1 gün içinde"],["%s gün önce","%s gün içinde"],["1 hafta önce","1 hafta içinde"],["%s hafta önce","%s hafta içinde"],["1 ay önce","1 ay içinde"],["%s ay önce","%s ay içinde"],["1 yıl önce","1 yıl içinde"],["%s yıl önce","%s yıl içinde"]][p]}var zhe=xF.default=Hhe,CF={};Object.defineProperty(CF,"__esModule",{value:!0});var jhe=["秒","分钟","小时","天","周","个月","年"];function Vhe(l,p){if(p===0)return["刚刚","片刻后"];var a=jhe[~~(p/2)];return[l+" "+a+"前",l+" "+a+"后"]}var AF=CF.default=Vhe,kF={};Object.defineProperty(kF,"__esModule",{value:!0});function Whe(l,p){return[["剛剛","片刻後"],["%s 秒前","%s 秒後"],["1 分鐘前","1 分鐘後"],["%s 分鐘前","%s 分鐘後"],["1 小時前","1 小時後"],["%s 小時前","%s 小時後"],["1 天前","1 天後"],["%s 天前","%s 天後"],["1 週前","1 週後"],["%s 週前","%s 週後"],["1 個月前","1 個月後"],["%s 個月前","%s 個月後"],["1 年前","1 年後"],["%s 年前","%s 年後"]][p]}var qhe=kF.default=Whe;const pf={ar:Fde,cs:Bde,de:Ude,el:Hde,es:zde,fi:jde,fr:Vde,gl:Wde,hi:qde,it:Gde,ja:Kde,ko:Yde,nl:Xde,pt:Zde,ru:Qde,sv:Jde,th:$de,tr:ehe,ur:the,zh:nhe,"zh-CN":ihe,"zh-TW":rhe},Ghe=Object.keys(pf),kh=new Nde({allowMissing:!0});kh.init=(l,p)=>{kh.clear(),l&&(kh.locale(l),kh.extend(pf[l])),p&&kh.extend(p)},Zi("ar",ahe),Zi("cs",uhe),Zi("de",dhe),Zi("el",phe),Zi("es",mhe),Zi("fi",yhe),Zi("fr",bhe),Zi("gl",_he),Zi("hi",The),Zi("it",xhe),Zi("ja",Ahe),Zi("ko",Phe),Zi("nl",Ihe),Zi("pt",Rhe),Zi("ru",Mhe),Zi("sv",Fhe),Zi("th",Uhe),Zi("tr",zhe),Zi("zh",AF),Zi("zh-CN",AF),Zi("zh-TW",qhe),kh.registerMessages=(l,p)=>{pf[l]?pf[l]={...pf[l],...p}:pf[l]=p};var ja=kh,Khe=l=>{const p=rt();return q(p,()=>l.onClickOutside()),yt.createElement("ul",{ref:p,className:"r6o-comment-dropdown-menu"},yt.createElement("li",{onClick:l.onEdit},ja.t("Edit")),yt.createElement("li",{onClick:l.onDelete},ja.t("Delete")))},PF={},lE={},uE={exports:{}};/*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */(function(l,p){(function(a,c){c(l,p)})(hs,function(a,c){var f=typeof Map=="function"?new Map:function(){var x=[],U=[];return{has:function(V){return x.indexOf(V)>-1},get:function(V){return U[x.indexOf(V)]},set:function(V,ie){x.indexOf(V)===-1&&(x.push(V),U.push(ie))},delete:function(V){var ie=x.indexOf(V);ie>-1&&(x.splice(ie,1),U.splice(ie,1))}}}(),m=function(x){return new Event(x,{bubbles:!0})};try{new Event("test")}catch{m=function(x){var U=document.createEvent("Event");return U.initEvent(x,!0,!1),U}}function v(x){if(!x||!x.nodeName||x.nodeName!=="TEXTAREA"||f.has(x))return;var U=null,V=null,ie=null;function de(){var Be=window.getComputedStyle(x,null);Be.resize==="vertical"?x.style.resize="none":Be.resize==="both"&&(x.style.resize="horizontal"),Be.boxSizing==="content-box"?U=-(parseFloat(Be.paddingTop)+parseFloat(Be.paddingBottom)):U=parseFloat(Be.borderTopWidth)+parseFloat(Be.borderBottomWidth),isNaN(U)&&(U=0),W()}function Ie(Be){{var tt=x.style.width;x.style.width="0px",x.offsetWidth,x.style.width=tt}x.style.overflowY=Be}function ke(Be){for(var tt=[];Be&&Be.parentNode&&Be.parentNode instanceof Element;)Be.parentNode.scrollTop&&tt.push({node:Be.parentNode,scrollTop:Be.parentNode.scrollTop}),Be=Be.parentNode;return tt}function Ve(){if(x.scrollHeight!==0){var Be=ke(x),tt=document.documentElement&&document.documentElement.scrollTop;x.style.height="",x.style.height=x.scrollHeight+U+"px",V=x.clientWidth,Be.forEach(function($e){$e.node.scrollTop=$e.scrollTop}),tt&&(document.documentElement.scrollTop=tt)}}function W(){Ve();var Be=Math.round(parseFloat(x.style.height)),tt=window.getComputedStyle(x,null),$e=tt.boxSizing==="content-box"?Math.round(parseFloat(tt.height)):x.offsetHeight;if($e"u"||typeof window.getComputedStyle!="function"?(E=function(x){return x},E.destroy=function(x){return x},E.update=function(x){return x}):(E=function(x,U){return x&&Array.prototype.forEach.call(x.length?x:[x],function(V){return v(V)}),x},E.destroy=function(x){return x&&Array.prototype.forEach.call(x.length?x:[x],_),x},E.update=function(x){return x&&Array.prototype.forEach.call(x.length?x:[x],S),x}),c.default=E,a.exports=c.default})})(uE,uE.exports);var Yhe=function(l,p,a){return a=window.getComputedStyle,(a?a(l):l.currentStyle)[p.replace(/-(\w)/gi,function(c,f){return f.toUpperCase()})]},Xhe=Yhe,cE=Xhe;function Zhe(l){var p=cE(l,"line-height"),a=parseFloat(p,10);if(p===a+""){var c=l.style.lineHeight;l.style.lineHeight=p+"em",p=cE(l,"line-height"),a=parseFloat(p,10),c?l.style.lineHeight=c:delete l.style.lineHeight}if(p.indexOf("pt")!==-1?(a*=4,a/=3):p.indexOf("mm")!==-1?(a*=96,a/=25.4):p.indexOf("cm")!==-1?(a*=96,a/=2.54):p.indexOf("in")!==-1?a*=96:p.indexOf("pc")!==-1&&(a*=16),a=Math.round(a),p==="normal"){var f=l.nodeName,m=document.createElement(f);m.innerHTML=" ",f.toUpperCase()==="TEXTAREA"&&m.setAttribute("rows","1");var v=cE(l,"font-size");m.style.fontSize=v,m.style.padding="0px",m.style.border="0px";var _=document.body;_.appendChild(m);var S=m.offsetHeight;a=S,_.removeChild(m)}return a}var Qhe=Zhe,Jhe=hs&&hs.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var c in a)a.hasOwnProperty(c)&&(p[c]=a[c])};return function(p,a){l(p,a);function c(){this.constructor=p}p.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)}}(),dE=hs&&hs.__assign||Object.assign||function(l){for(var p,a=1,c=arguments.length;a{a.which===13&&a.ctrlKey&&this.props.onSaveAndClose()}),r(this,"onKeyUp",a=>{a.which===46&&a.stopPropagation()}),this.element=$()}componentDidMount(){this.props.focus&&this.element.current&&this.element.current.focus({preventScroll:!0})}render(){return yt.createElement(ipe,{ref:this.element,className:"r6o-editable-text",value:this.props.content,placeholder:this.props.placeholder||ja.t("Add a comment..."),disabled:!this.props.editable,onChange:this.props.onChange,onKeyUp:this.onKeyUp,onKeyDown:this.onKeyDown})}}function Fn(){return Fn=Object.assign?Object.assign.bind():function(l){for(var p=1;p0?so(mf,--wa):0,ff--,ys===10&&(ff=1,o0--),ys}function Va(){return ys=wa2||Mg(ys)>3?"":" "}function ype(l,p){for(;--p&&Va()&&!(ys<48||ys>102||ys>57&&ys<65||ys>70&&ys<97););return Lg(l,l0()+(p<6&&Ku()==32&&Va()==32))}function gE(l){for(;Va();)switch(ys){case l:return wa;case 34:case 39:l!==34&&l!==39&&gE(ys);break;case 40:l===41&&gE(l);break;case 92:Va();break}return wa}function vpe(l,p){for(;Va()&&l+ys!==57&&!(l+ys===84&&Ku()===47););return"/*"+Lg(p,wa-1)+"*"+r0(l===47?l:Va())}function bpe(l){for(;!Mg(Ku());)Va();return Lg(l,wa)}function wpe(l){return FF(c0("",null,null,null,[""],l=NF(l),0,[0],l))}function c0(l,p,a,c,f,m,v,_,S){for(var E=0,x=0,U=v,V=0,ie=0,de=0,Ie=1,ke=1,Ve=1,W=0,Te="",je=f,Be=m,tt=c,$e=Te;ke;)switch(de=W,W=Va()){case 40:if(de!=108&&so($e,U-1)==58){fE($e+=qi(u0(W),"&","&\f"),"&\f")!=-1&&(Ve=-1);break}case 34:case 39:case 91:$e+=u0(W);break;case 9:case 10:case 13:case 32:$e+=gpe(de);break;case 92:$e+=ype(l0()-1,7);continue;case 47:switch(Ku()){case 42:case 47:s0(_pe(vpe(Va(),l0()),p,a),S);break;default:$e+="/"}break;case 123*Ie:_[E++]=Gu($e)*Ve;case 125*Ie:case 59:case 0:switch(W){case 0:case 125:ke=0;case 59+x:Ve==-1&&($e=qi($e,/\f/g,"")),ie>0&&Gu($e)-U&&s0(ie>32?UF($e+";",c,a,U-1):UF(qi($e," ","")+";",c,a,U-2),S);break;case 59:$e+=";";default:if(s0(tt=BF($e,p,a,E,x,f,_,Te,je=[],Be=[],U),m),W===123)if(x===0)c0($e,p,tt,tt,je,m,U,_,Be);else switch(V===99&&so($e,3)===110?100:V){case 100:case 108:case 109:case 115:c0(l,tt,tt,c&&s0(BF(l,tt,tt,0,0,f,_,Te,f,je=[],U),Be),f,Be,U,_,c?je:Be);break;default:c0($e,tt,tt,tt,[""],Be,0,_,Be)}}E=x=ie=0,Ie=Ve=1,Te=$e="",U=v;break;case 58:U=1+Gu($e),ie=de;default:if(Ie<1){if(W==123)--Ie;else if(W==125&&Ie++==0&&mpe()==125)continue}switch($e+=r0(W),W*Ie){case 38:Ve=x>0?1:($e+="\f",-1);break;case 44:_[E++]=(Gu($e)-1)*Ve,Ve=1;break;case 64:Ku()===45&&($e+=u0(Va())),V=Ku(),x=U=Gu(Te=$e+=bpe(l0())),W++;break;case 45:de===45&&Gu($e)==2&&(Ie=0)}}return m}function BF(l,p,a,c,f,m,v,_,S,E,x){for(var U=f-1,V=f===0?m:[""],ie=mE(V),de=0,Ie=0,ke=0;de0?V[Ve]+" "+W:qi(W,/&\f/g,V[Ve])))&&(S[ke++]=Te);return a0(l,p,a,f===0?hE:_,S,E,x)}function _pe(l,p,a){return a0(l,p,a,OF,r0(fpe()),Og(l,2,-2),0)}function UF(l,p,a,c){return a0(l,p,a,pE,Og(l,0,c),Og(l,c+1,-1),c)}function gf(l,p){for(var a="",c=mE(l),f=0;f6)switch(so(l,p+1)){case 109:if(so(l,p+4)!==45)break;case 102:return qi(l,/(.+:)(.+)-([^]+)/,"$1"+Wi+"$2-$3$1"+i0+(so(l,p+3)==108?"$3":"$2-$3"))+l;case 115:return~fE(l,"stretch")?zF(qi(l,"stretch","fill-available"),p)+l:l}break;case 4949:if(so(l,p+1)!==115)break;case 6444:switch(so(l,Gu(l)-3-(~fE(l,"!important")&&10))){case 107:return qi(l,":",":"+Wi)+l;case 101:return qi(l,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Wi+(so(l,14)===45?"inline-":"")+"box$3$1"+Wi+"$2$3$1"+Po+"$2box$3")+l}break;case 5936:switch(so(l,p+11)){case 114:return Wi+l+Po+qi(l,/[svh]\w+-[tblr]{2}/,"tb")+l;case 108:return Wi+l+Po+qi(l,/[svh]\w+-[tblr]{2}/,"tb-rl")+l;case 45:return Wi+l+Po+qi(l,/[svh]\w+-[tblr]{2}/,"lr")+l}return Wi+l+Po+l+l}return l}var Ipe=function(l,p,a,c){if(l.length>-1&&!l.return)switch(l.type){case pE:l.return=zF(l.value,l.length);break;case RF:return gf([Rg(l,{value:qi(l.value,"@","@"+Wi)})],c);case hE:if(l.length)return ppe(l.props,function(f){switch(hpe(f,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gf([Rg(l,{props:[qi(f,/:(read-\w+)/,":"+i0+"$1")]})],c);case"::placeholder":return gf([Rg(l,{props:[qi(f,/:(plac\w+)/,":"+Wi+"input-$1")]}),Rg(l,{props:[qi(f,/:(plac\w+)/,":"+i0+"$1")]}),Rg(l,{props:[qi(f,/:(plac\w+)/,Po+"input-$1")]})],c)}return""})}},Ope=[Ipe],Rpe=function(l){var p=l.key;if(p==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(de){var Ie=de.getAttribute("data-emotion");Ie.indexOf(" ")!==-1&&(document.head.appendChild(de),de.setAttribute("data-s",""))})}var c=l.stylisPlugins||Ope,f={},m,v=[];m=l.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+p+' "]'),function(de){for(var Ie=de.getAttribute("data-emotion").split(" "),ke=1;ke=4;++c,f-=4)a=l.charCodeAt(c)&255|(l.charCodeAt(++c)&255)<<8|(l.charCodeAt(++c)&255)<<16|(l.charCodeAt(++c)&255)<<24,a=(a&65535)*1540483477+((a>>>16)*59797<<16),a^=a>>>24,p=(a&65535)*1540483477+((a>>>16)*59797<<16)^(p&65535)*1540483477+((p>>>16)*59797<<16);switch(f){case 3:p^=(l.charCodeAt(c+2)&255)<<16;case 2:p^=(l.charCodeAt(c+1)&255)<<8;case 1:p^=l.charCodeAt(c)&255,p=(p&65535)*1540483477+((p>>>16)*59797<<16)}return p^=p>>>13,p=(p&65535)*1540483477+((p>>>16)*59797<<16),((p^p>>>15)>>>0).toString(36)}var Vpe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wpe=/[A-Z]|^ms/g,qpe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,YF=function(l){return l.charCodeAt(1)===45},XF=function(l){return l!=null&&typeof l!="boolean"},_E=xpe(function(l){return YF(l)?l:l.replace(Wpe,"-$&").toLowerCase()}),ZF=function(l,p){switch(l){case"animation":case"animationName":if(typeof p=="string")return p.replace(qpe,function(a,c,f){return Yu={name:c,styles:f,next:Yu},c})}return Vpe[l]!==1&&!YF(l)&&typeof p=="number"&&p!==0?p+"px":p};function Ng(l,p,a){if(a==null)return"";if(a.__emotion_styles!==void 0)return a;switch(typeof a){case"boolean":return"";case"object":{if(a.anim===1)return Yu={name:a.name,styles:a.styles,next:Yu},a.name;if(a.styles!==void 0){var c=a.next;if(c!==void 0)for(;c!==void 0;)Yu={name:c.name,styles:c.styles,next:Yu},c=c.next;var f=a.styles+";";return f}return Gpe(l,p,a)}case"function":{if(l!==void 0){var m=Yu,v=a(l);return Yu=m,Ng(l,p,v)}break}}if(p==null)return a;var _=p[a];return _!==void 0?_:a}function Gpe(l,p,a){var c="";if(Array.isArray(a))for(var f=0;f=0)&&(a[f]=l[f]);return a}function yf(l,p){if(l==null)return{};var a=CE(l,p),c,f;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);for(f=0;f=0)&&(!Object.prototype.propertyIsEnumerable.call(l,c)||(a[c]=l[c]))}return a}function vf(l){return vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},vf(l)}var nB={};Object.defineProperty(nB,"__esModule",{value:!0});var AE=Object.assign||function(l){for(var p=1;p=0||!Object.prototype.hasOwnProperty.call(l,c)||(a[c]=l[c]);return a}function afe(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}function lfe(l,p){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:l}function ufe(l,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);l.prototype=Object.create(p&&p.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(l,p):l.__proto__=p)}var oB={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},cfe=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],dfe=function(l){return cfe.forEach(function(p){return delete l[p]}),l},aB=function(l,p){p.style.fontSize=l.fontSize,p.style.fontFamily=l.fontFamily,p.style.fontWeight=l.fontWeight,p.style.fontStyle=l.fontStyle,p.style.letterSpacing=l.letterSpacing,p.style.textTransform=l.textTransform},lB=typeof window<"u"&&window.navigator?/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent):!1,uB=function(){return lB?"_"+Math.random().toString(36).substr(2,12):void 0},kE=function(l){ufe(p,l),iB(p,null,[{key:"getDerivedStateFromProps",value:function(a,c){var f=a.id;return f!==c.prevId?{inputId:f||uB(),prevId:f}:null}}]);function p(a){afe(this,p);var c=lfe(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,a));return c.inputRef=function(f){c.input=f,typeof c.props.inputRef=="function"&&c.props.inputRef(f)},c.placeHolderSizerRef=function(f){c.placeHolderSizer=f},c.sizerRef=function(f){c.sizer=f},c.state={inputWidth:a.minWidth,inputId:a.id||uB(),prevId:a.id},c}return iB(p,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"componentDidUpdate",value:function(a,c){c.inputWidth!==this.state.inputWidth&&typeof this.props.onAutosize=="function"&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(!(!this.mounted||!window.getComputedStyle)){var a=this.input&&window.getComputedStyle(this.input);!a||(aB(a,this.sizer),this.placeHolderSizer&&aB(a,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(!(!this.mounted||!this.sizer||typeof this.sizer.scrollWidth>"u")){var a=void 0;this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?a=Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:a=this.sizer.scrollWidth+2;var c=this.props.type==="number"&&this.props.extraWidth===void 0?16:parseInt(this.props.extraWidth)||0;a+=c,a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function gfe(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function yfe(l,p){return p&&(typeof p=="object"||typeof p=="function")?p:gfe(l)}function C0(l){var p=mfe();return function(){var a=x0(l),c;if(p){var f=x0(this).constructor;c=Reflect.construct(a,arguments,f)}else c=a.apply(this,arguments);return yfe(this,c)}}var A0=function(){};function vfe(l,p){return p?p[0]==="-"?l+p:l+"__"+p:l}function bfe(l,p,a){var c=[a];if(p&&l)for(var f in p)p.hasOwnProperty(f)&&p[f]&&c.push("".concat(vfe(l,f)));return c.filter(function(m){return m}).map(function(m){return String(m).trim()}).join(" ")}var pB=function(l){return Array.isArray(l)?l.filter(Boolean):vf(l)==="object"&&l!==null?[l]:[]},fB=function(l){l.className,l.clearValue,l.cx,l.getStyles,l.getValue,l.hasValue,l.isMulti,l.isRtl,l.options,l.selectOption,l.selectProps,l.setValue,l.theme;var p=yf(l,["className","clearValue","cx","getStyles","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"]);return oo({},p)};function PE(l){return[document.documentElement,document.body,window].indexOf(l)>-1}function mB(l){return PE(l)?window.pageYOffset:l.scrollTop}function k0(l,p){if(PE(l)){window.scrollTo(0,p);return}l.scrollTop=p}function wfe(l){var p=getComputedStyle(l),a=p.position==="absolute",c=/(auto|scroll)/,f=document.documentElement;if(p.position==="fixed")return f;for(var m=l;m=m.parentElement;)if(p=getComputedStyle(m),!(a&&p.position==="static")&&c.test(p.overflow+p.overflowY+p.overflowX))return m;return f}function _fe(l,p,a,c){return a*((l=l/c-1)*l*l+1)+p}function P0(l,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A0,f=mB(l),m=p-f,v=10,_=0;function S(){_+=v;var E=_fe(_,f,m,a);k0(l,E),_a.bottom?k0(l,Math.min(p.offsetTop+p.clientHeight-l.offsetHeight+f,l.scrollHeight)):c.top-f=Ie)return{placement:"bottom",maxHeight:p};if(en>=Ie&&!v)return m&&P0(E,ln,wn),{placement:"bottom",maxHeight:p};if(!v&&en>=c||v&&It>=c){m&&P0(E,ln,wn);var _n=v?It-Be:en-Be;return{placement:"bottom",maxHeight:_n}}if(f==="auto"||v){var Xn=p,Gn=v?$e:Ht;return Gn>=c&&(Xn=Math.min(Gn-Be-S.controlHeight,p)),{placement:"top",maxHeight:Xn}}if(f==="bottom")return m&&k0(E,ln),{placement:"bottom",maxHeight:p};break;case"top":if($e>=Ie)return{placement:"top",maxHeight:p};if(Ht>=Ie&&!v)return m&&P0(E,rn,wn),{placement:"top",maxHeight:p};if(!v&&Ht>=c||v&&$e>=c){var Ti=p;return(!v&&Ht>=c||v&&$e>=c)&&(Ti=v?$e-tt:Ht-tt),m&&P0(E,rn,wn),{placement:"top",maxHeight:Ti}}return{placement:"bottom",maxHeight:p};default:throw new Error('Invalid placement provided "'.concat(f,'".'))}return x}function kfe(l){var p={bottom:"top",top:"bottom"};return l?p[l]:"bottom"}var DE=function(l){return l==="auto"?"bottom":l},Pfe=function(l){var p,a=l.placement,c=l.theme,f=c.borderRadius,m=c.spacing,v=c.colors;return p={label:"menu"},Hc(p,kfe(a),"100%"),Hc(p,"backgroundColor",v.neutral0),Hc(p,"borderRadius",f),Hc(p,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Hc(p,"marginBottom",m.menuGutter),Hc(p,"marginTop",m.menuGutter),Hc(p,"position","absolute"),Hc(p,"width","100%"),Hc(p,"zIndex",1),p},vB=ji({getPortalPlacement:null}),bB=function(l){E0(a,l);var p=C0(a);function a(){var c;_0(this,a);for(var f=arguments.length,m=new Array(f),v=0;vl.length)&&(p=l.length);for(var a=0,c=new Array(p);a-1}};function Nme(l){l.in,l.out,l.onExited,l.appear,l.enter,l.exit;var p=l.innerRef;l.emotion;var a=yf(l,["in","out","onExited","appear","enter","exit","innerRef","emotion"]);return Bn("input",Fn({ref:p},a,{css:xE({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"","")}))}var Fme=function(l){l.preventDefault(),l.stopPropagation()};function Bme(l){var p=l.isEnabled,a=l.onBottomArrive,c=l.onBottomLeave,f=l.onTopArrive,m=l.onTopLeave,v=rt(!1),_=rt(!1),S=rt(0),E=rt(null),x=tn(function(ke,Ve){if(E.current!==null){var W=E.current,Te=W.scrollTop,je=W.scrollHeight,Be=W.clientHeight,tt=E.current,$e=Ve>0,It=je-Be-Te,Ht=!1;It>Ve&&v.current&&(c&&c(ke),v.current=!1),$e&&_.current&&(m&&m(ke),_.current=!1),$e&&Ve>It?(a&&!v.current&&a(ke),tt.scrollTop=je,Ht=!0,v.current=!0):!$e&&-Ve>Te&&(f&&!_.current&&f(ke),tt.scrollTop=0,Ht=!0,_.current=!0),Ht&&Fme(ke)}},[]),U=tn(function(ke){x(ke,ke.deltaY)},[x]),V=tn(function(ke){S.current=ke.changedTouches[0].clientY},[]),ie=tn(function(ke){var Ve=S.current-ke.changedTouches[0].clientY;x(ke,Ve)},[x]),de=tn(function(ke){if(ke){var Ve=Cfe?{passive:!1}:!1;typeof ke.addEventListener=="function"&&ke.addEventListener("wheel",U,Ve),typeof ke.addEventListener=="function"&&ke.addEventListener("touchstart",V,Ve),typeof ke.addEventListener=="function"&&ke.addEventListener("touchmove",ie,Ve)}},[ie,V,U]),Ie=tn(function(ke){!ke||(typeof ke.removeEventListener=="function"&&ke.removeEventListener("wheel",U,!1),typeof ke.removeEventListener=="function"&&ke.removeEventListener("touchstart",V,!1),typeof ke.removeEventListener=="function"&&ke.removeEventListener("touchmove",ie,!1))},[ie,V,U]);return Ue(function(){if(p){var ke=E.current;return de(ke),function(){Ie(ke)}}},[p,de,Ie]),function(ke){E.current=ke}}var MB=["boxSizing","height","overflow","paddingRight","position"],NB={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function FB(l){l.preventDefault()}function BB(l){l.stopPropagation()}function UB(){var l=this.scrollTop,p=this.scrollHeight,a=l+this.offsetHeight;l===0?this.scrollTop=1:a===p&&(this.scrollTop=l-1)}function HB(){return"ontouchstart"in window||navigator.maxTouchPoints}var zB=!!(typeof window<"u"&&window.document&&window.document.createElement),Bg=0,bf={capture:!1,passive:!1};function Ume(l){var p=l.isEnabled,a=l.accountForScrollbars,c=a===void 0?!0:a,f=rt({}),m=rt(null),v=tn(function(S){if(zB){var E=document.body,x=E&&E.style;if(c&&MB.forEach(function(de){var Ie=x&&x[de];f.current[de]=Ie}),c&&Bg<1){var U=parseInt(f.current.paddingRight,10)||0,V=document.body?document.body.clientWidth:0,ie=window.innerWidth-V+U||0;Object.keys(NB).forEach(function(de){var Ie=NB[de];x&&(x[de]=Ie)}),x&&(x.paddingRight="".concat(ie,"px"))}E&&HB()&&(E.addEventListener("touchmove",FB,bf),S&&(S.addEventListener("touchstart",UB,bf),S.addEventListener("touchmove",BB,bf))),Bg+=1}},[]),_=tn(function(S){if(zB){var E=document.body,x=E&&E.style;Bg=Math.max(Bg-1,0),c&&Bg<1&&MB.forEach(function(U){var V=f.current[U];x&&(x[U]=V)}),E&&HB()&&(E.removeEventListener("touchmove",FB,bf),S&&(S.removeEventListener("touchstart",UB,bf),S.removeEventListener("touchmove",BB,bf)))}},[]);return Ue(function(){if(p){var S=m.current;return v(S),function(){_(S)}}},[p,v,_]),function(S){m.current=S}}var Hme=function(){return document.activeElement&&document.activeElement.blur()},zme={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function jme(l){var p=l.children,a=l.lockEnabled,c=l.captureEnabled,f=c===void 0?!0:c,m=l.onBottomArrive,v=l.onBottomLeave,_=l.onTopArrive,S=l.onTopLeave,E=Bme({isEnabled:f,onBottomArrive:m,onBottomLeave:v,onTopArrive:_,onTopLeave:S}),x=Ume({isEnabled:a}),U=function(V){E(V),x(V)};return Bn(yt.Fragment,null,a&&Bn("div",{onClick:Hme,css:zme}),p(U))}var Vme=function(l){return l.label},Wme=function(l){return l.label},qme=function(l){return l.value},Gme=function(l){return!!l.isDisabled},Kme={clearIndicator:Gfe,container:Ffe,control:Jfe,dropdownIndicator:Wfe,group:eme,groupHeading:nme,indicatorsContainer:zfe,indicatorSeparator:Yfe,input:rme,loadingIndicator:Qfe,loadingMessage:Lfe,menu:Pfe,menuList:Ife,menuPortal:Mfe,multiValue:ame,multiValueLabel:lme,multiValueRemove:ume,noOptionsMessage:Rfe,option:pme,placeholder:mme,singleValue:yme,valueContainer:Ufe},Yme={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Xme=4,jB=4,Zme=38,Qme=jB*2,Jme={baseUnit:jB,controlHeight:Zme,menuGutter:Qme},BE={borderRadius:Xme,colors:Yme,spacing:Jme},$me={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:gB(),captureMenuScroll:!gB(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Mme(),formatGroupLabel:Vme,getOptionLabel:Wme,getOptionValue:qme,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Gme,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Efe(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(l){var p=l.count;return"".concat(p," result").concat(p!==1?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};function VB(l,p,a,c){var f=YB(l,p,a),m=XB(l,p,a),v=KB(l,p),_=I0(l,p);return{type:"option",data:p,isDisabled:f,isSelected:m,label:v,value:_,index:c}}function WB(l,p){return l.options.map(function(a,c){if(a.options){var f=a.options.map(function(v,_){return VB(l,v,p,_)}).filter(function(v){return GB(l,v)});return f.length>0?{type:"group",data:a,options:f,index:c}:void 0}var m=VB(l,a,p,c);return GB(l,m)?m:void 0}).filter(function(a){return!!a})}function qB(l){return l.reduce(function(p,a){return a.type==="group"?p.push.apply(p,DB(a.options.map(function(c){return c.data}))):p.push(a.data),p},[])}function ege(l,p){return qB(WB(l,p))}function GB(l,p){var a=l.inputValue,c=a===void 0?"":a,f=p.data,m=p.isSelected,v=p.label,_=p.value;return(!QB(l)||!m)&&ZB(l,{label:v,value:_,data:f},c)}function tge(l,p){var a=l.focusedValue,c=l.selectValue,f=c.indexOf(a);if(f>-1){var m=p.indexOf(a);if(m>-1)return a;if(f-1?a:p[0]}var KB=function(l,p){return l.getOptionLabel(p)},I0=function(l,p){return l.getOptionValue(p)};function YB(l,p,a){return typeof l.isOptionDisabled=="function"?l.isOptionDisabled(p,a):!1}function XB(l,p,a){if(a.indexOf(p)>-1)return!0;if(typeof l.isOptionSelected=="function")return l.isOptionSelected(p,a);var c=I0(l,p);return a.some(function(f){return I0(l,f)===c})}function ZB(l,p,a){return l.filterOption?l.filterOption(p,a):!0}var QB=function(l){var p=l.hideSelectedOptions,a=l.isMulti;return p===void 0?a:p},ige=1,JB=function(l){E0(a,l);var p=C0(a);function a(c){var f;return _0(this,a),f=p.call(this,c),f.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},f.blockOptionHover=!1,f.isComposing=!1,f.commonProps=void 0,f.initialTouchX=0,f.initialTouchY=0,f.instancePrefix="",f.openAfterFocus=!1,f.scrollToFocusedOptionOnUpdate=!1,f.userIsDragging=void 0,f.controlRef=null,f.getControlRef=function(m){f.controlRef=m},f.focusedOptionRef=null,f.getFocusedOptionRef=function(m){f.focusedOptionRef=m},f.menuListRef=null,f.getMenuListRef=function(m){f.menuListRef=m},f.inputRef=null,f.getInputRef=function(m){f.inputRef=m},f.focus=f.focusInput,f.blur=f.blurInput,f.onChange=function(m,v){var _=f.props,S=_.onChange,E=_.name;v.name=E,f.ariaOnChange(m,v),S(m,v)},f.setValue=function(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"set-value",_=arguments.length>2?arguments[2]:void 0,S=f.props,E=S.closeMenuOnSelect,x=S.isMulti;f.onInputChange("",{action:"set-value"}),E&&(f.setState({inputIsHiddenAfterUpdate:!x}),f.onMenuClose()),f.setState({clearFocusValueOnUpdate:!0}),f.onChange(m,{action:v,option:_})},f.selectOption=function(m){var v=f.props,_=v.blurInputOnSelect,S=v.isMulti,E=v.name,x=f.state.selectValue,U=S&&f.isOptionSelected(m,x),V=f.isOptionDisabled(m,x);if(U){var ie=f.getOptionValue(m);f.setValue(x.filter(function(de){return f.getOptionValue(de)!==ie}),"deselect-option",m)}else if(!V)S?f.setValue([].concat(DB(x),[m]),"select-option",m):f.setValue(m,"select-option");else{f.ariaOnChange(m,{action:"select-option",name:E});return}_&&f.blurInput()},f.removeValue=function(m){var v=f.props.isMulti,_=f.state.selectValue,S=f.getOptionValue(m),E=_.filter(function(U){return f.getOptionValue(U)!==S}),x=v?E:E[0]||null;f.onChange(x,{action:"remove-value",removedValue:m}),f.focusInput()},f.clearValue=function(){var m=f.state.selectValue;f.onChange(f.props.isMulti?[]:null,{action:"clear",removedValues:m})},f.popValue=function(){var m=f.props.isMulti,v=f.state.selectValue,_=v[v.length-1],S=v.slice(0,v.length-1),E=m?S:S[0]||null;f.onChange(E,{action:"pop-value",removedValue:_})},f.getValue=function(){return f.state.selectValue},f.cx=function(){for(var m=arguments.length,v=new Array(m),_=0;_x||E>x}},f.onTouchEnd=function(m){f.userIsDragging||(f.controlRef&&!f.controlRef.contains(m.target)&&f.menuListRef&&!f.menuListRef.contains(m.target)&&f.blurInput(),f.initialTouchX=0,f.initialTouchY=0)},f.onControlTouchEnd=function(m){f.userIsDragging||f.onControlMouseDown(m)},f.onClearIndicatorTouchEnd=function(m){f.userIsDragging||f.onClearIndicatorMouseDown(m)},f.onDropdownIndicatorTouchEnd=function(m){f.userIsDragging||f.onDropdownIndicatorMouseDown(m)},f.handleInputChange=function(m){var v=m.currentTarget.value;f.setState({inputIsHiddenAfterUpdate:!1}),f.onInputChange(v,{action:"input-change"}),f.props.menuIsOpen||f.onMenuOpen()},f.onInputFocus=function(m){f.props.onFocus&&f.props.onFocus(m),f.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(f.openAfterFocus||f.props.openMenuOnFocus)&&f.openMenu("first"),f.openAfterFocus=!1},f.onInputBlur=function(m){if(f.menuListRef&&f.menuListRef.contains(document.activeElement)){f.inputRef.focus();return}f.props.onBlur&&f.props.onBlur(m),f.onInputChange("",{action:"input-blur"}),f.onMenuClose(),f.setState({focusedValue:null,isFocused:!1})},f.onOptionHover=function(m){f.blockOptionHover||f.state.focusedOption===m||f.setState({focusedOption:m})},f.shouldHideSelectedOptions=function(){return QB(f.props)},f.onKeyDown=function(m){var v=f.props,_=v.isMulti,S=v.backspaceRemovesValue,E=v.escapeClearsValue,x=v.inputValue,U=v.isClearable,V=v.isDisabled,ie=v.menuIsOpen,de=v.onKeyDown,Ie=v.tabSelectsValue,ke=v.openMenuOnFocus,Ve=f.state,W=Ve.focusedOption,Te=Ve.focusedValue,je=Ve.selectValue;if(!V&&!(typeof de=="function"&&(de(m),m.defaultPrevented))){switch(f.blockOptionHover=!0,m.key){case"ArrowLeft":if(!_||x)return;f.focusValue("previous");break;case"ArrowRight":if(!_||x)return;f.focusValue("next");break;case"Delete":case"Backspace":if(x)return;if(Te)f.removeValue(Te);else{if(!S)return;_?f.popValue():U&&f.clearValue()}break;case"Tab":if(f.isComposing||m.shiftKey||!ie||!Ie||!W||ke&&f.isOptionSelected(W,je))return;f.selectOption(W);break;case"Enter":if(m.keyCode===229)break;if(ie){if(!W||f.isComposing)return;f.selectOption(W);break}return;case"Escape":ie?(f.setState({inputIsHiddenAfterUpdate:!1}),f.onInputChange("",{action:"menu-close"}),f.onMenuClose()):U&&E&&f.clearValue();break;case" ":if(x)return;if(!ie){f.openMenu("first");break}if(!W)return;f.selectOption(W);break;case"ArrowUp":ie?f.focusOption("up"):f.openMenu("last");break;case"ArrowDown":ie?f.focusOption("down"):f.openMenu("first");break;case"PageUp":if(!ie)return;f.focusOption("pageup");break;case"PageDown":if(!ie)return;f.focusOption("pagedown");break;case"Home":if(!ie)return;f.focusOption("first");break;case"End":if(!ie)return;f.focusOption("last");break;default:return}m.preventDefault()}},f.instancePrefix="react-select-"+(f.props.instanceId||++ige),f.state.selectValue=pB(c.value),f}return S0(a,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(c){var f=this.props,m=f.isDisabled,v=f.menuIsOpen,_=this.state.isFocused;(_&&!m&&c.isDisabled||_&&v&&!c.menuIsOpen)&&this.focusInput(),_&&m&&!c.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Sfe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(c,f){this.props.onInputChange(c,f)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(c){var f=this,m=this.state,v=m.selectValue,_=m.isFocused,S=this.buildFocusableOptions(),E=c==="first"?0:S.length-1;if(!this.props.isMulti){var x=S.indexOf(v[0]);x>-1&&(E=x)}this.scrollToFocusedOptionOnUpdate=!(_&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:S[E]},function(){return f.onMenuOpen()})}},{key:"focusValue",value:function(c){var f=this.state,m=f.selectValue,v=f.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var _=m.indexOf(v);v||(_=-1);var S=m.length-1,E=-1;if(m.length){switch(c){case"previous":_===0?E=0:_===-1?E=S:E=_-1;break;case"next":_>-1&&_0&&arguments[0]!==void 0?arguments[0]:"first",f=this.props.pageSize,m=this.state.focusedOption,v=this.getFocusableOptions();if(v.length){var _=0,S=v.indexOf(m);m||(S=-1),c==="up"?_=S>0?S-1:v.length-1:c==="down"?_=(S+1)%v.length:c==="pageup"?(_=S-f,_<0&&(_=0)):c==="pagedown"?(_=S+f,_>v.length-1&&(_=v.length-1)):c==="last"&&(_=v.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:v[_],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(BE):oo(oo({},BE),this.props.theme):BE}},{key:"getCommonProps",value:function(){var c=this.clearValue,f=this.cx,m=this.getStyles,v=this.getValue,_=this.selectOption,S=this.setValue,E=this.props,x=E.isMulti,U=E.isRtl,V=E.options,ie=this.hasValue();return{clearValue:c,cx:f,getStyles:m,getValue:v,hasValue:ie,isMulti:x,isRtl:U,options:V,selectOption:_,selectProps:E,setValue:S,theme:this.getTheme()}}},{key:"hasValue",value:function(){var c=this.state.selectValue;return c.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var c=this.props,f=c.isClearable,m=c.isMulti;return f===void 0?m:f}},{key:"isOptionDisabled",value:function(c,f){return YB(this.props,c,f)}},{key:"isOptionSelected",value:function(c,f){return XB(this.props,c,f)}},{key:"filterOption",value:function(c,f){return ZB(this.props,c,f)}},{key:"formatOptionLabel",value:function(c,f){if(typeof this.props.formatOptionLabel=="function"){var m=this.props.inputValue,v=this.state.selectValue;return this.props.formatOptionLabel(c,{context:f,inputValue:m,selectValue:v})}else return this.getOptionLabel(c)}},{key:"formatGroupLabel",value:function(c){return this.props.formatGroupLabel(c)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var c=this.props,f=c.isDisabled,m=c.isSearchable,v=c.inputId,_=c.inputValue,S=c.tabIndex,E=c.form,x=this.getComponents(),U=x.Input,V=this.state.inputIsHidden,ie=this.commonProps,de=v||this.getElementId("input"),Ie={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};return m?yt.createElement(U,Fn({},ie,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:de,innerRef:this.getInputRef,isDisabled:f,isHidden:V,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:S,form:E,type:"text",value:_},Ie)):yt.createElement(Nme,Fn({id:de,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:A0,onFocus:this.onInputFocus,readOnly:!0,disabled:f,tabIndex:S,form:E,value:""},Ie))}},{key:"renderPlaceholderOrValue",value:function(){var c=this,f=this.getComponents(),m=f.MultiValue,v=f.MultiValueContainer,_=f.MultiValueLabel,S=f.MultiValueRemove,E=f.SingleValue,x=f.Placeholder,U=this.commonProps,V=this.props,ie=V.controlShouldRenderValue,de=V.isDisabled,Ie=V.isMulti,ke=V.inputValue,Ve=V.placeholder,W=this.state,Te=W.selectValue,je=W.focusedValue,Be=W.isFocused;if(!this.hasValue()||!ie)return ke?null:yt.createElement(x,Fn({},U,{key:"placeholder",isDisabled:de,isFocused:Be}),Ve);if(Ie){var tt=Te.map(function(It,Ht){var en=It===je;return yt.createElement(m,Fn({},U,{components:{Container:v,Label:_,Remove:S},isFocused:en,isDisabled:de,key:"".concat(c.getOptionValue(It)).concat(Ht),index:Ht,removeProps:{onClick:function(){return c.removeValue(It)},onTouchEnd:function(){return c.removeValue(It)},onMouseDown:function(ln){ln.preventDefault(),ln.stopPropagation()}},data:It}),c.formatOptionLabel(It,"value"))});return tt}if(ke)return null;var $e=Te[0];return yt.createElement(E,Fn({},U,{data:$e,isDisabled:de}),this.formatOptionLabel($e,"value"))}},{key:"renderClearIndicator",value:function(){var c=this.getComponents(),f=c.ClearIndicator,m=this.commonProps,v=this.props,_=v.isDisabled,S=v.isLoading,E=this.state.isFocused;if(!this.isClearable()||!f||_||!this.hasValue()||S)return null;var x={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return yt.createElement(f,Fn({},m,{innerProps:x,isFocused:E}))}},{key:"renderLoadingIndicator",value:function(){var c=this.getComponents(),f=c.LoadingIndicator,m=this.commonProps,v=this.props,_=v.isDisabled,S=v.isLoading,E=this.state.isFocused;if(!f||!S)return null;var x={"aria-hidden":"true"};return yt.createElement(f,Fn({},m,{innerProps:x,isDisabled:_,isFocused:E}))}},{key:"renderIndicatorSeparator",value:function(){var c=this.getComponents(),f=c.DropdownIndicator,m=c.IndicatorSeparator;if(!f||!m)return null;var v=this.commonProps,_=this.props.isDisabled,S=this.state.isFocused;return yt.createElement(m,Fn({},v,{isDisabled:_,isFocused:S}))}},{key:"renderDropdownIndicator",value:function(){var c=this.getComponents(),f=c.DropdownIndicator;if(!f)return null;var m=this.commonProps,v=this.props.isDisabled,_=this.state.isFocused,S={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return yt.createElement(f,Fn({},m,{innerProps:S,isDisabled:v,isFocused:_}))}},{key:"renderMenu",value:function(){var c=this,f=this.getComponents(),m=f.Group,v=f.GroupHeading,_=f.Menu,S=f.MenuList,E=f.MenuPortal,x=f.LoadingMessage,U=f.NoOptionsMessage,V=f.Option,ie=this.commonProps,de=this.state.focusedOption,Ie=this.props,ke=Ie.captureMenuScroll,Ve=Ie.inputValue,W=Ie.isLoading,Te=Ie.loadingMessage,je=Ie.minMenuHeight,Be=Ie.maxMenuHeight,tt=Ie.menuIsOpen,$e=Ie.menuPlacement,It=Ie.menuPosition,Ht=Ie.menuPortalTarget,en=Ie.menuShouldBlockScroll,ln=Ie.menuShouldScrollIntoView,rn=Ie.noOptionsMessage,wn=Ie.onMenuScrollToTop,_n=Ie.onMenuScrollToBottom;if(!tt)return null;var Xn=function(Ui,Wc){var nu=Ui.type,Do=Ui.data,qa=Ui.isDisabled,Xu=Ui.isSelected,Tl=Ui.label,xf=Ui.value,Cf=de===Do,Rh=qa?void 0:function(){return c.onOptionHover(Do)},Af=qa?void 0:function(){return c.selectOption(Do)},kf="".concat(c.getElementId("option"),"-").concat(Wc),Pf={id:kf,onClick:Af,onMouseMove:Rh,onMouseOver:Rh,tabIndex:-1};return yt.createElement(V,Fn({},ie,{innerProps:Pf,data:Do,isDisabled:qa,isSelected:Xu,key:kf,label:Tl,type:nu,value:xf,isFocused:Cf,innerRef:Cf?c.getFocusedOptionRef:void 0}),c.formatOptionLabel(Ui.data,"menu"))},Gn;if(this.hasOptions())Gn=this.getCategorizedOptions().map(function(Ui){if(Ui.type==="group"){var Wc=Ui.data,nu=Ui.options,Do=Ui.index,qa="".concat(c.getElementId("group"),"-").concat(Do),Xu="".concat(qa,"-heading");return yt.createElement(m,Fn({},ie,{key:qa,data:Wc,options:nu,Heading:v,headingProps:{id:Xu,data:Ui.data},label:c.formatGroupLabel(Ui.data)}),Ui.options.map(function(Tl){return Xn(Tl,"".concat(Do,"-").concat(Tl.index))}))}else if(Ui.type==="option")return Xn(Ui,"".concat(Ui.index))});else if(W){var Ti=Te({inputValue:Ve});if(Ti===null)return null;Gn=yt.createElement(x,ie,Ti)}else{var Mi=rn({inputValue:Ve});if(Mi===null)return null;Gn=yt.createElement(U,ie,Mi)}var yr={minMenuHeight:je,maxMenuHeight:Be,menuPlacement:$e,menuPosition:It,menuShouldScrollIntoView:ln},mn=yt.createElement(bB,Fn({},ie,yr),function(Ui){var Wc=Ui.ref,nu=Ui.placerProps,Do=nu.placement,qa=nu.maxHeight;return yt.createElement(_,Fn({},ie,yr,{innerRef:Wc,innerProps:{onMouseDown:c.onMenuMouseDown,onMouseMove:c.onMenuMouseMove},isLoading:W,placement:Do}),yt.createElement(jme,{captureEnabled:ke,onTopArrive:wn,onBottomArrive:_n,lockEnabled:en},function(Xu){return yt.createElement(S,Fn({},ie,{innerRef:function(Tl){c.getMenuListRef(Tl),Xu(Tl)},isLoading:W,maxHeight:qa,focusedOption:de}),Gn)}))});return Ht||It==="fixed"?yt.createElement(E,Fn({},ie,{appendTo:Ht,controlElement:this.controlRef,menuPlacement:$e,menuPosition:It}),mn):mn}},{key:"renderFormField",value:function(){var c=this,f=this.props,m=f.delimiter,v=f.isDisabled,_=f.isMulti,S=f.name,E=this.state.selectValue;if(!(!S||v))if(_)if(m){var x=E.map(function(ie){return c.getOptionValue(ie)}).join(m);return yt.createElement("input",{name:S,type:"hidden",value:x})}else{var U=E.length>0?E.map(function(ie,de){return yt.createElement("input",{key:"i-".concat(de),name:S,type:"hidden",value:c.getOptionValue(ie)})}):yt.createElement("input",{name:S,type:"hidden"});return yt.createElement("div",null,U)}else{var V=E[0]?this.getOptionValue(E[0]):"";return yt.createElement("input",{name:S,type:"hidden",value:V})}}},{key:"renderLiveRegion",value:function(){var c=this.commonProps,f=this.state,m=f.ariaSelection,v=f.focusedOption,_=f.focusedValue,S=f.isFocused,E=f.selectValue,x=this.getFocusableOptions();return yt.createElement(Ime,Fn({},c,{ariaSelection:m,focusedOption:v,focusedValue:_,isFocused:S,selectValue:E,focusableOptions:x}))}},{key:"render",value:function(){var c=this.getComponents(),f=c.Control,m=c.IndicatorsContainer,v=c.SelectContainer,_=c.ValueContainer,S=this.props,E=S.className,x=S.id,U=S.isDisabled,V=S.menuIsOpen,ie=this.state.isFocused,de=this.commonProps=this.getCommonProps();return yt.createElement(v,Fn({},de,{className:E,innerProps:{id:x,onKeyDown:this.onKeyDown},isDisabled:U,isFocused:ie}),this.renderLiveRegion(),yt.createElement(f,Fn({},de,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:U,isFocused:ie,menuIsOpen:V}),yt.createElement(_,Fn({},de,{isDisabled:U}),this.renderPlaceholderOrValue(),this.renderInput()),yt.createElement(m,Fn({},de,{isDisabled:U}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(c,f){var m=f.prevProps,v=f.clearFocusValueOnUpdate,_=f.inputIsHiddenAfterUpdate,S=c.options,E=c.value,x=c.menuIsOpen,U=c.inputValue,V={};if(m&&(E!==m.value||S!==m.options||x!==m.menuIsOpen||U!==m.inputValue)){var ie=pB(E),de=x?ege(c,ie):[],Ie=v?tge(f,ie):null,ke=nge(f,de);V={selectValue:ie,focusedOption:ke,focusedValue:Ie,clearFocusValueOnUpdate:!1}}var Ve=_!=null&&c!==m?{inputIsHidden:_,inputIsHiddenAfterUpdate:void 0}:{};return oo(oo(oo({},V),Ve),{},{prevProps:c})}}]),a}(he);JB.defaultProps=$me;var rge={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},sge=function(l){var p,a;return a=p=function(c){E0(m,c);var f=C0(m);function m(){var v;_0(this,m);for(var _=arguments.length,S=new Array(_),E=0;E<_;E++)S[E]=arguments[E];return v=f.call.apply(f,[this].concat(S)),v.select=void 0,v.state={inputValue:v.props.inputValue!==void 0?v.props.inputValue:v.props.defaultInputValue,menuIsOpen:v.props.menuIsOpen!==void 0?v.props.menuIsOpen:v.props.defaultMenuIsOpen,value:v.props.value!==void 0?v.props.value:v.props.defaultValue},v.onChange=function(x,U){v.callProp("onChange",x,U),v.setState({value:x})},v.onInputChange=function(x,U){var V=v.callProp("onInputChange",x,U);v.setState({inputValue:V!==void 0?V:x})},v.onMenuOpen=function(){v.callProp("onMenuOpen"),v.setState({menuIsOpen:!0})},v.onMenuClose=function(){v.callProp("onMenuClose"),v.setState({menuIsOpen:!1})},v}return S0(m,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(v){return this.props[v]!==void 0?this.props[v]:this.state[v]}},{key:"callProp",value:function(v){if(typeof this.props[v]=="function"){for(var _,S=arguments.length,E=new Array(S>1?S-1:0),x=1;x{const p=l.content?UE.find(a=>a.value===l.content):null;return yt.createElement("div",{className:"r6o-purposedropdown"},yt.createElement(age,{value:p,onChange:l.onChange,options:UE,isDisabled:!l.editable}))};const lge=l=>yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 940",width:l.width},yt.createElement("metadata",null,"IcoFont Icons"),yt.createElement("title",null,"simple-down"),yt.createElement("glyph",{glyphName:"simple-down",unicode:"",horizAdvX:"1000"}),yt.createElement("path",{fill:"currentColor",d:"M200 392.6l300 300 300-300-85.10000000000002-85.10000000000002-214.89999999999998 214.79999999999995-214.89999999999998-214.89999999999998-85.10000000000002 85.20000000000005z"})),uge=l=>yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"180 150 700 800",width:l.width},yt.createElement("metadata",null,"IcoFont Icons"),yt.createElement("title",null,"close"),yt.createElement("glyph",{glyphName:"close",unicode:"",horizAdvX:"1000"}),yt.createElement("path",{fill:"currentColor",d:"M709.8 206.6c-64.39999999999998 65.50000000000003-128.89999999999998 131.20000000000002-194.19999999999993 197.6-8.600000000000023 8.699999999999989-22.400000000000034 8.800000000000011-31 0-65-66-129.70000000000005-131.8-194.5-197.6-8.600000000000023-8.699999999999989-22.400000000000034-8.599999999999994-30.900000000000034 0.09999999999999432-15.699999999999989 16.200000000000017-31.099999999999994 32.30000000000001-47.099999999999994 48.80000000000001-8.5 8.800000000000011-8.299999999999983 23 0.20000000000001705 31.69999999999999 63.099999999999966 64.19999999999999 127.89999999999998 130.10000000000002 193.59999999999997 197 8.600000000000023 8.699999999999989 8.5 22.80000000000001 0 31.599999999999966-65.19999999999999 66.40000000000009-130.2 132.5-194.7 198.10000000000002-8.5 8.700000000000045-8.5 22.800000000000068 0.20000000000001705 31.399999999999977l47.79999999999998 47.90000000000009c8.600000000000023 8.599999999999909 22.600000000000023 8.599999999999909 31.100000000000023-0.10000000000002274l194.2-197.30000000000007c8.600000000000023-8.699999999999932 22.399999999999977-8.699999999999932 31 0 64.70000000000005 65.80000000000007 129.20000000000005 131.4000000000001 194.20000000000005 197.5 8.599999999999909 8.700000000000045 22.5 8.800000000000068 31 0.10000000000002274 16-16.199999999999932 31.699999999999932-32.19999999999993 47.59999999999991-48.299999999999955 8.600000000000023-8.700000000000045 8.600000000000023-22.899999999999977 0.10000000000002274-31.600000000000023-63.799999999999955-65-128.5-130.89999999999998-194.19999999999993-197.79999999999995-8.600000000000023-8.700000000000045-8.600000000000023-22.900000000000034 0-31.600000000000023 65.19999999999993-66.40000000000003 130.0999999999999-132.5 194.5-198.20000000000005 8.599999999999909-8.699999999999989 8.5-22.799999999999955-0.10000000000002274-31.49999999999997l-47.80000000000007-48.099999999999994c-8.5-8.5-22.399999999999977-8.400000000000006-31 0.29999999999998295z"})),cge=l=>yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",width:l.width},yt.createElement("path",{fill:"currentColor",d:"M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z"}));var dge=l=>{const[p,a]=Ce(!1),[c,f]=Ce(!1),m=U=>{a(!0),f(!1)},v=U=>{l.onDelete(l.body),f(!1)},_=U=>l.onUpdate(l.body,{...l.body,value:U.target.value}),S=U=>l.onUpdate(l.body,{...l.body,purpose:U.value}),E=l.body.modified||l.body.created,x=l.body.creator&&yt.createElement("div",{className:"r6o-lastmodified"},yt.createElement("span",{className:"r6o-lastmodified-by"},l.body.creator.name||l.body.creator.id),l.body.created&&yt.createElement("span",{className:"r6o-lastmodified-at"},yt.createElement(z,{datetime:l.env.toClientTime(E),locale:ja.locale()})));return l.readOnly?yt.createElement("div",{className:"r6o-widget comment"},yt.createElement("div",{className:"r6o-readonly-comment"},l.body.value),x):yt.createElement("div",{className:p?"r6o-widget comment editable":"r6o-widget comment"},yt.createElement(IF,{editable:p,content:l.body.value,onChange:_,onSaveAndClose:l.onSaveAndClose}),!p&&x,l.purposeSelector&&yt.createElement($B,{editable:p,content:l.body.purpose,onChange:S,onSaveAndClose:l.onSaveAndClose}),yt.createElement("div",{className:c?"r6o-icon r6o-arrow-down r6o-menu-open":"r6o-icon r6o-arrow-down",onClick:()=>f(!c)},yt.createElement(lge,{width:12})),c&&yt.createElement(Khe,{onEdit:m,onDelete:v,onClickOutside:()=>f(!1)}))};const hge=UE.map(l=>l.value),e4=(l,p)=>{const a=p?hge.indexOf(l.purpose)>-1:l.purpose=="commenting"||l.purpose=="replying";return l.type==="TextualBody"&&(!Object.prototype.hasOwnProperty.call(l,"purpose")||a)},t4=(l,p)=>{var a,c;if(p.editable===!0)return!1;if(p.editable===!1)return!0;if(p.editable==="MINE_ONLY"){const f=(a=l.creator)==null?void 0:a.id;return((c=p.env.user)==null?void 0:c.id)!==f}return p.readOnly},pge=(l,p)=>l||{type:"TextualBody",value:"",purpose:p?"replying":"commenting",draft:!0},n4=l=>{const p=l.annotation?l.annotation.bodies.filter(S=>e4(S,l.purposeSelector)):[],a=pge(p.find(S=>S.draft==!0),p.length>1),c=p.filter(S=>S!=a),f=S=>{const E=a.value,x=S.target.value;E.length===0&&x.length>0?l.onAppendBody({...a,value:x}):E.length>0&&x.length===0?l.onRemoveBody(a):l.onUpdateBody(a,{...a,value:x})},m=S=>l.onUpdateBody(a,{...a,purpose:S.value}),v=!l.readOnly&&l.annotation,_=c.length===0||!l.disableReply;return yt.createElement(yt.Fragment,null,c.map((S,E)=>yt.createElement(dge,{key:E,env:l.env,purposeSelector:l.purposeSelector,readOnly:t4(S,l),body:S,onUpdate:l.onUpdateBody,onDelete:l.onRemoveBody,onSaveAndClose:l.onSaveAndClose})),v&&_&&yt.createElement("div",{className:"r6o-widget comment editable"},yt.createElement(IF,{focus:l.focus,content:a.value,editable:!0,placeholder:c.length>0?ja.t("Add a reply..."):l.textPlaceHolder||ja.t("Add a comment..."),onChange:f,onSaveAndClose:()=>l.onSaveAndClose()}),l.purposeSelector&&a.value.length>0&&yt.createElement($B,{editable:!0,content:a.purpose,onChange:m,onSaveAndClose:()=>l.onSaveAndClose()})))};n4.disableDelete=(l,p)=>l.bodies.filter(a=>e4(a,p.purposeSelector)).some(a=>t4(a,p));var i4=n4;function r4(l,p){l.prototype=Object.create(p.prototype),l.prototype.constructor=l,T0(l,p)}function fge(l,p){return l.classList?!!p&&l.classList.contains(p):(" "+(l.className.baseVal||l.className)+" ").indexOf(" "+p+" ")!==-1}function mge(l,p){l.classList?l.classList.add(p):fge(l,p)||(typeof l.className=="string"?l.className=l.className+" "+p:l.setAttribute("class",(l.className&&l.className.baseVal||"")+" "+p))}function s4(l,p){return l.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gge(l,p){l.classList?l.classList.remove(p):typeof l.className=="string"?l.className=s4(l.className,p):l.setAttribute("class",s4(l.className&&l.className.baseVal||"",p))}var o4={disabled:!1},a4=yt.createContext(null),l4=function(l){return l.scrollTop},Ug="unmounted",Ph="exited",Dh="entering",wf="entered",HE="exiting",zc=function(l){r4(p,l);function p(c,f){var m;m=l.call(this,c,f)||this;var v=f,_=v&&!v.isMounting?c.enter:c.appear,S;return m.appearStatus=null,c.in?_?(S=Ph,m.appearStatus=Dh):S=wf:c.unmountOnExit||c.mountOnEnter?S=Ug:S=Ph,m.state={status:S},m.nextCallback=null,m}p.getDerivedStateFromProps=function(c,f){var m=c.in;return m&&f.status===Ug?{status:Ph}:null};var a=p.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(c){var f=null;if(c!==this.props){var m=this.state.status;this.props.in?m!==Dh&&m!==wf&&(f=Dh):(m===Dh||m===wf)&&(f=HE)}this.updateStatus(!1,f)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var c=this.props.timeout,f,m,v;return f=m=v=c,c!=null&&typeof c!="number"&&(f=c.exit,m=c.enter,v=c.appear!==void 0?c.appear:m),{exit:f,enter:m,appear:v}},a.updateStatus=function(c,f){if(c===void 0&&(c=!1),f!==null)if(this.cancelNextCallback(),f===Dh){if(this.props.unmountOnExit||this.props.mountOnEnter){var m=this.props.nodeRef?this.props.nodeRef.current:yt.findDOMNode(this);m&&l4(m)}this.performEnter(c)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ph&&this.setState({status:Ug})},a.performEnter=function(c){var f=this,m=this.props.enter,v=this.context?this.context.isMounting:c,_=this.props.nodeRef?[v]:[yt.findDOMNode(this),v],S=_[0],E=_[1],x=this.getTimeouts(),U=v?x.appear:x.enter;if(!c&&!m||o4.disabled){this.safeSetState({status:wf},function(){f.props.onEntered(S)});return}this.props.onEnter(S,E),this.safeSetState({status:Dh},function(){f.props.onEntering(S,E),f.onTransitionEnd(U,function(){f.safeSetState({status:wf},function(){f.props.onEntered(S,E)})})})},a.performExit=function(){var c=this,f=this.props.exit,m=this.getTimeouts(),v=this.props.nodeRef?void 0:yt.findDOMNode(this);if(!f||o4.disabled){this.safeSetState({status:Ph},function(){c.props.onExited(v)});return}this.props.onExit(v),this.safeSetState({status:HE},function(){c.props.onExiting(v),c.onTransitionEnd(m.exit,function(){c.safeSetState({status:Ph},function(){c.props.onExited(v)})})})},a.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(c,f){f=this.setNextCallback(f),this.setState(c,f)},a.setNextCallback=function(c){var f=this,m=!0;return this.nextCallback=function(v){m&&(m=!1,f.nextCallback=null,c(v))},this.nextCallback.cancel=function(){m=!1},this.nextCallback},a.onTransitionEnd=function(c,f){this.setNextCallback(f);var m=this.props.nodeRef?this.props.nodeRef.current:yt.findDOMNode(this),v=c==null&&!this.props.addEndListener;if(!m||v){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var _=this.props.nodeRef?[this.nextCallback]:[m,this.nextCallback],S=_[0],E=_[1];this.props.addEndListener(S,E)}c!=null&&setTimeout(this.nextCallback,c)},a.render=function(){var c=this.state.status;if(c===Ug)return null;var f=this.props,m=f.children;f.in,f.mountOnEnter,f.unmountOnExit,f.appear,f.enter,f.exit,f.timeout,f.addEndListener,f.onEnter,f.onEntering,f.onEntered,f.onExit,f.onExiting,f.onExited,f.nodeRef;var v=CE(f,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return yt.createElement(a4.Provider,{value:null},typeof m=="function"?m(c,v):yt.cloneElement(yt.Children.only(m),v))},p}(yt.Component);zc.contextType=a4,zc.propTypes={};function _f(){}zc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_f,onEntering:_f,onEntered:_f,onExit:_f,onExiting:_f,onExited:_f},zc.UNMOUNTED=Ug,zc.EXITED=Ph,zc.ENTERING=Dh,zc.ENTERED=wf,zc.EXITING=HE;var yge=zc,vge=function(l,p){return l&&p&&p.split(" ").forEach(function(a){return mge(l,a)})},zE=function(l,p){return l&&p&&p.split(" ").forEach(function(a){return gge(l,a)})},jE=function(l){r4(p,l);function p(){for(var c,f=arguments.length,m=new Array(f),v=0;vp.filter(a=>(a.label?a.label:a).toLowerCase().startsWith(l.toLowerCase())),_ge=(l,p)=>p(l);var Sge=l=>{const p=rt(),[a,c]=Ce(l.initialValue||""),[f,m]=Ce([]),[v,_]=Ce(null);Ue(()=>{l.focus&&p.current.querySelector("input").focus({preventScroll:!0})},[]),Ue(()=>{l.onChange&&l.onChange(a)},[a]);const S=V=>{if(typeof l.vocabulary=="function"){const ie=_ge(V,l.vocabulary);ie.then?ie.then(m):m(ie)}else{const ie=wge(V,l.vocabulary);m(ie)}},E=()=>{if(v!==null)l.onSubmit(f[v]);else{const V=a.trim();if(V){const ie=Array.isArray(l.vocabulary)?l.vocabulary.find(de=>(de.label||de).toLowerCase()===V.toLowerCase()):null;ie?l.onSubmit(ie):l.onSubmit(V)}}c(""),m([]),_(null)},x=V=>{if(V.which===13)E();else if(V.which===27)l.onCancel&&l.onCancel();else if(f.length>0){if(V.which===38)if(v===null)_(0);else{const ie=Math.max(0,v-1);_(ie)}else if(V.which===40)if(v===null)_(0);else{const ie=Math.min(f.length-1,v+1);_(ie)}}else V.which===40&&Array.isArray(l.vocabulary)&&m(l.vocabulary)},U=V=>{const{value:ie}=V.target;c(ie),_(null),ie?S(ie):m([])};return yt.createElement("div",{ref:p,className:"r6o-autocomplete"},yt.createElement("div",null,yt.createElement("input",{onKeyDown:x,onChange:U,value:a,placeholder:l.placeholder})),yt.createElement("ul",null,f.length>0&&f.map((V,ie)=>yt.createElement("li",{key:`${V.label?V.label:V}${ie}`,onClick:E,onMouseEnter:()=>_(ie),style:v===ie?{backgroundColor:"#bde4ff"}:{}},V.label?V.label:V))))};const Tge=l=>l||{type:"TextualBody",value:"",purpose:"tagging",draft:!0};var u4=l=>{const p=l.annotation?l.annotation.bodies.filter(U=>U.purpose==="tagging"):[],a=Tge(p.slice().reverse().find(U=>U.draft)),c=p.filter(U=>U!=a),[f,m]=Ce(!1),v=U=>V=>{m(f===U?!1:U)},_=U=>{const V=a.value.trim(),ie=U.trim();V.length===0&&ie.length>0?l.onAppendBody({...a,value:ie}):V.length>0&&ie.length===0?l.onRemoveBody(a):V!==ie&&l.onUpdateBody(a,{...a,value:ie})},S=U=>V=>{V.stopPropagation(),l.onRemoveBody(U)},E=U=>{const V=U.uri?{type:"SpecificResource",purpose:"tagging",source:{id:U.uri,label:U.label}}:{type:"TextualBody",purpose:"tagging",value:U.label||U};a.value.trim().length===0?l.onAppendBody(V):l.onUpdateBody(a,V)},x=U=>U.value||U.source.label;return yt.createElement("div",{className:"r6o-widget r6o-tag"},c.length>0&&yt.createElement("ul",{className:"r6o-taglist"},c.map(U=>yt.createElement("li",{key:x(U),onClick:v(U)},yt.createElement("span",{className:"r6o-label"},x(U)),!l.readOnly&&yt.createElement(bge,{in:f===U,timeout:200,classNames:"r6o-delete"},yt.createElement("span",{className:"r6o-delete-wrapper",onClick:S(U)},yt.createElement("span",{className:"r6o-delete"},yt.createElement(uge,{width:12}))))))),!l.readOnly&&yt.createElement(Sge,{focus:l.focus,placeholder:l.textPlaceHolder||ja.t("Add tag..."),vocabulary:l.vocabulary||[],onChange:_,onSubmit:E}))};class c4 extends he{constructor(p){super(p),this.element=yt.createRef()}renderWidget(p){const a=this.props.widget({annotation:p.annotation,readOnly:p.readOnly,...p.config,onAppendBody:(c,f)=>p.onAppendBody(c,f),onUpdateBody:(c,f,m)=>p.onUpdateBody(c,f,m),onUpsertBody:(c,f,m)=>p.onUpsertBody(c,f,m),onRemoveBody:(c,f)=>p.onRemoveBody(c,f),onBatchModify:(c,f)=>p.onBatchModify(c,f),onSetProperty:(c,f)=>p.onSetProperty(c,f),onAddContext:c=>p.onAddContext(c),onSaveAndClose:()=>p.onSaveAndClose()});for(;this.element.current.firstChild;)this.element.current.removeChild(this.element.current.lastChild);this.element.current.appendChild(a)}componentDidMount(){this.renderWidget(this.props)}componentWillReceiveProps(p){this.element.current&&this.props.annotation!==p.annotation&&this.renderWidget(p)}render(){return yt.createElement("div",{ref:this.element,className:"widget"})}}window.React=yt,window.ReactDOM=yt;const Ege={COMMENT:i4,TAG:u4},xge=[yt.createElement(i4,null),yt.createElement(u4,null)],Cge=l=>{const p=c=>{var f;return typeof c=="function"&&!!((f=c.prototype)!=null&&f.isReactComponent)},a=c=>typeof c=="function"&&(String(c).match(/return .+\(['|"].+['|"],\s*\{/g)||String(c).match(/return .+preact_compat/)||String(c).match(/return .+\.createElement/g));return p(l)||a(l)},Age=l=>{const p=(a,c,f)=>{if(typeof a=="string"||a instanceof String)return yt.createElement(Ege[a],c);if((f==null?void 0:f.toLowerCase())==="react")return yt.createElement(a,c);if((f==null?void 0:f.toLowerCase())==="plainjs")return yt.createElement(c4,{widget:a,config:c});if(Cge(a))return yt.createElement(a,c);if(typeof a=="function"||a instanceof Function)return yt.createElement(c4,{widget:a,config:c});throw`${a} is not a valid plugin`};if(l.widget){const{widget:a,force:c,...f}=l;return p(a,f,c)}else return p(l)},d4=14;var h4=(l,p,a,c)=>{const f=l.getBoundingClientRect();p.className="r6o-editor r6o-arrow-top r6o-arrow-left";const{left:m,top:v,right:_,bottom:S}=a.getBoundingClientRect();if(p.style.top=`${S-f.top+d4}px`,p.style.left=`${m-f.left}px`,c){const E=p.children[1].getBoundingClientRect(),{innerWidth:x,innerHeight:U}=l.ownerDocument.defaultView;if(E.right>x&&(p.classList.remove("r6o-arrow-left"),p.classList.add("r6o-arrow-right"),p.style.left=`${_-E.width-f.left}px`),E.bottom>U){p.classList.remove("r6o-arrow-top"),p.classList.add("r6o-arrow-bottom");const ie=p.children[1].getBoundingClientRect().height;p.style.top=`${v-f.top-ie-d4}px`}const V=p.children[1].getBoundingClientRect();if(V.top<0){p.classList.add("pushed","down"),p.style.top=`${-f.top}px`;const ie=S-f.top;V.height-f.top>ie&&p.classList.remove("r6o-arrow-bottom")}V.left<0&&(p.classList.add("pushed","right"),p.style.left=`${-f.left}px`),requestAnimationFrame(()=>p.style.opacity=1)}};const p4=l=>{const{top:p,left:a,width:c,height:f}=l.getBoundingClientRect();return`${p}, ${a}, ${c}, ${f}`};class kge extends he{constructor(p){super(p),r(this,"initResizeObserver",()=>{const a=this.props.autoPosition===void 0?!0:this.props.autoPosition;if(window!=null&&window.ResizeObserver){const c=new ResizeObserver(()=>{this.state.dragged||h4(this.props.wrapperEl,this.element.current,this.props.selectedElement,a)});return c.observe(this.props.wrapperEl),()=>c.disconnect()}else this.state.dragged||h4(this.props.wrapperEl,this.element.current,this.props.selectedElement,a)}),r(this,"creationMeta",a=>{const c={},{user:f}=this.props.env;return f&&(c.creator={},f.id&&(c.creator.id=f.id),f.displayName&&(c.creator.name=f.displayName),c[a.created?"modified":"created"]=this.props.env.getCurrentTimeAdjusted()),c}),r(this,"getCurrentAnnotation",()=>this.state.currentAnnotation.clone()),r(this,"hasChanges",()=>{var a;return!((a=this.props.annotation)!=null&&a.isEqual(this.state.currentAnnotation))}),r(this,"updateCurrentAnnotation",(a,c)=>{this.setState({currentAnnotation:this.state.currentAnnotation.clone(a)},()=>{c?this.onOk():this.props.onChanged&&this.props.onChanged()})}),r(this,"onAppendBody",(a,c)=>this.updateCurrentAnnotation({body:[...this.state.currentAnnotation.bodies,{...a,...this.creationMeta(a)}]},c)),r(this,"onUpdateBody",(a,c,f)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.map(m=>m===a?{...c,...this.creationMeta(c)}:m)},f)),r(this,"onRemoveBody",(a,c)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.filter(f=>f!==a)},c)),r(this,"onUpsertBody",(a,c,f)=>{if(a==null&&c!=null)this.onAppendBody(c,f);else if(a!=null&&c!=null)this.onUpdateBody(a,c,f);else if(a!=null&&c==null){const m=this.state.currentAnnotation.bodies.find(v=>v.purpose===a.purpose);m?this.onUpdateBody(m,a,f):this.onAppendBody(a,f)}}),r(this,"onBatchModify",(a,c)=>{const f=a.filter(E=>E.action==="upsert"&&E.body).map(E=>({previous:this.state.currentAnnotation.bodies.find(x=>x.purpose===E.body.purpose),updated:{...E.body,...this.creationMeta(E.body)}})),m=a.filter(E=>E.action==="remove").map(E=>E.body),v=[...a.filter(E=>E.action==="append"||E.action==="upsert"&&E.updated&&!E.previous).map(E=>({...E.body,...this.creationMeta(E.body)})),...f.filter(E=>!E.previous).map(E=>E.updated)],_=[...a.filter(E=>E.action==="update"||E.action==="upsert"&&E.updated&&E.previous).map(E=>({previous:E.previous,updated:{...E.updated,...this.creationMeta(E.updated)}})),...f.filter(E=>E.previous)],S=[...this.state.currentAnnotation.bodies.filter(E=>!m.includes(E)).map(E=>{const x=_.find(U=>U.previous===E);return x?x.updated:E}),...v];this.updateCurrentAnnotation({body:S},c)}),r(this,"onSetProperty",(a,c)=>{if(["@context","id","type","body","target"].includes(a))throw new Exception(`Cannot set ${a} - not allowed`);if(c)this.updateCurrentAnnotation({[a]:c});else{const f=this.currentAnnotation.clone();delete f[a],this.setState({currentAnnotation:f})}}),r(this,"onAddContext",a=>{const{currentAnnotation:c}=this.state,f=Array.isArray(c.context)?c.context:[c.context];f.indexOf(a)<0&&(f.push(a),this.updateCurrentAnnotation({"@context":f}))}),r(this,"onCancel",()=>this.props.onCancel(this.props.annotation)),r(this,"onOk",()=>{const a=f=>f.clone({body:f.bodies.map(({draft:m,...v})=>v)}),{currentAnnotation:c}=this.state;c.bodies.length===0&&!this.props.allowEmpty?c.isSelection?this.onCancel():this.props.onAnnotationDeleted(this.props.annotation):c.isSelection?this.props.onAnnotationCreated(a(c).toAnnotation()):this.props.onAnnotationUpdated(a(c),this.props.annotation)}),r(this,"onDelete",()=>this.props.onAnnotationDeleted(this.props.annotation)),this.element=yt.createRef(),this.state={currentAnnotation:p.annotation,dragged:!1,selectionBounds:p4(p.selectedElement)}}componentWillReceiveProps(p){var a;const{selectionBounds:c}=this.state,f=p4(p.selectedElement);(a=this.props.annotation)!=null&&a.isEqual(p.annotation)?this.setState({selectionBounds:f}):this.setState({currentAnnotation:p.annotation,selectionBounds:f}),this.props.modifiedTarget!=p.modifiedTarget&&this.state.currentAnnotation&&this.updateCurrentAnnotation({target:this.props.modifiedTarget}),c!=f&&this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}componentDidMount(){this.removeObserver=this.initResizeObserver(),new MutationObserver(()=>{this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}).observe(this.element.current,{childList:!0,subtree:!0})}componentWillUnmount(){this.removeObserver&&this.removeObserver()}render(){const{currentAnnotation:p}=this.state,a=this.props.widgets?this.props.widgets.map(Age):xge,c=m=>m.type.disableDelete?m.type.disableDelete(p,{...m.props,readOnly:this.props.readOnly,env:this.props.env}):!1,f=p&&(p.bodies.length>0||this.props.allowEmpty)&&!this.props.readOnly&&!p.isSelection&&!a.some(c);return yt.createElement(kd,{disabled:!this.props.detachable,handle:".r6o-draggable",cancel:".r6o-btn, .r6o-btn *",onDrag:()=>this.setState({dragged:!0})},yt.createElement("div",{ref:this.element,className:this.state.dragged?"r6o-editor dragged":"r6o-editor"},yt.createElement("div",{className:"r6o-arrow"}),yt.createElement("div",{className:"r6o-editor-inner"},a.map((m,v)=>yt.cloneElement(m,{key:`${v}`,focus:v===0,annotation:p,readOnly:this.props.readOnly,env:this.props.env,onAppendBody:this.onAppendBody,onUpdateBody:this.onUpdateBody,onRemoveBody:this.onRemoveBody,onUpsertBody:this.onUpsertBody,onBatchModify:this.onBatchModify,onSetProperty:this.onSetProperty,onAddContext:this.onAddContext,onSaveAndClose:this.onOk})),this.props.readOnly?yt.createElement("div",{className:"r6o-footer"},yt.createElement("button",{className:"r6o-btn",onClick:this.onCancel},ja.t("Close"))):yt.createElement("div",{className:this.props.detachable?"r6o-footer r6o-draggable":"r6o-footer"},f&&yt.createElement("button",{className:"r6o-btn left delete-annotation",title:ja.t("Delete"),onClick:this.onDelete},yt.createElement(cge,{width:12})),yt.createElement("button",{className:"r6o-btn outline",onClick:this.onCancel},ja.t("Cancel")),yt.createElement("button",{className:"r6o-btn ",onClick:this.onOk},ja.t("Ok"))))))}}var O0,Pge=new Uint8Array(16);function Dge(){if(!O0&&(O0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!O0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O0(Pge)}var Ige=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Oge(l){return typeof l=="string"&&Ige.test(l)}for(var ao=[],VE=0;VE<256;++VE)ao.push((VE+256).toString(16).substr(1));function Rge(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(ao[l[p+0]]+ao[l[p+1]]+ao[l[p+2]]+ao[l[p+3]]+"-"+ao[l[p+4]]+ao[l[p+5]]+"-"+ao[l[p+6]]+ao[l[p+7]]+"-"+ao[l[p+8]]+ao[l[p+9]]+"-"+ao[l[p+10]]+ao[l[p+11]]+ao[l[p+12]]+ao[l[p+13]]+ao[l[p+14]]+ao[l[p+15]]).toLowerCase();if(!Oge(a))throw TypeError("Stringified UUID is invalid");return a}function f4(l,p,a){l=l||{};var c=l.random||(l.rng||Dge)();return c[6]=c[6]&15|64,c[8]=c[8]&63|128,Rge(c)}var Lge=function l(p,a){if(p===a)return!0;if(p&&a&&typeof p=="object"&&typeof a=="object"){if(p.constructor!==a.constructor)return!1;var c,f,m;if(Array.isArray(p)){if(c=p.length,c!=a.length)return!1;for(f=c;f--!==0;)if(!l(p[f],a[f]))return!1;return!0}if(p.constructor===RegExp)return p.source===a.source&&p.flags===a.flags;if(p.valueOf!==Object.prototype.valueOf)return p.valueOf()===a.valueOf();if(p.toString!==Object.prototype.toString)return p.toString()===a.toString();if(m=Object.keys(p),c=m.length,c!==Object.keys(a).length)return!1;for(f=c;f--!==0;)if(!Object.prototype.hasOwnProperty.call(a,m[f]))return!1;for(f=c;f--!==0;){var v=m[f];if(!l(p[v],a[v]))return!1}return!0}return p!==p&&a!==a},m4=Lge;const WE=class{constructor(l,p){r(this,"clone",(a,c)=>new WE({...this.underlying,...a},{...this.opts,...c})),r(this,"selector",a=>{const{target:c}=this.underlying;if(c.selector)return(Array.isArray(c.selector)?c.selector:[c.selector]).find(f=>f.type===a)}),this.underlying=l,this.opts=p}isEqual(l){return(l==null?void 0:l.type)!=="Annotation"?!1:this.underlying===l.underlying?!0:!this.underlying.id||!l.underlying.id?!1:m4(this.underlying,l.underlying)}get readOnly(){var l;return(l=this.opts)==null?void 0:l.readOnly}get id(){return this.underlying.id}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get motivation(){return this.underlying.motivation}get body(){return this.underlying.body}get target(){return this.underlying.target}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}set bodies(l){this.underlying.body=l}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}get quote(){var l;return(l=this.selector("TextQuoteSelector"))==null?void 0:l.exact}get start(){var l;return(l=this.selector("TextPositionSelector"))==null?void 0:l.start}get end(){var l;return(l=this.selector("TextPositionSelector"))==null?void 0:l.end}};let Ih=WE;r(Ih,"create",l=>{const p={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Annotation",id:`#${f4()}`,body:[]};return new WE({...p,...l})});class Hg{constructor(p,a){r(this,"clone",c=>{const f=new Hg;return f.underlying=JSON.parse(JSON.stringify(this.underlying)),c&&(f.underlying={...f.underlying,...c}),f}),r(this,"selector",c=>{const{target:f}=this.underlying;if(f.selector)return(Array.isArray(f.selector)?f.selector:[f.selector]).find(m=>m.type===c)}),r(this,"toAnnotation",()=>{const c=Object.assign({},this.underlying,{type:"Annotation",id:`#${f4()}`});return new Ih(c)}),this.underlying={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Selection",body:a||[],target:p}}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get body(){return this.underlying.body}get target(){return this.underlying.target}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}isEqual(p){return p?m4(this.underlying,p.underlying):!1}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}get quote(){var p;return(p=this.selector("TextQuoteSelector"))==null?void 0:p.exact}get isSelection(){return!0}}let qE=0;var Mge=()=>({setServerTime:l=>{const p=Date.now();qE=l-p},getCurrentTimeAdjusted:()=>new Date(Date.now()+qE).toISOString(),toClientTime:l=>Date.parse(l)-qE});const Nge=(l,p)=>{if(l){const a=l==="auto"?window.navigator.userLanguage||window.navigator.language:l,c=a.split("-")[0].toLowerCase(),f=[a,c].find(m=>Ghe.includes(m));f||console.warn(`Unsupported locale '${a}'. Falling back to default en.`),ja.init(f,p)}else ja.init(null,p)};var g4={exports:{}};(function(l){//! openseadragon 3.0.0 //! Built on 2021-12-15 //! Git commit: v3.0.0-0-3eded36 //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ function p(a){return new p.Viewer(a)}(function(a){a.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var c={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},f=Object.prototype.toString,m=Object.prototype.hasOwnProperty;a.isFunction=function(v){return a.type(v)==="function"},a.isArray=Array.isArray||function(v){return a.type(v)==="array"},a.isWindow=function(v){return v&&typeof v=="object"&&"setInterval"in v},a.type=function(v){return v==null?String(v):c[f.call(v)]||"object"},a.isPlainObject=function(v){if(!v||p.type(v)!=="object"||v.nodeType||a.isWindow(v)||v.constructor&&!m.call(v,"constructor")&&!m.call(v.constructor.prototype,"isPrototypeOf"))return!1;var _;for(var S in v)_=S;return _===void 0||m.call(v,_)},a.isEmptyObject=function(v){for(var _ in v)return!1;return!0},a.freezeObject=function(v){return Object.freeze?a.freezeObject=Object.freeze:a.freezeObject=function(_){return _},a.freezeObject(v)},a.supportsCanvas=function(){var v=document.createElement("canvas");return!!(a.isFunction(v.getContext)&&v.getContext("2d"))}(),a.isCanvasTainted=function(v){var _=!1;try{v.getContext("2d").getImageData(0,0,1,1)}catch{_=!0}return _},a.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),a.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),a.supportsEventListenerOptions=function(){var v=0;if(a.supportsAddEventListener)try{var _={get capture(){return v++,!1},get once(){return v++,!1},get passive(){return v++,!1}};window.addEventListener("test",null,_),window.removeEventListener("test",null,_)}catch{v=0}return v>=3}(),a.getCurrentPixelDensityRatio=function(){if(a.supportsCanvas){var v=document.createElement("canvas").getContext("2d"),_=window.devicePixelRatio||1,S=v.webkitBackingStorePixelRatio||v.mozBackingStorePixelRatio||v.msBackingStorePixelRatio||v.oBackingStorePixelRatio||v.backingStorePixelRatio||1;return Math.max(_,1)/S}else return 1},a.pixelDensityRatio=a.getCurrentPixelDensityRatio()})(p),function(a){a.extend=function(){var S,E,x,U,V,ie,de=arguments[0]||{},Ie=arguments.length,ke=!1,Ve=1;for(typeof de=="boolean"&&(ke=de,de=arguments[1]||{},Ve=2),typeof de!="object"&&!p.isFunction(de)&&(de={}),Ie===Ve&&(de=this,--Ve);Ve=x.x&&E.x=x.y},getMousePosition:function(S){if(typeof S.pageX=="number")a.getMousePosition=function(E){var x=new a.Point;return x.x=E.pageX,x.y=E.pageY,x};else if(typeof S.clientX=="number")a.getMousePosition=function(E){var x=new a.Point;return x.x=E.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,x.y=E.clientY+document.body.scrollTop+document.documentElement.scrollTop,x};else throw new Error("Unknown event mouse position, no known technique.");return a.getMousePosition(S)},getPageScroll:function(){var S=document.documentElement||{},E=document.body||{};if(typeof window.pageXOffset=="number")a.getPageScroll=function(){return new a.Point(window.pageXOffset,window.pageYOffset)};else if(E.scrollLeft||E.scrollTop)a.getPageScroll=function(){return new a.Point(document.body.scrollLeft,document.body.scrollTop)};else if(S.scrollLeft||S.scrollTop)a.getPageScroll=function(){return new a.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new a.Point(0,0);return a.getPageScroll()},setPageScroll:function(S){if(typeof window.scrollTo<"u")a.setPageScroll=function(U){window.scrollTo(U.x,U.y)};else{var E=a.getPageScroll();if(E.x===S.x&&E.y===S.y)return;document.body.scrollLeft=S.x,document.body.scrollTop=S.y;var x=a.getPageScroll();if(x.x!==E.x&&x.y!==E.y){a.setPageScroll=function(U){document.body.scrollLeft=U.x,document.body.scrollTop=U.y};return}if(document.documentElement.scrollLeft=S.x,document.documentElement.scrollTop=S.y,x=a.getPageScroll(),x.x!==E.x&&x.y!==E.y){a.setPageScroll=function(U){document.documentElement.scrollLeft=U.x,document.documentElement.scrollTop=U.y};return}a.setPageScroll=function(U){}}a.setPageScroll(S)},getWindowSize:function(){var S=document.documentElement||{},E=document.body||{};if(typeof window.innerWidth=="number")a.getWindowSize=function(){return new a.Point(window.innerWidth,window.innerHeight)};else if(S.clientWidth||S.clientHeight)a.getWindowSize=function(){return new a.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(E.clientWidth||E.clientHeight)a.getWindowSize=function(){return new a.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return a.getWindowSize()},makeCenteredNode:function(S){S=a.getElement(S);var E=[a.makeNeutralElement("div"),a.makeNeutralElement("div"),a.makeNeutralElement("div")];return a.extend(E[0].style,{display:"table",height:"100%",width:"100%"}),a.extend(E[1].style,{display:"table-row"}),a.extend(E[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),E[0].appendChild(E[1]),E[1].appendChild(E[2]),E[2].appendChild(S),E[0]},makeNeutralElement:function(S){var E=document.createElement(S),x=E.style;return x.background="transparent none",x.border="none",x.margin="0px",x.padding="0px",x.position="static",E},now:function(){return Date.now?a.now=Date.now:a.now=function(){return new Date().getTime()},a.now()},makeTransparentImage:function(S){var E=a.makeNeutralElement("img");return E.src=S,E},setElementOpacity:function(S,E,x){var U,V;S=a.getElement(S),x&&!a.Browser.alpha&&(E=Math.round(E)),a.Browser.opacity?S.style.opacity=E<1?E:"":E<1?(U=Math.round(100*E),V="alpha(opacity="+U+")",S.style.filter=V):S.style.filter=""},setElementTouchActionNone:function(S){S=a.getElement(S),typeof S.style.touchAction<"u"?S.style.touchAction="none":typeof S.style.msTouchAction<"u"&&(S.style.msTouchAction="none")},setElementPointerEvents:function(S,E){S=a.getElement(S),typeof S.style.pointerEvents<"u"&&(S.style.pointerEvents=E)},setElementPointerEventsNone:function(S){a.setElementPointerEvents(S,"none")},addClass:function(S,E){S=a.getElement(S),S.className?(" "+S.className+" ").indexOf(" "+E+" ")===-1&&(S.className+=" "+E):S.className=E},indexOf:function(S,E,x){return Array.prototype.indexOf?this.indexOf=function(U,V,ie){return U.indexOf(V,ie)}:this.indexOf=function(U,V,ie){var de,Ie=ie||0,ke;if(!U)throw new TypeError;if(ke=U.length,ke===0||Ie>=ke)return-1;for(Ie<0&&(Ie=ke-Math.abs(Ie)),de=Ie;de=200&&Ie.status<300||Ie.status===0&&de!=="http:"&&de!=="https:"?E(Ie):(a.console.log("AJAX request returned %d: %s",Ie.status,S),a.isFunction(x)&&x(Ie)))};try{if(Ie.open("GET",S,!0),ie&&(Ie.responseType=ie),V)for(var ke in V)Object.prototype.hasOwnProperty.call(V,ke)&&V[ke]&&Ie.setRequestHeader(ke,V[ke]);U&&(Ie.withCredentials=!0),Ie.send(null)}catch(Ve){a.console.log("%s while making AJAX request: %s",Ve.name,Ve.message),Ie.onreadystatechange=function(){},a.isFunction(x)&&x(Ie,Ve)}return Ie},jsonp:function(S){var E,x=S.url,U=document.head||document.getElementsByTagName("head")[0]||document.documentElement,V=S.callbackName||"openseadragon"+a.now(),ie=window[V],de="$1"+V+"$2",Ie=S.param||"callback",ke=S.callback;x=x.replace(/(=)\?(&|$)|\?\?/i,de),x+=(/\?/.test(x)?"&":"?")+Ie+"="+V,window[V]=function(Ve){if(ie)window[V]=ie;else try{delete window[V]}catch{}ke&&a.isFunction(ke)&&ke(Ve)},E=document.createElement("script"),(S.async!==void 0||S.async!==!1)&&(E.async="async"),S.scriptCharset&&(E.charset=S.scriptCharset),E.src=x,E.onload=E.onreadystatechange=function(Ve,W){(W||!E.readyState||/loaded|complete/.test(E.readyState))&&(E.onload=E.onreadystatechange=null,U&&E.parentNode&&U.removeChild(E),E=void 0)},U.insertBefore(E,U.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(S){if(window.DOMParser)a.parseXml=function(E){var x=null,U;return U=new DOMParser,x=U.parseFromString(E,"text/xml"),x};else if(window.ActiveXObject)a.parseXml=function(E){var x=null;return x=new ActiveXObject("Microsoft.XMLDOM"),x.async=!1,x.loadXML(E),x};else throw new Error("Browser doesn't support XML DOM.");return a.parseXml(S)},parseJSON:function(S){return a.parseJSON=window.JSON.parse,a.parseJSON(S)},imageFormatSupported:function(S){return S=S||"",!!m[S.toLowerCase()]},setImageFormatsSupported:function(S){a.extend(m,S)}});var f=function(S){};a.console=window.console||{log:f,debug:f,info:f,warn:f,error:f,assert:f},a.Browser={vendor:a.BROWSERS.UNKNOWN,version:0,alpha:!0};var m={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},v={};(function(){var S=navigator.appVersion,E=navigator.userAgent,x;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(a.Browser.vendor=a.BROWSERS.IE,a.Browser.version=parseFloat(E.substring(E.indexOf("MSIE")+5,E.indexOf(";",E.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(E.indexOf("Edge")>=0?(a.Browser.vendor=a.BROWSERS.EDGE,a.Browser.version=parseFloat(E.substring(E.indexOf("Edge")+5))):E.indexOf("Edg")>=0?(a.Browser.vendor=a.BROWSERS.CHROMEEDGE,a.Browser.version=parseFloat(E.substring(E.indexOf("Edg")+4))):E.indexOf("Firefox")>=0?(a.Browser.vendor=a.BROWSERS.FIREFOX,a.Browser.version=parseFloat(E.substring(E.indexOf("Firefox")+8))):E.indexOf("Safari")>=0?(a.Browser.vendor=E.indexOf("Chrome")>=0?a.BROWSERS.CHROME:a.BROWSERS.SAFARI,a.Browser.version=parseFloat(E.substring(E.substring(0,E.indexOf("Safari")).lastIndexOf("/")+1,E.indexOf("Safari")))):(x=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),x.exec(E)!==null&&(a.Browser.vendor=a.BROWSERS.IE,a.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":a.Browser.vendor=a.BROWSERS.OPERA,a.Browser.version=parseFloat(S);break}var U=window.location.search.substring(1),V=U.split("&"),ie,de,Ie;for(Ie=0;Ie0){var ke=ie.substring(0,de),Ve=ie.substring(de+1);try{v[ke]=decodeURIComponent(Ve)}catch{a.console.error("Ignoring malformed URL parameter: %s=%s",ke,Ve)}}a.Browser.alpha=!(a.Browser.vendor===a.BROWSERS.CHROME&&a.Browser.version<2),a.Browser.opacity=!0,a.Browser.vendor===a.BROWSERS.IE&&a.Browser.version<11&&a.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(S){var E=S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame||S.msRequestAnimationFrame,x=S.cancelAnimationFrame||S.mozCancelAnimationFrame||S.webkitCancelAnimationFrame||S.msCancelAnimationFrame;if(E&&x)a.requestAnimationFrame=function(){return E.apply(S,arguments)},a.cancelAnimationFrame=function(){return x.apply(S,arguments)};else{var U=[],V=[],ie=0,de;a.requestAnimationFrame=function(Ie){return U.push([++ie,Ie]),de||(de=setInterval(function(){if(U.length){var ke=a.now(),Ve=V;for(V=U,U=Ve;V.length;)V.shift()[1](ke)}else clearInterval(de),de=void 0},1e3/50)),ie},a.cancelAnimationFrame=function(Ie){var ke,Ve;for(ke=0,Ve=U.length;ke8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",a.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",a.MouseTracker.wheelEventName],a.MouseTracker.wheelEventName==="DOMMouseScroll"&&a.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(a.MouseTracker.havePointerEvents=!0,a.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),a.MouseTracker.havePointerCapture=function(){var oe=document.createElement("div");return a.isFunction(oe.setPointerCapture)&&a.isFunction(oe.releasePointerCapture)}(),a.MouseTracker.havePointerCapture&&a.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(a.MouseTracker.havePointerEvents=!1,a.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),a.MouseTracker.mousePointerId="legacy-mouse",a.MouseTracker.havePointerCapture=function(){var oe=document.createElement("div");return a.isFunction(oe.setCapture)&&a.isFunction(oe.releaseCapture)}(),a.MouseTracker.havePointerCapture&&a.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&a.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&a.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),a.MouseTracker.GesturePointList=function(oe){this._gPoints=[],this.type=oe,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},a.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(oe){return this._gPoints.push(oe)},removeById:function(oe){var ne,Ee=this._gPoints.length;for(ne=0;ne1&&(this.type==="mouse"||this.type==="pen")&&(a.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(a.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}};function v(oe){var ne=c[oe.hash],Ee,Pe,St,Yt,In,ir=ne.activePointersLists.length;for(Ee=0;Ee0){for(In=[],Yt=St.asArray(),Pe=0;Pene.touches.length-St&&a.console.warn("Tracked touch contact count doesn't match event.touches.length");var ir={originalEvent:ne,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(Rt(oe,ir),Pe=0;Pe0&&ne.removeContact(),Pe=ne.removeById(Ee.id)):Pe=ne.getLength(),Pe}function Kt(oe,ne){switch(ne.eventType){case"pointermove":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!1,ne.preventGesture=!oe.hasGestureHandlers,ne.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!1,ne.preventGesture=!1,ne.stopPropagation=!1;break;case"pointerdown":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!1,ne.preventGesture=!oe.hasGestureHandlers,ne.stopPropagation=!1;break;case"pointerup":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!1,ne.preventGesture=!oe.hasGestureHandlers,ne.stopPropagation=!1;break;case"wheel":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!1,ne.preventGesture=!oe.hasScrollHandler,ne.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":ne.isStoppable=!0,ne.isCancelable=!1,ne.preventDefault=!1,ne.preventGesture=!1,ne.stopPropagation=!1;break;case"click":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!!oe.clickHandler,ne.preventGesture=!1,ne.stopPropagation=!1;break;case"dblclick":ne.isStoppable=!0,ne.isCancelable=!0,ne.preventDefault=!!oe.dblClickHandler,ne.preventGesture=!1,ne.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:ne.isStoppable=!1,ne.isCancelable=!1,ne.preventDefault=!1,ne.preventGesture=!1,ne.stopPropagation=!1;break}}function Rt(oe,ne){ne.eventSource=oe,ne.eventPhase=ne.originalEvent&&typeof ne.originalEvent.eventPhase<"u"?ne.originalEvent.eventPhase:0,ne.defaultPrevented=a.eventIsCanceled(ne.originalEvent),ne.shouldCapture=!1,ne.shouldReleaseCapture=!1,ne.userData=oe.userData,Kt(oe,ne),oe.preProcessEventHandler&&oe.preProcessEventHandler(ne)}function bn(oe,ne,Ee){var Pe=oe.getActivePointersListByType(ne.type),St=Pe.getById(ne.id);St?Ee&&!St.captured?(St.captured=!0,Pe.captureCount++):!Ee&&St.captured&&(St.captured=!1,Pe.captureCount--,Pe.captureCount<0&&(Pe.captureCount=0,a.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):a.console.warn("updatePointerCaptured() called on untracked pointer")}function un(oe,ne,Ee){var Pe=oe.getActivePointersListByType(Ee.type),St;St=Pe.getById(Ee.id),St?(St.insideElement=!0,St.lastPos=St.currentPos,St.lastTime=St.currentTime,St.currentPos=Ee.currentPos,St.currentTime=Ee.currentTime,Ee=St):(Ee.captured=!1,Ee.insideElementPressed=!1,Ee.insideElement=!0,Me(Pe,Ee)),oe.enterHandler&&oe.enterHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.currentPos,oe.element),buttons:Pe.buttons,pointers:oe.getActivePointerCount(),insideElementPressed:Ee.insideElementPressed,buttonDownAny:Pe.buttons!==0,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData})}function Qi(oe,ne,Ee){var Pe=oe.getActivePointersListByType(Ee.type),St,Yt;St=Pe.getById(Ee.id),St?(St.captured?(St.insideElement=!1,St.lastPos=St.currentPos,St.lastTime=St.currentTime,St.currentPos=Ee.currentPos,St.currentTime=Ee.currentTime):wt(oe,Pe,St),Ee=St):(Ee.captured=!1,Ee.insideElementPressed=!1),(oe.leaveHandler||oe.exitHandler)&&(Yt={eventSource:oe,pointerType:Ee.type,position:Ee.currentPos&&Ve(Ee.currentPos,oe.element),buttons:Pe.buttons,pointers:oe.getActivePointerCount(),insideElementPressed:Ee.insideElementPressed,buttonDownAny:Pe.buttons!==0,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData},oe.leaveHandler&&oe.leaveHandler(Yt),oe.exitHandler&&oe.exitHandler(Yt))}function vr(oe,ne,Ee){var Pe,St;Pe=oe.getActivePointersListByType(Ee.type),St=Pe.getById(Ee.id),St?Ee=St:(Ee.captured=!1,Ee.insideElementPressed=!1),oe.overHandler&&oe.overHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.currentPos,oe.element),buttons:Pe.buttons,pointers:oe.getActivePointerCount(),insideElementPressed:Ee.insideElementPressed,buttonDownAny:Pe.buttons!==0,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData})}function Hi(oe,ne,Ee){var Pe,St;Pe=oe.getActivePointersListByType(Ee.type),St=Pe.getById(Ee.id),St?Ee=St:(Ee.captured=!1,Ee.insideElementPressed=!1),oe.outHandler&&oe.outHandler({eventSource:oe,pointerType:Ee.type,position:Ee.currentPos&&Ve(Ee.currentPos,oe.element),buttons:Pe.buttons,pointers:oe.getActivePointerCount(),insideElementPressed:Ee.insideElementPressed,buttonDownAny:Pe.buttons!==0,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData})}function Qn(oe,ne,Ee,Pe){var St=c[oe.hash],Yt=oe.getActivePointersListByType(Ee.type),In;if(typeof ne.originalEvent.buttons<"u"?Yt.buttons=ne.originalEvent.buttons:Pe===0?Yt.buttons|=1:Pe===1?Yt.buttons|=4:Pe===2?Yt.buttons|=2:Pe===3?Yt.buttons|=8:Pe===4?Yt.buttons|=16:Pe===5&&(Yt.buttons|=32),Pe!==0){ne.shouldCapture=!1,ne.shouldReleaseCapture=!1,oe.nonPrimaryPressHandler&&!ne.preventGesture&&!ne.defaultPrevented&&(ne.preventDefault=!0,oe.nonPrimaryPressHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.currentPos,oe.element),button:Pe,buttons:Yt.buttons,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}));return}if(In=Yt.getById(Ee.id),In)In.insideElementPressed=!0,In.insideElement=!0,In.originalTarget=ne.originalEvent.target,In.contactPos=Ee.currentPos,In.contactTime=Ee.currentTime,In.lastPos=In.currentPos,In.lastTime=In.currentTime,In.currentPos=Ee.currentPos,In.currentTime=Ee.currentTime,Ee=In;else{a.console.warn("pointerdown event on untracked pointer"),Ee.captured=!1,Ee.insideElementPressed=!0,Ee.insideElement=!0,Ee.originalTarget=ne.originalEvent.target,Me(Yt,Ee);return}Yt.addContact(),!ne.preventGesture&&!ne.defaultPrevented?(ne.shouldCapture=!0,ne.shouldReleaseCapture=!1,ne.preventDefault=!0,(oe.dragHandler||oe.dragEndHandler||oe.pinchHandler)&&a.MouseTracker.gesturePointVelocityTracker.addPoint(oe,Ee),Yt.contacts===1?oe.pressHandler&&!ne.preventGesture&&oe.pressHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.contactPos,oe.element),buttons:Yt.buttons,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}):Yt.contacts===2&&oe.pinchHandler&&Ee.type==="touch"&&(St.pinchGPoints=Yt.asArray(),St.lastPinchDist=St.currentPinchDist=St.pinchGPoints[0].currentPos.distanceTo(St.pinchGPoints[1].currentPos),St.lastPinchCenter=St.currentPinchCenter=W(St.pinchGPoints[0].currentPos,St.pinchGPoints[1].currentPos))):(ne.shouldCapture=!1,ne.shouldReleaseCapture=!1)}function es(oe,ne,Ee,Pe){var St=c[oe.hash],Yt=oe.getActivePointersListByType(Ee.type),In,ir,On,Ga=!1,Ks;if(typeof ne.originalEvent.buttons<"u"?Yt.buttons=ne.originalEvent.buttons:Pe===0?Yt.buttons^=-2:Pe===1?Yt.buttons^=-5:Pe===2?Yt.buttons^=-3:Pe===3?Yt.buttons^=-9:Pe===4?Yt.buttons^=-17:Pe===5&&(Yt.buttons^=-33),ne.shouldCapture=!1,Pe!==0){ne.shouldReleaseCapture=!1,oe.nonPrimaryReleaseHandler&&!ne.preventGesture&&!ne.defaultPrevented&&(ne.preventDefault=!0,oe.nonPrimaryReleaseHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.currentPos,oe.element),button:Pe,buttons:Yt.buttons,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}));return}On=Yt.getById(Ee.id),On?(Yt.removeContact(),On.captured&&(Ga=!0),On.lastPos=On.currentPos,On.lastTime=On.currentTime,On.currentPos=Ee.currentPos,On.currentTime=Ee.currentTime,On.insideElement||wt(oe,Yt,On),In=On.currentPos,ir=On.currentTime):(a.console.warn("updatePointerUp(): pointerup on untracked gPoint"),Ee.captured=!1,Ee.insideElementPressed=!1,Ee.insideElement=!0,Me(Yt,Ee),On=Ee),!ne.preventGesture&&!ne.defaultPrevented&&(Ga?(ne.shouldReleaseCapture=!0,ne.preventDefault=!0,(oe.dragHandler||oe.dragEndHandler||oe.pinchHandler)&&a.MouseTracker.gesturePointVelocityTracker.removePoint(oe,On),Yt.contacts===0?(oe.releaseHandler&&oe.releaseHandler({eventSource:oe,pointerType:On.type,position:Ve(In,oe.element),buttons:Yt.buttons,insideElementPressed:On.insideElementPressed,insideElementReleased:On.insideElement,isTouchEvent:On.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}),oe.dragEndHandler&&St.sentDragEvent&&oe.dragEndHandler({eventSource:oe,pointerType:On.type,position:Ve(On.currentPos,oe.element),speed:On.speed,direction:On.direction,shift:ne.originalEvent.shiftKey,isTouchEvent:On.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}),St.sentDragEvent=!1,(oe.clickHandler||oe.dblClickHandler)&&On.insideElement&&(Ks=ir-On.contactTime<=oe.clickTimeThreshold&&On.contactPos.distanceTo(In)<=oe.clickDistThreshold,oe.clickHandler&&oe.clickHandler({eventSource:oe,pointerType:On.type,position:Ve(On.currentPos,oe.element),quick:Ks,shift:ne.originalEvent.shiftKey,isTouchEvent:On.type==="touch",originalEvent:ne.originalEvent,originalTarget:On.originalTarget,userData:oe.userData}),oe.dblClickHandler&&Ks&&(Yt.clicks++,Yt.clicks===1?(St.lastClickPos=In,St.dblClickTimeOut=setTimeout(function(){Yt.clicks=0},oe.dblClickTimeThreshold)):Yt.clicks===2&&(clearTimeout(St.dblClickTimeOut),Yt.clicks=0,St.lastClickPos.distanceTo(In)<=oe.dblClickDistThreshold&&oe.dblClickHandler({eventSource:oe,pointerType:On.type,position:Ve(On.currentPos,oe.element),shift:ne.originalEvent.shiftKey,isTouchEvent:On.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}),St.lastClickPos=null)))):Yt.contacts===2&&oe.pinchHandler&&On.type==="touch"&&(St.pinchGPoints=Yt.asArray(),St.lastPinchDist=St.currentPinchDist=St.pinchGPoints[0].currentPos.distanceTo(St.pinchGPoints[1].currentPos),St.lastPinchCenter=St.currentPinchCenter=W(St.pinchGPoints[0].currentPos,St.pinchGPoints[1].currentPos))):(ne.shouldReleaseCapture=!1,oe.releaseHandler&&(oe.releaseHandler({eventSource:oe,pointerType:On.type,position:Ve(In,oe.element),buttons:Yt.buttons,insideElementPressed:On.insideElementPressed,insideElementReleased:On.insideElement,isTouchEvent:On.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}),ne.preventDefault=!0)))}function Pi(oe,ne,Ee){var Pe=c[oe.hash],St=oe.getActivePointersListByType(Ee.type),Yt,In,ir;if(typeof ne.originalEvent.buttons<"u"&&(St.buttons=ne.originalEvent.buttons),Yt=St.getById(Ee.id),Yt)Yt.lastPos=Yt.currentPos,Yt.lastTime=Yt.currentTime,Yt.currentPos=Ee.currentPos,Yt.currentTime=Ee.currentTime;else return;ne.shouldCapture=!1,ne.shouldReleaseCapture=!1,oe.stopHandler&&Ee.type==="mouse"&&(clearTimeout(oe.stopTimeOut),oe.stopTimeOut=setTimeout(function(){Ud(oe,ne.originalEvent,Ee.type)},oe.stopDelay)),St.contacts===0?oe.moveHandler&&oe.moveHandler({eventSource:oe,pointerType:Ee.type,position:Ve(Ee.currentPos,oe.element),buttons:St.buttons,isTouchEvent:Ee.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}):St.contacts===1?(oe.moveHandler&&(Yt=St.asArray()[0],oe.moveHandler({eventSource:oe,pointerType:Yt.type,position:Ve(Yt.currentPos,oe.element),buttons:St.buttons,isTouchEvent:Yt.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData})),oe.dragHandler&&!ne.preventGesture&&!ne.defaultPrevented&&(Yt=St.asArray()[0],ir=Yt.currentPos.minus(Yt.lastPos),oe.dragHandler({eventSource:oe,pointerType:Yt.type,position:Ve(Yt.currentPos,oe.element),buttons:St.buttons,delta:ir,speed:Yt.speed,direction:Yt.direction,shift:ne.originalEvent.shiftKey,isTouchEvent:Yt.type==="touch",originalEvent:ne.originalEvent,userData:oe.userData}),ne.preventDefault=!0,Pe.sentDragEvent=!0)):St.contacts===2&&(oe.moveHandler&&(In=St.asArray(),oe.moveHandler({eventSource:oe,pointerType:In[0].type,position:Ve(W(In[0].currentPos,In[1].currentPos),oe.element),buttons:St.buttons,isTouchEvent:In[0].type==="touch",originalEvent:ne.originalEvent,userData:oe.userData})),oe.pinchHandler&&Ee.type==="touch"&&!ne.preventGesture&&!ne.defaultPrevented&&(ir=Pe.pinchGPoints[0].currentPos.distanceTo(Pe.pinchGPoints[1].currentPos),ir!==Pe.currentPinchDist&&(Pe.lastPinchDist=Pe.currentPinchDist,Pe.currentPinchDist=ir,Pe.lastPinchCenter=Pe.currentPinchCenter,Pe.currentPinchCenter=W(Pe.pinchGPoints[0].currentPos,Pe.pinchGPoints[1].currentPos),oe.pinchHandler({eventSource:oe,pointerType:"touch",gesturePoints:Pe.pinchGPoints,lastCenter:Ve(Pe.lastPinchCenter,oe.element),center:Ve(Pe.currentPinchCenter,oe.element),lastDistance:Pe.lastPinchDist,distance:Pe.currentPinchDist,shift:ne.originalEvent.shiftKey,originalEvent:ne.originalEvent,userData:oe.userData}),ne.preventDefault=!0)))}function lo(oe,ne,Ee){var Pe=oe.getActivePointersListByType(Ee.type),St;St=Pe.getById(Ee.id),St&&wt(oe,Pe,St)}function Ud(oe,ne,Ee){oe.stopHandler&&oe.stopHandler({eventSource:oe,pointerType:Ee,position:ke(ne,oe.element),buttons:oe.getActivePointersListByType(Ee).buttons,isTouchEvent:Ee==="touch",originalEvent:ne,userData:oe.userData})}}(p),function(a){a.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},a.Control=function(c,f,m){var v=c.parentNode;typeof f=="number"&&(a.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),f={anchor:f}),f.attachToViewer=typeof f.attachToViewer>"u"?!0:f.attachToViewer,this.autoFade=typeof f.autoFade>"u"?!0:f.autoFade,this.element=c,this.anchor=f.anchor,this.container=m,this.anchor===a.ControlAnchor.ABSOLUTE?(this.wrapper=a.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof f.top=="number"?f.top+"px":f.top,this.wrapper.style.left=typeof f.left=="number"?f.left+"px":f.left,this.wrapper.style.height=typeof f.height=="number"?f.height+"px":f.height,this.wrapper.style.width=typeof f.width=="number"?f.width+"px":f.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=a.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===a.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),f.attachToViewer?this.anchor===a.ControlAnchor.TOP_RIGHT||this.anchor===a.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):v.appendChild(this.wrapper)},a.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==a.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(c){this.wrapper.style.display=c?this.anchor===a.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(c){this.element[a.SIGNAL]&&a.Browser.vendor===a.BROWSERS.IE?a.setElementOpacity(this.element,c,!0):a.setElementOpacity(this.wrapper,c,!0)}}}(p),function(a){a.ControlDock=function(f){var m=["topleft","topright","bottomright","bottomleft"],v,_;for(a.extend(!0,this,{id:"controldock-"+a.now()+"-"+Math.floor(Math.random()*1e6),container:a.makeNeutralElement("div"),controls:[]},f),this.container.onsubmit=function(){return!1},this.element&&(this.element=a.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),_=0;_=0)){switch(m.anchor){case a.ControlAnchor.TOP_RIGHT:v=this.controls.topright,f.style.position="relative",f.style.paddingRight="0px",f.style.paddingTop="0px";break;case a.ControlAnchor.BOTTOM_RIGHT:v=this.controls.bottomright,f.style.position="relative",f.style.paddingRight="0px",f.style.paddingBottom="0px";break;case a.ControlAnchor.BOTTOM_LEFT:v=this.controls.bottomleft,f.style.position="relative",f.style.paddingLeft="0px",f.style.paddingBottom="0px";break;case a.ControlAnchor.TOP_LEFT:v=this.controls.topleft,f.style.position="relative",f.style.paddingLeft="0px",f.style.paddingTop="0px";break;case a.ControlAnchor.ABSOLUTE:v=this.container,f.style.margin="0px",f.style.padding="0px";break;default:case a.ControlAnchor.NONE:v=this.container,f.style.margin="0px",f.style.padding="0px";break}this.controls.push(new a.Control(f,m,v)),f.style.display="inline-block"}},removeControl:function(f){f=a.getElement(f);var m=c(this,f);return m>=0&&(this.controls[m].destroy(),this.controls.splice(m,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var f;for(f=this.controls.length-1;f>=0;f--)if(this.controls[f].isVisible())return!0;return!1},setControlsEnabled:function(f){var m;for(m=this.controls.length-1;m>=0;m--)this.controls[m].setVisible(f);return this}};function c(f,m){var v=f.controls,_;for(_=v.length-1;_>=0;_--)if(v[_].element===m)return _;return-1}}(p),function(a){a.Placement=a.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(p),function(a){var c={},f=1;a.Viewer=function(J){var Me=arguments,wt=this,Kt;if(a.isPlainObject(J)||(J={id:Me[0],xmlPath:Me.length>1?Me[1]:void 0,prefixUrl:Me.length>2?Me[2]:void 0,controls:Me.length>3?Me[3]:void 0,overlays:Me.length>4?Me[4]:void 0}),J.config&&(a.extend(!0,J,J.config),delete J.config),a.extend(!0,this,{id:J.id,hash:J.hash||f++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},a.DEFAULT_SETTINGS,J),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof c[this.hash]<"u"&&a.console.warn("Hash "+this.hash+" has already been used."),c[this.hash]={fsBoundsDelta:new a.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=a.now(),a.EventSource.call(this),this.addHandler("open-failed",function(Rt){var bn=a.getString("Errors.OpenFailed",Rt.eventSource,Rt.message);wt._showMessage(bn)}),a.ControlDock.call(this,J),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=a.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(Rt){Rt.width="100%",Rt.height="100%",Rt.overflow="hidden",Rt.position="absolute",Rt.top="0px",Rt.left="0px"}(this.canvas.style),a.setElementTouchActionNone(this.canvas),J.tabIndex!==""&&(this.canvas.tabIndex=J.tabIndex===void 0?0:J.tabIndex),this.container.className="openseadragon-container",function(Rt){Rt.width="100%",Rt.height="100%",Rt.position="relative",Rt.overflow="hidden",Rt.left="0px",Rt.top="0px",Rt.textAlign="left"}(this.container.style),a.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new a.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:a.delegate(this,ke),keyDownHandler:a.delegate(this,Ve),keyHandler:a.delegate(this,W),clickHandler:a.delegate(this,Te),dblClickHandler:a.delegate(this,je),dragHandler:a.delegate(this,Be),dragEndHandler:a.delegate(this,tt),enterHandler:a.delegate(this,$e),leaveHandler:a.delegate(this,It),pressHandler:a.delegate(this,Ht),releaseHandler:a.delegate(this,en),nonPrimaryPressHandler:a.delegate(this,ln),nonPrimaryReleaseHandler:a.delegate(this,rn),scrollHandler:a.delegate(this,_n),pinchHandler:a.delegate(this,wn)}),this.outerTracker=new a.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:a.delegate(this,Xn),leaveHandler:a.delegate(this,Gn)}),this.toolbar&&(this.toolbar=new a.ControlDock({element:this.toolbar})),this.bindStandardControls(),c[this.hash].prevContainerSize=m(this.container),this.world=new a.World({viewer:this}),this.world.addHandler("add-item",function(Rt){wt.source=wt.world.getItemAt(0).source,c[wt.hash].forceRedraw=!0,wt._updateRequestId||(wt._updateRequestId=E(wt,Ti))}),this.world.addHandler("remove-item",function(Rt){wt.world.getItemCount()?wt.source=wt.world.getItemAt(0).source:wt.source=null,c[wt.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(Rt){wt.viewport&&wt.viewport._setContentBounds(wt.world.getHomeBounds(),wt.world.getContentFactor())}),this.world.addHandler("item-index-change",function(Rt){wt.source=wt.world.getItemAt(0).source}),this.viewport=new a.Viewport({containerSize:c[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new a.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:J.timeout}),this.tileCache=new a.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new a.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=a.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(Kt=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(Kt,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(Kt=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(Kt,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new a.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),Kt=0;Kt-1&&J.index=0&&J=0)return this;var bn=_(this,Rt);return this.currentOverlays.push(bn),bn.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:J,location:Rt.location,placement:Rt.placement}),this},updateOverlay:function(J,Me,wt){var Kt;return J=a.getElement(J),Kt=S(this.currentOverlays,J),Kt>=0&&(this.currentOverlays[Kt].update(Me,wt),c[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:J,location:Me,placement:wt})),this},removeOverlay:function(J){var Me;return J=a.getElement(J),Me=S(this.currentOverlays,J),Me>=0&&(this.currentOverlays[Me].destroy(),this.currentOverlays.splice(Me,1),c[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:J})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return c[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(J){var Me;return J=a.getElement(J),Me=S(this.currentOverlays,J),Me>=0?this.currentOverlays[Me]:null},_updateSequenceButtons:function(J){this.nextButton&&(!this.tileSources||this.tileSources.length-1===J?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(J>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(J){this._hideMessage();var Me=a.makeNeutralElement("div");Me.appendChild(document.createTextNode(J)),this.messageDiv=a.makeCenteredNode(Me),a.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var J=this.messageDiv;J&&(J.parentNode.removeChild(J),delete this.messageDiv)},gestureSettingsByDeviceType:function(J){switch(J){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var J,Me=this.currentOverlays.length;for(J=0;J1&&(this.referenceStrip=new a.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else a.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),a.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){a.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var J=a.pixelDensityRatio,Me=a.getCurrentPixelDensityRatio();J!==Me&&(a.pixelDensityRatio=Me,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var J=this._sequenceIndex-1;this.navPrevNextWrap&&J<0&&(J+=this.tileSources.length),this.goToPage(J)},goToNextPage:function(){var J=this._sequenceIndex+1;this.navPrevNextWrap&&J>=this.tileSources.length&&(J=0),this.goToPage(J)}});function m(J){return J=a.getElement(J),new a.Point(J.clientWidth===0?1:J.clientWidth,J.clientHeight===0?1:J.clientHeight)}function v(J,Me,wt,Kt,Rt){var bn=J;if(a.type(Me)==="string"){if(Me.match(/^\s*<.*>\s*$/))Me=a.parseXml(Me);else if(Me.match(/^\s*[{[].*[}\]]\s*$/))try{var un=a.parseJSON(Me);Me=un}catch{}}function Qi(vr,Hi){vr.ready?Kt(vr):(vr.addHandler("ready",function(){Kt(vr)}),vr.addHandler("open-failed",function(Qn){Rt({message:Qn.message,source:Hi})}))}setTimeout(function(){if(a.type(Me)==="string")Me=new a.TileSource({url:Me,crossOriginPolicy:wt.crossOriginPolicy!==void 0?wt.crossOriginPolicy:J.crossOriginPolicy,ajaxWithCredentials:J.ajaxWithCredentials,ajaxHeaders:wt.ajaxHeaders?wt.ajaxHeaders:J.ajaxHeaders,useCanvas:J.useCanvas,success:function(es){Kt(es.tileSource)}}),Me.addHandler("open-failed",function(es){Rt(es)});else if(a.isPlainObject(Me)||Me.nodeType)if(Me.crossOriginPolicy===void 0&&(wt.crossOriginPolicy!==void 0||J.crossOriginPolicy!==void 0)&&(Me.crossOriginPolicy=wt.crossOriginPolicy!==void 0?wt.crossOriginPolicy:J.crossOriginPolicy),Me.ajaxWithCredentials===void 0&&(Me.ajaxWithCredentials=J.ajaxWithCredentials),Me.useCanvas===void 0&&(Me.useCanvas=J.useCanvas),a.isFunction(Me.getTileUrl)){var vr=new a.TileSource(Me);vr.getTileUrl=Me.getTileUrl,Kt(vr)}else{var Hi=a.TileSource.determineType(bn,Me);if(!Hi){Rt({message:"Unable to load TileSource",source:Me});return}var Qn=Hi.prototype.configure.apply(bn,[Me]);Qi(new Hi(Qn),Me)}else Qi(Me,Me)})}function _(J,Me){if(Me instanceof a.Overlay)return Me;var wt=null;if(Me.element)wt=a.getElement(Me.element);else{var Kt=Me.id?Me.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);wt=a.getElement(Me.id),wt||(wt=document.createElement("a"),wt.href="#/overlay/"+Kt),wt.id=Kt,a.addClass(wt,Me.className?Me.className:"openseadragon-overlay")}var Rt=Me.location,bn=Me.width,un=Me.height;if(!Rt){var Qi=Me.x,vr=Me.y;if(Me.px!==void 0){var Hi=J.viewport.imageToViewportRectangle(new a.Rect(Me.px,Me.py,bn||0,un||0));Qi=Hi.x,vr=Hi.y,bn=bn!==void 0?Hi.width:void 0,un=un!==void 0?Hi.height:void 0}Rt=new a.Point(Qi,vr)}var Qn=Me.placement;return Qn&&a.type(Qn)==="string"&&(Qn=a.Placement[Me.placement.toUpperCase()]),new a.Overlay({element:wt,location:Rt,placement:Qn,onDraw:Me.onDraw,checkResize:Me.checkResize,width:bn,height:un,rotationMode:Me.rotationMode})}function S(J,Me){var wt;for(wt=J.length-1;wt>=0;wt--)if(J[wt].element===Me)return wt;return-1}function E(J,Me){return a.requestAnimationFrame(function(){Me(J)})}function x(J){a.requestAnimationFrame(function(){V(J)})}function U(J){!J.autoHideControls||(J.controlsShouldFade=!0,J.controlsFadeBeginTime=a.now()+J.controlsFadeDelay,window.setTimeout(function(){x(J)},J.controlsFadeDelay))}function V(J){var Me,wt,Kt,Rt;if(J.controlsShouldFade){for(Me=a.now(),wt=Me-J.controlsFadeBeginTime,Kt=1-wt/J.controlsFadeLength,Kt=Math.min(1,Kt),Kt=Math.max(0,Kt),Rt=J.controls.length-1;Rt>=0;Rt--)J.controls[Rt].autoFade&&J.controls[Rt].setOpacity(Kt);Kt>0&&x(J)}}function ie(J){var Me;for(J.controlsShouldFade=!1,Me=J.controls.length-1;Me>=0;Me--)J.controls[Me].setOpacity(1)}function de(){ie(this)}function Ie(){U(this)}function ke(J){var Me={tracker:J.eventSource,position:J.position,originalEvent:J.originalEvent,preventDefault:J.preventDefault};this.raiseEvent("canvas-contextmenu",Me),J.preventDefault=Me.preventDefault}function Ve(J){var Me={originalEvent:J.originalEvent,preventDefaultAction:!1,preventVerticalPan:J.preventVerticalPan,preventHorizontalPan:J.preventHorizontalPan};if(this.raiseEvent("canvas-key",Me),!Me.preventDefaultAction&&!J.ctrl&&!J.alt&&!J.meta)switch(J.keyCode){case 38:Me.preventVerticalPan||(J.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 40:Me.preventVerticalPan||(J.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 37:Me.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 39:Me.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),J.preventDefault=!0;break;default:J.preventDefault=!1;break}else J.preventDefault=!1}function W(J){var Me={originalEvent:J.originalEvent,preventDefaultAction:!1,preventVerticalPan:J.preventVerticalPan,preventHorizontalPan:J.preventHorizontalPan};if(this.raiseEvent("canvas-key",Me),!Me.preventDefaultAction&&!J.ctrl&&!J.alt&&!J.meta)switch(J.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),J.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),J.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),J.preventDefault=!0;break;case 119:case 87:Me.preventVerticalPan||(J.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,-40))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 115:case 83:Me.preventVerticalPan||(J.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,40))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 97:Me.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(-40,0))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 100:Me.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(40,0))),this.viewport.applyConstraints()),J.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(a.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(a.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),J.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(a.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(a.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),J.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),J.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:J.preventDefault=!1;break}else J.preventDefault=!1}function Te(J){var Me,wt=document.activeElement===this.canvas;wt||this.canvas.focus(),this.viewport.flipped&&(J.position.x=this.viewport.getContainerSize().x-J.position.x);var Kt={tracker:J.eventSource,position:J.position,quick:J.quick,shift:J.shift,originalEvent:J.originalEvent,originalTarget:J.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",Kt),!Kt.preventDefaultAction&&this.viewport&&J.quick&&(Me=this.gestureSettingsByDeviceType(J.pointerType),Me.clickToZoom&&(this.viewport.zoomBy(J.shift?1/this.zoomPerClick:this.zoomPerClick,Me.zoomToRefPoint?this.viewport.pointFromPixel(J.position,!0):null),this.viewport.applyConstraints()))}function je(J){var Me,wt={tracker:J.eventSource,position:J.position,shift:J.shift,originalEvent:J.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",wt),!wt.preventDefaultAction&&this.viewport&&(Me=this.gestureSettingsByDeviceType(J.pointerType),Me.dblClickToZoom&&(this.viewport.zoomBy(J.shift?1/this.zoomPerClick:this.zoomPerClick,Me.zoomToRefPoint?this.viewport.pointFromPixel(J.position,!0):null),this.viewport.applyConstraints()))}function Be(J){var Me,wt={tracker:J.eventSource,pointerType:J.pointerType,position:J.position,delta:J.delta,speed:J.speed,direction:J.direction,shift:J.shift,originalEvent:J.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",wt),Me=this.gestureSettingsByDeviceType(J.pointerType),Me.dragToPan&&!wt.preventDefaultAction&&this.viewport){if(this.panHorizontal||(J.delta.x=0),this.panVertical||(J.delta.y=0),this.viewport.flipped&&(J.delta.x=-J.delta.x),this.constrainDuringPan){var Kt=this.viewport.deltaPointsFromPixels(J.delta.negate());this.viewport.centerSpringX.target.value+=Kt.x,this.viewport.centerSpringY.target.value+=Kt.y;var Rt=this.viewport.getBounds(),bn=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=Kt.x,this.viewport.centerSpringY.target.value-=Kt.y,Rt.x!==bn.x&&(J.delta.x=0),Rt.y!==bn.y&&(J.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(J.delta.negate()),Me.flickEnabled&&!this.constrainDuringPan)}}function tt(J){var Me={tracker:J.eventSource,pointerType:J.pointerType,position:J.position,speed:J.speed,direction:J.direction,shift:J.shift,originalEvent:J.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",Me),!Me.preventDefaultAction&&this.viewport){var wt=this.gestureSettingsByDeviceType(J.pointerType);if(wt.flickEnabled&&J.speed>=wt.flickMinSpeed){var Kt=0;this.panHorizontal&&(Kt=wt.flickMomentum*J.speed*Math.cos(J.direction));var Rt=0;this.panVertical&&(Rt=wt.flickMomentum*J.speed*Math.sin(J.direction));var bn=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),un=this.viewport.pointFromPixel(new a.Point(bn.x-Kt,bn.y-Rt));this.viewport.panTo(un,!1)}this.viewport.applyConstraints()}}function $e(J){this.raiseEvent("canvas-enter",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,buttons:J.buttons,pointers:J.pointers,insideElementPressed:J.insideElementPressed,buttonDownAny:J.buttonDownAny,originalEvent:J.originalEvent})}function It(J){this.raiseEvent("canvas-exit",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,buttons:J.buttons,pointers:J.pointers,insideElementPressed:J.insideElementPressed,buttonDownAny:J.buttonDownAny,originalEvent:J.originalEvent})}function Ht(J){this.raiseEvent("canvas-press",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,insideElementPressed:J.insideElementPressed,insideElementReleased:J.insideElementReleased,originalEvent:J.originalEvent})}function en(J){this.raiseEvent("canvas-release",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,insideElementPressed:J.insideElementPressed,insideElementReleased:J.insideElementReleased,originalEvent:J.originalEvent})}function ln(J){this.raiseEvent("canvas-nonprimary-press",{tracker:J.eventSource,position:J.position,pointerType:J.pointerType,button:J.button,buttons:J.buttons,originalEvent:J.originalEvent})}function rn(J){this.raiseEvent("canvas-nonprimary-release",{tracker:J.eventSource,position:J.position,pointerType:J.pointerType,button:J.button,buttons:J.buttons,originalEvent:J.originalEvent})}function wn(J){var Me,wt,Kt,Rt,bn={tracker:J.eventSource,pointerType:J.pointerType,gesturePoints:J.gesturePoints,lastCenter:J.lastCenter,center:J.center,lastDistance:J.lastDistance,distance:J.distance,shift:J.shift,originalEvent:J.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",bn),this.viewport&&(Me=this.gestureSettingsByDeviceType(J.pointerType),Me.pinchToZoom&&(!bn.preventDefaultPanAction||!bn.preventDefaultZoomAction)&&(wt=this.viewport.pointFromPixel(J.center,!0),bn.preventDefaultZoomAction||this.viewport.zoomBy(J.distance/J.lastDistance,wt,!0),Me.zoomToRefPoint&&!bn.preventDefaultPanAction&&(Kt=this.viewport.pointFromPixel(J.lastCenter,!0),Rt=Kt.minus(wt),this.panHorizontal||(Rt.x=0),this.panVertical||(Rt.y=0),this.viewport.panBy(Rt,!0)),this.viewport.applyConstraints()),Me.pinchRotate&&!bn.preventDefaultRotateAction)){var un=Math.atan2(J.gesturePoints[0].currentPos.y-J.gesturePoints[1].currentPos.y,J.gesturePoints[0].currentPos.x-J.gesturePoints[1].currentPos.x),Qi=Math.atan2(J.gesturePoints[0].lastPos.y-J.gesturePoints[1].lastPos.y,J.gesturePoints[0].lastPos.x-J.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(un-Qi)*(180/Math.PI))}}function _n(J){var Me,wt,Kt,Rt,bn;Rt=a.now(),bn=Rt-this._lastScrollTime,bn>this.minScrollDeltaTime?(this._lastScrollTime=Rt,Me={tracker:J.eventSource,position:J.position,scroll:J.scroll,shift:J.shift,originalEvent:J.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",Me),!Me.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(J.position.x=this.viewport.getContainerSize().x-J.position.x),wt=this.gestureSettingsByDeviceType(J.pointerType),wt.scrollToZoom&&(Kt=Math.pow(this.zoomPerScroll,J.scroll),this.viewport.zoomBy(Kt,wt.zoomToRefPoint?this.viewport.pointFromPixel(J.position,!0):null),this.viewport.applyConstraints())),J.preventDefault=Me.preventDefault):J.preventDefault=!0}function Xn(J){c[this.hash].mouseInside=!0,ie(this),this.raiseEvent("container-enter",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,buttons:J.buttons,pointers:J.pointers,insideElementPressed:J.insideElementPressed,buttonDownAny:J.buttonDownAny,originalEvent:J.originalEvent})}function Gn(J){J.pointers<1&&(c[this.hash].mouseInside=!1,c[this.hash].animating||U(this)),this.raiseEvent("container-exit",{tracker:J.eventSource,pointerType:J.pointerType,position:J.position,buttons:J.buttons,pointers:J.pointers,insideElementPressed:J.insideElementPressed,buttonDownAny:J.buttonDownAny,originalEvent:J.originalEvent})}function Ti(J){Mi(J),J.isOpen()?J._updateRequestId=E(J,Ti):J._updateRequestId=!1}function Mi(J){if(!(J._opening||!c[J.hash])){if(J.autoResize){var Me=m(J.container),wt=c[J.hash].prevContainerSize;if(!Me.equals(wt)){var Kt=J.viewport;if(J.preserveImageSizeOnResize){var Rt=wt.x/Me.x,bn=Kt.getZoom()*Rt,un=Kt.getCenter();Kt.resize(Me,!1),Kt.zoomTo(bn,null,!0),Kt.panTo(un,!0)}else{var Qi=Kt.getBounds();Kt.resize(Me,!0),Kt.fitBoundsWithConstraints(Qi,!0)}c[J.hash].prevContainerSize=Me,c[J.hash].forceRedraw=!0}}var vr=J.viewport.update(),Hi=J.world.update()||vr;vr&&J.raiseEvent("viewport-change"),J.referenceStrip&&(Hi=J.referenceStrip.update(J.viewport)||Hi),!c[J.hash].animating&&Hi&&(J.raiseEvent("animation-start"),ie(J)),(Hi||c[J.hash].forceRedraw||J.world.needsDraw())&&(yr(J),J._drawOverlays(),J.navigator&&J.navigator.update(J.viewport),c[J.hash].forceRedraw=!1,Hi&&J.raiseEvent("animation")),c[J.hash].animating&&!Hi&&(J.raiseEvent("animation-finish"),c[J.hash].mouseInside||U(J)),c[J.hash].animating=Hi}}function yr(J){J.imageLoader.clear(),J.drawer.clear(),J.world.draw(),J.raiseEvent("update-viewport",{})}function mn(J,Me){return J?J+Me:Me}function Ui(){c[this.hash].lastZoomTime=a.now(),c[this.hash].zoomFactor=this.zoomPerSecond,c[this.hash].zooming=!0,Do(this)}function Wc(){c[this.hash].lastZoomTime=a.now(),c[this.hash].zoomFactor=1/this.zoomPerSecond,c[this.hash].zooming=!0,Do(this)}function nu(){c[this.hash].zooming=!1}function Do(J){a.requestAnimationFrame(a.delegate(J,qa))}function qa(){var J,Me,wt;c[this.hash].zooming&&this.viewport&&(J=a.now(),Me=J-c[this.hash].lastZoomTime,wt=Math.pow(c[this.hash].zoomFactor,Me/1e3),this.viewport.zoomBy(wt),this.viewport.applyConstraints(),c[this.hash].lastZoomTime=J,Do(this))}function Xu(){this.viewport&&(c[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Tl(){this.viewport&&(c[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function xf(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Cf(){this.viewport&&this.viewport.goHome()}function Rh(){this.isFullPage()&&!a.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function Af(){if(this.viewport){var J=this.viewport.getRotation();this.viewport.flipped?J=a.positiveModulo(J+this.rotationIncrement,360):J=a.positiveModulo(J-this.rotationIncrement,360),this.viewport.setRotation(J)}}function kf(){if(this.viewport){var J=this.viewport.getRotation();this.viewport.flipped?J=a.positiveModulo(J-this.rotationIncrement,360):J=a.positiveModulo(J+this.rotationIncrement,360),this.viewport.setRotation(J)}}function Pf(){this.viewport.toggleFlip()}}(p),function(a){a.Navigator=function(E){var x=E.viewer,U=this,V,ie;E.id?(this.element=document.getElementById(E.id),E.controlOptions={anchor:a.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(E.id="navigator-"+a.now(),this.element=a.makeNeutralElement("div"),E.controlOptions={anchor:a.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:E.autoFade},E.position&&(E.position==="BOTTOM_RIGHT"?E.controlOptions.anchor=a.ControlAnchor.BOTTOM_RIGHT:E.position==="BOTTOM_LEFT"?E.controlOptions.anchor=a.ControlAnchor.BOTTOM_LEFT:E.position==="TOP_RIGHT"?E.controlOptions.anchor=a.ControlAnchor.TOP_RIGHT:E.position==="TOP_LEFT"?E.controlOptions.anchor=a.ControlAnchor.TOP_LEFT:E.position==="ABSOLUTE"&&(E.controlOptions.anchor=a.ControlAnchor.ABSOLUTE,E.controlOptions.top=E.top,E.controlOptions.left=E.left,E.controlOptions.height=E.height,E.controlOptions.width=E.width))),this.element.id=E.id,this.element.className+=" navigator",E=a.extend(!0,{sizeRatio:a.DEFAULT_SETTINGS.navigatorSizeRatio},E,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:E.autoResize,minZoomImageRatio:1,background:E.background,opacity:E.opacity,borderColor:E.borderColor,displayRegionColor:E.displayRegionColor}),E.minPixelRatio=this.minPixelRatio=x.minPixelRatio,a.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new a.Point(1,1),this.totalBorderWidths=new a.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),E.controlOptions.anchor!==a.ControlAnchor.NONE&&function(ke,Ve){ke.margin="0px",ke.border=Ve+"px solid "+E.borderColor,ke.padding="0px",ke.background=E.background,ke.opacity=E.opacity,ke.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=a.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(ke,Ve){ke.position="relative",ke.top="0px",ke.left="0px",ke.fontSize="0px",ke.overflow="hidden",ke.border=Ve+"px solid "+E.displayRegionColor,ke.margin="0px",ke.padding="0px",ke.background="transparent",ke.float="left",ke.cssFloat="left",ke.styleFloat="left",ke.zIndex=999999999,ke.cursor="default"}(this.displayRegion.style,this.borderWidth),a.setElementPointerEventsNone(this.displayRegion),a.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=a.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",a.setElementPointerEventsNone(this.displayRegionContainer),a.setElementTouchActionNone(this.displayRegionContainer),x.addControl(this.element,E.controlOptions),this._resizeWithViewer=E.controlOptions.anchor!==a.ControlAnchor.ABSOLUTE&&E.controlOptions.anchor!==a.ControlAnchor.NONE,E.width&&E.height?(this.setWidth(E.width),this.setHeight(E.height)):this._resizeWithViewer&&(V=a.getElementSize(x.element),this.element.style.height=Math.round(V.y*E.sizeRatio)+"px",this.element.style.width=Math.round(V.x*E.sizeRatio)+"px",this.oldViewerSize=V,ie=a.getElementSize(this.element),this.elementArea=ie.x*ie.y),this.oldContainerSize=new a.Point(0,0),a.Viewer.apply(this,[E]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function de(ke){_(U.displayRegionContainer,ke),_(U.displayRegion,-ke),U.viewport.setRotation(ke)}if(E.navigatorRotate){var Ie=E.viewer.viewport?E.viewer.viewport.getRotation():E.viewer.degrees||0;de(Ie),E.viewer.addHandler("rotate",function(ke){de(ke.degrees)})}this.innerTracker.destroy(),this.innerTracker=new a.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:a.delegate(this,f),clickHandler:a.delegate(this,c),releaseHandler:a.delegate(this,m),scrollHandler:a.delegate(this,v),preProcessEventHandler:function(ke){ke.eventType==="wheel"&&(ke.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",a.setElementPointerEventsNone(this.canvas),a.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){U.viewport&&U.viewport.goHome(!0)}),x.world.addHandler("item-index-change",function(ke){window.setTimeout(function(){var Ve=U.world.getItemAt(ke.previousIndex);U.world.setItemIndex(Ve,ke.newIndex)},1)}),x.world.addHandler("remove-item",function(ke){var Ve=ke.item,W=U._getMatchingItem(Ve);W&&U.world.removeItem(W)}),this.update(x.viewport)},a.extend(a.Navigator.prototype,a.EventSource.prototype,a.Viewer.prototype,{updateSize:function(){if(this.viewport){var E=new a.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);E.equals(this.oldContainerSize)||(this.viewport.resize(E,!0),this.viewport.goHome(!0),this.oldContainerSize=E,this.drawer.clear(),this.world.draw())}},setWidth:function(E){this.width=E,this.element.style.width=typeof E=="number"?E+"px":E,this._resizeWithViewer=!1},setHeight:function(E){this.height=E,this.element.style.height=typeof E=="number"?E+"px":E,this._resizeWithViewer=!1},setFlip:function(E){return this.viewport.setFlip(E),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(E){S(this.displayRegion,E),S(this.canvas,E),S(this.element,E)},update:function(E){var x,U,V,ie,de,Ie;if(x=a.getElementSize(this.viewer.element),this._resizeWithViewer&&x.x&&x.y&&!x.equals(this.oldViewerSize)&&(this.oldViewerSize=x,this.maintainSizeRatio||!this.elementArea?(U=x.x*this.sizeRatio,V=x.y*this.sizeRatio):(U=Math.sqrt(this.elementArea*(x.x/x.y)),V=this.elementArea/U),this.element.style.width=Math.round(U)+"px",this.element.style.height=Math.round(V)+"px",this.elementArea||(this.elementArea=U*V),this.updateSize()),E&&this.viewport){ie=E.getBoundsNoRotate(!0),de=this.viewport.pixelFromPointNoRotate(ie.getTopLeft(),!1),Ie=this.viewport.pixelFromPointNoRotate(ie.getBottomRight(),!1).minus(this.totalBorderWidths);var ke=this.displayRegion.style;ke.display=this.world.getItemCount()?"block":"none",ke.top=Math.round(de.y)+"px",ke.left=Math.round(de.x)+"px";var Ve=Math.abs(de.x-Ie.x),W=Math.abs(de.y-Ie.y);ke.width=Math.round(Math.max(Ve,0))+"px",ke.height=Math.round(Math.max(W,0))+"px"}},addTiledImage:function(E){var x=this,U=E.originalTiledImage;delete E.original;var V=a.extend({},E,{success:function(ie){var de=ie.item;de._originalForNavigator=U,x._matchBounds(de,U,!0),x._matchOpacity(de,U),x._matchCompositeOperation(de,U);function Ie(){x._matchBounds(de,U)}function ke(){x._matchOpacity(de,U)}function Ve(){x._matchCompositeOperation(de,U)}U.addHandler("bounds-change",Ie),U.addHandler("clip-change",Ie),U.addHandler("opacity-change",ke),U.addHandler("composite-operation-change",Ve)}});return a.Viewer.prototype.addTiledImage.apply(this,[V])},destroy:function(){return a.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(E){for(var x=this.world.getItemCount(),U,V=0;V1||m.y>1));f++);return f-1},getTileAtPoint:function(f,m){var v=m.x>=0&&m.x<=1&&m.y>=0&&m.y<=1/this.aspectRatio;a.console.assert(v,"[TileSource.getTileAtPoint] must be called with a valid point.");var _=this.dimensions.x*this.getLevelScale(f),S=m.x*_,E=m.y*_,x=Math.floor(S/this.getTileWidth(f)),U=Math.floor(E/this.getTileHeight(f));m.x>=1&&(x=this.getNumTiles(f).x-1);var V=1e-15;return m.y>=1/this.aspectRatio-V&&(U=this.getNumTiles(f).y-1),new a.Point(x,U)},getTileBounds:function(f,m,v,_){var S=this.dimensions.times(this.getLevelScale(f)),E=this.getTileWidth(f),x=this.getTileHeight(f),U=m===0?0:E*m-this.tileOverlap,V=v===0?0:x*v-this.tileOverlap,ie=E+(m===0?1:2)*this.tileOverlap,de=x+(v===0?1:2)*this.tileOverlap,Ie=1/S.x;return ie=Math.min(ie,S.x-U),de=Math.min(de,S.y-V),_?new a.Rect(0,0,ie,de):new a.Rect(U*Ie,V*Ie,ie*Ie,de*Ie)},getImageInfo:function(f){var m=this,v,_,S,E,x,U,V;f&&(x=f.split("/"),U=x[x.length-1],V=U.lastIndexOf("."),V>-1&&(x[x.length-1]=U.slice(0,V))),_=function(ie){typeof ie=="string"&&(ie=a.parseXml(ie));var de=a.TileSource.determineType(m,ie,f);if(!de){m.raiseEvent("open-failed",{message:"Unable to load TileSource",source:f});return}E=de.prototype.configure.apply(m,[ie,f]),E.ajaxWithCredentials===void 0&&(E.ajaxWithCredentials=m.ajaxWithCredentials),S=new de(E),m.ready=!0,m.raiseEvent("ready",{tileSource:S})},f.match(/\.js$/)?(v=f.split("/").pop().replace(".js",""),a.jsonp({url:f,async:!1,callbackName:v,callback:_})):a.makeAjaxRequest({url:f,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(ie){var de=c(ie);_(de)},error:function(ie,de){var Ie;try{Ie="HTTP "+ie.status+" attempting to load TileSource"}catch{var ke;typeof de>"u"||!de.toString?ke="Unknown error":ke=de.toString(),Ie=ke+" attempting to load TileSource"}m.raiseEvent("open-failed",{message:Ie,source:f})}})},supports:function(f,m){return!1},configure:function(f,m){throw new Error("Method not implemented.")},getTileUrl:function(f,m,v){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(f,m,v){return{}},tileExists:function(f,m,v){var _=this.getNumTiles(f);return f>=this.minLevel&&f<=this.maxLevel&&m>=0&&v>=0&&m<_.x&&v<_.y}},a.extend(!0,a.TileSource.prototype,a.EventSource.prototype);function c(f){var m=f.responseText,v=f.status,_,S;if(f){if(f.status!==200&&f.status!==0)throw v=f.status,_=v===404?"Not Found":f.statusText,new Error(a.getString("Errors.Status",v,_))}else throw new Error(a.getString("Errors.Security"));if(m.match(/\s*<.*/))try{S=f.responseXML&&f.responseXML.documentElement?f.responseXML:a.parseXml(m)}catch{S=f.responseText}else if(m.match(/\s*[{[].*/))try{S=a.parseJSON(m)}catch{S=m}else S=m;return S}a.TileSource.determineType=function(f,m,v){var _;for(_ in p)if(_.match(/.+TileSource$/)&&a.isFunction(p[_])&&a.isFunction(p[_].prototype.supports)&&p[_].prototype.supports.call(f,m,v))return p[_];return a.console.error("No TileSource was able to open %s %s",v,m),null}}(p),function(a){a.DziTileSource=function(m,v,_,S,E,x,U,V,ie){var de,Ie,ke,Ve;if(a.isPlainObject(m)?Ve=m:Ve={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=Ve.tilesUrl,this.fileFormat=Ve.fileFormat,this.displayRects=Ve.displayRects,this.displayRects)for(de=this.displayRects.length-1;de>=0;de--)for(Ie=this.displayRects[de],ke=Ie.minLevel;ke<=Ie.maxLevel;ke++)this._levelRects[ke]||(this._levelRects[ke]=[]),this._levelRects[ke].push(Ie);a.TileSource.apply(this,[Ve])},a.extend(a.DziTileSource.prototype,a.TileSource.prototype,{supports:function(m,v){var _;return m.Image?_=m.Image.xmlns:m.documentElement&&(m.documentElement.localName==="Image"||m.documentElement.tagName==="Image")&&(_=m.documentElement.namespaceURI),_=(_||"").toLowerCase(),_.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||_.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(m,v){var _;return a.isPlainObject(m)?_=f(this,m):_=c(this,m),v&&!_.tilesUrl&&(_.tilesUrl=v.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),v.search(/\.(dzi|xml|js)\?/)!==-1?_.queryParams=v.match(/\?.*/):_.queryParams=""),_},getTileUrl:function(m,v,_){return[this.tilesUrl,m,"/",v,"_",_,".",this.fileFormat,this.queryParams].join("")},tileExists:function(m,v,_){var S=this._levelRects[m],E,x,U,V,ie,de,Ie;if(this.minLevel&&mthis.maxLevel)return!1;if(!S||!S.length)return!0;for(Ie=S.length-1;Ie>=0;Ie--)if(E=S[Ie],!(mE.maxLevel)&&(x=this.getLevelScale(m),U=E.x*x,V=E.y*x,ie=U+E.width*x,de=V+E.height*x,U=Math.floor(U/this._tileWidth),V=Math.floor(V/this._tileWidth),ie=Math.ceil(ie/this._tileWidth),de=Math.ceil(de/this._tileWidth),U<=v&&v0?_.tileSize=Math.max.apply(null,ie):_.tileSize=U}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,_.levels=f(this),a.extend(!0,_,{width:_.levels[_.levels.length-1].width,height:_.levels[_.levels.length-1].height,tileSize:Math.max(_.height,_.width),tileOverlap:0,minLevel:0,maxLevel:_.levels.length-1}),this.levels=_.levels):a.console.error("Nothing in the info.json to construct image pyramids from");if(!_.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)_.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var Ie=Math.max.apply(null,this.scale_factors);_.maxLevel=Math.round(Math.log(Ie)*Math.LOG2E)}a.TileSource.apply(this,[_])},a.extend(a.IIIFTileSource.prototype,a.TileSource.prototype,{supports:function(_,S){return _.protocol&&_.protocol==="http://iiif.io/api/image"||_["@context"]&&(_["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||_["@context"]==="http://iiif.io/api/image/1/context.json")||_.profile&&_.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||_.identifier&&_.width&&_.height?!0:!!(_.documentElement&&_.documentElement.tagName==="info"&&_.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(_,S){if(a.isPlainObject(_)){if(!_["@context"])_["@context"]="http://iiif.io/api/image/1.0/context.json",_["@id"]=S.replace("/info.json",""),_.version=1;else{var E=_["@context"];if(Array.isArray(E)){for(var x=0;x0&&_>=this.minLevel&&_<=this.maxLevel&&(S=this.levels[_].width/this.levels[this.maxLevel].width),S}return a.TileSource.prototype.getLevelScale.call(this,_)},getNumTiles:function(_){if(this.emulateLegacyImagePyramid){var S=this.getLevelScale(_);return S?new a.Point(1,1):new a.Point(0,0)}return a.TileSource.prototype.getNumTiles.call(this,_)},getTileAtPoint:function(_,S){return this.emulateLegacyImagePyramid?new a.Point(0,0):a.TileSource.prototype.getTileAtPoint.call(this,_,S)},getTileUrl:function(_,S,E){if(this.emulateLegacyImagePyramid){var x=null;return this.levels.length>0&&_>=this.minLevel&&_<=this.maxLevel&&(x=this.levels[_].url),x}var U="0",V=Math.pow(.5,this.maxLevel-_),ie=Math.ceil(this.width*V),de=Math.ceil(this.height*V),Ie,ke,Ve,W,Te,je,Be,tt,$e,It,Ht,en,ln,rn;return Ie=this.getTileWidth(_),ke=this.getTileHeight(_),Ve=Math.ceil(Ie/V),W=Math.ceil(ke/V),this.version===1?ln="native."+this.tileFormat:ln="default."+this.tileFormat,ie1&&_.profile[1].supports&&(U=_.profile[1].supports.indexOf("sizeByW")!==-1),_.version===3&&_.extraFeatures&&(U=_.extraFeatures.indexOf("sizeByWh")!==-1),!x||U}function f(_){for(var S=[],E=0;E<_.sizes.length;E++)S.push({url:_["@id"]+"/full/"+_.sizes[E].width+","+(_.version===3?_.sizes[E].height:"")+"/0/default."+_.tileFormat,width:_.sizes[E].width,height:_.sizes[E].height});return S.sort(function(x,U){return x.width-U.width})}function m(_){if(!_||!_.documentElement)throw new Error(a.getString("Errors.Xml"));var S=_.documentElement,E=S.tagName,x=null;if(E==="info")try{return x={},v(S,x),x}catch(U){throw U instanceof Error?U:new Error(a.getString("Errors.IIIF"))}throw new Error(a.getString("Errors.IIIF"))}function v(_,S,E){var x,U;if(_.nodeType===3&&E)U=_.nodeValue.trim(),U.match(/^\d*$/)&&(U=Number(U)),S[E]?(a.isArray(S[E])||(S[E]=[S[E]]),S[E].push(U)):S[E]=U;else if(_.nodeType===1)for(x=0;x<_.childNodes.length;x++)v(_.childNodes[x],S,_.nodeName)}}(p),function(a){a.OsmTileSource=function(c,f,m,v,_){var S;a.isPlainObject(c)?S=c:S={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]},(!S.width||!S.height)&&(S.width=65572864,S.height=65572864),S.tileSize||(S.tileSize=256,S.tileOverlap=0),S.tilesUrl||(S.tilesUrl="http://tile.openstreetmap.org/"),S.minLevel=8,a.TileSource.apply(this,[S])},a.extend(a.OsmTileSource.prototype,a.TileSource.prototype,{supports:function(c,f){return c.type&&c.type==="openstreetmaps"},configure:function(c,f){return c},getTileUrl:function(c,f,m){return this.tilesUrl+(c-8)+"/"+f+"/"+m+".png"}})}(p),function(a){a.TmsTileSource=function(c,f,m,v,_){var S;a.isPlainObject(c)?S=c:S={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var E=Math.ceil(S.width/256)*256,x=Math.ceil(S.height/256)*256,U;E>x?U=E/256:U=x/256,S.maxLevel=Math.ceil(Math.log(U)/Math.log(2))-1,S.tileSize=256,S.width=E,S.height=x,a.TileSource.apply(this,[S])},a.extend(a.TmsTileSource.prototype,a.TileSource.prototype,{supports:function(c,f){return c.type&&c.type==="tiledmapservice"},configure:function(c,f){return c},getTileUrl:function(c,f,m){var v=this.getNumTiles(c).y-1;return this.tilesUrl+c+"/"+f+"/"+(v-m)+".png"}})}(p),function(a){a.ZoomifyTileSource=function(c){typeof c.tileSize>"u"&&(c.tileSize=256),typeof c.fileFormat>"u"&&(c.fileFormat="jpg",this.fileFormat=c.fileFormat);var f={x:c.width,y:c.height};for(c.imageSizes=[{x:c.width,y:c.height}],c.gridSize=[this._getGridSize(c.width,c.height,c.tileSize)];parseInt(f.x,10)>c.tileSize||parseInt(f.y,10)>c.tileSize;)f.x=Math.floor(f.x/2),f.y=Math.floor(f.y/2),c.imageSizes.push({x:f.x,y:f.y}),c.gridSize.push(this._getGridSize(f.x,f.y,c.tileSize));c.imageSizes.reverse(),c.gridSize.reverse(),c.minLevel=0,c.maxLevel=c.gridSize.length-1,p.TileSource.apply(this,[c])},a.extend(a.ZoomifyTileSource.prototype,a.TileSource.prototype,{_getGridSize:function(c,f,m){return{x:Math.ceil(c/m),y:Math.ceil(f/m)}},_calculateAbsoluteTileNumber:function(c,f,m){for(var v=0,_={},S=0;S0?(S=_.levels[_.levels.length-1].width,E=_.levels[_.levels.length-1].height):(S=0,E=0,a.console.error("No supported image formats found")),a.extend(!0,_,{width:S,height:E,tileSize:Math.max(E,S),tileOverlap:0,minLevel:0,maxLevel:_.levels.length>0?_.levels.length-1:0}),a.TileSource.apply(this,[_]),this.levels=_.levels},a.extend(a.LegacyTileSource.prototype,a.TileSource.prototype,{supports:function(v,_){return v.type&&v.type==="legacy-image-pyramid"||v.documentElement&&v.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(v,_){var S;return a.isPlainObject(v)?S=m(this,v):S=f(this,v),S},getLevelScale:function(v){var _=NaN;return this.levels.length>0&&v>=this.minLevel&&v<=this.maxLevel&&(_=this.levels[v].width/this.levels[this.maxLevel].width),_},getNumTiles:function(v){var _=this.getLevelScale(v);return _?new a.Point(1,1):new a.Point(0,0)},getTileUrl:function(v,_,S){var E=null;return this.levels.length>0&&v>=this.minLevel&&v<=this.maxLevel&&(E=this.levels[v].url),E}});function c(v){var _=[],S,E;for(E=0;E");return _.sort(function(x,U){return x.height-U.height})}function f(v,_){if(!_||!_.documentElement)throw new Error(a.getString("Errors.Xml"));var S=_.documentElement,E=S.tagName,x=null,U=[],V,ie;if(E==="image")try{for(x={type:S.getAttribute("type"),levels:[]},U=S.getElementsByTagName("level"),ie=0;ie=this.minLevel&&c<=this.maxLevel&&(f=this.levels[c].width/this.levels[this.maxLevel].width),f},getNumTiles:function(c){var f=this.getLevelScale(c);return f?new a.Point(1,1):new a.Point(0,0)},getTileUrl:function(c,f,m){var v=null;return c>=this.minLevel&&c<=this.maxLevel&&(v=this.levels[c].url),v},getContext2D:function(c,f,m){var v=null;return c>=this.minLevel&&c<=this.maxLevel&&(v=this.levels[c].context2D),v},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var c=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!a.supportsCanvas||!this.useCanvas)return delete this._image,c;var f=this._image.naturalWidth,m=this._image.naturalHeight,v=document.createElement("canvas"),_=v.getContext("2d");if(v.width=f,v.height=m,_.drawImage(this._image,0,0,f,m),c[0].context2D=_,delete this._image,a.isCanvasTainted(v))return c;for(;f>=2&&m>=2;){f=Math.floor(f/2),m=Math.floor(m/2);var S=document.createElement("canvas"),E=S.getContext("2d");S.width=f,S.height=m,E.drawImage(v,0,0,f,m),c.splice(0,0,{context2D:E,width:f,height:m}),v=S,_=E}return c},_freeupCanvasMemory:function(){for(var c=0;c0&&c(E))}function m(E){E.shouldFade=!0,E.fadeBeginTime=a.now()+E.fadeDelay,window.setTimeout(function(){c(E)},E.fadeDelay)}function v(E){E.shouldFade=!1,E.imgGroup&&a.setElementOpacity(E.imgGroup,1,!0)}function _(E,x){E.element.disabled||(x>=a.ButtonState.GROUP&&E.currentState===a.ButtonState.REST&&(v(E),E.currentState=a.ButtonState.GROUP),x>=a.ButtonState.HOVER&&E.currentState===a.ButtonState.GROUP&&(E.imgHover&&(E.imgHover.style.visibility=""),E.currentState=a.ButtonState.HOVER),x>=a.ButtonState.DOWN&&E.currentState===a.ButtonState.HOVER&&(E.imgDown&&(E.imgDown.style.visibility=""),E.currentState=a.ButtonState.DOWN))}function S(E,x){E.element.disabled||(x<=a.ButtonState.HOVER&&E.currentState===a.ButtonState.DOWN&&(E.imgDown&&(E.imgDown.style.visibility="hidden"),E.currentState=a.ButtonState.HOVER),x<=a.ButtonState.GROUP&&E.currentState===a.ButtonState.HOVER&&(E.imgHover&&(E.imgHover.style.visibility="hidden"),E.currentState=a.ButtonState.GROUP),x<=a.ButtonState.REST&&E.currentState===a.ButtonState.GROUP&&(m(E),E.currentState=a.ButtonState.REST))}}(p),function(a){a.ButtonGroup=function(c){a.extend(!0,this,{buttons:[],clickTimeThreshold:a.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:a.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},c);var f=this.buttons.concat([]),m=this,v;if(this.element=c.element||a.makeNeutralElement("div"),!c.group)for(this.element.style.display="inline-block",v=0;v=270?(S=this.getTopRight(),this.x=S.x,this.y=S.y,E=this.height,this.height=this.width,this.width=E,this.degrees-=270):this.degrees>=180?(S=this.getBottomRight(),this.x=S.x,this.y=S.y,this.degrees-=180):this.degrees>=90&&(S=this.getBottomLeft(),this.x=S.x,this.y=S.y,E=this.height,this.height=this.width,this.width=E,this.degrees-=90)},a.Rect.fromSummits=function(c,f,m){var v=c.distanceTo(f),_=c.distanceTo(m),S=f.minus(c),E=Math.atan(S.y/S.x);return S.x<0?E+=Math.PI:S.y<0&&(E+=2*Math.PI),new a.Rect(c.x,c.y,v,_,E/Math.PI*180)},a.Rect.prototype={clone:function(){return new a.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new a.Point(this.x,this.y)},getBottomRight:function(){return new a.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new a.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new a.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new a.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new a.Point(this.width,this.height)},equals:function(c){return c instanceof a.Rect&&this.x===c.x&&this.y===c.y&&this.width===c.width&&this.height===c.height&&this.degrees===c.degrees},times:function(c){return new a.Rect(this.x*c,this.y*c,this.width*c,this.height*c,this.degrees)},translate:function(c){return new a.Rect(this.x+c.x,this.y+c.y,this.width,this.height,this.degrees)},union:function(c){var f=this.getBoundingBox(),m=c.getBoundingBox(),v=Math.min(f.x,m.x),_=Math.min(f.y,m.y),S=Math.max(f.x+f.width,m.x+m.width),E=Math.max(f.y+f.height,m.y+m.height);return new a.Rect(v,_,S-v,E-_)},intersection:function(c){var f=1e-10,m=[],v=this.getTopLeft();c.containsPoint(v,f)&&m.push(v);var _=this.getTopRight();c.containsPoint(_,f)&&m.push(_);var S=this.getBottomLeft();c.containsPoint(S,f)&&m.push(S);var E=this.getBottomRight();c.containsPoint(E,f)&&m.push(E);var x=c.getTopLeft();this.containsPoint(x,f)&&m.push(x);var U=c.getTopRight();this.containsPoint(U,f)&&m.push(U);var V=c.getBottomLeft();this.containsPoint(V,f)&&m.push(V);var ie=c.getBottomRight();this.containsPoint(ie,f)&&m.push(ie);for(var de=this._getSegments(),Ie=c._getSegments(),ke=0;ke$e&&($e=ln.x),ln.yHt&&(Ht=ln.y)}return new a.Rect(tt,It,$e-tt,Ht-It)},_getSegments:function(){var c=this.getTopLeft(),f=this.getTopRight(),m=this.getBottomLeft(),v=this.getBottomRight();return[[c,f],[f,v],[v,m],[m,c]]},rotate:function(c,f){if(c=a.positiveModulo(c,360),c===0)return this.clone();f=f||this.getCenter();var m=this.getTopLeft().rotate(c,f),v=this.getTopRight().rotate(c,f),_=v.minus(m);_=_.apply(function(E){var x=1e-15;return Math.abs(E)=-f&&(c.x-v.x)*S.x+(c.y-v.y)*S.y<=f&&(c.x-m.x)*E.x+(c.y-m.y)*E.y>=-f&&(c.x-_.x)*E.x+(c.y-_.y)*E.y<=f},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(p),function(a){var c={};a.ReferenceStrip=function(V){var ie=this,de=V.viewer,Ie=a.getElementSize(de.element),ke,Ve,W;for(V.id||(V.id="referencestrip-"+a.now(),this.element=a.makeNeutralElement("div"),this.element.id=V.id,this.element.className="referencestrip"),V=a.extend(!0,{sizeRatio:a.DEFAULT_SETTINGS.referenceStripSizeRatio,position:a.DEFAULT_SETTINGS.referenceStripPosition,scroll:a.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:a.DEFAULT_SETTINGS.clickTimeThreshold},V,{element:this.element}),a.extend(this,V),c[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,Ve=this.element.style,Ve.marginTop="0px",Ve.marginRight="0px",Ve.marginBottom="0px",Ve.marginLeft="0px",Ve.left="0px",Ve.bottom="0px",Ve.border="0px",Ve.background="#000",Ve.position="relative",a.setElementTouchActionNone(this.element),a.setElementOpacity(this.element,.8),this.viewer=de,this.tracker=new a.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:a.delegate(this,f),dragHandler:a.delegate(this,m),scrollHandler:a.delegate(this,v),enterHandler:a.delegate(this,S),leaveHandler:a.delegate(this,E),keyDownHandler:a.delegate(this,x),keyHandler:a.delegate(this,U),preProcessEventHandler:function(Te){Te.eventType==="wheel"&&(Te.preventDefault=!0)}}),V.width&&V.height?(this.element.style.width=V.width+"px",this.element.style.height=V.height+"px",de.addControl(this.element,{anchor:a.ControlAnchor.BOTTOM_LEFT})):V.scroll==="horizontal"?(this.element.style.width=Ie.x*V.sizeRatio*de.tileSources.length+12*de.tileSources.length+"px",this.element.style.height=Ie.y*V.sizeRatio+"px",de.addControl(this.element,{anchor:a.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=Ie.y*V.sizeRatio*de.tileSources.length+12*de.tileSources.length+"px",this.element.style.width=Ie.x*V.sizeRatio+"px",de.addControl(this.element,{anchor:a.ControlAnchor.TOP_LEFT})),this.panelWidth=Ie.x*this.sizeRatio+8,this.panelHeight=Ie.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},W=0;WVe+de.x-this.panelWidth?(Te=Math.min(Te,Ie-de.x),this.element.style.marginLeft=-Te+"px",_(this,de.x,-Te)):TeW+de.y-this.panelHeight?(Te=Math.min(Te,ke-de.y),this.element.style.marginTop=-Te+"px",_(this,de.y,-Te)):Te0?ie>-(Ie-Ve.x)&&(this.element.style.marginLeft=ie+V.delta.x*2+"px",_(this,Ve.x,ie+V.delta.x*2)):-V.delta.x<0&&ie<0&&(this.element.style.marginLeft=ie+V.delta.x*2+"px",_(this,Ve.x,ie+V.delta.x*2)):-V.delta.y>0?de>-(ke-Ve.y)&&(this.element.style.marginTop=de+V.delta.y*2+"px",_(this,Ve.y,de+V.delta.y*2)):-V.delta.y<0&&de<0&&(this.element.style.marginTop=de+V.delta.y*2+"px",_(this,Ve.y,de+V.delta.y*2))}}function v(V){if(this.element){var ie=Number(this.element.style.marginLeft.replace("px","")),de=Number(this.element.style.marginTop.replace("px","")),Ie=Number(this.element.style.width.replace("px","")),ke=Number(this.element.style.height.replace("px","")),Ve=a.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?V.scroll>0?ie>-(Ie-Ve.x)&&(this.element.style.marginLeft=ie-V.scroll*60+"px",_(this,Ve.x,ie-V.scroll*60)):V.scroll<0&&ie<0&&(this.element.style.marginLeft=ie-V.scroll*60+"px",_(this,Ve.x,ie-V.scroll*60)):V.scroll<0?de>Ve.y-ke&&(this.element.style.marginTop=de+V.scroll*60+"px",_(this,Ve.y,de+V.scroll*60)):V.scroll>0&&de<0&&(this.element.style.marginTop=de+V.scroll*60+"px",_(this,Ve.y,de+V.scroll*60)),V.preventDefault=!0}}function _(V,ie,de){var Ie,ke,Ve,W,Te,je;for(V.scroll==="horizontal"?Ie=V.panelWidth:Ie=V.panelHeight,ke=Math.ceil(ie/Ie)+5,Ve=Math.ceil((Math.abs(de)+ie)/Ie)+1,ke=Ve-ke,ke=ke<0?0:ke,Te=ke;Te1?m[1].springStiffness:5,animationTime:m.length>1?m[1].animationTime:1.5}),a.console.assert(typeof f.springStiffness=="number"&&f.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),a.console.assert(typeof f.animationTime=="number"&&f.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),f.exponential&&(this._exponential=!0,delete f.exponential),a.extend(!0,this,f),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:a.now()},a.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},a.Spring.prototype={resetTo:function(f){a.console.assert(!this._exponential||f!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=f,this.start.time=this.target.time=this.current.time=a.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(f){a.console.assert(!this._exponential||f!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=f,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(f){this.start.value+=f,this.target.value+=f,this._exponential&&(a.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(f){this._exponential=f,this._exponential&&(a.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=a.now();var f,m;this._exponential?(f=this.start._logValue,m=this.target._logValue):(f=this.start.value,m=this.target.value);var v=this.current.time>=this.target.time?m:f+(m-f)*c(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),_=this.current.value;return this._exponential?this.current.value=Math.exp(v):this.current.value=v,_!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function c(f,m){return(1-Math.exp(f*-m))/(1-Math.exp(-f))}}(p),function(a){function c(m){a.extend(!0,this,{timeout:a.DEFAULT_SETTINGS.timeout,jobId:null},m),this.image=null}c.prototype={errorMsg:null,start:function(){var m=this,v=this.abort;this.image=new Image,this.image.onload=function(){m.finish(!0)},this.image.onabort=this.image.onerror=function(){m.errorMsg="Image load aborted",m.finish(!1)},this.jobId=window.setTimeout(function(){m.errorMsg="Image load exceeded timeout ("+m.timeout+" ms)",m.finish(!1)},this.timeout),this.loadWithAjax?(this.request=a.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(_){var S;try{S=new window.Blob([_.response])}catch(V){var E=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(V.name==="TypeError"&&E){var x=new E;x.append(_.response),S=x.getBlob()}}S.size===0&&(m.errorMsg="Empty image response.",m.finish(!1));var U=(window.URL||window.webkitURL).createObjectURL(S);m.image.src=U},error:function(_){m.errorMsg="Image load aborted - XHR error",m.finish(!1)}}),this.abort=function(){m.request.abort(),typeof v=="function"&&v()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(m){this.image.onload=this.image.onerror=this.image.onabort=null,m||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},a.ImageLoader=function(m){a.extend(!0,this,{jobLimit:a.DEFAULT_SETTINGS.imageLoaderLimit,timeout:a.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},m)},a.ImageLoader.prototype={addJob:function(m){var v=this,_=function(x){f(v,x,m.callback)},S={src:m.src,loadWithAjax:m.loadWithAjax,ajaxHeaders:m.loadWithAjax?m.ajaxHeaders:null,crossOriginPolicy:m.crossOriginPolicy,ajaxWithCredentials:m.ajaxWithCredentials,callback:_,abort:m.abort,timeout:this.timeout},E=new c(S);!this.jobLimit||this.jobsInProgress0&&(S=m.jobQueue.shift(),S.start(),m.jobsInProgress++),_(v.image,v.errorMsg,v.request)}}(p),function(a){a.Tile=function(c,f,m,v,_,S,E,x,U,V){this.level=c,this.x=f,this.y=m,this.bounds=v,this.sourceBounds=V,this.exists=_,this.url=S,this.context2D=E,this.loadWithAjax=x,this.ajaxHeaders=U,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},a.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(c){if(!this.cacheImageRecord){a.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){a.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=a.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==c&&c.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),a.setElementOpacity(this.element,this.opacity)},drawCanvas:function(c,f,m,v){var _=this.position.times(a.pixelDensityRatio),S=this.size.times(a.pixelDensityRatio),E;if(!this.context2D&&!this.cacheImageRecord){a.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(E=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!E){a.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}c.save(),c.globalAlpha=this.opacity,typeof m=="number"&&m!==1&&(_=_.times(m),S=S.times(m)),v instanceof a.Point&&(_=_.plus(v)),c.globalAlpha===1&&this._hasTransparencyChannel()&&c.clearRect(_.x,_.y,S.x,S.y),f({context:c,tile:this,rendered:E});var x,U;this.sourceBounds?(x=Math.min(this.sourceBounds.width,E.canvas.width),U=Math.min(this.sourceBounds.height,E.canvas.height)):(x=E.canvas.width,U=E.canvas.height),c.translate(_.x+S.x/2,0),this.flipped&&c.scale(-1,1),c.drawImage(E.canvas,0,0,x,U,-S.x/2,_.y,S.x,S.y),c.restore()},getScaleForEdgeSmoothing:function(){var c;if(this.cacheImageRecord)c=this.cacheImageRecord.getRenderedContext();else if(this.context2D)c=this.context2D;else return a.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return c.canvas.width/(this.size.x*a.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(c,f,m){var v=Math.max(1,Math.ceil((m.x-f.x)/2)),_=Math.max(1,Math.ceil((m.y-f.y)/2));return new a.Point(v,_).minus(this.position.times(a.pixelDensityRatio).times(c||1).apply(function(S){return S%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(p),function(a){a.OverlayPlacement=a.Placement,a.OverlayRotationMode=a.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),a.Overlay=function(c,f,m){var v;a.isPlainObject(c)?v=c:v={element:c,location:f,placement:m},this.element=v.element,this.style=v.element.style,this._init(v)},a.Overlay.prototype={_init:function(c){this.location=c.location,this.placement=c.placement===void 0?a.Placement.TOP_LEFT:c.placement,this.onDraw=c.onDraw,this.checkResize=c.checkResize===void 0?!0:c.checkResize,this.width=c.width===void 0?null:c.width,this.height=c.height===void 0?null:c.height,this.rotationMode=c.rotationMode||a.OverlayRotationMode.EXACT,this.location instanceof a.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=a.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new a.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(c,f){var m=a.Placement.properties[this.placement];!m||(m.isHorizontallyCentered?c.x-=f.x/2:m.isRight&&(c.x-=f.x),m.isVerticallyCentered?c.y-=f.y/2:m.isBottom&&(c.y-=f.y))},destroy:function(){var c=this.element,f=this.style;c.parentNode&&(c.parentNode.removeChild(c),c.prevElementParent&&(f.display="none",document.body.appendChild(c))),this.onDraw=null,f.top="",f.left="",f.position="",this.width!==null&&(f.width=""),this.height!==null&&(f.height="");var m=a.getCssPropertyWithVendorPrefix("transformOrigin"),v=a.getCssPropertyWithVendorPrefix("transform");m&&v&&(f[m]="",f[v]="")},drawHTML:function(c,f){var m=this.element;m.parentNode!==c&&(m.prevElementParent=m.parentNode,m.prevNextSibling=m.nextSibling,c.appendChild(m),this.style.position="absolute",this.size=a.getElementSize(m));var v=this._getOverlayPositionAndSize(f),_=v.position,S=this.size=v.size,E=v.rotate;if(this.onDraw)this.onDraw(_,S,this.element);else{var x=this.style;x.left=_.x+"px",x.top=_.y+"px",this.width!==null&&(x.width=S.x+"px"),this.height!==null&&(x.height=S.y+"px");var U=a.getCssPropertyWithVendorPrefix("transformOrigin"),V=a.getCssPropertyWithVendorPrefix("transform");U&&V&&(E?(x[U]=this._getTransformOrigin(),x[V]="rotate("+E+"deg)"):(x[U]="",x[V]="")),x.display="block"}},_getOverlayPositionAndSize:function(c){var f=c.pixelFromPoint(this.location,!0),m=this._getSizeInPixels(c);this.adjust(f,m);var v=0;if(c.degrees&&this.rotationMode!==a.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===a.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var _=new a.Rect(f.x,f.y,m.x,m.y),S=this._getBoundingBox(_,c.degrees);f=S.getTopLeft(),m=S.getSize()}else v=c.degrees;return{position:f,size:m,rotate:v}},_getSizeInPixels:function(c){var f=this.size.x,m=this.size.y;if(this.width!==null||this.height!==null){var v=c.deltaPixelsFromPointsNoRotate(new a.Point(this.width||0,this.height||0),!0);this.width!==null&&(f=v.x),this.height!==null&&(m=v.y)}if(this.checkResize&&(this.width===null||this.height===null)){var _=this.size=a.getElementSize(this.element);this.width===null&&(f=_.x),this.height===null&&(m=_.y)}return new a.Point(f,m)},_getBoundingBox:function(c,f){var m=this._getPlacementPoint(c);return c.rotate(f,m).getBoundingBox()},_getPlacementPoint:function(c){var f=new a.Point(c.x,c.y),m=a.Placement.properties[this.placement];return m&&(m.isHorizontallyCentered?f.x+=c.width/2:m.isRight&&(f.x+=c.width),m.isVerticallyCentered?f.y+=c.height/2:m.isBottom&&(f.y+=c.height)),f},_getTransformOrigin:function(){var c="",f=a.Placement.properties[this.placement];return f&&(f.isLeft?c="left":f.isRight&&(c="right"),f.isTop?c+=" top":f.isBottom&&(c+=" bottom")),c},update:function(c,f){var m=a.isPlainObject(c)?c:{location:c,placement:f};this._init({location:m.location||this.location,placement:m.placement!==void 0?m.placement:this.placement,onDraw:m.onDraw||this.onDraw,checkResize:m.checkResize||this.checkResize,width:m.width!==void 0?m.width:this.width,height:m.height!==void 0?m.height:this.height,rotationMode:m.rotationMode||this.rotationMode})},getBounds:function(c){a.console.assert(c,"A viewport must now be passed to Overlay.getBounds.");var f=this.width,m=this.height;if(f===null||m===null){var v=c.deltaPointsFromPixelsNoRotate(this.size,!0);f===null&&(f=v.x),m===null&&(m=v.y)}var _=this.location.clone();return this.adjust(_,new a.Point(f,m)),this._adjustBoundsForRotation(c,new a.Rect(_.x,_.y,f,m))},_adjustBoundsForRotation:function(c,f){if(!c||c.degrees===0||this.rotationMode===a.OverlayRotationMode.EXACT)return f;if(this.rotationMode===a.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return f;var m=this._getOverlayPositionAndSize(c);return c.viewerElementToViewportRectangle(new a.Rect(m.position.x,m.position.y,m.size.x,m.size.y))}return f.rotate(-c.degrees,this._getPlacementPoint(f))}}}(p),function(a){a.Drawer=function(c){a.console.assert(c.viewer,"[Drawer] options.viewer is required");var f=arguments;if(a.isPlainObject(c)||(c={source:f[0],viewport:f[1],element:f[2]}),a.console.assert(c.viewport,"[Drawer] options.viewport is required"),a.console.assert(c.element,"[Drawer] options.element is required"),c.source&&a.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=c.viewer,this.viewport=c.viewport,this.debugGridColor=typeof c.debugGridColor=="string"?[c.debugGridColor]:c.debugGridColor||a.DEFAULT_SETTINGS.debugGridColor,c.opacity&&a.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=a.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=a.getElement(c.element),this.canvas=a.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var m=this._calculateCanvasSize();this.canvas.width=m.x,this.canvas.height=m.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",a.setElementOpacity(this.canvas,this.opacity,!0),a.setElementPointerEventsNone(this.canvas),a.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},a.Drawer.prototype={addOverlay:function(c,f,m,v){return a.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(c,f,m,v),this},updateOverlay:function(c,f,m){return a.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(c,f,m),this},removeOverlay:function(c){return a.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(c),this},clearOverlays:function(){return a.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(c){var f=this.viewport.pixelFromPointNoRotate(c,!0);return new a.Point(f.x*a.pixelDensityRatio,f.y*a.pixelDensityRatio)},clipWithPolygons:function(c,f){if(this.useCanvas){var m=this._getContext(f);m.beginPath(),c.forEach(function(v){v.forEach(function(_,S){m[S===0?"moveTo":"lineTo"](_.x,_.y)})}),m.clip()}},setOpacity:function(c){a.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var f=this.viewer.world,m=0;mf&&(f=v)}return f},needsUpdate:function(){return a.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return a.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return a.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return a.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var c=this._calculateCanvasSize();if((this.canvas.width!==c.x||this.canvas.height!==c.y)&&(this.canvas.width=c.x,this.canvas.height=c.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var f=this._calculateSketchCanvasSize();this.sketchCanvas.width=f.x,this.sketchCanvas.height=f.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(c,f){if(this.useCanvas){var m=this._getContext(c);if(f)m.clearRect(f.x,f.y,f.width,f.height);else{var v=m.canvas;m.clearRect(0,0,v.width,v.height)}}},viewportToDrawerRectangle:function(c){var f=this.viewport.pixelFromPointNoRotate(c.getTopLeft(),!0),m=this.viewport.deltaPixelsFromPointsNoRotate(c.getSize(),!0);return new a.Rect(f.x*a.pixelDensityRatio,f.y*a.pixelDensityRatio,m.x*a.pixelDensityRatio,m.y*a.pixelDensityRatio)},drawTile:function(c,f,m,v,_){if(a.console.assert(c,"[Drawer.drawTile] tile is required"),a.console.assert(f,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var S=this._getContext(m);v=v||1,c.drawCanvas(S,f,v,_)}else c.drawHTML(this.canvas)},_getContext:function(c){var f=this.context;if(c){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var m=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=m.x,this.sketchCanvas.height=m.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var v=this;this.viewer.addHandler("rotate",function _(){if(v.viewport.getRotation()!==0){v.viewer.removeHandler("rotate",_);var S=v._calculateSketchCanvasSize();v.sketchCanvas.width=S.x,v.sketchCanvas.height=S.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}f=this.sketchContext}return f},saveContext:function(c){!this.useCanvas||this._getContext(c).save()},restoreContext:function(c){!this.useCanvas||this._getContext(c).restore()},setClip:function(c,f){if(this.useCanvas){var m=this._getContext(f);m.beginPath(),m.rect(c.x,c.y,c.width,c.height),m.clip()}},drawRectangle:function(c,f,m){if(this.useCanvas){var v=this._getContext(m);v.save(),v.fillStyle=f,v.fillRect(c.x,c.y,c.width,c.height),v.restore()}},blendSketch:function(c,f,m,v){var _=c;if(a.isPlainObject(_)||(_={opacity:c,scale:f,translate:m,compositeOperation:v}),!(!this.useCanvas||!this.sketchCanvas)){c=_.opacity,v=_.compositeOperation;var S=_.bounds;if(this.context.save(),this.context.globalAlpha=c,v&&(this.context.globalCompositeOperation=v),S)S.x<0&&(S.width+=S.x,S.x=0),S.x+S.width>this.canvas.width&&(S.width=this.canvas.width-S.x),S.y<0&&(S.height+=S.y,S.y=0),S.y+S.height>this.canvas.height&&(S.height=this.canvas.height-S.y),this.context.drawImage(this.sketchCanvas,S.x,S.y,S.width,S.height,S.x,S.y,S.width,S.height);else{f=_.scale||1,m=_.translate;var E=m instanceof a.Point?m:new a.Point(0,0),x=0,U=0;if(m){var V=this.sketchCanvas.width-this.canvas.width,ie=this.sketchCanvas.height-this.canvas.height;x=Math.round(V/2),U=Math.round(ie/2)}this.context.drawImage(this.sketchCanvas,E.x-x*f,E.y-U*f,(this.canvas.width+2*x)*f,(this.canvas.height+2*U)*f,-x,-U,this.canvas.width+2*x,this.canvas.height+2*U)}this.context.restore()}},drawDebugInfo:function(c,f,m,v){if(this.useCanvas){var _=this.viewer.world.getIndexOfItem(v)%this.debugGridColor.length,S=this.context;S.save(),S.lineWidth=2*a.pixelDensityRatio,S.font="small-caps bold "+13*a.pixelDensityRatio+"px arial",S.strokeStyle=this.debugGridColor[_],S.fillStyle=this.debugGridColor[_],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),v.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:v.getRotation(!0),point:v.viewport.pixelFromPointNoRotate(v._getRotationPoint(!0),!0)}),v.viewport.degrees===0&&v.getRotation(!0)%360===0&&v._drawer.viewer.viewport.getFlip()&&v._drawer._flip(),S.strokeRect(c.position.x*a.pixelDensityRatio,c.position.y*a.pixelDensityRatio,c.size.x*a.pixelDensityRatio,c.size.y*a.pixelDensityRatio);var E=(c.position.x+c.size.x/2)*a.pixelDensityRatio,x=(c.position.y+c.size.y/2)*a.pixelDensityRatio;S.translate(E,x),S.rotate(Math.PI/180*-this.viewport.degrees),S.translate(-E,-x),c.x===0&&c.y===0&&(S.fillText("Zoom: "+this.viewport.getZoom(),c.position.x*a.pixelDensityRatio,(c.position.y-30)*a.pixelDensityRatio),S.fillText("Pan: "+this.viewport.getBounds().toString(),c.position.x*a.pixelDensityRatio,(c.position.y-20)*a.pixelDensityRatio)),S.fillText("Level: "+c.level,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+20)*a.pixelDensityRatio),S.fillText("Column: "+c.x,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+30)*a.pixelDensityRatio),S.fillText("Row: "+c.y,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+40)*a.pixelDensityRatio),S.fillText("Order: "+m+" of "+f,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+50)*a.pixelDensityRatio),S.fillText("Size: "+c.size.toString(),(c.position.x+10)*a.pixelDensityRatio,(c.position.y+60)*a.pixelDensityRatio),S.fillText("Position: "+c.position.toString(),(c.position.x+10)*a.pixelDensityRatio,(c.position.y+70)*a.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),v.getRotation(!0)%360!==0&&this._restoreRotationChanges(),v.viewport.degrees===0&&v.getRotation(!0)%360===0&&v._drawer.viewer.viewport.getFlip()&&v._drawer._flip(),S.restore()}},debugRect:function(c){if(this.useCanvas){var f=this.context;f.save(),f.lineWidth=2*a.pixelDensityRatio,f.strokeStyle=this.debugGridColor[0],f.fillStyle=this.debugGridColor[0],f.strokeRect(c.x*a.pixelDensityRatio,c.y*a.pixelDensityRatio,c.width*a.pixelDensityRatio,c.height*a.pixelDensityRatio),f.restore()}},setImageSmoothingEnabled:function(c){this.useCanvas&&(this._imageSmoothingEnabled=c,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(c){c.msImageSmoothingEnabled=this._imageSmoothingEnabled,c.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(c){var f=this._getContext(c).canvas;return new a.Point(f.width,f.height)},getCanvasCenter:function(){return new a.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(c){var f=c.point?c.point.times(a.pixelDensityRatio):this.getCanvasCenter(),m=this._getContext(c.useSketch);m.save(),m.translate(f.x,f.y),this.viewer.viewport.flipped?(m.rotate(Math.PI/180*-c.degrees),m.scale(-1,1)):m.rotate(Math.PI/180*c.degrees),m.translate(-f.x,-f.y)},_flip:function(c){c=c||{};var f=c.point?c.point.times(a.pixelDensityRatio):this.getCanvasCenter(),m=this._getContext(c.useSketch);m.translate(f.x,0),m.scale(-1,1),m.translate(-f.x,0)},_restoreRotationChanges:function(c){var f=this._getContext(c);f.restore()},_calculateCanvasSize:function(){var c=a.pixelDensityRatio,f=this.viewport.getContainerSize();return{x:Math.round(f.x*c),y:Math.round(f.y*c)}},_calculateSketchCanvasSize:function(){var c=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return c;var f=Math.ceil(Math.sqrt(c.x*c.x+c.y*c.y));return{x:f,y:f}}}}(p),function(a){a.Viewport=function(c){var f=arguments;f.length&&f[0]instanceof a.Point&&(c={containerSize:f[0],contentSize:f[1],config:f[2]}),c.config&&(a.extend(!0,c,c.config),delete c.config),this._margins=a.extend({left:0,top:0,right:0,bottom:0},c.margins||{}),delete c.margins,a.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:a.DEFAULT_SETTINGS.springStiffness,animationTime:a.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:a.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:a.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:a.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:a.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:a.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:a.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:a.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:a.DEFAULT_SETTINGS.maxZoomLevel,degrees:a.DEFAULT_SETTINGS.degrees,flipped:a.DEFAULT_SETTINGS.flipped,homeFillsViewer:a.DEFAULT_SETTINGS.homeFillsViewer},c),this._updateContainerInnerSize(),this.centerSpringX=new a.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new a.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new a.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new a.Rect(0,0,1,1),1),this.goHome(!0),this.update()},a.Viewport.prototype={resetContentSize:function(c){return a.console.assert(c,"[Viewport.resetContentSize] contentSize is required"),a.console.assert(c instanceof a.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),a.console.assert(c.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),a.console.assert(c.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new a.Rect(0,0,1,c.y/c.x),c.x),this},setHomeBounds:function(c,f){a.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(c,f)},_setContentBounds:function(c,f){a.console.assert(c,"[Viewport._setContentBounds] bounds is required"),a.console.assert(c instanceof a.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),a.console.assert(c.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),a.console.assert(c.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=c.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(f),this._contentBounds=c.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(f),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:f,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var c=this._contentAspectRatio/this.getAspectRatio(),f;return this.homeFillsViewer?f=c>=1?c:1:f=c>=1?1:c,f/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var c=this._contentBounds.getCenter(),f=1/this.getHomeZoom(),m=f/this.getAspectRatio();return new a.Rect(c.x-f/2,c.y-m/2,f,m)},goHome:function(c){return this.viewer&&this.viewer.raiseEvent("home",{immediately:c}),this.fitBounds(this.getHomeBounds(),c)},getMinZoom:function(){var c=this.getHomeZoom(),f=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*c;return f},getMaxZoom:function(){var c=this.maxZoomLevel;return c||(c=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,c/=this._contentBounds.width),Math.max(c,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new a.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return a.extend({},this._margins)},setMargins:function(c){a.console.assert(a.type(c)==="object","[Viewport.setMargins] margins must be an object"),this._margins=a.extend({left:0,top:0,right:0,bottom:0},c),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(c){return this.getBoundsNoRotate(c).rotate(-this.getRotation())},getBoundsNoRotate:function(c){var f=this.getCenter(c),m=1/this.getZoom(c),v=m/this.getAspectRatio();return new a.Rect(f.x-m/2,f.y-v/2,m,v)},getBoundsWithMargins:function(c){return this.getBoundsNoRotateWithMargins(c).rotate(-this.getRotation(),this.getCenter(c))},getBoundsNoRotateWithMargins:function(c){var f=this.getBoundsNoRotate(c),m=this._containerInnerSize.x*this.getZoom(c);return f.x-=this._margins.left/m,f.y-=this._margins.top/m,f.width+=(this._margins.left+this._margins.right)/m,f.height+=(this._margins.top+this._margins.bottom)/m,f},getCenter:function(c){var f=new a.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),m=new a.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),v,_,S,E,x,U,V,ie;return c?f:this.zoomPoint?(v=this.pixelFromPoint(this.zoomPoint,!0),_=this.getZoom(),S=1/_,E=S/this.getAspectRatio(),x=new a.Rect(f.x-S/2,f.y-E/2,S,E),U=this._pixelFromPoint(this.zoomPoint,x),V=U.minus(v),ie=V.divide(this._containerInnerSize.x*_),m.plus(ie)):m},getZoom:function(c){return c?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(c){return Math.max(Math.min(c,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(c){var f=new a.Rect(c.x,c.y,c.width,c.height);if(!this.wrapHorizontal){var m=this.visibilityRatio*f.width,v=f.x+f.width,_=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,S=this._contentBoundsNoRotate.x-v+m,E=_-f.x-m;m>this._contentBoundsNoRotate.width?f.x+=(S+E)/2:E<0?f.x+=E:S>0&&(f.x+=S)}if(!this.wrapVertical){var x=this.visibilityRatio*f.height,U=f.y+f.height,V=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,ie=this._contentBoundsNoRotate.y-U+x,de=V-f.y-x;x>this._contentBoundsNoRotate.height?f.y+=(ie+de)/2:de<0?f.y+=de:ie>0&&(f.y+=ie)}return f},_raiseConstraintsEvent:function(c){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:c})},applyConstraints:function(c){var f=this.getZoom(),m=this._applyZoomConstraints(f);f!==m&&this.zoomTo(m,this.zoomPoint,c);var v=this.getBoundsNoRotate(),_=this._applyBoundaryConstraints(v);return this._raiseConstraintsEvent(c),(v.x!==_.x||v.y!==_.y||c)&&this.fitBounds(_.rotate(-this.getRotation()),c),this},ensureVisible:function(c){return this.applyConstraints(c)},_fitBounds:function(c,f){f=f||{};var m=f.immediately||!1,v=f.constraints||!1,_=this.getAspectRatio(),S=c.getCenter(),E=new a.Rect(c.x,c.y,c.width,c.height,c.degrees+this.getRotation()).getBoundingBox();E.getAspectRatio()>=_?E.height=E.width/_:E.width=E.height*_,E.x=S.x-E.width/2,E.y=S.y-E.height/2;var x=1/E.width;if(v){var U=E.getAspectRatio(),V=this._applyZoomConstraints(x);x!==V&&(x=V,E.width=1/x,E.x=S.x-E.width/2,E.height=E.width/U,E.y=S.y-E.height/2),E=this._applyBoundaryConstraints(E),S=E.getCenter(),this._raiseConstraintsEvent(m)}if(m)return this.panTo(S,!0),this.zoomTo(x,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var ie=this.getBounds(),de=this.getZoom();if(de===0||Math.abs(x/de-1)<1e-8)return this.zoomTo(x,!0),this.panTo(S,m);E=E.rotate(-this.getRotation());var Ie=E.getTopLeft().times(x).minus(ie.getTopLeft().times(de)).divide(x-de);return this.zoomTo(x,Ie,m)},fitBounds:function(c,f){return this._fitBounds(c,{immediately:f,constraints:!1})},fitBoundsWithConstraints:function(c,f){return this._fitBounds(c,{immediately:f,constraints:!0})},fitVertically:function(c){var f=new a.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(f,c)},fitHorizontally:function(c){var f=new a.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(f,c)},getConstrainedBounds:function(c){var f,m;return f=this.getBounds(c),m=this._applyBoundaryConstraints(f),m},panBy:function(c,f){var m=new a.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(m.plus(c),f)},panTo:function(c,f){return f?(this.centerSpringX.resetTo(c.x),this.centerSpringY.resetTo(c.y)):(this.centerSpringX.springTo(c.x),this.centerSpringY.springTo(c.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:c,immediately:f}),this},zoomBy:function(c,f,m){return this.zoomTo(this.zoomSpring.target.value*c,f,m)},zoomTo:function(c,f,m){var v=this;return this.zoomPoint=f instanceof a.Point&&!isNaN(f.x)&&!isNaN(f.y)?f:null,m?this._adjustCenterSpringsForZoomPoint(function(){v.zoomSpring.resetTo(c)}):this.zoomSpring.springTo(c),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:c,refPoint:f,immediately:m}),this},setRotation:function(c){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=a.positiveModulo(c,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:c}),this)},getRotation:function(){return this.degrees},resize:function(c,f){var m=this.getBoundsNoRotate(),v=m,_;return this.containerSize.x=c.x,this.containerSize.y=c.y,this._updateContainerInnerSize(),f&&(_=c.x/this.containerSize.x,v.width=m.width*_,v.height=v.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:c,maintain:f}),this.fitBounds(v,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new a.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var c=this;this._adjustCenterSpringsForZoomPoint(function(){c.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var f=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,f},_adjustCenterSpringsForZoomPoint:function(c){if(this.zoomPoint){var f=this.pixelFromPoint(this.zoomPoint,!0);c();var m=this.pixelFromPoint(this.zoomPoint,!0),v=m.minus(f),_=this.deltaPointsFromPixels(v,!0);this.centerSpringX.shiftBy(_.x),this.centerSpringY.shiftBy(_.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else c()},deltaPixelsFromPointsNoRotate:function(c,f){return c.times(this._containerInnerSize.x*this.getZoom(f))},deltaPixelsFromPoints:function(c,f){return this.deltaPixelsFromPointsNoRotate(c.rotate(this.getRotation()),f)},deltaPointsFromPixelsNoRotate:function(c,f){return c.divide(this._containerInnerSize.x*this.getZoom(f))},deltaPointsFromPixels:function(c,f){return this.deltaPointsFromPixelsNoRotate(c,f).rotate(-this.getRotation())},pixelFromPointNoRotate:function(c,f){return this._pixelFromPointNoRotate(c,this.getBoundsNoRotate(f))},pixelFromPoint:function(c,f){return this._pixelFromPoint(c,this.getBoundsNoRotate(f))},_pixelFromPointNoRotate:function(c,f){return c.minus(f.getTopLeft()).times(this._containerInnerSize.x/f.width).plus(new a.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(c,f){return this._pixelFromPointNoRotate(c.rotate(this.getRotation(),this.getCenter(!0)),f)},pointFromPixelNoRotate:function(c,f){var m=this.getBoundsNoRotate(f);return c.minus(new a.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/m.width).plus(m.getTopLeft())},pointFromPixel:function(c,f){return this.pointFromPixelNoRotate(c,f).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(c,f){var m=this._contentBoundsNoRotate.width;return new a.Point(c*this._contentSizeNoRotate.x/m,f*this._contentSizeNoRotate.x/m)},viewportToImageCoordinates:function(c,f){if(c instanceof a.Point)return this.viewportToImageCoordinates(c.x,c.y);if(this.viewer){var m=this.viewer.world.getItemCount();if(m>1)a.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(m===1){var v=this.viewer.world.getItemAt(0);return v.viewportToImageCoordinates(c,f,!0)}}return this._viewportToImageDelta(c-this._contentBoundsNoRotate.x,f-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(c,f){var m=this._contentBoundsNoRotate.width;return new a.Point(c/this._contentSizeNoRotate.x*m,f/this._contentSizeNoRotate.x*m)},imageToViewportCoordinates:function(c,f){if(c instanceof a.Point)return this.imageToViewportCoordinates(c.x,c.y);if(this.viewer){var m=this.viewer.world.getItemCount();if(m>1)a.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(m===1){var v=this.viewer.world.getItemAt(0);return v.imageToViewportCoordinates(c,f,!0)}}var _=this._imageToViewportDelta(c,f);return _.x+=this._contentBoundsNoRotate.x,_.y+=this._contentBoundsNoRotate.y,_},imageToViewportRectangle:function(c,f,m,v){var _=c;if(_ instanceof a.Rect||(_=new a.Rect(c,f,m,v)),this.viewer){var S=this.viewer.world.getItemCount();if(S>1)a.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(S===1){var E=this.viewer.world.getItemAt(0);return E.imageToViewportRectangle(c,f,m,v,!0)}}var x=this.imageToViewportCoordinates(_.x,_.y),U=this._imageToViewportDelta(_.width,_.height);return new a.Rect(x.x,x.y,U.x,U.y,_.degrees)},viewportToImageRectangle:function(c,f,m,v){var _=c;if(_ instanceof a.Rect||(_=new a.Rect(c,f,m,v)),this.viewer){var S=this.viewer.world.getItemCount();if(S>1)a.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(S===1){var E=this.viewer.world.getItemAt(0);return E.viewportToImageRectangle(c,f,m,v,!0)}}var x=this.viewportToImageCoordinates(_.x,_.y),U=this._viewportToImageDelta(_.width,_.height);return new a.Rect(x.x,x.y,U.x,U.y,_.degrees)},viewerElementToImageCoordinates:function(c){var f=this.pointFromPixel(c,!0);return this.viewportToImageCoordinates(f)},imageToViewerElementCoordinates:function(c){var f=this.imageToViewportCoordinates(c);return this.pixelFromPoint(f,!0)},windowToImageCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var f=c.minus(a.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(f)},imageToWindowCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var f=this.imageToViewerElementCoordinates(c);return f.plus(a.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(c){return this.pointFromPixel(c,!0)},viewportToViewerElementCoordinates:function(c){return this.pixelFromPoint(c,!0)},viewerElementToViewportRectangle:function(c){return a.Rect.fromSummits(this.pointFromPixel(c.getTopLeft(),!0),this.pointFromPixel(c.getTopRight(),!0),this.pointFromPixel(c.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(c){return a.Rect.fromSummits(this.pixelFromPoint(c.getTopLeft(),!0),this.pixelFromPoint(c.getTopRight(),!0),this.pixelFromPoint(c.getBottomLeft(),!0))},windowToViewportCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var f=c.minus(a.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(f)},viewportToWindowCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var f=this.viewportToViewerElementCoordinates(c);return f.plus(a.getElementPosition(this.viewer.element))},viewportToImageZoom:function(c){if(this.viewer){var f=this.viewer.world.getItemCount();if(f>1)a.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(f===1){var m=this.viewer.world.getItemAt(0);return m.viewportToImageZoom(c)}}var v=this._contentSizeNoRotate.x,_=this._containerInnerSize.x,S=this._contentBoundsNoRotate.width,E=_/v*S;return c*E},imageToViewportZoom:function(c){if(this.viewer){var f=this.viewer.world.getItemCount();if(f>1)a.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(f===1){var m=this.viewer.world.getItemAt(0);return m.imageToViewportZoom(c)}}var v=this._contentSizeNoRotate.x,_=this._containerInnerSize.x,S=this._contentBoundsNoRotate.width,E=v/_/S;return c*E},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(c){return this.flipped===c?this:(this.flipped=c,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:c}),this)}}}(p),function(a){a.TiledImage=function(W){var Te=this;a.console.assert(W.tileCache,"[TiledImage] options.tileCache is required"),a.console.assert(W.drawer,"[TiledImage] options.drawer is required"),a.console.assert(W.viewer,"[TiledImage] options.viewer is required"),a.console.assert(W.imageLoader,"[TiledImage] options.imageLoader is required"),a.console.assert(W.source,"[TiledImage] options.source is required"),a.console.assert(!W.clip||W.clip instanceof a.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),a.EventSource.call(this),this._tileCache=W.tileCache,delete W.tileCache,this._drawer=W.drawer,delete W.drawer,this._imageLoader=W.imageLoader,delete W.imageLoader,W.clip instanceof a.Rect&&(this._clip=W.clip.clone()),delete W.clip;var je=W.x||0;delete W.x;var Be=W.y||0;delete W.y,this.normHeight=W.source.dimensions.y/W.source.dimensions.x,this.contentAspectX=W.source.dimensions.x/W.source.dimensions.y;var tt=1;W.width?(tt=W.width,delete W.width,W.height&&(a.console.error("specifying both width and height to a tiledImage is not supported"),delete W.height)):W.height&&(tt=W.height/this.normHeight,delete W.height);var $e=W.fitBounds;delete W.fitBounds;var It=W.fitBoundsPlacement||p.Placement.CENTER;delete W.fitBoundsPlacement;var Ht=W.degrees||0;delete W.degrees,a.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:a.DEFAULT_SETTINGS.springStiffness,animationTime:a.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:a.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:a.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:a.DEFAULT_SETTINGS.wrapVertical,immediateRender:a.DEFAULT_SETTINGS.immediateRender,blendTime:a.DEFAULT_SETTINGS.blendTime,alwaysBlend:a.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:a.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:a.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:a.DEFAULT_SETTINGS.iOSDevice,debugMode:a.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:a.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:a.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:a.DEFAULT_SETTINGS.placeholderFillStyle,opacity:a.DEFAULT_SETTINGS.opacity,preload:a.DEFAULT_SETTINGS.preload,compositeOperation:a.DEFAULT_SETTINGS.compositeOperation},W),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new a.Spring({initial:je,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new a.Spring({initial:Be,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new a.Spring({initial:tt,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new a.Spring({initial:Ht,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),$e&&this.fitBounds($e,It,!0),this._drawingHandler=function(en){Te.viewer.raiseEvent("tile-drawing",a.extend({tiledImage:Te},en))}},a.extend(a.TiledImage.prototype,a.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(W){W!==this._fullyLoaded&&(this._fullyLoaded=W,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=a.now(),this._needsDraw=!0},update:function(){var W=this._xSpring.update(),Te=this._ySpring.update(),je=this._scaleSpring.update(),Be=this._degreesSpring.update();return W||Te||je||Be?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(W){return this.getBoundsNoRotate(W).rotate(this.getRotation(W),this._getRotationPoint(W))},getBoundsNoRotate:function(W){return W?new a.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new a.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return a.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(W){var Te=this.getBoundsNoRotate(W);if(this._clip){var je=W?this._worldWidthCurrent:this._worldWidthTarget,Be=je/this.source.dimensions.x,tt=this._clip.times(Be);Te=new a.Rect(Te.x+tt.x,Te.y+tt.y,tt.width,tt.height)}return Te.rotate(this.getRotation(W),this._getRotationPoint(W))},getTileBounds:function(W,Te,je){var Be=this.source.getNumTiles(W),tt=(Be.x+Te%Be.x)%Be.x,$e=(Be.y+je%Be.y)%Be.y,It=this.source.getTileBounds(W,tt,$e);return this.getFlip()&&(It.x=1-It.x-It.width),It.x+=(Te-tt)/Be.x,It.y+=this._worldHeightCurrent/this._worldWidthCurrent*((je-$e)/Be.y),It},getContentSize:function(){return new a.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var W=this.imageToWindowCoordinates(new a.Point(0,0)),Te=this.imageToWindowCoordinates(this.getContentSize());return new a.Point(Te.x-W.x,Te.y-W.y)},_viewportToImageDelta:function(W,Te,je){var Be=je?this._scaleSpring.current.value:this._scaleSpring.target.value;return new a.Point(W*(this.source.dimensions.x/Be),Te*(this.source.dimensions.y*this.contentAspectX/Be))},viewportToImageCoordinates:function(W,Te,je){var Be;return W instanceof a.Point?(je=Te,Be=W):Be=new a.Point(W,Te),Be=Be.rotate(-this.getRotation(je),this._getRotationPoint(je)),je?this._viewportToImageDelta(Be.x-this._xSpring.current.value,Be.y-this._ySpring.current.value):this._viewportToImageDelta(Be.x-this._xSpring.target.value,Be.y-this._ySpring.target.value)},_imageToViewportDelta:function(W,Te,je){var Be=je?this._scaleSpring.current.value:this._scaleSpring.target.value;return new a.Point(W/this.source.dimensions.x*Be,Te/this.source.dimensions.y/this.contentAspectX*Be)},imageToViewportCoordinates:function(W,Te,je){W instanceof a.Point&&(je=Te,Te=W.y,W=W.x);var Be=this._imageToViewportDelta(W,Te);return je?(Be.x+=this._xSpring.current.value,Be.y+=this._ySpring.current.value):(Be.x+=this._xSpring.target.value,Be.y+=this._ySpring.target.value),Be.rotate(this.getRotation(je),this._getRotationPoint(je))},imageToViewportRectangle:function(W,Te,je,Be,tt){var $e=W;$e instanceof a.Rect?tt=Te:$e=new a.Rect(W,Te,je,Be);var It=this.imageToViewportCoordinates($e.getTopLeft(),tt),Ht=this._imageToViewportDelta($e.width,$e.height,tt);return new a.Rect(It.x,It.y,Ht.x,Ht.y,$e.degrees+this.getRotation(tt))},viewportToImageRectangle:function(W,Te,je,Be,tt){var $e=W;W instanceof a.Rect?tt=Te:$e=new a.Rect(W,Te,je,Be);var It=this.viewportToImageCoordinates($e.getTopLeft(),tt),Ht=this._viewportToImageDelta($e.width,$e.height,tt);return new a.Rect(It.x,It.y,Ht.x,Ht.y,$e.degrees-this.getRotation(tt))},viewerElementToImageCoordinates:function(W){var Te=this.viewport.pointFromPixel(W,!0);return this.viewportToImageCoordinates(Te)},imageToViewerElementCoordinates:function(W){var Te=this.imageToViewportCoordinates(W);return this.viewport.pixelFromPoint(Te,!0)},windowToImageCoordinates:function(W){var Te=W.minus(p.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(Te)},imageToWindowCoordinates:function(W){var Te=this.imageToViewerElementCoordinates(W);return Te.plus(p.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(W){var Te=this._scaleSpring.current.value;return W=W.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new a.Rect((W.x-this._xSpring.current.value)/Te,(W.y-this._ySpring.current.value)/Te,W.width/Te,W.height/Te,W.degrees)},viewportToImageZoom:function(W){var Te=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return Te*W},imageToViewportZoom:function(W){var Te=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return W/Te},setPosition:function(W,Te){var je=this._xSpring.target.value===W.x&&this._ySpring.target.value===W.y;if(Te){if(je&&this._xSpring.current.value===W.x&&this._ySpring.current.value===W.y)return;this._xSpring.resetTo(W.x),this._ySpring.resetTo(W.y),this._needsDraw=!0}else{if(je)return;this._xSpring.springTo(W.x),this._ySpring.springTo(W.y),this._needsDraw=!0}je||this._raiseBoundsChange()},setWidth:function(W,Te){this._setScale(W,Te)},setHeight:function(W,Te){this._setScale(W/this.normHeight,Te)},setCroppingPolygons:function(W){var Te=function(Be){return Be instanceof a.Point||typeof Be.x=="number"&&typeof Be.y=="number"},je=function(Be){return Be.map(function(tt){try{if(Te(tt))return{x:tt.x,y:tt.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!a.isArray(W))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=W.map(function(Be){return je(Be)})}catch(Be){a.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),a.console.error(Be),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(W,Te,je){Te=Te||a.Placement.CENTER;var Be=a.Placement.properties[Te],tt=this.contentAspectX,$e=0,It=0,Ht=1,en=1;if(this._clip&&(tt=this._clip.getAspectRatio(),Ht=this._clip.width/this.source.dimensions.x,en=this._clip.height/this.source.dimensions.y,W.getAspectRatio()>tt?($e=this._clip.x/this._clip.height*W.height,It=this._clip.y/this._clip.height*W.height):($e=this._clip.x/this._clip.width*W.width,It=this._clip.y/this._clip.width*W.width)),W.getAspectRatio()>tt){var ln=W.height/en,rn=0;Be.isHorizontallyCentered?rn=(W.width-W.height*tt)/2:Be.isRight&&(rn=W.width-W.height*tt),this.setPosition(new a.Point(W.x-$e+rn,W.y-It),je),this.setHeight(ln,je)}else{var wn=W.width/Ht,_n=0;Be.isVerticallyCentered?_n=(W.height-W.width/tt)/2:Be.isBottom&&(_n=W.height-W.width/tt),this.setPosition(new a.Point(W.x-$e,W.y-It+_n),je),this.setWidth(wn,je)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(W){a.console.assert(!W||W instanceof a.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),W instanceof a.Rect?this._clip=W.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(W){this.flipped=!!W,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(W){W!==this.opacity&&(this.opacity=W,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(W){this._preload=!!W,this._needsDraw=!0},getRotation:function(W){return W?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(W,Te){this._degreesSpring.target.value===W&&this._degreesSpring.isAtTargetValue()||(Te?this._degreesSpring.resetTo(W):this._degreesSpring.springTo(W),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(W){return this.getBoundsNoRotate(W).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(W){W!==this.compositeOperation&&(this.compositeOperation=W,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(W,Te){var je=this._scaleSpring.target.value===W;if(Te){if(je&&this._scaleSpring.current.value===W)return;this._scaleSpring.resetTo(W),this._updateForScale(),this._needsDraw=!0}else{if(je)return;this._scaleSpring.springTo(W),this._updateForScale(),this._needsDraw=!0}je||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var W=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),Te=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,je=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(Te/this.minPixelRatio)/Math.log(2))));return je=Math.max(je,this.source.minLevel||0),W=Math.min(W,je),{lowestLevel:W,highestLevel:je}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var W=this.lastDrawn.pop();W.beingDrawn=!1}var Te=this.viewport,je=this._viewportToTiledImageRectangle(Te.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var Be=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(je=je.intersection(Be),je===null)return}for(var tt=this._getLevelsInterval(),$e=tt.lowestLevel,It=tt.highestLevel,Ht=null,en=!1,ln=a.now(),rn=It;rn>=$e;rn--){var wn=!1,_n=Te.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(rn),!0).x*this._scaleSpring.current.value;if(rn===$e||!en&&_n>=this.minPixelRatio)wn=!0,en=!0;else if(!en)continue;var Xn=Te.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(rn),!1).x*this._scaleSpring.current.value,Gn=Te.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,Ti=this.immediateRender?1:Gn,Mi=Math.min(1,(_n-.5)/.5),yr=Ti/Math.abs(Ti-Xn);if(Ht=c(this,en,wn,rn,Mi,yr,je,ln,Ht),U(this.coverage,rn))break}ke(this,this.lastDrawn),Ht&&!Ht.context2D?(v(this,Ht,ln),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(W,Te,je){var Be,tt;this.wrapHorizontal?(Be=a.positiveModulo(Te.x,1),tt=a.positiveModulo(je.x,1)):(Be=Math.max(0,Te.x),tt=Math.min(1,je.x));var $e,It,Ht=1/this.source.aspectRatio;this.wrapVertical?($e=a.positiveModulo(Te.y,Ht),It=a.positiveModulo(je.y,Ht)):($e=Math.max(0,Te.y),It=Math.min(Ht,je.y));var en=this.source.getTileAtPoint(W,new a.Point(Be,$e)),ln=this.source.getTileAtPoint(W,new a.Point(tt,It)),rn=this.source.getNumTiles(W);return this.wrapHorizontal&&(en.x+=rn.x*Math.floor(Te.x),ln.x+=rn.x*Math.floor(je.x)),this.wrapVertical&&(en.y+=rn.y*Math.floor(Te.y/Ht),ln.y+=rn.y*Math.floor(je.y/Ht)),{topLeft:en,bottomRight:ln}}});function c(W,Te,je,Be,tt,$e,It,Ht,en){var ln=It.getBoundingBox().getTopLeft(),rn=It.getBoundingBox().getBottomRight();W.viewer&&W.viewer.raiseEvent("update-level",{tiledImage:W,havedrawn:Te,level:Be,opacity:tt,visibility:$e,drawArea:It,topleft:ln,bottomright:rn,currenttime:Ht,best:en}),de(W.coverage,Be),de(W.loadingCoverage,Be);var wn=W._getCornerTiles(Be,ln,rn),_n=wn.topLeft,Xn=wn.bottomRight,Gn=W.source.getNumTiles(Be),Ti=W.viewport.pixelFromPoint(W.viewport.getCenter());W.getFlip()&&(Xn.x+=1,W.wrapHorizontal||(Xn.x=Math.min(Xn.x,Gn.x-1)));for(var Mi=_n.x;Mi<=Xn.x;Mi++)for(var yr=_n.y;yr<=Xn.y;yr++){var mn;if(W.getFlip()){var Ui=(Gn.x+Mi%Gn.x)%Gn.x;mn=Mi+Gn.x-Ui-Ui-1}else mn=Mi;It.intersection(W.getTileBounds(Be,mn,yr))!==null&&(en=f(W,je,Te,mn,yr,Be,tt,$e,Ti,Gn,Ht,en))}return en}function f(W,Te,je,Be,tt,$e,It,Ht,en,ln,rn,wn){var _n=m(Be,tt,$e,W,W.source,W.tilesMatrix,rn,ln,W._worldWidthCurrent,W._worldHeightCurrent),Xn=je;W.viewer&&W.viewer.raiseEvent("update-tile",{tiledImage:W,tile:_n}),ie(W.coverage,$e,Be,tt,!1);var Gn=_n.loaded||_n.loading||V(W.loadingCoverage,$e,Be,tt);if(ie(W.loadingCoverage,$e,Be,tt,Gn),!_n.exists||(Te&&!Xn&&(V(W.coverage,$e,Be,tt)?ie(W.coverage,$e,Be,tt,!0):Xn=!0),!Xn))return wn;if(E(_n,W.source.tileOverlap,W.viewport,en,Ht,W),!_n.loaded)if(_n.context2D)S(W,_n);else{var Ti=W._tileCache.getImageRecord(_n.cacheKey);if(Ti){var Mi=Ti.getImage();S(W,_n,Mi)}}if(_n.loaded){var yr=x(W,_n,Be,tt,$e,It,rn);yr&&(W._needsDraw=!0)}else _n.loading?W._tilesLoading++:Gn||(wn=Ie(wn,_n));return wn}function m(W,Te,je,Be,tt,$e,It,Ht,en,ln){var rn,wn,_n,Xn,Gn,Ti,Mi,yr,mn;return $e[je]||($e[je]={}),$e[je][W]||($e[je][W]={}),(!$e[je][W][Te]||!$e[je][W][Te].flipped!=!Be.flipped)&&(rn=(Ht.x+W%Ht.x)%Ht.x,wn=(Ht.y+Te%Ht.y)%Ht.y,_n=Be.getTileBounds(je,W,Te),Xn=tt.getTileBounds(je,rn,wn,!0),Gn=tt.tileExists(je,rn,wn),Ti=tt.getTileUrl(je,rn,wn),Be.loadTilesWithAjax?(Mi=tt.getTileAjaxHeaders(je,rn,wn),a.isPlainObject(Be.ajaxHeaders)&&(Mi=a.extend({},Be.ajaxHeaders,Mi))):Mi=null,yr=tt.getContext2D?tt.getContext2D(je,rn,wn):void 0,mn=new a.Tile(je,W,Te,_n,Gn,Ti,yr,Be.loadTilesWithAjax,Mi,Xn),Be.getFlip()?rn===0&&(mn.isRightMost=!0):rn===Ht.x-1&&(mn.isRightMost=!0),wn===Ht.y-1&&(mn.isBottomMost=!0),mn.flipped=Be.flipped,$e[je][W][Te]=mn),mn=$e[je][W][Te],mn.lastTouchTime=It,mn}function v(W,Te,je){Te.loading=!0,W._imageLoader.addJob({src:Te.url,loadWithAjax:Te.loadWithAjax,ajaxHeaders:Te.ajaxHeaders,crossOriginPolicy:W.crossOriginPolicy,ajaxWithCredentials:W.ajaxWithCredentials,callback:function(Be,tt,$e){_(W,Te,je,Be,tt,$e)},abort:function(){Te.loading=!1}})}function _(W,Te,je,Be,tt,$e){if(!Be){a.console.log("Tile %s failed to load: %s - error: %s",Te,Te.url,tt),W.viewer.raiseEvent("tile-load-failed",{tile:Te,tiledImage:W,time:je,message:tt,tileRequest:$e}),Te.loading=!1,Te.exists=!1;return}if(jeW.visibility||Te.visibility===W.visibility&&Te.squaredDistance1&&Ht>W.smoothTileEdgesMinZoom&&!W.iOSDevice&&W.getRotation(!0)%360===0&&a.supportsCanvas&&(Be=!0,tt=je.getScaleForEdgeSmoothing(),$e=je.getTranslationForEdgeSmoothing(tt,W._drawer.getCanvasSize(!1),W._drawer.getCanvasSize(!0)));var en;Be&&(tt||(en=W.viewport.viewportToViewerElementRectangle(W.getClippedBounds(!0)).getIntegerBoundingBox(),W._drawer.viewer.viewport.getFlip()&&(W.viewport.degrees!==0||W.getRotation(!0)%360!==0)&&(en.x=W._drawer.viewer.container.clientWidth-(en.x+en.width)),en=en.times(a.pixelDensityRatio)),W._drawer._clear(!0,en)),tt||(W.viewport.degrees!==0&&W._drawer._offsetForRotation({degrees:W.viewport.degrees,useSketch:Be}),W.getRotation(!0)%360!==0&&W._drawer._offsetForRotation({degrees:W.getRotation(!0),point:W.viewport.pixelFromPointNoRotate(W._getRotationPoint(!0),!0),useSketch:Be}),W.viewport.degrees===0&&W.getRotation(!0)%360===0&&W._drawer.viewer.viewport.getFlip()&&W._drawer._flip());var ln=!1;if(W._clip){W._drawer.saveContext(Be);var rn=W.imageToViewportRectangle(W._clip,!0);rn=rn.rotate(-W.getRotation(!0),W._getRotationPoint(!0));var wn=W._drawer.viewportToDrawerRectangle(rn);tt&&(wn=wn.times(tt)),$e&&(wn=wn.translate($e)),W._drawer.setClip(wn,Be),ln=!0}if(W._croppingPolygons){W._drawer.saveContext(Be);try{var _n=W._croppingPolygons.map(function(Mi){return Mi.map(function(yr){var mn=W.imageToViewportCoordinates(yr.x,yr.y,!0).rotate(-W.getRotation(!0),W._getRotationPoint(!0)),Ui=W._drawer.viewportCoordToDrawerCoord(mn);return tt&&(Ui=Ui.times(tt)),Ui})});W._drawer.clipWithPolygons(_n,Be)}catch(Mi){a.console.error(Mi)}ln=!0}if(W.placeholderFillStyle&&W._hasOpaqueTile===!1){var Xn=W._drawer.viewportToDrawerRectangle(W.getBounds(!0));tt&&(Xn=Xn.times(tt)),$e&&(Xn=Xn.translate($e));var Gn=null;typeof W.placeholderFillStyle=="function"?Gn=W.placeholderFillStyle(W,W._drawer.context):Gn=W.placeholderFillStyle,W._drawer.drawRectangle(Xn,Gn,Be)}for(var Ti=Te.length-1;Ti>=0;Ti--)je=Te[Ti],W._drawer.drawTile(je,W._drawingHandler,Be,tt,$e),je.beingDrawn=!0,W.viewer&&W.viewer.raiseEvent("tile-drawn",{tiledImage:W,tile:je});ln&&W._drawer.restoreContext(Be),tt||(W.getRotation(!0)%360!==0&&W._drawer._restoreRotationChanges(Be),W.viewport.degrees!==0&&W._drawer._restoreRotationChanges(Be)),Be&&(tt&&(W.viewport.degrees!==0&&W._drawer._offsetForRotation({degrees:W.viewport.degrees,useSketch:!1}),W.getRotation(!0)%360!==0&&W._drawer._offsetForRotation({degrees:W.getRotation(!0),point:W.viewport.pixelFromPointNoRotate(W._getRotationPoint(!0),!0),useSketch:!1})),W._drawer.blendSketch({opacity:W.opacity,scale:tt,translate:$e,compositeOperation:W.compositeOperation,bounds:en}),tt&&(W.getRotation(!0)%360!==0&&W._drawer._restoreRotationChanges(!1),W.viewport.degrees!==0&&W._drawer._restoreRotationChanges(!1))),tt||W.viewport.degrees===0&&W.getRotation(!0)%360===0&&W._drawer.viewer.viewport.getFlip()&&W._drawer._flip(),Ve(W,Te)}}function Ve(W,Te){if(W.debugMode)for(var je=Te.length-1;je>=0;je--){var Be=Te[je];try{W._drawer.drawDebugInfo(Be,Te.length,je,W)}catch(tt){a.console.error(tt)}}}}(p),function(a){var c=function(m){a.console.assert(m,"[TileCache.cacheTile] options is required"),a.console.assert(m.tile,"[TileCache.cacheTile] options.tile is required"),a.console.assert(m.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=m.tile,this.tiledImage=m.tiledImage},f=function(m){a.console.assert(m,"[ImageRecord] options is required"),a.console.assert(m.image,"[ImageRecord] options.image is required"),this._image=m.image,this._tiles=[]};f.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var m=document.createElement("canvas");m.width=this._image.width,m.height=this._image.height,this._renderedContext=m.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(m){a.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=m},addTile:function(m){a.console.assert(m,"[ImageRecord.addTile] tile is required"),this._tiles.push(m)},removeTile:function(m){for(var v=0;vthis._maxImageCacheCount){for(var E=null,x=-1,U=null,V,ie,de,Ie,ke,Ve,W=this._tilesLoaded.length-1;W>=0;W--)if(Ve=this._tilesLoaded[W],V=Ve.tile,!(V.level<=v||V.beingDrawn)){if(!E){E=V,x=W,U=Ve;continue}Ie=V.lastTouchTime,ie=E.lastTouchTime,ke=V.level,de=E.level,(Iede)&&(E=V,x=W,U=Ve)}E&&x>=0&&(this._unloadTile(U),_=x)}this._tilesLoaded[_]=new c({tile:m.tile,tiledImage:m.tiledImage})},clearTilesFor:function(m){a.console.assert(m,"[TileCache.clearTilesFor] tiledImage is required");for(var v,_=0;_=this._items.length)throw new Error("Index bigger than number of layers.");f===m||m===-1||(this._items.splice(m,1),this._items.splice(f,0,c),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:c,previousIndex:m,newIndex:f}))},removeItem:function(c){a.console.assert(c,"[World.removeItem] item is required");var f=a.indexOf(this._items,c);f!==-1&&(c.removeHandler("bounds-change",this._delegatedFigureSizes),c.removeHandler("clip-change",this._delegatedFigureSizes),c.destroy(),this._items.splice(f,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(c))},removeAll:function(){this.viewer._cancelPendingImages();var c,f;for(f=0;fIe.height?ke=S:ke=S*(Ie.width/Ie.height),Ve=ke*(Ie.height/Ie.width),W=new a.Point(V+(S-ke)/2,ie+(S-Ve)/2),de.setPosition(W,f),de.setWidth(ke,f),m==="horizontal"?V+=x:ie+=x;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var c=this._homeBounds?this._homeBounds.clone():null,f=this._contentSize?this._contentSize.clone():null,m=this._contentFactor||0;if(!this._items.length)this._homeBounds=new a.Rect(0,0,1,1),this._contentSize=new a.Point(1,1),this._contentFactor=1;else{var v=this._items[0],_=v.getBounds();this._contentFactor=v.getContentSize().x/_.width;for(var S=v.getClippedBounds().getBoundingBox(),E=S.x,x=S.y,U=S.x+S.width,V=S.y+S.height,ie=1;ie{const p=l.getAttribute("class");return p?new Set(p.split(" ")):new Set},Vc=(l,p)=>{const a=GE(l);a.add(p),l.setAttribute("class",Array.from(a).join(" "))},R0=(l,p)=>{const a=GE(l);a.delete(p),a.size===0?l.removeAttribute("class"):l.setAttribute("class",Array.from(a).join(" "))},KE=(l,p)=>GE(l).has(p),Bd=(l,p)=>{const a=l.selector("FragmentSelector");if(a!=null&&a.conformsTo.startsWith("http://www.w3.org/TR/media-frags")){const{value:c}=a,f=c.includes(":")?c.substring(c.indexOf("=")+1,c.indexOf(":")):"pixel",m=c.includes(":")?c.substring(c.indexOf(":")+1):c.substring(c.indexOf("=")+1);let[v,_,S,E]=m.split(",").map(parseFloat);return f.toLowerCase()==="percent"&&(v=v*p.naturalWidth/100,_=_*p.naturalHeight/100,S=S*p.naturalWidth/100,E=E*p.naturalHeight/100),{x:v,y:_,w:S,h:E}}},Fge=(l,p,a,c,f)=>({source:f==null?void 0:f.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${l},${p},${a},${c}`}}),Bge=(l,p,a,c,f)=>{const m=l/f.naturalWidth*100,v=p/f.naturalHeight*100,_=a/f.naturalWidth*100,S=c/f.naturalHeight*100;return{source:f.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=percent:${m},${v},${_},${S}`}}},Sf=(l,p,a,c,f,m)=>(m==null?void 0:m.toLowerCase())==="percent"?Bge(l,p,a,c,f):Fge(l,p,a,c,f),L0=(l,p,a,c,f)=>{l.setAttribute("x",p),l.setAttribute("y",a),l.setAttribute("width",c),l.setAttribute("height",f)},M0=(l,p,a)=>{l.setAttribute("cx",p),l.setAttribute("cy",a),l.setAttribute("r",7)},y4=(l,p,a,c,f)=>{const m=document.createElementNS(ki,"path");m.setAttribute("fill-rule","evenodd");const{naturalWidth:v,naturalHeight:_}=l;return m.setAttribute("d",`M0 0 h${v} v${_} h-${v} z M${p} ${a} h${c} v${f} h-${c} z`),m},v4=(l,p,a,c,f,m)=>{const{naturalWidth:v,naturalHeight:_}=p;l.setAttribute("d",`M0 0 h${v} v${_} h-${v} z M${a} ${c} h${f} v${m} h-${f} z`)},YE=(l,p,a,c)=>{const{x:f,y:m,w:v,h:_}=l.type==="Annotation"||l.type==="Selection"?Bd(l,p):{x:l,y:p,w:a,h:c},S=document.createElementNS(ki,"g");if(v===0&&_===0){Vc(S,"a9s-point"),Vc(S,"a9s-non-scaling"),S.setAttribute("transform-origin",`${f} ${m}`);const E=document.createElementNS(ki,"circle"),x=document.createElementNS(ki,"circle");x.setAttribute("class","a9s-inner"),M0(x,f,m),E.setAttribute("class","a9s-outer"),M0(E,f,m),S.appendChild(E),S.appendChild(x)}else{const E=document.createElementNS(ki,"rect"),x=document.createElementNS(ki,"rect");x.setAttribute("class","a9s-inner"),L0(x,f,m,v,_),E.setAttribute("class","a9s-outer"),L0(E,f,m,v,_),S.appendChild(E),S.appendChild(x)}return S},XE=l=>{const p=l.querySelector(".a9s-outer");if(p.nodeName==="rect"){const a=parseFloat(p.getAttribute("x")),c=parseFloat(p.getAttribute("y")),f=parseFloat(p.getAttribute("width")),m=parseFloat(p.getAttribute("height"));return{x:a,y:c,w:f,h:m}}else{const a=parseFloat(p.getAttribute("cx")),c=parseFloat(p.getAttribute("cy"));return{x:a,y:c,w:0,h:0}}},b4=(l,p,a,c,f)=>{const m=l.querySelector(".a9s-inner"),v=l.querySelector(".a9s-outer");v.nodeName==="rect"?(L0(m,p,a,c,f),L0(v,p,a,c,f)):(M0(m,p,a),M0(v,p,a))},Uge=(l,p)=>{const{w:a,h:c}=Bd(l,p);return a*c};class Hge{constructor(p,a,c,f,m){r(this,"dragTo",(v,_)=>{this.group.style.display=null,this.opposite=[v,_];const{x:S,y:E,w:x,h:U}=this.bbox;v4(this.mask,this.env.image,S,E,x,U),b4(this.rect,S,E,x,U)}),r(this,"getBoundingClientRect",()=>this.rect.getBoundingClientRect()),r(this,"toSelection",()=>{const{x:v,y:_,w:S,h:E}=this.bbox;return new Hg(Sf(v,_,S,E,this.env.image,this.config.fragmentUnit))}),r(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.mask=null,this.rect=null,this.group=null}),this.anchor=[p,a],this.opposite=[p,a],this.config=f,this.env=m,this.group=document.createElementNS(ki,"g"),this.mask=y4(m.image,p,a,2,2),this.mask.setAttribute("class","a9s-selection-mask"),this.rect=YE(p,a,2,2),this.rect.setAttribute("class","a9s-selection"),this.group.style.pointerEvents="none",this.group.style.display="none",this.group.appendChild(this.mask),this.group.appendChild(this.rect),c.appendChild(this.group)}get bbox(){const p=this.opposite[0]-this.anchor[0],a=this.opposite[1]-this.anchor[1];return{x:p>0?this.anchor[0]:this.opposite[0],y:a>0?this.anchor[1]:this.opposite[1],w:Math.max(1,Math.abs(p)),h:Math.max(1,Math.abs(a))}}get element(){return this.rect}}const zge={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},ZE=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,jge=l=>{let p=null;const a=(f,m)=>new MouseEvent(f,{screenX:m.screenX,screenY:m.screenY,clientX:m.clientX,clientY:m.clientY,pageX:m.pageX,pageY:m.pageY,bubbles:!0}),c=f=>{const m=f.changedTouches[0],v=a(zge[f.type],m);m.target.dispatchEvent(v),f.preventDefault(),(f.type==="touchstart"||f.type==="touchmove")&&(p&&clearTimeout(p),p=setTimeout(()=>{const _=a("dblclick",m);m.target.dispatchEvent(_)},800)),f.type==="touchend"&&p&&clearTimeout(p)};l.addEventListener("touchstart",c,!0),l.addEventListener("touchmove",c,!0),l.addEventListener("touchend",c,!0),l.addEventListener("touchcancel",c,!0)},N0="An implementation is missing",Vge=ZE();class w4 extends Oa{constructor(p,a,c){super(),r(this,"enableResponsive",()=>{window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{const m=this.svg.getBoundingClientRect(),{width:v,height:_}=this.svg.viewBox.baseVal;this.scale=Math.max(v/m.width,_/m.height),this.onScaleChanged&&this.onScaleChanged(this.scale)}),this.resizeObserver.observe(this.svg.parentNode))}),r(this,"getSVGPoint",m=>{const v=this.svg.createSVGPoint();if(Vge){const _=this.svg.getBoundingClientRect(),S=m.clientX-_.x,E=m.clientY-_.y,{left:x,top:U}=this.svg.getBoundingClientRect();return v.x=S+x,v.y=E+U,v.matrixTransform(this.g.getScreenCTM().inverse())}else return v.x=m.offsetX,v.y=m.offsetY,v.matrixTransform(this.g.getCTM().inverse())}),r(this,"drawHandle",(m,v)=>{const _=document.createElementNS(ki,"g");_.setAttribute("class","a9s-handle");const S=document.createElementNS(ki,"g"),E=ie=>{const de=document.createElementNS(ki,"circle");return de.setAttribute("cx",m),de.setAttribute("cy",v),de.setAttribute("r",ie),de.setAttribute("transform-origin",`${m} ${v}`),de},x=this.config.handleRadius||6,U=E(x);U.setAttribute("class","a9s-handle-inner");const V=E(x+1);return V.setAttribute("class","a9s-handle-outer"),S.appendChild(V),S.appendChild(U),_.appendChild(S),_}),r(this,"setHandleXY",(m,v,_)=>{const S=m.querySelector(".a9s-handle-inner");S.setAttribute("cx",v),S.setAttribute("cy",_),S.setAttribute("transform-origin",`${v} ${_}`);const E=m.querySelector(".a9s-handle-outer");E.setAttribute("cx",v),E.setAttribute("cy",_),E.setAttribute("transform-origin",`${v} ${_}`)}),r(this,"getHandleXY",m=>{const v=m.querySelector(".a9s-handle-outer");return{x:parseFloat(v.getAttribute("cx")),y:parseFloat(v.getAttribute("cy"))}}),r(this,"scaleHandle",m=>{const v=m.querySelector(".a9s-handle-inner"),_=m.querySelector(".a9s-handle-outer"),S=this.scale*(this.config.handleRadius||6);v.setAttribute("r",S),_.setAttribute("r",S)}),this.svg=p.closest("svg"),this.g=p,this.config=a,this.env=c,this.scale=1;const{image:f}=c;(f instanceof Element||f instanceof HTMLDocument)&&this.enableResponsive()}destroy(){this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeObserver=null}}class QE extends w4{constructor(p,a,c){super(p,a,c),r(this,"attachListeners",({mouseMove:f,mouseUp:m,dblClick:v})=>{f&&(this.mouseMove=_=>{const{x:S,y:E}=this.getSVGPoint(_);this.started||(this.emit("startSelection",{x:S,y:E}),this.started=!0),f(S,E,_)},this.svg.addEventListener("mousemove",this.mouseMove)),m&&(this.mouseUp=_=>{if(_.button!==0)return;const{x:S,y:E}=this.getSVGPoint(_);m(S,E,_)},document.addEventListener("mouseup",this.mouseUp)),v&&(this.dblClick=_=>{const{x:S,y:E}=this.getSVGPoint(_);v(S,E,_)},document.addEventListener("dblclick",this.dblClick))}),r(this,"detachListeners",()=>{this.mouseMove&&this.svg.removeEventListener("mousemove",this.mouseMove),this.mouseUp&&document.removeEventListener("mouseup",this.mouseUp),this.dblClick&&document.removeEventListener("dblclick",this.dblClick)}),r(this,"start",(f,m)=>{const{x:v,y:_}=this.getSVGPoint(f),{naturalWidth:S,naturalHeight:E}=this.env.image,x=v<0?0:v>S?S:v,U=_<0?0:_>E?E:_;this.startDrawing(x,U,m,f)}),r(this,"startDrawing",f=>{throw new Error(N0)}),r(this,"createEditableShape",(f,m)=>{throw new Error(N0)}),this.started=!1}get isDrawing(){throw new Error(N0)}}QE.supports=l=>{throw new Error(N0)};const _4="An implementation is missing";class S4 extends w4{constructor(p,a,c,f){super(a,c,f),r(this,"updateState",m=>{throw new Error(_4)}),this.annotation=p}get element(){throw new Error(_4)}}const Wge=/firefox/i.test(navigator.userAgent),T4=(l,p,a,c,f)=>{l.setAttribute("width",c),l.setAttribute("height",f),Wge?(l.setAttribute("x",0),l.setAttribute("y",0),l.setAttribute("transform",`translate(${p}, ${a})`)):(l.setAttribute("x",p),l.setAttribute("y",a))},qge=(l,p)=>{const{x:a,y:c,width:f,height:m}=p.getBBox(),v=document.createElementNS(ki,"svg");v.setAttribute("class","a9s-formatter-el"),T4(v,a,c,f,m);const _=document.createElementNS(ki,"g");_.appendChild(l),v.appendChild(_),p.append(v)},F0=(l,p,a)=>{if(!a)return l;const c=a.reduce((_,S)=>{const E=S(p);if(!E)return _;if(typeof E=="string"||E instanceof String)_.className=_.className?`${_.className} ${E}`:E;else if(E.nodeType===Node.ELEMENT_NODE)_.elements=_.elements?[..._.elements,E]:[E];else{const{className:x,style:U,element:V}=E;x&&(_.className=_.className?`${_.className} ${x}`:x),U&&(_.style=_.style?`${_.style} ${U}`:U),V&&(_.elements=_.elements?[..._.elements,V]:[V])}for(const x in E)E.hasOwnProperty(x)&&x.startsWith("data-")&&(_[x]=E[x]);return _},{}),{className:f,style:m,elements:v}=c;if(f&&Vc(l,f),m){const _=l.querySelector(".a9s-outer"),S=l.querySelector(".a9s-inner");_&&S?(_.setAttribute("style","display:none"),S.setAttribute("style",m)):l.setAttribute("style",m)}v&&v.forEach(_=>qge(_,l));for(const _ in c)c.hasOwnProperty(_)&&_.startsWith("data-")&&l.setAttribute(_,c[_])},E4=(l,p,a,c,f)=>{const m=l.querySelector(".a9s-formatter-el");m&&T4(m,p,a,c,f)},zg="corner",B0="edge";class Gge extends S4{constructor(p,a,c,f){super(p,a,c,f),r(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle)),r(this,"setSize",(x,U,V,ie)=>{b4(this.rectangle,x,U,V,ie),v4(this.mask,this.env.image,x,U,V,ie),E4(this.elementGroup,x,U,V,ie);const[de,Ie,ke,Ve,W,Te,je,Be]=this.handles;this.setHandleXY(de,x,U),this.setHandleXY(Ie,x+V,U),this.setHandleXY(ke,x+V,U+ie),this.setHandleXY(Ve,x,U+ie),this.enableEdgeControls&&(this.setHandleXY(W,x+V/2,U),this.setHandleXY(Te,x+V,U+ie/2),this.setHandleXY(je,x+V/2,U+ie),this.setHandleXY(Be,x,U+ie/2))}),r(this,"stretchCorners",(x,U,V)=>{const ie=this.getHandleXY(U),de=V.x-ie.x,Ie=V.y-ie.y,ke=de>0?ie.x:V.x,Ve=Ie>0?ie.y:V.y,W=Math.abs(de),Te=Math.abs(Ie);return this.setSize(ke,Ve,W,Te),{x:ke,y:Ve,w:W,h:Te}}),r(this,"stretchEdge",(x,U,V)=>{const ie=this.getHandleXY(U),de=XE(this.rectangle),Ie=x%2===0,ke=Ie?de.w:V.x-ie.x,Ve=Ie?V.y-ie.y:de.h,W=Ie?de.x:ke>0?ie.x:V.x,Te=Ie?Ve>0?ie.y:V.y:de.y,je=Math.abs(ke),Be=Math.abs(Ve);return this.setSize(W,Te,je,Be),{x:W,y:Te,w:je,h:Be}}),r(this,"onGrab",(x,U)=>V=>{if(V.button!==0)return;this.grabbedElem=x,this.grabbedType=U;const ie=this.getSVGPoint(V),{x:de,y:Ie}=XE(this.rectangle);this.mouseOffset={x:ie.x-de,y:ie.y-Ie}}),r(this,"onMouseMove",x=>{if(x.button!==0)return;const U=(V,ie)=>V<0?0:V>ie?ie:V;if(this.grabbedElem){const V=this.getSVGPoint(x);if(this.grabbedElem===this.rectangle){const{w:ie,h:de}=XE(this.rectangle),{naturalWidth:Ie,naturalHeight:ke}=this.env.image,Ve=U(V.x-this.mouseOffset.x,Ie-ie),W=U(V.y-this.mouseOffset.y,ke-de);this.setSize(Ve,W,ie,de),this.emit("update",Sf(Ve,W,ie,de,this.env.image,this.config.fragmentUnit))}else{const ie=this.handles.indexOf(this.grabbedElem),de=this.handles[ie^2],{x:Ie,y:ke,w:Ve,h:W}=this.grabbedType===zg?this.stretchCorners(ie,de,V):this.stretchEdge(ie,de,V);this.emit("update",Sf(Ie,ke,Ve,W,this.env.image,this.config.fragmentUnit))}}}),r(this,"onMouseUp",x=>{this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null}),r(this,"updateState",x=>{const{x:U,y:V,w:ie,h:de}=Bd(x,this.env.image);this.setSize(U,V,ie,de)}),this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp);const{x:m,y:v,w:_,h:S}=Bd(p,f.image);this.containerGroup=document.createElementNS(ki,"g"),this.mask=y4(f.image,m,v,_,S),this.mask.setAttribute("class","a9s-selection-mask"),this.containerGroup.appendChild(this.mask),this.elementGroup=document.createElementNS(ki,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",p.id),this.rectangle=YE(m,v,_,S),this.rectangle.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.rectangle)),this.elementGroup.appendChild(this.rectangle),this.enableEdgeControls=c.enableEdgeControls;const E=this.enableEdgeControls?[[m+_/2,v,B0],[m+_,v+S/2,B0],[m+_/2,v+S,B0],[m,v+S/2,B0]]:[];this.handles=[[m,v,zg],[m+_,v,zg],[m+_,v+S,zg],[m,v+S,zg],...E].map(x=>{const[U,V,ie]=x,de=this.drawHandle(U,V);return de.addEventListener("mousedown",this.onGrab(de,ie)),this.elementGroup.appendChild(de),de}),this.containerGroup.appendChild(this.elementGroup),a.appendChild(this.containerGroup),F0(this.rectangle,p,c.formatters),this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null}get element(){return this.elementGroup}destroy(){this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()}}class U0 extends QE{constructor(p,a,c){super(p,a,c),r(this,"startDrawing",(f,m)=>{this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp}),this.rubberband=new Hge(f,m,this.g,this.config,this.env)}),r(this,"stop",()=>{this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)}),r(this,"onMouseMove",(f,m)=>{const{naturalWidth:v,naturalHeight:_}=this.env.image,S=Math.min(Math.max(f,0),v),E=Math.min(Math.max(m,0),_);this.rubberband.dragTo(S,E)}),r(this,"onMouseUp",()=>{this.detachListeners(),this.started=!1;const{width:f,height:m}=this.rubberband.getBoundingClientRect(),v=this.config.minSelectionWidth||4,_=this.config.minSelectionHeight||4;if(f>=v&&m>=_){const{element:S}=this.rubberband;S.annotation=this.rubberband.toSelection(),this.emit("complete",S)}else this.emit("cancel");this.stop()}),r(this,"createEditableShape",(f,m)=>new Gge(f,this.g,{...this.config,formatters:m},this.env)),this.rubberband=null}get isDrawing(){return this.rubberband!=null}}U0.identifier="rect",U0.supports=l=>{const p=l.selector("FragmentSelector");return p==null?void 0:p.conformsTo.startsWith("http://www.w3.org/TR/media-frags")};const H0=l=>{let p=0,a=l.length-1;for(let c=0;c{const f=l[0]-p,m=l[1]-a;return Math.sqrt(f*f+m*m)<=c},Yge=(l,p,a,c,f,m)=>{const _=Math.cos(0),S=Math.sin(0),E=l[0]-p,x=l[1]-a,U=_*E+S*x,V=S*E-_*x;return U*U/(c*c)+V*V/(f*f)<=1},JE=(l,p)=>{const a=l[0],c=l[1];let f=!1;for(let m=0,v=p.length-1;mc!=x>c&&a<(E-_)*(c-S)/(x-S)+_&&(f=!f)}return f},Xge=(l,p)=>{for(let a of l)if(!JE(a,p))return!1;return!0},Zge=(l,p,a,c,f,m)=>{const v=l[0],_=l[1],S=c-p,E=f-a,x=Math.sqrt(S*S+E*E);return Math.abs((v-p)*E-(_-a)*S)/x<=m},x4=l=>{const p=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()),a=[];let c=[];for(let f of p){const m=f.substring(0,1);if(m.toLowerCase()==="z")a.push([...c]),c=[];else{const v=f.substring(1).split(" ").map(x=>parseFloat(x.trim())),_=m===m.toUpperCase(),S=_?v[0]:v[0]+c[c.length-1][0],E=_?v[1]:v[1]+c[c.length-1][1];c.push([S,E])}}return c.length>0&&a.push([...c]),a},Qge=l=>{const p=new XMLSerializer().serializeToString(l.documentElement).replace("",``);return new DOMParser().parseFromString(p,"image/svg+xml").documentElement},C4=l=>{const p=c=>{Array.from(c.attributes).forEach(f=>{f.name.startsWith("on")&&c.removeAttribute(f.name)})},a=l.getElementsByTagName("script");return Array.from(a).reverse().forEach(c=>c.parentNode.removeChild(c)),p(l),Array.from(l.querySelectorAll("*")).forEach(p),l},Oh=l=>{const p=l.selector("SvgSelector");if(p){const a=new DOMParser,{value:c}=p,f=a.parseFromString(c,"image/svg+xml"),m=f.lookupPrefix(ki),v=f.lookupNamespaceURI(null);return m||v?C4(f).firstChild:C4(Qge(f)).firstChild}},A4=l=>{const p=Oh(l),a=document.createElementNS(ki,"g"),c=p.cloneNode(!0);c.setAttribute("class","a9s-inner");const f=p.cloneNode(!0);return f.setAttribute("class","a9s-outer"),a.appendChild(f),a.appendChild(c),a},$E=(l,p)=>{const a=l.querySelector(".a9s-inner").cloneNode(!0);a.removeAttribute("class"),a.removeAttribute("xmlns");let c=a.outerHTML||new XMLSerializer().serializeToString(a);return c=c.replace(` xmlns="${ki}"`,""),{source:p==null?void 0:p.src,selector:{type:"SvgSelector",value:`${c}`}}},Jge=l=>{const p=Oh(l),a=p.nodeName.toLowerCase();if(a==="polygon")return $ge(p);if(a==="circle")return eye(p);if(a==="ellipse")return tye(p);if(a=="path")return nye(p);if(a=="line")return 0;throw`Unsupported SVG shape type: ${a}`},$ge=l=>{const p=l.getAttribute("points").trim().split(" ").map(a=>a.split(",").map(c=>parseFloat(c.trim())));return H0(p)},eye=l=>{const p=l.getAttribute("r");return p*p*Math.PI},tye=l=>{const p=l.getAttribute("rx"),a=l.getAttribute("ry");return p*a*Math.PI},nye=l=>{const p=x4(l);if(p.length==1)return H0(p[0]);{const a=f=>p.find(m=>{if(f!==m)return Xge(f,m)});let c=0;for(let f of p)a(f)?c-=H0(f):c+=H0(f);return c}};class k4{constructor(p,a){r(this,"redraw",()=>{this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)}),r(this,"destroy",()=>this.mask.parentNode.removeChild(this.mask)),this.w=p.naturalWidth,this.h=p.naturalHeight,this.polygon=a,this.mask=document.createElementNS(ki,"path"),this.mask.setAttribute("fill-rule","evenodd"),this.mask.setAttribute("class","a9s-selection-mask"),this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)}get element(){return this.mask}}class iye{constructor(p,a,c){r(this,"setPoints",f=>{const m=f.map(v=>`${v[0]},${v[1]}`).join(" ");this.outer.setAttribute("points",m),this.inner.setAttribute("points",m)}),r(this,"getBoundingClientRect",()=>this.outer.getBoundingClientRect()),r(this,"dragTo",f=>{this.group.style.display=null,this.mousepos=f;const m=[...this.points,f];this.setPoints(m),this.mask.redraw()}),r(this,"addPoint",()=>{const[f,m]=this.mousepos,v=this.points[this.points.length-1];Math.pow(f-v[0],2)+Math.pow(m-v[1],2)>4&&(this.points=[...this.points,this.mousepos],this.setPoints(this.points),this.mask.redraw())}),r(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.polygon=null,this.group=null}),r(this,"toSelection",()=>new Hg($E(this.group,this.env.image))),this.points=[p],this.env=c,this.mousepos=p,this.group=document.createElementNS(ki,"g"),this.polygon=document.createElementNS(ki,"g"),this.polygon.setAttribute("class","a9s-selection"),this.outer=document.createElementNS(ki,"polygon"),this.outer.setAttribute("class","a9s-outer"),this.inner=document.createElementNS(ki,"polygon"),this.inner.setAttribute("class","a9s-inner"),this.setPoints(this.points),this.mask=new k4(c.image,this.inner),this.polygon.appendChild(this.outer),this.polygon.appendChild(this.inner),this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.polygon),a.appendChild(this.group)}get element(){return this.polygon}}const ex=l=>{const p=l.querySelector(".a9s-inner").points,a=[];for(let c=0;cl.querySelector(".a9s-inner").getBBox();class sye extends S4{constructor(p,a,c,f){super(p,a,c,f),r(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle)),r(this,"setPoints",m=>{const v=ie=>Math.round(10*ie)/10,_=m.map(ie=>`${v(ie.x)},${v(ie.y)}`).join(" ");this.shape.querySelector(".a9s-inner").setAttribute("points",_);const S=this.shape.querySelector(".a9s-outer");S.setAttribute("points",_),this.mask.redraw();const{x:E,y:x,width:U,height:V}=S.getBBox();E4(this.elementGroup,E,x,U,V)}),r(this,"onGrab",m=>v=>{v.button===0&&(this.grabbedElem=m,this.grabbedAt=this.getSVGPoint(v))}),r(this,"onMouseMove",m=>{const v=(_,S,E)=>_+S<0?-_:_+S>E?E-_:S;if(this.grabbedElem){const _=this.getSVGPoint(m);if(this.grabbedElem===this.shape){const{x:S,y:E,width:x,height:U}=rye(this.shape),{naturalWidth:V,naturalHeight:ie}=this.env.image,de=v(S,_.x-this.grabbedAt.x,V-x),Ie=v(E,_.y-this.grabbedAt.y,ie-U),ke=ex(this.shape).map(Ve=>({x:Ve.x+de,y:Ve.y+Ie}));this.grabbedAt=_,this.setPoints(ke),ke.forEach((Ve,W)=>this.setHandleXY(this.handles[W],Ve.x,Ve.y)),this.emit("update",$E(this.shape,this.env.image))}else{const S=this.handles.indexOf(this.grabbedElem),E=ex(this.shape).map((x,U)=>U===S?_:x);this.setPoints(E),this.setHandleXY(this.handles[S],_.x,_.y),this.emit("update",$E(this.shape,this.env.image))}}}),r(this,"onMouseUp",m=>{this.grabbedElem=null,this.grabbedAt=null}),r(this,"updateState",m=>{const v=Oh(m).getAttribute("points").split(" ").map(_=>{const[S,E]=_.split(",").map(x=>parseFloat(x.trim()));return{x:S,y:E}});this.setPoints(v),v.forEach((_,S)=>this.setHandleXY(this.handles[S],_.x,_.y))}),r(this,"destroy",()=>{this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()}),this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp),this.containerGroup=document.createElementNS(ki,"g"),this.shape=A4(p),this.shape.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.shape)),this.mask=new k4(f.image,this.shape.querySelector(".a9s-inner")),this.containerGroup.appendChild(this.mask.element),this.elementGroup=document.createElementNS(ki,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",p.id),this.elementGroup.appendChild(this.shape),this.handles=ex(this.shape).map(m=>{const v=this.drawHandle(m.x,m.y);return v.addEventListener("mousedown",this.onGrab(v)),this.elementGroup.appendChild(v),v}),this.containerGroup.appendChild(this.elementGroup),a.appendChild(this.containerGroup),F0(this.shape,p,c.formatters),this.grabbedElem=null,this.grabbedAt=null}get element(){return this.elementGroup}}class tx extends QE{constructor(p,a,c){super(p,a,c),r(this,"startDrawing",(f,m,v)=>{this._isDrawing=!0,this._startOnSingleClick=v,this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp,dblClick:this.onDblClick}),this.rubberband=new iye([f,m],this.g,this.env)}),r(this,"stop",()=>{this.detachListeners(),this._isDrawing=!1,this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)}),r(this,"onMouseMove",(f,m)=>this.rubberband.dragTo([f,m])),r(this,"onMouseUp",()=>{const{width:f,height:m}=this.rubberband.getBoundingClientRect(),v=this.config.minSelectionWidth||4,_=this.config.minSelectionHeight||4;f>=v||m>=_?this.rubberband.addPoint():this._startOnSingleClick||(this.emit("cancel"),this.stop())}),r(this,"onDblClick",()=>{this._isDrawing=!1;const f=this.rubberband.element;f.annotation=this.rubberband.toSelection(),this.emit("complete",f),this.stop()}),r(this,"createEditableShape",(f,m)=>new sye(f,this.g,{...this.config,formatters:m},this.env)),this._isDrawing=!1,this._startOnSingleClick=!1}get isDrawing(){return this._isDrawing}}tx.identifier="polygon",tx.supports=l=>{var p;const a=l.selector("SvgSelector");if(a)return(p=a.value)==null?void 0:p.match(/^this._registered.map(f=>f.identifier)),r(this,"registerTool",f=>{const m=f.identifier;this.listTools().includes(m)&&this.unregisterTool(m),this._registered.unshift(f)}),r(this,"unregisterTool",f=>this._registered=this._registered.filter(m=>m.identifier!==f)),r(this,"setCurrent",f=>{this._current&&this._current.destroy();const m=typeof f=="string"||f instanceof String?this._registered.find(v=>v.identifier===f):f;this._current=new m(this._g,this._config,this._env),this._current.on("startSelection",v=>this.emit("startSelection",v)),this._current.on("complete",v=>this.emit("complete",v)),this._current.on("cancel",v=>this.emit("cancel",v))}),r(this,"forAnnotation",f=>{var m;const[v,..._]=f.targets,S=(m=v.renderedVia)==null?void 0:m.name,E=S?this._registered.find(x=>x.identifier===S):this._registered.find(x=>x.supports(f));return E?new E(this._g,this._config,this._env):null}),this._g=p,this._config=a,this._env=c,this._registered=[U0,tx],this.setCurrent(U0)}get current(){return this._current}}const aye={FragmentSelector:YE,SvgSelector:A4},lye={FragmentSelector:Uge,SvgSelector:Jge},P4=l=>{const p=l.targets[0];if(p)return Array.isArray(p.selector)?p.selector[0]:p.selector},nx=(l,p)=>aye[P4(l).type](l,p),D4=(l,p)=>lye[P4(l).type](l,p);class uye{constructor(p){const a=document.createElementNS(ki,"svg");a.setAttribute("class","a9s-osd-crosshair-container");const c=document.createElementNS(ki,"g");c.setAttribute("class","a9s-crosshair"),a.appendChild(c);const f=document.createElementNS(ki,"line"),m=document.createElementNS(ki,"line");c.appendChild(f),c.appendChild(m),p.parentElement.appendChild(a);const v=_=>{const{offsetX:S,offsetY:E}=_,x=p.parentElement.offsetWidth,U=p.parentElement.offsetHeight;f.setAttribute("x1",0),f.setAttribute("y1",E),f.setAttribute("x2",x),f.setAttribute("y2",E),m.setAttribute("x1",S),m.setAttribute("y1",0),m.setAttribute("x2",S),m.setAttribute("y2",U)};p.addEventListener("pointermove",v),p.parentElement.addEventListener("pointermove",v)}}function cye(l,p,a,c,f){I4(l,p,a||0,c||l.length-1,f||dye)}function I4(l,p,a,c,f){for(;c>a;){if(c-a>600){var m=c-a+1,v=p-a+1,_=Math.log(m),S=.5*Math.exp(2*_/3),E=.5*Math.sqrt(_*S*(m-S)/m)*(v-m/2<0?-1:1),x=Math.max(a,Math.floor(p-v*S/m+E)),U=Math.min(c,Math.floor(p+(m-v)*S/m+E));I4(l,p,x,U,f)}var V=l[p],ie=a,de=c;for(jg(l,a,p),f(l[c],V)>0&&jg(l,a,c);ie0;)de--}f(l[a],V)===0?jg(l,a,de):(de++,jg(l,de,c)),de<=p&&(a=de+1),p<=de&&(c=de-1)}}function jg(l,p,a){var c=l[p];l[p]=l[a],l[a]=c}function dye(l,p){return lp?1:0}class hye{constructor(p=9){this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(p){let a=this.data;const c=[];if(!j0(p,a))return c;const f=this.toBBox,m=[];for(;a;){for(let v=0;v=0&&m[a].children.length>this._maxEntries;)this._split(m,a),a--;this._adjustParentBBoxes(f,m,a)}_split(p,a){const c=p[a],f=c.children.length,m=this._minEntries;this._chooseSplitAxis(c,m,f);const v=this._chooseSplitIndex(c,m,f),_=Ef(c.children.splice(v,c.children.length-v));_.height=c.height,_.leaf=c.leaf,Tf(c,this.toBBox),Tf(_,this.toBBox),a?p[a-1].children.push(_):this._splitRoot(c,_)}_splitRoot(p,a){this.data=Ef([p,a]),this.data.height=p.height+1,this.data.leaf=!1,Tf(this.data,this.toBBox)}_chooseSplitIndex(p,a,c){let f,m=1/0,v=1/0;for(let _=a;_<=c-a;_++){const S=Vg(p,0,_,this.toBBox),E=Vg(p,_,c,this.toBBox),x=yye(S,E),U=ix(S)+ix(E);x=a;E--){const x=p.children[E];Wg(_,p.leaf?m(x):x),S+=z0(_)}return S}_adjustParentBBoxes(p,a,c){for(let f=c;f>=0;f--)Wg(a[f],p)}_condense(p){for(let a=p.length-1,c;a>=0;a--)p[a].children.length===0?a>0?(c=p[a-1].children,c.splice(c.indexOf(p[a]),1)):this.clear():Tf(p[a],this.toBBox)}}function pye(l,p,a){if(!a)return p.indexOf(l);for(let c=0;c=l.minX&&p.maxY>=l.minY}function Ef(l){return{children:l,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function O4(l,p,a,c,f){const m=[p,a];for(;m.length;){if(a=m.pop(),p=m.pop(),a-p<=c)continue;const v=p+Math.ceil((a-p)/c/2)*c;cye(l,v,p,a,f),m.push(p,v,v,a)}}const sx=(l,p)=>{if(l.targets[0].selector.type==="FragmentSelector"){const{x:a,y:c,w:f,h:m}=Bd(l,p);return{minX:a,minY:c,maxX:a+f,maxY:c+m}}else{const a=nx(l,p),c=document.createElementNS(ki,"svg");c.style.position="absolute",c.style.opacity=0,c.style.top=0,c.style.left=0,c.appendChild(a),document.body.appendChild(c);const{x:f,y:m,width:v,height:_}=a.getBBox();return document.body.removeChild(c),{minX:f,minY:m,maxX:f+v,maxY:m+_}}},vye=l=>{var p;const a=l.targets[0];return Array.isArray(a.selector)?a.selector[0].type:(p=a.selector)==null?void 0:p.type},bye=(l,p,a,c)=>{const f=Oh(a),m=f.nodeName.toLowerCase(),v=[l,p];if(m==="polygon"){const _=Array.from(f.points).map(S=>[S.x,S.y]);return JE(v,_)}else if(m==="circle"){const _=f.getAttribute("cx"),S=f.getAttribute("cy"),E=f.getAttribute("r");return Kge(v,_,S,E)}else if(m==="ellipse"){const _=f.getAttribute("cx"),S=f.getAttribute("cy"),E=f.getAttribute("rx"),x=f.getAttribute("ry");return Yge(v,_,S,E,x)}else{if(m==="path")return x4(f).find(_=>JE(v,_));if(m==="line"){const _=parseInt(f.getAttribute("x1")),S=parseInt(f.getAttribute("y1")),E=parseInt(f.getAttribute("x2")),x=parseInt(f.getAttribute("y2"));return Zge(v,_,S,E,x,c)}else throw`Unsupported SVG shape type: ${m}`}};class wye{constructor(p){r(this,"clear",()=>this.spatial_index.clear()),r(this,"getAnnotationAt",(a,c,f)=>{const m=f?5/f:5,v=this.spatial_index.search({minX:a-m,minY:c-m,maxX:a+m,maxY:c+m}).map(_=>_.annotation).filter(_=>{const S=vye(_);if(S==="FragmentSelector")return!0;if(S==="SvgSelector")return bye(a,c,_,m);throw`Unsupported selector type: ${S}`});if(v.length>0)return v.sort((_,S)=>D4(_,this.env.image)-D4(S,this.env.image)),v[0]}),r(this,"getAnnotationsIntersecting",a=>{const c=a.minX,f=c?a:sx(a,this.env.image),m=this.spatial_index.search(f).map(v=>v.annotation);return c?m:m.filter(v=>!v.isEqual(a))}),r(this,"insert",a=>{(Array.isArray(a)?a:[a]).forEach(c=>{this.spatial_index.insert({...sx(c,this.env.image),annotation:c})})}),r(this,"getBounds",a=>this.getBounds(a,this.env.image)),r(this,"remove",a=>{const c={...sx(a,this.env.image),annotation:a};this.spatial_index.remove(c,(f,m)=>f.annotation.id===m.annotation.id)}),this.env=p,p.store=this,this.spatial_index=new hye}}const R4=(l,p)=>{const a=(KE(p,".a9s-annotation")?p:p.closest(".a9s-annotation")).querySelector(".a9s-outer").getBoundingClientRect(),{canvas:c}=l.drawer,f=c.getBoundingClientRect(),m=c.width/f.width,v=c.height/f.height,_=a.x-f.x,S=a.y-f.y,{width:E,height:x}=a,U=document.createElement("CANVAS"),V=U.getContext("2d");U.width=E,U.height=x,V.drawImage(c,_*m,S*v,E*m,x*v,0,0,E,x);const ie=l.viewport.viewerElementToImageCoordinates(new jc.Point(_,S)),de=l.viewport.viewportToImageZoom(l.viewport.getZoom());return{snippet:U,transform:Ie=>{const ke=ie.x+Ie[0]/m/de,Ve=ie.y+Ie[1]/v/de;return[ke,Ve]}}},_ye=ZE();class L4 extends Oa{constructor(p){super(),r(this,"_getShapeAt",c=>{const f=S=>{const E=this.svg.createSVGPoint();if(window.TouchEvent&&S instanceof TouchEvent){const x=this.svg.getBoundingClientRect(),U=S.touches[0],V=U.clientX-x.x,ie=U.clientY-x.y,{left:de,top:Ie}=this.svg.getBoundingClientRect();return E.x=V+de,E.y=ie+Ie,E.matrixTransform(this.g.getScreenCTM().inverse())}else return E.x=S.offsetX,E.y=S.offsetY,E.matrixTransform(this.g.getCTM().inverse())},{x:m,y:v}=f(c),_=this.store.getAnnotationAt(m,v,this.currentScale());if(_)return this.findShape(_)}),r(this,"_initDrawingTools",c=>{var f;let m=!1,v=!1,_=!1;this.tools=new oye(this.g,this.config,this.env),this.tools.on("complete",x=>{v=!1,this.onDrawingComplete(x)}),this.mouseTracker=new jc.MouseTracker({element:this.svg,preProcessEventHandler:x=>{this.mouseTracker.enabled||(x.preventDefault=!1,x.preventGesture=!0),this.selectedShape&&x.eventType==="wheel"&&(x.preventDefault=!1,this.viewer.canvas.dispatchEvent(new x.originalEvent.constructor(x.eventType,x.originalEvent)))},pressHandler:x=>{this.tools.current.isDrawing||(this.tools.current.start(x.originalEvent,this.drawOnSingleClick&&!this.hoveredShape),c||this.scaleTool(this.tools.current))},moveHandler:x=>{if(this.tools.current.isDrawing){const{x:U,y:V}=this.tools.current.getSVGPoint(x.originalEvent);v||x.originalEvent.stopPropagation(),this.tools.current.onMouseMove(U,V,x.originalEvent),m||(this.emit("startSelection",{x:U,y:V}),m=!0),!_&&this.tools.current.onDragStart&&(this.tools.current.onDragStart(U,V,x.originalEvent),_=!0)}},releaseHandler:x=>{if(this.tools.current.isDrawing){const{x:U,y:V}=this.tools.current.getSVGPoint(x.originalEvent);m&&(this.emit("endSelection",{x:U,y:V}),v=!0),this.tools.current.onMouseUp(U,V,x.originalEvent),_&&this.tools.current.onDragEnd&&this.tools.current.onDragEnd()}m=!1,_=!1}});const S=this.config.hotkey?this.config.hotkey.key?this.config.hotkey.key.toLowerCase():this.config.hotkey.toLowerCase():"shift",E=(f=this.config.hotkey)==null?void 0:f.inverted;this.mouseTracker.enabled=E,this.onKeyDown&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyUp&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyDown=x=>{if(x.key.toLowerCase()===S&&!this.selectedShape){const U=!this.readOnly&&!E;this.mouseTracker.enabled=U,this.tools.current.enabled=U}},this.onKeyUp=x=>{x.key.toLowerCase()===S&&!this.tools.current.isDrawing&&(this.mouseTracker.enabled=E,this.tools.current.enabled=E,v=!1)},document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)}),r(this,"_initMouseEvents",()=>{this.svg.addEventListener("mousemove",f=>{var m,v;if(!((m=this.tools)!=null&&m.current.isDrawing)&&!f.target.closest(".a9s-annotation.editable.selected")){const _=this._getShapeAt(f);if((_==null?void 0:_.annotation)!==((v=this.hoveredShape)==null?void 0:v.annotation)){if(this.hoveredShape){const S=this.hoveredShape.element||this.hoveredShape;R0(S,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape)}_&&(Vc(_,"hover"),this.emit("mouseEnterAnnotation",_.annotation,_))}this.hoveredShape=_}}),this.svg.parentElement.addEventListener("mouseleave",()=>{this.hoveredShape&&(R0(this.hoveredShape,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape),this.hoveredShape=null)});let c=null;this.viewer.addHandler("canvas-press",()=>c=new Date().getTime()),this.viewer.addHandler("canvas-click",f=>{var m;const{originalEvent:v}=f;if(!((m=this.tools.current)!=null&&m.isDrawing||this.disableSelect)&&new Date().getTime()-c<250){const _=v.target.closest(".a9s-annotation.editable.selected")?this.selectedShape:this._getShapeAt(v);_?(f.preventDefaultAction=!0,this.selectShape(_)):_||(this.deselect(),this.emit("select",{}))}this.disableSelect&&this.hoveredShape&&this.emit("clickAnnotation",this.hoveredShape.annotation,this.hoveredShape)})}),r(this,"_lazy",c=>{if(this.viewer.world.getItemAt(0))c();else{const f=()=>{c(),this.viewer.removeHandler("open",f),this.viewer.world.removeHandler("add-item",f)};this.viewer.addHandler("open",f),this.viewer.world.addHandler("add-item",f)}}),r(this,"_refreshNonScalingAnnotations",()=>{const c=this.currentScale();Array.from(this.svg.querySelectorAll(".a9s-non-scaling")).forEach(f=>f.setAttribute("transform",`scale(${1/c})`))}),r(this,"addAnnotation",(c,f)=>{const m=f||this.g,v=nx(c,this.env.image);return Vc(v,"a9s-annotation"),v.setAttribute("data-id",c.id),v.annotation=c,m.appendChild(v),F0(v,c,this.formatters),this.scaleFormatterElements(v),v}),r(this,"addDrawingTool",c=>this.tools.registerTool(c)),r(this,"addOrUpdateAnnotation",(c,f)=>{var m;const v=(m=this.selectedShape)==null?void 0:m.annotation;(v===c||v!=null&&v.isSelection||v==f)&&this.deselect(),f&&this.removeAnnotation(c),this.removeAnnotation(c);const _=this.addAnnotation(c);KE(_,"a9s-non-scaling")&&_.setAttribute("transform",`scale(${1/this.currentScale()})`),this.store.insert(c)}),r(this,"currentScale",()=>{const c=this.viewer.viewport.getContainerSize().x;return this.viewer.viewport.getZoom(!0)*c/this.viewer.world.getContentFactor()}),r(this,"deselect",()=>{var c;if((c=this.tools)==null||c.current.stop(),this.selectedShape){const{annotation:f}=this.selectedShape;if(this.selectedShape.destroy){if(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),!f.isSelection){const m=this.addAnnotation(f);KE(m,"a9s-non-scaling")&&m.setAttribute("transform",`scale(${1/this.currentScale()})`)}}else R0(this.selectedShape,"selected");this.selectedShape=null}}),r(this,"destroy",()=>{this.deselect(),this.svg.parentNode.removeChild(this.svg)}),r(this,"findShape",c=>{const f=c!=null&&c.id?c.id:c;return this.g.querySelector(`.a9s-annotation[data-id="${f}"]`)}),r(this,"_fit",(c,f,m)=>{const v=this.findShape(c);if(v){const _=f?typeof f=="boolean"?f:f.immediately:!1,S=(f==null?void 0:f.padding)||0,E=this.viewer.container.getBoundingClientRect(),x=Math.min(2*S/E.width,2*S/E.height),{x:U,y:V,width:ie,height:de}=v.getBBox(),Ie=U-x*ie,ke=V-x*de,Ve=ie+2*x*ie,W=de+2*x*de,Te=this.viewer.viewport.imageToViewportRectangle(Ie,ke,Ve,W);this.viewer.viewport[m](Te,_)}}),r(this,"fitBounds",(c,f)=>this._fit(c,f,"fitBounds")),r(this,"fitBoundsWithConstraints",(c,f)=>this._fit(c,f,"fitBoundsWithConstraints")),r(this,"getAnnotations",()=>Array.from(this.g.querySelectorAll(".a9s-annotation")).map(c=>c.annotation)),r(this,"getAnnotationsIntersecting",c=>{const f=c.id?c:this.findShape(c).annotation;return this.store.getAnnotationsIntersecting(f)}),r(this,"getImageSnippetById",c=>{const f=this.findShape(c);if(f)return R4(this.viewer,f)}),r(this,"getSelectedImageSnippet",()=>{var c;if(this.selectedShape){const f=(c=this.selectedShape.element)!=null?c:this.selectedShape;return R4(this.viewer,f)}}),r(this,"init",c=>{this.deselect(),Array.from(this.g.querySelectorAll(".a9s-annotation")).forEach(f=>this.g.removeChild(f)),this.store.clear(),this._lazy(()=>{console.time("Took"),console.log("Drawing..."),this.loaded||(this.g.style.display="none"),c.forEach(f=>this.addAnnotation(f)),console.log("Indexing..."),this.store.insert(c),console.timeEnd("Took"),this.resize()})}),r(this,"listDrawingTools",()=>this.tools.listTools()),r(this,"overrideId",(c,f)=>{const m=this.findShape(c);m.setAttribute("data-id",f);const{annotation:v}=m,_=v.clone({id:f});return m.annotation=_,this.store.remove(v),this.store.insert(_),_}),r(this,"panTo",(c,f)=>{const m=this.findShape(c);if(m){const{top:v,left:_,width:S,height:E}=m.getBoundingClientRect(),x=_+S/2+window.scrollX,U=v+E/2+window.scrollY,V=this.viewer.viewport.windowToViewportCoordinates(new jc.Point(x,U));this.viewer.viewport.panTo(V,f)}}),r(this,"removeAnnotation",c=>{var f,m;const v=c.type?c.id:c;((f=this.selectedShape)==null?void 0:f.annotation.id)===v&&this.deselect();const _=this.findShape(c);if(_){const{annotation:S}=_;((m=this.selectedShape)==null?void 0:m.annotation)===S&&this.deselect(),_.parentNode.removeChild(_),this.store.remove(S)}}),r(this,"removeDrawingTool",c=>{var f;return(f=this.tools)==null?void 0:f.unregisterTool(c)}),r(this,"scaleFormatterElements",c=>{const f=1/this.currentScale();if(c){const m=c.querySelector(".a9s-annotation:not(.a9s-non-scaling) .a9s-formatter-el");m&&m.firstChild.setAttribute("transform",`scale(${f})`)}else Array.from(this.g.querySelectorAll(".a9s-annotation:not(.a9s-non-scaling) .a9s-formatter-el")).forEach(m=>m.firstChild.setAttribute("transform",`scale(${f})`))}),r(this,"scaleTool",c=>{if(c){const f=1/this.currentScale();c.scale=f,c.onScaleChanged&&c.onScaleChanged(f)}}),r(this,"selectAnnotation",(c,f)=>{this.selectedShape&&this.deselect();const m=this.findShape(c);if(m){this.selectShape(m,f);const v=this.selectedShape.element?this.selectedShape.element:this.selectedShape;return{annotation:m.annotation,element:v}}else this.deselect()}),r(this,"selectShape",(c,f)=>{var m;if(!f&&!c.annotation.isSelection&&this.emit("clickAnnotation",c.annotation,c),((m=this.selectedShape)==null?void 0:m.annotation)===c.annotation)return;this.selectedShape&&this.selectedShape.annotation!==c.annotation&&this.deselect();const{annotation:v}=c;if(this.readOnly||v.readOnly||this.headless)this.selectedShape=c,Vc(c,"selected"),f||this.emit("select",{annotation:v,element:c,skipEvent:f});else{const _=this.tools.forAnnotation(v);if(_){setTimeout(()=>{c.parentNode.removeChild(c),f||this.emit("select",{annotation:v,element:this.selectedShape.element})},1),this.selectedShape=_.createEditableShape(v,this.formatters),this.scaleTool(this.selectedShape),this.scaleFormatterElements(this.selectedShape.element),this.selectedShape.element.annotation=v;const S=new jc.MouseTracker({element:this.svg,preProcessEventHandler:E=>{E.stopPropagation=!0,E.preventDefault=!1,E.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,S.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,S.setTracking(!1)}),this.selectedShape.mouseTracker=S,this.selectedShape.on("update",E=>this.emit("updateTarget",this.selectedShape.element,E))}else this.selectedShape=c,f||this.emit("select",{annotation:v,element:this.selectedShape})}}),r(this,"setDrawingEnabled",c=>{if(this.mouseTracker){const f=c&&!this.readOnly;this.mouseTracker.enabled=f,this.mouseTracker.setTracking(f),this.tools.current&&(this.tools.current.enabled=f)}}),r(this,"setDrawingTool",c=>{var f;this.tools&&((f=this.tools.current)==null||f.stop(),this.tools.setCurrent(c))}),r(this,"setVisible",c=>{c?this.svg.style.display=null:(this.deselect(),this.svg.style.display="none")}),r(this,"stopDrawing",()=>{var c;(c=this.tools)!=null&&c.current&&(this.tools.current.isDrawing&&this.tools.current.stop(),this.mouseTracker.enabled=!1,this.tools.current.enabled=!1)}),this.viewer=p.viewer,this.config=p.config,this.env=p.env,this.readOnly=p.config.readOnly,this.headless=p.config.headless,p.config.formatter?this.formatters=[p.config.formatter]:p.config.formatters&&(this.formatters=Array.isArray(p.config.formatters)?p.config.formatters:[p.config.formatters]),this.disableSelect=p.config.disableSelect,this.drawOnSingleClick=p.config.drawOnSingleClick,this.svg=document.createElementNS(ki,"svg"),_ye?(this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer touch"),jge(this.svg)):this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer"),this.g=document.createElementNS(ki,"g"),this.svg.appendChild(this.g),this.viewer.canvas.appendChild(this.svg),this.viewer.addHandler("animation",()=>this.resize()),this.viewer.addHandler("rotate",()=>this.resize()),this.viewer.addHandler("resize",()=>this.resize()),this.viewer.addHandler("flip",()=>this.resize()),this.loaded=!1;const a=()=>{const{x:c,y:f}=this.viewer.world.getItemAt(0).source.dimensions,m=this.viewer.world.getItemAt(0).source["@id"]||new URL(this.viewer.world.getItemAt(0).source.url,document.baseURI).href;this.env.image={src:m,naturalWidth:c,naturalHeight:f},p.config.crosshair&&(this.crosshair||(this.crosshair=new uye(this.svg),Vc(this.svg,"no-cursor"))),this.loaded||this.emit("load",m),this.loaded=!0,this.g.style.display="inline",this.resize()};this.viewer.addHandler("open",a),this.viewer.world.addHandler("add-item",a),this.viewer.world.getItemAt(0)&&a(),this.store=new wye(this.env),this.selectedShape=null,this.hoveredShape=null,this._initMouseEvents()}resize(){var p;const a=this.viewer.viewport.getFlip(),c=this.viewer.viewport.pixelFromPoint(new jc.Point(0,0),!0);a&&(c.x=this.viewer.viewport._containerInnerSize.x-c.x);const f=this.currentScale(),m=a?-f:f,v=this.viewer.viewport.getRotation();this.g.setAttribute("transform",`translate(${c.x}, ${c.y}) scale(${m}, ${f}) rotate(${v})`),this._refreshNonScalingAnnotations(),this.scaleFormatterElements(),this.selectedShape&&(this.selectedShape.element?(this.scaleTool(this.selectedShape),this.emit("viewportChange",this.selectedShape.element)):this.emit("viewportChange",this.selectedShape)),(p=this.tools)!=null&&p.current&&this.scaleTool(this.tools.current)}}class Sye extends L4{constructor(p){super(p),r(this,"onDrawingComplete",a=>{var c;this.mouseTracker.enabled=(c=this.config.hotkey)==null?void 0:c.inverted,this.selectShape(a),this.emit("createSelection",a.annotation)}),this._initDrawingTools()}}const ox=l=>{const p=l.viewport.viewportToImageRectangle(l.viewport.getBounds(!0)),a=l.viewport.getContainerSize().x,c=l.viewport.getZoom(!0)*a/l.world.getContentFactor();return{extent:p,scale:c}},Tye=l=>{var p;const a=l.targets[0];return a?Array.isArray(a.selector)?a.selector[0].type:(p=a.selector)==null?void 0:p.type:null},M4=(l,p)=>{const{extent:a,scale:c}=ox(l),{selector:f}=p,m=Ih.create({target:p});if(f.type==="SvgSelector"){const v=Oh(m),_=v.nodeName.toLowerCase();let S=null;if(_==="polygon")S=Eye(v,a,c);else if(_==="circle")S=xye(v,a,c);else if(_==="ellipse")S=Cye(v,a,c);else if(_==="path")S=Aye(v,a,c);else throw`Unsupported SVG shape type: ${_}`;let E=S.outerHTML||new XMLSerializer().serializeToString(S);return E=E.replace(` xmlns="${ki}"`,""),{...p,selector:{type:"SvgSelector",value:`${E}`}}}else if(f.type==="FragmentSelector"){const{x:v,y:_,w:S,h:E}=Bd(m),x=a.x+v/c,U=a.y+_/c,V=S/c,ie=E/c;return S===0&&E===0?{...Sf(x,U,V,ie),renderedVia:{name:"point"}}:Sf(x,U,V,ie)}else throw`Unsupported selector type: ${f.type}`},Eye=(l,p,a)=>{const c=Array.from(l.points).map(f=>{const m=p.x+f.x/a,v=p.y+f.y/a;return m+","+v}).join(" ");return l.setAttribute("points",c),l},xye=(l,p,a)=>{const c=parseFloat(l.getAttribute("cx")),f=parseFloat(l.getAttribute("cy")),m=parseFloat(l.getAttribute("r"));return l.setAttribute("cx",p.x+c/a),l.setAttribute("cy",p.y+f/a),l.setAttribute("r",m/a),l},Cye=(l,p,a)=>{const c=parseFloat(l.getAttribute("cx")),f=parseFloat(l.getAttribute("cy")),m=parseFloat(l.getAttribute("rx")),v=parseFloat(l.getAttribute("ry"));return l.setAttribute("cx",p.x+c/a),l.setAttribute("cy",p.y+f/a),l.setAttribute("rx",m/a),l.setAttribute("ry",v/a),l},Aye=(l,p,a)=>{const c=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()).map(f=>{const m=f.substring(0,1);if(m.toLowerCase()==="z")return m;{const v=f.substring(1).split(" ").map(x=>parseFloat(x.trim())),_=m===m.toUpperCase(),S=_?p.x+v[0]/a:v[0]/a,E=_?p.y+v[1]/a:v[1]/a;return m+" "+S+" "+E}}).join(" ");return l.setAttribute("d",c),l},N4=(l,p)=>{const{extent:a,scale:c}=ox(l),f=p.selector("FragmentSelector");if(p.selector("SvgSelector")){const m=Oh(p),v=m.nodeName.toLowerCase();let _=null;if(v==="polygon")_=kye(m,a,c);else if(v==="circle")_=Pye(m,a,c);else if(v==="ellipse")_=Dye(m,a,c);else if(v==="path")_=Iye(m,a,c);else throw`Unsupported SVG shape type: ${v}`;let S=_.outerHTML||new XMLSerializer().serializeToString(_);S=S.replace(` xmlns="${ki}"`,"");const E={selector:{type:"SvgSelector",value:`${S}`}};return p.clone({target:E})}else if(f){const{x:m,y:v,w:_,h:S}=Bd(p),E=(m-a.x)*c,x=(v-a.y)*c,U=Sf(E,x,_*c,S*c);return p.clone({target:U})}},kye=(l,p,a)=>{const c=Array.from(l.points).map(f=>{const m=a*(f.x-p.x),v=a*(f.y-p.y);return m+","+v}).join(" ");return l.setAttribute("points",c),l},Pye=(l,p,a)=>{const c=l.getAttribute("cx"),f=l.getAttribute("cy"),m=l.getAttribute("r");return l.setAttribute("cx",a*(c-p.x)),l.setAttribute("cy",a*(f-p.y)),l.setAttribute("r",m*a),l},Dye=(l,p,a)=>{const c=l.getAttribute("cx"),f=l.getAttribute("cy"),m=l.getAttribute("rx"),v=l.getAttribute("ry");return l.setAttribute("cx",a*(c-p.x)),l.setAttribute("cy",a*(f-p.y)),l.setAttribute("rx",m*a),l.setAttribute("ry",v*a),l},Iye=(l,p,a)=>{const c=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()).map(f=>{const m=f.substring(0,1);if(m.toLowerCase()==="z")return m;{const v=f.substring(1).split(" ").filter(x=>x).map(x=>parseFloat(x.trim())),_=m===m.toUpperCase(),S=_?a*(v[0]-p.x):a*v[0],E=_?a*(v[1]-p.y):a*v[1];return m+" "+S+" "+E}}).join(" ");return l.setAttribute("d",c),l},F4=(l,p)=>{const{extent:a,scale:c}=ox(l),f=Tye(p.annotation);if(f==="FragmentSelector")Oye(p,a,c);else if(f==="SvgSelector")Rye(p,a,c);else throw`Unsupported selector type type: ${f}`;const m=p.querySelector(".a9s-formatter-el");if(m){const{x:v,y:_}=p.querySelector(".a9s-inner").getBBox();m.setAttribute("x",v),m.setAttribute("y",_)}},Oye=(l,p,a)=>{const{x:c,y:f,w:m,h:v}=Bd(l.annotation),_=l.querySelector(".a9s-outer"),S=l.querySelector(".a9s-inner"),E=a*(c-p.x),x=a*(f-p.y);m===0&&v===0?[_,S].forEach(U=>{U.setAttribute("cx",E),U.setAttribute("cy",x)}):[_,S].forEach(U=>{U.setAttribute("x",E),U.setAttribute("y",x),U.setAttribute("width",m*a),U.setAttribute("height",v*a)})},Rye=(l,p,a)=>{const c=Oh(l.annotation),f=c.nodeName.toLowerCase();if(f==="polygon")Lye(l,c,p,a);else if(f==="circle")Mye(l,c,p,a);else if(f==="ellipse")Nye(l,c,p,a);else if(f==="path")Fye(l,c,p,a);else throw`Unsupported SVG shape type: ${f}`},Lye=(l,p,a,c)=>{const f=Array.from(p.points).map(m=>{const v=c*(m.x-a.x),_=c*(m.y-a.y);return v+","+_}).join(" ");l.querySelector(".a9s-outer").setAttribute("points",f),l.querySelector(".a9s-inner").setAttribute("points",f)},Mye=(l,p,a,c)=>{const f=c*(p.getAttribute("cx")-a.x),m=c*(p.getAttribute("cy")-a.y),v=c*p.getAttribute("r"),_=l.querySelector(".a9s-outer");_.setAttribute("cx",f),_.setAttribute("cy",m),_.setAttribute("r",v);const S=l.querySelector(".a9s-inner");S.setAttribute("cx",f),S.setAttribute("cy",m),S.setAttribute("r",v)},Nye=(l,p,a,c)=>{const f=c*(p.getAttribute("cx")-a.x),m=c*(p.getAttribute("cy")-a.y),v=c*p.getAttribute("rx"),_=c*p.getAttribute("ry"),S=l.querySelector(".a9s-outer");S.setAttribute("cx",f),S.setAttribute("cy",m),S.setAttribute("rx",v),S.setAttribute("ry",_);const E=l.querySelector(".a9s-inner");E.setAttribute("cx",f),E.setAttribute("cy",m),E.setAttribute("rx",v),E.setAttribute("ry",_)},Fye=(l,p,a,c)=>{const f=p.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(m=>m.trim()).map(m=>{const v=m.substring(0,1);if(v.toLowerCase()==="z")return v;{const _=m.substring(1).split(" ").filter(U=>U).map(U=>parseFloat(U.trim())),S=v===v.toUpperCase(),E=S?c*(_[0]-a.x):c*_[0],x=S?c*(_[1]-a.y):c*_[1];return v+" "+E+" "+x}}).join(" ");l.querySelector(".a9s-inner").setAttribute("d",f),l.querySelector(".a9s-outer").setAttribute("d",f)},Bye=ZE();class Uye extends L4{constructor(p){super(p),r(this,"_fit",(a,c,f)=>{const m=c?typeof c=="boolean"?c:c.immediately:!1,v=(c==null?void 0:c.padding)||0,_=this.findShape(a);if(_){const S=this.viewer.container.getBoundingClientRect(),E=_.getBoundingClientRect(),x=E.x-S.x,U=E.y-S.y,{width:V,height:ie}=E,de=x-v,Ie=U-v,ke=V+2*v,Ve=ie+2*v,W=this.viewer.viewport.viewerElementToViewportRectangle(new jc.Rect(de,Ie,ke,Ve));this.viewer.viewport[f](W,m)}}),r(this,"_getShapeAt",a=>{const c=S=>{if(Bye){const E=this.svg.getBoundingClientRect(),x=S.clientX-E.x,U=S.clientY-E.y;return new jc.Point(x,U)}else return new jc.Point(S.offsetX,S.offsetY)},f=this.viewer.viewport.viewerElementToViewportCoordinates(c(a)),{x:m,y:v}=this.viewer.viewport.viewportToImageCoordinates(f.x,f.y),_=this.store.getAnnotationAt(m,v,this.currentScale());if(_)return this.findShape(_)}),r(this,"_refreshNonScalingAnnotations",()=>{}),r(this,"addAnnotation",(a,c)=>{const f=c||this.g,m=nx(a,this.env.image);return Vc(m,"a9s-annotation"),m.setAttribute("data-id",a.id),m.annotation=a,F4(this.viewer,m),f.appendChild(m),F0(m,a,this.formatters),m}),r(this,"addOrUpdateAnnotation",(a,c)=>{var f;const m=(f=this.selectedShape)==null?void 0:f.annotation;(m===a||m!=null&&m.isSelection||m==c)&&this.deselect(),c&&this.removeAnnotation(a),this.removeAnnotation(a),this.addAnnotation(a),this.store.insert(a)}),r(this,"deselect",()=>{var a;if((a=this.tools)==null||a.current.stop(),this.selectedShape){const{annotation:c}=this.selectedShape;this.selectedShape.destroy?(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),c.isSelection||this.addAnnotation(c)):R0(this.selectedShape,"selected"),this.selectedShape=null}}),r(this,"onDrawingComplete",a=>{const c=a.annotation.clone({target:M4(this.viewer,a.annotation.target)});a.annotation=c,this.selectShape(a),this.emit("createSelection",a.annotation),this.mouseTracker.enabled=!1}),r(this,"selectShape",(a,c)=>{var f;if(!c&&!a.annotation.isSelection&&this.emit("clickAnnotation",a.annotation,a),((f=this.selectedShape)==null?void 0:f.annotation)===a.annotation)return;this.selectedShape&&this.selectedShape.annotation!==a.annotation&&this.deselect(!0);const{annotation:m}=a;if(this.readOnly||m.readOnly||this.headless)this.selectedShape=a,Vc(a,"selected"),c||this.emit("select",{annotation:m,element:a,skipEvent:c});else{setTimeout(()=>{a.parentNode.removeChild(a),c||this.emit("select",{annotation:m,element:this.selectedShape.element})},1);const v=this.tools.forAnnotation(m);this.selectedShape=v.createEditableShape(m),this.selectedShape.element.annotation=m;const _=N4(this.viewer,m);this.selectedShape.updateState(_);const S=new jc.MouseTracker({element:this.svg,preProcessEventHandler:E=>{E.stopPropagation=!0,E.preventDefault=!1,E.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,S.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,S.setTracking(!1)}),this.selectedShape.mouseTracker=S,this.selectedShape.on("update",E=>{const x=M4(this.viewer,E);this.selectedShape.element.annotation=this.selectedShape.annotation.clone({target:x}),this.emit("updateTarget",this.selectedShape.element,x)})}}),this._initDrawingTools(!0)}resize(){if(this.store&&(Array.from(this.g.querySelectorAll(".a9s-annotation:not(.selected)")).forEach(p=>F4(this.viewer,p)),this.selectedShape))if(this.selectedShape.element){const p=N4(this.viewer,this.selectedShape.element.annotation);this.selectedShape.updateState&&this.selectedShape.updateState(p),this.emit("viewportChange",this.selectedShape.element)}else this.emit("viewportChange",this.selectedShape)}}var Hye=0;function B4(l,p,a,c,f){var m,v,_={};for(v in p)v=="ref"?m=p[v]:_[v]=p[v];var S={type:l,props:_,key:a,ref:m,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Hye,__source:c,__self:f};if(typeof l=="function"&&(m=l.defaultProps))for(v in m)_[v]===void 0&&(_[v]=m[v]);return o.vnode&&o.vnode(S),S}class zye extends he{constructor(p){super(p),r(this,"clearState",a=>this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,beforeHeadlessModify:null},a)),r(this,"forwardEvent",(a,c)=>{this.annotationLayer.on(a,(f,m)=>{this.props[c](f.clone(),m)})}),r(this,"onKeyUp",a=>{if(a.which===27){this.annotationLayer.stopDrawing();const{selectedAnnotation:c}=this.state;c&&(this.cancelSelected(),this.props.onCancelSelected(c))}else if(a.which===46){const{disableDeleteKey:c}=this.props.config;if(!c){const{selectedAnnotation:f}=this.state;f&&(f.isSelection?this.onCancelAnnotation(f):this.onDeleteAnnotation(f))}}}),r(this,"handleStartSelect",a=>this.props.onSelectionStarted(a)),r(this,"handleEndSelect",a=>this.props.onSelectionEnded(a)),r(this,"handleSelect",(a,c)=>{this.state.editorDisabled?this.onHeadlessSelect(a,c):this.onNormalSelect(a,c)}),r(this,"onNormalSelect",(a,c)=>{const{annotation:f,element:m}=a;if(f){const v=()=>{this.setState({selectedAnnotation:f,selectedDOMElement:m,modifiedTarget:null},()=>{c||(f.isSelection?this.props.onSelectionCreated(f.clone()):this.props.onAnnotationSelected(f.clone(),m))})},{selectedAnnotation:_}=this.state;_&&!_.isEqual(f)?this.clearState(()=>{this.props.onCancelSelected(_),v()}):v()}else{const{selectedAnnotation:v}=this.state;v?this.clearState(()=>this.props.onCancelSelected(v)):this.clearState()}}),r(this,"onHeadlessSelect",(a,c)=>{this.saveSelected().then(()=>{this.onNormalSelect(a,c)})}),r(this,"handleUpdateTarget",(a,c)=>{this.setState({selectedDOMElement:a,modifiedTarget:c});const f=JSON.parse(JSON.stringify(c));this.props.onSelectionTargetChanged(f)}),r(this,"handleViewportChange",a=>this.setState({selectedDOMElement:a})),r(this,"overrideAnnotationId",a=>c=>{const{id:f}=a;this.state.selectedAnnotation?this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null},()=>{this.annotationLayer.overrideId(f,c)}):this.annotationLayer.overrideId(f,c)}),r(this,"onCreateOrUpdateAnnotation",(a,c)=>(f,m)=>{let v=f.isSelection?f.toAnnotation():f;v=this.state.modifiedTarget?v.clone({target:this.state.modifiedTarget}):v.clone(),this.clearState(()=>{this.annotationLayer.addOrUpdateAnnotation(v,m),m?this.props[a](v,m.clone()):this.props[a](v,this.overrideAnnotationId(v)),c&&c()})}),r(this,"onDeleteAnnotation",a=>{this.clearState(),this.annotationLayer.removeAnnotation(a),this.props.onAnnotationDeleted(a)}),r(this,"onCancelAnnotation",(a,c)=>{this.state.editorDisabled||this.annotationLayer.deselect(),this.props.onCancelSelected(a),this.clearState(c)}),r(this,"addAnnotation",a=>{var c;a.id===((c=this.state.selectedAnnotation)==null?void 0:c.id)&&(this.annotationLayer.deselect(),this.clearState()),this.annotationLayer.addOrUpdateAnnotation(a.clone())}),r(this,"addDrawingTool",a=>this.annotationLayer.addDrawingTool(a)),r(this,"cancelSelected",()=>new Promise(a=>{this.annotationLayer.deselect(),this.state.selectedAnnotation?this.clearState(a):a()})),r(this,"fitBounds",(a,c)=>this.annotationLayer.fitBounds(a,c)),r(this,"fitBoundsWithConstraints",(a,c)=>this.annotationLayer.fitBoundsWithConstraints(a,c)),r(this,"getAnnotationById",a=>{var c;return(c=this.annotationLayer.findShape(a))==null?void 0:c.annotation}),r(this,"getAnnotations",()=>this.annotationLayer.getAnnotations().map(a=>a.clone())),r(this,"getAnnotationsIntersecting",a=>this.annotationLayer.getAnnotationsIntersecting(a)),r(this,"getImageSnippetById",a=>this.annotationLayer.getImageSnippetById(a)),r(this,"getSelected",()=>{var a;if(this.state.selectedAnnotation)return this.state.editorDisabled?this.state.selectedAnnotation:(a=this._editor.current)==null?void 0:a.getCurrentAnnotation()}),r(this,"getSelectedImageSnippet",()=>this.annotationLayer.getSelectedImageSnippet()),r(this,"listDrawingTools",()=>this.annotationLayer.listDrawingTools()),r(this,"panTo",(a,c)=>this.annotationLayer.panTo(a,c)),r(this,"removeAnnotation",a=>this.annotationLayer.removeAnnotation(a)),r(this,"removeDrawingTool",a=>this.annotationLayer.removeDrawingTool(a)),r(this,"saveSelected",()=>new Promise(a=>{const c=this.state.selectedAnnotation;if(c)if(this._editor.current)this._editor.current.onOk(),a();else if(c.isSelection)c.bodies.length>0||this.props.config.allowEmpty?this.onCreateOrUpdateAnnotation("onAnnotationCreated",a)(c):(this.annotationLayer.deselect(),a());else{const{beforeHeadlessModify:f,modifiedTarget:m}=this.state;f?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",a)(c,f):m?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",a)(c,c):this.onCancelAnnotation(c,a)}else a()})),r(this,"selectAnnotation",a=>{const c=this.annotationLayer.selectAnnotation(a,!0);if(c)return this.handleSelect(c,!0),c.annotation.clone();this.clearState()}),r(this,"setAnnotations",a=>this.annotationLayer.init(a.map(c=>c.clone()))),r(this,"setDrawingEnabled",a=>this.annotationLayer.setDrawingEnabled(a)),r(this,"setDrawingTool",a=>this.annotationLayer.setDrawingTool(a)),r(this,"setVisible",a=>{this.annotationLayer.setVisible(a),a||this.clearState()}),r(this,"updateSelected",(a,c)=>new Promise(f=>{this.state.selectedAnnotation&&(c?this.state.selectedAnnotation.isSelection?this.onCreateOrUpdateAnnotation("onAnnotationCreated",f)(a):this.onCreateOrUpdateAnnotation("onAnnotationUpdated",f)(a,this.state.selectedAnnotation):this.setState({selectedAnnotation:a,beforeHeadlessModify:this.state.beforeHeadlessModify||this.state.selectedAnnotation},f))})),this.state={selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,readOnly:p.config.readOnly,editorDisabled:p.config.disableEditor,widgets:p.config.widgets,beforeHeadlessModify:null},this._editor=yt.createRef()}componentDidMount(){this.annotationLayer=this.props.config.gigapixelMode?new Uye(this.props):new Sye(this.props),this.annotationLayer.on("load",this.props.onLoad),this.annotationLayer.on("startSelection",this.handleStartSelect),this.annotationLayer.on("endSelection",this.handleEndSelect),this.annotationLayer.on("select",this.handleSelect),this.annotationLayer.on("updateTarget",this.handleUpdateTarget),this.annotationLayer.on("viewportChange",this.handleViewportChange),this.forwardEvent("clickAnnotation","onClickAnnotation"),this.forwardEvent("mouseEnterAnnotation","onMouseEnterAnnotation"),this.forwardEvent("mouseLeaveAnnotation","onMouseLeaveAnnotation"),document.addEventListener("keyup",this.onKeyUp)}componentWillUnmount(){this.annotationLayer.destroy(),document.removeEventListener("keyup",this.onKeyUp)}get disableEditor(){return this.state.editorDisabled}set disableEditor(p){this.setState({editorDisabled:p})}get disableSelect(){return this.annotationLayer.disableSelect}set disableSelect(p){this.annotationLayer.disableSelect=p}get formatters(){return this.annotationLayer.formatters}set formatters(p){this.annotationLayer.formatters=p}get readOnly(){return this.state.readOnly}set readOnly(p){this.annotationLayer.readOnly=p,this.setState({readOnly:p})}get widgets(){return this.state.widgets}set widgets(p){this.setState({widgets:p})}render(){var p;const a=this.state.selectedAnnotation&&!this.state.editorDisabled,c=this.state.readOnly||((p=this.state.selectedAnnotation)==null?void 0:p.readOnly);return a&&B4(kge,{ref:this._editor,detachable:!0,wrapperEl:this.props.wrapperEl,annotation:this.state.selectedAnnotation,modifiedTarget:this.state.modifiedTarget,selectedElement:this.state.selectedDOMElement,readOnly:c,allowEmpty:this.props.config.allowEmpty,widgets:this.state.widgets,env:this.props.env,onAnnotationCreated:this.onCreateOrUpdateAnnotation("onAnnotationCreated"),onAnnotationUpdated:this.onCreateOrUpdateAnnotation("onAnnotationUpdated"),onAnnotationDeleted:this.onDeleteAnnotation,onCancel:this.onCancelAnnotation})}}class jye{constructor(p,a){r(this,"handleAnnotationCreated",(f,m)=>this._emitter.emit("createAnnotation",f.underlying,m)),r(this,"handleAnnotationDeleted",f=>this._emitter.emit("deleteAnnotation",f.underlying)),r(this,"handleAnnotationSelected",(f,m)=>this._emitter.emit("selectAnnotation",f.underlying,m)),r(this,"handleAnnotationUpdated",(f,m)=>this._emitter.emit("updateAnnotation",f.underlying,m.underlying)),r(this,"handleCancelSelected",f=>this._emitter.emit("cancelSelected",f.underlying)),r(this,"handleClickAnnotation",(f,m)=>this._emitter.emit("clickAnnotation",f.underlying,m)),r(this,"handleLoad",f=>this._emitter.emit("load",f)),r(this,"handleSelectionCreated",f=>this._emitter.emit("createSelection",f.underlying)),r(this,"handleSelectionStarted",f=>this._emitter.emit("startSelection",f)),r(this,"handleSelectionEnded",f=>this._emitter.emit("endSelection",f)),r(this,"handleSelectionTargetChanged",f=>this._emitter.emit("changeSelectionTarget",f)),r(this,"handleMouseEnterAnnotation",(f,m)=>this._emitter.emit("mouseEnterAnnotation",f.underlying,m)),r(this,"handleMouseLeaveAnnotation",(f,m)=>this._emitter.emit("mouseLeaveAnnotation",f.underlying,m)),r(this,"_wrap",f=>(f==null?void 0:f.type)==="Annotation"?new Ih(f):f),r(this,"addAnnotation",f=>this._app.current.addAnnotation(new Ih(f))),r(this,"addDrawingTool",f=>this._app.current.addDrawingTool(f)),r(this,"cancelSelected",()=>this._app.current.cancelSelected()),r(this,"clearAnnotations",()=>this.setAnnotations([])),r(this,"clearAuthInfo",()=>this._env.user=null),r(this,"destroy",()=>yt.unmountComponentAtNode(this.appContainerEl)),r(this,"fitBounds",(f,m)=>this._app.current.fitBounds(this._wrap(f),m)),r(this,"fitBoundsWithConstraints",(f,m)=>this._app.current.fitBoundsWithConstraints(this._wrap(f),m)),r(this,"getAnnotationById",f=>{const m=this._app.current.getAnnotationById(f);return m==null?void 0:m.underlying}),r(this,"getAnnotations",()=>this._app.current.getAnnotations().map(f=>f.underlying)),r(this,"getAnnotationsIntersecting",f=>this._app.current.getAnnotationsIntersecting(this._wrap(f))),r(this,"getImageSnippetById",f=>this._app.current.getImageSnippetById(f)),r(this,"getSelected",()=>{const f=this._app.current.getSelected();return f==null?void 0:f.underlying}),r(this,"getSelectedImageSnippet",()=>this._app.current.getSelectedImageSnippet()),r(this,"listDrawingTools",()=>this._app.current.listDrawingTools()),r(this,"loadAnnotations",f=>fetch(f).then(m=>m.json()).then(m=>(this.setAnnotations(m),m))),r(this,"off",(f,m)=>this._emitter.off(f,m)),r(this,"on",(f,m)=>this._emitter.on(f,m)),r(this,"once",(f,m)=>this._emitter.once(f,m)),r(this,"panTo",(f,m)=>this._app.current.panTo(this._wrap(f),m)),r(this,"removeAnnotation",f=>this._app.current.removeAnnotation(this._wrap(f))),r(this,"removeDrawingTool",f=>this._app.current.removeDrawingTool(f)),r(this,"saveSelected",()=>this._app.current.saveSelected()),r(this,"selectAnnotation",f=>{const m=this._app.current.selectAnnotation(this._wrap(f));return m==null?void 0:m.underlying}),r(this,"setAnnotations",f=>{const m=(f||[]).map(v=>new Ih(v));this._app.current.setAnnotations(m)}),r(this,"setAuthInfo",f=>this._env.user=f),r(this,"setDrawingEnabled",f=>this._app.current.setDrawingEnabled(f)),r(this,"setDrawingTool",f=>this._app.current.setDrawingTool(f)),r(this,"setServerTime",f=>this._env.setServerTime(f)),r(this,"setVisible",f=>this._app.current.setVisible(f)),r(this,"updateSelected",(f,m)=>{let v=null;f.type==="Annotation"?v=new Ih(f):f.type==="Selection"&&(v=new Hg(f.target,f.body)),v&&this._app.current.updateSelected(v,m)});const c=a||{};this._app=yt.createRef(),this._emitter=new Oa,this._env=Mge(),this._element=p.element,window.getComputedStyle(this._element).getPropertyValue("position")==="static"&&(this._element.style.position="relative"),Nge(c.locale,c.messages),this.appContainerEl=document.createElement("DIV"),this._element.appendChild(this.appContainerEl),yt.render(B4(zye,{ref:this._app,viewer:p,wrapperEl:this._element,config:c,env:this._env,onSelectionStarted:this.handleSelectionStarted,onSelectionEnded:this.handleSelectionEnded,onSelectionCreated:this.handleSelectionCreated,onSelectionTargetChanged:this.handleSelectionTargetChanged,onAnnotationCreated:this.handleAnnotationCreated,onAnnotationSelected:this.handleAnnotationSelected,onAnnotationUpdated:this.handleAnnotationUpdated,onAnnotationDeleted:this.handleAnnotationDeleted,onCancelSelected:this.handleCancelSelected,onClickAnnotation:this.handleClickAnnotation,onLoad:this.handleLoad,onMouseEnterAnnotation:this.handleMouseEnterAnnotation,onMouseLeaveAnnotation:this.handleMouseLeaveAnnotation}),this.appContainerEl)}get disableEditor(){return this._app.current.disableEditor}set disableEditor(p){this._app.current.disableEditor=p}get disableSelect(){return this._app.current.disableSelect}set disableSelect(p){this._app.current.disableSelect=p}get formatters(){return this._app.current.formatters||[]}set formatters(p){if(p){const a=Array.isArray(p)?p:[p];this._app.current.formatters=a}else this._app.current.formatters=null}get readOnly(){return this._app.current.readOnly}set readOnly(p){this._app.current.readOnly=p}get widgets(){return this._app.current.widgets}set widgets(p){this._app.current.widgets=p}}var Vye=(l,p)=>new jye(l,p);return Vye})})(sk);var k8=sk.exports;const ok=My(k8);function ak(t,e){return function(){return t.apply(e,arguments)}}const{toString:P8}=Object.prototype,{getPrototypeOf:qw}=Object,{iterator:Ny,toStringTag:lk}=Symbol,Fy=(t=>e=>{const n=P8.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cl=t=>(t=t.toLowerCase(),e=>Fy(e)===t),By=t=>e=>typeof e===t,{isArray:Kh}=Array,im=By("undefined");function D8(t){return t!==null&&!im(t)&&t.constructor!==null&&!im(t.constructor)&&$o(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const uk=Cl("ArrayBuffer");function I8(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&uk(t.buffer),e}const O8=By("string"),$o=By("function"),ck=By("number"),Uy=t=>t!==null&&typeof t=="object",R8=t=>t===!0||t===!1,Hy=t=>{if(Fy(t)!=="object")return!1;const e=qw(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(lk in t)&&!(Ny in t)},L8=Cl("Date"),M8=Cl("File"),N8=Cl("Blob"),F8=Cl("FileList"),B8=t=>Uy(t)&&$o(t.pipe),U8=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||$o(t.append)&&((e=Fy(t))==="formdata"||e==="object"&&$o(t.toString)&&t.toString()==="[object FormData]"))},H8=Cl("URLSearchParams"),[z8,j8,V8,W8]=["ReadableStream","Request","Response","Headers"].map(Cl),q8=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rm(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,r;if(typeof t!="object"&&(t=[t]),Kh(t))for(i=0,r=t.length;i0;)if(r=n[i],e===r.toLowerCase())return r;return null}const Qd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hk=t=>!im(t)&&t!==Qd;function Gw(){const{caseless:t}=hk(this)&&this||{},e={},n=(i,r)=>{const s=t&&dk(e,r)||r;Hy(e[s])&&Hy(i)?e[s]=Gw(e[s],i):Hy(i)?e[s]=Gw({},i):Kh(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i(rm(e,(r,s)=>{n&&$o(r)?t[s]=ak(r,n):t[s]=r},{allOwnKeys:i}),t),K8=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Y8=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},X8=(t,e,n,i)=>{let r,s,o;const u={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),s=r.length;s-- >0;)o=r[s],(!i||i(o,t,e))&&!u[o]&&(e[o]=t[o],u[o]=!0);t=n!==!1&&qw(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Z8=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},Q8=t=>{if(!t)return null;if(Kh(t))return t;let e=t.length;if(!ck(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},J8=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qw(Uint8Array)),$8=(t,e)=>{const i=(t&&t[Ny]).call(t);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(t,s[0],s[1])}},ez=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},tz=Cl("HTMLFormElement"),nz=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),pk=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),iz=Cl("RegExp"),fk=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};rm(n,(r,s)=>{let o;(o=e(r,s,t))!==!1&&(i[s]=o||r)}),Object.defineProperties(t,i)},rz=t=>{fk(t,(e,n)=>{if($o(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if($o(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sz=(t,e)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return Kh(t)?i(t):i(String(t).split(e)),n},oz=()=>{},az=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function lz(t){return!!(t&&$o(t.append)&&t[lk]==="FormData"&&t[Ny])}const uz=t=>{const e=new Array(10),n=(i,r)=>{if(Uy(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=Kh(i)?[]:{};return rm(i,(o,u)=>{const d=n(o,r+1);!im(d)&&(s[u]=d)}),e[r]=void 0,s}}return i};return n(t,0)},cz=Cl("AsyncFunction"),dz=t=>t&&(Uy(t)||$o(t))&&$o(t.then)&&$o(t.catch),mk=((t,e)=>t?setImmediate:e?((n,i)=>(Qd.addEventListener("message",({source:r,data:s})=>{r===Qd&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),Qd.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$o(Qd.postMessage)),hz=typeof queueMicrotask<"u"?queueMicrotask.bind(Qd):typeof process<"u"&&process.nextTick||mk,mt={isArray:Kh,isArrayBuffer:uk,isBuffer:D8,isFormData:U8,isArrayBufferView:I8,isString:O8,isNumber:ck,isBoolean:R8,isObject:Uy,isPlainObject:Hy,isReadableStream:z8,isRequest:j8,isResponse:V8,isHeaders:W8,isUndefined:im,isDate:L8,isFile:M8,isBlob:N8,isRegExp:iz,isFunction:$o,isStream:B8,isURLSearchParams:H8,isTypedArray:J8,isFileList:F8,forEach:rm,merge:Gw,extend:G8,trim:q8,stripBOM:K8,inherits:Y8,toFlatObject:X8,kindOf:Fy,kindOfTest:Cl,endsWith:Z8,toArray:Q8,forEachEntry:$8,matchAll:ez,isHTMLForm:tz,hasOwnProperty:pk,hasOwnProp:pk,reduceDescriptors:fk,freezeMethods:rz,toObjectSet:sz,toCamelCase:nz,noop:oz,toFiniteNumber:az,findKey:dk,global:Qd,isContextDefined:hk,isSpecCompliantForm:lz,toJSONObject:uz,isAsyncFn:cz,isThenable:dz,setImmediate:mk,asap:hz,isIterable:t=>t!=null&&$o(t[Ny])};function ti(t,e,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}mt.inherits(ti,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:mt.toJSONObject(this.config),code:this.code,status:this.status}}});const gk=ti.prototype,yk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{yk[t]={value:t}}),Object.defineProperties(ti,yk),Object.defineProperty(gk,"isAxiosError",{value:!0}),ti.from=(t,e,n,i,r,s)=>{const o=Object.create(gk);return mt.toFlatObject(t,o,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),ti.call(o,t.message,e,n,i,r),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const pz=null;function Kw(t){return mt.isPlainObject(t)||mt.isArray(t)}function vk(t){return mt.endsWith(t,"[]")?t.slice(0,-2):t}function bk(t,e,n){return t?t.concat(e).map(function(r,s){return r=vk(r),!n&&s?"["+r+"]":r}).join(n?".":""):e}function fz(t){return mt.isArray(t)&&!t.some(Kw)}const mz=mt.toFlatObject(mt,{},null,function(e){return/^is[A-Z]/.test(e)});function zy(t,e,n){if(!mt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=mt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(P,M){return!mt.isUndefined(M[P])});const i=n.metaTokens,r=n.visitor||g,s=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&mt.isSpecCompliantForm(e);if(!mt.isFunction(r))throw new TypeError("visitor must be a function");function h(D){if(D===null)return"";if(mt.isDate(D))return D.toISOString();if(mt.isBoolean(D))return D.toString();if(!d&&mt.isBlob(D))throw new ti("Blob is not supported. Use a Buffer instead.");return mt.isArrayBuffer(D)||mt.isTypedArray(D)?d&&typeof Blob=="function"?new Blob([D]):Buffer.from(D):D}function g(D,P,M){let F=D;if(D&&!M&&typeof D=="object"){if(mt.endsWith(P,"{}"))P=i?P:P.slice(0,-2),D=JSON.stringify(D);else if(mt.isArray(D)&&fz(D)||(mt.isFileList(D)||mt.endsWith(P,"[]"))&&(F=mt.toArray(D)))return P=vk(P),F.forEach(function($,ee){!(mt.isUndefined($)||$===null)&&e.append(o===!0?bk([P],ee,s):o===null?P:P+"[]",h($))}),!1}return Kw(D)?!0:(e.append(bk(M,P,s),h(D)),!1)}const y=[],w=Object.assign(mz,{defaultVisitor:g,convertValue:h,isVisitable:Kw});function C(D,P){if(!mt.isUndefined(D)){if(y.indexOf(D)!==-1)throw Error("Circular reference detected in "+P.join("."));y.push(D),mt.forEach(D,function(F,K){(!(mt.isUndefined(F)||F===null)&&r.call(e,F,mt.isString(K)?K.trim():K,P,w))===!0&&C(F,P?P.concat(K):[K])}),y.pop()}}if(!mt.isObject(t))throw new TypeError("data must be an object");return C(t),e}function wk(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Yw(t,e){this._pairs=[],t&&zy(t,this,e)}const _k=Yw.prototype;_k.append=function(e,n){this._pairs.push([e,n])},_k.toString=function(e){const n=e?function(i){return e.call(this,i,wk)}:wk;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function gz(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Sk(t,e,n){if(!e)return t;const i=n&&n.encode||gz;mt.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let s;if(r?s=r(e,n):s=mt.isURLSearchParams(e)?e.toString():new Yw(e,n).toString(i),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tk{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){mt.forEach(this.handlers,function(i){i!==null&&e(i)})}}const Ek={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yz={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Yw,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Xw=typeof window<"u"&&typeof document<"u",Zw=typeof navigator=="object"&&navigator||void 0,vz=Xw&&(!Zw||["ReactNative","NativeScript","NS"].indexOf(Zw.product)<0),bz=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wz=Xw&&window.location.href||"http://localhost",fo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xw,hasStandardBrowserEnv:vz,hasStandardBrowserWebWorkerEnv:bz,navigator:Zw,origin:wz},Symbol.toStringTag,{value:"Module"})),...yz};function _z(t,e){return zy(t,new fo.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return fo.isNode&&mt.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Sz(t){return mt.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Tz(t){const e={},n=Object.keys(t);let i;const r=n.length;let s;for(i=0;i=n.length;return o=!o&&mt.isArray(r)?r.length:o,d?(mt.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!u):((!r[o]||!mt.isObject(r[o]))&&(r[o]=[]),e(n,i,r[o],s)&&mt.isArray(r[o])&&(r[o]=Tz(r[o])),!u)}if(mt.isFormData(t)&&mt.isFunction(t.entries)){const n={};return mt.forEachEntry(t,(i,r)=>{e(Sz(i),r,n,0)}),n}return null}function Ez(t,e,n){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const sm={transitional:Ek,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=mt.isObject(e);if(s&&mt.isHTMLForm(e)&&(e=new FormData(e)),mt.isFormData(e))return r?JSON.stringify(xk(e)):e;if(mt.isArrayBuffer(e)||mt.isBuffer(e)||mt.isStream(e)||mt.isFile(e)||mt.isBlob(e)||mt.isReadableStream(e))return e;if(mt.isArrayBufferView(e))return e.buffer;if(mt.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return _z(e,this.formSerializer).toString();if((u=mt.isFileList(e))||i.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return zy(u?{"files[]":e}:e,d&&new d,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),Ez(e)):e}],transformResponse:[function(e){const n=this.transitional||sm.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(mt.isResponse(e)||mt.isReadableStream(e))return e;if(e&&mt.isString(e)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?ti.from(u,ti.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fo.classes.FormData,Blob:fo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mt.forEach(["delete","get","head","post","put","patch"],t=>{sm.headers[t]={}});const xz=mt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Cz=t=>{const e={};let n,i,r;return t&&t.split(` `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||e[n]&&xz[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},Ck=Symbol("internals");function om(t){return t&&String(t).trim().toLowerCase()}function jy(t){return t===!1||t==null?t:mt.isArray(t)?t.map(jy):String(t)}function Az(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const kz=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Qw(t,e,n,i,r){if(mt.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!mt.isString(e)){if(mt.isString(i))return e.indexOf(i)!==-1;if(mt.isRegExp(i))return i.test(e)}}function Pz(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function Dz(t,e){const n=mt.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}let ea=class{constructor(e){e&&this.set(e)}set(e,n,i){const r=this;function s(u,d,h){const g=om(d);if(!g)throw new Error("header name must be a non-empty string");const y=mt.findKey(r,g);(!y||r[y]===void 0||h===!0||h===void 0&&r[y]!==!1)&&(r[y||d]=jy(u))}const o=(u,d)=>mt.forEach(u,(h,g)=>s(h,g,d));if(mt.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(mt.isString(e)&&(e=e.trim())&&!kz(e))o(Cz(e),n);else if(mt.isObject(e)&&mt.isIterable(e)){let u={},d,h;for(const g of e){if(!mt.isArray(g))throw TypeError("Object iterator must return a key-value pair");u[h=g[0]]=(d=u[h])?mt.isArray(d)?[...d,g[1]]:[d,g[1]]:g[1]}o(u,n)}else e!=null&&s(n,e,i);return this}get(e,n){if(e=om(e),e){const i=mt.findKey(this,e);if(i){const r=this[i];if(!n)return r;if(n===!0)return Az(r);if(mt.isFunction(n))return n.call(this,r,i);if(mt.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=om(e),e){const i=mt.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||Qw(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let r=!1;function s(o){if(o=om(o),o){const u=mt.findKey(i,o);u&&(!n||Qw(i,i[u],u,n))&&(delete i[u],r=!0)}}return mt.isArray(e)?e.forEach(s):s(e),r}clear(e){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!e||Qw(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const n=this,i={};return mt.forEach(this,(r,s)=>{const o=mt.findKey(i,s);if(o){n[o]=jy(r),delete n[s];return}const u=e?Pz(s):String(s).trim();u!==s&&delete n[s],n[u]=jy(r),i[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return mt.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&mt.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Ck]=this[Ck]={accessors:{}}).accessors,r=this.prototype;function s(o){const u=om(o);i[u]||(Dz(r,o),i[u]=!0)}return mt.isArray(e)?e.forEach(s):s(e),this}};ea.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),mt.reduceDescriptors(ea.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),mt.freezeMethods(ea);function Jw(t,e){const n=this||sm,i=e||n,r=ea.from(i.headers);let s=i.data;return mt.forEach(t,function(u){s=u.call(n,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Ak(t){return!!(t&&t.__CANCEL__)}function Yh(t,e,n){ti.call(this,t??"canceled",ti.ERR_CANCELED,e,n),this.name="CanceledError"}mt.inherits(Yh,ti,{__CANCEL__:!0});function kk(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new ti("Request failed with status code "+n.status,[ti.ERR_BAD_REQUEST,ti.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Iz(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Oz(t,e){t=t||10;const n=new Array(t),i=new Array(t);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),g=i[s];o||(o=h),n[r]=d,i[r]=h;let y=s,w=0;for(;y!==r;)w+=n[y++],y=y%t;if(r=(r+1)%t,r===s&&(s=(s+1)%t),h-o{n=g,r=null,s&&(clearTimeout(s),s=null),t.apply(null,h)};return[(...h)=>{const g=Date.now(),y=g-n;y>=i?o(h,g):(r=h,s||(s=setTimeout(()=>{s=null,o(r)},i-y)))},()=>r&&o(r)]}const Vy=(t,e,n=3)=>{let i=0;const r=Oz(50,250);return Rz(s=>{const o=s.loaded,u=s.lengthComputable?s.total:void 0,d=o-i,h=r(d),g=o<=u;i=o;const y={loaded:o,total:u,progress:u?o/u:void 0,bytes:d,rate:h||void 0,estimated:h&&u&&g?(u-o)/h:void 0,event:s,lengthComputable:u!=null,[e?"download":"upload"]:!0};t(y)},n)},Pk=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Dk=t=>(...e)=>mt.asap(()=>t(...e)),Lz=fo.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,fo.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(fo.origin),fo.navigator&&/(msie|trident)/i.test(fo.navigator.userAgent)):()=>!0,Mz=fo.hasStandardBrowserEnv?{write(t,e,n,i,r,s){const o=[t+"="+encodeURIComponent(e)];mt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),mt.isString(i)&&o.push("path="+i),mt.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Nz(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Fz(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ik(t,e,n){let i=!Nz(e);return t&&(i||n==!1)?Fz(t,e):e}const Ok=t=>t instanceof ea?{...t}:t;function Jd(t,e){e=e||{};const n={};function i(h,g,y,w){return mt.isPlainObject(h)&&mt.isPlainObject(g)?mt.merge.call({caseless:w},h,g):mt.isPlainObject(g)?mt.merge({},g):mt.isArray(g)?g.slice():g}function r(h,g,y,w){if(mt.isUndefined(g)){if(!mt.isUndefined(h))return i(void 0,h,y,w)}else return i(h,g,y,w)}function s(h,g){if(!mt.isUndefined(g))return i(void 0,g)}function o(h,g){if(mt.isUndefined(g)){if(!mt.isUndefined(h))return i(void 0,h)}else return i(void 0,g)}function u(h,g,y){if(y in e)return i(h,g);if(y in t)return i(void 0,h)}const d={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(h,g,y)=>r(Ok(h),Ok(g),y,!0)};return mt.forEach(Object.keys(Object.assign({},t,e)),function(g){const y=d[g]||r,w=y(t[g],e[g],g);mt.isUndefined(w)&&y!==u||(n[g]=w)}),n}const Rk=t=>{const e=Jd({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:u}=e;e.headers=o=ea.from(o),e.url=Sk(Ik(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let d;if(mt.isFormData(n)){if(fo.hasStandardBrowserEnv||fo.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((d=o.getContentType())!==!1){const[h,...g]=d?d.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...g].join("; "))}}if(fo.hasStandardBrowserEnv&&(i&&mt.isFunction(i)&&(i=i(e)),i||i!==!1&&Lz(e.url))){const h=r&&s&&Mz.read(s);h&&o.set(r,h)}return e},Bz=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,i){const r=Rk(t);let s=r.data;const o=ea.from(r.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:h}=r,g,y,w,C,D;function P(){C&&C(),D&&D(),r.cancelToken&&r.cancelToken.unsubscribe(g),r.signal&&r.signal.removeEventListener("abort",g)}let M=new XMLHttpRequest;M.open(r.method.toUpperCase(),r.url,!0),M.timeout=r.timeout;function F(){if(!M)return;const $=ea.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),he={data:!u||u==="text"||u==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:$,config:t,request:M};kk(function(fe){n(fe),P()},function(fe){i(fe),P()},he),M=null}"onloadend"in M?M.onloadend=F:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(F)},M.onabort=function(){M&&(i(new ti("Request aborted",ti.ECONNABORTED,t,M)),M=null)},M.onerror=function(){i(new ti("Network Error",ti.ERR_NETWORK,t,M)),M=null},M.ontimeout=function(){let ee=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const he=r.transitional||Ek;r.timeoutErrorMessage&&(ee=r.timeoutErrorMessage),i(new ti(ee,he.clarifyTimeoutError?ti.ETIMEDOUT:ti.ECONNABORTED,t,M)),M=null},s===void 0&&o.setContentType(null),"setRequestHeader"in M&&mt.forEach(o.toJSON(),function(ee,he){M.setRequestHeader(he,ee)}),mt.isUndefined(r.withCredentials)||(M.withCredentials=!!r.withCredentials),u&&u!=="json"&&(M.responseType=r.responseType),h&&([w,D]=Vy(h,!0),M.addEventListener("progress",w)),d&&M.upload&&([y,C]=Vy(d),M.upload.addEventListener("progress",y),M.upload.addEventListener("loadend",C)),(r.cancelToken||r.signal)&&(g=$=>{M&&(i(!$||$.type?new Yh(null,t,M):$),M.abort(),M=null)},r.cancelToken&&r.cancelToken.subscribe(g),r.signal&&(r.signal.aborted?g():r.signal.addEventListener("abort",g)));const K=Iz(r.url);if(K&&fo.protocols.indexOf(K)===-1){i(new ti("Unsupported protocol "+K+":",ti.ERR_BAD_REQUEST,t));return}M.send(s||null)})},Uz=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,r;const s=function(h){if(!r){r=!0,u();const g=h instanceof Error?h:this.reason;i.abort(g instanceof ti?g:new Yh(g instanceof Error?g.message:g))}};let o=e&&setTimeout(()=>{o=null,s(new ti(`timeout ${e} of ms exceeded`,ti.ETIMEDOUT))},e);const u=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),t=null)};t.forEach(h=>h.addEventListener("abort",s));const{signal:d}=i;return d.unsubscribe=()=>mt.asap(u),d}},Hz=function*(t,e){let n=t.byteLength;if(n{const r=zz(t,e);let s=0,o,u=d=>{o||(o=!0,i&&i(d))};return new ReadableStream({async pull(d){try{const{done:h,value:g}=await r.next();if(h){u(),d.close();return}let y=g.byteLength;if(n){let w=s+=y;n(w)}d.enqueue(new Uint8Array(g))}catch(h){throw u(h),h}},cancel(d){return u(d),r.return()}},{highWaterMark:2})},Wy=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mk=Wy&&typeof ReadableStream=="function",Vz=Wy&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Nk=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Wz=Mk&&Nk(()=>{let t=!1;const e=new Request(fo.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Fk=64*1024,$w=Mk&&Nk(()=>mt.isReadableStream(new Response("").body)),qy={stream:$w&&(t=>t.body)};Wy&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!qy[e]&&(qy[e]=mt.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new ti(`Response type '${e}' is not supported`,ti.ERR_NOT_SUPPORT,i)})})})(new Response);const qz=async t=>{if(t==null)return 0;if(mt.isBlob(t))return t.size;if(mt.isSpecCompliantForm(t))return(await new Request(fo.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(mt.isArrayBufferView(t)||mt.isArrayBuffer(t))return t.byteLength;if(mt.isURLSearchParams(t)&&(t=t+""),mt.isString(t))return(await Vz(t)).byteLength},Gz=async(t,e)=>{const n=mt.toFiniteNumber(t.getContentLength());return n??qz(e)},e_={http:pz,xhr:Bz,fetch:Wy&&(async t=>{let{url:e,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:u,onUploadProgress:d,responseType:h,headers:g,withCredentials:y="same-origin",fetchOptions:w}=Rk(t);h=h?(h+"").toLowerCase():"text";let C=Uz([r,s&&s.toAbortSignal()],o),D;const P=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let M;try{if(d&&Wz&&n!=="get"&&n!=="head"&&(M=await Gz(g,i))!==0){let he=new Request(e,{method:"POST",body:i,duplex:"half"}),ve;if(mt.isFormData(i)&&(ve=he.headers.get("content-type"))&&g.setContentType(ve),he.body){const[fe,ae]=Pk(M,Vy(Dk(d)));i=Lk(he.body,Fk,fe,ae)}}mt.isString(y)||(y=y?"include":"omit");const F="credentials"in Request.prototype;D=new Request(e,{...w,signal:C,method:n.toUpperCase(),headers:g.normalize().toJSON(),body:i,duplex:"half",credentials:F?y:void 0});let K=await fetch(D,w);const $=$w&&(h==="stream"||h==="response");if($w&&(u||$&&P)){const he={};["status","statusText","headers"].forEach(xe=>{he[xe]=K[xe]});const ve=mt.toFiniteNumber(K.headers.get("content-length")),[fe,ae]=u&&Pk(ve,Vy(Dk(u),!0))||[];K=new Response(Lk(K.body,Fk,fe,()=>{ae&&ae(),P&&P()}),he)}h=h||"text";let ee=await qy[mt.findKey(qy,h)||"text"](K,t);return!$&&P&&P(),await new Promise((he,ve)=>{kk(he,ve,{data:ee,headers:ea.from(K.headers),status:K.status,statusText:K.statusText,config:t,request:D})})}catch(F){throw P&&P(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new ti("Network Error",ti.ERR_NETWORK,t,D),{cause:F.cause||F}):ti.from(F,F&&F.code,t,D)}})};mt.forEach(e_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bk=t=>`- ${t}`,Kz=t=>mt.isFunction(t)||t===null||t===!1,Uk={getAdapter:t=>{t=mt.isArray(t)?t:[t];const{length:e}=t;let n,i;const r={};for(let s=0;s`adapter ${u} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : `+s.map(Bk).join(` `):" "+Bk(s[0]):"as no adapter specified";throw new ti("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:e_};function t_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yh(null,t)}function Hk(t){return t_(t),t.headers=ea.from(t.headers),t.data=Jw.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Uk.getAdapter(t.adapter||sm.adapter)(t).then(function(i){return t_(t),i.data=Jw.call(t,t.transformResponse,i),i.headers=ea.from(i.headers),i},function(i){return Ak(i)||(t_(t),i&&i.response&&(i.response.data=Jw.call(t,t.transformResponse,i.response),i.response.headers=ea.from(i.response.headers))),Promise.reject(i)})}const zk="1.10.0",Gy={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Gy[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const jk={};Gy.transitional=function(e,n,i){function r(s,o){return"[Axios v"+zk+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,u)=>{if(e===!1)throw new ti(r(o," has been removed"+(n?" in "+n:"")),ti.ERR_DEPRECATED);return n&&!jk[o]&&(jk[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,u):!0}},Gy.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function Yz(t,e,n){if(typeof t!="object")throw new ti("options must be an object",ti.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let r=i.length;for(;r-- >0;){const s=i[r],o=e[s];if(o){const u=t[s],d=u===void 0||o(u,s,t);if(d!==!0)throw new ti("option "+s+" must be "+d,ti.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ti("Unknown option "+s,ti.ERR_BAD_OPTION)}}const Ky={assertOptions:Yz,validators:Gy},cu=Ky.validators;let $d=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Tk,response:new Tk}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` `+s):i.stack=s}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Jd(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&Ky.assertOptions(i,{silentJSONParsing:cu.transitional(cu.boolean),forcedJSONParsing:cu.transitional(cu.boolean),clarifyTimeoutError:cu.transitional(cu.boolean)},!1),r!=null&&(mt.isFunction(r)?n.paramsSerializer={serialize:r}:Ky.assertOptions(r,{encode:cu.function,serialize:cu.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ky.assertOptions(n,{baseUrl:cu.spelling("baseURL"),withXsrfToken:cu.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&mt.merge(s.common,s[n.method]);s&&mt.forEach(["delete","get","head","post","put","patch","common"],D=>{delete s[D]}),n.headers=ea.concat(o,s);const u=[];let d=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(d=d&&P.synchronous,u.unshift(P.fulfilled,P.rejected))});const h=[];this.interceptors.response.forEach(function(P){h.push(P.fulfilled,P.rejected)});let g,y=0,w;if(!d){const D=[Hk.bind(this),void 0];for(D.unshift.apply(D,u),D.push.apply(D,h),w=D.length,g=Promise.resolve(n);y{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(u=>{i.subscribe(u),s=u}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,u){i.reason||(i.reason=new Yh(s,o,u),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new V4(function(r){e=r}),cancel:e}}};function Zz(t){return function(n){return t.apply(null,n)}}function Qz(t){return mt.isObject(t)&&t.isAxiosError===!0}const n_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(n_).forEach(([t,e])=>{n_[e]=t});function Vk(t){const e=new $d(t),n=ak($d.prototype.request,e);return mt.extend(n,$d.prototype,e,{allOwnKeys:!0}),mt.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return Vk(Jd(t,r))},n}const dr=Vk(sm);dr.Axios=$d,dr.CanceledError=Yh,dr.CancelToken=Xz,dr.isCancel=Ak,dr.VERSION=zk,dr.toFormData=zy,dr.AxiosError=ti,dr.Cancel=dr.CanceledError,dr.all=function(e){return Promise.all(e)},dr.spread=Zz,dr.isAxiosError=Qz,dr.mergeConfig=Jd,dr.AxiosHeaders=ea,dr.formToJSON=t=>xk(mt.isHTMLForm(t)?new FormData(t):t),dr.getAdapter=Uk.getAdapter,dr.HttpStatusCode=n_,dr.default=dr;const{Axios:yve,AxiosError:vve,CanceledError:bve,isCancel:wve,CancelToken:_ve,VERSION:Sve,all:Tve,Cancel:Eve,isAxiosError:xve,spread:Cve,toFormData:Ave,AxiosHeaders:kve,HttpStatusCode:Pve,formToJSON:Dve,getAdapter:Ive,mergeConfig:Ove}=dr;var i_={name:"Panel",emits:["update:collapsed","toggle"],props:{header:String,toggleable:Boolean,collapsed:Boolean,toggleButtonProps:{type:null,default:null}},data(){return{d_collapsed:this.collapsed}},watch:{collapsed(t){this.d_collapsed=t}},methods:{toggle(t){this.d_collapsed=!this.d_collapsed,this.$emit("update:collapsed",this.d_collapsed),this.$emit("toggle",{originalEvent:t,value:this.d_collapsed})},onKeyDown(t){(t.code==="Enter"||t.code==="Space")&&(this.toggle(t),t.preventDefault())}},computed:{ariaId(){return Xs()},containerClass(){return["p-panel p-component",{"p-panel-toggleable":this.toggleable}]},buttonAriaLabel(){return this.toggleButtonProps&&this.toggleButtonProps["aria-label"]?this.toggleButtonProps["aria-label"]:this.header}},directives:{ripple:po}};const Jz={class:"p-panel-header"},$z=["id"],ej={class:"p-panel-icons"},tj=["id","aria-label","aria-controls","aria-expanded"],nj=["id","aria-labelledby"],ij={class:"p-panel-content"};function rj(t,e,n,i,r,s){const o=_s("ripple");return G(),se("div",{class:Lt(s.containerClass)},[ue("div",Jz,[En(t.$slots,"header",{},()=>[n.header?(G(),se("span",{key:0,id:s.ariaId+"_header",class:"p-panel-title"},lt(n.header),9,$z)):qe("",!0)]),ue("div",ej,[En(t.$slots,"icons"),n.toggleable?ei((G(),se("button",Ni({key:0,id:s.ariaId+"_header",type:"button",role:"button",class:"p-panel-header-icon p-panel-toggler p-link","aria-label":s.buttonAriaLabel,"aria-controls":s.ariaId+"_content","aria-expanded":!r.d_collapsed,onClick:e[0]||(e[0]=(...u)=>s.toggle&&s.toggle(...u)),onKeydown:e[1]||(e[1]=(...u)=>s.onKeyDown&&s.onKeyDown(...u))},n.toggleButtonProps),[ue("span",{class:Lt({"pi pi-minus":!r.d_collapsed,"pi pi-plus":r.d_collapsed})},null,2)],16,tj)),[[o]]):qe("",!0)])]),gt(lu,{name:"p-toggleable-content"},{default:jt(()=>[ei(ue("div",{id:s.ariaId+"_content",class:"p-toggleable-content",role:"region","aria-labelledby":s.ariaId+"_header"},[ue("div",ij,[En(t.$slots,"default")])],8,nj),[[Qf,!r.d_collapsed]])]),_:3})],2)}function sj(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var oj=` .p-panel-header { display: flex; justify-content: space-between; align-items: center; } .p-panel-title { line-height: 1; } .p-panel-header-icon { display: inline-flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; overflow: hidden; position: relative; } `;sj(oj),i_.render=rj;var aj=Object.defineProperty,Wk=t=>{throw TypeError(t)},lj=(t,e,n)=>e in t?aj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,r_=(t,e,n)=>lj(t,typeof e!="symbol"?e+"":e,n),s_=(t,e,n)=>e.has(t)||Wk("Cannot "+n),Wn=(t,e,n)=>(s_(t,e,"read from private field"),n?n.call(t):e.get(t)),Mo=(t,e,n)=>e.has(t)?Wk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ns=(t,e,n,i)=>(s_(t,e,"write to private field"),e.set(t,n),n),Os=(t,e,n)=>(s_(t,e,"access private method"),n);/*! * shared v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */const Yy=typeof window<"u",nd=(t,e=!1)=>e?Symbol.for(t):Symbol(t),uj=(t,e,n)=>cj({l:t,k:e,s:n}),cj=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),is=t=>typeof t=="number"&&isFinite(t),dj=t=>o_(t)==="[object Date]",Xh=t=>o_(t)==="[object RegExp]",Xy=t=>pi(t)&&Object.keys(t).length===0,Ss=Object.assign,hj=Object.create,rr=(t=null)=>hj(t);let qk;const eh=()=>qk||(qk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:rr());function Gk(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const pj=Object.prototype.hasOwnProperty;function Al(t,e){return pj.call(t,e)}const Gr=Array.isArray,_r=t=>typeof t=="function",an=t=>typeof t=="string",Fi=t=>typeof t=="boolean",zi=t=>t!==null&&typeof t=="object",fj=t=>zi(t)&&_r(t.then)&&_r(t.catch),Kk=Object.prototype.toString,o_=t=>Kk.call(t),pi=t=>o_(t)==="[object Object]",mj=t=>t==null?"":Gr(t)||pi(t)&&t.toString===Kk?JSON.stringify(t,null,2):String(t);function a_(t,e=""){return t.reduce((n,i,r)=>r===0?n+i:n+e+i,"")}function gj(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const Zy=t=>!zi(t)||Gr(t);function Qy(t,e){if(Zy(t)||Zy(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:i,des:r}=n.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(zi(i[s])&&!zi(r[s])&&(r[s]=Array.isArray(i[s])?[]:rr()),Zy(r[s])||Zy(i[s])?r[s]=i[s]:n.push({src:i[s],des:r[s]}))})}}/*! * message-compiler v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function yj(t,e,n){return{line:t,column:e,offset:n}}function l_(t,e,n){return{start:t,end:e}}const $i={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},vj=17;function Jy(t,e,n={}){const{domain:i,messages:r,args:s}=n,o=t,u=new SyntaxError(String(o));return u.code=t,e&&(u.location=e),u.domain=i,u}function bj(t){throw t}const rc=" ",wj="\r",ta=` `,_j="\u2028",Sj="\u2029";function Tj(t){const e=t;let n=0,i=1,r=1,s=0;const o=fe=>e[fe]===wj&&e[fe+1]===ta,u=fe=>e[fe]===ta,d=fe=>e[fe]===Sj,h=fe=>e[fe]===_j,g=fe=>o(fe)||u(fe)||d(fe)||h(fe),y=()=>n,w=()=>i,C=()=>r,D=()=>s,P=fe=>o(fe)||d(fe)||h(fe)?ta:e[fe],M=()=>P(n),F=()=>P(n+s);function K(){return s=0,g(n)&&(i++,r=0),o(n)&&n++,n++,r++,e[n]}function $(){return o(n+s)&&s++,s++,e[n+s]}function ee(){n=0,i=1,r=1,s=0}function he(fe=0){s=fe}function ve(){const fe=n+s;for(;fe!==n;)K();s=0}return{index:y,line:w,column:C,peekOffset:D,charAt:P,currentChar:M,currentPeek:F,next:K,peek:$,reset:ee,resetPeek:he,skipToPeek:ve}}const id=void 0,Yk="'",Ej="tokenizer";function xj(t,e={}){const n=e.location!==!1,i=Tj(t),r=()=>i.index(),s=()=>yj(i.line(),i.column(),i.index()),o=s(),u=r(),d={currentType:13,offset:u,startLoc:o,endLoc:o,lastType:13,lastOffset:u,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},h=()=>d,{onError:g}=e;function y(re,ge,Ce,...Ge){const Ue=h();if(ge.column+=Ce,ge.offset+=Ce,g){const We=n?l_(Ue.startLoc,ge):null,rt=Jy(re,We,{domain:Ej,args:Ge});g(rt)}}function w(re,ge,Ce){re.endLoc=s(),re.currentType=ge;const Ge={type:ge};return n&&(Ge.loc=l_(re.startLoc,re.endLoc)),Ce!=null&&(Ge.value=Ce),Ge}const C=re=>w(re,13);function D(re,ge){return re.currentChar()===ge?(re.next(),ge):(y($i.EXPECTED_TOKEN,s(),0,ge),"")}function P(re){let ge="";for(;re.currentPeek()===rc||re.currentPeek()===ta;)ge+=re.currentPeek(),re.peek();return ge}function M(re){const ge=P(re);return re.skipToPeek(),ge}function F(re){if(re===id)return!1;const ge=re.charCodeAt(0);return ge>=97&&ge<=122||ge>=65&&ge<=90||ge===95}function K(re){if(re===id)return!1;const ge=re.charCodeAt(0);return ge>=48&&ge<=57}function $(re,ge){const{currentType:Ce}=ge;if(Ce!==2)return!1;P(re);const Ge=F(re.currentPeek());return re.resetPeek(),Ge}function ee(re,ge){const{currentType:Ce}=ge;if(Ce!==2)return!1;P(re);const Ge=re.currentPeek()==="-"?re.peek():re.currentPeek(),Ue=K(Ge);return re.resetPeek(),Ue}function he(re,ge){const{currentType:Ce}=ge;if(Ce!==2)return!1;P(re);const Ge=re.currentPeek()===Yk;return re.resetPeek(),Ge}function ve(re,ge){const{currentType:Ce}=ge;if(Ce!==7)return!1;P(re);const Ge=re.currentPeek()===".";return re.resetPeek(),Ge}function fe(re,ge){const{currentType:Ce}=ge;if(Ce!==8)return!1;P(re);const Ge=F(re.currentPeek());return re.resetPeek(),Ge}function ae(re,ge){const{currentType:Ce}=ge;if(!(Ce===7||Ce===11))return!1;P(re);const Ge=re.currentPeek()===":";return re.resetPeek(),Ge}function xe(re,ge){const{currentType:Ce}=ge;if(Ce!==9)return!1;const Ge=()=>{const We=re.currentPeek();return We==="{"?F(re.peek()):We==="@"||We==="|"||We===":"||We==="."||We===rc||!We?!1:We===ta?(re.peek(),Ge()):ot(re,!1)},Ue=Ge();return re.resetPeek(),Ue}function Qe(re){P(re);const ge=re.currentPeek()==="|";return re.resetPeek(),ge}function ot(re,ge=!0){const Ce=(Ue=!1,We="")=>{const rt=re.currentPeek();return rt==="{"||rt==="@"||!rt?Ue:rt==="|"?!(We===rc||We===ta):rt===rc?(re.peek(),Ce(!0,rc)):rt===ta?(re.peek(),Ce(!0,ta)):!0},Ge=Ce();return ge&&re.resetPeek(),Ge}function et(re,ge){const Ce=re.currentChar();return Ce===id?id:ge(Ce)?(re.next(),Ce):null}function pt(re){const ge=re.charCodeAt(0);return ge>=97&&ge<=122||ge>=65&&ge<=90||ge>=48&&ge<=57||ge===95||ge===36}function Wt(re){return et(re,pt)}function pn(re){const ge=re.charCodeAt(0);return ge>=97&&ge<=122||ge>=65&&ge<=90||ge>=48&&ge<=57||ge===95||ge===36||ge===45}function Ut(re){return et(re,pn)}function Xt(re){const ge=re.charCodeAt(0);return ge>=48&&ge<=57}function cn(re){return et(re,Xt)}function ai(re){const ge=re.charCodeAt(0);return ge>=48&&ge<=57||ge>=65&&ge<=70||ge>=97&&ge<=102}function Qt(re){return et(re,ai)}function xn(re){let ge="",Ce="";for(;ge=cn(re);)Ce+=ge;return Ce}function ii(re){let ge="";for(;;){const Ce=re.currentChar();if(Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||!Ce)break;if(Ce===rc||Ce===ta)if(ot(re))ge+=Ce,re.next();else{if(Qe(re))break;ge+=Ce,re.next()}else ge+=Ce,re.next()}return ge}function Zn(re){M(re);let ge="",Ce="";for(;ge=Ut(re);)Ce+=ge;return re.currentChar()===id&&y($i.UNTERMINATED_CLOSING_BRACE,s(),0),Ce}function li(re){M(re);let ge="";return re.currentChar()==="-"?(re.next(),ge+=`-${xn(re)}`):ge+=xn(re),re.currentChar()===id&&y($i.UNTERMINATED_CLOSING_BRACE,s(),0),ge}function Ft(re){return re!==Yk&&re!==ta}function ui(re){M(re),D(re,"'");let ge="",Ce="";for(;ge=et(re,Ft);)ge==="\\"?Ce+=or(re):Ce+=ge;const Ge=re.currentChar();return Ge===ta||Ge===id?(y($i.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),Ge===ta&&(re.next(),D(re,"'")),Ce):(D(re,"'"),Ce)}function or(re){const ge=re.currentChar();switch(ge){case"\\":case"'":return re.next(),`\\${ge}`;case"u":return ji(re,ge,4);case"U":return ji(re,ge,6);default:return y($i.UNKNOWN_ESCAPE_SEQUENCE,s(),0,ge),""}}function ji(re,ge,Ce){D(re,ge);let Ge="";for(let Ue=0;Ue{const Ge=re.currentChar();return Ge==="{"||Ge==="@"||Ge==="|"||Ge==="("||Ge===")"||!Ge||Ge===rc?Ce:(Ce+=Ge,re.next(),ge(Ce))};return ge("")}function Ke(re){M(re);const ge=D(re,"|");return M(re),ge}function N(re,ge){let Ce=null;switch(re.currentChar()){case"{":return ge.braceNest>=1&&y($i.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),re.next(),Ce=w(ge,2,"{"),M(re),ge.braceNest++,Ce;case"}":return ge.braceNest>0&&ge.currentType===2&&y($i.EMPTY_PLACEHOLDER,s(),0),re.next(),Ce=w(ge,3,"}"),ge.braceNest--,ge.braceNest>0&&M(re),ge.inLinked&&ge.braceNest===0&&(ge.inLinked=!1),Ce;case"@":return ge.braceNest>0&&y($i.UNTERMINATED_CLOSING_BRACE,s(),0),Ce=ce(re,ge)||C(ge),ge.braceNest=0,Ce;default:{let Ge=!0,Ue=!0,We=!0;if(Qe(re))return ge.braceNest>0&&y($i.UNTERMINATED_CLOSING_BRACE,s(),0),Ce=w(ge,1,Ke(re)),ge.braceNest=0,ge.inLinked=!1,Ce;if(ge.braceNest>0&&(ge.currentType===4||ge.currentType===5||ge.currentType===6))return y($i.UNTERMINATED_CLOSING_BRACE,s(),0),ge.braceNest=0,Re(re,ge);if(Ge=$(re,ge))return Ce=w(ge,4,Zn(re)),M(re),Ce;if(Ue=ee(re,ge))return Ce=w(ge,5,li(re)),M(re),Ce;if(We=he(re,ge))return Ce=w(ge,6,ui(re)),M(re),Ce;if(!Ge&&!Ue&&!We)return Ce=w(ge,12,Hn(re)),y($i.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,Ce.value),M(re),Ce;break}}return Ce}function ce(re,ge){const{currentType:Ce}=ge;let Ge=null;const Ue=re.currentChar();switch((Ce===7||Ce===8||Ce===11||Ce===9)&&(Ue===ta||Ue===rc)&&y($i.INVALID_LINKED_FORMAT,s(),0),Ue){case"@":return re.next(),Ge=w(ge,7,"@"),ge.inLinked=!0,Ge;case".":return M(re),re.next(),w(ge,8,".");case":":return M(re),re.next(),w(ge,9,":");default:return Qe(re)?(Ge=w(ge,1,Ke(re)),ge.braceNest=0,ge.inLinked=!1,Ge):ve(re,ge)||ae(re,ge)?(M(re),ce(re,ge)):fe(re,ge)?(M(re),w(ge,11,Ur(re))):xe(re,ge)?(M(re),Ue==="{"?N(re,ge)||Ge:w(ge,10,Fe(re))):(Ce===7&&y($i.INVALID_LINKED_FORMAT,s(),0),ge.braceNest=0,ge.inLinked=!1,Re(re,ge))}}function Re(re,ge){let Ce={type:13};if(ge.braceNest>0)return N(re,ge)||C(ge);if(ge.inLinked)return ce(re,ge)||C(ge);switch(re.currentChar()){case"{":return N(re,ge)||C(ge);case"}":return y($i.UNBALANCED_CLOSING_BRACE,s(),0),re.next(),w(ge,3,"}");case"@":return ce(re,ge)||C(ge);default:{if(Qe(re))return Ce=w(ge,1,Ke(re)),ge.braceNest=0,ge.inLinked=!1,Ce;if(ot(re))return w(ge,0,ii(re));break}}return Ce}function Ye(){const{currentType:re,offset:ge,startLoc:Ce,endLoc:Ge}=d;return d.lastType=re,d.lastOffset=ge,d.lastStartLoc=Ce,d.lastEndLoc=Ge,d.offset=r(),d.startLoc=s(),i.currentChar()===id?w(d,13):Re(i,d)}return{nextToken:Ye,currentOffset:r,currentPosition:s,context:h}}const Cj="parser",Aj=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function kj(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Pj(t={}){const e=t.location!==!1,{onError:n}=t;function i(F,K,$,ee,...he){const ve=F.currentPosition();if(ve.offset+=ee,ve.column+=ee,n){const fe=e?l_($,ve):null,ae=Jy(K,fe,{domain:Cj,args:he});n(ae)}}function r(F,K,$){const ee={type:F};return e&&(ee.start=K,ee.end=K,ee.loc={start:$,end:$}),ee}function s(F,K,$,ee){e&&(F.end=K,F.loc&&(F.loc.end=$))}function o(F,K){const $=F.context(),ee=r(3,$.offset,$.startLoc);return ee.value=K,s(ee,F.currentOffset(),F.currentPosition()),ee}function u(F,K){const $=F.context(),{lastOffset:ee,lastStartLoc:he}=$,ve=r(5,ee,he);return ve.index=parseInt(K,10),F.nextToken(),s(ve,F.currentOffset(),F.currentPosition()),ve}function d(F,K){const $=F.context(),{lastOffset:ee,lastStartLoc:he}=$,ve=r(4,ee,he);return ve.key=K,F.nextToken(),s(ve,F.currentOffset(),F.currentPosition()),ve}function h(F,K){const $=F.context(),{lastOffset:ee,lastStartLoc:he}=$,ve=r(9,ee,he);return ve.value=K.replace(Aj,kj),F.nextToken(),s(ve,F.currentOffset(),F.currentPosition()),ve}function g(F){const K=F.nextToken(),$=F.context(),{lastOffset:ee,lastStartLoc:he}=$,ve=r(8,ee,he);return K.type!==11?(i(F,$i.UNEXPECTED_EMPTY_LINKED_MODIFIER,$.lastStartLoc,0),ve.value="",s(ve,ee,he),{nextConsumeToken:K,node:ve}):(K.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,$.lastStartLoc,0,du(K)),ve.value=K.value||"",s(ve,F.currentOffset(),F.currentPosition()),{node:ve})}function y(F,K){const $=F.context(),ee=r(7,$.offset,$.startLoc);return ee.value=K,s(ee,F.currentOffset(),F.currentPosition()),ee}function w(F){const K=F.context(),$=r(6,K.offset,K.startLoc);let ee=F.nextToken();if(ee.type===8){const he=g(F);$.modifier=he.node,ee=he.nextConsumeToken||F.nextToken()}switch(ee.type!==9&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(ee)),ee=F.nextToken(),ee.type===2&&(ee=F.nextToken()),ee.type){case 10:ee.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(ee)),$.key=y(F,ee.value||"");break;case 4:ee.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(ee)),$.key=d(F,ee.value||"");break;case 5:ee.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(ee)),$.key=u(F,ee.value||"");break;case 6:ee.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(ee)),$.key=h(F,ee.value||"");break;default:{i(F,$i.UNEXPECTED_EMPTY_LINKED_KEY,K.lastStartLoc,0);const he=F.context(),ve=r(7,he.offset,he.startLoc);return ve.value="",s(ve,he.offset,he.startLoc),$.key=ve,s($,he.offset,he.startLoc),{nextConsumeToken:ee,node:$}}}return s($,F.currentOffset(),F.currentPosition()),{node:$}}function C(F){const K=F.context(),$=K.currentType===1?F.currentOffset():K.offset,ee=K.currentType===1?K.endLoc:K.startLoc,he=r(2,$,ee);he.items=[];let ve=null;do{const xe=ve||F.nextToken();switch(ve=null,xe.type){case 0:xe.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(xe)),he.items.push(o(F,xe.value||""));break;case 5:xe.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(xe)),he.items.push(u(F,xe.value||""));break;case 4:xe.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(xe)),he.items.push(d(F,xe.value||""));break;case 6:xe.value==null&&i(F,$i.UNEXPECTED_LEXICAL_ANALYSIS,K.lastStartLoc,0,du(xe)),he.items.push(h(F,xe.value||""));break;case 7:{const Qe=w(F);he.items.push(Qe.node),ve=Qe.nextConsumeToken||null;break}}}while(K.currentType!==13&&K.currentType!==1);const fe=K.currentType===1?K.lastOffset:F.currentOffset(),ae=K.currentType===1?K.lastEndLoc:F.currentPosition();return s(he,fe,ae),he}function D(F,K,$,ee){const he=F.context();let ve=ee.items.length===0;const fe=r(1,K,$);fe.cases=[],fe.cases.push(ee);do{const ae=C(F);ve||(ve=ae.items.length===0),fe.cases.push(ae)}while(he.currentType!==13);return ve&&i(F,$i.MUST_HAVE_MESSAGES_IN_PLURAL,$,0),s(fe,F.currentOffset(),F.currentPosition()),fe}function P(F){const K=F.context(),{offset:$,startLoc:ee}=K,he=C(F);return K.currentType===13?he:D(F,$,ee,he)}function M(F){const K=xj(F,Ss({},t)),$=K.context(),ee=r(0,$.offset,$.startLoc);return e&&ee.loc&&(ee.loc.source=F),ee.body=P(K),t.onCacheKey&&(ee.cacheKey=t.onCacheKey(F)),$.currentType!==13&&i(K,$i.UNEXPECTED_LEXICAL_ANALYSIS,$.lastStartLoc,0,F[$.offset]||""),s(ee,K.currentOffset(),K.currentPosition()),ee}return{parse:M}}function du(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Dj(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Xk(t,e){for(let n=0;nZk(n)),t}function Zk(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;no;function d(C,D){o.code+=C}function h(C,D=!0){const P=D?i:"";d(r?P+" ".repeat(C):P)}function g(C=!0){const D=++o.indentLevel;C&&h(D)}function y(C=!0){const D=--o.indentLevel;C&&h(D)}function w(){h(o.indentLevel)}return{context:u,push:d,indent:g,deindent:y,newline:w,helper:C=>`_${C}`,needIndent:()=>o.needIndent}}function Lj(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Qh(t,e.key),e.modifier?(t.push(", "),Qh(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Mj(t,e){const{helper:n,needIndent:i}=t;t.push(`${n("normalize")}([`),t.indent(i());const r=e.items.length;for(let s=0;s1){t.push(`${n("plural")}([`),t.indent(i());const r=e.cases.length;for(let s=0;s{const n=an(e.mode)?e.mode:"normal",i=an(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":` `,s=e.needIndent?e.needIndent:n!=="arrow",o=t.helpers||[],u=Rj(t,{filename:i,breakLineCode:r,needIndent:s});u.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),u.indent(s),o.length>0&&(u.push(`const { ${a_(o.map(g=>`${g}: _${g}`),", ")} } = ctx`),u.newline()),u.push("return "),Qh(u,t),u.deindent(s),u.push("}"),delete t.helpers;const{code:d,map:h}=u.context();return{ast:t,code:d,map:h?h.toJSON():void 0}};function Uj(t,e={}){const n=Ss({},e),i=!!n.jit,r=!!n.minify,s=n.optimize==null?!0:n.optimize,o=Pj(n).parse(t);return i?(s&&Oj(o),r&&Zh(o),{ast:o,code:""}):(Ij(o,n),Bj(o,n))}/*! * core-base v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function Hj(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(eh().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(eh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hu(t){return zi(t)&&c_(t)===0&&(Al(t,"b")||Al(t,"body"))}const Qk=["b","body"];function zj(t){return rd(t,Qk)}const Jk=["c","cases"];function jj(t){return rd(t,Jk,[])}const $k=["s","static"];function Vj(t){return rd(t,$k)}const eP=["i","items"];function Wj(t){return rd(t,eP,[])}const tP=["t","type"];function c_(t){return rd(t,tP)}const nP=["v","value"];function $y(t,e){const n=rd(t,nP);if(n!=null)return n;throw am(e)}const iP=["m","modifier"];function qj(t){return rd(t,iP)}const rP=["k","key"];function Gj(t){const e=rd(t,rP);if(e)return e;throw am(6)}function rd(t,e,n){for(let i=0;iKj(e,t)}function Kj(t,e){const n=zj(e);if(n==null)throw am(0);if(c_(n)===1){const i=jj(n);return t.plural(i.reduce((r,s)=>[...r,oP(t,s)],[]))}else return oP(t,n)}function oP(t,e){const n=Vj(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const i=Wj(e).reduce((r,s)=>[...r,h_(t,s)],[]);return t.normalize(i)}}function h_(t,e){const n=c_(e);switch(n){case 3:return $y(e,n);case 9:return $y(e,n);case 4:{const i=e;if(Al(i,"k")&&i.k)return t.interpolate(t.named(i.k));if(Al(i,"key")&&i.key)return t.interpolate(t.named(i.key));throw am(n)}case 5:{const i=e;if(Al(i,"i")&&is(i.i))return t.interpolate(t.list(i.i));if(Al(i,"index")&&is(i.index))return t.interpolate(t.list(i.index));throw am(n)}case 6:{const i=e,r=qj(i),s=Gj(i);return t.linked(h_(t,s),r?h_(t,r):void 0,t.type)}case 7:return $y(e,n);case 8:return $y(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Yj=t=>t;let ev=rr();function Xj(t,e={}){let n=!1;const i=e.onError||bj;return e.onError=r=>{n=!0,i(r)},{...Uj(t,e),detectError:n}}function Zj(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&an(t)){Fi(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||Yj)(t),i=ev[n];if(i)return i;const{ast:r,detectError:s}=Xj(t,{...e,location:!1,jit:!0}),o=d_(r);return s?o:ev[n]=o}else{const n=t.cacheKey;return n?ev[n]||(ev[n]=d_(t)):d_(t)}}let lm=null;function Qj(t){lm=t}function Jj(t,e,n){lm&&lm.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const $j=eV("function:translate");function eV(t){return e=>lm&&lm.emit(t,e)}const sc={INVALID_ARGUMENT:vj,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},tV=24;function oc(t){return Jy(t,null,void 0)}function p_(t,e){return e.locale!=null?aP(e.locale):aP(t.locale)}let f_;function aP(t){if(an(t))return t;if(_r(t)){if(t.resolvedOnce&&f_!=null)return f_;if(t.constructor.name==="Function"){const e=t();if(fj(e))throw oc(sc.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return f_=e}else throw oc(sc.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw oc(sc.NOT_SUPPORT_LOCALE_TYPE)}function nV(t,e,n){return[...new Set([n,...Gr(e)?e:zi(e)?Object.keys(e):an(e)?[e]:[n]])]}function lP(t,e,n){const i=an(n)?n:um,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(i);if(!s){s=[];let o=[n];for(;Gr(o);)o=uP(s,o,e);const u=Gr(e)||!pi(e)?e:e.default?e.default:null;o=an(u)?[u]:u,Gr(o)&&uP(s,o,!1),r.__localeChainCache.set(i,s)}return s}function uP(t,e,n){let i=!0;for(let r=0;r{o===void 0?o=u:o+=u},w[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},w[2]=()=>{w[0](),r++},w[3]=()=>{if(r>0)r--,i=4,w[0]();else{if(r=0,o===void 0||(o=uV(o),o===!1))return!1;w[1]()}};function C(){const D=t[n+1];if(i===5&&D==="'"||i===6&&D==='"')return n++,u="\\"+D,w[0](),!0}for(;i!==null;)if(n++,s=t[n],!(s==="\\"&&C())){if(d=lV(s),y=sd[i],h=y[d]||y.l||8,h===8||(i=h[0],h[1]!==void 0&&(g=w[h[1]],g&&(u=s,g()===!1))))return;if(i===7)return e}}const cP=new Map;function dV(t,e){return zi(t)?t[e]:null}function hV(t,e){if(!zi(t))return null;let n=cP.get(e);if(n||(n=cV(e),n&&cP.set(e,n)),!n)return null;const i=n.length;let r=t,s=0;for(;s`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function fV(){return{upper:(t,e)=>e==="text"&&an(t)?t.toUpperCase():e==="vnode"&&zi(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&an(t)?t.toLowerCase():e==="vnode"&&zi(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&an(t)?hP(t):e==="vnode"&&zi(t)&&"__v_isVNode"in t?hP(t.children):t}}let pP;function mV(t){pP=t}let fP;function gV(t){fP=t}let mP;function yV(t){mP=t}let gP=null;const yP=t=>{gP=t},vV=()=>gP;let vP=0;function bV(t={}){const e=_r(t.onWarn)?t.onWarn:gj,n=an(t.version)?t.version:pV,i=an(t.locale)||_r(t.locale)?t.locale:um,r=_r(i)?um:i,s=Gr(t.fallbackLocale)||pi(t.fallbackLocale)||an(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,o=pi(t.messages)?t.messages:m_(r),u=pi(t.datetimeFormats)?t.datetimeFormats:m_(r),d=pi(t.numberFormats)?t.numberFormats:m_(r),h=Ss(rr(),t.modifiers,fV()),g=t.pluralRules||rr(),y=_r(t.missing)?t.missing:null,w=Fi(t.missingWarn)||Xh(t.missingWarn)?t.missingWarn:!0,C=Fi(t.fallbackWarn)||Xh(t.fallbackWarn)?t.fallbackWarn:!0,D=!!t.fallbackFormat,P=!!t.unresolving,M=_r(t.postTranslation)?t.postTranslation:null,F=pi(t.processor)?t.processor:null,K=Fi(t.warnHtmlMessage)?t.warnHtmlMessage:!0,$=!!t.escapeParameter,ee=_r(t.messageCompiler)?t.messageCompiler:pP,he=_r(t.messageResolver)?t.messageResolver:fP||dV,ve=_r(t.localeFallbacker)?t.localeFallbacker:mP||nV,fe=zi(t.fallbackContext)?t.fallbackContext:void 0,ae=t,xe=zi(ae.__datetimeFormatters)?ae.__datetimeFormatters:new Map,Qe=zi(ae.__numberFormatters)?ae.__numberFormatters:new Map,ot=zi(ae.__meta)?ae.__meta:{};vP++;const et={version:n,cid:vP,locale:i,fallbackLocale:s,messages:o,modifiers:h,pluralRules:g,missing:y,missingWarn:w,fallbackWarn:C,fallbackFormat:D,unresolving:P,postTranslation:M,processor:F,warnHtmlMessage:K,escapeParameter:$,messageCompiler:ee,messageResolver:he,localeFallbacker:ve,fallbackContext:fe,onWarn:e,__meta:ot};return et.datetimeFormats=u,et.numberFormats=d,et.__datetimeFormatters=xe,et.__numberFormatters=Qe,__INTLIFY_PROD_DEVTOOLS__&&Jj(et,n,ot),et}const m_=t=>({[t]:rr()});function g_(t,e,n,i,r){const{missing:s,onWarn:o}=t;if(s!==null){const u=s(t,n,e,r);return an(u)?u:e}else return e}function cm(t,e,n){const i=t;i.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function wV(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function _V(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let i=n+1;i{wP.includes(d)?o[d]=n[d]:s[d]=n[d]}),an(i)?s.locale=i:pi(i)&&(o=i),pi(r)&&(o=r),[s.key||"",u,s,o]}function _P(t,e,n){const i=t;for(const r in n){const s=`${e}__${r}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function SP(t,...e){const{numberFormats:n,unresolving:i,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:u}=t,[d,h,g,y]=v_(...e),w=Fi(g.missingWarn)?g.missingWarn:t.missingWarn;Fi(g.fallbackWarn)?g.fallbackWarn:t.fallbackWarn;const C=!!g.part,D=p_(t,g),P=o(t,r,D);if(!an(d)||d==="")return new Intl.NumberFormat(D,y).format(h);let M={},F,K=null;const $="number format";for(let ve=0;ve{TP.includes(d)?o[d]=n[d]:s[d]=n[d]}),an(i)?s.locale=i:pi(i)&&(o=i),pi(r)&&(o=r),[s.key||"",u,s,o]}function EP(t,e,n){const i=t;for(const r in n){const s=`${e}__${r}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const SV=t=>t,TV=t=>"",EV="text",xV=t=>t.length===0?"":a_(t),CV=mj;function xP(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function AV(t){const e=is(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(is(t.named.count)||is(t.named.n))?is(t.named.count)?t.named.count:is(t.named.n)?t.named.n:e:e}function kV(t,e){e.count||(e.count=t),e.n||(e.n=t)}function PV(t={}){const e=t.locale,n=AV(t),i=zi(t.pluralRules)&&an(e)&&_r(t.pluralRules[e])?t.pluralRules[e]:xP,r=zi(t.pluralRules)&&an(e)&&_r(t.pluralRules[e])?xP:void 0,s=M=>M[i(n,M.length,r)],o=t.list||[],u=M=>o[M],d=t.named||rr();is(t.pluralIndex)&&kV(n,d);const h=M=>d[M];function g(M,F){return(_r(t.messages)?t.messages(M,!!F):zi(t.messages)?t.messages[M]:!1)||(t.parent?t.parent.message(M):TV)}const y=M=>t.modifiers?t.modifiers[M]:SV,w=pi(t.processor)&&_r(t.processor.normalize)?t.processor.normalize:xV,C=pi(t.processor)&&_r(t.processor.interpolate)?t.processor.interpolate:CV,D=pi(t.processor)&&an(t.processor.type)?t.processor.type:EV,P={list:u,named:h,plural:s,linked:(M,...F)=>{const[K,$]=F;let ee="text",he="";F.length===1?zi(K)?(he=K.modifier||he,ee=K.type||ee):an(K)&&(he=K||he):F.length===2&&(an(K)&&(he=K||he),an($)&&(ee=$||ee));const ve=g(M,!0)(P),fe=ee==="vnode"&&Gr(ve)&&he?ve[0]:ve;return he?y(he)(fe,ee):fe},message:g,type:D,interpolate:C,normalize:w,values:Ss(rr(),o,d)};return P}const CP=()=>"",kl=t=>_r(t);function AP(t,...e){const{fallbackFormat:n,postTranslation:i,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:u}=t,[d,h]=b_(...e),g=Fi(h.missingWarn)?h.missingWarn:t.missingWarn,y=Fi(h.fallbackWarn)?h.fallbackWarn:t.fallbackWarn,w=Fi(h.escapeParameter)?h.escapeParameter:t.escapeParameter,C=!!h.resolvedMessage,D=an(h.default)||Fi(h.default)?Fi(h.default)?s?d:()=>d:h.default:n?s?d:()=>d:null,P=n||D!=null&&(an(D)||_r(D)),M=p_(t,h);w&&DV(h);let[F,K,$]=C?[d,M,u[M]||rr()]:kP(t,d,M,o,y,g),ee=F,he=d;if(!C&&!(an(ee)||hu(ee)||kl(ee))&&P&&(ee=D,he=ee),!C&&(!(an(ee)||hu(ee)||kl(ee))||!an(K)))return r?tv:d;let ve=!1;const fe=()=>{ve=!0},ae=kl(ee)?ee:PP(t,d,K,ee,he,fe);if(ve)return ee;const xe=RV(t,K,$,h),Qe=PV(xe),ot=IV(t,ae,Qe),et=i?i(ot,d):ot;if(__INTLIFY_PROD_DEVTOOLS__){const pt={timestamp:Date.now(),key:an(d)?d:kl(ee)?ee.key:"",locale:K||(kl(ee)?ee.locale:""),format:an(ee)?ee:kl(ee)?ee.source:"",message:et};pt.meta=Ss({},t.__meta,{}),$j(pt)}return et}function DV(t){Gr(t.list)?t.list=t.list.map(e=>an(e)?Gk(e):e):zi(t.named)&&Object.keys(t.named).forEach(e=>{an(t.named[e])&&(t.named[e]=Gk(t.named[e]))})}function kP(t,e,n,i,r,s){const{messages:o,onWarn:u,messageResolver:d,localeFallbacker:h}=t,g=h(t,i,n);let y=rr(),w,C=null;const D="translate";for(let P=0;Pi;return h.locale=n,h.key=e,h}const d=o(i,OV(t,n,r,i,u,s));return d.locale=n,d.key=e,d.source=i,d}function IV(t,e,n){return e(n)}function b_(...t){const[e,n,i]=t,r=rr();if(!an(e)&&!is(e)&&!kl(e)&&!hu(e))throw oc(sc.INVALID_ARGUMENT);const s=is(e)?String(e):e;return is(n)?r.plural=n:an(n)?r.default=n:pi(n)&&!Xy(n)?r.named=n:Gr(n)&&(r.list=n),is(i)?r.plural=i:an(i)?r.default=i:pi(i)&&Ss(r,i),[s,r]}function OV(t,e,n,i,r,s){return{locale:e,key:n,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>uj(e,n,o)}}function RV(t,e,n,i){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:u,fallbackWarn:d,missingWarn:h,fallbackContext:g}=t,y={locale:e,modifiers:r,pluralRules:s,messages:(w,C)=>{let D=o(n,w);if(D==null&&(g||C)){const[,,P]=kP(g||t,w,e,u,d,h);D=o(P,w)}if(an(D)||hu(D)){let P=!1;const M=PP(t,w,e,D,w,()=>{P=!0});return P?CP:M}else return kl(D)?D:CP}};return t.processor&&(y.processor=t.processor),i.list&&(y.list=i.list),i.named&&(y.named=i.named),is(i.plural)&&(y.pluralIndex=i.plural),y}Hj();/*! * vue-i18n v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */const LV="10.0.7";function MV(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(eh().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(eh().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(eh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(eh().__INTLIFY_PROD_DEVTOOLS__=!1)}const No={UNEXPECTED_RETURN_TYPE:tV,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function na(t,...e){return Jy(t,null,void 0)}const w_=nd("__translateVNode"),__=nd("__datetimeParts"),S_=nd("__numberParts"),DP=nd("__setPluralRules"),IP=nd("__injectWithOption"),T_=nd("__dispose");function dm(t){if(!zi(t)||hu(t))return t;for(const e in t)if(Al(t,e))if(!e.includes("."))zi(t[e])&&dm(t[e]);else{const n=e.split("."),i=n.length-1;let r=t,s=!1;for(let o=0;o{if("locale"in u&&"resource"in u){const{locale:d,resource:h}=u;d?(o[d]=o[d]||rr(),Qy(h,o[d])):Qy(h,o)}else an(u)&&Qy(JSON.parse(u),o)}),r==null&&s)for(const u in o)Al(o,u)&&dm(o[u]);return o}function NV(t){return t.type}function OP(t,e,n){let i=zi(e.messages)?e.messages:rr();"__i18nGlobal"in n&&(i=E_(t.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const r=Object.keys(i);r.length&&r.forEach(s=>{t.mergeLocaleMessage(s,i[s])});{if(zi(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(zi(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function RP(t){return gt(Wf,null,t,0)}const LP=()=>[],FV=()=>!1;let MP=0;function NP(t){return(e,n,i,r)=>t(n,i,Vh()||void 0,r)}function x_(t={}){const{__root:e,__injectWithOption:n}=t,i=e===void 0,r=t.flatJson,s=Yy?lw:k3;let o=Fi(t.inheritLocale)?t.inheritLocale:!0;const u=s(e&&o?e.locale.value:an(t.locale)?t.locale:um),d=s(e&&o?e.fallbackLocale.value:an(t.fallbackLocale)||Gr(t.fallbackLocale)||pi(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:u.value),h=s(E_(u.value,t)),g=s(pi(t.datetimeFormats)?t.datetimeFormats:{[u.value]:{}}),y=s(pi(t.numberFormats)?t.numberFormats:{[u.value]:{}});let w=e?e.missingWarn:Fi(t.missingWarn)||Xh(t.missingWarn)?t.missingWarn:!0,C=e?e.fallbackWarn:Fi(t.fallbackWarn)||Xh(t.fallbackWarn)?t.fallbackWarn:!0,D=e?e.fallbackRoot:Fi(t.fallbackRoot)?t.fallbackRoot:!0,P=!!t.fallbackFormat,M=_r(t.missing)?t.missing:null,F=_r(t.missing)?NP(t.missing):null,K=_r(t.postTranslation)?t.postTranslation:null,$=e?e.warnHtmlMessage:Fi(t.warnHtmlMessage)?t.warnHtmlMessage:!0,ee=!!t.escapeParameter;const he=e?e.modifiers:pi(t.modifiers)?t.modifiers:{};let ve=t.pluralRules||e&&e.pluralRules,fe;fe=(()=>{i&&yP(null);const Ue={version:LV,locale:u.value,fallbackLocale:d.value,messages:h.value,modifiers:he,pluralRules:ve,missing:F===null?void 0:F,missingWarn:w,fallbackWarn:C,fallbackFormat:P,unresolving:!0,postTranslation:K===null?void 0:K,warnHtmlMessage:$,escapeParameter:ee,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};Ue.datetimeFormats=g.value,Ue.numberFormats=y.value,Ue.__datetimeFormatters=pi(fe)?fe.__datetimeFormatters:void 0,Ue.__numberFormatters=pi(fe)?fe.__numberFormatters:void 0;const We=bV(Ue);return i&&yP(We),We})(),cm(fe,u.value,d.value);function ae(){return[u.value,d.value,h.value,g.value,y.value]}const xe=$c({get:()=>u.value,set:Ue=>{u.value=Ue,fe.locale=u.value}}),Qe=$c({get:()=>d.value,set:Ue=>{d.value=Ue,fe.fallbackLocale=d.value,cm(fe,u.value,Ue)}}),ot=$c(()=>h.value),et=$c(()=>g.value),pt=$c(()=>y.value);function Wt(){return _r(K)?K:null}function pn(Ue){K=Ue,fe.postTranslation=Ue}function Ut(){return M}function Xt(Ue){Ue!==null&&(F=NP(Ue)),M=Ue,fe.missing=F}const cn=(Ue,We,rt,kt,Dt,tn)=>{ae();let dn;try{__INTLIFY_PROD_DEVTOOLS__,i||(fe.fallbackContext=e?vV():void 0),dn=Ue(fe)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(fe.fallbackContext=void 0)}if(rt!=="translate exists"&&is(dn)&&dn===tv||rt==="translate exists"&&!dn){const[te,Z]=We();return e&&D?kt(e):Dt(te)}else{if(tn(dn))return dn;throw na(No.UNEXPECTED_RETURN_TYPE)}};function ai(...Ue){return cn(We=>Reflect.apply(AP,null,[We,...Ue]),()=>b_(...Ue),"translate",We=>Reflect.apply(We.t,We,[...Ue]),We=>We,We=>an(We))}function Qt(...Ue){const[We,rt,kt]=Ue;if(kt&&!zi(kt))throw na(No.INVALID_ARGUMENT);return ai(We,rt,Ss({resolvedMessage:!0},kt||{}))}function xn(...Ue){return cn(We=>Reflect.apply(bP,null,[We,...Ue]),()=>y_(...Ue),"datetime format",We=>Reflect.apply(We.d,We,[...Ue]),()=>dP,We=>an(We))}function ii(...Ue){return cn(We=>Reflect.apply(SP,null,[We,...Ue]),()=>v_(...Ue),"number format",We=>Reflect.apply(We.n,We,[...Ue]),()=>dP,We=>an(We))}function Zn(Ue){return Ue.map(We=>an(We)||is(We)||Fi(We)?RP(String(We)):We)}const li={normalize:Zn,interpolate:Ue=>Ue,type:"vnode"};function Ft(...Ue){return cn(We=>{let rt;const kt=We;try{kt.processor=li,rt=Reflect.apply(AP,null,[kt,...Ue])}finally{kt.processor=null}return rt},()=>b_(...Ue),"translate",We=>We[w_](...Ue),We=>[RP(We)],We=>Gr(We))}function ui(...Ue){return cn(We=>Reflect.apply(SP,null,[We,...Ue]),()=>v_(...Ue),"number format",We=>We[S_](...Ue),LP,We=>an(We)||Gr(We))}function or(...Ue){return cn(We=>Reflect.apply(bP,null,[We,...Ue]),()=>y_(...Ue),"datetime format",We=>We[__](...Ue),LP,We=>an(We)||Gr(We))}function ji(Ue){ve=Ue,fe.pluralRules=ve}function Vi(Ue,We){return cn(()=>{if(!Ue)return!1;const rt=an(We)?We:u.value,kt=Fe(rt),Dt=fe.messageResolver(kt,Ue);return hu(Dt)||kl(Dt)||an(Dt)},()=>[Ue],"translate exists",rt=>Reflect.apply(rt.te,rt,[Ue,We]),FV,rt=>Fi(rt))}function Hn(Ue){let We=null;const rt=lP(fe,d.value,u.value);for(let kt=0;kt{o&&(u.value=Ue,fe.locale=Ue,cm(fe,u.value,d.value))}),Kd(e.fallbackLocale,Ue=>{o&&(d.value=Ue,fe.fallbackLocale=Ue,cm(fe,u.value,d.value))}));const Ge={id:MP,locale:xe,fallbackLocale:Qe,get inheritLocale(){return o},set inheritLocale(Ue){o=Ue,Ue&&e&&(u.value=e.locale.value,d.value=e.fallbackLocale.value,cm(fe,u.value,d.value))},get availableLocales(){return Object.keys(h.value).sort()},messages:ot,get modifiers(){return he},get pluralRules(){return ve||{}},get isGlobal(){return i},get missingWarn(){return w},set missingWarn(Ue){w=Ue,fe.missingWarn=w},get fallbackWarn(){return C},set fallbackWarn(Ue){C=Ue,fe.fallbackWarn=C},get fallbackRoot(){return D},set fallbackRoot(Ue){D=Ue},get fallbackFormat(){return P},set fallbackFormat(Ue){P=Ue,fe.fallbackFormat=P},get warnHtmlMessage(){return $},set warnHtmlMessage(Ue){$=Ue,fe.warnHtmlMessage=Ue},get escapeParameter(){return ee},set escapeParameter(Ue){ee=Ue,fe.escapeParameter=Ue},t:ai,getLocaleMessage:Fe,setLocaleMessage:Ke,mergeLocaleMessage:N,getPostTranslationHandler:Wt,setPostTranslationHandler:pn,getMissingHandler:Ut,setMissingHandler:Xt,[DP]:ji};return Ge.datetimeFormats=et,Ge.numberFormats=pt,Ge.rt=Qt,Ge.te=Vi,Ge.tm=Ur,Ge.d=xn,Ge.n=ii,Ge.getDateTimeFormat=ce,Ge.setDateTimeFormat=Re,Ge.mergeDateTimeFormat=Ye,Ge.getNumberFormat=re,Ge.setNumberFormat=ge,Ge.mergeNumberFormat=Ce,Ge[IP]=n,Ge[w_]=Ft,Ge[__]=or,Ge[S_]=ui,Ge}function BV(t){const e=an(t.locale)?t.locale:um,n=an(t.fallbackLocale)||Gr(t.fallbackLocale)||pi(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,i=_r(t.missing)?t.missing:void 0,r=Fi(t.silentTranslationWarn)||Xh(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=Fi(t.silentFallbackWarn)||Xh(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=Fi(t.fallbackRoot)?t.fallbackRoot:!0,u=!!t.formatFallbackMessages,d=pi(t.modifiers)?t.modifiers:{},h=t.pluralizationRules,g=_r(t.postTranslation)?t.postTranslation:void 0,y=an(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,w=!!t.escapeParameterHtml,C=Fi(t.sync)?t.sync:!0;let D=t.messages;if(pi(t.sharedMessages)){const he=t.sharedMessages;D=Object.keys(he).reduce((ve,fe)=>{const ae=ve[fe]||(ve[fe]={});return Ss(ae,he[fe]),ve},D||{})}const{__i18n:P,__root:M,__injectWithOption:F}=t,K=t.datetimeFormats,$=t.numberFormats,ee=t.flatJson;return{locale:e,fallbackLocale:n,messages:D,flatJson:ee,datetimeFormats:K,numberFormats:$,missing:i,missingWarn:r,fallbackWarn:s,fallbackRoot:o,fallbackFormat:u,modifiers:d,pluralRules:h,postTranslation:g,warnHtmlMessage:y,escapeParameter:w,messageResolver:t.messageResolver,inheritLocale:C,__i18n:P,__root:M,__injectWithOption:F}}function C_(t={}){const e=x_(BV(t)),{__extender:n}=t,i={id:e.id,get locale(){return e.locale.value},set locale(r){e.locale.value=r},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(r){e.fallbackLocale.value=r},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(r){e.setMissingHandler(r)},get silentTranslationWarn(){return Fi(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(r){e.missingWarn=Fi(r)?!r:r},get silentFallbackWarn(){return Fi(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(r){e.fallbackWarn=Fi(r)?!r:r},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(r){e.fallbackFormat=r},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(r){e.setPostTranslationHandler(r)},get sync(){return e.inheritLocale},set sync(r){e.inheritLocale=r},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){e.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(r){e.escapeParameter=r},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...r){return Reflect.apply(e.t,e,[...r])},rt(...r){return Reflect.apply(e.rt,e,[...r])},tc(...r){const[s,o,u]=r,d={plural:1};let h=null,g=null;if(!an(s))throw na(No.INVALID_ARGUMENT);const y=s;return an(o)?d.locale=o:is(o)?d.plural=o:Gr(o)?h=o:pi(o)&&(g=o),an(u)?d.locale=u:Gr(u)?h=u:pi(u)&&(g=u),Reflect.apply(e.t,e,[y,h||g||{},d])},te(r,s){return e.te(r,s)},tm(r){return e.tm(r)},getLocaleMessage(r){return e.getLocaleMessage(r)},setLocaleMessage(r,s){e.setLocaleMessage(r,s)},mergeLocaleMessage(r,s){e.mergeLocaleMessage(r,s)},d(...r){return Reflect.apply(e.d,e,[...r])},getDateTimeFormat(r){return e.getDateTimeFormat(r)},setDateTimeFormat(r,s){e.setDateTimeFormat(r,s)},mergeDateTimeFormat(r,s){e.mergeDateTimeFormat(r,s)},n(...r){return Reflect.apply(e.n,e,[...r])},getNumberFormat(r){return e.getNumberFormat(r)},setNumberFormat(r,s){e.setNumberFormat(r,s)},mergeNumberFormat(r,s){e.mergeNumberFormat(r,s)}};return i.__extender=n,i}function UV(t,e,n){return{beforeCreate(){const i=Vh();if(!i)throw na(No.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=e,this===this.$root)this.$i18n=FP(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=C_(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=FP(t,r);else{this.$i18n=C_({__i18n:r.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;r.__i18nGlobal&&OP(e,r,r),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=Vh();if(!i)throw na(No.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),n.__deleteInstance(i),delete this.$i18n}}}function FP(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[DP](e.pluralizationRules||t.pluralizationRules);const n=E_(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(i=>t.mergeLocaleMessage(i,n[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>t.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>t.mergeNumberFormat(i,e.numberFormats[i])),t}const A_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function HV({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((n,i)=>[...n,...i.type===xt?i.children:[i]],[]):e.reduce((n,i)=>{const r=t[i];return r&&(n[i]=r()),n},rr())}function BP(){return xt}const zV=fw({name:"i18n-t",props:Ss({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>is(t)||!isNaN(t)}},A_),setup(t,e){const{slots:n,attrs:i}=e,r=t.i18n||k_({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(y=>y!=="_"),o=rr();t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=an(t.plural)?+t.plural:t.plural);const u=HV(e,s),d=r[w_](t.keypath,u,o),h=Ss(rr(),i),g=an(t.tag)||zi(t.tag)?t.tag:BP();return Iw(g,h,d)}}}),UP=zV;function jV(t){return Gr(t)&&!an(t[0])}function HP(t,e,n,i){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let u=rr();t.locale&&(o.locale=t.locale),an(t.format)?o.key=t.format:zi(t.format)&&(an(t.format.key)&&(o.key=t.format.key),u=Object.keys(t.format).reduce((w,C)=>n.includes(C)?Ss(rr(),w,{[C]:t.format[C]}):w,rr()));const d=i(t.value,o,u);let h=[o.key];Gr(d)?h=d.map((w,C)=>{const D=r[w.type],P=D?D({[w.type]:w.value,index:C,parts:d}):[w.value];return jV(P)&&(P[0].key=`${w.type}-${C}`),P}):an(d)&&(h=[d]);const g=Ss(rr(),s),y=an(t.tag)||zi(t.tag)?t.tag:BP();return Iw(y,g,h)}}const VV=fw({name:"i18n-n",props:Ss({value:{type:Number,required:!0},format:{type:[String,Object]}},A_),setup(t,e){const n=t.i18n||k_({useScope:t.scope,__useComponent:!0});return HP(t,e,TP,(...i)=>n[S_](...i))}}),zP=VV,WV=fw({name:"i18n-d",props:Ss({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},A_),setup(t,e){const n=t.i18n||k_({useScope:t.scope,__useComponent:!0});return HP(t,e,wP,(...i)=>n[__](...i))}}),jP=WV;function qV(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const i=n.__getInstance(e);return i!=null?i.__composer:t.global.__composer}}function GV(t){const e=n=>{const{instance:i,value:r}=n;if(!i||!i.$)throw na(No.UNEXPECTED_ERROR);const s=qV(t,i.$),o=VP(r);return[Reflect.apply(s.t,s,[...WP(o)]),s]};return{created:(n,i)=>{const[r,s]=e(i);Yy&&t.global===s&&(n.__i18nWatcher=Kd(s.locale,()=>{i.instance&&i.instance.$forceUpdate()})),n.__composer=s,n.textContent=r},unmounted:n=>{Yy&&n.__i18nWatcher&&(n.__i18nWatcher(),n.__i18nWatcher=void 0,delete n.__i18nWatcher),n.__composer&&(n.__composer=void 0,delete n.__composer)},beforeUpdate:(n,{value:i})=>{if(n.__composer){const r=n.__composer,s=VP(i);n.textContent=Reflect.apply(r.t,r,[...WP(s)])}},getSSRProps:n=>{const[i]=e(n);return{textContent:i}}}}function VP(t){if(an(t))return{path:t};if(pi(t)){if(!("path"in t))throw na(No.REQUIRED_VALUE,"path");return t}else throw na(No.INVALID_VALUE)}function WP(t){const{path:e,locale:n,args:i,choice:r,plural:s}=t,o={},u=i||{};return an(n)&&(o.locale=n),is(r)&&(o.plural=r),is(s)&&(o.plural=s),[e,u,o]}function KV(t,e,...n){const i=pi(n[0])?n[0]:{};(!Fi(i.globalInstall)||i.globalInstall)&&([UP.name,"I18nT"].forEach(r=>t.component(r,UP)),[zP.name,"I18nN"].forEach(r=>t.component(r,zP)),[jP.name,"I18nD"].forEach(r=>t.component(r,jP))),t.directive("t",GV(e))}const YV=nd("global-vue-i18n");function XV(t={},e){const n=__VUE_I18N_LEGACY_API__&&Fi(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,i=Fi(t.globalInjection)?t.globalInjection:!0,r=new Map,[s,o]=ZV(t,n),u=nd("");function d(w){return r.get(w)||null}function h(w,C){r.set(w,C)}function g(w){r.delete(w)}const y={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},async install(w,...C){if(w.__VUE_I18N_SYMBOL__=u,w.provide(w.__VUE_I18N_SYMBOL__,y),pi(C[0])){const M=C[0];y.__composerExtend=M.__composerExtend,y.__vueI18nExtend=M.__vueI18nExtend}let D=null;!n&&i&&(D=rW(w,y.global)),__VUE_I18N_FULL_INSTALL__&&KV(w,y,...C),__VUE_I18N_LEGACY_API__&&n&&w.mixin(UV(o,o.__composer,y));const P=w.unmount;w.unmount=()=>{D&&D(),y.dispose(),P()}},get global(){return o},dispose(){s.stop()},__instances:r,__getInstance:d,__setInstance:h,__deleteInstance:g};return y}function k_(t={}){const e=Vh();if(e==null)throw na(No.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw na(No.NOT_INSTALLED);const n=QV(e),i=$V(n),r=NV(e),s=JV(t,r);if(s==="global")return OP(i,t,r),i;if(s==="parent"){let d=eW(n,e,t.__useComponent);return d==null&&(d=i),d}const o=n;let u=o.__getInstance(e);if(u==null){const d=Ss({},t);"__i18n"in r&&(d.__i18n=r.__i18n),i&&(d.__root=i),u=x_(d),o.__composerExtend&&(u[T_]=o.__composerExtend(u)),nW(o,e,u),o.__setInstance(e,u)}return u}function ZV(t,e,n){const i=X0(),r=__VUE_I18N_LEGACY_API__&&e?i.run(()=>C_(t)):i.run(()=>x_(t));if(r==null)throw na(No.UNEXPECTED_ERROR);return[i,r]}function QV(t){const e=jh(t.isCE?YV:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw na(t.isCE?No.NOT_INSTALLED_WITH_PROVIDE:No.UNEXPECTED_ERROR);return e}function JV(t,e){return Xy(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function $V(t){return t.mode==="composition"?t.global:t.global.__composer}function eW(t,e,n=!1){let i=null;const r=e.root;let s=tW(e,n);for(;s!=null;){const o=t;if(t.mode==="composition")i=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const u=o.__getInstance(s);u!=null&&(i=u.__composer,n&&i&&!i[IP]&&(i=null))}if(i!=null||r===s)break;s=s.parent}return i}function tW(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function nW(t,e,n){mw(()=>{},e),gw(()=>{const i=n;t.__deleteInstance(e);const r=i[T_];r&&(r(),delete i[T_])},e)}const iW=["locale","fallbackLocale","availableLocales"],qP=["t","rt","d","n","tm","te"];function rW(t,e){const n=Object.create(null);return iW.forEach(i=>{const r=Object.getOwnPropertyDescriptor(e,i);if(!r)throw na(No.UNEXPECTED_ERROR);const s=Mr(r.value)?{get(){return r.value.value},set(o){r.value.value=o}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,i,s)}),t.config.globalProperties.$i18n=n,qP.forEach(i=>{const r=Object.getOwnPropertyDescriptor(e,i);if(!r||!r.value)throw na(No.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${i}`,r)}),()=>{delete t.config.globalProperties.$i18n,qP.forEach(i=>{delete t.config.globalProperties[`$${i}`]})}}if(MV(),mV(Zj),gV(hV),yV(lP),__INTLIFY_PROD_DEVTOOLS__){const t=eh();t.__INTLIFY__=!0,Qj(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const sW={ui:{collection:"Collection",currentlyViewing:"Currently Viewing",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",index:"Index",image:"Image",images:"Images",annotation:"Annotation",annotations:"Annotations",allAnnotations:"All Annotations",noAnnotations:"No Annotations",about:"About",settings:"Settings",preference:"Preference",language:"Language",allLanguages:"All Languages",annotationFilters:"Annotation Filters",show:"Show",lineColor:"Line Color",allLineColors:"All Line Colors",lineWeight:"Line Weight",allLineWeights:"All Line Weights",display:"Display",light:"Light",informationPanel:"Information Panel",tableColumns:"Table Columns",title:"Title",description:"Description",links:"Links",tags:"Tags",notes:"Notes",attribution:"Attribution",date:"Date",comments:"Comments",canvasInformation:"Canvas Information",search:"Search",thumbnail:"Thumbnail",label:"Label",items:"Items",structures:"Structures",dropManifests:"Drop manifests here",summary:"Summary",rights:"Rights",altRepresentation:"Alternative Representation",homepage:"Homepage",seeAlso:"See Also",provider:"Provider",details:"Details",close:"Close"},message:{invalidImage:"Missing/Unsupported Image",noResults:"No results found.",noAnnotations:"No annotations available"}},oW={ui:{collection:"Sammlung",currentlyViewing:"Aktuell angezeigt",fullscreen:"Vollbild",exitFullscreen:"Vollbildmodus beenden",index:"Index",image:"Bild",images:"Bilder",annotation:"Annotation",annotations:"Annotationen",allAnnotations:"Alle Annotationen",noAnnotations:"Keine Annotationen",about:"Über",settings:"Einstellungen",preference:"Präferenz",language:"Sprache",allLanguages:"Alle Sprachen",annotationFilters:"Anmerkungsfilter",show:"Anzeigen",lineColor:"Linienfarbe",allLineColors:"Alle Linienfarben",lineWeight:"Linienhelligkeit",allLineWeights:"Alle Linienhelligkeiten",display:"Anzeige",light:"Licht",informationPanel:"Informationspanel",tableColumns:"Tabellenspalten",title:"Titel",description:"Beschreibung",links:"Links",tags:"Tags",notes:"Notizen",attribution:"Zuschreibung",date:"Datum",comments:"Kommentare",canvasInformation:"Canvas-Informationen",search:"Suche",thumbnail:"Miniaturbild",label:"Label",items:"Elemente",structures:"Strukturen",dropManifests:"Manifests hier ablegen",summary:"Zusammenfassung",rights:"Rechte",altRepresentation:"Alternative Darstellung",homepage:"Startseite",seeAlso:"Siehe auch",provider:"Anbieter",details:"Details",close:"Schließen"},message:{invalidImage:"Fehlendes/nicht unterstütztes Bild",noResults:"Keine Ergebnisse gefunden.",noAnnotations:"Keine Annotationen verfügbar"}},aW={ui:{collection:"Colección",currentlyViewing:"Viendo actualmente",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",index:"Índice",image:"Imagen",images:"Imágenes",annotation:"Anotación",annotations:"Anotaciones",allAnnotations:"Todas las anotaciones",noAnnotations:"No hay anotaciones",about:"Acerca de",settings:"Configuración",preference:"Preferencia",language:"Idioma",allLanguages:"Todos los idiomas",annotationFilters:"Filtros de anotación",show:"Mostrar",lineColor:"Color de línea",allLineColors:"Todos los colores de línea",lineWeight:"Luminosidad de línea",allLineWeights:"Todas las luminosidades de línea",display:"Visualización",light:"Luz",informationPanel:"Panel de información",tableColumns:"Columnas de la tabla",title:"Título",description:"Descripción",links:"Enlaces",tags:"Etiquetas",notes:"Notas",attribution:"Atribución",date:"Fecha",comments:"Comentarios",canvasInformation:"Información del lienzo",search:"Buscar",thumbnail:"Miniatura",label:"Etiqueta",items:"Elementos",structures:"Estructuras",dropManifests:"Suelta los manifests aquí",summary:"Resumen",rights:"Derechos",altRepresentation:"Representación alternativa",homepage:"Página principal",seeAlso:"Ver también",provider:"Proveedor",details:"Detalles",close:"Cerrar"},message:{invalidImage:"Imagen faltante/no compatible",noResults:"No se encontraron resultados.",noAnnotations:"No hay anotaciones disponibles"}},lW={ui:{collection:"Collection",currentlyViewing:"Actuellement en affichage",fullscreen:"Plein écran",exitFullscreen:"Quitter le plein écran",index:"Index",image:"Image",images:"Images",annotation:"Annotation",annotations:"Annotations",allAnnotations:"Toutes les annotations",noAnnotations:"Aucune annotation",about:"À propos",settings:"Paramètres",preference:"Préférence",language:"Langue",allLanguages:"Toutes les langues",annotationFilters:"Filtres d’annotation",show:"Afficher",lineColor:"Couleur du trait",allLineColors:"Toutes les couleurs de trait",lineWeight:"Luminosité du trait",allLineWeights:"Toutes les luminosités de trait",display:"Affichage",light:"Lumière",informationPanel:"Panneau d’information",tableColumns:"Colonnes du tableau",title:"Titre",description:"Description",links:"Liens",tags:"Étiquettes",notes:"Notes",attribution:"Attribution",date:"Date",comments:"Commentaires",canvasInformation:"Informations sur le canevas",search:"Recherche",thumbnail:"Vignette",label:"Étiquette",items:"Éléments",structures:"Structures",dropManifests:"Déposez les manifests ici",summary:"Résumé",rights:"Droits",altRepresentation:"Représentation alternative",homepage:"Page d’accueil",seeAlso:"Voir aussi",provider:"Fournisseur",details:"Détails",close:"Fermer"},message:{invalidImage:"Image manquante/non prise en charge",noResults:"Aucun résultat trouvé.",noAnnotations:"Aucune annotation disponible"}},uW={ui:{collection:"Collezione",currentlyViewing:"Attualmente in visualizzazione",fullscreen:"Schermo intero",exitFullscreen:"Esci da schermo intero",index:"Indice",image:"Immagine",images:"Immagini",annotation:"Annotazione",annotations:"Annotazioni",allAnnotations:"Tutte le annotazioni",noAnnotations:"Nessuna annotazione",about:"Informazioni",settings:"Impostazioni",preference:"Preferenza",language:"Lingua",allLanguages:"Tutte le lingue",annotationFilters:"Filtri annotazioni",show:"Mostra",lineColor:"Colore della linea",allLineColors:"Tutti i colori della linea",lineWeight:"Luminosità della linea",allLineWeights:"Tutte le luminosità della linea",display:"Visualizzazione",light:"Luce",informationPanel:"Pannello informazioni",tableColumns:"Colonne della tabella",title:"Titolo",description:"Descrizione",links:"Collegamenti",tags:"Tag",notes:"Note",attribution:"Attribuzione",date:"Data",comments:"Commenti",canvasInformation:"Informazioni sulla tela",search:"Cerca",thumbnail:"Miniatura",label:"Etichetta",items:"Elementi",structures:"Strutture",dropManifests:"Trascina i manifests qui",summary:"Riepilogo",rights:"Diritti",altRepresentation:"Rappresentazione alternativa",homepage:"Pagina principale",seeAlso:"Vedi anche",provider:"Fornitore",details:"Dettagli",close:"Chiudi"},message:{invalidImage:"Immagine mancante/non supportata",noResults:"Nessun risultato trovato.",noAnnotations:"Nessuna annotazione disponibile"}},cW={ui:{collection:"Collectie",currentlyViewing:"Momenteel bekeken",fullscreen:"Volledig scherm",exitFullscreen:"Volledig scherm afsluiten",index:"Index",image:"Afbeelding",images:"Afbeeldingen",annotation:"Annotatie",annotations:"Annotaties",allAnnotations:"Alle annotaties",noAnnotations:"Geen annotaties",about:"Over",settings:"Instellingen",preference:"Voorkeur",language:"Taal",allLanguages:"Alle talen",annotationFilters:"Annotatiefilters",show:"Weergeven",lineColor:"Lijnkleur",allLineColors:"Alle lijnkleuren",lineWeight:"Lijnhelderheid",allLineWeights:"Alle lijnhelderheden",display:"Weergave",light:"Licht",informationPanel:"Informatiepaneel",tableColumns:"Tabelkolommen",title:"Titel",description:"Beschrijving",links:"Links",tags:"Tags",notes:"Notities",attribution:"Toeschrijving",date:"Datum",comments:"Opmerkingen",canvasInformation:"Canvasinformatie",search:"Zoeken",thumbnail:"Miniatuur",label:"Label",items:"Items",structures:"Structuren",dropManifests:"Sleep manifests hierheen",summary:"Samenvatting",rights:"Rechten",altRepresentation:"Alternatieve weergave",homepage:"Startpagina",seeAlso:"Zie ook",provider:"Provider",details:"Details",close:"Sluiten"},message:{invalidImage:"Ontbrekende/niet-ondersteunde afbeelding",noResults:"Geen resultaten gevonden.",noAnnotations:"Geen annotaties beschikbaar"}},dW={ui:{collection:"合集",currentlyViewing:"當前查看",fullscreen:"全螢幕",exitFullscreen:"退出全螢幕",index:"索引",image:"圖像",images:"圖像集",annotation:"標註",annotations:"標註集",allAnnotations:"所有標註",noAnnotations:"無標註",about:"關於",settings:"設定",preference:"偏好",language:"語言",allLanguages:"所有語言",annotationFilters:"標註篩選",show:"顯示",lineColor:"線條顏色",allLineColors:"所有線條顏色",lineWeight:"線條亮度",allLineWeights:"所有線條亮度",display:"顯示",light:"亮度",informationPanel:"資訊面板",tableColumns:"表格欄位",title:"標題",description:"描述",links:"連結",tags:"標籤",notes:"備註",attribution:"歸屬",date:"日期",comments:"評論",canvasInformation:"畫布資訊",search:"搜尋",thumbnail:"縮圖",label:"標籤",items:"項目",structures:"結構",dropManifests:"將 manifests 拖放到此處",summary:"摘要",rights:"權限",altRepresentation:"替代表示",homepage:"首頁",seeAlso:"另見",provider:"提供方",details:"詳細資訊",close:"關閉"},message:{invalidImage:"缺少/不支援的圖像",noResults:"未找到結果。",noAnnotations:"暫無標註"}},hW={ui:{collection:"Samling",currentlyViewing:"Aktuelt vises",fullscreen:"Fuld skærm",exitFullscreen:"Forlad fuld skærm",index:"Indeks",image:"Billede",images:"Billeder",annotation:"Annotation",annotations:"Annotationer",allAnnotations:"Alle annotationer",noAnnotations:"Ingen annotationer",about:"Om",settings:"Indstillinger",preference:"Præference",language:"Sprog",allLanguages:"Alle sprog",annotationFilters:"Annotationsfiltre",show:"Vis",lineColor:"Linjefarve",allLineColors:"Alle linjefarver",lineWeight:"Linjelysstyrke",allLineWeights:"Alle linjelysstyrker",display:"Visning",light:"Lys",informationPanel:"Informationspanel",tableColumns:"Tabelkolonner",title:"Titel",description:"Beskrivelse",links:"Links",tags:"Tags",notes:"Noter",attribution:"Attribution",date:"Dato",comments:"Kommentarer",canvasInformation:"Canvas-information",search:"Søg",thumbnail:"Miniaturebillede",label:"Etiket",items:"Elementer",structures:"Strukturer",dropManifests:"Træk manifests her",summary:"Resumé",rights:"Rettigheder",altRepresentation:"Alternativ repræsentation",homepage:"Hjemmeside",seeAlso:"Se også",provider:"Udbyder",details:"Detaljer",close:"Luk"},message:{invalidImage:"Manglende/ikke-understøttet billede",noResults:"Ingen resultater fundet.",noAnnotations:"Ingen annotationer tilgængelige"}},pW={ui:{collection:"Συλλογή",currentlyViewing:"Τρέχουσα προβολή",fullscreen:"Πλήρης οθόνη",exitFullscreen:"Έξοδος από την πλήρη οθόνη",index:"Ευρετήριο",image:"Εικόνα",images:"Εικόνες",annotation:"Σημείωση",annotations:"Σημειώσεις",allAnnotations:"Όλες οι σημειώσεις",noAnnotations:"Δεν υπάρχουν σημειώσεις",about:"Σχετικά",settings:"Ρυθμίσεις",preference:"Προτίμηση",language:"Γλώσσα",allLanguages:"Όλες οι γλώσσες",annotationFilters:"Φίλτρα σημειώσεων",show:"Εμφάνιση",lineColor:"Χρώμα γραμμής",allLineColors:"Όλα τα χρώματα γραμμής",lineWeight:"Φωτεινότητα γραμμής",allLineWeights:"Όλες οι φωτεινότητες γραμμής",display:"Εμφάνιση",light:"Φως",informationPanel:"Πίνακας πληροφοριών",tableColumns:"Στήλες πίνακα",title:"Τίτλος",description:"Περιγραφή",links:"Σύνδεσμοι",tags:"Ετικέτες",notes:"Σημειώσεις",attribution:"Αναφορά",date:"Ημερομηνία",comments:"Σχόλια",canvasInformation:"Πληροφορίες καμβά",search:"Αναζήτηση",thumbnail:"Μικρογραφία",label:"Ετικέτα",items:"Στοιχεία",structures:"Δομές",dropManifests:"Σύρετε τα manifests εδώ",summary:"Περίληψη",rights:"Δικαιώματα",altRepresentation:"Εναλλακτική αναπαράσταση",homepage:"Αρχική σελίδα",seeAlso:"Δείτε επίσης",provider:"Πάροχος",details:"Λεπτομέρειες",close:"Κλείσιμο"},message:{invalidImage:"Εικόνα που λείπει/μη υποστηριζόμενη",noResults:"Δεν βρέθηκαν αποτελέσματα.",noAnnotations:"Δεν υπάρχουν διαθέσιμες σημειώσεις"}},fW={ui:{collection:"Kokoelma",currentlyViewing:"Tällä hetkellä katsotaan",fullscreen:"Koko näyttö",exitFullscreen:"Poistu koko näytöstä",index:"Indeksi",image:"Kuva",images:"Kuvat",annotation:"Merkintä",annotations:"Merkinnät",allAnnotations:"Kaikki merkinnät",noAnnotations:"Ei merkintöjä",about:"Tietoja",settings:"Asetukset",preference:"Mieltymys",language:"Kieli",allLanguages:"Kaikki kielet",annotationFilters:"Merkintäsuodattimet",show:"Näytä",lineColor:"Viivan väri",allLineColors:"Kaikki viivavärit",lineWeight:"Viivan kirkkaus",allLineWeights:"Kaikki viivan kirkkaudet",display:"Näyttö",light:"Valo",informationPanel:"Tietopaneeli",tableColumns:"Taulukkoluokat",title:"Otsikko",description:"Kuvaus",links:"Linkit",tags:"Tunnisteet",notes:"Muistiinpanot",attribution:"Tekijänoikeudet",date:"Päivämäärä",comments:"Kommentit",canvasInformation:"Kangastiedot",search:"Haku",thumbnail:"Pikkukuva",label:"Tunniste",items:"Esineet",structures:"Rakenteet",dropManifests:"Vedä manifestit tähän",summary:"Yhteenveto",rights:"Oikeudet",altRepresentation:"Vaihtoehtoinen esitys",homepage:"Etusivu",seeAlso:"Katso myös",provider:"Toimittaja",details:"Yksityiskohdat",close:"Sulje"},message:{invalidImage:"Puuttuva/ei tuettu kuva",noResults:"Ei tuloksia.",noAnnotations:"Ei saatavilla olevia merkintöjä"}},mW={ui:{collection:"संग्रह",currentlyViewing:"वर्तमान में देख रहे हैं",fullscreen:"पूर्ण स्क्रीन",exitFullscreen:"पूर्ण स्क्रीन से बाहर जाएं",index:"सूची",image:"चित्र",images:"चित्र",annotation:"टिप्पणी",annotations:"टिप्पणियाँ",allAnnotations:"सभी टिप्पणियाँ",noAnnotations:"कोई टिप्पणियाँ नहीं",about:"के बारे में",settings:"सेटिंग्स",preference:"प्राथमिकता",language:"भाषा",allLanguages:"सभी भाषाएँ",annotationFilters:"टिप्पणी फ़िल्टर",show:"दिखाएं",lineColor:"लाइन का रंग",allLineColors:"सभी लाइन रंग",lineWeight:"लाइन की चमक",allLineWeights:"सभी लाइन चमक",display:"प्रदर्शन",light:"प्रकाश",informationPanel:"जानकारी पैनल",tableColumns:"तालिका कॉलम",title:"शीर्षक",description:"विवरण",links:"लिंक",tags:"टैग",notes:"नोट्स",attribution:"श्रेय",date:"तारीख",comments:"टिप्पणियाँ",canvasInformation:"कैनवास जानकारी",search:"खोज",thumbnail:"थंबनेल",label:"लेबल",items:"आइटम",structures:"संरचनाएँ",dropManifests:"यहाँ मैनिफेस्ट ड्रॉप करें",summary:"सारांश",rights:"अधिकार",altRepresentation:"वैकल्पिक प्रतिनिधित्व",homepage:"मुख्य पृष्ठ",seeAlso:"यह भी देखें",provider:"प्रदाता",details:"विवरण",close:"बंद करें"},message:{invalidImage:"गायब/असमर्थित चित्र",noResults:"कोई परिणाम नहीं मिला।",noAnnotations:"कोई टिप्पणियाँ उपलब्ध नहीं हैं"}},gW={ui:{collection:"コレクション",currentlyViewing:"現在表示中",fullscreen:"全画面表示",exitFullscreen:"全画面表示を終了",index:"インデックス",image:"画像",images:"画像",annotation:"注釈",annotations:"注釈",allAnnotations:"すべての注釈",noAnnotations:"注釈はありません",about:"について",settings:"設定",preference:"設定",language:"言語",allLanguages:"すべての言語",annotationFilters:"注釈フィルター",show:"表示",lineColor:"線の色",allLineColors:"すべての線の色",lineWeight:"線の明度",allLineWeights:"すべての線の明度",display:"表示",light:"ライト",informationPanel:"情報パネル",tableColumns:"テーブル列",title:"タイトル",description:"説明",links:"リンク",tags:"タグ",notes:"ノート",attribution:"帰属",date:"日付",comments:"コメント",canvasInformation:"キャンバス情報",search:"検索",thumbnail:"サムネイル",label:"ラベル",items:"アイテム",structures:"構造",dropManifests:"マニフェストをここにドロップ",summary:"概要",rights:"権利",altRepresentation:"代替表現",homepage:"ホームページ",seeAlso:"関連情報",provider:"提供者",details:"詳細",close:"閉じる"},message:{invalidImage:"画像がない/非対応の画像",noResults:"結果が見つかりませんでした。",noAnnotations:"利用可能な注釈はありません"}},yW={ui:{collection:"컬렉션",currentlyViewing:"현재 보기",fullscreen:"전체 화면",exitFullscreen:"전체 화면 종료",index:"목록",image:"이미지",images:"이미지들",annotation:"주석",annotations:"주석들",allAnnotations:"모든 주석",noAnnotations:"주석 없음",about:"소개",settings:"설정",preference:"기본 설정",language:"언어",allLanguages:"모든 언어",annotationFilters:"주석 필터",show:"표시",lineColor:"선 색상",allLineColors:"모든 선 색상",lineWeight:"선 밝기",allLineWeights:"모든 선 밝기",display:"디스플레이",light:"빛",informationPanel:"정보 패널",tableColumns:"테이블 열",title:"제목",description:"설명",links:"링크",tags:"태그",notes:"메모",attribution:"저작권 표시",date:"날짜",comments:"댓글",canvasInformation:"캔버스 정보",search:"검색",thumbnail:"썸네일",label:"라벨",items:"항목들",structures:"구조",dropManifests:"여기에 매니페스트를 드롭하세요",summary:"요약",rights:"권리",altRepresentation:"대체 표현",homepage:"홈페이지",seeAlso:"참고",provider:"제공자",details:"세부 사항",close:"닫기"},message:{invalidImage:"이미지 없음/지원되지 않는 이미지",noResults:"결과 없음",noAnnotations:"사용 가능한 주석이 없습니다"}},vW={ui:{collection:"Samling",currentlyViewing:"For øyeblikket vist",fullscreen:"Fullskjerm",exitFullscreen:"Gå ut av fullskjerm",index:"Indeks",image:"Bilde",images:"Bilder",annotation:"Merknad",annotations:"Merknader",allAnnotations:"Alle merknader",noAnnotations:"Ingen merknader",about:"Om",settings:"Innstillinger",preference:"Preferanse",language:"Språk",allLanguages:"Alle språk",annotationFilters:"Merknadsfiltre",show:"Vis",lineColor:"Linjefarge",allLineColors:"Alle linjefarger",lineWeight:"Lysstyrke på linje",allLineWeights:"Alle lysstyrker på linje",display:"Visning",light:"Lys",informationPanel:"Informasjonspanel",tableColumns:"Tabellkolonner",title:"Tittel",description:"Beskrivelse",links:"Lenker",tags:"Tagger",notes:"Notater",attribution:"Attribution",date:"Dato",comments:"Kommentarer",canvasInformation:"Canvasinformasjon",search:"Søk",thumbnail:"Miniatyrbilde",label:"Etikett",items:"Elementer",structures:"Strukturer",dropManifests:"Dra manifestene hit",summary:"Sammendrag",rights:"Rettigheter",altRepresentation:"Alternativ representasjon",homepage:"Hjemmeside",seeAlso:"Se også",provider:"Leverandør",details:"Detaljer",close:"Lukk"},message:{invalidImage:"Manglende/ikke støttet bilde",noResults:"Ingen resultater funnet.",noAnnotations:"Ingen merknader tilgjengelig"}},bW={ui:{collection:"Kolekcja",currentlyViewing:"Aktualnie oglądane",fullscreen:"Pełny ekran",exitFullscreen:"Wyjdź z pełnego ekranu",index:"Indeks",image:"Obraz",images:"Obrazy",annotation:"Adnotacja",annotations:"Adnotacje",allAnnotations:"Wszystkie adnotacje",noAnnotations:"Brak adnotacji",about:"O",settings:"Ustawienia",preference:"Preferencje",language:"Język",allLanguages:"Wszystkie języki",annotationFilters:"Filtry adnotacji",show:"Pokaż",lineColor:"Kolor linii",allLineColors:"Wszystkie kolory linii",lineWeight:"Jasność linii",allLineWeights:"Wszystkie jasności linii",display:"Wyświetlanie",light:"Światło",informationPanel:"Panel informacji",tableColumns:"Kolumny tabeli",title:"Tytuł",description:"Opis",links:"Linki",tags:"Tagi",notes:"Notatki",attribution:"Atrybucja",date:"Data",comments:"Komentarze",canvasInformation:"Informacje o płótnie",search:"Szukaj",thumbnail:"Miniatura",label:"Etykieta",items:"Elementy",structures:"Struktury",dropManifests:"Upuść manifests tutaj",summary:"Podsumowanie",rights:"Prawa",altRepresentation:"Alternatywne przedstawienie",homepage:"Strona główna",seeAlso:"Zobacz także",provider:"Dostawca",details:"Szczegóły",close:"Zamknij"},message:{invalidImage:"Brakujący/nieobsługiwany obraz",noResults:"Brak wyników.",noAnnotations:"Brak dostępnych adnotacji"}},wW={ui:{collection:"Coleção",currentlyViewing:"Visualizando atualmente",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",index:"Índice",image:"Imagem",images:"Imagens",annotation:"Anotação",annotations:"Anotações",allAnnotations:"Todas as anotações",noAnnotations:"Nenhuma anotação",about:"Sobre",settings:"Configurações",preference:"Preferência",language:"Idioma",allLanguages:"Todos os idiomas",annotationFilters:"Filtros de anotação",show:"Mostrar",lineColor:"Cor da linha",allLineColors:"Todas as cores de linha",lineWeight:"Luminosidade da linha",allLineWeights:"Todas as luminosidades de linha",display:"Exibição",light:"Luz",informationPanel:"Painel de informações",tableColumns:"Colunas da tabela",title:"Título",description:"Descrição",links:"Links",tags:"Tags",notes:"Notas",attribution:"Atribuição",date:"Data",comments:"Comentários",canvasInformation:"Informações da tela",search:"Pesquisar",thumbnail:"Miniatura",label:"Rótulo",items:"Itens",structures:"Estruturas",dropManifests:"Arraste os manifests aqui",summary:"Resumo",rights:"Direitos",altRepresentation:"Representação alternativa",homepage:"Página inicial",seeAlso:"Veja também",provider:"Fornecedor",details:"Detalhes",close:"Fechar"},message:{invalidImage:"Imagem ausente/não suportada",noResults:"Nenhum resultado encontrado.",noAnnotations:"Nenhuma anotação disponível"}},_W={ui:{collection:"Коллекция",currentlyViewing:"Просматривается в данный момент",fullscreen:"На весь экран",exitFullscreen:"Выход из полного экрана",index:"Индекс",image:"Изображение",images:"Изображения",annotation:"Аннотация",annotations:"Аннотации",allAnnotations:"Все аннотации",noAnnotations:"Нет аннотаций",about:"О программе",settings:"Настройки",preference:"Предпочтения",language:"Язык",allLanguages:"Все языки",annotationFilters:"Фильтры аннотаций",show:"Показать",lineColor:"Цвет линии",allLineColors:"Все цвета линий",lineWeight:"Яркость линии",allLineWeights:"Все яркости линий",display:"Отображение",light:"Освещение",informationPanel:"Информационная панель",tableColumns:"Столбцы таблицы",title:"Заголовок",description:"Описание",links:"Ссылки",tags:"Теги",notes:"Заметки",attribution:"Атрибуция",date:"Дата",comments:"Комментарии",canvasInformation:"Информация о холсте",search:"Поиск",thumbnail:"Миниатюра",label:"Метка",items:"Элементы",structures:"Структуры",dropManifests:"Перетащите манифесты сюда",summary:"Резюме",rights:"Права",altRepresentation:"Альтернативное представление",homepage:"Главная страница",seeAlso:"См. также",provider:"Поставщик",details:"Детали",close:"Закрыть"},message:{invalidImage:"Отсутствует/неподдерживаемое изображение",noResults:"Результатов не найдено.",noAnnotations:"Нет доступных аннотаций"}},SW={ui:{collection:"Samling",currentlyViewing:"För närvarande visning",fullscreen:"Helskärm",exitFullscreen:"Exit helskärm",index:"Index",image:"Bild",images:"Bilder",annotation:"Kommentar",annotations:"Kommentarer",allAnnotations:"Alla kommentarer",noAnnotations:"Inga kommentarer",about:"Om",settings:"Inställningar",preference:"Preferens",language:"Språk",allLanguages:"Alla språk",annotationFilters:"Kommentarfilter",show:"Visa",lineColor:"Linjekulör",allLineColors:"Alla linjekulörer",lineWeight:"Linjelys",allLineWeights:"Alla linjelys",display:"Visning",light:"Ljus",informationPanel:"Informationspanel",tableColumns:"Tabellkolumner",title:"Titel",description:"Beskrivning",links:"Länkar",tags:"Taggar",notes:"Anteckningar",attribution:"Attribuering",date:"Datum",comments:"Kommentarer",canvasInformation:"Canvasinformation",search:"Sök",thumbnail:"Miniatyrbild",label:"Etikett",items:"Föremål",structures:"Strukturer",dropManifests:"Släpp manifests här",summary:"Sammanfattning",rights:"Rättigheter",altRepresentation:"Alternativ representation",homepage:"Hemsida",seeAlso:"Se även",provider:"Leverantör",details:"Detaljer",close:"Stäng"},message:{invalidImage:"Saknad/icke-stödd bild",noResults:"Inga resultat hittades.",noAnnotations:"Inga kommentarer tillgängliga"}},TW={ui:{collection:"Bộ sưu tập",currentlyViewing:"Đang xem",fullscreen:"Toàn màn hình",exitFullscreen:"Thoát toàn màn hình",index:"Chỉ mục",image:"Hình ảnh",images:"Hình ảnh",annotation:"Chú thích",annotations:"Chú thích",allAnnotations:"Tất cả chú thích",noAnnotations:"Không có chú thích",about:"Giới thiệu",settings:"Cài đặt",preference:"Tùy chọn",language:"Ngôn ngữ",allLanguages:"Tất cả ngôn ngữ",annotationFilters:"Bộ lọc chú thích",show:"Hiển thị",lineColor:"Màu đường viền",allLineColors:"Tất cả màu đường viền",lineWeight:"Độ sáng đường viền",allLineWeights:"Tất cả độ sáng đường viền",display:"Hiển thị",light:"Ánh sáng",informationPanel:"Bảng thông tin",tableColumns:"Cột bảng",title:"Tiêu đề",description:"Mô tả",links:"Liên kết",tags:"Thẻ",notes:"Ghi chú",attribution:"Ghi nguồn",date:"Ngày",comments:"Bình luận",canvasInformation:"Thông tin về Canvas",search:"Tìm kiếm",thumbnail:"Hình thu nhỏ",label:"Nhãn",items:"Mục",structures:"Cấu trúc",dropManifests:"Kéo manifest vào đây",summary:"Tóm tắt",rights:"Quyền",altRepresentation:"Biểu diễn thay thế",homepage:"Trang chủ",seeAlso:"Xem thêm",provider:"Nhà cung cấp",details:"Chi tiết",close:"Đóng"},message:{invalidImage:"Thiếu/Ảnh không hỗ trợ",noResults:"Không tìm thấy kết quả.",noAnnotations:"Không có chú thích có sẵn"}},EW=XV({locale:localStorage.getItem("prefLang")||"en",fallbackLocale:"en",messages:{en:sW,de:oW,es:aW,fr:lW,it:uW,nl:cW,zh:dW,da:hW,el:pW,fi:fW,hi:mW,ja:gW,ko:yW,no:vW,pl:bW,pt:wW,ru:_W,sv:SW,vi:TW}}),xW="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAEvCAYAAACzLzNmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAADWmSURBVHhe7d0HXFXl/wfw51wue8oegrgAt+YEFNwrZ5lajjRnmf5alv0qG/5tmf3KpjNnmmmpGSoucCsqbhkiLmSJ7A33/O+5fi0t7uLuez/vV8jz/R5UwqsfznPOeR6O53kGAAAApk1E7wEAAMCEIdABAADMAAIdAADADOAaej1U1UhsSipqnGtqJdbV0jehZyMWVYmtRNVOduJia+l72QcCAADoCQJdRRXVtXa/n7z57NaTN587cjW7L7Xr1KeNX8yYyCarh3UK/JVaAAAAOoVAV0II8p8OpM76fs/VN3KLKn2prZJGXo5przzZauGo8OD1OGsHAABdQqArcD27uPm4r+P/TM8paU6temnZ0PX8mtlRwwM9HG9SCwAAQKsQ6HL8cfr2qFdWnVxVWlXjTC2NuDna5K2YGTm6ewufA9QCAADQGgR6HU6m5nZ/etGBAzUSXnbDm7bYWYvK9s4f2LG5n0sStQAAALQCj639Q8b9ssDJ3x3+TdthLqioljhIf+3fi8qrXakFAACgFQj0f3j75zPf3C+p8qJS665lFYct+PXcZ1QCAABoBQL9EWeu53WLPZcxnEqd2XA4bWpSRmFrKgEAADSGQH/EB78kfkFDnZLwzGrRtosfUAkAAKAxBDrJKazwTUjLjaBS52IvZAx5uMocAACAphDo5GhyTk/GOI5Knauu5W3P37jfiUoAAACNINDJsaRsaaDr19nreV1pCAAAoBEEOskuqPCjod7czS9rSEMAAACNINBJRn5pEA31Jr+4yoOGAAAAGsFKcaTda9szsovK/anUi35t/f9wsrMqySmu9I4M8YkPD/WO79TU4zg2clGfsIlOZbXErqqm1lb63lbY2tZaLKqytbaqELa2Fd7bikWV9OEAAGYHgU76fLg78fLtgvZU6sWY8Mard5+/M6ywrNqdWrLlYTs28zz+MOCfaOJxEkH0b7Hn7w7Zez5jyNn0vK7q/Lm1C3I/3amZ+/GnujX+uWMTjxPUBgAweQh0MnHJ4e2xFzKGUakXo8KD1245fmMilXWytuIqOzX1PCGEe0SI9Ay+mecxO+nZJh22OMKiPN/tujr3ek5JCLXqrUNjj5Mv9G7+3TPhweuoBQBgshDoZO7ahB/XHUqbQaVeDGgfsG3PuYwRVKpEbMVVdQj2SIiQBrwQ8l2aex1xsLEqo8NmqaC0qsFPB1NnrdifMjuvuNKb2loT6OGYPnNA2JfPdm+yyty/lgBgvhDo5M+zd56a8v2RrVTqRddmXodOXsuNorJerDhW0zbY48yDgPeKjwj1iTOnUDpyNbu3sL5+amZRS2rpTJsgt7OLn+86rW2jBmepBQBgMhDopLSyxil0zta8mlrehlo65WgjLra1EZXdL6nyoZZW/DPguzX3PuxkJy6mwyZD+rLkvtl15a1Pf7/wf8JSudTWOWEG5IuJXWaMjWy8mloAACYBgf6IGUuPbdyecGsslTolDYxVm46mv0Clzog4Vts6sME52TV4mqZ3sbcupMNGKb+0yn3W8mPrD1zKGkQtvRNuWPx0QqeX7G2syqkFAGDUEOiPuHWvNLj7u39eraqR2FFLJ6RnzEVvjWz37nsbzyyhlh7xfMuGbhciQh/cRS8N+bgGjjb36aDBZRWU+49fcmjnpVv5HahlMF2aeR5Z/5/oIcb+DRAAgACB/g8f/pq46Ic9yW9QqRPvP9P+jRf6hHybeD2vy4mUnKjjyTlRCWn3Isqqap3oQ/SI50P8XK5EhEkDPsQ7Pqql7z5DBfz9kiqPEZ/tjU/JLG5FLYNrH+x+attbfaIt+ckCADANCPR/EHZAe2bxwX0nUjS7WU2e3q19dwlnfSKOk1BLplbCW124mf+EEPDHknOiT6Xmdi8sr25Ah/Xo8YCPDPM56Olsm0sHdaakosb56S/27z9/I78ztYxG/7YBO1bN6v602IqroRYAgNFBoNfhXlGld/T7MRe1/YhUU2/n5F3v9e+qyhSu9I+FS8oobH0sJSf6QchnR+UVa/cGOlUJn3d4mDTcQ73jhID3drXLokNa839bzn/67e6rb1FpdD4a0+HV6f1Cv6ISAMDoINDluJ1X2uj5bw5tv3KnsB21NCJM3a6dHTVckzBMvlvUUgj3EynZUcdTcqOyCioC6JBeNfJyTBOuwQvX3yPDvA/6N3C4Q4fq5fDV7D6jFx+Mlb4SjXZvAeHu933zB3YMC3C9RC0AAKOCQFegvKrWfu66U0u3HL85gVr1Mj6q6bIvJnbW+qI1N3NLmgjBLrsOL327mVvalA7pVYCHw01hFTsh4KNb+e5VJ+CraiQ20fNjLqXnlDSnltFqG9TgzK53+3e1EnG11AIAMBoIdBUI17TfXJfw47Ws4jBqqaRlQ9fzwjPNwnrs1NKpnMIK36PJOT0fXodPzSxsIf0j5uiw3jwa8MKjco28nK7ToX9ZtP3SB4v/uPQ+lUYPU+8AYKwQ6GrYlnBrTPzlrP7xlzP73s0vr3O71SbeTilRrXz39Wrlt2dA+4Ad1DYI4Xnuh+EuvL98u6CdPhdpecjXzS6DbrCLEx6Va+rjnCL0hRmQdq9vu1tUXu0m+0ATINxPEL9gcGvcIAcAxgaBXk/SLxsn4XmR8CbUwl3rwpv0fNhov6DCneQnUnN6nEq51/1IUnbPs+l54XRIrzycbbIjQn0OtQ5skPjJ7xc+prbJ+GF6xLMjuwRtohIAwCgg0C2YsIf4ydTcHg+vw59Ju9e1upa3pcM65epgfT/A3eG2tm461KfwEK/439/s05NKAACjgECHv1TWSGz1tdiNNBTjpN9ImGgo8vzJT4Y2U3RvAACAviHQQS5dLnbTs6XvnrgrWQOoNDm4OQ4AjA0CHVQm3DegrcVu2gS5nbl4q6AjlSanf/uA7Wtf7qHWXvYAALqEQAeNpGUXh8im6GVvuVEZeWWN6JBcwvXzwrJqdypNkpujTV7S1095UgkAYHAIdNCqu/llDQ9dye77MOTrWuymb1v/nfsu3B1CpcnKWDZGjEVmAMBYINBBp+pa7OatEW3f+2zbxf+jDzFZ178b5eRgKy6lEgDAoBDooFfCYjfZBeV+Pd/fZfJroid9/ZS7m6NNPpUAAAZltJthgHkS9lo3l7Na6bfCel9WFwBAHgQ66F2thBfT0KQ9XCUQAMAY4B8k0DsrkXmsgy4s9UtDAACDQ6CD3pnLxiacbNYdAMA4INBB72zEVpU0NGk2YlEVDQEADA6BDnrnYGNVRkOTZmttVUFDAACDQ6CD3pnDXe7CSnFYVAYAjAkCHQxC2IKUhiapS3OvIzQEADAKCHQwiIhQnzgamqTuod4m/fkDgPlBoINBDOoQsI2GJojnB3ZouJ0KAACjgEAHg2gd1OBcU2/nZCpNSniI96EgT8d0KgEAjAICHQxmUu/mP9DQpIyParachgAARgOBDgYzPqrpMld7a5Pa3KSxt1Pq8M5Bv1AJAGA0EOhgMPY2VuUzB4R9SaVJmNk/7EtzWekOAMwLAh0M6qWBLRaZyrX01kENEsdHNcV0OwAYJQQ6GJStWFS56PnOM6g0akte6DoJi8kAgLFCoIPBRYR6x788sMVnVBqlj8Z0eLVlQ7cLVAIAGB2O57FhFBiHwQv3HjubnhdOpdHo3z5g+9qXe4ygEgDAKOEMHYzG+v9EDw31c7lEpVEID/GKWzYjYiyVAABGC4EORsPdySZvy9zefdsGNThDLYPq1NTj2JrZUSPssKsaAJgATLmD0SmrqnV4cfmxDXsSMww2zT0hqunSRRM7z6QSAMDoIdDBKElfltx3e67O/Xjr+Y8lPLOits6JrbiqLyZ2mTE2svFqagEAmAQEOhi1Eym5PeauS/gxNbOoJbV0pk2Q29nFz3ed1rZRg7PUAgAwGQh0MAk/xia/9vWfl9/OL63ypJbW+DewvzV7cMvPJvdq/j21AABMDgIdTMqGw9en/Ho8faL0zD2KWvXWq5Xf7qe6Nfr5mfDgddQCADBZCHQwSTmFFb67Eu+M2Hvu7pB9l+4+SW2FbK1F5dGt/GKHdwr6tV87/50u9taFdAgAwOQh0MEs7LuQOfhUak73Wp4T1UpqrRjPSTGJSMRJrESi2l6tffYI+5jThwMAmB0EOpiFD39NXPTDnuQ3qPyX+c+0n/vSgLAvqAQAMDtYWAYAAMAMINABAADMAAIdAADADOAaOpgFXEM3U/dvNWU5aS1YbloYX5LnzSpKnVkVvUnHHF+LkxIwK7zYtoq5N7zOtey3jYVE7aa2ShDoYBYQ6GYgK6ktu3WuG38rMZzdvdKBy0puR0cALBLfe9ZHXN//vE+lUvjuFgAMo6LYlZ3ZOplfNWUX/367YrZk2Hm2bf5S7uzvkxDmANIz7gPfzWdF2f5UKoVABwD9uhgzml87fQf7qGMB2/r2Ku7a4YFcdbkTHQWAR2VebU8jpRDoAKAfx9e9zH8WfZNtfOUXLiluKHUBQJGKElcaKYVABwDdOvLTq/zC8Cz2x4JvuMLMIOoCgCrcA6/TSCkEOgDoRuqR/vznPdNZzCdfcqV5PtQFABXxnsHJrGGbBCqVQqADgHYVZgby62f9xn56YQ9XcDeYugCgBj6w7Uluwg8jGCeSUEspPLYGZgGPrRmJ8zuf5X97Z5m2bnLj7V3uMyfPLObsLX0T3ntlcU5ef42ZSFxNHwpgHqysq2TT7MLrW00IdDALCHQDq6m047d/8B13ZusL1KkX3sE1jzWP2s2F9fqThUbHMDtnbHELoCJMuQOAZu6lh/BLhp6rb5jzPiEX+ejpn7LpP/fg3jnpzY1ZPJ61G7IRYQ6gHgQ6ANRfekIUv2R4InfvRih1VMY3jYhlL297gvvPzrbcgDfeZsGdjqhzvRAAHodAB4D6ubR7FL9y4j6upsKBOirhA9ueYDM2duemrB7A/FsmUhsANIRABwD1ndw4k/0851dOUmtNHaV4v5Zn2fPLnuRe3BLOGnU8Sm0A0BIEOgCo5+D377Lt7/9AlVK8Z3AKe+6bUdzsbR1ZaM8YagOAliHQAUB1pzbNYHu/WkCVUnyHEWu5V3e3YK0HbKUWAOgIAh0AVHN5z1P8tvkqnZnzwn8D577FPfP587jRDUA/EOgAoFz6qWj+5//8wjEm/U8x3sqmgpu4dCiLmvY5tQBADxDoAKBYQUYjfs30PzheIqaOXLyD2z3uxV8imbAwDADoFQIdAOST1Ij5tTO3c1VlztSRi/dqcoWbvf0J5t/qLLUAQI8Q6AAgF79z4VdcVnI7KuXiXbzvcDM2RjFXv9vUAgA9Q6ADQN2u7h/Gndgwiyq5eGu7Um7Kmn7MoUEetQDAABDoAPBvFcWu/OY311All3A3u2yLR6+mSdQCAANBoAPAv/C7Fn3KVRa7USkXN3DuPNYsch+VAGBACHQAeFxWchuWsGkGVXLx7Yb8jEfTAIwHAh0AHsNv+e9KZc+b8wGtT8sWjQEAo4FAB4C/CTfC3b3Ymao68SKram7cN6OYSFxDLQAwAgh0APgLf+C792goX/j4b5lbwE2qAMBIINAB4IEbCT24jEudqKoTb+NQxPV+WeXNWQBAfxDoACDDxy97i4Zycb1e+pjZu+ZTCQBGBIEOAIwVZQdwyfFPUlUn3tk7g0VO+opKADAyCHQAYOzcH8/RSC5uwGvvMLFNJZUAYGQQ6ADA+PM7nqVhnXjv5pdYh5FrqQQAI4RAB7B0+bcbc5lJHaiqExcx4VvGcTyVAGCEEOgAlu5S7FM0kq9F7x00AgAjhUAHsHD8jYQoGtaJ9w09z5y9M6kEACOFQAewdNeO96ZR3cJ676QRABgxBDqAJctKastVlztRVScurOefNAQAI4ZAB7Bk109F06hOvIPbPRbU4TiVAGDEEOgAFozPvNqehnUL7RlDIwAwcgh0AAvG5d1sSsM6cf6tztIQAIwcAh3AgvH37zShYd1cvO/SCACMHAIdwFLxEhFXlBVIVd0Q6AAmA4EOYKmKcvxpJB+ePwcwGQh0AEtVVarwcTUZN/+bNAIAI4dAB7BUVWUKA523dclnIqtaKgHAyCHQASxVZakzjerm4onpdgATgkAHsFSVis/QmbMPbogDMCEIdABLdetMJI3q5uh2n0YAYAIQ6ACW6EZCD/7wqlepqpukFv8+AJgQ/IUFsDRCmP80NYarrbGhDgCYAQQ6gCW5e/kJWZgr2WENAEwPAh3AUuSmhfErn9+LMAcwTwh0AEuQfyeYXz7hAFde5E4dADAzCHQAc1ec6ysL85J7ftQBADOEQAcwZ0KYr5CGeUFGY+oAgJlCoAOYq/LCBrIwz73egjqP4+i9PJJaaxoBgAlAoAOYo6oyR7Zy0l65YS7g6b08Jbk+NAIAE4BABzA3NVW2/OqpMezu5Y7UqZuyM/TiPAQ6gAlBoAOYE0mtFb9h1m/cjdNR1JFP2Rl6UXYAjQDABCDQAcyFEOabXt/AJccPpo5CfNexS2lYJ05SY6N0RzYAMBoIdABzwPOcLMwvxYyhjkJ8p9HLuSHvvkKlfCX3MO0OYCIQ6ABmgP/9vaUqh3nrwb9wIxfMYGLbCt7BLZfadUOgA5gMBDqAqdu96FPu9OZpVCkkC/Oxi8cxjntwBd0jKE32Xh4EOoDJQKADmLJ9Sz5gh5a/RZVCfGh0jCzMRVa11GLMvZHCQOfvXulAQwAwcgh0AFMVv3QeO/Dt+1QpxAd3OsSN++6px8JcoOwMPengkzQCACOHQAcwRQmbp7I9iz+hSiFZmE9aMZiJbSqp9RfOv2UiDevEZSZ1YKX5nlQCgBFDoAOYmosxo4Wb4KhSzL/VGVmY2ziUUudxwZ0P0Ui+q/uG0wgAjBgCHcCUJMcP4je9toFjvNK/u7xXk6tsyup+csNc4OB2n/cNPU9VnfikOEy7A5gABDqAqRDCfP2s3zheIqaOXLxbQDo3dV1vZu+aTy35mnSNo1HdUg/3Z7wE/1YAGDn8JQUwBTcSesjCvLbKjjpyycJ8mjTMnb2yqKUQF9ZrJw3rxFVXOLK0472pBAAjhUAHMHZ3Lz/B/zQ1RqUwd/LMlIV5g4Y3qKVc0/ADvK2LwjN5PjlOpeVkAcBwEOgAxiw3LYxf+fxerrrciTpy8fYu99UOcwEnkrAOQ3+mqm5nf38e67oDGDcEOoCxEsJ8+YQDXHmRO3Xk4q3tS7gpa/oxr6ZJ1FIL1/bJTTSsk/A58Ae+fY9KADBCCHQAY5R/J1gW5iX3/KgjlyzMJ68YzPxbnaWW+oI7HeFdfG9TVbejq19hBRmNqAIAI4NABzA2xbm+Koe5lU2FLMyDOx+mVr1x3Z77gYZ14iS11vzuLz6lEgCMDAIdwJiUFzbgV0jDvCCjMXXk4jlRDTf+u6e0EeYyEROX8LbOBVTVibvw51iG9d0BjBICHcBYVJU5spWT9nK511tQRy5ZmI/9chwLjd5FLc3ZOJRyPSb/jyq5+B0ffktDADAiCHQAYyANc3711Bh293JH6sjFM04iC/M2gzdTS3u6v7BYuCZPVZ24W4kR7NCKuVQCgJFAoAMYWk2VrRDm3I3TUdRRiBu5YIZOwlwgnKX3nfMBVXLxuxd9ylIODaQSAIwAAh3AkCS1VvyGWb+pGuZswOtvs86jV1ClG90n/4/3DE6mqk7CWvL8htm/snvpIdQCAANDoAMYCs9z/KbXN3DJ8aqtwtb75Q9Z9Azd32XOiSTcqM8mUyWXsNgNv2rKLlZZ4kItADAgBDqAgQhboHKXYsZQqVjUtM+YClPhWhPU4Tjf8elVVMnFFdxpwq+b9ZvwzQm1AMBAEOgABsDv+mwRd3rzNCoV4juNXs4Gzp1Hpd5wQ9/9D+/mr3QZWe768T58zMdfUgkABoJAB9C33Ys+5Q6vfIMqhYQwl90EZwg2jiXc+O+fokoh7uiaV9jxdS9TCQAGgEAH0Kf4pfPYoeVvUaUQ33rwL7Iw5zieWvrn3zKRjVwwnSrF/ljwDb9zwdfCjX7UAQA9QqAD6EvC5qlsz+JPqFKID42O4cYuHmfQMH+o85jlfJtBKj0mxx1bN4etmLAfO7MB6B8CHUAfpGEu3ARHlUJ8cKdD3LjvnmIiq1pqGRz3zKKJfKOOR6hU7MbpaH7J8LPYyAVAvxDoALp2MWa07I52xiv9+yYL80krBjOxTSW1jIP08+EmrxjEeze/RB2FuPxbzfivhyey9ATVnq8HAI1ZbKDnlVR6Hrma3fvPs3ee2nwsfeK6+LTpW47fGB9z9s7IY8k50fmlVUr3oAZQKjl+EL/ptQ2qhDnzb3VGFuY2DqXUMS7CTXJT1/bhXf1uUUchrrJIttEMO/PbJGoBgA5xPG/4S3T6UlFdaycN7hmbj12fePFWwRPUlqtDY48TE6ObLnu2e5OfqAVG6sNfExf9sCdZ7p3j859pP/elAWFfUKkfNxJ68Csnx3K1VXbUkYv3anKVm/lLJLN3zaeW8RL2al85cR93/05T6ijFNwnfxw16420W0OY0tQBAyywi0MsqaxzXxF2b+f2eq2/kFlX6Ultljbwc0155stXCUeHB662tRNXUBiMyb8OZb1cfTJ1F5b8Ir/KHK5842oiLXRysC53txYUNnGzvN/dzvRoe4n0oPNQr3r+Bwx36MM3cvfwEv/S5eGE1NerIxbsFpHMvbo5gzl5Z1DJ+pfe9+BUT93PZKW2ooxI+rOcf3MA35zHvZleoBQBaYvaBnlNY4Ttj6dFNx1Nyo6lVb33b+u/8YVr4OGd76yJqgYEIf65Hk3N6HkvK7nkyNad7cmZxK0VLlT0a6Ir4udnfCQ/ziosM9ZW+eccFezul0SHVCWG+8vm9XHmR0ss2sjCftq43a9BQ6QIuRqeqVFj6dTd362wkdVQi/bPgWevBm7kBr77LPBpdozYAaMisA/1sel6X5785tL0+Z+XyNPV2Tl4zJ2p4M19nhZtXgHYJAX7oSlZfWYgnZ/e8mVv62HSvssBWNdD/Se2Az00L438cc1SlMHfyzJSdmZtimD9UW23Db3h5K5d0cAh1VCZsA8uC2p/gWvbbxtoM2MIaBKbTIQCoB7MN9KLyatdBC2JPpuUUh1JLa7qFeB369fVefTH9rntVNRKbmMQ7I9cfSpt65GpWH+lLts5c1lWgP6pNkNvZcT2arXgmInido63433uGC9eWfxh9jCu550cduXh7l/uya+ZeTZOoZbp4iYjF/fg2v2/JhxwvqfeiMrxXkyusVf9tXIs+21lgu1PUBgAVmWWgS3heNP7r+J0HLmUNopbWTYhqunTRxM4zqQQdOHQlu+97G8/8LzmzqDW15NJHoD/k62aX8daItu+NiWy8RsRJzzIFxbm+sjAvyGgsqxWQhfmUNf2Yf6uz1DIPt893FbZU5YqyAqlTb7y1XansjN0j8DpzD7zOCWPpe9lbg4bpzNqunD4UAIhZBvrvp26NfXHZsY1U6swf8/pGdm7meYxK0JJzN+53+r+t5z85cjW7L7WU0megPxTq53JpwbMdX40KFF0SHs/icq+3oENy8db2JdyMn6PNLswfqixx4ff+b4FsxTgd4h09soWw50TiKmoBmA2es5JwDfxvMWExp86jV1BbKbML9MoaiW3EOzuTM/LKdL5KVaemHsd2vt1PrRuCQD7h2f+F0iDfcChtqvRVqdYaCYYIdIEbV8YO+K8p8q/OVLonOG9lU8FN+ak/C+58mFrm686FzvyWt1dxOalKZ1cAQD6+WeRe7gXpvxsqMLuFZXYk3BqtjzAXnE7Lizh8NbsPlVBPNbW8eNWB1Fnd3v4jdf2htOnqhrmhOHCV7Be3NUylMOdENdz4756yiDAXNGybwL3yZxs26M25vNiujLoAoCbu2tF+TMWbTs0u0PdeyHiShmqRTVTQ28OhKmLPZwylIdSDcFY+8Zv4Hf/9+cy3hWXVJrM6ny2rZhtc17N21pnUkU8W5mO/HMdCo3dRy3L0mPoFNy8+iO/10gLewTWPugCgjjsXO9FIIbMKdGkocwcvZg6kUn3CnKz0jd79leyKAv7ABQ1+Pwt39U5hmz4f7ErU5c2LumDFatlK100s3OYmdeQTHs2ShXmbwSrtVmaWHBrkcf1emc+9dTiQjfhoJu/Z2PTv7AfQI76y2JWGCplVoJdV1TgWV9So9D/+L3XtUqlCwAuPxdVKeOz/rKZNR9MnDVy45+Td/PIgapkEIcy/d9nK+tqmUkeJEQtmWnSYP0q4M73L2KXca3tasNnb27OoaZ/xrv7KvysCsHCypzxUYFaBXlktsaWh+nhZZCv2j4DnKdp/PX5jwt38sobSAlRw4FLmwDfXJfwg/fOyp5ZJ4JhEFubD7VTacIwtLOnLNlR0pAoe49fiPBs4dx73Vlwwm7k5XDYl798mgY4CABFupmWtB2yhUiGzustdWE2s7evblF/U1JFgL6drkWHecRGhPnFaXRfcjAhhPunbw79X1UiUbliiDuFVrOhbMmXHVfGF83Y23v4MVYp9UdKTfVHWW/g9JcJ6BeOjmi6nQ6BIRZEbSz3ajxeuGRZmBrHCrADpW0NVnu8HMDe8i/cd7ulPp7Dm3WOppZBZBfqdvLKgTm/tUHsKTzjT5jT+5/7fHg34Hi189nu72pnO5hs6cDI1t/sziw/u1XaYC3Qd6O84xrLZjkeoUuyb0u5sYenfT5kg1LWkutyBVZY6P/YmrFIHYG44kYS5+d1Sd1loswr0e0WV3q1f+z2bSqPTzNc5KTzEJy6yhTTkQ7zjLSngkzIKW4/4fH9cQWmVB7W0SpeBPtvhEHvHaR9Viq0v78jeKB5O1d+sOFbzy2u9BnRv4XOAWgAAWmVWgS6s3x4ye2sBlSoTvgR1rxCuW5YS8FkF5f4DPopNyC4q96eW1ukq0F+0P8red95DlWJCmM8tHir9veo+aRS2bf3znX4RYQGuql2EBwBQg1kFurCRR9DMzZVUqoe+DMK9cQbIdhlzDPiSihrnJxfGHlNlPXZjM87uNFvssoMqxbZXtGYzi0bJDfOHfFzs7+6Z37+zr5v9XWoBAGiFWQW6YNDCvScS0/O6UllvwlV1xiTSL5D0nSFO36UeDfjuYT4HPJ1tc+mQyXhv09mvlu9L+Q+VJmOY7UX2o8sWJqrrccZ/2FfZnD1f+ByrZao9vdi9hc++La/36kclAIBWmF2gL4m5Mu/j3y58QqVWPPgKGTrgeT7Uz/VyZJhPXESYd1y3EO9Dxh7wuxMzhk/67vA2Kk1GH5sUtsb1ZyamjdQUOV7ViI0tmMgqmTV1VPPRmA6vTu8X+hWVAAAaM7tAF26M6/bfP1JLKmqUrq9dXw8D3snOqtjHxS7zek5JiKylV8Yd8LfulQb3/XB3YlF5tRu1TIIQ5sIqcHZcDXXkE8J8XOF4Vsarv/yB2Iqr2vFW36gnmnicpBYAgEbMLtAFujhLr8sP0yOeHdklaNO94kqv48k50ceSc3oeTcrqmZJZ1FL/p/GPB7z0/cEGjjb36aDezVl5cvXm4+nPU2kQfqIi5iEqY86iClYisWV5vAO7Wyt/IcFu1jfYJre1KoX5+Wo/NrLghXqF+UMdGnuc3PVOv25UAgBoxCwDvaK61i56fsylm7mlTamlde2D3U/tfrd/ndfqhQ1HjlzN7m3IgJf+ZpKWgW4XIkKl4R7qE9c1xOuwvgI+Mf1+50ELY09RqTd+VkVsmM0lNsT2Mutsc5u6/3a12psdrWnC9lWGsLiqZrJeW/Fd9rvbKuYoUr69dkqNJxuWP5UVSL9B0NRXk7tOHhvZeDWVAAD1ZpaBLkjNLArr99HuMxXVEs3/1f0Hdyeb3L3zB3YMcHeQnxqPEAL+REpO1IOAz+555U5BW3MNeGFd+8Efxx4/fyO/M7V0zkNUyuY57GfP2Z9hVircxPYo4Uz7u7Lu7DPnnayBqJy68t2qdWND8qexHIkzdTQjvJZOfTqsqZOduJhaAAD1YraBLvjj9O1R0348+iuVWmEjFlVseaN33y7NPI9SS23C8/LSYO9lTAEvTNO72FsX0uF6+/3UrbEvLju2kUqde8H+JHvPKZbZc9XUqSfhr4GSPwEhzJ/On8xuSxpQRzteH9r6w7nDW39AJQBAvZh1oAtiz98dMuX7w1uqazW42Emc7cSFa2ZHDZeGYDy1tMIYAl7Esdo2ge6JES28ZEvVdm3udUTdgJe+lLiBC2JPnb91X6W9ezX1rmMse1nF5Vg1lV3rJDsz13aYC1ztrfPPLR4RYG9jpXyKAABADrMPdMGRpJxeLy07tiGnqMKPWmpr7O2U+tPLPUaG+bteppbOCAF/IiW3x7Hk7J7HknJ6Xrqd317Cq/iQs5bUJ+CFjVee+yp+F5U69anzDjbJ/jRVWlTHmXq+xF52zTy11os62ofH2ABAUxYR6ALhRrk1cdde/HbXlTdziyp9qa1UIy/HtDmDW30i3LhkJeJqqa1Xwmpr0rP3aGMP+JGf7487npIbTaXOvGR/hM13VmnzIY0JYT6m4Hl2oUZnq9bK+LrZZZz+bHiw2EqFW+wBAOpgMYH+qIRr9yLir2T1k01v3y5oV1he/dc8qoezTXabIPdzwmNfUS199rVr5K7afpl6ZIwBH+TpdCN6/p8XdX2poLt1GtvstlalFdw0VSqxZiMLpug8zB/6aVb3kYM6NDS5hXgAwDhYZKD/k3Dtl2e8NIk44QeT+4IIAX/qWm6kEO5Hk3N6XriR17GWZ2I6rBfCTXYSIeeF15MOM/285+fMR1RClYoevsbV/LyWloWz90sGUaV7/dsHbF/7co8RVAIAqAWBbobKqmodZI/JGTDgH76qtBnwLzocZe87qbbzWZ0Xw//+rOi9YrkSR9Yp73VWyevnSycWcdXnvhjR0NPFNodaAAAqQ6BbAGMM+LriVhFnroKd8VjMXET120yvTip8Eq8VDWc/V3SkSvdwcxwA1BcC3QIJAZ8gTNEL1+GlIZ94I69zTS1vQ4f1Q/qy44UfpOEuZKqybH3W7iz7n4uSy8sqBPTjlP+EQ5VN2OjCSVTp3rDOgb8smxE5lkoAAJUh0EH2BMDJVOExOeMN+KUuv7Dhdjp/YvBfhL8ebe69ye7xTtTRrQAPh5tnPhsWTCUAgMoQ6PAvQsCfSr3X/Whydk8h6E+k5EbRIb2SvTZlAc+zFM+PlUy3//NbAO2ZXDCW7apqSZXunfp0aOMgT8cbVAIAqASBDkoJAX86LS/8wY5y2T1Pp93rpo2V91TlzMpZqreyzfM0CHT6xkGe94sHsKXlkVTp3tcvdJ00JqLxGioBAFSCQAe1VdZIbIVn+YWA/+3kjefSc0qa0yGdCBbdYyc8l1ClfyvLurJ3Sp6kSvem9Q35esHYJ16hEgBAJSJ6D6AyW7GosnuY90FhQ5G+bf1jhG8JeWFiXDbQ7jeIwnV1L6syquTQ+LdU/Av4W2m8Z41ahJ0CaQgAoDIEOmhECB9hslq4zi2btZb+IItHykjN452TvkiV/Sqa/i6Kp+orJNY00o/ULAQ6AKgPgQ4aSblb2IKGf5HFI2XkX1FZ34CX/oRMZXuPK7j+rRIlswr5vD2N9CMjr6wRDQEAVIZAB40Ul1e70lAxDQI+o9ZVhZl8VX6l+inUc6ALJDyPv5sAoBb8owEaEe6Ap6F6/hnwUkIkCzdpPoxmYSScfNcyK3alRtkGeY/+SmpScoZ/WenvrX3SL4MG/0MAYIkQ6KARbT6+JiQYJw3Xv5Ps71FsVSiN9C+uSqc38dcJgQ4A6kKgg9F6NNFiK1UJdO1Pu8dVNmUlel40DwCgPhDoUG/6PItMrGnIzlUr25dc+HS0G+o/lXehkX7hGjoAqAv/aEC9PXxCTV8+LB1II0Xq+h6jfp/myaogtqfqXzfx64WI4yQ0BABQCQIdTMbxqmB2oLI+17PrN5Ewt2Q4jfRP398sAYDpQ6CDRqytOC1uUK7c68XDWJ7EgSrdeaNoKEup8aJK/xDoAKAuBDpoxN3RLo+GepEpcWXPFUxg5byYOtoXU9mCra/oTJVhcIxDoAOAWhDooBF/D4fbNNSb8zUBbEbhGKq0a09lKJtV9DRVhuFsJy7EGToAqAuBDhpp7uuSREO9Ep5L739/JsuWOFFHcz+WhbPnC8dJz/4N+5haMz9Xg3xNAcC0IdBBI838nA0WPhdq/NkAaaj/WanZneiZtS7SIH+OfVAyiDqGZahvkgDAtCHQQSPN/bQTPsL88sM3dWRJXNiUwmdZ9/uz2dbyNtRVTaHEjq0o78Z63J/D9lQazwZnhvwmCQBMFyesnQ1QX7fulQZ3mfdHOpVqe/Dqk/7Ic38tqS706rtijSNXyZ60vcKGSt+cuArqMlbBi9l9iQO7zzuw2xJ32SNwF2v86Khx2Tq3d6/IUO84KgEAVIJAB41F/vfPpLScYpUXW//7FScsNffv6NYk0E2d8Bjgte+ecbUVi/T6OCAAmD5MuYPGerf1201DhYSgfhDWD9aMrSvMBZYa5oLIMJ84hDkA1AcCHTQWoWR6+EGQS3+U/vcgrJVHtqVOHPVurdo3RwAA/4RAB41FtfTd52BjVUKlzIMQfxDkD8/GH14jV4U6H2s+eH5gh4bbqQAAUAsCHTTmaCsuGdIxaKswfhjkyqbVVWFpZ+kdGnueCvJ0rPcNhgBg2RDooBVhAa6XhCR/EOICDU+xH3xXYFFGdgnaREMAALXhLneot8oaie3WEzfGrdyfMvvy7YL21NaM9OXIS4PcwrKciUVc9bnFIwI8nW1zqQUAoBYEOqgt435Z4Nr4azPWxV+bfr+kSuMtyR5cZ3+weLmlBflDo8Mbr1kypeskKgEA1IZAB5UdS86JXrEvZc7uc3eGS3hmRW0NCK894aqPZb8GrThWc2ThkBaNvZ2uUQsAQG0IdFBI29PqsrNx6UuO5zS5Xc68DOsc+MuyGZFjqQQAqBcEOtQpp7DCd+WBlJe1Pa0O/7b//YHtWwW6nacSAKBeEOjwmDPX87qt2Jc054/Td0bVSHhramtAeH1hWl0eXDsHAG1BoIPWp9WFO7atxaKqsqpaR5yTy+doIy4+9fnQJh5OtveoBQBQbwh0C6btaXVvF7vMSb2a/zA+qunyo8k5PV9cdmwjHYI6/Peptm/PGdzyUyoBADSCQLdA2p5Wbx/sfmpa39AlwzoHbra2ElVTmz2z+EDs4as5/aiERzT3c7lyeMHgVlQCAGgMgW4hdDGtPrRTwy0z+rf4Uhrop6n9mNyiCp9BC2NP3MkrC6YWSNlZi8r2zh/YURrqSdQCANAYAt3MaXta3d3JJndCdLNlU3qHfOvtapdFbbkS0+93HvrJ3qPaucHOPHw1uevksZGNV1MJAKAVCHQzde7G/U5LY6++pu1p9SGdAreou1/3iv0ps9/deHYJlRZtQlSzHxdN7PQilQAAWoNANyPCtPrO07dHLd+XPEca6F2oXW+qTKur6r1NZ79avi/lP1RapL5t/XeuntVjpNiKq6EWAIDWINDNgKGn1VUh4XnRrOXH1v9+6vaz1LIo4SFecRtf7TnIztqqgloAAFqFQDdh2p5WbxXodm5Kn5Bvnu4WvEHdaXVVTVxyeHvshYxhVFqEdsENEra+0aePk524mFoAAFqHQDcx1bUS6x0Jt0dre1p9at+wJR2beJygts7USnirN9YmLNt45PoL1DJr0jPz+A2v9BzsYGNVRi0AAJ1AoJsIYVp9/aG0aasPpr6YU1ThR+1608W0ujoW/3Fp/qLtlz6k0iwN7RT467dTwyfoarYDAOBRCHQjZ4rT6qqSnqVPfnX1qVVUmpWXB7b47N1R7eZRCQCgcwh0I2Tq0+rqOJue12Xq90d+vZtfHkQtk+Zqb52/dGbk2J6tfGOpBQCgFwh0I2Ju0+qqyi+tcp+7NmHpzjO3R1HLJLUNanDmp5d7jAxwd7hNLQAAvUGgGwFznlZXx5bjN8a/t+ns/6QB70ktk2BvY1X65vA270/tG7Lk0bXsAQD0CYFuINqeVhdxrHZg+4bbhVCJCPWOp7bJySup9Hxv05n//Xbi1nhqGbXoFj6xX0zqMj3Qw/EmtQAADAKBrmdCYK05eO1FbU+rT4xuttScpnpPpuZ2XxJz5e39FzMHU8uotA5qkPjKky0XDukYuJVaAAAGhUDXE2Fa/af9qbN+O3Xj2epa3pba9Waq0+rqSr5b1PKrnRff3Z5we7SEZ1bUNpjerX13zRrU8vPIUO84agEAGAUEug5hWl17MvPLAzYfT5+46cj1yek5Jc2prRe+bnYZz4Q3Xvdcj6YrG3s7XaM2AIBRQaDrgLan1YVHoZ6LarJyap/QJbiDmrETKbk9YhLvjDyWnNPz0q38DtTWKmlwp3YP8zkwoEPAjr5t/GOoDQBgtBDoWnT1TmGbH/ckvabtafWRXRpttLexKqc2PKKkosb5RGpOj9NpeeGXb+W3u5pR0OZOXlkwHVaJl4ttVmiA26XWgW7nOzT2OBUZ5nPQ09k2lw4DAJgEBLqGhGn13YkZw1fsT55zMvVeD2rXmyVPq2uL9CXN1UgkYuE9teQSHjPjOIa/BABg8hDo9YRpdQAAMCYIdDVhWh0AAIwRAl0FmFYHAABjh0BXANPqAABgKhDoddD2tHpzP5crU/uEfDM6ovEaTKsDAIAuINBJrYS3ijl7ZySm1QEAwBRZfKAL0+obj1x/YdX+lFna2JMb0+oAAGAIFhvomFYHAABzYlGBru1pdWEJk76tA2Km9gtZ0rOVbyw1AQAA9M4iAr2wrNpt3aFr07U9rT6pZ/MfGnk5Xac2AACAwZh1oAvT6qsOpMz69Xj6hIpqiQO16w3T6gAAYKzMLtAxrQ4AAJbIbAId0+oAAGDJdBbowpmy9JfmeMZznPSdSMQkIo6T0GGtwbQ6AACAFgO9rLLGcVdixoitJ9LHxV/O6lfLMzEd+ou7k03uiM6NfhkVHrz+iSYeJ6mtNkyrAwAAPE7jQM8vrXJftjf5lRX7kucUV9S4UlspYZex14e2/mjwEw1/p5ZS2p5Wd7QRF4/tHrx6er+wrzCtDgAApqzegS4E+Td/Xpn3U1zqS+VVtY7UVtvDYB/YIWC7vCn5a1nFoUtjk17V9rT6092CNzjZiYupDQAAYLLqFehVNRKbuWsSlv5yPH0StTQiDdWi76dFjOvfzn8ntWTT6vsv3h28bF/KnCNXs/tSWwOYVgcAAPNVr0CfvvToph0Jt8dQqRUcY5K1c6KGdWnmdRTT6gAAAOpRO9CXxFyZ9/FvFz6hUquc7cSFrw1r89GHmxMXU6vegr2crk3pE/Lts92brMK0OgAAmDu1An3/xcxB47+O3yn9GSJqaV0zX+ek4spq5+z8igBqqeHvafXolr57OY6pP/0AAABggtQK9EEL9x5PTM/rRqXODO4YuCXmzO1RVCqFaXUAALB0Kgd67PmMoRO/ObyDSp3yb2B/635JpaeyO9oxrQ4AAPCAylPnW07cGEdDnRNuhosI84mj8h+EaXX/Pze92nPA8Y+HhEzrG/I1whwAACydSoEu4XnRwYuZA6nUCw9n23tCeFMpm1af0rvZNyc/Gdps/StRQ4RHz3CNHAAA4AGVptxziyp82ry2LYtKvRBujmvo4XjzRk5JU0yrAwAAKKZSoKfnlDQL/+/OVCr1Qiziqs8tHhHg6WybSy0AAACQQ6Up99KKaica6k2NhLd2d7LJoxIAAAAUUC3QK2v0HugCiUR3z7sDAACYE5UC09FWXEJDvRL2UKchAAAAKKBSoNvZiMtpqFfydl8DAACAxxntGbqHs002DQEAAEAJlQLdx80uU9jilEq9GNwhcBsNAQAAQAmVAl2Y+u7dxm8XlXox6ImGCHQAAAAVqRTogmcjm/xEQ50L8HC42bu1324qAQAAQAmVA71Xa7894SFe8VTq1LtPt59HQwAAAFCByoEumP9Mh7k01JmWDV3Pj+wStIlKAAAAUIFagd6hsXvCf59q+zaVWudsJy5cNrP7GCoBAABARWoFumDO4JafSs+gf6ZSazjGJD/OiHy2ma9zMrUAAABARWoHuuCrF7q9MLyz9qbFra24yqUzI8f20fOd9AAAAOZCpd3W6iL9adwbaxOWbjicNo1a9SJMs6+ZHTU8ItRbLzfcAQAAmKN6B/pDR5Jyei3ecfH94ym50dRSiY1YVDEhqsnyV4a0XujlYodV4QAAADSgcaA/dOZ6Xre9F+4+GX85q19iel5Xaj/Gxd66ICLM52B0S599Tz4R+Ju3q10WHQIAAAANaC3QHyXheVFZZa1jeVWNQ3WtxNrOWlxub2NVJn0zyCYvAAAA5k4ngQ4AAAD6Va+73AEAAMC4INABAADMAAIdAADADCDQAQAAzAACHQAAwAwg0AEAAEweY/8PPuptMq2MzNwAAAAASUVORK5CYII=",P_=class ux{static getLanguageName(e){const n=ux.bcp47Languages.find(i=>i.code===e);return n?n.name:null}static getLanguageCode(e){const n=ux.bcp47Languages.find(i=>i.name===e);return n?n.code:null}};r_(P_,"bcp47Languages",[{name:"Afar",code:"aa"},{name:"Abkhaz",code:"ab"},{name:"Avestan",code:"ae"},{name:"Afrikaans",code:"af"},{name:"Akan",code:"ak"},{name:"Amharic",code:"am"},{name:"Aragonese",code:"an"},{name:"Arabic",code:"ar"},{name:"Assamese",code:"as"},{name:"Avaric",code:"av"},{name:"Aymara",code:"ay"},{name:"Azerbaijani",code:"az"},{name:"Bashkir",code:"ba"},{name:"Belarusian",code:"be"},{name:"Bulgarian",code:"bg"},{name:"Bihari languages",code:"bh"},{name:"Bislama",code:"bi"},{name:"Bambara",code:"bm"},{name:"Bengali",code:"bn"},{name:"Tibetan",code:"bo"},{name:"Breton",code:"br"},{name:"Bosnian",code:"bs"},{name:"Catalan; Valencian",code:"ca"},{name:"Chechen",code:"ce"},{name:"Chamorro",code:"ch"},{name:"Corsican",code:"co"},{name:"Cree",code:"cr"},{name:"Czech",code:"cs"},{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic",code:"cu"},{name:"Chuvash",code:"cv"},{name:"Welsh",code:"cy"},{name:"Danish",code:"da"},{name:"German",code:"de"},{name:"Divehi; Dhivehi; Maldivian",code:"dv"},{name:"Dzongkha",code:"dz"},{name:"Ewe",code:"ee"},{name:"Greek, Modern (1453-)",code:"el"},{name:"English",code:"en"},{name:"Esperanto",code:"eo"},{name:"Spanish; Castilian",code:"es"},{name:"Estonian",code:"et"},{name:"Basque",code:"eu"},{name:"Persian",code:"fa"},{name:"Fulah",code:"ff"},{name:"Finnish",code:"fi"},{name:"Fijian",code:"fj"},{name:"Faroese",code:"fo"},{name:"French",code:"fr"},{name:"Western Frisian",code:"fy"},{name:"Irish",code:"ga"},{name:"Gaelic; Scottish Gaelic",code:"gd"},{name:"Galician",code:"gl"},{name:"Guarani",code:"gn"},{name:"Gujarati",code:"gu"},{name:"Manx",code:"gv"},{name:"Hausa",code:"ha"},{name:"Hebrew",code:"he"},{name:"Hindi",code:"hi"},{name:"Hiri Motu",code:"ho"},{name:"Croatian",code:"hr"},{name:"Haitian; Haitian Creole",code:"ht"},{name:"Hungarian",code:"hu"},{name:"Armenian",code:"hy"},{name:"Herero",code:"hz"},{name:"Interlingua (International Auxiliary Language Association)",code:"ia"},{name:"Indonesian",code:"id"},{name:"Interlingue; Occidental",code:"ie"},{name:"Igbo",code:"ig"},{name:"Sichuan Yi; Nuosu",code:"ii"},{name:"Inupiaq",code:"ik"},{name:"Ido",code:"io"},{name:"Icelandic",code:"is"},{name:"Italian",code:"it"},{name:"Inuktitut",code:"iu"},{name:"Japanese",code:"ja"},{name:"Javanese",code:"jv"},{name:"Georgian",code:"ka"},{name:"Kongo",code:"kg"},{name:"Kikuyu; Gikuyu",code:"ki"},{name:"Kuanyama; Kwanyama",code:"kj"},{name:"Kazakh",code:"kk"},{name:"Kalaallisut; Greenlandic",code:"kl"},{name:"Central Khmer",code:"km"},{name:"Kannada",code:"kn"},{name:"Korean",code:"ko"},{name:"Kanuri",code:"kr"},{name:"Kashmiri",code:"ks"},{name:"Kurdish",code:"ku"},{name:"Komi",code:"kv"},{name:"Cornish",code:"kw"},{name:"Kirghiz; Kyrgyz",code:"ky"},{name:"Latin",code:"la"},{name:"Luxembourgish; Letzeburgesch",code:"lb"},{name:"Ganda",code:"lg"},{name:"Limburgan; Limburger; Limburgish",code:"li"},{name:"Lingala",code:"ln"},{name:"Lao",code:"lo"},{name:"Lithuanian",code:"lt"},{name:"Luba-Katanga",code:"lu"},{name:"Latvian",code:"lv"},{name:"Malagasy",code:"mg"},{name:"Marshallese",code:"mh"},{name:"Maori",code:"mi"},{name:"Macedonian",code:"mk"},{name:"Malayalam",code:"ml"},{name:"Mongolian",code:"mn"},{name:"Marathi",code:"mr"},{name:"Malay",code:"ms"},{name:"Maltese",code:"mt"},{name:"Burmese",code:"my"},{name:"Nauru",code:"na"},{name:"Bokmål, Norwegian; Norwegian Bokmål",code:"nb"},{name:"Ndebele, North; North Ndebele",code:"nd"},{name:"Nepali",code:"ne"},{name:"Ndonga",code:"ng"},{name:"Dutch; Flemish",code:"nl"},{name:"Norwegian Nynorsk; Nynorsk, Norwegian",code:"nn"},{name:"Norwegian",code:"no"},{name:"Ndebele, South; South Ndebele",code:"nr"},{name:"Navajo; Navaho",code:"nv"},{name:"Chichewa; Chewa; Nyanja",code:"ny"},{name:"Occitan (post 1500)",code:"oc"},{name:"Ojibwa",code:"oj"},{name:"Oromo",code:"om"},{name:"Oriya",code:"or"},{name:"Ossetian; Ossetic",code:"os"},{name:"Panjabi; Punjabi",code:"pa"},{name:"Pali",code:"pi"},{name:"Polish",code:"pl"},{name:"Pushto; Pashto",code:"ps"},{name:"Portuguese",code:"pt"},{name:"Quechua",code:"qu"},{name:"Romansh",code:"rm"},{name:"Rundi",code:"rn"},{name:"Romanian; Moldavian; Moldovan",code:"ro"},{name:"Russian",code:"ru"},{name:"Kinyarwanda",code:"rw"},{name:"Sanskrit",code:"sa"},{name:"Sardinian",code:"sc"},{name:"Sindhi",code:"sd"},{name:"Northern Sami",code:"se"},{name:"Sango",code:"sg"},{name:"Sinhala; Sinhalese",code:"si"},{name:"Slovak",code:"sk"},{name:"Slovenian",code:"sl"},{name:"Samoan",code:"sm"},{name:"Shona",code:"sn"},{name:"Somali",code:"so"},{name:"Albanian",code:"sq"},{name:"Serbian",code:"sr"},{name:"Swati",code:"ss"},{name:"Sotho, Southern",code:"st"},{name:"Sundanese",code:"su"},{name:"Swedish",code:"sv"},{name:"Swahili",code:"sw"},{name:"Tamil",code:"ta"},{name:"Telugu",code:"te"},{name:"Tajik",code:"tg"},{name:"Thai",code:"th"},{name:"Tigrinya",code:"ti"},{name:"Turkmen",code:"tk"},{name:"Tagalog",code:"tl"},{name:"Tswana",code:"tn"},{name:"Tonga (Tonga Islands)",code:"to"},{name:"Turkish",code:"tr"},{name:"Tsonga",code:"ts"},{name:"Tatar",code:"tt"},{name:"Twi",code:"tw"},{name:"Tahitian",code:"ty"},{name:"Uighur; Uyghur",code:"ug"},{name:"Ukrainian",code:"uk"},{name:"Urdu",code:"ur"},{name:"Uzbek",code:"uz"},{name:"Venda",code:"ve"},{name:"Vietnamese",code:"vi"},{name:"Volapük",code:"vo"},{name:"Walloon",code:"wa"},{name:"Wolof",code:"wo"},{name:"Xhosa",code:"xh"},{name:"Yiddish",code:"yi"},{name:"Yoruba",code:"yo"},{name:"Zhuang; Chuang",code:"za"},{name:"Chinese",code:"zh"},{name:"Zulu",code:"zu"}]),r_(P_,"uiLanguages",[{name:"English",code:"en"},{name:"Français",code:"fr"},{name:"Deutsch",code:"de"},{name:"Italiano",code:"it"},{name:"Español",code:"es"},{name:"Nederlands",code:"nl"},{name:"Dansk",code:"da"},{name:"Português",code:"pt"},{name:"Ελληνικά",code:"el"},{name:"Polski",code:"pl"},{name:"Svenska",code:"sv"},{name:"Norsk",code:"no"},{name:"Suomi",code:"fi"},{name:"Русский",code:"ru"},{name:"हिन्दी",code:"hi"},{name:"日本語",code:"ja"},{name:"한국어",code:"ko"},{name:"Tiếng Việt",code:"vi"},{name:"中文",code:"zh"}]);let th=P_;var hm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function GP(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}function CW(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var KP={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(hm,function(){var n;function i(){return n.apply(null,arguments)}function r(b){n=b}function s(b){return b instanceof Array||Object.prototype.toString.call(b)==="[object Array]"}function o(b){return b!=null&&Object.prototype.toString.call(b)==="[object Object]"}function u(b,A){return Object.prototype.hasOwnProperty.call(b,A)}function d(b){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(b).length===0;var A;for(A in b)if(u(b,A))return!1;return!0}function h(b){return b===void 0}function g(b){return typeof b=="number"||Object.prototype.toString.call(b)==="[object Number]"}function y(b){return b instanceof Date||Object.prototype.toString.call(b)==="[object Date]"}function w(b,A){var H=[],X,pe=b.length;for(X=0;X>>0,X;for(X=0;X0)for(H=0;H=0;return(ze?H?"+":"":"-")+Math.pow(10,Math.max(0,pe)).toString().substr(1)+X}var xn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ii=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Zn={},li={};function Ft(b,A,H,X){var pe=X;typeof X=="string"&&(pe=function(){return this[X]()}),b&&(li[b]=pe),A&&(li[A[0]]=function(){return Qt(pe.apply(this,arguments),A[1],A[2])}),H&&(li[H]=function(){return this.localeData().ordinal(pe.apply(this,arguments),b)})}function ui(b){return b.match(/\[[\s\S]/)?b.replace(/^\[|\]$/g,""):b.replace(/\\/g,"")}function or(b){var A=b.match(xn),H,X;for(H=0,X=A.length;H=0&&ii.test(b);)b=b.replace(ii,X),ii.lastIndex=0,H-=1;return b}var Hn={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Ur(b){var A=this._longDateFormat[b],H=this._longDateFormat[b.toUpperCase()];return A||!H?A:(this._longDateFormat[b]=H.match(xn).map(function(X){return X==="MMMM"||X==="MM"||X==="DD"||X==="dddd"?X.slice(1):X}).join(""),this._longDateFormat[b])}var Fe="Invalid date";function Ke(){return this._invalidDate}var N="%d",ce=/\d{1,2}/;function Re(b){return this._ordinal.replace("%d",b)}var Ye={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function re(b,A,H,X){var pe=this._relativeTime[H];return pt(pe)?pe(b,A,H,X):pe.replace(/%d/i,b)}function ge(b,A){var H=this._relativeTime[b>0?"future":"past"];return pt(H)?H(A):H.replace(/%s/i,A)}var Ce={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ge(b){return typeof b=="string"?Ce[b]||Ce[b.toLowerCase()]:void 0}function Ue(b){var A={},H,X;for(X in b)u(b,X)&&(H=Ge(X),H&&(A[H]=b[X]));return A}var We={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function rt(b){var A=[],H;for(H in b)u(b,H)&&A.push({unit:H,priority:We[H]});return A.sort(function(X,pe){return X.priority-pe.priority}),A}var kt=/\d/,Dt=/\d\d/,tn=/\d{3}/,dn=/\d{4}/,te=/[+-]?\d{6}/,Z=/\d\d?/,be=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,at=/\d{1,3}/,Et=/\d{1,4}/,Zt=/[+-]?\d{1,6}/,gn=/\d+/,nn=/[+-]?\d+/,ur=/Z|[+-]\d\d:?\d\d/gi,ci=/Z|[+-]\d\d(?::?\d\d)?/gi,os=/[+-]?\d+(\.\d{1,3})?/,Hr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,kr=/^[1-9]\d?/,ar=/^([1-9]\d|\d)/,wo;wo={};function qt(b,A,H){wo[b]=pt(A)?A:function(X,pe){return X&&H?H:A}}function Qs(b,A){return u(wo,b)?wo[b](A._strict,A._locale):new RegExp(ca(b))}function ca(b){return Zr(b.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(A,H,X,pe,ze){return H||X||pe||ze}))}function Zr(b){return b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Pr(b){return b<0?Math.ceil(b)||0:Math.floor(b)}function zn(b){var A=+b,H=0;return A!==0&&isFinite(A)&&(H=Pr(A)),H}var Js={};function ri(b,A){var H,X=A,pe;for(typeof b=="string"&&(b=[b]),g(A)&&(X=function(ze,vt){vt[A]=zn(ze)}),pe=b.length,H=0;H68?1900:2e3)};var Gt=Pn("FullYear",!0);function Pt(){return Yi(this.year())}function Pn(b,A){return function(H){return H!=null?(Ai(this,b,H),i.updateOffset(this,A),this):Ii(this,b)}}function Ii(b,A){if(!b.isValid())return NaN;var H=b._d,X=b._isUTC;switch(A){case"Milliseconds":return X?H.getUTCMilliseconds():H.getMilliseconds();case"Seconds":return X?H.getUTCSeconds():H.getSeconds();case"Minutes":return X?H.getUTCMinutes():H.getMinutes();case"Hours":return X?H.getUTCHours():H.getHours();case"Date":return X?H.getUTCDate():H.getDate();case"Day":return X?H.getUTCDay():H.getDay();case"Month":return X?H.getUTCMonth():H.getMonth();case"FullYear":return X?H.getUTCFullYear():H.getFullYear();default:return NaN}}function Ai(b,A,H){var X,pe,ze,vt,on;if(!(!b.isValid()||isNaN(H))){switch(X=b._d,pe=b._isUTC,A){case"Milliseconds":return void(pe?X.setUTCMilliseconds(H):X.setMilliseconds(H));case"Seconds":return void(pe?X.setUTCSeconds(H):X.setSeconds(H));case"Minutes":return void(pe?X.setUTCMinutes(H):X.setMinutes(H));case"Hours":return void(pe?X.setUTCHours(H):X.setHours(H));case"Date":return void(pe?X.setUTCDate(H):X.setDate(H));case"FullYear":break;default:return}ze=H,vt=b.month(),on=b.date(),on=on===29&&vt===1&&!Yi(ze)?28:on,pe?X.setUTCFullYear(ze,vt,on):X.setFullYear(ze,vt,on)}}function $s(b){return b=Ge(b),pt(this[b])?this[b]():this}function Qr(b,A){if(typeof b=="object"){b=Ue(b);var H=rt(b),X,pe=H.length;for(X=0;X=0?(on=new Date(b+400,A,H,X,pe,ze,vt),isFinite(on.getFullYear())&&on.setFullYear(b)):on=new Date(b,A,H,X,pe,ze,vt),on}function Ra(b){var A,H;return b<100&&b>=0?(H=Array.prototype.slice.call(arguments),H[0]=b+400,A=new Date(Date.UTC.apply(null,H)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(b)):A=new Date(Date.UTC.apply(null,arguments)),A}function Es(b,A,H){var X=7+A-H,pe=(7+Ra(b,0,X).getUTCDay()-A)%7;return-pe+X-1}function Go(b,A,H,X,pe){var ze=(7+H-X)%7,vt=Es(b,X,pe),on=1+7*(A-1)+ze+vt,Nn,mi;return on<=0?(Nn=b-1,mi=He(Nn)+on):on>He(b)?(Nn=b+1,mi=on-He(b)):(Nn=b,mi=on),{year:Nn,dayOfYear:mi}}function lr(b,A,H){var X=Es(b.year(),A,H),pe=Math.floor((b.dayOfYear()-X-1)/7)+1,ze,vt;return pe<1?(vt=b.year()-1,ze=pe+So(vt,A,H)):pe>So(b.year(),A,H)?(ze=pe-So(b.year(),A,H),vt=b.year()+1):(vt=b.year(),ze=pe),{week:ze,year:vt}}function So(b,A,H){var X=Es(b,A,H),pe=Es(b+1,A,H);return(He(b)-X+pe)/7}Ft("w",["ww",2],"wo","week"),Ft("W",["WW",2],"Wo","isoWeek"),qt("w",Z,kr),qt("ww",Z,Dt),qt("W",Z,kr),qt("WW",Z,Dt),as(["w","ww","W","WW"],function(b,A,H,X){A[X.substr(0,1)]=zn(b)});function ol(b){return lr(b,this._week.dow,this._week.doy).week}var al={dow:0,doy:6};function La(){return this._week.dow}function to(){return this._week.doy}function ll(b){var A=this.localeData().week(this);return b==null?A:this.add((b-A)*7,"d")}function Ri(b){var A=lr(this,1,4).week;return b==null?A:this.add((b-A)*7,"d")}Ft("d",0,"do","day"),Ft("dd",0,0,function(b){return this.localeData().weekdaysMin(this,b)}),Ft("ddd",0,0,function(b){return this.localeData().weekdaysShort(this,b)}),Ft("dddd",0,0,function(b){return this.localeData().weekdays(this,b)}),Ft("e",0,0,"weekday"),Ft("E",0,0,"isoWeekday"),qt("d",Z),qt("e",Z),qt("E",Z),qt("dd",function(b,A){return A.weekdaysMinRegex(b)}),qt("ddd",function(b,A){return A.weekdaysShortRegex(b)}),qt("dddd",function(b,A){return A.weekdaysRegex(b)}),as(["dd","ddd","dddd"],function(b,A,H,X){var pe=H._locale.weekdaysParse(b,X,H._strict);pe!=null?A.d=pe:M(H).invalidWeekday=b}),as(["d","e","E"],function(b,A,H,X){A[X]=zn(b)});function fs(b,A){return typeof b!="string"?b:isNaN(b)?(b=A.weekdaysParse(b),typeof b=="number"?b:null):parseInt(b,10)}function Ec(b,A){return typeof b=="string"?A.weekdaysParse(b)%7||7:isNaN(b)?null:b}function xc(b,A){return b.slice(A,7).concat(b.slice(0,A))}var ul="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ou="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ma=Hr,cl=Hr,Ko=Hr;function Fl(b,A){var H=s(this._weekdays)?this._weekdays:this._weekdays[b&&b!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return b===!0?xc(H,this._week.dow):b?H[b.day()]:H}function dl(b){return b===!0?xc(this._weekdaysShort,this._week.dow):b?this._weekdaysShort[b.day()]:this._weekdaysShort}function Yo(b){return b===!0?xc(this._weekdaysMin,this._week.dow):b?this._weekdaysMin[b.day()]:this._weekdaysMin}function zr(b,A,H){var X,pe,ze,vt=b.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],X=0;X<7;++X)ze=D([2e3,1]).day(X),this._minWeekdaysParse[X]=this.weekdaysMin(ze,"").toLocaleLowerCase(),this._shortWeekdaysParse[X]=this.weekdaysShort(ze,"").toLocaleLowerCase(),this._weekdaysParse[X]=this.weekdays(ze,"").toLocaleLowerCase();return H?A==="dddd"?(pe=vi.call(this._weekdaysParse,vt),pe!==-1?pe:null):A==="ddd"?(pe=vi.call(this._shortWeekdaysParse,vt),pe!==-1?pe:null):(pe=vi.call(this._minWeekdaysParse,vt),pe!==-1?pe:null):A==="dddd"?(pe=vi.call(this._weekdaysParse,vt),pe!==-1||(pe=vi.call(this._shortWeekdaysParse,vt),pe!==-1)?pe:(pe=vi.call(this._minWeekdaysParse,vt),pe!==-1?pe:null)):A==="ddd"?(pe=vi.call(this._shortWeekdaysParse,vt),pe!==-1||(pe=vi.call(this._weekdaysParse,vt),pe!==-1)?pe:(pe=vi.call(this._minWeekdaysParse,vt),pe!==-1?pe:null)):(pe=vi.call(this._minWeekdaysParse,vt),pe!==-1||(pe=vi.call(this._weekdaysParse,vt),pe!==-1)?pe:(pe=vi.call(this._shortWeekdaysParse,vt),pe!==-1?pe:null))}function Ru(b,A,H){var X,pe,ze;if(this._weekdaysParseExact)return zr.call(this,b,A,H);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),X=0;X<7;X++)if(pe=D([2e3,1]).day(X),H&&!this._fullWeekdaysParse[X]&&(this._fullWeekdaysParse[X]=new RegExp("^"+this.weekdays(pe,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[X]=new RegExp("^"+this.weekdaysShort(pe,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[X]=new RegExp("^"+this.weekdaysMin(pe,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[X]||(ze="^"+this.weekdays(pe,"")+"|^"+this.weekdaysShort(pe,"")+"|^"+this.weekdaysMin(pe,""),this._weekdaysParse[X]=new RegExp(ze.replace(".",""),"i")),H&&A==="dddd"&&this._fullWeekdaysParse[X].test(b)||H&&A==="ddd"&&this._shortWeekdaysParse[X].test(b)||H&&A==="dd"&&this._minWeekdaysParse[X].test(b)||!H&&this._weekdaysParse[X].test(b))return X}function Sd(b){if(!this.isValid())return b!=null?this:NaN;var A=Ii(this,"Day");return b!=null?(b=fs(b,this.localeData()),this.add(b-A,"d")):A}function Cc(b){if(!this.isValid())return b!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return b==null?A:this.add(b-A,"d")}function Bl(b){if(!this.isValid())return b!=null?this:NaN;if(b!=null){var A=Ec(b,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function Ul(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||fa.call(this),b?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Ma),this._weekdaysStrictRegex&&b?this._weekdaysStrictRegex:this._weekdaysRegex)}function Na(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||fa.call(this),b?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=cl),this._weekdaysShortStrictRegex&&b?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Hl(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||fa.call(this),b?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ko),this._weekdaysMinStrictRegex&&b?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function fa(){function b(qs,Sl){return Sl.length-qs.length}var A=[],H=[],X=[],pe=[],ze,vt,on,Nn,mi;for(ze=0;ze<7;ze++)vt=D([2e3,1]).day(ze),on=Zr(this.weekdaysMin(vt,"")),Nn=Zr(this.weekdaysShort(vt,"")),mi=Zr(this.weekdays(vt,"")),A.push(on),H.push(Nn),X.push(mi),pe.push(on),pe.push(Nn),pe.push(mi);A.sort(b),H.sort(b),X.sort(b),pe.sort(b),this._weekdaysRegex=new RegExp("^("+pe.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+X.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+H.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function zl(){return this.hours()%12||12}function Ac(){return this.hours()||24}Ft("H",["HH",2],0,"hour"),Ft("h",["hh",2],0,zl),Ft("k",["kk",2],0,Ac),Ft("hmm",0,0,function(){return""+zl.apply(this)+Qt(this.minutes(),2)}),Ft("hmmss",0,0,function(){return""+zl.apply(this)+Qt(this.minutes(),2)+Qt(this.seconds(),2)}),Ft("Hmm",0,0,function(){return""+this.hours()+Qt(this.minutes(),2)}),Ft("Hmmss",0,0,function(){return""+this.hours()+Qt(this.minutes(),2)+Qt(this.seconds(),2)});function kc(b,A){Ft(b,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}kc("a",!0),kc("A",!1);function Pc(b,A){return A._meridiemParse}qt("a",Pc),qt("A",Pc),qt("H",Z,ar),qt("h",Z,kr),qt("k",Z,kr),qt("HH",Z,Dt),qt("hh",Z,Dt),qt("kk",Z,Dt),qt("hmm",be),qt("hmmss",we),qt("Hmm",be),qt("Hmmss",we),ri(["H","HH"],Ln),ri(["k","kk"],function(b,A,H){var X=zn(b);A[Ln]=X===24?0:X}),ri(["a","A"],function(b,A,H){H._isPm=H._locale.isPM(b),H._meridiem=b}),ri(["h","hh"],function(b,A,H){A[Ln]=zn(b),M(H).bigHour=!0}),ri("hmm",function(b,A,H){var X=b.length-2;A[Ln]=zn(b.substr(0,X)),A[mr]=zn(b.substr(X)),M(H).bigHour=!0}),ri("hmmss",function(b,A,H){var X=b.length-4,pe=b.length-2;A[Ln]=zn(b.substr(0,X)),A[mr]=zn(b.substr(X,2)),A[qn]=zn(b.substr(pe)),M(H).bigHour=!0}),ri("Hmm",function(b,A,H){var X=b.length-2;A[Ln]=zn(b.substr(0,X)),A[mr]=zn(b.substr(X))}),ri("Hmmss",function(b,A,H){var X=b.length-4,pe=b.length-2;A[Ln]=zn(b.substr(0,X)),A[mr]=zn(b.substr(X,2)),A[qn]=zn(b.substr(pe))});function Td(b){return(b+"").toLowerCase().charAt(0)==="p"}var jl=/[ap]\.?m?\.?/i,Th=Pn("Hours",!0);function hl(b,A,H){return b>11?H?"pm":"PM":H?"am":"AM"}var Dr={calendar:cn,longDateFormat:Hn,invalidDate:Fe,ordinal:N,dayOfMonthOrdinalParse:ce,relativeTime:Ye,months:ha,monthsShort:pa,week:al,weekdays:ul,weekdaysMin:Ou,weekdaysShort:Nl,meridiemParse:jl},Li={},jr={},Vl;function Ed(b,A){var H,X=Math.min(b.length,A.length);for(H=0;H0;){if(pe=ls(ze.slice(0,H).join("-")),pe)return pe;if(X&&X.length>=H&&Ed(ze,X)>=H-1)break;H--}A++}return Vl}function Ir(b){return!!(b&&b.match("^[^/\\\\]*$"))}function ls(b){var A=null,H;if(Li[b]===void 0&&t&&t.exports&&Ir(b))try{A=Vl._abbr,H=CW,H("./locale/"+b),Jr(A)}catch{Li[b]=null}return Li[b]}function Jr(b,A){var H;return b&&(h(A)?H=wi(b):H=Cs(b,A),H?Vl=H:typeof console<"u"&&console.warn&&console.warn("Locale "+b+" not found. Did you forget to load it?")),Vl._abbr}function Cs(b,A){if(A!==null){var H,X=Dr;if(A.abbr=b,Li[b]!=null)et("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),X=Li[b]._config;else if(A.parentLocale!=null)if(Li[A.parentLocale]!=null)X=Li[A.parentLocale]._config;else if(H=ls(A.parentLocale),H!=null)X=H._config;else return jr[A.parentLocale]||(jr[A.parentLocale]=[]),jr[A.parentLocale].push({name:b,config:A}),null;return Li[b]=new Ut(pn(X,A)),jr[b]&&jr[b].forEach(function(pe){Cs(pe.name,pe.config)}),Jr(b),Li[b]}else return delete Li[b],null}function no(b,A){if(A!=null){var H,X,pe=Dr;Li[b]!=null&&Li[b].parentLocale!=null?Li[b].set(pn(Li[b]._config,A)):(X=ls(b),X!=null&&(pe=X._config),A=pn(pe,A),X==null&&(A.abbr=b),H=new Ut(A),H.parentLocale=Li[b],Li[b]=H),Jr(b)}else Li[b]!=null&&(Li[b].parentLocale!=null?(Li[b]=Li[b].parentLocale,b===Jr()&&Jr(b)):Li[b]!=null&&delete Li[b]);return Li[b]}function wi(b){var A;if(b&&b._locale&&b._locale._abbr&&(b=b._locale._abbr),!b)return Vl;if(!s(b)){if(A=ls(b),A)return A;b=[b]}return xs(b)}function Lu(){return Xt(Li)}function ma(b){var A,H=b._a;return H&&M(b).overflow===-2&&(A=H[ds]<0||H[ds]>11?ds:H[fr]<1||H[fr]>Oi(H[pr],H[ds])?fr:H[Ln]<0||H[Ln]>24||H[Ln]===24&&(H[mr]!==0||H[qn]!==0||H[Us]!==0)?Ln:H[mr]<0||H[mr]>59?mr:H[qn]<0||H[qn]>59?qn:H[Us]<0||H[Us]>999?Us:-1,M(b)._overflowDayOfYear&&(Afr)&&(A=fr),M(b)._overflowWeeks&&A===-1&&(A=Da),M(b)._overflowWeekday&&A===-1&&(A=da),M(b).overflow=A),b}var Vr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mu=/Z|[+-]\d\d(?::?\d\d)?/,To=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ga=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Hs=/^\/?Date\((-?\d+)/i,Fa=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Or={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ya(b){var A,H,X=b._i,pe=Vr.exec(X)||Wr.exec(X),ze,vt,on,Nn,mi=To.length,qs=ga.length;if(pe){for(M(b).iso=!0,A=0,H=mi;AHe(vt)||b._dayOfYear===0)&&(M(b)._overflowDayOfYear=!0),H=Ra(vt,0,b._dayOfYear),b._a[ds]=H.getUTCMonth(),b._a[fr]=H.getUTCDate()),A=0;A<3&&b._a[A]==null;++A)b._a[A]=X[A]=pe[A];for(;A<7;A++)b._a[A]=X[A]=b._a[A]==null?A===2?1:0:b._a[A];b._a[Ln]===24&&b._a[mr]===0&&b._a[qn]===0&&b._a[Us]===0&&(b._nextDay=!0,b._a[Ln]=0),b._d=(b._useUTC?Ra:_o).apply(null,X),ze=b._useUTC?b._d.getUTCDay():b._d.getDay(),b._tzm!=null&&b._d.setUTCMinutes(b._d.getUTCMinutes()-b._tzm),b._nextDay&&(b._a[Ln]=24),b._w&&typeof b._w.d<"u"&&b._w.d!==ze&&(M(b).weekdayMismatch=!0)}}function As(b){var A,H,X,pe,ze,vt,on,Nn,mi;A=b._w,A.GG!=null||A.W!=null||A.E!=null?(ze=1,vt=4,H=Xi(A.GG,b._a[pr],lr(Bi(),1,4).year),X=Xi(A.W,1),pe=Xi(A.E,1),(pe<1||pe>7)&&(Nn=!0)):(ze=b._locale._week.dow,vt=b._locale._week.doy,mi=lr(Bi(),ze,vt),H=Xi(A.gg,b._a[pr],mi.year),X=Xi(A.w,mi.week),A.d!=null?(pe=A.d,(pe<0||pe>6)&&(Nn=!0)):A.e!=null?(pe=A.e+ze,(A.e<0||A.e>6)&&(Nn=!0)):pe=ze),X<1||X>So(H,ze,vt)?M(b)._overflowWeeks=!0:Nn!=null?M(b)._overflowWeekday=!0:(on=Go(H,X,pe,ze,vt),b._a[pr]=on.year,b._dayOfYear=on.dayOfYear)}i.ISO_8601=function(){},i.RFC_2822=function(){};function Eo(b){if(b._f===i.ISO_8601){ya(b);return}if(b._f===i.RFC_2822){zs(b);return}b._a=[],M(b).empty=!0;var A=""+b._i,H,X,pe,ze,vt,on=A.length,Nn=0,mi,qs;for(pe=Vi(b._f,b._locale).match(xn)||[],qs=pe.length,H=0;H0&&M(b).unusedInput.push(vt),A=A.slice(A.indexOf(X)+X.length),Nn+=X.length),li[ze]?(X?M(b).empty=!1:M(b).unusedTokens.push(ze),Bs(ze,X,b)):b._strict&&!X&&M(b).unusedTokens.push(ze);M(b).charsLeftOver=on-Nn,A.length>0&&M(b).unusedInput.push(A),b._a[Ln]<=12&&M(b).bigHour===!0&&b._a[Ln]>0&&(M(b).bigHour=void 0),M(b).parsedDateParts=b._a.slice(0),M(b).meridiem=b._meridiem,b._a[Ln]=ml(b._locale,b._a[Ln],b._meridiem),mi=M(b).era,mi!==null&&(b._a[pr]=b._locale.erasConvertYear(mi,b._a[pr])),Nu(b),ma(b)}function ml(b,A,H){var X;return H==null?A:b.meridiemHour!=null?b.meridiemHour(A,H):(b.isPM!=null&&(X=b.isPM(H),X&&A<12&&(A+=12),!X&&A===12&&(A=0)),A)}function Wl(b){var A,H,X,pe,ze,vt,on=!1,Nn=b._f.length;if(Nn===0){M(b).invalidFormat=!0,b._d=new Date(NaN);return}for(pe=0;pethis?this:b:$()});function Bu(b,A){var H,X;if(A.length===1&&s(A[0])&&(A=A[0]),!A.length)return Bi();for(H=A[0],X=1;Xthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Se(){if(!h(this._isDSTShifted))return this._isDSTShifted;var b={},A;return ve(b,this),b=Fu(b),b._a?(A=b._isUTC?D(b._a):Bi(b._a),this._isDSTShifted=this.isValid()&&Yl(b._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ye(){return this.isValid()?!this._isUTC:!1}function me(){return this.isValid()?this._isUTC:!1}function nt(){return this.isValid()?this._isUTC&&this._offset===0:!1}var le=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,j=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Q(b,A){var H=b,X=null,pe,ze,vt;return gl(b)?H={ms:b._milliseconds,d:b._days,M:b._months}:g(b)||!isNaN(+b)?(H={},A?H[A]=+b:H.milliseconds=+b):(X=le.exec(b))?(pe=X[1]==="-"?-1:1,H={y:0,d:zn(X[fr])*pe,h:zn(X[Ln])*pe,m:zn(X[mr])*pe,s:zn(X[qn])*pe,ms:zn(Hu(X[Us]*1e3))*pe}):(X=j.exec(b))?(pe=X[1]==="-"?-1:1,H={y:dt(X[2],pe),M:dt(X[3],pe),w:dt(X[4],pe),d:dt(X[5],pe),h:dt(X[6],pe),m:dt(X[7],pe),s:dt(X[8],pe)}):H==null?H={}:typeof H=="object"&&("from"in H||"to"in H)&&(vt=At(Bi(H.from),Bi(H.to)),H={},H.ms=vt.milliseconds,H.M=vt.months),ze=new Uu(H),gl(b)&&u(b,"_locale")&&(ze._locale=b._locale),gl(b)&&u(b,"_isValid")&&(ze._isValid=b._isValid),ze}Q.fn=Uu.prototype,Q.invalid=Kl;function dt(b,A){var H=b&&parseFloat(b.replace(",","."));return(isNaN(H)?0:H)*A}function ht(b,A){var H={};return H.months=A.month()-b.month()+(A.year()-b.year())*12,b.clone().add(H.months,"M").isAfter(A)&&--H.months,H.milliseconds=+A-+b.clone().add(H.months,"M"),H}function At(b,A){var H;return b.isValid()&&A.isValid()?(A=yl(A,b),b.isBefore(A)?H=ht(b,A):(H=ht(A,b),H.milliseconds=-H.milliseconds,H.months=-H.months),H):{milliseconds:0,months:0}}function Tt(b,A){return function(H,X){var pe,ze;return X!==null&&!isNaN(+X)&&(et(A,"moment()."+A+"(period, number) is deprecated. Please use moment()."+A+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),ze=H,H=X,X=ze),pe=Q(H,X),it(this,pe,b),this}}function it(b,A,H,X){var pe=A._milliseconds,ze=Hu(A._days),vt=Hu(A._months);b.isValid()&&(X=X??!0,vt&&eo(b,Ii(b,"Month")+vt*H),ze&&Ai(b,"Date",Ii(b,"Date")+ze*H),pe&&b._d.setTime(b._d.valueOf()+pe*H),X&&i.updateOffset(b,ze||vt))}var ct=Tt(1,"add"),ft=Tt(-1,"subtract");function Ot(b){return typeof b=="string"||b instanceof String}function Mt(b){return ae(b)||y(b)||Ot(b)||g(b)||fn(b)||$t(b)||b===null||b===void 0}function $t(b){var A=o(b)&&!d(b),H=!1,X=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],pe,ze,vt=X.length;for(pe=0;peH.valueOf():H.valueOf()9999?ji(H,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):pt(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ji(H,"Z")):ji(H,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Er(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var b="moment",A="",H,X,pe,ze;return this.isLocal()||(b=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),H="["+b+'("]',X=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",pe="-MM-DD[T]HH:mm:ss.SSS",ze=A+'[")]',this.format(H+X+pe+ze)}function ro(b){b||(b=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var A=ji(this,b);return this.localeData().postformat(A)}function Rc(b,A){return this.isValid()&&(ae(b)&&b.isValid()||Bi(b).isValid())?Q({to:this,from:b}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function bl(b){return this.from(Bi(),b)}function zu(b,A){return this.isValid()&&(ae(b)&&b.isValid()||Bi(b).isValid())?Q({from:this,to:b}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function tf(b){return this.to(Bi(),b)}function Lc(b){var A;return b===void 0?this._locale._abbr:(A=wi(b),A!=null&&(this._locale=A),this)}var Mc=Qe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(b){return b===void 0?this.localeData():this.locale(b)});function di(){return this._locale}var Ha=1e3,Zl=60*Ha,za=60*Zl,Pd=(365*400+97)*24*za;function Ws(b,A){return(b%A+A)%A}function Dd(b,A,H){return b<100&&b>=0?new Date(b+400,A,H)-Pd:new Date(b,A,H).valueOf()}function nf(b,A,H){return b<100&&b>=0?Date.UTC(b+400,A,H)-Pd:Date.UTC(b,A,H)}function Ql(b){var A,H;if(b=Ge(b),b===void 0||b==="millisecond"||!this.isValid())return this;switch(H=this._isUTC?nf:Dd,b){case"year":A=H(this.year(),0,1);break;case"quarter":A=H(this.year(),this.month()-this.month()%3,1);break;case"month":A=H(this.year(),this.month(),1);break;case"week":A=H(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=H(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=H(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=Ws(A+(this._isUTC?0:this.utcOffset()*Zl),za);break;case"minute":A=this._d.valueOf(),A-=Ws(A,Zl);break;case"second":A=this._d.valueOf(),A-=Ws(A,Ha);break}return this._d.setTime(A),i.updateOffset(this,!0),this}function ju(b){var A,H;if(b=Ge(b),b===void 0||b==="millisecond"||!this.isValid())return this;switch(H=this._isUTC?nf:Dd,b){case"year":A=H(this.year()+1,0,1)-1;break;case"quarter":A=H(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=H(this.year(),this.month()+1,1)-1;break;case"week":A=H(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=H(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=H(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=za-Ws(A+(this._isUTC?0:this.utcOffset()*Zl),za)-1;break;case"minute":A=this._d.valueOf(),A+=Zl-Ws(A,Zl)-1;break;case"second":A=this._d.valueOf(),A+=Ha-Ws(A,Ha)-1;break}return this._d.setTime(A),i.updateOffset(this,!0),this}function Dn(){return this._d.valueOf()-(this._offset||0)*6e4}function Co(){return Math.floor(this.valueOf()/1e3)}function ks(){return new Date(this.valueOf())}function gs(){var b=this;return[b.year(),b.month(),b.date(),b.hour(),b.minute(),b.second(),b.millisecond()]}function wg(){var b=this;return{years:b.year(),months:b.month(),date:b.date(),hours:b.hours(),minutes:b.minutes(),seconds:b.seconds(),milliseconds:b.milliseconds()}}function rf(){return this.isValid()?this.toISOString():null}function sf(){return K(this)}function Nc(){return C({},M(this))}function Id(){return M(this).overflow}function _g(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ft("N",0,0,"eraAbbr"),Ft("NN",0,0,"eraAbbr"),Ft("NNN",0,0,"eraAbbr"),Ft("NNNN",0,0,"eraName"),Ft("NNNNN",0,0,"eraNarrow"),Ft("y",["y",1],"yo","eraYear"),Ft("y",["yy",2],0,"eraYear"),Ft("y",["yyy",3],0,"eraYear"),Ft("y",["yyyy",4],0,"eraYear"),qt("N",_e),qt("NN",_e),qt("NNN",_e),qt("NNNN",Ae),qt("NNNNN",De),ri(["N","NN","NNN","NNNN","NNNNN"],function(b,A,H,X){var pe=H._locale.erasParse(b,X,H._strict);pe?M(H).era=pe:M(H).invalidEra=b}),qt("y",gn),qt("yy",gn),qt("yyy",gn),qt("yyyy",gn),qt("yo",Le),ri(["y","yy","yyy","yyyy"],pr),ri(["yo"],function(b,A,H,X){var pe;H._locale._eraYearOrdinalRegex&&(pe=b.match(H._locale._eraYearOrdinalRegex)),H._locale.eraYearOrdinalParse?A[pr]=H._locale.eraYearOrdinalParse(b,pe):A[pr]=parseInt(b,10)});function Sg(b,A){var H,X,pe,ze=this._eras||wi("en")._eras;for(H=0,X=ze.length;H=0)return ze[X]}function Od(b,A){var H=b.since<=b.until?1:-1;return A===void 0?i(b.since).year():i(b.since).year()+(A-b.offset)*H}function af(){var b,A,H,X=this.localeData().eras();for(b=0,A=X.length;bze&&(A=ze),va.call(this,b,A,H,X,pe))}function va(b,A,H,X,pe){var ze=Go(b,A,H,X,pe),vt=Ra(ze.year,0,ze.dayOfYear);return this.year(vt.getUTCFullYear()),this.month(vt.getUTCMonth()),this.date(vt.getUTCDate()),this}Ft("Q",0,"Qo","quarter"),qt("Q",kt),ri("Q",function(b,A){A[ds]=(zn(b)-1)*3});function wl(b){return b==null?Math.ceil((this.month()+1)/3):this.month((b-1)*3+this.month()%3)}Ft("D",["DD",2],"Do","date"),qt("D",Z,kr),qt("DD",Z,Dt),qt("Do",function(b,A){return b?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),ri(["D","DD"],fr),ri("Do",function(b,A){A[fr]=zn(b.match(Z)[0])});var Fc=Pn("Date",!0);Ft("DDD",["DDDD",3],"DDDo","dayOfYear"),qt("DDD",at),qt("DDDD",tn),ri(["DDD","DDDD"],function(b,A,H){H._dayOfYear=zn(b)});function ba(b){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return b==null?A:this.add(b-A,"d")}Ft("m",["mm",2],0,"minute"),qt("m",Z,ar),qt("mm",Z,Dt),ri(["m","mm"],mr);var Vu=Pn("Minutes",!1);Ft("s",["ss",2],0,"second"),qt("s",Z,ar),qt("ss",Z,Dt),ri(["s","ss"],qn);var tr=Pn("Seconds",!1);Ft("S",0,0,function(){return~~(this.millisecond()/100)}),Ft(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Ft(0,["SSS",3],0,"millisecond"),Ft(0,["SSSS",4],0,function(){return this.millisecond()*10}),Ft(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Ft(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Ft(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Ft(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Ft(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),qt("S",at,kt),qt("SS",at,Dt),qt("SSS",at,tn);var Qo,ko;for(Qo="SSSS";Qo.length<=9;Qo+="S")qt(Qo,gn);function x1(b,A){A[Us]=zn(("0."+b)*1e3)}for(Qo="S";Qo.length<=9;Qo+="S")ri(Qo,x1);ko=Pn("Milliseconds",!1),Ft("z",0,0,"zoneAbbr"),Ft("zz",0,0,"zoneName");function Rd(){return this._isUTC?"UTC":""}function Rb(){return this._isUTC?"Coordinated Universal Time":""}var zt=fe.prototype;zt.add=ct,zt.calendar=si,zt.clone=Mn,zt.diff=jn,zt.endOf=ju,zt.format=ro,zt.from=Rc,zt.fromNow=bl,zt.to=zu,zt.toNow=tf,zt.get=$s,zt.invalidAt=Id,zt.isAfter=Un,zt.isBefore=Tn,zt.isBetween=ni,zt.isSame=bi,zt.isSameOrAfter=oi,zt.isSameOrBefore=Ei,zt.isValid=sf,zt.lang=Mc,zt.locale=Lc,zt.localeData=di,zt.max=Zi,zt.min=ql,zt.parsingFlags=Nc,zt.set=Qr,zt.startOf=Ql,zt.subtract=ft,zt.toArray=gs,zt.toObject=wg,zt.toDate=ks,zt.toISOString=xi,zt.inspect=Er,typeof Symbol<"u"&&Symbol.for!=null&&(zt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),zt.toJSON=rf,zt.toString=_i,zt.unix=Co,zt.valueOf=Dn,zt.creationData=_g,zt.eraName=af,zt.eraNarrow=T,zt.eraAbbr=k,zt.eraYear=O,zt.year=Gt,zt.isLeapYear=Pt,zt.weekYear=Jt,zt.isoWeekYear=_t,zt.quarter=zt.quarters=wl,zt.month=Iu,zt.daysInMonth=Oa,zt.week=zt.weeks=ll,zt.isoWeek=zt.isoWeeks=Ri,zt.weeksInYear=qr,zt.weeksInWeekYear=Ps,zt.isoWeeksInYear=vn,zt.isoWeeksInISOWeekYear=Yn,zt.date=Fc,zt.day=zt.days=Sd,zt.weekday=Cc,zt.isoWeekday=Bl,zt.dayOfYear=ba,zt.hour=zt.hours=Th,zt.minute=zt.minutes=Vu,zt.second=zt.seconds=tr,zt.millisecond=zt.milliseconds=ko,zt.utcOffset=Ua,zt.utc=R,zt.local=z,zt.parseZone=q,zt.hasAlignedHourOffset=Xe,zt.isDST=Je,zt.isLocal=ye,zt.isUtcOffset=me,zt.isUtc=nt,zt.isUTC=nt,zt.zoneAbbr=Rd,zt.zoneName=Rb,zt.dates=Qe("dates accessor is deprecated. Use date instead.",Fc),zt.months=Qe("months accessor is deprecated. Use month instead",Iu),zt.years=Qe("years accessor is deprecated. Use year instead",Gt),zt.zone=Qe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",L),zt.isDSTShifted=Qe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Se);function Lb(b){return Bi(b*1e3)}function Mb(){return Bi.apply(null,arguments).parseZone()}function Nb(b){return b}var Ci=Ut.prototype;Ci.calendar=ai,Ci.longDateFormat=Ur,Ci.invalidDate=Ke,Ci.ordinal=Re,Ci.preparse=Nb,Ci.postformat=Nb,Ci.relativeTime=re,Ci.pastFuture=ge,Ci.set=Wt,Ci.eras=Sg,Ci.erasParse=of,Ci.erasConvertYear=Od,Ci.erasAbbrRegex=B,Ci.erasNameRegex=I,Ci.erasNarrowRegex=Y,Ci.months=Du,Ci.monthsShort=hs,Ci.monthsParse=Ia,Ci.monthsRegex=Tc,Ci.monthsShortRegex=Ml,Ci.week=ol,Ci.firstDayOfYear=to,Ci.firstDayOfWeek=La,Ci.weekdays=Fl,Ci.weekdaysMin=Yo,Ci.weekdaysShort=dl,Ci.weekdaysParse=Ru,Ci.weekdaysRegex=Ul,Ci.weekdaysShortRegex=Na,Ci.weekdaysMinRegex=Hl,Ci.isPM=Td,Ci.meridiem=hl;function Eh(b,A,H,X){var pe=wi(),ze=D().set(X,A);return pe[H](ze,b)}function Fb(b,A,H){if(g(b)&&(A=b,b=void 0),b=b||"",A!=null)return Eh(b,A,H,"month");var X,pe=[];for(X=0;X<12;X++)pe[X]=Eh(b,X,H,"month");return pe}function Tg(b,A,H,X){typeof b=="boolean"?(g(A)&&(H=A,A=void 0),A=A||""):(A=b,H=A,b=!1,g(A)&&(H=A,A=void 0),A=A||"");var pe=wi(),ze=b?pe._week.dow:0,vt,on=[];if(H!=null)return Eh(A,(H+ze)%7,X,"day");for(vt=0;vt<7;vt++)on[vt]=Eh(A,(vt+ze)%7,X,"day");return on}function Bb(b,A){return Fb(b,A,"months")}function Ub(b,A){return Fb(b,A,"monthsShort")}function C1(b,A,H){return Tg(b,A,H,"weekdays")}function Jl(b,A,H){return Tg(b,A,H,"weekdaysShort")}function A1(b,A,H){return Tg(b,A,H,"weekdaysMin")}Jr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(b){var A=b%10,H=zn(b%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return b+H}}),i.lang=Qe("moment.lang is deprecated. Use moment.locale instead.",Jr),i.langData=Qe("moment.langData is deprecated. Use moment.localeData instead.",wi);var $l=Math.abs;function k1(){var b=this._data;return this._milliseconds=$l(this._milliseconds),this._days=$l(this._days),this._months=$l(this._months),b.milliseconds=$l(b.milliseconds),b.seconds=$l(b.seconds),b.minutes=$l(b.minutes),b.hours=$l(b.hours),b.months=$l(b.months),b.years=$l(b.years),this}function Ld(b,A,H,X){var pe=Q(A,H);return b._milliseconds+=X*pe._milliseconds,b._days+=X*pe._days,b._months+=X*pe._months,b._bubble()}function P1(b,A){return Ld(this,b,A,1)}function Hb(b,A){return Ld(this,b,A,-1)}function zb(b){return b<0?Math.floor(b):Math.ceil(b)}function D1(){var b=this._milliseconds,A=this._days,H=this._months,X=this._data,pe,ze,vt,on,Nn;return b>=0&&A>=0&&H>=0||b<=0&&A<=0&&H<=0||(b+=zb(lf(H)+A)*864e5,A=0,H=0),X.milliseconds=b%1e3,pe=Pr(b/1e3),X.seconds=pe%60,ze=Pr(pe/60),X.minutes=ze%60,vt=Pr(ze/60),X.hours=vt%24,A+=Pr(vt/24),Nn=Pr(jb(A)),H+=Nn,A-=zb(lf(Nn)),on=Pr(H/12),H%=12,X.days=A,X.months=H,X.years=on,this}function jb(b){return b*4800/146097}function lf(b){return b*146097/4800}function I1(b){if(!this.isValid())return NaN;var A,H,X=this._milliseconds;if(b=Ge(b),b==="month"||b==="quarter"||b==="year")switch(A=this._days+X/864e5,H=this._months+jb(A),b){case"month":return H;case"quarter":return H/3;case"year":return H/12}else switch(A=this._days+Math.round(lf(this._months)),b){case"week":return A/7+X/6048e5;case"day":return A+X/864e5;case"hour":return A*24+X/36e5;case"minute":return A*1440+X/6e4;case"second":return A*86400+X/1e3;case"millisecond":return Math.floor(A*864e5)+X;default:throw new Error("Unknown unit "+b)}}function eu(b){return function(){return this.as(b)}}var Vb=eu("ms"),O1=eu("s"),R1=eu("m"),L1=eu("h"),M1=eu("d"),N1=eu("w"),Eg=eu("M"),xg=eu("Q"),uf=eu("y"),Wb=Vb;function Cg(){return Q(this)}function Ag(b){return b=Ge(b),this.isValid()?this[b+"s"]():NaN}function _l(b){return function(){return this.isValid()?this._data[b]:NaN}}var qb=_l("milliseconds"),F1=_l("seconds"),xh=_l("minutes"),B1=_l("hours"),Ch=_l("days"),U1=_l("months"),Gb=_l("years");function H1(){return Pr(this.days()/7)}var tu=Math.round,Md={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function z1(b,A,H,X,pe){return pe.relativeTime(A||1,!!H,b,X)}function kg(b,A,H,X){var pe=Q(b).abs(),ze=tu(pe.as("s")),vt=tu(pe.as("m")),on=tu(pe.as("h")),Nn=tu(pe.as("d")),mi=tu(pe.as("M")),qs=tu(pe.as("w")),Sl=tu(pe.as("y")),qu=ze<=H.ss&&["s",ze]||ze0,qu[4]=X,z1.apply(null,qu)}function Wu(b){return b===void 0?tu:typeof b=="function"?(tu=b,!0):!1}function j1(b,A){return Md[b]===void 0?!1:A===void 0?Md[b]:(Md[b]=A,b==="s"&&(Md.ss=A-1),!0)}function Kb(b,A){if(!this.isValid())return this.localeData().invalidDate();var H=!1,X=Md,pe,ze;return typeof b=="object"&&(A=b,b=!1),typeof b=="boolean"&&(H=b),typeof A=="object"&&(X=Object.assign({},Md,A),A.s!=null&&A.ss==null&&(X.ss=A.s-1)),pe=this.localeData(),ze=kg(this,!H,X,pe),H&&(ze=pe.pastFuture(+this,ze)),pe.postformat(ze)}var cf=Math.abs;function Bc(b){return(b>0)-(b<0)||+b}function Jo(){if(!this.isValid())return this.localeData().invalidDate();var b=cf(this._milliseconds)/1e3,A=cf(this._days),H=cf(this._months),X,pe,ze,vt,on=this.asSeconds(),Nn,mi,qs,Sl;return on?(X=Pr(b/60),pe=Pr(X/60),b%=60,X%=60,ze=Pr(H/12),H%=12,vt=b?b.toFixed(3).replace(/\.?0+$/,""):"",Nn=on<0?"-":"",mi=Bc(this._months)!==Bc(on)?"-":"",qs=Bc(this._days)!==Bc(on)?"-":"",Sl=Bc(this._milliseconds)!==Bc(on)?"-":"",Nn+"P"+(ze?mi+ze+"Y":"")+(H?mi+H+"M":"")+(A?qs+A+"D":"")+(pe||X||b?"T":"")+(pe?Sl+pe+"H":"")+(X?Sl+X+"M":"")+(b?Sl+vt+"S":"")):"P0D"}var Si=Uu.prototype;Si.isValid=Oc,Si.abs=k1,Si.add=P1,Si.subtract=Hb,Si.as=I1,Si.asMilliseconds=Vb,Si.asSeconds=O1,Si.asMinutes=R1,Si.asHours=L1,Si.asDays=M1,Si.asWeeks=N1,Si.asMonths=Eg,Si.asQuarters=xg,Si.asYears=uf,Si.valueOf=Wb,Si._bubble=D1,Si.clone=Cg,Si.get=Ag,Si.milliseconds=qb,Si.seconds=F1,Si.minutes=xh,Si.hours=B1,Si.days=Ch,Si.weeks=H1,Si.months=U1,Si.years=Gb,Si.humanize=Kb,Si.toISOString=Jo,Si.toString=Jo,Si.toJSON=Jo,Si.locale=Lc,Si.localeData=di,Si.toIsoString=Qe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jo),Si.lang=Mc,Ft("X",0,0,"unix"),Ft("x",0,0,"valueOf"),qt("x",nn),qt("X",os),ri("X",function(b,A,H){H._d=new Date(parseFloat(b)*1e3)}),ri("x",function(b,A,H){H._d=new Date(zn(b))});//! moment.js return i.version="2.30.1",r(Bi),i.fn=zt,i.min=Zo,i.max=io,i.now=Gl,i.utc=D,i.unix=Lb,i.months=Bb,i.isDate=y,i.locale=Jr,i.invalid=$,i.duration=Q,i.isMoment=ae,i.weekdays=C1,i.parseZone=Mb,i.localeData=wi,i.isDuration=gl,i.monthsShort=Ub,i.weekdaysMin=A1,i.defineLocale=Cs,i.updateLocale=no,i.locales=Lu,i.weekdaysShort=Jl,i.normalizeUnits=Ge,i.relativeTimeRounding=Wu,i.relativeTimeThreshold=j1,i.calendarFormat=An,i.prototype=zt,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i})})(KP);var AW=KP.exports;const kW=Jh(AW);class Fo{static formatDate(e){return kW(e).format("DD/MM/YYYY")}static createTermObject(e){const n={key:e.term_id,label:e.term_label,data:{label:e.term_label}};return e.vocabulary_id&&(n.data.vocabId=e.vocabulary_id),e.vocabulary_name&&(n.data.vocabTitle=e.vocabulary_name),e.data&&(e.data.description&&(n.data.description=e.data.description),e.data.trace&&(n.data.trace=e.data.trace),e.data.link&&(n.data.link=e.data.link)),n}static annotoriousFormatter(){return function(e){var n,i,r,s,o,u;let d="rdwb-ano-shape",h="Medium",g="#506DAC";if(typeof e.body[0]<"u"){const C=e.body[0].value;typeof((i=(n=C.fields)==null?void 0:n["Line Color"])==null?void 0:i.en)<"u"&&(g=C.fields["Line Color"].en[0]),typeof((s=(r=C.fields)==null?void 0:r["Line Weight"])==null?void 0:s.en)<"u"&&(h=C.fields["Line Weight"].en[0])}let y=0;h==="Light"?y=.7:h==="Dark"&&(y=-.5);let w=`stroke:${Fo.adjustColor(g,y)};fill:${Fo.adjustColor(g,y)};fill-opacity:0`;return((u=(o=e.target)==null?void 0:o.renderedVia)==null?void 0:u.name)==="point"&&(w=`fill:${Fo.adjustColor(g,y)};`),{className:d,style:w}}}static isURL(e){return e.match(/^https?:\/\/\S*$/i)}static generateUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static adjustColor(e,n){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),n=n||0;let i="#",r,s;for(s=0;s<3;s++)r=parseInt(e.substring(s*2,s*2+2),16),r=Math.round(Math.min(Math.max(0,r+r*n),255)).toString(16),i+=("00"+r).substring(r.length);return i}}const pu=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},PW={name:"TermTagGroup",props:{terms:{type:Array,required:!0},readOnly:{type:Boolean,default:!1}},emits:["tagRemove"],data(){return{activeTerm:null}},computed:{activeTermUrl(){var t;if(this.activeTerm){if((t=this.activeTerm.data)!=null&&t.link)return this.activeTerm.data.link;if(Fo.isURL(this.activeTerm.key))return this.activeTerm.key}return null}},methods:{selectTerm(t){this.activeTerm&&this.activeTerm.key===t.key?this.activeTerm=null:this.activeTerm=t},removeTag(t){this.activeTerm=null,this.$emit("tagRemove",t)}}},DW={key:0,class:"term-tag-group flex flex-wrap gap-2"},IW=["aria-label"],OW=["onClick"],RW=["onClick"],LW={key:1,class:"text-sm flex flex-wrap gap-2 mt-4"},MW={key:2,class:"mt-5"},NW={key:3,class:"text-sm mt-5"},FW=["href"];function BW(t,e,n,i,r,s){var o;return G(),se("div",null,[n.terms&&n.terms.length>0?(G(),se("div",DW,[(G(!0),se(xt,null,hn(n.terms,u=>(G(),se("div",{key:u.key,class:Lt(["p-chip p-component",{active:r.activeTerm&&r.activeTerm.key===u.key}]),"aria-label":u.label},[ue("div",{class:"p-chip-text",onClick:d=>s.selectTerm(u)},lt(u.label),9,OW),n.readOnly?qe("",!0):(G(),se("span",{key:0,tabindex:"0",class:"p-chip-remove-icon pi pi-times-circle",onClick:d=>s.removeTag(u)},null,8,RW))],10,IW))),128))])):qe("",!0),r.activeTerm&&r.activeTerm.data&&(r.activeTerm.data.vocabTitle||r.activeTerm.data.trace)?(G(),se("div",LW,[ue("span",null,lt(r.activeTerm.data.vocabTitle),1),r.activeTerm.data.trace?(G(!0),se(xt,{key:0},hn(r.activeTerm.data.trace,u=>(G(),se(xt,null,[e[0]||(e[0]=ue("span",null,">",-1)),ue("span",null,lt(u.label),1)],64))),256)):qe("",!0),e[1]||(e[1]=ue("span",null,">",-1)),ue("span",null,lt(r.activeTerm.label),1)])):qe("",!0),r.activeTerm&&(o=r.activeTerm.data)!=null&&o.description?(G(),se("div",MW,lt(r.activeTerm.data.description),1)):qe("",!0),s.activeTermUrl?(G(),se("div",NW,[ue("a",{href:s.activeTermUrl,target:"_blank"},lt(t.$t("ui.details")),9,FW)])):qe("",!0)])}const D_=pu(PW,[["render",BW],["__scopeId","data-v-577e06d9"]]);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:YP,setPrototypeOf:XP,isFrozen:UW,getPrototypeOf:HW,getOwnPropertyDescriptor:zW}=Object;let{freeze:Bo,seal:Za,create:ZP}=Object,{apply:I_,construct:O_}=typeof Reflect<"u"&&Reflect;Bo||(Bo=function(t){return t}),Za||(Za=function(t){return t}),I_||(I_=function(t,e,n){return t.apply(e,n)}),O_||(O_=function(t,e){return new t(...e)});const nv=Ho(Array.prototype.forEach),jW=Ho(Array.prototype.lastIndexOf),QP=Ho(Array.prototype.pop),pm=Ho(Array.prototype.push),VW=Ho(Array.prototype.splice),iv=Ho(String.prototype.toLowerCase),R_=Ho(String.prototype.toString),JP=Ho(String.prototype.match),fm=Ho(String.prototype.replace),WW=Ho(String.prototype.indexOf),qW=Ho(String.prototype.trim),Pl=Ho(Object.prototype.hasOwnProperty),Uo=Ho(RegExp.prototype.test),mm=GW(TypeError);function Ho(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:iv;XP&&XP(t,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const s=n(r);s!==r&&(UW(e)||(e[i]=s),r=s)}t[r]=!0}return t}function KW(t){for(let e=0;e/gm),JW=Za(/\$\{[\w\W]*/gm),$W=Za(/^data-[\-\w.\u00B7-\uFFFF]+$/),eq=Za(/^aria-[\-\w]+$/),iD=Za(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tq=Za(/^(?:\w+script|data):/i),nq=Za(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rD=Za(/^html$/i),iq=Za(/^[a-z][.\w]*(-[.\w]+)+$/i);var sD=Object.freeze({__proto__:null,ARIA_ATTR:eq,ATTR_WHITESPACE:nq,CUSTOM_ELEMENT:iq,DATA_ATTR:$W,DOCTYPE_NAME:rD,ERB_EXPR:QW,IS_ALLOWED_URI:iD,IS_SCRIPT_OR_DATA:tq,MUSTACHE_EXPR:ZW,TMPLIT_EXPR:JW});const ym={element:1,text:3,progressingInstruction:7,comment:8,document:9},rq=function(){return typeof window>"u"?null:window},sq=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},oD=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function aD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rq();const e=He=>aD(He);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==ym.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const i=n,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:u,Element:d,NodeFilter:h,NamedNodeMap:g=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:y,DOMParser:w,trustedTypes:C}=t,D=d.prototype,P=gm(D,"cloneNode"),M=gm(D,"remove"),F=gm(D,"nextSibling"),K=gm(D,"childNodes"),$=gm(D,"parentNode");if(typeof o=="function"){const He=n.createElement("template");He.content&&He.content.ownerDocument&&(n=He.content.ownerDocument)}let ee,he="";const{implementation:ve,createNodeIterator:fe,createDocumentFragment:ae,getElementsByTagName:xe}=n,{importNode:Qe}=i;let ot=oD();e.isSupported=typeof YP=="function"&&typeof $=="function"&&ve&&ve.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:et,ERB_EXPR:pt,TMPLIT_EXPR:Wt,DATA_ATTR:pn,ARIA_ATTR:Ut,IS_SCRIPT_OR_DATA:Xt,ATTR_WHITESPACE:cn,CUSTOM_ELEMENT:ai}=sD;let{IS_ALLOWED_URI:Qt}=sD,xn=null;const ii=gi({},[...$P,...L_,...M_,...N_,...eD]);let Zn=null;const li=gi({},[...tD,...F_,...nD,...rv]);let Ft=Object.seal(ZP(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ui=null,or=null,ji=!0,Vi=!0,Hn=!1,Ur=!0,Fe=!1,Ke=!0,N=!1,ce=!1,Re=!1,Ye=!1,re=!1,ge=!1,Ce=!0,Ge=!1;const Ue="user-content-";let We=!0,rt=!1,kt={},Dt=null;const tn=gi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let dn=null;const te=gi({},["audio","video","img","source","image","track"]);let Z=null;const be=gi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml";let Zt=Et,gn=!1,nn=null;const ur=gi({},[we,at,Et],R_);let ci=gi({},["mi","mo","mn","ms","mtext"]),os=gi({},["annotation-xml"]);const Hr=gi({},["title","style","font","a","script"]);let kr=null;const ar=["application/xhtml+xml","text/html"],wo="text/html";let qt=null,Qs=null;const ca=n.createElement("form"),Zr=function(He){return He instanceof RegExp||He instanceof Function},Pr=function(){let He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qs&&Qs===He)){if((!He||typeof He!="object")&&(He={}),He=ac(He),kr=ar.indexOf(He.PARSER_MEDIA_TYPE)===-1?wo:He.PARSER_MEDIA_TYPE,qt=kr==="application/xhtml+xml"?R_:iv,xn=Pl(He,"ALLOWED_TAGS")?gi({},He.ALLOWED_TAGS,qt):ii,Zn=Pl(He,"ALLOWED_ATTR")?gi({},He.ALLOWED_ATTR,qt):li,nn=Pl(He,"ALLOWED_NAMESPACES")?gi({},He.ALLOWED_NAMESPACES,R_):ur,Z=Pl(He,"ADD_URI_SAFE_ATTR")?gi(ac(be),He.ADD_URI_SAFE_ATTR,qt):be,dn=Pl(He,"ADD_DATA_URI_TAGS")?gi(ac(te),He.ADD_DATA_URI_TAGS,qt):te,Dt=Pl(He,"FORBID_CONTENTS")?gi({},He.FORBID_CONTENTS,qt):tn,ui=Pl(He,"FORBID_TAGS")?gi({},He.FORBID_TAGS,qt):ac({}),or=Pl(He,"FORBID_ATTR")?gi({},He.FORBID_ATTR,qt):ac({}),kt=Pl(He,"USE_PROFILES")?He.USE_PROFILES:!1,ji=He.ALLOW_ARIA_ATTR!==!1,Vi=He.ALLOW_DATA_ATTR!==!1,Hn=He.ALLOW_UNKNOWN_PROTOCOLS||!1,Ur=He.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=He.SAFE_FOR_TEMPLATES||!1,Ke=He.SAFE_FOR_XML!==!1,N=He.WHOLE_DOCUMENT||!1,Ye=He.RETURN_DOM||!1,re=He.RETURN_DOM_FRAGMENT||!1,ge=He.RETURN_TRUSTED_TYPE||!1,Re=He.FORCE_BODY||!1,Ce=He.SANITIZE_DOM!==!1,Ge=He.SANITIZE_NAMED_PROPS||!1,We=He.KEEP_CONTENT!==!1,rt=He.IN_PLACE||!1,Qt=He.ALLOWED_URI_REGEXP||iD,Zt=He.NAMESPACE||Et,ci=He.MATHML_TEXT_INTEGRATION_POINTS||ci,os=He.HTML_INTEGRATION_POINTS||os,Ft=He.CUSTOM_ELEMENT_HANDLING||{},He.CUSTOM_ELEMENT_HANDLING&&Zr(He.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ft.tagNameCheck=He.CUSTOM_ELEMENT_HANDLING.tagNameCheck),He.CUSTOM_ELEMENT_HANDLING&&Zr(He.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ft.attributeNameCheck=He.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),He.CUSTOM_ELEMENT_HANDLING&&typeof He.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ft.allowCustomizedBuiltInElements=He.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fe&&(Vi=!1),re&&(Ye=!0),kt&&(xn=gi({},eD),Zn=[],kt.html===!0&&(gi(xn,$P),gi(Zn,tD)),kt.svg===!0&&(gi(xn,L_),gi(Zn,F_),gi(Zn,rv)),kt.svgFilters===!0&&(gi(xn,M_),gi(Zn,F_),gi(Zn,rv)),kt.mathMl===!0&&(gi(xn,N_),gi(Zn,nD),gi(Zn,rv))),He.ADD_TAGS&&(xn===ii&&(xn=ac(xn)),gi(xn,He.ADD_TAGS,qt)),He.ADD_ATTR&&(Zn===li&&(Zn=ac(Zn)),gi(Zn,He.ADD_ATTR,qt)),He.ADD_URI_SAFE_ATTR&&gi(Z,He.ADD_URI_SAFE_ATTR,qt),He.FORBID_CONTENTS&&(Dt===tn&&(Dt=ac(Dt)),gi(Dt,He.FORBID_CONTENTS,qt)),We&&(xn["#text"]=!0),N&&gi(xn,["html","head","body"]),xn.table&&(gi(xn,["tbody"]),delete ui.tbody),He.TRUSTED_TYPES_POLICY){if(typeof He.TRUSTED_TYPES_POLICY.createHTML!="function")throw mm('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof He.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mm('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ee=He.TRUSTED_TYPES_POLICY,he=ee.createHTML("")}else ee===void 0&&(ee=sq(C,r)),ee!==null&&typeof he=="string"&&(he=ee.createHTML(""));Bo&&Bo(He),Qs=He}},zn=gi({},[...L_,...M_,...YW]),Js=gi({},[...N_,...XW]),ri=function(He){let Gt=$(He);(!Gt||!Gt.tagName)&&(Gt={namespaceURI:Zt,tagName:"template"});const Pt=iv(He.tagName),Pn=iv(Gt.tagName);return nn[He.namespaceURI]?He.namespaceURI===at?Gt.namespaceURI===Et?Pt==="svg":Gt.namespaceURI===we?Pt==="svg"&&(Pn==="annotation-xml"||ci[Pn]):!!zn[Pt]:He.namespaceURI===we?Gt.namespaceURI===Et?Pt==="math":Gt.namespaceURI===at?Pt==="math"&&os[Pn]:!!Js[Pt]:He.namespaceURI===Et?Gt.namespaceURI===at&&!os[Pn]||Gt.namespaceURI===we&&!ci[Pn]?!1:!Js[Pt]&&(Hr[Pt]||!zn[Pt]):!!(kr==="application/xhtml+xml"&&nn[He.namespaceURI]):!1},as=function(He){pm(e.removed,{element:He});try{$(He).removeChild(He)}catch{M(He)}},Bs=function(He,Gt){try{pm(e.removed,{attribute:Gt.getAttributeNode(He),from:Gt})}catch{pm(e.removed,{attribute:null,from:Gt})}if(Gt.removeAttribute(He),He==="is")if(Ye||re)try{as(Gt)}catch{}else try{Gt.setAttribute(He,"")}catch{}},Yi=function(He){let Gt=null,Pt=null;if(Re)He=""+He;else{const Ai=JP(He,/^[\r\n\t ]+/);Pt=Ai&&Ai[0]}kr==="application/xhtml+xml"&&Zt===Et&&(He=''+He+"");const Pn=ee?ee.createHTML(He):He;if(Zt===Et)try{Gt=new w().parseFromString(Pn,kr)}catch{}if(!Gt||!Gt.documentElement){Gt=ve.createDocument(Zt,"template",null);try{Gt.documentElement.innerHTML=gn?he:Pn}catch{}}const Ii=Gt.body||Gt.documentElement;return He&&Pt&&Ii.insertBefore(n.createTextNode(Pt),Ii.childNodes[0]||null),Zt===Et?xe.call(Gt,N?"html":"body")[0]:N?Gt.documentElement:Ii},pr=function(He){return fe.call(He.ownerDocument||He,He,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},ds=function(He){return He instanceof y&&(typeof He.nodeName!="string"||typeof He.textContent!="string"||typeof He.removeChild!="function"||!(He.attributes instanceof g)||typeof He.removeAttribute!="function"||typeof He.setAttribute!="function"||typeof He.namespaceURI!="string"||typeof He.insertBefore!="function"||typeof He.hasChildNodes!="function")},fr=function(He){return typeof u=="function"&&He instanceof u};function Ln(He,Gt,Pt){nv(He,Pn=>{Pn.call(e,Gt,Pt,Qs)})}const mr=function(He){let Gt=null;if(Ln(ot.beforeSanitizeElements,He,null),ds(He))return as(He),!0;const Pt=qt(He.nodeName);if(Ln(ot.uponSanitizeElement,He,{tagName:Pt,allowedTags:xn}),Ke&&He.hasChildNodes()&&!fr(He.firstElementChild)&&Uo(/<[/\w!]/g,He.innerHTML)&&Uo(/<[/\w!]/g,He.textContent)||He.nodeType===ym.progressingInstruction||Ke&&He.nodeType===ym.comment&&Uo(/<[/\w]/g,He.data))return as(He),!0;if(!xn[Pt]||ui[Pt]){if(!ui[Pt]&&Us(Pt)&&(Ft.tagNameCheck instanceof RegExp&&Uo(Ft.tagNameCheck,Pt)||Ft.tagNameCheck instanceof Function&&Ft.tagNameCheck(Pt)))return!1;if(We&&!Dt[Pt]){const Pn=$(He)||He.parentNode,Ii=K(He)||He.childNodes;if(Ii&&Pn){const Ai=Ii.length;for(let $s=Ai-1;$s>=0;--$s){const Qr=P(Ii[$s],!0);Qr.__removalCount=(He.__removalCount||0)+1,Pn.insertBefore(Qr,F(He))}}}return as(He),!0}return He instanceof d&&!ri(He)||(Pt==="noscript"||Pt==="noembed"||Pt==="noframes")&&Uo(/<\/no(script|embed|frames)/i,He.innerHTML)?(as(He),!0):(Fe&&He.nodeType===ym.text&&(Gt=He.textContent,nv([et,pt,Wt],Pn=>{Gt=fm(Gt,Pn," ")}),He.textContent!==Gt&&(pm(e.removed,{element:He.cloneNode()}),He.textContent=Gt)),Ln(ot.afterSanitizeElements,He,null),!1)},qn=function(He,Gt,Pt){if(Ce&&(Gt==="id"||Gt==="name")&&(Pt in n||Pt in ca))return!1;if(!(Vi&&!or[Gt]&&Uo(pn,Gt))&&!(ji&&Uo(Ut,Gt))){if(!Zn[Gt]||or[Gt]){if(!(Us(He)&&(Ft.tagNameCheck instanceof RegExp&&Uo(Ft.tagNameCheck,He)||Ft.tagNameCheck instanceof Function&&Ft.tagNameCheck(He))&&(Ft.attributeNameCheck instanceof RegExp&&Uo(Ft.attributeNameCheck,Gt)||Ft.attributeNameCheck instanceof Function&&Ft.attributeNameCheck(Gt))||Gt==="is"&&Ft.allowCustomizedBuiltInElements&&(Ft.tagNameCheck instanceof RegExp&&Uo(Ft.tagNameCheck,Pt)||Ft.tagNameCheck instanceof Function&&Ft.tagNameCheck(Pt))))return!1}else if(!Z[Gt]&&!Uo(Qt,fm(Pt,cn,""))&&!((Gt==="src"||Gt==="xlink:href"||Gt==="href")&&He!=="script"&&WW(Pt,"data:")===0&&dn[He])&&!(Hn&&!Uo(Xt,fm(Pt,cn,"")))&&Pt)return!1}return!0},Us=function(He){return He!=="annotation-xml"&&JP(He,ai)},Da=function(He){Ln(ot.beforeSanitizeAttributes,He,null);const{attributes:Gt}=He;if(!Gt||ds(He))return;const Pt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Zn,forceKeepAttr:void 0};let Pn=Gt.length;for(;Pn--;){const Ii=Gt[Pn],{name:Ai,namespaceURI:$s,value:Qr}=Ii,gr=qt(Ai),vi=Qr;let Oi=Ai==="value"?vi:qW(vi);if(Pt.attrName=gr,Pt.attrValue=Oi,Pt.keepAttr=!0,Pt.forceKeepAttr=void 0,Ln(ot.uponSanitizeAttribute,He,Pt),Oi=Pt.attrValue,Ge&&(gr==="id"||gr==="name")&&(Bs(Ai,He),Oi=Ue+Oi),Ke&&Uo(/((--!?|])>)|<\/(style|title)/i,Oi)){Bs(Ai,He);continue}if(Pt.forceKeepAttr)continue;if(!Pt.keepAttr){Bs(Ai,He);continue}if(!Ur&&Uo(/\/>/i,Oi)){Bs(Ai,He);continue}Fe&&nv([et,pt,Wt],pa=>{Oi=fm(Oi,pa," ")});const ha=qt(He.nodeName);if(!qn(ha,gr,Oi)){Bs(Ai,He);continue}if(ee&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!$s)switch(C.getAttributeType(ha,gr)){case"TrustedHTML":{Oi=ee.createHTML(Oi);break}case"TrustedScriptURL":{Oi=ee.createScriptURL(Oi);break}}if(Oi!==vi)try{$s?He.setAttributeNS($s,Ai,Oi):He.setAttribute(Ai,Oi),ds(He)?as(He):QP(e.removed)}catch{Bs(Ai,He)}}Ln(ot.afterSanitizeAttributes,He,null)},da=function He(Gt){let Pt=null;const Pn=pr(Gt);for(Ln(ot.beforeSanitizeShadowDOM,Gt,null);Pt=Pn.nextNode();)Ln(ot.uponSanitizeShadowNode,Pt,null),mr(Pt),Da(Pt),Pt.content instanceof s&&He(Pt.content);Ln(ot.afterSanitizeShadowDOM,Gt,null)};return e.sanitize=function(He){let Gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,Pn=null,Ii=null,Ai=null;if(gn=!He,gn&&(He=""),typeof He!="string"&&!fr(He))if(typeof He.toString=="function"){if(He=He.toString(),typeof He!="string")throw mm("dirty is not a string, aborting")}else throw mm("toString is not a function");if(!e.isSupported)return He;if(ce||Pr(Gt),e.removed=[],typeof He=="string"&&(rt=!1),rt){if(He.nodeName){const gr=qt(He.nodeName);if(!xn[gr]||ui[gr])throw mm("root node is forbidden and cannot be sanitized in-place")}}else if(He instanceof u)Pt=Yi(""),Pn=Pt.ownerDocument.importNode(He,!0),Pn.nodeType===ym.element&&Pn.nodeName==="BODY"||Pn.nodeName==="HTML"?Pt=Pn:Pt.appendChild(Pn);else{if(!Ye&&!Fe&&!N&&He.indexOf("<")===-1)return ee&&ge?ee.createHTML(He):He;if(Pt=Yi(He),!Pt)return Ye?null:ge?he:""}Pt&&Re&&as(Pt.firstChild);const $s=pr(rt?He:Pt);for(;Ii=$s.nextNode();)mr(Ii),Da(Ii),Ii.content instanceof s&&da(Ii.content);if(rt)return He;if(Ye){if(re)for(Ai=ae.call(Pt.ownerDocument);Pt.firstChild;)Ai.appendChild(Pt.firstChild);else Ai=Pt;return(Zn.shadowroot||Zn.shadowrootmode)&&(Ai=Qe.call(i,Ai,!0)),Ai}let Qr=N?Pt.outerHTML:Pt.innerHTML;return N&&xn["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Uo(rD,Pt.ownerDocument.doctype.name)&&(Qr=" `+Qr),Fe&&nv([et,pt,Wt],gr=>{Qr=fm(Qr,gr," ")}),ee&&ge?ee.createHTML(Qr):Qr},e.setConfig=function(){let He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pr(He),ce=!0},e.clearConfig=function(){Qs=null,ce=!1},e.isValidAttribute=function(He,Gt,Pt){Qs||Pr({});const Pn=qt(He),Ii=qt(Gt);return qn(Pn,Ii,Pt)},e.addHook=function(He,Gt){typeof Gt=="function"&&pm(ot[He],Gt)},e.removeHook=function(He,Gt){if(Gt!==void 0){const Pt=jW(ot[He],Gt);return Pt===-1?void 0:VW(ot[He],Pt,1)[0]}return QP(ot[He])},e.removeHooks=function(He){ot[He]=[]},e.removeAllHooks=function(){ot=oD()},e}var oq=aD();class sv{static detectHtml(e){return e?e.charAt(0)==="<"&&e.charAt(e.length-1)===">":!1}static sanitizeHtml(e){const n={ALLOWED_TAGS:["a","b","br","i","img","p","small","span","sub","sup"],ALLOWED_ATTR:["href","src","alt"],ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:/^(?:https?|mailto):\/\/\S*|mailto:\S*$/i};return oq.sanitize(e,n)}}const aq={name:"ImageViewer",components:{TermTagGroup:D_,Dialog:nm,TabView:Oy,TabPanel:Ry,Dropdown:Zd,Button:nc},props:{image:{type:String,required:!0},plainImage:{type:Boolean,default:!1},annotations:{type:Array},defaultLanguage:{type:String,default:"en"},light:{type:Number,default:100},displayAnnotations:{type:Boolean,default:!0},highlightedAnnotationId:{type:String,default:null}},emits:["osdInitialized","canvasLoaded","annotationsLoaded","mouseEnterAnnotation","mouseLeaveAnnotation","annotationPopupOpened","annotationPopupClosed"],data(){return{showPopup:!1,popupData:{id:null,language:"en",languages:[],title:{},description:{},links:{},attribution:null,date:null,notes:[],tags:[],comments:[]}}},computed:{webAnnotations(){var t;const e=[];if(this.annotations)for(const n of this.annotations)(t=n.target)!=null&&t.selector&&e.push({"@context":"http://www.w3.org/ns/anno.jsonld",id:n.id,type:"Annotation",body:[{type:"TextualBody",value:n}],target:n.target});return e},popupHasData(){return this.popupData.description[this.popupData.language]||this.popupData.attribution||this.popupData.date||this.popupData.notes.length>0||this.popupData.links[this.popupData.language]||this.popupData.languages.length>1||this.popupData.tags.length>0||this.popupData.comments.length>0}},watch:{annotations(t,e){if(this.annotorious&&(this.annotorious.clearAnnotations(),this.webAnnotations.length>0)){this.annotorious.setAnnotations(this.webAnnotations);const n=[];if(t&&Array.isArray(t))for(const i of t)n.push(i.data);n>0&&this.$emit("annotationsLoaded",n)}},light(t,e){this.setLightLevel()},highlightedAnnotationId(t,e){if(this.annotorious&&(this.$refs.container.querySelectorAll(".highlighted").forEach(n=>n.classList.remove("highlighted")),t)){const n=this.$refs.container.querySelector(`[data-id="${t}"]`);n&&n.classList.add("highlighted")}}},setup(){return{osdViewer:null,annotorious:null,HtmlUtility:sv}},mounted(){this.initViewer()},methods:{initViewer(){const t={element:this.$refs.container,visibilityRatio:1,crossOriginPolicy:!1,prefixUrl:"https://openseadragon.github.io/openseadragon/images/",showZoomControl:!1,showHomeControl:!1,showFullPageControl:!1};if(this.plainImage?t.tileSources={type:"image",url:this.image,buildPyramid:!1}:t.tileSources=[this.image+"/info.json"],this.osdViewer=A8(t),this.$emit("osdInitialized",this.osdViewer),this.displayAnnotations){if(this.annotorious=ok(this.osdViewer,{disableEditor:!0,readOnly:!0,formatters:Fo.annotoriousFormatter()}),this.webAnnotations.length>0){this.annotorious.setAnnotations(this.webAnnotations);const e=[];for(const n of this.annotations)e.push(n.data);this.$emit("annotationsLoaded",e)}this.annotorious.on("selectAnnotation",e=>{this.openPopup(e)}),this.annotorious.on("mouseEnterAnnotation",(e,n)=>{this.$emit("mouseEnterAnnotation",e.id)}),this.annotorious.on("mouseLeaveAnnotation",(e,n)=>{this.$emit("mouseLeaveAnnotation",e.id)}),this.$refs.container.querySelector(".a9s-annotationlayer"),this.setLightLevel()}this.$emit("canvasLoaded")},openPopup(t){this.loadPopupData(t),this.showPopup=!0,this.$emit("annotationPopupOpened",t.id)},onPopupClose(){this.annotorious.cancelSelected(),this.$emit("annotationPopupClosed",this.popupData.id)},initPopupData(){this.popupData={id:null,language:"en",languages:[],title:{},description:{},links:{},attribution:null,date:null,notes:[],tags:[],comments:[]}},loadPopupData(t){var e,n,i,r,s,o;if(this.initPopupData(),this.popupData.id=t.id,typeof t.body[0]<"u"){const u=t.body[0].value;if(u.fields){const d=this.getAnnotationLanguageCodes(u);d.indexOf(this.defaultLanguage)>-1?this.popupData.language=this.defaultLanguage:d.indexOf("en")===-1?this.popupData.language=d[0]:this.popupData.language="en";for(const h of d){const g=th.getLanguageName(h);g&&this.popupData.languages.push({code:h,name:g})}for(const h of d)typeof((e=u.fields.Title)==null?void 0:e[h])<"u"&&(this.popupData.title[h]=u.fields.Title[h][0]),typeof((n=u.fields.Description)==null?void 0:n[h])<"u"&&(this.popupData.description[h]=u.fields.Description[h][0]),typeof((i=u.fields.Link)==null?void 0:i[h])<"u"&&(this.popupData.links[h]=u.fields.Link[h]);if(typeof((r=u.fields.Attribution)==null?void 0:r.en)<"u"&&(this.popupData.attribution=u.fields.Attribution.en[0]),typeof((s=u.fields.Date)==null?void 0:s.en)<"u"&&(this.popupData.date=u.fields.Date.en[0]),typeof((o=u.fields.Note)==null?void 0:o.en)<"u"&&(this.popupData.notes=u.fields.Note.en),typeof u.fields.Tag<"u")for(const h in u.fields.Tag)u.fields.Tag[h].forEach(g=>{const y=Fo.createTermObject(g);this.popupData.tags.push(y)});if(typeof u.fields.Comment<"u")for(const h in u.fields.Comment)u.fields.Comment[h].forEach(g=>{this.popupData.comments.push({language:h,text:g.value,format:g.format})})}}},getAnnotationLanguageCodes(t){let e=[];const n=["Title","Description","Link"];if(t.fields)for(const i in t.fields){if(n.indexOf(i)===-1)continue;const r=t.fields[i];if(r)for(const s in r)e.indexOf(s)===-1&&e.push(s)}return e},formatDate(t){return Fo.formatDate(t)},setLightLevel(){const t=this.$refs.container.querySelector(".a9s-annotationlayer");t.style.backgroundColor=`rgba(33,33,33,${1-this.light/100}`}}},lq={ref:"container",class:"w-full h-full bg-gray-900 anno-viewer-view"},uq={key:0,class:"p-fluid formgrid grid"},cq={class:"field col-12 flex justify-content-end"},dq={key:1},hq={key:2},pq=["href"],fq={key:0,class:"mb-4"},mq={key:1,class:"text-sm text-right"},gq={key:2,class:"text-sm text-right"},yq={key:0,class:"mb-4"},vq={class:"mb-4"},bq=["innerHTML"];function wq(t,e,n,i,r,s){const o=Bt("Dropdown"),u=Bt("TabPanel"),d=Bt("TermTagGroup"),h=Bt("TabView"),g=Bt("Button"),y=Bt("Dialog");return G(),se(xt,null,[ue("div",lq,null,512),gt(y,{visible:r.showPopup,"onUpdate:visible":e[2]||(e[2]=w=>r.showPopup=w),onHide:s.onPopupClose,modal:"",header:r.popupData.title[r.popupData.language]??t.$t("ui.annotation"),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},"append-to":"self",pt:{mask:w=>({style:{"z-index":1e3}})}},{footer:jt(()=>[gt(g,{label:t.$t("ui.close"),icon:"pi pi-times",onClick:e[1]||(e[1]=w=>r.showPopup=!1),outlined:""},null,8,["label"])]),default:jt(()=>[s.popupHasData?(G(),Ct(h,{key:0},{default:jt(()=>[r.popupData.languages.length>1||r.popupData.description[r.popupData.language]||r.popupData.links[r.popupData.language]?(G(),Ct(u,{key:0,header:t.$t("ui.about")},{default:jt(()=>[r.popupData.languages.length>0?(G(),se("div",uq,[ue("div",cq,[gt(o,{id:"anoLanguage",class:"w-5 lg:w-3",modelValue:r.popupData.language,"onUpdate:modelValue":e[0]||(e[0]=w=>r.popupData.language=w),"append-to":"self",options:r.popupData.languages,"option-label":"name","option-value":"code"},null,8,["modelValue","options"])])])):qe("",!0),r.popupData.description?(G(),se("p",dq,lt(r.popupData.description[r.popupData.language]),1)):qe("",!0),r.popupData.links[r.popupData.language]&&r.popupData.links[r.popupData.language].length>0?(G(),se("div",hq,[ue("h5",null,lt(t.$t("ui.links")),1),ue("ul",null,[(G(!0),se(xt,null,hn(r.popupData.links[r.popupData.language],w=>(G(),se("li",null,[ue("a",{href:w.url,target:"_blank"},lt(w.text?w.text:w.url),9,pq)]))),256))])])):qe("",!0)]),_:1},8,["header"])):qe("",!0),r.popupData.tags.length>0?(G(),Ct(u,{key:1,header:t.$t("ui.tags")},{default:jt(()=>[gt(d,{class:"mb-4",terms:r.popupData.tags,"read-only":""},null,8,["terms"])]),_:1},8,["header"])):qe("",!0),r.popupData.attribution||r.popupData.date||r.popupData.notes.length>0?(G(),Ct(u,{key:2,header:t.$t("ui.notes")},{default:jt(()=>[r.popupData.notes.length>0?(G(),se("div",fq,[(G(!0),se(xt,null,hn(r.popupData.notes,w=>(G(),se("p",null,lt(w),1))),256))])):qe("",!0),r.popupData.attribution?(G(),se("div",mq,lt(r.popupData.attribution),1)):qe("",!0),r.popupData.date?(G(),se("div",gq,lt(s.formatDate(r.popupData.date)),1)):qe("",!0)]),_:1},8,["header"])):qe("",!0),r.popupData.comments.length>0?(G(),Ct(u,{key:3,header:t.$t("ui.comments")},{default:jt(()=>[r.popupData.comments.length>0?(G(),se("div",yq,[(G(!0),se(xt,null,hn(r.popupData.comments,w=>(G(),se("div",vq,[w.format==="text/html"?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(w.text)},null,8,bq)):(G(),se(xt,{key:1},[Jn(lt(w.text),1)],64))]))),256))])):qe("",!0)]),_:1},8,["header"])):qe("",!0)]),_:1})):qe("",!0)]),_:1},8,["visible","onHide","header"])],64)}const _q=pu(aq,[["render",wq]]);class Sq{constructor(e){this.image=e,this.canvas=document.createElement("canvas"),this.canvas.width=this.image.width,this.canvas.height=this.image.height,this.canvasContext=this.canvas.getContext("2d")}crop(e){const n=this._calculateCropRectCoordinates(e),i=n[1][0]-n[0][0],r=n[1][1]-n[0][1];this.canvasContext.save(),this.resetCanvas(),this.canvasContext.beginPath(),this.canvasContext.moveTo(e[0][0],e[0][1]);for(let s=1;sr)&&(r=u),(s===null||d>s)&&(s=d)}return[[n,i],[r,s]]}}class Tq{static cropAnnotationImage(e,n){if(!n.hasLoaded())return null;if(!e.target.selector)return n.getImageElement().src;const i=n.getRatio(),r=new Sq(n.getImageElement()),s=e.target.selector;if(s.type==="SvgSelector"){if(s.value.match(/{const h=d.split(","),g=parseFloat(h[0])*i,y=parseFloat(h[1])*i;u.push([g,y])}),r.crop(u)}else if(s.value.match(/parseFloat(u)*i);return r.cropSvgPath(o)}}else if(s.type==="FragmentSelector"){let o=s.value;if(o.match(/=pixel:/)&&(o=o.replace(/=pixel:/,"=")),o.match(/^xywh=([0-9\-.,]+)$/)){const u=[...o.matchAll(/^xywh=([0-9\-.,]+)$/g)][0][1].split(","),d=parseFloat(u[0])*i,h=parseFloat(u[1])*i,g=parseFloat(u[2])*i,y=parseFloat(u[3])*i;if(g>0&&y>0){const w=[[d,h],[d+g,h],[d+g,h+y],[d,h+y]];return r.crop(w)}else if(g===0&&y===0)return r.cropCircle([d,h],50)}}return null}}var ov,vm,$h,ep,od,bm;class lD{constructor(e,n=null,i=!0){if(Mo(this,ov),Mo(this,vm),Mo(this,$h),Mo(this,ep),Mo(this,od),Mo(this,bm),ns(this,vm,i),i){let r="max";n&&(r=`${n},`),ns(this,ov,r)}ns(this,$h,e),ns(this,ep,!1)}async load(){if(Wn(this,ep))return;let e,n;if(Wn(this,vm)){e=`${Wn(this,$h)}/full/${Wn(this,ov)}/0/default.jpg`;const i=`${Wn(this,$h)}/info.json`;n=(await dr.get(i)).data.width}else e=Wn(this,$h);try{ns(this,od,new Image),Wn(this,od).crossOrigin="anonymous",Wn(this,od).src=e,await Wn(this,od).decode(),Wn(this,vm)?ns(this,bm,Wn(this,od).width/n):ns(this,bm,1),ns(this,ep,!0)}catch(i){console.error(i)}}getImageElement(){return Wn(this,od)}getRatio(){return Wn(this,bm)}hasLoaded(){return Wn(this,ep)}}ov=new WeakMap,vm=new WeakMap,$h=new WeakMap,ep=new WeakMap,od=new WeakMap,bm=new WeakMap;const Eq={name:"TableViewer",components:{TermTagGroup:D_,DataTable:Ly,Column:Vw},props:{image:{type:String,required:!0},plainImage:{type:Boolean,default:!1},annotations:{type:Array},tableColumns:{type:Array,default:()=>["Title","Description","Links","Tags","Notes","Comments"]},srcImageSize:{type:Number,default:1024}},data(){return{imageElement:null,cropper:null,ratio:1,imageLoader:null}},computed:{annotationImages(){const t={};return this.imageLoader&&this.annotations.forEach(e=>{t[e.id]=Tq.cropAnnotationImage(e,Rn(this.imageLoader))}),t}},watch:{image(t,e){t&&t!==e&&this.loadImage(t)}},setup(){return{HtmlUtility:sv}},created(){this.loadImage(this.image)},methods:{getAnnotationTags(t){var e;const n=[];if(typeof((e=t.fields)==null?void 0:e.Tag)<"u")for(const i in t.fields.Tag)t.fields.Tag[i].forEach(r=>{const s=Fo.createTermObject(r);n.push(s)});return n},async loadImage(t){this.imageLoader=null;let e;this.plainImage?e=new lD(t,null,!1):e=new lD(t,this.srcImageSize),await e.load(),this.imageLoader=e},onTablePageChange(){this.$nextTick(()=>{this.$refs.tableTop.scrollIntoView({behavior:"smooth"})})},formatDate(t){return Fo.formatDate(t)}}},xq={key:0,class:"w-full h-full bg-gray-900",style:{"overflow-y":"auto"}},Cq={class:"p-4 my-7"},Aq={ref:"tableTop"},kq=["src"],Pq={key:1,class:"pi pi-spin pi-spinner",style:{"font-size":"2rem"}},Dq={class:"mb-2"},Iq={class:"mb-2"},Oq={class:"mb-2"},Rq={class:"mb-2"},Lq={class:"mb-2"},Mq={class:"mb-2"},Nq=["href"],Fq={class:"mb-2"},Bq={class:"mb-2"},Uq={class:"mb-2"},Hq={class:"mb-2"},zq={class:"mb-2"},jq={class:"mb-2"},Vq={class:"mb-2"},Wq={class:"mb-2"},qq={class:"mb-2"},Gq={class:"mb-2"},Kq={class:"mb-2"},Yq=["innerHTML"],Xq={key:1,class:"flex flex-column align-items-center justify-content-center w-full h-full bg-gray-900 text-color-secondary"};function Zq(t,e,n,i,r,s){const o=Bt("Column"),u=Bt("TermTagGroup"),d=Bt("DataTable");return n.annotations&&n.annotations.length>0?(G(),se("div",xq,[ue("div",Cq,[ue("div",Aq,null,512),gt(d,{value:n.annotations,tableClass:"w-full",paginator:"",rows:10,onPage:s.onTablePageChange},{default:jt(()=>[gt(o,{header:t.$t("ui.image")},{body:jt(h=>[this.annotationImages[h.data.id]?(G(),se("img",{key:0,style:{"max-width":"200px"},src:this.annotationImages[h.data.id]},null,8,kq)):this.annotationImages[h.data.id]===void 0?(G(),se("i",Pq)):qe("",!0)]),_:1},8,["header"]),n.tableColumns.indexOf("Title")>=0?(G(),Ct(o,{key:0,header:t.$t("ui.title")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Title?(G(!0),se(xt,{key:0},hn(h.data.fields.Title,(y,w)=>(G(),se("div",Dq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Iq,lt(C),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Description")>=0?(G(),Ct(o,{key:1,header:t.$t("ui.description")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Description?(G(!0),se(xt,{key:0},hn(h.data.fields.Description,(y,w)=>(G(),se("div",Oq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Rq,lt(C),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Links")>=0?(G(),Ct(o,{key:2,header:t.$t("ui.links")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Link?(G(!0),se(xt,{key:0},hn(h.data.fields.Link,(y,w)=>(G(),se("div",Lq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Mq,[ue("a",{href:C.url,target:"_blank"},lt(C.text),9,Nq)]))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Tags")>=0?(G(),Ct(o,{key:3,style:{width:"20%"},header:t.$t("ui.tags")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Tag?(G(),Ct(u,{key:0,class:"mb-4",terms:s.getAnnotationTags(h.data),"read-only":""},null,8,["terms"])):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Notes")>=0?(G(),Ct(o,{key:4,header:t.$t("ui.notes")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Note?(G(!0),se(xt,{key:0},hn(h.data.fields.Note,(y,w)=>(G(),se("div",Fq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Bq,lt(C),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Attribution")>=0?(G(),Ct(o,{key:5,header:t.$t("ui.attribution")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Attribution?(G(!0),se(xt,{key:0},hn(h.data.fields.Attribution,(y,w)=>(G(),se("div",Uq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Hq,lt(C),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Date")>=0?(G(),Ct(o,{key:6,header:t.$t("ui.date")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Date?(G(!0),se(xt,{key:0},hn(h.data.fields.Date,(y,w)=>(G(),se("div",zq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",jq,lt(s.formatDate(C)),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Line Color")>=0?(G(),Ct(o,{key:7,header:t.$t("ui.lineColor")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g["Line Color"]?(G(!0),se(xt,{key:0},hn(h.data.fields["Line Color"],(y,w)=>(G(),se("div",Vq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",{class:"mb-2",style:hi(`width:20px;height:20px;background-color:${C};`)},null,4))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Line Weight")>=0?(G(),Ct(o,{key:8,header:t.$t("ui.lineWeight")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g["Line Weight"]?(G(!0),se(xt,{key:0},hn(h.data.fields["Line Weight"],(y,w)=>(G(),se("div",Wq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",qq,lt(C),1))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0),n.tableColumns.indexOf("Comments")>=0?(G(),Ct(o,{key:9,header:t.$t("ui.comments")},{body:jt(h=>{var g;return[(g=h.data.fields)!=null&&g.Comment?(G(!0),se(xt,{key:0},hn(h.data.fields.Comment,(y,w)=>(G(),se("div",Gq,[(G(!0),se(xt,null,hn(y,C=>(G(),se("div",Kq,[C.format==="text/html"?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(C.value)},null,8,Yq)):(G(),se(xt,{key:1},[Jn(lt(C.value),1)],64))]))),256))]))),256)):qe("",!0)]}),_:1},8,["header"])):qe("",!0)]),_:1},8,["value","onPage"])])])):(G(),se("div",Xq,[e[0]||(e[0]=ue("div",null,[ue("i",{class:"pi pi-comment",style:{"font-size":"7rem"}})],-1)),ue("div",null,lt(t.$t("message.noAnnotations")),1)]))}const Qq=pu(Eq,[["render",Zq],["__scopeId","data-v-7415e6dc"]]);var wm;typeof window<"u"?wm=window:typeof hm<"u"?wm=hm:typeof self<"u"?wm=self:wm={};var av=wm;const Oe=Jh(av),Jq={},$q=Object.freeze(Object.defineProperty({__proto__:null,default:Jq},Symbol.toStringTag,{value:"Module"})),eG=GP($q);var uD=typeof hm<"u"?hm:typeof window<"u"?window:{},tG=eG,_m;typeof document<"u"?_m=document:(_m=uD["__GLOBAL_DOCUMENT_CACHE@4"],_m||(_m=uD["__GLOBAL_DOCUMENT_CACHE@4"]=tG));var cD=_m;const Vt=Jh(cD);var B_={exports:{}};function Kr(){return Kr=Object.assign?Object.assign.bind():function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lG(t,e){if(t){if(typeof t=="string")return dD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dD(t,e)}}function dD(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=400&&i.statusCode<=599){var s=r;if(e)if(fG.TextDecoder){var o=gG(i.headers&&i.headers["content-type"]);try{s=new TextDecoder(o).decode(r)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(r));t({cause:s});return}t(null,r)}};function gG(t){return t===void 0&&(t=""),t.toLowerCase().split(";").reduce(function(e,n){var i=n.split("="),r=i[0],s=i[1];return r.trim()==="charset"?s.trim():e},"utf-8")}var yG=mG,hD=av,vG=iG,bG=rG,pD=cG,wG=pG;rs.httpHandler=yG,rs.requestInterceptorsStorage=new pD,rs.responseInterceptorsStorage=new pD,rs.retryManager=new wG;/** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * */var _G=function(t){var e={};return t&&t.trim().split(` `).forEach(function(n){var i=n.indexOf(":"),r=n.slice(0,i).trim().toLowerCase(),s=n.slice(i+1).trim();typeof e[r]>"u"?e[r]=s:Array.isArray(e[r])?e[r].push(s):e[r]=[e[r],s]}),e};B_.exports=rs,B_.exports.default=rs,rs.XMLHttpRequest=hD.XMLHttpRequest||xG,rs.XDomainRequest="withCredentials"in new rs.XMLHttpRequest?rs.XMLHttpRequest:hD.XDomainRequest,SG(["get","put","post","patch","head","delete"],function(t){rs[t==="delete"?"del":t]=function(e,n,i){return n=fD(e,n,i),n.method=t.toUpperCase(),U_(n)}});function SG(t,e){for(var n=0;n"u")throw new Error("callback argument missing");if(t.requestType&&rs.requestInterceptorsStorage.getIsEnabled()){var e={uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout},n=rs.requestInterceptorsStorage.execute(t.requestType,e);t.uri=n.uri,t.headers=n.headers,t.body=n.body,t.metadata=n.metadata,t.retry=n.retry,t.timeout=n.timeout}var i=!1,r=function(ee,he,ve){i||(i=!0,t.callback(ee,he,ve))};function s(){h.readyState===4&&!rs.responseInterceptorsStorage.getIsEnabled()&&setTimeout(d,0)}function o(){var ee=void 0;if(h.response?ee=h.response:ee=h.responseText||EG(h),F)try{ee=JSON.parse(ee)}catch{}return ee}function u(ee){if(clearTimeout(K),clearTimeout(t.retryTimeout),ee instanceof Error||(ee=new Error(""+(ee||"Unknown XMLHttpRequest Error"))),ee.statusCode=0,!y&&rs.retryManager.getIsEnabled()&&t.retry&&t.retry.shouldRetry()){t.retryTimeout=setTimeout(function(){t.retry.moveToNextAttempt(),t.xhr=h,U_(t)},t.retry.getCurrentFuzzedDelay());return}if(t.requestType&&rs.responseInterceptorsStorage.getIsEnabled()){var he={headers:$.headers||{},body:$.body,responseUrl:h.responseURL,responseType:h.responseType},ve=rs.responseInterceptorsStorage.execute(t.requestType,he);$.body=ve.body,$.headers=ve.headers}return r(ee,$)}function d(){if(!y){var ee;clearTimeout(K),clearTimeout(t.retryTimeout),t.useXDR&&h.status===void 0?ee=200:ee=h.status===1223?204:h.status;var he=$,ve=null;if(ee!==0?(he={body:o(),statusCode:ee,method:C,headers:{},url:w,rawRequest:h},h.getAllResponseHeaders&&(he.headers=_G(h.getAllResponseHeaders()))):ve=new Error("Internal XMLHttpRequest Error"),t.requestType&&rs.responseInterceptorsStorage.getIsEnabled()){var fe={headers:he.headers||{},body:he.body,responseUrl:h.responseURL,responseType:h.responseType},ae=rs.responseInterceptorsStorage.execute(t.requestType,fe);he.body=ae.body,he.headers=ae.headers}return r(ve,he,he.body)}}var h=t.xhr||null;h||(t.cors||t.useXDR?h=new rs.XDomainRequest:h=new rs.XMLHttpRequest);var g,y,w=h.url=t.uri||t.url,C=h.method=t.method||"GET",D=t.body||t.data,P=h.headers=t.headers||{},M=!!t.sync,F=!1,K,$={body:void 0,headers:{},statusCode:0,method:C,url:w,rawRequest:h};if("json"in t&&t.json!==!1&&(F=!0,P.accept||P.Accept||(P.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(P["content-type"]||P["Content-Type"]||(P["Content-Type"]="application/json"),D=JSON.stringify(t.json===!0?D:t.json))),h.onreadystatechange=s,h.onload=d,h.onerror=u,h.onprogress=function(){},h.onabort=function(){y=!0,clearTimeout(t.retryTimeout)},h.ontimeout=u,h.open(C,w,!M,t.username,t.password),M||(h.withCredentials=!!t.withCredentials),!M&&t.timeout>0&&(K=setTimeout(function(){if(!y){y=!0,h.abort("timeout");var ee=new Error("XMLHttpRequest timeout");ee.code="ETIMEDOUT",u(ee)}},t.timeout)),h.setRequestHeader)for(g in P)P.hasOwnProperty(g)&&h.setRequestHeader(g,P[g]);else if(t.headers&&!TG(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(h.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(h),h.send(D||null),h}function EG(t){try{if(t.responseType==="document")return t.responseXML;var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e)return t.responseXML}catch{}return null}function xG(){}var CG=B_.exports;const mD=Jh(CG);var gD={exports:{}},yD=cD,H_=Object.create||function(){function t(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function Ta(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}Ta.prototype=H_(Error.prototype),Ta.prototype.constructor=Ta,Ta.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function z_(t){function e(i,r,s,o){return(i|0)*3600+(r|0)*60+(s|0)+(o|0)/1e3}var n=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?e(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?e(n[1],n[2],0,n[4]):e(0,n[1],n[2],n[4]):null}function Sm(){this.values=H_(null)}Sm.prototype={set:function(t,e){!this.get(t)&&e!==""&&(this.values[t]=e)},get:function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,n){for(var i=0;i=0&&e<=100)?(this.set(t,e),!0):!1}};function Tm(t,e,n,i){var r=i?t.split(i):[t];for(var s in r)if(typeof r[s]=="string"){var o=r[s].split(n);if(o.length===2){var u=o[0].trim(),d=o[1].trim();e(u,d)}}}function AG(t,e,n){var i=t;function r(){var u=z_(t);if(u===null)throw new Ta(Ta.Errors.BadTimeStamp,"Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),u}function s(u,d){var h=new Sm;Tm(u,function(g,y){switch(g){case"region":for(var w=n.length-1;w>=0;w--)if(n[w].id===y){h.set(g,n[w].region);break}break;case"vertical":h.alt(g,y,["rl","lr"]);break;case"line":var C=y.split(","),D=C[0];h.integer(g,D),h.percent(g,D)&&h.set("snapToLines",!1),h.alt(g,D,["auto"]),C.length===2&&h.alt("lineAlign",C[1],["start","center","end"]);break;case"position":C=y.split(","),h.percent(g,C[0]),C.length===2&&h.alt("positionAlign",C[1],["start","center","end"]);break;case"size":h.percent(g,y);break;case"align":h.alt(g,y,["start","center","end","left","right"]);break}},/:/,/\s/),d.region=h.get("region",null),d.vertical=h.get("vertical","");try{d.line=h.get("line","auto")}catch{}d.lineAlign=h.get("lineAlign","start"),d.snapToLines=h.get("snapToLines",!0),d.size=h.get("size",100);try{d.align=h.get("align","center")}catch{d.align=h.get("align","middle")}try{d.position=h.get("position","auto")}catch{d.position=h.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},d.align)}d.positionAlign=h.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},d.align)}function o(){t=t.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),t.substr(0,3)!=="-->")throw new Ta(Ta.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+i);t=t.substr(3),o(),e.endTime=r(),o(),s(t,e)}var j_=yD.createElement&&yD.createElement("textarea"),kG={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},vD={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},PG={v:"title",lang:"lang"},bD={rt:"ruby"};function wD(t,e){function n(){if(!e)return null;function D(M){return e=e.substr(M.length),M}var P=e.match(/^([^<]*)(<[^>]*>?)?/);return D(P[1]?P[1]:P[2])}function i(D){return j_.innerHTML=D,D=j_.textContent,j_.textContent="",D}function r(D,P){return!bD[P.localName]||bD[P.localName]===D.localName}function s(D,P){var M=kG[D];if(!M)return null;var F=t.document.createElement(M),K=PG[D];return K&&P&&(F[K]=P.trim()),F}for(var o=t.document.createElement("div"),u=o,d,h=[];(d=n())!==null;){if(d[0]==="<"){if(d[1]==="/"){h.length&&h[h.length-1]===d.substr(2).replace(">","")&&(h.pop(),u=u.parentNode);continue}var g=z_(d.substr(1,d.length-2)),y;if(g){y=t.document.createProcessingInstruction("timestamp",g),u.appendChild(y);continue}var w=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!w||(y=s(w[1],w[3]),!y)||!r(u,y))continue;if(w[2]){var C=w[2].split(".");C.forEach(function(D){var P=/^bg_/.test(D),M=P?D.slice(3):D;if(vD.hasOwnProperty(M)){var F=P?"background-color":"color",K=vD[M];y.style[F]=K}}),y.className=C.join(" ")}h.push(w[1]),u.appendChild(y),u=y;continue}u.appendChild(t.document.createTextNode(i(d)))}return o}var _D=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function DG(t){for(var e=0;e<_D.length;e++){var n=_D[e];if(t>=n[0]&&t<=n[1])return!0}return!1}function IG(t){var e=[],n="",i;if(!t||!t.childNodes)return"ltr";function r(u,d){for(var h=d.childNodes.length-1;h>=0;h--)u.push(d.childNodes[h])}function s(u){if(!u||!u.length)return null;var d=u.pop(),h=d.textContent||d.innerText;if(h){var g=h.match(/^.*(\n|\r)/);return g?(u.length=0,g[0]):h}if(d.tagName==="ruby")return s(u);if(d.childNodes)return r(u,d),s(u)}for(r(e,t);n=s(e);)for(var o=0;o=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,n=e.textTrackList,i=0,r=0;rt.left&&this.topt.top},zo.prototype.overlapsAny=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},zo.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},zo.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),n=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),i=e*n;return i/(this.height*this.width)},zo.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},zo.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,n=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,i=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var r={left:t.left,right:t.right,top:t.top||i,height:t.height||e,bottom:t.bottom||i+(t.height||e),width:t.width||n};return r};function RG(t,e,n,i){function r(M,F){for(var K,$=new zo(M),ee=1,he=0;heve&&(K=new zo(M),ee=ve),M=new zo($)}return K||$}var s=new zo(e),o=e.cue,u=OG(o),d=[];if(o.snapToLines){var h;switch(o.vertical){case"":d=["+y","-y"],h="height";break;case"rl":d=["+x","-x"],h="width";break;case"lr":d=["-x","+x"],h="width";break}var g=s.lineHeight,y=g*Math.round(u),w=n[h]+g,C=d[0];Math.abs(y)>w&&(y=y<0?-1:1,y*=Math.ceil(w/g)*g),u<0&&(y+=o.vertical===""?n.height:n.width,d=d.reverse()),s.move(C,y)}else{var D=s.lineHeight/n.height*100;switch(o.lineAlign){case"center":u-=D/2;break;case"end":u-=D;break}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(u,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(u,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(u,"%")});break}d=["+y","-x","+x","-y"],s=new zo(e)}var P=r(s,d);e.move(P.toCSSCompatValues(n))}function tp(){}tp.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},tp.convertCueToDOMTree=function(t,e){return!t||!e?null:wD(t,e)};var LG=.05,MG="sans-serif",NG="1.5%";tp.processCues=function(t,e,n){if(!t||!e||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=t.document.createElement("div");i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin=NG,n.appendChild(i);function r(g){for(var y=0;y")===-1){e.cue.id=o;continue}case"CUE":try{AG(o,e.cue,e.regionList)}catch(g){e.reportOrThrowError(g),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var h=o.indexOf("-->")!==-1;if(!o||h&&(d=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` `),e.cue.text+=o.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":o||(e.state="ID");continue}}}catch(g){e.reportOrThrowError(g),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||t.state==="HEADER")&&(t.buffer+=` `,t.parse()),t.state==="INITIAL")throw new Ta(Ta.Errors.BadSignature)}catch(e){t.reportOrThrowError(e)}return t.onflush&&t.onflush(),this}};var FG=tp,BG="auto",UG={"":1,lr:1,rl:1},HG={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function zG(t){if(typeof t!="string")return!1;var e=UG[t.toLowerCase()];return e?t.toLowerCase():!1}function V_(t){if(typeof t!="string")return!1;var e=HG[t.toLowerCase()];return e?t.toLowerCase():!1}function SD(t,e,n){this.hasBeenReset=!1;var i="",r=!1,s=t,o=e,u=n,d=null,h="",g=!0,y="auto",w="start",C="auto",D="auto",P=100,M="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(F){i=""+F}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(F){r=!!F}},startTime:{enumerable:!0,get:function(){return s},set:function(F){if(typeof F!="number")throw new TypeError("Start time must be set to a number.");s=F,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return o},set:function(F){if(typeof F!="number")throw new TypeError("End time must be set to a number.");o=F,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(F){u=""+F,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return d},set:function(F){d=F,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(F){var K=zG(F);if(K===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=K,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return g},set:function(F){g=!!F,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(F){if(typeof F!="number"&&F!==BG)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=F,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return w},set:function(F){var K=V_(F);K?(w=K,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return C},set:function(F){if(F<0||F>100)throw new Error("Position must be between 0 and 100.");C=F,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return D},set:function(F){var K=V_(F);K?(D=K,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return P},set:function(F){if(F<0||F>100)throw new Error("Size must be between 0 and 100.");P=F,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return M},set:function(F){var K=V_(F);if(!K)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");M=K,this.hasBeenReset=!0}}}),this.displayState=void 0}SD.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var jG=SD,VG={"":!0,up:!0};function WG(t){if(typeof t!="string")return!1;var e=VG[t.toLowerCase()];return e?t.toLowerCase():!1}function Em(t){return typeof t=="number"&&t>=0&&t<=100}function qG(){var t=100,e=3,n=0,i=100,r=0,s=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(u){if(!Em(u))throw new Error("Width must be between 0 and 100.");t=u}},lines:{enumerable:!0,get:function(){return e},set:function(u){if(typeof u!="number")throw new TypeError("Lines must be set to a number.");e=u}},regionAnchorY:{enumerable:!0,get:function(){return i},set:function(u){if(!Em(u))throw new Error("RegionAnchorX must be between 0 and 100.");i=u}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(u){if(!Em(u))throw new Error("RegionAnchorY must be between 0 and 100.");n=u}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(u){if(!Em(u))throw new Error("ViewportAnchorY must be between 0 and 100.");s=u}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(u){if(!Em(u))throw new Error("ViewportAnchorX must be between 0 and 100.");r=u}},scroll:{enumerable:!0,get:function(){return o},set:function(u){var d=WG(u);d===!1?console.warn("Scroll: an invalid or illegal string was specified."):o=d}}})}var GG=qG,lc=av,nh=gD.exports={WebVTT:FG,VTTCue:jG,VTTRegion:GG};lc.vttjs=nh,lc.WebVTT=nh.WebVTT;var KG=nh.VTTCue,YG=nh.VTTRegion,XG=lc.VTTCue,ZG=lc.VTTRegion;nh.shim=function(){lc.VTTCue=KG,lc.VTTRegion=YG},nh.restore=function(){lc.VTTCue=XG,lc.VTTRegion=ZG},lc.VTTCue||nh.shim();var QG=gD.exports;const TD=Jh(QG);var ED="https://example.com",cv=function(t,e){if(/^[a-z]+:/i.test(e))return e;/^data:/.test(t)&&(t=Oe.location&&Oe.location.href||"");var n=/^\/\//.test(t),i=!Oe.location&&!/\/\//i.test(t);t=new Oe.URL(t,Oe.location||ED);var r=new URL(e,t);return i?r.href.slice(ED.length):n?r.href.slice(r.protocol.length):r.href},W_=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(n,i){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(i)},e.off=function(n,i){if(!this.listeners[n])return!1;var r=this.listeners[n].indexOf(i);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(r,1),r>-1},e.trigger=function(n){var i=this.listeners[n];if(i)if(arguments.length===2)for(var r=i.length,s=0;s-1;n=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,n)),this.buffer=this.buffer.substring(n+1)}}const eK=" ",q_=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),n={};return e[1]&&(n.length=parseInt(e[1],10)),e[2]&&(n.offset=parseInt(e[2],10)),n},tK=function(){const t='(?:[^=]*)=(?:"[^"]*"|[^,]*)';return new RegExp("(?:^|,)("+t+")")},jo=function(t){const e={};if(!t)return e;const n=t.split(tK());let i=n.length,r;for(;i--;)n[i]!==""&&(r=/([^=]*)=(.*)/.exec(n[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},CD=t=>{const e=t.split("x"),n={};return e[0]&&(n.width=parseInt(e[0],10)),e[1]&&(n.height=parseInt(e[1],10)),n};class nK extends W_{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let n,i;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((r,s)=>{const o=s(e);return o===e?r:r.concat([o])},[e]).forEach(r=>{for(let s=0;ss),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:i(s),customType:n,segment:r}),!0})}addTagMapper({expression:e,map:n}){const i=r=>e.test(r)?n(r):r;this.tagMappers.push(i)}}const iK=t=>t.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),ad=function(t){const e={};return Object.keys(t).forEach(function(n){e[iK(n)]=t[n]}),e},G_=function(t){const{serverControl:e,targetDuration:n,partTargetDuration:i}=t;if(!e)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",o="partHoldBack",u=n&&n*3,d=i&&i*2;n&&!e.hasOwnProperty(s)&&(e[s]=u,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[s]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&o&&(r.key=o),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(P){let M,F;if(n.manifest.definitions){for(const K in n.manifest.definitions)if(P.uri&&(P.uri=P.uri.replace(`{$${K}}`,n.manifest.definitions[K])),P.attributes)for(const $ in P.attributes)typeof P.attributes[$]=="string"&&(P.attributes[$]=P.attributes[$].replace(`{$${K}}`,n.manifest.definitions[K]))}({tag(){({version(){P.version&&(this.manifest.version=P.version)},"allow-cache"(){this.manifest.allowCache=P.allowed,"allowed"in P||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const K={};"length"in P&&(r.byterange=K,K.length=P.length,"offset"in P||(P.offset=w)),"offset"in P&&(r.byterange=K,K.offset=P.offset),w=K.offset+K.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),P.title&&(r.title=P.title),P.duration>0&&(r.duration=P.duration),P.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!P.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(P.attributes.METHOD==="NONE"){o=null;return}if(!P.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(P.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:P.attributes};return}if(P.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:P.attributes.URI};return}if(P.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(P.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(P.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),P.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(P.attributes.KEYID&&P.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:P.attributes.KEYFORMAT,keyId:P.attributes.KEYID.substring(2)},pssh:xD(P.attributes.URI.split(",")[1])};return}P.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:P.attributes.METHOD||"AES-128",uri:P.attributes.URI},typeof P.attributes.IV<"u"&&(o.iv=P.attributes.IV)},"media-sequence"(){if(!isFinite(P.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+P.number});return}this.manifest.mediaSequence=P.number},"discontinuity-sequence"(){if(!isFinite(P.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+P.number});return}this.manifest.discontinuitySequence=P.number,y=P.number},"playlist-type"(){if(!/VOD|EVENT/.test(P.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+P.playlist});return}this.manifest.playlistType=P.playlistType},map(){s={},P.uri&&(s.uri=P.uri),P.byterange&&(s.byterange=P.byterange),o&&(s.key=o)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||h,!P.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Kr(r.attributes,P.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(P.attributes&&P.attributes.TYPE&&P.attributes["GROUP-ID"]&&P.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const K=this.manifest.mediaGroups[P.attributes.TYPE];K[P.attributes["GROUP-ID"]]=K[P.attributes["GROUP-ID"]]||{},M=K[P.attributes["GROUP-ID"]],F={default:/yes/i.test(P.attributes.DEFAULT)},F.default?F.autoselect=!0:F.autoselect=/yes/i.test(P.attributes.AUTOSELECT),P.attributes.LANGUAGE&&(F.language=P.attributes.LANGUAGE),P.attributes.URI&&(F.uri=P.attributes.URI),P.attributes["INSTREAM-ID"]&&(F.instreamId=P.attributes["INSTREAM-ID"]),P.attributes.CHARACTERISTICS&&(F.characteristics=P.attributes.CHARACTERISTICS),P.attributes.FORCED&&(F.forced=/yes/i.test(P.attributes.FORCED)),M[P.attributes.NAME]=F},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=P.dateTimeString,this.manifest.dateTimeObject=P.dateTimeObject),r.dateTimeString=P.dateTimeString,r.dateTimeObject=P.dateTimeObject;const{lastProgramDateTime:K}=this;this.lastProgramDateTime=new Date(P.dateTimeString).getTime(),K===null&&this.manifest.segments.reduceRight(($,ee)=>(ee.programDateTime=$-ee.duration*1e3,ee.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(P.duration)||P.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+P.duration});return}this.manifest.targetDuration=P.duration,G_.call(this,this.manifest)},start(){if(!P.attributes||isNaN(P.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:P.attributes["TIME-OFFSET"],precise:P.attributes.PRECISE}},"cue-out"(){r.cueOut=P.data},"cue-out-cont"(){r.cueOutCont=P.data},"cue-in"(){r.cueIn=P.data},skip(){this.manifest.skip=ad(P.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",P.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const K=this.manifest.segments.length,$=ad(P.attributes);r.parts=r.parts||[],r.parts.push($),$.byterange&&($.byterange.hasOwnProperty("offset")||($.byterange.offset=C),C=$.byterange.offset+$.byterange.length);const ee=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${ee} for segment #${K}`,P.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((he,ve)=>{he.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${ve} lacks required attribute(s): LAST-PART`})})},"server-control"(){const K=this.manifest.serverControl=ad(P.attributes);K.hasOwnProperty("canBlockReload")||(K.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),G_.call(this,this.manifest),K.canSkipDateranges&&!K.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const K=this.manifest.segments.length,$=ad(P.attributes),ee=$.type&&$.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push($),$.byterange&&($.byterange.hasOwnProperty("offset")||($.byterange.offset=ee?C:0,ee&&(C=$.byterange.offset+$.byterange.length)));const he=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${he} for segment #${K}`,P.attributes,["TYPE","URI"]),!!$.type)for(let ve=0;veve.id===$.id);this.manifest.dateRanges[he]=Kr(this.manifest.dateRanges[he],$),D[$.id]=Kr(D[$.id],$),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=ad(P.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",P.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const K=($,ee)=>{if($ in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${$}`});return}this.manifest.definitions[$]=ee};if("QUERYPARAM"in P.attributes){if("NAME"in P.attributes||"IMPORT"in P.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const $=this.params.get(P.attributes.QUERYPARAM);if(!$){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${P.attributes.QUERYPARAM}`});return}K(P.attributes.QUERYPARAM,decodeURIComponent($));return}if("NAME"in P.attributes){if("IMPORT"in P.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in P.attributes)||typeof P.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${P.attributes.NAME}`});return}K(P.attributes.NAME,P.attributes.VALUE);return}if("IMPORT"in P.attributes){if(!this.mainDefinitions[P.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${P.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}K(P.attributes.IMPORT,this.mainDefinitions[P.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:P.attributes,uri:P.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",P.attributes,["BANDWIDTH","URI"])}}[P.tagType]||d).call(n)},uri(){r.uri=P.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),o&&(r.key=o),r.timeline=y,s&&(r.map=s),C=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){P.segment?(r.custom=r.custom||{},r.custom[P.customType]=P.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[P.customType]=P.data)}})[P.type].call(n)})}requiredCompatibilityversion(e,n){(eg&&(h-=g,h-=g,h-=Zs(2))}return Number(h)},mK=function(t,e){var n={},i=n.le,r=i===void 0?!1:i;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!==t)&&(t=0),t=Zs(t);for(var s=hK(t),o=new Uint8Array(new ArrayBuffer(s)),u=0;u=e.length&&d.call(e,function(h,g){var y=u[g]?u[g]&t[s+g]:t[s+g];return h===y})},yK=function(t,e,n){e.forEach(function(i){for(var r in t.mediaGroups[i])for(var s in t.mediaGroups[i][r]){var o=t.mediaGroups[i][r][s];n(o,i,r,s)}})},ld={},uc={};function vK(t,e,n){if(n===void 0&&(n=Array.prototype),t&&typeof n.find=="function")return n.find.call(t,e);for(var i=0;i=0&&t=0){for(var r=e.length-1;i0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&n[i]===t)return i}e=e.nodeType==ip?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,t))return n[t];e=e.nodeType==ip?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function ZD(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}Am(ra,er),Am(ra,er.prototype);function km(t,e){if(e(t))return!0;if(t=t.firstChild)do if(km(t,e))return!0;while(t=t.nextSibling)}function Pm(){this.ownerDocument=this}function CK(t,e,n){t&&t._inc++;var i=n.namespaceURI;i===Cm.XMLNS&&(e._nsMap[n.prefix?n.localName:""]=n.value)}function QD(t,e,n,i){t&&t._inc++;var r=n.namespaceURI;r===Cm.XMLNS&&delete e._nsMap[n.prefix?n.localName:""]}function Q_(t,e,n){if(t&&t._inc){t._inc++;var i=e.childNodes;if(n)i[i.length++]=n;else{for(var r=e.firstChild,s=0;r;)i[s++]=r,r=r.nextSibling;i.length=s,delete i[i.length]}}}function JD(t,e){var n=e.previousSibling,i=e.nextSibling;return n?n.nextSibling=i:t.firstChild=i,i?i.previousSibling=n:t.lastChild=n,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Q_(t.ownerDocument,t),e}function AK(t){return t&&(t.nodeType===er.DOCUMENT_NODE||t.nodeType===er.DOCUMENT_FRAGMENT_NODE||t.nodeType===er.ELEMENT_NODE)}function kK(t){return t&&(gu(t)||J_(t)||hc(t)||t.nodeType===er.DOCUMENT_FRAGMENT_NODE||t.nodeType===er.COMMENT_NODE||t.nodeType===er.PROCESSING_INSTRUCTION_NODE)}function hc(t){return t&&t.nodeType===er.DOCUMENT_TYPE_NODE}function gu(t){return t&&t.nodeType===er.ELEMENT_NODE}function J_(t){return t&&t.nodeType===er.TEXT_NODE}function $D(t,e){var n=t.childNodes||[];if(mu(n,gu)||hc(e))return!1;var i=mu(n,hc);return!(e&&i&&n.indexOf(i)>n.indexOf(e))}function eI(t,e){var n=t.childNodes||[];function i(s){return gu(s)&&s!==e}if(mu(n,i))return!1;var r=mu(n,hc);return!(e&&r&&n.indexOf(r)>n.indexOf(e))}function PK(t,e,n){if(!AK(t))throw new ss(sa,"Unexpected parent node type "+t.nodeType);if(n&&n.parentNode!==t)throw new ss(WD,"child not in parent");if(!kK(e)||hc(e)&&t.nodeType!==er.DOCUMENT_NODE)throw new ss(sa,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function DK(t,e,n){var i=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===er.DOCUMENT_FRAGMENT_NODE){var s=r.filter(gu);if(s.length>1||mu(r,J_))throw new ss(sa,"More than one element or text in fragment");if(s.length===1&&!$D(t,n))throw new ss(sa,"Element in fragment can not be inserted before doctype")}if(gu(e)&&!$D(t,n))throw new ss(sa,"Only one element can be added and only after doctype");if(hc(e)){if(mu(i,hc))throw new ss(sa,"Only one doctype is allowed");var o=mu(i,gu);if(n&&i.indexOf(o)1||mu(r,J_))throw new ss(sa,"More than one element or text in fragment");if(s.length===1&&!eI(t,n))throw new ss(sa,"Element in fragment can not be inserted before doctype")}if(gu(e)&&!eI(t,n))throw new ss(sa,"Only one element can be added and only after doctype");if(hc(e)){if(mu(i,function(u){return hc(u)&&u!==n}))throw new ss(sa,"Only one doctype is allowed");var o=mu(i,gu);if(n&&i.indexOf(o)0&&km(n.documentElement,function(r){if(r!==n&&r.nodeType===Dl){var s=r.getAttribute("class");if(s){var o=t===s;if(!o){var u=FD(s);o=e.every(TK(u))}o&&i.push(r)}}}),i})},createElement:function(t){var e=new rh;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new dc;var n=e.attributes=new hv;return n._ownerElement=e,e},createDocumentFragment:function(){var t=new gv;return t.ownerDocument=this,t.childNodes=new dc,t},createTextNode:function(t){var e=new $_;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new eS;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new tS;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new iS;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new fv;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new nS;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new rh,i=e.split(":"),r=n.attributes=new hv;return n.childNodes=new dc,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,i.length==2?(n.prefix=i[0],n.localName=i[1]):n.localName=e,r._ownerElement=n,n},createAttributeNS:function(t,e){var n=new fv,i=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,i.length==2?(n.prefix=i[0],n.localName=i[1]):n.localName=e,n}},ia(Pm,er);function rh(){this._nsMap={}}rh.prototype={nodeType:Dl,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===cc?this.insertBefore(t,null):IK(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new rp(this,function(e){var n=[];return km(e,function(i){i!==e&&i.nodeType==Dl&&(t==="*"||i.tagName==t)&&n.push(i)}),n})},getElementsByTagNameNS:function(t,e){return new rp(this,function(n){var i=[];return km(n,function(r){r!==n&&r.nodeType===Dl&&(t==="*"||r.namespaceURI===t)&&(e==="*"||r.localName==e)&&i.push(r)}),i})}},Pm.prototype.getElementsByTagName=rh.prototype.getElementsByTagName,Pm.prototype.getElementsByTagNameNS=rh.prototype.getElementsByTagNameNS,ia(rh,er);function fv(){}fv.prototype.nodeType=ip,ia(fv,er);function Dm(){}Dm.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Rs[sa])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var i=this.data.substring(0,t),r=this.data.substring(t+e);n=i+n+r,this.nodeValue=this.data=n,this.length=n.length}},ia(Dm,er);function $_(){}$_.prototype={nodeName:"#text",nodeType:dv,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},ia($_,Dm);function eS(){}eS.prototype={nodeName:"#comment",nodeType:zD},ia(eS,Dm);function tS(){}tS.prototype={nodeName:"#cdata-section",nodeType:BD},ia(tS,Dm);function mv(){}mv.prototype.nodeType=VD,ia(mv,er);function nI(){}nI.prototype.nodeType=xK,ia(nI,er);function iI(){}iI.prototype.nodeType=EK,ia(iI,er);function nS(){}nS.prototype.nodeType=UD,ia(nS,er);function gv(){}gv.prototype.nodeName="#document-fragment",gv.prototype.nodeType=cc,ia(gv,er);function iS(){}iS.prototype.nodeType=HD,ia(iS,er);function rI(){}rI.prototype.serializeToString=function(t,e,n){return sI.call(t,e,n)},er.prototype.toString=sI;function sI(t,e){var n=[],i=this.nodeType==9&&this.documentElement||this,r=i.prefix,s=i.namespaceURI;if(s&&r==null){var r=i.lookupPrefix(s);if(r==null)var o=[{namespace:s,prefix:null}]}return sp(this,n,t,e,o),n.join("")}function oI(t,e,n){var i=t.prefix||"",r=t.namespaceURI;if(!r||i==="xml"&&r===Cm.XML||r===Cm.XMLNS)return!1;for(var s=n.length;s--;){var o=n[s];if(o.prefix===i)return o.namespace!==r}return!0}function rS(t,e,n){t.push(" ",e,'="',n.replace(/[<>&"\t\n\r]/g,ZD),'"')}function sp(t,e,n,i,r){if(r||(r=[]),i)if(t=i(t),t){if(typeof t=="string"){e.push(t);return}}else return;switch(t.nodeType){case Dl:var s=t.attributes,o=s.length,u=t.firstChild,d=t.tagName;n=Cm.isHTML(t.namespaceURI)||n;var h=d;if(!n&&!t.prefix&&t.namespaceURI){for(var g,y=0;y=0;w--){var C=r[w];if(C.prefix===""&&C.namespace===t.namespaceURI){g=C.namespace;break}}if(g!==t.namespaceURI)for(var w=r.length-1;w>=0;w--){var C=r[w];if(C.namespace===t.namespaceURI){C.prefix&&(h=C.prefix+":"+d);break}}}e.push("<",h);for(var D=0;D"),n&&/^script$/i.test(d))for(;u;)u.data?e.push(u.data):sp(u,e,n,i,r.slice()),u=u.nextSibling;else for(;u;)sp(u,e,n,i,r.slice()),u=u.nextSibling;e.push("")}else e.push("/>");return;case jD:case cc:for(var u=t.firstChild;u;)sp(u,e,n,i,r.slice()),u=u.nextSibling;return;case ip:return rS(e,t.name,t.value);case dv:return e.push(t.data.replace(/[<&>]/g,ZD));case BD:return e.push("");case zD:return e.push("");case VD:var K=t.publicId,$=t.systemId;if(e.push("");else if($&&$!=".")e.push(" SYSTEM ",$,">");else{var ee=t.internalSubset;ee&&e.push(" [",ee,"]"),e.push(">")}return;case HD:return e.push("");case UD:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function aI(t,e,n){var i;switch(e.nodeType){case Dl:i=e.cloneNode(!1),i.ownerDocument=t;case cc:break;case ip:n=!0;break}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,n)for(var r=e.firstChild;r;)i.appendChild(aI(t,r,n)),r=r.nextSibling;return i}function sS(t,e,n){var i=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];typeof s!="object"&&s!=i[r]&&(i[r]=s)}switch(e.childNodes&&(i.childNodes=new dc),i.ownerDocument=t,i.nodeType){case Dl:var o=e.attributes,u=i.attributes=new hv,d=o.length;u._ownerElement=i;for(var h=0;h",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES})(uI);var oS={},Im=uc.NAMESPACE,aS=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,cI=new RegExp("[\\-\\.0-9"+aS.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),dI=new RegExp("^"+aS.source+cI.source+"*(?::"+aS.source+cI.source+"*)?$"),Om=0,ud=1,op=2,Rm=3,ap=4,lp=5,Lm=6,vv=7;function up(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,up)}up.prototype=new Error,up.prototype.name=up.name;function hI(){}hI.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),mI(e,e={}),OK(t,e,n,i,this.errorHandler),i.endDocument()}};function OK(t,e,n,i,r){function s(Ut){if(Ut>65535){Ut-=65536;var Xt=55296+(Ut>>10),cn=56320+(Ut&1023);return String.fromCharCode(Xt,cn)}else return String.fromCharCode(Ut)}function o(Ut){var Xt=Ut.slice(1,-1);return Object.hasOwnProperty.call(n,Xt)?n[Xt]:Xt.charAt(0)==="#"?s(parseInt(Xt.substr(1).replace("x","0x"))):(r.error("entity not found:"+Ut),Ut)}function u(Ut){if(Ut>P){var Xt=t.substring(P,Ut).replace(/&#?\w+;/g,o);w&&d(P),i.characters(Xt,0,Ut-P),P=Ut}}function d(Ut,Xt){for(;Ut>=g&&(Xt=y.exec(t));)h=Xt.index,g=h+Xt[0].length,w.lineNumber++;w.columnNumber=Ut-h+1}for(var h=0,g=0,y=/.*(?:\r\n?|\n)|.*$/g,w=i.locator,C=[{currentNSMap:e}],D={},P=0;;){try{var M=t.indexOf("<",P);if(M<0){if(!t.substr(P).match(/^\s*$/)){var F=i.doc,K=F.createTextNode(t.substr(P));F.appendChild(K),i.currentElement=K}return}switch(M>P&&u(M),t.charAt(M+1)){case"/":var ot=t.indexOf(">",M+3),$=t.substring(M+2,ot).replace(/[ \t\n\r]+$/g,""),ee=C.pop();ot<0?($=t.substring(M+2).replace(/[\s<].*/,""),r.error("end tag name: "+$+" is not complete:"+ee.tagName),ot=M+1+$.length):$.match(/\sP?P=ot:u(Math.max(M,P)+1)}}function pI(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function RK(t,e,n,i,r,s){function o(w,C,D){n.attributeNames.hasOwnProperty(w)&&s.fatalError("Attribute "+w+" redefined"),n.addValue(w,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),D)}for(var u,d,h=++e,g=Om;;){var y=t.charAt(h);switch(y){case"=":if(g===ud)u=t.slice(e,h),g=Rm;else if(g===op)g=Rm;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===Rm||g===ud)if(g===ud&&(s.warning('attribute value must after "="'),u=t.slice(e,h)),e=h+1,h=t.indexOf(y,e),h>0)d=t.slice(e,h),o(u,d,e-1),g=lp;else throw new Error("attribute value no end '"+y+"' match");else if(g==ap)d=t.slice(e,h),o(u,d,e),s.warning('attribute "'+u+'" missed start quot('+y+")!!"),e=h+1,g=lp;else throw new Error('attribute value must after "="');break;case"/":switch(g){case Om:n.setTagName(t.slice(e,h));case lp:case Lm:case vv:g=vv,n.closed=!0;case ap:case ud:break;case op:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),g==Om&&n.setTagName(t.slice(e,h)),h;case">":switch(g){case Om:n.setTagName(t.slice(e,h));case lp:case Lm:case vv:break;case ap:case ud:d=t.slice(e,h),d.slice(-1)==="/"&&(n.closed=!0,d=d.slice(0,-1));case op:g===op&&(d=u),g==ap?(s.warning('attribute "'+d+'" missed quot(")!'),o(u,d,e)):((!Im.isHTML(i[""])||!d.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,e));break;case Rm:throw new Error("attribute value missed!!")}return h;case"€":y=" ";default:if(y<=" ")switch(g){case Om:n.setTagName(t.slice(e,h)),g=Lm;break;case ud:u=t.slice(e,h),g=op;break;case ap:var d=t.slice(e,h);s.warning('attribute "'+d+'" missed quot(")!!'),o(u,d,e);case lp:g=Lm;break}else switch(g){case op:n.tagName,(!Im.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,e),e=h,g=ud;break;case lp:s.warning('attribute space is required"'+u+'"!!');case Lm:g=ud,e=h;break;case Rm:g=ap,e=h;break;case vv:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function fI(t,e,n){for(var i=t.tagName,r=null,s=t.length;s--;){var o=t[s],u=o.qName,d=o.value,w=u.indexOf(":");if(w>0)var h=o.prefix=u.slice(0,w),g=u.slice(w+1),y=h==="xmlns"&&g;else g=u,h=null,y=u==="xmlns"&&"";o.localName=g,y!==!1&&(r==null&&(r={},mI(n,n={})),n[y]=r[y]=d,o.uri=Im.XMLNS,e.startPrefixMapping(y,d))}for(var s=t.length;s--;){o=t[s];var h=o.prefix;h&&(h==="xml"&&(o.uri=Im.XML),h!=="xmlns"&&(o.uri=n[h||""]))}var w=i.indexOf(":");w>0?(h=t.prefix=i.slice(0,w),g=t.localName=i.slice(w+1)):(h=null,g=t.localName=i);var C=t.uri=n[h||""];if(e.startElement(C,g,i,t),t.closed){if(e.endElement(C,g,i),r)for(h in r)Object.prototype.hasOwnProperty.call(r,h)&&e.endPrefixMapping(h)}else return t.currentNSMap=n,t.localNSMap=r,!0}function LK(t,e,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var s=t.indexOf("",e),o=t.substring(e+1,s);if(/[&<]/.test(o))return/^script$/i.test(n)?(r.characters(o,0,o.length),s):(o=o.replace(/&#?\w+;/g,i),r.characters(o,0,o.length),s)}return e+1}function MK(t,e,n,i){var r=i[n];return r==null&&(r=t.lastIndexOf(""),r",e+4);return s>e?(n.comment(t,e+4,s-e-4),s+3):(i.error("Unclosed comment"),-1)}else return-1;default:if(t.substr(e+3,6)=="CDATA["){var s=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,s-e-9),n.endCDATA(),s+3}var o=BK(t,e),u=o.length;if(u>1&&/!doctype/i.test(o[0][0])){var d=o[1][0],h=!1,g=!1;u>3&&(/^public$/i.test(o[2][0])?(h=o[3][0],g=u>4&&o[4][0]):/^system$/i.test(o[2][0])&&(g=o[3][0]));var y=o[u-1];return n.startDTD(d,h,g),n.endDTD(),y.index+y[0].length}}return-1}function FK(t,e,n){var i=t.indexOf("?>",e);if(i){var r=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,n.processingInstruction(r[1],r[2]),i+2):-1}return-1}function gI(){this.attributeNames={}}gI.prototype={setTagName:function(t){if(!dI.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,n){if(!dI.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function BK(t,e){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);n=r.exec(t);)if(i.push(n),n[1])return i}oS.XMLReader=hI,oS.ParseError=up;var UK=uc,HK=ld,yI=uI,vI=oS,zK=HK.DOMImplementation,bI=UK.NAMESPACE,jK=vI.ParseError,VK=vI.XMLReader;function wI(t){return t.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function _I(t){this.options=t||{locator:{}}}_I.prototype.parseFromString=function(t,e){var n=this.options,i=new VK,r=n.domBuilder||new Mm,s=n.errorHandler,o=n.locator,u=n.xmlns||{},d=/\/x?html?$/.test(e),h=d?yI.HTML_ENTITIES:yI.XML_ENTITIES;o&&r.setDocumentLocator(o),i.errorHandler=WK(s,r,o),i.domBuilder=n.domBuilder||r,d&&(u[""]=bI.HTML),u.xml=u.xml||bI.XML;var g=n.normalizeLineEndings||wI;return t&&typeof t=="string"?i.parse(g(t),u,h):i.errorHandler.error("invalid doc source"),r.doc};function WK(t,e,n){if(!t){if(e instanceof Mm)return e;t=e}var i={},r=t instanceof Function;n=n||{};function s(o){var u=t[o];!u&&r&&(u=t.length==2?function(d){t(o,d)}:t),i[o]=u&&function(d){u("[xmldom "+o+"] "+d+lS(n))}||function(){}}return s("warning"),s("error"),s("fatalError"),i}function Mm(){this.cdata=!1}function cp(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Mm.prototype={startDocument:function(){this.doc=new zK().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,i){var r=this.doc,s=r.createElementNS(t,n||e),o=i.length;bv(this,s),this.currentElement=s,this.locator&&cp(this.locator,s);for(var u=0;u=e+n||e?new java.lang.String(t,e,n)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){Mm.prototype[t]=function(){return null}});function bv(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}yv.__DOMHandler=Mm,yv.normalizeLineEndings=wI,yv.DOMParser=_I;var qK=yv.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const TI=t=>!!t&&typeof t=="object",Ls=(...t)=>t.reduce((e,n)=>(typeof n!="object"||Object.keys(n).forEach(i=>{Array.isArray(e[i])&&Array.isArray(n[i])?e[i]=e[i].concat(n[i]):TI(e[i])&&TI(n[i])?e[i]=Ls(e[i],n[i]):e[i]=n[i]}),e),{}),EI=t=>Object.keys(t).map(e=>t[e]),GK=(t,e)=>{const n=[];for(let i=t;it.reduce((e,n)=>e.concat(n),[]),xI=t=>{if(!t.length)return[];const e=[];for(let n=0;nt.reduce((n,i,r)=>(i[e]&&n.push(r),n),[]),YK=(t,e)=>EI(t.reduce((n,i)=>(i.forEach(r=>{n[e(r)]=r}),n),{}));var hp={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Nm=({baseUrl:t="",source:e="",range:n="",indexRange:i=""})=>{const r={uri:e,resolvedUri:cv(t||"",e)};if(n||i){const s=(n||i).split("-");let o=Oe.BigInt?Oe.BigInt(s[0]):parseInt(s[0],10),u=Oe.BigInt?Oe.BigInt(s[1]):parseInt(s[1],10);o{let e;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=Oe.BigInt(t.offset)+Oe.BigInt(t.length)-Oe.BigInt(1):e=t.offset+t.length-1,`${t.offset}-${e}`},CI=t=>(t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t),ZK={static(t){const{duration:e,timescale:n=1,sourceDuration:i,periodDuration:r}=t,s=CI(t.endNumber),o=e/n;return typeof s=="number"?{start:0,end:s}:typeof r=="number"?{start:0,end:r/o}:{start:0,end:i/o}},dynamic(t){const{NOW:e,clientOffset:n,availabilityStartTime:i,timescale:r=1,duration:s,periodStart:o=0,minimumUpdatePeriod:u=0,timeShiftBufferDepth:d=1/0}=t,h=CI(t.endNumber),g=(e+n)/1e3,y=i+o,w=g+u-y,C=Math.ceil(w*r/s),D=Math.floor((g-y-d)*r/s),P=Math.floor((g-y)*r/s);return{start:Math.max(0,D),end:typeof h=="number"?h:Math.min(C,P)}}},QK=t=>e=>{const{duration:n,timescale:i=1,periodStart:r,startNumber:s=1}=t;return{number:s+e,duration:n/i,timeline:r,time:e*n}},uS=t=>{const{type:e,duration:n,timescale:i=1,periodDuration:r,sourceDuration:s}=t,{start:o,end:u}=ZK[e](t),d=GK(o,u).map(QK(t));if(e==="static"){const h=d.length-1,g=typeof r=="number"?r:s;d[h].duration=g-n/i*h}return d},AI=t=>{const{baseUrl:e,initialization:n={},sourceDuration:i,indexRange:r="",periodStart:s,presentationTime:o,number:u=0,duration:d}=t;if(!e)throw new Error(hp.NO_BASE_URL);const h=Nm({baseUrl:e,source:n.sourceURL,range:n.range}),g=Nm({baseUrl:e,source:e,indexRange:r});if(g.map=h,d){const y=uS(t);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=s);return g.presentationTime=o||s,g.number=u,[g]},cS=(t,e,n)=>{const i=t.sidx.map?t.sidx.map:null,r=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,u=o.offset+o.length,d=e.timescale,h=e.references.filter(M=>M.referenceType!==1),g=[],y=t.endList?"static":"dynamic",w=t.sidx.timeline;let C=w,D=t.mediaSequence||0,P;typeof e.firstOffset=="bigint"?P=Oe.BigInt(u)+e.firstOffset:P=u+e.firstOffset;for(let M=0;MYK(t,({timeline:e})=>e).sort((e,n)=>e.timeline>n.timeline?1:-1),eY=(t,e)=>{for(let n=0;n{let e=[];return yK(t,JK,(n,i,r,s)=>{e=e.concat(n.playlists||[])}),e},DI=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e,t.segments.forEach((n,i)=>{n.number=t.mediaSequence+i})},tY=({oldPlaylists:t,newPlaylists:e,timelineStarts:n})=>{e.forEach(i=>{i.discontinuitySequence=n.findIndex(function({timeline:u}){return u===i.timeline});const r=eY(t,i.attributes.NAME);if(!r||i.sidx)return;const s=i.segments[0],o=r.segments.findIndex(function(u){return Math.abs(u.presentationTime-s.presentationTime)<$K});if(o===-1){DI({playlist:i,mediaSequence:r.mediaSequence+r.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!r.segments.length&&i.timeline>r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--;return}r.segments[o].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),DI({playlist:i,mediaSequence:r.segments[o].number})})},nY=({oldManifest:t,newManifest:e})=>{const n=t.playlists.concat(PI(t)),i=e.playlists.concat(PI(e));return e.timelineStarts=kI([t.timelineStarts,e.timelineStarts]),tY({oldPlaylists:n,newPlaylists:i,timelineStarts:e.timelineStarts}),e},wv=t=>t&&t.uri+"-"+XK(t.byterange),dS=t=>{const e=t.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let n=[];return Object.values(e).forEach(i=>{const r=EI(i.reduce((s,o)=>{const u=o.attributes.id+(o.attributes.lang||"");return s[u]?(o.segments&&(o.segments[0]&&(o.segments[0].discontinuity=!0),s[u].segments.push(...o.segments)),o.attributes.contentProtection&&(s[u].attributes.contentProtection=o.attributes.contentProtection)):(s[u]=o,s[u].attributes.timelineStarts=[]),s[u].attributes.timelineStarts.push({start:o.attributes.periodStart,timeline:o.attributes.periodStart}),s},{}));n=n.concat(r)}),n.map(i=>(i.discontinuityStarts=KK(i.segments||[],"discontinuity"),i))},hS=(t,e)=>{const n=wv(t.sidx),i=n&&e[n]&&e[n].sidx;return i&&cS(t,i,t.sidx.resolvedUri),t},iY=(t,e={})=>{if(!Object.keys(e).length)return t;for(const n in t)t[n]=hS(t[n],e);return t},rY=({attributes:t,segments:e,sidx:n,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:s},o)=>{const u={attributes:{NAME:t.id,BANDWIDTH:t.bandwidth,CODECS:t.codecs,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:t.timelineStarts,mediaSequence:i,segments:e};return t.contentProtection&&(u.contentProtection=t.contentProtection),t.serviceLocation&&(u.attributes.serviceLocation=t.serviceLocation),n&&(u.sidx=n),o&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u},sY=({attributes:t,segments:e,mediaSequence:n,discontinuityStarts:i,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration);const s={NAME:t.id,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1};t.codecs&&(s.CODECS=t.codecs);const o={attributes:s,uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:n,segments:e};return t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),o},oY=(t,e={},n=!1)=>{let i;const r=t.reduce((s,o)=>{const u=o.attributes.role&&o.attributes.role.value||"",d=o.attributes.lang||"";let h=o.attributes.label||"main";if(d&&!o.attributes.label){const y=u?` (${u})`:"";h=`${o.attributes.lang}${y}`}s[h]||(s[h]={language:d,autoselect:!0,default:u==="main",playlists:[],uri:""});const g=hS(rY(o,n),e);return s[h].playlists.push(g),typeof i>"u"&&u==="main"&&(i=o,i.default=!0),s},{});if(!i){const s=Object.keys(r)[0];r[s].default=!0}return r},aY=(t,e={})=>t.reduce((n,i)=>{const r=i.attributes.label||i.attributes.lang||"text",s=i.attributes.lang||"und";return n[r]||(n[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),n[r].playlists.push(hS(sY(i),e)),n},{}),lY=t=>t.reduce((e,n)=>(n&&n.forEach(i=>{const{channel:r,language:s}=i;e[s]={autoselect:!1,default:!1,instreamId:r,language:s},i.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[s].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[s]["3D"]=i["3D"])}),e),{}),uY=({attributes:t,segments:e,sidx:n,discontinuityStarts:i})=>{const r={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:i,timelineStarts:t.timelineStarts,segments:e};return t.frameRate&&(r.attributes["FRAME-RATE"]=t.frameRate),t.contentProtection&&(r.contentProtection=t.contentProtection),t.serviceLocation&&(r.attributes.serviceLocation=t.serviceLocation),n&&(r.sidx=n),r},cY=({attributes:t})=>t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video",dY=({attributes:t})=>t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio",hY=({attributes:t})=>t.mimeType==="text/vtt"||t.contentType==="text",pY=(t,e)=>{t.forEach(n=>{n.mediaSequence=0,n.discontinuitySequence=e.findIndex(function({timeline:i}){return i===n.timeline}),n.segments&&n.segments.forEach((i,r)=>{i.number=r})})},II=t=>t?Object.keys(t).reduce((e,n)=>{const i=t[n];return e.concat(i.playlists)},[]):[],fY=({dashPlaylists:t,locations:e,contentSteering:n,sidxMapping:i={},previousManifest:r,eventStream:s})=>{if(!t.length)return{};const{sourceDuration:o,type:u,suggestedPresentationDelay:d,minimumUpdatePeriod:h}=t[0].attributes,g=dS(t.filter(cY)).map(uY),y=dS(t.filter(dY)),w=dS(t.filter(hY)),C=t.map(ee=>ee.attributes.captionServices).filter(Boolean),D={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:o,playlists:iY(g,i)};h>=0&&(D.minimumUpdatePeriod=h*1e3),e&&(D.locations=e),n&&(D.contentSteering=n),u==="dynamic"&&(D.suggestedPresentationDelay=d),s&&s.length>0&&(D.eventStream=s);const P=D.playlists.length===0,M=y.length?oY(y,i,P):null,F=w.length?aY(w,i):null,K=g.concat(II(M),II(F)),$=K.map(({timelineStarts:ee})=>ee);return D.timelineStarts=kI($),pY(K,D.timelineStarts),M&&(D.mediaGroups.AUDIO.audio=M),F&&(D.mediaGroups.SUBTITLES.subs=F),C.length&&(D.mediaGroups["CLOSED-CAPTIONS"].cc=lY(C)),r?nY({oldManifest:r,newManifest:D}):D},mY=(t,e,n)=>{const{NOW:i,clientOffset:r,availabilityStartTime:s,timescale:o=1,periodStart:u=0,minimumUpdatePeriod:d=0}=t,h=(i+r)/1e3,g=s+u,y=h+d-g;return Math.ceil((y*o-e)/n)},OI=(t,e)=>{const{type:n,minimumUpdatePeriod:i=0,media:r="",sourceDuration:s,timescale:o=1,startNumber:u=1,periodStart:d}=t,h=[];let g=-1;for(let y=0;yg&&(g=P);let M;if(D<0){const $=y+1;$===e.length?n==="dynamic"&&i>0&&r.indexOf("$Number$")>0?M=mY(t,g,C):M=(s*o-g)/C:M=(e[$].t-g)/C}else M=D+1;const F=u+h.length+M;let K=u+h.length;for(;K(e,n,i,r)=>{if(e==="$$")return"$";if(typeof t[n]>"u")return e;const s=""+t[n];return n==="RepresentationID"||(i?r=parseInt(r,10):r=1,s.length>=r)?s:`${new Array(r-s.length+1).join("0")}${s}`},RI=(t,e)=>t.replace(gY,yY(e)),vY=(t,e)=>!t.duration&&!e?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?uS(t):OI(t,e),bY=(t,e)=>{const n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=t,r=Nm({baseUrl:t.baseUrl,source:RI(i.sourceURL,n),range:i.range});return vY(t,e).map(s=>{n.Number=s.number,n.Time=s.time;const o=RI(t.media||"",n),u=t.timescale||1,d=t.presentationTimeOffset||0,h=t.periodStart+(s.time-d)/u;return{uri:o,timeline:s.timeline,duration:s.duration,resolvedUri:cv(t.baseUrl||"",o),map:r,number:s.number,presentationTime:h}})},wY=(t,e)=>{const{baseUrl:n,initialization:i={}}=t,r=Nm({baseUrl:n,source:i.sourceURL,range:i.range}),s=Nm({baseUrl:n,source:e.media,range:e.mediaRange});return s.map=r,s},_Y=(t,e)=>{const{duration:n,segmentUrls:i=[],periodStart:r}=t;if(!n&&!e||n&&e)throw new Error(hp.SEGMENT_TIME_UNSPECIFIED);const s=i.map(u=>wY(t,u));let o;return n&&(o=uS(t)),e&&(o=OI(t,e)),o.map((u,d)=>{if(s[d]){const h=s[d],g=t.timescale||1,y=t.presentationTimeOffset||0;return h.timeline=u.timeline,h.duration=u.duration,h.number=u.number,h.presentationTime=r+(u.time-y)/g,h}}).filter(u=>u)},SY=({attributes:t,segmentInfo:e})=>{let n,i;e.template?(i=bY,n=Ls(t,e.template)):e.base?(i=AI,n=Ls(t,e.base)):e.list&&(i=_Y,n=Ls(t,e.list));const r={attributes:t};if(!i)return r;const s=i(n,e.segmentTimeline);if(n.duration){const{duration:o,timescale:u=1}=n;n.duration=o/u}else s.length?n.duration=s.reduce((o,u)=>Math.max(o,Math.ceil(u.duration)),0):n.duration=0;return r.attributes=n,r.segments=s,e.base&&n.indexRange&&(r.sidx=s[0],r.segments=[]),r},TY=t=>t.map(SY),Ar=(t,e)=>xI(t.childNodes).filter(({tagName:n})=>n===e),Fm=t=>t.textContent.trim(),EY=t=>parseFloat(t.split("/").reduce((e,n)=>e/n)),pp=t=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!e)return 0;const[n,i,r,s,o,u]=e.slice(1);return parseFloat(n||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(r||0)*86400+parseFloat(s||0)*3600+parseFloat(o||0)*60+parseFloat(u||0)},xY=t=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)),LI={mediaPresentationDuration(t){return pp(t)},availabilityStartTime(t){return xY(t)/1e3},minimumUpdatePeriod(t){return pp(t)},suggestedPresentationDelay(t){return pp(t)},type(t){return t},timeShiftBufferDepth(t){return pp(t)},start(t){return pp(t)},width(t){return parseInt(t,10)},height(t){return parseInt(t,10)},bandwidth(t){return parseInt(t,10)},frameRate(t){return EY(t)},startNumber(t){return parseInt(t,10)},timescale(t){return parseInt(t,10)},presentationTimeOffset(t){return parseInt(t,10)},duration(t){const e=parseInt(t,10);return isNaN(e)?pp(t):e},d(t){return parseInt(t,10)},t(t){return parseInt(t,10)},r(t){return parseInt(t,10)},presentationTime(t){return parseInt(t,10)},DEFAULT(t){return t}},cs=t=>t&&t.attributes?xI(t.attributes).reduce((e,n)=>{const i=LI[n.name]||LI.DEFAULT;return e[n.name]=i(n.value),e},{}):{},CY={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},_v=(t,e)=>e.length?dp(t.map(function(n){return e.map(function(i){const r=Fm(i),s=cv(n.baseUrl,r),o=Ls(cs(i),{baseUrl:s});return s!==r&&!o.serviceLocation&&n.serviceLocation&&(o.serviceLocation=n.serviceLocation),o})})):t,pS=t=>{const e=Ar(t,"SegmentTemplate")[0],n=Ar(t,"SegmentList")[0],i=n&&Ar(n,"SegmentURL").map(y=>Ls({tag:"SegmentURL"},cs(y))),r=Ar(t,"SegmentBase")[0],s=n||e,o=s&&Ar(s,"SegmentTimeline")[0],u=n||r||e,d=u&&Ar(u,"Initialization")[0],h=e&&cs(e);h&&d?h.initialization=d&&cs(d):h&&h.initialization&&(h.initialization={sourceURL:h.initialization});const g={template:h,segmentTimeline:o&&Ar(o,"S").map(y=>cs(y)),list:n&&Ls(cs(n),{segmentUrls:i,initialization:cs(d)}),base:r&&Ls(cs(r),{initialization:cs(d)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},AY=(t,e,n)=>i=>{const r=Ar(i,"BaseURL"),s=_v(e,r),o=Ls(t,cs(i)),u=pS(i);return s.map(d=>({segmentInfo:Ls(n,u),attributes:Ls(o,d)}))},kY=t=>t.reduce((e,n)=>{const i=cs(n);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=CY[i.schemeIdUri];if(r){e[r]={attributes:i};const s=Ar(n,"cenc:pssh")[0];if(s){const o=Fm(s);e[r].pssh=o&&xD(o)}}return e},{}),PY=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(e=>{let n,i;return i=e,/^CC\d=/.test(e)?[n,i]=e.split("="):/^CC\d$/.test(e)&&(n=e),{channel:n,language:i}});if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(e=>{const n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,r=""]=e.split("=");n.channel=i,n.language=e,r.split(",").forEach(s=>{const[o,u]=s.split(":");o==="lang"?n.language=u:o==="er"?n.easyReader=Number(u):o==="war"?n.aspectRatio=Number(u):o==="3D"&&(n["3D"]=Number(u))})}else n.language=e;return n.channel&&(n.channel="SERVICE"+n.channel),n})},DY=t=>dp(Ar(t.node,"EventStream").map(e=>{const n=cs(e),i=n.schemeIdUri;return Ar(e,"Event").map(r=>{const s=cs(r),o=s.presentationTime||0,u=n.timescale||1,d=s.duration||0,h=o/u+t.attributes.start;return{schemeIdUri:i,value:n.value,id:s.id,start:h,end:h+d/u,messageData:Fm(r)||s.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})})),IY=(t,e,n)=>i=>{const r=cs(i),s=_v(e,Ar(i,"BaseURL")),o=Ar(i,"Role")[0],u={role:cs(o)};let d=Ls(t,r,u);const h=Ar(i,"Accessibility")[0],g=PY(cs(h));g&&(d=Ls(d,{captionServices:g}));const y=Ar(i,"Label")[0];if(y&&y.childNodes.length){const M=y.childNodes[0].nodeValue.trim();d=Ls(d,{label:M})}const w=kY(Ar(i,"ContentProtection"));Object.keys(w).length&&(d=Ls(d,{contentProtection:w}));const C=pS(i),D=Ar(i,"Representation"),P=Ls(n,C);return dp(D.map(AY(d,s,P)))},OY=(t,e)=>(n,i)=>{const r=_v(e,Ar(n.node,"BaseURL")),s=Ls(t,{periodStart:n.attributes.start});typeof n.attributes.duration=="number"&&(s.periodDuration=n.attributes.duration);const o=Ar(n.node,"AdaptationSet"),u=pS(n.node);return dp(o.map(IY(s,r,u)))},RY=(t,e)=>{if(t.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!t.length)return null;const n=Ls({serverURL:Fm(t[0])},cs(t[0]));return n.queryBeforeStart=n.queryBeforeStart==="true",n},LY=({attributes:t,priorPeriodAttributes:e,mpdType:n})=>typeof t.start=="number"?t.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&n==="static"?0:null,MY=(t,e={})=>{const{manifestUri:n="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=e,o=Ar(t,"Period");if(!o.length)throw new Error(hp.INVALID_NUMBER_OF_PERIOD);const u=Ar(t,"Location"),d=cs(t),h=_v([{baseUrl:n}],Ar(t,"BaseURL")),g=Ar(t,"ContentSteering");d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=i,d.clientOffset=r,u.length&&(d.locations=u.map(Fm));const y=[];return o.forEach((w,C)=>{const D=cs(w),P=y[C-1];D.start=LY({attributes:D,priorPeriodAttributes:P?P.attributes:null,mpdType:d.type}),y.push({node:w,attributes:D})}),{locations:d.locations,contentSteeringInfo:RY(g,s),representationInfo:dp(y.map(OY(d,h))),eventStream:dp(y.map(DY))}},MI=t=>{if(t==="")throw new Error(hp.DASH_EMPTY_MANIFEST);const e=new qK;let n,i;try{n=e.parseFromString(t,"application/xml"),i=n&&n.documentElement.tagName==="MPD"?n.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(hp.DASH_INVALID_XML);return i},NY=t=>{const e=Ar(t,"UTCTiming")[0];if(!e)return null;const n=cs(e);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(hp.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},FY=(t,e={})=>{const n=MY(MI(t),e),i=TY(n.representationInfo);return fY({dashPlaylists:i,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:n.eventStream})},BY=t=>NY(MI(t));var UY=Math.pow(2,32),HY=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),n;return e.getBigUint64?(n=e.getBigUint64(0),n0;i+=12,r--)n.references.push({referenceType:(t[i]&128)>>>7,referencedSize:e.getUint32(i)&2147483647,subsegmentDuration:e.getUint32(i+4),startsWithSap:!!(t[i+8]&128),sapType:(t[i+8]&112)>>>4,sapDeltaTime:e.getUint32(i+8)&268435455});return n},VY=jY;const WY=Jh(VY);var qY=Sn([73,68,51]),GY=function(t,e){e===void 0&&(e=0),t=Sn(t);var n=t[e+5],i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9],r=(n&16)>>4;return r?i+20:i+10},Bm=function t(e,n){return n===void 0&&(n=0),e=Sn(e),e.length-n<10||!Cr(e,qY,{offset:n})?n:(n+=GY(e,n),t(e,n))},FI=function(t){return typeof t=="string"?RD(t):t},KY=function(t){return Array.isArray(t)?t.map(function(e){return FI(e)}):[FI(t)]},YY=function t(e,n,i){i===void 0&&(i=!1),n=KY(n),e=Sn(e);var r=[];if(!n.length)return r;for(var s=0;s>>0,u=e.subarray(s+4,s+8);if(o===0)break;var d=s+o;if(d>e.length){if(i)break;d=e.length}var h=e.subarray(s+8,d);Cr(u,n[0])&&(n.length===1?r.push(h):r.push.apply(r,t(h,n.slice(1),i))),s=d}return r},Sv={EBML:Sn([26,69,223,163]),DocType:Sn([66,130]),Segment:Sn([24,83,128,103]),SegmentInfo:Sn([21,73,169,102]),Tracks:Sn([22,84,174,107]),Track:Sn([174]),TrackNumber:Sn([215]),DefaultDuration:Sn([35,227,131]),TrackEntry:Sn([174]),TrackType:Sn([131]),FlagDefault:Sn([136]),CodecID:Sn([134]),CodecPrivate:Sn([99,162]),VideoTrack:Sn([224]),AudioTrack:Sn([225]),Cluster:Sn([31,67,182,117]),Timestamp:Sn([231]),TimestampScale:Sn([42,215,177]),BlockGroup:Sn([160]),BlockDuration:Sn([155]),Block:Sn([161]),SimpleBlock:Sn([163])},fS=[128,64,32,16,8,4,2,1],XY=function(t){for(var e=1,n=0;n=n.length)return n.length;var r=Tv(n,i,!1);if(Cr(e.bytes,r.bytes))return i;var s=Tv(n,i+r.length);return t(e,n,i+s.length+s.value+r.length)},UI=function t(e,n){n=ZY(n),e=Sn(e);var i=[];if(!n.length)return i;for(var r=0;re.length?e.length:u+o.value,h=e.subarray(u,d);Cr(n[0],s.bytes)&&(n.length===1?i.push(h):i=i.concat(t(h,n.slice(1))));var g=s.length+o.length+h.length;r+=g}return i},JY=Sn([0,0,0,1]),$Y=Sn([0,0,1]),eX=Sn([0,0,3]),tX=function(t){for(var e=[],n=1;n>1&63),n.indexOf(d)!==-1&&(s=r+u),r+=u+(e==="h264"?1:2)}return t.subarray(0,0)},nX=function(t,e,n){return HI(t,"h264",e,n)},iX=function(t,e,n){return HI(t,"h265",e,n)},Vo={webm:Sn([119,101,98,109]),matroska:Sn([109,97,116,114,111,115,107,97]),flac:Sn([102,76,97,67]),ogg:Sn([79,103,103,83]),ac3:Sn([11,119]),riff:Sn([82,73,70,70]),avi:Sn([65,86,73]),wav:Sn([87,65,86,69]),"3gp":Sn([102,116,121,112,51,103]),mp4:Sn([102,116,121,112]),fmp4:Sn([115,116,121,112]),mov:Sn([102,116,121,112,113,116]),moov:Sn([109,111,111,118]),moof:Sn([109,111,111,102])},fp={aac:function(t){var e=Bm(t);return Cr(t,[255,16],{offset:e,mask:[255,22]})},mp3:function(t){var e=Bm(t);return Cr(t,[255,2],{offset:e,mask:[255,6]})},webm:function(t){var e=UI(t,[Sv.EBML,Sv.DocType])[0];return Cr(e,Vo.webm)},mkv:function(t){var e=UI(t,[Sv.EBML,Sv.DocType])[0];return Cr(e,Vo.matroska)},mp4:function(t){if(fp["3gp"](t)||fp.mov(t))return!1;if(Cr(t,Vo.mp4,{offset:4})||Cr(t,Vo.fmp4,{offset:4})||Cr(t,Vo.moof,{offset:4})||Cr(t,Vo.moov,{offset:4}))return!0},mov:function(t){return Cr(t,Vo.mov,{offset:4})},"3gp":function(t){return Cr(t,Vo["3gp"],{offset:4})},ac3:function(t){var e=Bm(t);return Cr(t,Vo.ac3,{offset:e})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var e=0;e+1880},sh={};/** * @license * Video.js 8.22.0 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */var yS="8.22.0";const pc={},cd=function(t,e){return pc[t]=pc[t]||[],e&&(pc[t]=pc[t].concat(e)),pc[t]},oX=function(t,e){cd(t,e)},zI=function(t,e){const n=cd(t).indexOf(e);return n<=-1?!1:(pc[t]=pc[t].slice(),pc[t].splice(n,1),!0)},aX=function(t,e){cd(t,[].concat(e).map(n=>{const i=(...r)=>(zI(t,i),n(...r));return i}))},Ev={prefixed:!0},xv=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],jI=xv[0];let Um;for(let t=0;t(i,r,s)=>{const o=e.levels[r],u=new RegExp(`^(${o})$`);let d=t;if(i!=="log"&&s.unshift(i.toUpperCase()+":"),n&&(d=`%c${t}`,s.unshift(n)),s.unshift(d+":"),oa){oa.push([].concat(s));const g=oa.length-1e3;oa.splice(0,g>0?g:0)}if(!Oe.console)return;let h=Oe.console[i];!h&&i==="debug"&&(h=Oe.console.info||Oe.console.log),!(!h||!o||!u.test(i))&&h[Array.isArray(s)?"apply":"call"](Oe.console,s)};function vS(t,e=":",n=""){let i="info",r;function s(...o){r("log",i,o)}return r=lX(t,s,n),s.createLogger=(o,u,d)=>{const h=u!==void 0?u:e,g=d!==void 0?d:n,y=`${t} ${h} ${o}`;return vS(y,h,g)},s.createNewLogger=(o,u,d)=>vS(o,u,d),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},s.level=o=>{if(typeof o=="string"){if(!s.levels.hasOwnProperty(o))throw new Error(`"${o}" in not a valid log level`);i=o}return i},s.history=()=>oa?[].concat(oa):[],s.history.filter=o=>(oa||[]).filter(u=>new RegExp(`.*${o}.*`).test(u[0])),s.history.clear=()=>{oa&&(oa.length=0)},s.history.disable=()=>{oa!==null&&(oa.length=0,oa=null)},s.history.enable=()=>{oa===null&&(oa=[])},s.error=(...o)=>r("error",i,o),s.warn=(...o)=>r("warn",i,o),s.debug=(...o)=>r("debug",i,o),s}const fi=vS("VIDEOJS"),VI=fi.createLogger,uX=Object.prototype.toString,WI=function(t){return yu(t)?Object.keys(t):[]};function mp(t,e){WI(t).forEach(n=>e(t[n],n))}function qI(t,e,n=0){return WI(t).reduce((i,r)=>e(i,t[r],r),n)}function yu(t){return!!t&&typeof t=="object"}function gp(t){return yu(t)&&uX.call(t)==="[object Object]"&&t.constructor===Object}function sr(...t){const e={};return t.forEach(n=>{n&&mp(n,(i,r)=>{if(!gp(i)){e[r]=i;return}gp(e[r])||(e[r]={}),e[r]=sr(e[r],i)})}),e}function GI(t={}){const e=[];for(const n in t)if(t.hasOwnProperty(n)){const i=t[n];e.push(i)}return e}function Cv(t,e,n,i=!0){const r=o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const o=n();return r(o),o}};return i&&(s.set=r),Object.defineProperty(t,e,s)}var cX=Object.freeze({__proto__:null,each:mp,reduce:qI,isObject:yu,isPlain:gp,merge:sr,values:GI,defineLazyProperty:Cv});let bS=!1,KI=null,Il=!1,YI,XI=!1,yp=!1,vp=!1,vu=!1,wS=null,Av=null;const dX=!!(Oe.cast&&Oe.cast.framework&&Oe.cast.framework.CastReceiverContext);let ZI=null,kv=!1,Pv=!1,Dv=!1,Iv=!1,Ov=!1,Rv=!1,Lv=!1;const Hm=!!(bp()&&("ontouchstart"in Oe||Oe.navigator.maxTouchPoints||Oe.DocumentTouch&&Oe.document instanceof Oe.DocumentTouch)),dd=Oe.navigator&&Oe.navigator.userAgentData;if(dd&&dd.platform&&dd.brands&&(Il=dd.platform==="Android",yp=!!dd.brands.find(t=>t.brand==="Microsoft Edge"),vp=!!dd.brands.find(t=>t.brand==="Chromium"),vu=!yp&&vp,wS=Av=(dd.brands.find(t=>t.brand==="Chromium")||{}).version||null,Pv=dd.platform==="Windows"),!vp){const t=Oe.navigator&&Oe.navigator.userAgent||"";bS=/iPod/i.test(t),KI=function(){const e=t.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Il=/Android/i.test(t),YI=function(){const e=t.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const n=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return n&&i?parseFloat(e[1]+"."+e[2]):n||null}(),XI=/Firefox/i.test(t),yp=/Edg/i.test(t),vp=/Chrome/i.test(t)||/CriOS/i.test(t),vu=!yp&&vp,wS=Av=function(){const e=t.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),ZI=function(){const e=/MSIE\s(\d+)\.\d/.exec(t);let n=e&&parseFloat(e[1]);return!n&&/Trident\/7.0/i.test(t)&&/rv:11.0/.test(t)&&(n=11),n}(),Ov=/Tizen/i.test(t),Rv=/Web0S/i.test(t),Lv=Ov||Rv,kv=/Safari/i.test(t)&&!vu&&!Il&&!yp&&!Lv,Pv=/Windows/i.test(t),Dv=/iPad/i.test(t)||kv&&Hm&&!/iPhone/i.test(t),Iv=/iPhone/i.test(t)&&!Dv}const go=Iv||Dv||bS,Mv=(kv||go)&&!vu;var QI=Object.freeze({__proto__:null,get IS_IPOD(){return bS},get IOS_VERSION(){return KI},get IS_ANDROID(){return Il},get ANDROID_VERSION(){return YI},get IS_FIREFOX(){return XI},get IS_EDGE(){return yp},get IS_CHROMIUM(){return vp},get IS_CHROME(){return vu},get CHROMIUM_VERSION(){return wS},get CHROME_VERSION(){return Av},IS_CHROMECAST_RECEIVER:dX,get IE_VERSION(){return ZI},get IS_SAFARI(){return kv},get IS_WINDOWS(){return Pv},get IS_IPAD(){return Dv},get IS_IPHONE(){return Iv},get IS_TIZEN(){return Ov},get IS_WEBOS(){return Rv},get IS_SMART_TV(){return Lv},TOUCH_ENABLED:Hm,IS_IOS:go,IS_ANY_SAFARI:Mv});function JI(t){return typeof t=="string"&&!!t.trim()}function hX(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function bp(){return Vt===Oe.document}function wp(t){return yu(t)&&t.nodeType===1}function $I(){try{return Oe.parent!==Oe.self}catch{return!0}}function eO(t){return function(e,n){if(!JI(e))return Vt[t](null);JI(n)&&(n=Vt.querySelector(n));const i=wp(n)?n:Vt;return i[t]&&i[t](e)}}function kn(t="div",e={},n={},i){const r=Vt.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(s){const o=e[s];s==="textContent"?hd(r,o):(r[s]!==o||s==="tabIndex")&&(r[s]=o)}),Object.getOwnPropertyNames(n).forEach(function(s){r.setAttribute(s,n[s])}),i&&SS(r,i),r}function hd(t,e){return typeof t.textContent>"u"?t.innerText=e:t.textContent=e,t}function _S(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function zm(t,e){return hX(e),t.classList.contains(e)}function oh(t,...e){return t.classList.add(...e.reduce((n,i)=>n.concat(i.split(/\s+/)),[])),t}function Nv(t,...e){return t?(t.classList.remove(...e.reduce((n,i)=>n.concat(i.split(/\s+/)),[])),t):(fi.warn("removeClass was called with an element that doesn't exist"),null)}function tO(t,e,n){return typeof n=="function"&&(n=n(t,e)),typeof n!="boolean"&&(n=void 0),e.split(/\s+/).forEach(i=>t.classList.toggle(i,n)),t}function nO(t,e){Object.getOwnPropertyNames(e).forEach(function(n){const i=e[n];i===null||typeof i>"u"||i===!1?t.removeAttribute(n):t.setAttribute(n,i===!0?"":i)})}function pd(t){const e={},n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(t&&t.attributes&&t.attributes.length>0){const i=t.attributes;for(let r=i.length-1;r>=0;r--){const s=i[r].name;let o=i[r].value;n.includes(s)&&(o=o!==null),e[s]=o}}return e}function iO(t,e){return t.getAttribute(e)}function _p(t,e,n){t.setAttribute(e,n)}function Fv(t,e){t.removeAttribute(e)}function rO(){Vt.body.focus(),Vt.onselectstart=function(){return!1}}function sO(){Vt.onselectstart=function(){return!0}}function Sp(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(n[i]=e[i])}),n.height||(n.height=parseFloat(Tp(t,"height"))),n.width||(n.width=parseFloat(Tp(t,"width"))),n}}function jm(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};const e=t.offsetWidth,n=t.offsetHeight;let i=0,r=0;for(;t.offsetParent&&t!==Vt[Ev.fullscreenElement];)i+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{left:i,top:r,width:e,height:n}}function Bv(t,e){const n={x:0,y:0};if(go){let g=t;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=Tp(g,"transform");if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);n.x+=w[4],n.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);n.x+=w[12],n.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&Oe.WebKitCSSMatrix){const w=Oe.getComputedStyle(g.assignedSlot.parentElement).transform,C=new Oe.WebKitCSSMatrix(w);n.x+=C.m41,n.y+=C.m42}g=g.parentNode||g.host}}const i={},r=jm(e.target),s=jm(t),o=s.width,u=s.height;let d=e.offsetY-(s.top-r.top),h=e.offsetX-(s.left-r.left);return e.changedTouches&&(h=e.changedTouches[0].pageX-s.left,d=e.changedTouches[0].pageY+s.top,go&&(h-=n.x,d-=n.y)),i.y=1-Math.max(0,Math.min(1,d/u)),i.x=Math.max(0,Math.min(1,h/o)),i}function oO(t){return yu(t)&&t.nodeType===3}function Uv(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function aO(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(e=>{if(typeof e=="function"&&(e=e()),wp(e)||oO(e))return e;if(typeof e=="string"&&/\S/.test(e))return Vt.createTextNode(e)}).filter(e=>e)}function SS(t,e){return aO(e).forEach(n=>t.appendChild(n)),t}function lO(t,e){return SS(Uv(t),e)}function Vm(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||t.type==="mousedown"&&t.button===0&&t.buttons===0?!0:!(t.button!==0||t.buttons!==1)}const fd=eO("querySelector"),uO=eO("querySelectorAll");function Tp(t,e){if(!t||!e)return"";if(typeof Oe.getComputedStyle=="function"){let n;try{n=Oe.getComputedStyle(t)}catch{return""}return n?n.getPropertyValue(e)||n[e]:""}return""}function cO(t){[...Vt.styleSheets].forEach(e=>{try{const n=[...e.cssRules].map(r=>r.cssText).join(""),i=Vt.createElement("style");i.textContent=n,t.document.head.appendChild(i)}catch{const n=Vt.createElement("link");n.rel="stylesheet",n.type=e.type,n.media=e.media.mediaText,n.href=e.href,t.document.head.appendChild(n)}})}var dO=Object.freeze({__proto__:null,isReal:bp,isEl:wp,isInFrame:$I,createEl:kn,textContent:hd,prependTo:_S,hasClass:zm,addClass:oh,removeClass:Nv,toggleClass:tO,setAttributes:nO,getAttributes:pd,getAttribute:iO,setAttribute:_p,removeAttribute:Fv,blockTextSelection:rO,unblockTextSelection:sO,getBoundingClientRect:Sp,findPosition:jm,getPointerPosition:Bv,isTextNode:oO,emptyEl:Uv,normalizeContent:aO,appendContent:SS,insertContent:lO,isSingleLeftClick:Vm,$:fd,$$:uO,computedStyle:Tp,copyStyleSheetsToWindow:cO});let hO=!1,TS;const pX=function(){if(TS.options.autoSetup===!1)return;const t=Array.prototype.slice.call(Vt.getElementsByTagName("video")),e=Array.prototype.slice.call(Vt.getElementsByTagName("audio")),n=Array.prototype.slice.call(Vt.getElementsByTagName("video-js")),i=t.concat(e,n);if(i&&i.length>0)for(let r=0,s=i.length;r-1&&(r={passive:!0}),t.addEventListener(e,i.dispatcher,r)}else t.attachEvent&&t.attachEvent("on"+e,i.dispatcher)}function yo(t,e,n){if(!Wo.has(t))return;const i=Wo.get(t);if(!i.handlers)return;if(Array.isArray(e))return CS(yo,t,e,n);const r=function(o,u){i.handlers[u]=[],mO(o,u)};if(e===void 0){for(const o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&r(t,o);return}const s=i.handlers[e];if(s){if(!n){r(t,e);return}if(n.guid)for(let o=0;o=e&&(t(...i),n=r)}},gO=function(t,e,n,i=Oe){let r;const s=()=>{i.clearTimeout(r),r=null},o=function(){const u=this,d=arguments;let h=function(){r=null,h=null,n||t.apply(u,d)};!r&&n&&t.apply(u,d),i.clearTimeout(r),r=i.setTimeout(h,e)};return o.cancel=s,o};var vX=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ja,bind_:hr,throttle:bu,debounce:gO});let Wm;class xa{on(e,n){const i=this.addEventListener;this.addEventListener=()=>{},Ea(this,e,n),this.addEventListener=i}off(e,n){yo(this,e,n)}one(e,n){const i=this.addEventListener;this.addEventListener=()=>{},jv(this,e,n),this.addEventListener=i}any(e,n){const i=this.addEventListener;this.addEventListener=()=>{},AS(this,e,n),this.addEventListener=i}trigger(e){const n=e.type||e;typeof e=="string"&&(e={type:n}),e=Hv(e),this.allowedEvents_[n]&&this["on"+n]&&this["on"+n](e),Ep(this,e)}queueTrigger(e){Wm||(Wm=new Map);const n=e.type||e;let i=Wm.get(this);i||(i=new Map,Wm.set(this,i));const r=i.get(n);i.delete(n),Oe.clearTimeout(r);const s=Oe.setTimeout(()=>{i.delete(n),i.size===0&&(i=null,Wm.delete(this)),this.trigger(e)},0);i.set(n,s)}}xa.prototype.allowedEvents_={},xa.prototype.addEventListener=xa.prototype.on,xa.prototype.removeEventListener=xa.prototype.off,xa.prototype.dispatchEvent=xa.prototype.trigger;const Vv=t=>typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t,fc=t=>t instanceof xa||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]=="function"),bX=(t,e)=>{fc(t)?e():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(e))},kS=t=>typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length,Wv=(t,e,n)=>{if(!t||!t.nodeName&&!fc(t))throw new Error(`Invalid target for ${Vv(e)}#${n}; must be a DOM node or evented object.`)},yO=(t,e,n)=>{if(!kS(t))throw new Error(`Invalid event type for ${Vv(e)}#${n}; must be a non-empty string or array.`)},vO=(t,e,n)=>{if(typeof t!="function")throw new Error(`Invalid listener for ${Vv(e)}#${n}; must be a function.`)},PS=(t,e,n)=>{const i=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let r,s,o;return i?(r=t.eventBusEl_,e.length>=3&&e.shift(),[s,o]=e):(r=e[0],s=e[1],o=e[2]),Wv(r,t,n),yO(s,t,n),vO(o,t,n),o=hr(t,o),{isTargetingSelf:i,target:r,type:s,listener:o}},ah=(t,e,n,i)=>{Wv(t,t,e),t.nodeName?yX[e](t,n,i):t[e](n,i)},wX={on(...t){const{isTargetingSelf:e,target:n,type:i,listener:r}=PS(this,t,"on");if(ah(n,"on",i,r),!e){const s=()=>this.off(n,i,r);s.guid=r.guid;const o=()=>this.off("dispose",s);o.guid=r.guid,ah(this,"on","dispose",s),ah(n,"on","dispose",o)}},one(...t){const{isTargetingSelf:e,target:n,type:i,listener:r}=PS(this,t,"one");if(e)ah(n,"one",i,r);else{const s=(...o)=>{this.off(n,i,s),r.apply(null,o)};s.guid=r.guid,ah(n,"one",i,s)}},any(...t){const{isTargetingSelf:e,target:n,type:i,listener:r}=PS(this,t,"any");if(e)ah(n,"any",i,r);else{const s=(...o)=>{this.off(n,i,s),r.apply(null,o)};s.guid=r.guid,ah(n,"any",i,s)}},off(t,e,n){if(!t||kS(t))yo(this.eventBusEl_,t,e);else{const i=t,r=e;Wv(i,this,"off"),yO(r,this,"off"),vO(n,this,"off"),n=hr(this,n),this.off("dispose",n),i.nodeName?(yo(i,r,n),yo(i,"dispose",n)):fc(i)&&(i.off(r,n),i.off("dispose",n))}},trigger(t,e){Wv(this.eventBusEl_,this,"trigger");const n=t&&typeof t!="string"?t.type:t;if(!kS(n))throw new Error(`Invalid event type for ${Vv(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ep(this.eventBusEl_,t,e)}};function DS(t,e={}){const{eventBusKey:n}=e;if(n){if(!t[n].nodeName)throw new Error(`The eventBusKey "${n}" does not refer to an element.`);t.eventBusEl_=t[n]}else t.eventBusEl_=kn("span",{className:"vjs-event-bus"});return Object.assign(t,wX),t.eventedCallbacks&&t.eventedCallbacks.forEach(i=>{i()}),t.on("dispose",()=>{t.off(),[t,t.el_,t.eventBusEl_].forEach(function(i){i&&Wo.has(i)&&Wo.delete(i)}),Oe.setTimeout(()=>{t.eventBusEl_=null},0)}),t}const _X={state:{},setState(t){typeof t=="function"&&(t=t());let e;return mp(t,(n,i)=>{this.state[i]!==n&&(e=e||{},e[i]={from:this.state[i],to:n}),this.state[i]=n}),e&&fc(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function bO(t,e){return Object.assign(t,_X),t.state=Object.assign({},t.state,e),typeof t.handleStateChanged=="function"&&fc(t)&&t.on("statechanged",t.handleStateChanged),t}const qm=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toLowerCase())},Yr=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toUpperCase())},wO=function(t,e){return Yr(t)===Yr(e)};var SX=Object.freeze({__proto__:null,toLowerCase:qm,toTitleCase:Yr,titleCaseEquals:wO});class bt{constructor(e,n,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=sr({},this.options_),n=this.options_=sr(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${Qa()}`}this.name_=n.name||null,n.el?this.el_=n.el:n.createEl!==!1&&(this.el_=this.createEl()),n.className&&this.el_&&n.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),n.evented!==!1&&(DS(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),bO(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,n.initChildren!==!1&&this.initChildren(),this.ready(i),n.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let n=this.children_.length-1;n>=0;n--)this.children_[n].dispose&&this.children_[n].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=sr(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,n,i){return kn(e,n,i)}localize(e,n,i=e){const r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[r],u=r&&r.split("-")[0],d=s&&s[u];let h=i;return o&&o[e]?h=o[e]:d&&d[e]&&(h=d[e]),n&&(h=h.replace(/\{(\d+)\}/g,function(g,y){const w=n[y-1];let C=w;return typeof w>"u"&&(C=g),C})),h}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let n=this;for(let i=0;i=0;r--)if(this.children_[r]===e){n=!0,this.children_.splice(r,1);break}if(!n)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Yr(e.name())]=null,this.childNameIndex_[qm(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const n=this.options_,i=o=>{const u=o.name;let d=o.opts;if(n[u]!==void 0&&(d=n[u]),d===!1)return;d===!0&&(d={}),d.playerOptions=this.options_.playerOptions;const h=this.addChild(u,d);h&&(this[u]=h)};let r;const s=bt.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(o){return!r.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(o=>{let u,d;return typeof o=="string"?(u=o,d=e[u]||this.options_[u]||{}):(u=o.name,d=o),{name:u,opts:d}}).filter(o=>{const u=bt.getComponent(o.opts.componentClass||Yr(o.name));return u&&!s.isTech(u)}).forEach(i)}}buildCSSClass(){return""}ready(e,n=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}n?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(n){n.call(this)},this),this.trigger("ready")},1)}$(e,n){return fd(e,n||this.contentEl())}$$(e,n){return uO(e,n||this.contentEl())}hasClass(e){return zm(this.el_,e)}addClass(...e){oh(this.el_,...e)}removeClass(...e){Nv(this.el_,...e)}toggleClass(e,n){tO(this.el_,e,n)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return iO(this.el_,e)}setAttribute(e,n){_p(this.el_,e,n)}removeAttribute(e){Fv(this.el_,e)}width(e,n){return this.dimension("width",e,n)}height(e,n){return this.dimension("height",e,n)}dimensions(e,n){this.width(e,!0),this.height(n)}dimension(e,n,i){if(n!==void 0){(n===null||n!==n)&&(n=0),(""+n).indexOf("%")!==-1||(""+n).indexOf("px")!==-1?this.el_.style[e]=n:n==="auto"?this.el_.style[e]="":this.el_.style[e]=n+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],s=r.indexOf("px");return parseInt(s!==-1?r.slice(0,s):this.el_["offset"+Yr(e)],10)}currentDimension(e){let n=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(n=Tp(this.el_,e),n=parseFloat(n),n===0||isNaN(n)){const i=`offset${Yr(e)}`;n=this.el_[i]}return n}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),n={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:n,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,n=null;const i=10,r=200;let s;this.on("touchstart",function(u){u.touches.length===1&&(n={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=Oe.performance.now(),s=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)s=!1;else if(n){const d=u.touches[0].pageX-n.pageX,h=u.touches[0].pageY-n.pageY;Math.sqrt(d*d+h*h)>i&&(s=!1)}});const o=function(){s=!1};this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(u){n=null,s===!0&&Oe.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},n),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),Oe.clearTimeout(e)),e}setInterval(e,n){e=hr(this,e),this.clearTimersOnDispose_();const i=Oe.setInterval(e,n);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Oe.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var n;return e=hr(this,e),n=Oe.requestAnimationFrame(()=>{this.rafIds_.has(n)&&this.rafIds_.delete(n),e()}),this.rafIds_.add(n),n}requestNamedAnimationFrame(e,n){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),n=hr(this,n);const i=this.requestAnimationFrame(()=>{n(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),Oe.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,n])=>{this[e].forEach((i,r)=>this[n](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function n(s){const o=Oe.getComputedStyle(s,null),u=o.getPropertyValue("visibility");return o.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function i(s){return!(!n(s.parentElement)||!n(s)||s.style.opacity==="0"||Oe.getComputedStyle(s).height==="0px"||Oe.getComputedStyle(s).width==="0px")}function r(s){if(s.offsetWidth+s.offsetHeight+s.getBoundingClientRect().height+s.getBoundingClientRect().width===0)return!1;const o={x:s.getBoundingClientRect().left+s.offsetWidth/2,y:s.getBoundingClientRect().top+s.offsetHeight/2};if(o.x<0||o.x>(Vt.documentElement.clientWidth||Oe.innerWidth)||o.y<0||o.y>(Vt.documentElement.clientHeight||Oe.innerHeight))return!1;let u=Vt.elementFromPoint(o.x,o.y);for(;u;){if(u===s)return!0;if(u.parentNode)u=u.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,n){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=bt.getComponent("Tech"),r=i&&i.isTech(n),s=bt===n||bt.prototype.isPrototypeOf(n.prototype);if(r||!s){let u;throw r?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=Yr(e),bt.components_||(bt.components_={});const o=bt.getComponent("Player");if(e==="Player"&&o&&o.players){const u=o.players,d=Object.keys(u);if(u&&d.length>0){for(let h=0;hn)throw new Error(`Failed to execute '${t}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${n}).`)}function _O(t,e,n,i){return TX(t,i,n.length-1),n[i][e]}function IS(t){let e;return t===void 0||t.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:t.length,start:_O.bind(null,"start",0,t),end:_O.bind(null,"end",1,t)},Oe.Symbol&&Oe.Symbol.iterator&&(e[Oe.Symbol.iterator]=()=>(t||[]).values()),e}function Ol(t,e){return Array.isArray(t)?IS(t):t===void 0||e===void 0?IS():IS([[t,e]])}const SO=function(t,e){t=t<0?0:t;let n=Math.floor(t%60),i=Math.floor(t/60%60),r=Math.floor(t/3600);const s=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(r=i=n="-"),r=r>0||o>0?r+":":"",i=((r||s>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,r+i+n};let OS=SO;function TO(t){OS=t}function EO(){OS=SO}function lh(t,e=t){return OS(t,e)}var EX=Object.freeze({__proto__:null,createTimeRanges:Ol,createTimeRange:Ol,setFormatTime:TO,resetFormatTime:EO,formatTime:lh});function xO(t,e){let n=0,i,r;if(!e)return 0;(!t||!t.length)&&(t=Ol(0,0));for(let s=0;se&&(r=e),n+=r-i;return n/e}function Fr(t){if(t instanceof Fr)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:yu(t)&&(typeof t.code=="number"&&(this.code=t.code),Object.assign(this,t)),this.message||(this.message=Fr.defaultMessages[this.code]||"")}Fr.prototype.code=0,Fr.prototype.message="",Fr.prototype.status=null,Fr.prototype.metadata=null,Fr.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Fr.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Fr.MEDIA_ERR_CUSTOM=0,Fr.prototype.MEDIA_ERR_CUSTOM=0,Fr.MEDIA_ERR_ABORTED=1,Fr.prototype.MEDIA_ERR_ABORTED=1,Fr.MEDIA_ERR_NETWORK=2,Fr.prototype.MEDIA_ERR_NETWORK=2,Fr.MEDIA_ERR_DECODE=3,Fr.prototype.MEDIA_ERR_DECODE=3,Fr.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Fr.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Fr.MEDIA_ERR_ENCRYPTED=5,Fr.prototype.MEDIA_ERR_ENCRYPTED=5;function Gm(t){return t!=null&&typeof t.then=="function"}function wu(t){Gm(t)&&t.then(null,e=>{})}const RS=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,n,i)=>(t[n]&&(e[n]=t[n]),e),{cues:t.cues&&Array.prototype.map.call(t.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var CO={textTracksToJson:function(t){const e=t.$$("track"),n=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const r=RS(i.track);return i.src&&(r.src=i.src),r}).concat(Array.prototype.filter.call(t.textTracks(),function(i){return n.indexOf(i)===-1}).map(RS))},jsonToTextTracks:function(t,e){return t.forEach(function(n){const i=e.addRemoteTextTrack(n).track;!n.src&&n.cues&&n.cues.forEach(r=>i.addCue(r))}),e.textTracks()},trackToJson_:RS};const LS="vjs-modal-dialog";class xp extends bt{constructor(e,n){super(e,n),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=kn("div",{className:`${LS}-content`},{role:"document"}),this.descEl_=kn("p",{className:`${LS}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),hd(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${LS} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const n=this.closeable_=!!e;let i=this.getChild("closeButton");if(n&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!n&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const n=this.contentEl(),i=n.parentNode,r=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(n),this.empty(),lO(n,e),this.trigger("modalfill"),r?i.insertBefore(n,r):i.appendChild(n);const s=this.getChild("closeButton");s&&i.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Uv(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=Vt.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(e)||n===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const n=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let s=0;s(n instanceof Oe.HTMLAnchorElement||n instanceof Oe.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof Oe.HTMLInputElement||n instanceof Oe.HTMLSelectElement||n instanceof Oe.HTMLTextAreaElement||n instanceof Oe.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof Oe.HTMLIFrameElement||n instanceof Oe.HTMLObjectElement||n instanceof Oe.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable"))}}xp.prototype.options_={pauseOnOpen:!0,temporary:!0},bt.registerComponent("ModalDialog",xp);class Cp extends xa{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let n=0;n{this.trigger({track:e,type:"labelchange",target:this})},fc(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let n;for(let i=0,r=this.length;i=0;n--)if(e[n].enabled){MS(e,e[n]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&MS(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,MS(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const NS=function(t,e){for(let n=0;n=0;n--)if(e[n].selected){NS(e,e[n]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let n=0;n{this.changing_||(this.changing_=!0,NS(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class AO extends Cp{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class AX{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let n=0,i=e.length;n0&&(Oe.console&&Oe.console.groupCollapsed&&Oe.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>fi.error(r)),Oe.console&&Oe.console.groupEnd&&Oe.console.groupEnd()),n.flush()},IO=function(t,e){const n={uri:t},i=Gv(t);i&&(n.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(n.withCredentials=r),mD(n,hr(this,function(s,o,u){if(s)return fi.error(s,o);e.loaded_=!0,typeof Oe.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],d=>{if(d.type==="vttjserror"){fi.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return DO(u,e)}):DO(u,e)}))};class Km extends FS{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const n=sr(e,{kind:DX[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=kO[n.mode]||"disabled";const r=n.default;(n.kind==="metadata"||n.kind==="chapters")&&(i="hidden"),super(n),this.tech_=n.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const s=new qv(this.cues_),o=new qv(this.activeCues_);let u=!1;this.timeupdateHandler=hr(this,function(h={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const d=()=>{this.stopTracking()};this.tech_.one("dispose",d),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(h){kO[h]&&i!==h&&(i=h,!this.preload_&&i!=="disabled"&&this.cues.length===0&&IO(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return o;const h=this.tech_.currentTime(),g=[];for(let y=0,w=this.cues.length;y=h&&g.push(C)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let y=0;y{n=mc.LOADED,this.trigger({type:"load",target:this})})}}mc.prototype.allowedEvents_={load:"load"},mc.NONE=0,mc.LOADING=1,mc.LOADED=2,mc.ERROR=3;const $a={audio:{ListClass:xX,TrackClass:OO,capitalName:"Audio"},video:{ListClass:CX,TrackClass:RO,capitalName:"Video"},text:{ListClass:AO,TrackClass:Km,capitalName:"Text"}};Object.keys($a).forEach(function(t){$a[t].getterName=`${t}Tracks`,$a[t].privateName=`${t}Tracks_`});const Ap={remoteText:{ListClass:AO,TrackClass:Km,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:AX,TrackClass:mc,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},qo=Object.assign({},$a,Ap);Ap.names=Object.keys(Ap),$a.names=Object.keys($a),qo.names=[].concat(Ap.names).concat($a.names);function OX(t,e,n,i,r={}){const s=t.textTracks();r.kind=e,n&&(r.label=n),i&&(r.language=i),r.tech=t;const o=new qo.text.TrackClass(r);return s.addTrack(o),o}class $n extends bt{constructor(e={},n=function(){}){e.reportTouchActivity=!1,super(null,e,n),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),qo.names.forEach(i=>{const r=qo[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new qo.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(hr(this,function(){const n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ol(0,0)}bufferedPercent(){return xO(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks($a.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(n=>{const i=this[`${n}Tracks`]()||[];let r=i.length;for(;r--;){const s=i[r];n==="text"&&this.removeRemoteTextTrack(s),i.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let n=e.length;for(;n--;){const i=e[n];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Fr(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ol(0,0):Ol()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){$a.names.forEach(e=>{const n=$a[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!Oe.WebVTT)if(Vt.body.contains(this.el())){if(!this.options_["vtt.js"]&&gp(TD)&&Object.keys(TD).length>0){this.trigger("vttjsloaded");return}const e=Vt.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),Oe.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),n=this.remoteTextTracks(),i=u=>e.addTrack(u.track),r=u=>e.removeTrack(u.track);n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),o=()=>{s();for(let u=0;uthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const n=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const n=Qa();return!this.isReady_||this.paused()?(this.queuedHanders_.add(n),this.one("playing",()=>{this.queuedHanders_.has(n)&&(this.queuedHanders_.delete(n),e())})):this.requestNamedAnimationFrame(n,e),n}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,n){return $n.canPlayType(e.type)}static isTech(e){return e.prototype instanceof $n||e instanceof $n||e===$n}static registerTech(e,n){if($n.techs_||($n.techs_={}),!$n.isTech(n))throw new Error(`Tech ${e} must be a Tech`);if(!$n.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!$n.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Yr(e),$n.techs_[e]=n,$n.techs_[qm(e)]=n,e!=="Tech"&&$n.defaultTechOrder_.push(e),n}static getTech(e){if(e){if($n.techs_&&$n.techs_[e])return $n.techs_[e];if(e=Yr(e),Oe&&Oe.videojs&&Oe.videojs[e])return fi.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),Oe.videojs[e]}}}qo.names.forEach(function(t){const e=qo[t];$n.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),$n.prototype.featuresVolumeControl=!0,$n.prototype.featuresMuteControl=!0,$n.prototype.featuresFullscreenResize=!1,$n.prototype.featuresPlaybackRate=!1,$n.prototype.featuresProgressEvents=!1,$n.prototype.featuresSourceset=!1,$n.prototype.featuresTimeupdateEvents=!1,$n.prototype.featuresNativeTextTracks=!1,$n.prototype.featuresVideoFrameCallback=!1,$n.withSourceHandlers=function(t){t.registerSourceHandler=function(e,n){let i=t.sourceHandlers;i||(i=t.sourceHandlers=[]),n===void 0&&(n=i.length),i.splice(n,0,e)},t.canPlayType=function(e){const n=t.sourceHandlers||[];let i;for(let r=0;rch(e,uh[e.type],n,t),1)}function MX(t,e){t.forEach(n=>n.setTech&&n.setTech(e))}function NX(t,e,n){return t.reduceRight(HS(n),e[n]())}function FX(t,e,n,i){return e[n](t.reduce(HS(n),i))}function LO(t,e,n,i=null){const r="call"+Yr(n),s=t.reduce(HS(r),i),o=s===Yv,u=o?null:e[n](s);return HX(t,n,u,o),u}const BX={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},UX={setCurrentTime:1,setMuted:1,setVolume:1},MO={play:1,pause:1};function HS(t){return(e,n)=>e===Yv?Yv:n[t]?n[t](e):e}function HX(t,e,n,i){for(let r=t.length-1;r>=0;r--){const s=t[r];s[e]&&s[e](i,n)}}function zX(t){Kv.hasOwnProperty(t.id())&&delete Kv[t.id()]}function jX(t,e){const n=Kv[t.id()];let i=null;if(n==null)return i=e(t),Kv[t.id()]=[[e,i]],i;for(let r=0;r{if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;const n=t.cache_.sources.filter(r=>r.src===e);if(n.length)return n[0].type;const i=t.$$("source");for(let r=0;r `;const BO=Ov?10009:Rv?461:8,kp={codes:{play:415,pause:19,ff:417,rw:412,back:BO},names:{415:"play",19:"pause",417:"ff",412:"rw",[BO]:"back"},isEventKey(t,e){return e=e.toLowerCase(),!!(this.names[t.keyCode]&&this.names[t.keyCode]===e)},getEventName(t){if(this.names[t.keyCode])return this.names[t.keyCode];if(this.codes[t.code]){const e=this.codes[t.code];return this.names[e]}return null}},UO=5;class GX extends xa{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const n=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n.key)){if(this.isPaused_)return;n.preventDefault();const i=n.key.substring(5).toLowerCase();this.move(i)}else if(kp.isEventKey(n,"play")||kp.isEventKey(n,"pause")||kp.isEventKey(n,"ff")||kp.isEventKey(n,"rw")){n.preventDefault();const i=kp.getEventName(n);this.performMediaAction_(i)}else kp.isEventKey(n,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(n.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+UO);break;case"rw":this.userSeek_(this.player_.currentTime()-UO);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const n=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);n&&(i=!!n.closest(".video-js"),n.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!n)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,n=[];function i(r){for(const s of r)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&n.push(s),s.hasOwnProperty("children_")&&s.children_.length>0&&i(s.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){n.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&n.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const s=r.el_.querySelector(".vjs-errors-ok-button-container");s&&s.querySelectorAll("button").forEach((o,u)=>{n.push({name:()=>"ModalButton"+(u+1),el:()=>o,getPositions:()=>{const d=o.getBoundingClientRect(),h={x:d.x,y:d.y,width:d.width,height:d.height,top:d.top,right:d.right,bottom:d.bottom,left:d.left},g={x:d.left+d.width/2,y:d.top+d.height/2,width:0,height:0,top:d.top+d.height/2,right:d.left+d.width/2,bottom:d.top+d.height/2,left:d.left+d.width/2};return{boundingClientRect:h,center:g}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:d=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=n,this.focusableComponents}findSuitableDOMChild(e){function n(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const n=this.getCurrentComponent();if(!n)return;const i=n.getPositions(),r=this.focusableComponents.filter(o=>o!==n&&this.isInDirection_(i.boundingClientRect,o.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(i.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:n})}findBestCandidate_(e,n,i){let r=1/0,s=null;for(const o of n){const u=o.getPositions().center,d=this.calculateDistance_(e,u,i);d=e.right;case"left":return n.right<=e.left;case"down":return n.top>=e.bottom;case"up":return n.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",n={},i={}){n=Object.assign({className:this.buildCSSClass(),tabIndex:0},n),e==="button"&&fi.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=n.tabIndex;const r=kn(e,n,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(kn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=kn("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,n=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,hd(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}bt.registerComponent("ClickableComponent",Zv);class zS extends Zv{constructor(e,n){super(e,n),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return kn("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const n=this.player().poster();this.setSrc(n),n?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(kn("picture",{className:"vjs-poster",tabIndex:-1},{},kn("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?wu(this.player_.play()):this.player_.pause())}}zS.prototype.crossorigin=zS.prototype.crossOrigin,bt.registerComponent("PosterImage",zS);const el="#222",HO="#ccc",YX={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function jS(t,e){let n;if(t.length===4)n=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else if(t.length===7)n=t.slice(1);else throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+e+")"}function _u(t,e,n){try{t.style[e]=n}catch{return}}function zO(t){return t?`${t}px`:""}class XX extends bt{constructor(e,n,i){super(e,n,i);const r=o=>this.updateDisplay(o),s=o=>{this.updateDisplayOverlay(),this.updateDisplay(o)};e.on("loadstart",o=>this.toggleDisplay(o)),e.on("texttrackchange",r),e.on("loadedmetadata",o=>{this.updateDisplayOverlay(),this.preselectTrack(o)}),e.ready(hr(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",s),e.on("playerresize",s);const o=Oe.screen.orientation||Oe,u=Oe.screen.orientation?"change":"orientationchange";o.addEventListener(u,s),e.on("dispose",()=>o.removeEventListener(u,s));const d=this.options_.playerOptions.tracks||[];for(let h=0;h0&&u.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!Oe.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),n=this.player_.currentHeight(),i=e/n,r=this.player_.videoWidth()/this.player_.videoHeight();let s=0,o=0;Math.abs(i-r)>.1&&(i>r?s=Math.round((e-n*r)/2):o=Math.round((n-e/r)/2)),_u(this.el_,"insetInline",zO(s)),_u(this.el_,"insetBlock",zO(o))}updateDisplayState(e){const n=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const s=i[r];if(!s)continue;const o=s.displayState;if(n.color&&(o.firstChild.style.color=n.color),n.textOpacity&&_u(o.firstChild,"color",jS(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(o.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&_u(o.firstChild,"backgroundColor",jS(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?_u(o,"backgroundColor",jS(n.windowColor,n.windowOpacity)):o.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?o.firstChild.style.textShadow=`2px 2px 3px ${el}, 2px 2px 4px ${el}, 2px 2px 5px ${el}`:n.edgeStyle==="raised"?o.firstChild.style.textShadow=`1px 1px ${el}, 2px 2px ${el}, 3px 3px ${el}`:n.edgeStyle==="depressed"?o.firstChild.style.textShadow=`1px 1px ${HO}, 0 1px ${HO}, -1px -1px ${el}, 0 -1px ${el}`:n.edgeStyle==="uniform"&&(o.firstChild.style.textShadow=`0 0 4px ${el}, 0 0 4px ${el}, 0 0 4px ${el}, 0 0 4px ${el}`)),n.fontPercent&&n.fontPercent!==1){const u=Oe.parseFloat(o.style.fontSize);o.style.fontSize=u*n.fontPercent+"px",o.style.height="auto",o.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=YX[n.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof Oe.WebVTT!="function"||e.every(i=>!i.activeCues))return;const n=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const n=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){wu(n),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const s=()=>r.focus();Gm(n)?n.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}jO.prototype.controlText_="Play Video",bt.registerComponent("BigPlayButton",jO);class QX extends vo{constructor(e,n){super(e,n),this.setIcon("cancel"),this.controlText(n&&n.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}bt.registerComponent("CloseButton",QX);class VO extends vo{constructor(e,n={}){super(e,n),n.replay=n.replay===void 0||n.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),n.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?wu(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",n=>this.handleSeeked(n))}}VO.prototype.controlText_="Play",bt.registerComponent("PlayToggle",VO);class Pp extends bt{constructor(e,n){super(e,n),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),n=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=kn("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return n.appendChild(i),this.contentEl_=kn("span",{className:`${e}-display`},{role:"presentation"}),n.appendChild(this.contentEl_),n}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=lh(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let n=this.textNode_;n&&this.contentEl_.firstChild!==n&&(n=null,fi.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=Vt.createTextNode(this.formattedTime_),this.textNode_&&(n?this.contentEl_.replaceChild(this.textNode_,n):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Pp.prototype.labelText_="Time",Pp.prototype.controlText_="Time",bt.registerComponent("TimeDisplay",Pp);class VS extends Pp{buildCSSClass(){return"vjs-current-time"}updateContent(e){let n;this.player_.ended()?n=this.player_.duration():n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)}}VS.prototype.labelText_="Current Time",VS.prototype.controlText_="Current Time",bt.registerComponent("CurrentTimeDisplay",VS);class WS extends Pp{constructor(e,n){super(e,n);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const n=this.player_.duration();this.updateTextNode_(n)}}WS.prototype.labelText_="Duration",WS.prototype.controlText_="Duration",bt.registerComponent("DurationDisplay",WS);class JX extends bt{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return n.appendChild(i),e.appendChild(n),e}}bt.registerComponent("TimeDivider",JX);class qS extends Pp{constructor(e,n){super(e,n),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(kn("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let n;this.player_.ended()?n=0:this.player_.remainingTimeDisplay?n=this.player_.remainingTimeDisplay():n=this.player_.remainingTime(),this.updateTextNode_(n)}}qS.prototype.labelText_="Remaining Time",qS.prototype.controlText_="Remaining Time",bt.registerComponent("RemainingTimeDisplay",qS);class $X extends bt{constructor(e,n){super(e,n),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=kn("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(kn("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(Vt.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}bt.registerComponent("LiveDisplay",$X);class WO extends vo{constructor(e,n){super(e,n),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=kn("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}WO.prototype.controlText_="Seek to live, currently playing live",bt.registerComponent("SeekToLive",WO);function Ym(t,e,n){return t=Number(t),Math.min(n,Math.max(e,isNaN(t)?e:t))}var eZ=Object.freeze({__proto__:null,clamp:Ym});class GS extends bt{constructor(e,n){super(e,n),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,n={},i={}){return n.className=n.className+" vjs-slider",n=Object.assign({tabIndex:0},n),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,n,i)}handleMouseDown(e){const n=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!vu&&e.preventDefault(),rO(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const n=this.bar.el_.ownerDocument;sO(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(n,"mousemove",this.handleMouseMove_),this.off(n,"mouseup",this.handleMouseUp_),this.off(n,"touchmove",this.handleMouseMove_),this.off(n,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const n=this.vertical()?"height":"width";this.bar.el().style[n]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Ym(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const n=Bv(this.el_,e);return this.vertical()?n.y:n.x}handleKeyDown(e){const n=this.options_.playerOptions.spatialNavigation,i=n&&n.enabled,r=n&&n.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}bt.registerComponent("Slider",GS);const KS=(t,e)=>Ym(t/e*100,0,100).toFixed(2)+"%";class tZ extends bt{constructor(e,n){super(e,n),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),n=kn("span",{className:"vjs-control-text"}),i=kn("span",{textContent:this.localize("Loaded")}),r=Vt.createTextNode(": ");return this.percentageEl_=kn("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(n),n.appendChild(i),n.appendChild(r),n.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const n=this.player_.liveTracker,i=this.player_.buffered(),r=n&&n.isLive()?n.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),o=this.partEls_,u=KS(s,r);this.percent_!==u&&(this.el_.style.width=u,hd(this.percentageEl_,u),this.percent_=u);for(let d=0;di.length;d--)this.el_.removeChild(o[d-1]);o.length=i.length})}}bt.registerComponent("LoadProgressBar",tZ);class nZ extends bt{constructor(e,n){super(e,n),this.update=bu(hr(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,n,i){const r=jm(this.el_),s=Sp(this.player_.el()),o=e.width*n;if(!s||!r)return;let u=e.left-s.left+o,d=e.width-o+(s.right-e.right);d||(d=e.width-o,u=o);let h=r.width/2;ur.width&&(h=r.width),h=Math.round(h),this.el_.style.right=`-${h}px`,this.write(i)}write(e){hd(this.el_,e)}updateTime(e,n,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;const o=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const u=this.player_.liveTracker.liveWindow(),d=u-n*u;s=(d<1?"":"-")+lh(d,u)}else s=lh(i,o);this.update(e,n,s),r&&r()})}}bt.registerComponent("TimeTooltip",nZ);class YS extends bt{constructor(e,n){super(e,n),this.setIcon("circle"),this.update=bu(hr(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,n){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,n,r)}}YS.prototype.options_={children:[]},!go&&!Il&&YS.prototype.options_.children.push("timeTooltip"),bt.registerComponent("PlayProgressBar",YS);class qO extends bt{constructor(e,n){super(e,n),this.update=bu(hr(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,n){const i=n*this.player_.duration();this.getChild("timeTooltip").updateTime(e,n,i,()=>{this.el_.style.left=`${e.width*n}px`})}}qO.prototype.options_={children:["timeTooltip"]},bt.registerComponent("MouseTimeDisplay",qO);class Qv extends GS{constructor(e,n){n=sr(Qv.prototype.options_,n),n.children=[...n.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(go||Il);(!go&&!Il||i)&&n.children.splice(1,0,"mouseTimeDisplay"),super(e,n),this.shouldDisableSeekWhileScrubbingOnMobile_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=hr(this,this.update),this.update=bu(this.update_,Ja),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Vt&&"visibilityState"in Vt&&this.on(Vt,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){Vt.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ja))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(Vt.visibilityState==="hidden")return;const n=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==n&&(this.el_.setAttribute("aria-valuenow",(n*100).toFixed(2)),this.percent_=n),(this.currentTime_!==i||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[lh(i,s),lh(s,s)],"{1} of {2}")),this.currentTime_=i,this.duration_=s),this.bar&&this.bar.update(Sp(this.el()),this.getProgress())}),n}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){if(this.pendingSeekTime_)return this.pendingSeekTime_/this.player_.duration();const e=this.getCurrentTime_();let n;const i=this.player_.liveTracker;return i&&i.isLive()?(n=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(n=1)):n=e/this.player_.duration(),n}handleMouseDown(e){Vm(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbingOnMobile_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,n=!1){if(!Vm(e)||isNaN(this.player_.duration()))return;!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),s=this.player_.liveTracker;if(!s||!s.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){s.seekToLiveEdge();return}const o=s.seekableStart(),u=s.liveCurrentTime();if(i=o+r*s.liveWindow(),i>=u&&(i=u),i<=o&&(i=o+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbingOnMobile_?this.pendingSeekTime_=i:this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime_&&(this.userSeek_(this.pendingSeekTime_),this.pendingSeekTime_=null),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?wu(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const n=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Vt&&"visibilityState"in Vt&&this.off(Vt,"visibilitychange",this.toggleVisibility_),super.dispose()}}Qv.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},bt.registerComponent("SeekBar",Qv);class GO extends bt{constructor(e,n){super(e,n),this.handleMouseMove=bu(hr(this,this.handleMouseMove),Ja),this.throttledHandleMouseSeek=bu(hr(this,this.handleMouseSeek),Ja),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const n=this.getChild("seekBar");if(!n)return;const i=n.getChild("playProgressBar"),r=n.getChild("mouseTimeDisplay");if(!i&&!r)return;const s=n.el(),o=jm(s);let u=Bv(s,e).x;u=Ym(u,0,1),r&&r.update(o,u),i&&i.update(o,n.getProgress())}handleMouseSeek(e){const n=this.getChild("seekBar");n&&n.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&wu(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const n=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}GO.prototype.options_={children:["seekBar"]},bt.registerComponent("ProgressControl",GO);class KO extends vo{constructor(e,n){super(e,n),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){Vt.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Oe?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof Vt.exitPictureInPicture=="function"&&super.show()}}KO.prototype.controlText_="Picture-in-Picture",bt.registerComponent("PictureInPictureToggle",KO);class YO extends vo{constructor(e,n){super(e,n),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),Vt[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}YO.prototype.controlText_="Fullscreen",bt.registerComponent("FullscreenToggle",YO);const iZ=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class rZ extends bt{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}bt.registerComponent("VolumeLevel",rZ);class sZ extends bt{constructor(e,n){super(e,n),this.update=bu(hr(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,n,i,r){if(!i){const s=Sp(this.el_),o=Sp(this.player_.el()),u=e.width*n;if(!o||!s)return;const d=e.left-o.left+u,h=e.width-u+(o.right-e.right);let g=s.width/2;ds.width&&(g=s.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){hd(this.el_,e)}updateVolume(e,n,i,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,n,i,r.toFixed(0)),s&&s()})}}bt.registerComponent("VolumeLevelTooltip",sZ);class XO extends bt{constructor(e,n){super(e,n),this.update=bu(hr(this,this.update),Ja)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,n,i){const r=100*n;this.getChild("volumeLevelTooltip").updateVolume(e,n,i,r,()=>{i?this.el_.style.bottom=`${e.height*n}px`:this.el_.style.left=`${e.width*n}px`})}}XO.prototype.options_={children:["volumeLevelTooltip"]},bt.registerComponent("MouseVolumeLevelDisplay",XO);class Jv extends GS{constructor(e,n){super(e,n),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Vm(e)&&super.handleMouseDown(e)}handleMouseMove(e){const n=this.getChild("mouseVolumeLevelDisplay");if(n){const i=this.el(),r=Sp(i),s=this.vertical();let o=Bv(i,e);o=s?o.y:o.x,o=Ym(o,0,1),n.update(r,o,s)}Vm(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Jv.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!go&&!Il&&Jv.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Jv.prototype.playerEvent="volumechange",bt.registerComponent("VolumeBar",Jv);class ZO extends bt{constructor(e,n={}){n.vertical=n.vertical||!1,(typeof n.volumeBar>"u"||gp(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),super(e,n),iZ(this,e),this.throttledHandleMouseMove=bu(hr(this,this.handleMouseMove),Ja),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ZO.prototype.options_={children:["volumeBar"]},bt.registerComponent("VolumeControl",ZO);const oZ=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class QO extends vo{constructor(e,n){super(e,n),oZ(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const n=this.player_.volume(),i=this.player_.lastVolume_();if(n===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let n=3;this.setIcon("volume-high"),go&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),n=0):e<.33?(this.setIcon("volume-low"),n=1):e<.67&&(this.setIcon("volume-medium"),n=2),Nv(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),oh(this.el_,`vjs-vol-${n}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}QO.prototype.controlText_="Mute",bt.registerComponent("MuteToggle",QO);class JO extends bt{constructor(e,n={}){typeof n.inline<"u"?n.inline=n.inline:n.inline=!0,(typeof n.volumeControl>"u"||gp(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),super(e,n),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Ea(Vt,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),yo(Vt,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}JO.prototype.options_={children:["muteToggle","volumeControl"]},bt.registerComponent("VolumePanel",JO);class $O extends vo{constructor(e,n){super(e,n),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const n=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let s;n+this.skipTime<=r?s=n+this.skipTime:s=r,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}$O.prototype.controlText_="Skip Forward",bt.registerComponent("SkipForward",$O);class eR extends vo{constructor(e,n){super(e,n),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const n=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let s;r&&n-this.skipTime<=r?s=r:n>=this.skipTime?s=n-this.skipTime:s=0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}eR.prototype.controlText_="Skip Backward",bt.registerComponent("SkipBackward",eR);class tR extends bt{constructor(e,n){super(e,n),n&&(this.menuButton_=n.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof bt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof bt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const n=this.addChild(e);n&&this.addEventListenerForItem(n)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=kn(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const n=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Ea(n,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),n}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const n=e.relatedTarget||Vt.activeElement;if(!this.children().some(i=>i.el()===n)){const i=this.menuButton_;i&&i.buttonPressed_&&n!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const n=this.children();if(!Array.isArray(n))return;const i=n.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const n=this.children().slice();n.length&&n[0].hasClass("vjs-menu-title")&&n.shift(),n.length>0&&(e<0?e=0:e>=n.length&&(e=n.length-1),this.focusedChild_=e,n[e].el_.focus())}}bt.registerComponent("Menu",tR);class XS extends bt{constructor(e,n={}){super(e,n),this.menuButton_=new vo(e,n),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=vo.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=s=>this.handleClick(s);this.handleMenuKeyUp_=s=>this.handleMenuKeyUp(s),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",s=>this.handleKeyDown(s)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Ea(Vt,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",s=>this.handleMouseLeave(s)),this.on("keydown",s=>this.handleSubmenuKeyDown(s))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new tR(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const n=kn("li",{className:"vjs-menu-title",textContent:Yr(this.options_.title),tabIndex:-1}),i=new bt(this.player_,{el:n});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let n=0;n{this.handleTracksChange.apply(this,u)},o=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};if(e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",o),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",o)}),r.onchange===void 0){let u;this.on(["tap","click"],function(){if(typeof Oe.Event!="object")try{u=new Oe.Event("change")}catch{}u||(u=Vt.createEvent("Event"),u.initEvent("change",!0,!0)),r.dispatchEvent(u)})}this.handleTracksChange()}handleClick(e){const n=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let r=0;r-1&&o.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const n=this.player().textTracks();let i=!0;for(let r=0,s=n.length;r-1&&o.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}bt.registerComponent("OffTextTrackMenuItem",nR);class Dp extends ZS{constructor(e,n={}){n.tracks=e.textTracks(),super(e,n)}createItems(e=[],n=Zm){let i;this.label_&&(i=`${this.label_} off`),e.push(new nR(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let s=0;s-1){const u=new n(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${o.kind}-menu-item`),e.push(u)}}return e}}bt.registerComponent("TextTrackButton",Dp);class iR extends Xm{constructor(e,n){const i=n.track,r=n.cue,s=e.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=r.text,n.selected=r.startTime<=s&&s{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),super.update()):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Yr(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const n=this.track_.cues;if(!n)return e;for(let i=0,r=n.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Yr(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new eT(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,rR),e}}nT.prototype.kinds_=["captions","subtitles"],nT.prototype.controlText_="Subtitles",bt.registerComponent("SubsCapsButton",nT);class sR extends Xm{constructor(e,n){const i=n.track,r=e.audioTracks();n.label=i.label||i.language||"Unknown",n.selected=i.enabled,super(e,n),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const s=(...o)=>{this.handleTracksChange.apply(this,o)};r.addEventListener("change",s),this.on("dispose",()=>{r.removeEventListener("change",s)})}createEl(e,n,i){const r=super.createEl(e,n,i),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(kn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(kn("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const n=this.player_.audioTracks();for(let i=0;ithis.update(s))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}iT.prototype.contentElType="button",bt.registerComponent("PlaybackRateMenuItem",iT);class aR extends XS{constructor(e,n){super(e,n),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=kn("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),n=[];for(let i=e.length-1;i>=0;i--)n.push(new iT(this.player(),{rate:e[i]+"x"}));return n}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}aR.prototype.controlText_="Playback Rate",bt.registerComponent("PlaybackRateMenuButton",aR);class lR extends bt{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",n={},i={}){return n.className||(n.className=this.buildCSSClass()),super.createEl(e,n,i)}}bt.registerComponent("Spacer",lR);class aZ extends lR{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}bt.registerComponent("CustomControlSpacer",aZ);class uR extends bt{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}uR.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},bt.registerComponent("ControlBar",uR);class cR extends xp{constructor(e,n){super(e,n),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}cR.prototype.options_=Object.assign({},xp.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),bt.registerComponent("ErrorDisplay",cR);class dR extends bt{constructor(e,n={}){super(e,n),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),kn("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const n=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Qa()}`)+"-"+e[1].replace(/\W+/g,""),i=kn("option",{id:n,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${n}`),i}))}}bt.registerComponent("TextTrackSelect",dR);class dh extends bt{constructor(e,n={}){super(e,n);const i=kn("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const s of r){const o=this.options_.selectConfigs[s],u=o.className,d=o.id.replace("%s",this.options_.id_);let h=null;const g=`vjs_select_${Qa()}`;if(this.options_.type==="colors"){h=kn("span",{className:u});const w=kn("label",{id:d,className:"vjs-label",textContent:this.localize(o.label)});w.setAttribute("for",g),h.appendChild(w)}const y=new dR(e,{SelectOptions:o.options,legendId:this.options_.legendId,id:g,labelId:d});this.addChild(y),this.options_.type==="colors"&&(h.appendChild(y.el()),this.el().appendChild(h))}}createEl(){return kn("fieldset",{className:this.options_.className})}}bt.registerComponent("TextTrackFieldset",dh);class hR extends bt{constructor(e,n={}){super(e,n);const i=this.options_.textTrackComponentid,r=new dh(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new dh(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const o=new dh(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(o)}createEl(){return kn("div",{className:"vjs-track-settings-colors"})}}bt.registerComponent("TextTrackSettingsColors",hR);class pR extends bt{constructor(e,n={}){super(e,n);const i=this.options_.textTrackComponentid,r=new dh(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new dh(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const o=new dh(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(o)}createEl(){return kn("div",{className:"vjs-track-settings-font"})}}bt.registerComponent("TextTrackSettingsFont",pR);class fR extends bt{constructor(e,n={}){super(e,n);const i=this.localize("restore all settings to the default values"),r=new vo(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const s=new vo(e,{controlText:i,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=this.localize("Done"),this.addChild(s)}createEl(){return kn("div",{className:"vjs-track-settings-controls"})}}bt.registerComponent("TrackSettingsControls",fR);const rT="vjs-text-track-settings",mR=["#000","Black"],gR=["#00F","Blue"],yR=["#0FF","Cyan"],vR=["#0F0","Green"],bR=["#F0F","Magenta"],wR=["#F00","Red"],_R=["#FFF","White"],SR=["#FF0","Yellow"],sT=["1","Opaque"],oT=["0.5","Semi-Transparent"],TR=["0","Transparent"],md={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[mR,_R,wR,vR,gR,SR,bR,yR],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[sT,oT,TR],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[_R,mR,wR,vR,gR,SR,bR,yR],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:t=>t==="1.00"?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[sT,oT],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[TR,oT,sT],className:"vjs-window-opacity vjs-opacity"}};md.windowColor.options=md.backgroundColor.options;function ER(t,e){if(e&&(t=e(t)),t&&t!=="none")return t}function lZ(t,e){const n=t.options[t.options.selectedIndex].value;return ER(n,e)}function uZ(t,e,n){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),mp(md,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return qI(md,(e,n,i)=>{const r=lZ(this.$(n.selector),n.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){mp(md,(n,i)=>{uZ(this.$(n.selector),e[i],n.parser)})}setDefaults(){mp(md,e=>{const n=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=n})}restoreSettings(){let e;try{e=JSON.parse(Oe.localStorage.getItem(rT))}catch(n){fi.warn(n)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?Oe.localStorage.setItem(rT,JSON.stringify(e)):Oe.localStorage.removeItem(rT)}catch(n){fi.warn(n)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}bt.registerComponent("TextTrackSettings",cZ);class dZ extends bt{constructor(e,n){let i=n.ResizeObserver||Oe.ResizeObserver;n.ResizeObserver===null&&(i=!1);const r=sr({createEl:!i,reportTouchActivity:!1},n);super(e,r),this.ResizeObserver=n.ResizeObserver||Oe.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=gO(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const s=this.debouncedHandler_;let o=this.unloadListener_=function(){yo(this,"resize",s),yo(this,"unload",o),o=null};Ea(this.el_.contentWindow,"unload",o),Ea(this.el_.contentWindow,"resize",s)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}bt.registerComponent("ResizeManager",dZ);const hZ={trackingThreshold:20,liveTolerance:15};class pZ extends bt{constructor(e,n){const i=sr(hZ,n,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const n=Number(Oe.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),s=this.player_.currentTime();let o=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(o=!1),o!==this.behindLiveEdge_&&(this.behindLiveEdge_=o,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ja),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),n=[];let i=e?e.length:0;for(;i--;)n.push(e.end(i));return n.length?n.sort()[n.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),n=[];let i=e?e.length:0;for(;i--;)n.push(e.start(i));return n.length?n.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}bt.registerComponent("LiveTracker",pZ);class fZ extends bt{constructor(e,n){super(e,n),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:kn("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Qa()}`}),description:kn("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Qa()}`})},kn("div",{className:"vjs-title-bar"},{},GI(this.els))}updateDom_(){const e=this.player_.tech_,n=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const s=this.state[r],o=this.els[r],u=i[r];Uv(o),s&&hd(o,s),n&&(n.removeAttribute(u),s&&n.setAttribute(u,o.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,n=e&&e.el_;n&&(n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}bt.registerComponent("TitleBar",fZ);const mZ={initialDisplay:4e3,position:[],takeFocus:!1};class gZ extends vo{constructor(e,n){n=sr(mZ,n),super(e,n),this.controlText(n.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=kn("button",{},{type:"button",class:this.buildCSSClass()},kn("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}bt.registerComponent("TransientButton",gZ);const aT=t=>{const e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;const n=t.$$("source"),i=[];let r="";if(!n.length)return!1;for(let s=0;s{let n={};for(let i=0;ixR([t.el(),Oe.HTMLMediaElement.prototype,Oe.Element.prototype,yZ],"innerHTML"),CR=function(t){const e=t.el();if(e.resetSourceWatch_)return;const n={},i=vZ(t),r=s=>(...o)=>{const u=s.apply(e,o);return aT(t),u};["append","appendChild","insertAdjacentHTML"].forEach(s=>{e[s]&&(n[s]=e[s],e[s]=r(n[s]))}),Object.defineProperty(e,"innerHTML",sr(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(n).forEach(s=>{e[s]=n[s]}),Object.defineProperty(e,"innerHTML",i)},t.one("sourceset",e.resetSourceWatch_)},bZ=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?PO(Oe.Element.prototype.getAttribute.call(this,"src")):""},set(t){return Oe.Element.prototype.setAttribute.call(this,"src",t),t}}),wZ=t=>xR([t.el(),Oe.HTMLMediaElement.prototype,bZ],"src"),_Z=function(t){if(!t.featuresSourceset)return;const e=t.el();if(e.resetSourceset_)return;const n=wZ(t),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",sr(n,{set:s=>{const o=n.set.call(e,s);return t.triggerSourceset(e.src),o}})),e.setAttribute=(s,o)=>{const u=i.call(e,s,o);return/src/i.test(s)&&t.triggerSourceset(e.src),u},e.load=()=>{const s=r.call(e);return aT(t)||(t.triggerSourceset(""),CR(t)),s},e.currentSrc?t.triggerSourceset(e.currentSrc):aT(t)||CR(t),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",n),e.resetSourceWatch_&&e.resetSourceWatch_()}};class sn extends $n{constructor(e,n){super(e,n);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const s=this.el_.childNodes;let o=s.length;const u=[];for(;o--;){const d=s[o];d.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(d),this.remoteTextTracks().addTrack(d.track),this.textTracks().addTrack(d.track),!r&&!this.el_.hasAttribute("crossorigin")&&Gv(d.src)&&(r=!0)):u.push(d))}for(let d=0;d{n=[];for(let s=0;se.removeEventListener("change",i));const r=()=>{for(let s=0;s{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,n){if(n!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!n,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const n=$a[e],i=this.el()[n.getterName],r=this[n.getterName]();if(!this[`featuresNative${n.capitalName}Tracks`]||!i||!i.addEventListener)return;const s={change:u=>{const d={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(d),e==="text"&&this[Ap.remoteText.getterName]().trigger(d)},addtrack(u){r.addTrack(u.track)},removetrack(u){r.removeTrack(u.track)}},o=function(){const u=[];for(let d=0;d{const d=s[u];i.addEventListener(u,d),this.on("dispose",h=>i.removeEventListener(u,d))}),this.on("loadstart",o),this.on("dispose",u=>this.off("loadstart",o))}proxyNativeTracks_(){$a.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),sn.disposeMediaElement(e),e=i}else{e=Vt.createElement("video");const i=this.options_.tag&&pd(this.options_.tag),r=sr({},i);(!Hm||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,nO(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&_p(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const n=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&n.push("loadeddata"),e.readyState>=3&&n.push("canplay"),e.readyState>=4&&n.push("canplaythrough"),this.ready(function(){n.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Mv?this.el_.fastSeek(e):this.el_.currentTime=e}catch(n){fi(n,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Il&&vu&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},n=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",()=>{this.off("webkitbeginfullscreen",n),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)wu(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{e.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,n){if(!e)return fi.error("Invalid source URL."),!1;const i={src:e};n&&(i.type=n);const r=kn("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return fi.error("Source URL is required to remove the source element."),!1;const n=this.el_.querySelectorAll("source");for(const i of n)if(i.src===e)return this.el_.removeChild(i),!0;return fi.warn(`No matching source element found with src: ${e}`),!1}reset(){sn.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,i):super.addTextTrack(e,n,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const n=Vt.createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e.default&&(n.default=e.default),e.id&&(n.id=e.id),e.src&&(n.src=e.src),n}addRemoteTextTrack(e,n){const i=super.addRemoteTextTrack(e,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const n=this.$$("track");let i=n.length;for(;i--;)(e===n[i]||e===n[i].track)&&this.el().removeChild(n[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),Oe.performance&&(e.creationTime=Oe.performance.now()),e}}Cv(sn,"TEST_VID",function(){if(!bp())return;const t=Vt.createElement("video"),e=Vt.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",t.appendChild(e),t}),sn.isSupported=function(){try{sn.TEST_VID.volume=.5}catch{return!1}return!!(sn.TEST_VID&&sn.TEST_VID.canPlayType)},sn.canPlayType=function(t){return sn.TEST_VID.canPlayType(t)},sn.canPlaySource=function(t,e){return sn.canPlayType(t.type)},sn.canControlVolume=function(){try{const t=sn.TEST_VID.volume;sn.TEST_VID.volume=t/2+.1;const e=t!==sn.TEST_VID.volume;return e&&go?(Oe.setTimeout(()=>{sn&&sn.prototype&&(sn.prototype.featuresVolumeControl=t!==sn.TEST_VID.volume)}),!1):e}catch{return!1}},sn.canMuteVolume=function(){try{const t=sn.TEST_VID.muted;return sn.TEST_VID.muted=!t,sn.TEST_VID.muted?_p(sn.TEST_VID,"muted","muted"):Fv(sn.TEST_VID,"muted","muted"),t!==sn.TEST_VID.muted}catch{return!1}},sn.canControlPlaybackRate=function(){if(Il&&vu&&Av<58)return!1;try{const t=sn.TEST_VID.playbackRate;return sn.TEST_VID.playbackRate=t/2+.1,t!==sn.TEST_VID.playbackRate}catch{return!1}},sn.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(Vt.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(Vt.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(Vt.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(Vt.createElement("audio"),"innerHTML",{get:t,set:t})}catch{return!1}return!0},sn.supportsNativeTextTracks=function(){return Mv||go&&vu},sn.supportsNativeVideoTracks=function(){return!!(sn.TEST_VID&&sn.TEST_VID.videoTracks)},sn.supportsNativeAudioTracks=function(){return!!(sn.TEST_VID&&sn.TEST_VID.audioTracks)},sn.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([t,e]){Cv(sn.prototype,t,()=>sn[e](),!0)}),sn.prototype.featuresVolumeControl=sn.canControlVolume(),sn.prototype.movingMediaElementInDOM=!go,sn.prototype.featuresFullscreenResize=!0,sn.prototype.featuresProgressEvents=!0,sn.prototype.featuresTimeupdateEvents=!0,sn.prototype.featuresVideoFrameCallback=!!(sn.TEST_VID&&sn.TEST_VID.requestVideoFrameCallback),sn.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},sn.resetMediaElement=function(t){if(!t)return;const e=t.querySelectorAll("source");let n=e.length;for(;n--;)t.removeChild(e[n]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){sn.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){sn.prototype["set"+Yr(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(t){sn.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){sn.prototype["set"+Yr(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(t){sn.prototype[t]=function(){return this.el_[t]()}}),$n.withSourceHandlers(sn),sn.nativeSourceHandler={},sn.nativeSourceHandler.canPlayType=function(t){try{return sn.TEST_VID.canPlayType(t)}catch{return""}},sn.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return sn.nativeSourceHandler.canPlayType(t.type);if(t.src){const n=US(t.src);return sn.nativeSourceHandler.canPlayType(`video/${n}`)}return""},sn.nativeSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},sn.nativeSourceHandler.dispose=function(){},sn.registerSourceHandler(sn.nativeSourceHandler),$n.registerTech("Html5",sn);const AR=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],lT={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},uT=["tiny","xsmall","small","medium","large","xlarge","huge"],$v={};uT.forEach(t=>{const e=t.charAt(0)==="x"?`x-${t.substring(1)}`:t;$v[t]=`vjs-layout-${e}`});const SZ={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Sr extends bt{constructor(e,n,i){if(e.id=e.id||n.id||`vjs_video_${Qa()}`,n=Object.assign(Sr.getTagSettings(e),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language){const o=e.closest("[lang]");o&&(n.language=o.getAttribute("lang"))}if(super(null,n,i),this.boundDocumentFullscreenChange_=o=>this.documentFullscreenChange_(o),this.boundFullWindowOnEscKey_=o=>this.fullWindowOnEscKey(o),this.boundUpdateStyleEl_=o=>this.updateStyleEl_(o),this.boundApplyInitTime_=o=>this.applyInitTime_(o),this.boundUpdateCurrentBreakpoint_=o=>this.updateCurrentBreakpoint_(o),this.boundHandleTechClick_=o=>this.handleTechClick_(o),this.boundHandleTechDoubleClick_=o=>this.handleTechDoubleClick_(o),this.boundHandleTechTouchStart_=o=>this.handleTechTouchStart_(o),this.boundHandleTechTouchMove_=o=>this.handleTechTouchMove_(o),this.boundHandleTechTouchEnd_=o=>this.handleTechTouchEnd_(o),this.boundHandleTechTap_=o=>this.handleTechTap_(o),this.boundUpdatePlayerHeightOnAudioOnlyMode_=o=>this.updatePlayerHeightOnAudioOnlyMode_(o),this.isFullscreen_=!1,this.log=VI(this.id_),this.fsApi_=Ev,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&pd(e),this.language(this.options_.language),n.languages){const o={};Object.getOwnPropertyNames(n.languages).forEach(function(u){o[u.toLowerCase()]=n.languages[u]}),this.languages_=o}else this.languages_=Sr.prototype.options_.languages;this.resetCache_(),this.poster_=n.poster||"",this.controls_=!!n.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(o=>{if(typeof this[o]!="function")throw new Error(`plugin "${o}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),DS(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Ea(Vt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=sr(this.options_);if(n.plugins&&Object.keys(n.plugins).forEach(o=>{this[o](n.plugins[o])}),n.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(n.playbackRates),n.experimentalSvgIcons){const o=new Oe.DOMParser().parseFromString(qX,"image/svg+xml");if(o.querySelector("parsererror"))fi.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),n.spatialNavigation&&n.spatialNavigation.enabled&&(this.spatialNavigation=new GX(this),this.addClass("vjs-spatial-navigation-enabled")),Hm&&this.addClass("vjs-touch-enabled"),go||this.addClass("vjs-workinghover"),Sr.players[this.id_]=this;const s=yS.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",o=>this.listenForUserActivity_(o)),this.on("keydown",o=>this.handleKeyDown(o)),this.on("languagechange",o=>this.handleLanguagechange(o)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),yo(Vt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),yo(Vt,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Sr.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),zX(this),qo.names.forEach(e=>{const n=qo[e],i=this[n.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,n,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?n=this.el_=e.parentNode:r||(n=this.el_=super.createEl("div"));const s=pd(e);if(r){for(n=this.el_=e,e=this.tag=Vt.createElement("video");n.children.length;)e.appendChild(n.firstChild);zm(n,"video-js")||oh(n,"video-js"),n.appendChild(e),i=this.playerElIngest_=n,Object.keys(n).forEach(d=>{try{e[d]=n[d]}catch{}})}e.setAttribute("tabindex","-1"),s.tabindex="-1",vu&&Pv&&(e.setAttribute("role","application"),s.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(d){r&&d==="class"||n.setAttribute(d,s[d]),r&&e.setAttribute(d,s[d])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=n.player=this,this.addClass("vjs-paused");const o=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(d=>QI[d]).map(d=>"vjs-device-"+d.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...o),Oe.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=pO("vjs-styles-dimensions");const d=fd(".vjs-styles-defaults"),h=fd("head");h.insertBefore(this.styleEl_,d?d.nextSibling:h.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const u=e.getElementsByTagName("a");for(let d=0;d"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){fi.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,n){const i=e+"_";if(n===void 0)return this[i]||0;if(n===""||n==="auto"){this[i]=void 0,this.updateStyleEl_();return}const r=parseFloat(n);if(isNaN(r)){fi.error(`Improper value "${n}" supplied for for ${e}`);return}this[i]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,fc(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),bX(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(Oe.VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,d=typeof this.height_=="number"?this.height_:this.options_.height,h=this.tech_&&this.tech_.el();h&&(u>=0&&(h.width=u),d>=0&&(h.height=d));return}let e,n,i,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const s=i.split(":"),o=s[1]/s[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/o:e=this.videoWidth()||300,this.height_!==void 0?n=this.height_:n=e*o,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),fO(this.styleEl_,` .${r} { width: ${e}px; height: ${n}px; } .${r}.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: ${o*100}%; } `)}loadTech_(e,n){this.tech_&&this.unloadTech_();const i=Yr(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&($n.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let s=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(s=!1);const o={source:n,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};qo.names.forEach(d=>{const h=qo[d];o[h.getterName]=this[h.privateName]}),Object.assign(o,this.options_[i]),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);const u=$n.getTech(e);if(!u)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new u(o),this.tech_.ready(hr(this,this.handleTechReady_),!0),CO.jsonToTextTracks(this.textTracksJson_||[],this.tech_),AR.forEach(d=>{this.on(this.tech_,d,h=>this[`handleTech${Yr(d)}_`](h))}),Object.keys(lT).forEach(d=>{this.on(this.tech_,d,h=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${lT[d]}_`].bind(this),event:h});return}this[`handleTech${lT[d]}_`](h)})}),this.on(this.tech_,"loadstart",d=>this.handleTechLoadStart_(d)),this.on(this.tech_,"sourceset",d=>this.handleTechSourceset_(d)),this.on(this.tech_,"waiting",d=>this.handleTechWaiting_(d)),this.on(this.tech_,"ended",d=>this.handleTechEnded_(d)),this.on(this.tech_,"seeking",d=>this.handleTechSeeking_(d)),this.on(this.tech_,"play",d=>this.handleTechPlay_(d)),this.on(this.tech_,"pause",d=>this.handleTechPause_(d)),this.on(this.tech_,"durationchange",d=>this.handleTechDurationChange_(d)),this.on(this.tech_,"fullscreenchange",(d,h)=>this.handleTechFullscreenChange_(d,h)),this.on(this.tech_,"fullscreenerror",(d,h)=>this.handleTechFullscreenError_(d,h)),this.on(this.tech_,"enterpictureinpicture",d=>this.handleTechEnterPictureInPicture_(d)),this.on(this.tech_,"leavepictureinpicture",d=>this.handleTechLeavePictureInPicture_(d)),this.on(this.tech_,"error",d=>this.handleTechError_(d)),this.on(this.tech_,"posterchange",d=>this.handleTechPosterChange_(d)),this.on(this.tech_,"textdata",d=>this.handleTechTextData_(d)),this.on(this.tech_,"ratechange",d=>this.handleTechRateChange_(d)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&_S(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){qo.names.forEach(e=>{const n=qo[e];this[n.privateName]=this[n.getterName]()}),this.textTracksJson_=CO.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&fi.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_}version(){return{"video.js":yS}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const n=()=>{const r=this.muted();this.muted(!0);const s=()=>{this.muted(r)};this.playTerminatedQueue_.push(s);const o=this.play();if(Gm(o))return o.catch(u=>{throw s(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),Gm(i)&&(i=i.catch(n))):e==="muted"&&!this.muted()?i=n():i=this.play(),!!Gm(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let n=e,i="";typeof n!="string"&&(n=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!i&&(i=WX(this,n)),this.cache_.source=sr({},e,{src:n,type:i});const r=this.cache_.sources.filter(d=>d.src&&d.src===n),s=[],o=this.$$("source"),u=[];for(let d=0;dthis.updateSourceCaches_(s);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(n=()=>{}),n(r),e.src||this.tech_.any(["sourceset","loadstart"],s=>{if(s.type==="sourceset")return;const o=this.techGet_("currentSrc");this.lastSource_.tech=o,this.updateSourceCaches_(o)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),n=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",n))};this.on("timeupdate",n)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?wu(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),n=>n.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!Vt.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const n=e.target.player;if(n&&n!==this)return;const i=this.el();let r=Vt[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,n){n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))}handleTechFullscreenError_(e,n){this.trigger("fullscreenerror",n)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,n){this.ready(function(){if(e in UX)return FX(this.middleware_,this.tech_,e,n);if(e in MO)return LO(this.middleware_,this.tech_,e,n);try{this.tech_&&this.tech_[e](n)}catch(i){throw fi(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in BX)return NX(this.middleware_,this.tech_,e);if(e in MO)return LO(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){throw this.tech_[e]===void 0?(fi(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,n),n):n.name==="TypeError"?(fi(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,n),this.tech_.isReady_=!1,n):(fi(n),n)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=wu){this.playCallbacks_.push(e);const n=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Mv||go);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n){this.waitToPlay_=s=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!n&&i&&this.load();return}const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(n){n()})}runPlayCallbacks_(e){const n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ol(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Ol(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Ol(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return xO(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),n=this.duration();let i=e.end(e.length-1);return i>n&&(i=n),i}volume(e){let n;if(e!==void 0){n=Math.max(0,Math.min(1,e)),this.cache_.volume=n,this.techCall_("setVolume",n),n>0&&this.lastVolume_(n);return}return n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const n=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const n=this;return new Promise((i,r)=>{function s(){n.off("fullscreenerror",u),n.off("fullscreenchange",o)}function o(){s(),i()}function u(h,g){s(),r(g)}n.one("fullscreenchange",o),n.one("fullscreenerror",u);const d=n.requestFullscreenHelper_(e);d&&(d.then(s,s),d.then(i,r))})}requestFullscreenHelper_(e){let n;if(this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(n=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](n);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((n,i)=>{function r(){e.off("fullscreenerror",o),e.off("fullscreenchange",s)}function s(){r(),n()}function o(d,h){r(),i(h)}e.one("fullscreenchange",s),e.one("fullscreenerror",o);const u=e.exitFullscreenHelper_();u&&(u.then(r,r),u.then(n,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Vt[this.fsApi_.exitFullscreen]();return e&&wu(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=Vt.documentElement.style.overflow,Ea(Vt,"keydown",this.boundFullWindowOnEscKey_),Vt.documentElement.style.overflow="hidden",oh(Vt.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,yo(Vt,"keydown",this.boundFullWindowOnEscKey_),Vt.documentElement.style.overflow=this.docOrigOverflow,Nv(Vt.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Oe.documentPictureInPicture){const e=Vt.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(kn("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),Oe.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(n=>(cO(n),this.el_.parentNode.insertBefore(e,this.el_),n.document.body.appendChild(this.el_),n.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:n}),n.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),n))}return"pictureInPictureEnabled"in Vt&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(Oe.documentPictureInPicture&&Oe.documentPictureInPicture.window)return Oe.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in Vt)return Vt.exitPictureInPicture()}handleKeyDown(e){const{userActions:n}=this.options_;!n||!n.hotkeys||(i=>{const r=i.tagName.toLowerCase();return i.isContentEditable?!0:r==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const n=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=o=>e.key.toLowerCase()==="f",muteKey:r=o=>e.key.toLowerCase()==="m",playPauseKey:s=o=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=n;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const o=bt.getComponent("FullscreenToggle");Vt[this.fsApi_.fullscreenEnabled]!==!1&&o.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),bt.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),bt.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let n;for(let i=0,r=this.options_.techOrder;i[u,$n.getTech(u)]).filter(([u,d])=>d?d.isSupported():(fi.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(u,d,h){let g;return u.some(y=>d.some(w=>{if(g=h(y,w),g)return!0})),g};let r;const s=u=>(d,h)=>u(h,d),o=([u,d],h)=>{if(d.canPlaySource(h,this.options_[u.toLowerCase()]))return{source:h,tech:u}};return this.options_.sourceOrder?r=i(e,n,s(o)):r=i(n,e,o),r||!1}handleSrc_(e,n){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=NO(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,n||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),LX(this,i[0],(r,s)=>{if(this.middleware_=s,n||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}MX(s,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},s=()=>{this.off("error",r)};this.one("error",r),this.one("playing",s),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",s)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const n=this.selectSource([e]);return n?wO(n.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(n.tech,n.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,n){return this.tech_?this.tech_.addSourceElement(e,n):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();wu(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),fc(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:n,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=i||{};e&&e.updateContent(),n&&n.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),n=[];return Object.keys(e).length!==0&&n.push(e),this.cache_.sources||n}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let n;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),n=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,n=typeof n>"u"?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(cd("beforeerror").forEach(n=>{const i=n(this,e);if(!(yu(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const n=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],n),this.one("loadstart",function(){this.off(["click","touchstart"],n)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Fr(e),this.addClass("vjs-error"),fi.error(`(CODE:${this.error_.code} ${Fr.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),cd("error").forEach(n=>n(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,n,i;const r=hr(this,this.reportUserActivity),s=function(y){(y.screenX!==n||y.screenY!==i)&&(n=y.screenX,i=y.screenY,r())},o=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},u=function(y){r(),this.clearInterval(e)};this.on("mousedown",o),this.on("mousemove",s),this.on("mouseup",u),this.on("mouseleave",u);const d=this.getChild("controlBar");d&&!go&&!Il&&(d.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),d.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let h;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(h);const y=this.options_.inactivityTimeout;y<=0||(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),n=this.getChild("ControlBar"),i=n&&n.currentHeight();e.forEach(r=>{r!==n&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),Promise.all(n).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,n,i){if(this.tech_)return this.tech_.addTextTrack(e,n,i)}addRemoteTextTrack(e,n){if(this.tech_)return this.tech_.addRemoteTextTrack(e,n)}removeRemoteTextTrack(e={}){let{track:n}=e;if(n||(n=e),this.tech_)return this.tech_.removeRemoteTextTrack(n)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),fc(this)&&this.trigger("languagechange"))}languages(){return sr(Sr.prototype.options_.languages,this.languages_)}toJSON(){const e=sr(this.options_),n=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),n=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:o||r||""}),this.ready(n)}getMedia(){if(!this.cache_.media){const e=this.poster(),n=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),s=>({kind:s.kind,label:s.label,language:s.language,src:s.src})),r={src:n,textTracks:i};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Xv(r.poster)}]),r}return sr(this.cache_.media)}static getTagSettings(e){const n={sources:[],tracks:[]},i=pd(e),r=i["data-setup"];if(zm(e,"vjs-fill")&&(i.fill=!0),zm(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(s){fi.error("data-setup",s)}if(Object.assign(n,i),e.hasChildNodes()){const s=e.childNodes;for(let o=0,u=s.length;otypeof n=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}qo.names.forEach(function(t){const e=qo[t];Sr.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Sr.prototype.crossorigin=Sr.prototype.crossOrigin,Sr.players={};const Qm=Oe.navigator;Sr.prototype.options_={techOrder:$n.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Qm&&(Qm.languages&&Qm.languages[0]||Qm.userLanguage||Qm.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1},AR.forEach(function(t){Sr.prototype[`handleTech${Yr(t)}_`]=function(){return this.trigger(t)}}),bt.registerComponent("Player",Sr);const eb="plugin",Ip="activePlugins_",Op={},tb=t=>Op.hasOwnProperty(t),nb=t=>tb(t)?Op[t]:void 0,kR=(t,e)=>{t[Ip]=t[Ip]||{},t[Ip][e]=!0},ib=(t,e,n)=>{const i=(n?"before":"")+"pluginsetup";t.trigger(i,e),t.trigger(i+":"+e.name,e)},TZ=function(t,e){const n=function(){ib(this,{name:t,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return kR(this,t),ib(this,{name:t,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){n[i]=e[i]}),n},PR=(t,e)=>(e.prototype.name=t,function(...n){ib(this,{name:t,plugin:e,instance:null},!0);const i=new e(this,...n);return this[t]=()=>i,ib(this,i.getEventHash()),i});class aa{constructor(e){if(this.constructor===aa)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),DS(this),delete this.trigger,bO(this,this.constructor.defaultState),kR(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,n={}){return Ep(this.eventBusEl_,e,this.getEventHash(n))}handleStateChanged(e){}dispose(){const{name:e,player:n}=this;this.trigger("dispose"),this.off(),n.off("dispose",this.dispose),n[Ip][e]=!1,this.player=this.state=null,n[e]=PR(e,Op[e])}static isBasic(e){const n=typeof e=="string"?nb(e):e;return typeof n=="function"&&!aa.prototype.isPrototypeOf(n.prototype)}static registerPlugin(e,n){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(tb(e))fi.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Sr.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof n!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof n}.`);return Op[e]=n,e!==eb&&(aa.isBasic(n)?Sr.prototype[e]=TZ(e,n):Sr.prototype[e]=PR(e,n)),n}static deregisterPlugin(e){if(e===eb)throw new Error("Cannot de-register base plugin.");tb(e)&&(delete Op[e],delete Sr.prototype[e])}static getPlugins(e=Object.keys(Op)){let n;return e.forEach(i=>{const r=nb(i);r&&(n=n||{},n[i]=r)}),n}static getPluginVersion(e){const n=nb(e);return n&&n.VERSION||""}}aa.getPlugin=nb,aa.BASE_PLUGIN_NAME=eb,aa.registerPlugin(eb,aa),Sr.prototype.usingPlugin=function(t){return!!this[Ip]&&this[Ip][t]===!0},Sr.prototype.hasPlugin=function(t){return!!tb(t)};function EZ(t,e){let n=!1;return function(...i){return n||fi.warn(t),n=!0,e.apply(this,i)}}function Rl(t,e,n,i){return EZ(`${e} is deprecated and will be removed in ${t}.0; please use ${n} instead.`,i)}var xZ={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const DR=t=>t.indexOf("#")===0?t.slice(1):t;function st(t,e,n){let i=st.getPlayer(t);if(i)return e&&fi.warn(`Player "${t}" is already initialised. Options will not be applied.`),n&&i.ready(n),i;const r=typeof t=="string"?fd("#"+DR(t)):t;if(!wp(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const s="getRootNode"in r&&r.getRootNode()instanceof Oe.ShadowRoot?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!s.contains(r))&&fi.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),cd("beforesetup").forEach(u=>{const d=u(r,sr(e));if(!yu(d)||Array.isArray(d)){fi.error("please return an object in beforesetup hooks");return}e=sr(e,d)});const o=bt.getComponent("Player");return i=new o(r,e,n),cd("setup").forEach(u=>u(i)),i}if(st.hooks_=pc,st.hooks=cd,st.hook=oX,st.hookOnce=aX,st.removeHook=zI,Oe.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&bp()){let t=fd(".vjs-styles-defaults");if(!t){t=pO("vjs-styles-defaults");const e=fd("head");e&&e.insertBefore(t,e.firstChild),fO(t,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}ES(1,st),st.VERSION=yS,st.options=Sr.prototype.options_,st.getPlayers=()=>Sr.players,st.getPlayer=t=>{const e=Sr.players;let n;if(typeof t=="string"){const i=DR(t),r=e[i];if(r)return r;n=fd("#"+i)}else n=t;if(wp(n)){const{player:i,playerId:r}=n;if(i||e[r])return i||e[r]}},st.getAllPlayers=()=>Object.keys(Sr.players).map(t=>Sr.players[t]).filter(Boolean),st.players=Sr.players,st.getComponent=bt.getComponent,st.registerComponent=(t,e)=>($n.isTech(e)&&fi.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),bt.registerComponent.call(bt,t,e)),st.getTech=$n.getTech,st.registerTech=$n.registerTech,st.use=RX,Object.defineProperty(st,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(st.middleware,"TERMINATOR",{value:Yv,writeable:!1,enumerable:!0}),st.browser=QI,st.obj=cX,st.mergeOptions=Rl(9,"videojs.mergeOptions","videojs.obj.merge",sr),st.defineLazyProperty=Rl(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Cv),st.bind=Rl(9,"videojs.bind","native Function.prototype.bind",hr),st.registerPlugin=aa.registerPlugin,st.deregisterPlugin=aa.deregisterPlugin,st.plugin=(t,e)=>(fi.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),aa.registerPlugin(t,e)),st.getPlugins=aa.getPlugins,st.getPlugin=aa.getPlugin,st.getPluginVersion=aa.getPluginVersion,st.addLanguage=function(t,e){return t=(""+t).toLowerCase(),st.options.languages=sr(st.options.languages,{[t]:e}),st.options.languages[t]},st.log=fi,st.createLogger=VI,st.time=EX,st.createTimeRange=Rl(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ol),st.createTimeRanges=Rl(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ol),st.formatTime=Rl(9,"videojs.formatTime","videojs.time.formatTime",lh),st.setFormatTime=Rl(9,"videojs.setFormatTime","videojs.time.setFormatTime",TO),st.resetFormatTime=Rl(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",EO),st.parseUrl=Rl(9,"videojs.parseUrl","videojs.url.parseUrl",BS),st.isCrossOrigin=Rl(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Gv),st.EventTarget=xa,st.any=AS,st.on=Ea,st.one=jv,st.off=yo,st.trigger=Ep,st.xhr=mD,st.TextTrack=Km,st.AudioTrack=OO,st.VideoTrack=RO,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(t=>{st[t]=function(){return fi.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`),dO[t].apply(null,arguments)}}),st.computedStyle=Rl(9,"videojs.computedStyle","videojs.dom.computedStyle",Tp),st.dom=dO,st.fn=vX,st.num=eZ,st.str=SX,st.url=IX,st.Error=xZ;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class CZ{constructor(e){let n=this;return n.id=e.id,n.label=n.id,n.width=e.width,n.height=e.height,n.bitrate=e.bandwidth,n.frameRate=e.frameRate,n.enabled_=e.enabled,Object.defineProperty(n,"enabled",{get(){return n.enabled_()},set(i){n.enabled_(i)}}),n}}class rb extends st.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let n=this.getQualityLevelById(e.id);if(n)return n;const i=this.levels_.length;return n=new CZ(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(n),this.trigger({qualityLevel:n,type:"addqualitylevel"}),n}removeQualityLevel(e){let n=null;for(let i=0,r=this.length;ii&&this.selectedIndex_--;break}return n&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),n}getQualityLevelById(e){for(let n=0,i=this.length;ni,t.qualityLevels.VERSION=IR,i},OR=function(t){return AZ(this,st.obj.merge({},t))};st.registerPlugin("qualityLevels",OR),OR.VERSION=IR;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const la=cv,sb=(t,e)=>e&&e.responseURL&&t!==e.responseURL?e.responseURL:t,tl=t=>st.log.debug?st.log.debug.bind(st,"VHS:",`${t} >`):function(){};function Ki(...t){const e=st.obj||st;return(e.merge||e.mergeOptions).apply(e,t)}function bo(...t){const e=st.time||st;return(e.createTimeRanges||e.createTimeRanges).apply(e,t)}function kZ(t){if(t.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: `;for(let n=0;n ${r}. Duration (${r-i}) `}return e}const Su=1/30,Tu=Su*3,RR=function(t,e){const n=[];let i;if(t&&t.length)for(i=0;i=e})},ob=function(t,e){return RR(t,function(n){return n-Su>=e})},PZ=function(t){if(t.length<2)return bo();const e=[];for(let n=1;n{const e=[];if(!t||!t.length)return"";for(let n=0;n "+t.end(n));return e.join(", ")},IZ=function(t,e,n=1){return((t.length?t.end(t.length-1):0)-e)/n},hh=t=>{const e=[];for(let n=0;ns)){if(e>r&&e<=s){n+=s-e;continue}n+=s-r}}return n},hT=(t,e)=>{if(!e.preload)return e.duration;let n=0;return(e.parts||[]).forEach(function(i){n+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(n+=t.partTargetDuration)}),n},pT=t=>(t.segments||[]).reduce((e,n,i)=>(n.parts?n.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:i,partIndex:s,part:r,segment:n})}):e.push({duration:n.duration,segmentIndex:i,partIndex:null,segment:n,part:null}),e),[]),MR=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]},NR=({preloadSegment:t})=>{if(!t)return;const{parts:e,preloadHints:n}=t;let i=(n||[]).reduce((r,s)=>r+(s.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},FR=(t,e)=>{if(e.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;const n=MR(e).length>0;return n&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:n&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},RZ=function(t,e){let n=0,i=e-t.mediaSequence,r=t.segments[i];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=t.segments[i],typeof r.end<"u")return{result:n+r.end,precise:!0};if(n+=hT(t,r),typeof r.start<"u")return{result:n+r.start,precise:!0}}return{result:n,precise:!1}},LZ=function(t,e){let n=0,i,r=e-t.mediaSequence;for(;r"u"&&(e=t.mediaSequence+t.segments.length),e"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return Oe.Infinity}return BR(t,e,n)},Jm=function({defaultDuration:t,durationList:e,startIndex:n,endIndex:i}){let r=0;if(n>i&&([n,i]=[i,n]),n<0){for(let s=n;s0)for(let h=d-1;h>=0;h--){const g=u[h];if(o+=g.duration,s){if(o<0)continue}else if(o+Su<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-Jm({defaultDuration:t.targetDuration,durationList:u,startIndex:d,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(d<0){for(let h=d;h<0;h++)if(o-=t.targetDuration,o<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};d=0}for(let h=d;hSu,w=o===0,C=y&&o+Su>=0;if(!((w||C)&&h!==u.length-1)){if(s){if(o>0)continue}else if(o-Su>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+Jm({defaultDuration:t.targetDuration,durationList:u,startIndex:d,endIndex:h})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},zR=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},fT=function(t){return t.excludeUntil&&t.excludeUntil===1/0},ab=function(t){const e=zR(t);return!t.disabled&&!e},FZ=function(t){return t.disabled},BZ=function(t){for(let e=0;e{if(t.playlists.length===1)return!0;const n=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(i=>ab(i)?(i.attributes.BANDWIDTH||0)!t&&!e||!t&&e||t&&!e?!1:!!(t===e||t.id&&e.id&&t.id===e.id||t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri||t.uri&&e.uri&&t.uri===e.uri),VR=function(t,e){const n=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let i=!1;for(const r in n){for(const s in n[r])if(i=e(n[r][s]),i)break;if(i)break}return!!i},$m=t=>{if(!t||!t.playlists||!t.playlists.length)return VR(t,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;ePD(r))||VR(t,r=>gT(n,r))))return!1}return!0};var ua={liveEdgeDelay:FR,duration:UR,seekable:MZ,getMediaInfoForTime:NZ,isEnabled:ab,isDisabled:FZ,isExcluded:zR,isIncompatible:fT,playlistEnd:HR,isAes:BZ,hasAttribute:jR,estimateSegmentRequestTime:UZ,isLowestEnabledRendition:mT,isAudioOnly:$m,playlistMatch:gT,segmentDurationWithParts:hT};const{log:WR}=st,Lp=(t,e)=>`${t}-${e}`,qR=(t,e,n)=>`placeholder-uri-${t}-${e}-${n}`,HZ=({onwarn:t,oninfo:e,manifestString:n,customTagParsers:i=[],customTagMappers:r=[],llhls:s})=>{const o=new rK;t&&o.on("warn",t),e&&o.on("info",e),i.forEach(h=>o.addParser(h)),r.forEach(h=>o.addTagMapper(h)),o.push(n),o.end();const u=o.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(h){u.hasOwnProperty(h)&&delete u[h]}),u.segments&&u.segments.forEach(function(h){["parts","preloadHints"].forEach(function(g){h.hasOwnProperty(g)&&delete h[g]})})),!u.targetDuration){let h=10;u.segments&&u.segments.length&&(h=u.segments.reduce((g,y)=>Math.max(g,y.duration),0)),t&&t({message:`manifest has no targetDuration defaulting to ${h}`}),u.targetDuration=h}const d=MR(u);if(d.length&&!u.partTargetDuration){const h=d.reduce((g,y)=>Math.max(g,y.duration),0);t&&(t({message:`manifest has no partTargetDuration defaulting to ${h}`}),WR.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),u.partTargetDuration=h}return u},Mp=(t,e)=>{t.mediaGroups&&["AUDIO","SUBTITLES"].forEach(n=>{if(t.mediaGroups[n])for(const i in t.mediaGroups[n])for(const r in t.mediaGroups[n][i]){const s=t.mediaGroups[n][i][r];e(s,n,i,r)}})},GR=({playlist:t,uri:e,id:n})=>{t.id=n,t.playlistErrors_=0,e&&(t.uri=e),t.attributes=t.attributes||{}},zZ=t=>{let e=t.playlists.length;for(;e--;){const n=t.playlists[e];GR({playlist:n,id:Lp(e,n.uri)}),n.resolvedUri=la(t.uri,n.uri),t.playlists[n.id]=n,t.playlists[n.uri]=n,n.attributes.BANDWIDTH||WR.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},jZ=t=>{Mp(t,e=>{e.uri&&(e.resolvedUri=la(t.uri,e.uri))})},VZ=(t,e)=>{const n=Lp(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Oe.location.href,resolvedUri:Oe.location.href,playlists:[{uri:e,id:n,resolvedUri:e,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[e]=i.playlists[0],i},KR=(t,e,n=qR)=>{t.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(i&&s==="AUDIO"&&!r.uri)for(let d=0;d(r.set(s.id,s),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},n=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),n.push(i),!!i.class))if(e[i.class]){const s=e[i.class].push(i);i.classListIndex=s-1}else e[i.class]=[i],i.classListIndex=0});for(const i of n){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return n}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((n,i)=>{n.startDate.getTime(){const r=e.status<200||e.status>299,s=e.status>=400&&e.status<=499,o={uri:e.uri,requestType:t},u=r&&!s||i;if(n&&s)o.error=Kr({},n),o.errorType=st.Error.NetworkRequestFailed;else if(e.aborted)o.errorType=st.Error.NetworkRequestAborted;else if(e.timedout)o.erroType=st.Error.NetworkRequestTimeout;else if(u){const d=i?st.Error.NetworkBodyParserFailed:st.Error.NetworkBadStatus;o.errorType=d,o.status=e.status,o.headers=e.headers}return o},WZ=tl("CodecUtils"),ZR=function(t){const e=t.attributes||{};if(e.CODECS)return fu(e.CODECS)},QR=(t,e)=>{const n=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&n.AUDIO&&t.mediaGroups.AUDIO[n.AUDIO]},qZ=(t,e)=>{if(!QR(t,e))return!0;const n=e.attributes||{},i=t.mediaGroups.AUDIO[n.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},eg=function(t){const e={};return t.forEach(({mediaType:n,type:i,details:r})=>{e[n]=e[n]||[],e[n].push(kD(`${i}${r}`))}),Object.keys(e).forEach(function(n){if(e[n].length>1){WZ(`multiple ${n} codecs found as attributes: ${e[n].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[n]=null;return}e[n]=e[n][0]}),e},JR=function(t){let e=0;return t.audio&&e++,t.video&&e++,e},tg=function(t,e){const n=e.attributes||{},i=eg(ZR(e)||[]);if(QR(t,e)&&!i.audio&&!qZ(t,e)){const r=eg(oK(t,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},{EventTarget:GZ}=st,KZ=(t,e)=>{if(e.endList||!e.serverControl)return t;const n={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const s=i.parts||[],o=NR(e)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&r--}n._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(n._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){const i=new Oe.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){n.hasOwnProperty(r)&&i.searchParams.set(r,n[r])}),t=i.toString()}return t},YZ=(t,e)=>{if(!t)return e;const n=Ki(t,e);if(t.preloadHints&&!e.preloadHints&&delete n.preloadHints,t.parts&&!e.parts)delete n.parts;else if(t.parts&&e.parts)for(let i=0;i{const i=t.slice(),r=e.slice();n=n||0;const s=[];let o;for(let u=0;u{!t.resolvedUri&&t.uri&&(t.resolvedUri=la(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=la(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=la(e,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=la(e,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(n=>{n.resolvedUri||(n.resolvedUri=la(e,n.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(n=>{n.resolvedUri||(n.resolvedUri=la(e,n.uri))})},e2=function(t){const e=t.segments||[],n=t.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(let i=0;it===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment,yT=(t,e,n=t2)=>{const i=Ki(t,{}),r=i.playlists[e.id];if(!r||n(r,e))return null;e.segments=e2(e);const s=Ki(r,e);if(s.preloadSegment&&!e.preloadSegment&&delete s.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let o=0;o{$R(o,s.resolvedUri)});for(let o=0;o{if(o.playlists)for(let g=0;g{const n=t.segments||[],i=n[n.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],s=r&&r.duration||i&&i.duration;return e&&s?s*1e3:(t.partTargetDuration||t.targetDuration||10)*500},n2=(t,e,n)=>{if(!t)return;const i=[];return t.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:s,RESOLUTION:o,CODECS:u}=r.attributes;i.push({id:r.id,bandwidth:s,resolution:o,codecs:u})}),{type:e,isLive:n,renditions:i}};class Np extends GZ{constructor(e,n,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=tl("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=n,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const s=n.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new YR,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const n=this.dateRangesStorage_.getDateRangesToProcess();!n.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(n)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let n=la(this.main.uri,e.uri);this.llhls&&(n=KZ(n,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,n,i){const{uri:r,id:s}=n;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:ph({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:n}){try{const i=HZ({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:n,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:st.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const n=i=>{const r=i.attributes||{},{width:s,height:o}=r.RESOLUTION||{};if(s&&o)return!0;const u=ZR(i)||[];return!!eg(u).video};e.some(n)&&e.forEach(i=>{n(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:n,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const s={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:s});const o=n||this.parseManifest_({url:i,manifestString:e});o.lastRequest=Date.now(),GR({playlist:o,uri:i,id:r});const u=yT(this.main,o);this.targetDuration=o.partTargetDuration||o.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(vT(this.media(),!!u)),s.parsedPlaylist=n2(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Oe.clearTimeout(this.mediaUpdateTimeout),Oe.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new YR,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,n){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(Oe.clearTimeout(this.finalRenditionTimeout),n){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=Oe.setTimeout(this.media.bind(this,e,!1),u);return}const i=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(vT(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const o={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:o}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(u,d)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=sb(e.resolvedUri,d),u)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:o}),this.haveMetadata({playlistString:d.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const n=this.media();if(e){const i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Oe.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=Oe.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=Oe.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(n,i)=>{if(!this.request)return;if(this.request=null,n)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:ph({requestType:i.requestType,request:i,error:n})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=sb(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=n2(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,KR(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=e2(i),i.segments.forEach(r=>{$R(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const n=this.srcUri()||Oe.location.href;this.main=VZ(e,n),this.haveMetadata({playlistObject:e,url:n,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,n){const i=this.main,r=e.ID;let s=i.playlists.length;for(;s--;){const o=i.playlists[s];if(o.attributes["PATHWAY-ID"]===r){const u=o.resolvedUri,d=o.id;if(n){const h=this.createCloneURI_(o.resolvedUri,e),g=Lp(r,h),y=this.createCloneAttributes_(r,o.attributes),w=this.createClonePlaylist_(o,g,e,y);i.playlists[s]=w,i.playlists[g]=w,i.playlists[h]=w}else i.playlists.splice(s,1);delete i.playlists[d],delete i.playlists[u]}}this.updateOrDeleteCloneMedia(e,n)}updateOrDeleteCloneMedia(e,n){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!i.mediaGroups[s]||!i.mediaGroups[s][r])){for(const o in i.mediaGroups[s])if(o===r){for(const u in i.mediaGroups[s][o])i.mediaGroups[s][o][u].playlists.forEach((d,h)=>{const g=i.playlists[d.id],y=g.id,w=g.resolvedUri;delete i.playlists[y],delete i.playlists[w]});delete i.mediaGroups[s][o]}}}),n&&this.createClonedMediaGroups_(e)}addClonePathway(e,n={}){const i=this.main,r=i.playlists.length,s=this.createCloneURI_(n.resolvedUri,e),o=Lp(e.ID,s),u=this.createCloneAttributes_(e.ID,n.attributes),d=this.createClonePlaylist_(n,o,e,u);i.playlists[r]=d,i.playlists[o]=d,i.playlists[s]=d,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const n=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!r.mediaGroups[s]||r.mediaGroups[s][n]))for(const o in r.mediaGroups[s]){if(o===i)r.mediaGroups[s][n]={};else continue;for(const u in r.mediaGroups[s][o]){const d=r.mediaGroups[s][o][u];r.mediaGroups[s][n][u]=Kr({},d);const h=r.mediaGroups[s][n][u],g=this.createCloneURI_(d.resolvedUri,e);h.resolvedUri=g,h.uri=g,h.playlists=[],d.playlists.forEach((y,w)=>{const C=r.playlists[y.id],D=qR(s,n,u),P=Lp(n,D);if(C&&!r.playlists[P]){const M=this.createClonePlaylist_(C,P,e),F=M.resolvedUri;r.playlists[P]=M,r.playlists[F]=M}h.playlists[w]=this.createClonePlaylist_(y,P,e)})}}})}createClonePlaylist_(e,n,i,r){const s=this.createCloneURI_(e.resolvedUri,i),o={resolvedUri:s,uri:s,id:n};return e.segments&&(o.segments=[]),r&&(o.attributes=r),Ki(e,o)}createCloneURI_(e,n){const i=new URL(e);i.hostname=n["URI-REPLACEMENT"].HOST;const r=n["URI-REPLACEMENT"].PARAMS;for(const s of Object.keys(r))i.searchParams.set(s,r[s]);return i.href}createCloneAttributes_(e,n){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{n[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const n=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&n.add(r.toLowerCase())}return n}}}const bT=function(t,e,n,i){const r=t.responseType==="arraybuffer"?t.response:t.responseText;!e&&r&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=r.byteLength||r.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),n.headers&&(t.responseHeaders=n.headers),e&&e.code==="ETIMEDOUT"&&(t.timedout=!0),!e&&!t.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(t&&(r||t.responseText)))),i(e,t)},ZZ=(t,e)=>{if(!t||!t.size)return;let n=e;return t.forEach(i=>{n=i(n)}),n},QZ=(t,e,n,i)=>{!t||!t.size||t.forEach(r=>{r(e,n,i)})},i2=function(){const t=function e(n,i){n=Ki({timeout:45e3},n);const r=e.beforeRequest||st.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||st.Vhs.xhr._requestCallbackSet||new Set,o=e._responseCallbackSet||st.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(st.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));const u=st.Vhs.xhr.original===!0?st.xhr:st.Vhs.xhr,d=ZZ(s,n);s.delete(r);const h=u(d||n,function(y,w){return QZ(o,h,y,w),bT(h,y,w,i)}),g=h.abort;return h.abort=function(){return h.aborted=!0,g.apply(h,arguments)},h.uri=n.uri,h.requestType=n.requestType,h.requestTime=Date.now(),h};return t.original=!0,t},JZ=function(t){let e;const n=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=Oe.BigInt(t.offset)+Oe.BigInt(t.length)-Oe.BigInt(1):e=t.offset+t.length-1,"bytes="+n+"-"+e},wT=function(t){const e={};return t.byterange&&(e.Range=JZ(t.byterange)),e},$Z=function(t,e){return t.start(e)+"-"+t.end(e)},eQ=function(t,e){const n=t.toString(16);return"00".substring(0,2-n.length)+n+(e%2?" ":"")},tQ=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},r2=function(t){const e={};return Object.keys(t).forEach(n=>{const i=t[n];OD(i)?e[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[n]=i}),e},lb=function(t){const e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},s2=function(t){return t.resolvedUri},o2=t=>{const e=Array.prototype.slice.call(t),n=16;let i="",r,s;for(let o=0;oo2(t),textRanges:t=>{let e="",n;for(n=0;n{if(!e.dateTimeObject)return null;const n=e.videoTimingInfo.transmuxerPrependedSeconds,i=e.videoTimingInfo.transmuxedPresentationStart+n,r=t-i;return new Date(e.dateTimeObject.getTime()+r*1e3)},rQ=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds,sQ=(t,e)=>{let n;try{n=new Date(t)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(nu?null:(n>new Date(s)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:ua.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},oQ=(t,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let n=0,i;for(let s=0;sn){if(t>n+r.duration*a2)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},aQ=(t,e)=>{let n,i;try{n=new Date(t),i=new Date(e)}catch{}const r=n.getTime();return(i.getTime()-r)/1e3},lQ=t=>{if(!t.segments||t.segments.length===0)return!1;for(let e=0;e{if(!n)throw new Error("getProgramTime: callback must be provided");if(!t||e===void 0)return n({message:"getProgramTime: playlist and time must be provided"});const i=oQ(e,t);if(!i)return n({message:"valid programTime was not found"});if(i.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},s=iQ(e,i.segment);return s&&(r.programDateTime=s.toISOString()),n(null,r)},l2=({programTime:t,playlist:e,retryCount:n=2,seekTo:i,pauseAfterSeek:r=!0,tech:s,callback:o})=>{if(!o)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!e||!i)return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!s.hasStarted_)return o({message:"player must be playing a live stream to start buffering"});if(!lQ(e))return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=sQ(t,e);if(!u)return o({message:`${t} was not found in the stream`});const d=u.segment,h=aQ(d.dateTimeObject,t);if(u.type==="estimate"){if(n===0)return o({message:`${t} is not buffered yet. Try again`});i(u.estimatedStart+h),s.one("seeked",()=>{l2({programTime:t,playlist:e,retryCount:n-1,seekTo:i,pauseAfterSeek:r,tech:s,callback:o})});return}const g=d.start+h,y=()=>o(null,s.currentTime());s.one("seeked",y),r&&s.pause(),i(g)},_T=(t,e)=>{if(t.readyState===4)return e()},cQ=(t,e,n,i)=>{let r=[],s,o=!1;const u=function(g,y,w,C){return y.abort(),o=!0,n(g,y,w,C)},d=function(g,y){if(o)return;if(g)return g.metadata=ph({requestType:i,request:y,error:g}),u(g,y,"",r);const w=y.responseText.substring(r&&r.byteLength||0,y.responseText.length);if(r=gK(r,RD(w,!0)),s=s||Bm(r),r.length<10||s&&r.lengthu(g,y,"",r));const C=gS(r);return C==="ts"&&r.length<188?_T(y,()=>u(g,y,"",r)):!C&&r.length<376?_T(y,()=>u(g,y,"",r)):u(null,y,C,r)},h=e({uri:t,beforeSend(g){g.overrideMimeType("text/plain; charset=x-user-defined"),g.addEventListener("progress",function({total:y,loaded:w}){return bT(g,null,{statusCode:g.status},d)})}},function(g,y){return bT(h,g,y,d)});return h},{EventTarget:dQ}=st,u2=function(t,e){if(!t2(t,e)||t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length)||!t.sidx&&e.sidx||t.sidx&&!e.sidx||t.segments&&!e.segments||!t.segments&&e.segments)return!1;if(!t.segments&&!e.segments)return!0;for(let n=0;n{const r=i.attributes.NAME||n;return`placeholder-uri-${t}-${e}-${r}`},pQ=({mainXml:t,srcUrl:e,clientOffset:n,sidxMapping:i,previousManifest:r})=>{const s=FY(t,{manifestUri:e,clientOffset:n,sidxMapping:i,previousManifest:r});return KR(s,e,hQ),s},fQ=(t,e)=>{Mp(t,(n,i,r,s)=>{(!e.mediaGroups[i][r]||!(s in e.mediaGroups[i][r]))&&delete t.mediaGroups[i][r][s]})},mQ=(t,e,n)=>{let i=!0,r=Ki(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let s=0;s{if(s.playlists&&s.playlists.length){const h=s.playlists[0].id,g=yT(r,s.playlists[0],u2);g&&(r=g,d in r.mediaGroups[o][u]||(r.mediaGroups[o][u][d]=s),r.mediaGroups[o][u][d].playlists[0]=r.playlists[h],i=!1)}}),fQ(r,e),e.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(i=!1),i?null:r},gQ=(t,e)=>(!t.map&&!e.map||!!(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length))&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length,c2=(t,e)=>{const n={};for(const i in t){const r=t[i].sidx;if(r){const s=wv(r);if(!e[s])break;const o=e[s].sidxInfo;gQ(o,r)&&(n[s]=e[s])}}return n},yQ=(t,e)=>{let n=c2(t.playlists,e);return Mp(t,(i,r,s,o)=>{if(i.playlists&&i.playlists.length){const u=i.playlists;n=Ki(n,c2(u,e))}}),n};class ST extends dQ{constructor(e,n,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:s=!1}=i;if(this.vhs_=n,this.withCredentials=s,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=tl("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,n,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,n,i){const r=e.sidx&&wv(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){Oe.clearTimeout(this.mediaRequest_),this.mediaRequest_=Oe.setTimeout(()=>i(!1),0);return}const s=sb(e.sidx.resolvedUri),o=(d,h)=>{if(this.requestErrored_(d,h,n))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=h;let w;try{w=WY(Sn(h.response).subarray(8))}catch(C){C.metadata=ph({requestType:y,request:h,parseFailure:!0}),this.requestErrored_(C,h,n);return}return g[r]={sidxInfo:e.sidx,sidx:w},cS(e,w,e.sidx.resolvedUri),i(!0)},u="dash-sidx";this.request=cQ(s,this.vhs_.xhr,(d,h,g,y)=>{if(d)return o(d,h);if(!g||g!=="mp4"){const D=g||"unknown";return o({status:h.status,message:`Unsupported ${D} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},h)}const{offset:w,length:C}=e.sidx.byterange;if(y.length>=C+w)return o(d,{response:y.subarray(w,w+C),status:h.status,uri:h.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:wT({byterange:e.sidx.byterange})},o)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Oe.clearTimeout(this.minimumUpdatePeriodTimeout_),Oe.clearTimeout(this.mediaRequest_),Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const n=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,r=>{this.haveMetadata({startingState:n,playlist:e})}))}haveMetadata({startingState:e,playlist:n}){this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,Oe.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(n.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Oe.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,Oe.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const n=this.media();if(e){const i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Oe.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}n&&!n.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){Oe.clearTimeout(this.mediaRequest_),this.mediaRequest_=Oe.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,n)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const n={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:n}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:o}=r;i.metadata=ph({requestType:o,request:r,error:i})}if(this.requestErrored_(i,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:n});const s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=sb(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncClientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){const n=BY(this.mainPlaylistLoader_.mainXml_);if(n===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(n.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=n.value-Date.now(),e();this.request=this.vhs_.xhr({uri:la(this.mainPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:o}=r;return this.error.metadata=ph({requestType:o,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;n.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?s=this.mainLoaded_:s=Date.parse(r.responseHeaders.date):s=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){Oe.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,n={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:n});let i;try{i=pQ({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(s){this.error=s,this.error.metadata={errorType:st.Error.StreamingDashManifestParserError,error:s},this.trigger("error")}e&&(i=mQ(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:s,endList:o}=i,u=[];i.playlists.forEach(h=>{u.push({id:h.id,bandwidth:h.attributes.BANDWIDTH,resolution:h.attributes.RESOLUTION,codecs:h.attributes.CODECS})});const d={duration:s,isLive:!o,renditions:u};n.parsedManifest=d,this.trigger({type:"manifestparsecomplete",metadata:n})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(Oe.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let n=e.main&&e.main.minimumUpdatePeriod;if(n===0&&(e.media()?n=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof n!="number"||n<=0){n<0&&this.logger_(`found invalid minimumUpdatePeriod of ${n}, not setting a timeout`);return}this.createMUPTimeout_(n)}createMUPTimeout_(e){const n=this.mainPlaylistLoader_;n.minimumUpdatePeriodTimeout_=Oe.setTimeout(()=>{n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,n)=>{n&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=yQ(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const n=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==n[e];if(i?this.media_=n[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=Oe.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},vT(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const n=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",n,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const n=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&n.add(r.replace(/-/g,"").toLowerCase())}return n}}}var Ms={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const vQ=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let n=0;n-1):!1},this.trigger=function(k){var O,I,B,Y;if(O=T[k],!!O)if(arguments.length===2)for(B=O.length,I=0;I"u")){for(T in pt)pt.hasOwnProperty(T)&&(pt[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);Wt=new Uint8Array([105,115,111,109]),Ut=new Uint8Array([97,118,99,49]),pn=new Uint8Array([0,0,0,1]),Xt=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),cn=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ai={video:Xt,audio:cn},ii=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),xn=new Uint8Array([0,0,0,0,0,0,0,0]),Zn=new Uint8Array([0,0,0,0,0,0,0,0]),li=Zn,Ft=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ui=Zn,Qt=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(T){var k=[],O=0,I,B,Y;for(I=1;I>>1,T.samplingfrequencyindex<<7|T.channelcount<<3,6,1,2]))},g=function(){return u(pt.ftyp,Wt,pn,Wt,Ut)},ve=function(T){return u(pt.hdlr,ai[T])},y=function(T){return u(pt.mdat,T)},he=function(T){var k=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,T.duration>>>24&255,T.duration>>>16&255,T.duration>>>8&255,T.duration&255,85,196,0,0]);return T.samplerate&&(k[12]=T.samplerate>>>24&255,k[13]=T.samplerate>>>16&255,k[14]=T.samplerate>>>8&255,k[15]=T.samplerate&255),u(pt.mdhd,k)},ee=function(T){return u(pt.mdia,he(T),ve(T.type),C(T))},w=function(T){return u(pt.mfhd,new Uint8Array([0,0,0,0,(T&4278190080)>>24,(T&16711680)>>16,(T&65280)>>8,T&255]))},C=function(T){return u(pt.minf,T.type==="video"?u(pt.vmhd,Qt):u(pt.smhd,xn),d(),ae(T))},D=function(T,k){for(var O=[],I=k.length;I--;)O[I]=Qe(k[I]);return u.apply(null,[pt.moof,w(T)].concat(O))},P=function(T){for(var k=T.length,O=[];k--;)O[k]=K(T[k]);return u.apply(null,[pt.moov,F(4294967295)].concat(O).concat(M(T)))},M=function(T){for(var k=T.length,O=[];k--;)O[k]=ot(T[k]);return u.apply(null,[pt.mvex].concat(O))},F=function(T){var k=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(T&4278190080)>>24,(T&16711680)>>16,(T&65280)>>8,T&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u(pt.mvhd,k)},fe=function(T){var k=T.samples||[],O=new Uint8Array(4+k.length),I,B;for(B=0;B>>8),Y.push(I[Ae].byteLength&255),Y=Y.concat(Array.prototype.slice.call(I[Ae]));for(Ae=0;Ae>>8),_e.push(B[Ae].byteLength&255),_e=_e.concat(Array.prototype.slice.call(B[Ae]));if(De=[pt.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(O.width&65280)>>8,O.width&255,(O.height&65280)>>8,O.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(pt.avcC,new Uint8Array([1,O.profileIdc,O.profileCompatibility,O.levelIdc,255].concat([I.length],Y,[B.length],_e))),u(pt.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],O.sarRatio){var Le=O.sarRatio[0],Ze=O.sarRatio[1];De.push(u(pt.pasp,new Uint8Array([(Le&4278190080)>>24,(Le&16711680)>>16,(Le&65280)>>8,Le&255,(Ze&4278190080)>>24,(Ze&16711680)>>16,(Ze&65280)>>8,Ze&255])))}return u.apply(null,De)},k=function(O){return u(pt.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(O.channelcount&65280)>>8,O.channelcount&255,(O.samplesize&65280)>>8,O.samplesize&255,0,0,0,0,(O.samplerate&65280)>>8,O.samplerate&255,0,0]),h(O))}}(),$=function(T){var k=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,0,(T.duration&4278190080)>>24,(T.duration&16711680)>>16,(T.duration&65280)>>8,T.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(T.width&65280)>>8,T.width&255,0,0,(T.height&65280)>>8,T.height&255,0,0]);return u(pt.tkhd,k)},Qe=function(T){var k,O,I,B,Y,_e,Ae;return k=u(pt.tfhd,new Uint8Array([0,0,0,58,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),_e=Math.floor(T.baseMediaDecodeTime/o),Ae=Math.floor(T.baseMediaDecodeTime%o),O=u(pt.tfdt,new Uint8Array([1,0,0,0,_e>>>24&255,_e>>>16&255,_e>>>8&255,_e&255,Ae>>>24&255,Ae>>>16&255,Ae>>>8&255,Ae&255])),Y=92,T.type==="audio"?(I=et(T,Y),u(pt.traf,k,O,I)):(B=fe(T),I=et(T,B.length+Y),u(pt.traf,k,O,I,B))},K=function(T){return T.duration=T.duration||4294967295,u(pt.trak,$(T),ee(T))},ot=function(T){var k=new Uint8Array([0,0,0,0,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return T.type!=="video"&&(k[k.length-1]=0),u(pt.trex,k)},function(){var T,k,O;O=function(I,B){var Y=0,_e=0,Ae=0,De=0;return I.length&&(I[0].duration!==void 0&&(Y=1),I[0].size!==void 0&&(_e=2),I[0].flags!==void 0&&(Ae=4),I[0].compositionTimeOffset!==void 0&&(De=8)),[0,0,Y|_e|Ae|De,1,(I.length&4278190080)>>>24,(I.length&16711680)>>>16,(I.length&65280)>>>8,I.length&255,(B&4278190080)>>>24,(B&16711680)>>>16,(B&65280)>>>8,B&255]},k=function(I,B){var Y,_e,Ae,De,Le,Ze;for(De=I.samples||[],B+=20+16*De.length,Ae=O(De,B),_e=new Uint8Array(Ae.length+De.length*16),_e.set(Ae),Y=Ae.length,Ze=0;Ze>>24,_e[Y++]=(Le.duration&16711680)>>>16,_e[Y++]=(Le.duration&65280)>>>8,_e[Y++]=Le.duration&255,_e[Y++]=(Le.size&4278190080)>>>24,_e[Y++]=(Le.size&16711680)>>>16,_e[Y++]=(Le.size&65280)>>>8,_e[Y++]=Le.size&255,_e[Y++]=Le.flags.isLeading<<2|Le.flags.dependsOn,_e[Y++]=Le.flags.isDependedOn<<6|Le.flags.hasRedundancy<<4|Le.flags.paddingValue<<1|Le.flags.isNonSyncSample,_e[Y++]=Le.flags.degradationPriority&61440,_e[Y++]=Le.flags.degradationPriority&15,_e[Y++]=(Le.compositionTimeOffset&4278190080)>>>24,_e[Y++]=(Le.compositionTimeOffset&16711680)>>>16,_e[Y++]=(Le.compositionTimeOffset&65280)>>>8,_e[Y++]=Le.compositionTimeOffset&255;return u(pt.trun,_e)},T=function(I,B){var Y,_e,Ae,De,Le,Ze;for(De=I.samples||[],B+=20+8*De.length,Ae=O(De,B),Y=new Uint8Array(Ae.length+De.length*8),Y.set(Ae),_e=Ae.length,Ze=0;Ze>>24,Y[_e++]=(Le.duration&16711680)>>>16,Y[_e++]=(Le.duration&65280)>>>8,Y[_e++]=Le.duration&255,Y[_e++]=(Le.size&4278190080)>>>24,Y[_e++]=(Le.size&16711680)>>>16,Y[_e++]=(Le.size&65280)>>>8,Y[_e++]=Le.size&255;return u(pt.trun,Y)},et=function(I,B){return I.type==="audio"?T(I,B):k(I,B)}}();var or={ftyp:g,mdat:y,moof:D,moov:P,initSegment:function(T){var k=g(),O=P(T),I;return I=new Uint8Array(k.byteLength+O.byteLength),I.set(k),I.set(O,k.byteLength),I}},ji=function(T){var k,O,I=[],B=[];for(B.byteLength=0,B.nalCount=0,B.duration=0,I.byteLength=0,k=0;k1&&(k=T.shift(),T.byteLength-=k.byteLength,T.nalCount-=k.nalCount,T[0][0].dts=k.dts,T[0][0].pts=k.pts,T[0][0].duration+=k.duration),T},Ur=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Fe=function(T,k){var O=Ur();return O.dataOffset=k,O.compositionTimeOffset=T.pts-T.dts,O.duration=T.duration,O.size=4*T.length,O.size+=T.byteLength,T.keyFrame&&(O.flags.dependsOn=2,O.flags.isNonSyncSample=0),O},Ke=function(T,k){var O,I,B,Y,_e,Ae=k||0,De=[];for(O=0;OEt.ONE_SECOND_IN_TS/2))){for(Le=at()[T.samplerate],Le||(Le=k[0].data),Ze=0;Ze=O?T:(k.minSegmentDts=1/0,T.filter(function(I){return I.dts>=O?(k.minSegmentDts=Math.min(k.minSegmentDts,I.dts),k.minSegmentPts=k.minSegmentDts,!0):!1}))},ur=function(T){var k,O,I=[];for(k=0;k=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(T),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ln.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ln.prototype.addText=function(T){this.rows[this.rowIdx]+=T},Ln.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var mr=function(T,k,O){this.serviceNum=T,this.text="",this.currentWindow=new Ln(-1),this.windows=[],this.stream=O,typeof k=="string"&&this.createTextDecoder(k)};mr.prototype.init=function(T,k){this.startPts=T;for(var O=0;O<8;O++)this.windows[O]=new Ln(O),typeof k=="function"&&(this.windows[O].beforeRowOverflow=k)},mr.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},mr.prototype.createTextDecoder=function(T){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(T)}catch(k){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+T+" encoding. "+k})}};var qn=function(T){T=T||{},qn.prototype.init.call(this);var k=this,O=T.captionServices||{},I={},B;Object.keys(O).forEach(Y=>{B=O[Y],/^SERVICE/.test(Y)&&(I[Y]=B.encoding)}),this.serviceEncodings=I,this.current708Packet=null,this.services={},this.push=function(Y){Y.type===3?(k.new708Packet(),k.add708Bytes(Y)):(k.current708Packet===null&&k.new708Packet(),k.add708Bytes(Y))}};qn.prototype=new as,qn.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},qn.prototype.add708Bytes=function(T){var k=T.ccData,O=k>>>8,I=k&255;this.current708Packet.ptsVals.push(T.pts),this.current708Packet.data.push(O),this.current708Packet.data.push(I)},qn.prototype.push708Packet=function(){var T=this.current708Packet,k=T.data,O=null,I=null,B=0,Y=k[B++];for(T.seq=Y>>6,T.sizeCode=Y&63;B>5,I=Y&31,O===7&&I>0&&(Y=k[B++],O=Y),this.pushServiceBlock(O,B,I),I>0&&(B+=I-1)},qn.prototype.pushServiceBlock=function(T,k,O){var I,B=k,Y=this.current708Packet.data,_e=this.services[T];for(_e||(_e=this.initService(T,B));B("0"+(vn&255).toString(16)).slice(-2)).join("")}if(B?(ut=[Ae,De],T++):ut=[Ae],k.textDecoder_&&!I)Ze=k.textDecoder_.decode(new Uint8Array(ut));else if(B){const _t=Jt(ut);Ze=String.fromCharCode(parseInt(_t,16))}else Ze=ds(_e|Ae);return Le.pendingNewLine&&!Le.isEmpty()&&Le.newLine(this.getPts(T)),Le.pendingNewLine=!1,Le.addText(Ze),T},qn.prototype.multiByteCharacter=function(T,k){var O=this.current708Packet.data,I=O[T+1],B=O[T+2];return fr(I)&&fr(B)&&(T=this.handleText(++T,k,{isMultiByte:!0})),T},qn.prototype.setCurrentWindow=function(T,k){var O=this.current708Packet.data,I=O[T],B=I&7;return k.setCurrentWindow(B),T},qn.prototype.defineWindow=function(T,k){var O=this.current708Packet.data,I=O[T],B=I&7;k.setCurrentWindow(B);var Y=k.currentWindow;return I=O[++T],Y.visible=(I&32)>>5,Y.rowLock=(I&16)>>4,Y.columnLock=(I&8)>>3,Y.priority=I&7,I=O[++T],Y.relativePositioning=(I&128)>>7,Y.anchorVertical=I&127,I=O[++T],Y.anchorHorizontal=I,I=O[++T],Y.anchorPoint=(I&240)>>4,Y.rowCount=I&15,I=O[++T],Y.columnCount=I&63,I=O[++T],Y.windowStyle=(I&56)>>3,Y.penStyle=I&7,Y.virtualRowCount=Y.rowCount+1,T},qn.prototype.setWindowAttributes=function(T,k){var O=this.current708Packet.data,I=O[T],B=k.currentWindow.winAttr;return I=O[++T],B.fillOpacity=(I&192)>>6,B.fillRed=(I&48)>>4,B.fillGreen=(I&12)>>2,B.fillBlue=I&3,I=O[++T],B.borderType=(I&192)>>6,B.borderRed=(I&48)>>4,B.borderGreen=(I&12)>>2,B.borderBlue=I&3,I=O[++T],B.borderType+=(I&128)>>5,B.wordWrap=(I&64)>>6,B.printDirection=(I&48)>>4,B.scrollDirection=(I&12)>>2,B.justify=I&3,I=O[++T],B.effectSpeed=(I&240)>>4,B.effectDirection=(I&12)>>2,B.displayEffect=I&3,T},qn.prototype.flushDisplayed=function(T,k){for(var O=[],I=0;I<8;I++)k.windows[I].visible&&!k.windows[I].isEmpty()&&O.push(k.windows[I].getText());k.endPts=T,k.text=O.join(` `),this.pushCaption(k),k.startPts=T},qn.prototype.pushCaption=function(T){T.text!==""&&(this.trigger("data",{startPts:T.startPts,endPts:T.endPts,text:T.text,stream:"cc708_"+T.serviceNum}),T.text="",T.startPts=T.endPts)},qn.prototype.displayWindows=function(T,k){var O=this.current708Packet.data,I=O[++T],B=this.getPts(T);this.flushDisplayed(B,k);for(var Y=0;Y<8;Y++)I&1<>4,B.offset=(I&12)>>2,B.penSize=I&3,I=O[++T],B.italics=(I&128)>>7,B.underline=(I&64)>>6,B.edgeType=(I&56)>>3,B.fontStyle=I&7,T},qn.prototype.setPenColor=function(T,k){var O=this.current708Packet.data,I=O[T],B=k.currentWindow.penColor;return I=O[++T],B.fgOpacity=(I&192)>>6,B.fgRed=(I&48)>>4,B.fgGreen=(I&12)>>2,B.fgBlue=I&3,I=O[++T],B.bgOpacity=(I&192)>>6,B.bgRed=(I&48)>>4,B.bgGreen=(I&12)>>2,B.bgBlue=I&3,I=O[++T],B.edgeRed=(I&48)>>4,B.edgeGreen=(I&12)>>2,B.edgeBlue=I&3,T},qn.prototype.setPenLocation=function(T,k){var O=this.current708Packet.data,I=O[T],B=k.currentWindow.penLoc;return k.currentWindow.pendingNewLine=!0,I=O[++T],B.row=I&15,I=O[++T],B.column=I&63,T},qn.prototype.reset=function(T,k){var O=this.getPts(T);return this.flushDisplayed(O,k),this.initService(k.serviceNum,T)};var Us={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Da=function(T){return T===null?"":(T=Us[T]||T,String.fromCharCode(T))},da=14,He=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Gt=function(){for(var T=[],k=da+1;k--;)T.push({text:"",indent:0,offset:0});return T},Pt=function(T,k){Pt.prototype.init.call(this),this.field_=T||0,this.dataChannel_=k||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(O){var I,B,Y,_e,Ae;if(I=O.ccData&32639,I===this.lastControlCode_){this.lastControlCode_=null;return}if((I&61440)===4096?this.lastControlCode_=I:I!==this.PADDING_&&(this.lastControlCode_=null),Y=I>>>8,_e=I&255,I!==this.PADDING_)if(I===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(I===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(O.pts),this.flushDisplayed(O.pts),B=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=B,this.startPts_=O.pts;else if(I===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(O.pts);else if(I===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(O.pts);else if(I===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(O.pts);else if(I===this.CARRIAGE_RETURN_)this.clearFormatting(O.pts),this.flushDisplayed(O.pts),this.shiftRowsUp_(),this.startPts_=O.pts;else if(I===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(I===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(O.pts),this.displayed_=Gt();else if(I===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Gt();else if(I===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(O.pts),this.displayed_=Gt()),this.mode_="paintOn",this.startPts_=O.pts;else if(this.isSpecialCharacter(Y,_e))Y=(Y&3)<<8,Ae=Da(Y|_e),this[this.mode_](O.pts,Ae),this.column_++;else if(this.isExtCharacter(Y,_e))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),Y=(Y&3)<<8,Ae=Da(Y|_e),this[this.mode_](O.pts,Ae),this.column_++;else if(this.isMidRowCode(Y,_e))this.clearFormatting(O.pts),this[this.mode_](O.pts," "),this.column_++,(_e&14)===14&&this.addFormatting(O.pts,["i"]),(_e&1)===1&&this.addFormatting(O.pts,["u"]);else if(this.isOffsetControlCode(Y,_e)){const Le=_e&3;this.nonDisplayed_[this.row_].offset=Le,this.column_+=Le}else if(this.isPAC(Y,_e)){var De=He.indexOf(I&7968);if(this.mode_==="rollUp"&&(De-this.rollUpRows_+1<0&&(De=this.rollUpRows_-1),this.setRollUp(O.pts,De)),De!==this.row_&&De>=0&&De<=14&&(this.clearFormatting(O.pts),this.row_=De),_e&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(O.pts,["u"]),(I&16)===16){const Le=(I&14)>>1;this.column_=Le*4,this.nonDisplayed_[this.row_].indent+=Le}this.isColorPAC(_e)&&(_e&14)===14&&this.addFormatting(O.pts,["i"])}else this.isNormalChar(Y)&&(_e===0&&(_e=null),Ae=Da(Y),Ae+=Da(_e),this[this.mode_](O.pts,Ae),this.column_+=Ae.length)}};Pt.prototype=new as,Pt.prototype.flushDisplayed=function(T){const k=I=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+I+"."})},O=[];this.displayed_.forEach((I,B)=>{if(I&&I.text&&I.text.length){try{I.text=I.text.trim()}catch{k(B)}I.text.length&&O.push({text:I.text,line:B+1,position:10+Math.min(70,I.indent*10)+I.offset*2.5})}else I==null&&k(B)}),O.length&&this.trigger("data",{startPts:this.startPts_,endPts:T,content:O,stream:this.name_})},Pt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Gt(),this.nonDisplayed_=Gt(),this.lastControlCode_=null,this.column_=0,this.row_=da,this.rollUpRows_=2,this.formatting_=[]},Pt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Pt.prototype.isSpecialCharacter=function(T,k){return T===this.EXT_&&k>=48&&k<=63},Pt.prototype.isExtCharacter=function(T,k){return(T===this.EXT_+1||T===this.EXT_+2)&&k>=32&&k<=63},Pt.prototype.isMidRowCode=function(T,k){return T===this.EXT_&&k>=32&&k<=47},Pt.prototype.isOffsetControlCode=function(T,k){return T===this.OFFSET_&&k>=33&&k<=35},Pt.prototype.isPAC=function(T,k){return T>=this.BASE_&&T=64&&k<=127},Pt.prototype.isColorPAC=function(T){return T>=64&&T<=79||T>=96&&T<=127},Pt.prototype.isNormalChar=function(T){return T>=32&&T<=127},Pt.prototype.setRollUp=function(T,k){if(this.mode_!=="rollUp"&&(this.row_=da,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=Gt(),this.displayed_=Gt()),k!==void 0&&k!==this.row_)for(var O=0;O"},"");this[this.mode_](T,O)},Pt.prototype.clearFormatting=function(T){if(this.formatting_.length){var k=this.formatting_.reverse().reduce(function(O,I){return O+""},"");this.formatting_=[],this[this.mode_](T,k)}},Pt.prototype.popOn=function(T,k){var O=this.nonDisplayed_[this.row_].text;O+=k,this.nonDisplayed_[this.row_].text=O},Pt.prototype.rollUp=function(T,k){var O=this.displayed_[this.row_].text;O+=k,this.displayed_[this.row_].text=O},Pt.prototype.shiftRowsUp_=function(){var T;for(T=0;Tk&&(O=-1);Math.abs(k-T)>Qr;)T+=O*$s;return T},Oi=function(T){var k,O;Oi.prototype.init.call(this),this.type_=T||gr,this.push=function(I){if(I.type==="metadata"){this.trigger("data",I);return}this.type_!==gr&&I.type!==this.type_||(O===void 0&&(O=I.dts),I.dts=vi(I.dts,O),I.pts=vi(I.pts,O),k=I.dts,this.trigger("data",I))},this.flush=function(){O=k,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){O=void 0,k=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oi.prototype=new Ai;var ha={TimestampRolloverStream:Oi,handleRollover:vi},pa=(T,k,O)=>{if(!T)return-1;for(var I=O;I";T.data[0]===yt.Utf8&&(O=rl(T.data,0,k),!(O<0)&&(T.mimeType=sl(T.data,k,O),k=O+1,T.pictureType=T.data[k],k++,I=rl(T.data,0,k),!(I<0)&&(T.description=hs(T.data,k,I),k=I+1,T.mimeType===B?T.url=sl(T.data,k,T.data.length):T.pictureData=T.data.subarray(k,T.data.length))))},"T*":function(T){T.data[0]===yt.Utf8&&(T.value=hs(T.data,1,T.data.length).replace(/\0*$/,""),T.values=T.value.split("\0"))},TXXX:function(T){var k;T.data[0]===yt.Utf8&&(k=rl(T.data,0,1),k!==-1&&(T.description=hs(T.data,1,k),T.value=hs(T.data,k+1,T.data.length).replace(/\0*$/,""),T.data=T.value))},"W*":function(T){T.url=sl(T.data,0,T.data.length).replace(/\0.*$/,"")},WXXX:function(T){var k;T.data[0]===yt.Utf8&&(k=rl(T.data,0,1),k!==-1&&(T.description=hs(T.data,1,k),T.url=sl(T.data,k+1,T.data.length).replace(/\0.*$/,"")))},PRIV:function(T){var k;for(k=0;k>>2;vn*=4,vn+=_t[7]&3,Ze.timeStamp=vn,Ae.pts===void 0&&Ae.dts===void 0&&(Ae.pts=Ze.timeStamp,Ae.dts=Ze.timeStamp),this.trigger("timestamp",Ze)}Ae.frames.push(Ze),De+=10,De+=Le}while(De>>4>1&&(_e+=B[_e]+1),Y.pid===0)Y.type="pat",T(B.subarray(_e),Y),this.trigger("data",Y);else if(Y.pid===this.pmtPid)for(Y.type="pmt",T(B.subarray(_e),Y),this.trigger("data",Y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([B,_e,Y]):this.processPes_(B,_e,Y)},this.processPes_=function(B,Y,_e){_e.pid===this.programMapTable.video?_e.streamType=lr.H264_STREAM_TYPE:_e.pid===this.programMapTable.audio?_e.streamType=lr.ADTS_STREAM_TYPE:_e.streamType=this.programMapTable["timed-metadata"][_e.pid],_e.type="pes",_e.data=B.subarray(Y),this.trigger("data",_e)}},al.prototype=new Es,al.STREAM_TYPES={h264:27,adts:15},La=function(){var T=this,k=!1,O={data:[],size:0},I={data:[],size:0},B={data:[],size:0},Y,_e=function(De,Le){var Ze;const ut=De[0]<<16|De[1]<<8|De[2];Le.data=new Uint8Array,ut===1&&(Le.packetLength=6+(De[4]<<8|De[5]),Le.dataAlignmentIndicator=(De[6]&4)!==0,Ze=De[7],Ze&192&&(Le.pts=(De[9]&14)<<27|(De[10]&255)<<20|(De[11]&254)<<12|(De[12]&255)<<5|(De[13]&254)>>>3,Le.pts*=4,Le.pts+=(De[13]&6)>>>1,Le.dts=Le.pts,Ze&64&&(Le.dts=(De[14]&14)<<27|(De[15]&255)<<20|(De[16]&254)<<12|(De[17]&255)<<5|(De[18]&254)>>>3,Le.dts*=4,Le.dts+=(De[18]&6)>>>1)),Le.data=De.subarray(9+De[8]))},Ae=function(De,Le,Ze){var ut=new Uint8Array(De.size),Jt={type:Le},_t=0,vn=0,Yn=!1,qr;if(!(!De.data.length||De.size<9)){for(Jt.trackId=De.data[0].pid,_t=0;_t>5,De=((k[B+6]&3)+1)*1024,Le=De*ul/Ou[(k[B+2]&60)>>>2],k.byteLength-B>>6&3)+1,channelcount:(k[B+2]&1)<<2|(k[B+3]&192)>>>6,samplerate:Ou[(k[B+2]&60)>>>2],samplingfrequencyindex:(k[B+2]&60)>>>2,samplesize:16,data:k.subarray(B+7+_e,B+Y)}),O++,B+=Y}typeof Ze=="number"&&(this.skipWarn_(Ze,B),Ze=null),k=k.subarray(B)}},this.flush=function(){O=0,this.trigger("done")},this.reset=function(){k=void 0,this.trigger("reset")},this.endTimeline=function(){k=void 0,this.trigger("endedtimeline")}},Nl.prototype=new xc;var Ma=Nl,cl;cl=function(T){var k=T.byteLength,O=0,I=0;this.length=function(){return 8*k},this.bitsAvailable=function(){return 8*k+I},this.loadWord=function(){var B=T.byteLength-k,Y=new Uint8Array(4),_e=Math.min(4,k);if(_e===0)throw new Error("no bytes available");Y.set(T.subarray(B,B+_e)),O=new DataView(Y.buffer).getUint32(0),I=_e*8,k-=_e},this.skipBits=function(B){var Y;I>B?(O<<=B,I-=B):(B-=I,Y=Math.floor(B/8),B-=Y*8,k-=Y,this.loadWord(),O<<=B,I-=B)},this.readBits=function(B){var Y=Math.min(I,B),_e=O>>>32-Y;return I-=Y,I>0?O<<=Y:k>0&&this.loadWord(),Y=B-Y,Y>0?_e<>>B)return O<<=B,I-=B,B;return this.loadWord(),B+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var B=this.skipLeadingZeros();return this.readBits(B+1)-1},this.readExpGolomb=function(){var B=this.readUnsignedExpGolomb();return 1&B?1+B>>>1:-1*(B>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ko=cl,Fl=n,dl=Ko,Yo,zr,Ru;zr=function(){var T=0,k,O;zr.prototype.init.call(this),this.push=function(I){var B;O?(B=new Uint8Array(O.byteLength+I.data.byteLength),B.set(O),B.set(I.data,O.byteLength),O=B):O=I.data;for(var Y=O.byteLength;T3&&this.trigger("data",O.subarray(T+3)),O=null,T=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},zr.prototype=new Fl,Ru={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Yo=function(){var T=new zr,k,O,I,B,Y,_e,Ae;Yo.prototype.init.call(this),k=this,this.push=function(De){De.type==="video"&&(O=De.trackId,I=De.pts,B=De.dts,T.push(De))},T.on("data",function(De){var Le={trackId:O,pts:I,dts:B,data:De,nalUnitTypeCode:De[0]&31};switch(Le.nalUnitTypeCode){case 5:Le.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Le.nalUnitType="sei_rbsp",Le.escapedRBSP=Y(De.subarray(1));break;case 7:Le.nalUnitType="seq_parameter_set_rbsp",Le.escapedRBSP=Y(De.subarray(1)),Le.config=_e(Le.escapedRBSP);break;case 8:Le.nalUnitType="pic_parameter_set_rbsp";break;case 9:Le.nalUnitType="access_unit_delimiter_rbsp";break}k.trigger("data",Le)}),T.on("done",function(){k.trigger("done")}),T.on("partialdone",function(){k.trigger("partialdone")}),T.on("reset",function(){k.trigger("reset")}),T.on("endedtimeline",function(){k.trigger("endedtimeline")}),this.flush=function(){T.flush()},this.partialFlush=function(){T.partialFlush()},this.reset=function(){T.reset()},this.endTimeline=function(){T.endTimeline()},Ae=function(De,Le){var Ze=8,ut=8,Jt,_t;for(Jt=0;Jt>4;return O=O>=0?O:0,B?O+20:O+10},Ul=function(T,k){return T.length-k<10||T[k]!==73||T[k+1]!==68||T[k+2]!==51?k:(k+=Bl(T,k),Ul(T,k))},Na=function(T){var k=Ul(T,0);return T.length>=k+2&&(T[k]&255)===255&&(T[k+1]&240)===240&&(T[k+1]&22)===16},Hl=function(T){return T[0]<<21|T[1]<<14|T[2]<<7|T[3]},fa=function(T,k,O){var I,B="";for(I=k;I>5,I=T[k+4]<<3,B=T[k+3]&6144;return B|I|O},kc=function(T,k){return T[k]===73&&T[k+1]===68&&T[k+2]===51?"timed-metadata":T[k]&!0&&(T[k+1]&240)===240?"audio":null},Pc=function(T){for(var k=0;k+5>>2]}return null},Td=function(T){var k,O,I,B;k=10,T[5]&64&&(k+=4,k+=Hl(T.subarray(10,14)));do{if(O=Hl(T.subarray(k+4,k+8)),O<1)return null;if(B=String.fromCharCode(T[k],T[k+1],T[k+2],T[k+3]),B==="PRIV"){I=T.subarray(k+10,k+O+10);for(var Y=0;Y>>2;return De*=4,De+=Ae[7]&3,De}break}}k+=10,k+=O}while(k=3;){if(T[B]===73&&T[B+1]===68&&T[B+2]===51){if(T.length-B<10||(I=hl.parseId3TagSize(T,B),B+I>T.length))break;_e={type:"timed-metadata",data:T.subarray(B,B+I)},this.trigger("data",_e),B+=I;continue}else if((T[B]&255)===255&&(T[B+1]&240)===240){if(T.length-B<7||(I=hl.parseAdtsSize(T,B),B+I>T.length))break;Ae={type:"audio",data:T.subarray(B,B+I),pts:k,dts:k},this.trigger("data",Ae),B+=I;continue}B++}Y=T.length-B,Y>0?T=T.subarray(B):T=new Uint8Array},this.reset=function(){T=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){T=new Uint8Array,this.trigger("endedtimeline")}},Dr.prototype=new Th;var Li=Dr,jr=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Vl=jr,Ed=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Dc=Ed,xs=n,Ir=or,ls=Ye,Jr=os,Cs=qt,no=Ec,wi=we,Lu=Ma,ma=Sd.H264Stream,Vr=Li,Wr=jl.isLikelyAacData,Mu=we.ONE_SECOND_IN_TS,To=Vl,ga=Dc,Hs,Fa,Or,ya,Rr=function(T,k){k.stream=T,this.trigger("log",k)},Xo=function(T,k){for(var O=Object.keys(k),I=0;I=-1e4&&Ze<=De&&(!ut||Le>Ze)&&(ut=_t,Le=Ze)));return ut?ut.gop:null},this.alignGopsAtStart_=function(Ae){var De,Le,Ze,ut,Jt,_t,vn,Yn;for(Jt=Ae.byteLength,_t=Ae.nalCount,vn=Ae.duration,De=Le=0;DeZe.pts){De++;continue}Le++,Jt-=ut.byteLength,_t-=ut.nalCount,vn-=ut.duration}return Le===0?Ae:Le===Ae.length?null:(Yn=Ae.slice(Le),Yn.byteLength=Jt,Yn.duration=vn,Yn.nalCount=_t,Yn.pts=Yn[0].pts,Yn.dts=Yn[0].dts,Yn)},this.alignGopsAtEnd_=function(Ae){var De,Le,Ze,ut,Jt,_t;for(De=B.length-1,Le=Ae.length-1,Jt=null,_t=!1;De>=0&&Le>=0;){if(Ze=B[De],ut=Ae[Le],Ze.pts===ut.pts){_t=!0;break}if(Ze.pts>ut.pts){De--;continue}De===B.length-1&&(Jt=Le),Le--}if(!_t&&Jt===null)return null;var vn;if(_t?vn=Le:vn=Jt,vn===0)return Ae;var Yn=Ae.slice(vn),qr=Yn.reduce(function(Ps,Ao){return Ps.byteLength+=Ao.byteLength,Ps.duration+=Ao.duration,Ps.nalCount+=Ao.nalCount,Ps},{byteLength:0,duration:0,nalCount:0});return Yn.byteLength=qr.byteLength,Yn.duration=qr.duration,Yn.nalCount=qr.nalCount,Yn.pts=Yn[0].pts,Yn.dts=Yn[0].dts,Yn},this.alignGopsWith=function(Ae){B=Ae}},Hs.prototype=new xs,ya=function(T,k){this.numberOfTracks=0,this.metadataStream=k,T=T||{},typeof T.remux<"u"?this.remuxTracks=!!T.remux:this.remuxTracks=!0,typeof T.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=T.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ya.prototype.init.call(this),this.push=function(O){if(O.content||O.text)return this.pendingCaptions.push(O);if(O.frames)return this.pendingMetadata.push(O);this.pendingTracks.push(O.track),this.pendingBytes+=O.boxes.byteLength,O.track.type==="video"&&(this.videoTrack=O.track,this.pendingBoxes.push(O.boxes)),O.track.type==="audio"&&(this.audioTrack=O.track,this.pendingBoxes.unshift(O.boxes))}},ya.prototype=new xs,ya.prototype.flush=function(T){var k=0,O={captions:[],captionStreams:{},metadata:[],info:{}},I,B,Y,_e=0,Ae;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(_e=this.videoTrack.timelineStartInfo.pts,ga.forEach(function(De){O.info[De]=this.videoTrack[De]},this)):this.audioTrack&&(_e=this.audioTrack.timelineStartInfo.pts,To.forEach(function(De){O.info[De]=this.audioTrack[De]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?O.type=this.pendingTracks[0].type:O.type="combined",this.emittedTracks+=this.pendingTracks.length,Y=Ir.initSegment(this.pendingTracks),O.initSegment=new Uint8Array(Y.byteLength),O.initSegment.set(Y),O.data=new Uint8Array(this.pendingBytes),Ae=0;Ae=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ya.prototype.setRemux=function(T){this.remuxTracks=T},Or=function(T){var k=this,O=!0,I,B;Or.prototype.init.call(this),T=T||{},this.baseMediaDecodeTime=T.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var Y={};this.transmuxPipeline_=Y,Y.type="aac",Y.metadataStream=new no.MetadataStream,Y.aacStream=new Vr,Y.audioTimestampRolloverStream=new no.TimestampRolloverStream("audio"),Y.timedMetadataTimestampRolloverStream=new no.TimestampRolloverStream("timed-metadata"),Y.adtsStream=new Lu,Y.coalesceStream=new ya(T,Y.metadataStream),Y.headOfPipeline=Y.aacStream,Y.aacStream.pipe(Y.audioTimestampRolloverStream).pipe(Y.adtsStream),Y.aacStream.pipe(Y.timedMetadataTimestampRolloverStream).pipe(Y.metadataStream).pipe(Y.coalesceStream),Y.metadataStream.on("timestamp",function(_e){Y.aacStream.setTimestamp(_e.timeStamp)}),Y.aacStream.on("data",function(_e){_e.type!=="timed-metadata"&&_e.type!=="audio"||Y.audioSegmentStream||(B=B||{timelineStartInfo:{baseMediaDecodeTime:k.baseMediaDecodeTime},codec:"adts",type:"audio"},Y.coalesceStream.numberOfTracks++,Y.audioSegmentStream=new Fa(B,T),Y.audioSegmentStream.on("log",k.getLogTrigger_("audioSegmentStream")),Y.audioSegmentStream.on("timingInfo",k.trigger.bind(k,"audioTimingInfo")),Y.adtsStream.pipe(Y.audioSegmentStream).pipe(Y.coalesceStream),k.trigger("trackinfo",{hasAudio:!!B,hasVideo:!!I}))}),Y.coalesceStream.on("data",this.trigger.bind(this,"data")),Y.coalesceStream.on("done",this.trigger.bind(this,"done")),Xo(this,Y)},this.setupTsPipeline=function(){var Y={};this.transmuxPipeline_=Y,Y.type="ts",Y.metadataStream=new no.MetadataStream,Y.packetStream=new no.TransportPacketStream,Y.parseStream=new no.TransportParseStream,Y.elementaryStream=new no.ElementaryStream,Y.timestampRolloverStream=new no.TimestampRolloverStream,Y.adtsStream=new Lu,Y.h264Stream=new ma,Y.captionStream=new no.CaptionStream(T),Y.coalesceStream=new ya(T,Y.metadataStream),Y.headOfPipeline=Y.packetStream,Y.packetStream.pipe(Y.parseStream).pipe(Y.elementaryStream).pipe(Y.timestampRolloverStream),Y.timestampRolloverStream.pipe(Y.h264Stream),Y.timestampRolloverStream.pipe(Y.adtsStream),Y.timestampRolloverStream.pipe(Y.metadataStream).pipe(Y.coalesceStream),Y.h264Stream.pipe(Y.captionStream).pipe(Y.coalesceStream),Y.elementaryStream.on("data",function(_e){var Ae;if(_e.type==="metadata"){for(Ae=_e.tracks.length;Ae--;)!I&&_e.tracks[Ae].type==="video"?(I=_e.tracks[Ae],I.timelineStartInfo.baseMediaDecodeTime=k.baseMediaDecodeTime):!B&&_e.tracks[Ae].type==="audio"&&(B=_e.tracks[Ae],B.timelineStartInfo.baseMediaDecodeTime=k.baseMediaDecodeTime);I&&!Y.videoSegmentStream&&(Y.coalesceStream.numberOfTracks++,Y.videoSegmentStream=new Hs(I,T),Y.videoSegmentStream.on("log",k.getLogTrigger_("videoSegmentStream")),Y.videoSegmentStream.on("timelineStartInfo",function(De){B&&!T.keepOriginalTimestamps&&(B.timelineStartInfo=De,Y.audioSegmentStream.setEarliestDts(De.dts-k.baseMediaDecodeTime))}),Y.videoSegmentStream.on("processedGopsInfo",k.trigger.bind(k,"gopInfo")),Y.videoSegmentStream.on("segmentTimingInfo",k.trigger.bind(k,"videoSegmentTimingInfo")),Y.videoSegmentStream.on("baseMediaDecodeTime",function(De){B&&Y.audioSegmentStream.setVideoBaseMediaDecodeTime(De)}),Y.videoSegmentStream.on("timingInfo",k.trigger.bind(k,"videoTimingInfo")),Y.h264Stream.pipe(Y.videoSegmentStream).pipe(Y.coalesceStream)),B&&!Y.audioSegmentStream&&(Y.coalesceStream.numberOfTracks++,Y.audioSegmentStream=new Fa(B,T),Y.audioSegmentStream.on("log",k.getLogTrigger_("audioSegmentStream")),Y.audioSegmentStream.on("timingInfo",k.trigger.bind(k,"audioTimingInfo")),Y.audioSegmentStream.on("segmentTimingInfo",k.trigger.bind(k,"audioSegmentTimingInfo")),Y.adtsStream.pipe(Y.audioSegmentStream).pipe(Y.coalesceStream)),k.trigger("trackinfo",{hasAudio:!!B,hasVideo:!!I})}}),Y.coalesceStream.on("data",this.trigger.bind(this,"data")),Y.coalesceStream.on("id3Frame",function(_e){_e.dispatchType=Y.metadataStream.dispatchType,k.trigger("id3Frame",_e)}),Y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),Y.coalesceStream.on("done",this.trigger.bind(this,"done")),Xo(this,Y)},this.setBaseMediaDecodeTime=function(Y){var _e=this.transmuxPipeline_;T.keepOriginalTimestamps||(this.baseMediaDecodeTime=Y),B&&(B.timelineStartInfo.dts=void 0,B.timelineStartInfo.pts=void 0,Cs.clearDtsInfo(B),_e.audioTimestampRolloverStream&&_e.audioTimestampRolloverStream.discontinuity()),I&&(_e.videoSegmentStream&&(_e.videoSegmentStream.gopCache_=[]),I.timelineStartInfo.dts=void 0,I.timelineStartInfo.pts=void 0,Cs.clearDtsInfo(I),_e.captionStream.reset()),_e.timestampRolloverStream&&_e.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(Y){B&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(Y)},this.setRemux=function(Y){var _e=this.transmuxPipeline_;T.remux=Y,_e&&_e.coalesceStream&&_e.coalesceStream.setRemux(Y)},this.alignGopsWith=function(Y){I&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(Y)},this.getLogTrigger_=function(Y){var _e=this;return function(Ae){Ae.stream=Y,_e.trigger("log",Ae)}},this.push=function(Y){if(O){var _e=Wr(Y);_e&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!_e&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),O=!1}this.transmuxPipeline_.headOfPipeline.push(Y)},this.flush=function(){O=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Or.prototype=new xs;var fl={Transmuxer:Or},zs=function(T){return T>>>0},xd=function(T){return("00"+T.toString(16)).slice(-2)},Xi={toUnsigned:zs,toHexString:xd},Cd=function(T){var k="";return k+=String.fromCharCode(T[0]),k+=String.fromCharCode(T[1]),k+=String.fromCharCode(T[2]),k+=String.fromCharCode(T[3]),k},Nu=Cd,As=Xi.toUnsigned,Eo=Nu,ml=function(T,k){var O=[],I,B,Y,_e,Ae;if(!k.length)return null;for(I=0;I1?I+B:T.byteLength,Y===k[0]&&(k.length===1?O.push(T.subarray(I+8,_e)):(Ae=ml(T.subarray(I+8,_e),k.slice(1)),Ae.length&&(O=O.concat(Ae)))),I=_e;return O},Wl=ml,Ad=Xi.toUnsigned,kd=s.getUint64,Fu=function(T){var k={version:T[0],flags:new Uint8Array(T.subarray(1,4))};return k.version===1?k.baseMediaDecodeTime=kd(T.subarray(4)):k.baseMediaDecodeTime=Ad(T[4]<<24|T[5]<<16|T[6]<<8|T[7]),k},Ic=Fu,xo=function(T){var k=new DataView(T.buffer,T.byteOffset,T.byteLength),O={version:T[0],flags:new Uint8Array(T.subarray(1,4)),trackId:k.getUint32(4)},I=O.flags[2]&1,B=O.flags[2]&2,Y=O.flags[2]&8,_e=O.flags[2]&16,Ae=O.flags[2]&32,De=O.flags[0]&65536,Le=O.flags[0]&131072,Ze;return Ze=8,I&&(Ze+=4,O.baseDataOffset=k.getUint32(12),Ze+=4),B&&(O.sampleDescriptionIndex=k.getUint32(Ze),Ze+=4),Y&&(O.defaultSampleDuration=k.getUint32(Ze),Ze+=4),_e&&(O.defaultSampleSize=k.getUint32(Ze),Ze+=4),Ae&&(O.defaultSampleFlags=k.getUint32(Ze)),De&&(O.durationIsEmpty=!0),!I&&Le&&(O.baseDataOffsetIsMoof=!0),O},Bi=xo,ql=function(T){return{isLeading:(T[0]&12)>>>2,dependsOn:T[0]&3,isDependedOn:(T[1]&192)>>>6,hasRedundancy:(T[1]&48)>>>4,paddingValue:(T[1]&14)>>>1,isNonSyncSample:T[1]&1,degradationPriority:T[2]<<8|T[3]}},Zi=ql,Bu=Zi,Zo=function(T){var k={version:T[0],flags:new Uint8Array(T.subarray(1,4)),samples:[]},O=new DataView(T.buffer,T.byteOffset,T.byteLength),I=k.flags[2]&1,B=k.flags[2]&4,Y=k.flags[1]&1,_e=k.flags[1]&2,Ae=k.flags[1]&4,De=k.flags[1]&8,Le=O.getUint32(4),Ze=8,ut;for(I&&(k.dataOffset=O.getInt32(Ze),Ze+=4),B&&Le&&(ut={flags:Bu(T.subarray(Ze,Ze+4))},Ze+=4,Y&&(ut.duration=O.getUint32(Ze),Ze+=4),_e&&(ut.size=O.getUint32(Ze),Ze+=4),De&&(k.version===1?ut.compositionTimeOffset=O.getInt32(Ze):ut.compositionTimeOffset=O.getUint32(Ze),Ze+=4),k.samples.push(ut),Le--);Le--;)ut={},Y&&(ut.duration=O.getUint32(Ze),Ze+=4),_e&&(ut.size=O.getUint32(Ze),Ze+=4),Ae&&(ut.flags=Bu(T.subarray(Ze,Ze+4)),Ze+=4),De&&(k.version===1?ut.compositionTimeOffset=O.getInt32(Ze):ut.compositionTimeOffset=O.getUint32(Ze),Ze+=4),k.samples.push(ut);return k},io=Zo,Gl={tfdt:Ic,trun:io},js={parseTfdt:Gl.tfdt,parseTrun:Gl.trun},Ba=function(T){for(var k=0,O=String.fromCharCode(T[k]),I="";O!=="\0";)I+=O,k++,O=String.fromCharCode(T[k]);return I+=O,I},Oc={uint8ToCString:Ba},Kl=Oc.uint8ToCString,Uu=s.getUint64,gl=function(T){var k=4,O=T[0],I,B,Y,_e,Ae,De,Le,Ze;if(O===0){I=Kl(T.subarray(k)),k+=I.length,B=Kl(T.subarray(k)),k+=B.length;var ut=new DataView(T.buffer);Y=ut.getUint32(k),k+=4,Ae=ut.getUint32(k),k+=4,De=ut.getUint32(k),k+=4,Le=ut.getUint32(k),k+=4}else if(O===1){var ut=new DataView(T.buffer);Y=ut.getUint32(k),k+=4,_e=Uu(T.subarray(k)),k+=8,De=ut.getUint32(k),k+=4,Le=ut.getUint32(k),k+=4,I=Kl(T.subarray(k)),k+=I.length,B=Kl(T.subarray(k)),k+=B.length}Ze=new Uint8Array(T.subarray(k,T.byteLength));var Jt={scheme_id_uri:I,value:B,timescale:Y||1,presentation_time:_e,presentation_time_delta:Ae,event_duration:De,id:Le,message_data:Ze};return Yl(O,Jt)?Jt:void 0},Hu=function(T,k,O,I){return T||T===0?T/k:I+O/k},Yl=function(T,k){var O=k.scheme_id_uri!=="\0",I=T===0&&Vs(k.presentation_time_delta)&&O,B=T===1&&Vs(k.presentation_time)&&O;return!(T>1)&&I||B},Vs=function(T){return T!==void 0||T!==null},Xl={parseEmsgBox:gl,scaleTime:Hu},ms;typeof window<"u"?ms=window:typeof t<"u"?ms=t:typeof self<"u"?ms=self:ms={};var yl=ms,vl=Xi.toUnsigned,Ua=Xi.toHexString,L=Wl,R=Nu,z=Xl,q=Bi,Xe=io,Je=Ic,Se=s.getUint64,ye,me,nt,le,j,Q,dt,ht=yl,At=Oa.parseId3Frames;ye=function(T){var k={},O=L(T,["moov","trak"]);return O.reduce(function(I,B){var Y,_e,Ae,De,Le;return Y=L(B,["tkhd"])[0],!Y||(_e=Y[0],Ae=_e===0?12:20,De=vl(Y[Ae]<<24|Y[Ae+1]<<16|Y[Ae+2]<<8|Y[Ae+3]),Le=L(B,["mdia","mdhd"])[0],!Le)?null:(_e=Le[0],Ae=_e===0?12:20,I[De]=vl(Le[Ae]<<24|Le[Ae+1]<<16|Le[Ae+2]<<8|Le[Ae+3]),I)},k)},me=function(T,k){var O;O=L(k,["moof","traf"]);var I=O.reduce(function(B,Y){var _e=L(Y,["tfhd"])[0],Ae=vl(_e[4]<<24|_e[5]<<16|_e[6]<<8|_e[7]),De=T[Ae]||9e4,Le=L(Y,["tfdt"])[0],Ze=new DataView(Le.buffer,Le.byteOffset,Le.byteLength),ut;Le[0]===1?ut=Se(Le.subarray(4,12)):ut=Ze.getUint32(4);let Jt;return typeof ut=="bigint"?Jt=ut/ht.BigInt(De):typeof ut=="number"&&!isNaN(ut)&&(Jt=ut/De),Jt11?(B.codec+=".",B.codec+=Ua(_t[9]),B.codec+=Ua(_t[10]),B.codec+=Ua(_t[11])):B.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(B.codec)?(_t=Jt.subarray(28),vn=R(_t.subarray(4,8)),vn==="esds"&&_t.length>20&&_t[19]!==0?(B.codec+="."+Ua(_t[19]),B.codec+="."+Ua(_t[20]>>>2&63).replace(/^0/,"")):B.codec="mp4a.40.2"):B.codec=B.codec.toLowerCase())}var Yn=L(I,["mdia","mdhd"])[0];Yn&&(B.timescale=Q(Yn)),O.push(B)}),O},dt=function(T,k=0){var O=L(T,["emsg"]);return O.map(I=>{var B=z.parseEmsgBox(new Uint8Array(I)),Y=At(B.message_data);return{cueTime:z.scaleTime(B.presentation_time,B.timescale,B.presentation_time_delta,k),duration:z.scaleTime(B.event_duration,B.timescale),frames:Y}})};var Tt={findBox:L,parseType:R,timescale:ye,startTime:me,compositionStartTime:nt,videoTrackIds:le,tracks:j,getTimescaleFromMediaHeader:Q,getEmsgID3:dt};const{parseTrun:it}=js,{findBox:ct}=Tt;var ft=yl,Ot=function(T){var k=ct(T,["moof","traf"]),O=ct(T,["mdat"]),I=[];return O.forEach(function(B,Y){var _e=k[Y];I.push({mdat:B,traf:_e})}),I},Mt=function(T,k,O){var I=k,B=O.defaultSampleDuration||0,Y=O.defaultSampleSize||0,_e=O.trackId,Ae=[];return T.forEach(function(De){var Le=it(De),Ze=Le.samples;Ze.forEach(function(ut){ut.duration===void 0&&(ut.duration=B),ut.size===void 0&&(ut.size=Y),ut.trackId=_e,ut.dts=I,ut.compositionTimeOffset===void 0&&(ut.compositionTimeOffset=0),typeof I=="bigint"?(ut.pts=I+ft.BigInt(ut.compositionTimeOffset),I+=ft.BigInt(ut.duration)):(ut.pts=I+ut.compositionTimeOffset,I+=ut.duration)}),Ae=Ae.concat(Ze)}),Ae},$t={getMdatTrafPairs:Ot,parseSamples:Mt},fn=ri.discardEmulationPreventionBytes,yn=Pn.CaptionStream,An=Wl,si=Ic,Mn=Bi,{getMdatTrafPairs:Un,parseSamples:Tn}=$t,ni=function(T,k){for(var O=T,I=0;I0?si(Ze[0]).baseMediaDecodeTime:0,Jt=An(_e,["trun"]),_t,vn;k===Le&&Jt.length>0&&(_t=Tn(Jt,ut,De),vn=bi(Y,_t,Le),O[Le]||(O[Le]={seiNals:[],logs:[]}),O[Le].seiNals=O[Le].seiNals.concat(vn.seiNals),O[Le].logs=O[Le].logs.concat(vn.logs))}),O},Ei=function(T,k,O){var I;if(k===null)return null;I=oi(T,k);var B=I[k]||{};return{seiNals:B.seiNals,logs:B.logs,timescale:O}},jn=function(){var T=!1,k,O,I,B,Y,_e;this.isInitialized=function(){return T},this.init=function(Ae){k=new yn,T=!0,_e=Ae?Ae.isPartial:!1,k.on("data",function(De){De.startTime=De.startPts/B,De.endTime=De.endPts/B,Y.captions.push(De),Y.captionStreams[De.stream]=!0}),k.on("log",function(De){Y.logs.push(De)})},this.isNewInit=function(Ae,De){return Ae&&Ae.length===0||De&&typeof De=="object"&&Object.keys(De).length===0?!1:I!==Ae[0]||B!==De[I]},this.parse=function(Ae,De,Le){var Ze;if(this.isInitialized()){if(!De||!Le)return null;if(this.isNewInit(De,Le))I=De[0],B=Le[I];else if(I===null||!B)return O.push(Ae),null}else return null;for(;O.length>0;){var ut=O.shift();this.parse(ut,De,Le)}return Ze=Ei(Ae,I,B),Ze&&Ze.logs&&(Y.logs=Y.logs.concat(Ze.logs)),Ze===null||!Ze.seiNals?Y.logs.length?{logs:Y.logs,captions:[],captionStreams:[]}:null:(this.pushNals(Ze.seiNals),this.flushStream(),Y)},this.pushNals=function(Ae){if(!this.isInitialized()||!Ae||Ae.length===0)return null;Ae.forEach(function(De){k.push(De)})},this.flushStream=function(){if(!this.isInitialized())return null;_e?k.partialFlush():k.flush()},this.clearParsedCaptions=function(){Y.captions=[],Y.captionStreams={},Y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;k.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){O=[],I=null,B=null,Y?this.clearParsedCaptions():Y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Lr=jn;const{parseTfdt:_i}=js,xi=Wl,{getTimescaleFromMediaHeader:Er}=Tt,{parseSamples:ro,getMdatTrafPairs:Rc}=$t;var bl=function(){let T=9e4;this.init=function(k){const O=xi(k,["moov","trak","mdia","mdhd"])[0];O&&(T=Er(O))},this.parseSegment=function(k){const O=[],I=Rc(k);let B=0;return I.forEach(function(Y){const _e=Y.mdat,Ae=Y.traf,De=xi(Ae,["tfdt"])[0],Le=xi(Ae,["tfhd"])[0],Ze=xi(Ae,["trun"]);if(De&&(B=_i(De).baseMediaDecodeTime),Ze.length&&Le){const ut=ro(Ze,B,Le);let Jt=0;ut.forEach(function(_t){const vn="utf-8",Yn=new TextDecoder(vn),qr=_e.slice(Jt,Jt+_t.size);if(xi(qr,["vtte"])[0]){Jt+=_t.size;return}xi(qr,["vttc"]).forEach(function(Ps){const Ao=xi(Ps,["payl"])[0],va=xi(Ps,["sttg"])[0],wl=_t.pts/T,Fc=(_t.pts+_t.duration)/T;let ba,Vu;if(Ao)try{ba=Yn.decode(Ao)}catch(tr){console.error(tr)}if(va)try{Vu=Yn.decode(va)}catch(tr){console.error(tr)}_t.duration&&ba&&O.push({cueText:ba,start:wl,end:Fc,settings:Vu})}),Jt+=_t.size})}}),O}},zu=Ii,tf=function(T){var k=T[1]&31;return k<<=8,k|=T[2],k},Lc=function(T){return!!(T[1]&64)},Mc=function(T){var k=0;return(T[3]&48)>>>4>1&&(k+=T[4]+1),k},di=function(T,k){var O=tf(T);return O===0?"pat":O===k?"pmt":k?"pes":null},Ha=function(T){var k=Lc(T),O=4+Mc(T);return k&&(O+=T[O]+1),(T[O+10]&31)<<8|T[O+11]},Zl=function(T){var k={},O=Lc(T),I=4+Mc(T);if(O&&(I+=T[I]+1),!!(T[I+5]&1)){var B,Y,_e;B=(T[I+1]&15)<<8|T[I+2],Y=3+B-4,_e=(T[I+10]&15)<<8|T[I+11];for(var Ae=12+_e;Ae=T.byteLength)return null;var I=null,B;return B=T[O+7],B&192&&(I={},I.pts=(T[O+9]&14)<<27|(T[O+10]&255)<<20|(T[O+11]&254)<<12|(T[O+12]&255)<<5|(T[O+13]&254)>>>3,I.pts*=4,I.pts+=(T[O+13]&6)>>>1,I.dts=I.pts,B&64&&(I.dts=(T[O+14]&14)<<27|(T[O+15]&255)<<20|(T[O+16]&254)<<12|(T[O+17]&255)<<5|(T[O+18]&254)>>>3,I.dts*=4,I.dts+=(T[O+18]&6)>>>1)),I},Ws=function(T){switch(T){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Dd=function(T){for(var k=4+Mc(T),O=T.subarray(k),I=0,B=0,Y=!1,_e;B3&&(_e=Ws(O[B+3]&31),_e==="slice_layer_without_partitioning_rbsp_idr"&&(Y=!0)),Y},nf={parseType:di,parsePat:Ha,parsePmt:Zl,parsePayloadUnitStartIndicator:Lc,parsePesType:za,parsePesTime:Pd,videoPacketContainsKeyFrame:Dd},Ql=Ii,ju=ha.handleRollover,Dn={};Dn.ts=nf,Dn.aac=jl;var Co=we.ONE_SECOND_IN_TS,ks=188,gs=71,wg=function(T,k){for(var O=0,I=ks,B,Y;I=0;){if(T[I]===gs&&(T[B]===gs||B===T.byteLength)){switch(Y=T.subarray(I,B),_e=Dn.ts.parseType(Y,k.pid),_e){case"pes":Ae=Dn.ts.parsePesType(Y,k.table),De=Dn.ts.parsePayloadUnitStartIndicator(Y),Ae==="audio"&&De&&(Le=Dn.ts.parsePesTime(Y),Le&&(Le.type="audio",O.audio.push(Le),Ze=!0));break}if(Ze)break;I-=ks,B-=ks;continue}I--,B--}},sf=function(T,k,O){for(var I=0,B=ks,Y,_e,Ae,De,Le,Ze,ut,Jt,_t=!1,vn={data:[],size:0};B=0;){if(T[I]===gs&&T[B]===gs){switch(Y=T.subarray(I,B),_e=Dn.ts.parseType(Y,k.pid),_e){case"pes":Ae=Dn.ts.parsePesType(Y,k.table),De=Dn.ts.parsePayloadUnitStartIndicator(Y),Ae==="video"&&De&&(Le=Dn.ts.parsePesTime(Y),Le&&(Le.type="video",O.video.push(Le),_t=!0));break}if(_t)break;I-=ks,B-=ks;continue}I--,B--}},Nc=function(T,k){if(T.audio&&T.audio.length){var O=k;(typeof O>"u"||isNaN(O))&&(O=T.audio[0].dts),T.audio.forEach(function(Y){Y.dts=ju(Y.dts,O),Y.pts=ju(Y.pts,O),Y.dtsTime=Y.dts/Co,Y.ptsTime=Y.pts/Co})}if(T.video&&T.video.length){var I=k;if((typeof I>"u"||isNaN(I))&&(I=T.video[0].dts),T.video.forEach(function(Y){Y.dts=ju(Y.dts,I),Y.pts=ju(Y.pts,I),Y.dtsTime=Y.dts/Co,Y.ptsTime=Y.pts/Co}),T.firstKeyFrame){var B=T.firstKeyFrame;B.dts=ju(B.dts,I),B.pts=ju(B.pts,I),B.dtsTime=B.dts/Co,B.ptsTime=B.pts/Co}}},Id=function(T){for(var k=!1,O=0,I=null,B=null,Y=0,_e=0,Ae;T.length-_e>=3;){var De=Dn.aac.parseType(T,_e);switch(De){case"timed-metadata":if(T.length-_e<10){k=!0;break}if(Y=Dn.aac.parseId3TagSize(T,_e),Y>T.length){k=!0;break}B===null&&(Ae=T.subarray(_e,_e+Y),B=Dn.aac.parseAacTimestamp(Ae)),_e+=Y;break;case"audio":if(T.length-_e<7){k=!0;break}if(Y=Dn.aac.parseAdtsSize(T,_e),Y>T.length){k=!0;break}I===null&&(Ae=T.subarray(_e,_e+Y),I=Dn.aac.parseSampleRate(Ae)),O++,_e+=Y;break;default:_e++;break}if(k)return null}if(I===null||B===null)return null;var Le=Co/I,Ze={audio:[{type:"audio",dts:B,pts:B},{type:"audio",dts:B+O*1024*Le,pts:B+O*1024*Le}]};return Ze},_g=function(T){var k={pid:null,table:null},O={};wg(T,k);for(var I in k.table)if(k.table.hasOwnProperty(I)){var B=k.table[I];switch(B){case Ql.H264_STREAM_TYPE:O.video=[],sf(T,k,O),O.video.length===0&&delete O.video;break;case Ql.ADTS_STREAM_TYPE:O.audio=[],rf(T,k,O),O.audio.length===0&&delete O.audio;break}}return O},Sg=function(T,k){var O=Dn.aac.isLikelyAacData(T),I;return O?I=Id(T):I=_g(T),!I||!I.audio&&!I.video?null:(Nc(I,k),I)},of={inspect:Sg,parseAudioPes_:rf};const Od=function(T,k){k.on("data",function(O){const I=O.initSegment;O.initSegment={data:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength};const B=O.data;O.data=B.buffer,T.postMessage({action:"data",segment:O,byteOffset:B.byteOffset,byteLength:B.byteLength},[O.data])}),k.on("done",function(O){T.postMessage({action:"done"})}),k.on("gopInfo",function(O){T.postMessage({action:"gopInfo",gopInfo:O})}),k.on("videoSegmentTimingInfo",function(O){const I={start:{decode:we.videoTsToSeconds(O.start.dts),presentation:we.videoTsToSeconds(O.start.pts)},end:{decode:we.videoTsToSeconds(O.end.dts),presentation:we.videoTsToSeconds(O.end.pts)},baseMediaDecodeTime:we.videoTsToSeconds(O.baseMediaDecodeTime)};O.prependedContentDuration&&(I.prependedContentDuration=we.videoTsToSeconds(O.prependedContentDuration)),T.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:I})}),k.on("audioSegmentTimingInfo",function(O){const I={start:{decode:we.videoTsToSeconds(O.start.dts),presentation:we.videoTsToSeconds(O.start.pts)},end:{decode:we.videoTsToSeconds(O.end.dts),presentation:we.videoTsToSeconds(O.end.pts)},baseMediaDecodeTime:we.videoTsToSeconds(O.baseMediaDecodeTime)};O.prependedContentDuration&&(I.prependedContentDuration=we.videoTsToSeconds(O.prependedContentDuration)),T.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:I})}),k.on("id3Frame",function(O){T.postMessage({action:"id3Frame",id3Frame:O})}),k.on("caption",function(O){T.postMessage({action:"caption",caption:O})}),k.on("trackinfo",function(O){T.postMessage({action:"trackinfo",trackInfo:O})}),k.on("audioTimingInfo",function(O){T.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:we.videoTsToSeconds(O.start),end:we.videoTsToSeconds(O.end)}})}),k.on("videoTimingInfo",function(O){T.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:we.videoTsToSeconds(O.start),end:we.videoTsToSeconds(O.end)}})}),k.on("log",function(O){T.postMessage({action:"log",log:O})})};class af{constructor(k,O){this.options=O||{},this.self=k,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new fl.Transmuxer(this.options),Od(this.self,this.transmuxer)}pushMp4Captions(k){this.captionParser||(this.captionParser=new Lr,this.captionParser.init());const O=new Uint8Array(k.data,k.byteOffset,k.byteLength),I=this.captionParser.parse(O,k.trackIds,k.timescales);this.self.postMessage({action:"mp4Captions",captions:I&&I.captions||[],logs:I&&I.logs||[],data:O.buffer},[O.buffer])}initMp4WebVttParser(k){this.webVttParser||(this.webVttParser=new bl);const O=new Uint8Array(k.data,k.byteOffset,k.byteLength);this.webVttParser.init(O)}getMp4WebVttText(k){this.webVttParser||(this.webVttParser=new bl);const O=new Uint8Array(k.data,k.byteOffset,k.byteLength),I=this.webVttParser.parseSegment(O);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:I||[],data:O.buffer},[O.buffer])}probeMp4StartTime({timescales:k,data:O}){const I=Tt.startTime(k,O);this.self.postMessage({action:"probeMp4StartTime",startTime:I,data:O},[O.buffer])}probeMp4Tracks({data:k}){const O=Tt.tracks(k);this.self.postMessage({action:"probeMp4Tracks",tracks:O,data:k},[k.buffer])}probeEmsgID3({data:k,offset:O}){const I=Tt.getEmsgID3(k,O);this.self.postMessage({action:"probeEmsgID3",id3Frames:I,emsgData:k},[k.buffer])}probeTs({data:k,baseStartTime:O}){const I=typeof O=="number"&&!isNaN(O)?O*we.ONE_SECOND_IN_TS:void 0,B=of.inspect(k,I);let Y=null;B&&(Y={hasVideo:B.video&&B.video.length===2||!1,hasAudio:B.audio&&B.audio.length===2||!1},Y.hasVideo&&(Y.videoStart=B.video[0].ptsTime),Y.hasAudio&&(Y.audioStart=B.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:Y,data:k},[k.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(k){const O=new Uint8Array(k.data,k.byteOffset,k.byteLength);this.transmuxer.push(O)}reset(){this.transmuxer.reset()}setTimestampOffset(k){const O=k.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(we.secondsToVideoTs(O)))}setAudioAppendStart(k){this.transmuxer.setAudioAppendStart(Math.ceil(we.secondsToVideoTs(k.appendStart)))}setRemux(k){this.transmuxer.setRemux(k.remux)}flush(k){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(k){this.transmuxer.alignGopsWith(k.gopsToAlignWith.slice())}}self.onmessage=function(T){if(T.data.action==="init"&&T.data.options){this.messageHandlers=new af(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new af(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}}));var _Q=h2(wQ);const SQ=(t,e,n)=>{const{type:i,initSegment:r,captions:s,captionStreams:o,metadata:u,videoFrameDtsTime:d,videoFramePtsTime:h}=t.data.segment;e.buffer.push({captions:s,captionStreams:o,metadata:u});const g=t.data.segment.boxes||{data:t.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof d<"u"&&(y.videoFrameDtsTime=d),typeof h<"u"&&(y.videoFramePtsTime=h),n(y)},TQ=({transmuxedData:t,callback:e})=>{t.buffer=[],e(t)},EQ=(t,e)=>{e.gopInfo=t.data.gopInfo},m2=t=>{const{transmuxer:e,bytes:n,audioAppendStart:i,gopsToAlignWith:r,remux:s,onData:o,onTrackInfo:u,onAudioTimingInfo:d,onVideoTimingInfo:h,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:C,onDone:D,onEndedTimeline:P,onTransmuxerLog:M,isEndOfTimeline:F,segment:K,triggerSegmentEventFn:$}=t,ee={buffer:[]};let he=F;const ve=ae=>{e.currentTransmux===t&&(ae.data.action==="data"&&SQ(ae,ee,o),ae.data.action==="trackinfo"&&u(ae.data.trackInfo),ae.data.action==="gopInfo"&&EQ(ae,ee),ae.data.action==="audioTimingInfo"&&d(ae.data.audioTimingInfo),ae.data.action==="videoTimingInfo"&&h(ae.data.videoTimingInfo),ae.data.action==="videoSegmentTimingInfo"&&g(ae.data.videoSegmentTimingInfo),ae.data.action==="audioSegmentTimingInfo"&&y(ae.data.audioSegmentTimingInfo),ae.data.action==="id3Frame"&&w([ae.data.id3Frame],ae.data.id3Frame.dispatchType),ae.data.action==="caption"&&C(ae.data.caption),ae.data.action==="endedtimeline"&&(he=!1,P()),ae.data.action==="log"&&M(ae.data.log),ae.data.type==="transmuxed"&&(he||(e.onmessage=null,TQ({transmuxedData:ee,callback:D}),g2(e))))},fe=()=>{const ae={message:"Received an error message from the transmuxer worker",metadata:{errorType:st.Error.StreamingFailedToTransmuxSegment,segmentInfo:fh({segment:K})}};D(null,ae)};if(e.onmessage=ve,e.onerror=fe,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof s<"u"&&e.postMessage({action:"setRemux",remux:s}),n.byteLength){const ae=n instanceof ArrayBuffer?n:n.buffer,xe=n instanceof ArrayBuffer?0:n.byteOffset;$({type:"segmenttransmuxingstart",segment:K}),e.postMessage({action:"push",data:ae,byteOffset:xe,byteLength:n.byteLength},[ae])}F&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},g2=t=>{t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():m2(t.currentTransmux))},y2=(t,e)=>{t.postMessage({action:e}),g2(t)},v2=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t,y2(e,t);return}e.transmuxQueue.push(y2.bind(null,e,t))},xQ=t=>{v2("reset",t)},CQ=t=>{v2("endTimeline",t)},b2=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,m2(t);return}t.transmuxer.transmuxQueue.push(t)};var TT={reset:xQ,endTimeline:CQ,transmux:b2,createTransmuxer:t=>{const e=new _Q;e.currentTransmux=null,e.transmuxQueue=[];const n=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,n.call(e)),e.postMessage({action:"init",options:t}),e}};const Fp=function(t){const e=t.transmuxer,n=t.endAction||t.action,i=t.callback,r=Kr({},t,{endAction:null,transmuxer:null,callback:null}),s=o=>{o.data.action===n&&(e.removeEventListener("message",s),o.data.data&&(o.data.data=new Uint8Array(o.data.data,t.byteOffset||0,t.byteLength||o.data.data.byteLength),t.data&&(t.data=o.data.data)),i(o.data))};if(e.addEventListener("message",s),t.data){const o=t.data instanceof ArrayBuffer;r.byteOffset=o?0:t.data.byteOffset,r.byteLength=t.data.byteLength;const u=[o?t.data:t.data.buffer];e.postMessage(r,u)}else e.postMessage(r)},Eu={FAILURE:2,TIMEOUT:-101,ABORTED:-102},w2="wvtt",ET=t=>{t.forEach(e=>{e.abort()})},AQ=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}),kQ=t=>{const e=t.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return n.bytesReceived=t.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},xT=(t,e)=>{const{requestType:n}=e,i=ph({requestType:n,request:e,error:t});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Eu.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Eu.ABORTED,xhr:e,metadata:i}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Eu.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Eu.FAILURE,xhr:e,metadata:i}:null},_2=(t,e,n,i)=>(r,s)=>{const o=s.response,u=xT(r,s);if(u)return n(u,t);if(o.byteLength!==16)return n({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:Eu.FAILURE,xhr:s},t);const d=new DataView(o),h=new Uint32Array([d.getUint32(0),d.getUint32(4),d.getUint32(8),d.getUint32(12)]);for(let y=0;y{e===w2&&t.transmuxer.postMessage({action:"initMp4WebVttParser",data:t.map.bytes})},DQ=(t,e,n)=>{e===w2&&Fp({action:"getMp4WebVttText",data:t.bytes,transmuxer:t.transmuxer,callback:({data:i,mp4VttCues:r})=>{t.bytes=i,n(null,t,{mp4VttCues:r})}})},S2=(t,e)=>{const n=gS(t.map.bytes);if(n!=="mp4"){const i=t.map.resolvedUri||t.map.uri,r=n||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Eu.FAILURE,metadata:{mediaType:r}})}Fp({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:i,data:r})=>(t.map.bytes=r,i.forEach(function(s){t.map.tracks=t.map.tracks||{},!t.map.tracks[s.type]&&(t.map.tracks[s.type]=s,typeof s.id=="number"&&s.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[s.id]=s.timescale),s.type==="text"&&PQ(t,s.codec))}),e(null))})},IQ=({segment:t,finishProcessingFn:e,triggerSegmentEventFn:n})=>(i,r)=>{const s=xT(i,r);if(s)return e(s,t);const o=new Uint8Array(r.response);if(n({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=o,e(null,t);t.map.bytes=o,S2(t,function(u){if(u)return u.xhr=r,u.status=r.status,e(u,t);e(null,t)})},OQ=({segment:t,finishProcessingFn:e,responseType:n,triggerSegmentEventFn:i})=>(r,s)=>{const o=xT(r,s);if(o)return e(o,t);i({type:"segmentloaded",segment:t});const u=n==="arraybuffer"||!s.responseText?s.response:vQ(s.responseText.substring(t.lastReachedChar||0));return t.stats=AQ(s),t.key?t.encryptedBytes=new Uint8Array(u):t.bytes=new Uint8Array(u),e(null,t)},RQ=({segment:t,bytes:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})=>{const D=t.map&&t.map.tracks||{},P=!!(D.audio&&D.video);let M=i.bind(null,t,"audio","start");const F=i.bind(null,t,"audio","end");let K=i.bind(null,t,"video","start");const $=i.bind(null,t,"video","end"),ee=()=>b2({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:P,onData:he=>{he.type=he.type==="combined"?"video":he.type,g(t,he)},onTrackInfo:he=>{n&&(P&&(he.isMuxed=!0),n(t,he))},onAudioTimingInfo:he=>{M&&typeof he.start<"u"&&(M(he.start),M=null),F&&typeof he.end<"u"&&F(he.end)},onVideoTimingInfo:he=>{K&&typeof he.start<"u"&&(K(he.start),K=null),$&&typeof he.end<"u"&&$(he.end)},onVideoSegmentTimingInfo:he=>{const ve={pts:{start:he.start.presentation,end:he.end.presentation},dts:{start:he.start.decode,end:he.end.decode}};C({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:ve}),r(he)},onAudioSegmentTimingInfo:he=>{const ve={pts:{start:he.start.pts,end:he.end.pts},dts:{start:he.start.dts,end:he.end.dts}};C({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:ve}),s(he)},onId3:(he,ve)=>{o(t,he,ve)},onCaptions:he=>{u(t,[he])},isEndOfTimeline:d,onEndedTimeline:()=>{h()},onTransmuxerLog:w,onDone:(he,ve)=>{y&&(he.type=he.type==="combined"?"video":he.type,C({type:"segmenttransmuxingcomplete",segment:t}),y(ve,t,he))},segment:t,triggerSegmentEventFn:C});Fp({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:he=>{t.bytes=e=he.data;const ve=he.result;ve&&(n(t,{hasAudio:ve.hasAudio,hasVideo:ve.hasVideo,isMuxed:P}),n=null),ee()}})},T2=({segment:t,bytes:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})=>{let D=new Uint8Array(e);if(sX(D)){t.isFmp4=!0;const{tracks:P}=t.map;if(P.text&&(!P.audio||!P.video)){g(t,{data:D,type:"text"}),DQ(t,P.text.codec,y);return}const M={isFmp4:!0,hasVideo:!!P.video,hasAudio:!!P.audio};P.audio&&P.audio.codec&&P.audio.codec!=="enca"&&(M.audioCodec=P.audio.codec),P.video&&P.video.codec&&P.video.codec!=="encv"&&(M.videoCodec=P.video.codec),P.video&&P.audio&&(M.isMuxed=!0),n(t,M);const F=(K,$)=>{g(t,{data:D,type:M.hasAudio&&!M.isMuxed?"audio":"video"}),$&&$.length&&o(t,$),K&&K.length&&u(t,K),y(null,t,{})};Fp({action:"probeMp4StartTime",timescales:t.map.timescales,data:D,transmuxer:t.transmuxer,callback:({data:K,startTime:$})=>{e=K.buffer,t.bytes=D=K,M.hasAudio&&!M.isMuxed&&i(t,"audio","start",$),M.hasVideo&&i(t,"video","start",$),Fp({action:"probeEmsgID3",data:D,transmuxer:t.transmuxer,offset:$,callback:({emsgData:ee,id3Frames:he})=>{if(e=ee.buffer,t.bytes=D=ee,!P.video||!ee.byteLength||!t.transmuxer){F(void 0,he);return}Fp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:D,timescales:t.map.timescales,trackIds:[P.video.id],callback:ve=>{e=ve.data.buffer,t.bytes=D=ve.data,ve.logs.forEach(function(fe){w(Ki(fe,{stream:"mp4CaptionParser"}))}),F(ve.captions,he)}})}})}});return}if(!t.transmuxer){y(null,t,{});return}if(typeof t.container>"u"&&(t.container=gS(D)),t.container!=="ts"&&t.container!=="aac"){n(t,{hasAudio:!1,hasVideo:!1}),y(null,t,{});return}RQ({segment:t,bytes:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})},E2=function({id:t,key:e,encryptedBytes:n,decryptionWorker:i,segment:r,doneFn:s},o){const u=h=>{if(h.data.source===t){i.removeEventListener("message",u);const g=h.data.decrypted;o(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};i.onerror=()=>{const h="An error occurred in the decryption worker",g=fh({segment:r}),y={message:h,metadata:{error:new Error(h),errorType:st.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(y,r)},i.addEventListener("message",u);let d;e.bytes.slice?d=e.bytes.slice():d=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(r2({source:t,encrypted:n,key:d,iv:e.iv}),[n.buffer,d.buffer])},LQ=({decryptionWorker:t,segment:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})=>{C({type:"segmentdecryptionstart"}),E2({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:y},D=>{e.bytes=D,C({type:"segmentdecryptioncomplete",segment:e}),T2({segment:e,bytes:e.bytes,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})})},MQ=({activeXhrs:t,decryptionWorker:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})=>{let D=0,P=!1;return(M,F)=>{if(!P){if(M)return P=!0,ET(t),y(M,F);if(D+=1,D===t.length){const K=function(){if(F.encryptedBytes)return LQ({decryptionWorker:e,segment:F,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C});T2({segment:F,bytes:F.bytes,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:C})};if(F.endOfAllRequests=Date.now(),F.map&&F.map.encryptedBytes&&!F.map.bytes)return C({type:"segmentdecryptionstart",segment:F}),E2({decryptionWorker:e,id:F.requestId+"-init",encryptedBytes:F.map.encryptedBytes,key:F.map.key,segment:F,doneFn:y},$=>{F.map.bytes=$,C({type:"segmentdecryptioncomplete",segment:F}),S2(F,ee=>{if(ee)return ET(t),y(ee,F);K()})});K()}}}},NQ=({loadendState:t,abortFn:e})=>n=>{n.target.aborted&&e&&!t.calledAbortFn&&(e(),t.calledAbortFn=!0)},FQ=({segment:t,progressFn:e,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:g})=>y=>{if(!y.target.aborted)return t.stats=Ki(t.stats,kQ(y)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),e(y,t)},BQ=({xhr:t,xhrOptions:e,decryptionWorker:n,segment:i,abortFn:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:h,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:C,dataFn:D,doneFn:P,onTransmuxerLog:M,triggerSegmentEventFn:F})=>{const K=[],$=MQ({activeXhrs:K,decryptionWorker:n,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:h,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:C,dataFn:D,doneFn:P,onTransmuxerLog:M,triggerSegmentEventFn:F});if(i.key&&!i.key.bytes){const ae=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&ae.push(i.map.key);const xe=Ki(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Qe=_2(i,ae,$,F),ot={uri:i.key.resolvedUri};F({type:"segmentkeyloadstart",segment:i,keyInfo:ot});const et=t(xe,Qe);K.push(et)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const ot=Ki(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),et=_2(i,[i.map.key],$,F),pt={uri:i.map.key.resolvedUri};F({type:"segmentkeyloadstart",segment:i,keyInfo:pt});const Wt=t(ot,et);K.push(Wt)}const ae=Ki(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:wT(i.map),requestType:"segment-media-initialization"}),xe=IQ({segment:i,finishProcessingFn:$,triggerSegmentEventFn:F});F({type:"segmentloadstart",segment:i});const Qe=t(ae,xe);K.push(Qe)}const ee=Ki(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:wT(i),requestType:"segment"}),he=OQ({segment:i,finishProcessingFn:$,responseType:ee.responseType,triggerSegmentEventFn:F});F({type:"segmentloadstart",segment:i});const ve=t(ee,he);ve.addEventListener("progress",FQ({segment:i,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:h,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:C,dataFn:D})),K.push(ve);const fe={};return K.forEach(ae=>{ae.addEventListener("loadend",NQ({loadendState:fe,abortFn:r}))}),()=>ET(K)},ub=tl("PlaylistSelector"),x2=function(t){if(!t||!t.playlist)return;const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})},Bp=function(t,e){if(!t)return"";const n=Oe.getComputedStyle(t);return n?n[e]:""},Up=function(t,e){const n=t.slice();t.sort(function(i,r){const s=e(i,r);return s===0?n.indexOf(i)-n.indexOf(r):s})},CT=function(t,e){let n,i;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||Oe.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||Oe.Number.MAX_VALUE,n-i},UQ=function(t,e){let n,i;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||Oe.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||Oe.Number.MAX_VALUE,n===i&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:n-i};let C2=function(t){const{main:e,bandwidth:n,playerWidth:i,playerHeight:r,playerObjectFit:s,limitRenditionByPlayerDimensions:o,playlistController:u}=t;if(!e)return;const d={bandwidth:n,width:i,height:r,limitRenditionByPlayerDimensions:o};let h=e.playlists;ua.isAudioOnly(e)&&(h=u.getAudioTrackPlaylists_(),d.audioOnly=!0);let g=h.map(fe=>{let ae;const xe=fe.attributes&&fe.attributes.RESOLUTION&&fe.attributes.RESOLUTION.width,Qe=fe.attributes&&fe.attributes.RESOLUTION&&fe.attributes.RESOLUTION.height;return ae=fe.attributes&&fe.attributes.BANDWIDTH,ae=ae||Oe.Number.MAX_VALUE,{bandwidth:ae,width:xe,height:Qe,playlist:fe}});Up(g,(fe,ae)=>fe.bandwidth-ae.bandwidth),g=g.filter(fe=>!ua.isIncompatible(fe.playlist));let y=g.filter(fe=>ua.isEnabled(fe.playlist));y.length||(y=g.filter(fe=>!ua.isDisabled(fe.playlist)));const w=y.filter(fe=>fe.bandwidth*Ms.BANDWIDTH_VARIANCEfe.bandwidth===C.bandwidth)[0];if(o===!1){const fe=D||y[0]||g[0];if(fe&&fe.playlist){let ae="sortedPlaylistReps";return D&&(ae="bandwidthBestRep"),y[0]&&(ae="enabledPlaylistReps"),ub(`choosing ${x2(fe)} using ${ae} with options`,d),fe.playlist}return ub("could not choose a playlist with options",d),null}const P=w.filter(fe=>fe.width&&fe.height);Up(P,(fe,ae)=>fe.width-ae.width);const M=P.filter(fe=>fe.width===i&&fe.height===r);C=M[M.length-1];const F=M.filter(fe=>fe.bandwidth===C.bandwidth)[0];let K,$,ee;F||(K=P.filter(fe=>s==="cover"?fe.width>i&&fe.height>r:fe.width>i||fe.height>r),$=K.filter(fe=>fe.width===K[0].width&&fe.height===K[0].height),C=$[$.length-1],ee=$.filter(fe=>fe.bandwidth===C.bandwidth)[0]);let he;if(u.leastPixelDiffSelector){const fe=P.map(ae=>(ae.pixelDiff=Math.abs(ae.width-i)+Math.abs(ae.height-r),ae));Up(fe,(ae,xe)=>ae.pixelDiff===xe.pixelDiff?xe.bandwidth-ae.bandwidth:ae.pixelDiff-xe.pixelDiff),he=fe[0]}const ve=he||ee||F||D||y[0]||g[0];if(ve&&ve.playlist){let fe="sortedPlaylistReps";return he?fe="leastPixelDiffRep":ee?fe="resolutionPlusOneRep":F?fe="resolutionBestRep":D?fe="bandwidthBestRep":y[0]&&(fe="enabledPlaylistReps"),ub(`choosing ${x2(ve)} using ${fe} with options`,d),ve.playlist}return ub("could not choose a playlist with options",d),null};const A2=function(){let t=this.useDevicePixelRatio&&Oe.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(t=this.customPixelRatio),C2({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Bp(this.tech_.el(),"width"),10)*t,playerHeight:parseInt(Bp(this.tech_.el(),"height"),10)*t,playerObjectFit:this.usePlayerObjectFit?Bp(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},HQ=function(t){let e=-1,n=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&Oe.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(e=t*this.systemBandwidth+(1-t)*e,n=this.systemBandwidth),C2({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(Bp(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(Bp(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?Bp(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},zQ=function(t){const{main:e,currentTime:n,bandwidth:i,duration:r,segmentDuration:s,timeUntilRebuffer:o,currentTimeline:u,syncController:d}=t,h=e.playlists.filter(C=>!ua.isIncompatible(C));let g=h.filter(ua.isEnabled);g.length||(g=h.filter(C=>!ua.isDisabled(C)));const y=g.filter(ua.hasAttribute.bind(null,"BANDWIDTH")).map(C=>{const D=d.getSyncPoint(C,r,u,n)?1:2,P=ua.estimateSegmentRequestTime(s,i,C)*D-o;return{playlist:C,rebufferingImpact:P}}),w=y.filter(C=>C.rebufferingImpact<=0);return Up(w,(C,D)=>CT(D.playlist,C.playlist)),w.length?w[0]:(Up(y,(C,D)=>C.rebufferingImpact-D.rebufferingImpact),y[0]||null)},jQ=function(){const t=this.playlists.main.playlists.filter(ua.isEnabled);return Up(t,(e,n)=>CT(e,n)),t.filter(e=>!!tg(this.playlists.main,e).video)[0]||null},VQ=t=>{let e=0,n;return t.bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(i=>{n.set(i,e),e+=i.byteLength})),n};function k2(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch{return""}}const WQ=function(t,e,n){if(!t[n]){e.trigger({type:"usage",name:"vhs-608"});let i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)t[n]=r;else{const s=e.options_.vhs&&e.options_.vhs.captionServices||{};let o=n,u=n,d=!1;const h=s[i];h&&(o=h.label,u=h.language,d=h.default),t[n]=e.addRemoteTextTrack({kind:"captions",id:i,default:d,label:o,language:u},!1).track}}},qQ=function({inbandTextTracks:t,captionArray:e,timestampOffset:n}){if(!e)return;const i=Oe.WebKitDataCue||Oe.VTTCue;e.forEach(r=>{const s=r.stream;r.content?r.content.forEach(o=>{const u=new i(r.startTime+n,r.endTime+n,o.text);u.line=o.line,u.align="left",u.position=o.position,u.positionAlign="line-left",t[s].addCue(u)}):t[s].addCue(new i(r.startTime+n,r.endTime+n,r.text))})},GQ=function(t){Object.defineProperties(t.frame,{id:{get(){return st.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get(){return st.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get(){return st.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},KQ=({inbandTextTracks:t,metadataArray:e,timestampOffset:n,videoDuration:i})=>{if(!e)return;const r=Oe.WebKitDataCue||Oe.VTTCue,s=t.metadataTrack_;if(!s||(e.forEach(g=>{const y=g.cueTime+n;typeof y!="number"||Oe.isNaN(y)||y<0||!(y<1/0)||!g.frames||!g.frames.length||g.frames.forEach(w=>{const C=new r(y,y,w.value||w.url||w.data||"");C.frame=w,C.value=w,GQ(C),s.addCue(C)})}),!s.cues||!s.cues.length))return;const o=s.cues,u=[];for(let g=0;g{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),h=Object.keys(d).sort((g,y)=>Number(g)-Number(y));h.forEach((g,y)=>{const w=d[g],C=isFinite(i)?i:g,D=Number(h[y+1])||C;w.forEach(P=>{P.endTime=D})})},YQ={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},XQ=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),ZQ=({inbandTextTracks:t,dateRanges:e})=>{const n=t.metadataTrack_;if(!n)return;const i=Oe.WebKitDataCue||Oe.VTTCue;e.forEach(r=>{for(const s of Object.keys(r)){if(XQ.has(s))continue;const o=new i(r.startTime,r.endTime,"");o.id=r.id,o.type="com.apple.quicktime.HLS",o.value={key:YQ[s],data:r[s]},(s==="scte35Out"||s==="scte35In")&&(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),n.addCue(o)}r.processDateRange()})},P2=(t,e,n)=>{t.metadataTrack_||(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,st.browser.IS_ANY_SAFARI||(t.metadataTrack_.inBandMetadataTrackDispatchType=e))},ng=function(t,e,n){let i,r;if(n&&n.cues)for(i=n.cues.length;i--;)r=n.cues[i],r.startTime>=t&&r.endTime<=e&&n.removeCue(r)},QQ=function(t){const e=t.cues;if(!e)return;const n={};for(let i=e.length-1;i>=0;i--){const r=e[i],s=`${r.startTime}-${r.endTime}-${r.text}`;n[s]?t.removeCue(r):n[s]=r}},JQ=(t,e,n)=>{if(typeof e>"u"||e===null||!t.length)return[];const i=Math.ceil((e-n+3)*sh.ONE_SECOND_IN_TS);let r;for(r=0;ri);r++);return t.slice(r)},$Q=(t,e,n)=>{if(!e.length)return t;if(n)return e.slice();const i=e[0].pts;let r=0;for(r;r=i);r++);return t.slice(0,r).concat(e)},eJ=(t,e,n,i)=>{const r=Math.ceil((e-i)*sh.ONE_SECOND_IN_TS),s=Math.ceil((n-i)*sh.ONE_SECOND_IN_TS),o=t.slice();let u=t.length;for(;u--&&!(t[u].pts<=s););if(u===-1)return o;let d=u+1;for(;d--&&!(t[d].pts<=r););return d=Math.max(d,0),o.splice(d,u-d+1),o},tJ=function(t,e){if(!t&&!e||!t&&e||t&&!e)return!1;if(t===e)return!0;const n=Object.keys(t).sort(),i=Object.keys(e).sort();if(n.length!==i.length)return!1;for(let r=0;rn))return s}return i.length===0?0:i[i.length-1]},ig=1,iJ=500,D2=t=>typeof t=="number"&&isFinite(t),cb=1/60,rJ=(t,e,n)=>t!=="main"||!e||!n?null:!n.hasAudio&&!n.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,sJ=(t,e,n)=>{let i=e-Ms.BACK_BUFFER_LENGTH;t.length&&(i=Math.max(i,t.start(0)));const r=e-n;return Math.min(r,i)},Hp=t=>{const{startOfSegment:e,duration:n,segment:i,part:r,playlist:{mediaSequence:s,id:o,segments:u=[]},mediaIndex:d,partIndex:h,timeline:g}=t,y=u.length-1;let w="mediaIndex/partIndex increment";t.getMediaInfoForTime?w=`getMediaInfoForTime (${t.getMediaInfoForTime})`:t.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(w+=` with independent ${t.independent}`);const C=typeof h=="number",D=t.segment.uri?"segment":"pre-segment",P=C?NR({preloadSegment:i})-1:0;return`${D} [${s+d}/${s+y}]`+(C?` part [${h}/${P}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(C?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${n}] timeline [${g}] selected by [${w}] playlist [${o}]`},I2=t=>`${t}TimingInfo`,oJ=({segmentTimeline:t,currentTimeline:e,startOfSegment:n,buffered:i,overrideCheck:r})=>!r&&t===e?null:t{if(e===n)return!1;if(i==="audio"){const s=t.lastTimelineChange({type:"main"});return!s||s.to!==n}if(i==="main"&&r){const s=t.pendingTimelineChange({type:"audio"});return!(s&&s.to===n)}return!1},aJ=t=>{if(!t)return!1;const e=t.pendingTimelineChange({type:"audio"}),n=t.pendingTimelineChange({type:"main"}),i=e&&n,r=i&&e.to!==n.to;return!!(i&&e.from!==-1&&n.from!==-1&&r)},lJ=t=>{const e=t.timelineChangeController_.pendingTimelineChange({type:"audio"}),n=t.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&n&&e.to{const e=t.pendingSegment_;if(e&&AT({timelineChangeController:t.timelineChangeController_,currentTimeline:t.currentTimeline_,segmentTimeline:e.timeline,loaderType:t.loaderType_,audioDisabled:t.audioDisabled_})&&aJ(t.timelineChangeController_)){if(lJ(t)){t.timelineChangeController_.trigger("audioTimelineBehind");return}t.timelineChangeController_.trigger("fixBadTimelineChange")}},uJ=t=>{let e=0;return["video","audio"].forEach(function(n){const i=t[`${n}TimingInfo`];if(!i)return;const{start:r,end:s}=i;let o;typeof r=="bigint"||typeof s=="bigint"?o=Oe.BigInt(s)-Oe.BigInt(r):typeof r=="number"&&typeof s=="number"&&(o=s-r),typeof o<"u"&&o>e&&(e=o)}),typeof e=="bigint"&&et?Math.round(t)>e+Su:!1,cJ=(t,e)=>{if(e!=="hls")return null;const n=uJ({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!n)return null;const i=t.playlist.targetDuration,r=O2({segmentDuration:n,maxDuration:i*2}),s=O2({segmentDuration:n,maxDuration:i}),o=`Segment with index ${t.mediaIndex} from playlist ${t.playlist.id} has a duration of ${n} when the reported duration is ${t.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:o}:null},fh=({type:t,segment:e})=>{if(!e)return;const n=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:t||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:n,isMediaInitialization:i}};class kT extends st.EventTarget{constructor(e,n={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=tl(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():gd(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(Kr({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():gd(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(Kr({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():gd(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():gd(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return TT.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&Oe.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,Oe.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&TT.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return bo();if(this.loaderType_==="main"){const{hasAudio:n,hasVideo:i,isMuxed:r}=e;if(i&&n&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,n=!1){if(!e)return null;const i=lb(e);let r=this.initSegments_[i];return n&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,n=!1){if(!e)return null;const i=s2(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&n&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,n={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=n,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: currentTime: ${this.currentTime_()} bufferedEnd: ${cT(this.buffered_())} `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const o=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${o}]`),this.mediaIndex!==null)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const d=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=d}}r&&(r.mediaIndex-=o,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(Oe.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&TT.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,n,i=()=>{},r=!1){if(n===1/0&&(n=this.duration_()),n<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let s=1;const o=()=>{s--,s===0&&i()};(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,n,o)),(r||this.loaderType_==="main")&&(this.gopBuffer_=eJ(this.gopBuffer_,e,n,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,n,o));for(const u in this.inbandTextTracks_)ng(e,n,this.inbandTextTracks_[u]);ng(e,n,this.segmentMetadataTrack_),o()}monitorBuffer_(){this.checkBufferTimeout_&&Oe.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Oe.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&Oe.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Oe.setTimeout(this.monitorBufferTick_.bind(this),iJ)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const n={segmentInfo:fh({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:n}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,n=this.playlist_,i=this.partIndex){if(!n||!this.mediaSource_)return!1;const r=typeof e=="number"&&n.segments[e],s=e+1===n.segments.length,o=!r||!r.parts||i+1===r.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&s&&o}chooseNextRequest_(){const e=this.buffered_(),n=cT(e)||0,i=dT(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),o=this.playlist_.segments;if(!o.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=nJ(this.currentTimeline_,o,n),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const w=o[this.mediaIndex],C=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=w.end?w.end:n,w.parts&&w.parts[C+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=C+1):u.mediaIndex=this.mediaIndex+1}else{let w,C,D;const P=this.fetchAtBuffer_?n:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: For TargetTime: ${P}. CurrentTime: ${this.currentTime_()} BufferedEnd: ${n} Fetch At Buffer: ${this.fetchAtBuffer_} `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const M=this.getSyncInfoFromMediaSequenceSync_(P);if(!M){const F="No sync info found while using media sequence sync";return this.error({message:F,metadata:{errorType:st.Error.StreamingFailedToSelectNextSegment,error:new Error(F)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${M.start} --> ${M.end})`),w=M.segmentIndex,C=M.partIndex,D=M.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const M=ua.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:P,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=M.segmentIndex,C=M.partIndex,D=M.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${P}`:`currentTime ${P}`,u.mediaIndex=w,u.startOfSegment=D,u.partIndex=C,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const d=o[u.mediaIndex];let h=d&&typeof u.partIndex=="number"&&d.parts&&d.parts[u.partIndex];if(!d||typeof u.partIndex=="number"&&!h)return null;typeof u.partIndex!="number"&&d.parts&&(u.partIndex=0,h=d.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&h&&!g&&!h.independent)if(u.partIndex===0){const w=o[u.mediaIndex-1],C=w.parts&&w.parts.length&&w.parts[w.parts.length-1];C&&C.independent&&(u.mediaIndex-=1,u.partIndex=w.parts.length-1,u.independent="previous segment")}else d.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=o.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const n=Math.max(e,this.mediaSequenceSync_.start);e!==n&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${n}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(n);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:n,playlist:i,mediaIndex:r,startOfSegment:s,isSyncRequest:o,partIndex:u,forceTimestampOffset:d,getMediaInfoForTime:h}=e,g=i.segments[r],y=typeof u=="number"&&g.parts[u],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?u:null,isSyncRequest:o,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:n},C=typeof d<"u"?d:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:C});const D=cT(this.sourceUpdater_.audioBuffered());return typeof D=="number"&&(w.audioAppendStart=D-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=JQ(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return oJ(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const n=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,s=ua.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),o=IZ(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(s<=o)return;const u=zQ({main:this.vhs_.playlists.main,currentTime:n,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const d=s-o-u.rebufferingImpact;let h=.5;o<=Su&&(h=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||d{r[s.stream]=r[s.stream]||{startTime:1/0,captions:[],endTime:0};const o=r[s.stream];o.startTime=Math.min(o.startTime,s.startTime+i),o.endTime=Math.max(o.endTime,s.endTime+i),o.captions.push(s)}),Object.keys(r).forEach(s=>{const{startTime:o,endTime:u,captions:d}=r[s],h=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${u} for ${s}`),WQ(h,this.vhs_.tech_,s),ng(o,u,h[s]),qQ({captionArray:d,inbandTextTracks:h,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,n,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,n,i));return}this.addMetadataToTextTrack(i,n,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(n=>n())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(n=>n())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!AT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!e||!n)return!1;const{hasAudio:i,hasVideo:r,isMuxed:s}=n;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||AT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){gd(this),this.callQueue_.push(this.handleData_.bind(this,e,n));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[I2(n.type)].start;else{const r=this.getCurrentMediaInfo_(),s=this.loaderType_==="main"&&r&&r.hasVideo;let o;s&&(o=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:o,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,n.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,n)}}updateAppendInitSegmentStatus(e,n){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==e.playlist&&(this.appendInitSegment_[n]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:n,map:i,playlist:r}){if(i){const s=lb(i);if(this.activeInitSegmentId_===s)return null;n=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=s}return n&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,n):null}handleQuotaExceededError_({segmentInfo:e,type:n,bytes:i},r){const s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+hh(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+hh(o).join(", "));const u=s.length?s.start(0):0,d=s.length?s.end(s.length-1):0,h=o.length?o.start(0):0,g=o.length?o.end(o.length-1):0;if(d-u<=ig&&g-h<=ig){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${hh(s).join(", ")}, video buffer: ${hh(o).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:n,bytes:i}));const y=this.currentTime_()-ig;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ig}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=Oe.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},ig*1e3)},!0)}handleAppendError_({segmentInfo:e,type:n,bytes:i},r){if(r){if(r.code===XR){this.handleQuotaExceededError_({segmentInfo:e,type:n,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${n} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:st.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r,bytes:s}){if(!s){const u=[r];let d=r.byteLength;i&&(u.unshift(i),d+=i.byteLength),s=VQ({bytes:d,segments:u})}const o={segmentInfo:fh({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:o}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:n,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:n,bytes:s}))}handleSegmentTimingInfo_(e,n,i){if(!this.pendingSegment_||n!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[s].transmuxedPresentationStart=i.start.presentation,r[s].transmuxedDecodeStart=i.start.decode,r[s].transmuxedPresentationEnd=i.end.presentation,r[s].transmuxedDecodeEnd=i.end.decode,r[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,n){const{type:i,data:r}=n;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:i,initSegment:n.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){gd(this),this.loadQueue_.push(()=>{const n=Kr({},e,{forceTimestampOffset:!0});Kr(e,this.generateSegmentInfo_(n)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const n=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,s=e.timeline!==this.currentTimeline_&&e.timeline>0,o=i||r&&s;this.logger_(`Requesting ${k2(e.uri)} ${Hp(e)}`),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=BQ({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:o,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:u,level:d,stream:h})=>{this.logger_(`${Hp(e)} logged from transmuxer stream ${h} as a ${d}: ${u}`)},triggerSegmentEventFn:({type:u,segment:d,keyInfo:h,trackInfo:g,timingInfo:y})=>{const w={segmentInfo:fh({segment:d})};h&&(w.keyInfo=h),g&&(w.trackInfo=g),y&&(w.timingInfo=y),this.trigger({type:u,metadata:w})}})}trimBackBuffer_(e){const n=sJ(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)}createSimplifiedSegmentObj_(e){const n=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,o={resolvedUri:i?i.resolvedUri:n.resolvedUri,byterange:i?i.byterange:n.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===n.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),n.key){const d=n.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=d}return n.map&&(o.map=this.initSegmentForMap(n.map)),o}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,n){if(this.pendingSegment_.byteLength=n.bytesReceived,e"u"||h.end!==r+s?r:u.start}waitForAppendsToComplete_(e){const n=this.getCurrentMediaInfo_(e);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:r,isMuxed:s}=n,o=this.loaderType_==="main"&&r,u=!this.audioDisabled_&&i&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}o&&e.waitingOnAppends++,u&&e.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const n=rJ(this.loaderType_,this.getCurrentMediaInfo_(),e);return n?(this.error({message:n,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let n=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),n=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:n,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const n=this.getMediaInfo_(),i=this.loaderType_==="main"&&n&&n.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end=typeof i.end=="number"?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:fh({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const n=cJ(e,this.sourceType_);if(n&&(n.severity==="warn"?st.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Hp(e)}`);return}this.logger_(`Appended ${Hp(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,r=e.part,s=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,o=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(s||o){this.logger_(`bad ${s?"segment":"part"} ${Hp(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},dJ=["video","audio"],PT=(t,e)=>{const n=e[`${t}Buffer`];return n&&n.updating||e.queuePending[t]},hJ=(t,e)=>{for(let n=0;n{if(e.queue.length===0)return;let n=0,i=e.queue[n];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),zp("audio",e),zp("video",e));return}if(t!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||PT(t,e))){if(i.type!==t){if(n=hJ(t,e.queue),n===null)return;i=e.queue[n]}if(e.queue.splice(n,1),e.queuePending[t]=i,i.action(t,e),!i.doneFn){e.queuePending[t]=null,zp(t,e);return}}},L2=(t,e)=>{const n=e[`${t}Buffer`],i=R2(t);n&&(n.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),n.removeEventListener("error",e[`on${i}Error_`]),e.codecs[t]=null,e[`${t}Buffer`]=null)},xu=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1,Ca={appendBuffer:(t,e,n)=>(i,r)=>{const s=r[`${i}Buffer`];if(xu(r.mediaSource,s)){r.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${i}Buffer`);try{s.appendBuffer(t)}catch(o){r.logger_(`Error with code ${o.code} `+(o.code===XR?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,n(o)}}},remove:(t,e)=>(n,i)=>{const r=i[`${n}Buffer`];if(xu(i.mediaSource,r)){i.logger_(`Removing ${t} to ${e} from ${n}Buffer`);try{r.remove(t,e)}catch{i.logger_(`Remove ${t} to ${e} from ${n}Buffer failed`)}}},timestampOffset:t=>(e,n)=>{const i=n[`${e}Buffer`];xu(n.mediaSource,i)&&(n.logger_(`Setting ${e}timestampOffset to ${t}`),i.timestampOffset=t)},callback:t=>(e,n)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(n){st.log.warn("Failed to call media source endOfStream",n)}}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(n){st.log.warn("Failed to set media source duration",n)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open")return;const n=e[`${t}Buffer`];if(xu(e.mediaSource,n)){e.logger_(`calling abort on ${t}Buffer`);try{n.abort()}catch(i){st.log.warn(`Failed to abort on ${t}Buffer`,i)}}},addSourceBuffer:(t,e)=>n=>{const i=R2(t),r=np(e);n.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const s=n.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",n[`on${i}UpdateEnd_`]),s.addEventListener("error",n[`on${i}Error_`]),n.codecs[t]=e,n[`${t}Buffer`]=s},removeSourceBuffer:t=>e=>{const n=e[`${t}Buffer`];if(L2(t,e),!!xu(e.mediaSource,n)){e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(n)}catch(i){st.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,i)}}},changeType:t=>(e,n)=>{const i=n[`${e}Buffer`],r=np(t);if(!xu(n.mediaSource,i))return;const s=t.substring(0,t.indexOf(".")),o=n.codecs[e];if(o.substring(0,o.indexOf("."))===s)return;const u={codecsChangeInfo:{from:o,to:t}};n.trigger({type:"codecschange",metadata:u}),n.logger_(`changing ${e}Buffer codec from ${o} to ${t}`);try{i.changeType(r),n.codecs[e]=t}catch(d){u.errorType=st.Error.StreamingCodecsChangeError,u.error=d,d.metadata=u,n.error_=d,n.trigger("error"),st.log.warn(`Failed to changeType on ${e}Buffer`,d)}}},Aa=({type:t,sourceUpdater:e,action:n,doneFn:i,name:r})=>{e.queue.push({type:t,action:n,doneFn:i,name:r}),zp(t,e)},M2=(t,e)=>n=>{const i=e[`${t}Buffered`](),r=kZ(i);if(e.logger_(`received "updateend" event for ${t} Source Buffer: `,r),e.queuePending[t]){const s=e.queuePending[t].doneFn;e.queuePending[t]=null,s&&s(e[`${t}Error_`])}zp(t,e)};class N2 extends st.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>zp("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=tl("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=M2("video",this),this.onAudioUpdateEnd_=M2("audio",this),this.onVideoError_=n=>{this.videoError_=n},this.onAudioError_=n=>{this.audioError_=n},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,n){Aa({type:"mediaSource",sourceUpdater:this,action:Ca.addSourceBuffer(e,n),name:"addSourceBuffer"})}abort(e){Aa({type:e,sourceUpdater:this,action:Ca.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){st.log.error("removeSourceBuffer is not supported!");return}Aa({type:"mediaSource",sourceUpdater:this,action:Ca.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!st.browser.IS_FIREFOX&&Oe.MediaSource&&Oe.MediaSource.prototype&&typeof Oe.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return Oe.SourceBuffer&&Oe.SourceBuffer.prototype&&typeof Oe.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,n){if(!this.canChangeType()){st.log.error("changeType is not supported!");return}Aa({type:e,sourceUpdater:this,action:Ca.changeType(n),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(n=>{const i=e[n];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(n,i);this.canChangeType()&&this.changeType(n,i)})}appendBuffer(e,n){const{segmentInfo:i,type:r,bytes:s}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,n]),this.logger_(`delayed audio append of ${s.length} until video append`);return}const o=n;if(Aa({type:r,sourceUpdater:this,action:Ca.appendBuffer(s,i||{mediaIndex:-1},o),doneFn:n,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(d=>{this.appendBuffer.apply(this,d)})}}audioBuffered(){return xu(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:bo()}videoBuffered(){return xu(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:bo()}buffered(){const e=xu(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=xu(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!e?this.audioBuffered():e&&!n?this.videoBuffered():DZ(this.audioBuffered(),this.videoBuffered())}setDuration(e,n=gc){Aa({type:"mediaSource",sourceUpdater:this,action:Ca.duration(e),name:"duration",doneFn:n})}endOfStream(e=null,n=gc){typeof e!="string"&&(e=void 0),Aa({type:"mediaSource",sourceUpdater:this,action:Ca.endOfStream(e),name:"endOfStream",doneFn:n})}removeAudio(e,n,i=gc){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Aa({type:"audio",sourceUpdater:this,action:Ca.remove(e,n),doneFn:i,name:"remove"})}removeVideo(e,n,i=gc){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Aa({type:"video",sourceUpdater:this,action:Ca.remove(e,n),doneFn:i,name:"remove"})}updating(){return!!(PT("audio",this)||PT("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Aa({type:"audio",sourceUpdater:this,action:Ca.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Aa({type:"video",sourceUpdater:this,action:Ca.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Aa({type:"audio",sourceUpdater:this,action:Ca.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Aa({type:"video",sourceUpdater:this,action:Ca.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),dJ.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>L2(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const F2=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t))),pJ=t=>{const e=new Uint8Array(t);return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")},B2=new Uint8Array(` `.split("").map(t=>t.charCodeAt(0)));class fJ extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class mJ extends kT{constructor(e,n={}){super(e,n),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return bo();const e=this.subtitlesTrack_.cues,n=e[0].startTime,i=e[e.length-1].startTime;return bo([[n,i]])}initSegmentForMap(e,n=!1){if(!e)return null;const i=lb(e);let r=this.initSegments_[i];if(n&&!r&&e.bytes){const s=B2.byteLength+e.bytes.byteLength,o=new Uint8Array(s);o.set(e.bytes),o.set(B2,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:o}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,n){ng(e,n,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const n=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",n),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,n,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Eu.TIMEOUT&&this.handleTimeout_(),e.code===Eu.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,s=i.mp4VttCues&&i.mp4VttCues.length;s&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");const o=r.segment;if(o.map&&(o.map.bytes=n.map.bytes),r.bytes=n.bytes,typeof Oe.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,n,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}o.requested=!0;try{this.parseVTTCues_(r)}catch(u){this.stopForError({message:u.message,metadata:{errorType:st.Error.StreamingVttParserError,error:u}});return}if(s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,r.cues.forEach(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Oe.VTTCue(u.startTime,u.endTime,u.text):u)}),QQ(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,n){const i=e&&e.type==="vtt",r=n&&n.type==="text";i&&r&&super.handleData_(e,n)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const n=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const r=i.start+n,s=i.end+n,o=new Oe.VTTCue(r,s,i.cueText);i.settings&&i.settings.split(" ").forEach(u=>{const d=u.split(":"),h=d[0],g=d[1];o[h]=isNaN(g)?g:Number(g)}),e.cues.push(o)})}parseVTTCues_(e){let n,i=!1;if(typeof Oe.WebVTT!="function")throw new fJ;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof Oe.TextDecoder=="function"?n=new Oe.TextDecoder("utf8"):(n=Oe.WebVTT.StringDecoder(),i=!0);const r=new Oe.WebVTT.Parser(Oe,Oe.vttjs,n);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=o=>{e.timestampmap=o},r.onparsingerror=o=>{st.log.warn("Error encountered when parsing cues: "+o.message)},e.segment.map){let o=e.segment.map.bytes;i&&(o=F2(o)),r.parse(o)}let s=e.bytes;i&&(s=F2(s)),r.parse(s),r.flush()}updateTimeMapping_(e,n,i){const r=e.segment;if(!n)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:s,LOCAL:o}=e.timestampmap,u=s/sh.ONE_SECOND_IN_TS-o+n.mapping;if(e.cues.forEach(d=>{const h=d.endTime-d.startTime,g=this.handleRollover_(d.startTime+u,n.time);d.startTime=Math.max(g,0),d.endTime=Math.max(g+h,0)}),!i.syncInfo){const d=e.cues[0].startTime,h=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(d,h-r.duration)}}}handleRollover_(e,n){if(n===null)return e;let i=e*sh.ONE_SECOND_IN_TS;const r=n*sh.ONE_SECOND_IN_TS;let s;for(r4294967296;)i+=s;return i/sh.ONE_SECOND_IN_TS}}const gJ=function(t,e){const n=t.cues;for(let i=0;i=r.adStartTime&&e<=r.adEndTime)return r}return null},yJ=function(t,e,n=0){if(!t.segments)return;let i=n,r;for(let s=0;s=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class H2{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,n){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),!!this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,n))}getSyncInfoForTime(e){for(const{segmentSyncInfo:n,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(n.isInRange(e))return n;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,n,i){const r=new Map;let s=` `,o=i,u=n;this.start_=o,e.forEach((d,h)=>{const g=this.storage_.get(u),y=o,w=y+d.duration,C=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),D=new U2({start:y,end:w,appended:C,segmentIndex:h});d.syncInfo=D;let P=o;const M=(d.parts||[]).map((F,K)=>{const $=P,ee=P+F.duration,he=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[K]&&g.partsSyncInfo[K].isAppended),ve=new U2({start:$,end:ee,appended:he,segmentIndex:h,partIndex:K});return P=ee,s+=`Media Sequence: ${u}.${K} | Range: ${$} --> ${ee} | Appended: ${he} `,F.syncInfo=ve,ve});r.set(u,new vJ(D,M)),s+=`${k2(d.resolvedUri)} | Media Sequence: ${u} | Range: ${y} --> ${w} | Appended: ${C} `,u++,o=w}),this.end_=o,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,n,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(en!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(t,e,n,i,r,s)=>{const o=t.getMediaSequenceSync(s);if(!o||!o.isReliable)return null;const u=o.getSyncInfoForTime(r);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,n,i,r)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let s=null,o=null;const u=pT(e);r=r||0;for(let d=0;d{let s=null,o=null;r=r||0;const u=pT(e);for(let d=0;d=C)&&(o=C,s={time:w,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return s}},{name:"Discontinuity",run:(t,e,n,i,r)=>{let s=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let o=null;for(let u=0;u=y)&&(o=y,s={time:g.time,segmentIndex:d,partIndex:null})}}}return s}},{name:"Playlist",run:(t,e,n,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class wJ extends st.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const n=new H2,i=new z2(n),r=new z2(n);this.mediaSequenceStorage_={main:n,audio:i,vtt:r},this.logger_=tl("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,n,i,r,s){if(n!==1/0)return DT.find(({name:u})=>u==="VOD").run(this,e,n);const o=this.runStrategies_(e,n,i,r,s);if(!o.length)return null;for(const u of o){const{syncPoint:d,strategy:h}=u,{segmentIndex:g,time:y}=d;if(g<0)continue;const w=e.segments[g],C=y,D=C+w.duration;if(this.logger_(`Strategy: ${h}. Current time: ${r}. selected segment: ${g}. Time: [${C} -> ${D}]}`),r>=C&&r0&&(r.time*=-1),Math.abs(r.time+Jm({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,n,i,r,s){const o=[];for(let u=0;ubJ){st.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-1;r>=0;r--){const s=e.segments[r];if(s&&typeof s.start<"u"){n.syncInfo={mediaSequence:e.mediaSequence+r,time:s.start},this.logger_(`playlist refresh sync: [time:${n.syncInfo.time}, mediaSequence: ${n.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const n=e.segments[0],i=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:n}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,n),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const s=r.dateTimeObject;r.discontinuity&&n&&s&&(this.timelineToDatetimeMappings[r.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,n,i){const r=e.segment,s=e.part;let o=this.timelines[e.timeline],u,d;if(typeof e.timestampOffset=="number")o={time:e.startOfSegment,mapping:e.startOfSegment-n.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),u=e.startOfSegment,d=n.end+o.mapping;else if(o)u=n.start+o.mapping,d=n.end+o.mapping;else return!1;return s&&(s.start=u,s.end=d),(!r.start||ud){let h;u<0?h=i.start-Jm({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex,endIndex:s}):h=i.end+Jm({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[o]={time:h,accuracy:d}}}}dispose(){this.trigger("dispose"),this.off()}}class _J extends st.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:n,to:i}){return typeof n=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:n,to:i}){if(typeof n=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:n,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:n,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const SJ=p2(f2(function(){var t=function(){function P(){this.listeners={}}var M=P.prototype;return M.on=function(F,K){this.listeners[F]||(this.listeners[F]=[]),this.listeners[F].push(K)},M.off=function(F,K){if(!this.listeners[F])return!1;var $=this.listeners[F].indexOf(K);return this.listeners[F]=this.listeners[F].slice(0),this.listeners[F].splice($,1),$>-1},M.trigger=function(F){var K=this.listeners[F];if(K)if(arguments.length===2)for(var $=K.length,ee=0;ee<$;++ee)K[ee].call(this,arguments[1]);else for(var he=Array.prototype.slice.call(arguments,1),ve=K.length,fe=0;fe>7)*283)^ee]=ee;for(he=ve=0;!K[he];he^=xe||1,ve=ae[ve]||1)for(et=ve^ve<<1^ve<<2^ve<<3^ve<<4,et=et>>8^et&255^99,K[he]=et,$[et]=he,ot=fe[Qe=fe[xe=fe[he]]],Wt=ot*16843009^Qe*65537^xe*257^he*16843008,pt=fe[et]*257^et*16843008,ee=0;ee<4;ee++)M[ee][he]=pt=pt<<24^pt>>>8,F[ee][et]=Wt=Wt<<24^Wt>>>8;for(ee=0;ee<5;ee++)M[ee]=M[ee].slice(0),F[ee]=F[ee].slice(0);return P};let i=null;class r{constructor(M){i||(i=n()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let F,K,$;const ee=this._tables[0][4],he=this._tables[1],ve=M.length;let fe=1;if(ve!==4&&ve!==6&&ve!==8)throw new Error("Invalid aes key size");const ae=M.slice(0),xe=[];for(this._key=[ae,xe],F=ve;F<4*ve+28;F++)$=ae[F-1],(F%ve===0||ve===8&&F%ve===4)&&($=ee[$>>>24]<<24^ee[$>>16&255]<<16^ee[$>>8&255]<<8^ee[$&255],F%ve===0&&($=$<<8^$>>>24^fe<<24,fe=fe<<1^(fe>>7)*283)),ae[F]=ae[F-ve]^$;for(K=0;F;K++,F--)$=ae[K&3?F:F-4],F<=4||K<4?xe[K]=$:xe[K]=he[0][ee[$>>>24]]^he[1][ee[$>>16&255]]^he[2][ee[$>>8&255]]^he[3][ee[$&255]]}decrypt(M,F,K,$,ee,he){const ve=this._key[1];let fe=M^ve[0],ae=$^ve[1],xe=K^ve[2],Qe=F^ve[3],ot,et,pt;const Wt=ve.length/4-2;let pn,Ut=4;const Xt=this._tables[1],cn=Xt[0],ai=Xt[1],Qt=Xt[2],xn=Xt[3],ii=Xt[4];for(pn=0;pn>>24]^ai[ae>>16&255]^Qt[xe>>8&255]^xn[Qe&255]^ve[Ut],et=cn[ae>>>24]^ai[xe>>16&255]^Qt[Qe>>8&255]^xn[fe&255]^ve[Ut+1],pt=cn[xe>>>24]^ai[Qe>>16&255]^Qt[fe>>8&255]^xn[ae&255]^ve[Ut+2],Qe=cn[Qe>>>24]^ai[fe>>16&255]^Qt[ae>>8&255]^xn[xe&255]^ve[Ut+3],Ut+=4,fe=ot,ae=et,xe=pt;for(pn=0;pn<4;pn++)ee[(3&-pn)+he]=ii[fe>>>24]<<24^ii[ae>>16&255]<<16^ii[xe>>8&255]<<8^ii[Qe&255]^ve[Ut++],ot=fe,fe=ae,ae=xe,xe=Qe,Qe=ot}}class s extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(M){this.jobs.push(M),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},u=function(P,M,F){const K=new Int32Array(P.buffer,P.byteOffset,P.byteLength>>2),$=new r(Array.prototype.slice.call(M)),ee=new Uint8Array(P.byteLength),he=new Int32Array(ee.buffer);let ve,fe,ae,xe,Qe,ot,et,pt,Wt;for(ve=F[0],fe=F[1],ae=F[2],xe=F[3],Wt=0;Wt{const K=P[F];w(K)?M[F]={bytes:K.buffer,byteOffset:K.byteOffset,byteLength:K.byteLength}:M[F]=K}),M};self.onmessage=function(P){const M=P.data,F=new Uint8Array(M.encrypted.bytes,M.encrypted.byteOffset,M.encrypted.byteLength),K=new Uint32Array(M.key.bytes,M.key.byteOffset,M.key.byteLength/4),$=new Uint32Array(M.iv.bytes,M.iv.byteOffset,M.iv.byteLength/4);new d(F,K,$,function(ee,he){self.postMessage(D({source:M.source,decrypted:he}),[he.buffer])})}}));var TJ=h2(SJ);const EJ=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},j2=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},IT=(t,e)=>{e.activePlaylistLoader=t,t.load()},xJ=(t,e)=>()=>{const{segmentLoaders:{[t]:n,main:i},mediaTypes:{[t]:r}}=e,s=r.activeTrack(),o=r.getActiveGroup(),u=r.activePlaylistLoader,d=r.lastGroup_;if(!(o&&d&&o.id===d.id)&&(r.lastGroup_=o,r.lastTrack_=s,j2(n,r),!(!o||o.isMainPlaylist))){if(!o.playlistLoader){u&&i.resetEverything();return}n.resyncLoader(),IT(o.playlistLoader,r)}},CJ=(t,e)=>()=>{const{segmentLoaders:{[t]:n},mediaTypes:{[t]:i}}=e;i.lastGroup_=null,n.abort(),n.pause()},AJ=(t,e)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[t]:i,main:r},mediaTypes:{[t]:s}}=e,o=s.activeTrack(),u=s.getActiveGroup(),d=s.activePlaylistLoader,h=s.lastTrack_;if(!(h&&o&&h.id===o.id)&&(s.lastGroup_=u,s.lastTrack_=o,j2(i,s),!!u)){if(u.isMainPlaylist){if(!o||!h||o.id===h.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();if(g.media()===y)return;s.logger_(`track change. Switching main audio from ${h.id} to ${o.id}`),n.pause(),r.resetEverything(),g.fastQualityChange_(y);return}if(t==="AUDIO"){if(!u.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(d===u.playlistLoader){IT(u.playlistLoader,s);return}i.track&&i.track(o),i.resetEverything(),IT(u.playlistLoader,s)}},db={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:n},excludePlaylist:i}=e,r=n.activeTrack(),s=n.activeGroup(),o=(s.filter(d=>d.default)[0]||s[0]).id,u=n.tracks[o];if(r===u){i({error:{message:"Problem encountered loading the default audio track."}});return}st.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const d in n.tracks)n.tracks[d].enabled=n.tracks[d]===u;n.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:n}}=e;st.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=n.activeTrack();i&&(i.mode="disabled"),n.onTrackChanged()}},V2={AUDIO:(t,e,n)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[t]:s}}=n;e.on("loadedmetadata",()=>{const o=e.media();s.playlist(o,r),(!i.paused()||o.endList&&i.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),i.paused()||s.load()}),e.on("error",db[t](t,n))},SUBTITLES:(t,e,n)=>{const{tech:i,requestOptions:r,segmentLoaders:{[t]:s},mediaTypes:{[t]:o}}=n;e.on("loadedmetadata",()=>{const u=e.media();s.playlist(u,r),s.track(o.activeTrack()),(!i.paused()||u.endList&&i.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),i.paused()||s.load()}),e.on("error",db[t](t,n))}},kJ={AUDIO:(t,e)=>{const{vhs:n,sourceType:i,segmentLoaders:{[t]:r},requestOptions:s,main:{mediaGroups:o},mediaTypes:{[t]:{groups:u,tracks:d,logger_:h}},mainPlaylistLoader:g}=e,y=$m(g.main);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},y&&(o[t].main.default.playlists=g.main.playlists));for(const w in o[t]){u[w]||(u[w]=[]);for(const C in o[t][w]){let D=o[t][w][C],P;if(y?(h(`AUDIO group '${w}' label '${C}' is a main playlist`),D.isMainPlaylist=!0,P=null):i==="vhs-json"&&D.playlists?P=new Np(D.playlists[0],n,s):D.resolvedUri?P=new Np(D.resolvedUri,n,s):D.playlists&&i==="dash"?P=new ST(D.playlists[0],n,s,g):P=null,D=Ki({id:C,playlistLoader:P},D),V2[t](t,D.playlistLoader,e),u[w].push(D),typeof d[C]>"u"){const M=new st.AudioTrack({id:C,kind:EJ(D),enabled:!1,language:D.language,default:D.default,label:C});d[C]=M}}}r.on("error",db[t](t,e))},SUBTITLES:(t,e)=>{const{tech:n,vhs:i,sourceType:r,segmentLoaders:{[t]:s},requestOptions:o,main:{mediaGroups:u},mediaTypes:{[t]:{groups:d,tracks:h}},mainPlaylistLoader:g}=e;for(const y in u[t]){d[y]||(d[y]=[]);for(const w in u[t][y]){if(!i.options_.useForcedSubtitles&&u[t][y][w].forced)continue;let C=u[t][y][w],D;if(r==="hls")D=new Np(C.resolvedUri,i,o);else if(r==="dash"){if(!C.playlists.filter(P=>P.excludeUntil!==1/0).length)return;D=new ST(C.playlists[0],i,o,g)}else r==="vhs-json"&&(D=new Np(C.playlists?C.playlists[0]:C.resolvedUri,i,o));if(C=Ki({id:w,playlistLoader:D},C),V2[t](t,C.playlistLoader,e),d[y].push(C),typeof h[w]>"u"){const P=n.addRemoteTextTrack({id:w,kind:"subtitles",default:C.default&&C.autoselect,language:C.language,label:w},!1).track;h[w]=P}}}s.on("error",db[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:n,main:{mediaGroups:i},mediaTypes:{[t]:{groups:r,tracks:s}}}=e;for(const o in i[t]){r[o]||(r[o]=[]);for(const u in i[t][o]){const d=i[t][o][u];if(!/^(?:CC|SERVICE)/.test(d.instreamId))continue;const h=n.options_.vhs&&n.options_.vhs.captionServices||{};let g={label:u,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(h[g.instreamId]&&(g=Ki(g,h[g.instreamId])),g.default===void 0&&delete g.default,r[o].push(Ki({id:u},d)),typeof s[u]>"u"){const y=n.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;s[u]=y}}}}},W2=(t,e)=>{for(let n=0;nn=>{const{mainPlaylistLoader:i,mediaTypes:{[t]:{groups:r}}}=e,s=i.media();if(!s)return null;let o=null;s.attributes[t]&&(o=r[s.attributes[t]]);const u=Object.keys(r);if(!o)if(t==="AUDIO"&&u.length>1&&$m(e.main))for(let d=0;d"u"?o:n===null||!o?null:o.filter(d=>d.id===n.id)[0]||null},DJ={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const i in n)if(n[i].enabled)return n[i];return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const i in n)if(n[i].mode==="showing"||n[i].mode==="hidden")return n[i];return null}},IJ=(t,{mediaTypes:e})=>()=>{const n=e[t].activeTrack();return n?e[t].activeGroup(n):null},OJ=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(h=>{kJ[h](h,t)});const{mediaTypes:e,mainPlaylistLoader:n,tech:i,vhs:r,segmentLoaders:{["AUDIO"]:s,main:o}}=t;["AUDIO","SUBTITLES"].forEach(h=>{e[h].activeGroup=PJ(h,t),e[h].activeTrack=DJ[h](h,t),e[h].onGroupChanged=xJ(h,t),e[h].onGroupChanging=CJ(h,t),e[h].onTrackChanged=AJ(h,t),e[h].getActiveGroup=IJ(h,t)});const u=e.AUDIO.activeGroup();if(u){const h=(u.filter(g=>g.default)[0]||u[0]).id;e.AUDIO.tracks[h].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanged())}),n.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanging())});const d=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",d),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",d),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const h in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[h])},RJ=()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:gc,activeTrack:gc,getActiveGroup:gc,onGroupChanged:gc,onTrackChanged:gc,lastTrack_:null,logger_:tl(`MediaGroups[${e}]`)}}),t};class q2{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=la(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(n=>[n.ID,n])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class LJ extends st.EventTarget{constructor(e,n){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new q2,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=tl("Content Steering"),this.xhr_=e,this.getBandwidth_=n}assignTagProperties(e,n){this.manifestType_=n.serverUri?"HLS":"DASH";const i=n.serverUri||n.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=la(e,i),this.defaultPathway=n.pathwayId||n.defaultServiceLocation,this.queryBeforeStart=n.queryBeforeStart,this.proxyServerUrl_=n.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const n=this.steeringManifest.reloadUri;if(!n)return;const i=e?n:this.getRequestURI(n);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(s,o)=>{if(s){if(o.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(o.status===429){const h=o.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${h} seconds.`),this.startTTLTimeout_(parseInt(h,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let u;try{u=JSON.parse(this.request_.responseText)}catch(h){const g={errorType:st.Error.StreamingContentSteeringParserError,error:h};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(u);const d={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:d}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const n=new Oe.URL(e),i=new Oe.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(n.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const n=JSON.parse(Oe.atob(e));this.assignSteeringProperties_(n)}setSteeringParams_(e){const n=new Oe.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const s=`_${this.manifestType_}_pathway`;n.searchParams.set(s,i)}if(r){const s=`_${this.manifestType_}_throughput`;n.searchParams.set(s,r)}return n.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const n=(i=>{for(const r of i)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const n=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!n(r))return r}const i=this.setSteeringParams_(e);return n(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const n=e*1e3;this.ttlTimeout_=Oe.setTimeout(()=>{this.requestSteeringManifest()},n)}clearTTLTimeout_(){Oe.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new q2}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,n){return!n&&this.steeringManifest.reloadUri||n&&(la(e,n.serverURL)!==this.steeringManifest.reloadUri||n.defaultServiceLocation!==this.defaultPathway||n.queryBeforeStart!==this.queryBeforeStart||n.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const MJ=(t,e)=>{let n=null;return(...i)=>{clearTimeout(n),n=setTimeout(()=>{t.apply(null,i)},e)}},NJ=10;let yd;const FJ=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],BJ=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},UJ=function({currentPlaylist:t,buffered:e,currentTime:n,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:o,bufferBasedABR:u,log:d}){if(!i)return st.log.warn("We received no playlist to switch to. Please check your stream."),!1;const h=`allowing switch ${t&&t.id||"null"} -> ${i.id}`;if(!t)return d(`${h} as current playlist is not set`),!0;if(i.id===t.id)return!1;const g=!!Rp(e,n).length;if(!t.endList)return!g&&typeof t.partTargetDuration=="number"?(d(`not ${h} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(d(`${h} as current playlist is live`),!0);const y=dT(e,n),w=u?Ms.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ms.MAX_BUFFER_LOW_WATER_LINE;if(oD)&&y>=r){let P=`${h} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return u&&(P+=` and next bandwidth > current bandwidth (${C} > ${D})`),d(P),!0}return d(`not ${h} as no switching criteria met`),!1};class HJ extends st.EventTarget{constructor(e){super(),this.fastQualityChange_=MJ(this.fastQualityChange_.bind(this),100);const{src:n,withCredentials:i,tech:r,bandwidth:s,externVhs:o,useCueTags:u,playlistExclusionDuration:d,enableLowInitialPlaylist:h,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:w,leastPixelDiffSelector:C,captionServices:D,experimentalUseMMS:P}=e;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:M}=e;(M===null||typeof M>"u")&&(M=1/0),yd=o,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!C,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=u,this.playlistExclusionDuration=d,this.maxPlaylistRetries=M,this.enableLowInitialPlaylist=h,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:M,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=RJ(),P&&Oe.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Oe.ManagedMediaSource,this.usingManagedMediaSource_=!0,st.log("Using ManagedMediaSource")):Oe.MediaSource&&(this.mediaSource=new Oe.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=bo(),this.hasPlayed_=!1,this.syncController_=new wJ(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new TJ,this.sourceUpdater_=new N2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new _J,this.keyStatusMap_=new Map;const F={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:D,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new ST(n,this.vhs_,Ki(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Np(n,this.vhs_,Ki(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new kT(Ki(F,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new kT(Ki(F,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new mJ(Ki(F,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((ee,he)=>{function ve(){r.off("vttjserror",fe),ee()}function fe(){r.off("vttjsloaded",ve),he()}r.one("vttjsloaded",ve),r.one("vttjserror",fe),r.addWebVttScript_()})}),e);const K=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new LJ(this.vhs_.xhr,K),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),FJ.forEach(ee=>{this[ee+"_"]=BJ.bind(this,ee)}),this.logger_=tl("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const $=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one($,()=>{const ee=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-ee,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return e===-1||n===-1?-1:e+n}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,e)}switchMedia_(e,n,i){const r=this.media(),s=r&&(r.id||r.uri),o=e&&(e.id||e.uri);if(s&&s!==o){this.logger_(`switch media ${s} -> ${o} from ${n}`);const u={renditionInfo:{id:o,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:n};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${n}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const n=this.mediaTypes_[e],i=n?n.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const s=(i.length?i[0].playlists:i.playlists).filter(o=>o.attributes.serviceLocation===r);s.length&&this.mediaTypes_[e].activePlaylistLoader.media(s[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Oe.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Oe.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),n=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return n;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const u=i.main||r.length&&i[r[0]];for(const d in u)if(u[d].default){s={label:d};break}}if(!s)return n;const o=[];for(const u in i)if(i[u][s.label]){const d=i[u][s.label];if(d.playlists&&d.playlists.length)o.push.apply(o,d.playlists);else if(d.uri)o.push(d);else if(e.playlists.length)for(let h=0;h{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;mT(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),OJ({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;mT(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,n=>{this.player_.trigger(Kr({},n))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,n){const i=e.mediaGroups||{};let r=!0;const s=Object.keys(i.AUDIO);for(const o in i.AUDIO)for(const u in i.AUDIO[o])i.AUDIO[o][u].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),yd.Playlist.isAes(n)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const n=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),o=this.tech_.buffered();return UJ({buffered:o,currentTime:i,currentPlaylist:n,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const n=this.audioSegmentLoader_.pendingSegment_;if(!n||!n.segment||!n.segment.syncInfo)return;const i=n.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:NJ}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(n=>{this.mainSegmentLoader_.on(n,i=>{this.player_.trigger(Kr({},i))}),this.audioSegmentLoader_.on(n,i=>{this.player_.trigger(Kr({},i))}),this.subtitleSegmentLoader_.on(n,i=>{this.player_.trigger(Kr({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const n=this.duration();e[e.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;const i=yd.Playlist.playlistEnd(e,n),r=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-r<=Tu;const o=s.end(s.length-1);return o-r<=Tu&&i-o<=Tu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:n={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||n.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=n,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(ab),o=s.length===1&&s[0]===e;if(r.length===1&&i!==1/0)return st.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(o);if(o){if(this.main().contentSteering){const D=this.pathwayAttribute_(e),P=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(D),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(D)},P);return}let C=!1;r.forEach(D=>{if(D===e)return;const P=D.excludeUntil;typeof P<"u"&&P!==1/0&&(C=!0,delete D.excludeUntil)}),C&&(st.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+i*1e3,e.excludeUntil=u,n.reason&&(e.lastExcludeReason_=n.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const d=this.selectPlaylist();if(!d){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const h=n.internal?this.logger_:st.log.warn,g=n.message?" "+n.message:"";h(`${n.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${d.id}.`),d.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=d.targetDuration/2*1e3||5*1e3,w=typeof d.lastRequest=="number"&&Date.now()-d.lastRequest<=y;return this.switchMedia_(d,"exclude",o||w)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,n){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const s=[];(r||e==="audio")&&s.push("AUDIO"),(r||e==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(o=>{const u=this.mediaTypes_[o]&&this.mediaTypes_[o].activePlaylistLoader;u&&i.push(u)}),["main","audio","subtitle"].forEach(o=>{const u=this[`${o}SegmentLoader_`];u&&(e===o||e==="all")&&i.push(u)}),i.forEach(o=>n.forEach(u=>{typeof o[u]=="function"&&o[u]()}))}setCurrentTime(e){const n=Rp(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(n&&n.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:yd.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,n){const i=e.media();if(!i)return null;const r=this.syncController_.getMediaSequenceSync(n);if(r&&r.isReliable){const u=r.start,d=r.end;if(!isFinite(u)||!isFinite(d))return null;const h=yd.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),g=Math.max(u,d-h);return bo([[u,g]])}const s=this.syncController_.getExpiredTime(i,this.duration());if(s===null)return null;const o=yd.Playlist.seekable(i,s,yd.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return o.length?o:null}computeFinalSeekable_(e,n){if(!n)return e;const i=e.start(0),r=e.end(0),s=n.start(0),o=n.end(0);return s>r||i>o?e:bo([[Math.max(i,s),Math.min(r,o)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let n;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!n))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,n),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${LR(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const n=this.mediaTypes_[e].groups;for(const i in n)n[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=tg(this.main(),n),r={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||lK),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||DD}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||DD,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:n,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const o=(h,g)=>h?xm(g,this.usingManagedMediaSource_):K_(g),u={};let d;if(["video","audio"].forEach(function(h){if(r.hasOwnProperty(h)&&!o(e[h].isFmp4,r[h])){const g=e[h].isFmp4?"browser":"muxer";u[g]=u[g]||[],u[g].push(r[h]),h==="audio"&&(d=g)}}),s&&d&&n.attributes.AUDIO){const h=n.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===h&&g!==n&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${h} as ${d} does not support codec(s): "${r.audio}"`)}if(Object.keys(u).length){const h=Object.keys(u).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${u[y].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:n,error:{internal:!0,message:h},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const h=[];if(["video","audio"].forEach(g=>{const y=(fu(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(fu(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.toLowerCase()&&h.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),h.length){this.excludePlaylist({playlistToExclude:n,error:{message:`Codec switching not supported: ${h.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const n=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}excludeUnsupportedVariants_(){const e=this.main().playlists,n=[];Object.keys(e).forEach(i=>{const r=e[i];if(n.indexOf(r.id)!==-1)return;n.push(r.id);const s=tg(this.main,r),o=[];s.audio&&!K_(s.audio)&&!xm(s.audio,this.usingManagedMediaSource_)&&o.push(`audio codec ${s.audio}`),s.video&&!K_(s.video)&&!xm(s.video,this.usingManagedMediaSource_)&&o.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&o.push(`text codec ${s.text}`),o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${o.join(", ")}`))})}excludeIncompatibleVariants_(e){const n=[],i=this.main().playlists,r=eg(fu(e)),s=JR(r),o=r.video&&fu(r.video)[0]||null,u=r.audio&&fu(r.audio)[0]||null;Object.keys(i).forEach(d=>{const h=i[d];if(n.indexOf(h.id)!==-1||h.excludeUntil===1/0)return;n.push(h.id);const g=[],y=tg(this.mainPlaylistLoader_.main,h),w=JR(y);if(!(!y.audio&&!y.video)){if(w!==s&&g.push(`codec count "${w}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const C=y.video&&fu(y.video)[0]||null,D=y.audio&&fu(y.audio)[0]||null;C&&o&&C.type.toLowerCase()!==o.type.toLowerCase()&&g.push(`video codec "${C.type}" !== "${o.type}"`),D&&u&&D.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${D.type}" !== "${u.type}"`)}g.length&&(h.excludeUntil=1/0,this.logger_(`excluding ${h.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let n=0;const i=this.seekable();i.length&&(n=i.start(0)),yJ(e,this.cueTagsTrack_,n)}goalBufferLength(){const e=this.tech_.currentTime(),n=Ms.GOAL_BUFFER_LENGTH,i=Ms.GOAL_BUFFER_LENGTH_RATE,r=Math.max(n,Ms.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),n=Ms.BUFFER_LOW_WATER_LINE,i=Ms.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(n,Ms.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(n,Ms.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+e*i,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return Ms.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){P2(this.inbandTextTracks_,"com.apple.streaming",this.tech_),ZQ({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,n,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();P2(this.inbandTextTracks_,e,this.tech_),KQ({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const n of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(n));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,n=>{this.trigger(Kr({},n))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),i=[];for(const r of e.playlists){const s=r.attributes.serviceLocation;if(s&&(i.push(s),!n.has(s)))return!0}return!!(!i.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const n=this.main().playlists,i=new Set;let r=!1;Object.keys(n).forEach(s=>{const o=n[s],u=this.pathwayAttribute_(o),d=u&&e!==u;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!d&&(delete o.excludeUntil,delete o.lastExcludeReason_,r=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!i.has(o.id)&&d&&h&&(i.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(s=>{const o=this.mediaTypes_[s];if(o.activePlaylistLoader){const u=o.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||i&&i.size){for(const[r,s]of n.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(s),this.contentSteeringController_.excludePathway(r));for(const[r,s]of i.entries()){const o=n.get(r);if(!o){e.filter(u=>u.attributes["PATHWAY-ID"]===s["BASE-ID"]).forEach(u=>{this.mainPlaylistLoader_.addClonePathway(s,u)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(o,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,n){if(e["BASE-ID"]!==n["BASE-ID"]||e.ID!==n.ID||e["URI-REPLACEMENT"].HOST!==n["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=n["URI-REPLACEMENT"].PARAMS;for(const s in i)if(i[s]!==r[s])return!1;for(const s in r)if(i[s]!==r[s])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const n="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);!r||!r.size||r.forEach(s=>{const o="usable",u=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===o,d=i.lastExcludeReason_===n&&i.excludeUntil===1/0;u?u&&d&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${o}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==n&&(i.excludeUntil=1/0,i.lastExcludeReason_=n,this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${o}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,s=i.excludeUntil===1/0&&i.lastExcludeReason_===n;r&&s&&(delete i.excludeUntil,st.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${n} key IDs`))})}addKeyStatus_(e,n){const i=(typeof e=="string"?e:pJ(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${n}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,n)}updatePlaylistByKeyStatus(e,n){this.addKeyStatus_(e,n),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const zJ=(t,e,n)=>i=>{const r=t.main.playlists[e],s=fT(r),o=ab(r);if(typeof i>"u")return o;i?delete r.disabled:r.disabled=!0;const u={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i!==o&&!s&&(i?(n(r),t.trigger({type:"renditionenabled",metadata:u})):t.trigger({type:"renditiondisabled",metadata:u})),i};class jJ{constructor(e,n,i){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(n.attributes){const o=n.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=n.attributes.BANDWIDTH,this.frameRate=n.attributes["FRAME-RATE"]}this.codecs=tg(r.main(),n),this.playlist=n,this.id=i,this.enabled=zJ(e.playlists,n.id,s)}}const VJ=function(t){t.representations=()=>{const e=t.playlistController_.main(),n=$m(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return n?n.filter(i=>!fT(i)).map((i,r)=>new jJ(t,i,i.id)):[]}},G2=["seeking","seeked","pause","playing","error"];class WJ extends st.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=tl("PlaybackWatcher"),this.logger_("initialize");const n=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),o=this.playlistController_,u=["main","subtitle","audio"],d={};u.forEach(g=>{d[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},o[`${g}SegmentLoader_`].on("appendsdone",d[g].updateend),o[`${g}SegmentLoader_`].on("playlistupdate",d[g].reset),this.tech_.on(["seeked","seeking"],d[g].reset)});const h=g=>{["main","audio"].forEach(y=>{o[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=()=>h("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(G2,s),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(G2,s),this.tech_.off("canplay",i),this.tech_.off("play",n),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(g=>{o[`${g}SegmentLoader_`].off("appendsdone",d[g].updateend),o[`${g}SegmentLoader_`].off("playlistupdate",d[g].reset),this.tech_.off(["seeked","seeking"],d[g].reset)}),this.checkCurrentTimeTimeout_&&Oe.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Oe.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Oe.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const n=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=n.buffered_()}checkSegmentDownloads_(e){const n=this.playlistController_,i=n[`${e}SegmentLoader_`],r=i.buffered_(),s=OZ(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){const o={bufferedRanges:r};n.trigger({type:"bufferedrangeschanged",metadata:o}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:hh(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&n.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),n=this.tech_.buffered();if(this.lastRecordedTime===e&&(!n.length||e+Tu>=n.end(n.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(bo([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),n=this.tech_.currentTime(),i=this.afterSeekableWindow_(e,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let r;if(i&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,n)){const C=e.start(0);r=C+(C===e.end(0)?0:Tu)}if(typeof r<"u")return this.logger_(`Trying to seek outside of seekable at time ${n} with seekable range ${LR(e)}. Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0;const s=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),u=s.audioBuffer?s.audioBuffered():null,d=s.videoBuffer?s.videoBuffered():null,h=this.media(),g=h.partTargetDuration?h.partTargetDuration:(h.targetDuration-Su)*2,y=[u,d];for(let C=0;C ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),n=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,n)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${n}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:n}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=ob(r,n);return s.length>0?(this.logger_(`Stopped at ${n} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(n),!0):!1}afterSeekableWindow_(e,n,i,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Tu;const o=!i.endList,u=typeof i.partTargetDuration=="number";return o&&(u||r)&&(s=e.end(e.length-1)+i.targetDuration*3),n>s}beforeSeekableWindow_(e,n){return!!(e.length&&e.start(0)>0&&n2)return{start:s,end:o}}return null}}const qJ={errorInterval:30,getSource(t){const e=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return t(e)}},K2=function(t,e){let n=0,i=0;const r=Ki(qJ,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){i&&t.currentTime(i)},o=function(g){g!=null&&(i=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(g),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},u=function(){if(Date.now()-n{Object.defineProperty(Br,t,{get(){return st.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Ms[t]},set(e){if(st.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){st.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}Ms[t]=e}})});const X2="videojs-vhs",Z2=function(t,e){const n=e.media();let i=-1;for(let r=0;r{t.addQualityLevel(n)}),Z2(t,e.playlists)};Br.canPlaySource=function(){return st.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const JJ=(t,e,n)=>{if(!t)return t;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=eg(fu(e.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);const r=np(i.video),s=np(i.audio),o={};for(const u in t)o[u]={},s&&(o[u].audioContentType=s),r&&(o[u].videoContentType=r),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(o[u].pssh=e.contentProtection[u].pssh),typeof t[u]=="string"&&(o[u].url=t[u]);return Ki(t,o)},$J=(t,e)=>t.reduce((n,i)=>{if(!i.contentProtection)return n;const r=e.reduce((s,o)=>{const u=i.contentProtection[o];return u&&u.pssh&&(s[o]={pssh:u.pssh}),s},{});return Object.keys(r).length&&n.push(r),n},[]),e$=({player:t,sourceKeySystems:e,audioMedia:n,mainPlaylists:i})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const r=n?i.concat([n]):i,s=$J(r,Object.keys(e)),o=[],u=[];return s.forEach(d=>{u.push(new Promise((h,g)=>{t.tech_.one("keysessioncreated",h)})),o.push(new Promise((h,g)=>{t.eme.initializeMediaKeys({keySystems:d},y=>{if(y){g(y);return}h()})}))}),Promise.race([Promise.all(o),Promise.race(u)])},t$=({player:t,sourceKeySystems:e,media:n,audioMedia:i})=>{const r=JJ(e,n,i);return r?(t.currentSource().keySystems=r,r&&!t.eme?(st.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Q2=()=>{if(!Oe.localStorage)return null;const t=Oe.localStorage.getItem(X2);if(!t)return null;try{return JSON.parse(t)}catch{return null}},n$=t=>{if(!Oe.localStorage)return!1;let e=Q2();e=e?Ki(e,t):t;try{Oe.localStorage.setItem(X2,JSON.stringify(e))}catch{return!1}return e},i$=t=>t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t,J2=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},$2=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},eL=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},tL=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};Br.supportsNativeHls=function(){if(!Vt||!Vt.createElement)return!1;const t=Vt.createElement("video");return st.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(t.canPlayType(e))}):!1}(),Br.supportsNativeDash=function(){return!Vt||!Vt.createElement||!st.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Vt.createElement("video").canPlayType("application/dash+xml"))}(),Br.supportsTypeNatively=t=>t==="hls"?Br.supportsNativeHls:t==="dash"?Br.supportsNativeDash:!1,Br.isSupported=function(){return st.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Br.xhr.onRequest=function(t){J2(Br.xhr,t)},Br.xhr.onResponse=function(t){$2(Br.xhr,t)},Br.xhr.offRequest=function(t){eL(Br.xhr,t)},Br.xhr.offResponse=function(t){tL(Br.xhr,t)};const r$=st.getComponent("Component");class nL extends r${constructor(e,n,i){if(super(n,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=tl("VhsHandler"),n.options_&&n.options_.playerId){const r=st.getPlayer(n.options_.playerId);this.player_=r}if(this.tech_=n,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Vt,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const s=Vt.fullscreenElement||Vt.webkitFullscreenElement||Vt.mozFullScreenElement||Vt.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ki(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=Q2();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ms.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ms.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const n=this.options_.customPixelRatio;typeof n=="number"&&n>=0&&(this.customPixelRatio=n)}setOptions(e={}){this.setOptions_(e)}src(e,n){if(!e)return;this.setOptions_(),this.options_.src=i$(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Br,this.options_.sourceType=ID(n),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new HJ(this.options_);const i=Ki({liveRangeSafeTimeDelta:Tu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new WJ(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=st.players[this.tech_.options_.playerId];let o=this.playlistController_.error;typeof o=="object"&&!o.code?o.code=3:typeof o=="string"&&(o={message:o,code:3}),s.error(o)});const r=this.options_.bufferBasedABR?Br.movingAverageBandwidthSelector(.55):Br.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Br.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const o=Oe.navigator.connection||Oe.navigator.mozConnection||Oe.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&o){const d=o.downlink*1e3*1e3;d>=u&&s>=u?s=Math.max(s,d):s=d}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let o;return this.throughput>0?o=1/this.throughput:o=0,Math.floor(1/(s+o))},set(){st.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>hh(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>hh(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&n$({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{VJ(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Oe.URL.createObjectURL(this.playlistController_.mediaSource),(st.browser.IS_ANY_SAFARI||st.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),e$({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(n=>{this.logger_("error while creating EME key session",n),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=t$({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!n){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=st.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{QJ(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Z2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Y2,"mux.js":KJ,"mpd-parser":YJ,"m3u8-parser":XJ,"aes-decrypter":ZJ}}version(){return this.constructor.version()}canChangeType(){return N2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Oe.URL.revokeObjectURL&&(Oe.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,n){return uQ({playlist:this.playlistController_.media(),time:e,callback:n})}seekToProgramTime(e,n,i=!0,r=2){return l2({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})}setupXhrHooks_(){this.xhr.onRequest=e=>{J2(this.xhr,e)},this.xhr.onResponse=e=>{$2(this.xhr,e)},this.xhr.offRequest=e=>{eL(this.xhr,e)},this.xhr.offResponse=e=>{tL(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],n=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,r=>{this.player_.trigger(Kr({},r))})}),n.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(Kr({},r))})})}}const hb={name:"videojs-http-streaming",VERSION:Y2,canHandleSource(t,e={}){const n=Ki(st.options,e);return!n.vhs.experimentalUseMMS&&!xm("avc1.4d400d,mp4a.40.2",!1)?!1:hb.canPlayType(t.type,n)},handleSource(t,e,n={}){const i=Ki(st.options,n);return e.vhs=new nL(t,e,i),e.vhs.xhr=i2(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const n=ID(t);if(!n)return"";const i=hb.getOverrideNative(e);return!Br.supportsTypeNatively(n)||i?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,n=!(st.browser.IS_ANY_SAFARI||st.browser.IS_IOS),{overrideNative:i=n}=e;return i}};xm("avc1.4d400d,mp4a.40.2",!0)&&st.getTech("Html5").registerSourceHandler(hb,0),st.VhsHandler=nL,st.VhsSourceHandler=hb,st.Vhs=Br,st.use||st.registerComponent("Vhs",Br),st.options.vhs=st.options.vhs||{},(!st.getPlugin||!st.getPlugin("reloadSourceOnError"))&&st.registerPlugin("reloadSourceOnError",GJ);const s$={name:"VideoPlayer",props:{options:{type:Object,default(){return{}}},fitHeight:{type:Boolean,default:!1}},data(){return{player:null}},mounted(){this.player=st(this.$refs.videoPlayer,this.options)},beforeDestroy(){this.player&&this.player.dispose()}};function o$(t,e,n,i,r,s){return G(),se("div",{class:Lt({"h-full":n.fitHeight})},[ue("video",{ref:"videoPlayer",class:Lt(["video-js w-full text-xl",{"h-full":n.fitHeight}])},null,2)],2)}const iL=pu(s$,[["render",o$]]),a$={name:"AudioViewer",components:{VideoPlayer:iL},props:{source:{type:String,required:!0},format:{type:String,required:!0}}},l$={class:"w-full h-full bg-gray-900 flex flex-column justify-content-end",style:{"overflow-y":"auto"}},u$={class:"p-3"};function c$(t,e,n,i,r,s){const o=Bt("VideoPlayer");return G(),se("div",l$,[e[0]||(e[0]=ue("div",{class:"flex-grow-1 text-color-secondary flex flex-column justify-content-center align-items-center"},[ue("i",{class:"pi pi-volume-up",style:{"font-size":"7rem"}})],-1)),ue("div",u$,[gt(o,{options:{controls:!0,audioOnlyMode:!0,sources:[{src:n.source,type:n.format}]}},null,8,["options"])])])}const d$=pu(a$,[["render",c$]]),h$={name:"VideoViewer",components:{VideoPlayer:iL},props:{source:{type:String,required:!0},format:{type:String,required:!0}}},p$={class:"w-full h-full bg-gray-900 flex flex-column justify-content-end",style:{"overflow-y":"auto"}},f$={class:"p-3 flex-grow-1"};function m$(t,e,n,i,r,s){const o=Bt("VideoPlayer");return G(),se("div",p$,[ue("div",f$,[gt(o,{"fit-height":!0,options:{controls:!0,responsive:!0,sources:[{src:n.source,type:n.format}]}},null,8,["options"])])])}const g$=pu(h$,[["render",m$]]);var rg,pb;const rL=class Hd{constructor(e){Mo(this,rg),r_(this,"data"),this.data=e}getID(){return this.data.id?this.data.id:null}getType(){return this.data.type?this.data.type:null}getPrefLabel(e=null){return this.data.label?Hd.displayLangPropertyAuto(this.data.label,e):null}getSummary(e=null){return this.data.summary?Hd.displayLangPropertyAuto(this.data.summary,e):null}getRequiredStatement(e=null){return this.data.requiredStatement&&this.data.requiredStatement.label&&this.data.requiredStatement.value?{label:Hd.displayLangPropertyAuto(this.data.requiredStatement.label,e),value:Hd.displayLangPropertyAuto(this.data.requiredStatement.value,e)}:null}getRights(){return this.data.rights?this.data.rights:null}getMetadata(e=null){const n=[];if(this.data.metadata)for(const i of this.data.metadata){const r=Hd.displayLangPropertyAuto(i.label,e),s=Hd.displayLangPropertyAuto(i.value,e);n.push({label:r,value:s})}return n.length>0?n:null}getMetadataValue(e,n=!0){if(this.data.metadata)for(const i of this.data.metadata){const r=i.label;let s=null;for(const o in r)if(r[o].indexOf(e)>=0){s=o;break}if(s)if(n){if(i.value[s])return i.value[s].join("; ")}else return Hd.displayLangPropertyCombined(i.value)}return null}getThumbnail(e=80){return this.getImagePropertyValue("thumbnail",e)}getImagePropertyValue(e,n=80){if(this.data[e])for(const i of this.data[e]){const r=nl.create(i);if(r instanceof OT)return r.isIIIF()?`${r.getIIIFUrl()}/full/${n},/0/default.jpg`:r.getUrl()}return null}getRendering(e=null){return Os(this,rg,pb).call(this,"rendering","Alternative Representation",e)}getHomePage(e=null){return Os(this,rg,pb).call(this,"homepage","Homepage",e)}getSeeAlsoLinks(e=null){return Os(this,rg,pb).call(this,"seeAlso","See Also",e)}getProvider(){return this.data.provider?this.data.provider:null}getLanguages(){const e=[];if(this.data.label&&e.push(Object.keys(this.data.label)),this.data.summary&&e.push(Object.keys(this.data.summary)),this.data.requiredStatement&&(this.data.requiredStatement.label&&e.push(Object.keys(this.data.requiredStatement.label)),this.data.requiredStatement.value&&e.push(Object.keys(this.data.requiredStatement.value))),this.data.metadata)for(const r of this.data.metadata)r.label&&e.push(Object.keys(r.label)),r.value&&e.push(Object.keys(r.value));if(this.data.rendering)for(const r of this.data.rendering)r.label&&e.push(Object.keys(r.label));if(this.data.homepage)for(const r of this.data.homepage)r.label&&e.push(Object.keys(r.label));if(this.data.seeAlso)for(const r of this.data.seeAlso)r.label&&e.push(Object.keys(r.label));const n=[...new Set([].concat(...e))],i=[];for(const r of n){let s=th.getLanguageName(r);s&&i.push({code:r,name:s})}return i}getData(){return this.data}static displayLangProperty(e,n){return e[n]?e[n].join("; "):null}static displayLangPropertyCombined(e,n=!0){const i=[];for(const r in e){let s=th.getLanguageName(r);s||(s="Unknown Language");let o=n?`(${s}) `:"";o+=e[r].join("; "),i.push(o)}return i}static displayLangPropertyAuto(e,n=null){const i=[];n&&i.push(n),i.indexOf("en")<0&&i.push("en"),i.indexOf("none")<0&&i.push("none");for(const r of i){const s=this.displayLangProperty(e,r);if(s)return s}return this.displayLangProperty(e,Object.keys(e)[0])}};rg=new WeakSet,pb=function(t,e,n=null){if(this.data[t]){const i=[];for(const r of this.data[t]){let s=null;r.label&&(s=rL.displayLangPropertyAuto(r.label,n));const o={label:s??e,value:r.id};r.format&&(o.format=r.format),r.type&&(o.type=r.type),i.push(o)}return i}return null};let Ll=rL;class OT extends Ll{getUrl(){return this.getID()}getFormat(){return this.data.format?this.data.format:null}getWidth(){return this.data.width?this.data.width:null}getHeight(){return this.data.height?this.data.height:null}getService(){return this.data.service?this.data.service:null}getIIIFUrl(){if(this.getService()){const e=this.getService()[0];if(e["@context"]==="http://iiif.io/api/image/2/context.json"||e["@context"]==="https://iiif.io/api/image/2/context.json"||e.type==="ImageService2"||e["@type"]==="ImageService2"||e.type==="ImageService3"||e["@type"]==="ImageService3"){if(typeof e.id<"u")return e.id;if(typeof e["@id"]<"u")return e["@id"]}}return null}getServiceType(){if(this.getService()){const e=this.getService()[0];return e.type?e.type:e["@type"]}return null}getServiceProfile(){if(this.getService()){const e=this.getService()[0];return e.profile?e.profile:null}return null}isLevel0(){return this.getServiceProfile()==="http://iiif.io/api/image/2/level0.json"||this.getServiceProfile()==="level0"}isIIIF(){return!!this.getIIIFUrl()}}class RT extends Ll{getUrl(){return this.getID()}getFormat(){return this.data.format?this.data.format:null}getDuration(){return this.data.duration?this.data.duration:null}}class sL extends RT{getWidth(){return this.data.width?this.data.width:null}getHeight(){return this.data.height?this.data.height:null}}var jp,oL,fb;class y$ extends Ll{constructor(){super(...arguments),Mo(this,jp)}getCanvases(e=null){const n=[];return Array.isArray(this.data.items)&&this.data.items.forEach(i=>{if(i.type==="Canvas"){const r=nl.create(i),s={id:i.id,parser:r};typeof i.label<"u"&&(s.label=Ll.displayLangPropertyAuto(i.label,e)),typeof i.summary<"u"&&(s.description=Ll.displayLangPropertyAuto(i.summary,e));const o=this.getCanvasImage(i);o&&(o.type==="audio"?s.audio=o:o.type==="video"?s.video=o:s.image=o);const u=this.getCanvasThumbnail(i);u&&(s.thumbnail=u);const d=this.getCanvasAnnotations(i);d.length>0&&(s.annotations=d),n.push(s)}}),n}getCanvasImage(e){let n=null;return Array.isArray(e.items)&&e.items.forEach(i=>{i.type==="AnnotationPage"&&Array.isArray(i.items)&&i.items.forEach(r=>{if(r.type==="Annotation"&&r.motivation.toLowerCase()==="painting"&&typeof r.body<"u"){const s=nl.create(r.body);if(s instanceof OT)s.isIIIF()?n={type:"iiif",isLevel0:s.isLevel0(),url:decodeURI(s.getIIIFUrl())}:n={type:"image",url:decodeURI(r.body.id)};else if(s instanceof sL)n={type:"video",format:s.getFormat(),url:decodeURI(s.getUrl()),width:s.getWidth(),height:s.getHeight()};else if(s instanceof RT)n={type:"audio",format:s.getFormat(),url:decodeURI(s.getUrl())};else if(s instanceof aL){const o=s.getSource();if(o&&o.type==="Image"){const u=nl.create(o);let d=u.getIIIFUrl(),h;if(d){h=d;const g={region:"full",size:"max",rotation:0,quality:"default",format:"jpg"},y=s.getSelector();if(y&&y.type==="iiif:ImageApiSelector")for(const w in g)typeof y[w]<"u"&&(g[w]=y[w]);h+=`/${g.region}/${g.size}/${g.rotation}/${g.quality}.${g.format}`}else h=u.getUrl();n={type:"image",url:decodeURI(h)}}}}})}),n}getCanvasThumbnail(e){const n=nl.create(e).getThumbnail();if(n)return decodeURI(n);const i=this.getCanvasImage(e);if(i!==null){if(i.type==="iiif")return i.isLevel0?`${decodeURI(i.url)}/full/max/0/default.jpg`:`${decodeURI(i.url)}/full/80,/0/default.jpg`;if(i.type==="image")return decodeURI(i.url)}return null}getCanvasAnnotations(e){const n=[];if(Array.isArray(e.annotations)){for(const i of e.annotations)if(i.type==="AnnotationPage"){const r=nl.create(i).getMetadataValue("Identifier");if(Array.isArray(i.items)){for(const s of i.items)if(s.type==="Annotation"){const o={id:s.id,target:this.getAnnotationTarget(s),group:r||i.id,data:s};s.body&&(o.fields=this.createAnnotationFieldsData(s.body,s.motivation)),n.push(o)}}}}return n}getAnnotationTarget(e){var n;if(e.target){const i=e.target;if(i.type==="SpecificResource"){if(i.selector){const r=i.selector;if(r.type==="PointSelector")return{source:i.source,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${r.x},${r.y},0,0`},renderedVia:{name:"point"}};if(r.type==="FragmentSelector")return r.value.startsWith("xywh=")&&!r.value.startsWith("xywh=pixel:")&&(r.value=r.value.replace(/^xywh=/,"xywh=pixel:")),r.conformsTo="http://www.w3.org/TR/media-frags/",i}}else if(typeof i=="string"){const r=/#xywh=(\d+,\d+,\d+,\d+)$/i,s=i.match(r);return s?{source:i.replace(r,""),selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${s[1]}`}}:{source:i}}return((n=i.selector)==null?void 0:n.type)==="SvgSelector"&&(i.selector.value=i.selector.value.replace(/<\/?g[^>]*>/g,""),i.selector.value=i.selector.value.replace(/]*>/g,""),i.selector.value=i.selector.value.replace(/(]+d=['"])([^>]+)(['"])/g,(r,s,o,u)=>s+o.replace(/,/g," ")+u)),i}return null}createAnnotationFieldsData(e,n=null){typeof e=="object"&&!Array.isArray(e)&&(e=[e]);const i={};let r=null;for(const s of e)if(s.type==="TextualBody"){let o=n;s.purpose&&(o=s.purpose);const u=Os(this,jp,oL).call(this,s.value,o),d=s.language||"none";u.label==="Comment"&&(u.value={value:u.value},s.format&&(u.value.format=s.format)),typeof i[u.label]>"u"&&(i[u.label]={}),typeof i[u.label][d]>"u"&&(i[u.label][d]=[]),i[u.label][d].push(u.value)}else if(s.type==="Image"){typeof i.Comment>"u"&&(i.Comment={}),typeof i.Comment.none>"u"&&(i.Comment.none=[]);const o=nl.create(s);i.Comment.none.push({value:`Annotation Image`,format:"text/html"})}else s.type==="SpecificResource"&&n.toLowerCase()==="tagging"&&s.source&&Fo.isURL(s.source)&&(r=s.source);if(r&&i.Tag)for(const s in i.Tag)for(const o of i.Tag[s])o.data||(o.data={}),o.data.link=r;return i}getAnnotationSets(e=null){const n=[];return Array.isArray(this.data.items)&&this.data.items.forEach(i=>{i.type==="Canvas"&&Array.isArray(i.annotations)&&i.annotations.forEach(r=>{if(r.type==="AnnotationPage"){const s=nl.create(r),o={},u=s.getMetadataValue("Identifier");if(o.id=u||r.id,n.find(h=>h.id===o.id))return;typeof r.label<"u"&&(o.label=Ll.displayLangPropertyAuto(r.label,e)),typeof r.summary<"u"&&(o.description=Ll.displayLangPropertyAuto(r.summary,e));const d=s.getMetadataValue("Creator");d&&(o.creator=d),n.push(o)}})}),n}getStartCanvas(){if(this.data.start){if(this.data.start.type==="Canvas")return this.data.start.id;if(this.data.start.type==="SpecificResource"&&this.data.start.source)return this.data.start.source}return null}getStructures(){return this.data.structures?this.data.structures:null}getLanguages(){const e=[super.getLanguages()];this.getCanvases().forEach(r=>{e.push(r.parser.getLanguages()),r.annotations&&r.annotations.forEach(s=>{if(s.fields)for(const o in s.fields){const u=Object.keys(s.fields[o]),d=[];for(const h of u){let g=th.getLanguageName(h);g&&d.push({code:h,name:g})}e.push(d)}})});const n=this.getStructures();if(n){const r=[];IL.structureTraverse(n,s=>{s.label&&Object.keys(s.label).forEach(o=>{let u=th.getLanguageName(o);u&&r.push({code:o,name:u})})}),e.push(r)}const i={};return e.forEach(r=>{r.forEach(s=>{i[s.code]=s})}),Object.values(i)}}jp=new WeakSet,oL=function(t,e=null){const n={label:"Comment",value:t},i=t.match(/^([^:]+):(.*)$/s);if(i){const r=i[1].trim();if(r==="Title"||r==="Description"||r==="Note"||r==="Attribution"||r==="Date"||r==="Line Color"||r==="Line Weight")n.label=r,n.value=i[2].trim();else if(r==="Link")n.label=r,n.value=Os(this,jp,fb).call(this,i[2].trim());else if(r==="Tag"){n.label=r;const s={},o=t.split(` `);for(const u of o){const d=u.match(/^([^:]+):(.*)$/);if(d){const h=d[1].trim(),g=d[2].trim();if(h==="Tag"){const y=Os(this,jp,fb).call(this,g);s.term_id=y.url,s.term_label=y.text}else if(h==="Vocabulary"){const y=Os(this,jp,fb).call(this,g);s.vocabulary_id=y.url,s.vocabulary_name=y.text}else h==="Data"&&(s.data=JSON.parse(g))}}n.value=s}}else e==="tagging"&&(n.label="Tag",n.value={term_id:Fo.generateUUID(),term_label:t});return n},fb=function(t){const e=t.match(/^\[(.*)\]\((.*)\)$/);return e?{text:e[1],url:e[2]}:{text:t,url:t}};class aL extends Ll{getSource(){return this.data.source?this.data.source:null}getSelector(){return this.data.selector?this.data.selector:null}}class v$ extends Ll{getLogo(e=80){return this.getImagePropertyValue("logo",e)}}class LT extends Ll{getItems(){return this.data.items?this.data.items:null}}class nl{static create(e){switch(e.type){case"Manifest":return new y$(e);case"Image":return new OT(e);case"Sound":return new RT(e);case"Video":return new sL(e);case"SpecificResource":return new aL(e);case"Agent":return new v$(e);case"Collection":return new LT(e);default:return new Ll(e)}}}var b$="http://library.stanford.edu/iiif/image-api/compliance.html#level0",w$="http://library.stanford.edu/iiif/image-api/compliance.html#level1",lL="http://library.stanford.edu/iiif/image-api/compliance.html#level2",_$="http://library.stanford.edu/iiif/image-api/conformance.html#level0",S$="http://library.stanford.edu/iiif/image-api/conformance.html#level1",uL="http://library.stanford.edu/iiif/image-api/conformance.html#level2",T$="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",E$="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",cL="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",x$="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",C$="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",dL="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",A$="http://iiif.io/api/image/1/level0.json",k$="http://iiif.io/api/image/1/profiles/level0.json",P$="http://iiif.io/api/image/1/level1.json",D$="http://iiif.io/api/image/1/profiles/level1.json",hL="http://iiif.io/api/image/1/level2.json",pL="http://iiif.io/api/image/1/profiles/level2.json",I$="http://iiif.io/api/image/2/level0.json",O$="http://iiif.io/api/image/2/profiles/level0.json",R$="http://iiif.io/api/image/2/level1.json",L$="http://iiif.io/api/image/2/profiles/level1.json",fL="http://iiif.io/api/image/2/level2.json",mL="http://iiif.io/api/image/2/profiles/level2.json",M$="level0",N$="level1",gL="level2",F$="http://iiif.io/api/image/2/level0",B$="http://iiif.io/api/image/2/level1",yL="http://iiif.io/api/image/2/level2",U$=[yL,lL,uL,cL,dL,hL,pL,fL,mL,gL],H$=[F$,B$,yL,b$,w$,lL,_$,S$,uL,T$,E$,cL,x$,C$,dL,A$,k$,P$,D$,hL,pL,I$,O$,R$,L$,fL,mL,M$,N$,gL],z$=H$;function Cu(t){for(let e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}function j$(t){return Array.isArray(t)?t:t?[t]:[]}var V$=Object.defineProperty,W$=(t,e,n)=>e in t?V$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vL=(t,e,n)=>(W$(t,typeof e!="symbol"?e+"":e,n),n),bL=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function q$(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){let e=bL.indexOf(t["@type"]);if(e!==-1)return bL[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}var G$=class W4{constructor(e,n={}){vL(this,"traversals"),vL(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new W4({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){let n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){let n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){let n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(q$(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){let n=Array.isArray(e),i=Array.isArray(e)?e:[e],r=[];for(let s of i)typeof s=="string"?r.push(this.traverseContentResource({"@id":s,"@type":"dctypes:Image"})):r.push(this.traverseContentResource(s));return!n&&!this.options.convertPropsToArray?r[0]:r}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){let n=Array.isArray(e),i=Array.isArray(e)?e:[e],r=[];for(let s of i)r.push(this.traverseService(s));return!n&&!this.options.convertPropsToArray?r[0]:r}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,r)=>{let s=r(i);return typeof s>"u"&&!this.options.allowUndefinedReturn?i:s},e)}},K$="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Y$="http://library.stanford.edu/iiif/image-api/compliance.html#level2",X$="http://library.stanford.edu/iiif/image-api/conformance.html#level1",Z$="http://library.stanford.edu/iiif/image-api/conformance.html#level2",Q$="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",J$="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",$$="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e7="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",t7="http://iiif.io/api/image/1/level1.json",n7="http://iiif.io/api/image/1/profiles/level1.json",i7="http://iiif.io/api/image/1/level2.json",r7="http://iiif.io/api/image/1/profiles/level2.json",s7="http://iiif.io/api/image/2/level1.json",o7="http://iiif.io/api/image/2/profiles/level1.json",a7="http://iiif.io/api/image/2/level2.json",l7="http://iiif.io/api/image/2/profiles/level2.json",u7="level1",c7="level2",d7="http://iiif.io/api/image/2/level1",h7="http://iiif.io/api/image/2/level2",p7=[d7,h7,K$,Y$,X$,Z$,Q$,J$,$$,e7,t7,n7,i7,r7,s7,o7,a7,l7,u7,c7],MT={attributionLabel:"Attribution",providerId:"http://example.org/provider",providerName:"Unknown"};function f7(t){if(typeof t=="string")return[t];if(!t)return[];let e=Array.isArray(t)?t:[t],n=[];for(let i of e){if(typeof i=="string"){n.push(i);continue}n.push({"@language":i["@language"]||i.language,"@value":i["@value"]||i.value})}return n}function mh(t,e="none"){if(!t)return{none:[""]};let n=f7(t),i={};for(let r of n){if(typeof r=="string"){i[e]=i[e]?i[e]:[],i[e].push(r||"");continue}if(!r["@language"]){i[e]=i[e]?i[e]:[],i[e].push(r["@value"]||"");continue}let s=r["@language"];i[s]=i[s]?i[s]:[],i[s].push(r["@value"]||"")}return Object.keys(i).length===0?{none:[""]}:i}function wL(t){if(Array.isArray(t))return wL(t.find(e=>typeof e=="string"));if(U$.indexOf(t)!==-1)return"level2";if(p7.indexOf(t)!==-1)return"level1";if(z$.indexOf(t)!==-1)return"level0";if(typeof t=="string")return t}function m7(t){let e=Array.isArray(t)?t:[t];for(let n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function g7(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function _L(t){for(let e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}var y7=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function NT(t){let e=t["@id"]||t.id,n=t["@type"]||t.type,i=t.profile||void 0,r=t["@context"]||void 0;if(i){let s=g7(i);if(s)return s}if(r){let s=m7(r);if(s)return s}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(let s of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${s}:`)){n=n.slice(s.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&y7.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}var v7=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function b7(t){let e=t.match(v7);return e?e[0]:t}function w7(t,e="Rights/License",n="none"){let i=null,r=[],s=Array.isArray(t)?t:[t];for(let o of s){let u=o?b7(o):void 0;if(u&&(u.indexOf("creativecommons.org")!==-1||u.indexOf("rightsstatements.org")!==-1)){u.startsWith("https://")?i=`http://${u.slice(8)}`:i=u;continue}u&&r.push({label:{[n]:[e]},value:{[n]:[u]}})}return[i,r]}var _7=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function S7(t){if(t){let e=Array.isArray(t)?t:[t],n=[];for(let i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),_7.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function T7(t){return t?t.map(e=>({label:mh(e.label),value:mh(e.value)})):[]}var SL=0;function TL(t,e){let n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(SL++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${SL}`)}function yc(t){let e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(_L):t.motivation&&(n=_L(t.motivation)),{"@context":t["@context"]?S7(t["@context"]):void 0,id:(t["@id"]||TL(t)).trim(),type:NT(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function vc(t){let[e,n]=w7(t.license),i=[...t.metadata?T7(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?mh(t.label):void 0,requiredStatement:t.attribution?{label:mh(MT.attributionLabel),value:mh(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?mh(t.description):void 0,thumbnail:E7(t.thumbnail)}}function E7(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function x7(t){if(!t.within)return;let e=Array.isArray(t.within)?t.within:[t.within],n=[];for(let i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:NT(i)});return n.length?n:void 0}function vd(t){let e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:MT.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:mh(MT.providerName)}]:void 0,partOf:x7(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?j$(t.service):void 0,supplementary:n?[n]:void 0}}function C7(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function A7(t){return Cu({...yc(t),...vc(t),...vd(t),items:t.members})}function k7(t){let e=[],n=[],i,r;for(let o of t.sequences||[])console.log(o),o.canvases.length&&e.push(...o.canvases),o.behavior&&n.push(...o.behavior),o.viewingDirection&&(r=o.viewingDirection),o.startCanvas&&(i=o.startCanvas);let s=yc(t);return n.length&&(s.behavior?s.behavior.push(...n):s.behavior=n),Cu({...s,...vc(t),...vd(t),viewingDirection:r,start:i,items:e,structures:P7(t.structures)})}function P7(t){if(!t)return t;let e=new Map;for(let i of t)e.set(i.id,i);let n=[];for(let i of t)if(i.items){let r=i.items.map(s=>typeof s=="string"?(n.push(s),e.get(s)||s):s&&s.id?(n.push(s.id),e.get(s.id)||s):s);i.items=r}return t.filter(i=>n.indexOf(i.id)===-1)}function D7(t){return Cu({...yc(t),...vc(t),...vd(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:TL(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function I7(t){return Cu({...yc(t),...vc(t),...vd(t),items:t.resources&&t.resources.length?t.resources:void 0})}function O7(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],viewingDirection:t.viewingDirection,startCanvas:t.startCanvas}}function R7(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:FT(n.selector)}}else return encodeURI(n["@id"]).trim()}return Cu({...yc(t),...vc(t),...vd(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(EL):EL(t.resource)})}function EL(t){return t.type==="Choice"?t:xL(t)}function xL(t){let e=t;return Cu({...yc(e),...vc(e),...vd(e),...C7(e)})}function L7(t){let e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),Cu({...yc(t),...vc(t),items:e})}function M7(t){return Cu({...yc(t),...vc(t),...vd(t),items:t.members})}function N7(t){let{"@id":e,"@type":n,"@context":i,profile:r,...s}=t,o={};return e&&(o["@id"]=e),o["@type"]=NT(t),o["@type"]==="unknown"&&(i&&i.length&&(o["@context"]=i),o["@type"]="Service"),r&&(o.profile=wL(r)),Cu({...o,...s})}function F7(t){return Cu({...yc(t),...vc(t),...vd(t)})}var B7=new G$({collection:[A7],manifest:[k7],canvas:[D7],annotationList:[I7],sequence:[O7],annotation:[R7],contentResource:[xL],choice:[L7],range:[M7],service:[N7],layer:[F7]});function CL(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?B7.traverseUnknown(t):t}function FT(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[FT(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(FT)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var gh,Vp,Tr,sg,og,bc,ka,AL,kL,PL,wc;class DL{constructor(e){Mo(this,ka),Mo(this,gh),Mo(this,Vp),Mo(this,Tr),Mo(this,sg),Mo(this,og),Mo(this,bc),ns(this,gh,e),ns(this,Tr,null),ns(this,sg,null),ns(this,og,[]),ns(this,bc,"initial")}async load(){if(ns(this,bc,"loading"),typeof Wn(this,gh)=="string")try{const e=await dr.get(Wn(this,gh),{withCredentials:!1,headers:{Accept:"application/json"}});ns(this,Tr,e.data)}catch{Os(this,ka,wc).call(this,"Failed to load manifest from its URL")}else typeof Wn(this,gh)=="object"?ns(this,Tr,Wn(this,gh)):Os(this,ka,wc).call(this,"Invalid manifest data");this.hasErrors()||Os(this,ka,AL).call(this),this.hasErrors()||(await Os(this,ka,kL).call(this),Os(this,ka,PL).call(this),ns(this,sg,nl.create(Wn(this,Tr))),ns(this,bc,"loaded"))}hasErrors(){return Wn(this,bc)==="error"}hasLoaded(){return Wn(this,bc)==="loaded"}isLoading(){return Wn(this,bc)==="loading"}getData(){return Wn(this,Tr)}getParser(){return Wn(this,sg)}getVersion(){return Wn(this,Vp)}getErrors(){return Wn(this,og)}isCollection(){return Wn(this,Tr)&&Wn(this,Tr).type==="Collection"}}gh=new WeakMap,Vp=new WeakMap,Tr=new WeakMap,sg=new WeakMap,og=new WeakMap,bc=new WeakMap,ka=new WeakSet,AL=function(){if(Wn(this,Tr)){if(!Wn(this,Tr)["@context"]){Os(this,ka,wc).call(this,"Invalid manifest: missing context");return}const t=IL.detectPresentationApiVersion(Wn(this,Tr));if(t)ns(this,Vp,t);else{Os(this,ka,wc).call(this,"Invalid manifest: unsupported version");return}if(t==="2.0")try{ns(this,Tr,CL(Wn(this,Tr)))}catch{Os(this,ka,wc).call(this,"Invalid manifest: failed to parse the legacy v2 format");return}if(Wn(this,Tr).type!=="Manifest"&&Wn(this,Tr).type!=="Collection"){Os(this,ka,wc).call(this,`Invalid manifest: invalid type ${Wn(this,Tr).type}`);return}if(Wn(this,Tr).type==="Collection"&&(!Wn(this,Tr).items||Wn(this,Tr).items.length===0)){Os(this,ka,wc).call(this,"Invalid manifest: the collection is empty");return}}else Os(this,ka,wc).call(this,"Manifest is empty")},kL=async function(){if(Wn(this,Tr).items){for(const t of Wn(this,Tr).items)if(t.annotations)for(let e=0;e{t.annotations&&t.annotations.forEach(e=>{e.type==="AnnotationPage"&&e.items&&e.items.forEach(n=>{n.type==="Annotation"&&(n.motivation&&Array.isArray(n.motivation)&&(n.motivation=n.motivation[0]),n.body&&n.body.forEach(i=>{i.type==="Text"&&i.chars&&(i.type="TextualBody",i.value=i.chars)}))})})})},wc=function(t){Wn(this,og).push(t),ns(this,bc,"error")};class IL{static detectPresentationApiVersion(e){if(e["@context"]){let n=e["@context"];if(Array.isArray(n)&&(n=n[n.length-1]),n==="http://iiif.io/api/presentation/2/context.json")return"2.0";if(n==="http://iiif.io/api/presentation/3/context.json")return"3.0"}return null}static structureTraverse(e,n){for(const i of e)n(i),i.items&&this.structureTraverse(i.items,n)}}const U7={name:"AgentCard",components:{Panel:i_},props:{agent:{type:Object,required:!0}},data(){return{label:null,homepage:null,logo:null,seeAlso:null}},mounted(){this.loadAgentInfo()},methods:{loadAgentInfo(){const t=nl.create(Rn(this.agent));this.label=t.getPrefLabel(),this.homepage=t.getHomePage(),this.logo=t.getLogo(300),this.seeAlso=t.getSeeAlsoLinks()}}},H7=["src","alt"],z7={key:1},j7={class:"mb-2"},V7=["href"],W7={key:2},q7={class:"mb-2"},G7=["href"];function K7(t,e,n,i,r,s){const o=Bt("Panel");return r.label?(G(),Ct(o,{key:0,header:r.label,toggleable:"",collapsed:""},{default:jt(()=>[r.logo?(G(),se("img",{key:0,class:"max-w-full mb-3",src:r.logo,alt:r.label},null,8,H7)):qe("",!0),r.homepage?(G(),se("div",z7,[(G(!0),se(xt,null,hn(r.homepage,u=>(G(),se("div",j7,[ue("a",{href:u.value,target:"_blank"},lt(u.label),9,V7)]))),256))])):qe("",!0),r.seeAlso?(G(),se("div",W7,[(G(!0),se(xt,null,hn(r.seeAlso,u=>(G(),se("div",q7,[ue("a",{href:u.value,target:"_blank"},lt(u.label),9,G7)]))),256))])):qe("",!0)]),_:1},8,["header"])):qe("",!0)}const Y7=pu(U7,[["render",K7]]),X7={name:"ResourceInfoDetails",components:{AgentCard:Y7},props:{resourceInfo:{type:Object,required:!0}},setup(){return{HtmlUtility:sv,Helper:Fo}}},Z7={key:0,class:"gv-field"},Q7={class:"gv-field-label"},J7={class:"gv-field-value"},$7=["href"],eee={key:1,class:"gv-field"},tee={class:"gv-field-label"},nee={class:"gv-field-value"},iee=["innerHTML"],ree={key:2,class:"gv-field"},see={class:"gv-field-label"},oee={class:"gv-field-value"},aee=["innerHTML"],lee={key:3,class:"gv-field"},uee={class:"gv-field-label"},cee={class:"gv-field-value"},dee=["href"],hee={class:"gv-field"},pee={class:"gv-field-label"},fee={class:"gv-field-value"},mee=["innerHTML"],gee={key:5,class:"gv-field"},yee={class:"gv-field-label"},vee={class:"gv-field-value"},bee=["href"],wee={key:6,class:"gv-field"},_ee={class:"gv-field-label"},See={class:"gv-field-value"},Tee=["href"],Eee={key:7,class:"gv-field"},xee={class:"gv-field-label"},Cee={class:"gv-field-value"},Aee=["href"],kee={key:8,class:"gv-field"},Pee={class:"gv-field-label mb-1"},Dee={class:"gv-field-value"},Iee={class:"mb-3"};function Oee(t,e,n,i,r,s){const o=Bt("AgentCard");return G(),se(xt,null,[n.resourceInfo.link?(G(),se("div",Z7,[ue("div",Q7,lt(n.resourceInfo.link.text),1),ue("div",J7,[ue("a",{target:"_blank",href:n.resourceInfo.link.url},lt(n.resourceInfo.link.url),9,$7)])])):qe("",!0),n.resourceInfo.summary?(G(),se("div",eee,[ue("div",tee,lt(t.$t("ui.summary")),1),ue("div",nee,[i.HtmlUtility.detectHtml(n.resourceInfo.summary)?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(n.resourceInfo.summary)},null,8,iee)):(G(),se(xt,{key:1},[Jn(lt(n.resourceInfo.summary),1)],64))])])):qe("",!0),n.resourceInfo.requiredStatement?(G(),se("div",ree,[ue("div",see,lt(n.resourceInfo.requiredStatement.label),1),ue("div",oee,[i.HtmlUtility.detectHtml(n.resourceInfo.requiredStatement.value)?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(n.resourceInfo.requiredStatement.value)},null,8,aee)):(G(),se(xt,{key:1},[Jn(lt(n.resourceInfo.requiredStatement.value),1)],64))])])):qe("",!0),n.resourceInfo.rights?(G(),se("div",lee,[ue("div",uee,lt(t.$t("ui.rights")),1),ue("div",cee,[i.Helper.isURL(n.resourceInfo.rights)?(G(),se("a",{key:0,href:n.resourceInfo.rights},lt(n.resourceInfo.rights),9,dee)):(G(),se(xt,{key:1},[Jn(lt(n.resourceInfo.rights),1)],64))])])):qe("",!0),n.resourceInfo.metadata?(G(!0),se(xt,{key:4},hn(n.resourceInfo.metadata,u=>(G(),se("div",hee,[ue("div",pee,lt(u.label),1),ue("div",fee,[i.HtmlUtility.detectHtml(u.value)?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(u.value)},null,8,mee)):(G(),se(xt,{key:1},[Jn(lt(u.value),1)],64))])]))),256)):qe("",!0),n.resourceInfo.rendering?(G(),se("div",gee,[ue("div",yee,lt(t.$t("ui.altRepresentation")),1),ue("div",vee,[(G(!0),se(xt,null,hn(n.resourceInfo.rendering,u=>(G(),se("div",null,[ue("a",{target:"_blank",href:u.value},lt(u.label),9,bee)]))),256))])])):qe("",!0),n.resourceInfo.homepage?(G(),se("div",wee,[ue("div",_ee,lt(t.$t("ui.homepage")),1),ue("div",See,[(G(!0),se(xt,null,hn(n.resourceInfo.homepage,u=>(G(),se("div",null,[ue("a",{target:"_blank",href:u.value},lt(u.label),9,Tee)]))),256))])])):qe("",!0),n.resourceInfo.seeAlso?(G(),se("div",Eee,[ue("div",xee,lt(t.$t("ui.seeAlso")),1),ue("div",Cee,[(G(!0),se(xt,null,hn(n.resourceInfo.seeAlso,u=>(G(),se("div",null,[ue("a",{target:"_blank",href:u.value},lt(u.label),9,Aee)]))),256))])])):qe("",!0),n.resourceInfo.provider?(G(),se("div",kee,[ue("div",Pee,lt(t.$t("ui.provider")),1),ue("div",Dee,[(G(!0),se(xt,null,hn(n.resourceInfo.provider,u=>(G(),se("div",Iee,[gt(o,{class:"w-full",agent:u},null,8,["agent"])]))),256))])])):qe("",!0)],64)}const Ree=pu(X7,[["render",Oee]]),Lee={name:"ResourceInfoCard",components:{Panel:i_,ResourceInfoDetails:Ree},props:{resourceInfo:{type:Object,required:!0},cardTitle:{type:String},titleIcon:{type:String,default:"info-circle"},toggleable:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1}}},Mee={class:"w-full mb-6"},Nee={key:0},Fee={key:1};function Bee(t,e,n,i,r,s){const o=Bt("ResourceInfoDetails"),u=Bt("Panel");return G(),se("div",Mee,[n.cardTitle?(G(),se("h3",Nee,[ue("i",{class:Lt(`pi pi-${n.titleIcon}`)},null,2),Jn(" "+lt(n.cardTitle),1)])):qe("",!0),n.resourceInfo.label?(G(),se("h4",Fee,lt(n.resourceInfo.label),1)):qe("",!0),n.toggleable?(G(),Ct(u,{key:2,header:t.$t("ui.details"),toggleable:n.toggleable,collapsed:n.collapsed},{default:jt(()=>[gt(o,{"resource-info":n.resourceInfo},null,8,["resource-info"])]),_:1},8,["header","toggleable","collapsed"])):(G(),Ct(o,{key:3,"resource-info":n.resourceInfo},null,8,["resource-info"]))])}const Uee=pu(Lee,[["render",Bee]]),Hee={name:"GlycerineViewer",components:{AudioViewer:d$,VideoViewer:g$,TableViewer:Qq,ImageViewer:_q,ResourceInfoCard:Uee,Button:nc,Dropdown:Zd,InputSwitch:RA,Checkbox:Uw,Message:Iy,Listbox:Hw,Chip:LA,TabView:Oy,TabPanel:Ry,DataTable:Ly,Column:Vw,InputText:tm,Tree:Ww,Slider:ik},props:{manifest:{type:[Object,String],required:!0},defaultInfoPanel:{type:Boolean,default:!0},showFullScreenButton:{type:Boolean,default:!0},showIndexButton:{type:Boolean,default:!0},showAnnotationViewButton:{type:Boolean,default:!0},showAboutPaneButton:{type:Boolean,default:!0},showSettingPaneButton:{type:Boolean,default:!0},showCollectionPaneButton:{type:Boolean,default:!0},showManifestUrl:{type:Boolean,default:!0},displayAnnotations:{type:Boolean,default:!0},enableDropManifest:{type:Boolean,default:!0},toggleIndexPanel:{type:Boolean,default:!1},toggleAboutPanel:{type:Boolean,default:!1}},emits:["osdInitialized","manifestLoaded","canvasLoaded","canvasAnnotationsLoaded","mouseEnterAnnotation","mouseLeaveAnnotation","annotationPopupOpened","annotationPopupClosed","viewModeChanged","indexPanelClosed","aboutPanelClosed"],data(){return{currentManifest:this.manifest,manifestStatus:"initial",manifestErrors:[],viewMode:"image",highlightedAnnotationId:null,showAboutPanel:!1,showIndexPanel:!1,showCollectionPanel:!1,showSettingsPanel:!1,settings:{language:{default:null,options:[]},filters:{set:"all",language:"all",line:"all",weight:"all"},light:100,showInfoPanel:this.defaultInfoPanel,tableColumns:{Title:!0,Description:!0,Links:!0,Tags:!0,Notes:!0,Attribution:!1,Date:!1,"Line Color":!1,"Line Weight":!1,Comments:!1}},isInFullscreen:!1,hasAddedFullscreenListener:!1,collectionActiveManifest:null,navigation:{activeIndex:0,maxVisibleItems:0,styles:{thumbnailWidth:110,gap:15}},index:{searchFilter:{global:{value:null,matchMode:Nr.CONTAINS}},rowsPerPage:10},collectionTableOptions:{searchFilter:{global:{value:null,matchMode:Nr.CONTAINS}},rowsPerPage:10},showDropZone:!1,userAnnotationFilter:null}},computed:{manifestIsLoading(){return this.manifestStatus==="loading"},manifestHasLoaded(){return this.manifestStatus==="loaded"},manifestHadErrors(){return this.manifestStatus==="error"},canvases(){let t=[];return this.manifestHasLoaded&&(t=this.manifestLoader.getParser().getCanvases()),t},manifestInfo(){const t={};if(this.manifestHasLoaded){if(this.showManifestUrl){let n=null;typeof this.currentManifest=="string"&&(n=this.currentManifest),typeof this.currentManifest=="object"&&this.currentManifest.id&&(n=this.currentManifest.id),n&&(t.link={text:"IIIF Manifest",url:n})}const e=this.manifestLoader.getParser();t.label=e.getPrefLabel(this.settings.language.default),t.summary=e.getSummary(this.settings.language.default),t.requiredStatement=e.getRequiredStatement(this.settings.language.default),t.rights=e.getRights(),t.metadata=e.getMetadata(this.settings.language.default),t.rendering=e.getRendering(this.settings.language.default),t.homepage=e.getHomePage(this.settings.language.default),t.seeAlso=e.getSeeAlsoLinks(this.settings.language.default),t.thumbnail=e.getThumbnail(),t.provider=e.getProvider()}return t},currentCanvasInfo(){if(this.manifestHasLoaded){const t=Rn(this.canvases[this.navigation.activeIndex].parser),e={label:t.getPrefLabel(this.settings.language.default),summary:t.getSummary(this.settings.language.default),requiredStatement:t.getRequiredStatement(this.settings.language.default),rights:t.getRights(),metadata:t.getMetadata(this.settings.language.default),rendering:t.getRendering(this.settings.language.default),homepage:t.getHomePage(this.settings.language.default),seeAlso:t.getSeeAlsoLinks(this.settings.language.default),provider:t.getProvider()};let n=!1;for(const i in e)if(e[i]){n=!0;break}if(n)return e}return null},collectionInfo(){if(this.manifestHasLoaded&&this.collectionLoader){const t=this.collectionLoader.getParser(),e={label:t.getPrefLabel(this.settings.language.default),summary:t.getSummary(this.settings.language.default),requiredStatement:t.getRequiredStatement(this.settings.language.default),rights:t.getRights(),metadata:t.getMetadata(this.settings.language.default),rendering:t.getRendering(this.settings.language.default),homepage:t.getHomePage(this.settings.language.default),seeAlso:t.getSeeAlsoLinks(this.settings.language.default),provider:t.getProvider()};this.showManifestUrl&&(e.link={text:"IIIF Manifest",url:t.getID()}),e.items=[];const n=t.getItems();for(const i of n){const r=nl.create(i);e.items.push({id:r.getID(),label:r.getPrefLabel(this.settings.language.default),type:r.getType(),thumbnail:r.getThumbnail()})}return e}return null},collectionTableActiveItem(){return this.collectionActiveManifest?this.collectionInfo.items.find(t=>t.id===this.collectionActiveManifest):null},collectionTableFirstIndex(){if(this.collectionInfo&&this.collectionInfo.items){const t=this.collectionInfo.items.findIndex(e=>e.id===this.collectionActiveManifest);return Math.floor(t/this.collectionTableOptions.rowsPerPage)*this.collectionTableOptions.rowsPerPage}return 0},tableColumns(){return Object.keys(this.settings.tableColumns).filter(t=>this.settings.tableColumns[t])},annotations(){const t={};return this.canvases.length>0&&this.canvases.forEach(e=>{t[e.id]=[],e.annotations&&e.annotations.length>0&&e.annotations.forEach(n=>{var i,r,s,o;this.settings.filters.set==="none"||this.settings.filters.set!=="all"&&n.group!==this.settings.filters.set||this.settings.filters.language!=="all"&&this.getAnnotationLanguageCodes(n).indexOf(this.settings.filters.language)<0||this.settings.filters.line!=="all"&&((r=(i=n.fields["Line Color"])==null?void 0:i.en)==null?void 0:r[0])!==this.settings.filters.line||this.settings.filters.weight!=="all"&&((o=(s=n.fields["Line Weight"])==null?void 0:s.en)==null?void 0:o[0])!==this.settings.filters.weight||this.userAnnotationFilter!==null&&this.userAnnotationFilter.indexOf(n.id)<0||t[e.id].push(n)})}),t},hasAnnotation(){let t=!1;return this.canvases.length>0&&this.canvases.forEach(e=>{e.annotations&&e.annotations.length>0&&(t=!0)}),t},filterSetOptions(){const t=[{label:this.$t("ui.allAnnotations"),value:"all"}];if(this.manifestHasLoaded){const e=this.manifestLoader.getParser().getAnnotationSets();for(const n of e){let i=n.label??"Untitled";n.creator&&(i=n.creator+" - "+i),t.push({label:i,value:n.id})}}return t.push({label:this.$t("ui.noAnnotations"),value:"none"}),t},filterLanguageOptions(){const t=[{label:this.$t("ui.allLanguages"),value:"all"},{label:"English",value:"en"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(n=>{n.annotations&&n.annotations.length>0&&n.annotations.forEach(i=>{this.getAnnotationLanguageCodes(i).forEach(r=>{r!=="en"&&e.indexOf(r)<0&&e.push(r)})})}),e.forEach(n=>{const i=th.getLanguageName(n);i&&t.push({label:i,value:n})})}return t},filterLineOptions(){const t=[{label:this.$t("ui.allLineColors"),value:"all"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(n=>{n.annotations&&n.annotations.length>0&&n.annotations.forEach(i=>{if(i.fields){for(const r in i.fields)if(r==="Line Color"&&i.fields[r].en){const s=i.fields[r].en[0];e.indexOf(s)<0&&e.push(s)}}})}),e.forEach(n=>{t.push({label:n,value:n})})}return t},filterWeightOptions(){const t=[{label:this.$t("ui.allLineWeights"),value:"all"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(n=>{n.annotations&&n.annotations.length>0&&n.annotations.forEach(i=>{if(i.fields){for(const r in i.fields)if(r==="Line Weight"&&i.fields[r].en){const s=i.fields[r].en[0];e.indexOf(s)<0&&e.push(s)}}})}),e.forEach(n=>{t.push({label:n,value:n})})}return t},infoPanelVisibility(){return this.manifestHasLoaded&&this.settings.showInfoPanel&&this.viewMode==="image"},annotationDefaultLanguage(){return this.settings.filters.language!=="all"?this.settings.filters.language:this.settings.language.default},navThumbnails(){const t=[];if(this.canvases.length>0&&this.navigation.maxVisibleItems>0){let e=Math.max(0,this.navigation.activeIndex-Math.floor(this.navigation.maxVisibleItems/2)),n=Math.min(this.canvases.length,e+this.navigation.maxVisibleItems);n-e0)for(let e=0;er.id),n=r=>{const s=[];for(const o of r){let u=nl.create(o);if(u.getType()==="Range"){const d=u.getPrefLabel(this.settings.language.default);if(d){const h={key:u.getID(),label:d,data:{id:u.getID(),type:u.getType(),label:d}};if(o.items){const g=[];for(const y of o.items)if(y.type==="Range")g.push(y);else if(y.type==="Canvas"){const w=y.id,C=e.indexOf(w);C>-1&&(h.data.canvasIndices?h.data.canvasIndices.push(C):h.data.canvasIndices=[C])}g.length>0&&(h.children=n(g))}s.push(h)}}}return s},i=this.manifestLoader.getParser().getStructures();i&&(t=n(i))}return t},selectedStructureNodes(){const t={};if(this.structureNodes.length>0){const e=n=>{for(const i of n)i.data.canvasIndices&&i.data.canvasIndices.indexOf(this.navigation.activeIndex)>-1&&(t[i.key]=!0),i.children&&e(i.children)};e(this.structureNodes)}return t},expandedStructureNodes(){const t={};if(this.structureNodes.length>0){const e=n=>{let i=!1;for(const r of n)r.data.canvasIndices&&r.data.canvasIndices.indexOf(this.navigation.activeIndex)>-1&&(i=!0),r.children&&e(r.children)&&(i=!0,t[r.key]=!0);return i};e(this.structureNodes)}return t}},setup(){return{version:"1.4.0",logoPath:xW,HtmlUtility:sv,Helper:Fo,manifestLoader:null,collectionLoader:null}},mounted(){this.loadManifest()},watch:{manifest(){this.collectionLoader=null,this.reset()},manifestHasLoaded:{handler(t,e){t&&this.canvases&&this.canvases.length>1&&this.initNavigation()},flush:"post"},toggleAboutPanel(t){this.showAboutPanel=t},toggleIndexPanel(t){this.showIndexPanel=t},showAboutPanel(t,e){e===!0&&t===!1&&this.$emit("aboutPanelClosed")},showIndexPanel(t,e){t===!1&&e===!0&&this.$emit("indexPanelClosed")}},methods:{async reset(t=null){this.currentManifest=t??this.manifest,this.manifestStatus="initial",this.manifestErrors=[],this.viewMode="image",this.highlightedAnnotationId=null,this.showAboutPanel=!1,this.showCollectionPanel=!1,this.showSettingsPanel=!1,this.showIndexPanel=!1,this.settings={language:{default:null,options:[]},filters:{set:"all",language:"all",line:"all",weight:"all"},light:100,showInfoPanel:this.defaultInfoPanel,tableColumns:{Title:!0,Description:!0,Links:!0,Tags:!0,Notes:!0,Attribution:!1,Date:!1,"Line Color":!1,"Line Weight":!1,Comments:!1}},this.isInFullscreen=!1,this.hasAddedFullscreenListener=!1,this.collectionActiveManifest=null,this.navigation={activeIndex:0,maxVisibleItems:0,styles:{thumbnailWidth:110,gap:15}},this.index={searchFilter:{global:{value:null,matchMode:Nr.CONTAINS}},rowsPerPage:10},this.collectionTableOptions={searchFilter:{global:{value:null,matchMode:Nr.CONTAINS}},rowsPerPage:10},this.userAnnotationFilter=null,await this.loadManifest()},async loadManifest(){const t=new DL(this.currentManifest);if(this.manifestStatus="loading",await t.load(),t.hasErrors())this.manifestStatus="error",this.manifestErrors=t.getErrors();else if(t.hasLoaded())if(t.getParser()instanceof LT){this.collectionLoader=t;const e=this.collectionLoader.getParser().getItems();e&&e.length>0&&(this.currentManifest=e[0].id,await this.loadManifest())}else{this.manifestLoader=t,this.manifestStatus="loaded",this.$emit("manifestLoaded",this.manifestLoader.getData()),this.loadTableColumnVisibility();const e=th.uiLanguages,n=e.map(s=>s.code),i=this.manifestLoader.getParser().getLanguages();for(const s of i)n.indexOf(s.code)<0&&e.push(s);this.settings.language.options=e.map(s=>({label:s.name,value:s.code})),this.settings.language.default=this.$i18n.locale;const r=this.manifestLoader.getParser().getStartCanvas();r&&this.manifestLoader.getParser().getCanvases().forEach((s,o)=>{s.id===r&&(this.navigation.activeIndex=o)}),this.collectionLoader&&(this.collectionActiveManifest=this.manifestLoader.getParser().getID())}},loadTableColumnVisibility(){const t=[],e=["Attribution","Date","Line Color","Line Weight"];this.canvases.length>0&&this.canvases.forEach(n=>{n.annotations&&n.annotations.length>0&&n.annotations.forEach(i=>{if(i.fields)for(const r in i.fields){let s=r;r==="Comment"?s="Comments":r==="Note"?s="Notes":r==="Link"?s="Links":r==="Tag"&&(s="Tags"),t.indexOf(s)<0&&t.push(s)}})});for(const n in this.settings.tableColumns)this.settings.tableColumns[n]=t.indexOf(n)>-1&&e.indexOf(n)<0},activate(t){this.navigation.activeIndex=t},toggleViewMode(){this.viewMode=this.viewMode==="image"?"table":"image",this.$emit("viewModeChanged",this.viewMode)},getAnnotationLanguageCodes(t){const e=[];if(t.fields)for(const n in t.fields)for(const i in t.fields[n])e.indexOf(i)<0&&e.push(i);return e},toggleFullscreen(){const t=this.$refs.gViewer;this.isInFullscreen?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen(),this.hasAddedFullscreenListener||(t.addEventListener("fullscreenchange",()=>{this.isInFullscreen=document.fullscreenElement!==null}),this.hasAddedFullscreenListener=!0)},initNavigation(){const t=this.$refs.navContainer.offsetWidth;let e=Math.floor(t/(this.navigation.styles.thumbnailWidth+this.navigation.styles.gap));e>1&&e%2===0&&(e-=1),this.navigation.maxVisibleItems=e},openIndexPanel(){this.index.searchFilter.global.value=null,this.showIndexPanel=!0},indexPanelScrollTop(){this.$nextTick(()=>{this.$refs.indexPanelTop.scrollIntoView({behavior:"smooth"})})},onIndexRowSelect(t){const e=t.data;for(let n=0;n0&&this.activate(t.data.canvasIndices[0])},onManifestDrop(t){t.preventDefault();const e=t.dataTransfer.getData("text/plain");this.openManifest(e),this.showDropZone=!1},onManifestDragOver(t){t.preventDefault(),this.enableDropManifest&&(this.showDropZone=!0)},onManifestDragLeave(t){t.preventDefault(),this.showDropZone=!1},onPrefLanguageChange(t){this.settings.language.default=t.value,localStorage.setItem("prefLang",t.value)},onCollectionItemRowSelect(t){const e=t.data;e&&this.reset(e.id)},collectionTableScrollTop(){this.$nextTick(()=>{this.$refs.collectionTableTop.scrollIntoView({behavior:"smooth"})})},async openManifest(t){Fo.isURL(t)&&(this.collectionLoader=null,await this.reset(t))},activateCanvas(t){const e=this.canvases.findIndex(n=>n.id===t);e>=0&&this.activate(e)},highlightAnnotation(t){this.highlightedAnnotationId=t},clearHighlight(){this.highlightedAnnotationId=null},setUserAnnotationFilter(t=null){this.userAnnotationFilter=t}}},zee={class:"gv-gallery flex flex-column justify-content-end h-full"},jee={class:"gv-gallery-views w-full flex-grow-1",style:{"min-height":"0"}},Vee={key:0,class:"h-full"},Wee={key:3,class:"flex flex-column align-items-center justify-content-center w-full h-full bg-gray-900 text-color-secondary"},qee={key:0,class:"anno-gallery-nav flex align-items-center justify-content-between gap-3 w-full bg-black-alpha-90 p-3"},Gee={class:"thumbnail-container bg-gray-900"},Kee=["onClick"],Yee=["src","alt"],Xee={key:1,class:"pi pi-volume-up text-color-secondary",style:{"font-size":"3rem"}},Zee={key:2,class:"pi pi-video text-color-secondary",style:{"font-size":"3rem"}},Qee={key:3,class:"pi pi-image text-color-secondary",style:{"font-size":"3rem"}},Jee={key:0,class:"gv-info-pane"},$ee={class:"gv-info-header"},ete={class:"gv-info-tools"},tte={class:"flex justify-content-between align-items-center w-full gap-2"},nte={key:0,class:"gv-info-thumbnail flex-shrink-0"},ite=["src","alt"],rte={class:"gv-info-title"},ste={key:0,class:"mt-2"},ote={class:"gv-info-body"},ate={class:"gv-field"},lte={class:"gv-field-label"},ute={key:0,class:"gv-field-value"},cte={key:0,class:"gv-field"},dte={class:"gv-field-label"},hte={class:"gv-field-value"},pte=["innerHTML"],fte={class:"absolute",style:{top:"1rem",right:"1rem"}},mte={key:0,class:"gv-sidebar"},gte={class:"text-right"},yte={class:"p-fluid formgrid grid"},vte={class:"w-full mb-2"},bte={class:"pl-2"},wte={class:"field col-12"},_te={for:"filterLang"},Ste={key:0,class:"w-full mb-2"},Tte={class:"pl-2"},Ete={class:"field col-12"},xte={for:"filterSet"},Cte={class:"field col-12"},Ate={for:"filterLang"},kte={class:"field col-12"},Pte={for:"filterLine"},Dte={key:0,class:"flex align-items-center gap-2"},Ite={key:0},Ote={key:1},Rte={class:"flex align-items-center gap-2"},Lte={key:0},Mte={class:"field col-12"},Nte={for:"filterLang"},Fte={class:"w-full"},Bte={class:"pl-2"},Ute={key:0,class:"field col-12 flex align-items-center gap-4"},Hte={key:1,class:"field col-12 flex align-items-center gap-4"},zte={key:2,class:"field col-12"},jte={class:"mb-2"},Vte={class:"mb-1"},Wte={for:"tcTitle"},qte={class:"mb-1"},Gte={for:"tcDescription"},Kte={class:"mb-1"},Yte={for:"tcLinks"},Xte={class:"mb-1"},Zte={for:"tcTags"},Qte={class:"mb-1"},Jte={for:"tcNotes"},$te={class:"mb-1"},ene={for:"tcAttribution"},tne={class:"mb-1"},nne={for:"tcDate"},ine={class:"mb-1"},rne={for:"tcLineColor"},sne={class:"mb-1"},one={for:"tcLineWeight"},ane={class:"mb-1"},lne={for:"tcComments"},une={key:0,class:"gv-sidebar"},cne={class:"text-right"},dne={class:"text-center mt-8 gv-powered-by"},hne={class:"mr-2"},pne={key:0,class:"gv-sidebar"},fne={class:"text-right"},mne={key:0},gne={ref:"collectionTableTop"},yne={class:"flex justify-content-end"},vne={class:"p-input-icon-left w-full"},bne=["src"],wne={key:1,class:"thumbnail-container surface-50"},_ne={key:2,class:"thumbnail-container surface-50"},Sne={key:0},Tne={key:1},Ene={key:0,class:"gv-sidebar"},xne={ref:"indexPanelTop"},Cne={class:"text-right"},Ane={class:"flex justify-content-end"},kne={class:"p-input-icon-left w-full"},Pne=["src"],Dne={key:1,class:"thumbnail-container surface-50"},Ine={key:2,class:"thumbnail-container surface-50"},One={key:0},Rne={key:1},Lne={key:1,class:"w-full h-full bg-gray-900 overflow-hidden flex flex-column align-items-center justify-content-center gap-4"},Mne=["src"],Nne={key:0};function Fne(t,e,n,i,r,s){var o;const u=Bt("TableViewer"),d=Bt("ImageViewer"),h=Bt("AudioViewer"),g=Bt("VideoViewer"),y=Bt("Button"),w=Bt("Dropdown"),C=Bt("Slider"),D=Bt("InputSwitch"),P=Bt("Checkbox"),M=Bt("ResourceInfoCard"),F=Bt("InputText"),K=Bt("Column"),$=Bt("DataTable"),ee=Bt("TabPanel"),he=Bt("Tree"),ve=Bt("TabView"),fe=Bt("Message");return G(),se("div",{class:"gv-container w-full h-full relative overflow-hidden",onDragover:e[38]||(e[38]=ae=>s.onManifestDragOver(ae))},[s.manifestHasLoaded?(G(),se("div",Ni({key:0,ref:"gViewer"},t.$attrs,{class:"w-full h-full relative overflow-hidden"}),[ue("div",zee,[ue("div",jee,[(G(!0),se(xt,null,hn(s.canvases,(ae,xe)=>(G(),se(xt,null,[r.navigation.activeIndex===xe?(G(),se("div",Vee,[ae.image?(G(),se(xt,{key:0},[r.viewMode==="table"?(G(),Ct(u,{key:0,image:ae.image.url,"plain-image":ae.image.type==="image",annotations:s.annotations[ae.id],"table-columns":s.tableColumns},null,8,["image","plain-image","annotations","table-columns"])):(G(),Ct(d,{key:1,image:ae.image.url,"plain-image":ae.image.type==="image",annotations:s.annotations[ae.id],light:r.settings.light,"default-language":s.annotationDefaultLanguage,displayAnnotations:n.displayAnnotations,highlightedAnnotationId:r.highlightedAnnotationId,onOsdInitialized:Qe=>{t.$emit("osdInitialized",Qe,ae)},onCanvasLoaded:()=>{t.$emit("canvasLoaded",ae.id)},onAnnotationsLoaded:Qe=>{t.$emit("canvasAnnotationsLoaded",Qe,ae.id)},onMouseEnterAnnotation:e[0]||(e[0]=Qe=>{t.$emit("mouseEnterAnnotation",Qe)}),onMouseLeaveAnnotation:e[1]||(e[1]=Qe=>{t.$emit("mouseLeaveAnnotation",Qe)}),onAnnotationPopupOpened:e[2]||(e[2]=Qe=>{t.$emit("annotationPopupOpened",Qe)}),onAnnotationPopupClosed:e[3]||(e[3]=Qe=>{t.$emit("annotationPopupClosed",Qe)})},null,8,["image","plain-image","annotations","light","default-language","displayAnnotations","highlightedAnnotationId","onOsdInitialized","onCanvasLoaded","onAnnotationsLoaded"]))],64)):ae.audio?(G(),Ct(h,{key:1,source:ae.audio.url,format:ae.audio.format},null,8,["source","format"])):ae.video?(G(),Ct(g,{key:2,source:ae.video.url,format:ae.video.format},null,8,["source","format"])):(G(),se("div",Wee,[e[39]||(e[39]=ue("div",null,[ue("i",{class:"pi pi-image",style:{"font-size":"7rem"}})],-1)),ue("div",null,lt(t.$t("message.invalidImage")),1)]))])):qe("",!0)],64))),256))]),s.canvases.length>1?(G(),se("div",qee,[ue("div",null,[gt(y,{class:"text-white",type:"button",text:"",rounded:"",icon:"pi pi-chevron-left",onClick:e[4]||(e[4]=ae=>s.activate(r.navigation.activeIndex-1)),disabled:r.navigation.activeIndex===0},null,8,["disabled"])]),ue("div",{ref:"navContainer",class:"anno-gallery-nav-items flex align-items-center justify-content-center flex-no-wrap w-full overflow-hidden",style:hi({gap:r.navigation.styles.gap+"px"})},[gt(m5,{name:"rolling"},{default:jt(()=>[(G(!0),se(xt,null,hn(s.navThumbnails,ae=>(G(),se("div",{class:"anno-gallery-nav-item flex-shrink-0",style:hi({width:r.navigation.styles.thumbnailWidth+"px"}),key:ae.id},[ue("div",Gee,[ue("a",{class:Lt(["thumbnail-item",{"thumbnail-item-active":r.navigation.activeIndex===ae.index}]),href:"#",onClick:$f(xe=>s.activate(ae.index),["prevent"])},[ae.image?(G(),se("img",{key:0,src:ae.image,alt:ae.label},null,8,Yee)):ae.type==="Audio"?(G(),se("i",Xee)):ae.type==="Video"?(G(),se("i",Zee)):(G(),se("i",Qee))],10,Kee)])],4))),128))]),_:1})],4),ue("div",null,[gt(y,{class:"text-white",type:"button",text:"",rounded:"",icon:"pi pi-chevron-right",onClick:e[5]||(e[5]=ae=>s.activate(r.navigation.activeIndex+1)),disabled:r.navigation.activeIndex===s.canvases.length-1},null,8,["disabled"])])])):qe("",!0)]),s.infoPanelVisibility?(G(),se("div",Jee,[ue("div",$ee,[ue("div",ete,[ue("span",{onClick:e[6]||(e[6]=ae=>this.settings.showInfoPanel=!1)},e[40]||(e[40]=[ue("i",{class:"pi pi-times-circle"},null,-1)]))]),ue("div",tte,[s.manifestInfo.thumbnail?(G(),se("div",nte,[ue("img",{src:s.manifestInfo.thumbnail,alt:s.manifestInfo.label},null,8,ite)])):qe("",!0),ue("div",null,[ue("div",rte,lt(s.manifestInfo.label),1),s.collectionInfo?(G(),se("div",ste,[Jn(lt(t.$t("ui.collection"))+": ",1),ue("a",{onClick:e[7]||(e[7]=$f(ae=>r.showCollectionPanel=!0,["prevent"])),href:"#"},lt(s.collectionInfo.label),1)])):qe("",!0)])])]),ue("div",ote,[ue("div",ate,[ue("div",lte,[Jn(lt(t.$t("ui.currentlyViewing"))+" ",1),ue("span",null,"("+lt(r.navigation.activeIndex+1)+" of "+lt(s.canvases.length)+")",1)]),(o=s.currentCanvasInfo)!=null&&o.label?(G(),se("div",ute,lt(s.currentCanvasInfo.label),1)):qe("",!0)]),s.manifestInfo.requiredStatement?(G(),se("div",cte,[ue("div",dte,lt(s.manifestInfo.requiredStatement.label),1),ue("div",hte,[i.HtmlUtility.detectHtml(s.manifestInfo.requiredStatement.value)?(G(),se("div",{key:0,innerHTML:i.HtmlUtility.sanitizeHtml(s.manifestInfo.requiredStatement.value)},null,8,pte)):(G(),se(xt,{key:1},[Jn(lt(s.manifestInfo.requiredStatement.value),1)],64))])])):qe("",!0)])])):qe("",!0),ue("div",fte,[n.showFullScreenButton?(G(),se(xt,{key:0},[r.isInFullscreen?(G(),Ct(y,{key:1,rounded:"",icon:"pi pi-window-minimize",class:"mr-2",title:t.$t("ui.exitFullscreen"),onClick:s.toggleFullscreen},null,8,["title","onClick"])):(G(),Ct(y,{key:0,rounded:"",icon:"pi pi-window-maximize",class:"mr-2",title:t.$t("ui.fullscreen"),onClick:s.toggleFullscreen},null,8,["title","onClick"]))],64)):qe("",!0),n.showCollectionPaneButton?(G(),se(xt,{key:1},[s.collectionInfo?(G(),Ct(y,{key:0,rounded:"",icon:"pi pi-book",class:"mr-2",title:t.$t("ui.collection"),onClick:e[8]||(e[8]=ae=>r.showCollectionPanel=!0)},null,8,["title"])):qe("",!0)],64)):qe("",!0),n.showIndexButton?(G(),Ct(y,{key:2,rounded:"",icon:"pi pi-list",class:"mr-2",title:t.$t("ui.index"),onClick:s.openIndexPanel},null,8,["title","onClick"])):qe("",!0),n.showAnnotationViewButton&&n.displayAnnotations?(G(),se(xt,{key:3},[s.hasAnnotation?(G(),Ct(y,{key:0,rounded:"",class:"mr-2",icon:r.viewMode==="table"?"pi pi-image":"pi pi-comment",title:r.viewMode==="table"?t.$t("ui.images"):t.$t("ui.annotations"),onClick:s.toggleViewMode},null,8,["icon","title","onClick"])):qe("",!0)],64)):qe("",!0),n.showAboutPaneButton?(G(),Ct(y,{key:4,rounded:"",icon:"pi pi-info-circle",class:"mr-2",title:t.$t("ui.about"),onClick:e[9]||(e[9]=ae=>r.showAboutPanel=!0)},null,8,["title"])):qe("",!0),n.showSettingPaneButton?(G(),Ct(y,{key:5,rounded:"",icon:"pi pi-cog",title:t.$t("ui.settings"),onClick:e[10]||(e[10]=ae=>r.showSettingsPanel=!0)},null,8,["title"])):qe("",!0)]),gt(lu,{name:"slide"},{default:jt(()=>[r.showSettingsPanel?(G(),se("div",mte,[ue("div",gte,[gt(y,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[11]||(e[11]=ae=>r.showSettingsPanel=!1)})]),ue("h3",null,[e[41]||(e[41]=ue("i",{class:"pi pi-cog"},null,-1)),Jn(" "+lt(t.$t("ui.settings")),1)]),ue("div",yte,[ue("div",vte,[ue("h4",bte,lt(t.$t("ui.preference")),1),ue("div",wte,[ue("label",_te,lt(t.$t("ui.language")),1),gt(w,{id:"filterLang",modelValue:t.$i18n.locale,"onUpdate:modelValue":e[12]||(e[12]=ae=>t.$i18n.locale=ae),options:r.settings.language.options,"option-label":"label","option-value":"value","append-to":"self",onChange:s.onPrefLanguageChange},null,8,["modelValue","options","onChange"])])]),n.displayAnnotations&&s.hasAnnotation?(G(),se("div",Ste,[ue("h4",Tte,lt(t.$t("ui.annotationFilters")),1),ue("div",Ete,[ue("label",xte,lt(t.$t("ui.show")),1),gt(w,{id:"filterSet",modelValue:r.settings.filters.set,"onUpdate:modelValue":e[13]||(e[13]=ae=>r.settings.filters.set=ae),options:s.filterSetOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])]),ue("div",Cte,[ue("label",Ate,lt(t.$t("ui.language")),1),gt(w,{id:"filterLang",modelValue:r.settings.filters.language,"onUpdate:modelValue":e[14]||(e[14]=ae=>r.settings.filters.language=ae),options:s.filterLanguageOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])]),ue("div",kte,[ue("label",Pte,lt(t.$t("ui.lineColor")),1),gt(w,{id:"filterLine",modelValue:r.settings.filters.line,"onUpdate:modelValue":e[15]||(e[15]=ae=>r.settings.filters.line=ae),options:s.filterLineOptions,"option-label":"label","option-value":"value","append-to":"self"},{value:jt(ae=>[ae.value?(G(),se("div",Dte,[ae.value==="all"?(G(),se("div",Ite,lt(t.$t("ui.allLineColors")),1)):(G(),se("div",{key:1,style:hi(`width:100%;height:20px;background-color:${ae.value}`)},null,4))])):(G(),se("span",Ote,lt(ae.placeholder),1))]),option:jt(ae=>[ue("div",Rte,[ae.option.value==="all"?(G(),se("div",Lte,lt(ae.option.label),1)):qe("",!0),ue("div",{style:hi(`width:100%;height:20px;background-color:${ae.option.value}`)},null,4)])]),_:1},8,["modelValue","options"])]),ue("div",Mte,[ue("label",Nte,lt(t.$t("ui.lineWeight")),1),gt(w,{id:"filterLang",modelValue:r.settings.filters.weight,"onUpdate:modelValue":e[16]||(e[16]=ae=>r.settings.filters.weight=ae),options:s.filterWeightOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])])])):qe("",!0),ue("div",Fte,[ue("h4",Bte,lt(t.$t("ui.display")),1),n.displayAnnotations&&r.viewMode==="image"?(G(),se("div",Ute,[ue("div",null,[e[42]||(e[42]=ue("i",{class:"pi pi-sun"},null,-1)),Jn(" "+lt(t.$t("ui.light")),1)]),gt(C,{modelValue:r.settings.light,"onUpdate:modelValue":e[17]||(e[17]=ae=>r.settings.light=ae),class:"w-10rem"},null,8,["modelValue"]),ue("span",null,lt(r.settings.light)+"%",1)])):qe("",!0),r.viewMode==="image"?(G(),se("div",Hte,[ue("div",null,[e[43]||(e[43]=ue("i",{class:"pi pi-info-circle"},null,-1)),Jn(" "+lt(t.$t("ui.informationPanel")),1)]),gt(D,{modelValue:r.settings.showInfoPanel,"onUpdate:modelValue":e[18]||(e[18]=ae=>r.settings.showInfoPanel=ae)},null,8,["modelValue"])])):qe("",!0),n.displayAnnotations&&r.viewMode==="table"&&s.hasAnnotation?(G(),se("div",zte,[ue("div",jte,lt(t.$t("ui.tableColumns")),1),ue("div",Vte,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Title,"onUpdate:modelValue":e[19]||(e[19]=ae=>r.settings.tableColumns.Title=ae),"input-id":"tcTitle",binary:!0},null,8,["modelValue"]),ue("label",Wte,lt(t.$t("ui.title")),1)]),ue("div",qte,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Description,"onUpdate:modelValue":e[20]||(e[20]=ae=>r.settings.tableColumns.Description=ae),"input-id":"tcDescription",binary:!0},null,8,["modelValue"]),ue("label",Gte,lt(t.$t("ui.description")),1)]),ue("div",Kte,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Links,"onUpdate:modelValue":e[21]||(e[21]=ae=>r.settings.tableColumns.Links=ae),"input-id":"tcLinks",binary:!0},null,8,["modelValue"]),ue("label",Yte,lt(t.$t("ui.links")),1)]),ue("div",Xte,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Tags,"onUpdate:modelValue":e[22]||(e[22]=ae=>r.settings.tableColumns.Tags=ae),"input-id":"tcTags",binary:!0},null,8,["modelValue"]),ue("label",Zte,lt(t.$t("ui.tags")),1)]),ue("div",Qte,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Notes,"onUpdate:modelValue":e[23]||(e[23]=ae=>r.settings.tableColumns.Notes=ae),"input-id":"tcNotes",binary:!0},null,8,["modelValue"]),ue("label",Jte,lt(t.$t("ui.notes")),1)]),ue("div",$te,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Attribution,"onUpdate:modelValue":e[24]||(e[24]=ae=>r.settings.tableColumns.Attribution=ae),"input-id":"tcAttribution",binary:!0},null,8,["modelValue"]),ue("label",ene,lt(t.$t("ui.attribution")),1)]),ue("div",tne,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Date,"onUpdate:modelValue":e[25]||(e[25]=ae=>r.settings.tableColumns.Date=ae),"input-id":"tcDate",binary:!0},null,8,["modelValue"]),ue("label",nne,lt(t.$t("ui.date")),1)]),ue("div",ine,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns["Line Color"],"onUpdate:modelValue":e[26]||(e[26]=ae=>r.settings.tableColumns["Line Color"]=ae),"input-id":"tcLineColor",binary:!0},null,8,["modelValue"]),ue("label",rne,lt(t.$t("ui.lineColor")),1)]),ue("div",sne,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns["Line Weight"],"onUpdate:modelValue":e[27]||(e[27]=ae=>r.settings.tableColumns["Line Weight"]=ae),"input-id":"tcLineWeight",binary:!0},null,8,["modelValue"]),ue("label",one,lt(t.$t("ui.lineWeight")),1)]),ue("div",ane,[gt(P,{class:"mr-2",modelValue:r.settings.tableColumns.Comments,"onUpdate:modelValue":e[28]||(e[28]=ae=>r.settings.tableColumns.Comments=ae),"input-id":"tcComments",binary:!0},null,8,["modelValue"]),ue("label",lne,lt(t.$t("ui.comments")),1)])])):qe("",!0)])])])):qe("",!0)]),_:1}),gt(lu,{name:"slide"},{default:jt(()=>[r.showAboutPanel?(G(),se("div",une,[ue("div",cne,[gt(y,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[29]||(e[29]=ae=>r.showAboutPanel=!1)})]),gt(M,{"resource-info":s.manifestInfo,"card-title":t.$t("ui.about")},null,8,["resource-info","card-title"]),s.currentCanvasInfo?(G(),Ct(M,{key:0,"resource-info":s.currentCanvasInfo,"card-title":t.$t("ui.canvasInformation")},null,8,["resource-info","card-title"])):qe("",!0),ue("div",dne,[ue("span",hne,"Powered by Glycerine Viewer (v"+lt(i.version)+")",1),e[44]||(e[44]=ue("a",{target:"_blank",class:"mr-2",title:"Website",href:"https://glycerine.io/viewer/"},[ue("i",{class:"pi pi-globe"})],-1)),e[45]||(e[45]=ue("a",{target:"_blank",title:"GitHub",href:"https://github.com/Systemik-Solutions/glycerine-viewer"},[ue("i",{class:"pi pi-github"})],-1))])])):qe("",!0)]),_:1}),gt(lu,{name:"slide"},{default:jt(()=>[r.showCollectionPanel?(G(),se("div",pne,[ue("div",fne,[gt(y,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[30]||(e[30]=ae=>r.showCollectionPanel=!1)})]),gt(M,{"resource-info":s.collectionInfo,"card-title":t.$t("ui.collection"),"title-icon":"book",toggleable:!0,collapsed:!0},null,8,["resource-info","card-title"]),s.collectionInfo.items.length>0?(G(),se("div",mne,[ue("div",gne,null,512),gt($,{value:s.collectionInfo.items,tableClass:"w-full",paginator:"",rows:r.collectionTableOptions.rowsPerPage,selectionMode:"single",dataKey:"id",paginatorTemplate:"PrevPageLink JumpToPageDropdown NextPageLink",filters:r.collectionTableOptions.searchFilter,"onUpdate:filters":e[32]||(e[32]=ae=>r.collectionTableOptions.searchFilter=ae),globalFilterFields:["label"],onPage:s.collectionTableScrollTop,selection:s.collectionTableActiveItem,onRowSelect:s.onCollectionItemRowSelect,first:s.collectionTableFirstIndex},{header:jt(()=>[ue("div",yne,[ue("div",vne,[e[46]||(e[46]=ue("i",{class:"pi pi-search"},null,-1)),gt(F,{modelValue:r.collectionTableOptions.searchFilter.global.value,"onUpdate:modelValue":e[31]||(e[31]=ae=>r.collectionTableOptions.searchFilter.global.value=ae),placeholder:t.$t("ui.search"),class:"w-full"},null,8,["modelValue","placeholder"])])])]),empty:jt(()=>[Jn(lt(t.$t("message.noResults")),1)]),default:jt(()=>[gt(K,{style:{width:"20%"},field:"thumbnail",header:t.$t("ui.thumbnail")},{body:jt(ae=>[ae.data.thumbnail?(G(),se("img",{key:0,class:"w-full",src:ae.data.thumbnail,alt:""},null,8,bne)):ae.data.type==="Collection"?(G(),se("div",wne,e[47]||(e[47]=[ue("i",{class:"pi pi-book text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):(G(),se("div",_ne,e[48]||(e[48]=[ue("i",{class:"pi pi-file text-color-secondary",style:{"font-size":"1rem"}},null,-1)])))]),_:1},8,["header"]),gt(K,{style:{width:"80%"},field:"label",header:t.$t("ui.label")},{body:jt(ae=>[ae.data.label?(G(),se("span",Sne,lt(ae.data.label),1)):(G(),se("span",Tne,"NA"))]),_:1},8,["header"])]),_:1},8,["value","rows","filters","onPage","selection","onRowSelect","first"])])):qe("",!0)])):qe("",!0)]),_:1}),gt(lu,{name:"slide"},{default:jt(()=>[r.showIndexPanel?(G(),se("div",Ene,[ue("div",xne,null,512),ue("div",Cne,[gt(y,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[33]||(e[33]=ae=>r.showIndexPanel=!1)})]),ue("h3",null,[e[49]||(e[49]=ue("i",{class:"pi pi-list"},null,-1)),Jn(" "+lt(t.$t("ui.index")),1)]),gt(ve,{class:"gv-index-tabs"},{default:jt(()=>[gt(ee,{header:t.$t("ui.items")},{default:jt(()=>[gt($,{value:s.indexItems,tableClass:"w-full",paginator:"",rows:r.index.rowsPerPage,selectionMode:"single",dataKey:"id",paginatorTemplate:"PrevPageLink JumpToPageDropdown NextPageLink",filters:r.index.searchFilter,"onUpdate:filters":e[35]||(e[35]=ae=>r.index.searchFilter=ae),globalFilterFields:["label"],onPage:s.indexPanelScrollTop,selection:s.activeIndexItem,onRowSelect:s.onIndexRowSelect,first:s.indexTableFirstIndex},{header:jt(()=>[ue("div",Ane,[ue("div",kne,[e[50]||(e[50]=ue("i",{class:"pi pi-search"},null,-1)),gt(F,{modelValue:r.index.searchFilter.global.value,"onUpdate:modelValue":e[34]||(e[34]=ae=>r.index.searchFilter.global.value=ae),placeholder:t.$t("ui.search"),class:"w-full"},null,8,["modelValue","placeholder"])])])]),empty:jt(()=>[Jn(lt(t.$t("message.noResults")),1)]),default:jt(()=>[gt(K,{style:{width:"20%"},field:"thumbnail",header:t.$t("ui.thumbnail")},{body:jt(ae=>[ae.data.thumbnail?(G(),se("img",{key:0,class:"w-full",src:ae.data.thumbnail,alt:""},null,8,Pne)):ae.data.type==="Audio"?(G(),se("div",Dne,e[51]||(e[51]=[ue("i",{class:"pi pi-volume-up text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):ae.data.type==="Video"?(G(),se("div",Ine,e[52]||(e[52]=[ue("i",{class:"pi pi-video text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):qe("",!0)]),_:1},8,["header"]),gt(K,{style:{width:"80%"},field:"label",header:t.$t("ui.label")},{body:jt(ae=>[ae.data.label?(G(),se("span",One,lt(ae.data.label),1)):(G(),se("span",Rne,"NA"))]),_:1},8,["header"])]),_:1},8,["value","rows","filters","onPage","selection","onRowSelect","first"])]),_:1},8,["header"]),s.structureNodes.length>0?(G(),Ct(ee,{key:0,header:t.$t("ui.structures")},{default:jt(()=>[gt(he,{value:s.structureNodes,class:"w-full",selectionMode:"single",selectionKeys:s.selectedStructureNodes,expandedKeys:s.expandedStructureNodes,onNodeSelect:s.onStructureNodeSelect},null,8,["value","selectionKeys","expandedKeys","onNodeSelect"])]),_:1},8,["header"])):qe("",!0)]),_:1})])):qe("",!0)]),_:1})],16)):(G(),se("div",Lne,[ue("img",{class:Lt({"gv-start-logo":!0,animation:s.manifestIsLoading}),src:i.logoPath,alt:"Glycerine"},null,10,Mne),s.manifestHadErrors?(G(),se("div",Nne,[(G(!0),se(xt,null,hn(r.manifestErrors,ae=>(G(),Ct(fe,{style:{"max-width":"400px"},severity:"error",closable:!1},{default:jt(()=>[Jn(lt(ae),1)]),_:2},1024))),256))])):qe("",!0)])),r.showDropZone?(G(),se("div",{key:2,class:"drop-zone w-full h-full overflow-hidden flex flex-column align-items-center justify-content-center gap-2",onDragleave:e[36]||(e[36]=ae=>s.onManifestDragLeave(ae)),onDrop:e[37]||(e[37]=ae=>s.onManifestDrop(ae))},[e[53]||(e[53]=ue("div",null,[ue("i",{class:"pi pi-file",style:{"font-size":"5rem"}})],-1)),ue("div",null,lt(t.$t("ui.dropManifests")),1)],32)):qe("",!0)],32)}const OL=pu(Hee,[["render",Fne],["__scopeId","data-v-f7325bf7"]]),Bne={install(t,e){t.use(O5,{ripple:!0}),t.use(EW),t.component("GlycerineViewer",OL)}};/*! * pinia v2.3.1 * (c) 2025 Eduardo San Martin Morote * @license MIT */let RL;const mb=t=>RL=t,LL=Symbol();function BT(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var ag;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(ag||(ag={}));function Une(){const t=X0(!0),e=t.run(()=>lw({}));let n=[],i=[];const r=aw({install(s){mb(r),r._a=s,s.provide(LL,r),s.config.globalProperties.$pinia=r,i.forEach(o=>n.push(o)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return r}const ML=()=>{};function NL(t,e,n,i=ML){t.push(e);const r=()=>{const s=t.indexOf(e);s>-1&&(t.splice(s,1),i())};return!n&&Ex()&&a3(r),r}function Wp(t,...e){t.slice().forEach(n=>{n(...e)})}const Hne=t=>t(),FL=Symbol(),UT=Symbol();function HT(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],r=t[n];BT(r)&&BT(i)&&t.hasOwnProperty(n)&&!Mr(i)&&!Kc(i)?t[n]=HT(r,i):t[n]=i}return t}const zne=Symbol();function jne(t){return!BT(t)||!t.hasOwnProperty(zne)}const{assign:bd}=Object;function Vne(t){return!!(Mr(t)&&t.effect)}function Wne(t,e,n,i){const{state:r,actions:s,getters:o}=e,u=n.state.value[t];let d;function h(){u||(n.state.value[t]=r?r():{});const g=O3(n.state.value[t]);return bd(g,s,Object.keys(o||{}).reduce((y,w)=>(y[w]=aw($c(()=>{mb(n);const C=n._s.get(t);return o[w].call(C,C)})),y),{}))}return d=BL(t,h,e,n,i,!0),d}function BL(t,e,n={},i,r,s){let o;const u=bd({actions:{}},n),d={deep:!0};let h,g,y=[],w=[],C;const D=i.state.value[t];!s&&!D&&(i.state.value[t]={}),lw({});let P;function M(ae){let xe;h=g=!1,typeof ae=="function"?(ae(i.state.value[t]),xe={type:ag.patchFunction,storeId:t,events:C}):(HT(i.state.value[t],ae),xe={type:ag.patchObject,payload:ae,storeId:t,events:C});const Qe=P=Symbol();Yx().then(()=>{P===Qe&&(h=!0)}),g=!0,Wp(y,xe,i.state.value[t])}const F=s?function(){const{state:xe}=n,Qe=xe?xe():{};this.$patch(ot=>{bd(ot,Qe)})}:ML;function K(){o.stop(),y=[],w=[],i._s.delete(t)}const $=(ae,xe="")=>{if(FL in ae)return ae[UT]=xe,ae;const Qe=function(){mb(i);const ot=Array.from(arguments),et=[],pt=[];function Wt(Xt){et.push(Xt)}function pn(Xt){pt.push(Xt)}Wp(w,{args:ot,name:Qe[UT],store:he,after:Wt,onError:pn});let Ut;try{Ut=ae.apply(this&&this.$id===t?this:he,ot)}catch(Xt){throw Wp(pt,Xt),Xt}return Ut instanceof Promise?Ut.then(Xt=>(Wp(et,Xt),Xt)).catch(Xt=>(Wp(pt,Xt),Promise.reject(Xt))):(Wp(et,Ut),Ut)};return Qe[FL]=!0,Qe[UT]=xe,Qe},ee={_p:i,$id:t,$onAction:NL.bind(null,w),$patch:M,$reset:F,$subscribe(ae,xe={}){const Qe=NL(y,ae,xe.detached,()=>ot()),ot=o.run(()=>Kd(()=>i.state.value[t],et=>{(xe.flush==="sync"?g:h)&&ae({storeId:t,type:ag.direct,events:C},et)},bd({},d,xe)));return Qe},$dispose:K},he=Fh(ee);i._s.set(t,he);const fe=(i._a&&i._a.runWithContext||Hne)(()=>i._e.run(()=>(o=X0()).run(()=>e({action:$}))));for(const ae in fe){const xe=fe[ae];if(Mr(xe)&&!Vne(xe)||Kc(xe))s||(D&&jne(xe)&&(Mr(xe)?xe.value=D[ae]:HT(xe,D[ae])),i.state.value[t][ae]=xe);else if(typeof xe=="function"){const Qe=$(xe,ae);fe[ae]=Qe,u.actions[ae]=xe}}return bd(he,fe),bd(Rn(he),fe),Object.defineProperty(he,"$state",{get:()=>i.state.value[t],set:ae=>{M(xe=>{bd(xe,ae)})}}),i._p.forEach(ae=>{bd(he,o.run(()=>ae({store:he,app:i._a,pinia:i,options:u})))}),D&&s&&n.hydrate&&n.hydrate(he.$state,D),h=!0,g=!0,he}/*! #__NO_SIDE_EFFECTS__ */function qne(t,e,n){let i,r;const s=typeof e=="function";i=t,r=s?n:e;function o(u,d){const h=m6();return u=u||(h?jh(LL,null):null),u&&mb(u),u=RL,u._s.has(i)||(s?BL(i,e,r,u):Wne(i,r,u)),u._s.get(i)}return o.$id=i,o}function zT(t){t.$_ptooltipModifiers.focus?(t.addEventListener("focus",zL),t.addEventListener("blur",jL)):(t.addEventListener("mouseenter",UL),t.addEventListener("mouseleave",HL),t.addEventListener("click",VL)),t.addEventListener("keydown",WL)}function jT(t){t.$_ptooltipModifiers.focus?(t.removeEventListener("focus",zL),t.removeEventListener("blur",jL)):(t.removeEventListener("mouseenter",UL),t.removeEventListener("mouseleave",HL),t.removeEventListener("click",VL)),t.removeEventListener("keydown",WL)}function Gne(t){t.$_ptooltipScrollHandler||(t.$_ptooltipScrollHandler=new Ay(t,function(){qp(t)})),t.$_ptooltipScrollHandler.bindScrollListener()}function Kne(t){t.$_ptooltipScrollHandler&&t.$_ptooltipScrollHandler.unbindScrollListener()}function UL(t){qL(t.currentTarget)}function HL(t){qp(t.currentTarget)}function zL(t){qL(t.currentTarget)}function jL(t){qp(t.currentTarget)}function VL(t){qp(t.currentTarget)}function WL(t){t.code==="Escape"&&qp(t.currentTarget)}function qL(t){if(t.$_ptooltipDisabled)return;let e=Yne(t);Xne(t),Ne.fadeIn(e,250),window.addEventListener("resize",function n(){Ne.isTouchDevice()||qp(t),this.removeEventListener("resize",n)}),Gne(t),Lo.set("tooltip",e,t.$_ptooltipZIndex)}function qp(t){GL(t),Kne(t)}function yh(t){return document.getElementById(t.$_ptooltipId)}function Yne(t){const e=t.$_ptooltipIdAttr!==""?t.$_ptooltipIdAttr:Xs()+"_tooltip";t.$_ptooltipId=e;let n=document.createElement("div");n.id=e;let i=document.createElement("div");i.className="p-tooltip-arrow",n.appendChild(i);let r=document.createElement("div");return r.className="p-tooltip-text",t.$_ptooltipEscape?r.innerHTML=t.$_ptooltipValue:(r.innerHTML="",r.appendChild(document.createTextNode(t.$_ptooltipValue))),n.setAttribute("role","tooltip"),n.appendChild(r),document.body.appendChild(n),n.style.display="inline-block",t.$_ptooltipFitContent&&(n.style.width="fit-content"),n}function GL(t){if(t){let e=yh(t);e&&e.parentElement&&(Lo.clear(e),document.body.removeChild(e)),t.$_ptooltipId=null}}function Xne(t){const e=t.$_ptooltipModifiers;e.top?(lg(t),il(t)&&(ug(t),il(t)&&lg(t))):e.left?(WT(t),il(t)&&(VT(t),il(t)&&(lg(t),il(t)&&(ug(t),il(t)&&WT(t))))):e.bottom?(ug(t),il(t)&&(lg(t),il(t)&&ug(t))):(VT(t),il(t)&&(WT(t),il(t)&&(lg(t),il(t)&&(ug(t),il(t)&&VT(t)))))}function gb(t){let e=t.getBoundingClientRect(),n=e.left+Ne.getWindowScrollLeft(),i=e.top+Ne.getWindowScrollTop();return{left:n,top:i}}function VT(t){yb(t,"right");let e=yh(t),n=gb(t),i=n.left+Ne.getOuterWidth(t),r=n.top+(Ne.getOuterHeight(t)-Ne.getOuterHeight(e))/2;e.style.left=i+"px",e.style.top=r+"px"}function WT(t){yb(t,"left");let e=yh(t),n=gb(t),i=n.left-Ne.getOuterWidth(e),r=n.top+(Ne.getOuterHeight(t)-Ne.getOuterHeight(e))/2;e.style.left=i+"px",e.style.top=r+"px"}function lg(t){yb(t,"top");let e=yh(t),n=gb(t),i=n.left+(Ne.getOuterWidth(t)-Ne.getOuterWidth(e))/2,r=n.top-Ne.getOuterHeight(e);e.style.left=i+"px",e.style.top=r+"px"}function ug(t){yb(t,"bottom");let e=yh(t),n=gb(t),i=n.left+(Ne.getOuterWidth(t)-Ne.getOuterWidth(e))/2,r=n.top+Ne.getOuterHeight(t);e.style.left=i+"px",e.style.top=r+"px"}function yb(t,e){let n=yh(t);n.style.left="-999px",n.style.top="-999px",n.className=`p-tooltip p-component p-tooltip-${e} ${t.$_ptooltipClass||""}`}function il(t){let e=yh(t),n=e.getBoundingClientRect(),i=n.top,r=n.left,s=Ne.getOuterWidth(e),o=Ne.getOuterHeight(e),u=Ne.getViewport();return r+s>u.width||r<0||i<0||i+o>u.height}function qT(t){return Ne.hasClass(t,"p-inputwrapper")?Ne.findSingle(t,"input"):t}function KL(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&typeof t.arg=="object"?Object.entries(t.arg).reduce((e,[n,i])=>((n==="event"||n==="position")&&(e[i]=!0),e),{}):{}}const Zne={beforeMount(t,e){let n=qT(t);if(n.$_ptooltipModifiers=KL(e),e.value){if(typeof e.value=="string")n.$_ptooltipValue=e.value,n.$_ptooltipDisabled=!1,n.$_ptooltipEscape=!1,n.$_ptooltipClass=null,n.$_ptooltipFitContent=!0,n.$_ptooltipIdAttr="";else if(typeof e.value=="object"&&e.value){if(Nt.isEmpty(e.value.value)||e.value.value.trim()==="")return;n.$_ptooltipValue=e.value.value,n.$_ptooltipDisabled=!!e.value.disabled===e.value.disabled?e.value.disabled:!1,n.$_ptooltipEscape=!!e.value.escape===e.value.escape?e.value.escape:!1,n.$_ptooltipClass=e.value.class,n.$_ptooltipFitContent=!!e.value.fitContent===e.value.fitContent?e.value.fitContent:!0,n.$_ptooltipIdAttr=e.value.id||""}}else return;n.$_ptooltipZIndex=e.instance.$primevue&&e.instance.$primevue.config&&e.instance.$primevue.config.zIndex.tooltip,zT(n)},unmounted(t){let e=qT(t);GL(e),jT(e),e.$_ptooltipScrollHandler&&(e.$_ptooltipScrollHandler.destroy(),e.$_ptooltipScrollHandler=null)},updated(t,e){let n=qT(t);if(n.$_ptooltipModifiers=KL(e),!e.value){jT(n);return}if(typeof e.value=="string")n.$_ptooltipValue=e.value,n.$_ptooltipDisabled=!1,n.$_ptooltipEscape=!1,n.$_ptooltipClass=null,n.$_ptooltipIdAttr="",zT(n);else if(typeof e.value=="object"&&e.value)if(Nt.isEmpty(e.value.value)||e.value.value.trim()===""){jT(n);return}else n.$_ptooltipValue=e.value.value,n.$_ptooltipDisabled=!!e.value.disabled===e.value.disabled?e.value.disabled:!1,n.$_ptooltipEscape=!!e.value.escape===e.value.escape?e.value.escape:!1,n.$_ptooltipClass=e.value.class,n.$_ptooltipFitContent=!!e.value.fitContent===e.value.fitContent?e.value.fitContent:!0,n.$_ptooltipIdAttr=e.value.id||"",zT(n)}};var Gp=AA();const Qne=Symbol();var Jne={install:t=>{const e={require:n=>{Gp.emit("confirm",n)},close:()=>{Gp.emit("close")}};t.config.globalProperties.$confirm=e,t.provide(Qne,e)}};const $ne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAEvCAYAAACzLzNmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAADWmSURBVHhe7d0HXFXl/wfw51wue8oegrgAt+YEFNwrZ5lajjRnmf5alv0qG/5tmf3KpjNnmmmpGSoucCsqbhkiLmSJ7A33/O+5fi0t7uLuez/vV8jz/R5UwqsfznPOeR6O53kGAAAApk1E7wEAAMCEIdABAADMAAIdAADADOAaej1U1UhsSipqnGtqJdbV0jehZyMWVYmtRNVOduJia+l72QcCAADoCQJdRRXVtXa/n7z57NaTN587cjW7L7Xr1KeNX8yYyCarh3UK/JVaAAAAOoVAV0II8p8OpM76fs/VN3KLKn2prZJGXo5przzZauGo8OD1OGsHAABdQqArcD27uPm4r+P/TM8paU6temnZ0PX8mtlRwwM9HG9SCwAAQKsQ6HL8cfr2qFdWnVxVWlXjTC2NuDna5K2YGTm6ewufA9QCAADQGgR6HU6m5nZ/etGBAzUSXnbDm7bYWYvK9s4f2LG5n0sStQAAALQCj639Q8b9ssDJ3x3+TdthLqioljhIf+3fi8qrXakFAACgFQj0f3j75zPf3C+p8qJS665lFYct+PXcZ1QCAABoBQL9EWeu53WLPZcxnEqd2XA4bWpSRmFrKgEAADSGQH/EB78kfkFDnZLwzGrRtosfUAkAAKAxBDrJKazwTUjLjaBS52IvZAx5uMocAACAphDo5GhyTk/GOI5Knauu5W3P37jfiUoAAACNINDJsaRsaaDr19nreV1pCAAAoBEEOskuqPCjod7czS9rSEMAAACNINBJRn5pEA31Jr+4yoOGAAAAGsFKcaTda9szsovK/anUi35t/f9wsrMqySmu9I4M8YkPD/WO79TU4zg2clGfsIlOZbXErqqm1lb63lbY2tZaLKqytbaqELa2Fd7bikWV9OEAAGYHgU76fLg78fLtgvZU6sWY8Mard5+/M6ywrNqdWrLlYTs28zz+MOCfaOJxEkH0b7Hn7w7Zez5jyNn0vK7q/Lm1C3I/3amZ+/GnujX+uWMTjxPUBgAweQh0MnHJ4e2xFzKGUakXo8KD1245fmMilXWytuIqOzX1PCGEe0SI9Ay+mecxO+nZJh22OMKiPN/tujr3ek5JCLXqrUNjj5Mv9G7+3TPhweuoBQBgshDoZO7ahB/XHUqbQaVeDGgfsG3PuYwRVKpEbMVVdQj2SIiQBrwQ8l2aex1xsLEqo8NmqaC0qsFPB1NnrdifMjuvuNKb2loT6OGYPnNA2JfPdm+yyty/lgBgvhDo5M+zd56a8v2RrVTqRddmXodOXsuNorJerDhW0zbY48yDgPeKjwj1iTOnUDpyNbu3sL5+amZRS2rpTJsgt7OLn+86rW2jBmepBQBgMhDopLSyxil0zta8mlrehlo65WgjLra1EZXdL6nyoZZW/DPguzX3PuxkJy6mwyZD+rLkvtl15a1Pf7/wf8JSudTWOWEG5IuJXWaMjWy8mloAACYBgf6IGUuPbdyecGsslTolDYxVm46mv0Clzog4Vts6sME52TV4mqZ3sbcupMNGKb+0yn3W8mPrD1zKGkQtvRNuWPx0QqeX7G2syqkFAGDUEOiPuHWvNLj7u39eraqR2FFLJ6RnzEVvjWz37nsbzyyhlh7xfMuGbhciQh/cRS8N+bgGjjb36aDBZRWU+49fcmjnpVv5HahlMF2aeR5Z/5/oIcb+DRAAgACB/g8f/pq46Ic9yW9QqRPvP9P+jRf6hHybeD2vy4mUnKjjyTlRCWn3Isqqap3oQ/SI50P8XK5EhEkDPsQ7Pqql7z5DBfz9kiqPEZ/tjU/JLG5FLYNrH+x+attbfaIt+ckCADANCPR/EHZAe2bxwX0nUjS7WU2e3q19dwlnfSKOk1BLplbCW124mf+EEPDHknOiT6Xmdi8sr25Ah/Xo8YCPDPM56Olsm0sHdaakosb56S/27z9/I78ztYxG/7YBO1bN6v602IqroRYAgNFBoNfhXlGld/T7MRe1/YhUU2/n5F3v9e+qyhSu9I+FS8oobH0sJSf6QchnR+UVa/cGOlUJn3d4mDTcQ73jhID3drXLokNa839bzn/67e6rb1FpdD4a0+HV6f1Cv6ISAMDoINDluJ1X2uj5bw5tv3KnsB21NCJM3a6dHTVckzBMvlvUUgj3EynZUcdTcqOyCioC6JBeNfJyTBOuwQvX3yPDvA/6N3C4Q4fq5fDV7D6jFx+Mlb4SjXZvAeHu933zB3YMC3C9RC0AAKOCQFegvKrWfu66U0u3HL85gVr1Mj6q6bIvJnbW+qI1N3NLmgjBLrsOL327mVvalA7pVYCHw01hFTsh4KNb+e5VJ+CraiQ20fNjLqXnlDSnltFqG9TgzK53+3e1EnG11AIAMBoIdBUI17TfXJfw47Ws4jBqqaRlQ9fzwjPNwnrs1NKpnMIK36PJOT0fXodPzSxsIf0j5uiw3jwa8MKjco28nK7ToX9ZtP3SB4v/uPQ+lUYPU+8AYKwQ6GrYlnBrTPzlrP7xlzP73s0vr3O71SbeTilRrXz39Wrlt2dA+4Ad1DYI4Xnuh+EuvL98u6CdPhdpecjXzS6DbrCLEx6Va+rjnCL0hRmQdq9vu1tUXu0m+0ATINxPEL9gcGvcIAcAxgaBXk/SLxsn4XmR8CbUwl3rwpv0fNhov6DCneQnUnN6nEq51/1IUnbPs+l54XRIrzycbbIjQn0OtQ5skPjJ7xc+prbJ+GF6xLMjuwRtohIAwCgg0C2YsIf4ydTcHg+vw59Ju9e1upa3pcM65epgfT/A3eG2tm461KfwEK/439/s05NKAACjgECHv1TWSGz1tdiNNBTjpN9ImGgo8vzJT4Y2U3RvAACAviHQQS5dLnbTs6XvnrgrWQOoNDm4OQ4AjA0CHVQm3DegrcVu2gS5nbl4q6AjlSanf/uA7Wtf7qHWXvYAALqEQAeNpGUXh8im6GVvuVEZeWWN6JBcwvXzwrJqdypNkpujTV7S1095UgkAYHAIdNCqu/llDQ9dye77MOTrWuymb1v/nfsu3B1CpcnKWDZGjEVmAMBYINBBp+pa7OatEW3f+2zbxf+jDzFZ178b5eRgKy6lEgDAoBDooFfCYjfZBeV+Pd/fZfJroid9/ZS7m6NNPpUAAAZltJthgHkS9lo3l7Na6bfCel9WFwBAHgQ66F2thBfT0KQ9XCUQAMAY4B8k0DsrkXmsgy4s9UtDAACDQ6CD3pnLxiacbNYdAMA4INBB72zEVpU0NGk2YlEVDQEADA6BDnrnYGNVRkOTZmttVUFDAACDQ6CD3pnDXe7CSnFYVAYAjAkCHQxC2IKUhiapS3OvIzQEADAKCHQwiIhQnzgamqTuod4m/fkDgPlBoINBDOoQsI2GJojnB3ZouJ0KAACjgEAHg2gd1OBcU2/nZCpNSniI96EgT8d0KgEAjAICHQxmUu/mP9DQpIyParachgAARgOBDgYzPqrpMld7a5Pa3KSxt1Pq8M5Bv1AJAGA0EOhgMPY2VuUzB4R9SaVJmNk/7EtzWekOAMwLAh0M6qWBLRaZyrX01kENEsdHNcV0OwAYJQQ6GJStWFS56PnOM6g0akte6DoJi8kAgLFCoIPBRYR6x788sMVnVBqlj8Z0eLVlQ7cLVAIAGB2O57FhFBiHwQv3HjubnhdOpdHo3z5g+9qXe4ygEgDAKOEMHYzG+v9EDw31c7lEpVEID/GKWzYjYiyVAABGC4EORsPdySZvy9zefdsGNThDLYPq1NTj2JrZUSPssKsaAJgATLmD0SmrqnV4cfmxDXsSMww2zT0hqunSRRM7z6QSAMDoIdDBKElfltx3e67O/Xjr+Y8lPLOits6JrbiqLyZ2mTE2svFqagEAmAQEOhi1Eym5PeauS/gxNbOoJbV0pk2Q29nFz3ed1rZRg7PUAgAwGQh0MAk/xia/9vWfl9/OL63ypJbW+DewvzV7cMvPJvdq/j21AABMDgIdTMqGw9en/Ho8faL0zD2KWvXWq5Xf7qe6Nfr5mfDgddQCADBZCHQwSTmFFb67Eu+M2Hvu7pB9l+4+SW2FbK1F5dGt/GKHdwr6tV87/50u9taFdAgAwOQh0MEs7LuQOfhUak73Wp4T1UpqrRjPSTGJSMRJrESi2l6tffYI+5jThwMAmB0EOpiFD39NXPTDnuQ3qPyX+c+0n/vSgLAvqAQAMDtYWAYAAMAMINABAADMAAIdAADADOAaOpgFXEM3U/dvNWU5aS1YbloYX5LnzSpKnVkVvUnHHF+LkxIwK7zYtoq5N7zOtey3jYVE7aa2ShDoYBYQ6GYgK6ktu3WuG38rMZzdvdKBy0puR0cALBLfe9ZHXN//vE+lUvjuFgAMo6LYlZ3ZOplfNWUX/367YrZk2Hm2bf5S7uzvkxDmANIz7gPfzWdF2f5UKoVABwD9uhgzml87fQf7qGMB2/r2Ku7a4YFcdbkTHQWAR2VebU8jpRDoAKAfx9e9zH8WfZNtfOUXLiluKHUBQJGKElcaKYVABwDdOvLTq/zC8Cz2x4JvuMLMIOoCgCrcA6/TSCkEOgDoRuqR/vznPdNZzCdfcqV5PtQFABXxnsHJrGGbBCqVQqADgHYVZgby62f9xn56YQ9XcDeYugCgBj6w7Uluwg8jGCeSUEspPLYGZgGPrRmJ8zuf5X97Z5m2bnLj7V3uMyfPLObsLX0T3ntlcU5ef42ZSFxNHwpgHqysq2TT7MLrW00IdDALCHQDq6m047d/8B13ZusL1KkX3sE1jzWP2s2F9fqThUbHMDtnbHELoCJMuQOAZu6lh/BLhp6rb5jzPiEX+ejpn7LpP/fg3jnpzY1ZPJ61G7IRYQ6gHgQ6ANRfekIUv2R4InfvRih1VMY3jYhlL297gvvPzrbcgDfeZsGdjqhzvRAAHodAB4D6ubR7FL9y4j6upsKBOirhA9ueYDM2duemrB7A/FsmUhsANIRABwD1ndw4k/0851dOUmtNHaV4v5Zn2fPLnuRe3BLOGnU8Sm0A0BIEOgCo5+D377Lt7/9AlVK8Z3AKe+6bUdzsbR1ZaM8YagOAliHQAUB1pzbNYHu/WkCVUnyHEWu5V3e3YK0HbKUWAOgIAh0AVHN5z1P8tvkqnZnzwn8D577FPfP587jRDUA/EOgAoFz6qWj+5//8wjEm/U8x3sqmgpu4dCiLmvY5tQBADxDoAKBYQUYjfs30PzheIqaOXLyD2z3uxV8imbAwDADoFQIdAOST1Ij5tTO3c1VlztSRi/dqcoWbvf0J5t/qLLUAQI8Q6AAgF79z4VdcVnI7KuXiXbzvcDM2RjFXv9vUAgA9Q6ADQN2u7h/Gndgwiyq5eGu7Um7Kmn7MoUEetQDAABDoAPBvFcWu/OY311All3A3u2yLR6+mSdQCAANBoAPAv/C7Fn3KVRa7USkXN3DuPNYsch+VAGBACHQAeFxWchuWsGkGVXLx7Yb8jEfTAIwHAh0AHsNv+e9KZc+b8wGtT8sWjQEAo4FAB4C/CTfC3b3Ymao68SKram7cN6OYSFxDLQAwAgh0APgLf+C792goX/j4b5lbwE2qAMBIINAB4IEbCT24jEudqKoTb+NQxPV+WeXNWQBAfxDoACDDxy97i4Zycb1e+pjZu+ZTCQBGBIEOAIwVZQdwyfFPUlUn3tk7g0VO+opKADAyCHQAYOzcH8/RSC5uwGvvMLFNJZUAYGQQ6ADA+PM7nqVhnXjv5pdYh5FrqQQAI4RAB7B0+bcbc5lJHaiqExcx4VvGcTyVAGCEEOgAlu5S7FM0kq9F7x00AgAjhUAHsHD8jYQoGtaJ9w09z5y9M6kEACOFQAewdNeO96ZR3cJ676QRABgxBDqAJctKastVlztRVScurOefNAQAI4ZAB7Bk109F06hOvIPbPRbU4TiVAGDEEOgAFozPvNqehnUL7RlDIwAwcgh0AAvG5d1sSsM6cf6tztIQAIwcAh3AgvH37zShYd1cvO/SCACMHAIdwFLxEhFXlBVIVd0Q6AAmA4EOYKmKcvxpJB+ePwcwGQh0AEtVVarwcTUZN/+bNAIAI4dAB7BUVWUKA523dclnIqtaKgHAyCHQASxVZakzjerm4onpdgATgkAHsFSVis/QmbMPbogDMCEIdABLdetMJI3q5uh2n0YAYAIQ6ACW6EZCD/7wqlepqpukFv8+AJgQ/IUFsDRCmP80NYarrbGhDgCYAQQ6gCW5e/kJWZgr2WENAEwPAh3AUuSmhfErn9+LMAcwTwh0AEuQfyeYXz7hAFde5E4dADAzCHQAc1ec6ysL85J7ftQBADOEQAcwZ0KYr5CGeUFGY+oAgJlCoAOYq/LCBrIwz73egjqP4+i9PJJaaxoBgAlAoAOYo6oyR7Zy0l65YS7g6b08Jbk+NAIAE4BABzA3NVW2/OqpMezu5Y7UqZuyM/TiPAQ6gAlBoAOYE0mtFb9h1m/cjdNR1JFP2Rl6UXYAjQDABCDQAcyFEOabXt/AJccPpo5CfNexS2lYJ05SY6N0RzYAMBoIdABzwPOcLMwvxYyhjkJ8p9HLuSHvvkKlfCX3MO0OYCIQ6ABmgP/9vaUqh3nrwb9wIxfMYGLbCt7BLZfadUOgA5gMBDqAqdu96FPu9OZpVCkkC/Oxi8cxjntwBd0jKE32Xh4EOoDJQKADmLJ9Sz5gh5a/RZVCfGh0jCzMRVa11GLMvZHCQOfvXulAQwAwcgh0AFMVv3QeO/Dt+1QpxAd3OsSN++6px8JcoOwMPengkzQCACOHQAcwRQmbp7I9iz+hSiFZmE9aMZiJbSqp9RfOv2UiDevEZSZ1YKX5nlQCgBFDoAOYmosxo4Wb4KhSzL/VGVmY2ziUUudxwZ0P0Ui+q/uG0wgAjBgCHcCUJMcP4je9toFjvNK/u7xXk6tsyup+csNc4OB2n/cNPU9VnfikOEy7A5gABDqAqRDCfP2s3zheIqaOXLxbQDo3dV1vZu+aTy35mnSNo1HdUg/3Z7wE/1YAGDn8JQUwBTcSesjCvLbKjjpyycJ8mjTMnb2yqKUQF9ZrJw3rxFVXOLK0472pBAAjhUAHMHZ3Lz/B/zQ1RqUwd/LMlIV5g4Y3qKVc0/ADvK2LwjN5PjlOpeVkAcBwEOgAxiw3LYxf+fxerrrciTpy8fYu99UOcwEnkrAOQ3+mqm5nf38e67oDGDcEOoCxEsJ8+YQDXHmRO3Xk4q3tS7gpa/oxr6ZJ1FIL1/bJTTSsk/A58Ae+fY9KADBCCHQAY5R/J1gW5iX3/KgjlyzMJ68YzPxbnaWW+oI7HeFdfG9TVbejq19hBRmNqAIAI4NABzA2xbm+Koe5lU2FLMyDOx+mVr1x3Z77gYZ14iS11vzuLz6lEgCMDAIdwJiUFzbgV0jDvCCjMXXk4jlRDTf+u6e0EeYyEROX8LbOBVTVibvw51iG9d0BjBICHcBYVJU5spWT9nK511tQRy5ZmI/9chwLjd5FLc3ZOJRyPSb/jyq5+B0ffktDADAiCHQAYyANc3711Bh293JH6sjFM04iC/M2gzdTS3u6v7BYuCZPVZ24W4kR7NCKuVQCgJFAoAMYWk2VrRDm3I3TUdRRiBu5YIZOwlwgnKX3nfMBVXLxuxd9ylIODaQSAIwAAh3AkCS1VvyGWb+pGuZswOtvs86jV1ClG90n/4/3DE6mqk7CWvL8htm/snvpIdQCAANDoAMYCs9z/KbXN3DJ8aqtwtb75Q9Z9Azd32XOiSTcqM8mUyWXsNgNv2rKLlZZ4kItADAgBDqAgQhboHKXYsZQqVjUtM+YClPhWhPU4Tjf8elVVMnFFdxpwq+b9ZvwzQm1AMBAEOgABsDv+mwRd3rzNCoV4juNXs4Gzp1Hpd5wQ9/9D+/mr3QZWe768T58zMdfUgkABoJAB9C33Ys+5Q6vfIMqhYQwl90EZwg2jiXc+O+fokoh7uiaV9jxdS9TCQAGgEAH0Kf4pfPYoeVvUaUQ33rwL7Iw5zieWvrn3zKRjVwwnSrF/ljwDb9zwdfCjX7UAQA9QqAD6EvC5qlsz+JPqFKID42O4cYuHmfQMH+o85jlfJtBKj0mxx1bN4etmLAfO7MB6B8CHUAfpGEu3ARHlUJ8cKdD3LjvnmIiq1pqGRz3zKKJfKOOR6hU7MbpaH7J8LPYyAVAvxDoALp2MWa07I52xiv9+yYL80krBjOxTSW1jIP08+EmrxjEeze/RB2FuPxbzfivhyey9ATVnq8HAI1ZbKDnlVR6Hrma3fvPs3ee2nwsfeK6+LTpW47fGB9z9s7IY8k50fmlVUr3oAZQKjl+EL/ptQ2qhDnzb3VGFuY2DqXUMS7CTXJT1/bhXf1uUUchrrJIttEMO/PbJGoBgA5xPG/4S3T6UlFdaycN7hmbj12fePFWwRPUlqtDY48TE6ObLnu2e5OfqAVG6sNfExf9sCdZ7p3j859pP/elAWFfUKkfNxJ68Csnx3K1VXbUkYv3anKVm/lLJLN3zaeW8RL2al85cR93/05T6ijFNwnfxw16420W0OY0tQBAyywi0MsqaxzXxF2b+f2eq2/kFlX6Ultljbwc0155stXCUeHB662tRNXUBiMyb8OZb1cfTJ1F5b8Ir/KHK5842oiLXRysC53txYUNnGzvN/dzvRoe4n0oPNQr3r+Bwx36MM3cvfwEv/S5eGE1NerIxbsFpHMvbo5gzl5Z1DJ+pfe9+BUT93PZKW2ooxI+rOcf3MA35zHvZleoBQBaYvaBnlNY4Ttj6dFNx1Nyo6lVb33b+u/8YVr4OGd76yJqgYEIf65Hk3N6HkvK7nkyNad7cmZxK0VLlT0a6Ir4udnfCQ/ziosM9ZW+eccFezul0SHVCWG+8vm9XHmR0ss2sjCftq43a9BQ6QIuRqeqVFj6dTd362wkdVQi/bPgWevBm7kBr77LPBpdozYAaMisA/1sel6X5785tL0+Z+XyNPV2Tl4zJ2p4M19nhZtXgHYJAX7oSlZfWYgnZ/e8mVv62HSvssBWNdD/Se2Az00L438cc1SlMHfyzJSdmZtimD9UW23Db3h5K5d0cAh1VCZsA8uC2p/gWvbbxtoM2MIaBKbTIQCoB7MN9KLyatdBC2JPpuUUh1JLa7qFeB369fVefTH9rntVNRKbmMQ7I9cfSpt65GpWH+lLts5c1lWgP6pNkNvZcT2arXgmInido63433uGC9eWfxh9jCu550cduXh7l/uya+ZeTZOoZbp4iYjF/fg2v2/JhxwvqfeiMrxXkyusVf9tXIs+21lgu1PUBgAVmWWgS3heNP7r+J0HLmUNopbWTYhqunTRxM4zqQQdOHQlu+97G8/8LzmzqDW15NJHoD/k62aX8daItu+NiWy8RsRJzzIFxbm+sjAvyGgsqxWQhfmUNf2Yf6uz1DIPt893FbZU5YqyAqlTb7y1XansjN0j8DpzD7zOCWPpe9lbg4bpzNqunD4UAIhZBvrvp26NfXHZsY1U6swf8/pGdm7meYxK0JJzN+53+r+t5z85cjW7L7WU0megPxTq53JpwbMdX40KFF0SHs/icq+3oENy8db2JdyMn6PNLswfqixx4ff+b4FsxTgd4h09soWw50TiKmoBmA2es5JwDfxvMWExp86jV1BbKbML9MoaiW3EOzuTM/LKdL5KVaemHsd2vt1PrRuCQD7h2f+F0iDfcChtqvRVqdYaCYYIdIEbV8YO+K8p8q/OVLonOG9lU8FN+ak/C+58mFrm686FzvyWt1dxOalKZ1cAQD6+WeRe7gXpvxsqMLuFZXYk3BqtjzAXnE7Lizh8NbsPlVBPNbW8eNWB1Fnd3v4jdf2htOnqhrmhOHCV7Be3NUylMOdENdz4756yiDAXNGybwL3yZxs26M25vNiujLoAoCbu2tF+TMWbTs0u0PdeyHiShmqRTVTQ28OhKmLPZwylIdSDcFY+8Zv4Hf/9+cy3hWXVJrM6ny2rZhtc17N21pnUkU8W5mO/HMdCo3dRy3L0mPoFNy8+iO/10gLewTWPugCgjjsXO9FIIbMKdGkocwcvZg6kUn3CnKz0jd79leyKAv7ABQ1+Pwt39U5hmz4f7ErU5c2LumDFatlK100s3OYmdeQTHs2ShXmbwSrtVmaWHBrkcf1emc+9dTiQjfhoJu/Z2PTv7AfQI76y2JWGCplVoJdV1TgWV9So9D/+L3XtUqlCwAuPxdVKeOz/rKZNR9MnDVy45+Td/PIgapkEIcy/d9nK+tqmUkeJEQtmWnSYP0q4M73L2KXca3tasNnb27OoaZ/xrv7KvysCsHCypzxUYFaBXlktsaWh+nhZZCv2j4DnKdp/PX5jwt38sobSAlRw4FLmwDfXJfwg/fOyp5ZJ4JhEFubD7VTacIwtLOnLNlR0pAoe49fiPBs4dx73Vlwwm7k5XDYl798mgY4CABFupmWtB2yhUiGzustdWE2s7evblF/U1JFgL6drkWHecRGhPnFaXRfcjAhhPunbw79X1UiUbliiDuFVrOhbMmXHVfGF83Y23v4MVYp9UdKTfVHWW/g9JcJ6BeOjmi6nQ6BIRZEbSz3ajxeuGRZmBrHCrADpW0NVnu8HMDe8i/cd7ulPp7Dm3WOppZBZBfqdvLKgTm/tUHsKTzjT5jT+5/7fHg34Hi189nu72pnO5hs6cDI1t/sziw/u1XaYC3Qd6O84xrLZjkeoUuyb0u5sYenfT5kg1LWkutyBVZY6P/YmrFIHYG44kYS5+d1Sd1loswr0e0WV3q1f+z2bSqPTzNc5KTzEJy6yhTTkQ7zjLSngkzIKW4/4fH9cQWmVB7W0SpeBPtvhEHvHaR9Viq0v78jeKB5O1d+sOFbzy2u9BnRv4XOAWgAAWmVWgS6s3x4ye2sBlSoTvgR1rxCuW5YS8FkF5f4DPopNyC4q96eW1ukq0F+0P8red95DlWJCmM8tHir9veo+aRS2bf3znX4RYQGuql2EBwBQg1kFurCRR9DMzZVUqoe+DMK9cQbIdhlzDPiSihrnJxfGHlNlPXZjM87uNFvssoMqxbZXtGYzi0bJDfOHfFzs7+6Z37+zr5v9XWoBAGiFWQW6YNDCvScS0/O6UllvwlV1xiTSL5D0nSFO36UeDfjuYT4HPJ1tc+mQyXhv09mvlu9L+Q+VJmOY7UX2o8sWJqrrccZ/2FfZnD1f+ByrZao9vdi9hc++La/36kclAIBWmF2gL4m5Mu/j3y58QqVWPPgKGTrgeT7Uz/VyZJhPXESYd1y3EO9Dxh7wuxMzhk/67vA2Kk1GH5sUtsb1ZyamjdQUOV7ViI0tmMgqmTV1VPPRmA6vTu8X+hWVAAAaM7tAF26M6/bfP1JLKmqUrq9dXw8D3snOqtjHxS7zek5JiKylV8Yd8LfulQb3/XB3YlF5tRu1TIIQ5sIqcHZcDXXkE8J8XOF4Vsarv/yB2Iqr2vFW36gnmnicpBYAgEbMLtAFujhLr8sP0yOeHdklaNO94kqv48k50ceSc3oeTcrqmZJZ1FL/p/GPB7z0/cEGjjb36aDezVl5cvXm4+nPU2kQfqIi5iEqY86iClYisWV5vAO7Wyt/IcFu1jfYJre1KoX5+Wo/NrLghXqF+UMdGnuc3PVOv25UAgBoxCwDvaK61i56fsylm7mlTamlde2D3U/tfrd/ndfqhQ1HjlzN7m3IgJf+ZpKWgW4XIkKl4R7qE9c1xOuwvgI+Mf1+50ELY09RqTd+VkVsmM0lNsT2Mutsc5u6/3a12psdrWnC9lWGsLiqZrJeW/Fd9rvbKuYoUr69dkqNJxuWP5UVSL9B0NRXk7tOHhvZeDWVAAD1ZpaBLkjNLArr99HuMxXVEs3/1f0Hdyeb3L3zB3YMcHeQnxqPEAL+REpO1IOAz+555U5BW3MNeGFd+8Efxx4/fyO/M7V0zkNUyuY57GfP2Z9hVircxPYo4Uz7u7Lu7DPnnayBqJy68t2qdWND8qexHIkzdTQjvJZOfTqsqZOduJhaAAD1YraBLvjj9O1R0348+iuVWmEjFlVseaN33y7NPI9SS23C8/LSYO9lTAEvTNO72FsX0uF6+/3UrbEvLju2kUqde8H+JHvPKZbZc9XUqSfhr4GSPwEhzJ/On8xuSxpQRzteH9r6w7nDW39AJQBAvZh1oAtiz98dMuX7w1uqazW42Emc7cSFa2ZHDZeGYDy1tMIYAl7Esdo2ge6JES28ZEvVdm3udUTdgJe+lLiBC2JPnb91X6W9ezX1rmMse1nF5Vg1lV3rJDsz13aYC1ztrfPPLR4RYG9jpXyKAABADrMPdMGRpJxeLy07tiGnqMKPWmpr7O2U+tPLPUaG+bteppbOCAF/IiW3x7Hk7J7HknJ6Xrqd317Cq/iQs5bUJ+CFjVee+yp+F5U69anzDjbJ/jRVWlTHmXq+xF52zTy11os62ofH2ABAUxYR6ALhRrk1cdde/HbXlTdziyp9qa1UIy/HtDmDW30i3LhkJeJqqa1Xwmpr0rP3aGMP+JGf7487npIbTaXOvGR/hM13VmnzIY0JYT6m4Hl2oUZnq9bK+LrZZZz+bHiw2EqFW+wBAOpgMYH+qIRr9yLir2T1k01v3y5oV1he/dc8qoezTXabIPdzwmNfUS199rVr5K7afpl6ZIwBH+TpdCN6/p8XdX2poLt1GtvstlalFdw0VSqxZiMLpug8zB/6aVb3kYM6NDS5hXgAwDhYZKD/k3Dtl2e8NIk44QeT+4IIAX/qWm6kEO5Hk3N6XriR17GWZ2I6rBfCTXYSIeeF15MOM/285+fMR1RClYoevsbV/LyWloWz90sGUaV7/dsHbF/7co8RVAIAqAWBbobKqmodZI/JGTDgH76qtBnwLzocZe87qbbzWZ0Xw//+rOi9YrkSR9Yp73VWyevnSycWcdXnvhjR0NPFNodaAAAqQ6BbAGMM+LriVhFnroKd8VjMXET120yvTip8Eq8VDWc/V3SkSvdwcxwA1BcC3QIJAZ8gTNEL1+GlIZ94I69zTS1vQ4f1Q/qy44UfpOEuZKqybH3W7iz7n4uSy8sqBPTjlP+EQ5VN2OjCSVTp3rDOgb8smxE5lkoAAJUh0EH2BMDJVOExOeMN+KUuv7Dhdjp/YvBfhL8ebe69ye7xTtTRrQAPh5tnPhsWTCUAgMoQ6PAvQsCfSr3X/Whydk8h6E+k5EbRIb2SvTZlAc+zFM+PlUy3//NbAO2ZXDCW7apqSZXunfp0aOMgT8cbVAIAqASBDkoJAX86LS/8wY5y2T1Pp93rpo2V91TlzMpZqreyzfM0CHT6xkGe94sHsKXlkVTp3tcvdJ00JqLxGioBAFSCQAe1VdZIbIVn+YWA/+3kjefSc0qa0yGdCBbdYyc8l1ClfyvLurJ3Sp6kSvem9Q35esHYJ16hEgBAJSJ6D6AyW7GosnuY90FhQ5G+bf1jhG8JeWFiXDbQ7jeIwnV1L6syquTQ+LdU/Av4W2m8Z41ahJ0CaQgAoDIEOmhECB9hslq4zi2btZb+IItHykjN452TvkiV/Sqa/i6Kp+orJNY00o/ULAQ6AKgPgQ4aSblb2IKGf5HFI2XkX1FZ34CX/oRMZXuPK7j+rRIlswr5vD2N9CMjr6wRDQEAVIZAB40Ul1e70lAxDQI+o9ZVhZl8VX6l+inUc6ALJDyPv5sAoBb8owEaEe6Ap6F6/hnwUkIkCzdpPoxmYSScfNcyK3alRtkGeY/+SmpScoZ/WenvrX3SL4MG/0MAYIkQ6KARbT6+JiQYJw3Xv5Ps71FsVSiN9C+uSqc38dcJgQ4A6kKgg9F6NNFiK1UJdO1Pu8dVNmUlel40DwCgPhDoUG/6PItMrGnIzlUr25dc+HS0G+o/lXehkX7hGjoAqAv/aEC9PXxCTV8+LB1II0Xq+h6jfp/myaogtqfqXzfx64WI4yQ0BABQCQIdTMbxqmB2oLI+17PrN5Ewt2Q4jfRP398sAYDpQ6CDRqytOC1uUK7c68XDWJ7EgSrdeaNoKEup8aJK/xDoAKAuBDpoxN3RLo+GepEpcWXPFUxg5byYOtoXU9mCra/oTJVhcIxDoAOAWhDooBF/D4fbNNSb8zUBbEbhGKq0a09lKJtV9DRVhuFsJy7EGToAqAuBDhpp7uuSREO9Ep5L739/JsuWOFFHcz+WhbPnC8dJz/4N+5haMz9Xg3xNAcC0IdBBI838nA0WPhdq/NkAaaj/WanZneiZtS7SIH+OfVAyiDqGZahvkgDAtCHQQSPN/bQTPsL88sM3dWRJXNiUwmdZ9/uz2dbyNtRVTaHEjq0o78Z63J/D9lQazwZnhvwmCQBMFyesnQ1QX7fulQZ3mfdHOpVqe/Dqk/7Ic38tqS706rtijSNXyZ60vcKGSt+cuArqMlbBi9l9iQO7zzuw2xJ32SNwF2v86Khx2Tq3d6/IUO84KgEAVIJAB41F/vfPpLScYpUXW//7FScsNffv6NYk0E2d8Bjgte+ecbUVi/T6OCAAmD5MuYPGerf1201DhYSgfhDWD9aMrSvMBZYa5oLIMJ84hDkA1AcCHTQWoWR6+EGQS3+U/vcgrJVHtqVOHPVurdo3RwAA/4RAB41FtfTd52BjVUKlzIMQfxDkD8/GH14jV4U6H2s+eH5gh4bbqQAAUAsCHTTmaCsuGdIxaKswfhjkyqbVVWFpZ+kdGnueCvJ0rPcNhgBg2RDooBVhAa6XhCR/EOICDU+xH3xXYFFGdgnaREMAALXhLneot8oaie3WEzfGrdyfMvvy7YL21NaM9OXIS4PcwrKciUVc9bnFIwI8nW1zqQUAoBYEOqgt435Z4Nr4azPWxV+bfr+kSuMtyR5cZ3+weLmlBflDo8Mbr1kypeskKgEA1IZAB5UdS86JXrEvZc7uc3eGS3hmRW0NCK894aqPZb8GrThWc2ThkBaNvZ2uUQsAQG0IdFBI29PqsrNx6UuO5zS5Xc68DOsc+MuyGZFjqQQAqBcEOtQpp7DCd+WBlJe1Pa0O/7b//YHtWwW6nacSAKBeEOjwmDPX87qt2Jc054/Td0bVSHhramtAeH1hWl0eXDsHAG1BoIPWp9WFO7atxaKqsqpaR5yTy+doIy4+9fnQJh5OtveoBQBQbwh0C6btaXVvF7vMSb2a/zA+qunyo8k5PV9cdmwjHYI6/Peptm/PGdzyUyoBADSCQLdA2p5Wbx/sfmpa39AlwzoHbra2ElVTmz2z+EDs4as5/aiERzT3c7lyeMHgVlQCAGgMgW4hdDGtPrRTwy0z+rf4Uhrop6n9mNyiCp9BC2NP3MkrC6YWSNlZi8r2zh/YURrqSdQCANAYAt3MaXta3d3JJndCdLNlU3qHfOvtapdFbbkS0+93HvrJ3qPaucHOPHw1uevksZGNV1MJAKAVCHQzde7G/U5LY6++pu1p9SGdAreou1/3iv0ps9/deHYJlRZtQlSzHxdN7PQilQAAWoNANyPCtPrO07dHLd+XPEca6F2oXW+qTKur6r1NZ79avi/lP1RapL5t/XeuntVjpNiKq6EWAIDWINDNgKGn1VUh4XnRrOXH1v9+6vaz1LIo4SFecRtf7TnIztqqgloAAFqFQDdh2p5WbxXodm5Kn5Bvnu4WvEHdaXVVTVxyeHvshYxhVFqEdsENEra+0aePk524mFoAAFqHQDcx1bUS6x0Jt0dre1p9at+wJR2beJygts7USnirN9YmLNt45PoL1DJr0jPz+A2v9BzsYGNVRi0AAJ1AoJsIYVp9/aG0aasPpr6YU1ThR+1608W0ujoW/3Fp/qLtlz6k0iwN7RT467dTwyfoarYDAOBRCHQjZ4rT6qqSnqVPfnX1qVVUmpWXB7b47N1R7eZRCQCgcwh0I2Tq0+rqOJue12Xq90d+vZtfHkQtk+Zqb52/dGbk2J6tfGOpBQCgFwh0I2Ju0+qqyi+tcp+7NmHpzjO3R1HLJLUNanDmp5d7jAxwd7hNLQAAvUGgGwFznlZXx5bjN8a/t+ns/6QB70ktk2BvY1X65vA270/tG7Lk0bXsAQD0CYFuINqeVhdxrHZg+4bbhVCJCPWOp7bJySup9Hxv05n//Xbi1nhqGbXoFj6xX0zqMj3Qw/EmtQAADAKBrmdCYK05eO1FbU+rT4xuttScpnpPpuZ2XxJz5e39FzMHU8uotA5qkPjKky0XDukYuJVaAAAGhUDXE2Fa/af9qbN+O3Xj2epa3pba9Waq0+rqSr5b1PKrnRff3Z5we7SEZ1bUNpjerX13zRrU8vPIUO84agEAGAUEug5hWl17MvPLAzYfT5+46cj1yek5Jc2prRe+bnYZz4Q3Xvdcj6YrG3s7XaM2AIBRQaDrgLan1YVHoZ6LarJyap/QJbiDmrETKbk9YhLvjDyWnNPz0q38DtTWKmlwp3YP8zkwoEPAjr5t/GOoDQBgtBDoWnT1TmGbH/ckvabtafWRXRpttLexKqc2PKKkosb5RGpOj9NpeeGXb+W3u5pR0OZOXlkwHVaJl4ttVmiA26XWgW7nOzT2OBUZ5nPQ09k2lw4DAJgEBLqGhGn13YkZw1fsT55zMvVeD2rXmyVPq2uL9CXN1UgkYuE9teQSHjPjOIa/BABg8hDo9YRpdQAAMCYIdDVhWh0AAIwRAl0FmFYHAABjh0BXANPqAABgKhDoddD2tHpzP5crU/uEfDM6ovEaTKsDAIAuINBJrYS3ijl7ZySm1QEAwBRZfKAL0+obj1x/YdX+lFna2JMb0+oAAGAIFhvomFYHAABzYlGBru1pdWEJk76tA2Km9gtZ0rOVbyw1AQAA9M4iAr2wrNpt3aFr07U9rT6pZ/MfGnk5Xac2AACAwZh1oAvT6qsOpMz69Xj6hIpqiQO16w3T6gAAYKzMLtAxrQ4AAJbIbAId0+oAAGDJdBbowpmy9JfmeMZznPSdSMQkIo6T0GGtwbQ6AACAFgO9rLLGcVdixoitJ9LHxV/O6lfLMzEd+ou7k03uiM6NfhkVHrz+iSYeJ6mtNkyrAwAAPE7jQM8vrXJftjf5lRX7kucUV9S4UlspYZex14e2/mjwEw1/p5ZS2p5Wd7QRF4/tHrx6er+wrzCtDgAApqzegS4E+Td/Xpn3U1zqS+VVtY7UVtvDYB/YIWC7vCn5a1nFoUtjk17V9rT6092CNzjZiYupDQAAYLLqFehVNRKbuWsSlv5yPH0StTQiDdWi76dFjOvfzn8ntWTT6vsv3h28bF/KnCNXs/tSWwOYVgcAAPNVr0CfvvToph0Jt8dQqRUcY5K1c6KGdWnmdRTT6gAAAOpRO9CXxFyZ9/FvFz6hUquc7cSFrw1r89GHmxMXU6vegr2crk3pE/Lts92brMK0OgAAmDu1An3/xcxB47+O3yn9GSJqaV0zX+ek4spq5+z8igBqqeHvafXolr57OY6pP/0AAABggtQK9EEL9x5PTM/rRqXODO4YuCXmzO1RVCqFaXUAALB0Kgd67PmMoRO/ObyDSp3yb2B/635JpaeyO9oxrQ4AAPCAylPnW07cGEdDnRNuhosI84mj8h+EaXX/Pze92nPA8Y+HhEzrG/I1whwAACydSoEu4XnRwYuZA6nUCw9n23tCeFMpm1af0rvZNyc/Gdps/StRQ4RHz3CNHAAA4AGVptxziyp82ry2LYtKvRBujmvo4XjzRk5JU0yrAwAAKKZSoKfnlDQL/+/OVCr1Qiziqs8tHhHg6WybSy0AAACQQ6Up99KKaica6k2NhLd2d7LJoxIAAAAUUC3QK2v0HugCiUR3z7sDAACYE5UC09FWXEJDvRL2UKchAAAAKKBSoNvZiMtpqFfydl8DAACAxxntGbqHs002DQEAAEAJlQLdx80uU9jilEq9GNwhcBsNAQAAQAmVAl2Y+u7dxm8XlXox6ImGCHQAAAAVqRTogmcjm/xEQ50L8HC42bu1324qAQAAQAmVA71Xa7894SFe8VTq1LtPt59HQwAAAFCByoEumP9Mh7k01JmWDV3Pj+wStIlKAAAAUIFagd6hsXvCf59q+zaVWudsJy5cNrP7GCoBAABARWoFumDO4JafSs+gf6ZSazjGJD/OiHy2ma9zMrUAAABARWoHuuCrF7q9MLyz9qbFra24yqUzI8f20fOd9AAAAOZCpd3W6iL9adwbaxOWbjicNo1a9SJMs6+ZHTU8ItRbLzfcAQAAmKN6B/pDR5Jyei3ecfH94ym50dRSiY1YVDEhqsnyV4a0XujlYodV4QAAADSgcaA/dOZ6Xre9F+4+GX85q19iel5Xaj/Gxd66ICLM52B0S599Tz4R+Ju3q10WHQIAAAANaC3QHyXheVFZZa1jeVWNQ3WtxNrOWlxub2NVJn0zyCYvAAAA5k4ngQ4AAAD6Va+73AEAAMC4INABAADMAAIdAADADCDQAQAAzAACHQAAwAwg0AEAAEweY/8PPuptMq2MzNwAAAAASUVORK5CYII=";var YL={name:"Toolbar",props:{"aria-labelledby":{type:String,default:null}}};const eie=["aria-labelledby"],tie={class:"p-toolbar-group-start p-toolbar-group-left"},nie={class:"p-toolbar-group-center"},iie={class:"p-toolbar-group-end p-toolbar-group-right"};function rie(t,e,n,i,r,s){return G(),se("div",{class:"p-toolbar p-component",role:"toolbar","aria-labelledby":t.ariaLabelledby},[ue("div",tie,[En(t.$slots,"start")]),ue("div",nie,[En(t.$slots,"center")]),ue("div",iie,[En(t.$slots,"end")])],8,eie)}function sie(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var oie=` .p-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; } .p-toolbar-group-start, .p-toolbar-group-center, .p-toolbar-group-end { display: flex; align-items: center; } .p-toolbar-group-left, .p-toolbar-group-right { display: flex; align-items: center; } `;sie(oie),YL.render=rie;var XL={name:"Divider",props:{align:{type:String,default:null},layout:{type:String,default:"horizontal"},type:{type:String,default:"solid"}},computed:{containerClass(){return["p-divider p-component","p-divider-"+this.layout,"p-divider-"+this.type,{"p-divider-left":this.layout==="horizontal"&&(!this.align||this.align==="left")},{"p-divider-center":this.layout==="horizontal"&&this.align==="center"},{"p-divider-right":this.layout==="horizontal"&&this.align==="right"},{"p-divider-top":this.layout==="vertical"&&this.align==="top"},{"p-divider-center":this.layout==="vertical"&&(!this.align||this.align==="center")},{"p-divider-bottom":this.layout==="vertical"&&this.align==="bottom"}]}}};const aie=["aria-orientation"],lie={key:0,class:"p-divider-content"};function uie(t,e,n,i,r,s){return G(),se("div",{class:Lt(s.containerClass),role:"separator","aria-orientation":n.layout},[t.$slots.default?(G(),se("div",lie,[En(t.$slots,"default")])):qe("",!0)],10,aie)}function cie(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var die=` .p-divider-horizontal { display: flex; width: 100%; position: relative; align-items: center; } .p-divider-horizontal:before { position: absolute; display: block; top: 50%; left: 0; width: 100%; content: ''; } .p-divider-horizontal.p-divider-left { justify-content: flex-start; } .p-divider-horizontal.p-divider-right { justify-content: flex-end; } .p-divider-horizontal.p-divider-center { justify-content: center; } .p-divider-content { z-index: 1; } .p-divider-vertical { min-height: 100%; margin: 0 1rem; display: flex; position: relative; justify-content: center; } .p-divider-vertical:before { position: absolute; display: block; top: 0; left: 50%; height: 100%; content: ''; } .p-divider-vertical.p-divider-top { align-items: flex-start; } .p-divider-vertical.p-divider-center { align-items: center; } .p-divider-vertical.p-divider-bottom { align-items: flex-end; } .p-divider-solid.p-divider-horizontal:before { border-top-style: solid; } .p-divider-solid.p-divider-vertical:before { border-left-style: solid; } .p-divider-dashed.p-divider-horizontal:before { border-top-style: dashed; } .p-divider-dashed.p-divider-vertical:before { border-left-style: dashed; } .p-divider-dotted.p-divider-horizontal:before { border-top-style: dotted; } .p-divider-dotted.p-divider-vertical:before { border-left-style: dotted; } `;cie(die),XL.render=uie;var ZL={name:"Textarea",emits:["update:modelValue"],props:{modelValue:null,autoResize:Boolean},mounted(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize(){const t=window.getComputedStyle(this.$el);this.$el.style.height="auto",this.$el.style.height=`calc(${t.borderTopWidth} + ${t.borderBottomWidth} + ${this.$el.scrollHeight}px)`,parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput(t){this.autoResize&&this.resize(),this.$emit("update:modelValue",t.target.value)}},computed:{filled(){return this.modelValue!=null&&this.modelValue.toString().length>0}}};const hie=["value"];function pie(t,e,n,i,r,s){return G(),se("textarea",{class:Lt(["p-inputtextarea p-inputtext p-component",{"p-filled":s.filled,"p-inputtextarea-resizable ":n.autoResize}]),value:n.modelValue,onInput:e[0]||(e[0]=(...o)=>s.onInput&&s.onInput(...o))},null,42,hie)}function fie(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var mie=` .p-inputtextarea-resizable { overflow: hidden; resize: none; } .p-fluid .p-inputtextarea { width: 100%; } `;fie(mie),ZL.render=pie;var QL={name:"ProgressSpinner",props:{strokeWidth:{type:String,default:"2"},fill:{type:String,default:"none"},animationDuration:{type:String,default:"2s"}},computed:{svgStyle(){return{"animation-duration":this.animationDuration}}}};const gie={class:"p-progress-spinner",role:"progressbar"},yie=["fill","stroke-width"];function vie(t,e,n,i,r,s){return G(),se("div",gie,[(G(),se("svg",{class:"p-progress-spinner-svg",viewBox:"25 25 50 50",style:hi(s.svgStyle)},[ue("circle",{class:"p-progress-spinner-circle",cx:"50",cy:"50",r:"20",fill:n.fill,"stroke-width":n.strokeWidth,strokeMiterlimit:"10"},null,8,yie)],4))])}function bie(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var wie=` .p-progress-spinner { position: relative; margin: 0 auto; width: 100px; height: 100px; display: inline-block; } .p-progress-spinner::before { content: ''; display: block; padding-top: 100%; } .p-progress-spinner-svg { height: 100%; transform-origin: center center; width: 100%; position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; } `;bie(wie),QL.render=vie;var JL={name:"Calendar",emits:["show","hide","input","month-change","year-change","date-select","update:modelValue","today-click","clear-click","focus","blur","keydown"],props:{modelValue:null,selectionMode:{type:String,default:"single"},dateFormat:{type:String,default:null},inline:{type:Boolean,default:!1},showOtherMonths:{type:Boolean,default:!0},selectOtherMonths:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1},icon:{type:String,default:"pi pi-calendar"},previousIcon:{type:String,default:"pi pi-chevron-left"},nextIcon:{type:String,default:"pi pi-chevron-right"},incrementIcon:{type:String,default:"pi pi-chevron-up"},decrementIcon:{type:String,default:"pi pi-chevron-down"},numberOfMonths:{type:Number,default:1},responsiveOptions:Array,view:{type:String,default:"date"},touchUI:{type:Boolean,default:!1},monthNavigator:{type:Boolean,default:!1},yearNavigator:{type:Boolean,default:!1},yearRange:{type:String,default:null},minDate:{type:Date,value:null},maxDate:{type:Date,value:null},disabledDates:{type:Array,value:null},disabledDays:{type:Array,value:null},maxDateCount:{type:Number,value:null},showOnFocus:{type:Boolean,default:!0},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},showButtonBar:{type:Boolean,default:!1},shortYearCutoff:{type:String,default:"+10"},showTime:{type:Boolean,default:!1},timeOnly:{type:Boolean,default:!1},hourFormat:{type:String,default:"24"},stepHour:{type:Number,default:1},stepMinute:{type:Number,default:1},stepSecond:{type:Number,default:1},showSeconds:{type:Boolean,default:!1},hideOnDateTimeSelect:{type:Boolean,default:!1},hideOnRangeSelection:{type:Boolean,default:!1},timeSeparator:{type:String,default:":"},showWeek:{type:Boolean,default:!1},manualInput:{type:Boolean,default:!0},appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:String,default:null},id:{type:String,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},navigationState:null,timePickerChange:!1,scrollHandler:null,outsideClickListener:null,maskClickListener:null,resizeListener:null,overlay:null,input:null,mask:null,timePickerTimer:null,preventFocus:!1,typeUpdate:!1,data(){return{currentMonth:null,currentYear:null,currentHour:null,currentMinute:null,currentSecond:null,pm:null,focused:!1,overlayVisible:!1,currentView:this.view}},watch:{modelValue(t){this.updateCurrentMetaData(),!this.typeUpdate&&!this.inline&&this.input&&(this.input.value=this.formatValue(t)),this.typeUpdate=!1},showTime(){this.updateCurrentMetaData()},months(){this.overlay&&(this.focused||(this.inline&&(this.preventFocus=!0),setTimeout(this.updateFocus,0)))},numberOfMonths(){this.destroyResponsiveStyleElement(),this.createResponsiveStyle()},responsiveOptions(){this.destroyResponsiveStyleElement(),this.createResponsiveStyle()},currentView(){Promise.resolve(null).then(()=>this.alignOverlay())}},created(){this.updateCurrentMetaData()},mounted(){this.createResponsiveStyle(),this.inline?(this.overlay&&this.overlay.setAttribute(this.attributeSelector,""),this.disabled||(this.preventFocus=!0,this.initFocusableCell(),this.numberOfMonths===1&&(this.overlay.style.width=Ne.getOuterWidth(this.$el)+"px"))):this.input.value=this.formatValue(this.modelValue)},updated(){this.overlay&&(this.preventFocus=!0,setTimeout(this.updateFocus,0)),this.input&&this.selectionStart!=null&&this.selectionEnd!=null&&(this.input.selectionStart=this.selectionStart,this.input.selectionEnd=this.selectionEnd,this.selectionStart=null,this.selectionEnd=null)},beforeUnmount(){this.timePickerTimer&&clearTimeout(this.timePickerTimer),this.mask&&this.destroyMask(),this.destroyResponsiveStyleElement(),this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&this.autoZIndex&&Lo.clear(this.overlay),this.overlay=null},methods:{isComparable(){return this.modelValue!=null&&typeof this.modelValue!="string"},isSelected(t){if(!this.isComparable())return!1;if(this.modelValue){if(this.isSingleSelection())return this.isDateEquals(this.modelValue,t);if(this.isMultipleSelection()){let e=!1;for(let n of this.modelValue)if(e=this.isDateEquals(n,t),e)break;return e}else if(this.isRangeSelection())return this.modelValue[1]?this.isDateEquals(this.modelValue[0],t)||this.isDateEquals(this.modelValue[1],t)||this.isDateBetween(this.modelValue[0],this.modelValue[1],t):this.isDateEquals(this.modelValue[0],t)}return!1},isMonthSelected(t){if(this.isComparable()){let e=this.isRangeSelection()?this.modelValue[0]:this.modelValue;return this.isMultipleSelection()?!1:e.getMonth()===t&&e.getFullYear()===this.currentYear}return!1},isYearSelected(t){if(this.isComparable()){let e=this.isRangeSelection()?this.modelValue[0]:this.modelValue;return!this.isMultipleSelection()&&this.isComparable()?e.getFullYear()===t:!1}return!1},isDateEquals(t,e){return t?t.getDate()===e.day&&t.getMonth()===e.month&&t.getFullYear()===e.year:!1},isDateBetween(t,e,n){let i=!1;if(t&&e){let r=new Date(n.year,n.month,n.day);return t.getTime()<=r.getTime()&&e.getTime()>=r.getTime()}return i},getFirstDayOfMonthIndex(t,e){let n=new Date;n.setDate(1),n.setMonth(t),n.setFullYear(e);let i=n.getDay()+this.sundayIndex;return i>=7?i-7:i},getDaysCountInMonth(t,e){return 32-this.daylightSavingAdjust(new Date(e,t,32)).getDate()},getDaysCountInPrevMonth(t,e){let n=this.getPreviousMonthAndYear(t,e);return this.getDaysCountInMonth(n.month,n.year)},getPreviousMonthAndYear(t,e){let n,i;return t===0?(n=11,i=e-1):(n=t-1,i=e),{month:n,year:i}},getNextMonthAndYear(t,e){let n,i;return t===11?(n=0,i=e+1):(n=t+1,i=e),{month:n,year:i}},daylightSavingAdjust(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},isToday(t,e,n,i){return t.getDate()===e&&t.getMonth()===n&&t.getFullYear()===i},isSelectable(t,e,n,i){let r=!0,s=!0,o=!0,u=!0;return i&&!this.selectOtherMonths?!1:(this.minDate&&(this.minDate.getFullYear()>n||this.minDate.getFullYear()===n&&(this.minDate.getMonth()>e||this.minDate.getMonth()===e&&this.minDate.getDate()>t))&&(r=!1),this.maxDate&&(this.maxDate.getFullYear()11,e>=12?e=e==12?12:e-12:e=e==0?12:e),this.currentHour=Math.floor(e/this.stepHour)*this.stepHour,this.currentMinute=Math.floor(t.getMinutes()/this.stepMinute)*this.stepMinute,this.currentSecond=Math.floor(t.getSeconds()/this.stepSecond)*this.stepSecond},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=t=>{this.overlayVisible&&this.isOutsideClicked(t)&&(this.overlayVisible=!1)},document.addEventListener("mousedown",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("mousedown",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new Ay(this.$refs.container,()=>{this.overlayVisible&&(this.overlayVisible=!1)})),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!Ne.isTouchDevice()&&(this.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(t){return!(this.$el.isSameNode(t.target)||this.isNavIconClicked(t)||this.$el.contains(t.target)||this.overlay&&this.overlay.contains(t.target))},isNavIconClicked(t){return Ne.hasClass(t.target,"p-datepicker-prev")||Ne.hasClass(t.target,"p-datepicker-prev-icon")||Ne.hasClass(t.target,"p-datepicker-next")||Ne.hasClass(t.target,"p-datepicker-next-icon")},alignOverlay(){this.touchUI?this.enableModality():this.overlay&&(this.appendTo==="self"||this.inline?Ne.relativePosition(this.overlay,this.$el):(this.view==="date"?(this.overlay.style.width=Ne.getOuterWidth(this.overlay)+"px",this.overlay.style.minWidth=Ne.getOuterWidth(this.$el)+"px"):this.overlay.style.width=Ne.getOuterWidth(this.$el)+"px",Ne.absolutePosition(this.overlay,this.$el)))},onButtonClick(){this.isEnabled()&&(this.overlayVisible?this.overlayVisible=!1:(this.input.focus(),this.overlayVisible=!0))},isDateDisabled(t,e,n){if(this.disabledDates){for(let i of this.disabledDates)if(i.getFullYear()===n&&i.getMonth()===e&&i.getDate()===t)return!0}return!1},isDayDisabled(t,e,n){if(this.disabledDays){let r=new Date(n,e,t).getDay();return this.disabledDays.indexOf(r)!==-1}return!1},onMonthDropdownChange(t){this.currentMonth=parseInt(t),this.$emit("month-change",{month:this.currentMonth+1,year:this.currentYear})},onYearDropdownChange(t){this.currentYear=parseInt(t),this.$emit("year-change",{month:this.currentMonth+1,year:this.currentYear})},onDateSelect(t,e){if(!(this.disabled||!e.selectable)){if(Ne.find(this.overlay,".p-datepicker-calendar td span:not(.p-disabled)").forEach(n=>n.tabIndex=-1),t&&t.currentTarget.focus(),this.isMultipleSelection()&&this.isSelected(e)){let n=this.modelValue.filter(i=>!this.isDateEquals(i,e));this.updateModel(n)}else this.shouldSelectDate(e)&&(e.otherMonth?(this.currentMonth=e.month,this.currentYear=e.year,this.selectDate(e)):this.selectDate(e));this.isSingleSelection()&&(!this.showTime||this.hideOnDateTimeSelect)&&setTimeout(()=>{this.input&&this.input.focus(),this.overlayVisible=!1},150)}},selectDate(t){let e=new Date(t.year,t.month,t.day);this.showTime&&(this.hourFormat==="12"&&this.pm&&this.currentHour!=12?e.setHours(this.currentHour+12):e.setHours(this.currentHour),e.setMinutes(this.currentMinute),e.setSeconds(this.currentSecond)),this.minDate&&this.minDate>e&&(e=this.minDate,this.currentHour=e.getHours(),this.currentMinute=e.getMinutes(),this.currentSecond=e.getSeconds()),this.maxDate&&this.maxDate=i.getTime()?r=e:(i=e,r=null),n=[i,r]}else n=[e,null];n!==null&&this.updateModel(n),this.isRangeSelection()&&this.hideOnRangeSelection&&n[1]!==null&&setTimeout(()=>{this.overlayVisible=!1},150),this.$emit("date-select",e)},updateModel(t){this.$emit("update:modelValue",t)},shouldSelectDate(){return this.isMultipleSelection()&&this.maxDateCount!=null?this.maxDateCount>(this.modelValue?this.modelValue.length:0):!0},isSingleSelection(){return this.selectionMode==="single"},isRangeSelection(){return this.selectionMode==="range"},isMultipleSelection(){return this.selectionMode==="multiple"},formatValue(t){if(typeof t=="string")return t;let e="";if(t)try{if(this.isSingleSelection())e=this.formatDateTime(t);else if(this.isMultipleSelection())for(let n=0;n{const h=n+1{let y=""+h;if(i(d))for(;y.lengthi(d)?y[h]:g[h];let o="",u=!1;if(t)for(n=0;n11&&n!==12&&(n-=12),this.hourFormat==="12"?e+=n===0?12:n<10?"0"+n:n:e+=n<10?"0"+n:n,e+=":",e+=i<10?"0"+i:i,this.showSeconds&&(e+=":",e+=r<10?"0"+r:r),this.hourFormat==="12"&&(e+=t.getHours()>11?` ${this.$primevue.config.locale.pm}`:` ${this.$primevue.config.locale.am}`),e},onTodayButtonClick(t){let e=new Date,n={day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),otherMonth:e.getMonth()!==this.currentMonth||e.getFullYear()!==this.currentYear,today:!0,selectable:!0};this.onDateSelect(null,n),this.$emit("today-click",e),t.preventDefault()},onClearButtonClick(t){this.updateModel(null),this.overlayVisible=!1,this.$emit("clear-click",t),t.preventDefault()},onTimePickerElementMouseDown(t,e,n){this.isEnabled()&&(this.repeat(t,null,e,n),t.preventDefault())},onTimePickerElementMouseUp(t){this.isEnabled()&&(this.clearTimePickerTimer(),this.updateModelTime(),t.preventDefault())},onTimePickerElementMouseLeave(){this.clearTimePickerTimer()},repeat(t,e,n,i){let r=e||500;switch(this.clearTimePickerTimer(),this.timePickerTimer=setTimeout(()=>{this.repeat(t,100,n,i)},r),n){case 0:i===1?this.incrementHour(t):this.decrementHour(t);break;case 1:i===1?this.incrementMinute(t):this.decrementMinute(t);break;case 2:i===1?this.incrementSecond(t):this.decrementSecond(t);break}},convertTo24Hour(t,e){return this.hourFormat=="12"?t===12?e?12:0:e?t+12:t:t},validateTime(t,e,n,i){let r=this.isComparable()?this.modelValue:this.viewDate;const s=this.convertTo24Hour(t,i);this.isRangeSelection()&&(r=this.modelValue[1]||this.modelValue[0]),this.isMultipleSelection()&&(r=this.modelValue[this.modelValue.length-1]);const o=r?r.toDateString():null;return!(this.minDate&&o&&this.minDate.toDateString()===o&&(this.minDate.getHours()>s||this.minDate.getHours()===s&&(this.minDate.getMinutes()>e||this.minDate.getMinutes()===e&&this.minDate.getSeconds()>n))||this.maxDate&&o&&this.maxDate.toDateString()===o&&(this.maxDate.getHours()=24?n-24:n:this.hourFormat=="12"&&(e<12&&n>11&&(i=!this.pm),n=n>=13?n-12:n),this.validateTime(n,this.currentMinute,this.currentSecond,i)&&(this.currentHour=n,this.pm=i),t.preventDefault()},decrementHour(t){let e=this.currentHour-this.stepHour,n=this.pm;this.hourFormat=="24"?e=e<0?24+e:e:this.hourFormat=="12"&&(this.currentHour===12&&(n=!this.pm),e=e<=0?12+e:e),this.validateTime(e,this.currentMinute,this.currentSecond,n)&&(this.currentHour=e,this.pm=n),t.preventDefault()},incrementMinute(t){let e=this.currentMinute+this.stepMinute;this.validateTime(this.currentHour,e,this.currentSecond,this.pm)&&(this.currentMinute=e>59?e-60:e),t.preventDefault()},decrementMinute(t){let e=this.currentMinute-this.stepMinute;e=e<0?60+e:e,this.validateTime(this.currentHour,e,this.currentSecond,this.pm)&&(this.currentMinute=e),t.preventDefault()},incrementSecond(t){let e=this.currentSecond+this.stepSecond;this.validateTime(this.currentHour,this.currentMinute,e,this.pm)&&(this.currentSecond=e>59?e-60:e),t.preventDefault()},decrementSecond(t){let e=this.currentSecond-this.stepSecond;e=e<0?60+e:e,this.validateTime(this.currentHour,this.currentMinute,e,this.pm)&&(this.currentSecond=e),t.preventDefault()},updateModelTime(){this.timePickerChange=!0;let t=this.isComparable()?this.modelValue:this.viewDate;this.isRangeSelection()&&(t=this.modelValue[1]||this.modelValue[0]),this.isMultipleSelection()&&(t=this.modelValue[this.modelValue.length-1]),t=t?new Date(t.getTime()):new Date,this.hourFormat=="12"?this.currentHour===12?t.setHours(this.pm?12:0):t.setHours(this.pm?this.currentHour+12:this.currentHour):t.setHours(this.currentHour),t.setMinutes(this.currentMinute),t.setSeconds(this.currentSecond),this.isRangeSelection()&&(this.modelValue[1]?t=[this.modelValue[0],t]:t=[t,null]),this.isMultipleSelection()&&(t=[...this.modelValue.slice(0,-1),t]),this.updateModel(t),this.$emit("date-select",t),setTimeout(()=>this.timePickerChange=!1,0)},toggleAMPM(t){!this.validateTime(this.currentHour,this.currentMinute,this.currentSecond,!this.pm)&&(this.maxDate||this.minDate)||(this.pm=!this.pm,this.updateModelTime(),t.preventDefault())},clearTimePickerTimer(){this.timePickerTimer&&clearInterval(this.timePickerTimer)},onMonthSelect(t,{month:e,index:n}){this.view==="month"?this.onDateSelect(t,{year:this.currentYear,month:n,day:1,selectable:!0}):(this.currentMonth=n,this.currentView="date",this.$emit("month-change",{month:this.currentMonth+1,year:this.currentYear})),setTimeout(this.updateFocus,0)},onYearSelect(t,e){this.view==="year"?this.onDateSelect(t,{year:e.value,month:0,day:1,selectable:!0}):(this.currentYear=e.value,this.currentView="month",this.$emit("year-change",{month:this.currentMonth+1,year:this.currentYear})),setTimeout(this.updateFocus,0)},enableModality(){this.mask||(this.mask=document.createElement("div"),this.mask.style.zIndex=String(parseInt(this.overlay.style.zIndex,10)-1),Ne.addMultipleClasses(this.mask,"p-datepicker-mask p-datepicker-mask-scrollblocker p-component-overlay p-component-overlay-enter"),this.maskClickListener=()=>{this.overlayVisible=!1},this.mask.addEventListener("click",this.maskClickListener),document.body.appendChild(this.mask),Ne.addClass(document.body,"p-overflow-hidden"))},disableModality(){this.mask&&(Ne.addClass(this.mask,"p-component-overlay-leave"),this.mask.addEventListener("animationend",()=>{this.destroyMask()}))},destroyMask(){this.mask.removeEventListener("click",this.maskClickListener),this.maskClickListener=null,document.body.removeChild(this.mask),this.mask=null;let t=document.body.children,e;for(let n=0;nthis.isSelectable(n.getDate(),n.getMonth(),n.getFullYear(),!1))&&this.isRangeSelection()&&(e=t.length>1&&t[1]>t[0]),e},parseValue(t){if(!t||t.trim().length===0)return null;let e;if(this.isSingleSelection())e=this.parseDateTime(t);else if(this.isMultipleSelection()){let n=t.split(",");e=[];for(let i of n)e.push(this.parseDateTime(i.trim()))}else if(this.isRangeSelection()){let n=t.split(" - ");e=[];for(let i=0;i23||s>59||this.hourFormat=="12"&&r>12||this.showSeconds&&(isNaN(o)||o>59))throw"Invalid time";return this.hourFormat=="12"&&r!==12&&this.pm&&(r+=12),{hour:r,minute:s,second:o}},parseDate(t,e){if(e==null||t==null)throw"Invalid arguments";if(t=typeof t=="object"?t.toString():t+"",t==="")return null;let n,i,r,s=0,o=typeof this.shortYearCutoff!="string"?this.shortYearCutoff:new Date().getFullYear()%100+parseInt(this.shortYearCutoff,10),u=-1,d=-1,h=-1,g=-1,y=!1,w,C=F=>{let K=n+1{let K=C(F),$=F==="@"?14:F==="!"?20:F==="y"&&K?4:F==="o"?3:2,ee=F==="y"?$:1,he=new RegExp("^\\d{"+ee+","+$+"}"),ve=t.substring(s).match(he);if(!ve)throw"Missing number at position "+s;return s+=ve[0].length,parseInt(ve[0],10)},P=(F,K,$)=>{let ee=-1,he=C(F)?$:K,ve=[];for(let fe=0;fe-(fe[1].length-ae[1].length));for(let fe=0;fe{if(t.charAt(s)!==e.charAt(n))throw"Unexpected literal at position "+s;s++};for(this.currentView==="month"&&(h=1),n=0;n-1){d=1,h=g;do{if(i=this.getDaysCountInMonth(u,d-1),h<=i)break;d++,h-=i}while(!0)}if(w=this.daylightSavingAdjust(new Date(u,d-1,h)),w.getFullYear()!==u||w.getMonth()+1!==d||w.getDate()!==h)throw"Invalid date";return w},getWeekNumber(t){let e=new Date(t.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));let n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e.getTime())/864e5)/7)+1},onDateCellKeydown(t,e,n){const i=t.currentTarget,r=i.parentElement,s=Ne.index(r);switch(t.code){case"ArrowDown":{if(i.tabIndex="-1",r.parentElement.nextElementSibling){let u=Ne.index(r.parentElement),g=Array.from(r.parentElement.parentElement.children).slice(u+1).find(y=>{let w=y.children[s].children[0];return!Ne.hasClass(w,"p-disabled")});if(g){let y=g.children[s].children[0];y.tabIndex="0",y.focus()}else this.navigationState={backward:!1},this.navForward(t)}else this.navigationState={backward:!1},this.navForward(t);t.preventDefault();break}case"ArrowUp":{if(i.tabIndex="-1",r.parentElement.previousElementSibling){let u=Ne.index(r.parentElement),g=Array.from(r.parentElement.parentElement.children).slice(0,u).reverse().find(y=>{let w=y.children[s].children[0];return!Ne.hasClass(w,"p-disabled")});if(g){let y=g.children[s].children[0];y.tabIndex="0",y.focus()}else this.navigationState={backward:!0},this.navBackward(t)}else this.navigationState={backward:!0},this.navBackward(t);t.preventDefault();break}case"ArrowLeft":{if(i.tabIndex="-1",r.previousElementSibling){let h=Array.from(r.parentElement.children).slice(0,s).reverse().find(g=>{let y=g.children[0];return!Ne.hasClass(y,"p-disabled")});if(h){let g=h.children[0];g.tabIndex="0",g.focus()}else this.navigateToMonth(t,!0,n)}else this.navigateToMonth(t,!0,n);t.preventDefault();break}case"ArrowRight":{if(i.tabIndex="-1",r.nextElementSibling){let h=Array.from(r.parentElement.children).slice(s+1).find(g=>{let y=g.children[0];return!Ne.hasClass(y,"p-disabled")});if(h){let g=h.children[0];g.tabIndex="0",g.focus()}else this.navigateToMonth(t,!1,n)}else this.navigateToMonth(t,!1,n);t.preventDefault();break}case"Enter":case"Space":{this.onDateSelect(t,e),t.preventDefault();break}case"Escape":{this.overlayVisible=!1,t.preventDefault();break}case"Tab":{this.inline||this.trapFocus(t);break}case"Home":{i.tabIndex="-1";let u=r.parentElement.children[0].children[0];Ne.hasClass(u,"p-disabled")?this.navigateToMonth(t,!0,n):(u.tabIndex="0",u.focus()),t.preventDefault();break}case"End":{i.tabIndex="-1";let o=r.parentElement,u=o.children[o.children.length-1].children[0];Ne.hasClass(u,"p-disabled")?this.navigateToMonth(t,!1,n):(u.tabIndex="0",u.focus()),t.preventDefault();break}case"PageUp":{i.tabIndex="-1",t.shiftKey?(this.navigationState={backward:!0},this.navBackward(t)):this.navigateToMonth(t,!0,n),t.preventDefault();break}case"PageDown":{i.tabIndex="-1",t.shiftKey?(this.navigationState={backward:!1},this.navForward(t)):this.navigateToMonth(t,!1,n),t.preventDefault();break}}},navigateToMonth(t,e,n){if(e)if(this.numberOfMonths===1||n===0)this.navigationState={backward:!0},this.navBackward(t);else{let i=this.overlay.children[n-1],r=Ne.find(i,".p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)"),s=r[r.length-1];s.tabIndex="0",s.focus()}else if(this.numberOfMonths===1||n===this.numberOfMonths-1)this.navigationState={backward:!1},this.navForward(t);else{let i=this.overlay.children[n+1],r=Ne.findSingle(i,".p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)");r.tabIndex="0",r.focus()}},onMonthCellKeydown(t,e){const n=t.currentTarget;switch(t.code){case"ArrowUp":case"ArrowDown":{n.tabIndex="-1";var i=n.parentElement.children,r=Ne.index(n);let s=i[t.code==="ArrowDown"?r+3:r-3];s&&(s.tabIndex="0",s.focus()),t.preventDefault();break}case"ArrowLeft":{n.tabIndex="-1";let s=n.previousElementSibling;s?(s.tabIndex="0",s.focus()):(this.navigationState={backward:!0},this.navBackward(t)),t.preventDefault();break}case"ArrowRight":{n.tabIndex="-1";let s=n.nextElementSibling;s?(s.tabIndex="0",s.focus()):(this.navigationState={backward:!1},this.navForward(t)),t.preventDefault();break}case"PageUp":{if(t.shiftKey)return;this.navigationState={backward:!0},this.navBackward(t);break}case"PageDown":{if(t.shiftKey)return;this.navigationState={backward:!1},this.navForward(t);break}case"Enter":case"Space":{this.onMonthSelect(t,e),t.preventDefault();break}case"Escape":{this.overlayVisible=!1,t.preventDefault();break}case"Tab":{this.trapFocus(t);break}}},onYearCellKeydown(t,e){const n=t.currentTarget;switch(t.code){case"ArrowUp":case"ArrowDown":{n.tabIndex="-1";var i=n.parentElement.children,r=Ne.index(n);let s=i[t.code==="ArrowDown"?r+2:r-2];s&&(s.tabIndex="0",s.focus()),t.preventDefault();break}case"ArrowLeft":{n.tabIndex="-1";let s=n.previousElementSibling;s?(s.tabIndex="0",s.focus()):(this.navigationState={backward:!0},this.navBackward(t)),t.preventDefault();break}case"ArrowRight":{n.tabIndex="-1";let s=n.nextElementSibling;s?(s.tabIndex="0",s.focus()):(this.navigationState={backward:!1},this.navForward(t)),t.preventDefault();break}case"PageUp":{if(t.shiftKey)return;this.navigationState={backward:!0},this.navBackward(t);break}case"PageDown":{if(t.shiftKey)return;this.navigationState={backward:!1},this.navForward(t);break}case"Enter":case"Space":{this.onYearSelect(t,e),t.preventDefault();break}case"Escape":{this.overlayVisible=!1,t.preventDefault();break}case"Tab":{this.trapFocus(t);break}}},updateFocus(){let t;if(this.navigationState){if(this.navigationState.button)this.initFocusableCell(),this.navigationState.backward?Ne.findSingle(this.overlay,".p-datepicker-prev").focus():Ne.findSingle(this.overlay,".p-datepicker-next").focus();else{if(this.navigationState.backward){let e;this.currentView==="month"?e=Ne.find(this.overlay,".p-monthpicker .p-monthpicker-month:not(.p-disabled)"):this.currentView==="year"?e=Ne.find(this.overlay,".p-yearpicker .p-yearpicker-year:not(.p-disabled)"):e=Ne.find(this.overlay,".p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)"),e&&e.length>0&&(t=e[e.length-1])}else this.currentView==="month"?t=Ne.findSingle(this.overlay,".p-monthpicker .p-monthpicker-month:not(.p-disabled)"):this.currentView==="year"?t=Ne.findSingle(this.overlay,".p-yearpicker .p-yearpicker-year:not(.p-disabled)"):t=Ne.findSingle(this.overlay,".p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)");t&&(t.tabIndex="0",t.focus())}this.navigationState=null}else this.initFocusableCell()},initFocusableCell(){let t;if(this.currentView==="month"){let e=Ne.find(this.overlay,".p-monthpicker .p-monthpicker-month"),n=Ne.findSingle(this.overlay,".p-monthpicker .p-monthpicker-month.p-highlight");e.forEach(i=>i.tabIndex=-1),t=n||e[0]}else if(this.currentView==="year"){let e=Ne.find(this.overlay,".p-yearpicker .p-yearpicker-year"),n=Ne.findSingle(this.overlay,".p-yearpicker .p-yearpicker-year.p-highlight");e.forEach(i=>i.tabIndex=-1),t=n||e[0]}else if(t=Ne.findSingle(this.overlay,"span.p-highlight"),!t){let e=Ne.findSingle(this.overlay,"td.p-datepicker-today span:not(.p-disabled):not(.p-ink");e?t=e:t=Ne.findSingle(this.overlay,".p-datepicker-calendar td span:not(.p-disabled):not(.p-ink")}t&&(t.tabIndex="0",!this.inline&&(!this.navigationState||!this.navigationState.button)&&!this.timePickerChange&&t.focus(),this.preventFocus=!1)},trapFocus(t){t.preventDefault();let e=Ne.getFocusableElements(this.overlay);if(e&&e.length>0)if(!document.activeElement)e[0].focus();else{let n=e.indexOf(document.activeElement);if(t.shiftKey)n===-1||n===0?e[e.length-1].focus():e[n-1].focus();else if(n===-1)if(this.timeOnly)e[0].focus();else{let i=null;for(let r=0;re.tabIndex="-1"),this.overlayVisible&&(this.overlayVisible=!1))},overlayRef(t){this.overlay=t},inputRef(t){this.input=t},getMonthName(t){return this.$primevue.config.locale.monthNames[t]},getYear(t){return this.currentView==="month"?this.currentYear:t.year},onOverlayClick(t){this.inline||ic.emit("overlay-click",{originalEvent:t,target:this.$el})},onOverlayKeyDown(t){switch(t.code){case"Escape":this.input.focus(),this.overlayVisible=!1;break}},onOverlayMouseUp(t){this.onOverlayClick(t)},createResponsiveStyle(){if(this.numberOfMonths>1&&this.responsiveOptions){this.responsiveStyleElement||(this.responsiveStyleElement=document.createElement("style"),this.responsiveStyleElement.type="text/css",document.body.appendChild(this.responsiveStyleElement));let t="";if(this.responsiveOptions){let e=[...this.responsiveOptions].filter(n=>!!(n.breakpoint&&n.numMonths)).sort((n,i)=>-1*n.breakpoint.localeCompare(i.breakpoint,void 0,{numeric:!0}));for(let n=0;ne?this.minDate:e}},inputFieldValue(){return this.formatValue(this.modelValue)},containerClass(){return["p-calendar p-component p-inputwrapper",{"p-calendar-w-btn":this.showIcon,"p-calendar-timeonly":this.timeOnly,"p-calendar-disabled":this.disabled,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused}]},panelStyleClass(){return["p-datepicker p-component",this.panelClass,{"p-datepicker-inline":this.inline,"p-disabled":this.disabled,"p-datepicker-timeonly":this.timeOnly,"p-datepicker-multiple-month":this.numberOfMonths>1,"p-datepicker-monthpicker":this.currentView==="month","p-datepicker-yearpicker":this.currentView==="year","p-datepicker-touch-ui":this.touchUI,"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},months(){let t=[];for(let e=0;e11&&(n=n%11-1,i=i+1);let r=[],s=this.getFirstDayOfMonthIndex(n,i),o=this.getDaysCountInMonth(n,i),u=this.getDaysCountInPrevMonth(n,i),d=1,h=new Date,g=[],y=Math.ceil((o+s)/7);for(let w=0;wo){let P=this.getNextMonthAndYear(n,i);C.push({day:d-o,month:P.month,year:P.year,otherMonth:!0,today:this.isToday(h,d-o,P.month,P.year),selectable:this.isSelectable(d-o,P.month,P.year,!0)})}else C.push({day:d,month:n,year:i,today:this.isToday(h,d,n,i),selectable:this.isSelectable(d,n,i,!1)});d++}this.showWeek&&g.push(this.getWeekNumber(new Date(C[0].year,C[0].month,C[0].day))),r.push(C)}t.push({month:n,year:i,dates:r,weekNumbers:g})}return t},weekDays(){let t=[],e=this.$primevue.config.locale.firstDayOfWeek;for(let n=0;n<7;n++)t.push(this.$primevue.config.locale.dayNamesMin[e]),e=e==6?0:++e;return t},ticksTo1970(){return(1969*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*1e7},sundayIndex(){return this.$primevue.config.locale.firstDayOfWeek>0?7-this.$primevue.config.locale.firstDayOfWeek:0},datePattern(){return this.dateFormat||this.$primevue.config.locale.dateFormat},yearOptions(){if(this.yearRange){let t=this;const e=this.yearRange.split(":");let n=parseInt(e[0]),i=parseInt(e[1]),r=[];this.currentYeari&&(t.currentYear=n);for(let s=n;s<=i;s++)r.push(s);return r}else return null},monthPickerValues(){let t=[];const e=n=>{if(this.minDate){const i=this.minDate.getMonth(),r=this.minDate.getFullYear();if(this.currentYearr||this.currentYear===r&&n>i)return!1}return!0};for(let n=0;n<=11;n++)t.push({value:this.$primevue.config.locale.monthNamesShort[n],selectable:e(n)});return t},yearPickerValues(){let t=[],e=this.currentYear-this.currentYear%10;const n=i=>!(this.minDate&&this.minDate.getFullYear()>i||this.maxDate&&this.maxDate.getFullYear()1||this.disabled},panelId(){return Xs()+"_panel"}},components:{CalendarButton:nc,Portal:em},directives:{ripple:po}};const _ie=["id"],Sie=["id","placeholder","aria-expanded","aria-controls","aria-labelledby","aria-label","disabled","readonly"],Tie=["id","role","aria-modal","aria-label"],Eie={class:"p-datepicker-group-container"},xie={class:"p-datepicker-header"},Cie=["disabled","aria-label"],Aie={class:"p-datepicker-title"},kie=["disabled","aria-label"],Pie=["disabled","aria-label"],Die={key:2,class:"p-datepicker-decade"},Iie=["disabled","aria-label"],Oie={key:0,class:"p-datepicker-calendar-container"},Rie={class:"p-datepicker-calendar",role:"grid"},Lie={key:0,scope:"col",class:"p-datepicker-weekheader p-disabled"},Mie=["abbr"],Nie={key:0,class:"p-datepicker-weeknumber"},Fie={class:"p-disabled"},Bie={key:0,style:{visibility:"hidden"}},Uie=["aria-label"],Hie=["onClick","onKeydown","aria-selected"],zie={key:0,class:"p-hidden-accessible","aria-live":"polite"},jie={key:0,class:"p-monthpicker"},Vie=["onClick","onKeydown"],Wie={key:0,class:"p-hidden-accessible","aria-live":"polite"},qie={key:1,class:"p-yearpicker"},Gie=["onClick","onKeydown"],Kie={key:0,class:"p-hidden-accessible","aria-live":"polite"},Yie={key:1,class:"p-timepicker"},Xie={class:"p-hour-picker"},Zie=["aria-label"],Qie=["aria-label"],Jie={class:"p-separator"},$ie={class:"p-minute-picker"},ere=["aria-label","disabled"],tre=["aria-label","disabled"],nre={key:0,class:"p-separator"},ire={key:1,class:"p-second-picker"},rre=["aria-label","disabled"],sre=["aria-label","disabled"],ore={key:2,class:"p-separator"},are={key:3,class:"p-ampm-picker"},lre=["aria-label","disabled"],ure=["aria-label","disabled"],cre={key:2,class:"p-datepicker-buttonbar"};function dre(t,e,n,i,r,s){const o=Bt("CalendarButton"),u=Bt("Portal"),d=_s("ripple");return G(),se("span",{ref:"container",id:n.id,class:Lt(s.containerClass)},[n.inline?qe("",!0):(G(),se("input",Ni({key:0,ref:s.inputRef,id:n.inputId,type:"text",role:"combobox",class:["p-inputtext p-component",n.inputClass],style:n.inputStyle,placeholder:n.placeholder,autocomplete:"off","aria-autocomplete":"none","aria-haspopup":"dialog","aria-expanded":r.overlayVisible,"aria-controls":s.panelId,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,inputmode:"none",disabled:n.disabled,readonly:!n.manualInput||n.readonly,tabindex:0,onInput:e[0]||(e[0]=(...h)=>s.onInput&&s.onInput(...h)),onClick:e[1]||(e[1]=(...h)=>s.onInputClick&&s.onInputClick(...h)),onFocus:e[2]||(e[2]=(...h)=>s.onFocus&&s.onFocus(...h)),onBlur:e[3]||(e[3]=(...h)=>s.onBlur&&s.onBlur(...h)),onKeydown:e[4]||(e[4]=(...h)=>s.onKeyDown&&s.onKeyDown(...h))},n.inputProps),null,16,Sie)),n.showIcon?(G(),Ct(o,{key:1,icon:n.icon,class:"p-datepicker-trigger",disabled:n.disabled,onClick:s.onButtonClick,type:"button","aria-label":t.$primevue.config.locale.chooseDate,"aria-haspopup":"dialog","aria-expanded":r.overlayVisible,"aria-controls":s.panelId},null,8,["icon","disabled","onClick","aria-label","aria-expanded","aria-controls"])):qe("",!0),gt(u,{appendTo:n.appendTo,disabled:n.inline},{default:jt(()=>[gt(lu,{name:"p-connected-overlay",onEnter:e[68]||(e[68]=h=>s.onOverlayEnter(h)),onAfterEnter:s.onOverlayEnterComplete,onAfterLeave:s.onOverlayAfterLeave,onLeave:s.onOverlayLeave},{default:jt(()=>[n.inline||r.overlayVisible?(G(),se("div",Ni({key:0,ref:s.overlayRef,id:s.panelId,class:s.panelStyleClass,style:n.panelStyle,role:n.inline?null:"dialog","aria-modal":n.inline?null:"true","aria-label":t.$primevue.config.locale.chooseDate,onClick:e[65]||(e[65]=(...h)=>s.onOverlayClick&&s.onOverlayClick(...h)),onKeydown:e[66]||(e[66]=(...h)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...h)),onMouseup:e[67]||(e[67]=(...h)=>s.onOverlayMouseUp&&s.onOverlayMouseUp(...h))},n.panelProps),[n.timeOnly?qe("",!0):(G(),se(xt,{key:0},[ue("div",Eie,[(G(!0),se(xt,null,hn(s.months,(h,g)=>(G(),se("div",{key:h.month+h.year,class:"p-datepicker-group"},[ue("div",xie,[En(t.$slots,"header"),ei((G(),se("button",{class:"p-datepicker-prev p-link",onClick:e[5]||(e[5]=(...y)=>s.onPrevButtonClick&&s.onPrevButtonClick(...y)),type:"button",onKeydown:e[6]||(e[6]=(...y)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...y)),disabled:n.disabled,"aria-label":r.currentView==="year"?t.$primevue.config.locale.prevDecade:r.currentView==="month"?t.$primevue.config.locale.prevYear:t.$primevue.config.locale.prevMonth},[ue("span",{class:Lt(["p-datepicker-prev-icon",n.previousIcon])},null,2)],40,Cie)),[[Qf,n.showOtherMonths?g===0:!1],[d]]),ue("div",Aie,[r.currentView==="date"?(G(),se("button",{key:0,type:"button",onClick:e[7]||(e[7]=(...y)=>s.switchToMonthView&&s.switchToMonthView(...y)),onKeydown:e[8]||(e[8]=(...y)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...y)),class:"p-datepicker-month p-link",disabled:s.switchViewButtonDisabled,"aria-label":t.$primevue.config.locale.chooseMonth},lt(s.getMonthName(h.month)),41,kie)):qe("",!0),r.currentView!=="year"?(G(),se("button",{key:1,type:"button",onClick:e[9]||(e[9]=(...y)=>s.switchToYearView&&s.switchToYearView(...y)),onKeydown:e[10]||(e[10]=(...y)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...y)),class:"p-datepicker-year p-link",disabled:s.switchViewButtonDisabled,"aria-label":t.$primevue.config.locale.chooseYear},lt(s.getYear(h)),41,Pie)):qe("",!0),r.currentView==="year"?(G(),se("span",Die,[En(t.$slots,"decade",{years:s.yearPickerValues},()=>[Jn(lt(s.yearPickerValues[0].value)+" - "+lt(s.yearPickerValues[s.yearPickerValues.length-1].value),1)])])):qe("",!0)]),ei((G(),se("button",{class:"p-datepicker-next p-link",onClick:e[11]||(e[11]=(...y)=>s.onNextButtonClick&&s.onNextButtonClick(...y)),type:"button",onKeydown:e[12]||(e[12]=(...y)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...y)),disabled:n.disabled,"aria-label":r.currentView==="year"?t.$primevue.config.locale.nextDecade:r.currentView==="month"?t.$primevue.config.locale.nextYear:t.$primevue.config.locale.nextMonth},[ue("span",{class:Lt(["p-datepicker-next-icon",n.nextIcon])},null,2)],40,Iie)),[[Qf,n.showOtherMonths?n.numberOfMonths===1?!0:g===n.numberOfMonths-1:!1],[d]])]),r.currentView==="date"?(G(),se("div",Oie,[ue("table",Rie,[ue("thead",null,[ue("tr",null,[n.showWeek?(G(),se("th",Lie,[ue("span",null,lt(s.weekHeaderLabel),1)])):qe("",!0),(G(!0),se(xt,null,hn(s.weekDays,y=>(G(),se("th",{key:y,scope:"col",abbr:y},[ue("span",null,lt(y),1)],8,Mie))),128))])]),ue("tbody",null,[(G(!0),se(xt,null,hn(h.dates,(y,w)=>(G(),se("tr",{key:y[0].day+""+y[0].month},[n.showWeek?(G(),se("td",Nie,[ue("span",Fie,[h.weekNumbers[w]<10?(G(),se("span",Bie,"0")):qe("",!0),Jn(" "+lt(h.weekNumbers[w]),1)])])):qe("",!0),(G(!0),se(xt,null,hn(y,C=>(G(),se("td",{key:C.day+""+C.month,"aria-label":C.day,class:Lt({"p-datepicker-other-month":C.otherMonth,"p-datepicker-today":C.today})},[ei((G(),se("span",{class:Lt({"p-highlight":s.isSelected(C),"p-disabled":!C.selectable}),onClick:D=>s.onDateSelect(D,C),draggable:"false",onKeydown:D=>s.onDateCellKeydown(D,C,g),"aria-selected":s.isSelected(C)},[En(t.$slots,"date",{date:C},()=>[Jn(lt(C.day),1)])],42,Hie)),[[d]]),s.isSelected(C)?(G(),se("div",zie,lt(C.day),1)):qe("",!0)],10,Uie))),128))]))),128))])])])):qe("",!0)]))),128))]),r.currentView==="month"?(G(),se("div",jie,[(G(!0),se(xt,null,hn(s.monthPickerValues,(h,g)=>ei((G(),se("span",{key:h,onClick:y=>s.onMonthSelect(y,{month:h,index:g}),onKeydown:y=>s.onMonthCellKeydown(y,{month:h,index:g}),class:Lt(["p-monthpicker-month",{"p-highlight":s.isMonthSelected(g),"p-disabled":!h.selectable}])},[Jn(lt(h.value)+" ",1),s.isMonthSelected(g)?(G(),se("div",Wie,lt(h.value),1)):qe("",!0)],42,Vie)),[[d]])),128))])):qe("",!0),r.currentView==="year"?(G(),se("div",qie,[(G(!0),se(xt,null,hn(s.yearPickerValues,h=>ei((G(),se("span",{key:h.value,onClick:g=>s.onYearSelect(g,h),onKeydown:g=>s.onYearCellKeydown(g,h),class:Lt(["p-yearpicker-year",{"p-highlight":s.isYearSelected(h.value),"p-disabled":!h.selectable}])},[Jn(lt(h.value)+" ",1),s.isYearSelected(h.value)?(G(),se("div",Kie,lt(h.value),1)):qe("",!0)],42,Gie)),[[d]])),128))])):qe("",!0)],64)),(n.showTime||n.timeOnly)&&r.currentView==="date"?(G(),se("div",Yie,[ue("div",Xie,[ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.nextHour,onMousedown:e[13]||(e[13]=h=>s.onTimePickerElementMouseDown(h,0,1)),onMouseup:e[14]||(e[14]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[15]||(e[15]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[17]||(e[17]=Ji(h=>s.onTimePickerElementMouseDown(h,0,1),["enter"])),e[18]||(e[18]=Ji(h=>s.onTimePickerElementMouseDown(h,0,1),["space"]))],onMouseleave:e[16]||(e[16]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[19]||(e[19]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[20]||(e[20]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.incrementIcon)},null,2)],40,Zie)),[[d]]),ue("span",null,lt(s.formattedCurrentHour),1),ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.prevHour,onMousedown:e[21]||(e[21]=h=>s.onTimePickerElementMouseDown(h,0,-1)),onMouseup:e[22]||(e[22]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[23]||(e[23]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[25]||(e[25]=Ji(h=>s.onTimePickerElementMouseDown(h,0,-1),["enter"])),e[26]||(e[26]=Ji(h=>s.onTimePickerElementMouseDown(h,0,-1),["space"]))],onMouseleave:e[24]||(e[24]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[27]||(e[27]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[28]||(e[28]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.decrementIcon)},null,2)],40,Qie)),[[d]])]),ue("div",Jie,[ue("span",null,lt(n.timeSeparator),1)]),ue("div",$ie,[ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.nextMinute,onMousedown:e[29]||(e[29]=h=>s.onTimePickerElementMouseDown(h,1,1)),onMouseup:e[30]||(e[30]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[31]||(e[31]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[33]||(e[33]=Ji(h=>s.onTimePickerElementMouseDown(h,1,1),["enter"])),e[34]||(e[34]=Ji(h=>s.onTimePickerElementMouseDown(h,1,1),["space"]))],disabled:n.disabled,onMouseleave:e[32]||(e[32]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[35]||(e[35]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[36]||(e[36]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.incrementIcon)},null,2)],40,ere)),[[d]]),ue("span",null,lt(s.formattedCurrentMinute),1),ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.prevMinute,onMousedown:e[37]||(e[37]=h=>s.onTimePickerElementMouseDown(h,1,-1)),onMouseup:e[38]||(e[38]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[39]||(e[39]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[41]||(e[41]=Ji(h=>s.onTimePickerElementMouseDown(h,1,-1),["enter"])),e[42]||(e[42]=Ji(h=>s.onTimePickerElementMouseDown(h,1,-1),["space"]))],disabled:n.disabled,onMouseleave:e[40]||(e[40]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[43]||(e[43]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[44]||(e[44]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.decrementIcon)},null,2)],40,tre)),[[d]])]),n.showSeconds?(G(),se("div",nre,[ue("span",null,lt(n.timeSeparator),1)])):qe("",!0),n.showSeconds?(G(),se("div",ire,[ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.nextSecond,onMousedown:e[45]||(e[45]=h=>s.onTimePickerElementMouseDown(h,2,1)),onMouseup:e[46]||(e[46]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[47]||(e[47]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[49]||(e[49]=Ji(h=>s.onTimePickerElementMouseDown(h,2,1),["enter"])),e[50]||(e[50]=Ji(h=>s.onTimePickerElementMouseDown(h,2,1),["space"]))],disabled:n.disabled,onMouseleave:e[48]||(e[48]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[51]||(e[51]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[52]||(e[52]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.incrementIcon)},null,2)],40,rre)),[[d]]),ue("span",null,lt(s.formattedCurrentSecond),1),ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.prevSecond,onMousedown:e[53]||(e[53]=h=>s.onTimePickerElementMouseDown(h,2,-1)),onMouseup:e[54]||(e[54]=h=>s.onTimePickerElementMouseUp(h)),onKeydown:[e[55]||(e[55]=(...h)=>s.onContainerButtonKeydown&&s.onContainerButtonKeydown(...h)),e[57]||(e[57]=Ji(h=>s.onTimePickerElementMouseDown(h,2,-1),["enter"])),e[58]||(e[58]=Ji(h=>s.onTimePickerElementMouseDown(h,2,-1),["space"]))],disabled:n.disabled,onMouseleave:e[56]||(e[56]=h=>s.onTimePickerElementMouseLeave()),onKeyup:[e[59]||(e[59]=Ji(h=>s.onTimePickerElementMouseUp(h),["enter"])),e[60]||(e[60]=Ji(h=>s.onTimePickerElementMouseUp(h),["space"]))],type:"button"},[ue("span",{class:Lt(n.decrementIcon)},null,2)],40,sre)),[[d]])])):qe("",!0),n.hourFormat=="12"?(G(),se("div",ore,[ue("span",null,lt(n.timeSeparator),1)])):qe("",!0),n.hourFormat=="12"?(G(),se("div",are,[ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.am,onClick:e[61]||(e[61]=h=>s.toggleAMPM(h)),type:"button",disabled:n.disabled},[ue("span",{class:Lt(n.incrementIcon)},null,2)],8,lre)),[[d]]),ue("span",null,lt(r.pm?t.$primevue.config.locale.pm:t.$primevue.config.locale.am),1),ei((G(),se("button",{class:"p-link","aria-label":t.$primevue.config.locale.pm,onClick:e[62]||(e[62]=h=>s.toggleAMPM(h)),type:"button",disabled:n.disabled},[ue("span",{class:Lt(n.decrementIcon)},null,2)],8,ure)),[[d]])])):qe("",!0)])):qe("",!0),n.showButtonBar?(G(),se("div",cre,[gt(o,{type:"button",label:s.todayLabel,onClick:e[63]||(e[63]=h=>s.onTodayButtonClick(h)),class:"p-button-text",onKeydown:s.onContainerButtonKeydown},null,8,["label","onKeydown"]),gt(o,{type:"button",label:s.clearLabel,onClick:e[64]||(e[64]=h=>s.onClearButtonClick(h)),class:"p-button-text",onKeydown:s.onContainerButtonKeydown},null,8,["label","onKeydown"])])):qe("",!0),En(t.$slots,"footer")],16,Tie)):qe("",!0)]),_:3},8,["onAfterEnter","onAfterLeave","onLeave"])]),_:3},8,["appendTo","disabled"])],10,_ie)}function hre(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var pre=` .p-calendar { position: relative; display: inline-flex; max-width: 100%; } .p-calendar .p-inputtext { flex: 1 1 auto; width: 1%; } .p-calendar-w-btn .p-inputtext { border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-calendar-w-btn .p-datepicker-trigger { border-top-left-radius: 0; border-bottom-left-radius: 0; } /* Fluid */ .p-fluid .p-calendar { display: flex; } .p-fluid .p-calendar .p-inputtext { width: 1%; } /* Datepicker */ .p-calendar .p-datepicker { min-width: 100%; } .p-datepicker { width: auto; position: absolute; top: 0; left: 0; } .p-datepicker-inline { display: inline-block; position: static; overflow-x: auto; } /* Header */ .p-datepicker-header { display: flex; align-items: center; justify-content: space-between; } .p-datepicker-header .p-datepicker-title { margin: 0 auto; } .p-datepicker-prev, .p-datepicker-next { cursor: pointer; display: inline-flex; justify-content: center; align-items: center; overflow: hidden; position: relative; } /* Multiple Month DatePicker */ .p-datepicker-multiple-month .p-datepicker-group-container { display: flex; } .p-datepicker-multiple-month .p-datepicker-group-container .p-datepicker-group { flex: 1 1 auto; } /* DatePicker Table */ .p-datepicker table { width: 100%; border-collapse: collapse; } .p-datepicker td > span { display: flex; justify-content: center; align-items: center; cursor: pointer; margin: 0 auto; overflow: hidden; position: relative; } /* Month Picker */ .p-monthpicker-month { width: 33.3%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; } /* Year Picker */ .p-yearpicker-year { width: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; } /* Button Bar */ .p-datepicker-buttonbar { display: flex; justify-content: space-between; align-items: center; } /* Time Picker */ .p-timepicker { display: flex; justify-content: center; align-items: center; } .p-timepicker button { display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; } .p-timepicker > div { display: flex; align-items: center; flex-direction: column; } /* Touch UI */ .p-datepicker-touch-ui, .p-calendar .p-datepicker-touch-ui { position: fixed; top: 50%; left: 50%; min-width: 80vw; transform: translate(-50%, -50%); } `;hre(pre),JL.render=dre;var $L={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},confirmListener:null,closeListener:null,data(){return{visible:!1,confirmation:null}},mounted(){this.confirmListener=t=>{t&&t.group===this.group&&(this.confirmation=t,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},Gp.on("confirm",this.confirmListener),Gp.on("close",this.closeListener)},beforeUnmount(){Gp.off("confirm",this.confirmListener),Gp.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return this.confirmation?this.confirmation.blockScroll:!0},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return this.confirmation.defaultFocus===void 0||this.confirmation.defaultFocus==="accept"},autoFocusReject(){return this.confirmation.defaultFocus==="reject"},closeOnEscape(){return this.confirmation?this.confirmation.closeOnEscape:!0}},components:{CDialog:nm,CDButton:nc}};const fre={class:"p-confirm-dialog-message"};function mre(t,e,n,i,r,s){const o=Bt("CDButton"),u=Bt("CDialog");return G(),Ct(u,{visible:r.visible,"onUpdate:visible":[e[2]||(e[2]=d=>r.visible=d),s.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,breakpoints:n.breakpoints,closeOnEscape:s.closeOnEscape,draggable:n.draggable},{footer:jt(()=>[gt(o,{label:s.rejectLabel,icon:s.rejectIcon,class:Lt(s.rejectClass),onClick:e[0]||(e[0]=d=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),gt(o,{label:s.acceptLabel,icon:s.acceptIcon,class:Lt(s.acceptClass),onClick:e[1]||(e[1]=d=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])]),default:jt(()=>[t.$slots.message?(G(),Ct(us(t.$slots.message),{key:1,message:r.confirmation},null,8,["message"])):(G(),se(xt,{key:0},[r.confirmation.icon?(G(),se("i",{key:0,class:Lt(s.iconClass)},null,2)):qe("",!0),ue("span",fre,lt(s.message),1)],64))]),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible"])}$L.render=mre;var Kp=TypeError;const gre=x8(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var GT=typeof Map=="function"&&Map.prototype,KT=Object.getOwnPropertyDescriptor&>?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,vb=GT&&KT&&typeof KT.get=="function"?KT.get:null,eM=GT&&Map.prototype.forEach,YT=typeof Set=="function"&&Set.prototype,XT=Object.getOwnPropertyDescriptor&&YT?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,bb=YT&&XT&&typeof XT.get=="function"?XT.get:null,tM=YT&&Set.prototype.forEach,yre=typeof WeakMap=="function"&&WeakMap.prototype,cg=yre?WeakMap.prototype.has:null,vre=typeof WeakSet=="function"&&WeakSet.prototype,dg=vre?WeakSet.prototype.has:null,bre=typeof WeakRef=="function"&&WeakRef.prototype,nM=bre?WeakRef.prototype.deref:null,wre=Boolean.prototype.valueOf,_re=Object.prototype.toString,Sre=Function.prototype.toString,Tre=String.prototype.match,ZT=String.prototype.slice,wd=String.prototype.replace,Ere=String.prototype.toUpperCase,iM=String.prototype.toLowerCase,rM=RegExp.prototype.test,sM=Array.prototype.concat,Au=Array.prototype.join,xre=Array.prototype.slice,oM=Math.floor,QT=typeof BigInt=="function"?BigInt.prototype.valueOf:null,JT=Object.getOwnPropertySymbols,$T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Yp=typeof Symbol=="function"&&typeof Symbol.iterator=="object",hg=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Yp||!0)?Symbol.toStringTag:null,aM=Object.prototype.propertyIsEnumerable,lM=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function uM(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||rM.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-oM(-t):oM(t);if(i!==t){var r=String(i),s=ZT.call(e,r.length+1);return wd.call(r,n,"$&_")+"."+wd.call(wd.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return wd.call(e,n,"$&_")}var e1=gre,cM=e1.custom,dM=mM(cM)?cM:null,hM={__proto__:null,double:'"',single:"'"},Cre={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},wb=function t(e,n,i,r){var s=n||{};if(_c(s,"quoteStyle")&&!_c(hM,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_c(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=_c(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_c(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_c(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return yM(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var d=String(e);return u?uM(e,d):d}if(typeof e=="bigint"){var h=String(e)+"n";return u?uM(e,h):h}var g=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=g&&g>0&&typeof e=="object")return t1(e)?"[Array]":"[Object]";var y=Wre(s,i);if(typeof r>"u")r=[];else if(gM(r,e)>=0)return"[Circular]";function w(pt,Wt,pn){if(Wt&&(r=xre.call(r),r.push(Wt)),pn){var Ut={depth:s.depth};return _c(s,"quoteStyle")&&(Ut.quoteStyle=s.quoteStyle),t(pt,Ut,i+1,r)}return t(pt,s,i+1,r)}if(typeof e=="function"&&!fM(e)){var C=Mre(e),D=_b(e,w);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(D.length>0?" { "+Au.call(D,", ")+" }":"")}if(mM(e)){var P=Yp?wd.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):$T.call(e);return typeof e=="object"&&!Yp?pg(P):P}if(zre(e)){for(var M="<"+iM.call(String(e.nodeName)),F=e.attributes||[],K=0;K",M}if(t1(e)){if(e.length===0)return"[]";var $=_b(e,w);return y&&!Vre($)?"["+i1($,y)+"]":"[ "+Au.call($,", ")+" ]"}if(Pre(e)){var ee=_b(e,w);return!("cause"in Error.prototype)&&"cause"in e&&!aM.call(e,"cause")?"{ ["+String(e)+"] "+Au.call(sM.call("[cause]: "+w(e.cause),ee),", ")+" }":ee.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Au.call(ee,", ")+" }"}if(typeof e=="object"&&o){if(dM&&typeof e[dM]=="function"&&e1)return e1(e,{depth:g-i});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Nre(e)){var he=[];return eM&&eM.call(e,function(pt,Wt){he.push(w(Wt,e,!0)+" => "+w(pt,e))}),vM("Map",vb.call(e),he,y)}if(Ure(e)){var ve=[];return tM&&tM.call(e,function(pt){ve.push(w(pt,e))}),vM("Set",bb.call(e),ve,y)}if(Fre(e))return n1("WeakMap");if(Hre(e))return n1("WeakSet");if(Bre(e))return n1("WeakRef");if(Ire(e))return pg(w(Number(e)));if(Rre(e))return pg(w(QT.call(e)));if(Ore(e))return pg(wre.call(e));if(Dre(e))return pg(w(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Gh<"u"&&e===Gh)return"{ [object globalThis] }";if(!kre(e)&&!fM(e)){var fe=_b(e,w),ae=lM?lM(e)===Object.prototype:e instanceof Object||e.constructor===Object,xe=e instanceof Object?"":"null prototype",Qe=!ae&&hg&&Object(e)===e&&hg in e?ZT.call(_d(e),8,-1):xe?"Object":"",ot=ae||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",et=ot+(Qe||xe?"["+Au.call(sM.call([],Qe||[],xe||[]),": ")+"] ":"");return fe.length===0?et+"{}":y?et+"{"+i1(fe,y)+"}":et+"{ "+Au.call(fe,", ")+" }"}return String(e)};function pM(t,e,n){var i=n.quoteStyle||e,r=hM[i];return r+t+r}function Are(t){return wd.call(String(t),/"/g,""")}function vh(t){return!hg||!(typeof t=="object"&&(hg in t||typeof t[hg]<"u"))}function t1(t){return _d(t)==="[object Array]"&&vh(t)}function kre(t){return _d(t)==="[object Date]"&&vh(t)}function fM(t){return _d(t)==="[object RegExp]"&&vh(t)}function Pre(t){return _d(t)==="[object Error]"&&vh(t)}function Dre(t){return _d(t)==="[object String]"&&vh(t)}function Ire(t){return _d(t)==="[object Number]"&&vh(t)}function Ore(t){return _d(t)==="[object Boolean]"&&vh(t)}function mM(t){if(Yp)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!$T)return!1;try{return $T.call(t),!0}catch{}return!1}function Rre(t){if(!t||typeof t!="object"||!QT)return!1;try{return QT.call(t),!0}catch{}return!1}var Lre=Object.prototype.hasOwnProperty||function(t){return t in this};function _c(t,e){return Lre.call(t,e)}function _d(t){return _re.call(t)}function Mre(t){if(t.name)return t.name;var e=Tre.call(Sre.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function gM(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;ne.maxStringLength){var n=t.length-e.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return yM(ZT.call(t,0,e.maxStringLength),e)+i}var r=Cre[e.quoteStyle||"single"];r.lastIndex=0;var s=wd.call(wd.call(t,r,"\\$1"),/[\x00-\x1f]/g,jre);return pM(s,"single",e)}function jre(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Ere.call(e.toString(16))}function pg(t){return"Object("+t+")"}function n1(t){return t+" { ? }"}function vM(t,e,n,i){var r=i?i1(n,i):Au.call(n,", ");return t+" ("+e+") {"+r+"}"}function Vre(t){for(var e=0;e=0)return!1;return!0}function Wre(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=Au.call(Array(t.indent+1)," ");else return null;return{base:n,prev:Au.call(Array(e+1),n)}}function i1(t,e){if(t.length===0)return"";var n=` `+e.prev+e.base;return n+Au.call(t,","+n)+` `+e.prev}function _b(t,e){var n=t1(t),i=[];if(n){i.length=t.length;for(var r=0;r"u"||!Ns?yi:Ns(Uint8Array),bh={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?yi:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?yi:ArrayBuffer,"%ArrayIteratorPrototype%":Qp&&Ns?Ns([][Symbol.iterator]()):yi,"%AsyncFromSyncIteratorPrototype%":yi,"%AsyncFunction%":Jp,"%AsyncGenerator%":Jp,"%AsyncGeneratorFunction%":Jp,"%AsyncIteratorPrototype%":Jp,"%Atomics%":typeof Atomics>"u"?yi:Atomics,"%BigInt%":typeof BigInt>"u"?yi:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?yi:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?yi:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?yi:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ose,"%eval%":eval,"%EvalError%":Rse,"%Float16Array%":typeof Float16Array>"u"?yi:Float16Array,"%Float32Array%":typeof Float32Array>"u"?yi:Float32Array,"%Float64Array%":typeof Float64Array>"u"?yi:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?yi:FinalizationRegistry,"%Function%":NM,"%GeneratorFunction%":Jp,"%Int8Array%":typeof Int8Array>"u"?yi:Int8Array,"%Int16Array%":typeof Int16Array>"u"?yi:Int16Array,"%Int32Array%":typeof Int32Array>"u"?yi:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Qp&&Ns?Ns(Ns([][Symbol.iterator]())):yi,"%JSON%":typeof JSON=="object"?JSON:yi,"%Map%":typeof Map>"u"?yi:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Qp||!Ns?yi:Ns(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ise,"%Object.getOwnPropertyDescriptor%":fg,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?yi:Promise,"%Proxy%":typeof Proxy>"u"?yi:Proxy,"%RangeError%":Lse,"%ReferenceError%":Mse,"%Reflect%":typeof Reflect>"u"?yi:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?yi:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Qp||!Ns?yi:Ns(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?yi:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qp&&Ns?Ns(""[Symbol.iterator]()):yi,"%Symbol%":Qp?Symbol:yi,"%SyntaxError%":Xp,"%ThrowTypeError%":qse,"%TypedArray%":Yse,"%TypeError%":Zp,"%Uint8Array%":typeof Uint8Array>"u"?yi:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?yi:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?yi:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?yi:Uint32Array,"%URIError%":Nse,"%WeakMap%":typeof WeakMap>"u"?yi:WeakMap,"%WeakRef%":typeof WeakRef>"u"?yi:WeakRef,"%WeakSet%":typeof WeakSet>"u"?yi:WeakSet,"%Function.prototype.call%":mg,"%Function.prototype.apply%":FM,"%Object.defineProperty%":Wse,"%Object.getPrototypeOf%":Gse,"%Math.abs%":Fse,"%Math.floor%":Bse,"%Math.max%":Use,"%Math.min%":Hse,"%Math.pow%":zse,"%Math.round%":jse,"%Math.sign%":Vse,"%Reflect.getPrototypeOf%":Kse};if(Ns)try{null.error}catch(t){var Xse=Ns(Ns(t));bh["%Error.prototype%"]=Xse}var Zse=function t(e){var n;if(e==="%AsyncFunction%")n=g1("async function () {}");else if(e==="%GeneratorFunction%")n=g1("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=g1("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(n=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var r=t("%AsyncGenerator%");r&&Ns&&(n=Ns(r.prototype))}return bh[e]=n,n},BM={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gg=xb(),Cb=Dse(),Qse=gg.call(mg,Array.prototype.concat),Jse=gg.call(FM,Array.prototype.splice),UM=gg.call(mg,String.prototype.replace),Ab=gg.call(mg,String.prototype.slice),$se=gg.call(mg,RegExp.prototype.exec),eoe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,toe=/\\(\\)?/g,noe=function(e){var n=Ab(e,0,1),i=Ab(e,-1);if(n==="%"&&i!=="%")throw new Xp("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&n!=="%")throw new Xp("invalid intrinsic syntax, expected opening `%`");var r=[];return UM(e,eoe,function(s,o,u,d){r[r.length]=u?UM(d,toe,"$1"):o||s}),r},ioe=function(e,n){var i=e,r;if(Cb(BM,i)&&(r=BM[i],i="%"+r[0]+"%"),Cb(bh,i)){var s=bh[i];if(s===Jp&&(s=Zse(i)),typeof s>"u"&&!n)throw new Zp("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new Xp("intrinsic "+e+" does not exist!")},v1=function(e,n){if(typeof e!="string"||e.length===0)throw new Zp("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Zp('"allowMissing" argument must be a boolean');if($se(/^%?[^%]*%?$/,e)===null)throw new Xp("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=noe(e),r=i.length>0?i[0]:"",s=ioe("%"+r+"%",n),o=s.name,u=s.value,d=!1,h=s.alias;h&&(r=h[0],Jse(i,Qse([0,1],h)));for(var g=1,y=!0;g=i.length){var P=fg(u,w);y=!!P,y&&"get"in P&&!("originalValue"in P.get)?u=P.get:u=u[w]}else y=Cb(u,w),u=u[w];y&&!d&&(bh[o]=u)}}return u},HM=v1,zM=OM,roe=zM([HM("%String.prototype.indexOf%")]),jM=function(e,n){var i=HM(e,!!n);return typeof i=="function"&&roe(e,".prototype.")>-1?zM([i]):i},soe=v1,yg=jM,ooe=wb,aoe=Kp,VM=soe("%Map%",!0),loe=yg("Map.prototype.get",!0),uoe=yg("Map.prototype.set",!0),coe=yg("Map.prototype.has",!0),doe=yg("Map.prototype.delete",!0),hoe=yg("Map.prototype.size",!0),WM=!!VM&&function(){var e,n={assert:function(i){if(!n.has(i))throw new aoe("Side channel does not contain "+ooe(i))},delete:function(i){if(e){var r=doe(e,i);return hoe(e)===0&&(e=void 0),r}return!1},get:function(i){if(e)return loe(e,i)},has:function(i){return e?coe(e,i):!1},set:function(i,r){e||(e=new VM),uoe(e,i,r)}};return n},poe=v1,kb=jM,foe=wb,Pb=WM,moe=Kp,$p=poe("%WeakMap%",!0),goe=kb("WeakMap.prototype.get",!0),yoe=kb("WeakMap.prototype.set",!0),voe=kb("WeakMap.prototype.has",!0),boe=kb("WeakMap.prototype.delete",!0),woe=$p?function(){var e,n,i={assert:function(r){if(!i.has(r))throw new moe("Side channel does not contain "+foe(r))},delete:function(r){if($p&&r&&(typeof r=="object"||typeof r=="function")){if(e)return boe(e,r)}else if(Pb&&n)return n.delete(r);return!1},get:function(r){return $p&&r&&(typeof r=="object"||typeof r=="function")&&e?goe(e,r):n&&n.get(r)},has:function(r){return $p&&r&&(typeof r=="object"||typeof r=="function")&&e?voe(e,r):!!n&&n.has(r)},set:function(r,s){$p&&r&&(typeof r=="object"||typeof r=="function")?(e||(e=new $p),yoe(e,r,s)):Pb&&(n||(n=Pb()),n.set(r,s))}};return i}:Pb,_oe=Kp,Soe=wb,Toe=Qre,Eoe=WM,xoe=woe,Coe=xoe||Eoe||Toe,Aoe=function(){var e,n={assert:function(i){if(!n.has(i))throw new _oe("Side channel does not contain "+Soe(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,r){e||(e=Coe()),e.set(i,r)}};return n},koe=String.prototype.replace,Poe=/%20/g,b1={RFC1738:"RFC1738",RFC3986:"RFC3986"},w1={default:b1.RFC3986,formatters:{RFC1738:function(t){return koe.call(t,Poe,"+")},RFC3986:function(t){return String(t)}},RFC1738:b1.RFC1738,RFC3986:b1.RFC3986},Doe=w1,_1=Object.prototype.hasOwnProperty,wh=Array.isArray,ku=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ioe=function(e){for(;e.length>1;){var n=e.pop(),i=n.obj[n.prop];if(wh(i)){for(var r=[],s=0;s=S1?o.slice(d,d+S1):o,g=[],y=0;y=48&&w<=57||w>=65&&w<=90||w>=97&&w<=122||s===Doe.RFC1738&&(w===40||w===41)){g[g.length]=h.charAt(y);continue}if(w<128){g[g.length]=ku[w];continue}if(w<2048){g[g.length]=ku[192|w>>6]+ku[128|w&63];continue}if(w<55296||w>=57344){g[g.length]=ku[224|w>>12]+ku[128|w>>6&63]+ku[128|w&63];continue}y+=1,w=65536+((w&1023)<<10|h.charCodeAt(y)&1023),g[g.length]=ku[240|w>>18]+ku[128|w>>12&63]+ku[128|w>>6&63]+ku[128|w&63]}u+=g.join("")}return u},Noe=function(e){for(var n=[{obj:{o:e},prop:"o"}],i=[],r=0;r"u"&&(he=0)}if(typeof g=="function"?$=g(n,$):$ instanceof Date?$=C($):i==="comma"&&Pu($)&&($=Db.maybeMap($,function(Qt){return Qt instanceof Date?C(Qt):Qt})),$===null){if(o)return h&&!M?h(n,Ts.encoder,F,"key",D):n;$=""}if(Woe($)||Db.isBuffer($)){if(h){var ae=M?n:h(n,Ts.encoder,F,"key",D);return[P(ae)+"="+P(h($,Ts.encoder,F,"value",D))]}return[P(n)+"="+P(String($))]}var xe=[];if(typeof $>"u")return xe;var Qe;if(i==="comma"&&Pu($))M&&h&&($=Db.maybeMap($,h)),Qe=[{value:$.length>0?$.join(",")||null:void 0}];else if(Pu(g))Qe=g;else{var ot=Object.keys($);Qe=y?ot.sort(y):ot}var et=d?String(n).replace(/\./g,"%2E"):String(n),pt=r&&Pu($)&&$.length===1?et+"[]":et;if(s&&Pu($)&&$.length===0)return pt+"[]";for(var Wt=0;Wt"u"?e.encodeDotInKeys===!0?!0:Ts.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ts.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Ts.allowEmptyArrays,arrayFormat:o,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ts.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Ts.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ts.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Ts.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Ts.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ts.encodeValuesOnly,filter:s,format:i,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ts.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ts.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ts.strictNullHandling}},Koe=function(t,e){var n=t,i=Goe(e),r,s;typeof i.filter=="function"?(s=i.filter,n=s("",n)):Pu(i.filter)&&(s=i.filter,r=s);var o=[];if(typeof n!="object"||n===null)return"";var u=YM[i.arrayFormat],d=u==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var h=KM(),g=0;g0?D+C:""},_h=GM,E1=Object.prototype.hasOwnProperty,QM=Array.isArray,Xr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_h.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Yoe=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},JM=function(t,e,n){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&n>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},Xoe="utf8=%26%2310003%3B",Zoe="utf8=%E2%9C%93",Qoe=function(e,n){var i={__proto__:null},r=n.ignoreQueryPrefix?e.replace(/^\?/,""):e;r=r.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=r.split(n.delimiter,n.throwOnLimitExceeded?s+1:s);if(n.throwOnLimitExceeded&&o.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var u=-1,d,h=n.charset;if(n.charsetSentinel)for(d=0;d-1&&(D=QM(D)?[D]:D);var P=E1.call(i,C);P&&n.duplicates==="combine"?i[C]=_h.combine(i[C],D):(!P||n.duplicates==="last")&&(i[C]=D)}return i},Joe=function(t,e,n,i){var r=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");r=Array.isArray(e)&&e[s]?e[s].length:0}for(var o=i?e:JM(e,n,r),u=t.length-1;u>=0;--u){var d,h=t[u];if(h==="[]"&&n.parseArrays)d=n.allowEmptyArrays&&(o===""||n.strictNullHandling&&o===null)?[]:_h.combine([],o);else{d=n.plainObjects?{__proto__:null}:{};var g=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,y=n.decodeDotInKeys?g.replace(/%2E/g,"."):g,w=parseInt(y,10);!n.parseArrays&&y===""?d={0:o}:!isNaN(w)&&h!==y&&String(w)===y&&w>=0&&n.parseArrays&&w<=n.arrayLimit?(d=[],d[w]=o):y!=="__proto__"&&(d[y]=o)}o=d}return o},$oe=function(e,n,i,r){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=i.depth>0&&o.exec(s),h=d?s.slice(0,d.index):s,g=[];if(h){if(!i.plainObjects&&E1.call(Object.prototype,h)&&!i.allowPrototypes)return;g.push(h)}for(var y=0;i.depth>0&&(d=u.exec(s))!==null&&y"u"?Xr.charset:e.charset,i=typeof e.duplicates>"u"?Xr.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var r=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Xr.allowDots:!!e.allowDots;return{allowDots:r,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Xr.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Xr.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Xr.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Xr.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Xr.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Xr.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Xr.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Xr.decoder,delimiter:typeof e.delimiter=="string"||_h.isRegExp(e.delimiter)?e.delimiter:Xr.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Xr.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Xr.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Xr.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Xr.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Xr.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Xr.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},tae=function(t,e){var n=eae(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?{__proto__:null}:{};for(var i=typeof t=="string"?Qoe(t,n):t,r=n.plainObjects?{__proto__:null}:{},s=Object.keys(i),o=0;or)break;n=await ts(this,Fs,hx).call(this,s)}return e}catch(e){return console.log(`Failed to get vocabularies: ${e.message}`),[]}}async getTerms(e){try{const n=await ts(this,Fs,K4).call(this,e),i=ts(this,Fs,q4).call(this,n);return ts(this,Fs,cx).call(this,i),i}catch(n){return console.log(`Failed to get terms: ${n.message}`),[]}}generateFullVocabID(e){return`${qg(this,bg)}/viewById/${e}`}}Sh=new WeakMap,bg=new WeakMap,Fs=new WeakSet,q4=function(e){const n=[];for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];r.parents?r.parents.forEach(s=>{e[s]?(e[s].children||(e[s].children=[]),e[s].children.push(r)):n.push(r)}):n.push(r)}return n},cx=function(e,n=null){e.sort((i,r)=>i.label.localeCompare(r.label));for(let i=0;iu._lang==="en");o?s.label=o._value:s.label=e.prefLabel[0]._value}else s.label=e.prefLabel._value;if(s.data={label:s.label,vocabId:n.id,vocabTitle:n.title},e.definition&&(s.data.description=e.definition),e.broader){let o;Array.isArray(e.broader)?o=e.broader:o=[e.broader],s.parents=o.map(u=>typeof u=="string"?u:u._about)}if(e.narrower){let o;Array.isArray(e.narrower)?o=e.narrower:o=[e.narrower],o.forEach(u=>{let d;typeof u=="string"?d=u:(u.broader||(u.broader=s.key),ts(this,Fs,dx).call(this,u,n,i,r),d=u._about),(!r[d]||r[d].indexOf(s.key)===-1)&&(r[d]||(r[d]=[]),r[d].push(s.key))})}i[s.key]?s.key&&s.label&&Object.keys(s.data).length>Object.keys(i[s.key].data).length&&(i[s.key]=s):i[s.key]=s},hx=async function(e=null,n=200){const i={widgetable:!0,pp:n};e&&(i.p=e);const r=oae.stringify({filtersJson:JSON.stringify(i)});return(await qg(this,Sh).post("/registry/api/services/search",r)).data},Wye=async function(e,n=0,i=200){return(await qg(this,Sh).get(`${e}/concept.json?_pageSize=${i}&_page=${n}`)).data};const $M=qne("vocab",{state:()=>({rvaApiBaseURL:"https://vocabs.ardc.edu.au",rvaSandpitApiBaseURL:"https://demo.vocabs.ardc.edu.au",vocabularies:[],sandpitVocabularies:[],vocabLoaded:!1}),actions:{async loadVocabularies(){if(!this.vocabLoaded){const t=new Ib(this.rvaApiBaseURL);this.vocabularies=await t.getVocabularies();const e=new Ib(this.rvaSandpitApiBaseURL);this.sandpitVocabularies=await e.getVocabularies(),this.sandpitVocabularies.forEach(n=>n.sandpit=!0),this.vocabLoaded=!0}},findVocabularyByID(t){let e=this.vocabularies.find(n=>n.id===t);return e||(e=this.sandpitVocabularies.find(n=>n.id===t)),e},isFromSandpit(t){return t.startsWith(void 0)}}});var eN={name:"SelectButton",emits:["update:modelValue","focus","blur","change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,unselectable:{type:Boolean,default:!1},disabled:Boolean,dataKey:null,"aria-labelledby":{type:String,default:null}},data(){return{focusedIndex:0}},mounted(){this.defaultTabIndexes()},methods:{defaultTabIndexes(){let t=Ne.find(this.$refs.container,".p-button"),e=Ne.findSingle(this.$refs.container,".p-highlight");for(let n=0;n!Nt.equals(o,r,this.equalityKey)):s=this.modelValue?[...this.modelValue,r]:[r]:s=i?null:r,this.focusedIndex=n,this.$emit("update:modelValue",s),this.$emit("change",{event:t,value:s})},isSelected(t){let e=!1,n=this.getOptionValue(t);if(this.multiple){if(this.modelValue){for(let i of this.modelValue)if(Nt.equals(i,n,this.equalityKey)){e=!0;break}}}else e=Nt.equals(this.modelValue,n,this.equalityKey);return e},onKeydown(t,e,n){switch(t.code){case"Space":{this.onOptionSelect(t,e,n),t.preventDefault();break}case"ArrowDown":case"ArrowRight":{this.changeTabIndexes(t,"next"),t.preventDefault();break}case"ArrowUp":case"ArrowLeft":{this.changeTabIndexes(t,"prev"),t.preventDefault();break}}},changeTabIndexes(t,e){let n,i;for(let r=0;r<=this.$refs.container.children.length-1;r++)this.$refs.container.children[r].getAttribute("tabindex")==="0"&&(n={elem:this.$refs.container.children[r],index:r});e==="prev"?n.index===0?i=this.$refs.container.children.length-1:i=n.index-1:n.index===this.$refs.container.children.length-1?i=0:i=n.index+1,this.focusedIndex=i,this.$refs.container.children[i].focus()},onFocus(t){this.$emit("focus",t)},onBlur(t,e){t.target&&t.relatedTarget&&t.target.parentElement!==t.relatedTarget.parentElement&&this.defaultTabIndexes(),this.$emit("blur",t,e)},getButtonClass(t){return["p-button p-component",{"p-highlight":this.isSelected(t),"p-disabled":this.isOptionDisabled(t)}]}},computed:{containerClass(){return["p-selectbutton p-buttonset p-component",{"p-disabled":this.disabled}]},equalityKey(){return this.optionValue?null:this.dataKey}},directives:{ripple:po}};const aae=["aria-labelledby"],lae=["tabindex","aria-label","role","aria-checked","aria-disabled","onClick","onKeydown","onBlur"],uae={class:"p-button-label"};function cae(t,e,n,i,r,s){const o=_s("ripple");return G(),se("div",{ref:"container",class:Lt(s.containerClass),role:"group","aria-labelledby":t.ariaLabelledby},[(G(!0),se(xt,null,hn(n.options,(u,d)=>ei((G(),se("div",{key:s.getOptionRenderKey(u),tabindex:d===r.focusedIndex?"0":"-1","aria-label":s.getOptionLabel(u),role:n.multiple?"checkbox":"radio","aria-checked":s.isSelected(u),"aria-disabled":n.optionDisabled,class:Lt(s.getButtonClass(u,d)),onClick:h=>s.onOptionSelect(h,u,d),onKeydown:h=>s.onKeydown(h,u,d),onFocus:e[0]||(e[0]=h=>s.onFocus(h)),onBlur:h=>s.onBlur(h,u)},[En(t.$slots,"option",{option:u,index:d},()=>[ue("span",uae,lt(s.getOptionLabel(u)),1)])],42,lae)),[[o]])),128))],10,aae)}eN.render=cae;const tN=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},dae={name:"VocabularySelector",components:{Button:nc,Dialog:nm,SelectButton:eN,Message:Iy,DataTable:Ly,Column:Vw,InputText:tm},props:{selectedVocabId:{type:String}},emits:["selectVocabulary"],data(){return{showDialog:!1,filters:{global:{value:null,matchMode:Nr.CONTAINS}},vocabSourceOptions:["Published","Sandpit"],vocabSource:"Published",sandpitWarningTooltip:{value:"This vocabulary is from the sandpit."}}},computed:{selectedVocab(){return this.selectedVocabId?this.vocabStore.findVocabularyByID(this.selectedVocabId):null},vocabularies(){return this.vocabSource==="Sandpit"?this.vocabStore.sandpitVocabularies:this.vocabStore.vocabularies}},setup(){return{vocabStore:$M()}},methods:{onTablePageChange(){this.$nextTick(()=>{this.$refs.tableTop.scrollIntoView({behavior:"smooth"})})},selectVocab(t){const e=this.vocabStore.findVocabularyByID(t);this.$emit("selectVocabulary",e),this.showDialog=!1}}},hae={class:"flex align-items-center justify-content-between gap-3"},pae={key:0,class:"text-sm text-color-secondary"},fae={key:0,class:"pi pi-exclamation-triangle text-yellow-500",style:{"font-size":"1rem"}},mae={class:"text-right",style:{"min-width":"10rem"}},gae={class:"mb-4"},yae={ref:"tableTop"},vae={class:"flex justify-content-end"},bae={class:"p-input-icon-left"},wae=["href"];function _ae(t,e,n,i,r,s){const o=Bt("Button"),u=Bt("SelectButton"),d=Bt("Message"),h=Bt("InputText"),g=Bt("Column"),y=Bt("DataTable"),w=Bt("Dialog"),C=_s("tooltip");return G(),se("div",hae,[s.selectedVocab?(G(),se("div",pae,[Jn(" Current Vocabulary: "+lt(s.selectedVocab.title)+" ",1),s.selectedVocab.sandpit?ei((G(),se("i",fae,null,512)),[[C,r.sandpitWarningTooltip,void 0,{top:!0}]]):qe("",!0)])):qe("",!0),ue("div",mae,[s.selectedVocab?(G(),Ct(o,{key:0,label:"Switch Vocabulary",size:"small",onClick:e[0]||(e[0]=D=>r.showDialog=!0)})):(G(),Ct(o,{key:1,label:"Select Vocabulary",onClick:e[1]||(e[1]=D=>r.showDialog=!0)}))]),gt(w,{visible:r.showDialog,"onUpdate:visible":e[5]||(e[5]=D=>r.showDialog=D),modal:"",header:"Select Vocabulary",style:{width:"70vw"},breakpoints:{"1199px":"75vw","575px":"90vw"}},{default:jt(()=>[ue("div",gae,[gt(u,{modelValue:r.vocabSource,"onUpdate:modelValue":e[2]||(e[2]=D=>r.vocabSource=D),options:r.vocabSourceOptions,"aria-labelledby":"Vocabulary source"},null,8,["modelValue","options"])]),r.vocabSource==="Sandpit"?(G(),Ct(d,{key:0,closable:!1,class:"mb-4",severity:"warn"},{default:jt(()=>e[6]||(e[6]=[Jn(" Sandpit vocabularies are for work-in-progress purposes and a publication plan needs to be considered. The vocabularies can be officially 'published' from the RVA portal, and any tags used from a Sandpit vocabulary will remain valid upon publication. Please contact us for support with the vocabulary publication workflow. ")])),_:1,__:[6]})):qe("",!0),ue("div",yae,null,512),gt(y,{value:s.vocabularies,tableClass:"w-full",paginator:"",rows:20,rowsPerPageOptions:[20,30,50],onPage:s.onTablePageChange,filters:r.filters,"onUpdate:filters":e[4]||(e[4]=D=>r.filters=D),globalFilterFields:["title"]},{header:jt(()=>[ue("div",vae,[ue("span",bae,[e[7]||(e[7]=ue("i",{class:"pi pi-search"},null,-1)),gt(h,{modelValue:r.filters.global.value,"onUpdate:modelValue":e[3]||(e[3]=D=>r.filters.global.value=D),placeholder:"Search"},null,8,["modelValue"])])])]),empty:jt(()=>e[8]||(e[8]=[Jn(" No results found. ")])),default:jt(()=>[gt(g,{style:{width:"50%"},field:"title",header:"Title",sortable:!0},{body:jt(D=>[ue("a",{href:D.data.id,target:"_blank"},lt(D.data.title),9,wae)]),_:1}),gt(g,{style:{width:"40%"},field:"publisher",header:"Publisher",sortable:!0},{body:jt(D=>[Jn(lt(D.data.publisher.join(", ")),1)]),_:1}),gt(g,null,{body:jt(D=>[gt(o,{label:"Select",onClick:P=>s.selectVocab(D.data.id)},null,8,["onClick"])]),_:1})]),_:1},8,["value","onPage","filters"])]),_:1},8,["visible"])])}const Sae=tN(dae,[["render",_ae]]);var nN={exports:{}};/*! For license information please see annotorious-selector-pack.js.LICENSE.txt */(function(t,e){(function(n,i){t.exports=i()})(self,()=>(()=>{var n={922:o=>{o.exports=function(u){var d=[];return d.toString=function(){return this.map(function(h){var g=u(h);return h[2]?"@media ".concat(h[2]," {").concat(g,"}"):g}).join("")},d.i=function(h,g,y){typeof h=="string"&&(h=[[null,h,""]]);var w={};if(y)for(var C=0;C{function u(d,h){(h==null||h>d.length)&&(h=d.length);for(var g=0,y=new Array(h);g{function u(d){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},u(d)}o.exports=function d(h,g){if(h===g)return!0;if(h&&g&&u(h)=="object"&&u(g)=="object"){if(h.constructor!==g.constructor)return!1;var y,w,C;if(Array.isArray(h)){if((y=h.length)!=g.length)return!1;for(w=y;w--!=0;)if(!d(h[w],g[w]))return!1;return!0}if(h.constructor===RegExp)return h.source===g.source&&h.flags===g.flags;if(h.valueOf!==Object.prototype.valueOf)return h.valueOf()===g.valueOf();if(h.toString!==Object.prototype.toString)return h.toString()===g.toString();if((y=(C=Object.keys(h)).length)!==Object.keys(g).length)return!1;for(w=y;w--!=0;)if(!Object.prototype.hasOwnProperty.call(g,C[w]))return!1;for(w=y;w--!=0;){var D=C[w];if(!d(h[D],g[D]))return!1}return!0}return h!=h&&g!=g}},773:o=>{function u(){}u.prototype={on:function(d,h,g){var y=this.e||(this.e={});return(y[d]||(y[d]=[])).push({fn:h,ctx:g}),this},once:function(d,h,g){var y=this;function w(){y.off(d,w),h.apply(g,arguments)}return w._=h,this.on(d,w,g)},emit:function(d){for(var h=[].slice.call(arguments,1),g=((this.e||(this.e={}))[d]||[]).slice(),y=0,w=g.length;y{d.d(u,{Z:()=>C});var h=d(162),g=d.n(h),y=d(922),w=d.n(y)()(g());w.push([o.id,".a9s-selection.improved-polygon .a9s-rubberband{fill:rgba(255,255,255,.15);stroke-width:1px;stroke:rgba(0,0,0,.3)}.a9s-selection.improved-polygon .a9s-inner,.a9s-annotation.improved-polygon.editable .a9s-inner{stroke-width:2px;stroke:#fff;stroke-dasharray:5 3}.a9s-annotation.improved-polygon.editable .a9s-inner:hover{fill:transparent}.a9s-selection.improved-polygon .a9s-outer,.a9s-annotation.improved-polygon.editable .a9s-outer{stroke-width:4px;stroke:rgba(0,0,0,.35)}.a9s-selection.improved-polygon .a9s-handle .a9s-handle-outer,.a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-outer{stroke-width:1;stroke:#000;color:green}.a9s-selection.improved-polygon .a9s-handle .a9s-handle-inner,.a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-inner{stroke-width:2;stroke:#fff;fill:#000;color:green}.a9s-selection.improved-polygon .a9s-handle .a9s-handle-inner:hover,.a9s-annotation.improved-polygon.editable .a9s-handle.selected .a9s-handle-inner,.a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-inner:hover{fill:#fff;color:green}.selectedCorner{fill:#fff !important}.selectedCorner .a9s-handle-inner{fill:#fff !important;color:green}.a9s-annotation.improved-polygon.editable .a9s-midpoint{display:none;fill:rgba(255,255,255,.65);stroke-width:1;stroke:rgba(0,0,0,.65)}.a9s-annotation.improved-polygon.editable:hover .a9s-midpoint{display:block}.a9s-annotation.improved-polygon.editable .a9s-midpoint:hover{fill:#fff}","",{version:3,sources:["webpack://./src/multipolygon/EditableMultipolygon.scss"],names:[],mappings:"AACA,gDACE,0BAAA,CACA,gBAAA,CACA,qBAAA,CAIF,gGAEE,gBAAA,CACA,WAAA,CACA,oBAAA,CAGF,2DACE,gBAAA,CAGF,gGAEE,gBAAA,CACA,sBAAA,CAIF,sIAEE,cAAA,CACA,WAAA,CACA,WAAA,CAGF,sIAEE,cAAA,CACA,WAAA,CACA,SAAA,CACA,WAAA,CAGF,mOAGE,SAAA,CACA,WAAA,CAEF,gBACE,oBAAA,CAEF,kCACE,oBAAA,CACA,WAAA,CAGF,wDACE,YAAA,CACA,0BAAA,CACA,cAAA,CACA,sBAAA,CAGF,8DACE,aAAA,CAGF,8DACE,SAAA",sourcesContent:[`/** Rubberband **/ .a9s-selection.improved-polygon .a9s-rubberband { fill:rgba(255,255,255,0.15); stroke-width:1px; stroke:rgba(0, 0, 0, 0.3); } /** Polygon **/ .a9s-selection.improved-polygon .a9s-inner, .a9s-annotation.improved-polygon.editable .a9s-inner { stroke-width:2px; stroke:#fff; stroke-dasharray:5 3; } .a9s-annotation.improved-polygon.editable .a9s-inner:hover { fill:transparent; } .a9s-selection.improved-polygon .a9s-outer, .a9s-annotation.improved-polygon.editable .a9s-outer { stroke-width:4px; stroke:rgba(0, 0, 0, 0.35); } /** Corner handles **/ .a9s-selection.improved-polygon .a9s-handle .a9s-handle-outer, .a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-outer { stroke-width:1; stroke:#000; color:green; } .a9s-selection.improved-polygon .a9s-handle .a9s-handle-inner, .a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-inner { stroke-width:2; stroke:#fff; fill:#000; color:green; } .a9s-selection.improved-polygon .a9s-handle .a9s-handle-inner:hover, .a9s-annotation.improved-polygon.editable .a9s-handle.selected .a9s-handle-inner, .a9s-annotation.improved-polygon.editable .a9s-handle .a9s-handle-inner:hover { fill:#fff; color:green; } .selectedCorner { fill: white!important; } .selectedCorner .a9s-handle-inner{ fill: white!important; color:green; } /** Midpoints **/ .a9s-annotation.improved-polygon.editable .a9s-midpoint { display:none; fill:rgba(255,255,255,0.65); stroke-width:1; stroke:rgba(0,0,0,0.65); } .a9s-annotation.improved-polygon.editable:hover .a9s-midpoint { display:block; } .a9s-annotation.improved-polygon.editable .a9s-midpoint:hover { fill:#fff; } `],sourceRoot:""}]);const C=w},379:(o,u,d)=>{var h,g=function(){var ve={};return function(fe){if(ve[fe]===void 0){var ae=document.querySelector(fe);if(window.HTMLIFrameElement&&ae instanceof window.HTMLIFrameElement)try{ae=ae.contentDocument.head}catch{ae=null}ve[fe]=ae}return ve[fe]}}(),y=[];function w(ve){for(var fe=-1,ae=0;ae{var u=o&&o.__esModule?()=>o.default:()=>o;return r.d(u,{a:u}),u},r.d=(o,u)=>{for(var d in u)r.o(u,d)&&!r.o(o,d)&&Object.defineProperty(o,d,{enumerable:!0,get:u[d]})},r.o=(o,u)=>Object.prototype.hasOwnProperty.call(o,u),r.nc=void 0;var s={};return(()=>{r.d(s,{default:()=>Ua});var o,u=r(773),d=r.n(u),h="http://www.w3.org/2000/svg",g=function(L){var R=L.getAttribute("class");return R?new Set(R.split(" ")):new Set},y=function(L,R){var z=g(L);z.add(R),L.setAttribute("class",Array.from(z).join(" "))},w=function(L,R){var z=g(L);z.delete(R),z.size===0?L.removeAttribute("class"):L.setAttribute("class",Array.from(z).join(" "))},C=function(L,R){return g(L).has(R)},D=new Uint8Array(16);function P(){if(!o&&!(o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(D)}const M=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,F=function(L){return typeof L=="string"&&M.test(L)};for(var K=[],$=0;$<256;++$)K.push(($+256).toString(16).substr(1));const ee=function(L,R,z){var q=(L=L||{}).random||(L.rng||P)();return q[6]=15&q[6]|64,q[8]=63&q[8]|128,function(Xe){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Se=(K[Xe[Je+0]]+K[Xe[Je+1]]+K[Xe[Je+2]]+K[Xe[Je+3]]+"-"+K[Xe[Je+4]]+K[Xe[Je+5]]+"-"+K[Xe[Je+6]]+K[Xe[Je+7]]+"-"+K[Xe[Je+8]]+K[Xe[Je+9]]+"-"+K[Xe[Je+10]]+K[Xe[Je+11]]+K[Xe[Je+12]]+K[Xe[Je+13]]+K[Xe[Je+14]]+K[Xe[Je+15]]).toLowerCase();if(!F(Se))throw TypeError("Stringified UUID is invalid");return Se}(q)};var he=r(94),ve=r.n(he);function fe(L,R){var z=Object.keys(L);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(L);R&&(q=q.filter(function(Xe){return Object.getOwnPropertyDescriptor(L,Xe).enumerable})),z.push.apply(z,q)}return z}function ae(L){for(var R=1;R"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var z,q=Ft(L);if(R){var Xe=Ft(this).constructor;z=Reflect.construct(q,arguments,Xe)}else z=q.apply(this,arguments);return function(Je,Se){if(Se&&(Xt(Se)==="object"||typeof Se=="function"))return Se;if(Se!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return li(Je)}(this,z)}}function li(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}function Ft(L){return Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},Ft(L)}function ui(L,R,z){return R in L?Object.defineProperty(L,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):L[R]=z,L}var or="An implementation is missing",ji="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Vi=function(L){xn(z,L);var R=Zn(z);function z(q,Xe,Je){var Se;cn(this,z),ui(li(Se=R.call(this)),"enableResponsive",function(){window.ResizeObserver&&(Se.resizeObserver=new ResizeObserver(function(){var me=Se.svg.getBoundingClientRect(),nt=Se.svg.viewBox.baseVal,le=nt.width,j=nt.height;Se.scale=Math.max(le/me.width,j/me.height),Se.onScaleChanged&&Se.onScaleChanged(Se.scale)}),Se.resizeObserver.observe(Se.svg.parentNode))}),ui(li(Se),"getSVGPoint",function(me){var nt=Se.svg.createSVGPoint();if(ji){var le=Se.svg.getBoundingClientRect(),j=me.clientX-le.x,Q=me.clientY-le.y,dt=Se.svg.getBoundingClientRect(),ht=dt.left,At=dt.top;return nt.x=j+ht,nt.y=Q+At,nt.matrixTransform(Se.g.getScreenCTM().inverse())}return nt.x=me.offsetX,nt.y=me.offsetY,nt.matrixTransform(Se.g.getCTM().inverse())}),ui(li(Se),"drawHandle",function(me,nt){var le=document.createElementNS(h,"g");le.setAttribute("class","a9s-handle");var j=document.createElementNS(h,"g"),Q=function(Tt){var it=document.createElementNS(h,"circle");return it.setAttribute("cx",me),it.setAttribute("cy",nt),it.setAttribute("r",Tt),it.setAttribute("transform-origin","".concat(me," ").concat(nt)),it},dt=Se.config.handleRadius||6,ht=Q(dt);ht.setAttribute("class","a9s-handle-inner");var At=Q(dt+1);return At.setAttribute("class","a9s-handle-outer"),j.appendChild(At),j.appendChild(ht),le.appendChild(j),le}),ui(li(Se),"setHandleXY",function(me,nt,le){var j=me.querySelector(".a9s-handle-inner");j.setAttribute("cx",nt),j.setAttribute("cy",le),j.setAttribute("transform-origin","".concat(nt," ").concat(le));var Q=me.querySelector(".a9s-handle-outer");Q.setAttribute("cx",nt),Q.setAttribute("cy",le),Q.setAttribute("transform-origin","".concat(nt," ").concat(le))}),ui(li(Se),"getHandleXY",function(me){var nt=me.querySelector(".a9s-handle-outer");return{x:parseFloat(nt.getAttribute("cx")),y:parseFloat(nt.getAttribute("cy"))}}),ui(li(Se),"scaleHandle",function(me){var nt=me.querySelector(".a9s-handle-inner"),le=me.querySelector(".a9s-handle-outer"),j=Se.scale*(Se.config.handleRadius||6);nt.setAttribute("r",j),le.setAttribute("r",j)}),Se.svg=q.closest("svg"),Se.g=q,Se.config=Xe,Se.env=Je,Se.scale=1;var ye=Je.image;return(ye instanceof Element||ye instanceof HTMLDocument)&&Se.enableResponsive(),Se}return Qt(z,[{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeObserver=null}}]),z}(d()),Hn=function(L){xn(z,L);var R=Zn(z);function z(q,Xe,Je){var Se;return cn(this,z),ui(li(Se=R.call(this,q,Xe,Je)),"attachListeners",function(ye){var me=ye.mouseMove,nt=ye.mouseUp,le=ye.dblClick;me&&(Se.mouseMove=function(j){var Q=Se.getSVGPoint(j),dt=Q.x,ht=Q.y;Se.started||(Se.emit("startSelection",{x:dt,y:ht}),Se.started=!0),me(dt,ht,j)},Se.svg.addEventListener("mousemove",Se.mouseMove)),nt&&(Se.mouseUp=function(j){if(j.button===0){var Q=Se.getSVGPoint(j),dt=Q.x,ht=Q.y;nt(dt,ht,j)}},document.addEventListener("mouseup",Se.mouseUp)),le&&(Se.dblClick=function(j){var Q=Se.getSVGPoint(j),dt=Q.x,ht=Q.y;le(dt,ht,j)},document.addEventListener("dblclick",Se.dblClick))}),ui(li(Se),"detachListeners",function(){Se.mouseMove&&Se.svg.removeEventListener("mousemove",Se.mouseMove),Se.mouseUp&&document.removeEventListener("mouseup",Se.mouseUp),Se.dblClick&&document.removeEventListener("dblclick",Se.dblClick)}),ui(li(Se),"start",function(ye,me){var nt=Se.getSVGPoint(ye),le=nt.x,j=nt.y,Q=Se.env.image,dt=Q.naturalWidth,ht=Q.naturalHeight,At=le<0?0:le>dt?dt:le,Tt=j<0?0:j>ht?ht:j;Se.startDrawing(At,Tt,me,ye)}),ui(li(Se),"startDrawing",function(ye){throw new Error(or)}),ui(li(Se),"createEditableShape",function(ye,me){throw new Error(or)}),Se.started=!1,Se}return Qt(z,[{key:"isDrawing",get:function(){throw new Error(or)}}]),z}(Vi);function Ur(L){return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Ur(L)}function Fe(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=ce(q);if(Xe){var nt=ce(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Ur(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(le)}(this,ye)});function Se(ye,me,nt,le){var j,Q,dt,ht;return function(At,Tt){if(!(At instanceof Tt))throw new TypeError("Cannot call a class as a function")}(this,Se),ht=function(At){throw new Error(Re)},(dt="updateState")in(Q=N(j=Je.call(this,me,nt,le)))?Object.defineProperty(Q,dt,{value:ht,enumerable:!0,configurable:!0,writable:!0}):Q[dt]=ht,j.annotation=ye,j}return R=Se,(z=[{key:"element",get:function(){throw new Error(Re)}}])&&Fe(R.prototype,z),Se}(Vi);function re(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Z(q);if(Xe){var nt=Z(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(kt(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return te(le)}(this,ye)});function Se(ye,me,nt,le){var j;(function(At,Tt){if(!(At instanceof Tt))throw new TypeError("Cannot call a class as a function")})(this,Se),be(te(j=Je.call(this,ye,me,nt,le)),"onScaleChanged",function(){return j.scaleHandle(j.point)}),be(te(j),"onGrab",function(){j.isGrabbed=!0}),be(te(j),"onMouseMove",function(At){if(At.button===0&&j.isGrabbed){var Tt=j.getSVGPoint(At),it=Tt.x,ct=Tt.y;j.setHandleXY(j.point,it,ct);var ft=rt(it,ct,j.env.image,j.config.fragmentUnit);j.emit("update",ft)}}),be(te(j),"onMouseUp",function(){j.isGrabbed=!1}),be(te(j),"updateState",function(At){var Tt=ge(At,j.env.image),it=Tt.x,ct=Tt.y;j.setHandleXY(j.point,it,ct)}),j.svg.addEventListener("mousemove",j.onMouseMove),j.svg.addEventListener("mouseup",j.onMouseUp);var Q=ge(ye,le.image),dt=Q.x,ht=Q.y;return j.container=document.createElementNS(h,"g"),j.elementGroup=document.createElementNS(h,"g"),j.elementGroup.setAttribute("class","a9s-annotation editable selected"),j.point=j.drawHandle(dt,ht),j.point.addEventListener("mousedown",j.onGrab),j.elementGroup.appendChild(j.point),j.container.appendChild(j.elementGroup),me.appendChild(j.container),j.isGrabbed=!1,j}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}},{key:"destroy",value:function(){this.svg.removeEventListener("mousemove",this.onMouseMove),this.svg.removeEventListener("mouseup",this.onMouseUp),this.container.parentNode.removeChild(this.container),tn(Z(Se.prototype),"destroy",this).call(this)}}])&&Dt(R.prototype,z),Se}(Ye);function at(L){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},at(L)}function Et(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=nn(q);if(Xe){var nt=nn(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(at(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gn(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),ur(gn(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q,dt,ht){var At,Tt=(At=ht.target.closest(".a9s-annotation"))===null||At===void 0?void 0:At.annotation;if(Tt&&We(Tt))le.emit("cancel");else{var it=le.drawHandle(j,Q);le.scaleHandle(it),le.g.appendChild(it),it.annotation=new Ut(rt(j,Q,le.env.image,le.config.fragmentUnit)),le.emit("complete",it)}}),ur(gn(le),"stop",function(){}),ur(gn(le),"createEditableShape",function(j){return new we(j,le.g,le.config,le.env)}),le}return R=Se,(z=[{key:"isDrawing",get:function(){return!1}}])&&Et(R.prototype,z),Se}(Hn);ci.identifier="point",ci.supports=function(L){return!1};var os=function(L){var R=function(q){Array.from(q.attributes).forEach(function(Xe){Xe.name.startsWith("on")&&q.removeAttribute(Xe.name)})},z=L.getElementsByTagName("script");return Array.from(z).reverse().forEach(function(q){return q.parentNode.removeChild(q)}),R(L),Array.from(L.querySelectorAll("*")).forEach(R),L},Hr=function(L){var R,z,q=L.selector("SvgSelector");if(q){var Xe=new DOMParser,Je=q.value,Se=Xe.parseFromString(Je,"image/svg+xml"),ye=Se.lookupPrefix(h),me=Se.lookupNamespaceURI(null);return ye||me?os(Se).firstChild:os((R=Se,z=new XMLSerializer().serializeToString(R.documentElement).replace("",'')),new DOMParser().parseFromString(z,"image/svg+xml").documentElement)).firstChild}},kr=function(L){var R=Hr(L),z=document.createElementNS(h,"g"),q=R.cloneNode(!0);q.setAttribute("class","a9s-inner");var Xe=R.cloneNode(!0);return Xe.setAttribute("class","a9s-outer"),z.appendChild(Xe),z.appendChild(q),z},ar=function(L,R){var z=L.querySelector(".a9s-inner").cloneNode(!0);z.removeAttribute("class"),z.removeAttribute("xmlns");var q=z.outerHTML||new XMLSerializer().serializeToString(z);return q=q.replace(' xmlns="'.concat(h,'"'),""),{source:R==null?void 0:R.src,selector:{type:"SvgSelector",value:"".concat(q,"")}}},wo=function(L,R,z,q){L.setAttribute("cx",R),L.setAttribute("cy",z),L.setAttribute("r",q)},qt=function(L,R,z){var q=document.createElementNS(h,"g"),Xe=document.createElementNS(h,"circle"),Je=document.createElementNS(h,"circle");return Je.setAttribute("class","a9s-inner"),wo(Je,L,R,z),Xe.setAttribute("class","a9s-outer"),wo(Xe,L,R,z),q.appendChild(Xe),q.appendChild(Je),q},Qs=function(L,R,z,q){var Xe=L.querySelector(".a9s-inner"),Je=L.querySelector(".a9s-outer");wo(Xe,R,z,q),wo(Je,R,z,q)},ca=function(L){var R=L.querySelector(".a9s-outer");return{cx:parseFloat(R.getAttribute("cx")),cy:parseFloat(R.getAttribute("cy")),r:parseFloat(R.getAttribute("r"))}};function Zr(L,R){for(var z=0;zJe.w?Je.w-At:dt,it=ht+At>Je.h?Je.h-At:ht+At;Je.mask.setAttribute("d","M0 0 h".concat(Je.w," v").concat(Je.h," h-").concat(Je.w," z M").concat(Tt," ").concat(it," a ").concat(At," ").concat(At," 0 1 1 1 0"))}),Pr(this,"destroy",function(){return Je.mask.parentNode.removeChild(Je.mask)}),this.w=q.naturalWidth,this.h=q.naturalHeight,this.circle=Xe;var Se=ca(this.circle),ye=Se.cx,me=Se.cy,nt=Se.r,le=ye+nt>this.w?this.w-nt:ye,j=me+nt>this.h?this.h-nt:me+nt;this.mask=document.createElementNS(h,"path"),this.mask.setAttribute("fill-rule","evenodd"),this.mask.setAttribute("class","a9s-selection-mask"),this.mask.setAttribute("d","M0 0 h".concat(this.w," v").concat(this.h," h-").concat(this.w," z M").concat(le," ").concat(j," a ").concat(nt," ").concat(nt," 0 1 1 1 0"))}var R,z;return R=L,(z=[{key:"element",get:function(){return this.mask}}])&&Zr(R.prototype,z),L}();function Js(L,R){for(var z=0;zj||it-At<0||it+At>Q||(Qs(ye.circle,Tt,it,At),ye.mask.redraw())}),ri(this,"getBoundingClientRect",function(){return ye.circle.getBoundingClientRect()}),ri(this,"toSelection",function(){return new Ut(ar(ye.group,ye.env.image))}),ri(this,"destroy",function(){ye.group.parentNode.removeChild(ye.group),ye.mask=null,ye.circle=null,ye.group=null}),this.anchor=[q,Xe],this.env=Se,this.group=document.createElementNS(h,"g"),this.circle=qt(q,Xe,2),this.circle.setAttribute("class","a9s-selection"),this.mask=new zn(Se.image,this.circle),this.group.style.pointerEvents="none",this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.circle),Je.appendChild(this.group)}var R,z;return R=L,(z=[{key:"element",get:function(){return this.circle}}])&&Js(R.prototype,z),L}();function Bs(L){return function(R){if(Array.isArray(R))return Yi(R)}(L)||function(R){if(typeof Symbol<"u"&&R[Symbol.iterator]!=null||R["@@iterator"]!=null)return Array.from(R)}(L)||function(R,z){if(R){if(typeof R=="string")return Yi(R,z);var q=Object.prototype.toString.call(R).slice(8,-1);return q==="Object"&&R.constructor&&(q=R.constructor.name),q==="Map"||q==="Set"?Array.from(R):q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q)?Yi(R,z):void 0}}(L)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Yi(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);zL.length)&&(R=L.length);for(var z=0,q=new Array(R);z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Pt(q);if(Xe){var nt=Pt(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(mr(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gt(le)}(this,ye)});function Se(ye,me,nt,le){var j;(function(Tt,it){if(!(Tt instanceof it))throw new TypeError("Cannot call a class as a function")})(this,Se),Pn(Gt(j=Je.call(this,ye,me,nt,le)),"setSize",function(Tt,it,ct){Qs(j.circle,Tt,it,ct),j.mask.redraw(),Ln(j.elementGroup,Tt,it,ct,ct);var ft=qn(j.handles,4),Ot=ft[0],Mt=ft[1],$t=ft[2],fn=ft[3];j.setHandleXY(Ot,Tt,it-ct),j.setHandleXY(Mt,Tt+ct,it),j.setHandleXY($t,Tt,it+ct),j.setHandleXY(fn,Tt-ct,it)}),Pn(Gt(j),"stretchCorners",function(Tt,it,ct){var ft,Ot=j.getHandleXY(it),Mt=ct.x,$t=ct.y,fn=0,yn=0;Tt==0||Tt==2?(Mt=Ot.x,yn=$t-Ot.y,ft=Math.abs(yn)/2):($t=Ot.y,fn=Mt-Ot.x,ft=Math.abs(fn)/2);var An=fn>0?Ot.x:Mt,si=yn>0?Ot.y:$t,Mn=An+Math.abs(fn)/2,Un=si+Math.abs(yn)/2;if(Qs(j.circle,Mn,Un,ft),j.mask.redraw(),Ln(j.elementGroup,Mn,Un,ft,ft),Tt==0||Tt==2){var Tn=0,ni=2;(Tt==0&&yn>0||Tt==2&&yn<0)&&(Tn=2,ni=0),j.setHandleXY(j.handles[Tn],Mn,Un-ft),j.setHandleXY(j.handles[ni],Mn,Un+ft),j.setHandleXY(j.handles[1],Mn+ft,Un),j.setHandleXY(j.handles[3],Mn-ft,Un)}else{var bi=3,oi=1;(Tt==1&&fn>0||Tt==3&&fn<0)&&(bi=1,oi=3),j.setHandleXY(j.handles[bi],Mn+ft,Un),j.setHandleXY(j.handles[oi],Mn-ft,Un),j.setHandleXY(j.handles[0],Mn,Un-ft),j.setHandleXY(j.handles[2],Mn,Un+ft)}}),Pn(Gt(j),"onGrab",function(Tt){return function(it){j.grabbedElem=Tt;var ct=j.getSVGPoint(it),ft=ca(j.circle),Ot=ft.cx,Mt=ft.cy;j.grabbedAt={x:ct.x-Ot,y:ct.y-Mt}}}),Pn(Gt(j),"onMouseMove",function(Tt){var it=function(Mn,Un){return Mn<0?0:Mn>Un?Un:Mn};if(j.grabbedElem){var ct=j.getSVGPoint(Tt);if(j.grabbedElem===j.circle){var ft=ca(j.circle).r,Ot=j.env.image,Mt=Ot.naturalWidth,$t=Ot.naturalHeight,fn=Math.max(it(ct.x-j.grabbedAt.x,Mt-ft),ft),yn=Math.max(it(ct.y-j.grabbedAt.y,$t-ft),ft);j.setSize(fn,yn,ft),j.emit("update",ar(j.circle,j.env.image))}else{var An=j.handles.indexOf(j.grabbedElem),si=An<2?j.handles[An+2]:j.handles[An-2];j.stretchCorners(An,si,ct),j.emit("update",ar(j.circle,j.env.image))}}}),Pn(Gt(j),"onMouseUp",function(){j.grabbedElem=null,j.grabbedAt=null}),Pn(Gt(j),"onScaleChanged",function(Tt){return j.handles.map(j.scaleHandle)}),Pn(Gt(j),"updateState",function(Tt){var it=Hr(Tt),ct=parseFloat(it.getAttribute("cx")),ft=parseFloat(it.getAttribute("cy")),Ot=parseFloat(it.getAttribute("r"));j.setSize(ct,ft,Ot)}),j.svg.addEventListener("mousemove",j.onMouseMove),j.svg.addEventListener("mouseup",j.onMouseUp),j.containerGroup=document.createElementNS(h,"g"),j.circle=kr(ye),j.circle.querySelector(".a9s-inner").addEventListener("mousedown",j.onGrab(j.circle)),j.mask=new zn(le.image,j.circle),j.containerGroup.appendChild(j.mask.element),j.elementGroup=document.createElementNS(h,"g"),j.elementGroup.setAttribute("class","a9s-annotation editable selected"),j.elementGroup.appendChild(j.circle);var Q=ca(j.circle),dt=Q.cx,ht=Q.cy,At=Q.r;return j.handles=[[dt,ht-At],[dt+At,ht],[dt,ht+At],[dt-At,ht]].map(function(Tt){var it=qn(Tt,2),ct=it[0],ft=it[1],Ot=j.drawHandle(ct,ft);return Ot.addEventListener("mousedown",j.onGrab(Ot)),j.elementGroup.appendChild(Ot),Ot}),j.containerGroup.appendChild(j.elementGroup),me.appendChild(j.containerGroup),fr(j.circle,ye,nt.formatter),j.grabbedElem=null,j.grabbedAt=null,j}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}},{key:"destroy",value:function(){this.containerGroup.parentNode.removeChild(this.containerGroup),da(Pt(Se.prototype),"destroy",this).call(this)}}])&&Da(R.prototype,z),Se}(Ye);function Ai(L){return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Ai(L)}function $s(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=vi(q);if(Xe){var nt=vi(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Ai(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gr(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),Oi(gr(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q){le.attachListeners({mouseMove:le.onMouseMove,mouseUp:le.onMouseUp}),le.rubberband=new as(j,Q,le.g,le.env)}),Oi(gr(le),"stop",function(){le.rubberband&&(le.rubberband.destroy(),le.rubberband=null)}),Oi(gr(le),"onMouseMove",function(j,Q){return le.rubberband.dragTo(j,Q)}),Oi(gr(le),"onMouseUp",function(){le.detachListeners(),le.started=!1;var j=le.rubberband.getBoundingClientRect(),Q=j.width,dt=j.height,ht=le.config.minSelectionWidth||4,At=le.config.minSelectionHeight||4;if(Q>=ht&&dt>=At){var Tt=le.rubberband.element;Tt.annotation=le.rubberband.toSelection(),le.emit("complete",Tt)}else le.emit("cancel");le.stop()}),Oi(gr(le),"createEditableShape",function(j){return new Ii(j,le.g,le.config,le.env)}),le.rubberband=null,le}return R=Se,(z=[{key:"isDrawing",get:function(){return this.rubberband!=null}}])&&$s(R.prototype,z),Se}(Hn);ha.identifier="circle",ha.supports=function(L){var R,z=L.selector("SvgSelector");if(z)return(R=z.value)===null||R===void 0?void 0:R.match(/^0?ye.anchor[0]+le/2:me+le/2,dt=j>0?ye.anchor[1]+j/2:nt+j/2,ht=Math.abs(le/2),At=Math.abs(j/2);rl(ye.ellipse,Q,dt,ht,At),ye.mask.redraw()}),eo(this,"getBoundingClientRect",function(){return ye.ellipse.getBoundingClientRect()}),eo(this,"toSelection",function(){return new Ut(ar(ye.group,ye.env.image))}),eo(this,"destroy",function(){ye.group.parentNode.removeChild(ye.group),ye.mask=null,ye.ellipse=null,ye.group=null}),this.anchor=[q,Xe],this.env=Se,this.group=document.createElementNS(h,"g"),this.ellipse=Sc(q,Xe,2,2),this.ellipse.setAttribute("class","a9s-selection"),this.mask=new sl(Se.image,this.ellipse),this.group.style.pointerEvents="none",this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.ellipse),Je.appendChild(this.group)}var R,z;return R=L,(z=[{key:"element",get:function(){return this.ellipse}}])&&Ia(R.prototype,z),L}();function Oa(L){return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Oa(L)}function Ml(L,R){return function(z){if(Array.isArray(z))return z}(L)||function(z,q){var Xe=z==null?null:typeof Symbol<"u"&&z[Symbol.iterator]||z["@@iterator"];if(Xe!=null){var Je,Se,ye=[],me=!0,nt=!1;try{for(Xe=Xe.call(z);!(me=(Je=Xe.next()).done)&&(ye.push(Je.value),!q||ye.length!==q);me=!0);}catch(le){nt=!0,Se=le}finally{try{me||Xe.return==null||Xe.return()}finally{if(nt)throw Se}}return ye}}(L,R)||function(z,q){if(z){if(typeof z=="string")return Tc(z,q);var Xe=Object.prototype.toString.call(z).slice(8,-1);return Xe==="Object"&&z.constructor&&(Xe=z.constructor.name),Xe==="Map"||Xe==="Set"?Array.from(z):Xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Xe)?Tc(z,q):void 0}}(L,R)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Tc(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Go(q);if(Xe){var nt=Go(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Oa(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Es(le)}(this,ye)});function Se(ye,me,nt,le){var j;(function(it,ct){if(!(it instanceof ct))throw new TypeError("Cannot call a class as a function")})(this,Se),lr(Es(j=Je.call(this,ye,me,nt,le)),"setSize",function(it,ct,ft,Ot){rl(j.ellipse,it,ct,ft,Ot),j.mask.redraw(),Ln(j.elementGroup,it,ct,ft,Ot);var Mt=Ml(j.handles,4),$t=Mt[0],fn=Mt[1],yn=Mt[2],An=Mt[3];j.setHandleXY($t,it,ct-Ot),j.setHandleXY(fn,it+ft,ct),j.setHandleXY(yn,it,ct+Ot),j.setHandleXY(An,it-ft,ct)}),lr(Es(j),"stretchCorners",function(it,ct,ft,Ot){var Mt=j.getHandleXY(ct),$t=j.getHandleXY(ft),fn=Ot.x,yn=Ot.y,An=0,si=0;it==0||it==2?fn=Mt.x:yn=Mt.y;var Mn=fn-Mt.x,Un=yn-Mt.y,Tn=Mn>0?Mt.x:fn,ni=Un>0?Mt.y:yn,bi=Math.abs(Mn),oi=Math.abs(Un),Ei=Tn+bi/2,jn=ni+oi/2;if(An=bi/2,si=oi/2,it==0||it==2?An=Math.abs(Mt.x-$t.x):si=Math.abs(Mt.y-$t.y),rl(j.ellipse,Ei,jn,An,si),j.mask.redraw(),Ln(j.elementGroup,Ei,jn,An,si),it==0||it==2){var Lr=0,_i=2;(it==0&&Un>0||it==2&&Un<0)&&(Lr=2,_i=0),j.setHandleXY(j.handles[Lr],Ei,jn-si),j.setHandleXY(j.handles[_i],Ei,jn+si),j.setHandleXY(j.handles[1],Ei+An,jn),j.setHandleXY(j.handles[3],Ei-An,jn)}else{var xi=3,Er=1;(it==1&&Mn>0||it==3&&Mn<0)&&(xi=1,Er=3),j.setHandleXY(j.handles[xi],Ei+An,jn),j.setHandleXY(j.handles[Er],Ei-An,jn),j.setHandleXY(j.handles[0],Ei,jn-si),j.setHandleXY(j.handles[2],Ei,jn+si)}}),lr(Es(j),"onGrab",function(it){return function(ct){j.grabbedElem=it;var ft=j.getSVGPoint(ct),Ot=yt(j.ellipse),Mt=Ot.cx,$t=Ot.cy;j.grabbedAt={x:ft.x-Mt,y:ft.y-$t}}}),lr(Es(j),"onMouseMove",function(it){var ct=function(bi,oi){return bi<0?0:bi>oi?oi:bi};if(j.grabbedElem){var ft=j.getSVGPoint(it);if(j.grabbedElem===j.ellipse){var Ot=yt(j.ellipse),Mt=Ot.rx,$t=Ot.ry,fn=j.env.image,yn=fn.naturalWidth,An=fn.naturalHeight,si=ct(ft.x-j.grabbedAt.x,yn-Mt),Mn=ct(ft.y-j.grabbedAt.y,An-$t);j.setSize(si,Mn,Mt,$t),j.emit("update",ar(j.ellipse,j.env.image))}else{var Un=j.handles.indexOf(j.grabbedElem),Tn=Un<2?j.handles[Un+2]:j.handles[Un-2],ni=j.handles[(Un+3)%4];j.stretchCorners(Un,Tn,ni,ft),j.emit("update",ar(j.ellipse,j.env.image))}}}),lr(Es(j),"onMouseUp",function(){j.grabbedElem=null,j.grabbedAt=null}),lr(Es(j),"onScaleChanged",function(it){return j.handles.map(j.scaleHandle)}),lr(Es(j),"updateState",function(it){var ct=Hr(it),ft=parseFloat(ct.getAttribute("cx")),Ot=parseFloat(ct.getAttribute("cy")),Mt=parseFloat(ct.getAttribute("rx")),$t=parseFloat(ct.getAttribute("ry"));j.setSize(ft,Ot,Mt,$t)}),j.svg.addEventListener("mousemove",j.onMouseMove),j.svg.addEventListener("mouseup",j.onMouseUp),j.containerGroup=document.createElementNS(h,"g"),j.ellipse=kr(ye),j.ellipse.querySelector(".a9s-inner").addEventListener("mousedown",j.onGrab(j.ellipse)),j.mask=new sl(le.image,j.ellipse),j.containerGroup.appendChild(j.mask.element),j.elementGroup=document.createElementNS(h,"g"),j.elementGroup.setAttribute("class","a9s-annotation editable selected"),j.elementGroup.appendChild(j.ellipse);var Q=yt(j.ellipse),dt=Q.cx,ht=Q.cy,At=Q.rx,Tt=Q.ry;return j.handles=[[dt,ht-Tt],[dt+At,ht],[dt,ht+Tt],[dt-At,ht]].map(function(it){var ct=Ml(it,2),ft=ct[0],Ot=ct[1],Mt=j.drawHandle(ft,Ot);return Mt.addEventListener("mousedown",j.onGrab(Mt)),j.elementGroup.appendChild(Mt),Mt}),j.containerGroup.appendChild(j.elementGroup),me.appendChild(j.containerGroup),fr(j.ellipse,ye,nt.formatter),j.grabbedElem=null,j.grabbedAt=null,j}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}},{key:"destroy",value:function(){this.containerGroup.parentNode.removeChild(this.containerGroup),_o(Go(Se.prototype),"destroy",this).call(this)}}])&&ps(R.prototype,z),Se}(Ye);function ol(L){return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},ol(L)}function al(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=ll(q);if(Xe){var nt=ll(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(ol(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return to(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),Ri(to(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q){le.attachListeners({mouseMove:le.onMouseMove,mouseUp:le.onMouseUp}),le.rubberband=new Iu(j,Q,le.g,le.env)}),Ri(to(le),"stop",function(){le.rubberband&&(le.rubberband.destroy(),le.rubberband=null)}),Ri(to(le),"onMouseMove",function(j,Q){return le.rubberband.dragTo(j,Q)}),Ri(to(le),"onMouseUp",function(){le.detachListeners(),le.started=!1;var j=le.rubberband.getBoundingClientRect(),Q=j.width,dt=j.height,ht=le.config.minSelectionWidth||4,At=le.config.minSelectionHeight||4;if(Q>=ht&&dt>=At){var Tt=le.rubberband.element;Tt.annotation=le.rubberband.toSelection(),le.emit("complete",Tt)}else le.emit("cancel");le.stop()}),Ri(to(le),"createEditableShape",function(j){return new So(j,le.g,le.config,le.env)}),le.rubberband=null,le}return R=Se,(z=[{key:"isDrawing",get:function(){return this.rubberband!=null}}])&&al(R.prototype,z),Se}(Hn);function Ec(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z0){var q=R[0].substring(1).trim().split(" ");z.push({x:parseFloat(q[0]),y:parseFloat(q[1])});for(var Xe=1;Xe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=dl(q);if(Xe){var nt=dl(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Ou(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ko(le)}(this,ye)});function Se(ye,me,nt,le){var j,Q;(function(ht,At){if(!(ht instanceof At))throw new TypeError("Cannot call a class as a function")})(this,Se),Yo(Ko(Q=Je.call(this,ye,me,nt,le)),"setPoints",function(ht){var At=function(fn){return Math.round(10*fn)/10},Tt=ht.map(function(fn){return"L".concat(At(fn.x)," ").concat(At(fn.y))}).join(" ");Tt="M"+Tt.substring(1),Q.shape.querySelector(".a9s-inner").setAttribute("d",Tt);var it=Q.shape.querySelector(".a9s-outer");it.setAttribute("d",Tt);var ct=it.getBBox(),ft=ct.x,Ot=ct.y,Mt=ct.width,$t=ct.height;Ln(Q.elementGroup,ft,Ot,Mt,$t)}),Yo(Ko(Q),"onGrab",function(ht){return function(At){Q.grabbedElem=ht;var Tt=Q.getSVGPoint(At);Q.grabbedAt={x:Tt.x,y:Tt.y}}}),Yo(Ko(Q),"onMouseMove",function(ht){var At=function(Tn,ni,bi){return Tn+ni<0?-Tn:Tn+ni>bi?bi-Tn:ni};if(Q.grabbedElem){var Tt=Q.getSVGPoint(ht),it=Ru(Q.shape),ct=it.x,ft=it.y,Ot=it.width,Mt=it.height;if(Q.grabbedElem===Q.shape){var $t=Q.env.image,fn=$t.naturalWidth,yn=$t.naturalHeight,An=At(ct,Tt.x-Q.grabbedAt.x,fn-Ot),si=At(ft,Tt.y-Q.grabbedAt.y,yn-Mt),Mn=Q.shape.querySelector(".a9s-inner"),Un=zr(Mn).map(function(Tn){return{x:Tn.x+An,y:Tn.y+si}});Q.grabbedAt=Tt,Q.setPoints(Un),Q.emit("update",ar(Q.shape,Q.env.image))}}}),Yo(Ko(Q),"onMouseUp",function(ht){Q.grabbedElem=null,Q.grabbedAt=null}),Yo(Ko(Q),"updateState",function(ht){var At=zr(Hr(ht));Q.setPoints(At)}),Yo(Ko(Q),"destroy",function(){Q.containerGroup.parentNode.removeChild(Q.containerGroup),Fl((j=Ko(Q),dl(Se.prototype)),"destroy",j).call(j)}),Q.svg.addEventListener("mousemove",Q.onMouseMove),Q.svg.addEventListener("mouseup",Q.onMouseUp),Q.containerGroup=document.createElementNS(h,"g"),Q.shape=kr(ye),Q.elementGroup=document.createElementNS(h,"g"),Q.elementGroup.setAttribute("class","a9s-annotation editable selected"),Q.elementGroup.appendChild(Q.shape),Q.containerGroup.appendChild(Q.elementGroup),me.appendChild(Q.containerGroup),fr(Q.shape,ye,nt.formatter),Q.shape.querySelector(".a9s-inner").addEventListener("mousedown",Q.onGrab(Q.shape));var dt=Ru(Q.shape);return dt.x,dt.y,dt.width,dt.height,Q.grabbedElem=null,Q.grabbedAt=null,Q}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}}])&&Ma(R.prototype,z),Se}(Ye);function Cc(L){return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Cc(L)}function Bl(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Hl(q);if(Xe){var nt=Hl(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Cc(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Na(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),fa(Na(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q){le._isDrawing=!0,le.attachListeners({mouseMove:le.onMouseMove,mouseUp:le.onMouseUp,dblClick:le.onDblClick}),le.rubberband=new Nl([j,Q],le.g,le.env)}),fa(Na(le),"stop",function(){le.detachListeners(),le._isDrawing=!1,le.rubberband&&(le.rubberband.destroy(),le.rubberband=null)}),fa(Na(le),"onMouseMove",function(j,Q){return le.rubberband.dragTo([j,Q])}),fa(Na(le),"onMouseUp",function(j,Q){le.onDblClick(j,Q)}),fa(Na(le),"onDblClick",function(j,Q){le._isDrawing=!1,le.rubberband.addPoint([j,Q]),le.detachListeners();var dt=le.rubberband.getBoundingClientRect(),ht=dt.width,At=dt.height,Tt=le.config.minSelectionWidth||4,it=le.config.minSelectionHeight||4;if(ht>=Tt||At>=it){var ct=le.rubberband.element;ct.annotation=le.rubberband.toSelection(),le.emit("complete",ct)}else le.emit("cancel");le.stop()}),fa(Na(le),"createEditableShape",function(j){return new Sd(j,le.g,le.config,le.env)}),le._isDrawing=!1,le}return R=Se,(z=[{key:"isDrawing",get:function(){return this._isDrawing}}])&&Bl(R.prototype,z),Se}(Hn);function Ac(L){return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Ac(L)}function kc(L){return function(R){if(Array.isArray(R))return jl(R)}(L)||function(R){if(typeof Symbol<"u"&&R[Symbol.iterator]!=null||R["@@iterator"]!=null)return Array.from(R)}(L)||Td(L)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Pc(L,R){var z=typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(!z){if(Array.isArray(L)||(z=Td(L))||R){z&&(L=z);var q=0,Xe=function(){};return{s:Xe,n:function(){return q>=L.length?{done:!0}:{done:!1,value:L[q++]}},e:function(me){throw me},f:Xe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Je,Se=!0,ye=!1;return{s:function(){z=z.call(L)},n:function(){var me=z.next();return Se=me.done,me},e:function(me){ye=!0,Je=me},f:function(){try{Se||z.return==null||z.return()}finally{if(ye)throw Je}}}}function Td(L,R){if(L){if(typeof L=="string")return jl(L,R);var z=Object.prototype.toString.call(L).slice(8,-1);return z==="Object"&&L.constructor&&(z=L.constructor.name),z==="Map"||z==="Set"?Array.from(L):z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z)?jl(L,R):void 0}}function jl(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Li(q);if(Xe){var nt=Li(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Ac(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dr(le)}(this,ye)});function Se(ye,me,nt,le){var j;return function(Q,dt){if(!(Q instanceof dt))throw new TypeError("Cannot call a class as a function")}(this,Se),jr(Dr(j=Je.call(this,me,nt,le)),"setPoints",function(Q){var dt,ht="",At=Pc(Q);try{for(At.s();!(dt=At.n()).done;){var Tt=dt.value,it="";if(Tt.length>0){var ct,ft=Pc(Tt);try{for(ft.s();!(ct=ft.n()).done;){var Ot=ct.value;Ot&&(it+=it===""?"M".concat(Ot[0],",").concat(Ot[1]):" L".concat(Ot[0],",").concat(Ot[1]))}}catch(Mt){ft.e(Mt)}finally{ft.f()}ht+=it}}}catch(Mt){At.e(Mt)}finally{At.f()}ht+=" Z",j.outer.setAttribute("d",ht),j.inner.setAttribute("d",ht)}),jr(Dr(j),"close",function(){var Q=new Q(ar(j.points,j.env.image));j.emit("close",{shape:j.multipolygon,multipolygon:Q})}),jr(Dr(j),"getBoundingClientRect",function(){return j.outer.getBoundingClientRect()}),jr(Dr(j),"dragTo",function(Q){j.group.style.display=null,j.mousepos=Q;var dt=j.points[j.points.length-1].slice(0,j.points[j.points.length-1].length-1),ht=j.points.slice(0,-1),At=[].concat(kc(dt),[Q,dt[0]]);ht.push(At),j.setPoints(ht)}),jr(Dr(j),"onScaleChanged",function(Q){j.scale=Q;var dt=j.closeHandle.querySelector(".a9s-handle-inner"),ht=j.closeHandle.querySelector(".a9s-handle-outer"),At=Q*(j.config.handleRadius||6);dt.setAttribute("r",At),ht.setAttribute("r",At)}),jr(Dr(j),"addPoint",function(Q){if(j.points[j.points.length-1].length>0){var dt=j.points[j.points.length-1].slice(0,j.points[j.points.length-1].length-1),ht=dt[dt.length-1];Math.pow(Q[0]-ht[0],2)+Math.pow(Q[1]-ht[1],2)>4&&(j.points[j.points.length-1]=[].concat(kc(dt),[Q,dt[0]]),j.setPoints(j.points))}else j.points[j.points.length-1]=[Q,Q],j.setPoints(j.points)}),jr(Dr(j),"undo",function(){j.pop()}),jr(Dr(j),"isClosable",function(){return j.getDistanceToStart()<6*j.scale}),jr(Dr(j),"pop",function(){j.points[j.points.length-1].length>2?j.points[j.points.length-1].pop():j.points.length>1&&j.points.pop(),j.setPoints(j.points)}),jr(Dr(j),"newPart",function(){j.points.push([])}),jr(Dr(j),"getDistanceToStart",function(){if(j.points[j.points.length-1].length<3)return 1/0;var Q=Math.abs(j.mousepos[0]-j.points[j.points.length-1][0][0]),dt=Math.abs(j.mousepos[1]-j.points[j.points.length-1][0][1]);return Math.sqrt(Math.pow(Q,2)+Math.pow(dt,2))/j.scale}),jr(Dr(j),"destroy",function(){j.group.parentNode.removeChild(j.group),j.multipolygon=null,j.group=null}),jr(Dr(j),"toSelection",function(){return new Ut(ar(j.group,j.env.image))}),j.points=[],j.points.push([ye,ye]),j.mousepos=ye,j.env=le,j.scale=1,j.group=document.createElementNS(h,"g"),j.multipolygon=document.createElementNS(h,"g"),j.multipolygon.setAttribute("class","a9s-selection a9s-multipolygon improved-polygon"),j.rubberband=document.createElementNS(h,"polygon"),j.rubberband.setAttribute("class","a9s-rubberband"),j.closeHandle=j.drawHandle(ye[0],ye[1]),j.closeHandle.style.display="none",j.outer=document.createElementNS(h,"path"),j.outer.setAttribute("class","a9s-outer"),j.inner=document.createElementNS(h,"path"),j.inner.setAttribute("class","a9s-inner"),j.setPoints(j.points),j.multipolygon.appendChild(j.rubberband),j.multipolygon.appendChild(j.outer),j.multipolygon.appendChild(j.inner),j.multipolygon.appendChild(j.closeHandle),j.group.style.display="none",j.group.appendChild(j.multipolygon),me.appendChild(j.group),j}return R=Se,(z=[{key:"element",get:function(){return this.multipolygon}}])&&Th(R.prototype,z),Se}(Vi),Ed=function(L,R){for(var z=L[0],q=L[1],Xe=!1,Je=0,Se=R.length-1;Jeq!=le>q&&z<(nt-ye)*(q-me)/(le-me)+ye&&(Xe=!Xe)}return Xe},Dc=r(379),xs=r.n(Dc),Ir=r(354);function ls(L){return ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},ls(L)}function Jr(L){return function(R){if(Array.isArray(R))return To(R)}(L)||function(R){if(typeof Symbol<"u"&&R[Symbol.iterator]!=null||R["@@iterator"]!=null)return Array.from(R)}(L)||Mu(L)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Cs(L,R){for(var z=0;z=L.length?{done:!0}:{done:!1,value:L[q++]}},e:function(me){throw me},f:Xe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Je,Se=!0,ye=!1;return{s:function(){z=z.call(L)},n:function(){var me=z.next();return Se=me.done,me},e:function(me){ye=!0,Je=me},f:function(){try{Se||z.return==null||z.return()}finally{if(ye)throw Je}}}}function Mu(L,R){if(L){if(typeof L=="string")return To(L,R);var z=Object.prototype.toString.call(L).slice(8,-1);return z==="Object"&&L.constructor&&(z=L.constructor.name),z==="Map"||z==="Set"?Array.from(L):z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z)?To(L,R):void 0}}function To(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z0){var Je=[];(q=(q=(q=(q=(q=q.replace(/ Z/g,"Z")).replace(/Z /g,"Z")).replace(/Z/g,"")).replace(/L /g,"L")).replace(/ L/g,"L")).split("L").forEach(function(Se,ye){Je.push([parseFloat(Se.split(",")[0]).toFixed(2).toString(),parseFloat(Se.split(",")[1]).toFixed(2).toString()])}),Je[0][0]!==Je[Je.length-1][0]&&Je[0][1]!==Je[Je.length-1][1]&&Je.push(Je[0]),z.push(Je)}}),z},Hs=function(L){var R,z=[],q=Wr(ga(L.querySelector(".a9s-inner").attributes.d.nodeValue));try{for(q.s();!(R=q.n()).done;){var Xe,Je=R.value,Se=[],ye=Wr(Je);try{for(ye.s();!(Xe=ye.n()).done;){var me=Xe.value,nt={x:parseFloat(me[0]),y:parseFloat(me[1])};Se.push(nt)}}catch(le){ye.e(le)}finally{ye.f()}z.push(Se)}}catch(le){q.e(le)}finally{q.f()}return z},Fa=function(L){return L.querySelector(".a9s-inner").getBBox()},Or=function(L){var R=Hr(L);(function(Je){var Se=Hr(Je).getAttribute("d");ga(Se)})(L);var z=document.createElementNS(h,"g"),q=R.cloneNode(!0);q.setAttribute("class","a9s-inner");var Xe=R.cloneNode(!0);return Xe.setAttribute("class","a9s-outer"),z.appendChild(Xe),z.appendChild(q),z},ya=function(L){(function(ye,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function");ye.prototype=Object.create(me&&me.prototype,{constructor:{value:ye,writable:!0,configurable:!0}}),me&&no(ye,me)})(Se,L);var R,z,q,Xe,Je=(q=Se,Xe=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=ma(q);if(Xe){var nt=ma(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(ls(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wi(le)}(this,ye)});function Se(ye,me,nt,le){var j,Q;(function(it,ct){if(!(it instanceof ct))throw new TypeError("Cannot call a class as a function")})(this,Se),Vr(wi(Q=Je.call(this,ye,me,nt,le)),"createCornerHandle",function(it){var ct=Q.drawHandle(it.x,it.y);return ct.addEventListener("mousedown",Q.onGrab(ct)),ct.addEventListener("click",Q.onSelectCorner(ct)),Q.scaleHandle(ct),Q.elementGroup.appendChild(ct),ct}),Vr(wi(Q),"createMidpoint",function(it,ct){var ft=it[ct],Ot=ct===it.length-1?it[0]:it[ct+1],Mt=(ft.x+Ot.x)/2,$t=(ft.y+Ot.y)/2,fn=Q.drawMidpoint(Mt,$t);return fn.addEventListener("mousedown",Q.onGrab(fn)),Q.shape.appendChild(fn),fn}),Vr(wi(Q),"deleteSelected",function(){var it=Hs(Q.shape);Q.selected.length>0&&function(){var ct,ft=-1,Ot=[],Mt=[],$t=Wr(Q.midpoints);try{for($t.s();!(ct=$t.n()).done;){var fn=ct.value,yn=fn.filter(function(_i,xi){return Q.selected.map(function(Er){return Er[0]===ft&&Er[1]===xi}).indexOf(!0)===-1}),An=fn.filter(function(_i,xi){return Q.selected.map(function(Er){return Er[0]===ft&&Er[1]===xi}).indexOf(!0)>-1});An.forEach(function(_i){return _i.parentNode.removeChild(_i)}),yn.length>2&&Mt.push(yn)}}catch(_i){$t.e(_i)}finally{$t.f()}var si,Mn=Wr(it);try{for(Mn.s();!(si=Mn.n()).done;){var Un=si.value;ft+=1;var Tn=Un.filter(function(_i,xi){return Q.selected.map(function(Er){return Er[0]===ft&&Er[1]===xi}).indexOf(!0)===-1});Tn.length>2&&Ot.push(Tn)}}catch(_i){Mn.e(_i)}finally{Mn.f()}ft=-1;var ni,bi=[],oi=Wr(Q.cornerHandles);try{for(oi.s();!(ni=oi.n()).done;){var Ei=ni.value;ft+=1;var jn=Ei.filter(function(_i,xi){return Q.selected.map(function(Er){return Er[0]===ft&&Er[1]===xi}).indexOf(!0)!==-1}),Lr=Ei.filter(function(_i,xi){return Q.selected.map(function(Er){return Er[0]===ft&&Er[1]===xi}).indexOf(!0)===-1});Lr.length>2&&bi.push(Lr),jn.forEach(function(_i){return _i.parentNode.removeChild(_i)})}}catch(_i){oi.e(_i)}finally{oi.f()}Q.midpoints=Mt,Q.cornerHandles=bi,Q.selected=[],Q.setPoints(Ot)}()}),Vr(wi(Q),"deselectCorners",function(){return Q.cornerHandles.forEach(function(it){return w(it,"selected")})}),Vr(wi(Q),"destroy",function(){Q.container.parentNode.removeChild(Q.container),Q.svg.removeEventListener("mousemove",Q.onMouseMove),Q.svg.removeEventListener("mouseup",Q.onMouseUp),document.body.removeEventListener("keydown",Q.onKeyDown),Lu((j=wi(Q),ma(Se.prototype)),"destroy",j).call(j)}),Vr(wi(Q),"drawMidpoint",function(it,ct){var ft=document.createElementNS(h,"circle");return ft.setAttribute("class","a9s-midpoint"),ft.setAttribute("cx",it),ft.setAttribute("cy",ct),ft.setAttribute("r",5*Q.scale),ft}),Vr(wi(Q),"onAddPoint",function(it){var ct,ft=Hs(Q.shape),Ot=-1,Mt=-1,$t=Wr(Q.midpoints);try{for($t.s();!(ct=$t.n()).done;){var fn=ct.value;if(Mt+=1,(Ot=fn.indexOf(Q.grabbedElement))>-1)break}}catch(xi){$t.e(xi)}finally{$t.f()}var yn,An=[],si=-1,Mn=null,Un=null,Tn=Wr(ft);try{for(Tn.s();!(yn=Tn.n()).done;){var ni=yn.value;if((si+=1)===Mt){var bi,oi=[],Ei=-1,jn=Wr(ni);try{for(jn.s();!(bi=jn.n()).done;){var Lr=bi.value;Ei+=1,oi.push(Lr),Ei===Ot&&(oi.push(it),Mn=Q.createMidpoint(ni,Ei-1),Un=Q.createMidpoint(ni,Ei))}}catch(xi){jn.e(xi)}finally{jn.f()}An.push(oi)}else An.push(ni)}}catch(xi){Tn.e(xi)}finally{Tn.f()}var _i=Q.createCornerHandle(it);Q.cornerHandles[Mt]=[].concat(Jr(Q.cornerHandles[Mt].slice(0,Ot+1)),[_i],Jr(Q.cornerHandles[Mt].slice(Ot+1))),Q.midpoints[Mt]=[].concat(Jr(Q.midpoints[Mt].slice(0,Ot)),[Mn,Un],Jr(Q.midpoints[Mt].slice(Ot+1))),Q.grabbedElement.parentNode.removeChild(Q.grabbedElement),Q.grabbedElement=_i,Q.setPoints(An)}),Vr(wi(Q),"onGrab",function(it){return function(ct){ct.button===0&&(ct.stopPropagation(),Q.grabbedElement=it,Q.grabbedAt=Q.getSVGPoint(ct),Q.lastMouseDown=new Date().getTime())}}),Vr(wi(Q),"onKeyDown",function(it){it.which===46&&Q.deleteSelected()}),Vr(wi(Q),"onMoveShape",function(it){var ct,ft=function(jn,Lr,_i){return jn+Lr<0?-jn:jn+Lr>_i?_i-jn:Lr},Ot=Fa(Q.shape),Mt=Ot.x,$t=Ot.y,fn=Ot.width,yn=Ot.height,An=Q.env.image,si=An.naturalWidth,Mn=An.naturalHeight,Un=ft(Mt,it.x-Q.grabbedAt.x,si-fn),Tn=ft($t,it.y-Q.grabbedAt.y,Mn-yn),ni=[],bi=Wr(Hs(Q.shape));try{for(bi.s();!(ct=bi.n()).done;){var oi=ct.value,Ei=oi.map(function(jn){return[jn.x,jn.y]});Ed([Q.grabbedAt.x,Q.grabbedAt.y],Ei)?ni.push(oi.map(function(jn){return{x:jn.x+Un,y:jn.y+Tn}})):ni.push(oi)}}catch(jn){bi.e(jn)}finally{bi.f()}Q.grabbedAt=it,Q.setPoints(ni)}),Vr(wi(Q),"onMoveCornerHandle",function(it,ct){var ft,Ot=-1,Mt=0,$t=Wr(Q.cornerHandles);try{for($t.s();!(ft=$t.n()).done;){var fn=ft.value;if((Ot=fn.indexOf(Q.grabbedElement))>-1)break;Mt+=1}}catch(oi){$t.e(oi)}finally{$t.f()}ct.ctrlKey?Q.selected=Array.from(new Set([].concat(Jr(Q.selected),[Ot]))):Q.selected.includes(Ot)||(Q.selected=[Ot]);var yn,An=Hs(Q.shape),si=Q.selected.map(function(oi){var Ei=An[Mt][Ot],jn=An[Mt][oi];return{index:oi,dx:jn.x-Ei.x,dy:jn.y-Ei.y}}),Mn=0,Un=[],Tn=Wr(Hs(Q.shape));try{for(Tn.s();!(yn=Tn.n()).done;){var ni=yn.value;if(Mn===Mt){var bi=ni.map(function(oi,Ei){if(Ei===Ot)return it;if(Q.selected.includes(Ei)){var jn=si.find(function(xi){return xi.index===Ei}),Lr=jn.dx,_i=jn.dy;return{x:it.x+Lr,y:it.y+_i}}return oi});Un.push(bi)}else Un.push(ni);Mn+=1}}catch(oi){Tn.e(oi)}finally{Tn.f()}Q.setPoints(Un)}),Vr(wi(Q),"onMouseMove",function(it){if(Q.grabbedElement){var ct=Q.getSVGPoint(it);Q.grabbedElement===Q.shape?Q.onMoveShape(ct):C(Q.grabbedElement,"a9s-handle")?Q.onMoveCornerHandle(ct,it):C(Q.grabbedElement,"a9s-midpoint")&&Q.onAddPoint(ct),Q.emit("update",Nu(Hs(Q.shape),Q.env.image))}}),Vr(wi(Q),"onMouseUp",function(it){Q.grabbedElement=null,Q.grabbedAt=null}),Vr(wi(Q),"onScaleChanged",function(it){var ct,ft=Wr(Q.cornerHandles);try{for(ft.s();!(ct=ft.n()).done;)ct.value.map(Q.scaleHandle)}catch($t){ft.e($t)}finally{ft.f()}var Ot,Mt=Wr(Q.midpoints);try{for(Mt.s();!(Ot=Mt.n()).done;)Ot.value.map(function($t){$t.setAttribute("r",5*Q.scale)})}catch($t){Mt.e($t)}finally{Mt.f()}}),Vr(wi(Q),"onSelectCorner",function(it){return function(ct){if(!(new Date().getTime()-Q.lastMouseDown>250)){var ft,Ot=-1,Mt=-1,$t=Wr(Q.cornerHandles);try{for($t.s();!(ft=$t.n()).done;){var fn=ft.value;if(Ot+=1,(Mt=fn.indexOf(it))>0)break}}catch(yn){$t.e(yn)}finally{$t.f()}ct!=null&&ct.ctrlKey?Q.selected.map(function(yn){return yn[0]===Ot&&yn[1]===Mt}).indexOf(!0)>-1?Q.selected=Q.selected.filter(function(yn){return!(yn[1]===Mt&&yn[0]===Ot)}):Q.selected=[].concat(Jr(Q.selected),[[Ot,Mt]]):Q.selected.length===1&&Q.selected[0][1]===Mt&&Q.selected[0][0]===Ot?Q.selected=[]:Q.selected=[[Ot,Mt]],Q.setPoints(Hs(Q.shape))}}}),Vr(wi(Q),"setPoints",function(it){var ct=Cd(it);Q.shape.querySelector(".a9s-inner").setAttribute("d",ct);var ft=Q.shape.querySelector(".a9s-outer");ft.setAttribute("d",ct);var Ot,Mt=0,$t=Wr(it);try{for($t.s();!(Ot=$t.n()).done;){var fn=Ot.value;fn.forEach(function(ro,Rc){Q.setHandleXY(Q.cornerHandles[Mt][Rc],ro.x,ro.y)});for(var yn=0;yn-1;bl&&!C(ro,"selectedCorner")?y(ro,"selectedCorner"):!bl&&C(ro,"selectedCorner")&&w(ro,"selectedCorner")})}}catch(ro){oi.e(ro)}finally{oi.f()}var jn=ft.getBBox(),Lr=jn.x,_i=jn.y,xi=jn.width,Er=jn.height;Ln(Q.shape,Lr,_i,xi,Er)}),Vr(wi(Q),"updateState",function(it){var ct=Or(it),ft=Hs(ct);Q.setPoints(ft)}),Q.svg.addEventListener("mousemove",Q.onMouseMove),Q.svg.addEventListener("mouseup",Q.onMouseUp),document.body.addEventListener("keydown",Q.onKeyDown),Q.container=document.createElementNS(h,"g"),Q.shape=Or(ye),Q.shape.setAttribute("class","a9s-annotation editable selected improved-polygon"),Q.elementGroup=document.createElementNS(h,"g"),Q.elementGroup.setAttribute("class","a9s-annotation editable selected"),Q.elementGroup.appendChild(Q.shape);var dt=Hs(Q.shape);Q.cornerHandles=[],Q.midpoints=[];var ht,At=Wr(dt);try{var Tt=function(){var it=ht.value,ct=[];Q.cornerHandles.push(it.map(function(ft,Ot){return ct.push(Q.createMidpoint(it,Ot)),Q.createCornerHandle(ft)})),Q.midpoints.push(ct)};for(At.s();!(ht=At.n()).done;)Tt()}catch(it){At.e(it)}finally{At.f()}return Q.container.appendChild(Q.elementGroup),me.appendChild(Q.container),fr(Q.shape,ye,nt.formatter),Q.shape.querySelector(".a9s-inner").addEventListener("mousedown",Q.onGrab(Q.shape)),Q.grabbedElement=null,Q.grabbedAt=null,Q.selected=[],Q.lastMouseDown=null,Q}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}}])&&Cs(R.prototype,z),Se}(Ye);function Rr(L){return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},Rr(L)}function Xo(L,R){for(var z=0;z=L.length?{done:!0}:{done:!1,value:L[q++]}},e:function(me){throw me},f:Xe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Je,Se=!0,ye=!1;return{s:function(){z=z.call(L)},n:function(){var me=z.next();return Se=me.done,me},e:function(me){ye=!0,Je=me},f:function(){try{Se||z.return==null||z.return()}finally{if(ye)throw Je}}}}function Xi(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z')}}},As=function(L){(function(ye,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function");ye.prototype=Object.create(me&&me.prototype,{constructor:{value:ye,writable:!0,configurable:!0}}),me&&pl(ye,me)})(Se,L);var R,z,q,Xe,Je=(q=Se,Xe=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=fl(q);if(Xe){var nt=fl(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(Rr(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $r(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),zs($r(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q,dt,ht){le._isDrawing=!0,le._startOnSingleClick=dt||!1,le.attachListeners({mouseMove:le.onMouseMove,mouseUp:le.onMouseUp,dblClick:le.onDblClick}),le.rubberband=new Vl([j,Q],le.g,le.config,le.env),le.rubberband.on("close",function(At){var Tt=At.shape,it=At.selection;Tt.annotation=it,le.emit("complete",Tt),le.stop()})}),zs($r(le),"stop",function(){le.detachListeners(),le._isDrawing=!1,le.rubberband&&(le.rubberband.destroy(),le.rubberband=null)}),zs($r(le),"undo",function(){le.rubberband&&le.rubberband.undo()}),zs($r(le),"newPart",function(){le.rubberband&&le.rubberband.newPart()}),zs($r(le),"onMouseMove",function(j,Q,dt){le.rubberband.dragTo([j,Q])}),zs($r(le),"onMouseUp",function(j,Q,dt){if(dt.altKey)le.complete(j,Q);else if(dt.ctrlKey)le.rubberband.undo();else if(dt.shiftKey&&le.rubberband.points.length>2)le.newPart();else{var ht=le.rubberband.getBoundingClientRect(),At=ht.width,Tt=ht.height,it=le.config.minSelectionWidth||4,ct=le.config.minSelectionHeight||4;At>=it||Tt>=ct?le.rubberband.addPoint([j,Q]):(le.emit("cancel"),le.stop())}}),zs($r(le),"onScaleChanged",function(j){le.rubberband&&le.rubberband.onScaleChanged(j)}),zs($r(le),"onDblClick",function(j,Q){le.config.completeWithDoubleClick&&le.complete(j,Q)}),zs($r(le),"complete",function(j,Q){le._isDrawing=!1,le.rubberband.addPoint([j,Q]);var dt=le.rubberband.element;dt.annotation=le.rubberband.toSelection(),le.emit("complete",dt),le.stop()}),zs($r(le),"createEditableShape",function(j){return new ya(j,le.g,le.config,le.env)}),le._isDrawing=!1,le.viewer=null,window.addEventListener("keydown",function(j){j.key==="z"&&j.ctrlKey?le.undo():j.key!=="n"&&j.key!=="p"||le.newPart()},!0),le._startOnSingleClick=!1,le}return R=Se,(z=[{key:"isDrawing",get:function(){return this._isDrawing}}])&&Xo(R.prototype,z),Se}(Hn);function Eo(L,R){for(var z=0;zL.length)&&(R=L.length);for(var z=0,q=new Array(R);z2&&(Se.outer.setAttribute("x2",me[2]),Se.inner.setAttribute("x2",me[2]),Se.outer.setAttribute("y2",me[3]),Se.inner.setAttribute("y2",me[3]))}),xo(this,"getBoundingClientRect",function(){return Se.outer.getBoundingClientRect()}),xo(this,"dragTo",function(ye){Se.group.style.display=null,Se.mousepos=ye;var me,nt=[].concat(function(le){if(Array.isArray(le))return Fu(le)}(me=Se.points)||function(le){if(typeof Symbol<"u"&&le[Symbol.iterator]!=null||le["@@iterator"]!=null)return Array.from(le)}(me)||function(le,j){if(le){if(typeof le=="string")return Fu(le,j);var Q=Object.prototype.toString.call(le).slice(8,-1);return Q==="Object"&&le.constructor&&(Q=le.constructor.name),Q==="Map"||Q==="Set"?Array.from(le):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?Fu(le,j):void 0}}(me)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(),[ye[0],ye[1]]);Se.setPoints(nt),Se.mask.redraw()}),xo(this,"addPoint",function(ye){Se.points.length<=2&&(Se.points[2]=ye[0],Se.points[3]=ye[1],Se.setPoints(Se.points))}),xo(this,"undo",function(){Se.points[Se.points.length-1].length>2?Se.points[Se.points.length-1].pop():Se.points.length>1&&Se.points.pop()}),xo(this,"newPart",function(){Se.points.push([])}),xo(this,"destroy",function(){Se.group.parentNode.removeChild(Se.group),Se.Line=null,Se.group=null}),xo(this,"toSelection",function(){return new Ut(kd(kd({},ar(Se.group,Se.env.image)),{},{renderedVia:{name:"line"}}))}),this.points=q,this.env=Je,this.group=document.createElementNS(h,"g"),this.Line=document.createElementNS(h,"g"),this.Line.setAttribute("class","a9s-selection"),this.outer=document.createElementNS(h,"line"),this.outer.setAttribute("class","a9s-outer"),this.inner=document.createElementNS(h,"line"),this.inner.setAttribute("class","a9s-inner"),this.setPoints(this.points),this.mask=new Wl(Je.image,this.inner),this.Line.appendChild(this.outer),this.Line.appendChild(this.inner),this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.Line),Xe.appendChild(this.group)}var R,z;return R=L,(z=[{key:"element",get:function(){return this.Line}}])&&Ic(R.prototype,z),L}();function ql(L){return ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},ql(L)}function Zi(L,R){(R==null||R>L.length)&&(R=L.length);for(var z=0,q=new Array(R);z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=js(q);if(Xe){var nt=js(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(ql(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return io(le)}(this,ye)});function Se(ye,me,nt,le){var j,Q;return function(dt,ht){if(!(dt instanceof ht))throw new TypeError("Cannot call a class as a function")}(this,Se),Ba(io(Q=Je.call(this,ye,me,nt,le)),"onScaleChanged",function(){return Q.handles.map(Q.scaleHandle)}),Ba(io(Q),"setPoints",function(dt){var ht=dt[0].x,At=dt[0].y,Tt=dt[1].x,it=dt[1].y,ct=Q.shape.querySelector(".a9s-inner");ct.setAttribute("x1",ht),ct.setAttribute("y1",At),ct.setAttribute("x2",Tt),ct.setAttribute("y2",it);var ft=Q.shape.querySelector(".a9s-outer");ft.setAttribute("x1",ht),ft.setAttribute("y1",At),ft.setAttribute("x2",Tt),ft.setAttribute("y2",it),Q.mask.redraw();var Ot=ft.getBBox(),Mt=Ot.x,$t=Ot.y,fn=Ot.width,yn=Ot.height;Ln(Q.elementGroup,Mt,$t,fn,yn)}),Ba(io(Q),"onGrab",function(dt){return function(ht){ht.button===0&&(Q.grabbedElem=dt,Q.grabbedAt=Q.getSVGPoint(ht))}}),Ba(io(Q),"onMouseMove",function(dt){var ht=function(Tn,ni,bi){return Tn+ni<0?-Tn:Tn+ni>bi?bi-Tn:ni};if(Q.grabbedElem){var At=Q.getSVGPoint(dt);if(Q.grabbedElem===Q.shape){var Tt=Kl(Q.shape),it=Tt.x,ct=Tt.y,ft=Tt.width,Ot=Tt.height,Mt=Q.env.image,$t=Mt.naturalWidth,fn=Mt.naturalHeight,yn=ht(it,At.x-Q.grabbedAt.x,$t-ft),An=ht(ct,At.y-Q.grabbedAt.y,fn-Ot),si=Oc(Q.shape).map(function(Tn){return{x:Tn[0].value+yn,y:Tn[1].value+An}});Q.grabbedAt=At,Q.setPoints(si),si.forEach(function(Tn,ni){return Q.setHandleXY(Q.handles[ni],Tn.x,Tn.y)}),Q.emit("update",ar(Q.shape,Q.env.image))}else{var Mn=Q.handles.indexOf(Q.grabbedElem),Un=Oc(Q.shape).map(function(Tn,ni){return ni===Mn?At:{x:Tn[0].value,y:Tn[1].value}});Q.setPoints(Un),Q.setHandleXY(Q.handles[Mn],At.x,At.y),Q.emit("update",ar(Q.shape,Q.env.image))}}}),Ba(io(Q),"onMouseUp",function(dt){Q.grabbedElem=null,Q.grabbedAt=null}),Ba(io(Q),"updateState",function(dt){var ht=Hr(dt).getAttribute("points").split(" ").map(function(At){var Tt=function(it,ct){return function(ft){if(Array.isArray(ft))return ft}(it)||function(ft,Ot){var Mt=ft==null?null:typeof Symbol<"u"&&ft[Symbol.iterator]||ft["@@iterator"];if(Mt!=null){var $t,fn,yn=[],An=!0,si=!1;try{for(Mt=Mt.call(ft);!(An=($t=Mt.next()).done)&&(yn.push($t.value),!Ot||yn.length!==Ot);An=!0);}catch(Mn){si=!0,fn=Mn}finally{try{An||Mt.return==null||Mt.return()}finally{if(si)throw fn}}return yn}}(it,ct)||function(ft,Ot){if(ft){if(typeof ft=="string")return Zi(ft,Ot);var Mt=Object.prototype.toString.call(ft).slice(8,-1);return Mt==="Object"&&ft.constructor&&(Mt=ft.constructor.name),Mt==="Map"||Mt==="Set"?Array.from(ft):Mt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Mt)?Zi(ft,Ot):void 0}}(it,ct)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}(At.split(",").map(function(it){return parseFloat(it.trim())}),2);return{x:Tt[0],y:Tt[1]}});Q.setPoints(ht),ht.forEach(function(At,Tt){return Q.setHandleXY(Q.handles[Tt],At.x,At.y)})}),Ba(io(Q),"destroy",function(){Q.containerGroup.parentNode.removeChild(Q.containerGroup),Gl((j=io(Q),js(Se.prototype)),"destroy",j).call(j)}),Q.svg.addEventListener("mousemove",Q.onMouseMove),Q.svg.addEventListener("mouseup",Q.onMouseUp),Q.containerGroup=document.createElementNS(h,"g"),Q.shape=kr(ye),Q.shape.querySelector(".a9s-inner").addEventListener("mousedown",Q.onGrab(Q.shape)),Q.mask=new Wl(le.image,Q.shape.querySelector(".a9s-inner")),Q.containerGroup.appendChild(Q.mask.element),Q.elementGroup=document.createElementNS(h,"g"),Q.elementGroup.setAttribute("class","a9s-annotation editable selected"),Q.elementGroup.setAttribute("data-id",ye.id),Q.elementGroup.appendChild(Q.shape),Q.handles=Oc(Q.shape).map(function(dt){var ht=Q.drawHandle(dt[0].value,dt[1].value);return ht.addEventListener("mousedown",Q.onGrab(ht)),Q.elementGroup.appendChild(ht),ht}),Q.containerGroup.appendChild(Q.elementGroup),me.appendChild(Q.containerGroup),fr(Q.shape,ye,nt.formatters),Q.grabbedElem=null,Q.grabbedAt=null,Q}return R=Se,(z=[{key:"element",get:function(){return this.elementGroup}}])&&Bu(R.prototype,z),Se}(Ye);function gl(L){return gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},gl(L)}function Hu(L,R){for(var z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var ye,me=Xl(q);if(Xe){var nt=Xl(this).constructor;ye=Reflect.construct(me,arguments,nt)}else ye=me.apply(this,arguments);return function(le,j){if(j&&(gl(j)==="object"||typeof j=="function"))return j;if(j!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vs(le)}(this,ye)});function Se(ye,me,nt){var le;return function(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}(this,Se),ms(Vs(le=Je.call(this,ye,me,nt)),"startDrawing",function(j,Q){le._isDrawing=!0,le.attachListeners({mouseMove:le.onMouseMove,mouseUp:le.onMouseUp}),le.rubberband=new Bi([j,Q],le.g,le.env)}),ms(Vs(le),"stop",function(){le.detachListeners(),le._isDrawing=!1,le.rubberband&&(le.rubberband.destroy(),le.rubberband=null)}),ms(Vs(le),"undo",function(){le.rubberband&&le.rubberband.undo()}),ms(Vs(le),"newPart",function(){le.rubberband&&le.rubberband.newPart()}),ms(Vs(le),"onMouseMove",function(j,Q){return le.rubberband.dragTo([j,Q])}),ms(Vs(le),"onMouseUp",function(j,Q,dt){if(dt.altKey)le.onDblClick(dt);else if(dt.ctrlKey)le.rubberband.undo();else if(le.rubberband.points.length==2)if(le.rubberband.addPoint([j,Q]),le.rubberband.points[0]==le.rubberband.points[2]&&le.rubberband.points[1]==le.rubberband.points[3])le.emit("cancel"),le.stop();else{le._isDrawing=!1;var ht=le.rubberband.element;ht.annotation=le.rubberband.toSelection(),le.emit("complete",ht),le.stop()}}),ms(Vs(le),"createEditableShape",function(j){return new Uu(j,le.g,le.config,le.env)}),le._isDrawing=!1,document.addEventListener("keydown",function(j){j.key=="z"&&j.ctrlKey&&le.undo(),j.key=="n"&&le.newPart()}),le}return R=Se,(z=[{key:"isDrawing",get:function(){return this._isDrawing}}])&&Hu(R.prototype,z),Se}(Hn);yl.identifier="line",yl.supports=function(L){var R,z=L.selector("SvgSelector");if(z)return(R=z.value)===null||R===void 0?void 0:R.match(/^0&&(n.data=i),n}static termValueToObject(e){const n={key:e.term_id,label:e.term_label,data:{label:e.term_label,vocabId:e.vocabulary_id,vocabTitle:e.vocabulary_name}};return e.data&&(e.data.description&&(n.data.description=e.data.description),e.data.trace&&(n.data.trace=e.data.trace)),n}static colorMap(){return{"#506DAC":"Blue","#4A9A5A":"Green","#D04A4A":"Red","#E8C547":"Yellow","#8E4A9A":"Purple","#E88D47":"Orange","#E88DAD":"Pink","#8D6F47":"Brown","#8D8D8D":"Gray"}}static basicColors(){const e=Di.colorMap();return Object.keys(e)}static defaultLineColor(){return"#506DAC"}static getColorName(e){return Di.colorMap()[e]}static getColorFromName(e){const n=Di.colorMap();for(const i in n)if(n[i]===e)return i;return null}static adjustColor(e,n){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),n=n||0;let i="#",r,s;for(s=0;s<3;s++)r=parseInt(e.substring(s*2,s*2+2),16),r=Math.round(Math.min(Math.max(0,r+r*n),255)).toString(16),i+=("00"+r).substring(r.length);return i}static annotoriousFormatter(){return function(e){var u,d;let n="rdwb-ano-shape",i="Medium",r=Di.defaultLineColor();if(e.body){const h=Di.parseAnnotationBody(e);h.lineColor&&(r=h.lineColor),h.lineWeight&&(i=h.lineWeight)}let s=0;i==="Light"?s=.7:i==="Dark"&&(s=-.5);let o=`stroke:${Di.adjustColor(r,s)};`;return((d=(u=e.target)==null?void 0:u.renderedVia)==null?void 0:d.name)==="point"&&(o=`fill:${Di.adjustColor(r,s)};`),{className:n,style:o}}}static generateUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static createTemporaryURI(e,n){return e.endsWith("/")&&(e=e.slice(0,-1)),`${e}/${n}/${Di.generateUUID()}`}static parseAnnotationBody(e){const n={};return e.body&&e.body.length>0&&e.body.forEach(i=>{const r=i.value,s=i.language||"en",o=r.match(/^([^:]+):(.*)$/s);if(o)switch(o[1].trim()){case"Title":n.title||(n.title={}),n.title[s]=o[2].trim();break;case"Description":n.description||(n.description={}),n.description[s]=o[2].trim();break;case"Link":n.links||(n.links={}),n.links[s]||(n.links[s]=[]),n.links[s].push(Di.parseLinkValue(o[2].trim()));break;case"Attribution":n.attribution=o[2].trim();break;case"Date":n.date=o[2].trim();break;case"Note":n.notes||(n.notes=[]),n.notes.push(o[2].trim());break;case"Line Color":n.lineColor=o[2].trim();break;case"Line Weight":n.lineWeight=o[2].trim();break;case"Tag":n.tags||(n.tags=[]);const d={},h=r.split(` `);for(const g of h){const y=g.match(/^([^:]+):(.*)$/);if(y){const w=y[1].trim(),C=y[2].trim();if(w==="Tag"){const D=Di.parseLinkValue(C);d.term_id=D.url,d.term_label=D.text}else if(w==="Vocabulary"){const D=Di.parseLinkValue(C);d.vocabulary_id=D.url,d.vocabulary_name=D.text}else w==="Data"&&(d.data=JSON.parse(C))}}n.tags.push(d);break}}),n}static parseLinkValue(e){const n=e.match(/^\[(.*)\]\((.*)\)$/);return n?{text:n[1],url:n[2]}:{text:e,url:e}}static createAnnotationBody(e){const n=[];if(e.title)for(const i in e.title)e.title[i]&&n.push({type:"TextualBody",purpose:"describing",language:i,format:"text/plain",value:`Title: ${e.title[i]}`});if(e.description)for(const i in e.description)e.description[i]&&n.push({type:"TextualBody",purpose:"describing",language:i,format:"text/plain",value:`Description: ${e.description[i]}`});if(e.links)for(const i in e.links)e.links[i].forEach(r=>{r.url&&n.push({type:"TextualBody",purpose:"linking",language:i,format:"text/plain",value:`Link: [${r.text}](${r.url})`})});return e.attribution&&n.push({type:"TextualBody",purpose:"commenting",language:"en",format:"text/plain",value:`Attribution: ${e.attribution}`}),e.date&&n.push({type:"TextualBody",purpose:"commenting",language:"en",format:"text/plain",value:`Date: ${e.date}`}),e.notes&&e.notes.forEach(i=>{i&&n.push({type:"TextualBody",purpose:"commenting",language:"en",format:"text/plain",value:`Note: ${i}`})}),e.lineColor&&n.push({type:"TextualBody",purpose:"classifying",language:"en",format:"text/plain",value:`Line Color: ${e.lineColor}`}),e.lineWeight&&n.push({type:"TextualBody",purpose:"commenting",language:"en",format:"text/plain",value:`Line Weight: ${e.lineWeight}`}),e.tags&&e.tags.forEach(i=>{const r=[];r.push(`Tag: [${i.term_label}](${i.term_id})`),r.push(`Vocabulary: [${i.vocabulary_name}](${i.vocabulary_id})`),i.data&&r.push(`Data: ${JSON.stringify(i.data)}`),n.push({type:"TextualBody",purpose:"tagging",language:"en",format:"text/plain",value:r.join(` `)})}),n}static toISODate(e){const n=e.getTimezoneOffset();return e=new Date(e.getTime()-n*60*1e3),e.toISOString().split("T")[0]}static getFromLocalStorage(e){const n=localStorage.getItem(e);return n?JSON.parse(n):null}static setToLocalStorage(e,n){localStorage.setItem(e,JSON.stringify(n))}}class xae{constructor(e){this.manifestData=e,this.annotations={},this.manifestData.items&&this.manifestData.items.forEach(n=>{n.type==="Canvas"&&n.annotations&&n.annotations.forEach(i=>{i.type==="AnnotationPage"&&i.items&&i.items.forEach(r=>{if(r.type==="Annotation"){const s=n.id;this.annotations[s]||(this.annotations[s]=[]),this.annotations[s].push(r)}})})})}list(){return JSON.parse(JSON.stringify(this.annotations))}show(e){for(const n in this.annotations){const i=this.annotations[n].find(r=>r.id===e);if(i)return{...i}}return null}create(e){const n=e.target.source,i={...e};return i.id=Di.createTemporaryURI(n,"annotations"),i.type="Annotation",i.created=new Date().toISOString(),i.modified=new Date().toISOString(),this.annotations[n]||(this.annotations[n]=[]),this.annotations[n].push(i),i}update(e){const n=e.target.source,i=this.annotations[n].findIndex(r=>r.id===e.id);if(i!==-1){const r={...e};return r.modified=new Date().toISOString(),this.annotations[n][i]=r,r}return null}delete(e){for(const n in this.annotations){const i=this.annotations[n].findIndex(r=>r.id===e);if(i!==-1)return this.annotations[n].splice(i,1),!0}return!1}}class Cae{constructor(e){Lh(this,ef);if(this.manifestID=e,this.annotations=null,!localStorage.getItem(e))localStorage.setItem(e,JSON.stringify({annotations:{}})),this.annotations={};else{const n=JSON.parse(localStorage.getItem(e));this.annotations=n.annotations}}list(){return JSON.parse(JSON.stringify(this.annotations))}show(e){for(const n in this.annotations){const i=this.annotations[n].find(r=>r.id===e);if(i)return{...i}}return null}create(e){const n=e.target.source,i={...e};return i.id=Di.createTemporaryURI(n,"annotations"),i.type="Annotation",i.created=new Date().toISOString(),i.modified=new Date().toISOString(),this.annotations[n]||(this.annotations[n]=[]),this.annotations[n].push(i),ts(this,ef,V0).call(this),i}update(e){const n=e.target.source,i=this.annotations[n].findIndex(r=>r.id===e.id);if(i!==-1){const r={...e};return r.modified=new Date().toISOString(),this.annotations[n][i]=r,ts(this,ef,V0).call(this),r}return null}delete(e){for(const n in this.annotations){const i=this.annotations[n].findIndex(r=>r.id===e);if(i!==-1)return this.annotations[n].splice(i,1),ts(this,ef,V0).call(this),!0}return!1}}ef=new WeakSet,V0=function(){Di.setToLocalStorage(this.manifestID,{annotations:this.annotations})};class Aae{constructor(e){Lh(this,Pa);this.config=e,this.client=ts(this,Pa,Y4).call(this)}async list(){const e={},n=await this.client.get(this.config.container,{headers:{Accept:'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"',Prefer:'return=representation;include="http://www.w3.org/ns/oa#PreferContainedDescriptions"'}});return n.data.first&&(await ts(this,Pa,px).call(this,n.data.first)).forEach(r=>{var o;let s;typeof r.target=="string"?s=r.target:(o=r.target)!=null&&o.source&&(s=r.target.source),s&&(e[s]||(e[s]=[]),e[s].push(r))}),e}async show(e){let n=e;this.config.useRelativeURI&&(n=ts(this,Pa,If).call(this,n));const i=await this.client.get(n,{headers:{Accept:'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"'}});if(i.data.type!=="Annotation")throw new Error("Invalid annotation");return i.data}async create(e){const n={...e};n["@context"]||(n["@context"]="http://www.w3.org/ns/anno.jsonld");let i=this.config.container;return this.config.useRelativeURI&&(i=ts(this,Pa,If).call(this,i)),(await this.client.post(i,n,{headers:{"Content-Type":'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"',Accept:'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"'}})).data}async update(e){const n={...e};n["@context"]||(n["@context"]="http://www.w3.org/ns/anno.jsonld");let i=e.id;return this.config.useRelativeURI&&(i=ts(this,Pa,If).call(this,i)),(await this.client.put(i,n,{headers:{"Content-Type":'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"',Accept:'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"'}})).data}async delete(e){let n=e;return this.config.useRelativeURI&&(n=ts(this,Pa,If).call(this,n)),await this.client.delete(n),!0}}Pa=new WeakSet,Y4=function(){let e;return typeof this.config.clientConfig=="function"?e=this.config.clientConfig():e=dr.create(this.config.clientConfig),e},px=async function(e){let n=null;if(typeof e=="string"?n=e:typeof e=="object"&&e.type==="AnnotationPage"&&(n=e.id),n&&!e.items){this.config.useRelativeURI&&(n=ts(this,Pa,If).call(this,n));const r=await this.client.get(n,{headers:{Accept:'application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"'}});r.data.type==="AnnotationPage"&&(e=r.data)}let i=[];return e.items&&e.items.length>0&&(i=e.items),e.next&&(i=i.concat(await ts(this,Pa,px).call(this,e.next))),i},If=function(e){return e.startsWith("http://")||e.startsWith("https://")?new URL(e).pathname:e};const kae={name:"GlycerineEditor",components:{GlycerineViewer:OL,TermTagGroup:D_,Toolbar:YL,Button:nc,Divider:XL,Dropdown:Zd,Dialog:nm,TabView:Oy,TabPanel:Ry,InputText:tm,Textarea:ZL,ProgressSpinner:QL,Tree:Ww,Checkbox:Uw,Calendar:JL,ConfirmDialog:$L,Listbox:Hw,Message:Iy,VocabularySelector:Sae},props:{manifest:{type:[Object,String]},allowedAnnotationLanguages:{type:Array,default:()=>[{code:"en",name:"English"}]},defaultVocab:{type:String},storageConfig:{type:Object},allowOpen:{type:Boolean,default:!0},allowExport:{type:Boolean,default:!0},allowedShapes:{type:Array,default:()=>["rect","polygon","circle","ellipse","freehand"]},defaultLineColor:{type:String,default:"Blue"},defaultColorShade:{type:String,default:"Medium"}},emits:["manifestLoaded","annotationsLoaded","annotationSelected","annotationCreated","annotationUpdated","annotationDeleted"],data(){const t=this.initialState();return t.loading=!1,t.manifestUrl=null,t.manifestData=null,t.annotations={},t.recentItems=[],t.messages=[],t},computed:{luminance(){let t=0;return this.colorShade.value==="Light"?t=.7:this.colorShade.value==="Dark"&&(t=-.5),t},languageCodes(){const t=["en"];if(this.allowedAnnotationLanguages&&this.allowedAnnotationLanguages.length>0)for(const e of this.allowedAnnotationLanguages)e.code!=="en"&&t.push(e.code);return t}},watch:{manifest(t){t&&this.openManifestByConfig(t)},drawingMode(t){if(t)switch(this.annotorious.setDrawingTool(t),this.annotorious.setDrawingEnabled(!0),this.clearMessages(),t){case"rect":this.addMessage("Click and drag to draw a rectangle on the image. Press ESC to cancel.");break;case"polygon":this.addMessage("Click and drag to draw the first line on the image. Single click to draw following lines. Double click to finish. Press ESC to cancel.");break;case"circle":this.addMessage("Click and drag to draw a circle on the image. Press ESC to cancel.");break;case"ellipse":this.addMessage("Click and drag to draw an ellipse on the image. Press ESC to cancel.");break;case"freehand":this.addMessage("Click and drag to draw freehand on the image. Press ESC to cancel.");break}else this.annotorious.setDrawingEnabled(!1),this.clearMessages()},areaEditingMode(t){t?this.addMessage("Editing annotation area. Press ENTER to complete or press ESC to cancel."):this.clearMessages()},selectedVocab(t){t&&this.loadTerms()}},setup(){const t=$M(),e=new Ib(t.rvaApiBaseURL),n=new Ib(t.rvaSandpitApiBaseURL);return{version:"1.0.2",logoPath:$ne,osdViewer:null,annotorious:null,Helper:Di,vocabStore:t,rvaClient:e,rvaSpClient:n,storage:null}},async created(){try{if(await this.vocabStore.loadVocabularies(),this.defaultVocab){const t=this.vocabStore.findVocabularyByID(this.defaultVocab);t&&(this.selectedVocab=t)}}catch(t){this.messages.push({severity:"error",content:`Failed to load the vocabularies. ${t.message}`})}},mounted(){this.loadRecentItems(),this.manifest&&this.loadManifest(this.manifest),document.addEventListener("keyup",t=>{this.drawingMode&&t.key==="Escape"&&(this.drawingMode=null),this.areaEditingMode&&t.key==="Enter"&&this.finishAreaEditing()})},methods:{initialState(){const t={options:Di.basicColors()};let e;this.defaultLineColor?(e=Di.getColorFromName(this.defaultLineColor),e||(e=Di.getColorFromName("Blue"))):e=Di.getColorFromName("Blue"),t.value=e;const n={options:["Light","Medium","Dark"]};return this.defaultColorShade&&n.options.includes(this.defaultColorShade)?n.value=this.defaultColorShade:n.value="Medium",{drawingMode:null,lineColor:t,colorShade:n,showOpenDialog:!1,showAboutPanel:!1,showIndexPanel:!1,showExportDialog:!1,showEditingDialog:!1,editingDialogMode:"create",editingDialogSaving:!1,annotationInEdit:null,areaEditingMode:!1,annotationFormModels:{language:"en",title:{},description:{},links:{},attribution:null,date:null,notes:[""]},currentCanvasID:null,selectedVocab:{},terms:[],isLoadingTerms:!1,selectedTerms:[],treeCheckedItems:{},manifestOutputJson:"",openingManifest:!1}},loadRecentItems(){let t=Di.getFromLocalStorage("recentManifests");t&&(this.recentItems=t)},async loadManifest(t){this.loading=!0;let e=t;if(t.url&&t.clientConfig)try{let i;typeof t.clientConfig=="function"?i=await t.clientConfig().get(t.url):i=await dr.get(t.url,t.clientConfig),e=i.data}catch(i){return this.messages.push({severity:"error",content:`Failed to load the manifest from its URL. ${i.message}`}),this.loading=!1,!1}const n=new DL(e);if(await n.load(),n.hasErrors())n.getErrors().forEach(i=>{this.messages.push({severity:"error",content:i})});else if(n.hasLoaded())if(n.getParser()instanceof LT)this.messages.push({severity:"error",content:"IIIF collections are not supported. Please open each manifest from the collection individually."});else{n.getVersion()!=="3.0"&&this.messages.push({severity:"warn",content:"Older version of IIIF manifest was detected. The manifest has been converted to IIIF Presentation API 3.0."}),this.manifestData=n.getData(),this.initStorage(),this.annotations=await this.storage.list();const i=n.getParser();return this.recentItems=this.recentItems.filter(r=>r.url!==i.getID()),this.recentItems.unshift({label:i.getPrefLabel(),url:i.getID()}),this.recentItems.length>5&&(this.recentItems=this.recentItems.slice(0,5)),Di.setToLocalStorage("recentManifests",this.recentItems),this.loading=!1,this.$emit("manifestLoaded",Rn(this.manifestData)),!0}return this.loading=!1,!1},initStorage(){if(this.storageConfig)switch(this.storageConfig.type){case"was":this.storage=new Aae(this.storageConfig);break;default:this.storage=new Cae(this.manifestData.id)}else this.storage=new xae(this.manifestData)},onOsdInit(t,e){this.currentCanvasID=e.id,this.annotations[this.currentCanvasID]||(this.annotations[this.currentCanvasID]=[]),this.osdViewer=t,this.annotorious=ok(this.osdViewer,{allowEmpty:!0,disableEditor:!0,formatters:Di.annotoriousFormatter()}),Eae(this.annotorious,{tools:["rect","polygon","circle","ellipse","freehand"]}),this.annotorious.setAnnotations(this.annotations[this.currentCanvasID]),this.$emit("annotationsLoaded",this.currentCanvasID,Rn(this.annotations[this.currentCanvasID])),this.annotorious.on("updateAnnotation",n=>{this.drawingMode=null}),this.annotorious.on("deleteAnnotation",n=>{this.drawingMode=null}),this.annotorious.on("createSelection",n=>{this.drawingMode=null,this.openEditingDialog(n)}),this.annotorious.on("selectAnnotation",n=>{this.openEditingDialog(n,"edit"),this.$emit("annotationSelected",n)}),this.annotorious.on("cancelSelected",n=>{this.drawingMode=null,this.areaEditingMode=!1}),this.annotorious.on("changeSelectionTarget",n=>{this.areaEditingMode&&(this.annotationInEdit.target=n)})},async openManifest(){this.openingManifest=!0,await this.loadManifest(this.manifestUrl)&&Object.assign(this.$data,this.initialState()),this.openingManifest=!1,this.showOpenDialog=!1},onEditingDialogClosed(){this.areaEditingMode||this.annotorious.cancelSelected()},addNote(){this.annotationFormModels.notes.push("")},removeNote(t){this.annotationFormModels.notes.splice(t,1)},addLink(){this.annotationFormModels.links[this.annotationFormModels.language].push({url:"",text:""})},removeLink(t){this.annotationFormModels.links[this.annotationFormModels.language].splice(t,1)},removeTag(t){this.selectedTerms=this.selectedTerms.filter(e=>e.key!==t.key),this.treeCheckedItems[t.key]=!1},onTermSelectChange(t){this.treeCheckedItems[t.key]?this.selectedTerms.push(t):this.selectedTerms=this.selectedTerms.filter(e=>e.key!==t.key)},enterAreaEditingMode(){this.showEditingDialog=!1,this.areaEditingMode=!0},finishAreaEditing(){this.areaEditingMode=!1,this.showEditingDialog=!0},deleteAnnotation(){this.showEditingDialog=!1,this.$confirm.require({header:"Confirmation",message:"Are you sure you want to delete this annotation?",icon:"pi pi-info-circle",acceptClass:"p-button-danger p-button-sm",accept:async()=>{const t=Rn(this.annotationInEdit),e=t.id;try{await this.storage.delete(e)&&(this.annotations[this.currentCanvasID]=this.annotations[this.currentCanvasID].filter(n=>n.id!==e),this.annotorious.removeAnnotation(t),this.$emit("annotationDeleted",t))}catch(n){this.messages.push({severity:"error",content:`Failed to delete the annotation. ${n.message}`})}}})},async editingDialogSubmit(){this.validateDialogForm()&&(this.editingDialogMode==="create"?await this.createAnnotation():this.editingDialogMode==="edit"&&await this.updateAnnotation())},openEditingDialog(t,e="create"){this.annotationInEdit=t,this.editingDialogMode=e,this.loadFormModels(t),this.showEditingDialog=!0},initFormModels(){this.annotationFormModels={language:"en",title:{},description:{},attribution:null,date:null,notes:[""],links:{}};for(const t of this.languageCodes)this.annotationFormModels.title[t]=null,this.annotationFormModels.description[t]=null,this.annotationFormModels.links[t]=[{url:"",text:""}];this.selectedTerms=[],this.treeCheckedItems={}},loadFormModels(t){var n,i,r;this.initFormModels();const e=Di.parseAnnotationBody(t);for(const s of this.languageCodes)typeof((n=e.title)==null?void 0:n[s])<"u"&&(this.annotationFormModels.title[s]=e.title[s]),typeof((i=e.description)==null?void 0:i[s])<"u"&&(this.annotationFormModels.description[s]=e.description[s]),typeof((r=e.links)==null?void 0:r[s])<"u"&&(this.annotationFormModels.links[s]=e.links[s]);typeof e.attribution<"u"&&(this.annotationFormModels.attribution=e.attribution),typeof e.date<"u"&&(this.annotationFormModels.date=e.date),typeof e.notes<"u"&&(this.annotationFormModels.notes=e.notes),typeof e.tags<"u"&&e.tags.forEach(s=>{const o=Di.termValueToObject(s);this.selectedTerms.push(o),this.treeCheckedItems[o.key]=!0})},async loadTerms(){this.terms=[],this.selectedVocab&&(this.isLoadingTerms=!0,this.selectedVocab.sandpit?this.terms=await this.rvaSpClient.getTerms(this.selectedVocab):this.terms=await this.rvaClient.getTerms(this.selectedVocab),this.isLoadingTerms=!1)},validateDialogForm(){if(!this.annotationFormModels.title||Object.keys(this.annotationFormModels.title).length===0)return!1;let t=!1;for(let e in this.annotationFormModels.title)if(this.annotationFormModels.title[e]){t=!0;break}return!!t},async createAnnotation(){try{this.editingDialogSaving=!0;const e={type:"Annotation",motivation:"commenting",target:{...Rn(this.annotationInEdit).target}};e.target.source=this.currentCanvasID;const n={...Rn(this.annotationFormModels),lineColor:this.lineColor.value,lineWeight:this.colorShade.value};if(n.date&&(n.date=Di.toISODate(n.date)),this.selectedTerms&&this.selectedTerms.length>0){const r=[];this.selectedTerms.forEach(s=>{const o=Di.termObjectToValue(s);r.push(o)}),n.tags=r}else n.tags=null;e.body=Di.createAnnotationBody(n);const i=await this.storage.create(e);i&&(this.annotations[this.currentCanvasID]||(this.annotations[this.currentCanvasID]=[]),this.annotations[this.currentCanvasID].push(i),await this.annotorious.updateSelected(i,!0),this.$emit("annotationCreated",i))}catch(t){this.messages.push({severity:"error",content:"Failed to create the annotation."+t.message})}finally{this.showEditingDialog=!1,this.editingDialogSaving=!1}},async updateAnnotation(){try{this.editingDialogSaving=!0;const t=Rn(this.annotationInEdit),e=t.id;t.target.source=this.currentCanvasID;const n=this.annotations[this.currentCanvasID].findIndex(u=>u.id===e),i=Di.parseAnnotationBody(t),r={...Rn(this.annotationFormModels),lineColor:i.lineColor,lineWeight:i.lineWeight};if(this.selectedTerms&&this.selectedTerms.length>0){const u=[];this.selectedTerms.forEach(d=>{const h=Di.termObjectToValue(d);u.push(h)}),r.tags=u}else r.tags=null;const s=this.annotations[this.currentCanvasID][n];s.body=Di.createAnnotationBody(r),s.target=t.target;const o=await this.storage.update(s);o&&(this.annotations[this.currentCanvasID][n]=o,await this.annotorious.updateSelected(o,!0),this.$emit("annotationUpdated",o))}catch(t){this.messages.push({severity:"error",content:"Failed to save the annotation"+t.message})}finally{this.showEditingDialog=!1,this.editingDialogSaving=!1}},openExportDialog(){this.manifestOutputJson=JSON.stringify(this.generateManifestOutput(),null,2),this.showExportDialog=!0},generateManifestOutput(){let t=null;if(this.manifestData){const e=JSON.parse(JSON.stringify(Rn(this.annotations)));if(t={...this.manifestData},t.items)for(let n=0;n(delete r["@context"],r))}])}}return t},copyManifestOutput(){navigator.clipboard.writeText(this.manifestOutputJson)},downloadManifestOutput(){const t=new Blob([this.manifestOutputJson],{type:"application/json"}),e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download="manifest.json",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(e)},addMessage(t,e="info"){this.messages.push({id:Di.generateUUID(),content:t,severity:e})},clearMessages(){this.messages=[]},async openManifestByConfig(t){this.openingManifest=!0,await this.loadManifest(t)&&Object.assign(this.$data,this.initialState()),this.openingManifest=!1},getAnnotations(t=null){return Rn(t?this.annotations[t]:this.annotations)}}},Pae={class:"ge-container w-full h-full relative overflow-hidden flex flex-column"},Dae={key:0,class:"flex align-items-center gap-2"},Iae={key:1},Oae={class:"flex align-items-center gap-2"},Rae={class:"w-full relative flex-grow-1"},Lae={key:1,class:"w-full h-full flex flex-column align-items-center justify-content-center gap-3 surface-200",style:{border:"1px solid #e2e8f0","border-radius":"6px"}},Mae=["src"],Nae={class:"text-xs text-color-secondary"},Fae={key:0},Bae={class:"w-full absolute top-0 left-0"},Uae={class:"p-fluid formgrid grid"},Hae={key:0,class:"field col-12 flex justify-content-end"},zae={class:"field col-12"},jae={class:"field col-12"},Vae={class:"field col-12"},Wae={class:"flex align-items-center gap-2 mb-2"},qae={class:"flex-grow-1"},Gae={class:"flex-grow-1"},Kae={key:0,class:"flex flex-column justify-content-center align-items-center",style:{"min-height":"30vh"}},Yae={key:0},Xae={key:1},Zae={class:"flex align-items-center gap-2"},Qae={class:"p-fluid formgrid grid"},Jae={class:"field col-12"},$ae={class:"flex align-items-center gap-2"},ele={class:"flex-grow-1"},tle={class:"field col-12"},nle={class:"field col-12"},ile={class:"flex justify-content-between"},rle={class:"text-left"},sle={class:"text-right"},ole={class:"p-fluid formgrid grid"},ale={class:"field col-12"},lle={key:0};function ule(t,e,n,i,r,s){const o=Bt("ConfirmDialog"),u=Bt("Button"),d=Bt("Divider"),h=Bt("Dropdown"),g=Bt("Toolbar"),y=Bt("GlycerineViewer"),w=Bt("Message"),C=Bt("InputText"),D=Bt("Textarea"),P=Bt("TabPanel"),M=Bt("VocabularySelector"),F=Bt("TermTagGroup"),K=Bt("ProgressSpinner"),$=Bt("Checkbox"),ee=Bt("Tree"),he=Bt("Calendar"),ve=Bt("TabView"),fe=Bt("Dialog"),ae=Bt("Listbox");return G(),se("div",Pae,[ue("div",null,[gt(o),gt(g,null,{start:jt(()=>[n.allowOpen?(G(),Ct(u,{key:0,class:"mr-2",icon:"pi pi pi-folder-open","aria-label":"Open Manifest",title:"Open Manifest",severity:"primary",disabled:t.loading,onClick:e[0]||(e[0]=xe=>t.showOpenDialog=!0)},null,8,["disabled"])):qe("",!0),n.allowExport?(G(),Ct(u,{key:1,icon:"pi pi-file-export","aria-label":"Export Manifest",title:"Export Manifest",severity:"primary",disabled:!t.manifestData,onClick:s.openExportDialog},null,8,["disabled","onClick"])):qe("",!0),n.allowOpen||n.allowExport?(G(),Ct(d,{key:2,layout:"vertical"})):qe("",!0),n.allowedShapes.includes("rect")?(G(),Ct(u,{key:3,class:"mr-2",icon:"pi pi-check","aria-label":"Rectangle",title:"Draw Rectangle",severity:"primary",disabled:t.drawingMode==="rect"||!t.manifestData,onClick:e[1]||(e[1]=xe=>t.drawingMode="rect")},{default:jt(()=>e[29]||(e[29]=[ue("svg",{class:"draw-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ue("rect",{x:"2",y:"2",width:"12",height:"12",stroke:"#444","stroke-width":"1.5",fill:"none"}),ue("circle",{cx:"2",cy:"2",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"2",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"14",r:"1.5",fill:"none"}),ue("circle",{cx:"2",cy:"14",r:"1.5",fill:"none"})],-1),ue("span",{class:"p-button-label"}," ",-1)])),_:1,__:[29]},8,["disabled"])):qe("",!0),n.allowedShapes.includes("polygon")?(G(),Ct(u,{key:4,class:"mr-2",icon:"pi pi-check","aria-label":"Polygon",title:"Draw Polygon",severity:"primary",disabled:t.drawingMode==="polygon"||!t.manifestData,onClick:e[2]||(e[2]=xe=>t.drawingMode="polygon")},{default:jt(()=>e[30]||(e[30]=[ue("svg",{class:"draw-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ue("polygon",{points:"2,2 14,2 15,8 11,14 5,14 1,8",stroke:"#444","stroke-width":"1.5",fill:"none"}),ue("circle",{cx:"2",cy:"2",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"2",r:"1.5",fill:"none"}),ue("circle",{cx:"15",cy:"8",r:"1.5",fill:"none"}),ue("circle",{cx:"11",cy:"14",r:"1.5",fill:"none"}),ue("circle",{cx:"5",cy:"14",r:"1.5",fill:"none"}),ue("circle",{cx:"1",cy:"8",r:"1.5",fill:"none"})],-1),ue("span",{class:"p-button-label"}," ",-1)])),_:1,__:[30]},8,["disabled"])):qe("",!0),n.allowedShapes.includes("circle")?(G(),Ct(u,{key:5,class:"mr-2",icon:"pi pi-check","aria-label":"Circle",title:"Draw Circle",severity:"primary",disabled:t.drawingMode==="circle"||!t.manifestData,onClick:e[3]||(e[3]=xe=>t.drawingMode="circle")},{default:jt(()=>e[31]||(e[31]=[ue("svg",{class:"draw-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ue("circle",{cx:"8",cy:"8",r:"6",stroke:"#444","stroke-width":"1.5",fill:"none"}),ue("circle",{cx:"8",cy:"2",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"8",r:"1.5",fill:"none"}),ue("circle",{cx:"8",cy:"14",r:"1.5",fill:"none"}),ue("circle",{cx:"2",cy:"8",r:"1.5",fill:"none"})],-1),ue("span",{class:"p-button-label"}," ",-1)])),_:1,__:[31]},8,["disabled"])):qe("",!0),n.allowedShapes.includes("ellipse")?(G(),Ct(u,{key:6,class:"mr-2",icon:"pi pi-check","aria-label":"Ellipse",title:"Draw Ellipse",severity:"primary",disabled:t.drawingMode==="ellipse"||!t.manifestData,onClick:e[4]||(e[4]=xe=>t.drawingMode="ellipse")},{default:jt(()=>e[32]||(e[32]=[ue("svg",{class:"draw-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ue("ellipse",{cx:"8",cy:"8",rx:"6",ry:"4",stroke:"#444","stroke-width":"1.5",fill:"none"}),ue("circle",{cx:"8",cy:"4",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"8",r:"1.5",fill:"none"}),ue("circle",{cx:"8",cy:"12",r:"1.5",fill:"none"}),ue("circle",{cx:"2",cy:"8",r:"1.5",fill:"none"})],-1),ue("span",{class:"p-button-label"}," ",-1)])),_:1,__:[32]},8,["disabled"])):qe("",!0),n.allowedShapes.includes("freehand")?(G(),Ct(u,{key:7,icon:"pi pi-check","aria-label":"Freehand",title:"Freehand",severity:"primary",disabled:t.drawingMode==="freehand"||!t.manifestData,onClick:e[5]||(e[5]=xe=>t.drawingMode="freehand")},{default:jt(()=>e[33]||(e[33]=[ue("svg",{class:"draw-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ue("path",{d:"M2 14 Q4 4, 8 8 T14 2",stroke:"#444","stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),ue("circle",{cx:"2",cy:"14",r:"1.5",fill:"none"}),ue("circle",{cx:"14",cy:"2",r:"1.5",fill:"none"})],-1),ue("span",{class:"p-button-label"}," ",-1)])),_:1,__:[33]},8,["disabled"])):qe("",!0),gt(d,{layout:"vertical"}),gt(h,{class:"mr-2",title:"Line Color",modelValue:t.lineColor.value,"onUpdate:modelValue":e[6]||(e[6]=xe=>t.lineColor.value=xe),options:t.lineColor.options,placeholder:"Line Color",disabled:!t.manifestData},{value:jt(xe=>[xe.value?(G(),se("div",Dae,[ue("div",{style:hi(`width:20px;height:20px;background-color:${i.Helper.adjustColor(xe.value,s.luminance)}`)},null,4)])):(G(),se("span",Iae,lt(xe.placeholder),1))]),option:jt(xe=>[ue("div",Oae,[ue("div",{style:hi(`width:20px;height:20px;background-color:${i.Helper.adjustColor(xe.option,s.luminance)}`)},null,4)])]),_:1},8,["modelValue","options","disabled"]),gt(h,{title:"Shade",modelValue:t.colorShade.value,"onUpdate:modelValue":e[7]||(e[7]=xe=>t.colorShade.value=xe),options:t.colorShade.options,placeholder:"Shade",disabled:!t.manifestData},null,8,["modelValue","options","disabled"]),gt(d,{layout:"vertical"}),gt(u,{class:"mr-2",icon:"pi pi pi-list","aria-label":"Index",title:"Index",severity:"primary",disabled:!t.manifestData,onClick:e[8]||(e[8]=xe=>{t.showAboutPanel=!1,t.showIndexPanel=!t.showIndexPanel})},null,8,["disabled"]),gt(u,{icon:"pi pi pi-info-circle","aria-label":"About the manifest",title:"About the manifest",severity:"primary",disabled:!t.manifestData,onClick:e[9]||(e[9]=xe=>{t.showIndexPanel=!1,t.showAboutPanel=!t.showAboutPanel})},null,8,["disabled"])]),_:1})]),ue("div",Rae,[!t.loading&&t.manifestData?(G(),Ct(y,{key:0,manifest:t.manifestData,defaultInfoPanel:!1,showFullScreenButton:!1,showIndexButton:!1,showAnnotationViewButton:!1,showAboutPaneButton:!1,showSettingPaneButton:!1,showCollectionPaneButton:!1,showManifestUrl:!1,displayAnnotations:!1,toggleIndexPanel:t.showIndexPanel,toggleAboutPanel:t.showAboutPanel,onOsdInitialized:s.onOsdInit,onAboutPanelClosed:e[10]||(e[10]=xe=>t.showAboutPanel=!1),onIndexPanelClosed:e[11]||(e[11]=xe=>t.showIndexPanel=!1)},null,8,["manifest","toggleIndexPanel","toggleAboutPanel","onOsdInitialized"])):(G(),se("div",Lae,[ue("img",{style:{width:"200px"},src:i.logoPath,alt:"Glycerine"},null,8,Mae),ue("p",Nae,"Glycerine Editor (version "+lt(i.version)+")",1),t.loading?(G(),se("p",Fae,e[34]||(e[34]=[ue("i",{class:"pi pi-spin pi-spinner text-color-secondary text-4xl"},null,-1)]))):!n.manifest&&n.allowOpen?(G(),Ct(u,{key:1,label:"Open Manifest",onClick:e[12]||(e[12]=xe=>t.showOpenDialog=!0)})):qe("",!0)])),ue("div",Bae,[(G(!0),se(xt,null,hn(t.messages,xe=>(G(),Ct(w,{key:xe.id,severity:xe.severity,class:"m-0 mb-1 editor-message border-noround"},{default:jt(()=>[Jn(lt(xe.content),1)]),_:2},1032,["severity"]))),128))])]),gt(fe,{visible:t.showEditingDialog,"onUpdate:visible":e[20]||(e[20]=xe=>t.showEditingDialog=xe),onHide:s.onEditingDialogClosed,modal:"",header:t.editingDialogMode==="create"?"Create Annotation":"Edit Annotation",style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"}},{footer:jt(()=>[ue("div",ile,[ue("div",rle,[t.editingDialogMode==="edit"?(G(),Ct(u,{key:0,style:{width:"3rem"},icon:"pi pi-eraser",outlined:"",title:"Edit Annotation Area","aria-label":"Edit Annotation Area",onClick:s.enterAreaEditingMode},null,8,["onClick"])):qe("",!0),t.editingDialogMode==="edit"?(G(),Ct(u,{key:1,style:{width:"3rem"},icon:"pi pi-trash",outlined:"",severity:"danger",title:"Delete","aria-label":"Delete",onClick:s.deleteAnnotation},null,8,["onClick"])):qe("",!0)]),ue("div",sle,[gt(u,{label:"Cancel",icon:"pi pi-times",onClick:e[19]||(e[19]=xe=>t.showEditingDialog=!1),outlined:""}),gt(u,{label:t.editingDialogMode==="create"?"Create":"Save",loading:t.editingDialogSaving,onClick:s.editingDialogSubmit},null,8,["label","loading","onClick"])])])]),default:jt(()=>[gt(ve,null,{default:jt(()=>[gt(P,{header:"About"},{default:jt(()=>[ue("div",Uae,[n.allowedAnnotationLanguages&&n.allowedAnnotationLanguages.length>0?(G(),se("div",Hae,[gt(h,{id:"anoLanguage",class:"w-5 lg:w-3",modelValue:t.annotationFormModels.language,"onUpdate:modelValue":e[13]||(e[13]=xe=>t.annotationFormModels.language=xe),options:n.allowedAnnotationLanguages,"option-label":"name","option-value":"code"},null,8,["modelValue","options"])])):qe("",!0),ue("div",zae,[e[35]||(e[35]=ue("label",{for:"anoTitle"},"Title",-1)),gt(C,{id:"anoTitle",type:"text",modelValue:t.annotationFormModels.title[t.annotationFormModels.language],"onUpdate:modelValue":e[14]||(e[14]=xe=>t.annotationFormModels.title[t.annotationFormModels.language]=xe)},null,8,["modelValue"])]),ue("div",jae,[e[36]||(e[36]=ue("label",{for:"anoDescription"},"Description",-1)),gt(D,{id:"anoDescription",rows:"5",modelValue:t.annotationFormModels.description[t.annotationFormModels.language],"onUpdate:modelValue":e[15]||(e[15]=xe=>t.annotationFormModels.description[t.annotationFormModels.language]=xe)},null,8,["modelValue"])]),ue("div",Vae,[e[37]||(e[37]=ue("label",{for:"anoNote"},"Link",-1)),(G(!0),se(xt,null,hn(t.annotationFormModels.links[t.annotationFormModels.language],(xe,Qe)=>(G(),se("div",Wae,[ue("div",qae,[gt(C,{type:"url",placeholder:"URL",modelValue:t.annotationFormModels.links[t.annotationFormModels.language][Qe].url,"onUpdate:modelValue":ot=>t.annotationFormModels.links[t.annotationFormModels.language][Qe].url=ot},null,8,["modelValue","onUpdate:modelValue"])]),ue("div",Gae,[gt(C,{type:"text",placeholder:"Link Text",modelValue:t.annotationFormModels.links[t.annotationFormModels.language][Qe].text,"onUpdate:modelValue":ot=>t.annotationFormModels.links[t.annotationFormModels.language][Qe].text=ot},null,8,["modelValue","onUpdate:modelValue"])]),ue("div",null,[Qe===t.annotationFormModels.links[t.annotationFormModels.language].length-1?(G(),Ct(u,{key:0,rounded:"",outlined:"",icon:"pi pi-plus",size:"small",title:"Add New",onClick:s.addLink},null,8,["onClick"])):(G(),Ct(u,{key:1,rounded:"",outlined:"",icon:"pi pi-minus",size:"small",severity:"danger",title:"Delete",onClick:ot=>s.removeLink(Qe)},null,8,["onClick"]))])]))),256))])])]),_:1}),gt(P,{header:"Tags"},{default:jt(()=>[gt(M,{class:"mb-4","selected-vocab-id":t.selectedVocab.id,onSelectVocabulary:e[16]||(e[16]=xe=>{this.selectedVocab=xe})},null,8,["selected-vocab-id"]),gt(F,{class:"mb-4",terms:t.selectedTerms,onTagRemove:s.removeTag},null,8,["terms","onTagRemove"]),t.isLoadingTerms?(G(),se("div",Kae,[gt(K),t.selectedVocab?(G(),se("p",Yae,"Loading terms from "+lt(t.selectedVocab.title),1)):qe("",!0)])):t.terms&&t.terms.length>0?(G(),se("div",Xae,[gt(ee,{value:t.terms,filter:!0,filterMode:"lenient",class:"w-full"},{default:jt(xe=>[ue("div",Zae,[gt($,{modelValue:t.treeCheckedItems[xe.node.key],"onUpdate:modelValue":Qe=>t.treeCheckedItems[xe.node.key]=Qe,binary:!0,onChange:Qe=>s.onTermSelectChange(xe.node)},null,8,["modelValue","onUpdate:modelValue","onChange"]),ue("div",null,lt(xe.node.label),1)])]),_:1},8,["value"])])):qe("",!0)]),_:1}),gt(P,{header:"Notes"},{default:jt(()=>[ue("div",Qae,[ue("div",Jae,[e[38]||(e[38]=ue("label",{for:"anoNote"},"Note",-1)),(G(!0),se(xt,null,hn(t.annotationFormModels.notes,(xe,Qe)=>(G(),se("div",$ae,[ue("div",ele,[gt(D,{id:"anoNote",rows:"3",modelValue:t.annotationFormModels.notes[Qe],"onUpdate:modelValue":ot=>t.annotationFormModels.notes[Qe]=ot},null,8,["modelValue","onUpdate:modelValue"])]),ue("div",null,[Qe===t.annotationFormModels.notes.length-1?(G(),Ct(u,{key:0,rounded:"",outlined:"",icon:"pi pi-plus",size:"small",title:"Add New",onClick:s.addNote},null,8,["onClick"])):(G(),Ct(u,{key:1,rounded:"",outlined:"",icon:"pi pi-minus",size:"small",severity:"danger",title:"Delete",onClick:ot=>s.removeNote(Qe)},null,8,["onClick"]))])]))),256))]),ue("div",tle,[e[39]||(e[39]=ue("label",{for:"anoAttribution"},"Attribution",-1)),gt(C,{id:"anoAttribution",type:"text",modelValue:t.annotationFormModels.attribution,"onUpdate:modelValue":e[17]||(e[17]=xe=>t.annotationFormModels.attribution=xe)},null,8,["modelValue"])]),ue("div",nle,[e[40]||(e[40]=ue("label",{for:"anoDate"},"Date",-1)),gt(he,{id:"anoDate",dateFormat:"yy-mm-dd",modelValue:t.annotationFormModels.date,"onUpdate:modelValue":e[18]||(e[18]=xe=>t.annotationFormModels.date=xe),showIcon:"",showOnFocus:!1},null,8,["modelValue"]),e[41]||(e[41]=ue("small",{class:"text-color-secondary"},"Format: YYYY-MM-DD",-1))])])]),_:1})]),_:1})]),_:1},8,["visible","onHide","header"]),n.allowExport?(G(),Ct(fe,{key:0,visible:t.showExportDialog,"onUpdate:visible":e[23]||(e[23]=xe=>t.showExportDialog=xe),modal:"",header:"Export Manifest",style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"}},{footer:jt(()=>[gt(u,{label:"Copy",icon:"pi pi-copy",onClick:s.copyManifestOutput},null,8,["onClick"]),gt(u,{label:"Download",icon:"pi pi-download",onClick:s.downloadManifestOutput},null,8,["onClick"]),gt(u,{label:"Close",icon:"pi pi-times",onClick:e[22]||(e[22]=xe=>t.showExportDialog=!1),outlined:""})]),default:jt(()=>[gt(D,{style:{width:"100%","font-family":"'Courier New',monospace","white-space":"pre"},disabled:"",id:"manifestOutput",rows:"20",modelValue:t.manifestOutputJson,"onUpdate:modelValue":e[21]||(e[21]=xe=>t.manifestOutputJson=xe)},null,8,["modelValue"])]),_:1},8,["visible"])):qe("",!0),n.allowOpen?(G(),Ct(fe,{key:1,visible:t.showOpenDialog,"onUpdate:visible":e[27]||(e[27]=xe=>t.showOpenDialog=xe),modal:"",header:"Open Manifest",onShow:e[28]||(e[28]=xe=>t.manifestUrl=""),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"}},{footer:jt(()=>[gt(u,{label:"Close",icon:"pi pi-times",onClick:e[26]||(e[26]=xe=>t.showOpenDialog=!1),outlined:""}),gt(u,{label:"Open",icon:"pi pi-check",loading:t.openingManifest,onClick:s.openManifest},null,8,["loading","onClick"])]),default:jt(()=>[ue("div",ole,[ue("div",ale,[e[42]||(e[42]=ue("label",{for:"anoTitle"},"Manifest URL",-1)),gt(C,{type:"text",modelValue:t.manifestUrl,"onUpdate:modelValue":e[24]||(e[24]=xe=>t.manifestUrl=xe)},null,8,["modelValue"])])]),t.recentItems.length>0?(G(),se("div",lle,[e[44]||(e[44]=ue("div",{class:"mb-2"},"Recent Manifests",-1)),gt(ae,{modelValue:t.manifestUrl,"onUpdate:modelValue":e[25]||(e[25]=xe=>t.manifestUrl=xe),options:t.recentItems,optionLabel:"label",optionValue:"url",onChange:s.openManifest,class:"w-full"},{option:jt(xe=>[ue("span",null,[Jn(lt(xe.option.label),1),e[43]||(e[43]=ue("br",null,null,-1)),ue("small",null,lt(xe.option.url),1)])]),_:1},8,["modelValue","options","onChange"])])):qe("",!0)]),_:1},8,["visible"])):qe("",!0)])}const iN=tN(kae,[["render",ule]]),cle={install(t,e){t.use(Bne),t.component("GlycerineEditor",iN);const n=Une();t.use(n),t.directive("tooltip",Zne),t.use(Jne)}};class dle{constructor(e,n={}){Lh(this,Ob);this.element=e,this.options=n,this.rootProps=Fh(ts(this,Ob,X4).call(this)),this.app=C5(iN,this.rootProps),this.app.use(cle),this.rootComponent=null}init(){this.options.width?this.element.style.width=this.options.width:this.element.style.width="100%",this.options.height?this.element.style.height=this.options.height:this.element.style.height="600px",this.rootComponent=this.app.mount(this.element)}async openManifest(e){await this.rootComponent.openManifestByConfig(e)}exportManifest(){return this.rootComponent.generateManifestOutput()}getAnnotations(e=null){return this.rootComponent.getAnnotations(e)}destroy(){this.app&&(this.app.unmount(),this.app=null)}}return Ob=new WeakSet,X4=function(){return{manifest:this.options.manifest,allowedAnnotationLanguages:this.options.allowedAnnotationLanguages,defaultVocab:this.options.defaultVocab,storageConfig:this.options.storageConfig,allowOpen:this.options.allowOpen,allowExport:this.options.allowExport,allowedShapes:this.options.allowedShapes,defaultLineColor:this.options.defaultLineColor,defaultColorShade:this.options.defaultColorShade,onManifestLoaded:this.options.onManifestLoaded,onAnnotationsLoaded:this.options.onAnnotationsLoaded,onAnnotationSelected:this.options.onAnnotationSelected,onAnnotationCreated:this.options.onAnnotationCreated,onAnnotationUpdated:this.options.onAnnotationUpdated,onAnnotationDeleted:this.options.onAnnotationDeleted}},dle});