music-detail.9a02a130.js 267 KB

12345678910111213141516171819202122
  1. import{d as Oi,bN as bn,c as N,t as ve,a7 as si,U as be,$ as Ns,B as Ps,bl as vn,p as An,bn as wn,bo as Cn,ap as Ms,aj as Tn,r as xn,a1 as En,b9 as Sn,al as kn,F as Nn,P as ni,a0 as ri,be as ai,n as Pn,g as Mn,e as Bn}from"./ResizeObserver.es.40f83289.js";import{O as Ji}from"./index.8345c4d6.js";import{i as it,d as On,e as Fn,f as In}from"./music-img-default.7aa4a8c2.js";/* empty css */import{d as oi}from"./deep-clone.c5af4e6b.js";import{R as Ln,a as li}from"./index.7f1ba041.js";import{C as Rn}from"./index.2cf1d4b8.js";import{C as ui}from"./index.dfaaa165.js";import{I as ot}from"./index.eb5a4c0f.js";import{S as Dn,a as Vn}from"./index.4ffaeb3d.js";import{S as Hn}from"./index.7025d2da.js";import{P as Un}from"./index.97ba61ac.js";import"./index.1999a95d.js";import"./index.ca5d18fb.js";import"./Checker.b67b7e50.js";import"./Picker.2c714917.js";import"./index.12ef0aea.js";import"./use-tab-status.05af9536.js";import"./index.389de34f.js";const ci={"Acoustic Grand Piano":"\u5927\u94A2\u7434","Bright Acoustic Piano":"\u660E\u4EAE\u7684\u94A2\u7434","Electric Grand Piano":"\u7535\u94A2\u7434","Rhodes Piano":"\u67D4\u548C\u7684\u7535\u94A2\u7434","Chorused Piano":"\u52A0\u5408\u5531\u6548\u679C\u7684\u7535\u94A2\u7434",Harpsichord:"\u7FBD\u7BA1\u952E\u7434",Clavichord:"\u79D1\u62C9\u7EF4\u79D1\u7279\u7434",Celesta:"\u94A2\u7247\u7434",Glockenspiel:"\u94A2\u7247\u7434","Music box":"\u516B\u97F3\u76D2",Vibraphone:"\u98A4\u97F3\u7434",Marimba:"\u9A6C\u6797\u5DF4",Xylophone:"\u6728\u7434","Tubular Bells":"\u7BA1\u949F",Dulcimer:"\u5927\u626C\u7434","Hammond Organ":"\u51FB\u6746\u98CE\u7434","Percussive Organ":"\u6253\u51FB\u5F0F\u98CE\u7434","Rock Organ":"\u6447\u6EDA\u98CE\u7434","Church Organ":"\u6559\u5802\u98CE\u7434","Reed Organ":"\u7C27\u7BA1\u98CE\u7434",Accordian:"\u624B\u98CE\u7434",Harmonica:"\u53E3\u7434","Tango Accordian":"\u63A2\u6208\u624B\u98CE\u7434","Acoustic Guitar":"\u94A2\u5F26\u5409\u4ED6","Electric Guitar":"\u95F7\u97F3\u7535\u5409\u4ED6","Overdriven Guitar":"\u52A0\u9A71\u52A8\u6548\u679C\u7684\u7535\u5409\u4ED6","Distortion Guitar":"\u52A0\u5931\u771F\u6548\u679C\u7684\u7535\u5409\u4ED6","Guitar Harmonics":"\u5409\u4ED6\u548C\u97F3","Acoustic Bass":"\u5927\u8D1D\u53F8","Electric Bass":"\u7535\u8D1D\u53F8","Fretless Bass":"\u65E0\u54C1\u8D1D\u53F8","Slap Bass":"\u638C\u51FB","Synth Bass":"\u7535\u5B50\u5408\u6210",Violin:"\u5C0F\u63D0\u7434",Viola:"\u4E2D\u63D0\u7434",Cello:"\u5927\u63D0\u7434",Contrabass:"\u4F4E\u97F3\u5927\u63D0\u7434","Tremolo Strings":"\u5F26\u4E50\u7FA4\u98A4\u97F3\u97F3\u8272","Pizzicato Strings":"\u5F26\u4E50\u7FA4\u62E8\u5F26\u97F3\u8272","Orchestral Harp":"\u7AD6\u7434",Timpani:"\u5B9A\u97F3\u9F13","String Ensemble":"\u5F26\u4E50\u5408\u594F\u97F3\u8272","Synth Strings":"\u5408\u6210\u5F26\u4E50\u5408\u594F\u97F3\u8272","Choir Aahs":"\u4EBA\u58F0\u5408\u5531","Voice Oohs":"\u4EBA\u58F0","Synth Voice":"\u5408\u6210\u4EBA\u58F0","Orchestra Hit":"\u7BA1\u5F26\u4E50\u6572\u51FB\u9F50\u594F",Trumpet:"\u5C0F\u53F7",Trombone:"\u957F\u53F7",Tuba:"\u5927\u53F7","Muted Trumpet":"\u52A0\u5F31\u97F3\u5668\u5C0F\u53F7","French Horn":"\u6CD5\u56FD\u53F7","Brass Section":"\u94DC\u7BA1\u7EC4","Synth Brass":"\u5408\u6210\u94DC\u7BA1\u97F3\u8272","Soprano Sax":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Sax":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Sax":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Sax":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Oboe:"\u53CC\u7C27\u7BA1","English Horn":"\u82F1\u56FD\u7BA1",Bassoon:"\u5DF4\u677E","Soprano Saxophone":"\u9AD8\u97F3\u8428\u514B\u65AF\u7BA1","Alto Saxophone":"\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Tenor Saxophone":"\u6B21\u4E2D\u97F3\u8428\u514B\u65AF\u7BA1","Baritone Saxophone":"\u4F4E\u97F3\u8428\u514B\u65AF\u7BA1",Piccolo:"\u77ED\u7B1B",Flute:"\u957F\u7B1B",Recorder:"\u7AD6\u7B1B","Soprano Recorder":"\u9AD8\u97F3\u7AD6\u7B1B","Pan Flute":"\u6392\u7BAB","Bottle Blow":"\u74F6\u6728\u7BA1",Whistle:"\u53E3\u54E8\u58F0",Ocarina:"\u9676\u7B1B",Lead:"\u5408\u6210\u4E3B\u97F3","Lead lead":"\u5408\u6210\u4E3B\u97F3","Pad age":"\u5408\u6210\u97F3\u8272",Pad:"\u5408\u6210\u97F3\u8272",FX:"\u5408\u6210\u6548\u679C \u79D1\u5E7B",Sitar:"\u897F\u5854\u5C14",Banjo:"\u73ED\u5353\u7434",Shamisen:"\u4E09\u6627\u7EBF",Koto:"\u5341\u4E09\u5F26\u7B5D",Kalimba:"\u5361\u6797\u5DF4",Bagpipe:"\u98CE\u7B1B",Fiddle:"\u6C11\u65CF\u63D0\u7434",Shanai:"\u5C71\u5948","Tinkle Bell":"\u53EE\u5F53\u94C3",Agogos:"\u963F\u6208\u6208\u94C3","Steel Drums":"\u94A2\u9F13","Taiko Drum":"\u592A\u9F13","Melodic Toms":"\u55F5\u55F5\u9F13","Synth Drums":"\u5408\u6210\u9F13","Reverse Cymbals":"\u53CD\u5411\u9572","Agogo Bells":"\u963F\u6208\u6208\u94C3","Taiko Drums":"\u592A\u9F13",Bongos:"\u90A6\u6208\u9F13","Bongo Bell":"\u90A6\u6208\u94C3",Congas:"\u5EB7\u52A0\u9F13",Guiro:"\u522E\u58F6","Guitar Fret Noise":"\u5409\u4ED6\u6362\u628A\u6742\u97F3","Breath Noise":"\u547C\u5438\u58F0",Seashore:"\u6D77\u6D6A\u58F0","Bird Tweet":"\u9E1F\u9E23","Telephone Ring":"\u7535\u8BDD\u94C3",Helicopter:"\u76F4\u5347\u673A",Applause:"\u9F13\u638C\u58F0",Gunshot:"\u67AA\u58F0","Acoustic Bass Drum":"\u5927\u9F13","Bass Drum":"\u5927\u9F13","Side Drum":"\u5C0F\u9F13\u9F13\u8FB9","Acoustic Snare":"\u5C0F\u9F13","Hand Claps":"\u62CD\u624B","Electric Snare":"\u5C0F\u9F13","Low Floor Tom":"\u4F4E\u97F3\u55F5\u9F13","Closed Hi-Hat":"\u95ED\u5408\u8E29\u9572","High Floor Tom":"\u9AD8\u97F3\u843D\u5730\u55F5\u9F13","Pedal Hi-Hat":"\u811A\u8E0F\u8E29\u9572","Low Tom":"\u4F4E\u97F3\u55F5\u9F13","Open Hi-Hat":"\u5F00\u97F3\u8E29\u9572","Low-Mid Tom":"\u4E2D\u4F4E\u97F3\u55F5\u9F13","Hi Mid Tom":"\u9AD8\u97F3\u9F13","Crash Cymbals":"\u5BF9\u9572","High Tom":"\u9AD8\u97F3\u55F5\u9F13","Ride Cymbals":"\u53EE\u53EE\u9572","Chinese Cymbals":"\u4E2D\u56FD\u9572","Ride Bell":"\u5706\u94C3",Tambourine:"\u94C3\u9F13","Splash Cymbal":"\u6E85\u97F3\u9572",Cowbell:"\u725B\u94C3","Crash Cymbal":"\u5F3A\u97F3\u94B9","Vibra-Slap":"\u98A4\u97F3\u5668","Ride Cymbal":"\u6253\u70B9\u94B9","Hi Bongo":"\u9AD8\u97F3\u90A6\u6208\u9F13","Low Bongo":"\u4F4E\u97F3\u90A6\u6208\u9F13","Mute Hi Conga":"\u5F31\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Open Hi Conga":"\u5F3A\u97F3\u9AD8\u97F3\u5EB7\u52A0\u9F13","Low Conga":"\u4F4E\u97F3\u5EB7\u52A0\u9F13","High Timbale":"\u9AD8\u97F3\u5929\u5DF4\u9F13","Low Timbale":"\u4F4E\u97F3\u5929\u5DF4\u9F13","High Agogo":"\u9AD8\u97F3\u963F\u6208\u6208\u94C3","Low Agogo":"\u4F4E\u97F3\u963F\u6208\u6208\u94C3",Cabasa:"\u5361\u5DF4\u8428",Maracas:"\u6C99\u9524","Short Whistle":"\u77ED\u53E3\u54E8","Long Whistle":"\u957F\u53E3\u54E8","Short Guiro":"\u77ED\u522E\u58F6","Long Guiro":"\u957F\u522E\u58F6",Claves:"\u54CD\u68D2","Hi Wood Block":"\u9AD8\u97F3\u6728\u9C7C","Low Wood Block":"\u4F4E\u97F3\u6728\u9C7C","Mute Triangle":"\u5F31\u97F3\u4E09\u89D2\u94C1","Open Triangle":"\u5F3A\u97F3\u4E09\u89D2\u94C1","Drum Set":"\u67B6\u5B50\u9F13","Hulusi flute":"\u846B\u82A6\u4E1D",Melodica:"\u53E3\u98CE\u7434","Snare Drum":"\u5C0F\u519B\u9F13","Horn in F":"\u5706\u53F7",Triangle:"\u4E09\u89D2\u94C1",Vibrato:"\u98A4\u97F3\u7434","Suspend Cymbals":"\u540A\u9572","Suspended Cymbals":"\u540A\u9572","Tom-Toms":"\u55F5\u55F5\u9F13",Bell:"\u94C3\u94DB",Bells:"\u94C3\u94DB","Alto Clarinet":"\u4E2D\u97F3\u5355\u7C27\u7BA1","Bass Clarinet":"\u4F4E\u97F3\u5355\u7C27\u7BA1",Clarinet:"\u5355\u7C27\u7BA1",Cornet:"\u77ED\u53F7",Euphonium:"\u4E0A\u4F4E\u97F3\u53F7","crash cymbals":"\u5BF9\u9572",Castanets:"\u54CD\u677F",Shaker:"\u6C99\u9524","Mark tree":"\u97F3\u6811",Chimes:"\u7BA1\u949F","Mark Tree":"\u97F3\u6811","Tom-toms":"\u55F5\u55F5\u9F13","Hi-Hat":"\u8E29\u9572","Sleigh Bells":"\u96EA\u6A47\u94C3",Flexatone:"\u5F39\u97F3\u5668","Brake drum":"\u95F8\u9F13",Gong:"\u9523","concert tom":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13","brake drum":"\u8F66\u8F6E\u9F13","finger cymbal":"\u6307\u94B9","ride cymbal":"\u53EE\u53EE\u9572","Concert Toms":"\u97F3\u4E50\u4F1A\u55F5\u55F5\u9F13",Vibraslap:"\u5F39\u97F3\u5668","Wood Blocks":"\u6728\u9C7C","Temple Blocks":"\u6728\u9C7C","Wood Block":"\u6728\u9C7C","Field Drum":"\u519B\u9F13","Quad-Toms":"\u7B52\u9F13",Quads:"\u7B52\u9F13","Drums set":"\u67B6\u5B50\u9F13","High Bongo":"\u90A6\u6208",Timbales:"\u5929\u5DF4\u9F13","rain stick":"\u96E8\u68D2","String Bass":"\u5F26\u4E50\u4F4E\u97F3","Floor Tom":"\u4FA7\u55F5\u9F13","Brake Drum":"\u95F8\u9F13","Tam-tam":"\u5927\u9523",Cymbal:"\u9572",Cymbals:"\u9572"},zn=s=>{const e=s.replace(/ /g," ").toLocaleLowerCase(),t=Object.keys(ci);for(let i=0;i<t.length;i++)if(t[i].replace(/ /g," ").toLocaleLowerCase()===e)return ci[t[i]]||"";for(let i=0;i<t.length;i++){const n=t[i].replace(/ /g," ").toLocaleLowerCase();if(e.includes(n))return ci[t[i]]||""}return""},Qn="_musicDetail_1624u_1",Wn="_musicContainer_1624u_14",qn="_musicInfos_1624u_25",Xn="_musicImg_1624u_31",Yn="_info_1624u_43",jn="_names_1624u_49",Gn="_author_1624u_62",Kn="_audio_1624u_67",Jn="_showImgContainer_1624u_83",Zn="_footers_1624u_92",_n="_iconGroup_1624u_103",$n="_icon_1624u_11",er="_staffChange_1624u_123";var re={musicDetail:Qn,musicContainer:Wn,musicInfos:qn,musicImg:Xn,info:Yn,names:jn,author:Gn,audio:Kn,showImgContainer:Jn,footers:Zn,iconGroup:_n,icon:$n,staffChange:er};function k(s,e,t){return(e=ir(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function tr(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 ir(s){var e=tr(s,"string");return typeof e=="symbol"?e:String(e)}function sr(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function Zi(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 nr(s,e,t){return e&&Zi(s.prototype,e),t&&Zi(s,t),s}function rr(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 $i(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){rr(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 es={addCSS:!0,thumbWidth:15,watch:!0};function ar(s,e){return function(){return Array.from(document.querySelectorAll(e)).includes(this)}.call(s,e)}function or(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},Fi=function(s,e){return!!(s&&e&&s instanceof e)},Bs=function(s){return s==null},Os=function(s){return pt(s)===Object},lr=function(s){return pt(s)===Number&&!Number.isNaN(s)},Fs=function(s){return pt(s)===String},ur=function(s){return pt(s)===Boolean},cr=function(s){return pt(s)===Function},Is=function(s){return Array.isArray(s)},Ls=function(s){return Fi(s,NodeList)},hr=function(s){return Fi(s,Element)},dr=function(s){return Fi(s,Event)},mr=function(s){return Bs(s)||(Fs(s)||Is(s)||Ls(s))&&!s.length||Os(s)&&!Object.keys(s).length},ae={nullOrUndefined:Bs,object:Os,number:lr,string:Fs,boolean:ur,function:cr,array:Is,nodeList:Ls,element:hr,event:dr,empty:mr};function gr(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 pr(s,e){if(1>e){var t=gr(e);return parseFloat(s.toFixed(t))}return Math.round(s/e)*e}var fr=function(){function s(e,t){sr(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=$i({},es,{},t),this.init())}return nr(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(),u=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)*u:50<t&&(t+=2*(t-50)*u),r+pr(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),or(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=$i({},es,{},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)&&ar(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),Ii=s=>s==null,Rs=s=>ft(s)===Object,yr=s=>ft(s)===Number&&!Number.isNaN(s),Vt=s=>ft(s)===String,br=s=>ft(s)===Boolean,Ds=s=>typeof s=="function",Vs=s=>Array.isArray(s),vr=s=>Ne(s,WeakMap),Hs=s=>Ne(s,NodeList),Ar=s=>ft(s)===Text,wr=s=>Ne(s,Event),Cr=s=>Ne(s,KeyboardEvent),Tr=s=>Ne(s,window.TextTrackCue)||Ne(s,window.VTTCue),xr=s=>Ne(s,TextTrack)||!Ii(s)&&Vt(s.kind),Er=s=>Ne(s,Promise)&&Ds(s.then),Sr=s=>s!==null&&typeof s=="object"&&s.nodeType===1&&typeof s.style=="object"&&typeof s.ownerDocument=="object",Us=s=>Ii(s)||(Vt(s)||Vs(s)||Hs(s))&&!s.length||Rs(s)&&!Object.keys(s).length,kr=s=>{if(Ne(s,window.URL))return!0;if(!Vt(s))return!1;let e=s;s.startsWith("http://")&&s.startsWith("https://")||(e=`http://${s}`);try{return!Us(new URL(e).hostname)}catch{return!1}};var g={nullOrUndefined:Ii,object:Rs,number:yr,string:Vt,boolean:br,function:Ds,array:Vs,weakMap:vr,nodeList:Hs,element:Sr,textNode:Ar,event:wr,keyboardEvent:Cr,cue:Tr,track:xr,promise:Er,url:kr,empty:Us};const Ci=(()=>{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 zs(s,e){setTimeout(()=>{try{s.hidden=!0,s.offsetHeight,s.hidden=!1}catch{}},e)}const Nr=Boolean(window.document.documentMode),Pr=/Edge/g.test(navigator.userAgent),Mr="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),Br=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Or=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Fr=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var ie={isIE:Nr,isEdge:Pr,isWebKit:Mr,isIPhone:Br,isIPadOS:Or,isIos:Fr};function Ir(s){return JSON.parse(JSON.stringify(s))}function Qs(s,e){return e.split(".").reduce((t,i)=>t&&t[i],s)}function G(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]:{}}),G(s[i],t[i])):Object.assign(s,{[i]:t[i]})}),G(s,...e)):s}function Ws(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 Ti(s,e){g.element(s)&&!g.empty(e)&&Object.entries(e).filter(([,t])=>!g.nullOrUndefined(t)).forEach(([t,i])=>s.setAttribute(t,i))}function M(s,e,t){const i=document.createElement(s);return g.object(e)&&Ti(i,e),g.string(t)&&(i.innerText=t),i}function Lr(s,e){g.element(s)&&g.element(e)&&e.parentNode.insertBefore(s,e.nextSibling)}function ts(s,e,t,i){g.element(e)&&e.appendChild(M(s,t,i))}function Se(s){g.nodeList(s)||g.array(s)?Array.from(s).forEach(Se):g.element(s)&&g.element(s.parentNode)&&s.parentNode.removeChild(s)}function Bt(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=G({},e);return s.split(",").forEach(n=>{const r=n.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),[l]=a,u=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]=u}}),G(i,t)}function ze(s,e){if(!g.element(s))return;let t=e;g.boolean(t)||(t=!s.hidden),s.hidden=t}function D(s,e,t){if(g.nodeList(s))return Array.from(s).map(i=>D(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 Rt(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 ut(s){return this.elements.container.querySelectorAll(s)}function $(s){return this.elements.container.querySelector(s)}function hi(s=null,e=!1){g.element(s)&&s.focus({preventScroll:!0,focusVisible:e})}const is={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},K={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(s,e){const t=K[s]||e!=="html5";return{api:t,ui:t&&K.rangeInput}},pip:!(ie.isIPhone||!g.function(M("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||M("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(is).includes(t)&&(t+=`; codecs="${is[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:Ci!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Dr=(()=>{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 ct(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;Dr&&(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 L(s,e="",t,i=!0,n=!1){ct.call(this,s,e,t,!0,i,n)}function Ht(s,e="",t,i=!0,n=!1){ct.call(this,s,e,t,!1,i,n)}function Li(s,e="",t,i=!0,n=!1){const r=(...o)=>{Ht(s,e,r,i,n),t.apply(this,o)};ct.call(this,s,e,r,!0,i,n)}function O(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 Hr(){return new Promise(s=>this.ready?setTimeout(s,0):L.call(this,this.elements.container,"ready",s)).then(()=>{})}function Te(s){g.promise(s)&&s.then(null,()=>{})}function xi(s){return g.array(s)?s.filter((e,t)=>s.indexOf(e)===t):s}function qs(s,e){return g.array(s)&&s.length?s.reduce((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t):null}function Xs(s){return!(!window||!window.CSS)&&window.CSS.supports(s)}const ss=[[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 Ys(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 Ri(s){const e=i=>Ys(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=Ri.call(this,s);if(!g.array(t))return{};const[i,n]=Dt(t),r=100/i*n;if(Xs(`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=qs(Object.keys(ss),i);return Math.abs(n-i)<=t?ss[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 Ie={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(s=>{const e=s.getAttribute("type");return!!g.empty(e)||K.mime.call(this,e)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ie.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=Ie.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=Ie.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())}O.call(s,s.media,"qualitychange",!1,{quality:e})}}})},cancelRequests(){this.isHTML5&&(Se(Ie.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function zr(s){return`${s}-${Math.floor(1e4*Math.random())}`}function Ei(s,...e){return g.empty(s)?s:s.toString().replace(/{(\d+)}/g,(t,i)=>e[i].toString())}function Qr(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()),Gs=(s="")=>s.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase());function Wr(s=""){let e=s.toString();return e=lt(e,"-"," "),e=lt(e,"_"," "),e=Gs(e),lt(e," ","")}function qr(s=""){let e=s.toString();return e=Wr(e),e.charAt(0).toLowerCase()+e.slice(1)}function Xr(s){const e=document.createDocumentFragment(),t=document.createElement("div");return e.appendChild(t),t.innerHTML=s,e.firstChild.innerText}function Yr(s){const e=document.createElement("div");return e.appendChild(s),e.innerHTML}const ns={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},te={get(s="",e={}){if(g.empty(s)||g.empty(e))return"";let t=Qs(e.i18n,s);if(g.empty(t))return Object.keys(ns).includes(s)?ns[s]:"";const i={"{seektime}":e.seekTime,"{title}":e.title};return Object.entries(i).forEach(([n,r])=>{t=lt(t,n,r)}),t}};class ht{constructor(e){k(this,"get",t=>{if(!ht.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(!ht.supported||!this.enabled||!g.object(t))return;let i=this.get();g.empty(i)&&(i={}),G(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 Ks(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=ht.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),i&&l.setAttribute("id",e),a){const u=window.localStorage.getItem(`${t}-${e}`);if(n=u!==null,n){const c=JSON.parse(u);o(l,c.content)}}yt(s).then(u=>{if(!g.empty(u)){if(a)try{window.localStorage.setItem(`${t}-${e}`,JSON.stringify({content:u}))}catch{}o(l,u)}}).catch(()=>{})}}const Js=s=>Math.trunc(s/60/60%60,10),jr=s=>Math.trunc(s/60%60,10),Gr=s=>Math.trunc(s%60,10);function Ut(s=0,e=!1,t=!1){if(!g.number(s))return Ut(void 0,e,t);const i=a=>`0${a}`.slice(-2);let n=Js(s);const r=jr(s),o=Gr(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||ie.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=$.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ut.call(this,this.config.selectors.buttons.play),pause:$.call(this,this.config.selectors.buttons.pause),restart:$.call(this,this.config.selectors.buttons.restart),rewind:$.call(this,this.config.selectors.buttons.rewind),fastForward:$.call(this,this.config.selectors.buttons.fastForward),mute:$.call(this,this.config.selectors.buttons.mute),pip:$.call(this,this.config.selectors.buttons.pip),airplay:$.call(this,this.config.selectors.buttons.airplay),settings:$.call(this,this.config.selectors.buttons.settings),captions:$.call(this,this.config.selectors.buttons.captions),fullscreen:$.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=$.call(this,this.config.selectors.progress),this.elements.inputs={seek:$.call(this,this.config.selectors.inputs.seek),volume:$.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:$.call(this,this.config.selectors.display.buffer),currentTime:$.call(this,this.config.selectors.display.currentTime),duration:$.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");Ti(r,G(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=te.get(s,this.config);return M("span",{...e,class:[e.class,this.config.classNames.hidden].filter(Boolean).join(" ")},t)},createBadge(s){if(g.empty(s))return null;const e=M("span",{class:this.config.classNames.menu.value});return e.appendChild(M("span",{class:this.config.classNames.menu.badge},s)),e},createButton(s,e){const t=G({},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)||G(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=M(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))),G(t,Ce(this.config.selectors.buttons[i],t)),Ti(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=M("input",G(Ce(this.config.selectors.inputs[s]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":te.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),fr.setup(t),t},createProgress(s,e){const t=M("progress",G(Ce(this.config.selectors.display[s]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},e));if(s!=="volume"){t.appendChild(M("span",null,"0"));const i={played:"played",buffer:"buffered"}[s],n=i?te.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=M("div",G(t,{class:`${t.class?t.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":te.get(s,this.config),role:"timer"}),"00:00");return this.elements.display[s]=i,i},bindMenuItemShortcuts(s,e){L.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),L.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=M("button",G(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:s})),l=M("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(u){u&&Array.from(a.parentNode.children).filter(c=>qe(c,'[role="menuitemradio"]')).forEach(c=>c.setAttribute("aria-checked","false")),a.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(a,"click keyup",u=>{if(!g.keyboardEvent(u)||u.key===" "){switch(u.preventDefault(),u.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(u))}},t,!1),E.bindMenuItemShortcuts.call(this,a,t),e.appendChild(a)},formatTime(s=0,e=!1){return g.number(s)?Ut(s,Js(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=Qr(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=te.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);(ie.isWebKit||ie.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=c=>D(i,n,c);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(!Rt(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 u=(e=this.config.markers)===null||e===void 0||(t=e.points)===null||t===void 0?void 0:t.find(({time:c})=>c===Math.round(l));u&&i.insertAdjacentHTML("afterbegin",`${u.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 ze(this.elements.display.currentTime,!0),void ze(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){ze(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?te.get("normal",this.config):`${e}&times;`;case"quality":if(g.number(e)){const t=te.get(`qualityLabel.${e}`,this.config);return t.length?t:`${e}p`}return Gs(e);case"captions":return R.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=xi(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),Bt(t),E.checkMenu.call(this),!i)return;const n=r=>{const o=te.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=R.getTracks.call(this),i=Boolean(t.length);if(E.toggleMenuButton.call(this,s,i),Bt(e),E.checkMenu.call(this),!i)return;const n=t.map((r,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:R.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:te.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),Bt(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);ze(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),ze(e,!n),D(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 Se(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(K.transitions&&!K.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="",Ht.call(this,i,Ci,o))};L.call(this,i,Ci,o),i.style.width=`${r.width}px`,i.style.height=`${r.height}px`}ze(n,!0),ze(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 u=M("div",Ce(this.config.selectors.controls.wrapper));this.elements.controls=u;const c={class:"plyr__controls__item"};return xi(g.array(this.config.controls)?this.config.controls:[]).forEach(m=>{if(m==="restart"&&u.appendChild(t.call(this,"restart",c)),m==="rewind"&&u.appendChild(t.call(this,"rewind",c)),m==="play"&&u.appendChild(t.call(this,"play",c)),m==="fast-forward"&&u.appendChild(t.call(this,"fast-forward",c)),m==="progress"){const h=M("div",{class:`${c.class} plyr__progress__container`}),d=M("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=M("span",{class:this.config.classNames.tooltip},"00:00");d.appendChild(p),this.elements.display.seekTooltip=p}this.elements.progress=d,h.appendChild(this.elements.progress),u.appendChild(h)}if(m==="current-time"&&u.appendChild(r.call(this,"currentTime",c)),m==="duration"&&u.appendChild(r.call(this,"duration",c)),m==="mute"||m==="volume"){let{volume:h}=this.elements;if(g.element(h)&&u.contains(h)||(h=M("div",G({},c,{class:`${c.class} plyr__volume`.trim()})),this.elements.volume=h,u.appendChild(h)),m==="mute"&&h.appendChild(t.call(this,"mute")),m==="volume"&&!ie.isIos&&!ie.isIPadOS){const d={max:1,step:.05,value:this.config.volume};h.appendChild(n.call(this,"volume",G(d,{id:`plyr-volume-${s.id}`})))}}if(m==="captions"&&u.appendChild(t.call(this,"captions",c)),m==="settings"&&!g.empty(this.config.settings)){const h=M("div",G({},c,{class:`${c.class} plyr__menu`.trim(),hidden:""}));h.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${s.id}`,"aria-expanded":!1}));const d=M("div",{class:"plyr__menu__container",id:`plyr-settings-${s.id}`,hidden:""}),p=M("div"),y=M("div",{id:`plyr-settings-${s.id}-home`}),b=M("div",{role:"menu"});y.appendChild(b),p.appendChild(y),this.elements.settings.panels.home=y,this.config.settings.forEach(v=>{const A=M("button",G(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,A,v),L.call(this,A,"click",()=>{l.call(this,v,!1)});const f=M("span",null,te.get(v,this.config)),w=M("span",{class:this.config.classNames.menu.value});w.innerHTML=s[v],f.appendChild(w),A.appendChild(f),b.appendChild(A);const x=M("div",{id:`plyr-settings-${s.id}-${v}`,hidden:""}),S=M("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});S.appendChild(M("span",{"aria-hidden":!0},te.get(v,this.config))),S.appendChild(M("span",{class:this.config.classNames.hidden},te.get("menuBack",this.config))),L.call(this,x,"keydown",T=>{T.key==="ArrowLeft"&&(T.preventDefault(),T.stopPropagation(),l.call(this,"home",!0))},!1),L.call(this,S,"click",()=>{l.call(this,"home",!1)}),x.appendChild(S),x.appendChild(M("div",{role:"menu"})),p.appendChild(x),this.elements.settings.buttons[v]=A,this.elements.settings.panels[v]=x}),d.appendChild(p),h.appendChild(d),u.appendChild(h),this.elements.settings.popup=d,this.elements.settings.menu=h}if(m==="pip"&&K.pip&&u.appendChild(t.call(this,"pip",c)),m==="airplay"&&K.airplay&&u.appendChild(t.call(this,"airplay",c)),m==="download"){const h=G({},c,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(h.download="");const{download:d}=this.config.urls;!g.url(d)&&this.isEmbed&&G(h,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(t.call(this,"download",h))}m==="fullscreen"&&u.appendChild(t.call(this,"fullscreen",c))}),this.isHTML5&&o.call(this,Ie.getQualityOptions.call(this)),a.call(this),u},inject(){if(this.config.loadSprite){const n=E.getIconUrl.call(this);n.cors&&Ks(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:R.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:()=>Rt(r,o),set(a=!1){D(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(ie.isEdge&&zs(i),this.config.tooltips.controls){const{classNames:n,selectors:r}=this.config,o=`${r.controls.wrapper} ${r.labels} .${n.hidden}`,a=ut.call(this,o);Array.from(a).forEach(l=>{D(l,this.config.classNames.hidden,!1),D(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=>D(r,o,l);t.forEach(l=>{const u=M("span",{class:this.config.classNames.marker},""),c=l.time/this.duration*100+"%";r&&(u.addEventListener("mouseenter",()=>{l.label||(r.style.left=c,r.innerHTML=l.label,a(!0))}),u.addEventListener("mouseleave",()=>{a(!1)})),u.addEventListener("click",()=>{this.currentTime=l.time}),u.style.left=c,n.appendChild(u)}),i.appendChild(n),this.config.tooltips.seek||(r=M("span",{class:this.config.classNames.tooltip},""),i.appendChild(r)),this.elements.markers={points:n,tip:r},this.elements.progress.appendChild(i)}};function Zs(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 _s(s){const e=new URLSearchParams;return g.object(s)&&Object.entries(s).forEach(([t,i])=>{e.set(t,i)}),e}const R={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!K.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=M("div",Ce(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Lr(this.elements.captions,this.elements.wrapper)),ie.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(n=>{const r=n.getAttribute("src"),o=Zs(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(()=>{Se(n)})})}const s=xi((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";L.call(this,this.media.textTracks,i,R.update.bind(this))}setTimeout(R.update.bind(this),0)},update(){const s=R.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"),L.call(this,o,"cuechange",()=>R.updateCues.call(this))}),(r&&this.language!==t||!s.includes(n))&&(R.setLanguage.call(this,t),R.toggle.call(this,e&&r)),this.elements&&D(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=R.getTracks.call(this),o=R.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=o.language,void R.set.call(this,r.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),D(this.elements.container,i,n),this.captions.toggled=n,E.updateSetting.call(this,"captions"),O.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(s,e=!0){const t=R.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),O.call(this,this.media,"languagechange")}R.toggle.call(this,!0,e),this.isHTML5&&this.isVideo&&R.updateCues.call(this)}else this.debug.warn("Track not found",s);else this.debug.warn("Invalid caption argument",s);else R.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=R.getTracks.call(this),n=R.findTrack.call(this,[t]);R.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=R.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 R.getTracks.call(this)[this.currentTrack]},getLabel(s){let e=s;return!g.track(e)&&K.textTracks&&this.captions.toggled&&(e=R.getCurrentTrack.call(this)),g.track(e)?g.empty(e.label)?g.empty(e.language)?te.get("enabled",this.config):s.language.toUpperCase():e.label:te.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=R.getCurrentTrack.call(this);e=Array.from((i||{}).activeCues||[]).map(n=>n.getCueAsHTML()).map(Yr)}const t=e.map(i=>i.trim()).join(`
  2. `);if(t!==this.elements.captions.innerHTML){Bt(this.elements.captions);const i=M("span",Ce(this.config.selectors.caption));i.innerHTML=t,this.elements.captions.appendChild(i),O.call(this,this.media,"cuechange")}}},$s={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:[]}},di={active:"picture-in-picture",inactive:"inline"},Fe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},mi={audio:"audio",video:"video"};function Kr(s){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(s)?Fe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(s)?Fe.vimeo:null}const gi=()=>{};class Jr{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):gi}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):gi}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):gi}}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;O.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":"",D(this.target,this.player.config.classNames.fullscreen.fallback,t),ie.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(ie.isIos||ie.isIPadOS||!this.active||t.key!=="Tab")return;const i=document.activeElement,n=ut.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");D(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),k(this,"enter",()=>{this.supported&&(ie.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(ie.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),L.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),L.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")}),L.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||!ie.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 Rt(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 ie.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(e=this.player.elements.fullscreen)!=null?e:this.player.elements.container}}function Ot(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 H={addStyleHook(){D(this.elements.container,this.config.selectors.container.replace(".",""),!0),D(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 H.toggleNativeControls.call(this,!0);g.element(this.elements.controls)||(E.inject.call(this),this.listeners.controls()),H.toggleNativeControls.call(this),this.isHTML5&&R.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),H.checkPlaying.call(this),D(this.elements.container,this.config.classNames.pip.supported,K.pip&&this.isHTML5&&this.isVideo),D(this.elements.container,this.config.classNames.airplay.supported,K.airplay&&this.isHTML5),D(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{O.call(this,this.media,"ready")},0),H.setTitle.call(this),this.poster&&H.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&E.durationUpdate.call(this),this.config.mediaMetadata&&E.setMediaMetadata.call(this)},setTitle(){let s=te.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=$.call(this,"iframe");if(!g.element(e))return;const t=g.empty(this.config.title)?"video":this.config.title,i=te.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(s){D(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"),Hr.call(this).then(()=>Ot(s)).catch(t=>{throw s===this.poster&&H.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:""}),H.togglePoster.call(this,!0),s)))},checkPlaying(s){D(this.elements.container,this.config.classNames.playing,this.playing),D(this.elements.container,this.config.classNames.paused,this.paused),D(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",te.get(this.playing?"pause":"play",this.config))}),g.event(s)&&s.type==="timeupdate"||H.toggleControls.call(this)},checkLoading(s){this.loading=["stalled","waiting"].includes(s.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{D(this.elements.container,this.config.classNames.loading,this.loading),H.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 Zr{constructor(e){k(this,"firstTouch",()=>{const{player:t}=this,{elements:i}=t;t.touch=!0,D(i.container,t.config.classNames.isTouch,!0)}),k(this,"global",(t=!0)=>{const{player:i}=this;i.config.keyboard.global&&ct.call(i,window,"keydown keyup",this.handleKey,t,!1),ct.call(i,document.body,"click",this.toggleMenu,t),Li.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&&L.call(t,n.container,"keydown keyup",this.handleKey,!1),L.call(t,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",l=>{const{controls:u}=n;u&&l.type==="enterfullscreen"&&(u.pressed=!1,u.hover=!1);let c=0;["touchstart","touchmove","mousemove"].includes(l.type)&&(H.toggleControls.call(t,!0),c=t.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>H.toggleControls.call(t,!1),c)});const o=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const l=n.wrapper,{active:u}=t.fullscreen,[c,m]=Ri.call(t),h=Xs(`aspect-ratio: ${c} / ${m}`);if(!u)return void(h?(l.style.width=null,l.style.height=null):(l.style.maxWidth=null,l.style.margin=null));const[d,p]=Ur(),y=d/p>c/m;h?(l.style.width=y?"auto":"100%",l.style.height=y?"100%":"auto"):(l.style.maxWidth=y?p/m*c+"px":null,l.style.margin=y?"0 auto":null)},a=()=>{clearTimeout(r.resized),r.resized=setTimeout(o,50)};L.call(t,n.container,"enterfullscreen exitfullscreen",l=>{const{target:u}=t.fullscreen;u===n.container&&(!t.isEmbed&&g.empty(t.config.ratio)||(o(),(l.type==="enterfullscreen"?L:Ht).call(t,window,"resize",a)))})}),k(this,"media",()=>{const{player:t}=this,{elements:i}=t;if(L.call(t,t.media,"timeupdate seeking seeked",r=>E.timeUpdate.call(t,r)),L.call(t,t.media,"durationchange loadeddata loadedmetadata",r=>E.durationUpdate.call(t,r)),L.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),L.call(t,t.media,"progress playing seeking seeked",r=>E.updateProgress.call(t,r)),L.call(t,t.media,"volumechange",r=>E.updateVolume.call(t,r)),L.call(t,t.media,"playing play pause ended emptied timeupdate",r=>H.checkPlaying.call(t,r)),L.call(t,t.media,"waiting canplay seeked playing",r=>H.checkLoading.call(t,r)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const r=$.call(t,`.${t.config.classNames.video}`);if(!g.element(r))return;L.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&&L.call(t,i.wrapper,"contextmenu",r=>{r.preventDefault()},!1),L.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),L.call(t,t.media,"ratechange",()=>{E.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),L.call(t,t.media,"qualitychange",r=>{E.updateSetting.call(t,"quality",null,r.detail.quality)}),L.call(t,t.media,"ready qualitychange",()=>{E.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");L.call(t,t.media,n,r=>{let{detail:o={}}=r;r.type==="error"&&(o=t.media.error),O.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],u=g.function(l);L.call(a,t,i,c=>this.proxy(c,n,r),o&&!u)}),k(this,"controls",()=>{const{player:t}=this,{elements:i}=t,n=ie.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",()=>{O.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),u=["mouseup","touchend","keyup"].includes(r.type);l&&u?(o.removeAttribute(a),Te(t.play())):!u&&t.playing&&(o.setAttribute(a,""),t.pause())}),ie.isIos){const r=ut.call(t,'input[type="range"]');Array.from(r).forEach(o=>this.bind(o,n,a=>zs(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)}),ie.isWebKit&&Array.from(ut.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;D(i.controls,r.classNames.noTransition,!0),H.toggleControls.call(t,!0),setTimeout(()=>{D(i.controls,r.classNames.noTransition,!1)},0);const a=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>H.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),u=Math.sign(Math.abs(a)>Math.abs(l)?a:l);t.increaseVolume(u/50);const{volume:c}=t.media;(u===1&&c<1||u===-1&&c>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:u}=e,c=r==="keydown",m=c&&n===this.lastKey;if(!(o||a||l||u)&&!!n){if(c){const d=document.activeElement;if(g.element(d)){const{editable:p}=t.config.selectors,{seek:y}=i.inputs;if(d!==y&&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||(h=parseInt(n,10),t.currentTime=t.duration/10*h);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 h}}toggleMenu(e){E.toggleMenu.call(this.player,e)}}function _r(s,e){return s(e={exports:{}},e.exports),e.exports}var $r=_r(function(s,e){s.exports=function(){var t=function(){},i={},n={},r={};function o(h,d){h=h.push?h:[h];var p,y,b,v=[],A=h.length,f=A;for(p=function(w,x){x.length&&v.push(w),--f||d(v)};A--;)y=h[A],(b=n[y])?p(y,b):(r[y]=r[y]||[]).push(p)}function a(h,d){if(h){var p=r[h];if(n[h]=d,p)for(;p.length;)p[0](h,d),p.splice(0,1)}}function l(h,d){h.call&&(h={success:h}),d.length?(h.error||t)(d):(h.success||t)(h)}function u(h,d,p,y){var b,v,A=document,f=p.async,w=(p.numRetries||0)+1,x=p.before||t,S=h.replace(/[\?|#].*$/,""),T=h.replace(/^(css|img)!/,"");y=y||0,/(^css!|\.css$)/.test(S)?((v=A.createElement("link")).rel="stylesheet",v.href=T,(b="hideFocus"in v)&&v.relList&&(b=0,v.rel="preload",v.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(S)?(v=A.createElement("img")).src=T:((v=A.createElement("script")).src=h,v.async=f===void 0||f),v.onload=v.onerror=v.onbeforeload=function(B){var I=B.type[0];if(b)try{v.sheet.cssText.length||(I="e")}catch(U){U.code!=18&&(I="e")}if(I=="e"){if((y+=1)<w)return u(h,d,p,y)}else if(v.rel=="preload"&&v.as=="style")return v.rel="stylesheet";d(h,I,B.defaultPrevented)},x(h,v)!==!1&&A.head.appendChild(v)}function c(h,d,p){var y,b,v=(h=h.push?h:[h]).length,A=v,f=[];for(y=function(w,x,S){if(x=="e"&&f.push(w),x=="b"){if(!S)return;f.push(w)}--v||d(f)},b=0;b<A;b++)u(h[b],y,p)}function m(h,d,p){var y,b;if(d&&d.trim&&(y=d),b=(y?p:d)||{},y){if(y in i)throw"LoadJS";i[y]=!0}function v(A,f){c(h,function(w){l(b,w),A&&l({success:A,error:f},w),a(y,w)},b)}if(b.returnPromise)return new Promise(v);v()}return m.ready=function(h,d){return o(h,function(p){l(d,p)}),m},m.done=function(h){a(h,[])},m.reset=function(){i={},n={},r={}},m.isDefined=function(h){return h in i},m}()});function Di(s){return new Promise((e,t)=>{$r(s,{success:e,error:t})})}function ea(s){return g.empty(s)?null:g.number(Number(s))?s:s.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:s}function ta(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,O.call(this,this.media,s?"play":"pause"))}const Si={setup(){const s=this;D(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):Di(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=ta(r);const a=o?{h:o}:{};t&&Object.assign(n,{controls:!1,sidedock:!1});const l=_s({loop:s.config.loop.active,autoplay:s.autoplay,muted:s.muted,gesture:"media",playsinline:s.config.playsinline,...a,...n}),u=ea(r),c=M("iframe"),m=Ei(s.config.urls.vimeo.iframe,u,l);if(c.setAttribute("src",m),c.setAttribute("allowfullscreen",""),c.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),g.empty(i)||c.setAttribute("referrerPolicy",i),t||!e.customControls)c.setAttribute("data-poster",s.poster),s.media=Lt(c,s.media);else{const A=M("div",{class:s.config.classNames.embedContainer,"data-poster":s.poster});A.appendChild(c),s.media=Lt(A,s.media)}e.customControls||yt(Ei(s.config.urls.vimeo.api,m)).then(A=>{!g.empty(A)&&A.thumbnail_url&&H.setPoster.call(s,A.thumbnail_url).catch(()=>{})}),s.embed=new window.Vimeo.Player(c,{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:h}=s.media;Object.defineProperty(s.media,"currentTime",{get:()=>h,set(A){const{embed:f,media:w,paused:x,volume:S}=s,T=x&&!f.hasPlayed;w.seeking=!0,O.call(s,w,"seeking"),Promise.resolve(T&&f.setVolume(0)).then(()=>f.setCurrentTime(A)).then(()=>T&&f.pause()).then(()=>T&&f.setVolume(S)).catch(()=>{})}});let d=s.config.speed.selected;Object.defineProperty(s.media,"playbackRate",{get:()=>d,set(A){s.embed.setPlaybackRate(A).then(()=>{d=A,O.call(s,s.media,"ratechange")}).catch(()=>{s.options.speed=[1]})}});let{volume:p}=s.config;Object.defineProperty(s.media,"volume",{get:()=>p,set(A){s.embed.setVolume(A).then(()=>{p=A,O.call(s,s.media,"volumechange")})}});let{muted:y}=s.config;Object.defineProperty(s.media,"muted",{get:()=>y,set(A){const f=!!g.boolean(A)&&A;s.embed.setMuted(!!f||s.config.muted).then(()=>{y=f,O.call(s,s.media,"volumechange")})}});let b,{loop:v}=s.config;Object.defineProperty(s.media,"loop",{get:()=>v,set(A){const f=g.boolean(A)?A:s.config.loop.active;s.embed.setLoop(f).then(()=>{v=f})}}),s.embed.getVideoUrl().then(A=>{b=A,E.setDownloadUrl.call(s)}).catch(A=>{this.debug.warn(A)}),Object.defineProperty(s.media,"currentSrc",{get:()=>b}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration}),Promise.all([s.embed.getVideoWidth(),s.embed.getVideoHeight()]).then(A=>{const[f,w]=A;s.embed.ratio=js(f,w),$e.call(this)}),s.embed.setAutopause(s.config.autopause).then(A=>{s.config.autopause=A}),s.embed.getVideoTitle().then(A=>{s.config.title=A,H.setTitle.call(this)}),s.embed.getCurrentTime().then(A=>{h=A,O.call(s,s.media,"timeupdate")}),s.embed.getDuration().then(A=>{s.media.duration=A,O.call(s,s.media,"durationchange")}),s.embed.getTextTracks().then(A=>{s.media.textTracks=A,R.setup.call(s)}),s.embed.on("cuechange",({cues:A=[]})=>{const f=A.map(w=>Xr(w.text));R.updateCues.call(s,f)}),s.embed.on("loaded",()=>{s.embed.getPaused().then(A=>{st.call(s,!A),A||O.call(s,s.media,"playing")}),g.element(s.embed.element)&&s.supported.ui&&s.embed.element.setAttribute("tabindex",-1)}),s.embed.on("bufferstart",()=>{O.call(s,s.media,"waiting")}),s.embed.on("bufferend",()=>{O.call(s,s.media,"playing")}),s.embed.on("play",()=>{st.call(s,!0),O.call(s,s.media,"playing")}),s.embed.on("pause",()=>{st.call(s,!1)}),s.embed.on("timeupdate",A=>{s.media.seeking=!1,h=A.seconds,O.call(s,s.media,"timeupdate")}),s.embed.on("progress",A=>{s.media.buffered=A.percent,O.call(s,s.media,"progress"),parseInt(A.percent,10)===1&&O.call(s,s.media,"canplaythrough"),s.embed.getDuration().then(f=>{f!==s.media.duration&&(s.media.duration=f,O.call(s,s.media,"durationchange"))})}),s.embed.on("seeked",()=>{s.media.seeking=!1,O.call(s,s.media,"seeked")}),s.embed.on("ended",()=>{s.media.paused=!0,O.call(s,s.media,"ended")}),s.embed.on("error",A=>{s.media.error=A,O.call(s,s.media,"error")}),e.customControls&&setTimeout(()=>H.build.call(s),0)}};function ia(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,O.call(this,this.media,s?"play":"pause"))}function sa(s){return s.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const Ft={setup(){if(D(this.elements.wrapper,this.config.classNames.embed,!0),g.object(window.YT)&&g.function(window.YT.Player))Ft.ready.call(this);else{const s=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{g.function(s)&&s(),Ft.ready.call(this)},Di(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(s){yt(Ei(this.config.urls.youtube.api,s)).then(e=>{if(g.object(e)){const{title:t,height:i,width:n}=e;this.config.title=t,H.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=ia(i),r=M("div",{id:zr(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`;Ot(o("maxres"),121).catch(()=>Ot(o("sd"),121)).catch(()=>Ot(o("hq"))).then(a=>H.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:sa(e),playerVars:G({},{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},O.call(s,s.media,"error")}},onPlaybackRateChange(o){const a=o.target;s.media.playbackRate=a.getPlaybackRate(),O.call(s,s.media,"ratechange")},onReady(o){if(g.function(s.media.play))return;const a=o.target;Ft.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,O.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),O.call(s,s.media,"volumechange")}});let{muted:u}=s.config;Object.defineProperty(s.media,"muted",{get:()=>u,set(m){const h=g.boolean(m)?m:u;u=h,a[h?"mute":"unMute"](),a.setVolume(100*l),O.call(s,s.media,"volumechange")}}),Object.defineProperty(s.media,"currentSrc",{get:()=>a.getVideoUrl()}),Object.defineProperty(s.media,"ended",{get:()=>s.currentTime===s.duration});const c=a.getAvailablePlaybackRates();s.options.speed=c.filter(m=>s.config.speed.options.includes(m)),s.supported.ui&&e.customControls&&s.media.setAttribute("tabindex",-1),O.call(s,s.media,"timeupdate"),O.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)&&O.call(s,s.media,"progress"),s.media.lastBuffered=s.media.buffered,s.media.buffered===1&&(clearInterval(s.timers.buffering),O.call(s,s.media,"canplaythrough"))},200),e.customControls&&setTimeout(()=>H.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,O.call(s,s.media,"seeked")),o.data){case-1:O.call(s,s.media,"timeupdate"),s.media.buffered=a.getVideoLoadedFraction(),O.call(s,s.media,"progress");break;case 0:nt.call(s,!1),s.media.loop?(a.stopVideo(),a.playVideo()):O.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),O.call(s,s.media,"playing"),s.timers.playing=setInterval(()=>{O.call(s,s.media,"timeupdate")},50),s.media.duration!==a.getDuration()&&(s.media.duration=a.getDuration(),O.call(s,s.media,"durationchange")));break;case 2:s.muted||s.embed.unMute(),nt.call(s,!1);break;case 3:O.call(s,s.media,"waiting")}O.call(s,s.elements.container,"statechange",!1,{code:o.data})}}})}},en={setup(){this.media?(D(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),D(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&D(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=M("div",{class:this.config.classNames.video}),Ws(this.media,this.elements.wrapper),this.elements.poster=M("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ie.setup.call(this):this.isYouTube?Ft.setup.call(this):this.isVimeo&&Si.setup.call(this)):this.debug.warn("No media element found!")}};class na{constructor(e){k(this,"load",()=>{this.enabled&&(g.object(window.google)&&g.object(window.google.ima)?this.ready():Di(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=M("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=Ut(Math.max(this.manager.getRemainingTime(),0)),n=`${te.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=M("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=>{O.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/?${_s({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 tn(s=0,e=0,t=255){return Math.min(Math.max(s,e),t)}const ra=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},rs=(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 ki{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:ra(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=Ut(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):Li.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=M("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=M("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=M("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=M("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=M("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 u=new Image;u.src=l,u.dataset.index=i,u.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),u.onload=()=>this.showImage(u,o,t,i,a,!0),this.loadingImage=u,this.removeOldImages(u)}}),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 u=l.text;if(u!==r&&!this.loadedImages.includes(u)){a=!0,this.player.debug.log(`Preloading thumb filename: ${u}`);const{urlPrefix:c}=this.thumbnails[0],m=c+u,h=new Image;h.src=m,h.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${u}`),this.loadedImages.includes(u)||this.loadedImages.push(u),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=tn(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}=rs(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}=rs(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 Ni={insertElements(s,e){g.string(e)?ts(s,this.media,{src:e}):g.array(e)&&e.forEach(t=>{ts(s,this.media,t)})},change(s){Qs(s,"sources.length")?(Ie.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],Se(this.media),this.media=null,g.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:e,type:t}=s,[{provider:i=Fe.html5,src:n}]=e,r=i==="html5"?t:"div",o=i==="html5"?{}:{src:n};Object.assign(this,{provider:i,type:t,supported:K.check(t,i,this.config.playsinline),media:M(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","")),H.addStyleHook.call(this),this.isHTML5&&Ni.insertElements.call(this,"source",e),this.config.title=s.title,en.setup.call(this),this.isHTML5&&Object.keys(s).includes("tracks")&&Ni.insertElements.call(this,"track",s.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&H.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 ki(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",()=>{K.airplay&&this.media.webkitShowPlaybackTargetPicker()}),k(this,"toggleControls",a=>{if(this.supported.ui&&!this.isAudio){const l=Rt(this.elements.container,this.config.classNames.hideControls),u=a===void 0?void 0:!a,c=D(this.elements.container,this.config.classNames.hideControls,u);if(c&&g.array(this.config.controls)&&this.config.controls.includes("settings")&&!g.empty(this.config.settings)&&E.toggleMenu.call(this,!1),c!==l){const m=c?"controlshidden":"controlsshown";O.call(this,this.media,m)}return!c}return!1}),k(this,"on",(a,l)=>{L.call(this,this.elements.container,a,l)}),k(this,"once",(a,l)=>{Li.call(this,this.elements.container,a,l)}),k(this,"off",(a,l)=>{Ht(this.elements.container,a,l)}),k(this,"destroy",(a,l=!1)=>{if(!this.ready)return;const u=()=>{document.body.style.overflow="",this.embed=null,l?(Object.keys(this.elements).length&&(Se(this.elements.buttons.play),Se(this.elements.captions),Se(this.elements.controls),Se(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),Ie.cancelRequests.call(this),Lt(this.elements.original,this.elements.container),O.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?(H.toggleNativeControls.call(this,!0),u()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&g.function(this.embed.destroy)&&this.embed.destroy(),u()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(u),setTimeout(u,200))}),k(this,"supports",a=>K.mime.call(this,a)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=K.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=G({},$s,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 Jr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",K),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(!K.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=Zs(r.getAttribute("src")),this.provider=Kr(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(Fe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=mi.video;break;case"video":case"audio":this.type=n,this.provider=Fe.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=K.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Zr(this),this.storage=new ht(this),this.media.plyr=this,g.element(this.elements.container)||(this.elements.container=M("div"),Ws(this.media,this.elements.container)),H.migrateStyles.call(this),H.addStyleHook.call(this),en.setup.call(this),this.config.debug&&L.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)&&H.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new na(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Te(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ki(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Fe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Fe.youtube}get isVimeo(){return this.provider===Fe.vimeo}get isVideo(){return this.type===mi.video}get isAudio(){return this.type===mi.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=tn(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=qs(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){Ni.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?H.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(Ri.call(this));return g.array(e)?e.join(":"):e}set ratio(e){this.isVideo?g.string(e)&&Ys(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){R.toggle.call(this,e,!1)}set currentTrack(e){R.set.call(this,e,!1),R.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){R.setLanguage.call(this,e,!1)}get language(){return(R.getCurrentTrack.call(this)||{}).language}set pip(e){if(!K.pip)return;const t=g.boolean(e)?e:!this.pip;g.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?di.active:di.inactive),g.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return K.pip?g.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===di.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 ki(this))}static supported(e,t){return K.check(e,t)}static loadSprite(e,t){return Ks(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($s);const aa="_staffContainer_f8ytm_1",oa="_staffTitle_f8ytm_6",la="_staffImg_f8ytm_13",ua="_name_f8ytm_17",ca="_boxStyle_f8ytm_22",ha="_active_f8ytm_29";var he={staffContainer:aa,staffTitle:oa,staffImg:la,name:ua,boxStyle:ca,active:ha},pi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA11JREFUWEfVmU1ME0EUx/9vt0TkO6EkLdg0IKF08aZGr569mKgJB0+e1OAdDp484F0jnDyZGAMHL569mqgn7JYShJAKbUKbAAUsod0nb9NtxvJRKiUd5rTZnXnzm/fmfcws4T8aMxu2bd80DOMOgOsAIgCCANpL4nIAUgASAH44jvPFsqxvROTUOh3VMiCRSPQVCoUxAI+I6EotY5n5N4D3Pp/vTSQSWT3t2FMBxuPxbmZ+CeAxgEunFX5Mvz0A74joRTQazVaTVRXQtu1RAK8B+FVhPp8Pra2taGlpQXNzM5qammAYhtvFcRzs7+8jn89jd3cXOzs7KBQKlSwZ0zTHIpHIx5MgjwVkZt+B5gTsiSpAgLq7u104oqrrc4cyswuZzWZd4Io2faDJ50R0aAXS78gZksnk5VwuNwPgridMNBQIBNDW1lbNKid+397eRjqddjWstM/t7e0PQ6HQn8rBhwBLmvukwnV0dCAYDJZNeCbC0hZIpVLY2tr6BzIajd6r1OQhQN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f7ieWnQkDHIrdwoVsrODqOSJa8Je0ffBKBWyUmG3mDCLQWlcalVAlSCU4kis8Vr9tyOhvdXGVsr4BcA/l/1XMIyDPzDgEOAXlGIM/uLVeAVhO4Weg86EuoPOf9ibiXZJql1LVst2LcIcAKWhlkHQJsBDMXU58KAWqofAazMN7LOiMNASLpTqvfDlluQcb/wRKtbeb3ow4R5xHwFI04SuEmS98kWSbAQdteBBwC7MXTsjWHAMuQ2avgEGAvnpatOQRYhsxeBYcAe/G0bM0hwDJk9io4BNiLp2VrDgGWIbNXwSHAXjwtW/svbQM/ebg6togAAAAASUVORK5CYII=",ba=Oi({name:"staff-change",props:{radio:{type:String,default:"staff"}},emits:["change","close"],setup(s,{emit:e}){const{radio:t}=bn(s),i=n=>{t.value=n,e("change",n),e("close")};return()=>N("div",{class:he.staffContainer},[N("div",{class:he.staffTitle},[ve("\u8F6C\u6362\u66F2\u8C31")]),N(Ln,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{default:()=>[N(Rn,{border:!1},{default:()=>[N(ui,{center:!0,border:!1,class:t.value==="staff"?he.active:"",onClick:()=>i("staff")},{icon:()=>N(ot,{src:t.value==="staff"?ma:da,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u4E94\u7EBF\u8C31")]),value:()=>N(li,{name:"staff"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})}),N(ui,{center:!0,border:!1,class:t.value==="first"?he.active:"",onClick:()=>i("first")},{icon:()=>N(ot,{src:t.value==="first"?ya:fa,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u7B80\u8C31-\u9996\u8C03")]),value:()=>N(li,{name:"first"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})}),N(ui,{center:!0,border:!1,class:t.value==="fixed"?he.active:"",onClick:()=>i("fixed")},{icon:()=>N(ot,{src:t.value==="fixed"?pa:ga,class:he.staffImg},null),title:()=>N("span",{class:he.name},[ve("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>N(li,{name:"fixed"},{icon:n=>N(si,{class:he.boxStyle,name:n.checked?fi:pi},null)})})]})]})])}});const va="_downloadContainer_ahrb6_1",Aa="_musicContainer_ahrb6_4",wa="_musicImg_ahrb6_15",Ca="_num_ahrb6_18",Ta="_page_ahrb6_26",xa="_downloadBtn_ahrb6_32";var Be={downloadContainer:va,musicContainer:Aa,musicImg:wa,num:Ca,page:Ta,downloadBtn:xa};const Ea=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},Sa=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)}},ka=(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},Na=s=>s.toDataURL("image/png");var Pa=Oi({name:"download",props:{imgList:{type:Array,default:()=>[]},musicSheetName:{type:String,default:""}},setup(s){const e=be(s.imgList),t=be();Ns(()=>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 Ea(e.value[i.value]),u=ka(l,{title:s.musicSheetName,size:12}),c=await Sa(u);r.value=Na(c),console.log(r.value,"image.value"),await a()}},a=async()=>{var u;vn({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{n.value=!1},100);const l=await An({api:"savePicture",content:{base64:r.value}});((u=l==null?void 0:l.content)==null?void 0:u.status)==="success"?wn("\u5DF2\u4FDD\u5B58\u5230\u76F8\u518C"):Cn("\u4FDD\u5B58\u5931\u8D25")};return()=>N("div",{class:Be.downloadContainer},[N("div",{class:Be.musicContainer},[N("h2",null,[s.musicSheetName]),N("div",{class:Be.musicImg},[N(Dn,{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:Be.buttonGroup},[N("div",{class:Be.num},[N("span",{class:Be.page},[i.value+1,ve("/"),e.value.length]),N("span",{class:Be.countPage},[ve("\uFF08\u5171"),e.value.length,ve("\u9875\uFF09")])]),N(Ps,{type:"primary",color:"#FF8057",class:Be.downloadBtn,block:!0,round:!0,onClick:()=>o(),loading:n.value,loadingText:"\u4E0B\u8F7D\u4E2D..."},{default:()=>[ve("\u4E0B\u8F7D\u5F53\u524D\u9875\u9762")]})])])}}),zt={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(Ms);var Ma=at.exports,ke=typeof window=="undefined"?Ms: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 yi=0,as=0,Qe=[],Ba=1e3/60;et=function(s){if(Qe.length===0){var e=Ma(),t=Math.max(0,Ba-(e-yi));yi=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(yi)}catch(r){setTimeout(function(){throw r},0)}},Math.round(t))}return Qe.push({handle:++as,callback:s,cancelled:!1}),as},mt=function(s){for(var e=0;e<Qe.length;e++)Qe[e].handle===s&&(Qe[e].cancelled=!0)}}zt.exports=function(s){return et.call(ke,s)};zt.exports.cancel=function(){mt.apply(ke,arguments)};zt.exports.polyfill=function(s){s||(s=ke),s.requestAnimationFrame=et,s.cancelAnimationFrame=mt};var bi=zt.exports,Pi=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),u=this.g.toString(16),c=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+l+u+c},this.getHelpXML=function(){for(var l=new Array,u=0;u<t.length;u++)for(var c=t[u].example,m=0;m<c.length;m++)l[l.length]=c[m];for(var h in e)l[l.length]=h;var d=document.createElement("ul");d.setAttribute("id","rgbcolor-examples");for(var u=0;u<l.length;u++)try{var p=document.createElement("li"),y=new RGBColor(l[u]),b=document.createElement("div");b.style.cssText="margin: 3px; border: 1px solid black; background:"+y.toHex()+"; color:"+y.toHex(),b.appendChild(document.createTextNode("test"));var v=document.createTextNode(" "+l[u]+" -> "+y.toRGB()+" -> "+y.toHex());p.appendChild(b),p.appendChild(v),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 sn=function(s,e){return(sn=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 nn(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}sn(s,e),s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Oa(s){var e="";Array.isArray(s)||(s=[s]);for(var t=0;t<s.length;t++){var i=s[t];if(i.type===C.CLOSE_PATH)e+="z";else if(i.type===C.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===C.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===C.MOVE_TO)e+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===C.LINE_TO)e+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===C.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===C.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===C.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===C.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==C.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 Mi(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 Oe=Math.PI;function vi(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=Mi([(e-r)/2,(t-o)/2],-s.xRot/180*Oe),l=a[0],u=a[1],c=Math.pow(l,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(n,2);1<c&&(i*=Math.sqrt(c),n*=Math.sqrt(c)),s.rX=i,s.rY=n;var m=Math.pow(i,2)*Math.pow(u,2)+Math.pow(n,2)*Math.pow(l,2),h=(s.lArcFlag!==s.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-m)/m)),d=i*u/n*h,p=-n*l/i*h,y=Mi([d,p],s.xRot/180*Oe);s.cX=y[0]+(e+r)/2,s.cY=y[1]+(t+o)/2,s.phi1=Math.atan2((u-p)/n,(l-d)/i),s.phi2=Math.atan2((-u-p)/n,(-l-d)/i),s.sweepFlag===0&&s.phi2>s.phi1&&(s.phi2-=2*Oe),s.sweepFlag===1&&s.phi2<s.phi1&&(s.phi2+=2*Oe),s.phi1*=180/Oe,s.phi2*=180/Oe}function os(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 Z,xe=Math.PI/180;function ls(s,e,t){return(1-t)*s+t*e}function us(s,e,t,i){return s+Math.cos(i/180*Oe)*e+Math.sin(i/180*Oe)*t}function cs(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),u=3*r;return Math.abs(a)<n?[-u/l]:function(c,m,h){h===void 0&&(h=1e-6);var d=c*c/4-m;if(d<-h)return[];if(d<=h)return[-c/2];var p=Math.sqrt(d);return[-c/2-p,-c/2+p]}(l/a,u/a,n)}function hs(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,u){return a.relative&&(a.x1!==void 0&&(a.x1+=l),a.y1!==void 0&&(a.y1+=u),a.x2!==void 0&&(a.x2+=l),a.y2!==void 0&&(a.y2+=u),a.x!==void 0&&(a.x+=l),a.y!==void 0&&(a.y+=u),a.relative=!1),a})}function t(){var a=NaN,l=NaN,u=NaN,c=NaN;return n(function(m,h,d){return m.type&C.SMOOTH_CURVE_TO&&(m.type=C.CURVE_TO,a=isNaN(a)?h:a,l=isNaN(l)?d:l,m.x1=m.relative?h-a:2*h-a,m.y1=m.relative?d-l:2*d-l),m.type&C.CURVE_TO?(a=m.relative?h+m.x2:m.x2,l=m.relative?d+m.y2:m.y2):(a=NaN,l=NaN),m.type&C.SMOOTH_QUAD_TO&&(m.type=C.QUAD_TO,u=isNaN(u)?h:u,c=isNaN(c)?d:c,m.x1=m.relative?h-u:2*h-u,m.y1=m.relative?d-c:2*d-c),m.type&C.QUAD_TO?(u=m.relative?h+m.x1:m.x1,c=m.relative?d+m.y1:m.y1):(u=NaN,c=NaN),m})}function i(){var a=NaN,l=NaN;return n(function(u,c,m){if(u.type&C.SMOOTH_QUAD_TO&&(u.type=C.QUAD_TO,a=isNaN(a)?c:a,l=isNaN(l)?m:l,u.x1=u.relative?c-a:2*c-a,u.y1=u.relative?m-l:2*m-l),u.type&C.QUAD_TO){a=u.relative?c+u.x1:u.x1,l=u.relative?m+u.y1:u.y1;var h=u.x1,d=u.y1;u.type=C.CURVE_TO,u.x1=((u.relative?0:c)+2*h)/3,u.y1=((u.relative?0:m)+2*d)/3,u.x2=(u.x+2*h)/3,u.y2=(u.y+2*d)/3}else a=NaN,l=NaN;return u})}function n(a){var l=0,u=0,c=NaN,m=NaN;return function(h){if(isNaN(c)&&!(h.type&C.MOVE_TO))throw new Error("path must start with moveto");var d=a(h,l,u,c,m);return h.type&C.CLOSE_PATH&&(l=c,u=m),h.x!==void 0&&(l=h.relative?l+h.x:h.x),h.y!==void 0&&(u=h.relative?u+h.y:h.y),h.type&C.MOVE_TO&&(c=l,m=u),d}}function r(a,l,u,c,m,h){return fe(a,l,u,c,m,h),n(function(d,p,y,b){var v=d.x1,A=d.x2,f=d.relative&&!isNaN(b),w=d.x!==void 0?d.x:f?0:p,x=d.y!==void 0?d.y:f?0:y;function S(ge){return ge*ge}d.type&C.HORIZ_LINE_TO&&l!==0&&(d.type=C.LINE_TO,d.y=d.relative?0:y),d.type&C.VERT_LINE_TO&&u!==0&&(d.type=C.LINE_TO,d.x=d.relative?0:p),d.x!==void 0&&(d.x=d.x*a+x*u+(f?0:m)),d.y!==void 0&&(d.y=w*l+d.y*c+(f?0:h)),d.x1!==void 0&&(d.x1=d.x1*a+d.y1*u+(f?0:m)),d.y1!==void 0&&(d.y1=v*l+d.y1*c+(f?0:h)),d.x2!==void 0&&(d.x2=d.x2*a+d.y2*u+(f?0:m)),d.y2!==void 0&&(d.y2=A*l+d.y2*c+(f?0:h));var T=a*c-l*u;if(d.xRot!==void 0&&(a!==1||l!==0||u!==0||c!==1))if(T===0)delete d.rX,delete d.rY,delete d.xRot,delete d.lArcFlag,delete d.sweepFlag,d.type=C.LINE_TO;else{var B=d.xRot*Math.PI/180,I=Math.sin(B),U=Math.cos(B),_=1/S(d.rX),X=1/S(d.rY),ee=S(U)*_+S(I)*X,Y=2*I*U*(_-X),j=S(I)*_+S(U)*X,ne=ee*c*c-Y*l*c+j*l*l,se=Y*(a*c+l*u)-2*(ee*u*c+j*a*l),de=ee*u*u-Y*a*u+j*a*a,q=(Math.atan2(se,ne-de)+Math.PI)%Math.PI/2,Q=Math.sin(q),oe=Math.cos(q);d.rX=Math.abs(T)/Math.sqrt(ne*S(oe)+se*Q*oe+de*S(Q)),d.rY=Math.abs(T)/Math.sqrt(ne*S(Q)-se*Q*oe+de*S(oe)),d.xRot=180*q/Math.PI}return d.sweepFlag!==void 0&&0>T&&(d.sweepFlag=+!d.sweepFlag),d})}function o(){return function(a){var l={};for(var u in a)l[u]=a[u];return l}}s.ROUND=function(a){function l(u){return Math.round(u*a)/a}return a===void 0&&(a=1e13),fe(a),function(u){return u.x1!==void 0&&(u.x1=l(u.x1)),u.y1!==void 0&&(u.y1=l(u.y1)),u.x2!==void 0&&(u.x2=l(u.x2)),u.y2!==void 0&&(u.y2=l(u.y2)),u.x!==void 0&&(u.x=l(u.x)),u.y!==void 0&&(u.y=l(u.y)),u.rX!==void 0&&(u.rX=l(u.rX)),u.rY!==void 0&&(u.rY=l(u.rY)),u}},s.TO_ABS=e,s.TO_REL=function(){return n(function(a,l,u){return a.relative||(a.x1!==void 0&&(a.x1-=l),a.y1!==void 0&&(a.y1-=u),a.x2!==void 0&&(a.x2-=l),a.y2!==void 0&&(a.y2-=u),a.x!==void 0&&(a.x-=l),a.y!==void 0&&(a.y-=u),a.relative=!0),a})},s.NORMALIZE_HVZ=function(a,l,u){return a===void 0&&(a=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),n(function(c,m,h,d,p){if(isNaN(d)&&!(c.type&C.MOVE_TO))throw new Error("path must start with moveto");return l&&c.type&C.HORIZ_LINE_TO&&(c.type=C.LINE_TO,c.y=c.relative?0:h),u&&c.type&C.VERT_LINE_TO&&(c.type=C.LINE_TO,c.x=c.relative?0:m),a&&c.type&C.CLOSE_PATH&&(c.type=C.LINE_TO,c.x=c.relative?d-m:d,c.y=c.relative?p-h:p),c.type&C.ARC&&(c.rX===0||c.rY===0)&&(c.type=C.LINE_TO,delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag),c})},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,u=NaN,c=NaN,m=NaN;return n(function(h,d,p,y,b){var v=Math.abs,A=!1,f=0,w=0;if(h.type&C.SMOOTH_CURVE_TO&&(f=isNaN(l)?0:d-l,w=isNaN(u)?0:p-u),h.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(l=h.relative?d+h.x2:h.x2,u=h.relative?p+h.y2:h.y2):(l=NaN,u=NaN),h.type&C.SMOOTH_QUAD_TO?(c=isNaN(c)?d:2*d-c,m=isNaN(m)?p:2*p-m):h.type&C.QUAD_TO?(c=h.relative?d+h.x1:h.x1,m=h.relative?p+h.y1:h.y2):(c=NaN,m=NaN),h.type&C.LINE_COMMANDS||h.type&C.ARC&&(h.rX===0||h.rY===0||!h.lArcFlag)||h.type&C.CURVE_TO||h.type&C.SMOOTH_CURVE_TO||h.type&C.QUAD_TO||h.type&C.SMOOTH_QUAD_TO){var x=h.x===void 0?0:h.relative?h.x:h.x-d,S=h.y===void 0?0:h.relative?h.y:h.y-p;f=isNaN(c)?h.x1===void 0?f:h.relative?h.x:h.x1-d:c-d,w=isNaN(m)?h.y1===void 0?w:h.relative?h.y:h.y1-p:m-p;var T=h.x2===void 0?0:h.relative?h.x:h.x2-d,B=h.y2===void 0?0:h.relative?h.y:h.y2-p;v(x)<=a&&v(S)<=a&&v(f)<=a&&v(w)<=a&&v(T)<=a&&v(B)<=a&&(A=!0)}return h.type&C.CLOSE_PATH&&v(d-y)<=a&&v(p-b)<=a&&(A=!0),A?[]:h})},s.MATRIX=r,s.ROTATE=function(a,l,u){l===void 0&&(l=0),u===void 0&&(u=0),fe(a,l,u);var c=Math.sin(a),m=Math.cos(a);return r(m,c,-c,m,l-l*m+u*c,u-l*c-u*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,u){return C.ARC===a.type?function(c,m,h){var d,p,y,b;c.cX||vi(c,m,h);for(var v=Math.min(c.phi1,c.phi2),A=Math.max(c.phi1,c.phi2)-v,f=Math.ceil(A/90),w=new Array(f),x=m,S=h,T=0;T<f;T++){var B=ls(c.phi1,c.phi2,T/f),I=ls(c.phi1,c.phi2,(T+1)/f),U=I-B,_=4/3*Math.tan(U*xe/4),X=[Math.cos(B*xe)-_*Math.sin(B*xe),Math.sin(B*xe)+_*Math.cos(B*xe)],ee=X[0],Y=X[1],j=[Math.cos(I*xe),Math.sin(I*xe)],ne=j[0],se=j[1],de=[ne+_*Math.sin(I*xe),se-_*Math.cos(I*xe)],q=de[0],Q=de[1];w[T]={relative:c.relative,type:C.CURVE_TO};var oe=function(ge,we){var Me=Mi([ge*c.rX,we*c.rY],c.xRot),je=Me[0],vt=Me[1];return[c.cX+je,c.cY+vt]};d=oe(ee,Y),w[T].x1=d[0],w[T].y1=d[1],p=oe(q,Q),w[T].x2=p[0],w[T].y2=p[1],y=oe(ne,se),w[T].x=y[0],w[T].y=y[1],c.relative&&(w[T].x1-=x,w[T].y1-=S,w[T].x2-=x,w[T].y2-=S,w[T].x-=x,w[T].y-=S),x=(b=[w[T].x,w[T].y])[0],S=b[1]}return w}(a,a.relative?0:l,a.relative?0:u):a})},s.ANNOTATE_ARCS=function(){return n(function(a,l,u){return a.relative&&(l=0,u=0),C.ARC===a.type&&vi(a,l,u),a})},s.CLONE=o,s.CALCULATE_BOUNDS=function(){var a=function(h){var d={};for(var p in h)d[p]=h[p];return d},l=e(),u=i(),c=t(),m=n(function(h,d,p){var y=c(u(l(a(h))));function b(Q){Q>m.maxX&&(m.maxX=Q),Q<m.minX&&(m.minX=Q)}function v(Q){Q>m.maxY&&(m.maxY=Q),Q<m.minY&&(m.minY=Q)}if(y.type&C.DRAWING_COMMANDS&&(b(d),v(p)),y.type&C.HORIZ_LINE_TO&&b(y.x),y.type&C.VERT_LINE_TO&&v(y.y),y.type&C.LINE_TO&&(b(y.x),v(y.y)),y.type&C.CURVE_TO){b(y.x),v(y.y);for(var A=0,f=cs(d,y.x1,y.x2,y.x);A<f.length;A++)0<(q=f[A])&&1>q&&b(hs(d,y.x1,y.x2,y.x,q));for(var w=0,x=cs(p,y.y1,y.y2,y.y);w<x.length;w++)0<(q=x[w])&&1>q&&v(hs(p,y.y1,y.y2,y.y,q))}if(y.type&C.ARC){b(y.x),v(y.y),vi(y,d,p);for(var S=y.xRot/180*Math.PI,T=Math.cos(S)*y.rX,B=Math.sin(S)*y.rX,I=-Math.sin(S)*y.rY,U=Math.cos(S)*y.rY,_=y.phi1<y.phi2?[y.phi1,y.phi2]:-180>y.phi2?[y.phi2+360,y.phi1+360]:[y.phi2,y.phi1],X=_[0],ee=_[1],Y=function(Q){var oe=Q[0],ge=Q[1],we=180*Math.atan2(ge,oe)/Math.PI;return we<X?we+360:we},j=0,ne=os(I,-T,0).map(Y);j<ne.length;j++)(q=ne[j])>X&&q<ee&&b(us(y.cX,T,I,q));for(var se=0,de=os(U,-B,0).map(Y);se<de.length;se++){var q;(q=de[se])>X&&q<ee&&v(us(y.cY,B,U,q))}}return h});return m.minX=1/0,m.maxX=-1/0,m.minY=1/0,m.maxY=-1/0,m}})(Z||(Z={}));var pe,rn=function(){function s(){}return s.prototype.round=function(e){return this.transform(Z.ROUND(e))},s.prototype.toAbs=function(){return this.transform(Z.TO_ABS())},s.prototype.toRel=function(){return this.transform(Z.TO_REL())},s.prototype.normalizeHVZ=function(e,t,i){return this.transform(Z.NORMALIZE_HVZ(e,t,i))},s.prototype.normalizeST=function(){return this.transform(Z.NORMALIZE_ST())},s.prototype.qtToC=function(){return this.transform(Z.QT_TO_C())},s.prototype.aToC=function(){return this.transform(Z.A_TO_C())},s.prototype.sanitize=function(e){return this.transform(Z.SANITIZE(e))},s.prototype.translate=function(e,t){return this.transform(Z.TRANSLATE(e,t))},s.prototype.scale=function(e,t){return this.transform(Z.SCALE(e,t))},s.prototype.rotate=function(e,t,i){return this.transform(Z.ROTATE(e,t,i))},s.prototype.matrix=function(e,t,i,n,r,o){return this.transform(Z.MATRIX(e,t,i,n,r,o))},s.prototype.skewX=function(e){return this.transform(Z.SKEW_X(e))},s.prototype.skewY=function(e){return this.transform(Z.SKEW_Y(e))},s.prototype.xSymmetry=function(e){return this.transform(Z.X_AXIS_SYMMETRY(e))},s.prototype.ySymmetry=function(e){return this.transform(Z.Y_AXIS_SYMMETRY(e))},s.prototype.annotateArcs=function(){return this.transform(Z.ANNOTATE_ARCS())},s}(),Fa=function(s){return s===" "||s===" "||s==="\r"||s===`
  14. `},ds=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 nn(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!==C.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=ds(a)&&(this.curNumber==="0"&&a==="0"||l);if(!ds(a)||u)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 c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===C.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError('Expected positive number, got "'+c+'" 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(c),this.curArgs.length===La[this.curCommandType]&&(C.HORIZ_LINE_TO===this.curCommandType?r({type:C.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):C.VERT_LINE_TO===this.curCommandType?r({type:C.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===C.MOVE_TO||this.curCommandType===C.LINE_TO||this.curCommandType===C.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),C.MOVE_TO===this.curCommandType&&(this.curCommandType=C.LINE_TO)):this.curCommandType===C.CURVE_TO?r({type:C.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===C.SMOOTH_CURVE_TO?r({type:C.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.QUAD_TO?r({type:C.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.ARC&&r({type:C.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(!Fa(a))if(a===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!=="+"&&a!=="-"&&a!==".")if(u)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=C.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=C.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=C.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=C.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=C.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=C.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=C.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=C.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else{if(a!=="a"&&a!=="A")throw new SyntaxError('Unexpected character "'+a+'" at index '+o+".");this.curCommandType=C.ARC,this.curCommandRelative=a==="a"}else i.push({type:C.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}(rn),C=function(s){function e(t){var i=s.call(this)||this;return i.commands=typeof t=="string"?e.parse(t):t,i}return nn(e,s),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=Z.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 Oa(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}(rn),La=((pe={})[C.MOVE_TO]=2,pe[C.LINE_TO]=2,pe[C.HORIZ_LINE_TO]=1,pe[C.VERT_LINE_TO]=1,pe[C.CLOSE_PATH]=0,pe[C.QUAD_TO]=4,pe[C.SMOOTH_QUAD_TO]=2,pe[C.CURVE_TO]=6,pe[C.SMOOTH_CURVE_TO]=4,pe[C.ARC]=7,pe);function It(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?It=function(e){return typeof e}:It=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(s)}function Ra(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}var Da=[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 Ha(s,e,t,i,n){if(typeof s=="string"&&(s=document.getElementById(s)),!s||It(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=Ha(s,e,t,i,n);o=za(o,e,t,i,n,r),s.getContext("2d").putImageData(o,e,t)}}function za(s,e,t,i,n,r){for(var o=s.data,a=2*r+1,l=i-1,u=n-1,c=r+1,m=c*(c+1)/2,h=new ms,d=h,p,y=1;y<a;y++)d=d.next=new ms,y===c&&(p=d);d.next=h;for(var b=null,v=null,A=0,f=0,w=Da[r],x=Va[r],S=0;S<n;S++){d=h;for(var T=o[f],B=o[f+1],I=o[f+2],U=o[f+3],_=0;_<c;_++)d.r=T,d.g=B,d.b=I,d.a=U,d=d.next;for(var X=0,ee=0,Y=0,j=0,ne=c*T,se=c*B,de=c*I,q=c*U,Q=m*T,oe=m*B,ge=m*I,we=m*U,Me=1;Me<c;Me++){var je=f+((l<Me?l:Me)<<2),vt=o[je],zi=o[je+1],Qi=o[je+2],Wi=o[je+3],At=c-Me;Q+=(d.r=vt)*At,oe+=(d.g=zi)*At,ge+=(d.b=Qi)*At,we+=(d.a=Wi)*At,X+=vt,ee+=zi,Y+=Qi,j+=Wi,d=d.next}b=h,v=p;for(var Xt=0;Xt<i;Xt++){var Yt=we*w>>>x;if(o[f+3]=Yt,Yt!==0){var jt=255/Yt;o[f]=(Q*w>>>x)*jt,o[f+1]=(oe*w>>>x)*jt,o[f+2]=(ge*w>>>x)*jt}else o[f]=o[f+1]=o[f+2]=0;Q-=ne,oe-=se,ge-=de,we-=q,ne-=b.r,se-=b.g,de-=b.b,q-=b.a;var De=Xt+r+1;De=A+(De<l?De:l)<<2,X+=b.r=o[De],ee+=b.g=o[De+1],Y+=b.b=o[De+2],j+=b.a=o[De+3],Q+=X,oe+=ee,ge+=Y,we+=j,b=b.next;var wt=v,qi=wt.r,Xi=wt.g,Yi=wt.b,ji=wt.a;ne+=qi,se+=Xi,de+=Yi,q+=ji,X-=qi,ee-=Xi,Y-=Yi,j-=ji,v=v.next,f+=4}A+=i}for(var Ge=0;Ge<i;Ge++){f=Ge<<2;var Ve=o[f],He=o[f+1],Ue=o[f+2],ue=o[f+3],Gt=c*Ve,Kt=c*He,Jt=c*Ue,Zt=c*ue,Ct=m*Ve,Tt=m*He,xt=m*Ue,Et=m*ue;d=h;for(var Gi=0;Gi<c;Gi++)d.r=Ve,d.g=He,d.b=Ue,d.a=ue,d=d.next;for(var Ki=i,_t=0,$t=0,ei=0,ti=0,St=1;St<=r;St++){f=Ki+Ge<<2;var kt=c-St;Ct+=(d.r=Ve=o[f])*kt,Tt+=(d.g=He=o[f+1])*kt,xt+=(d.b=Ue=o[f+2])*kt,Et+=(d.a=ue=o[f+3])*kt,ti+=Ve,_t+=He,$t+=Ue,ei+=ue,d=d.next,St<u&&(Ki+=i)}f=Ge,b=h,v=p;for(var ii=0;ii<n;ii++){var ce=f<<2;o[ce+3]=ue=Et*w>>>x,ue>0?(ue=255/ue,o[ce]=(Ct*w>>>x)*ue,o[ce+1]=(Tt*w>>>x)*ue,o[ce+2]=(xt*w>>>x)*ue):o[ce]=o[ce+1]=o[ce+2]=0,Ct-=Gt,Tt-=Kt,xt-=Jt,Et-=Zt,Gt-=b.r,Kt-=b.g,Jt-=b.b,Zt-=b.a,ce=Ge+((ce=ii+c)<u?ce:u)*i<<2,Ct+=ti+=b.r=o[ce],Tt+=_t+=b.g=o[ce+1],xt+=$t+=b.b=o[ce+2],Et+=ei+=b.a=o[ce+3],b=b.next,Gt+=Ve=v.r,Kt+=He=v.g,Jt+=Ue=v.b,Zt+=ue=v.a,ti-=Ve,_t-=He,$t-=Ue,ei-=ue,v=v.next,f+=i}}return s}var ms=function s(){Ra(this,s),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function Qa(){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 Wa(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:Qa,node:Wa});function tt(s){return s.replace(/(?!\u3000)\s+/gm," ")}function Xa(s){return s.replace(/^[\n \t]+/,"")}function Ya(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 ja(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 Ga=/^[A-Z-]+$/;function Ka(s){return Ga.test(s)?s.toLowerCase():s}function an(s){const e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(s);return e&&(e[2]||e[3]||e[4])||""}function Ja(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 Za=/(\[[^\]]+\])/g,_a=/(#[^\s+>~.[:]+)/g,$a=/(\.[^\s+>~.[:]+)/g,eo=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,to=/(:[\w-]+\([^)]*\))/gi,io=/(:[^\s+>~.[:]+)/g,so=/([^\s+>~.[:]+)/g;function We(s,e){const t=e.exec(s);return t?[s.replace(e," "),t.length]:[s,0]}function no(s){const e=[0,0,0];let t=s.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),i=0;return[t,i]=We(t,Za),e[1]+=i,[t,i]=We(t,_a),e[0]+=i,[t,i]=We(t,$a),e[1]+=i,[t,i]=We(t,eo),e[2]+=i,[t,i]=We(t,to),e[1]+=i,[t,i]=We(t,io),e[1]+=i,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,i]=We(t,so),e[2]+=i,e.join("")}const _e=1e-8;function gs(s){return Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2))}function Bi(s,e){return(s[0]*e[0]+s[1]*e[1])/(gs(s)*gs(e))}function ps(s,e){return(s[0]*e[1]<s[1]*e[0]?-1:1)*Math.acos(Bi(s,e))}function fs(s){return s*s*s}function ys(s){return 3*s*s*(1-s)}function bs(s){return 3*s*(1-s)*(1-s)}function vs(s){return(1-s)*(1-s)*(1-s)}function As(s){return s*s}function ws(s){return 2*s*(1-s)}function Cs(s){return(1-s)*(1-s)}class P{static empty(e){return new P(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 P(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=Ja(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 P.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 Pi(t);r.ok&&(r.alpha=e.getNumber(),t=r.toRGBA())}return new P(this.document,this.name,t)}constructor(e,t,i){this.document=e,this.name=t,this.value=i,this.isNormalizedColor=!1}}P.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||Ts()}getCurrent(){const{viewPorts:e}=this,t=e[e.length-1];return t||Ts()}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 Ts(){return{width:gt.DEFAULT_VIEWPORT_WIDTH,height:gt.DEFAULT_VIEWPORT_HEIGHT}}class W{static parse(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const[i=t,n=t]=me(e);return new W(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 W(i,n)}static parsePath(e){const t=me(e),i=t.length,n=[];for(let r=0;r<i;r+=2)n.push(new W(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 ro{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 W(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 on=typeof window!="undefined"?window:null,ln=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:u=0,minY:c=0,refX:m,refY:h,clip:d=!1,clipX:p=0,clipY:y=0}=e;const b=tt(n).replace(/^defer\s/,""),[v,A]=b.split(" "),f=v||"xMidYMid",w=A||"meet",x=r/o,S=a/l,T=Math.min(x,S),B=Math.max(x,S);let I=o,U=l;w==="meet"&&(I*=T,U*=T),w==="slice"&&(I*=B,U*=B);const _=new P(t,"refX",m),X=new P(t,"refY",h),ee=_.hasValue()&&X.hasValue();if(ee&&i.translate(-T*_.getPixels("x"),-T*X.getPixels("y")),d){const Y=T*p,j=T*y;i.beginPath(),i.moveTo(Y,j),i.lineTo(r,j),i.lineTo(r,a),i.lineTo(Y,a),i.closePath(),i.clip()}if(!ee){const Y=w==="meet"&&T===S,j=w==="slice"&&B===S,ne=w==="meet"&&T===x,se=w==="slice"&&B===x;f.startsWith("xMid")&&(Y||j)&&i.translate(r/2-I/2,0),f.endsWith("YMid")&&(ne||se)&&i.translate(0,a/2-U/2),f.startsWith("xMax")&&(Y||j)&&i.translate(r-I,0),f.endsWith("YMax")&&(ne||se)&&i.translate(0,a-U)}switch(!0){case f==="none":i.scale(x,S);break;case w==="meet":i.scale(T,T);break;case w==="slice":i.scale(B,B);break}i.translate(-u,-c)}start(e){let{enableRedraw:t=!1,ignoreMouse:i=!1,ignoreAnimation:n=!1,ignoreDimensions:r=!1,ignoreClear:o=!1,forceRedraw:a,scaleWidth:l,scaleHeight:u,offsetX:c,offsetY:m}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{mouse:h}=this,d=1e3/Pe.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=d,this.readyPromise=new Promise(A=>{this.resolveReady=A}),this.isReady()&&this.render(e,r,o,l,u,c,m),!t)return;let p=Date.now(),y=p,b=0;const v=()=>{p=Date.now(),b=p-y,b>=d&&(y=p-b%d,this.shouldUpdate(n,a)&&(this.render(e,r,o,l,u,c,m),h.runEvents())),this.intervalId=bi(v)};i||h.start(),this.intervalId=bi(v)}stop(){this.intervalId&&(bi.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:u,isFirstRender:c}=this,m=u.canvas;l.clear(),m.width&&m.height&&l.setCurrent(m.width,m.height);const h=e.getStyle("width"),d=e.getStyle("height");!t&&(c||typeof n!="number"&&typeof r!="number")&&(h.hasValue()&&(m.width=h.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,y=m.clientHeight||m.height;if(t&&h.hasValue()&&d.hasValue()&&(p=h.getPixels("x"),y=d.getPixels("y")),l.setCurrent(p,y),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 b=me(e.getAttribute("viewBox").getString());let v=0,A=0;if(typeof n=="number"){const w=e.getStyle("width");w.hasValue()?v=w.getPixels("x")/n:b[2]&&!isNaN(b[2])&&(v=b[2]/n)}if(typeof r=="number"){const w=e.getStyle("height");w.hasValue()?A=w.getPixels("y")/r:b[3]&&!isNaN(b[3])&&(A=b[3]/r)}v||(v=A),A||(A=v),e.getAttribute("width",!0).setValue(n),e.getAttribute("height",!0).setValue(r);const f=e.getStyle("transform",!0,!0);f.setValue("".concat(f.getString()," scale(").concat(1/v,", ").concat(1/A,")"))}i||u.clearRect(0,0,p,y),e.render(u),c&&(this.isFirstRender=!1)}constructor(e,{fetch:t=ln,window:i=on}={}){if(this.ctx=e,this.viewPort=new gt,this.mouse=new ro(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=on;Pe.defaultFetch=ln;Pe.FRAMERATE=30;Pe.MAX_VIRTUAL_PIXELS=3e4;const{defaultFetch:ao}=Pe,oo=typeof DOMParser!="undefined"?DOMParser:void 0;class Ai{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=ao,DOMParser:t=oo}={}){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 lo{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=W.parse(t)}}class uo{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 P(e,"angle",n[0]),this.originX=i[0],this.originY=i[1],this.cx=n[1]||0,this.cy=n[2]||0}}class co{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=W.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],u=n[3],c=n[5],m=0,h=0,d=1,p=1/(r*(u*d-c*h)-o*(l*d-c*m)+a*(l*h-u*m)),y=t.getPixels("x"),b=i.getPixels("y");e.translate(y,b),e.transform(p*(u*d-c*h),p*(c*m-l*d),p*(a*h-o*d),p*(r*d-a*m),p*(o*c-a*u),p*(a*l-r*c)),e.translate(-y,-b)}applyToPoint(e){e.applyTransform(this.matrix)}constructor(e,t,i){this.type="matrix",this.matrix=ja(t),this.originX=i[0],this.originY=i[1]}}class cn extends un{constructor(e,t,i){super(e,t,i),this.type="skew",this.angle=new P(e,"angle",t)}}class ho extends cn{constructor(e,t,i){super(e,t,i),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class mo extends cn{constructor(e,t,i){super(e,t,i),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function go(s){return tt(s).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function po(s){const[e="",t=""]=s.split("(");return[e.trim(),t.trim().replace(")","")]}class Xe{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 Xe(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=[],go(t).forEach(r=>{if(r==="none")return;const[o,a]=po(r),l=Xe.transformTypes[o];l&&this.transforms.push(new l(this.document,a,i))})}}Xe.transformTypes={translate:lo,rotate:uo,scale:co,matrix:un,skewX:ho,skewY:mo};class z{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 P(this.document,e,"");return this.attributes[e]=n,n}return i||P.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||P.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 P(this.document,e,"");return this.styles[e]=o,o}return P.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=Xe.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 z?e:this.document.createElement(e);t.parent=this,z.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=Ka(o.nodeName);this.attributes[a]=new P(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,u]=a.split(":").map(c=>c.trim());l&&(this.styles[l]=new P(e,l,u))});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)}})}}z.ignoreChildTypes=["title"];class fo extends z{constructor(e,t,i){super(e,t,i)}}function yo(s){const e=s.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function bo(s){return typeof process=="undefined"?s:s.trim().split(",").map(yo).join(",")}function vo(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 Ao(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(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(c=>{switch(!0){case(!u.fontStyle&&le.styles.includes(c)):c!=="inherit"&&(i=c),u.fontStyle=!0;break;case(!u.fontVariant&&le.variants.includes(c)):c!=="inherit"&&(n=c),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&le.weights.includes(c)):c!=="inherit"&&(r=c),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:c!=="inherit"&&(o=c.split("/")[0]||""),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:c!=="inherit"&&(a+=c)}}),new le(i,n,r,o,a,t)}toString(){return[vo(this.fontStyle),this.fontVariant,Ao(this.fontWeight),this.fontSize,bo(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 h=-l/o;0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,i,n,r)):this.addY(this.sumCubic(h,t,i,n,r)));return}const u=Math.pow(o,2)-4*l*a;if(u<0)return;const c=(-o+Math.sqrt(u))/(2*a);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,i,n,r)):this.addY(this.sumCubic(c,t,i,n,r)));const m=(-o-Math.sqrt(u))/(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),u=a+1/3*(r-e),c=l+1/3*(o-t);this.addBezierCurve(e,t,a,u,l,c,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 Ye extends z{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 P(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 P(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"),u=this.getStyle("stroke-linejoin"),c=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),h=this.getStyle("stroke-dashoffset");if(l.hasValue()&&(e.lineCap=l.getString()),u.hasValue()&&(e.lineJoin=u.getString()),c.hasValue()&&(e.miterLimit=c.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=h.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"),u=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(u.fontStyle),r.setValue(u.fontVariant),o.setValue(u.fontWeight),a.setValue(u.fontSize),l.setValue(u.fontFamily),e.font=u.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 Re extends Ye{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],u=t[i+1];let c="isolated";(i===0||l===" ")&&i<a-1&&u!==" "&&(c="terminal"),i>0&&l!==" "&&i<a-1&&u!==" "&&(c="medial"),i>0&&l!==" "&&(i===a-1||u===" ")&&(c="initial"),r=((o=e.arabicGlyphs[n])===null||o===void 0?void 0:o[c])||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=Xa(o)),n===r&&(o=Ya(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,u=le.parse(t.ctx.font),c=i.getStyle("font-size").getNumber(u.fontSize),m=i.getStyle("font-style").getString(u.fontStyle),h=c/l,d=r.isRTL?n.split("").reverse().join(""):n,p=me(i.getAttribute("dx").getString()),y=d.length;for(let b=0;b<y;b++){const v=this.getGlyph(r,d,b);e.translate(this.x,this.y),e.scale(h,-h);const A=e.lineWidth;e.lineWidth=e.lineWidth*l/c,m==="italic"&&e.transform(1,0,.4,1,0,0),v.render(e),m==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=A,e.scale(1/h,-1/h),e.translate(-this.x,-this.y),this.x+=c*(v.horizAdvX||r.horizAdvX)/l,typeof p[b]!="undefined"&&!isNaN(p[b])&&(this.x+=p[b])}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"),u=r.getAttribute("dy"),c=r.getStyle("font-family").getDefinition(),m=Boolean(c==null?void 0:c.isRTL);n===0&&(o.hasValue()||o.setValue(r.getInheritedAttribute("x")),a.hasValue()||a.setValue(r.getInheritedAttribute("y")),l.hasValue()||l.setValue(r.getInheritedAttribute("dx")),u.hasValue()||u.setValue(r.getInheritedAttribute("dy")));const h=r.measureText(e);return m&&(t.x-=h),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+=h),a.hasValue()?(r.y=a.getPixels("y"),u.hasValue()&&(r.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),r.y=t.y),t.y=r.y,t.leafTexts.push(r),t.minX=Math.min(t.minX,r.x,r.x+h),t.maxX=Math.max(t.maxX,r.x,r.x+h),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 u=t.getChildBoundingBox(e,t,r,l);o.addBoundingBox(u)}),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()),u=a.length;let c=0;for(let m=0;m<u;m++)c+=(this.getGlyph(n,a,m).horizAdvX||n.horizAdvX)*o/n.fontFace.unitsPerEm,typeof l[m]!="undefined"&&!isNaN(l[m])&&(c+=l[m]);return c}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 Re&&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===Re?!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 Re{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 wo extends Qt{constructor(...e){super(...e),this.type="textNode"}}class F extends C{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new W(0,0),this.control=new W(0,0),this.current=new W(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 W(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!==C.CURVE_TO&&e!==C.SMOOTH_CURVE_TO&&e!==C.QUAD_TO&&e!==C.SMOOTH_QUAD_TO)return this.current;const{current:{x:t,y:i},control:{x:n,y:r}}=this;return new W(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 W(0,0),this.start=new W(0,0),this.current=new W(0,0),this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}}class V extends Ye{path(e){const{pathParser:t}=this,i=new Ae;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case F.MOVE_TO:this.pathM(e,i);break;case F.LINE_TO:this.pathL(e,i);break;case F.HORIZ_LINE_TO:this.pathH(e,i);break;case F.VERT_LINE_TO:this.pathV(e,i);break;case F.CURVE_TO:this.pathC(e,i);break;case F.SMOOTH_CURVE_TO:this.pathS(e,i);break;case F.QUAD_TO:this.pathQ(e,i);break;case F.SMOOTH_QUAD_TO:this.pathT(e,i);break;case F.ARC:this.pathA(e,i);break;case F.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(),[u,c]=i[0];l.render(e,u,c)}if(o.isUrlDefinition()){const l=o.getDefinition();for(let u=1;u<n;u++){const[c,m]=i[u];l.render(e,c,m)}}if(a.isUrlDefinition()){const l=a.getDefinition(),[u,c]=i[n];l.render(e,u,c)}}}static pathM(e){const t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){const{pathParser:i}=this,{point:n}=V.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}=V.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 W((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}=V.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 W(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}=V.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}=V.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}=V.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}=V.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}=V.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 u=o*(Math.PI/180),c=e.getAsCurrentPoint(),m=new W(Math.cos(u)*(t.x-c.x)/2+Math.sin(u)*(t.y-c.y)/2,-Math.sin(u)*(t.x-c.x)/2+Math.cos(u)*(t.y-c.y)/2),h=Math.pow(m.x,2)/Math.pow(n,2)+Math.pow(m.y,2)/Math.pow(r,2);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));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 W(d*n*m.y/r,d*-r*m.x/n),y=new W((t.x+c.x)/2+Math.cos(u)*p.x-Math.sin(u)*p.y,(t.y+c.y)/2+Math.sin(u)*p.x+Math.cos(u)*p.y),b=ps([1,0],[(m.x-p.x)/n,(m.y-p.y)/r]),v=[(m.x-p.x)/n,(m.y-p.y)/r],A=[(-m.x-p.x)/n,(-m.y-p.y)/r];let f=ps(v,A);return Bi(v,A)<=-1&&(f=Math.PI),Bi(v,A)>=1&&(f=0),{currentPoint:c,rX:n,rY:r,sweepFlag:l,xAxisRotation:u,centp:y,a1:b,ad:f}}pathA(e,t){const{pathParser:i}=this,{currentPoint:n,rX:r,rY:o,sweepFlag:a,xAxisRotation:l,centp:u,a1:c,ad:m}=V.pathA(i),h=1-a?1:-1,d=c+h*(m/2),p=new W(u.x+r*Math.cos(d),u.y+o*Math.sin(d));if(i.addMarkerAngle(p,d-h*Math.PI/2),i.addMarkerAngle(n,d-h*Math.PI),t.addPoint(n.x,n.y),e&&!isNaN(c)&&!isNaN(m)){const y=r>o?r:o,b=r>o?1:r/o,v=r>o?o/r:1;e.translate(u.x,u.y),e.rotate(l),e.scale(b,v),e.arc(0,0,y,c,c+m,Boolean(1-a)),e.scale(1/b,1/v),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){V.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 F(this.getAttribute("d").getString())}}class bt extends Ye{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 A=new P(i,"fontSize",le.parse(e.font).fontSize);A.hasValue()&&(i.rootEmSize=A.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 u=this.getAttribute("refX"),c=this.getAttribute("refY"),m=this.getAttribute("viewBox"),h=m.hasValue()?me(m.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let p=0,y=0,b=0,v=0;h&&(p=h[0],y=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(b=p,v=y,p=0,y=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")),h&&(a=h[2],l=h[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:y,refX:u.getValue(),refY:c.getValue(),clip:d,clipX:b,clipY:v}),h&&(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),u=r.getNumber(0);if(i)if(typeof i=="string")this.getAttribute("preserveAspectRatio",!0).setValue(i);else{const c=this.getAttribute("preserveAspectRatio");c.hasValue()&&c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(e),r.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(l||e," ").concat(u||t)),a.hasValue()){const c=this.getStyle("width"),m=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),m.hasValue()&&m.setValue("".concat(t,"px"))}}constructor(...e){super(...e),this.type="svg",this.root=!1}}class hn extends V{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"),u=a.getPixels("y");if(o.hasValue()&&!a.hasValue()&&(u=l),a.hasValue()&&!o.hasValue()&&(l=u),l=Math.min(l,n/2),u=Math.min(u,r/2),e){const c=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+c*l,i,t+n,i+u-c*u,t+n,i+u),e.lineTo(t+n,i+r-u),e.bezierCurveTo(t+n,i+r-u+c*u,t+n-l+c*l,i+r,t+n-l,i+r),e.lineTo(t+l,i+r),e.bezierCurveTo(t+l-c*l,i+r,t,i+r-u+c*u,t,i+r-u),e.lineTo(t,i+u),e.bezierCurveTo(t,i+u-c*u,t+l-c*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 Co extends V{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 To extends V{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 xo extends V{getPoints(){return[new W(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new W(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 dn extends V{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=W.parsePath(this.getAttribute("points").getString())}}class Eo extends dn{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 So extends z{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 P(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new P(this.document,"width","".concat(n,"px")),o.attributes.height=new P(this.document,"height","".concat(r,"px")),o.attributes.transform=new P(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;const a=this.document.createCanvas(n,r),l=a.getContext("2d"),u=this.getAttribute("x"),c=this.getAttribute("y");u.hasValue()&&c.hasValue()&&l.translate(u.getPixels("x",!0),c.getPixels("y",!0)),i.hasValue()?this.styles["fill-opacity"]=i:Reflect.deleteProperty(this.styles,"fill-opacity");for(let h=-1;h<=1;h++)for(let d=-1;d<=1;d++)l.save(),o.attributes.x=new P(this.document,"x",h*a.width),o.attributes.y=new P(this.document,"y",d*a.height),o.render(l),l.restore();return e.createPattern(a,"repeat")}constructor(...e){super(...e),this.type="pattern"}}class ko extends z{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 P(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new P(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new P(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new P(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new P(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new P(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new P(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new P(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 No extends z{render(){}constructor(...e){super(...e),this.type="defs"}}class Vi extends Ye{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 mn extends z{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:u}=a.screen,c=u.getRoot(),m=new hn(a);m.attributes.x=new P(a,"x",-l/3),m.attributes.y=new P(a,"y",-l/3),m.attributes.width=new P(a,"width",l),m.attributes.height=new P(a,"height",l);const h=new Vi(a);h.attributes.transform=new P(a,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[m];const d=new bt(a);d.attributes.x=new P(a,"x",0),d.attributes.y=new P(a,"y",0),d.attributes.width=new P(a,"width",c.width),d.attributes.height=new P(a,"height",c.height),d.children=[h];const p=a.createCanvas(c.width,c.height),y=p.getContext("2d");return y.fillStyle=o,d.render(y),y.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 P(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 Po extends mn{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 Mo extends mn{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 u=i?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),c=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,l,c,r,o,u)}constructor(e,t,i){super(e,t,i),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class Bo extends z{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 Hi extends z{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 u;u=t.getValue()[a],n=new P(e,"from",u?parseFloat(u):0),u=t.getValue()[l],r=new P(e,"to",u?parseFloat(u):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 P(e,"values",null);const n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}}class Oo extends Hi{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=new Pi(t.getColor()),r=new Pi(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 Fo extends Hi{calcValue(){const{progress:e,from:t,to:i}=this.getProgress(),n=me(t.getString()),r=me(i.getString());return n.map((a,l)=>{const u=r[l];return a+(u-a)*e}).join(" ")}constructor(...e){super(...e),this.type="animateTransform"}}class gn extends z{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 Ui extends V{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 pn extends Ui{constructor(...e){super(...e),this.type="missing-glyph",this.horizAdvX=0}}class Io extends z{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 gn){this.fontFace=o;const a=o.getStyle("font-family");a.hasValue()&&(n[a.getString()]=this)}else if(o instanceof pn)this.missingGlyph=o;else if(o instanceof Ui)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 Lo extends Re{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 Re{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 P(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 Vi(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 Do extends Re{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 F.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case F.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case F.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case F.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case F.ARC:{const[o,a,l,u,c,m,h,d]=r,p=l>u?l:u,y=l>u?1:l/u,b=l>u?u/l:1;e&&(e.translate(o,a),e.rotate(h),e.scale(y,b),e.arc(0,0,p,c,c+m,Boolean(1-d)),e.scale(1/y,1/b),e.rotate(-h),e.translate(-o,-a));break}case F.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:u,rotation:c,text:m}=o;e.save(),e.translate(l.x,l.y),e.rotate(c),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(u.x,u.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,u){let c=o,m=this.measureText(e,l);l===" "&&t==="justify"&&i<n&&(m+=(n-i)/r),u>-1&&(c+=this.getLetterSpacingAt(u));const h=this.textHeight/20,d=this.getEquidistantPointOnPath(c,h,0),p=this.getEquidistantPointOnPath(c+m,h,0),y={p0:d,p1:p},b=d&&p?Math.atan2(p.y-d.y,p.x-d.x):0;if(a){const v=Math.cos(Math.PI/2+b)*a,A=Math.cos(-b)*a;y.p0={...d,x:d.x+v,y:d.y+A},y.p1={...p,x:p.x+v,y:p.y+A}}return c+=m,{offset:c,segment:y,rotation:b}}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(f=>f.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing");let c=0;!l.hasValue()||l.getValue()==="inherit"?c=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(c=l.getPixels());const m=[],h=t.length;this.letterSpacingCache=m;for(let f=0;f<h;f++)m.push(typeof r[f]!="undefined"?r[f]:c);const d=m.reduce((f,w,x)=>x===0?0:f+w||0,0),p=this.measureText(e),y=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];const b=this.getPathLength(),v=this.getStyle("startOffset").getNumber(0)*b;let A=0;(a==="middle"||a==="center")&&(A=-y/2),(a==="end"||a==="right")&&(A=-y),A+=v,i.forEach((f,w)=>{const{offset:x,segment:S,rotation:T}=this.findSegmentToFitChar(e,a,y,b,n,A,o,f,w);A=x,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:i[w],p0:S.p0,p1:S.p1,rotation:T})})}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,u=[];switch(a.type){case F.MOVE_TO:this.pathM(i,u);break;case F.LINE_TO:l=this.pathL(i,u);break;case F.HORIZ_LINE_TO:l=this.pathH(i,u);break;case F.VERT_LINE_TO:l=this.pathV(i,u);break;case F.CURVE_TO:this.pathC(i,u);break;case F.SMOOTH_CURVE_TO:l=this.pathS(i,u);break;case F.QUAD_TO:this.pathQ(i,u);break;case F.SMOOTH_QUAD_TO:l=this.pathT(i,u);break;case F.ARC:u=this.pathA(i);break;case F.CLOSE_PATH:V.pathZ(i);break}a.type!==F.CLOSE_PATH?t.push({type:l,points:u,start:{x:r,y:o},pathLength:this.calcLength(r,o,l,u)}):t.push({type:F.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){const{x:i,y:n}=V.pathM(e).point;t.push(i,n)}pathL(e,t){const{x:i,y:n}=V.pathL(e).point;return t.push(i,n),F.LINE_TO}pathH(e,t){const{x:i,y:n}=V.pathH(e).point;return t.push(i,n),F.LINE_TO}pathV(e,t){const{x:i,y:n}=V.pathV(e).point;return t.push(i,n),F.LINE_TO}pathC(e,t){const{point:i,controlPoint:n,currentPoint:r}=V.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}=V.pathS(e);return t.push(i.x,i.y,n.x,n.y,r.x,r.y),F.CURVE_TO}pathQ(e,t){const{controlPoint:i,currentPoint:n}=V.pathQ(e);t.push(i.x,i.y,n.x,n.y)}pathT(e,t){const{controlPoint:i,currentPoint:n}=V.pathT(e);return t.push(i.x,i.y,n.x,n.y),F.QUAD_TO}pathA(e){let{rX:t,rY:i,sweepFlag:n,xAxisRotation:r,centp:o,a1:a,ad:l}=V.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 F.LINE_TO:return this.getLineLength(e,t,n[0],n[1]);case F.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 F.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 F.ARC:{r=0;const u=n[4],c=n[5],m=n[4]+c;let h=Math.PI/180;if(Math.abs(u-m)<h&&(h=Math.abs(u-m)),o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),c<0)for(l=u-h;l>m;l-=h)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=u+h;l<m;l+=h)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 u=Math.sqrt(e*e/(1+l*l));n<t&&(u*=-1);let c=l*u,m=null;if(n===t)m={x:o,y:a+c};else if((a-i)/(o-t+_e)===l)m={x:o+u,y:a+c};else{let h=0,d=0;const p=this.getLineLength(t,i,n,r);if(p<_e)return null;let y=(o-t)*(n-t)+(a-i)*(r-i);y/=p*p,h=t+y*(n-t),d=i+y*(r-i);const b=this.getLineLength(o,a,h,d),v=Math.sqrt(e*e-b*b);u=Math.sqrt(v*v/(1+l*l)),n<t&&(u*=-1),c=l*u,m={x:h+u,y:d+c}}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 F.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 F.ARC:{const u=o.points[4],c=o.points[5],m=o.points[4]+c;if(l=u+a/o.pathLength*c,c<0&&l<m||c>=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 F.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 F.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,u){const c=l*fs(e)+o*ys(e)+n*bs(e)+t*vs(e),m=u*fs(e)+a*ys(e)+r*bs(e)+i*vs(e);return{x:c,y:m}}getPointOnQuadraticBezier(e,t,i,n,r,o,a){const l=o*As(e)+n*ws(e)+t*Cs(e),u=a*As(e)+r*ws(e)+i*Cs(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,i,n,r,o){const a=Math.cos(o),l=Math.sin(o),u={x:i*Math.cos(r),y:n*Math.sin(r)};return{x:e+(u.x*a-u.y*l),y:t+(u.x*l+u.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),u=this.getPointOnPath(a+n);!l||!u||(o+=this.getLineLength(l.x,l.y,u.x,u.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 Ho extends Ye{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 u=t.canvg.forkString(e,i,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:l}),{documentElement:c}=u.document;c&&(c.parent=this),u.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 Ye{render(e){}constructor(...e){super(...e),this.type="symbol"}}class zo{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 fn extends z{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("{"),u=l[0].split(","),c=l[1].split(";");u.forEach(m=>{const h=m.trim();if(!h)return;const d=e.styles[h]||{};if(c.forEach(p=>{const y=p.indexOf(":"),b=p.substr(0,y).trim(),v=p.substr(y+1,p.length-y).trim();b&&v&&(d[b]=new P(e,b,v))}),e.styles[h]=d,e.stylesSpecificity[h]=no(h),h==="@font-face"){const p=d["font-family"].getString().replace(/"|'/g,"");d.src.getString().split(",").forEach(b=>{if(b.indexOf('format("svg")')>0){const v=an(b);v&&new zo(e).load(p,v)}})}})})}}fn.parseExternalUrl=an;class Qo extends Ye{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 P(t,"viewBox",i.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new P(t,"preserveAspectRatio",i.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new P(t,"overflow",i.getAttribute("overflow").getString()),n.children=i.children,i.styles.opacity=new P(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 P(t,"width",o.getString())),a.hasValue()&&(n.attributes.height=new P(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?Xe.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 J(s,e,t){return s[e]*t}function Ee(s,e,t,i){return e+Math.cos(s)*t+Math.sin(s)*i}class yn extends z{apply(e,t,i,n,r){const{includeOpacity:o,matrix:a}=this,l=e.getImageData(0,0,n,r);for(let u=0;u<r;u++)for(let c=0;c<n;c++){const m=Pt(l.data,c,u,n,r,0),h=Pt(l.data,c,u,n,r,1),d=Pt(l.data,c,u,n,r,2),p=Pt(l.data,c,u,n,r,3);let y=J(a,0,m)+J(a,1,h)+J(a,2,d)+J(a,3,p)+J(a,4,1),b=J(a,5,m)+J(a,6,h)+J(a,7,d)+J(a,8,p)+J(a,9,1),v=J(a,10,m)+J(a,11,h)+J(a,12,d)+J(a,13,p)+J(a,14,1),A=J(a,15,m)+J(a,16,h)+J(a,17,d)+J(a,18,p)+J(a,19,1);o&&(y=0,b=0,v=0,A*=p/255),Mt(l.data,c,u,n,r,0,y),Mt(l.data,c,u,n,r,1,b),Mt(l.data,c,u,n,r,2,v),Mt(l.data,c,u,n,r,3,A)}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=[Ee(r,.213,.787,-.213),Ee(r,.715,-.715,-.715),Ee(r,.072,-.072,.928),0,0,Ee(r,.213,-.213,.143),Ee(r,.715,.285,.14),Ee(r,.072,-.072,-.283),0,0,Ee(r,.213,-.213,-.787),Ee(r,.715,-.715,.715),Ee(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 z{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),u=i.createCanvas(n+o,r+a),c=u.getContext("2d");i.screen.setDefaults(c),this.renderChildren(c),new yn(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,n+o,r+a);const m=i.createCanvas(n+o,r+a),h=m.getContext("2d");i.screen.setDefaults(h),t.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=c.createPattern(u,"no-repeat"),h.fillRect(0,0,n+o,r+a),e.fillStyle=h.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 xs=()=>{};class Wo extends z{apply(e){const{document:t}=this,i=Reflect.getPrototypeOf(e),{beginPath:n,closePath:r}=e;i&&(i.beginPath=xs,i.closePath=xs),Reflect.apply(n,e,[]),this.children.forEach(o=>{if(!("path"in o))return;let a="elementTransform"in o?o.elementTransform():null;a||(a=Xe.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 z{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(v=>{const A=v.extraFilterDistance||0;o=Math.max(o,A),a=Math.max(a,A)});const l=Math.floor(r.width),u=Math.floor(r.height),c=l+2*o,m=u+2*a;if(c<1||m<1)return;const h=Math.floor(r.x),d=Math.floor(r.y),p=this.removeStyles(t,qt.ignoreStyles),y=i.createCanvas(c,m),b=y.getContext("2d");i.screen.setDefaults(b),b.translate(-h+o,-d+a),t.render(b),n.forEach(v=>{typeof v.apply=="function"&&v.apply(b,0,0,c,m)}),e.drawImage(y,0,0,c,m,h-o,d-a,c,m),this.restoreStyles(t,p)}render(e){}constructor(...e){super(...e),this.type="filter"}}qt.ignoreStyles=["filter","transform","clip-path"];class qo extends z{apply(e,t,i,n,r){}constructor(e,t,i){super(e,t,i),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class Xo extends z{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feMorphology"}}class Yo extends z{apply(e,t,i,n,r){}constructor(...e){super(...e),this.type="feComposite"}}class jo extends z{apply(e,t,i,n,r){const{document:o,blurRadius:a}=this,l=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),Ua(u,t,i,n,r,a),l&&l.removeChild(u)}constructor(e,t,i){super(e,t,i),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class Go extends z{constructor(...e){super(...e),this.type="title"}}class Ko extends z{constructor(...e){super(...e),this.type="desc"}}const Jo={svg:bt,rect:hn,circle:Co,ellipse:To,line:xo,polyline:dn,polygon:Eo,path:V,pattern:So,marker:ko,defs:No,linearGradient:Po,radialGradient:Mo,stop:Bo,animate:Hi,animateColor:Oo,animateTransform:Fo,font:Io,"font-face":gn,"missing-glyph":pn,glyph:Ui,text:Re,tspan:Qt,tref:Lo,a:Ro,textPath:Do,image:Ho,g:Vi,symbol:Uo,style:fn,use:Qo,mask:Wt,clipPath:Wo,filter:qt,feDropShadow:qo,feMorphology:Xo,feComposite:Yo,feColorMatrix:yn,feGaussianBlur:jo,title:Go,desc:Ko};function Zo(s,e){const t=document.createElement("canvas");return t.width=s,t.height=e,t}async function _o(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,u)=>{n(u)},t.src=s})}const wi=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]||wi}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 fo(this,e)}createTextNode(e){return new wo(this,e)}setViewBox(e){this.screen.setViewBox({document:this,...e})}constructor(e,{rootEmSize:t=wi,emSize:i=wi,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=Zo;Le.createImage=_o;Le.elementTypes=Jo;class Je{static async from(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=await new Ai(i).parse(t);return new Je(e,r,i)}static fromString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=new Ai(i).parseFromString(t);return new Je(e,r,i)}fork(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Je.from(e,t,{...this.options,...i})}forkString(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Je.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 Ai(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 $o=qa.offscreen(),el=s=>new Promise((e,t)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.readAsDataURL(s)});let Ke=null;const tl=async(s,e,t)=>{Ke||(Ke=new OffscreenCanvas(e,t));const i=Ke.getContext("2d");let n=await Je.fromString(i,s,$o);n.resize(e*2,t*2,"xMidYMid meet"),await n.start();const r=await Ke.convertToBlob(),o=await el(r);return i.clearRect(0,0,Ke.width,Ke.height),await n.stop(),n=null,o},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 u=(o=a.getElementsByTagName("forward")[0])==null?void 0:o.getElementsByTagName("duration")[0];u&&(u.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)},Ss=(s,e)=>{var c,m,h,d;if(!s)return"";const t=new DOMParser().parseFromString(s,"text/xml"),i=((m=(c=t.getElementsByTagName("part-list"))==null?void 0:c[0])==null?void 0:m.getElementsByTagName("score-part"))||[],n=Array.from(i).map(p=>{var y;return((y=p.getElementsByTagName("part-name"))==null?void 0:y[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=(h=n[0])==null?void 0:h.toLocaleUpperCase)==null?void 0:d.call(h))==="COMMON"&&(e++,n.shift());const u=i[e];if(u){const p=u.getAttribute("id");Array.from(r).forEach(b=>{var v,A,f,w,x;if(b&&b.getAttribute("id")!==p)(v=b.parentNode)==null||v.removeChild(b);else if(b&&b.getAttribute("id")!=="P1"){const S={};for(let T=0;T<l.length;T++){const B=l[T],I=(f=(A=B.parentElement)==null?void 0:A.parentElement)==null?void 0:f.parentElement;if(I){const U=a.indexOf(I);S[U]=B}}Object.values(S).forEach(T=>{var X;const B=(X=T.parentElement)==null?void 0:X.parentElement,I=B==null?void 0:B.parentElement,U=[...(I==null?void 0:I.childNodes)||[]],_=B?U.indexOf(B):-1;if(I&&_>-1){const ee=a.indexOf(I),Y=b.getElementsByTagName("measure")[ee];sl(B,I,Y)}})}if(b&&b.getAttribute("id")===p){const S=b.getElementsByTagName("barline"),T=(w=S[S.length-1])==null?void 0:w.parentElement;if(((x=T==null?void 0:T.lastElementChild)==null?void 0:x.tagName)!=="barline"){const B=(T==null?void 0:T.children)||[];for(const I of B)if(I.tagName==="barline"){T==null||T.appendChild(I);break}}}}),Array.from(i).forEach(b=>{var v;b&&b.getAttribute("id")!==p&&((v=b.parentNode)==null||v.removeChild(b))});const y=t.getElementsByTagName("note");Array.from(y).forEach((b,v)=>{const A=b.getElementsByTagName("grace");A&&A.length})}return new XMLSerializer().serializeToString(il(t))},il=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 u=t((n=a.parentElement)==null?void 0:n.nextElementSibling);if(u&&u.querySelectorAll("slur").length>0){const c=Array.from(((r=u.querySelector("notations"))==null?void 0:r.children)||[]).map(h=>h.getAttribute("number")),m=l.querySelectorAll("slur");for(const h of m)c.includes(h.getAttribute("number"))||(o=u.querySelector("notations"))==null||o.appendChild(h)}}}return s},sl=(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}}}}},ks=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 xl=Oi({name:"music-detail",setup(){const s=Tn(),e=be(),t=be(null),i=be([]),n=xn({details:{},status:!1,open:!1,audioReady:!1,iframeSrc:"",isComberRender:!1,musicXml:[],instrumentName:"",iframeRef:null,imgs:[],radio:"staff",partList:[],partNames:[],selectedPartName:"",selectedPartIndex:0,partXmlIndex:0}),r=be(!1),o=be(!1),a=be([]);Ns(()=>n.radio,f=>{var w,x,S;f=="first"?a.value=oi(((w=n.details.musicFirstSvg)==null?void 0:w.split(","))||[]):f=="fixed"?a.value=oi(((x=n.details.musicJianSvg)==null?void 0:x.split(","))||[]):a.value=oi(((S=n.details.musicImg)==null?void 0:S.split(","))||[])});const l=async()=>{const f=document.getElementById("staffIframeRef");if(f&&f.contentWindow.renderXml){const w=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),x=ks(w),S=Es(x.parsedXML);if(n.isComberRender)f.contentWindow.renderXml(S,n.partXmlIndex,n.isComberRender);else{const T=Ss(S,n.partXmlIndex);f.contentWindow.renderXml(T,n.partXmlIndex,n.isComberRender)}}},u=async()=>{const f=document.getElementById("staffIframeRef");if(f&&f.contentWindow.renderXml){r.value=!0;const w=await ai.get(n.details.xmlFileUrl,{mode:"cors"}),x=ks(w),S=Es(x.parsedXML);if(n.isComberRender)f.contentWindow.renderXml(S,n.partXmlIndex,n.isComberRender);else{const T=Ss(S,n.partXmlIndex);f.contentWindow.renderXml(T,0,n.isComberRender)}}},c=(f,w)=>{const x=document.getElementById("staffIframeRef");x&&x.contentWindow.renderXml&&x.contentWindow.resetRenderPage(f,w)},m=async()=>{try{n.iframeSrc=`${location.origin}${location.pathname}osmd/index.html`}catch{}},h=async f=>{const w=[];try{const x=await ai.get(f,{mode:"cors"}),S=new DOMParser().parseFromString(x,"text/xml");for(const T of S.getElementsByTagName("part-name"))T.textContent&&w.push(T.textContent)}catch{}return w.filter(x=>x.toLocaleUpperCase()!=="COMMON")||[]},d=async f=>{if(f.musicSheetType==="SINGLE"){r.value=!1;return}n.partNames=await h(f.xmlFileUrl);let w=f.background||[];w=w.filter(S=>{var T,B;return!((B=(T=S.track)==null?void 0:T.toLocaleUpperCase())!=null&&B.includes("COMMON"))}),i.value=w.map((S,T)=>{const B=zn(S.track),I=n.partNames.findIndex(U=>U===S.track);return{text:S.track+(B?`(${B})`:""),instrumentName:B,xmlIndex:I,value:T}});const x=i.value[n.selectedPartIndex];n.selectedPartName=x.instrumentName,n.partXmlIndex=x.xmlIndex},p=async()=>{var f;r.value=!0;try{if(!s.query.id)return;const{data:w}=await Pn.get(Mn.platformApi+"/musicSheet/detail/"+s.query.id);n.details=w||{},a.value=((f=n.details.musicImg)==null?void 0:f.split(","))||[],n.isComberRender=w.musicSubject==="1",ri(async()=>{w.audioFileUrl?y():(await d(n.details),m())})}catch(w){console.log(w)}},y=async()=>{const f=["play","progress","captions","current-time","duration"];t.value=new dt(e.value,{controls:f}),t.value.on("ready",()=>{n.audioReady=!0,t.value.muted=!1,ri(async()=>{await d(n.details),m()})})},b=async f=>{let w=`${location.origin}/orchestra-music-score/?id=${f.id}&part-index=${n.selectedPartIndex}`;if(n.details.musicSheetType==="SINGLE"){let x="staff";n.radio==="first"?x="firstTone":n.radio==="fixed"?x="fixedTone":n.radio==="staff"&&(x="staff"),w+="&musicRenderType="+x}console.log("\u{1F680} ~ src:",w),Bn({api:"openAccompanyWebView",content:{url:w,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})},v=()=>{var f;(f=t.value)==null||f.pause(),b(n.details)},A=async f=>{var w;if(((w=f.data)==null?void 0:w.api)==="musicStaffRender"){try{const x=f.data.osmdImg,S=[];for(let T=0;T<x.length;T++){const B=await tl(x[T].img,x[T].width,x[T].height);S.push(B)}a.value=S}catch{}r.value=f.data.loading}};return En(async()=>{await p(),window.addEventListener("message",A)}),Sn(()=>{window.removeEventListener("message",A)}),()=>N("div",{class:re.musicDetail},[N(Ji,{mode:"sticky",position:"top"},{default:()=>[N(kn,{border:!1,background:"transparent"},null)]}),N("div",{class:re.musicContainer},[N("div",{class:re.musicInfos},[N("div",{class:re.musicImg},[N(ot,{src:On},null)]),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},[r.value&&N(Nn,null,[N(Hn,{title:!0,row:7},null)]),N("iframe",{id:"staffIframeRef",style:{opacity:r.value?0:1,width:"100%",height:"100%"},src:n.iframeSrc,onLoad:l},null)])]),n.details.id&&N(Ji,{position:"bottom",varName:"--footer-height"},{default:()=>{var f,w,x;return[N("div",{class:re.bottomStyle,style:{background:"#fff"}},[((f=n.details)==null?void 0:f.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:(w=n.details)==null?void 0:w.audioFileUrl,type:"audio/mp3"},null)])]),N("div",{class:re.footers},[N("div",{class:re.iconGroup},[N("div",{class:re.icon,onClick:()=>{r.value||(o.value=!0)}},[N("img",{src:Fn},null),N("span",null,[ve("\u4E0B\u8F7D")])]),((x=n.details)==null?void 0:x.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(Ps,{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":f=>n.status=f,teleport:"body",closeable:!0,style:{width:"80%"},class:re.staffChange,round:!0},{default:()=>[N(ba,{radio:n.radio,onClose:()=>n.status=!1,onChange:f=>{n.radio=f,n.status=!1,f=="first"?(r.value=!0,c("first",n.details.xmlFileUrl)):f=="fixed"?(r.value=!0,c("fixed",n.details.xmlFileUrl)):(r.value=!0,c("staff",n.details.xmlFileUrl))}},null)]}),N(ni,{show:o.value,"onUpdate:show":f=>o.value=f,position:"bottom",round:!0},{default:()=>[o.value&&N(Pa,{imgList:JSON.parse(JSON.stringify(a.value)),musicSheetName:n.details.musicSheetName},null)]}),N(ni,{teleport:"body",position:"bottom",round:!0,show:n.open,"onUpdate:show":f=>n.open=f},{default:()=>[N(Un,{columns:i.value,onConfirm:f=>{n.open=!1,n.selectedPartIndex=f.selectedValues[0],n.selectedPartName=f.selectedOptions[0].instrumentName,n.partXmlIndex=f.selectedOptions[0].xmlIndex,ri(()=>{u()})},onCancel:()=>n.open=!1},null)]})])}});export{xl as default};