music-detail.ae1596bf.js 262 KB

12345678910111213141516171819202122
  1. import{d as Oi,bN as An,c as N,t as ve,a7 as si,U as be,$ as Ps,B as Ms,bl as wn,p as Os,bn as Cn,bo as Tn,ap as Is,aj as xn,r as Sn,a1 as En,b9 as kn,al as Nn,P as ni,a0 as ri,be as ai,n as Ji,g as Ki,e as Pn}from"./ResizeObserver.es.7b3c8c20.js";import{O as Zi}from"./index.4676d40a.js";import{i as it,d as Mn,e as On,f as In}from"./music-img-default.7aa4a8c2.js";/* empty css */import{d as oi}from"./deep-clone.c5af4e6b.js";import{R as Bn,a as li}from"./index.8cdc0d66.js";import{C as Rn}from"./index.b27aea49.js";import{C as ci}from"./index.931071c6.js";import{I as ot}from"./index.725d7287.js";import{S as Ln,a as Vn}from"./index.3845f5b9.js";import{S as Dn}from"./index.a3c2e90b.js";import{P as Un}from"./index.1a102cff.js";import"./index.601919da.js";import"./index.ef638512.js";import"./Checker.c96b08ff.js";import"./Picker.40859110.js";import"./index.acee245e.js";import"./use-tab-status.299f907f.js";import"./index.0cdfaa50.js";const Fn="_musicDetail_1rgii_1",zn="_musicContainer_1rgii_14",Hn="_musicInfos_1rgii_25",Qn="_musicImg_1rgii_31",Wn="_info_1rgii_43",qn="_names_1rgii_49",Yn="_author_1rgii_62",Xn="_audio_1rgii_67",jn="_showImgContainer_1rgii_83",Gn="_pdfContainer_1rgii_87",Jn="_footers_1rgii_95",Kn="_iconGroup_1rgii_106",Zn="_icon_1rgii_11",_n="_staffChange_1rgii_126";var re={musicDetail:Fn,musicContainer:zn,musicInfos:Hn,musicImg:Qn,info:Wn,names:qn,author:Yn,audio:Xn,showImgContainer:jn,pdfContainer:Gn,footers:Jn,iconGroup:Kn,icon:Zn,staffChange:_n};function k(s,e,t){return(e=er(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function $n(s,e){if(typeof s!="object"||s===null)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function er(s){var e=$n(s,"string");return typeof e=="symbol"?e:String(e)}function tr(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function _i(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function ir(s,e,t){return e&&_i(s.prototype,e),t&&_i(s,t),s}function sr(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function $i(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function es(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$i(Object(t),!0).forEach(function(i){sr(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):$i(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}var ts={addCSS:!0,thumbWidth:15,watch:!0};function nr(s,e){return function(){return Array.from(document.querySelectorAll(e)).includes(this)}.call(s,e)}function rr(s,e){if(s&&e){var t=new Event(e,{bubbles:!0});s.dispatchEvent(t)}}var pt=function(s){return s!=null?s.constructor:null},Ii=function(s,e){return!!(s&&e&&s instanceof e)},Bs=function(s){return s==null},Rs=function(s){return pt(s)===Object},ar=function(s){return pt(s)===Number&&!Number.isNaN(s)},Ls=function(s){return pt(s)===String},or=function(s){return pt(s)===Boolean},lr=function(s){return pt(s)===Function},Vs=function(s){return Array.isArray(s)},Ds=function(s){return Ii(s,NodeList)},cr=function(s){return Ii(s,Element)},hr=function(s){return Ii(s,Event)},ur=function(s){return Bs(s)||(Ls(s)||Vs(s)||Ds(s))&&!s.length||Rs(s)&&!Object.keys(s).length},ae={nullOrUndefined:Bs,object:Rs,number:ar,string:Ls,boolean:or,function:lr,array:Vs,nodeList:Ds,element:cr,event:hr,empty:ur};function dr(s){var e="".concat(s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function mr(s,e){if(1>e){var t=dr(e);return parseFloat(s.toFixed(t))}return Math.round(s/e)*e}var gr=function(){function s(e,t){tr(this,s),ae.element(e)?this.element=e:ae.string(e)&&(this.element=document.querySelector(e)),ae.element(this.element)&&ae.empty(this.element.rangeTouch)&&(this.config=es({},ts,{},t),this.init())}return ir(s,[{key:"init",value:function(){s.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){s.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(n){t.element[i](n,function(r){return t.set(r)},!1)})}},{key:"get",value:function(e){if(!s.enabled||!ae.event(e))return null;var t,i=e.target,n=e.changedTouches[0],r=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,a=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(t=100/l.width*(n.clientX-l.left))?t=0:100<t&&(t=100),50>t?t-=(100-2*t)*c:50<t&&(t+=2*(t-50)*c),r+mr(t/100*(o-r),a)}},{key:"set",value:function(e){s.enabled&&ae.event(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),rr(e.target,e.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},i=null;if(ae.empty(e)||ae.string(e)?i=Array.from(document.querySelectorAll(ae.string(e)?e:'input[type="range"]')):ae.element(e)?i=[e]:ae.nodeList(e)?i=Array.from(e):ae.array(e)&&(i=e.filter(ae.element)),ae.empty(i))return null;var n=es({},ts,{},t);if(ae.string(e)&&n.watch){var r=new MutationObserver(function(o){Array.from(o).forEach(function(a){Array.from(a.addedNodes).forEach(function(l){ae.element(l)&&nr(l,e)&&new s(l,n)})})});r.observe(document.body,{childList:!0,subtree:!0})}return i.map(function(o){return new s(o,t)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),s}();const ft=s=>s!=null?s.constructor:null,Ne=(s,e)=>Boolean(s&&e&&s instanceof e),Bi=s=>s==null,Us=s=>ft(s)===Object,pr=s=>ft(s)===Number&&!Number.isNaN(s),Ut=s=>ft(s)===String,fr=s=>ft(s)===Boolean,Fs=s=>typeof s=="function",zs=s=>Array.isArray(s),yr=s=>Ne(s,WeakMap),Hs=s=>Ne(s,NodeList),br=s=>ft(s)===Text,vr=s=>Ne(s,Event),Ar=s=>Ne(s,KeyboardEvent),wr=s=>Ne(s,window.TextTrackCue)||Ne(s,window.VTTCue),Cr=s=>Ne(s,TextTrack)||!Bi(s)&&Ut(s.kind),Tr=s=>Ne(s,Promise)&&Fs(s.then),xr=s=>s!==null&&typeof s=="object"&&s.nodeType===1&&typeof s.style=="object"&&typeof s.ownerDocument=="object",Qs=s=>Bi(s)||(Ut(s)||zs(s)||Hs(s))&&!s.length||Us(s)&&!Object.keys(s).length,Sr=s=>{if(Ne(s,window.URL))return!0;if(!Ut(s))return!1;let e=s;s.startsWith("http://")&&s.startsWith("https://")||(e=`http://${s}`);try{return!Qs(new URL(e).hostname)}catch{return!1}};var g={nullOrUndefined:Bi,object:Us,number:pr,string:Ut,boolean:fr,function:Fs,array:zs,weakMap:yr,nodeList:Hs,element:xr,textNode:br,event:vr,keyboardEvent:Ar,cue:wr,track:Cr,promise:Tr,url:Sr,empty:Qs};const wi=(()=>{const s=document.createElement("span"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},t=Object.keys(e).find(i=>s.style[i]!==void 0);return!!g.string(t)&&e[t]})();function Ws(s,e){setTimeout(()=>{try{s.hidden=!0,s.offsetHeight,s.hidden=!1}catch{}},e)}const Er=Boolean(window.document.documentMode),kr=/Edge/g.test(navigator.userAgent),Nr="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),Pr=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Mr=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Or=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var ne={isIE:Er,isEdge:kr,isWebKit:Nr,isIPhone:Pr,isIPadOS:Mr,isIos:Or};function Ir(s){return JSON.parse(JSON.stringify(s))}function qs(s,e){return e.split(".").reduce((t,i)=>t&&t[i],s)}function K(s={},...e){if(!e.length)return s;const t=e.shift();return g.object(t)?(Object.keys(t).forEach(i=>{g.object(t[i])?(Object.keys(s).includes(i)||Object.assign(s,{[i]:{}}),K(s[i],t[i])):Object.assign(s,{[i]:t[i]})}),K(s,...e)):s}function Ys(s,e){const t=s.length?s:[s];Array.from(t).reverse().forEach((i,n)=>{const r=n>0?e.cloneNode(!0):e,o=i.parentNode,a=i.nextSibling;r.appendChild(i),a?o.insertBefore(r,a):o.appendChild(r)})}function Ci(s,e){g.element(s)&&!g.empty(e)&&Object.entries(e).filter(([,t])=>!g.nullOrUndefined(t)).forEach(([t,i])=>s.setAttribute(t,i))}function I(s,e,t){const i=document.createElement(s);return g.object(e)&&Ci(i,e),g.string(t)&&(i.innerText=t),i}function Br(s,e){g.element(s)&&g.element(e)&&e.parentNode.insertBefore(s,e.nextSibling)}function is(s,e,t,i){g.element(e)&&e.appendChild(I(s,t,i))}function Ee(s){g.nodeList(s)||g.array(s)?Array.from(s).forEach(Ee):g.element(s)&&g.element(s.parentNode)&&s.parentNode.removeChild(s)}function Ot(s){if(!g.element(s))return;let{length:e}=s.childNodes;for(;e>0;)s.removeChild(s.lastChild),e-=1}function Lt(s,e){return g.element(e)&&g.element(e.parentNode)&&g.element(s)?(e.parentNode.replaceChild(s,e),s):null}function Ce(s,e){if(!g.string(s)||g.empty(s))return{};const t={},i=K({},e);return s.split(",").forEach(n=>{const r=n.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),[l]=a,c=a.length>1?a[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":g.string(i.class)?t.class=`${i.class} ${o}`:t.class=o;break;case"#":t.id=r.replace("#","");break;case"[":t[l]=c}}),K(i,t)}function He(s,e){if(!g.element(s))return;let t=e;g.boolean(t)||(t=!s.hidden),s.hidden=t}function F(s,e,t){if(g.nodeList(s))return Array.from(s).map(i=>F(i,e,t));if(g.element(s)){let i="toggle";return t!==void 0&&(i=t?"add":"remove"),s.classList[i](e),s.classList.contains(e)}return!1}function Vt(s,e){return g.element(s)&&s.classList.contains(e)}function qe(s,e){const{prototype:t}=Element;return(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return Array.from(document.querySelectorAll(e)).includes(this)}).call(s,e)}function Rr(s,e){const{prototype:t}=Element;return(t.closest||function(){let i=this;do{if(qe.matches(i,e))return i;i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}).call(s,e)}function ct(s){return this.elements.container.querySelectorAll(s)}function te(s){return this.elements.container.querySelector(s)}function hi(s=null,e=!1){g.element(s)&&s.focus({preventScroll:!0,focusVisible:e})}const ss={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Z={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(s,e){const t=Z[s]||e!=="html5";return{api:t,ui:t&&Z.rangeInput}},pip:!(ne.isIPhone||!g.function(I("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||I("video").disablePictureInPicture)),airplay:g.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(s){if(g.empty(s))return!1;const[e]=s.split("/");let t=s;if(!this.isHTML5||e!==this.type)return!1;Object.keys(ss).includes(t)&&(t+=`; codecs="${ss[s]}"`);try{return Boolean(t&&this.media.canPlayType(t).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const s=document.createElement("input");return s.type="range",s.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:wi!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Lr=(()=>{let s=!1;try{const e=Object.defineProperty({},"passive",{get:()=>(s=!0,null)});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return s})();function ht(s,e,t,i=!1,n=!0,r=!1){if(!s||!("addEventListener"in s)||g.empty(e)||!g.function(t))return;const o=e.split(" ");let a=r;Lr&&(a={passive:n,capture:r}),o.forEach(l=>{this&&this.eventListeners&&i&&this.eventListeners.push({element:s,type:l,callback:t,options:a}),s[i?"addEventListener":"removeEventListener"](l,t,a)})}function V(s,e="",t,i=!0,n=!1){ht.call(this,s,e,t,!0,i,n)}function Ft(s,e="",t,i=!0,n=!1){ht.call(this,s,e,t,!1,i,n)}function Ri(s,e="",t,i=!0,n=!1){const r=(...o)=>{Ft(s,e,r,i,n),t.apply(this,o)};ht.call(this,s,e,r,!0,i,n)}function B(s,e="",t=!1,i={}){if(!g.element(s)||g.empty(e))return;const n=new CustomEvent(e,{bubbles:t,detail:{...i,plyr:this}});s.dispatchEvent(n)}function Vr(){this&&this.eventListeners&&(this.eventListeners.forEach(s=>{const{element:e,type:t,callback:i,options:n}=s;e.removeEventListener(t,i,n)}),this.eventListeners=[])}function Dr(){return new Promise(s=>this.ready?setTimeout(s,0):V.call(this,this.elements.container,"ready",s)).then(()=>{})}function Te(s){g.promise(s)&&s.then(null,()=>{})}function Ti(s){return g.array(s)?s.filter((e,t)=>s.indexOf(e)===t):s}function Xs(s,e){return g.array(s)&&s.length?s.reduce((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t):null}function js(s){return!(!window||!window.CSS)&&window.CSS.supports(s)}const ns=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((s,[e,t])=>({...s,[e/t]:[e,t]}),{});function Gs(s){return g.array(s)||g.string(s)&&s.includes(":")?(g.array(s)?s:s.split(":")).map(Number).every(g.number):!1}function Dt(s){if(!g.array(s)||!s.every(g.number))return null;const[e,t]=s,i=(r,o)=>o===0?r:i(o,r%o),n=i(e,t);return[e/n,t/n]}function Li(s){const e=i=>Gs(i)?i.split(":").map(Number):null;let t=e(s);if(t===null&&(t=e(this.config.ratio)),t===null&&!g.empty(this.embed)&&g.array(this.embed.ratio)&&({ratio:t}=this.embed),t===null&&this.isHTML5){const{videoWidth:i,videoHeight:n}=this.media;t=[i,n]}return Dt(t)}function $e(s){if(!this.isVideo)return{};const{wrapper:e}=this.elements,t=Li.call(this,s);if(!g.array(t))return{};const[i,n]=Dt(t),r=100/i*n;if(js(`aspect-ratio: ${i}/${n}`)?e.style.aspectRatio=`${i}/${n}`:e.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const o=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),a=(o-r)/(o/50);this.fullscreen.active?e.style.paddingBottom=null:this.media.style.transform=`translateY(-${a}%)`}else this.isHTML5&&e.classList.add(this.config.classNames.videoFixedRatio);return{padding:r,ratio:t}}function Js(s,e,t=.05){const i=s/e,n=Xs(Object.keys(ns),i);return Math.abs(n-i)<=t?ns[n]:[s,e]}function Ur(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const Re={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(s=>{const e=s.getAttribute("type");return!!g.empty(e)||Z.mime.call(this,e)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Re.getSources.call(this).map(s=>Number(s.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const s=this;s.options.speed=s.config.speed.options,g.empty(this.config.ratio)||$e.call(s),Object.defineProperty(s.media,"quality",{get(){const e=Re.getSources.call(s).find(t=>t.getAttribute("src")===s.source);return e&&Number(e.getAttribute("size"))},set(e){if(s.quality!==e){if(s.config.quality.forced&&g.function(s.config.quality.onChange))s.config.quality.onChange(e);else{const t=Re.getSources.call(s).find(l=>Number(l.getAttribute("size"))===e);if(!t)return;const{currentTime:i,paused:n,preload:r,readyState:o,playbackRate:a}=s.media;s.media.src=t.getAttribute("src"),(r!=="none"||o)&&(s.once("loadedmetadata",()=>{s.speed=a,s.currentTime=i,n||Te(s.play())}),s.media.load())}B.call(s,s.media,"qualitychange",!1,{quality:e})}}})},cancelRequests(){this.isHTML5&&(Ee(Re.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Fr(s){return`${s}-${Math.floor(1e4*Math.random())}`}function xi(s,...e){return g.empty(s)?s:s.toString().replace(/{(\d+)}/g,(t,i)=>e[i].toString())}function zr(s,e){return s===0||e===0||Number.isNaN(s)||Number.isNaN(e)?0:(s/e*100).toFixed(2)}const lt=(s="",e="",t="")=>s.replace(new RegExp(e.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString()),Ks=(s="")=>s.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase());function Hr(s=""){let e=s.toString();return e=lt(e,"-"," "),e=lt(e,"_"," "),e=Ks(e),lt(e," ","")}function Qr(s=""){let e=s.toString();return e=Hr(e),e.charAt(0).toLowerCase()+e.slice(1)}function Wr(s){const e=document.createDocumentFragment(),t=document.createElement("div");return e.appendChild(t),t.innerHTML=s,e.firstChild.innerText}function qr(s){const e=document.createElement("div");return e.appendChild(s),e.innerHTML}const rs={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},se={get(s="",e={}){if(g.empty(s)||g.empty(e))return"";let t=qs(e.i18n,s);if(g.empty(t))return Object.keys(rs).includes(s)?rs[s]:"";const i={"{seektime}":e.seekTime,"{title}":e.title};return Object.entries(i).forEach(([n,r])=>{t=lt(t,n,r)}),t}};class ut{constructor(e){k(this,"get",t=>{if(!ut.supported||!this.enabled)return null;const i=window.localStorage.getItem(this.key);if(g.empty(i))return null;const n=JSON.parse(i);return g.string(t)&&t.length?n[t]:n}),k(this,"set",t=>{if(!ut.supported||!this.enabled||!g.object(t))return;let i=this.get();g.empty(i)&&(i={}),K(i,t);try{window.localStorage.setItem(this.key,JSON.stringify(i))}catch{}}),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function yt(s,e="text"){return new Promise((t,i)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",()=>{if(e==="text")try{t(JSON.parse(n.responseText))}catch{t(n.responseText)}else t(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",s,!0),n.responseType=e,n.send()}catch(n){i(n)}})}function Zs(s,e){if(!g.string(s))return;const t="cache",i=g.string(e);let n=!1;const r=()=>document.getElementById(e)!==null,o=(a,l)=>{a.innerHTML=l,i&&r()||document.body.insertAdjacentElement("afterbegin",a)};if(!i||!r()){const a=ut.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),i&&l.setAttribute("id",e),a){const c=window.localStorage.getItem(`${t}-${e}`);if(n=c!==null,n){const h=JSON.parse(c);o(l,h.content)}}yt(s).then(c=>{if(!g.empty(c)){if(a)try{window.localStorage.setItem(`${t}-${e}`,JSON.stringify({content:c}))}catch{}o(l,c)}}).catch(()=>{})}}const _s=s=>Math.trunc(s/60/60%60,10),Yr=s=>Math.trunc(s/60%60,10),Xr=s=>Math.trunc(s%60,10);function zt(s=0,e=!1,t=!1){if(!g.number(s))return zt(void 0,e,t);const i=a=>`0${a}`.slice(-2);let n=_s(s);const r=Yr(s),o=Xr(s);return n=e||n>0?`${n}:`:"",`${t&&s>0?"-":""}${n}${i(r)}:${i(o)}`}const E={getIconUrl(){const s=new URL(this.config.iconUrl,window.location),e=window.location.host?window.location.host:window.top.location.host,t=s.host!==e||ne.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=te.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ct.call(this,this.config.selectors.buttons.play),pause:te.call(this,this.config.selectors.buttons.pause),restart:te.call(this,this.config.selectors.buttons.restart),rewind:te.call(this,this.config.selectors.buttons.rewind),fastForward:te.call(this,this.config.selectors.buttons.fastForward),mute:te.call(this,this.config.selectors.buttons.mute),pip:te.call(this,this.config.selectors.buttons.pip),airplay:te.call(this,this.config.selectors.buttons.airplay),settings:te.call(this,this.config.selectors.buttons.settings),captions:te.call(this,this.config.selectors.buttons.captions),fullscreen:te.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=te.call(this,this.config.selectors.progress),this.elements.inputs={seek:te.call(this,this.config.selectors.inputs.seek),volume:te.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:te.call(this,this.config.selectors.display.buffer),currentTime:te.call(this,this.config.selectors.display.currentTime),duration:te.call(this,this.config.selectors.display.duration)},g.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(s){return this.debug.warn("It looks like there is a problem with your custom controls HTML",s),this.toggleNativeControls(!0),!1}},createIcon(s,e){const t="http://www.w3.org/2000/svg",i=E.getIconUrl.call(this),n=`${i.cors?"":i.url}#${this.config.iconPrefix}`,r=document.createElementNS(t,"svg");Ci(r,K(e,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(t,"use"),a=`${n}-${s}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.appendChild(o),r},createLabel(s,e={}){const t=se.get(s,this.config);return I("span",{...e,class:[e.class,this.config.classNames.hidden].filter(Boolean).join(" ")},t)},createBadge(s){if(g.empty(s))return null;const e=I("span",{class:this.config.classNames.menu.value});return e.appendChild(I("span",{class:this.config.classNames.menu.badge},s)),e},createButton(s,e){const t=K({},e);let i=Qr(s);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(o=>{Object.keys(t).includes(o)&&(n[o]=t[o],delete t[o])}),n.element!=="button"||Object.keys(t).includes("type")||(t.type="button"),Object.keys(t).includes("class")?t.class.split(" ").some(o=>o===this.config.classNames.control)||K(t,{class:`${t.class} ${this.config.classNames.control}`}):t.class=this.config.classNames.control,s){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":t.class+=` ${this.config.classNames.control}--overlaid`,i="play",n.label="play",n.icon="play";break;default:g.empty(n.label)&&(n.label=i),g.empty(n.icon)&&(n.icon=s)}const r=I(n.element);return n.toggle?(r.appendChild(E.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),r.appendChild(E.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),r.appendChild(E.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),r.appendChild(E.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(r.appendChild(E.createIcon.call(this,n.icon)),r.appendChild(E.createLabel.call(this,n.label))),K(t,Ce(this.config.selectors.buttons[i],t)),Ci(r,t),i==="play"?(g.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(r)):this.elements.buttons[i]=r,r},createRange(s,e){const t=I("input",K(Ce(this.config.selectors.inputs[s]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":se.get(s,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},e));return this.elements.inputs[s]=t,E.updateRangeFill.call(this,t),gr.setup(t),t},createProgress(s,e){const t=I("progress",K(Ce(this.config.selectors.display[s]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},e));if(s!=="volume"){t.appendChild(I("span",null,"0"));const i={played:"played",buffer:"buffered"}[s],n=i?se.get(i,this.config):"";t.innerText=`% ${n.toLowerCase()}`}return this.elements.display[s]=t,t},createTime(s,e){const t=Ce(this.config.selectors.display[s],e),i=I("div",K(t,{class:`${t.class?t.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":se.get(s,this.config),role:"timer"}),"00:00");return this.elements.display[s]=i,i},bindMenuItemShortcuts(s,e){V.call(this,s,"keydown keyup",t=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(t.key)||(t.preventDefault(),t.stopPropagation(),t.type==="keydown"))return;const i=qe(s,'[role="menuitemradio"]');if(!i&&[" ","ArrowRight"].includes(t.key))E.showMenuPanel.call(this,e,!0);else{let n;t.key!==" "&&(t.key==="ArrowDown"||i&&t.key==="ArrowRight"?(n=s.nextElementSibling,g.element(n)||(n=s.parentNode.firstElementChild)):(n=s.previousElementSibling,g.element(n)||(n=s.parentNode.lastElementChild)),hi.call(this,n,!0))}},!1),V.call(this,s,"keyup",t=>{t.key==="Return"&&E.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:s,list:e,type:t,title:i,badge:n=null,checked:r=!1}){const o=Ce(this.config.selectors.inputs[t]),a=I("button",K(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:s})),l=I("span");l.innerHTML=i,g.element(n)&&l.appendChild(n),a.appendChild(l),Object.defineProperty(a,"checked",{enumerable:!0,get:()=>a.getAttribute("aria-checked")==="true",set(c){c&&Array.from(a.parentNode.children).filter(h=>qe(h,'[role="menuitemradio"]')).forEach(h=>h.setAttribute("aria-checked","false")),a.setAttribute("aria-checked",c?"true":"false")}}),this.listeners.bind(a,"click keyup",c=>{if(!g.keyboardEvent(c)||c.key===" "){switch(c.preventDefault(),c.stopPropagation(),a.checked=!0,t){case"language":this.currentTrack=Number(s);break;case"quality":this.quality=s;break;case"speed":this.speed=parseFloat(s)}E.showMenuPanel.call(this,"home",g.keyboardEvent(c))}},t,!1),E.bindMenuItemShortcuts.call(this,a,t),e.appendChild(a)},formatTime(s=0,e=!1){return g.number(s)?zt(s,_s(this.duration)>0,e):s},updateTimeDisplay(s=null,e=0,t=!1){g.element(s)&&g.number(e)&&(s.innerText=E.formatTime(e,t))},updateVolume(){this.supported.ui&&(g.element(this.elements.inputs.volume)&&E.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),g.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(s,e=0){g.element(s)&&(s.value=e,E.updateRangeFill.call(this,s))},updateProgress(s){if(!this.supported.ui||!g.event(s))return;let e=0;const t=(i,n)=>{const r=g.number(n)?n:0,o=g.element(i)?i:this.elements.display.buffer;if(g.element(o)){o.value=r;const a=o.getElementsByTagName("span")[0];g.element(a)&&(a.childNodes[0].nodeValue=r)}};if(s)switch(s.type){case"timeupdate":case"seeking":case"seeked":e=zr(this.currentTime,this.duration),s.type==="timeupdate"&&E.setRange.call(this,this.elements.inputs.seek,e);break;case"playing":case"progress":t(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(s){const e=g.event(s)?s.target:s;if(g.element(e)&&e.getAttribute("type")==="range"){if(qe(e,this.config.selectors.inputs.seek)){e.setAttribute("aria-valuenow",this.currentTime);const t=E.formatTime(this.currentTime),i=E.formatTime(this.duration),n=se.get("seekLabel",this.config);e.setAttribute("aria-valuetext",n.replace("{currentTime}",t).replace("{duration}",i))}else if(qe(e,this.config.selectors.inputs.volume)){const t=100*e.value;e.setAttribute("aria-valuenow",t),e.setAttribute("aria-valuetext",`${t.toFixed(1)}%`)}else e.setAttribute("aria-valuenow",e.value);(ne.isWebKit||ne.isIPadOS)&&e.style.setProperty("--value",e.value/e.max*100+"%")}},updateSeekTooltip(s){var e,t;if(!this.config.tooltips.seek||!g.element(this.elements.inputs.seek)||!g.element(this.elements.display.seekTooltip)||this.duration===0)return;const i=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,r=h=>F(i,n,h);if(this.touch)return void r(!1);let o=0;const a=this.elements.progress.getBoundingClientRect();if(g.event(s))o=100/a.width*(s.pageX-a.left);else{if(!Vt(i,n))return;o=parseFloat(i.style.left,10)}o<0?o=0:o>100&&(o=100);const l=this.duration/100*o;i.innerText=E.formatTime(l);const c=(e=this.config.markers)===null||e===void 0||(t=e.points)===null||t===void 0?void 0:t.find(({time:h})=>h===Math.round(l));c&&i.insertAdjacentHTML("afterbegin",`${c.label}<br>`),i.style.left=`${o}%`,g.event(s)&&["mouseenter","mouseleave"].includes(s.type)&&r(s.type==="mouseenter")},timeUpdate(s){const e=!g.element(this.elements.display.duration)&&this.config.invertTime;E.updateTimeDisplay.call(this,this.elements.display.currentTime,e?this.duration-this.currentTime:this.currentTime,e),s&&s.type==="timeupdate"&&this.media.seeking||E.updateProgress.call(this,s)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return He(this.elements.display.currentTime,!0),void He(this.elements.progress,!0);g.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const s=g.element(this.elements.display.duration);!s&&this.config.displayDuration&&this.paused&&E.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),s&&E.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&E.setMarkers.call(this),E.updateSeekTooltip.call(this)},toggleMenuButton(s,e){He(this.elements.settings.buttons[s],!e)},updateSetting(s,e,t){const i=this.elements.settings.panels[s];let n=null,r=e;if(s==="captions")n=this.currentTrack;else{if(n=g.empty(t)?this[s]:t,g.empty(n)&&(n=this.config[s].default),!g.empty(this.options[s])&&!this.options[s].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${s}`);if(!this.config[s].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${s}`)}if(g.element(r)||(r=i&&i.querySelector('[role="menu"]')),!g.element(r))return;this.elements.settings.buttons[s].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=E.getLabel.call(this,s,n);const o=r&&r.querySelector(`[value="${n}"]`);g.element(o)&&(o.checked=!0)},getLabel(s,e){switch(s){case"speed":return e===1?se.get("normal",this.config):`${e}&times;`;case"quality":if(g.number(e)){const t=se.get(`qualityLabel.${e}`,this.config);return t.length?t:`${e}p`}return Ks(e);case"captions":return U.getLabel.call(this);default:return null}},setQualityMenu(s){if(!g.element(this.elements.settings.panels.quality))return;const e="quality",t=this.elements.settings.panels.quality.querySelector('[role="menu"]');g.array(s)&&(this.options.quality=Ti(s).filter(r=>this.config.quality.options.includes(r)));const i=!g.empty(this.options.quality)&&this.options.quality.length>1;if(E.toggleMenuButton.call(this,e,i),Ot(t),E.checkMenu.call(this),!i)return;const n=r=>{const o=se.get(`qualityBadge.${r}`,this.config);return o.length?E.createBadge.call(this,o):null};this.options.quality.sort((r,o)=>{const a=this.config.quality.options;return a.indexOf(r)>a.indexOf(o)?1:-1}).forEach(r=>{E.createMenuItem.call(this,{value:r,list:t,type:e,title:E.getLabel.call(this,"quality",r),badge:n(r)})}),E.updateSetting.call(this,e,t)},setCaptionsMenu(){if(!g.element(this.elements.settings.panels.captions))return;const s="captions",e=this.elements.settings.panels.captions.querySelector('[role="menu"]'),t=U.getTracks.call(this),i=Boolean(t.length);if(E.toggleMenuButton.call(this,s,i),Ot(e),E.checkMenu.call(this),!i)return;const n=t.map((r,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:U.getLabel.call(this,r),badge:r.language&&E.createBadge.call(this,r.language.toUpperCase()),list:e,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:se.get("disabled",this.config),list:e,type:"language"}),n.forEach(E.createMenuItem.bind(this)),E.updateSetting.call(this,s,e)},setSpeedMenu(){if(!g.element(this.elements.settings.panels.speed))return;const s="speed",e=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(i=>i>=this.minimumSpeed&&i<=this.maximumSpeed);const t=!g.empty(this.options.speed)&&this.options.speed.length>1;E.toggleMenuButton.call(this,s,t),Ot(e),E.checkMenu.call(this),t&&(this.options.speed.forEach(i=>{E.createMenuItem.call(this,{value:i,list:e,type:s,title:E.getLabel.call(this,"speed",i)})}),E.updateSetting.call(this,s,e))},checkMenu(){const{buttons:s}=this.elements.settings,e=!g.empty(s)&&Object.values(s).some(t=>!t.hidden);He(this.elements.settings.menu,!e)},focusFirstMenuItem(s,e=!1){if(this.elements.settings.popup.hidden)return;let t=s;g.element(t)||(t=Object.values(this.elements.settings.panels).find(n=>!n.hidden));const i=t.querySelector('[role^="menuitem"]');hi.call(this,i,e)},toggleMenu(s){const{popup:e}=this.elements.settings,t=this.elements.buttons.settings;if(!g.element(e)||!g.element(t))return;const{hidden:i}=e;let n=i;if(g.boolean(s))n=s;else if(g.keyboardEvent(s)&&s.key==="Escape")n=!1;else if(g.event(s)){const r=g.function(s.composedPath)?s.composedPath()[0]:s.target,o=e.contains(r);if(o||!o&&s.target!==t&&n)return}t.setAttribute("aria-expanded",n),He(e,!n),F(this.elements.container,this.config.classNames.menu.open,n),n&&g.keyboardEvent(s)?E.focusFirstMenuItem.call(this,null,!0):n||i||hi.call(this,t,g.keyboardEvent(s))},getMenuSize(s){const e=s.cloneNode(!0);e.style.position="absolute",e.style.opacity=0,e.removeAttribute("hidden"),s.parentNode.appendChild(e);const t=e.scrollWidth,i=e.scrollHeight;return Ee(e),{width:t,height:i}},showMenuPanel(s="",e=!1){const t=this.elements.container.querySelector(`#plyr-settings-${this.id}-${s}`);if(!g.element(t))return;const i=t.parentNode,n=Array.from(i.children).find(r=>!r.hidden);if(Z.transitions&&!Z.reducedMotion){i.style.width=`${n.scrollWidth}px`,i.style.height=`${n.scrollHeight}px`;const r=E.getMenuSize.call(this,t),o=a=>{a.target===i&&["width","height"].includes(a.propertyName)&&(i.style.width="",i.style.height="",Ft.call(this,i,wi,o))};V.call(this,i,wi,o),i.style.width=`${r.width}px`,i.style.height=`${r.height}px`}He(n,!0),He(t,!1),E.focusFirstMenuItem.call(this,t,e)},setDownloadUrl(){const s=this.elements.buttons.download;g.element(s)&&s.setAttribute("href",this.download)},create(s){const{bindMenuItemShortcuts:e,createButton:t,createProgress:i,createRange:n,createTime:r,setQualityMenu:o,setSpeedMenu:a,showMenuPanel:l}=E;this.elements.controls=null,g.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(t.call(this,"play-large"));const c=I("div",Ce(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return Ti(g.array(this.config.controls)?this.config.controls:[]).forEach(m=>{if(m==="restart"&&c.appendChild(t.call(this,"restart",h)),m==="rewind"&&c.appendChild(t.call(this,"rewind",h)),m==="play"&&c.appendChild(t.call(this,"play",h)),m==="fast-forward"&&c.appendChild(t.call(this,"fast-forward",h)),m==="progress"){const u=I("div",{class:`${h.class} plyr__progress__container`}),d=I("div",Ce(this.config.selectors.progress));if(d.appendChild(n.call(this,"seek",{id:`plyr-seek-${s.id}`})),d.appendChild(i.call(this,"buffer")),this.config.tooltips.seek){const p=I("span",{class:this.config.classNames.tooltip},"00:00");d.appendChild(p),this.elements.display.seekTooltip=p}this.elements.progress=d,u.appendChild(this.elements.progress),c.appendChild(u)}if(m==="current-time"&&c.appendChild(r.call(this,"currentTime",h)),m==="duration"&&c.appendChild(r.call(this,"duration",h)),m==="mute"||m==="volume"){let{volume:u}=this.elements;if(g.element(u)&&c.contains(u)||(u=I("div",K({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=u,c.appendChild(u)),m==="mute"&&u.appendChild(t.call(this,"mute")),m==="volume"&&!ne.isIos&&!ne.isIPadOS){const d={max:1,step:.05,value:this.config.volume};u.appendChild(n.call(this,"volume",K(d,{id:`plyr-volume-${s.id}`})))}}if(m==="captions"&&c.appendChild(t.call(this,"captions",h)),m==="settings"&&!g.empty(this.config.settings)){const u=I("div",K({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));u.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${s.id}`,"aria-expanded":!1}));const d=I("div",{class:"plyr__menu__container",id:`plyr-settings-${s.id}`,hidden:""}),p=I("div"),f=I("div",{id:`plyr-settings-${s.id}-home`}),y=I("div",{role:"menu"});f.appendChild(y),p.appendChild(f),this.elements.settings.panels.home=f,this.config.settings.forEach(b=>{const v=I("button",K(Ce(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));e.call(this,v,b),V.call(this,v,"click",()=>{l.call(this,b,!1)});const C=I("span",null,se.get(b,this.config)),S=I("span",{class:this.config.classNames.menu.value});S.innerHTML=s[b],C.appendChild(S),v.appendChild(C),y.appendChild(v);const w=I("div",{id:`plyr-settings-${s.id}-${b}`,hidden:""}),x=I("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});x.appendChild(I("span",{"aria-hidden":!0},se.get(b,this.config))),x.appendChild(I("span",{class:this.config.classNames.hidden},se.get("menuBack",this.config))),V.call(this,w,"keydown",A=>{A.key==="ArrowLeft"&&(A.preventDefault(),A.stopPropagation(),l.call(this,"home",!0))},!1),V.call(this,x,"click",()=>{l.call(this,"home",!1)}),w.appendChild(x),w.appendChild(I("div",{role:"menu"})),p.appendChild(w),this.elements.settings.buttons[b]=v,this.elements.settings.panels[b]=w}),d.appendChild(p),u.appendChild(d),c.appendChild(u),this.elements.settings.popup=d,this.elements.settings.menu=u}if(m==="pip"&&Z.pip&&c.appendChild(t.call(this,"pip",h)),m==="airplay"&&Z.airplay&&c.appendChild(t.call(this,"airplay",h)),m==="download"){const u=K({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(u.download="");const{download:d}=this.config.urls;!g.url(d)&&this.isEmbed&&K(u,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(t.call(this,"download",u))}m==="fullscreen"&&c.appendChild(t.call(this,"fullscreen",h))}),this.isHTML5&&o.call(this,Re.getQualityOptions.call(this)),a.call(this),c},inject(){if(this.config.loadSprite){const n=E.getIconUrl.call(this);n.cors&&Zs(n.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let s=null;this.elements.controls=null;const e={id:this.id,seektime:this.config.seekTime,title:this.config.title};let t=!0;g.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,e)),this.config.controls||(this.config.controls=[]),g.element(this.config.controls)||g.string(this.config.controls)?s=this.config.controls:(s=E.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:U.getLabel.call(this)}),t=!1);let i;if(t&&g.string(this.config.controls)&&(s=(n=>{let r=n;return Object.entries(e).forEach(([o,a])=>{r=lt(r,`{${o}}`,a)}),r})(s)),g.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),g.element(i)||(i=this.elements.container),i[g.element(s)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",s),g.element(this.elements.controls)||E.findElements.call(this),!g.empty(this.elements.buttons)){const n=r=>{const o=this.config.classNames.controlPressed;r.setAttribute("aria-pressed","false"),Object.defineProperty(r,"pressed",{configurable:!0,enumerable:!0,get:()=>Vt(r,o),set(a=!1){F(r,o,a),r.setAttribute("aria-pressed",a?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(r=>{g.array(r)||g.nodeList(r)?Array.from(r).filter(Boolean).forEach(n):n(r)})}if(ne.isEdge&&Ws(i),this.config.tooltips.controls){const{classNames:n,selectors:r}=this.config,o=`${r.controls.wrapper} ${r.labels} .${n.hidden}`,a=ct.call(this,o);Array.from(a).forEach(l=>{F(l,this.config.classNames.hidden,!1),F(l,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var s,e;if(!this.duration||this.elements.markers)return;const t=(s=this.config.markers)===null||s===void 0||(e=s.points)===null||e===void 0?void 0:e.filter(({time:l})=>l>0&&l<this.duration);if(t==null||!t.length)return;const i=document.createDocumentFragment(),n=document.createDocumentFragment();let r=null;const o=`${this.config.classNames.tooltip}--visible`,a=l=>F(r,o,l);t.forEach(l=>{const c=I("span",{class:this.config.classNames.marker},""),h=l.time/this.duration*100+"%";r&&(c.addEventListener("mouseenter",()=>{l.label||(r.style.left=h,r.innerHTML=l.label,a(!0))}),c.addEventListener("mouseleave",()=>{a(!1)})),c.addEventListener("click",()=>{this.currentTime=l.time}),c.style.left=h,n.appendChild(c)}),i.appendChild(n),this.config.tooltips.seek||(r=I("span",{class:this.config.classNames.tooltip},""),i.appendChild(r)),this.elements.markers={points:n,tip:r},this.elements.progress.appendChild(i)}};function $s(s,e=!0){let t=s;if(e){const i=document.createElement("a");i.href=t,t=i.href}try{return new URL(t)}catch{return null}}function en(s){const e=new URLSearchParams;return g.object(s)&&Object.entries(s).forEach(([t,i])=>{e.set(t,i)}),e}const U={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Z.textTracks)return void(g.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&E.setCaptionsMenu.call(this));if(g.element(this.elements.captions)||(this.elements.captions=I("div",Ce(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Br(this.elements.captions,this.elements.wrapper)),ne.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(n=>{const r=n.getAttribute("src"),o=$s(r);o!==null&&o.hostname!==window.location.href.hostname&&["http:","https:"].includes(o.protocol)&&yt(r,"blob").then(a=>{n.setAttribute("src",window.URL.createObjectURL(a))}).catch(()=>{Ee(n)})})}const s=Ti((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(i=>i.split("-")[0]));let e=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();e==="auto"&&([e]=s);let t=this.storage.get("captions");if(g.boolean(t)||({active:t}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:t,language:e,languages:s}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";V.call(this,this.media.textTracks,i,U.update.bind(this))}setTimeout(U.update.bind(this),0)},update(){const s=U.getTracks.call(this,!0),{active:e,language:t,meta:i,currentTrackNode:n}=this.captions,r=Boolean(s.find(o=>o.language===t));this.isHTML5&&this.isVideo&&s.filter(o=>!i.get(o)).forEach(o=>{this.debug.log("Track added",o),i.set(o,{default:o.mode==="showing"}),o.mode==="showing"&&(o.mode="hidden"),V.call(this,o,"cuechange",()=>U.updateCues.call(this))}),(r&&this.language!==t||!s.includes(n))&&(U.setLanguage.call(this,t),U.toggle.call(this,e&&r)),this.elements&&F(this.elements.container,this.config.classNames.captions.enabled,!g.empty(s)),g.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&E.setCaptionsMenu.call(this)},toggle(s,e=!0){if(!this.supported.ui)return;const{toggled:t}=this.captions,i=this.config.classNames.captions.active,n=g.nullOrUndefined(s)?!t:s;if(n!==t){if(e||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!e){const r=U.getTracks.call(this),o=U.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=o.language,void U.set.call(this,r.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),F(this.elements.container,i,n),this.captions.toggled=n,E.updateSetting.call(this,"captions"),B.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(s,e=!0){const t=U.getTracks.call(this);if(s!==-1)if(g.number(s))if(s in t){if(this.captions.currentTrack!==s){this.captions.currentTrack=s;const i=t[s],{language:n}=i||{};this.captions.currentTrackNode=i,E.updateSetting.call(this,"captions"),e||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),B.call(this,this.media,"languagechange")}U.toggle.call(this,!0,e),this.isHTML5&&this.isVideo&&U.updateCues.call(this)}else this.debug.warn("Track not found",s);else this.debug.warn("Invalid caption argument",s);else U.toggle.call(this,!1,e)},setLanguage(s,e=!0){if(!g.string(s))return void this.debug.warn("Invalid language argument",s);const t=s.toLowerCase();this.captions.language=t;const i=U.getTracks.call(this),n=U.findTrack.call(this,[t]);U.set.call(this,i.indexOf(n),e)},getTracks(s=!1){return Array.from((this.media||{}).textTracks||[]).filter(e=>!this.isHTML5||s||this.captions.meta.has(e)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(s,e=!1){const t=U.getTracks.call(this),i=o=>Number((this.captions.meta.get(o)||{}).default),n=Array.from(t).sort((o,a)=>i(a)-i(o));let r;return s.every(o=>(r=n.find(a=>a.language===o),!r)),r||(e?n[0]:void 0)},getCurrentTrack(){return U.getTracks.call(this)[this.currentTrack]},getLabel(s){let e=s;return!g.track(e)&&Z.textTracks&&this.captions.toggled&&(e=U.getCurrentTrack.call(this)),g.track(e)?g.empty(e.label)?g.empty(e.language)?se.get("enabled",this.config):s.language.toUpperCase():e.label:se.get("disabled",this.config)},updateCues(s){if(!this.supported.ui)return;if(!g.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!g.nullOrUndefined(s)&&!Array.isArray(s))return void this.debug.warn("updateCues: Invalid input",s);let e=s;if(!e){const i=U.getCurrentTrack.call(this);e=Array.from((i||{}).activeCues||[]).map(n=>n.getCueAsHTML()).map(qr)}const t=e.map(i=>i.trim()).join(`
  2. `);if(t!==this.elements.captions.innerHTML){Ot(this.elements.captions);const i=I("span",Ce(this.config.selectors.caption));i.innerHTML=t,this.elements.captions.appendChild(i),B.call(this,this.media,"cuechange")}}},tn={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},ui={active:"picture-in-picture",inactive:"inline"},Be={html5:"html5",youtube:"youtube",vimeo:"vimeo"},di={audio:"audio",video:"video"};function jr(s){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(s)?Be.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(s)?Be.vimeo:null}const mi=()=>{};class Gr{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):mi}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):mi}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):mi}}class ye{constructor(e){k(this,"onChange",()=>{if(!this.supported)return;const t=this.player.elements.buttons.fullscreen;g.element(t)&&(t.pressed=this.active);const i=this.target===this.player.media?this.target:this.player.elements.container;B.call(this.player,i,this.active?"enterfullscreen":"exitfullscreen",!0)}),k(this,"toggleFallback",(t=!1)=>{var i,n;if(t?this.scrollPosition={x:(i=window.scrollX)!=null?i:0,y:(n=window.scrollY)!=null?n:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",F(this.target,this.player.config.classNames.fullscreen.fallback,t),ne.isIos){let r=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";r||(r=document.createElement("meta"),r.setAttribute("name","viewport"));const a=g.string(r.content)&&r.content.includes(o);t?(this.cleanupViewport=!a,a||(r.content+=`,${o}`)):this.cleanupViewport&&(r.content=r.content.split(",").filter(l=>l.trim()!==o).join(","))}this.onChange()}),k(this,"trapFocus",t=>{if(ne.isIos||ne.isIPadOS||!this.active||t.key!=="Tab")return;const i=document.activeElement,n=ct.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[r]=n,o=n[n.length-1];i!==o||t.shiftKey?i===r&&t.shiftKey&&(o.focus(),t.preventDefault()):(r.focus(),t.preventDefault())}),k(this,"update",()=>{if(this.supported){let t;t=this.forceFallback?"Fallback (forced)":ye.nativeSupported?"Native":"Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");F(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),k(this,"enter",()=>{this.supported&&(ne.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!ye.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?g.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),k(this,"exit",()=>{if(this.supported)if(ne.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),Te(this.player.play());else if(!ye.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!g.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),k(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=e,this.prefix=ye.prefix,this.property=ye.property,this.scrollPosition={x:0,y:0},this.forceFallback=e.config.fullscreen.fallback==="force",this.player.elements.fullscreen=e.config.fullscreen.container&&Rr(this.player.elements.container,e.config.fullscreen.container),V.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),V.call(this.player,this.player.elements.container,"dblclick",t=>{g.element(this.player.elements.controls)&&this.player.elements.controls.contains(t.target)||this.player.listeners.proxy(t,this.toggle,"fullscreen")}),V.call(this,this.player.elements.container,"keydown",t=>this.trapFocus(t)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return ye.nativeSupported&&!this.forceFallback}static get prefix(){if(g.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some(t=>!(!g.function(document[`${t}ExitFullscreen`])&&!g.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,ye.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||ye.nativeSupported||!ne.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!ye.nativeSupported||this.forceFallback)return Vt(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return ne.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(e=this.player.elements.fullscreen)!=null?e:this.player.elements.container}}function It(s,e=1){return new Promise((t,i)=>{const n=new Image,r=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=e?t:i)(n)};Object.assign(n,{onload:r,onerror:r,src:s})})}const Q={addStyleHook(){F(this.elements.container,this.config.selectors.container.replace(".",""),!0),F(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(s=!1){s&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Q.toggleNativeControls.call(this,!0);g.element(this.elements.controls)||(E.inject.call(this),this.listeners.controls()),Q.toggleNativeControls.call(this),this.isHTML5&&U.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,E.updateVolume.call(this),E.timeUpdate.call(this),E.durationUpdate.call(this),Q.checkPlaying.call(this),F(this.elements.container,this.config.classNames.pip.supported,Z.pip&&this.isHTML5&&this.isVideo),F(this.elements.container,this.config.classNames.airplay.supported,Z.airplay&&this.isHTML5),F(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{B.call(this,this.media,"ready")},0),Q.setTitle.call(this),this.poster&&Q.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&E.durationUpdate.call(this),this.config.mediaMetadata&&E.setMediaMetadata.call(this)},setTitle(){let s=se.get("play",this.config);if(g.string(this.config.title)&&!g.empty(this.config.title)&&(s+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(e=>{e.setAttribute("aria-label",s)}),this.isEmbed){const e=te.call(this,"iframe");if(!g.element(e))return;const t=g.empty(this.config.title)?"video":this.config.title,i=se.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(s){F(this.elements.container,this.config.classNames.posterEnabled,s)},setPoster(s,e=!0){return e&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",s),this.elements.poster.removeAttribute("hidden"),Dr.call(this).then(()=>It(s)).catch(t=>{throw s===this.poster&&Q.togglePoster.call(this,!1),t}).then(()=>{if(s!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${s}')`,backgroundSize:""}),Q.togglePoster.call(this,!0),s)))},checkPlaying(s){F(this.elements.container,this.config.classNames.playing,this.playing),F(this.elements.container,this.config.classNames.paused,this.paused),F(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",se.get(this.playing?"pause":"play",this.config))}),g.event(s)&&s.type==="timeupdate"||Q.toggleControls.call(this)},checkLoading(s){this.loading=["stalled","waiting"].includes(s.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{F(this.elements.container,this.config.classNames.loading,this.loading),Q.toggleControls.call(this)},this.loading?250:0)},toggleControls(s){const{controls:e}=this.elements;if(e&&this.config.hideControls){const t=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(s||this.loading||this.paused||e.pressed||e.hover||t))}},migrateStyles(){Object.values({...this.media.style}).filter(s=>!g.empty(s)&&g.string(s)&&s.startsWith("--plyr")).forEach(s=>{this.elements.container.style.setProperty(s,this.media.style.getPropertyValue(s)),this.media.style.removeProperty(s)}),g.empty(this.media.style)&&this.media.removeAttribute("style")}};class Jr{constructor(e){k(this,"firstTouch",()=>{const{player:t}=this,{elements:i}=t;t.touch=!0,F(i.container,t.config.classNames.isTouch,!0)}),k(this,"global",(t=!0)=>{const{player:i}=this;i.config.keyboard.global&&ht.call(i,window,"keydown keyup",this.handleKey,t,!1),ht.call(i,document.body,"click",this.toggleMenu,t),Ri.call(i,document.body,"touchstart",this.firstTouch)}),k(this,"container",()=>{const{player:t}=this,{config:i,elements:n,timers:r}=t;!i.keyboard.global&&i.keyboard.focused&&V.call(t,n.container,"keydown keyup",this.handleKey,!1),V.call(t,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",l=>{const{controls:c}=n;c&&l.type==="enterfullscreen"&&(c.pressed=!1,c.hover=!1);let h=0;["touchstart","touchmove","mousemove"].includes(l.type)&&(Q.toggleControls.call(t,!0),h=t.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>Q.toggleControls.call(t,!1),h)});const o=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const l=n.wrapper,{active:c}=t.fullscreen,[h,m]=Li.call(t),u=js(`aspect-ratio: ${h} / ${m}`);if(!c)return void(u?(l.style.width=null,l.style.height=null):(l.style.maxWidth=null,l.style.margin=null));const[d,p]=Ur(),f=d/p>h/m;u?(l.style.width=f?"auto":"100%",l.style.height=f?"100%":"auto"):(l.style.maxWidth=f?p/m*h+"px":null,l.style.margin=f?"0 auto":null)},a=()=>{clearTimeout(r.resized),r.resized=setTimeout(o,50)};V.call(t,n.container,"enterfullscreen exitfullscreen",l=>{const{target:c}=t.fullscreen;c===n.container&&(!t.isEmbed&&g.empty(t.config.ratio)||(o(),(l.type==="enterfullscreen"?V:Ft).call(t,window,"resize",a)))})}),k(this,"media",()=>{const{player:t}=this,{elements:i}=t;if(V.call(t,t.media,"timeupdate seeking seeked",r=>E.timeUpdate.call(t,r)),V.call(t,t.media,"durationchange loadeddata loadedmetadata",r=>E.durationUpdate.call(t,r)),V.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),V.call(t,t.media,"progress playing seeking seeked",r=>E.updateProgress.call(t,r)),V.call(t,t.media,"volumechange",r=>E.updateVolume.call(t,r)),V.call(t,t.media,"playing play pause ended emptied timeupdate",r=>Q.checkPlaying.call(t,r)),V.call(t,t.media,"waiting canplay seeked playing",r=>Q.checkLoading.call(t,r)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const r=te.call(t,`.${t.config.classNames.video}`);if(!g.element(r))return;V.call(t,i.container,"click",o=>{([i.container,r].includes(o.target)||r.contains(o.target))&&(t.touch&&t.config.hideControls||(t.ended?(this.proxy(o,t.restart,"restart"),this.proxy(o,()=>{Te(t.play())},"play")):this.proxy(o,()=>{Te(t.togglePlay())},"play")))})}t.supported.ui&&t.config.disableContextMenu&&V.call(t,i.wrapper,"contextmenu",r=>{r.preventDefault()},!1),V.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),V.call(t,t.media,"ratechange",()=>{E.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),V.call(t,t.media,"qualitychange",r=>{E.updateSetting.call(t,"quality",null,r.detail.quality)}),V.call(t,t.media,"ready qualitychange",()=>{E.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");V.call(t,t.media,n,r=>{let{detail:o={}}=r;r.type==="error"&&(o=t.media.error),B.call(t,i.container,r.type,!0,o)})}),k(this,"proxy",(t,i,n)=>{const{player:r}=this,o=r.config.listeners[n];let a=!0;g.function(o)&&(a=o.call(r,t)),a!==!1&&g.function(i)&&i.call(r,t)}),k(this,"bind",(t,i,n,r,o=!0)=>{const{player:a}=this,l=a.config.listeners[r],c=g.function(l);V.call(a,t,i,h=>this.proxy(h,n,r),o&&!c)}),k(this,"controls",()=>{const{player:t}=this,{elements:i}=t,n=ne.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach(r=>{this.bind(r,"click",()=>{Te(t.togglePlay())},"play")}),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",()=>{t.lastSeekTime=Date.now(),t.rewind()},"rewind"),this.bind(i.buttons.fastForward,"click",()=>{t.lastSeekTime=Date.now(),t.forward()},"fastForward"),this.bind(i.buttons.mute,"click",()=>{t.muted=!t.muted},"mute"),this.bind(i.buttons.captions,"click",()=>t.toggleCaptions()),this.bind(i.buttons.download,"click",()=>{B.call(t,t.media,"download")},"download"),this.bind(i.buttons.fullscreen,"click",()=>{t.fullscreen.toggle()},"fullscreen"),this.bind(i.buttons.pip,"click",()=>{t.pip="toggle"},"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",r=>{r.stopPropagation(),r.preventDefault(),E.toggleMenu.call(t,r)},null,!1),this.bind(i.buttons.settings,"keyup",r=>{[" ","Enter"].includes(r.key)&&(r.key!=="Enter"?(r.preventDefault(),r.stopPropagation(),E.toggleMenu.call(t,r)):E.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(i.settings.menu,"keydown",r=>{r.key==="Escape"&&E.toggleMenu.call(t,r)}),this.bind(i.inputs.seek,"mousedown mousemove",r=>{const o=i.progress.getBoundingClientRect(),a=100/o.width*(r.pageX-o.left);r.currentTarget.setAttribute("seek-value",a)}),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",r=>{const o=r.currentTarget,a="play-on-seeked";if(g.keyboardEvent(r)&&!["ArrowLeft","ArrowRight"].includes(r.key))return;t.lastSeekTime=Date.now();const l=o.hasAttribute(a),c=["mouseup","touchend","keyup"].includes(r.type);l&&c?(o.removeAttribute(a),Te(t.play())):!c&&t.playing&&(o.setAttribute(a,""),t.pause())}),ne.isIos){const r=ct.call(t,'input[type="range"]');Array.from(r).forEach(o=>this.bind(o,n,a=>Ws(a.target)))}this.bind(i.inputs.seek,n,r=>{const o=r.currentTarget;let a=o.getAttribute("seek-value");g.empty(a)&&(a=o.value),o.removeAttribute("seek-value"),t.currentTime=a/o.max*t.duration},"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",r=>E.updateSeekTooltip.call(t,r)),this.bind(i.progress,"mousemove touchmove",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startMove(r)}),this.bind(i.progress,"mouseleave touchend click",()=>{const{previewThumbnails:r}=t;r&&r.loaded&&r.endMove(!1,!0)}),this.bind(i.progress,"mousedown touchstart",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startScrubbing(r)}),this.bind(i.progress,"mouseup touchend",r=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.endScrubbing(r)}),ne.isWebKit&&Array.from(ct.call(t,'input[type="range"]')).forEach(r=>{this.bind(r,"input",o=>E.updateRangeFill.call(t,o.target))}),t.config.toggleInvert&&!g.element(i.display.duration)&&this.bind(i.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,E.timeUpdate.call(t))}),this.bind(i.inputs.volume,n,r=>{t.volume=r.target.value},"volume"),this.bind(i.controls,"mouseenter mouseleave",r=>{i.controls.hover=!t.touch&&r.type==="mouseenter"}),i.fullscreen&&Array.from(i.fullscreen.children).filter(r=>!r.contains(i.container)).forEach(r=>{this.bind(r,"mouseenter mouseleave",o=>{i.controls&&(i.controls.hover=!t.touch&&o.type==="mouseenter")})}),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",r=>{i.controls.pressed=["mousedown","touchstart"].includes(r.type)}),this.bind(i.controls,"focusin",()=>{const{config:r,timers:o}=t;F(i.controls,r.classNames.noTransition,!0),Q.toggleControls.call(t,!0),setTimeout(()=>{F(i.controls,r.classNames.noTransition,!1)},0);const a=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>Q.toggleControls.call(t,!1),a)}),this.bind(i.inputs.volume,"wheel",r=>{const o=r.webkitDirectionInvertedFromDevice,[a,l]=[r.deltaX,-r.deltaY].map(m=>o?-m:m),c=Math.sign(Math.abs(a)>Math.abs(l)?a:l);t.increaseVolume(c/50);const{volume:h}=t.media;(c===1&&h<1||c===-1&&h>0)&&r.preventDefault()},"volume",!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:n,type:r,altKey:o,ctrlKey:a,metaKey:l,shiftKey:c}=e,h=r==="keydown",m=h&&n===this.lastKey;if(!(o||a||l||c)&&!!n){if(h){const d=document.activeElement;if(g.element(d)){const{editable:p}=t.config.selectors,{seek:f}=i.inputs;if(d!==f&&qe(d,p)||e.key===" "&&qe(d,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":m||(u=parseInt(n,10),t.currentTime=t.duration/10*u);break;case" ":case"k":m||Te(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":m||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":m||t.toggleCaptions();break;case"l":t.loop=!t.loop}n==="Escape"&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null;var u}}toggleMenu(e){E.toggleMenu.call(this.player,e)}}function Kr(s,e){return s(e={exports:{}},e.exports),e.exports}var Zr=Kr(function(s,e){s.exports=function(){var t=function(){},i={},n={},r={};function o(u,d){u=u.push?u:[u];var p,f,y,b=[],v=u.length,C=v;for(p=function(S,w){w.length&&b.push(S),--C||d(b)};v--;)f=u[v],(y=n[f])?p(f,y):(r[f]=r[f]||[]).push(p)}function a(u,d){if(u){var p=r[u];if(n[u]=d,p)for(;p.length;)p[0](u,d),p.splice(0,1)}}function l(u,d){u.call&&(u={success:u}),d.length?(u.error||t)(d):(u.success||t)(u)}function c(u,d,p,f){var y,b,v=document,C=p.async,S=(p.numRetries||0)+1,w=p.before||t,x=u.replace(/[\?|#].*$/,""),A=u.replace(/^(css|img)!/,"");f=f||0,/(^css!|\.css$)/.test(x)?((b=v.createElement("link")).rel="stylesheet",b.href=A,(y="hideFocus"in b)&&b.relList&&(y=0,b.rel="preload",b.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(x)?(b=v.createElement("img")).src=A:((b=v.createElement("script")).src=u,b.async=C===void 0||C),b.onload=b.onerror=b.onbeforeload=function(P){var M=P.type[0];if(y)try{b.sheet.cssText.length||(M="e")}catch(L){L.code!=18&&(M="e")}if(M=="e"){if((f+=1)<S)return c(u,d,p,f)}else if(b.rel=="preload"&&b.as=="style")return b.rel="stylesheet";d(u,M,P.defaultPrevented)},w(u,b)!==!1&&v.head.appendChild(b)}function h(u,d,p){var f,y,b=(u=u.push?u:[u]).length,v=b,C=[];for(f=function(S,w,x){if(w=="e"&&C.push(S),w=="b"){if(!x)return;C.push(S)}--b||d(C)},y=0;y<v;y++)c(u[y],f,p)}function m(u,d,p){var f,y;if(d&&d.trim&&(f=d),y=(f?p:d)||{},f){if(f in i)throw"LoadJS";i[f]=!0}function b(v,C){h(u,function(S){l(y,S),v&&l({success:v,error:C},S),a(f,S)},y)}if(y.returnPromise)return new Promise(b);b()}return m.ready=function(u,d){return o(u,function(p){l(d,p)}),m},m.done=function(u){a(u,[])},m.reset=function(){i={},n={},r={}},m.isDefined=function(u){return u in i},m}()});function Vi(s){return new Promise((e,t)=>{Zr(s,{success:e,error:t})})}function _r(s){return g.empty(s)?null:g.number(Number(s))?s:s.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:s}function $r(s){const e=s.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return e&&e.length===5?e[4]:null}function st(s){s&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===s&&(this.media.paused=!s,B.call(this,this.media,s?"play":"pause"))}const Si={setup(){const s=this;F(s.elements.wrapper,s.config.classNames.embed,!0),s.options.speed=s.config.speed.options,$e.call(s),g.object(window.Vimeo)?Si.ready.call(s):Vi(s.config.urls.vimeo.sdk).then(()=>{Si.ready.call(s)}).catch(e=>{s.debug.warn("Vimeo SDK (player.js) failed to load",e)})},ready(){const s=this,e=s.config.vimeo,{premium:t,referrerPolicy:i,...n}=e;let r=s.media.getAttribute("src"),o="";g.empty(r)?(r=s.media.getAttribute(s.config.attributes.embed.id),o=s.media.getAttribute(s.config.attributes.embed.hash)):o=$r(r);const a=o?{h:o}:{};t&&Object.assign(n,{controls:!1,sidedock:!1});const l=en({loop:s.config.loop.active,autoplay:s.autoplay,muted:s.muted,gesture:"media",playsinline:s.config.playsinline,...a,...n}),c=_r(r),h=I("iframe"),m=xi(s.config.urls.vimeo.iframe,c,l);if(h.setAttribute("src",m),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),g.empty(i)||h.setAttribute("referrerPolicy",i),t||!e.customControls)h.setAttribute("data-poster",s.poster),s.media=Lt(h,s.media);else{const v=I("div",{class:s.config.classNames.embedContainer,"data-poster":s.poster});v.appendChild(h),s.media=Lt(v,s.media)}e.customControls||yt(xi(s.config.urls.vimeo.api,m)).then(v=>{!g.empty(v)&&v.thumbnail_url&&Q.setPoster.call(s,v.thumbnail_url).catch(()=>{})}),s.embed=new window.Vimeo.Player(h,{autopause:s.config.autopause,muted:s.muted}),s.media.paused=!0,s.media.currentTime=0,s.supported.ui&&s.embed.disableTextTrack(),s.media.play=()=>(st.call(s,!0),s.embed.play()),s.media.pause=()=>(st.call(s,!1),s.embed.pause()),s.media.stop=()=>{s.pause(),s.currentTime=0};let{currentTime:u}=s.media;Object.defineProperty(s.media,"currentTime",{get:()=>u,set(v){const{embed:C,media:S,paused:w,volume:x}=s,A=w&&!C.hasPlayed;S.seeking=!0,B.call(s,S,"seeking"),Promise.resolve(A&&C.setVolume(0)).then(()=>C.setCurrentTime(v)).then(()=>A&&C.pause()).then(()=>A&&C.setVolume(x)).catch(()=>{})}});let d=s.config.speed.selected;Object.defineProperty(s.media,"playbackRate",{get:()=>d,set(v){s.embed.setPlaybackRate(v).then(()=>{d=v,B.call(s,s.media,"ratechange")}).catch(()=>{s.options.speed=[1]})}});let{volume:p}=s.config;Object.defineProperty(s.media,"volume",{get:()=>p,set(v){s.embed.setVolume(v).then(()=>{p=v,B.call(s,s.media,"volumechange")})}});let{muted:f}=s.config;Object.defineProperty(s.media,"muted",{get:()=>f,set(v){const C=!!g.boolean(v)&&v;s.embed.setMuted(!!C||s.config.muted).then(()=>{f=C,B.call(s,s.media,"volumechange")})}});let y,{loop:b}=s.config;Object.defineProperty(s.media,"loop",{get:()=>b,set(v){const C=g.boolean(v)?v:s.config.loop.active;s.embed.setLoop(C).then(()=>{b=C})}}),s.embed.getVideoUrl().then(v=>{y=v,E.setDownloadUrl.call(s)}).catch(v=>{this.debug.warn(v)}),Object.defineProperty(s.media,"currentSrc",{get:()=>y}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration}),Promise.all([s.embed.getVideoWidth(),s.embed.getVideoHeight()]).then(v=>{const[C,S]=v;s.embed.ratio=Js(C,S),$e.call(this)}),s.embed.setAutopause(s.config.autopause).then(v=>{s.config.autopause=v}),s.embed.getVideoTitle().then(v=>{s.config.title=v,Q.setTitle.call(this)}),s.embed.getCurrentTime().then(v=>{u=v,B.call(s,s.media,"timeupdate")}),s.embed.getDuration().then(v=>{s.media.duration=v,B.call(s,s.media,"durationchange")}),s.embed.getTextTracks().then(v=>{s.media.textTracks=v,U.setup.call(s)}),s.embed.on("cuechange",({cues:v=[]})=>{const C=v.map(S=>Wr(S.text));U.updateCues.call(s,C)}),s.embed.on("loaded",()=>{s.embed.getPaused().then(v=>{st.call(s,!v),v||B.call(s,s.media,"playing")}),g.element(s.embed.element)&&s.supported.ui&&s.embed.element.setAttribute("tabindex",-1)}),s.embed.on("bufferstart",()=>{B.call(s,s.media,"waiting")}),s.embed.on("bufferend",()=>{B.call(s,s.media,"playing")}),s.embed.on("play",()=>{st.call(s,!0),B.call(s,s.media,"playing")}),s.embed.on("pause",()=>{st.call(s,!1)}),s.embed.on("timeupdate",v=>{s.media.seeking=!1,u=v.seconds,B.call(s,s.media,"timeupdate")}),s.embed.on("progress",v=>{s.media.buffered=v.percent,B.call(s,s.media,"progress"),parseInt(v.percent,10)===1&&B.call(s,s.media,"canplaythrough"),s.embed.getDuration().then(C=>{C!==s.media.duration&&(s.media.duration=C,B.call(s,s.media,"durationchange"))})}),s.embed.on("seeked",()=>{s.media.seeking=!1,B.call(s,s.media,"seeked")}),s.embed.on("ended",()=>{s.media.paused=!0,B.call(s,s.media,"ended")}),s.embed.on("error",v=>{s.media.error=v,B.call(s,s.media,"error")}),e.customControls&&setTimeout(()=>Q.build.call(s),0)}};function ea(s){return g.empty(s)?null:s.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:s}function nt(s){s&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===s&&(this.media.paused=!s,B.call(this,this.media,s?"play":"pause"))}function ta(s){return s.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const Bt={setup(){if(F(this.elements.wrapper,this.config.classNames.embed,!0),g.object(window.YT)&&g.function(window.YT.Player))Bt.ready.call(this);else{const s=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{g.function(s)&&s(),Bt.ready.call(this)},Vi(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(s){yt(xi(this.config.urls.youtube.api,s)).then(e=>{if(g.object(e)){const{title:t,height:i,width:n}=e;this.config.title=t,Q.setTitle.call(this),this.embed.ratio=Js(n,i)}$e.call(this)}).catch(()=>{$e.call(this)})},ready(){const s=this,e=s.config.youtube,t=s.media&&s.media.getAttribute("id");if(!g.empty(t)&&t.startsWith("youtube-"))return;let i=s.media.getAttribute("src");g.empty(i)&&(i=s.media.getAttribute(this.config.attributes.embed.id));const n=ea(i),r=I("div",{id:Fr(s.provider),"data-poster":e.customControls?s.poster:void 0});if(s.media=Lt(r,s.media),e.customControls){const o=a=>`https://i.ytimg.com/vi/${n}/${a}default.jpg`;It(o("maxres"),121).catch(()=>It(o("sd"),121)).catch(()=>It(o("hq"))).then(a=>Q.setPoster.call(s,a.src)).then(a=>{a.includes("maxres")||(s.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}s.embed=new window.YT.Player(s.media,{videoId:n,host:ta(e),playerVars:K({},{autoplay:s.config.autoplay?1:0,hl:s.config.hl,controls:s.supported.ui&&e.customControls?0:1,disablekb:1,playsinline:s.config.playsinline&&!s.config.fullscreen.iosNative?1:0,cc_load_policy:s.captions.active?1:0,cc_lang_pref:s.config.captions.language,widget_referrer:window?window.location.href:null},e),events:{onError(o){if(!s.media.error){const a=o.data,l={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[a]||"An unknown error occurred";s.media.error={code:a,message:l},B.call(s,s.media,"error")}},onPlaybackRateChange(o){const a=o.target;s.media.playbackRate=a.getPlaybackRate(),B.call(s,s.media,"ratechange")},onReady(o){if(g.function(s.media.play))return;const a=o.target;Bt.getTitle.call(s,n),s.media.play=()=>{nt.call(s,!0),a.playVideo()},s.media.pause=()=>{nt.call(s,!1),a.pauseVideo()},s.media.stop=()=>{a.stopVideo()},s.media.duration=a.getDuration(),s.media.paused=!0,s.media.currentTime=0,Object.defineProperty(s.media,"currentTime",{get:()=>Number(a.getCurrentTime()),set(m){s.paused&&!s.embed.hasPlayed&&s.embed.mute(),s.media.seeking=!0,B.call(s,s.media,"seeking"),a.seekTo(m)}}),Object.defineProperty(s.media,"playbackRate",{get:()=>a.getPlaybackRate(),set(m){a.setPlaybackRate(m)}});let{volume:l}=s.config;Object.defineProperty(s.media,"volume",{get:()=>l,set(m){l=m,a.setVolume(100*l),B.call(s,s.media,"volumechange")}});let{muted:c}=s.config;Object.defineProperty(s.media,"muted",{get:()=>c,set(m){const u=g.boolean(m)?m:c;c=u,a[u?"mute":"unMute"](),a.setVolume(100*l),B.call(s,s.media,"volumechange")}}),Object.defineProperty(s.media,"currentSrc",{get:()=>a.getVideoUrl()}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration});const h=a.getAvailablePlaybackRates();s.options.speed=h.filter(m=>s.config.speed.options.includes(m)),s.supported.ui&&e.customControls&&s.media.setAttribute("tabindex",-1),B.call(s,s.media,"timeupdate"),B.call(s,s.media,"durationchange"),clearInterval(s.timers.buffering),s.timers.buffering=setInterval(()=>{s.media.buffered=a.getVideoLoadedFraction(),(s.media.lastBuffered===null||s.media.lastBuffered<s.media.buffered)&&B.call(s,s.media,"progress"),s.media.lastBuffered=s.media.buffered,s.media.buffered===1&&(clearInterval(s.timers.buffering),B.call(s,s.media,"canplaythrough"))},200),e.customControls&&setTimeout(()=>Q.build.call(s),50)},onStateChange(o){const a=o.target;switch(clearInterval(s.timers.playing),s.media.seeking&&[1,2].includes(o.data)&&(s.media.seeking=!1,B.call(s,s.media,"seeked")),o.data){case-1:B.call(s,s.media,"timeupdate"),s.media.buffered=a.getVideoLoadedFraction(),B.call(s,s.media,"progress");break;case 0:nt.call(s,!1),s.media.loop?(a.stopVideo(),a.playVideo()):B.call(s,s.media,"ended");break;case 1:e.customControls&&!s.config.autoplay&&s.media.paused&&!s.embed.hasPlayed?s.media.pause():(nt.call(s,!0),B.call(s,s.media,"playing"),s.timers.playing=setInterval(()=>{B.call(s,s.media,"timeupdate")},50),s.media.duration!==a.getDuration()&&(s.media.duration=a.getDuration(),B.call(s,s.media,"durationchange")));break;case 2:s.muted||s.embed.unMute(),nt.call(s,!1);break;case 3:B.call(s,s.media,"waiting")}B.call(s,s.elements.container,"statechange",!1,{code:o.data})}}})}},sn={setup(){this.media?(F(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),F(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&F(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=I("div",{class:this.config.classNames.video}),Ys(this.media,this.elements.wrapper),this.elements.poster=I("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Re.setup.call(this):this.isYouTube?Bt.setup.call(this):this.isVimeo&&Si.setup.call(this)):this.debug.warn("No media element found!")}};class ia{constructor(e){k(this,"load",()=>{this.enabled&&(g.object(window.google)&&g.object(window.google.ima)?this.ready():Vi(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),k(this,"ready",()=>{var t;this.enabled||((t=this).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),k(this,"setupIMA",()=>{this.elements.container=I("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t=>this.onAdsManagerLoaded(t),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t=>this.onAdError(t),!1),this.requestAds()}),k(this,"requestAds",()=>{const{container:t}=this.player.elements;try{const i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=t.offsetWidth,i.linearAdSlotHeight=t.offsetHeight,i.nonLinearAdSlotWidth=t.offsetWidth,i.nonLinearAdSlotHeight=t.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(i){this.onAdError(i)}}),k(this,"pollCountdown",(t=!1)=>{if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const i=zt(Math.max(this.manager.getRemainingTime(),0)),n=`${se.get("advertisement",this.player.config)} - ${i}`;this.elements.container.setAttribute("data-badge-text",n)},100)}),k(this,"onAdsManagerLoaded",t=>{if(!this.enabled)return;const i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=t.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,n=>this.onAdError(n)),Object.keys(google.ima.AdEvent.Type).forEach(n=>{this.manager.addEventListener(google.ima.AdEvent.Type[n],r=>this.onAdEvent(r))}),this.trigger("loaded")}),k(this,"addCuePoints",()=>{g.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t<this.player.duration){const i=this.player.elements.progress;if(g.element(i)){const n=100/this.player.duration*t,r=I("span",{class:this.player.config.classNames.cues});r.style.left=`${n.toString()}%`,i.appendChild(r)}}})}),k(this,"onAdEvent",t=>{const{container:i}=this.player.elements,n=t.getAd(),r=t.getAdData();switch((o=>{B.call(this.player,this.player.media,`ads${o.replace(/_/g,"").toLowerCase()}`)})(t.type),t.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`)}}),k(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)}),k(this,"listeners",()=>{const{container:t}=this.player.elements;let i;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{i=this.player.currentTime}),this.player.on("seeked",()=>{const n=this.player.currentTime;g.empty(this.cuePoints)||this.cuePoints.forEach((r,o)=>{i<r&&r<n&&(this.manager.discardAdBreak(),this.cuePoints.splice(o,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}),k(this,"play",()=>{const{container:t}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(i){this.onAdError(i)}}).catch(()=>{})}),k(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,Te(this.player.media.play())}),k(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),k(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),k(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(t=>{this.on("loaded",t),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),k(this,"trigger",(t,...i)=>{const n=this.events[t];g.array(n)&&n.forEach(r=>{g.function(r)&&r.apply(this,i)})}),k(this,"on",(t,i)=>(g.array(this.events[t])||(this.events[t]=[]),this.events[t].push(i),this)),k(this,"startSafetyTimer",(t,i)=>{this.player.debug.log(`Safety timer invoked from: ${i}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)}),k(this,"clearSafetyTimer",t=>{g.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${t}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((t,i)=>{this.on("loaded",t),this.on("error",i)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!g.empty(e.publisherId)||g.url(e.tagUrl))}get tagUrl(){const{config:e}=this;return g.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${en({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function nn(s=0,e=0,t=255){return Math.min(Math.max(s,e),t)}const sa=s=>{const e=[];return s.split(/\r\n\r\n|\n\n|\r\r/).forEach(t=>{const i={};t.split(/\r\n|\n|\r/).forEach(n=>{if(g.number(i.startTime)){if(!g.empty(n.trim())&&g.empty(i.text)){const r=n.trim().split("#xywh=");[i.text]=r,r[1]&&([i.x,i.y,i.w,i.h]=r[1].split(","))}}else{const r=n.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);r&&(i.startTime=60*Number(r[1]||0)*60+60*Number(r[2])+Number(r[3])+Number(`0.${r[4]}`),i.endTime=60*Number(r[6]||0)*60+60*Number(r[7])+Number(r[8])+Number(`0.${r[9]}`))}}),i.text&&e.push(i)}),e},as=(s,e)=>{const t={};return s>e.width/e.height?(t.width=e.width,t.height=1/s*e.width):(t.height=e.height,t.width=s*e.height),t};class Ei{constructor(e){k(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),k(this,"getThumbnails",()=>new Promise(t=>{const{src:i}=this.player.config.previewThumbnails;if(g.empty(i))throw new Error("Missing previewThumbnails.src config attribute");const n=()=>{this.thumbnails.sort((r,o)=>r.height-o.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(g.function(i))i(r=>{this.thumbnails=r,n()});else{const r=(g.string(i)?[i]:i).map(o=>this.getThumbnail(o));Promise.all(r).then(n)}})),k(this,"getThumbnail",t=>new Promise(i=>{yt(t).then(n=>{const r={frames:sa(n),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const o=new Image;o.onload=()=>{r.height=o.naturalHeight,r.width=o.naturalWidth,this.thumbnails.push(r),i()},o.src=r.urlPrefix+r.frames[0].text})})),k(this,"startMove",t=>{if(this.loaded&&g.event(t)&&["touchmove","mousemove"].includes(t.type)&&this.player.media.duration){if(t.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var i,n;const r=this.player.elements.progress.getBoundingClientRect(),o=100/r.width*(t.pageX-r.left);this.seekTime=this.player.media.duration*(o/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=t.pageX,this.elements.thumb.time.innerText=zt(this.seekTime);const a=(i=this.player.config.markers)===null||i===void 0||(n=i.points)===null||n===void 0?void 0:n.find(({time:l})=>l===Math.round(this.seekTime));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}}),k(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),k(this,"startScrubbing",t=>{(g.nullOrUndefined(t.button)||t.button===!1||t.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),k(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ri.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),k(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),k(this,"render",()=>{this.elements.thumb.container=I("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=I("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=I("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=I("span",{},"00:00"),t.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(t),g.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=I("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),k(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),k(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const t=this.thumbnails[0].frames.findIndex(r=>this.seekTime>=r.startTime&&this.seekTime<=r.endTime),i=t>=0;let n=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((r,o)=>{this.loadedImages.includes(r.frames[t].text)&&(n=o)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}),k(this,"loadImage",(t=0)=>{const i=this.showingThumb,n=this.thumbnails[t],{urlPrefix:r}=n,o=n.frames[i],a=n.frames[i].text,l=r+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,o,t,i,a,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const c=new Image;c.src=l,c.dataset.index=i,c.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),c.onload=()=>this.showImage(c,o,t,i,a,!0),this.loadingImage=c,this.removeOldImages(c)}}),k(this,"showImage",(t,i,n,r,o,a=!0)=>{this.player.debug.log(`Showing thumb: ${o}. num: ${r}. qual: ${n}. newimg: ${a}`),this.setImageSizeAndOffset(t,i),a&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(o)||this.loadedImages.push(o)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(n,t,i,o))}),k(this,"removeOldImages",t=>{Array.from(this.currentImageContainer.children).forEach(i=>{if(i.tagName.toLowerCase()!=="img")return;const n=this.usingSprites?500:1e3;if(i.dataset.index!==t.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;const{currentImageContainer:r}=this;setTimeout(()=>{r.removeChild(i),this.player.debug.log(`Removing thumb: ${i.dataset.filename}`)},n)}})}),k(this,"preloadNearby",(t,i=!0)=>new Promise(n=>{setTimeout(()=>{const r=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===r){let o;o=i?this.thumbnails[0].frames.slice(t):this.thumbnails[0].frames.slice(0,t).reverse();let a=!1;o.forEach(l=>{const c=l.text;if(c!==r&&!this.loadedImages.includes(c)){a=!0,this.player.debug.log(`Preloading thumb filename: ${c}`);const{urlPrefix:h}=this.thumbnails[0],m=h+c,u=new Image;u.src=m,u.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${c}`),this.loadedImages.includes(c)||this.loadedImages.push(c),n()}}}),a||n()}},300)})),k(this,"getHigherQuality",(t,i,n,r)=>{if(t<this.thumbnails.length-1){let o=i.naturalHeight;this.usingSprites&&(o=n.h),o<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(t+1))},300)}}),k(this,"toggleThumbContainer",(t=!1,i=!1)=>{const n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,t),!t&&i&&(this.showingThumb=null,this.showingThumbFilename=null)}),k(this,"toggleScrubbingContainer",(t=!1)=>{const i=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(i,t),t||(this.showingThumb=null,this.showingThumbFilename=null)}),k(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),k(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:t}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(t.clientHeight>20&&t.clientWidth<20){const i=Math.floor(t.clientHeight*this.thumbAspectRatio);t.style.width=`${i}px`}else if(t.clientHeight<20&&t.clientWidth>20){const i=Math.floor(t.clientWidth/this.thumbAspectRatio);t.style.height=`${i}px`}}else{const i=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);t.style.height=`${this.thumbContainerHeight}px`,t.style.width=`${i}px`}this.setThumbContainerPos()}),k(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),i=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,r=i.left-t.left+10,o=i.right-t.left-n.clientWidth-10,a=this.mousePosX-t.left-n.clientWidth/2,l=nn(a,r,o);n.style.left=`${l}px`,n.style.setProperty("--preview-arrow-offset",a-l+"px")}),k(this,"setScrubbingContainerSize",()=>{const{width:t,height:i}=as(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${t}px`,this.elements.scrubbing.container.style.height=`${i}px`}),k(this,"setImageSizeAndOffset",(t,i)=>{if(!this.usingSprites)return;const n=this.thumbContainerHeight/i.h;t.style.height=t.naturalHeight*n+"px",t.style.width=t.naturalWidth*n+"px",t.style.left=`-${i.x*n}px`,t.style.top=`-${i.y*n}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=as(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const ki={insertElements(s,e){g.string(e)?is(s,this.media,{src:e}):g.array(e)&&e.forEach(t=>{is(s,this.media,t)})},change(s){qs(s,"sources.length")?(Re.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],Ee(this.media),this.media=null,g.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:e,type:t}=s,[{provider:i=Be.html5,src:n}]=e,r=i==="html5"?t:"div",o=i==="html5"?{}:{src:n};Object.assign(this,{provider:i,type:t,supported:Z.check(t,i,this.config.playsinline),media:I(r,o)}),this.elements.container.appendChild(this.media),g.boolean(s.autoplay)&&(this.config.autoplay=s.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),g.empty(s.poster)||(this.poster=s.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Q.addStyleHook.call(this),this.isHTML5&&ki.insertElements.call(this,"source",e),this.config.title=s.title,sn.setup.call(this),this.isHTML5&&Object.keys(s).includes("tracks")&&ki.insertElements.call(this,"track",s.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Q.build.call(this),this.isHTML5&&this.media.load(),g.empty(s.previewThumbnails)||(Object.assign(this.config.previewThumbnails,s.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ei(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class dt{constructor(e,t){if(k(this,"play",()=>g.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Te(this.media.play())),this.media.play()):null),k(this,"pause",()=>this.playing&&g.function(this.media.pause)?this.media.pause():null),k(this,"togglePlay",a=>(g.boolean(a)?a:!this.playing)?this.play():this.pause()),k(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):g.function(this.media.stop)&&this.media.stop()}),k(this,"restart",()=>{this.currentTime=0}),k(this,"rewind",a=>{this.currentTime-=g.number(a)?a:this.config.seekTime}),k(this,"forward",a=>{this.currentTime+=g.number(a)?a:this.config.seekTime}),k(this,"increaseVolume",a=>{const l=this.media.muted?0:this.volume;this.volume=l+(g.number(a)?a:0)}),k(this,"decreaseVolume",a=>{this.increaseVolume(-a)}),k(this,"airplay",()=>{Z.airplay&&this.media.webkitShowPlaybackTargetPicker()}),k(this,"toggleControls",a=>{if(this.supported.ui&&!this.isAudio){const l=Vt(this.elements.container,this.config.classNames.hideControls),c=a===void 0?void 0:!a,h=F(this.elements.container,this.config.classNames.hideControls,c);if(h&&g.array(this.config.controls)&&this.config.controls.includes("settings")&&!g.empty(this.config.settings)&&E.toggleMenu.call(this,!1),h!==l){const m=h?"controlshidden":"controlsshown";B.call(this,this.media,m)}return!h}return!1}),k(this,"on",(a,l)=>{V.call(this,this.elements.container,a,l)}),k(this,"once",(a,l)=>{Ri.call(this,this.elements.container,a,l)}),k(this,"off",(a,l)=>{Ft(this.elements.container,a,l)}),k(this,"destroy",(a,l=!1)=>{if(!this.ready)return;const c=()=>{document.body.style.overflow="",this.embed=null,l?(Object.keys(this.elements).length&&(Ee(this.elements.buttons.play),Ee(this.elements.captions),Ee(this.elements.controls),Ee(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),g.function(a)&&a()):(Vr.call(this),Re.cancelRequests.call(this),Lt(this.elements.original,this.elements.container),B.call(this,this.elements.original,"destroyed",!0),g.function(a)&&a.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Q.toggleNativeControls.call(this,!0),c()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&g.function(this.embed.destroy)&&this.embed.destroy(),c()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(c),setTimeout(c,200))}),k(this,"supports",a=>Z.mime.call(this,a)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Z.touch,this.media=e,g.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||g.nodeList(this.media)||g.array(this.media))&&(this.media=this.media[0]),this.config=K({},tn,dt.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Gr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Z),g.nullOrUndefined(this.media)||!g.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!Z.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const n=this.media.tagName.toLowerCase();let r=null,o=null;switch(n){case"div":if(r=this.media.querySelector("iframe"),g.element(r)){if(o=$s(r.getAttribute("src")),this.provider=jr(o.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",o.search.length){const a=["1","true"];a.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),a.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=a.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(g.empty(this.provider)||!Object.values(Be).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=di.video;break;case"video":case"audio":this.type=n,this.provider=Be.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Z.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Jr(this),this.storage=new ut(this),this.media.plyr=this,g.element(this.elements.container)||(this.elements.container=I("div"),Ys(this.media,this.elements.container)),Q.migrateStyles.call(this),Q.addStyleHook.call(this),sn.setup.call(this),this.config.debug&&V.call(this,this.elements.container,this.config.events.join(" "),a=>{this.debug.log(`event: ${a.type}`)}),this.fullscreen=new ye(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Q.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ia(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Te(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ei(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Be.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Be.youtube}get isVimeo(){return this.provider===Be.vimeo}get isVideo(){return this.type===di.video}get isAudio(){return this.type===di.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=g.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return g.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=g.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;g.string(t)&&(t=Number(t)),g.number(t)||(t=this.storage.get("volume")),g.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!g.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;g.boolean(t)||(t=this.storage.get("muted")),g.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;g.number(e)&&(t=e),g.number(t)||(t=this.storage.get("speed")),g.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:n}=this;t=nn(t,i,n),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let n=[!g.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(g.number),r=!0;if(!i.includes(n)){const o=Xs(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${o} instead`),n=o,r=!1}t.selected=n,this.media.quality=n,r&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=g.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){ki.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return g.url(e)?e:this.source}set download(e){g.url(e)&&(this.config.urls.download=e,E.setDownloadUrl.call(this))}set poster(e){this.isVideo?Q.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Dt(Li.call(this));return g.array(e)?e.join(":"):e}set ratio(e){this.isVideo?g.string(e)&&Gs(e)?(this.config.ratio=Dt(e),$e.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=g.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){U.toggle.call(this,e,!1)}set currentTrack(e){U.set.call(this,e,!1),U.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){U.setLanguage.call(this,e,!1)}get language(){return(U.getCurrentTrack.call(this)||{}).language}set pip(e){if(!Z.pip)return;const t=g.boolean(e)?e:!this.pip;g.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?ui.active:ui.inactive),g.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return Z.pip?g.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ui.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ei(this))}static supported(e,t){return Z.check(e,t)}static loadSprite(e,t){return Zs(e,t)}static setup(e,t={}){let i=null;return g.string(e)?i=Array.from(document.querySelectorAll(e)):g.nodeList(e)?i=Array.from(e):g.array(e)&&(i=e.filter(g.element)),g.empty(i)?null:i.map(n=>new dt(n,t))}}dt.defaults=Ir(tn);const na="_staffContainer_f8ytm_1",ra="_staffTitle_f8ytm_6",aa="_staffImg_f8ytm_13",oa="_name_f8ytm_17",la="_boxStyle_f8ytm_22",ca="_active_f8ytm_29";var ue={staffContainer:na,staffTitle:ra,staffImg:aa,name:oa,boxStyle:la,active:ca},gi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA11JREFUWEfVmU1ME0EUx/9vt0TkO6EkLdg0IKF08aZGr569mKgJB0+e1OAdDp484F0jnDyZGAMHL569mqgn7JYShJAKbUKbAAUsod0nb9NtxvJRKiUd5rTZnXnzm/fmfcws4T8aMxu2bd80DOMOgOsAIgCCANpL4nIAUgASAH44jvPFsqxvROTUOh3VMiCRSPQVCoUxAI+I6EotY5n5N4D3Pp/vTSQSWT3t2FMBxuPxbmZ+CeAxgEunFX5Mvz0A74joRTQazVaTVRXQtu1RAK8B+FVhPp8Pra2taGlpQXNzM5qammAYhtvFcRzs7+8jn89jd3cXOzs7KBQKlSwZ0zTHIpHIx5MgjwVkZt+B5gTsiSpAgLq7u104oqrrc4cyswuZzWZd4Io2faDJ50R0aAXS78gZksnk5VwuNwPgridMNBQIBNDW1lbNKid+397eRjqddjWstM/t7e0PQ6HQn8rBhwBLmvukwnV0dCAYDJZNeCbC0hZIpVLY2tr6BzIajd6r1OQhQNu2p1Sz+v1+9PT0nJXpyPHr6+vIZDLqt2nLsp6qL/4BLDnEB6/DecJ5c1RCmqY5qjpOGbAUSuY9bxWz9vX1nYvmKoWurq6q5s4Q0bAXgsqAtm2/BeCqVxxiYGCgbnuu2iolLC0tLamOM2VZ1rOyF0uGKBaLv7wgHAqFzuyt1aAqv4t3J5NJ7/WeaZpXJeO4GozFYpNENC7PEufC4XCt8uvSf2VlpRwnmfnVyMjIBJUS/4qXWxuhPW91qhYld1uWFaZYLHaLiL5KJ0lfg4ODp84QdVGb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WIbNXwSHAXjwtW/svbQM/ebg6togAAAAASUVORK5CYII=",fa=Oi({name:"staff-change",props:{radio:{type:String,default:"staff"}},emits:["change","close"],setup(s,{emit:e}){const{radio:t}=An(s),i=n=>{t.value=n,e("change",n),e("close")};return()=>N("div",{class:ue.staffContainer},[N("div",{class:ue.staffTitle},[ve("\u8F6C\u6362\u66F2\u8C31")]),N(Bn,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{default:()=>[N(Rn,{border:!1},{default:()=>[N(ci,{center:!0,border:!1,class:t.value==="staff"?ue.active:"",onClick:()=>i("staff")},{icon:()=>N(ot,{src:t.value==="staff"?ua:ha,class:ue.staffImg},null),title:()=>N("span",{class:ue.name},[ve("\u4E94\u7EBF\u8C31")]),value:()=>N(li,{name:"staff"},{icon:n=>N(si,{class:ue.boxStyle,name:n.checked?pi:gi},null)})}),N(ci,{center:!0,border:!1,class:t.value==="first"?ue.active:"",onClick:()=>i("first")},{icon:()=>N(ot,{src:t.value==="first"?pa:ga,class:ue.staffImg},null),title:()=>N("span",{class:ue.name},[ve("\u7B80\u8C31-\u9996\u8C03")]),value:()=>N(li,{name:"first"},{icon:n=>N(si,{class:ue.boxStyle,name:n.checked?pi:gi},null)})}),N(ci,{center:!0,border:!1,class:t.value==="fixed"?ue.active:"",onClick:()=>i("fixed")},{icon:()=>N(ot,{src:t.value==="fixed"?ma:da,class:ue.staffImg},null),title:()=>N("span",{class:ue.name},[ve("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>N(li,{name:"fixed"},{icon:n=>N(si,{class:ue.boxStyle,name:n.checked?pi:gi},null)})})]})]})])}});const ya="_downloadContainer_ahrb6_1",ba="_musicContainer_ahrb6_4",va="_musicImg_ahrb6_15",Aa="_num_ahrb6_18",wa="_page_ahrb6_26",Ca="_downloadBtn_ahrb6_32";var Oe={downloadContainer:ya,musicContainer:ba,musicImg:va,num:Aa,page:wa,downloadBtn:Ca};const Ta=async s=>{console.log("imgToCanvas",s);const e=document.createElement("img");e.setAttribute("crossOrigin","anonymous"),s&&typeof s=="string"&&s.includes("data:image")?e.src=s:e.src=s+`?t=${+new Date}`,await new Promise(n=>e.onload=n);const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");return i.fillStyle="rgb(255, 255, 255)",i.fillStyle="#fff",i.fillRect(0,0,e.width,e.height),i.drawImage(e,0,0),t},xa=async(s,e)=>{console.log("addWatermark");try{const t=s.getContext("2d"),i=document.createElement("img");i.setAttribute("crossOrigin","anonymous"),it&&typeof it=="string"&&it.includes("data:image")?i.src=it:i.src=it+`?${new Date().getTime()}`,await new Promise(a=>i.onload=a);const n=document.createElement("canvas");n.width=600,n.height=500;const r=n.getContext("2d");r.clearRect(0,0,n.width,n.height),r.rotate(-30*Math.PI/180),r.drawImage(i,0,300);const o=t.createPattern(n,"repeat");return t.fillStyle=o,t.fillRect(0,0,s.width,s.height),s}catch(t){console.log(t)}},Sa=(s,e)=>{s.getContext("2d");const t=document.createElement("canvas");t.width=s.width,t.height=s.height+70;const i=t.getContext("2d");return i.fillStyle="#fff",i.fillRect(0,0,s.width,s.height+90),i.font="40pt Calibri",i.fillStyle="#000",i.textAlign="center",i.drawImage(s,0,70),i.fillText(e.title,s.width/2,120),t},Ea=s=>s.toDataURL("image/png");var ka=Oi({name:"download",props:{imgList:{type:Array,default:()=>[]},musicSheetName:{type:String,default:""}},setup(s){const e=be(s.imgList),t=be();Ps(()=>s.imgList,l=>{e.value=l,i.value=0,t.value&&t.value.swipeTo(0)});const i=be(0),n=be(!1),r=be(""),o=async()=>{if(!n.value)if(n.value=!0,r.value)a();else{console.log(e.value[i.value],"list.value[acitveIndex.value]");const l=await Ta(e.value[i.value]),c=Sa(l,{title:s.musicSheetName,size:12}),h=await xa(c);r.value=Ea(h),console.log(r.value,"image.value"),await a()}},a=async()=>{var c;wn({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{n.value=!1},100);const l=await Os({api:"savePicture",content:{base64:r.value}});((c=l==null?void 0:l.content)==null?void 0:c.status)==="success"?Cn("\u5DF2\u4FDD\u5B58\u5230\u76F8\u518C"):Tn("\u4FDD\u5B58\u5931\u8D25")};return()=>N("div",{class:Oe.downloadContainer},[N("div",{class:Oe.musicContainer},[N("h2",null,[s.musicSheetName]),N("div",{class:Oe.musicImg},[N(Ln,{ref:t,showIndicators:!1,loop:!1,onChange:l=>{i.value=l,r.value=""}},{default:()=>[e.value.length>0&&e.value.map(l=>N(Vn,null,{default:()=>[N(ot,{src:l},null)]}))]})])]),N("div",{class:Oe.buttonGroup},[N("div",{class:Oe.num},[N("span",{class:Oe.page},[i.value+1,ve("/"),e.value.length]),N("span",{class:Oe.countPage},[ve("\uFF08\u5171"),e.value.length,ve("\u9875\uFF09")])]),N(Ms,{type:"primary",color:"#FF8057",class:Oe.downloadBtn,block:!0,round:!0,onClick:()=>o(),loading:n.value,loadingText:"\u4E0B\u8F7D\u4E2D..."},{default:()=>[ve("\u4E0B\u8F7D\u5F53\u524D\u9875\u9762")]})])])}}),Ht={exports:{}},at={exports:{}};(function(){var s,e,t,i,n,r;typeof performance!="undefined"&&performance!==null&&performance.now?at.exports=function(){return performance.now()}:typeof process!="undefined"&&process!==null&&process.hrtime?(at.exports=function(){return(s()-n)/1e6},e=process.hrtime,s=function(){var o;return o=e(),o[0]*1e9+o[1]},i=s(),r=process.uptime()*1e9,n=i-r):Date.now?(at.exports=function(){return Date.now()-t},t=Date.now()):(at.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(Is);var Na=at.exports,ke=typeof window=="undefined"?Is:window,Nt=["moz","webkit"],Ze="AnimationFrame",et=ke["request"+Ze],mt=ke["cancel"+Ze]||ke["cancelRequest"+Ze];for(var rt=0;!et&&rt<Nt.length;rt++)et=ke[Nt[rt]+"Request"+Ze],mt=ke[Nt[rt]+"Cancel"+Ze]||ke[Nt[rt]+"CancelRequest"+Ze];if(!et||!mt){var fi=0,os=0,Qe=[],Pa=1e3/60;et=function(s){if(Qe.length===0){var e=Na(),t=Math.max(0,Pa-(e-fi));fi=t+e,setTimeout(function(){var i=Qe.slice(0);Qe.length=0;for(var n=0;n<i.length;n++)if(!i[n].cancelled)try{i[n].callback(fi)}catch(r){setTimeout(function(){throw r},0)}},Math.round(t))}return Qe.push({handle:++os,callback:s,cancelled:!1}),os},mt=function(s){for(var e=0;e<Qe.length;e++)Qe[e].handle===s&&(Qe[e].cancelled=!0)}}Ht.exports=function(s){return et.call(ke,s)};Ht.exports.cancel=function(){mt.apply(ke,arguments)};Ht.exports.polyfill=function(s){s||(s=ke),s.requestAnimationFrame=et,s.cancelAnimationFrame=mt};var yi=Ht.exports,Ni=function(s){this.ok=!1,this.alpha=1,s.charAt(0)=="#"&&(s=s.substr(1,6)),s=s.replace(/ /g,""),s=s.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};s=e[s]||s;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3]),parseFloat(l[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],i=0;i<t.length;i++){var n=t[i].re,r=t[i].process,o=n.exec(s);if(o){var a=r(o);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var l=this.r.toString(16),c=this.g.toString(16),h=this.b.toString(16);return l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),h.length==1&&(h="0"+h),"#"+l+c+h},this.getHelpXML=function(){for(var l=new Array,c=0;c<t.length;c++)for(var h=t[c].example,m=0;m<h.length;m++)l[l.length]=h[m];for(var u in e)l[l.length]=u;var d=document.createElement("ul");d.setAttribute("id","rgbcolor-examples");for(var c=0;c<l.length;c++)try{var p=document.createElement("li"),f=new RGBColor(l[c]),y=document.createElement("div");y.style.cssText="margin: 3px; border: 1px solid black; background:"+f.toHex()+"; color:"+f.toHex(),y.appendChild(document.createTextNode("test"));var b=document.createTextNode(" "+l[c]+" -> "+f.toRGB()+" -> "+f.toHex());p.appendChild(y),p.appendChild(b),d.appendChild(p)}catch{}return d}};/*! *****************************************************************************
  3. Copyright (c) Microsoft Corporation.
  4. Permission to use, copy, modify, and/or distribute this software for any
  5. purpose with or without fee is hereby granted.
  6. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  7. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  8. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  9. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  10. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  11. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  12. PERFORMANCE OF THIS SOFTWARE.
  13. ***************************************************************************** */var rn=function(s,e){return(rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])})(s,e)};function an(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=s}rn(s,e),s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Ma(s){var e="";Array.isArray(s)||(s=[s]);for(var t=0;t<s.length;t++){var i=s[t];if(i.type===T.CLOSE_PATH)e+="z";else if(i.type===T.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===T.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===T.MOVE_TO)e+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===T.LINE_TO)e+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===T.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===T.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===T.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===T.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==T.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+t+".");e+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return e}function Pi(s,e){var t=s[0],i=s[1];return[t*Math.cos(e)-i*Math.sin(e),t*Math.sin(e)+i*Math.cos(e)]}function fe(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];for(var t=0;t<s.length;t++)if(typeof s[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof s[t]+" == typeof "+s[t]);return!0}var Ie=Math.PI;function bi(s,e,t){s.lArcFlag=s.lArcFlag===0?0:1,s.sweepFlag=s.sweepFlag===0?0:1;var i=s.rX,n=s.rY,r=s.x,o=s.y;i=Math.abs(s.rX),n=Math.abs(s.rY);var a=Pi([(e-r)/2,(t-o)/2],-s.xRot/180*Ie),l=a[0],c=a[1],h=Math.pow(l,2)/Math.pow(i,2)+Math.pow(c,2)/Math.pow(n,2);1<h&&(i*=Math.sqrt(h),n*=Math.sqrt(h)),s.rX=i,s.rY=n;var m=Math.pow(i,2)*Math.pow(c,2)+Math.pow(n,2)*Math.pow(l,2),u=(s.lArcFlag!==s.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-m)/m)),d=i*c/n*u,p=-n*l/i*u,f=Pi([d,p],s.xRot/180*Ie);s.cX=f[0]+(e+r)/2,s.cY=f[1]+(t+o)/2,s.phi1=Math.atan2((c-p)/n,(l-d)/i),s.phi2=Math.atan2((-c-p)/n,(-l-d)/i),s.sweepFlag===0&&s.phi2>s.phi1&&(s.phi2-=2*Ie),s.sweepFlag===1&&s.phi2<s.phi1&&(s.phi2+=2*Ie),s.phi1*=180/Ie,s.phi2*=180/Ie}function ls(s,e,t){fe(s,e,t);var i=s*s+e*e-t*t;if(0>i)return[];if(i===0)return[[s*t/(s*s+e*e),e*t/(s*s+e*e)]];var n=Math.sqrt(i);return[[(s*t+e*n)/(s*s+e*e),(e*t-s*n)/(s*s+e*e)],[(s*t-e*n)/(s*s+e*e),(e*t+s*n)/(s*s+e*e)]]}var ee,xe=Math.PI/180;function cs(s,e,t){return(1-t)*s+t*e}function hs(s,e,t,i){return s+Math.cos(i/180*Ie)*e+Math.sin(i/180*Ie)*t}function us(s,e,t,i){var n=1e-6,r=e-s,o=t-e,a=3*r+3*(i-t)-6*o,l=6*(o-r),c=3*r;return Math.abs(a)<n?[-c/l]:function(h,m,u){u===void 0&&(u=1e-6);var d=h*h/4-m;if(d<-u)return[];if(d<=u)return[-h/2];var p=Math.sqrt(d);return[-h/2-p,-h/2+p]}(l/a,c/a,n)}function ds(s,e,t,i,n){var r=1-n;return s*(r*r*r)+e*(3*r*r*n)+t*(3*r*n*n)+i*(n*n*n)}(function(s){function e(){return n(function(a,l,c){return a.relative&&(a.x1!==void 0&&(a.x1+=l),a.y1!==void 0&&(a.y1+=c),a.x2!==void 0&&(a.x2+=l),a.y2!==void 0&&(a.y2+=c),a.x!==void 0&&(a.x+=l),a.y!==void 0&&(a.y+=c),a.relative=!1),a})}function t(){var a=NaN,l=NaN,c=NaN,h=NaN;return n(function(m,u,d){return m.type&T.SMOOTH_CURVE_TO&&(m.type=T.CURVE_TO,a=isNaN(a)?u:a,l=isNaN(l)?d:l,m.x1=m.relative?u-a:2*u-a,m.y1=m.relative?d-l:2*d-l),m.type&T.CURVE_TO?(a=m.relative?u+m.x2:m.x2,l=m.relative?d+m.y2:m.y2):(a=NaN,l=NaN),m.type&T.SMOOTH_QUAD_TO&&(m.type=T.QUAD_TO,c=isNaN(c)?u:c,h=isNaN(h)?d:h,m.x1=m.relative?u-c:2*u-c,m.y1=m.relative?d-h:2*d-h),m.type&T.QUAD_TO?(c=m.relative?u+m.x1:m.x1,h=m.relative?d+m.y1:m.y1):(c=NaN,h=NaN),m})}function i(){var a=NaN,l=NaN;return n(function(c,h,m){if(c.type&T.SMOOTH_QUAD_TO&&(c.type=T.QUAD_TO,a=isNaN(a)?h:a,l=isNaN(l)?m:l,c.x1=c.relative?h-a:2*h-a,c.y1=c.relative?m-l:2*m-l),c.type&T.QUAD_TO){a=c.relative?h+c.x1:c.x1,l=c.relative?m+c.y1:c.y1;var u=c.x1,d=c.y1;c.type=T.CURVE_TO,c.x1=((c.relative?0:h)+2*u)/3,c.y1=((c.relative?0:m)+2*d)/3,c.x2=(c.x+2*u)/3,c.y2=(c.y+2*d)/3}else a=NaN,l=NaN;return c})}function n(a){var l=0,c=0,h=NaN,m=NaN;return function(u){if(isNaN(h)&&!(u.type&T.MOVE_TO))throw new Error("path must start with moveto");var d=a(u,l,c,h,m);return u.type&T.CLOSE_PATH&&(l=h,c=m),u.x!==void 0&&(l=u.relative?l+u.x:u.x),u.y!==void 0&&(c=u.relative?c+u.y:u.y),u.type&T.MOVE_TO&&(h=l,m=c),d}}function r(a,l,c,h,m,u){return fe(a,l,c,h,m,u),n(function(d,p,f,y){var b=d.x1,v=d.x2,C=d.relative&&!isNaN(y),S=d.x!==void 0?d.x:C?0:p,w=d.y!==void 0?d.y:C?0:f;function x(ge){return ge*ge}d.type&T.HORIZ_LINE_TO&&l!==0&&(d.type=T.LINE_TO,d.y=d.relative?0:f),d.type&T.VERT_LINE_TO&&c!==0&&(d.type=T.LINE_TO,d.x=d.relative?0:p),d.x!==void 0&&(d.x=d.x*a+w*c+(C?0:m)),d.y!==void 0&&(d.y=S*l+d.y*h+(C?0:u)),d.x1!==void 0&&(d.x1=d.x1*a+d.y1*c+(C?0:m)),d.y1!==void 0&&(d.y1=b*l+d.y1*h+(C?0:u)),d.x2!==void 0&&(d.x2=d.x2*a+d.y2*c+(C?0:m)),d.y2!==void 0&&(d.y2=v*l+d.y2*h+(C?0:u));var A=a*h-l*c;if(d.xRot!==void 0&&(a!==1||l!==0||c!==0||h!==1))if(A===0)delete d.rX,delete d.rY,delete d.xRot,delete d.lArcFlag,delete d.sweepFlag,d.type=T.LINE_TO;else{var P=d.xRot*Math.PI/180,M=Math.sin(P),L=Math.cos(P),G=1/x(d.rX),D=1/x(d.rY),X=x(L)*G+x(M)*D,z=2*M*L*(G-D),j=x(M)*G+x(L)*D,ie=X*h*h-z*l*h+j*l*l,_=z*(a*h+l*c)-2*(X*c*h+j*a*l),de=X*c*c-z*a*c+j*a*a,J=(Math.atan2(_,ie-de)+Math.PI)%Math.PI/2,q=Math.sin(J),oe=Math.cos(J);d.rX=Math.abs(A)/Math.sqrt(ie*x(oe)+_*q*oe+de*x(q)),d.rY=Math.abs(A)/Math.sqrt(ie*x(q)-_*q*oe+de*x(oe)),d.xRot=180*J/Math.PI}return d.sweepFlag!==void 0&&0>A&&(d.sweepFlag=+!d.sweepFlag),d})}function o(){return function(a){var l={};for(var c in a)l[c]=a[c];return l}}s.ROUND=function(a){function l(c){return Math.round(c*a)/a}return a===void 0&&(a=1e13),fe(a),function(c){return c.x1!==void 0&&(c.x1=l(c.x1)),c.y1!==void 0&&(c.y1=l(c.y1)),c.x2!==void 0&&(c.x2=l(c.x2)),c.y2!==void 0&&(c.y2=l(c.y2)),c.x!==void 0&&(c.x=l(c.x)),c.y!==void 0&&(c.y=l(c.y)),c.rX!==void 0&&(c.rX=l(c.rX)),c.rY!==void 0&&(c.rY=l(c.rY)),c}},s.TO_ABS=e,s.TO_REL=function(){return n(function(a,l,c){return a.relative||(a.x1!==void 0&&(a.x1-=l),a.y1!==void 0&&(a.y1-=c),a.x2!==void 0&&(a.x2-=l),a.y2!==void 0&&(a.y2-=c),a.x!==void 0&&(a.x-=l),a.y!==void 0&&(a.y-=c),a.relative=!0),a})},s.NORMALIZE_HVZ=function(a,l,c){return a===void 0&&(a=!0),l===void 0&&(l=!0),c===void 0&&(c=!0),n(function(h,m,u,d,p){if(isNaN(d)&&!(h.type&T.MOVE_TO))throw new Error("path must start with moveto");return l&&h.type&T.HORIZ_LINE_TO&&(h.type=T.LINE_TO,h.y=h.relative?0:u),c&&h.type&T.VERT_LINE_TO&&(h.type=T.LINE_TO,h.x=h.relative?0:m),a&&h.type&T.CLOSE_PATH&&(h.type=T.LINE_TO,h.x=h.relative?d-m:d,h.y=h.relative?p-u:p),h.type&T.ARC&&(h.rX===0||h.rY===0)&&(h.type=T.LINE_TO,delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag),h})},s.NORMALIZE_ST=t,s.QT_TO_C=i,s.INFO=n,s.SANITIZE=function(a){a===void 0&&(a=0),fe(a);var l=NaN,c=NaN,h=NaN,m=NaN;return n(function(u,d,p,f,y){var b=Math.abs,v=!1,C=0,S=0;if(u.type&T.SMOOTH_CURVE_TO&&(C=isNaN(l)?0:d-l,S=isNaN(c)?0:p-c),u.type&(T.CURVE_TO|T.SMOOTH_CURVE_TO)?(l=u.relative?d+u.x2:u.x2,c=u.relative?p+u.y2:u.y2):(l=NaN,c=NaN),u.type&T.SMOOTH_QUAD_TO?(h=isNaN(h)?d:2*d-h,m=isNaN(m)?p:2*p-m):u.type&T.QUAD_TO?(h=u.relative?d+u.x1:u.x1,m=u.relative?p+u.y1:u.y2):(h=NaN,m=NaN),u.type&T.LINE_COMMANDS||u.type&T.ARC&&(u.rX===0||u.rY===0||!u.lArcFlag)||u.type&T.CURVE_TO||u.type&T.SMOOTH_CURVE_TO||u.type&T.QUAD_TO||u.type&T.SMOOTH_QUAD_TO){var w=u.x===void 0?0:u.relative?u.x:u.x-d,x=u.y===void 0?0:u.relative?u.y:u.y-p;C=isNaN(h)?u.x1===void 0?C:u.relative?u.x:u.x1-d:h-d,S=isNaN(m)?u.y1===void 0?S:u.relative?u.y:u.y1-p:m-p;var A=u.x2===void 0?0:u.relative?u.x:u.x2-d,P=u.y2===void 0?0:u.relative?u.y:u.y2-p;b(w)<=a&&b(x)<=a&&b(C)<=a&&b(S)<=a&&b(A)<=a&&b(P)<=a&&(v=!0)}return u.type&T.CLOSE_PATH&&b(d-f)<=a&&b(p-y)<=a&&(v=!0),v?[]:u})},s.MATRIX=r,s.ROTATE=function(a,l,c){l===void 0&&(l=0),c===void 0&&(c=0),fe(a,l,c);var h=Math.sin(a),m=Math.cos(a);return r(m,h,-h,m,l-l*m+c*h,c-l*h-c*m)},s.TRANSLATE=function(a,l){return l===void 0&&(l=0),fe(a,l),r(1,0,0,1,a,l)},s.SCALE=function(a,l){return l===void 0&&(l=a),fe(a,l),r(a,0,0,l,0,0)},s.SKEW_X=function(a){return fe(a),r(1,0,Math.atan(a),1,0,0)},s.SKEW_Y=function(a){return fe(a),r(1,Math.atan(a),0,1,0,0)},s.X_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),fe(a),r(-1,0,0,1,a,0)},s.Y_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),fe(a),r(1,0,0,-1,0,a)},s.A_TO_C=function(){return n(function(a,l,c){return T.ARC===a.type?function(h,m,u){var d,p,f,y;h.cX||bi(h,m,u);for(var b=Math.min(h.phi1,h.phi2),v=Math.max(h.phi1,h.phi2)-b,C=Math.ceil(v/90),S=new Array(C),w=m,x=u,A=0;A<C;A++){var P=cs(h.phi1,h.phi2,A/C),M=cs(h.phi1,h.phi2,(A+1)/C),L=M-P,G=4/3*Math.tan(L*xe/4),D=[Math.cos(P*xe)-G*Math.sin(P*xe),Math.sin(P*xe)+G*Math.cos(P*xe)],X=D[0],z=D[1],j=[Math.cos(M*xe),Math.sin(M*xe)],ie=j[0],_=j[1],de=[ie+G*Math.sin(M*xe),_-G*Math.cos(M*xe)],J=de[0],q=de[1];S[A]={relative:h.relative,type:T.CURVE_TO};var oe=function(ge,we){var Me=Pi([ge*h.rX,we*h.rY],h.xRot),je=Me[0],vt=Me[1];return[h.cX+je,h.cY+vt]};d=oe(X,z),S[A].x1=d[0],S[A].y1=d[1],p=oe(J,q),S[A].x2=p[0],S[A].y2=p[1],f=oe(ie,_),S[A].x=f[0],S[A].y=f[1],h.relative&&(S[A].x1-=w,S[A].y1-=x,S[A].x2-=w,S[A].y2-=x,S[A].x-=w,S[A].y-=x),w=(y=[S[A].x,S[A].y])[0],x=y[1]}return S}(a,a.relative?0:l,a.relative?0:c):a})},s.ANNOTATE_ARCS=function(){return n(function(a,l,c){return a.relative&&(l=0,c=0),T.ARC===a.type&&bi(a,l,c),a})},s.CLONE=o,s.CALCULATE_BOUNDS=function(){var a=function(u){var d={};for(var p in u)d[p]=u[p];return d},l=e(),c=i(),h=t(),m=n(function(u,d,p){var f=h(c(l(a(u))));function y(q){q>m.maxX&&(m.maxX=q),q<m.minX&&(m.minX=q)}function b(q){q>m.maxY&&(m.maxY=q),q<m.minY&&(m.minY=q)}if(f.type&T.DRAWING_COMMANDS&&(y(d),b(p)),f.type&T.HORIZ_LINE_TO&&y(f.x),f.type&T.VERT_LINE_TO&&b(f.y),f.type&T.LINE_TO&&(y(f.x),b(f.y)),f.type&T.CURVE_TO){y(f.x),b(f.y);for(var v=0,C=us(d,f.x1,f.x2,f.x);v<C.length;v++)0<(J=C[v])&&1>J&&y(ds(d,f.x1,f.x2,f.x,J));for(var S=0,w=us(p,f.y1,f.y2,f.y);S<w.length;S++)0<(J=w[S])&&1>J&&b(ds(p,f.y1,f.y2,f.y,J))}if(f.type&T.ARC){y(f.x),b(f.y),bi(f,d,p);for(var x=f.xRot/180*Math.PI,A=Math.cos(x)*f.rX,P=Math.sin(x)*f.rX,M=-Math.sin(x)*f.rY,L=Math.cos(x)*f.rY,G=f.phi1<f.phi2?[f.phi1,f.phi2]:-180>f.phi2?[f.phi2+360,f.phi1+360]:[f.phi2,f.phi1],D=G[0],X=G[1],z=function(q){var oe=q[0],ge=q[1],we=180*Math.atan2(ge,oe)/Math.PI;return we<D?we+360:we},j=0,ie=ls(M,-A,0).map(z);j<ie.length;j++)(J=ie[j])>D&&J<X&&y(hs(f.cX,A,M,J));for(var _=0,de=ls(L,-P,0).map(z);_<de.length;_++){var J;(J=de[_])>D&&J<X&&b(hs(f.cY,P,L,J))}}return u});return m.minX=1/0,m.maxX=-1/0,m.minY=1/0,m.maxY=-1/0,m}})(ee||(ee={}));var pe,on=function(){function s(){}return s.prototype.round=function(e){return this.transform(ee.ROUND(e))},s.prototype.toAbs=function(){return this.transform(ee.TO_ABS())},s.prototype.toRel=function(){return this.transform(ee.TO_REL())},s.prototype.normalizeHVZ=function(e,t,i){return this.transform(ee.NORMALIZE_HVZ(e,t,i))},s.prototype.normalizeST=function(){return this.transform(ee.NORMALIZE_ST())},s.prototype.qtToC=function(){return this.transform(ee.QT_TO_C())},s.prototype.aToC=function(){return this.transform(ee.A_TO_C())},s.prototype.sanitize=function(e){return this.transform(ee.SANITIZE(e))},s.prototype.translate=function(e,t){return this.transform(ee.TRANSLATE(e,t))},s.prototype.scale=function(e,t){return this.transform(ee.SCALE(e,t))},s.prototype.rotate=function(e,t,i){return this.transform(ee.ROTATE(e,t,i))},s.prototype.matrix=function(e,t,i,n,r,o){return this.transform(ee.MATRIX(e,t,i,n,r,o))},s.prototype.skewX=function(e){return this.transform(ee.SKEW_X(e))},s.prototype.skewY=function(e){return this.transform(ee.SKEW_Y(e))},s.prototype.xSymmetry=function(e){return this.transform(ee.X_AXIS_SYMMETRY(e))},s.prototype.ySymmetry=function(e){return this.transform(ee.Y_AXIS_SYMMETRY(e))},s.prototype.annotateArcs=function(){return this.transform(ee.ANNOTATE_ARCS())},s}(),Oa=function(s){return s===" "||s===" "||s==="\r"||s===`
  14. `},ms=function(s){return"0".charCodeAt(0)<=s.charCodeAt(0)&&s.charCodeAt(0)<="9".charCodeAt(0)},Ia=function(s){function e(){var t=s.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return an(e,s),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,i){var n=this;i===void 0&&(i=[]);for(var r=function(m){i.push(m),n.curArgs.length=0,n.canParseCommandOrComma=!0},o=0;o<t.length;o++){var a=t[o],l=!(this.curCommandType!==T.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),c=ms(a)&&(this.curNumber==="0"&&a==="0"||l);if(!ms(a)||c)if(a!=="e"&&a!=="E")if(a!=="-"&&a!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(a!=="."||this.curNumberHasExp||this.curNumberHasDecimal||l){if(this.curNumber&&this.curCommandType!==-1){var h=Number(this.curNumber);if(isNaN(h))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===T.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>h)throw new SyntaxError('Expected positive number, got "'+h+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(h),this.curArgs.length===Ba[this.curCommandType]&&(T.HORIZ_LINE_TO===this.curCommandType?r({type:T.HORIZ_LINE_TO,relative:this.curCommandRelative,x:h}):T.VERT_LINE_TO===this.curCommandType?r({type:T.VERT_LINE_TO,relative:this.curCommandRelative,y:h}):this.curCommandType===T.MOVE_TO||this.curCommandType===T.LINE_TO||this.curCommandType===T.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),T.MOVE_TO===this.curCommandType&&(this.curCommandType=T.LINE_TO)):this.curCommandType===T.CURVE_TO?r({type:T.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===T.SMOOTH_CURVE_TO?r({type:T.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===T.QUAD_TO?r({type:T.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===T.ARC&&r({type:T.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Oa(a))if(a===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!=="+"&&a!=="-"&&a!==".")if(c)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,a!=="z"&&a!=="Z")if(a==="h"||a==="H")this.curCommandType=T.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=T.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=T.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=T.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=T.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=T.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=T.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=T.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else{if(a!=="a"&&a!=="A")throw new SyntaxError('Unexpected character "'+a+'" at index '+o+".");this.curCommandType=T.ARC,this.curCommandRelative=a==="a"}else i.push({type:T.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal=a==="."}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return i},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(i,n){n===void 0&&(n=[]);for(var r=0,o=Object.getPrototypeOf(this).parse.call(this,i);r<o.length;r++){var a=o[r],l=t(a);Array.isArray(l)?n.push.apply(n,l):n.push(l)}return n}}})},e}(on),T=function(s){function e(t){var i=s.call(this)||this;return i.commands=typeof t=="string"?e.parse(t):t,i}return an(e,s),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=ee.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var i=[],n=0,r=this.commands;n<r.length;n++){var o=t(r[n]);Array.isArray(o)?i.push.apply(i,o):i.push(o)}return this.commands=i,this},e.encode=function(t){return Ma(t)},e.parse=function(t){var i=new Ia,n=[];return i.parse(t,n),i.finish(n),n},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(on),Ba=((pe={})[T.MOVE_TO]=2,pe[T.LINE_TO]=2,pe[T.HORIZ_LINE_TO]=1,pe[T.VERT_LINE_TO]=1,pe[T.CLOSE_PATH]=0,pe[T.QUAD_TO]=4,pe[T.SMOOTH_QUAD_TO]=2,pe[T.CURVE_TO]=6,pe[T.SMOOTH_CURVE_TO]=4,pe[T.ARC]=7,pe);function Rt(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(e){return typeof e}:Rt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rt(s)}function Ra(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}var La=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Va=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Da(s,e,t,i,n){if(typeof s=="string"&&(s=document.getElementById(s)),!s||Rt(s)!=="object"||!("getContext"in s))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var r=s.getContext("2d");try{return r.getImageData(e,t,i,n)}catch(o){throw new Error("unable to access image data: "+o)}}function Ua(s,e,t,i,n,r){if(!(isNaN(r)||r<1)){r|=0;var o=Da(s,e,t,i,n);o=Fa(o,e,t,i,n,r),s.getContext("2d").putImageData(o,e,t)}}function Fa(s,e,t,i,n,r){for(var o=s.data,a=2*r+1,l=i-1,c=n-1,h=r+1,m=h*(h+1)/2,u=new gs,d=u,p,f=1;f<a;f++)d=d.next=new gs,f===h&&(p=d);d.next=u;for(var y=null,b=null,v=0,C=0,S=La[r],w=Va[r],x=0;x<n;x++){d=u;for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(d.g=Fe=o[C+1])*kt,xt+=(d.b=ze=o[C+2])*kt,St+=(d.a=ce=o[C+3])*kt,ti+=Ue,_t+=Fe,$t+=ze,ei+=ce,d=d.next,Et<c&&(Gi+=i)}C=Ge,y=u,b=p;for(var ii=0;ii<n;ii++){var he=C<<2;o[he+3]=ce=St*S>>>w,ce>0?(ce=255/ce,o[he]=(Ct*S>>>w)*ce,o[he+1]=(Tt*S>>>w)*ce,o[he+2]=(xt*S>>>w)*ce):o[he]=o[he+1]=o[he+2]=0,Ct-=Gt,Tt-=Jt,xt-=Kt,St-=Zt,Gt-=y.r,Jt-=y.g,Kt-=y.b,Zt-=y.a,he=Ge+((he=ii+h)<c?he:c)*i<<2,Ct+=ti+=y.r=o[he],Tt+=_t+=y.g=o[he+1],xt+=$t+=y.b=o[he+2],St+=ei+=y.a=o[he+3],y=y.next,Gt+=Ue=b.r,Jt+=Fe=b.g,Kt+=ze=b.b,Zt+=ce=b.a,ti-=Ue,_t-=Fe,$t-=ze,ei-=ce,b=b.next,C+=i}}return s}var gs=function s(){Ra(this,s),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function za(){let{DOMParser:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:s,createCanvas(t,i){return new OffscreenCanvas(t,i)},async createImage(t){const n=await(await fetch(t)).blob();return await createImageBitmap(n)}};return(typeof globalThis.DOMParser!="undefined"||typeof s=="undefined")&&Reflect.deleteProperty(e,"DOMParser"),e}function Ha(s){let{DOMParser:e,canvas:t,fetch:i}=s;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:i,createCanvas:t.createCanvas,createImage:t.loadImage}}var Qa=Object.freeze({__proto__:null,offscreen:za,node:Ha});function tt(s){return s.replace(/(?!\u3000)\s+/gm," ")}function Wa(s){return s.replace(/^[\n \t]+/,"")}function qa(s){return s.replace(/[\n \t]+$/,"")}function me(s){const e=s.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}function Ya(s){const e=me(s);return[e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0]}const Xa=/^[A-Z-]+$/;function ja(s){return Xa.test(s)?s.toLowerCase():s}function ln(s){const e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(s);return e&&(e[2]||e[3]||e[4])||""}function Ga(s){if(!s.startsWith("rgb"))return s;let e=3;return s.replace(/\d+(\.\d+)?/g,(i,n)=>e--&&n?String(Math.round(parseFloat(i))):i)}const Ja=/(\[[^\]]+\])/g,Ka=/(#[^\s+>~.[:]+)/g,Za=/(\.[^\s+>~.[:]+)/g,_a=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,$a=/(:[\w-]+\([^)]*\))/gi,eo=/(:[^\s+>~.[:]+)/g,to=/([^\s+>~.[:]+)/g;function We(s,e){const t=e.exec(s);return t?[s.replace(e," "),t.length]:[s,0]}function io(s){const e=[0,0,0];let t=s.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),i=0;return[t,i]=We(t,Ja),e[1]+=i,[t,i]=We(t,Ka),e[0]+=i,[t,i]=We(t,Za),e[1]+=i,[t,i]=We(t,_a),e[2]+=i,[t,i]=We(t,$a),e[1]+=i,[t,i]=We(t,eo),e[1]+=i,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,i]=We(t,to),e[2]+=i,e.join("")}const _e=1e-8;function ps(s){return Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2))}function Mi(s,e){return(s[0]*e[0]+s[1]*e[1])/(ps(s)*ps(e))}function fs(s,e){return(s[0]*e[1]<s[1]*e[0]?-1:1)*Math.acos(Mi(s,e))}function ys(s){return s*s*s}function bs(s){return 3*s*s*(1-s)}function vs(s){return 3*s*(1-s)*(1-s)}function As(s){return(1-s)*(1-s)*(1-s)}function ws(s){return s*s}function Cs(s){return 2*s*(1-s)}function Ts(s){return(1-s)*(1-s)}class O{static empty(e){return new O(e,"EMPTY","")}split(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ";const{document:t,name:i}=this;return tt(this.getString()).trim().split(e).map(n=>new O(t,i,n))}hasValue(e){const t=this.value;return t!==null&&t!==""&&(e||t!==0)&&typeof t!="undefined"}isString(e){const{value:t}=this,i=typeof t=="string";return!i||!e?i:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e=="undefined"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e=="undefined"?0:parseFloat(e);const{value:t}=this;let i=parseFloat(t);return this.isString(/%$/)&&(i/=100),i}getString(e){return typeof e=="undefined"||this.hasValue()?typeof this.value=="undefined"?"":String(this.value):String(e)}getColor(e){let t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=Ga(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;const[i,n]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:r}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(r.computeSize("x"),r.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(r.computeSize("x"),r.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*r.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*r.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*r.computeSize(i);default:{const o=this.getNumber();return t&&o<1?o*r.computeSize(i):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){const e=this.getString(),t=/#([^)'"]+)/.exec(e),i=(t==null?void 0:t[1])||e;return this.document.definitions[i]}getFillStyleDefinition(e,t){let i=this.getDefinition();if(!i)return null;if(typeof i.createGradient=="function"&&"getBoundingBox"in e)return i.createGradient(this.document.ctx,e,t);if(typeof i.createPattern=="function"){if(i.getHrefAttribute().hasValue()){const n=i.getAttribute("patternTransform");i=i.getHrefAttribute().getDefinition(),i&&n.hasValue()&&i.getAttribute("patternTransform",!0).setValue(n.value)}if(i)return i.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){if(!this.hasValue())return null;const e=this.getString();return O.textBaselineMapping[e]||null}addOpacity(e){let t=this.getColor();const i=t.length;let n=0;for(let r=0;r<i&&(t[r]===","&&n++,n!==3);r++);if(e.hasValue()&&this.isString()&&n!==3){const r=new Ni(t);r.ok&&(r.alpha=e.getNumber(),t=r.toRGBA())}return new O(this.document,this.name,t)}constructor(e,t,i){this.document=e,this.name=t,this.value=i,this.isNormalizedColor=!1}}O.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class gt{clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getRoot(){const[e]=this.viewPorts;return e||xs()}getCurrent(){const{viewPorts:e}=this,t=e[e.length-1];return t||xs()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}constructor(){this.viewPorts=[]}}gt.DEFAULT_VIEWPORT_WIDTH=800;gt.DEFAULT_VIEWPORT_HEIGHT=600;function xs(){return{width:gt.DEFAULT_VIEWPORT_WIDTH,height:gt.DEFAULT_VIEWPORT_HEIGHT}}class Y{static parse(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const[i=t,n=t]=me(e);return new Y(i,n)}static parseScale(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const[i=t,n=i]=me(e);return new Y(i,n)}static parsePath(e){const t=me(e),i=t.length,n=[];for(let r=0;r<i;r+=2)n.push(new Y(t[r],t[r+1]));return n}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){const{x:t,y:i}=this,n=t*e[0]+i*e[2]+e[4],r=t*e[1]+i*e[3]+e[5];this.x=n,this.y=r}constructor(e,t){this.x=e,this.y=t}}class so{isWorking(){return this.working}start(){if(this.working)return;const{screen:e,onClick:t,onMouseMove:i}=this,n=e.ctx.canvas;n.onclick=t,n.onmousemove=i,this.working=!0}stop(){if(!this.working)return;const e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!this.working)return;const{screen:e,events:t,eventElements:i}=this,{style:n}=e.ctx.canvas;let r;n&&(n.cursor=""),t.forEach((o,a)=>{let{run:l}=o;for(r=i[a];r;)l(r),r=r.parent}),this.events=[],this.eventElements=[]}checkPath(e,t){if(!this.working||!t)return;const{events:i,eventElements:n}=this;i.forEach((r,o)=>{let{x:a,y:l}=r;!n[o]&&t.isPointInPath&&t.isPointInPath(a,l)&&(n[o]=e)})}checkBoundingBox(e,t){if(!this.working||!t)return;const{events:i,eventElements:n}=this;i.forEach((r,o)=>{let{x:a,y:l}=r;!n[o]&&t.isPointInBox(a,l)&&(n[o]=e)})}mapXY(e,t){const{window:i,ctx:n}=this.screen,r=new Y(e,t);let o=n.canvas;for(;o;)r.x-=o.offsetLeft,r.y-=o.offsetTop,o=o.offsetParent;return i!=null&&i.scrollX&&(r.x+=i.scrollX),i!=null&&i.scrollY&&(r.y+=i.scrollY),r}onClick(e){const{x:t,y:i}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:i,run(n){n.onClick&&n.onClick()}})}onMouseMove(e){const{x:t,y:i}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:i,run(n){n.onMouseMove&&n.onMouseMove()}})}constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}}const cn=typeof window!="undefined"?window:null,hn=typeof fetch!="undefined"?fetch.bind(void 0):void 0;class Pe{wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){let{document:t,ctx:i,aspectRatio:n,width:r,desiredWidth:o,height:a,desiredHeight:l,minX:c=0,minY:h=0,refX:m,refY:u,clip:d=!1,clipX:p=0,clipY:f=0}=e;const y=tt(n).replace(/^defer\s/,""),[b,v]=y.split(" "),C=b||"xMidYMid",S=v||"meet",w=r/o,x=a/l,A=Math.min(w,x),P=Math.max(w,x);let M=o,L=l;S==="meet"&&(M*=A,L*=A),S==="slice"&&(M*=P,L*=P);const G=new O(t,"refX",m),D=new O(t,"refY",u),X=G.hasValue()&&D.hasValue();if(X&&i.translate(-A*G.getPixels("x"),-A*D.getPixels("y")),d){const z=A*p,j=A*f;i.beginPath(),i.moveTo(z,j),i.lineTo(r,j),i.lineTo(r,a),i.lineTo(z,a),i.closePath(),i.clip()}if(!X){const z=S==="meet"&&A===x,j=S==="slice"&&P===x,ie=S==="meet"&&A===w,_=S==="slice"&&P===w;C.startsWith("xMid")&&(z||j)&&i.translate(r/2-M/2,0),C.endsWith("YMid")&&(ie||_)&&i.translate(0,a/2-L/2),C.startsWith("xMax")&&(z||j)&&i.translate(r-M,0),C.endsWith("YMax")&&(ie||_)&&i.translate(0,a-L)}switch(!0){case C==="none":i.scale(w,x);break;case S==="meet":i.scale(A,A);break;case S==="slice":i.scale(P,P);break}i.translate(-c,-h)}start(e){let{enableRedraw:t=!1,ignoreMouse:i=!1,ignoreAnimation:n=!1,ignoreDimensions:r=!1,ignoreClear:o=!1,forceRedraw:a,scaleWidth:l,scaleHeight:c,offsetX:h,offsetY:m}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{mouse:u}=this,d=1e3/Pe.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=d,this.readyPromise=new Promise(v=>{this.resolveReady=v}),this.isReady()&&this.render(e,r,o,l,c,h,m),!t)return;let p=Date.now(),f=p,y=0;const b=()=>{p=Date.now(),y=p-f,y>=d&&(f=p-y%d,this.shouldUpdate(n,a)&&(this.render(e,r,o,l,c,h,m),u.runEvents())),this.intervalId=yi(b)};i||u.start(),this.intervalId=yi(b)}stop(){this.intervalId&&(yi.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){const{frameDuration:i}=this;if(this.animations.reduce((r,o)=>o.update(i)||r,!1))return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,i,n,r,o,a){const{viewPort:l,ctx:c,isFirstRender:h}=this,m=c.canvas;l.clear(),m.width&&m.height&&l.setCurrent(m.width,m.height);const u=e.getStyle("width"),d=e.getStyle("height");!t&&(h||typeof n!="number"&&typeof r!="number")&&(u.hasValue()&&(m.width=u.getPixels("x"),m.style&&(m.style.width="".concat(m.width,"px"))),d.hasValue()&&(m.height=d.getPixels("y"),m.style&&(m.style.height="".concat(m.height,"px"))));let p=m.clientWidth||m.width,f=m.clientHeight||m.height;if(t&&u.hasValue()&&d.hasValue()&&(p=u.getPixels("x"),f=d.getPixels("y")),l.setCurrent(p,f),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof a=="number"&&e.getAttribute("y",!0).setValue(a),typeof n=="number"||typeof r=="number"){const y=me(e.getAttribute("viewBox").getString());let b=0,v=0;if(typeof n=="number"){const S=e.getStyle("width");S.hasValue()?b=S.getPixels("x")/n:y[2]&&!isNaN(y[2])&&(b=y[2]/n)}if(typeof r=="number"){const S=e.getStyle("height");S.hasValue()?v=S.getPixels("y")/r:y[3]&&!isNaN(y[3])&&(v=y[3]/r)}b||(b=v),v||(v=b),e.getAttribute("width",!0).setValue(n),e.getAttribute("height",!0).setValue(r);const C=e.getStyle("transform",!0,!0);C.setValue("".concat(C.getString()," scale(").concat(1/b,", ").concat(1/v,")"))}i||c.clearRect(0,0,p,f),e.render(c),h&&(this.isFirstRender=!1)}constructor(e,{fetch:t=hn,window:i=cn}={}){if(this.ctx=e,this.viewPort=new gt,this.mouse=new so(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=i,!t)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=t}}Pe.defaultWindow=cn;Pe.defaultFetch=hn;Pe.FRAMERATE=30;Pe.MAX_VIRTUAL_PIXELS=3e4;const{defaultFetch:no}=Pe,ro=typeof DOMParser!="undefined"?DOMParser:void 0;class vi{async parse(e){return e.startsWith("<")?this.parseFromString(e):this.load(e)}parseFromString(e){const t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){const t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent||"Unknown parse error");return e}async load(e){const i=await(await this.fetch(e)).text();return this.parseFromString(i)}constructor({fetch:e=no,DOMParser:t=ro}={}){if(!e)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!t)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=e,this.DOMParser=t}}class ao{apply(e){const{x:t,y:i}=this.point;e.translate(t||0,i||0)}unapply(e){const{x:t,y:i}=this.point;e.translate(-1*t||0,-1*i||0)}applyToPoint(e){const{x:t,y:i}=this.point;e.applyTransform([1,0,0,1,t||0,i||0])}constructor(e,t){this.type="translate",this.point=Y.parse(t)}}class oo{apply(e){const{cx:t,cy:i,originX:n,originY:r,angle:o}=this,a=t+n.getPixels("x"),l=i+r.getPixels("y");e.translate(a,l),e.rotate(o.getRadians()),e.translate(-a,-l)}unapply(e){const{cx:t,cy:i,originX:n,originY:r,angle:o}=this,a=t+n.getPixels("x"),l=i+r.getPixels("y");e.translate(a,l),e.rotate(-1*o.getRadians()),e.translate(-a,-l)}applyToPoint(e){const{cx:t,cy:i,angle:n}=this,r=n.getRadians();e.applyTransform([1,0,0,1,t||0,i||0]),e.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),e.applyTransform([1,0,0,1,-t||0,-i||0])}constructor(e,t,i){this.type="rotate";const n=me(t);this.angle=new O(e,"angle",n[0]),this.originX=i[0],this.originY=i[1],this.cx=n[1]||0,this.cy=n[2]||0}}class lo{apply(e){const{scale:{x:t,y:i},originX:n,originY:r}=this,o=n.getPixels("x"),a=r.getPixels("y");e.translate(o,a),e.scale(t,i||t),e.translate(-o,-a)}unapply(e){const{scale:{x:t,y:i},originX:n,originY:r}=this,o=n.getPixels("x"),a=r.getPixels("y");e.translate(o,a),e.scale(1/t,1/i||t),e.translate(-o,-a)}applyToPoint(e){const{x:t,y:i}=this.scale;e.applyTransform([t||0,0,0,i||0,0,0])}constructor(e,t,i){this.type="scale";const n=Y.parseScale(t);(n.x===0||n.y===0)&&(n.x=_e,n.y=_e),this.scale=n,this.originX=i[0],this.originY=i[1]}}class un{apply(e){const{originX:t,originY:i,matrix:n}=this,r=t.getPixels("x"),o=i.getPixels("y");e.translate(r,o),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),e.translate(-r,-o)}unapply(e){const{originX:t,originY:i,matrix:n}=this,r=n[0],o=n[2],a=n[4],l=n[1],c=n[3],h=n[5],m=0,u=0,d=1,p=1/(r*(c*d-h*u)-o*(l*d-h*m)+a*(l*u-c*m)),f=t.getPixels("x"),y=i.getPixels("y");e.translate(f,y),e.transform(p*(c*d-h*u),p*(h*m-l*d),p*(a*u-o*d),p*(r*d-a*m),p*(o*h-a*c),p*(a*l-r*h)),e.translate(-f,-y)}applyToPoint(e){e.applyTransform(this.matrix)}constructor(e,t,i){this.type="matrix",this.matrix=Ya(t),this.originX=i[0],this.originY=i[1]}}class dn extends un{constructor(e,t,i){super(e,t,i),this.type="skew",this.angle=new O(e,"angle",t)}}class co extends dn{constructor(e,t,i){super(e,t,i),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class ho extends dn{constructor(e,t,i){super(e,t,i),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function uo(s){return tt(s).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function mo(s){const[e="",t=""]=s.split("(");return[e.trim(),t.trim().replace(")","")]}class Ye{static fromElement(e,t){const i=t.getStyle("transform",!1,!0);if(i.hasValue()){const[n,r=n]=t.getStyle("transform-origin",!1,!0).split();if(n&&r){const o=[n,r];return new Ye(e,i.getString(),o)}}return null}apply(e){this.transforms.forEach(t=>t.apply(e))}unapply(e){this.transforms.forEach(t=>t.unapply(e))}applyToPoint(e){this.transforms.forEach(t=>t.applyToPoint(e))}constructor(e,t,i){this.document=e,this.transforms=[],uo(t).forEach(r=>{if(r==="none")return;const[o,a]=mo(r),l=Ye.transformTypes[o];l&&this.transforms.push(new l(this.document,a,i))})}}Ye.transformTypes={translate:ao,rotate:oo,scale:lo,matrix:un,skewX:co,skewY:ho};class W{getAttribute(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.attributes[e];if(!i&&t){const n=new O(this.document,e,"");return this.attributes[e]=n,n}return i||O.empty(this.document)}getHrefAttribute(){let e;for(const t in this.attributes)if(t==="href"||t.endsWith(":href")){e=this.attributes[t];break}return e||O.empty(this.document)}getStyle(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.styles[e];if(n)return n;const r=this.getAttribute(e);if(r.hasValue())return this.styles[e]=r,r;if(!i){const{parent:o}=this;if(o){const a=o.getStyle(e);if(a.hasValue())return a}}if(t){const o=new O(this.document,e,"");return this.styles[e]=o,o}return O.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){const t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const t=this.getStyle("filter").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){const t=Ye.fromElement(this.document,this);t&&t.apply(e);const i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){const n=i.getDefinition();n&&n.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){const t=e instanceof W?e:this.document.createElement(e);t.parent=this,W.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t;const{node:i}=this;if(typeof i.matches=="function")return i.matches(e);const n=(t=i.getAttribute)===null||t===void 0?void 0:t.call(i,"class");return!n||n===""?!1:n.split(" ").some(r=>".".concat(r)===e)}addStylesFromStyleDefinition(){const{styles:e,stylesSpecificity:t}=this.document;let i;for(const n in e)if(!n.startsWith("@")&&this.matchesSelector(n)){const r=e[n],o=t[n];if(r)for(const a in r){let l=this.stylesSpecificity[a];typeof l=="undefined"&&(l="000"),o&&o>=l&&(i=r[a],i&&(this.styles[a]=i),this.stylesSpecificity[a]=o)}}}removeStyles(e,t){return t.reduce((n,r)=>{const o=e.getStyle(r);if(!o.hasValue())return n;const a=o.getString();return o.setValue(""),[...n,[r,a]]},[])}restoreStyles(e,t){t.forEach(i=>{let[n,r]=i;e.getStyle(n,!0).setValue(r)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}constructor(e,t,i=!1){if(this.document=e,this.node=t,this.captureTextNodes=i,this.type="",this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!t||t.nodeType!==1)return;Array.from(t.attributes).forEach(o=>{const a=ja(o.nodeName);this.attributes[a]=new O(e,a,o.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(a=>a.trim()).forEach(a=>{if(!a)return;const[l,c]=a.split(":").map(h=>h.trim());l&&(this.styles[l]=new O(e,l,c))});const{definitions:n}=e,r=this.getAttribute("id");r.hasValue()&&(n[r.getString()]||(n[r.getString()]=this)),Array.from(t.childNodes).forEach(o=>{if(o.nodeType===1)this.addChild(o);else if(i&&(o.nodeType===3||o.nodeType===4)){const a=e.createTextNode(o);a.getText().length>0&&this.addChild(a)}})}}W.ignoreChildTypes=["title"];class go extends W{constructor(e,t,i){super(e,t,i)}}function po(s){const e=s.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function fo(s){return typeof process=="undefined"?s:s.trim().split(",").map(po).join(",")}function yo(s){if(!s)return"";const e=s.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function bo(s){if(!s)return"";const e=s.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class le{static parse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,i="",n="",r="",o="",a="";const l=tt(e).trim().split(" "),c={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(h=>{switch(!0){case(!c.fontStyle&&le.styles.includes(h)):h!=="inherit"&&(i=h),c.fontStyle=!0;break;case(!c.fontVariant&&le.variants.includes(h)):h!=="inherit"&&(n=h),c.fontStyle=!0,c.fontVariant=!0;break;case(!c.fontWeight&&le.weights.includes(h)):h!=="inherit"&&(r=h),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0;break;case!c.fontSize:h!=="inherit"&&(o=h.split("/")[0]||""),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0,c.fontSize=!0;break;default:h!=="inherit"&&(a+=h)}}),new le(i,n,r,o,a,t)}toString(){return[yo(this.fontStyle),this.fontVariant,bo(this.fontWeight),this.fontSize,fo(this.fontFamily)].join(" ").trim()}constructor(e,t,i,n,r,o){const a=o?typeof o=="string"?le.parse(o):o:{};this.fontFamily=r||a.fontFamily,this.fontSize=n||a.fontSize,this.fontStyle=e||a.fontStyle,this.fontWeight=i||a.fontWeight,this.fontVariant=t||a.fontVariant}}le.styles="normal|italic|oblique|inherit";le.variants="normal|small-caps|inherit";le.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class Ae{get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e!="undefined"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t!="undefined"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,0)}addY(e){this.addPoint(0,e)}addBoundingBox(e){if(!e)return;const{x1:t,y1:i,x2:n,y2:r}=e;this.addPoint(t,i),this.addPoint(n,r)}sumCubic(e,t,i,n,r){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*i+3*(1-e)*Math.pow(e,2)*n+Math.pow(e,3)*r}bezierCurveAdd(e,t,i,n,r){const o=6*t-12*i+6*n,a=-3*t+9*i-9*n+3*r,l=3*i-3*t;if(a===0){if(o===0)return;const u=-l/o;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,i,n,r)):this.addY(this.sumCubic(u,t,i,n,r)));return}const c=Math.pow(o,2)-4*l*a;if(c<0)return;const h=(-o+Math.sqrt(c))/(2*a);0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,i,n,r)):this.addY(this.sumCubic(h,t,i,n,r)));const m=(-o-Math.sqrt(c))/(2*a);0<m&&m<1&&(e?this.addX(this.sumCubic(m,t,i,n,r)):this.addY(this.sumCubic(m,t,i,n,r)))}addBezierCurve(e,t,i,n,r,o,a,l){this.addPoint(e,t),this.addPoint(a,l),this.bezierCurveAdd(!0,e,i,r,a),this.bezierCurveAdd(!1,t,n,o,l)}addQuadraticCurve(e,t,i,n,r,o){const a=e+.6666666666666666*(i-e),l=t+2/3*(n-t),c=a+1/3*(r-e),h=l+1/3*(o-t);this.addBezierCurve(e,t,a,c,l,h,r,o)}isPointInBox(e,t){const{x1:i,y1:n,x2:r,y2:o}=this;return i<=e&&e<=r&&n<=t&&t<=o}constructor(e=Number.NaN,t=Number.NaN,i=Number.NaN,n=Number.NaN){this.x1=e,this.y1=t,this.x2=i,this.y2=n,this.addPoint(e,t),this.addPoint(i,n)}}class Xe extends W{calculateOpacity(){let e=1,t=this;for(;t;){const i=t.getStyle("opacity",!1,!0);i.hasValue(!0)&&(e*=i.getNumber()),t=t.parent}return e}setContext(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){const i=this.getStyle("fill"),n=this.getStyle("fill-opacity"),r=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(i.isUrlDefinition()){const d=i.getFillStyleDefinition(this,n);d&&(e.fillStyle=d)}else if(i.hasValue()){i.getString()==="currentColor"&&i.setValue(this.getStyle("color").getColor());const d=i.getColor();d!=="inherit"&&(e.fillStyle=d==="none"?"rgba(0,0,0,0)":d)}if(n.hasValue()){const d=new O(this.document,"fill",e.fillStyle).addOpacity(n).getColor();e.fillStyle=d}if(r.isUrlDefinition()){const d=r.getFillStyleDefinition(this,o);d&&(e.strokeStyle=d)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());const d=r.getString();d!=="inherit"&&(e.strokeStyle=d==="none"?"rgba(0,0,0,0)":d)}if(o.hasValue()){const d=new O(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=d}const a=this.getStyle("stroke-width");if(a.hasValue()){const d=a.getPixels();e.lineWidth=d||_e}const l=this.getStyle("stroke-linecap"),c=this.getStyle("stroke-linejoin"),h=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),u=this.getStyle("stroke-dashoffset");if(l.hasValue()&&(e.lineCap=l.getString()),c.hasValue()&&(e.lineJoin=c.getString()),h.hasValue()&&(e.miterLimit=h.getNumber()),m.hasValue()&&m.getString()!=="none"){const d=me(m.getString());typeof e.setLineDash!="undefined"?e.setLineDash(d):typeof e.webkitLineDash!="undefined"?e.webkitLineDash=d:typeof e.mozDash!="undefined"&&!(d.length===1&&d[0]===0)&&(e.mozDash=d);const p=u.getPixels();typeof e.lineDashOffset!="undefined"?e.lineDashOffset=p:typeof e.webkitLineDashOffset!="undefined"?e.webkitLineDashOffset=p:typeof e.mozDashOffset!="undefined"&&(e.mozDashOffset=p)}}if(this.modifiedEmSizeStack=!1,typeof e.font!="undefined"){const i=this.getStyle("font"),n=this.getStyle("font-style"),r=this.getStyle("font-variant"),o=this.getStyle("font-weight"),a=this.getStyle("font-size"),l=this.getStyle("font-family"),c=new le(n.getString(),r.getString(),o.getString(),a.hasValue()?"".concat(a.getPixels(!0),"px"):"",l.getString(),le.parse(i.getString(),e.font));n.setValue(c.fontStyle),r.setValue(c.fontVariant),o.setValue(c.fontWeight),a.setValue(c.fontSize),l.setValue(c.fontFamily),e.font=c.toString(),a.isPixels()&&(this.document.emSize=a.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}constructor(...e){super(...e),this.modifiedEmSizeStack=!1}}class Ve extends Xe{setContext(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);const i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(e.textBaseline=i)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);let t=null;return this.children.forEach((i,n)=>{const r=this.getChildBoundingBox(e,this,this,n);t?t.addBoundingBox(r):t=r}),t}getFontSize(){const{document:e,parent:t}=this,i=le.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(i)}getTElementBoundingBox(e){const t=this.getFontSize();return new Ae(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,i){const n=t[i];let r;if(e.isArabic){var o;const a=t.length,l=t[i-1],c=t[i+1];let h="isolated";(i===0||l===" ")&&i<a-1&&c!==" "&&(h="terminal"),i>0&&l!==" "&&i<a-1&&c!==" "&&(h="medial"),i>0&&l!==" "&&(i===a-1||c===" ")&&(h="initial"),r=((o=e.arabicGlyphs[n])===null||o===void 0?void 0:o[h])||e.glyphs[n]}else r=e.glyphs[n];return r||(r=e.missingGlyph),r}getText(){return""}getTextFromNode(e){const t=e||this.node,i=Array.from(t.parentNode.childNodes),n=i.indexOf(t),r=i.length-1;let o=tt(t.textContent||"");return n===0&&(o=Wa(o)),n===r&&(o=qa(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((i,n)=>{this.renderChild(e,this,this,n)});const{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){const{document:t,parent:i}=this,n=this.getText(),r=i.getStyle("font-family").getDefinition();if(r){const{unitsPerEm:l}=r.fontFace,c=le.parse(t.ctx.font),h=i.getStyle("font-size").getNumber(c.fontSize),m=i.getStyle("font-style").getString(c.fontStyle),u=h/l,d=r.isRTL?n.split("").reverse().join(""):n,p=me(i.getAttribute("dx").getString()),f=d.length;for(let y=0;y<f;y++){const b=this.getGlyph(r,d,y);e.translate(this.x,this.y),e.scale(u,-u);const v=e.lineWidth;e.lineWidth=e.lineWidth*l/h,m==="italic"&&e.transform(1,0,.4,1,0,0),b.render(e),m==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=v,e.scale(1/u,-1/u),e.translate(-this.x,-this.y),this.x+=h*(b.horizAdvX||r.horizAdvX)/l,typeof p[y]!="undefined"&&!isNaN(p[y])&&(this.x+=p[y])}return}const{x:o,y:a}=this;e.fillStyle&&e.fillText(n,o,a),e.strokeStyle&&e.strokeText(n,o,a)}applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;const e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),i=!1;let n=0;t==="start"&&!i||t==="end"&&i?n=e.x-this.minX:t==="end"&&!i||t==="start"&&i?n=e.x-this.maxX:n=e.x-(this.minX+this.maxX)/2;for(let r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(e){this.children.forEach((t,i)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,i)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,i,n){const r=i.children[n];r.children.length>0?r.children.forEach((o,a)=>{t.adjustChildCoordinatesRecursiveCore(e,t,r,a)}):this.adjustChildCoordinates(e,t,i,n)}adjustChildCoordinates(e,t,i,n){const r=i.children[n];if(typeof r.measureText!="function")return r;e.save(),r.setContext(e,!0);const o=r.getAttribute("x"),a=r.getAttribute("y"),l=r.getAttribute("dx"),c=r.getAttribute("dy"),h=r.getStyle("font-family").getDefinition(),m=Boolean(h==null?void 0:h.isRTL);n===0&&(o.hasValue()||o.setValue(r.getInheritedAttribute("x")),a.hasValue()||a.setValue(r.getInheritedAttribute("y")),l.hasValue()||l.setValue(r.getInheritedAttribute("dx")),c.hasValue()||c.setValue(r.getInheritedAttribute("dy")));const u=r.measureText(e);return m&&(t.x-=u),o.hasValue()?(t.applyAnchoring(),r.x=o.getPixels("x"),l.hasValue()&&(r.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),r.x=t.x),t.x=r.x,m||(t.x+=u),a.hasValue()?(r.y=a.getPixels("y"),c.hasValue()&&(r.y+=c.getPixels("y"))):(c.hasValue()&&(t.y+=c.getPixels("y")),r.y=t.y),t.y=r.y,t.leafTexts.push(r),t.minX=Math.min(t.minX,r.x,r.x+u),t.maxX=Math.max(t.maxX,r.x,r.x+u),r.clearContext(e),e.restore(),r}getChildBoundingBox(e,t,i,n){const r=i.children[n];if(typeof r.getBoundingBox!="function")return null;const o=r.getBoundingBox(e);return o&&r.children.forEach((a,l)=>{const c=t.getChildBoundingBox(e,t,r,l);o.addBoundingBox(c)}),o}renderChild(e,t,i,n){const r=i.children[n];r.render(e),r.children.forEach((o,a)=>{t.renderChild(e,t,r,a)})}measureText(e){const{measureCache:t}=this;if(~t)return t;const i=this.getText(),n=this.measureTargetText(e,i);return this.measureCache=n,n}measureTargetText(e,t){if(!t.length)return 0;const{parent:i}=this,n=i.getStyle("font-family").getDefinition();if(n){const o=this.getFontSize(),a=n.isRTL?t.split("").reverse().join(""):t,l=me(i.getAttribute("dx").getString()),c=a.length;let h=0;for(let m=0;m<c;m++)h+=(this.getGlyph(n,a,m).horizAdvX||n.horizAdvX)*o/n.fontFace.unitsPerEm,typeof l[m]!="undefined"&&!isNaN(l[m])&&(h+=l[m]);return h}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);const{width:r}=e.measureText(t);return this.clearContext(e),e.restore(),r}getInheritedAttribute(e){let t=this;for(;t instanceof Ve&&t.isFirstChild()&&t.parent;){const i=t.parent.getAttribute(e);if(i.hasValue(!0))return i.getString("0");t=t.parent}return null}constructor(e,t,i){super(e,t,new.target===Ve?!0:i),this.type="text",this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.measureCache=-1}}class Qt extends Ve{getText(){return this.text}constructor(e,t,i){super(e,t,new.target===Qt?!0:i),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}}class vo extends Qt{constructor(...e){super(...e),this.type="textNode"}}class R extends T{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Y(0,0),this.control=new Y(0,0),this.current=new Y(0,0),this.points=[],this.angles=[]}isEnd(){const{i:e,commands:t}=this;return e>=t.length-1}next(){const e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";const i=new Y(this.command[e],this.command[t]);return this.makeAbsolute(i)}getAsControlPoint(e,t){const i=this.getPoint(e,t);return this.control=i,i}getAsCurrentPoint(e,t){const i=this.getPoint(e,t);return this.current=i,i}getReflectedControlPoint(){const e=this.previousCommand.type;if(e!==T.CURVE_TO&&e!==T.SMOOTH_CURVE_TO&&e!==T.QUAD_TO&&e!==T.SMOOTH_QUAD_TO)return this.current;const{current:{x:t,y:i},control:{x:n,y:r}}=this;return new Y(2*t-n,2*i-r)}makeAbsolute(e){if(this.command.relative){const{x:t,y:i}=this.current;e.x+=t,e.y+=i}return e}addMarker(e,t,i){const{points:n,angles:r}=this;i&&r.length>0&&!r[r.length-1]&&(r[r.length-1]=n[n.length-1].angleTo(i)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:e}=this,t=e.length;for(let i=0;i<t;i++)if(!e[i]){for(let n=i+1;n<t;n++)if(e[n]){e[i]=e[n];break}}return e}constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=new Y(0,0),this.start=new Y(0,0),this.current=new Y(0,0),this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}}class H extends Xe{path(e){const{pathParser:t}=this,i=new Ae;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case R.MOVE_TO:this.pathM(e,i);break;case R.LINE_TO:this.pathL(e,i);break;case R.HORIZ_LINE_TO:this.pathH(e,i);break;case R.VERT_LINE_TO:this.pathV(e,i);break;case R.CURVE_TO:this.pathC(e,i);break;case R.SMOOTH_CURVE_TO:this.pathS(e,i);break;case R.QUAD_TO:this.pathQ(e,i);break;case R.SMOOTH_QUAD_TO:this.pathT(e,i);break;case R.ARC:this.pathA(e,i);break;case R.CLOSE_PATH:this.pathZ(e,i);break}return i}getBoundingBox(e){return this.path()}getMarkers(){const{pathParser:e}=this,t=e.getMarkerPoints(),i=e.getMarkerAngles();return t.map((r,o)=>[r,i[o]])}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);const t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());const i=this.getMarkers();if(i){const n=i.length-1,r=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(r.isUrlDefinition()){const l=r.getDefinition(),[c,h]=i[0];l.render(e,c,h)}if(o.isUrlDefinition()){const l=o.getDefinition();for(let c=1;c<n;c++){const[h,m]=i[c];l.render(e,h,m)}}if(a.isUrlDefinition()){const l=a.getDefinition(),[c,h]=i[n];l.render(e,c,h)}}}static pathM(e){const t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){const{pathParser:i}=this,{point:n}=H.pathM(i),{x:r,y:o}=n;i.addMarker(n),t.addPoint(r,o),e&&e.moveTo(r,o)}static pathL(e){const{current:t}=e,i=e.getAsCurrentPoint();return{current:t,point:i}}pathL(e,t){const{pathParser:i}=this,{current:n,point:r}=H.pathL(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathH(e){const{current:t,command:i}=e,n=new Y((i.relative?t.x:0)+i.x,t.y);return e.current=n,{current:t,point:n}}pathH(e,t){const{pathParser:i}=this,{current:n,point:r}=H.pathH(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathV(e){const{current:t,command:i}=e,n=new Y(t.x,(i.relative?t.y:0)+i.y);return e.current=n,{current:t,point:n}}pathV(e,t){const{pathParser:i}=this,{current:n,point:r}=H.pathV(i),{x:o,y:a}=r;i.addMarker(r,n),t.addPoint(o,a),e&&e.lineTo(o,a)}static pathC(e){const{current:t}=e,i=e.getPoint("x1","y1"),n=e.getAsControlPoint("x2","y2"),r=e.getAsCurrentPoint();return{current:t,point:i,controlPoint:n,currentPoint:r}}pathC(e,t){const{pathParser:i}=this,{current:n,point:r,controlPoint:o,currentPoint:a}=H.pathC(i);i.addMarker(a,o,r),t.addBezierCurve(n.x,n.y,r.x,r.y,o.x,o.y,a.x,a.y),e&&e.bezierCurveTo(r.x,r.y,o.x,o.y,a.x,a.y)}static pathS(e){const{current:t}=e,i=e.getReflectedControlPoint(),n=e.getAsControlPoint("x2","y2"),r=e.getAsCurrentPoint();return{current:t,point:i,controlPoint:n,currentPoint:r}}pathS(e,t){const{pathParser:i}=this,{current:n,point:r,controlPoint:o,currentPoint:a}=H.pathS(i);i.addMarker(a,o,r),t.addBezierCurve(n.x,n.y,r.x,r.y,o.x,o.y,a.x,a.y),e&&e.bezierCurveTo(r.x,r.y,o.x,o.y,a.x,a.y)}static pathQ(e){const{current:t}=e,i=e.getAsControlPoint("x1","y1"),n=e.getAsCurrentPoint();return{current:t,controlPoint:i,currentPoint:n}}pathQ(e,t){const{pathParser:i}=this,{current:n,controlPoint:r,currentPoint:o}=H.pathQ(i);i.addMarker(o,r,r),t.addQuadraticCurve(n.x,n.y,r.x,r.y,o.x,o.y),e&&e.quadraticCurveTo(r.x,r.y,o.x,o.y)}static pathT(e){const{current:t}=e,i=e.getReflectedControlPoint();e.control=i;const n=e.getAsCurrentPoint();return{current:t,controlPoint:i,currentPoint:n}}pathT(e,t){const{pathParser:i}=this,{current:n,controlPoint:r,currentPoint:o}=H.pathT(i);i.addMarker(o,r,r),t.addQuadraticCurve(n.x,n.y,r.x,r.y,o.x,o.y),e&&e.quadraticCurveTo(r.x,r.y,o.x,o.y)}static pathA(e){const{current:t,command:i}=e;let{rX:n,rY:r,xRot:o,lArcFlag:a,sweepFlag:l}=i;const c=o*(Math.PI/180),h=e.getAsCurrentPoint(),m=new Y(Math.cos(c)*(t.x-h.x)/2+Math.sin(c)*(t.y-h.y)/2,-Math.sin(c)*(t.x-h.x)/2+Math.cos(c)*(t.y-h.y)/2),u=Math.pow(m.x,2)/Math.pow(n,2)+Math.pow(m.y,2)/Math.pow(r,2);u>1&&(n*=Math.sqrt(u),r*=Math.sqrt(u));let d=(a===l?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(r,2)-Math.pow(n,2)*Math.pow(m.y,2)-Math.pow(r,2)*Math.pow(m.x,2))/(Math.pow(n,2)*Math.pow(m.y,2)+Math.pow(r,2)*Math.pow(m.x,2)));isNaN(d)&&(d=0);const p=new Y(d*n*m.y/r,d*-r*m.x/n),f=new Y((t.x+h.x)/2+Math.cos(c)*p.x-Math.sin(c)*p.y,(t.y+h.y)/2+Math.sin(c)*p.x+Math.cos(c)*p.y),y=fs([1,0],[(m.x-p.x)/n,(m.y-p.y)/r]),b=[(m.x-p.x)/n,(m.y-p.y)/r],v=[(-m.x-p.x)/n,(-m.y-p.y)/r];let C=fs(b,v);return Mi(b,v)<=-1&&(C=Math.PI),Mi(b,v)>=1&&(C=0),{currentPoint:h,rX:n,rY:r,sweepFlag:l,xAxisRotation:c,centp:f,a1:y,ad:C}}pathA(e,t){const{pathParser:i}=this,{currentPoint:n,rX:r,rY:o,sweepFlag:a,xAxisRotation:l,centp:c,a1:h,ad:m}=H.pathA(i),u=1-a?1:-1,d=h+u*(m/2),p=new Y(c.x+r*Math.cos(d),c.y+o*Math.sin(d));if(i.addMarkerAngle(p,d-u*Math.PI/2),i.addMarkerAngle(n,d-u*Math.PI),t.addPoint(n.x,n.y),e&&!isNaN(h)&&!isNaN(m)){const f=r>o?r:o,y=r>o?1:r/o,b=r>o?o/r:1;e.translate(c.x,c.y),e.rotate(l),e.scale(y,b),e.arc(0,0,f,h,h+m,Boolean(1-a)),e.scale(1/y,1/b),e.rotate(-l),e.translate(-c.x,-c.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){H.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}constructor(e,t,i){super(e,t,i),this.type="path",this.pathParser=new R(this.getAttribute("d").getString())}}class bt extends Xe{setContext(e){var t;const{document:i}=this,{screen:n,window:r}=i,o=e.canvas;if(n.setDefaults(e),"style"in o&&typeof e.font!="undefined"&&r&&typeof r.getComputedStyle!="undefined"){e.font=r.getComputedStyle(o).getPropertyValue("font");const v=new O(i,"fontSize",le.parse(e.font).fontSize);v.hasValue()&&(i.rootEmSize=v.getPixels("y"),i.emSize=i.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:a,height:l}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");const c=this.getAttribute("refX"),h=this.getAttribute("refY"),m=this.getAttribute("viewBox"),u=m.hasValue()?me(m.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let p=0,f=0,y=0,b=0;u&&(p=u[0],f=u[1]),this.root||(a=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=p,b=f,p=0,f=0)),n.viewPort.setCurrent(a,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),u&&(a=u[2],l=u[3]),i.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:a,height:n.viewPort.height,desiredHeight:l,minX:p,minY:f,refX:c.getValue(),refY:h.getValue(),clip:d,clipX:y,clipY:b}),u&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(a,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.getAttribute("width",!0),r=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),a=this.getAttribute("style"),l=n.getNumber(0),c=r.getNumber(0);if(i)if(typeof i=="string")this.getAttribute("preserveAspectRatio",!0).setValue(i);else{const h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(e),r.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(l||e," ").concat(c||t)),a.hasValue()){const h=this.getStyle("width"),m=this.getStyle("height");h.hasValue()&&h.setValue("".concat(e,"px")),m.hasValue()&&m.setValue("".concat(t,"px"))}}constructor(...e){super(...e),this.type="svg",this.root=!1}}class mn extends H{path(e){const t=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),r=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),a=this.getAttribute("ry");let l=o.getPixels("x"),c=a.getPixels("y");if(o.hasValue()&&!a.hasValue()&&(c=l),a.hasValue()&&!o.hasValue()&&(l=c),l=Math.min(l,n/2),c=Math.min(c,r/2),e){const h=4*((Math.sqrt(2)-1)/3);e.beginPath(),r>0&&n>0&&(e.moveTo(t+l,i),e.lineTo(t+n-l,i),e.bezierCurveTo(t+n-l+h*l,i,t+n,i+c-h*c,t+n,i+c),e.lineTo(t+n,i+r-c),e.bezierCurveTo(t+n,i+r-c+h*c,t+n-l+h*l,i+r,t+n-l,i+r),e.lineTo(t+l,i+r),e.bezierCurveTo(t+l-h*l,i+r,t,i+r-c+h*c,t,i+r-c),e.lineTo(t,i+c),e.bezierCurveTo(t,i+c-h*c,t+l-h*l,i,t+l,i),e.closePath())}return new Ae(t,i,t+n,i+r)}getMarkers(){return null}constructor(...e){super(...e),this.type="rect"}}class Ao extends H{path(e){const t=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return e&&n>0&&(e.beginPath(),e.arc(t,i,n,0,Math.PI*2,!1),e.closePath()),new Ae(t-n,i-n,t+n,i+n)}getMarkers(){return null}constructor(...e){super(...e),this.type="circle"}}class wo extends H{path(e){const t=4*((Math.sqrt(2)-1)/3),i=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),r=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&i>0&&n>0&&(e.beginPath(),e.moveTo(r+i,o),e.bezierCurveTo(r+i,o+t*n,r+t*i,o+n,r,o+n),e.bezierCurveTo(r-t*i,o+n,r-i,o+t*n,r-i,o),e.bezierCurveTo(r-i,o-t*n,r-t*i,o-n,r,o-n),e.bezierCurveTo(r+t*i,o-n,r+i,o-t*n,r+i,o),e.closePath()),new Ae(r-i,o-n,r+i,o+n)}getMarkers(){return null}constructor(...e){super(...e),this.type="ellipse"}}class Co extends H{getPoints(){return[new Y(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Y(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){const[{x:t,y:i},{x:n,y:r}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,i),e.lineTo(n,r)),new Ae(t,i,n,r)}getMarkers(){const[e,t]=this.getPoints(),i=e.angleTo(t);return[[e,i],[t,i]]}constructor(...e){super(...e),this.type="line"}}class gn extends H{path(e){const{points:t}=this,[{x:i,y:n}]=t,r=new Ae(i,n);return e&&(e.beginPath(),e.moveTo(i,n)),t.forEach(o=>{let{x:a,y:l}=o;r.addPoint(a,l),e&&e.lineTo(a,l)}),r}getMarkers(){const{points:e}=this,t=e.length-1,i=[];return e.forEach((n,r)=>{r!==t&&i.push([n,n.angleTo(e[r+1])])}),i.length>0&&i.push([e[e.length-1],i[i.length-1][1]]),i}constructor(e,t,i){super(e,t,i),this.type="polyline",this.points=[],this.points=Y.parsePath(this.getAttribute("points").getString())}}class To extends gn{path(e){const t=super.path(e),[{x:i,y:n}]=this.points;return e&&(e.lineTo(i,n),e.closePath()),t}constructor(...e){super(...e),this.type="polygon"}}class xo extends W{createPattern(e,t,i){const n=this.getStyle("width").getPixels("x",!0),r=this.getStyle("height").getPixels("y",!0),o=new bt(this.document,null);o.attributes.viewBox=new O(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new O(this.document,"width","".concat(n,"px")),o.attributes.height=new O(this.document,"height","".concat(r,"px")),o.attributes.transform=new O(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;const a=this.document.createCanvas(n,r),l=a.getContext("2d"),c=this.getAttribute("x"),h=this.getAttribute("y");c.hasValue()&&h.hasValue()&&l.translate(c.getPixels("x",!0),h.getPixels("y",!0)),i.hasValue()?this.styles["fill-opacity"]=i:Reflect.deleteProperty(this.styles,"fill-opacity");for(let u=-1;u<=1;u++)for(let d=-1;d<=1;d++)l.save(),o.attributes.x=new O(this.document,"x",u*a.width),o.attributes.y=new O(this.document,"y",d*a.height),o.render(l),l.restore();return e.createPattern(a,"repeat")}constructor(...e){super(...e),this.type="pattern"}}class So extends W{render(e,t,i){if(!t)return;const{x:n,y:r}=t,o=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(n,r),o==="auto"&&e.rotate(i),a==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();const l=new bt(this.document);l.type=this.type,l.attributes.viewBox=new O(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new O(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new O(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new O(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new O(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new O(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new O(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new O(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),a==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-i),e.translate(-n,-r)}constructor(...e){super(...e),this.type="marker"}}class Eo extends W{render(){}constructor(...e){super(...e),this.type="defs"}}class Di extends Xe{getBoundingBox(e){const t=new Ae;return this.children.forEach(i=>{t.addBoundingBox(i.getBoundingBox(e))}),t}constructor(...e){super(...e),this.type="g"}}class pn extends W{getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,i){let n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));const{stops:r}=n,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(i,r[r.length-1].color);if(r.forEach(a=>{o.addColorStop(a.offset,this.addParentOpacity(i,a.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:a}=this,{MAX_VIRTUAL_PIXELS:l}=Pe,{viewPort:c}=a.screen,h=c.getRoot(),m=new mn(a);m.attributes.x=new O(a,"x",-l/3),m.attributes.y=new O(a,"y",-l/3),m.attributes.width=new O(a,"width",l),m.attributes.height=new O(a,"height",l);const u=new Di(a);u.attributes.transform=new O(a,"transform",this.getAttribute("gradientTransform").getValue()),u.children=[m];const d=new bt(a);d.attributes.x=new O(a,"x",0),d.attributes.y=new O(a,"y",0),d.attributes.width=new O(a,"width",h.width),d.attributes.height=new O(a,"height",h.height),d.children=[u];const p=a.createCanvas(h.width,h.height),f=p.getContext("2d");return f.fillStyle=o,d.render(f),f.createPattern(p,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new O(this.document,"color",t).addOpacity(e).getColor():t}constructor(e,t,i){super(e,t,i),this.attributesToInherit=["gradientUnits"],this.stops=[];const{stops:n,children:r}=this;r.forEach(o=>{o.type==="stop"&&n.push(o)})}}class ko extends pn{getGradient(e,t){const i=this.getGradientUnits()==="objectBoundingBox",n=i?t.getBoundingBox(e):null;if(i&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));const r=i?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=i?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=i?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=i?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return r===a&&o===l?null:e.createLinearGradient(r,o,a,l)}constructor(e,t,i){super(e,t,i),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}}class No extends pn{getGradient(e,t){const i=this.getGradientUnits()==="objectBoundingBox",n=t.getBoundingBox(e);if(i&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");const r=i?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=i?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let a=r,l=o;this.getAttribute("fx").hasValue()&&(a=i?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=i?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const c=i?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,l,h,r,o,c)}constructor(e,t,i){super(e,t,i),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class Po extends W{constructor(e,t,i){super(e,t,i),this.type="stop";const n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),r=this.getStyle("stop-opacity");let o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),r.hasValue()&&(o=o.addOpacity(r)),this.offset=n,this.color=o.getColor()}}class Ui extends W{getProperty(){const e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){const{initialUnits:e}=this,{progress:t,from:i,to:n}=this.getProgress();let r=i.getNumber()+(n.getNumber()-i.getNumber())*t;return e==="%"&&(r*=100),"".concat(r).concat(e)}update(e){const{parent:t}=this,i=this.getProperty();if(this.initialValue||(this.initialValue=i.getString(),this.initialUnits=i.getUnits()),this.duration>this.maxDuration){const r=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(r==="freeze"&&!this.frozen)this.frozen=!0,t&&i&&(t.animationFrozen=!0,t.animationFrozenValue=i.getString());else if(r==="remove"&&!this.removed)return this.removed=!0,t&&i&&i.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;let n=!1;if(this.begin<this.duration){let r=this.calcValue();const o=this.getAttribute("type");if(o.hasValue()){const a=o.getString();r="".concat(a,"(").concat(r,")")}i.setValue(r),n=!0}return n}getProgress(){const{document:e,values:t}=this;let i=(this.duration-this.begin)/(this.maxDuration-this.begin),n,r;if(t.hasValue()){const o=i*(t.getValue().length-1),a=Math.floor(o),l=Math.ceil(o);let c;c=t.getValue()[a],n=new O(e,"from",c?parseFloat(c):0),c=t.getValue()[l],r=new O(e,"to",c?parseFloat(c):0),i=(o-a)/(l-a)}else n=this.from,r=this.to;return{progress:i,from:n,to:r}}constructor(e,t,i){super(e,t,i),this.type="animate",this.duration=0,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new O(e,"values",null);const n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}}class Mo extends Ui{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=new Ni(t.getColor()),r=new Ni(i.getColor());if(n.ok&&r.ok){const o=n.r+(r.r-n.r)*e,a=n.g+(r.g-n.g)*e,l=n.b+(r.b-n.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(a),", ").concat(Math.floor(l),")")}return this.getAttribute("from").getColor()}constructor(...e){super(...e),this.type="animateColor"}}class Oo extends Ui{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=me(t.getString()),r=me(i.getString());return n.map((a,l)=>{const c=r[l];return a+(c-a)*e}).join(" ")}constructor(...e){super(...e),this.type="animateTransform"}}class fn extends W{constructor(e,t,i){super(e,t,i),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class Fi extends H{constructor(e,t,i){super(e,t,i),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class yn extends Fi{constructor(...e){super(...e),this.type="missing-glyph",this.horizAdvX=0}}class Io extends W{render(){}constructor(e,t,i){super(e,t,i),this.type="font",this.isArabic=!1,this.glyphs={},this.arabicGlyphs={},this.isRTL=!1,this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:n}=e,{children:r}=this;for(const o of r)if(o instanceof fn){this.fontFace=o;const a=o.getStyle("font-family");a.hasValue()&&(n[a.getString()]=this)}else if(o instanceof yn)this.missingGlyph=o;else if(o instanceof Fi)if(o.arabicForm){this.isRTL=!0,this.isArabic=!0;const a=this.arabicGlyphs[o.unicode];typeof a=="undefined"?this.arabicGlyphs[o.unicode]={[o.arabicForm]:o}:a[o.arabicForm]=o}else this.glyphs[o.unicode]=o}}class Bo extends Ve{getText(){const e=this.getHrefAttribute().getDefinition();if(e){const t=e.children[0];if(t)return t.getText()}return""}constructor(...e){super(...e),this.type="tref"}}class Ro extends Ve{getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);const{document:t,x:i,y:n}=this,{mouse:r}=t.screen,o=new O(t,"fontSize",le.parse(t.ctx.font).fontSize);r.isWorking()&&r.checkBoundingBox(this,new Ae(i,n-o.getPixels("y"),i+this.measureText(e),n))}else if(this.children.length>0){const t=new Di(this.document);t.children=this.children,t.parent=this,t.render(e)}}onClick(){const{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){const e=this.document.ctx;e.canvas.style.cursor="pointer"}constructor(e,t,i){super(e,t,i),this.type="a";const{childNodes:n}=t,r=n[0],o=n.length>0&&Array.from(n).every(a=>a.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(r):""}}class Lo extends Ve{getText(){return this.text}path(e){const{dataArray:t}=this;e&&e.beginPath(),t.forEach(i=>{let{type:n,points:r}=i;switch(n){case R.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case R.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case R.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case R.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case R.ARC:{const[o,a,l,c,h,m,u,d]=r,p=l>c?l:c,f=l>c?1:l/c,y=l>c?c/l:1;e&&(e.translate(o,a),e.rotate(u),e.scale(f,y),e.arc(0,0,p,h,h+m,Boolean(1-d)),e.scale(1/f,1/y),e.rotate(-u),e.translate(-o,-a));break}case R.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();const t=this.parent.getStyle("text-decoration").getString(),i=this.getFontSize(),{glyphInfo:n}=this,r=e.fillStyle;t==="underline"&&e.beginPath(),n.forEach((o,a)=>{const{p0:l,p1:c,rotation:h,text:m}=o;e.save(),e.translate(l.x,l.y),e.rotate(h),e.fillStyle&&e.fillText(m,0,0),e.strokeStyle&&e.strokeText(m,0,0),e.restore(),t==="underline"&&(a===0&&e.moveTo(l.x,l.y+i/8),e.lineTo(c.x,c.y+i/5))}),t==="underline"&&(e.lineWidth=i/20,e.strokeStyle=r,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,i,n,r,o,a,l,c){let h=o,m=this.measureText(e,l);l===" "&&t==="justify"&&i<n&&(m+=(n-i)/r),c>-1&&(h+=this.getLetterSpacingAt(c));const u=this.textHeight/20,d=this.getEquidistantPointOnPath(h,u,0),p=this.getEquidistantPointOnPath(h+m,u,0),f={p0:d,p1:p},y=d&&p?Math.atan2(p.y-d.y,p.x-d.x):0;if(a){const b=Math.cos(Math.PI/2+y)*a,v=Math.cos(-y)*a;f.p0={...d,x:d.x+b,y:d.y+v},f.p1={...p,x:p.x+b,y:p.y+v}}return h+=m,{offset:h,segment:f,rotation:y}}measureText(e,t){const{measuresCache:i}=this,n=t||this.getText();if(i.has(n))return i.get(n);const r=this.measureTargetText(e,n);return i.set(n,r),r}setTextData(e){if(this.glyphInfo)return;const t=this.getText(),i=t.split(""),n=t.split(" ").length-1,r=this.parent.getAttribute("dx").split().map(C=>C.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),c=this.parent.getStyle("letter-spacing");let h=0;!l.hasValue()||l.getValue()==="inherit"?h=c.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(h=l.getPixels());const m=[],u=t.length;this.letterSpacingCache=m;for(let C=0;C<u;C++)m.push(typeof r[C]!="undefined"?r[C]:h);const d=m.reduce((C,S,w)=>w===0?0:C+S||0,0),p=this.measureText(e),f=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];const y=this.getPathLength(),b=this.getStyle("startOffset").getNumber(0)*y;let v=0;(a==="middle"||a==="center")&&(v=-f/2),(a==="end"||a==="right")&&(v=-f),v+=b,i.forEach((C,S)=>{const{offset:w,segment:x,rotation:A}=this.findSegmentToFitChar(e,a,f,y,n,v,o,C,S);v=w,!(!x.p0||!x.p1)&&this.glyphInfo.push({text:i[S],p0:x.p0,p1:x.p1,rotation:A})})}parsePathData(e){if(this.pathLength=-1,!e)return[];const t=[],{pathParser:i}=e;for(i.reset();!i.isEnd();){const{current:n}=i,r=n?n.x:0,o=n?n.y:0,a=i.next();let l=a.type,c=[];switch(a.type){case R.MOVE_TO:this.pathM(i,c);break;case R.LINE_TO:l=this.pathL(i,c);break;case R.HORIZ_LINE_TO:l=this.pathH(i,c);break;case R.VERT_LINE_TO:l=this.pathV(i,c);break;case R.CURVE_TO:this.pathC(i,c);break;case R.SMOOTH_CURVE_TO:l=this.pathS(i,c);break;case R.QUAD_TO:this.pathQ(i,c);break;case R.SMOOTH_QUAD_TO:l=this.pathT(i,c);break;case R.ARC:c=this.pathA(i);break;case R.CLOSE_PATH:H.pathZ(i);break}a.type!==R.CLOSE_PATH?t.push({type:l,points:c,start:{x:r,y:o},pathLength:this.calcLength(r,o,l,c)}):t.push({type:R.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){const{x:i,y:n}=H.pathM(e).point;t.push(i,n)}pathL(e,t){const{x:i,y:n}=H.pathL(e).point;return t.push(i,n),R.LINE_TO}pathH(e,t){const{x:i,y:n}=H.pathH(e).point;return t.push(i,n),R.LINE_TO}pathV(e,t){const{x:i,y:n}=H.pathV(e).point;return t.push(i,n),R.LINE_TO}pathC(e,t){const{point:i,controlPoint:n,currentPoint:r}=H.pathC(e);t.push(i.x,i.y,n.x,n.y,r.x,r.y)}pathS(e,t){const{point:i,controlPoint:n,currentPoint:r}=H.pathS(e);return t.push(i.x,i.y,n.x,n.y,r.x,r.y),R.CURVE_TO}pathQ(e,t){const{controlPoint:i,currentPoint:n}=H.pathQ(e);t.push(i.x,i.y,n.x,n.y)}pathT(e,t){const{controlPoint:i,currentPoint:n}=H.pathT(e);return t.push(i.x,i.y,n.x,n.y),R.QUAD_TO}pathA(e){let{rX:t,rY:i,sweepFlag:n,xAxisRotation:r,centp:o,a1:a,ad:l}=H.pathA(e);return n===0&&l>0&&(l-=2*Math.PI),n===1&&l<0&&(l+=2*Math.PI),[o.x,o.y,t,i,a,l,r,n]}calcLength(e,t,i,n){let r=0,o=null,a=null,l=0;switch(i){case R.LINE_TO:return this.getLineLength(e,t,n[0],n[1]);case R.CURVE_TO:for(r=0,o=this.getPointOnCubicBezier(0,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),l=.01;l<=1;l+=.01)a=this.getPointOnCubicBezier(l,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return r;case R.QUAD_TO:for(r=0,o=this.getPointOnQuadraticBezier(0,e,t,n[0],n[1],n[2],n[3]),l=.01;l<=1;l+=.01)a=this.getPointOnQuadraticBezier(l,e,t,n[0],n[1],n[2],n[3]),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return r;case R.ARC:{r=0;const c=n[4],h=n[5],m=n[4]+h;let u=Math.PI/180;if(Math.abs(c-m)<u&&(u=Math.abs(c-m)),o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],c,0),h<0)for(l=c-u;l>m;l-=u)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(l=c+u;l<m;l+=u)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],m,0),r+=this.getLineLength(o.x,o.y,a.x,a.y),r}}return 0}getPointOnLine(e,t,i,n,r){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:i;const l=(r-i)/(n-t+_e);let c=Math.sqrt(e*e/(1+l*l));n<t&&(c*=-1);let h=l*c,m=null;if(n===t)m={x:o,y:a+h};else if((a-i)/(o-t+_e)===l)m={x:o+c,y:a+h};else{let u=0,d=0;const p=this.getLineLength(t,i,n,r);if(p<_e)return null;let f=(o-t)*(n-t)+(a-i)*(r-i);f/=p*p,u=t+f*(n-t),d=i+f*(r-i);const y=this.getLineLength(o,a,u,d),b=Math.sqrt(e*e-y*y);c=Math.sqrt(b*b/(1+l*l)),n<t&&(c*=-1),h=l*c,m={x:u+c,y:d+h}}return m}getPointOnPath(e){const t=this.getPathLength();let i=0,n=null;if(e<-5e-5||e-5e-5>t)return null;const{dataArray:r}=this;for(const o of r){if(o&&(o.pathLength<5e-5||i+o.pathLength+5e-5<e)){i+=o.pathLength;continue}const a=e-i;let l=0;switch(o.type){case R.LINE_TO:n=this.getPointOnLine(a,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case R.ARC:{const c=o.points[4],h=o.points[5],m=o.points[4]+h;if(l=c+a/o.pathLength*h,h<0&&l<m||h>=0&&l>m)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],l,o.points[6]);break}case R.CURVE_TO:l=a/o.pathLength,l>1&&(l=1),n=this.getPointOnCubicBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case R.QUAD_TO:l=a/o.pathLength,l>1&&(l=1),n=this.getPointOnQuadraticBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(n)return n;break}return null}getLineLength(e,t,i,n){return Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,i,n,r,o,a,l,c){const h=l*ys(e)+o*bs(e)+n*vs(e)+t*As(e),m=c*ys(e)+a*bs(e)+r*vs(e)+i*As(e);return{x:h,y:m}}getPointOnQuadraticBezier(e,t,i,n,r,o,a){const l=o*ws(e)+n*Cs(e)+t*Ts(e),c=a*ws(e)+r*Cs(e)+i*Ts(e);return{x:l,y:c}}getPointOnEllipticalArc(e,t,i,n,r,o){const a=Math.cos(o),l=Math.sin(o),c={x:i*Math.cos(r),y:n*Math.sin(r)};return{x:e+(c.x*a-c.y*l),y:t+(c.x*l+c.y*a)}}buildEquidistantCache(e,t){const i=this.getPathLength(),n=t||.25,r=e||i/100;if(!this.equidistantCache||this.equidistantCache.step!==r||this.equidistantCache.precision!==n){this.equidistantCache={step:r,precision:n,points:[]};let o=0;for(let a=0;a<=i;a+=n){const l=this.getPointOnPath(a),c=this.getPointOnPath(a+n);!l||!c||(o+=this.getLineLength(l.x,l.y,c.x,c.y),o>=r&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:a}),o-=r))}}}getEquidistantPointOnPath(e,t,i){if(this.buildEquidistantCache(t,i),e<0||e-this.getPathLength()>5e-5)return null;const n=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}constructor(e,t,i){super(e,t,i),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);const n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}}const Vo=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class Do extends Xe{async loadImage(e){try{const t=await this.document.createImage(e);this.image=t}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}this.loaded=!0}async loadSvg(e){const t=Vo.exec(e);if(t){const i=t[5];i&&(t[4]==="base64"?this.image=atob(i):this.image=decodeURIComponent(i))}else try{const n=await(await this.document.fetch(e)).text();this.image=n}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}this.loaded=!0}renderChildren(e){const{document:t,image:i,loaded:n}=this,r=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!n||!i||!a||!l)){if(e.save(),e.translate(r,o),typeof i=="string"){const c=t.canvg.forkString(e,i,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:l}),{documentElement:h}=c.document;h&&(h.parent=this),c.render()}else t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:i.width,height:l,desiredHeight:i.height}),this.loaded&&(!("complete"in i)||i.complete)&&e.drawImage(i,0,0);e.restore()}}getBoundingBox(){const e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),i=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new Ae(e,t,e+i,t+n)}constructor(e,t,i){super(e,t,i),this.type="image",this.loaded=!1;const n=this.getHrefAttribute().getString();if(!n)return;const r=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);e.images.push(this),r?this.loadSvg(n):this.loadImage(n)}}class Uo extends Xe{render(e){}constructor(...e){super(...e),this.type="symbol"}}class Fo{async load(e,t){try{const{document:i}=this,r=(await i.canvg.parser.load(t)).getElementsByTagName("font");Array.from(r).forEach(o=>{const a=i.createElement(o);i.definitions[e]=a})}catch(i){console.error('Error while loading font "'.concat(t,'":'),i)}this.loaded=!0}constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}}class bn extends W{constructor(e,t,i){super(e,t,i),this.type="style",tt(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(o=>{const a=o.trim();if(!a)return;const l=a.split("{"),c=l[0].split(","),h=l[1].split(";");c.forEach(m=>{const u=m.trim();if(!u)return;const d=e.styles[u]||{};if(h.forEach(p=>{const f=p.indexOf(":"),y=p.substr(0,f).trim(),b=p.substr(f+1,p.length-f).trim();y&&b&&(d[y]=new O(e,y,b))}),e.styles[u]=d,e.stylesSpecificity[u]=io(u),u==="@font-face"){const p=d["font-family"].getString().replace(/"|'/g,"");d.src.getString().split(",").forEach(y=>{if(y.indexOf('format("svg")')>0){const b=ln(y);b&&new Fo(e).load(p,b)}})}})})}}bn.parseExternalUrl=ln;class zo extends Xe{setContext(e){super.setContext(e);const t=this.getAttribute("x"),i=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),i.hasValue()&&e.translate(0,i.getPixels("y"))}path(e){const{element:t}=this;t&&t.path(e)}renderChildren(e){const{document:t,element:i}=this;if(i){let n=i;if(i.type==="symbol"&&(n=new bt(t),n.attributes.viewBox=new O(t,"viewBox",i.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new O(t,"preserveAspectRatio",i.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new O(t,"overflow",i.getAttribute("overflow").getString()),n.children=i.children,i.styles.opacity=new O(t,"opacity",this.calculateOpacity())),n.type==="svg"){const o=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);o.hasValue()&&(n.attributes.width=new O(t,"width",o.getString())),a.hasValue()&&(n.attributes.height=new O(t,"height",a.getString()))}const r=n.parent;n.parent=this,n.render(e),n.parent=r}}getBoundingBox(e){const{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){const{document:e,element:t}=this;return t?Ye.fromElement(e,t):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}constructor(...e){super(...e),this.type="use"}}function Pt(s,e,t,i,n,r){return s[t*i*4+e*4+r]}function Mt(s,e,t,i,n,r,o){s[t*i*4+e*4+r]=o}function $(s,e,t){return s[e]*t}function Se(s,e,t,i){return e+Math.cos(s)*t+Math.sin(s)*i}class vn extends W{apply(e,t,i,n,r){const{includeOpacity:o,matrix:a}=this,l=e.getImageData(0,0,n,r);for(let c=0;c<r;c++)for(let h=0;h<n;h++){const m=Pt(l.data,h,c,n,r,0),u=Pt(l.data,h,c,n,r,1),d=Pt(l.data,h,c,n,r,2),p=Pt(l.data,h,c,n,r,3);let f=$(a,0,m)+$(a,1,u)+$(a,2,d)+$(a,3,p)+$(a,4,1),y=$(a,5,m)+$(a,6,u)+$(a,7,d)+$(a,8,p)+$(a,9,1),b=$(a,10,m)+$(a,11,u)+$(a,12,d)+$(a,13,p)+$(a,14,1),v=$(a,15,m)+$(a,16,u)+$(a,17,d)+$(a,18,p)+$(a,19,1);o&&(f=0,y=0,b=0,v*=p/255),Mt(l.data,h,c,n,r,0,f),Mt(l.data,h,c,n,r,1,y),Mt(l.data,h,c,n,r,2,b),Mt(l.data,h,c,n,r,3,v)}e.clearRect(0,0,n,r),e.putImageData(l,0,0)}constructor(e,t,i){super(e,t,i),this.type="feColorMatrix";let n=me(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{const r=n[0];n=[.213+.787*r,.715-.715*r,.072-.072*r,0,0,.213-.213*r,.715+.285*r,.072-.072*r,0,0,.213-.213*r,.715-.715*r,.072+.928*r,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{const r=n[0]*Math.PI/180;n=[Se(r,.213,.787,-.213),Se(r,.715,-.715,-.715),Se(r,.072,-.072,.928),0,0,Se(r,.213,-.213,.143),Se(r,.715,.285,.14),Se(r,.072,-.072,-.283),0,0,Se(r,.213,-.213,-.787),Se(r,.715,-.715,.715),Se(r,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}}class Wt extends W{apply(e,t){const{document:i}=this;let n=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!o&&!a){const d=new Ae;this.children.forEach(p=>{d.addBoundingBox(p.getBoundingBox(e))}),n=Math.floor(d.x1),r=Math.floor(d.y1),o=Math.floor(d.width),a=Math.floor(d.height)}const l=this.removeStyles(t,Wt.ignoreStyles),c=i.createCanvas(n+o,r+a),h=c.getContext("2d");i.screen.setDefaults(h),this.renderChildren(h),new vn(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(h,0,0,n+o,r+a);const m=i.createCanvas(n+o,r+a),u=m.getContext("2d");i.screen.setDefaults(u),t.render(u),u.globalCompositeOperation="destination-in",u.fillStyle=h.createPattern(c,"no-repeat"),u.fillRect(0,0,n+o,r+a),e.fillStyle=u.createPattern(m,"no-repeat"),e.fillRect(0,0,n+o,r+a),this.restoreStyles(t,l)}render(e){}constructor(...e){super(...e),this.type="mask"}}Wt.ignoreStyles=["mask","transform","clip-path"];const Ss=()=>{};class Ho extends W{apply(e){const{document:t}=this,i=Reflect.getPrototypeOf(e),{beginPath:n,closePath:r}=e;i&&(i.beginPath=Ss,i.closePath=Ss),Reflect.apply(n,e,[]),this.children.forEach(o=>{if(!("path"in o))return;let a="elementTransform"in o?o.elementTransform():null;a||(a=Ye.fromElement(t,o)),a&&a.apply(e),o.path(e),i&&(i.closePath=r),a&&a.unapply(e)}),Reflect.apply(r,e,[]),e.clip(),i&&(i.beginPath=n,i.closePath=r)}render(e){}constructor(...e){super(...e),this.type="clipPath"}}class qt extends W{apply(e,t){const{document:i,children:n}=this,r="getBoundingBox"in t?t.getBoundingBox(e):null;if(!r)return;let o=0,a=0;n.forEach(b=>{const v=b.extraFilterDistance||0;o=Math.max(o,v),a=Math.max(a,v)});const l=Math.floor(r.width),c=Math.floor(r.height),h=l+2*o,m=c+2*a;if(h<1||m<1)return;const u=Math.floor(r.x),d=Math.floor(r.y),p=this.removeStyles(t,qt.ignoreStyles),f=i.createCanvas(h,m),y=f.getContext("2d");i.screen.setDefaults(y),y.translate(-u+o,-d+a),t.render(y),n.forEach(b=>{typeof b.apply=="function"&&b.apply(y,0,0,h,m)}),e.drawImage(f,0,0,h,m,u-o,d-a,h,m),this.restoreStyles(t,p)}render(e){}constructor(...e){super(...e),this.type="filter"}}qt.ignoreStyles=["filter","transform","clip-path"];class Qo extends W{apply(e,t,i,n,r){}constructor(e,t,i){super(e,t,i),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class Wo extends W{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feMorphology"}}class qo extends W{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feComposite"}}class Yo extends W{apply(e,t,i,n,r){const{document:o,blurRadius:a}=this,l=o.window?o.window.document.body:null,c=e.canvas;c.id=o.getUniqueId(),l&&(c.style.display="none",l.appendChild(c)),Ua(c,t,i,n,r,a),l&&l.removeChild(c)}constructor(e,t,i){super(e,t,i),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class Xo extends W{constructor(...e){super(...e),this.type="title"}}class jo extends W{constructor(...e){super(...e),this.type="desc"}}const Go={svg:bt,rect:mn,circle:Ao,ellipse:wo,line:Co,polyline:gn,polygon:To,path:H,pattern:xo,marker:So,defs:Eo,linearGradient:ko,radialGradient:No,stop:Po,animate:Ui,animateColor:Mo,animateTransform:Oo,font:Io,"font-face":fn,"missing-glyph":yn,glyph:Fi,text:Ve,tspan:Qt,tref:Bo,a:Ro,textPath:Lo,image:Do,g:Di,symbol:Uo,style:bn,use:zo,mask:Wt,clipPath:Ho,filter:qt,feDropShadow:Qo,feMorphology:Wo,feComposite:qo,feColorMatrix:vn,feGaussianBlur:Yo,title:Xo,desc:jo};function Jo(s,e){const t=document.createElement("canvas");return t.width=s,t.height=e,t}async function Ko(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((i,n)=>{t.onload=()=>{i(t)},t.onerror=(r,o,a,l,c)=>{n(c)},t.src=s})}const Ai=12;class Le{bindCreateImage(e,t){return typeof t=="boolean"?(i,n)=>e(i,typeof n=="boolean"?n:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:e}=this;return e[e.length-1]||Ai}set emSize(e){const{emSizeStack:t}=this;t.push(e)}popEmSize(){const{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){const t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){const t=e.nodeName.replace(/^[^:]+:/,""),i=Le.elementTypes[t];return i?new i(this,e):new go(this,e)}createTextNode(e){return new vo(this,e)}setViewBox(e){this.screen.setViewBox({document:this,...e})}constructor(e,{rootEmSize:t=Ai,emSize:i=Ai,createCanvas:n=Le.createCanvas,createImage:r=Le.createImage,anonymousCrossOrigin:o}={}){this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=i,this.createCanvas=n,this.createImage=this.bindCreateImage(r,o),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}}Le.createCanvas=Jo;Le.createImage=Ko;Le.elementTypes=Go;class Ke{static async from(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=await new vi(i).parse(t);return new Ke(e,r,i)}static fromString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=new vi(i).parseFromString(t);return new Ke(e,r,i)}fork(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ke.from(e,t,{...this.options,...i})}forkString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ke.fromString(e,t,{...this.options,...i})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...e}),await this.ready(),this.stop()}start(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{documentElement:t,screen:i,options:n}=this;i.start(t,{enableRedraw:!0,...n,...e})}stop(){this.screen.stop()}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,i)}constructor(e,t,i={}){this.parser=new vi(i),this.screen=new Pe(e,i),this.options=i;const n=new Le(this,i),r=n.createDocumentElement(t);this.document=n,this.documentElement=r}}window.OffscreenCanvas||(window.OffscreenCanvas=class{constructor(e,t){return this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=t,this.canvas.convertToBlob=()=>new Promise(i=>{this.canvas.toBlob(i)}),this.canvas}});const Zo=Qa.offscreen(),_o=s=>new Promise((e,t)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.readAsDataURL(s)});let Je=null;const $o=async(s,e,t)=>{Je||(Je=new OffscreenCanvas(e,t));const i=Je.getContext("2d");let n=await Ke.fromString(i,s,Zo);n.resize(e*2,t*2,"xMidYMid meet"),await n.start();const r=await Je.convertToBlob(),o=await _o(r);return i.clearRect(0,0,Je.width,Je.height),await n.stop(),n=null,o},el=(s,e)=>{const t=e.replace(/ /g,"").replace(/\d+|\d+/g,"").trim().toLocaleLowerCase(),i=Object.keys(s);for(let n=0;n<i.length;n++)if(i[n].replace(/ /g,"").toLocaleLowerCase()===t)return s[i[n]]||"";for(let n=0;n<i.length;n++){const r=i[n].replace(/ /g,"").toLocaleLowerCase();if(t.includes(r))return s[i[n]]||""}return""},Es=s=>{var r,o;if(!s)return"";const e=new DOMParser().parseFromString(s,"text/xml"),t=e.getElementsByTagName("measure");let i=-1,n=-1;for(const a of t){i===-1&&a.getElementsByTagName("beats").length&&(i=parseInt(a.getElementsByTagName("beats")[0].textContent||"4")),n===-1&&a.getElementsByTagName("beat-type").length&&(n=parseInt(a.getElementsByTagName("beat-type")[0].textContent||"4"));const l=parseInt(((r=a.getElementsByTagName("divisions")[0])==null?void 0:r.textContent)||"256");if(a.getElementsByTagName("note").length===0){const c=(o=a.getElementsByTagName("forward")[0])==null?void 0:o.getElementsByTagName("duration")[0];c&&(c.textContent="0"),a.innerHTML=a.innerHTML+`
  15. <note>
  16. <rest measure="yes"/>
  17. <duration>${l*i}</duration>
  18. <voice>1</voice>
  19. <type>whole</type>
  20. </note>`}}return new XMLSerializer().serializeToString(e)},ks=(s,e)=>{var h,m,u,d;if(!s)return"";const t=new DOMParser().parseFromString(s,"text/xml"),i=((m=(h=t.getElementsByTagName("part-list"))==null?void 0:h[0])==null?void 0:m.getElementsByTagName("score-part"))||[],n=Array.from(i).map(p=>{var f;return((f=p.getElementsByTagName("part-name"))==null?void 0:f[0].textContent)||""}),r=t.getElementsByTagName("part"),o=r[0],a=[...o.getElementsByTagName("measure")],l=[...o.getElementsByTagName("metronome")];[...o.getElementsByTagName("words")],[...o.getElementsByTagName("coda")],[...o.getElementsByTagName("rehearsal")],((d=(u=n[0])==null?void 0:u.toLocaleUpperCase)==null?void 0:d.call(u))==="COMMON"&&(e++,n.shift());const c=i[e];if(c){const p=c.getAttribute("id");Array.from(r).forEach(y=>{var b,v,C,S,w;if(y&&y.getAttribute("id")!==p)(b=y.parentNode)==null||b.removeChild(y);else if(y&&y.getAttribute("id")!=="P1"){const x={};for(let A=0;A<l.length;A++){const P=l[A],M=(C=(v=P.parentElement)==null?void 0:v.parentElement)==null?void 0:C.parentElement;if(M){const L=a.indexOf(M);x[L]=P}}Object.values(x).forEach(A=>{var D;const P=(D=A.parentElement)==null?void 0:D.parentElement,M=P==null?void 0:P.parentElement,L=[...(M==null?void 0:M.childNodes)||[]],G=P?L.indexOf(P):-1;if(M&&G>-1){const X=a.indexOf(M),z=y.getElementsByTagName("measure")[X];il(P,M,z)}})}if(y&&y.getAttribute("id")===p){const x=y.getElementsByTagName("barline"),A=(S=x[x.length-1])==null?void 0:S.parentElement;if(((w=A==null?void 0:A.lastElementChild)==null?void 0:w.tagName)!=="barline"){const P=(A==null?void 0:A.children)||[];for(const M of P)if(M.tagName==="barline"){A==null||A.appendChild(M);break}}}}),Array.from(i).forEach(y=>{var b;y&&y.getAttribute("id")!==p&&((b=y.parentNode)==null||b.removeChild(y))});const f=t.getElementsByTagName("note");Array.from(f).forEach((y,b)=>{const v=y.getElementsByTagName("grace");v&&v.length})}return new XMLSerializer().serializeToString(tl(t))},tl=s=>{var i,n,r,o;if(!s)return s;const e=s.querySelectorAll("grace");if(!e.length)return s;const t=a=>a.querySelector("grace")?t(a==null?void 0:a.nextElementSibling):a;for(const a of e){const l=(i=a.parentElement)==null?void 0:i.querySelector("notations");if(l&&l.querySelectorAll("slur").length>1){const c=t((n=a.parentElement)==null?void 0:n.nextElementSibling);if(c&&c.querySelectorAll("slur").length>0){const h=Array.from(((r=c.querySelector("notations"))==null?void 0:r.children)||[]).map(u=>u.getAttribute("number")),m=l.querySelectorAll("slur");for(const u of m)h.includes(u.getAttribute("number"))||(o=c.querySelector("notations"))==null||o.appendChild(u)}}}return s},il=(s,e,t)=>{let i=0;if(!!e){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(r.nodeName==="note"&&i++,r===s)break}if(i===0&&t){t.insertBefore(s,t.childNodes[0]);return}if(t&&t.childNodes.length>0){let n=0;const r=Array.from(t.childNodes).filter(a=>a.nodeName==="note"),o=r[r.length-1];if(i>=r.length&&o){t.insertBefore(s,t.childNodes[Array.from(t.childNodes).indexOf(o)]);return}for(let a=0;a<r.length;a++){const l=r[a];if(l.nodeName==="note"&&(n=n+1,n===i)){t.insertBefore(s,l);break}}}}},Ns=s=>{var n,r;const e={showSpeed:!0,parsedXML:s},t=new DOMParser().parseFromString(s,"text/xml"),i=t.getElementsByTagName("words");for(const o of i)o&&((n=o.textContent)==null?void 0:n.trim())==="\u9690\u85CF\u901F\u5EA6"&&(e.showSpeed=!1,o.textContent=""),o&&((r=o.textContent)==null?void 0:r.trim())==="@"&&(o.textContent="segno");return e.parsedXML=new XMLSerializer().serializeToString(t),e};var Tl=Oi({name:"music-detail",setup(){const s=xn(),e=be(),t=be(null),i=be([]),n=Sn({details:{},musicPdfUrl:"",status:!1,open:!1,audioReady:!1,iframeSrc:"",isComberRender:!1,musicXml:[],instrumentName:"",iframeRef:null,imgs:[],radio:"staff",partList:[],partNames:[],selectedPartName:"",selectedPartIndex:0,partXmlIndex:0,instrumentCodes:{}}),r=be(!1),o=be(!1),a=be([]);Ps(()=>n.radio,w=>{var x,A,P;w=="first"?a.value=oi(((x=n.details.musicFirstSvg)==null?void 0:x.split(","))||[]):w=="fixed"?a.value=oi(((A=n.details.musicJianSvg)==null?void 0:A.split(","))||[]):a.value=oi(((P=n.details.musicImg)==null?void 0:P.split(","))||[])});const l=async()=>{const w=document.getElementById("staffIframeRef");if(w&&w.contentWindow.renderXml){const x=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),A=Ns(x),P=Es(A.parsedXML);if(n.isComberRender)w.contentWindow.renderXml(P,n.partXmlIndex,n.isComberRender);else{const M=ks(P,n.partXmlIndex);w.contentWindow.renderXml(M,n.partXmlIndex,n.isComberRender)}}},c=async()=>{const w=document.getElementById("staffIframeRef");if(w&&w.contentWindow.renderXml){r.value=!0;const x=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),A=Ns(x),P=Es(A.parsedXML);if(n.isComberRender)w.contentWindow.renderXml(P,n.partXmlIndex,n.isComberRender);else{const M=ks(P,n.partXmlIndex);w.contentWindow.renderXml(M,0,n.isComberRender)}}},h=(w,x)=>{const A=document.getElementById("staffIframeRef");A&&A.contentWindow.renderXml&&A.contentWindow.resetRenderPage(w,x)},m=async()=>{try{n.musicPdfUrl?(document.querySelector("#staffIframeRef").contentWindow.location.replace(`${location.origin}${location.pathname}pdf/web/viewer.html?file=${encodeURIComponent(n.musicPdfUrl)}&t=${Date.now()}`),n.iframeSrc=`${location.origin}${location.pathname}pdf/web/viewer.html?file=${encodeURIComponent(n.musicPdfUrl)}&t=${Date.now()}`):(document.querySelector("#staffIframeRef").contentWindow.location.replace(`${location.origin}${location.pathname}osmd/index.html`),n.iframeSrc=`${location.origin}${location.pathname}osmd/index.html`)}catch{}},u=async w=>{var A;const x=[];try{const P=await ai.get(w,{mode:"cors"}),M=new DOMParser().parseFromString(P,"text/xml");for(const L of M.getElementsByTagName("part-name"))L.textContent&&x.push((A=L.textContent)==null?void 0:A.trim())}catch{}return x.filter(P=>P.toLocaleUpperCase()!=="COMMON")||[]},d=(w,x="")=>{var A;if(x=x.toLocaleLowerCase().replace(/ /g,""),!x)return"";for(const P in w){const M=w[P];if(((A=M.track)==null?void 0:A.toLocaleLowerCase().replace(/ /g,""))===x)return M}return""},p=async w=>{var P,M,L,G;if(w.musicSheetType==="SINGLE"){r.value=!1,n.musicPdfUrl=w.musicPdfUrl;return}n.partNames=await u(w.xmlFileUrl);let x=w.background||[];x=x.filter(D=>{var X,z;return!((z=(X=D.track)==null?void 0:X.toLocaleUpperCase())!=null&&z.includes("COMMON"))}),i.value=x.map((D,X)=>{const z=el(n.instrumentCodes,D.track),j=n.partNames.findIndex(ie=>{var _;return ie===((_=D.track)==null?void 0:_.trim())});return{text:D.track+(z?`(${z})`:""),instrumentName:z,track:D.track,xmlIndex:j,value:X}});const A=i.value[n.selectedPartIndex];if(n.selectedPartName=A.instrumentName||A.track,n.partXmlIndex=A.xmlIndex,n.isComberRender)n.musicPdfUrl=w.musicPdfUrl;else{const D=d(((P=n.details)==null?void 0:P.background)||[],(M=i.value[n.selectedPartIndex])==null?void 0:M.track);console.log(D,"item",(L=n.details)==null?void 0:L.background,(G=i.value[n.selectedPartIndex])==null?void 0:G.track),D?n.musicPdfUrl=D.musicPdfUrl:n.musicPdfUrl=""}},f=async()=>{var w;r.value=!0;try{if(!s.query.id)return;const{data:x}=await Ji.get(Ki.platformApi+"/musicSheet/detail/"+s.query.id);n.details=x||{},a.value=((w=n.details.musicImg)==null?void 0:w.split(","))||[],n.isComberRender=x.musicSubject==="1",ri(async()=>{x.audioFileUrl?y():(await p(n.details),m())})}catch(x){console.log(x)}},y=async()=>{const w=["play","progress","captions","current-time","duration"];t.value=new dt(e.value,{controls:w}),t.value.on("ready",()=>{n.audioReady=!0,t.value.muted=!1,ri(async()=>{await p(n.details),m()})})},b=async w=>{let x=`${location.origin}/orchestra-music-score/?id=${w.id}&part-index=${n.selectedPartIndex}`;if(n.details.musicSheetType==="SINGLE"){let A="staff";n.radio==="first"?A="firstTone":n.radio==="fixed"?A="fixedTone":n.radio==="staff"&&(A="staff"),x+="&musicRenderType="+A}console.log("\u{1F680} ~ src:",x),Pn({api:"openAccompanyWebView",content:{url:x,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})},v=()=>{var w;(w=t.value)==null||w.pause(),b(n.details)},C=async w=>{var x;if(((x=w.data)==null?void 0:x.api)==="musicStaffRender"){try{const A=w.data.osmdImg,P=[];for(let M=0;M<A.length;M++){const L=await $o(A[M].img,A[M].width,A[M].height);P.push(L)}a.value=P}catch{}r.value=w.data.loading}},S=async()=>{try{const{data:w}=await Ji.get("/musicSheet/instrumentCode",{prefix:Ki.platformType==="TEACHER"?"/api-teacher":"/api-student"});if(Array.isArray(w)){const x={};w.forEach(A=>{var M;((M=A.code)==null?void 0:M.split(",")).forEach(L=>{x[L]=A.name})}),n.instrumentCodes=x}}catch{}};return En(async()=>{await S(),await f(),window.addEventListener("message",C)}),kn(()=>{window.removeEventListener("message",C)}),()=>N("div",{class:re.musicDetail},[N(Zi,{mode:"sticky",position:"top"},{default:()=>[N(Nn,{border:!1,background:"transparent"},null)]}),N("div",{class:re.musicContainer},[N("div",{class:re.musicInfos},[N("div",{class:re.musicImg},[N(ot,{src:Mn},null)]),n.details.id&&!n.musicPdfUrl&&N("div",{class:re.info},[N("p",{class:re.names},[n.details.musicSheetName,n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:""]),N("p",{class:re.author},[n.details.composer])])]),N("div",{class:[re.showImgContainer,n.musicPdfUrl&&re.pdfContainer]},[r.value&&N(Dn,{title:!0,row:7},null),n.details.id?n.musicPdfUrl?N("iframe",{style:{opacity:r.value?0:1,width:"100%",height:"100%"},id:"staffIframeRef",onLoad:()=>{r.value=!1}},null):N("iframe",{id:"staffIframeRef",style:{opacity:r.value?0:1,width:"100%",height:"100%"},onLoad:()=>{l()}},null):""])]),n.details.id&&N(Zi,{position:"bottom",varName:"--footer-height"},{default:()=>{var w,x,A;return[N("div",{class:re.bottomStyle,style:{background:"#fff"}},[((w=n.details)==null?void 0:w.audioFileUrl)&&N("div",{class:[re.audio,re.collectCell],style:{opacity:n.audioReady?1:0}},[N("audio",{id:"player",controls:!0,ref:e,style:{height:"40px"}},[N("source",{src:(x=n.details)==null?void 0:x.audioFileUrl,type:"audio/mp3"},null)])]),N("div",{class:re.footers},[N("div",{class:re.iconGroup},[N("div",{class:re.icon,onClick:()=>{var P;if(!r.value)if(n.musicPdfUrl){const M=((P=n.details)==null?void 0:P.musicSheetName)+(n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:"");Os({api:"downloadFile",content:{downloadUrl:n.musicPdfUrl,fileName:M}})}else o.value=!0}},[N("img",{src:On},null),N("span",null,[ve("\u4E0B\u8F7D")])]),((A=n.details)==null?void 0:A.musicSheetType)==="CONCERT"?N("div",{class:re.icon,onClick:()=>{r.value||(n.open=!0)}},[N("img",{src:In},null),N("span",null,[ve("\u58F0\u8F68")])]):N("div",null,null)]),N(Ms,{round:!0,block:!0,type:"primary",disabled:r.value,color:"#FF8057",onClick:v},{default:()=>[ve("\u5F00\u59CB\u7EC3\u4E60")]})])])]}}),N(ni,{show:n.status,"onUpdate:show":w=>n.status=w,teleport:"body",closeable:!0,style:{width:"80%"},class:re.staffChange,round:!0},{default:()=>[N(fa,{radio:n.radio,onClose:()=>n.status=!1,onChange:w=>{n.radio=w,n.status=!1,w=="first"?(r.value=!0,h("first",n.details.xmlFileUrl)):w=="fixed"?(r.value=!0,h("fixed",n.details.xmlFileUrl)):(r.value=!0,h("staff",n.details.xmlFileUrl))}},null)]}),N(ni,{show:o.value,"onUpdate:show":w=>o.value=w,position:"bottom",round:!0},{default:()=>[o.value&&N(ka,{imgList:JSON.parse(JSON.stringify(a.value)),musicSheetName:n.details.musicSheetName+(n.details.musicSheetType==="CONCERT"&&n.selectedPartName?`(${n.selectedPartName})`:"")},null)]}),N(ni,{teleport:"body",position:"bottom",round:!0,show:n.open,"onUpdate:show":w=>n.open=w},{default:()=>[N(Un,{columns:i.value,onConfirm:w=>{n.open=!1,n.selectedPartIndex=w.selectedValues[0],n.selectedPartName=w.selectedOptions[0].instrumentName||w.selectedOptions[0].track,n.partXmlIndex=w.selectedOptions[0].xmlIndex,ri(()=>{const x=d(n.details.background||[],w.selectedOptions[0].track);console.log(x,"nextTick",n.details);let A="";n!=null&&n.isComberRender?n!=null&&n.musicPdfUrl&&(A=n==null?void 0:n.musicPdfUrl):A=x==null?void 0:x.musicPdfUrl,A?(n.musicPdfUrl=A,m()):(n.musicPdfUrl="",r.value=!0,n.iframeSrc.indexOf("pdf/web")!==-1?m():c())})},onCancel:()=>n.open=!1},null)]})])}});export{Tl as default};