1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{44720:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=s(r(67294)),l=a(r(80206));t.default=function(e){var t=e.children,r=(0,l.default)();return t?"function"===typeof t?o.default.createElement(o.Fragment,null,t(r)):o.default.createElement(o.Fragment,null,t):null}},50591:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=(0,r(67294).createContext)({});t.default=n},95788:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=a(r(67294)),c=o(r(50591)),d=function(e,t){var r=t.timestamp;t.animationRef.current=null;var n=e.x,i=e.y,s=e.xDirection,a=e.yDirection,o=e.eventsFired,l=e.hasScrolled||Boolean(r),c=l?window.pageXOffset:0,d=l?window.pageYOffset:0,u=l?o+1:o,h=c-n,f=d-i,p=c/(document.body.scrollWidth-window.innerWidth)*100,m=d/(document.body.scrollHeight-window.innerHeight)*100;return{x:c,y:d,xDifference:h,yDifference:f,xDirection:h>0?"right":h<0?"left":s,yDirection:f>0?"down":f<0?"up":a,xPercentage:p,yPercentage:m,totalPercentage:(p+m)/2,eventsFired:u,hasScrolled:l}};t.default=function(e){var t=e.children,r=(0,l.useRef)(null),i=(0,l.useReducer)(d,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),s=i[0],a=i[1],o=(0,l.useCallback)((function(e){r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame((function(t){a({e:e,timestamp:t,animationRef:r})}))}),[]);return(0,l.useEffect)((function(){return window.addEventListener("scroll",o),function(){window.removeEventListener("scroll",o)}}),[o]),l.default.createElement(c.default.Provider,{value:n({},s)},t&&t)}},14719:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.withScrollInfo=t.useScrollInfo=t.ScrollInfoProvider=t.ScrollInfoContext=t.ScrollInfo=void 0;var i=r(44720);Object.defineProperty(t,"ScrollInfo",{enumerable:!0,get:function(){return n(i).default}});var s=r(50591);Object.defineProperty(t,"ScrollInfoContext",{enumerable:!0,get:function(){return n(s).default}});var a=r(95788);Object.defineProperty(t,"ScrollInfoProvider",{enumerable:!0,get:function(){return n(a).default}});var o=r(80206);Object.defineProperty(t,"useScrollInfo",{enumerable:!0,get:function(){return n(o).default}});var l=r(31576);Object.defineProperty(t,"withScrollInfo",{enumerable:!0,get:function(){return n(l).default}})},80206:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(67294),s=n(r(50591));t.default=function(){return(0,i.useContext)(s.default)}},31576:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(r(67294)),a=r(14719);t.default=function(e){return function(t){var r=(0,a.useScrollInfo)();return s.default.createElement(e,n({},n(n({},t),{scrollInfo:r})))}}},60698:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=s(r(67294)),l=a(r(3796));t.default=function(e){var t=e.children,r=(0,l.default)();return t?"function"===typeof t?o.default.createElement(o.Fragment,null,t(r)):o.default.createElement(o.Fragment,null,t):null}},93108:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=(0,r(67294).createContext)({});t.default=n},87071:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=a(r(67294)),c=o(r(93108)),d=function(e,t){var r=t.payload,i=r.breakpoints;r.animationRef.current=null;var s=e.eventsFired,a=document.documentElement,o=a.style,l=a.clientWidth,c=a.clientHeight,d=window.innerWidth,u=window.innerHeight,h="".concat(l/100,"px"),f="".concat(c/100,"px"),p=i?Object.keys(i).reduce((function(e,t){var r;return n(n({},e),((r={})[t]=window.matchMedia(i[t]).matches,r))}),{}):{},m={width:d,height:u,"--vw":h,"--vh":f,breakpoints:p,eventsFired:s+1};return o.setProperty("--vw",h),o.setProperty("--vh",f),m};t.default=function(e){var t=e.breakpoints,r=e.children,i=(0,l.useRef)(null),s=(0,l.useReducer)(d,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),a=s[0],o=s[1],u=(0,l.useCallback)((function(){i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame((function(){return o({type:"UPDATE",payload:{breakpoints:t,animationRef:i}})}))}),[t]),h=(0,l.useCallback)((function(){setTimeout((function(){u()}),500)}),[u]);return(0,l.useEffect)((function(){return window.addEventListener("resize",u),window.addEventListener("orientationchange",h),function(){window.removeEventListener("resize",u),window.removeEventListener("orientationchange",h)}}),[u,h]),(0,l.useEffect)((function(){0===a.eventsFired&&o({type:"UPDATE",payload:{breakpoints:t,animationRef:i}})}),[t,a]),l.default.createElement(c.default.Provider,{value:n({},a)},r&&r)}},80727:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.withWindowInfo=t.WindowInfoProvider=t.WindowInfoContext=t.WindowInfo=t.useWindowInfo=void 0;var i=r(3796);Object.defineProperty(t,"useWindowInfo",{enumerable:!0,get:function(){return n(i).default}});var s=r(60698);Object.defineProperty(t,"WindowInfo",{enumerable:!0,get:function(){return n(s).default}});var a=r(93108);Object.defineProperty(t,"WindowInfoContext",{enumerable:!0,get:function(){return n(a).default}});var o=r(87071);Object.defineProperty(t,"WindowInfoProvider",{enumerable:!0,get:function(){return n(o).default}});var l=r(38917);Object.defineProperty(t,"withWindowInfo",{enumerable:!0,get:function(){return n(l).default}})},3796:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(67294),s=n(r(93108));t.default=function(){return(0,i.useContext)(s.default)}},38917:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(r(67294)),a=i(r(3796));t.default=function(e){return function(t){var r=(0,a.default)();return s.default.createElement(e,n({},n(n({},t),{windowInfo:r})))}}},48764:function(e,t,r){"use strict";var n=r(22191),i=r(80645),s="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=l,t.h2=50;var a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,r)}function c(e,t,r){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=o(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=function(e){if(l.isBuffer(e)){var t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!==typeof e.length||V(e.length)?o(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return d(e),o(e<0?0:0|p(e))}function h(e){for(var t=e.length<0?0:0|p(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}
vendor: 5,317 bytes, line 1
1else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var s,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var d=-1;for(s=r;s<o;s++)if(c(e,s)===c(t,-1===d?0:s-d)){if(-1===d&&(d=s),s-d+1===l)return d*a}else-1!==d&&(s-=s-d),d=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){for(var u=!0,h=0;h<l;h++)if(c(e,s+h)!==c(t,h)){u=!1;break}if(u)return s}return-1}function E(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o=parseInt(t.substr(2*a,2),16);if(V(o))return a;e[r+a]=o}return a}function _(e,t,r,n){return j(U(t,e.length-r),e,r,n)}function w(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return j(B(t),e,r,n)}function S(e,t,r,n){return j(function(e,t){for(var r,n,i,s=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,a,o,l,c=e[i],d=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(d=c);break;case 2:128===(192&(s=e[i+1]))&&(l=(31&c)<<6|63&s)>127&&(d=l);break;case 3:s=e[i+1],a=e[i+2],128===(192&s)&&128===(192&a)&&(l=(15&c)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:s=e[i+1],a=e[i+2],o=e[i+3],128===(192&s)&&128===(192&a)&&128===(192&o)&&(l=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),i+=u}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return d(e),e<=0?o(e):void 0!==t?"string"===typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if($(s,Uint8Array))i+s.length>n.length?l.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else{if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i)}i+=s.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)}
vendor: 9,897 bytes, line 1
1,l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),o=Math.min(s,a),c=this.slice(n,i),d=e.slice(t,r),u=0;u<o;++u)if(c[u]!==d[u]){s=c[u],a=d[u];break}return s<a?-1:a<s?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function R(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=H[e[s]];return i}function D(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function C(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,i,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,s){return t=+t,r>>>=0,s||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,s){return t=+t,r>>>=0,s||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=l.isBuffer(e)?e:l.from(e,n),o=a.length;
1if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%o]}return this};var F=/[^+/0-9A-Za-z-_]/g;function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function B(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!==e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},22191:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,o)),d=0,u=o>0?a-4:a;for(r=0;r<u;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[d++]=t>>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[d++]=255&t);1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=16383,o=0,l=n-i;o<l;o+=a)s.push(c(e,o,o+a>l?l:o+a));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a<o;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,s,a=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},76489:function(e,t){"use strict";t.parse=function(e,t){if("string"!==typeof e)throw new TypeError("argument str must be a string");for(var n={},i=t||{},a=e.split(";"),o=i.decode||r,l=0;l<a.length;l++){var c=a[l],d=c.indexOf("=");if(!(d<0)){var u=c.substring(0,d).trim();if(void 0==n[u]){var h=c.substring(d+1,c.length).trim();'"'===h[0]&&(h=h.slice(1,-1)),n[u]=s(h,o)}}}return n},t.serialize=function(e,t,r){var s=r||{},a=s.encode||n;if("function"!==typeof a)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var o=a(t);if(o&&!i.test(o))throw new TypeError("argument val is invalid");var l=e+"="+o;if(null!=s.maxAge){var c=s.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(c)}if(s.domain){if(!i.test(s.domain))throw new TypeError("option domain is invalid");l+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");l+="; Path="+s.path}if(s.expires){if("function"!==typeof s.expires.toUTCString)throw new TypeError("option expires is invali
1d");l+="; Expires="+s.expires.toUTCString()}s.httpOnly&&(l+="; HttpOnly");s.secure&&(l+="; Secure");if(s.sameSite){switch("string"===typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var r=decodeURIComponent,n=encodeURIComponent,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(r){return e}}},47041:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.checkCookies=t.hasCookie=t.removeCookies=t.deleteCookie=t.setCookies=t.setCookie=t.getCookie=t.getCookies=void 0;var s=r(76489),a=function(){return"undefined"!==typeof window},o=function(e){void 0===e&&(e="");try{var t=JSON.stringify(e);return/^[\{\[]/.test(t)?t:e}catch(r){return e}};t.getCookies=function(e){var t;if(e&&(t=e.req),!a())return t&&t.cookies?t.cookies:t&&t.headers&&t.headers.cookie?(0,s.parse)(t.headers.cookie):{};for(var r={},n=document.cookie?document.cookie.split("; "):[],i=0,o=n.length;i<o;i++){var l=n[i].split("="),c=l.slice(1).join("=");r[l[0]]=c}return r};t.getCookie=function(e,r){var n,i=(0,t.getCookies)(r)[e];if(void 0!==i)return function(e){return"true"===e||"false"!==e&&("undefined"!==e?"null"===e?null:e:void 0)}((n=i)?n.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent):n)};t.setCookie=function(e,t,r){var l,c,d;r&&(c=r.req,d=r.res,l=i(r,["req","res"]));var u=(0,s.serialize)(e,o(t),n({path:"/"},l));if(a())document.cookie=u;else if(d&&c){var h=d.getHeader("Set-Cookie");if(Array.isArray(h)||(h=h?[String(h)]:[]),d.setHeader("Set-Cookie",h.concat(u)),c&&c.cookies){var f=c.cookies;""===t?delete f[e]:f[e]=o(t)}if(c&&c.headers&&c.headers.cookie){f=(0,s.parse)(c.headers.cookie);""===t?delete f[e]:f[e]=o(t),c.headers.cookie=Object.entries(f).reduce((function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))}),"")}}};t.setCookies=function(e,r,n){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,t.setCookie)(e,r,n)};t.deleteCookie=function(e,r){return(0,t.setCookie)(e,"",n(n({},r),{maxAge:-1}))};t.removeCookies=function(e,r){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,t.deleteCookie)(e,r)};t.hasCookie=function(e,r){return!!e&&(0,t.getCookies)(r).hasOwnProperty(e)};t.checkCookies=function(e,r){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,t.hasCookie)(e,r)}},71221:function(e){"use strict";"undefined"!==typeof self?e.exports=self:"undefined"!==typeof window?e.exports=window:e.exports=Function("return this")()},52168:function(e,t,r){"use strict";var n=r(71221);e.exports=function(){return"object"===typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},80645:function(e,t){t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,c=l>>1,d=-7,u=r?i-1:0,h=r?-1:1,f=e[t+u];for(u+=h,s=f&(1<<-d)-1,f>>=-d,d+=o;d>0;s=256*s+e[t+u],u+=h,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=n;d>0;a=256*a+e[t+u],u+=h,d-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=c}return(f?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,l,c=8*s-i-1,d=(1<<c)-1,u=d>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=d?(o=0,a=d):a+u>=1?(o=(t*l-1)*Math.pow(2,i),a+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&o,f+=p,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;e[r+f]=255&a,f+=p,a/=256,c-=8);e[r+f-p]|=128*m}},54125:function(e){!function(){var t;t=function(){return function(){var e={80:function(e,t,r){e.exports=r(728).default},728:function(e,t,r){"use strict";r.d(t,{default:function(){return Mt}});var n=r(48),i=r.n(n),s=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},a=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)},o=function(e){return e&&void 0!==e.nodeName?(e.muxId||(e.muxId=e.id||a()),e.muxId):e},l=function(e){var t;e&&void 0!==e.nodeName?e=o(t=e):t=document.querySelector(e);var r=t&&t.nodeName?t.nodeName.toLowerCase():"";return[t,e,r]},c=r(640),d=r.n(c),u=d().methodFactory;d().methodFactory=function(e,t,r){var n=u(e,t,r);return function(){for(var e=["[mux]"],t=0;t<arguments.length;t++)e.push(arguments[t]);n.apply(void 0,e)}},d().setLevel(d().getLevel());var h=d();function f(){return"1"===(i().doNotTrack||i().navigator&&i().navigator.doNotTrack)}var p={now:function(){var e=i().performance,t=e&&e.timing,r=t&&t.navigationStart,n="number"==typeof r&&"function"==typeof e.now?r+e.now():Date.now();return Math.round(n)}},m=function(e){return g(e)[0]},g=function(e){if("string"!=typeof e||""===e)return["localhost"];var t,r=(e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/)||[])[4];return r&&(t=(r.match(/[^\.]+\.[^\.]+$/)||[])[0]),[r,t]},v=function(){var e=i().performance;return void 0!==(e&&e.timing)},y=function(){var e=i().performance,t=e&&e.timing;return t&&t.domContentLoadedEventEnd},b=function(){var e=i().performance,t=e&&e.timing;return t&&t.navigationStart};function E(e,t,r){r=void 0===r?1:r,e[t]=e[t]||0,e[t]+=r}var _=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"],w=["x-cdn","content-type"].concat(_);function T(e){var t={};
vendor: 5,999 bytes, line 1
1return(e=e||"").trim().split(/[\r\n]+/).forEach((function(e){if(e){var r=e.split(": "),n=r.shift();n&&(w.indexOf(n.toLowerCase())>=0||0===n.toLowerCase().indexOf("x-litix-"))&&(t[n]=r.join(": "))}})),t}function S(e){if(e){var t=_.find((function(t){return void 0!==e[t]}));return t?e[t]:void 0}}var A=function(e){var t={};for(var r in e){var n=e[r];-1!==n["DATA-ID"].search("io.litix.data.")&&(t[n["DATA-ID"].replace("io.litix.data.","")]=n.VALUE)}return t};function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){L(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=function(e){if(!e)return{};var t=b(),r=e.loading,n=r?r.start:e.trequest,i=r?r.first:e.tfirst,s=r?r.end:e.tload;return{bytesLoaded:e.total,requestStart:Math.round(t+n),responseStart:Math.round(t+i),responseEnd:Math.round(t+s)}},R=function(e){if(e&&"function"==typeof e.getAllResponseHeaders)return T(e.getAllResponseHeaders())};function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){P(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O=function(e,t){if(!e||"function"!=typeof e.getRequests)return{};var r=e.getRequests({state:"executed"});if(0===r.length)return{};var n,i=r[r.length-1],s=m(i.url),a=i.url,o=i.bytesLoaded,l=new Date(i.requestStartDate).getTime(),c=new Date(i.firstByteDate).getTime(),d=new Date(i.requestEndDate).getTime(),u=isNaN(i.duration)?0:i.duration,h="function"==typeof t.getMetricsFor?t.getMetricsFor(i.mediaType).HttpList:t.getDashMetrics().getHttpRequests(i.mediaType);return h.length>0&&(n=T(h[h.length-1]._responseHeaders||"")),{requestStart:l,requestResponseStart:c,requestResponseEnd:d,requestBytesLoaded:o,requestResponseHeaders:n,requestMediaDuration:u,requestHostname:s,requestUrl:a,requestId:n?S(n):void 0}},M=function(e){var t;return null===(t=e.match(/.*codecs\*?="(.*)"/))||void 0===t?void 0:t[1]};function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var F=0,U=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"on",value:function(e,t,r){return t._eventEmitterGuid=t._eventEmitterGuid||++F,this._listeners=this._listeners||{},this._listeners[e]=this._listeners[e]||[],r&&(t=t.bind(r)),this._listeners[e].push(t),t}},{key:"off",value:function(e,t){var r=this._listeners&&this._listeners[e];r&&r.forEach((function(e,n){e._eventEmitterGuid===t._eventEmitterGuid&&r.splice(n,1)}))}},{key:"one",value:function(e,t,r){var n=this;t._eventEmitterGuid=t._eventEmitterGuid||++F;var i=function i(){n.off(e,i),t.apply(r||this,arguments)};i._eventEmitterGuid=t._eventEmitterGuid,this.on(e,i)}},{key:"emit",value:function(e,t){var r=this;if(this._listeners){t=t||{};var n=this._listeners["before*"]||[],i=this._listeners[e]||[],s=this._listeners["after"+e]||[],a=function(t,n){(t=t.slice()).forEach((function(t){t.call(r,{type:e},n)}))};a(n,t),a(i,t),a(s,t)}}}],r&&N(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),B=U;function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var $=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,t.on("playing",(function(){r._playheadShouldBeProgressing=!0})),t.on("play",this._startPlaybackHeartbeatInterval.bind(this)),t.on("playing",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adbreakstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adplay",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adplaying",this._startPlaybackHeartbeatInterval.bind(this)),t.on("seeking",this._startPlaybackHeartbeatInterval.bind(this)),t.on("devicewake",this._startPlaybackHeartbeatInterval.bind(this)),t.on("viewstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("rebufferstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("pause",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("ended",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("viewend",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("error",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("aderror",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adpause",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adended",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adbreakend",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("seeked",(function(){t.data.player_is_paused?r._stopPlaybackHeartbeatInterval():r._startPlaybackHeartbeatInterval()})),t.on("timeupdate",(function(){null!==r._playbackHeartbeatInterval&&t.emit("playbackheartbeat")}
1)),t.on("devicesleep",(function(e,n){null!==r._playbackHeartbeatInterval&&(i().clearInterval(r._playbackHeartbeatInterval),t.emit("playbackheartbeatend",{viewer_time:n.viewer_time}),r._playbackHeartbeatInterval=null)}))}var t,r;return t=e,(r=[{key:"_startPlaybackHeartbeatInterval",value:function(){var e=this;null===this._playbackHeartbeatInterval&&(this.pm.emit("playbackheartbeat"),this._playbackHeartbeatInterval=i().setInterval((function(){e.pm.emit("playbackheartbeat")}),this.pm.playbackHeartbeatTime))}},{key:"_stopPlaybackHeartbeatInterval",value:function(){this._playheadShouldBeProgressing=!1,null!==this._playbackHeartbeatInterval&&(i().clearInterval(this._playbackHeartbeatInterval),this.pm.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)}}])&&j(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function V(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var H=function(e,t,r){return t&&V(e.prototype,t),r&&V(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.on("viewinit",(function(){r.viewErrored=!1})),t.on("error",(function(e,n){try{var i=t.errorTranslator({player_error_code:n.player_error_code,player_error_message:n.player_error_message,player_error_context:n.player_error_context});i?(t.data.player_error_code=i.player_error_code||n.player_error_code,t.data.player_error_message=i.player_error_message||n.player_error_message,t.data.player_error_context=i.player_error_context||n.player_error_context,r.viewErrored=!0):(delete t.data.player_error_code,delete t.data.player_error_message,delete t.data.player_error_context)}catch(e){t.mux.log.warn("Exception in error translator callback.",e),r.viewErrored=!0}}))}));function G(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var q=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,this._watchTimeTrackerLastCheckedTime=null,t.on("playbackheartbeat",this._updateWatchTime.bind(this)),t.on("playbackheartbeatend",this._clearWatchTimeState.bind(this))}var t,r;return t=e,(r=[{key:"_updateWatchTime",value:function(e,t){var r=t.viewer_time;null===this._watchTimeTrackerLastCheckedTime&&(this._watchTimeTrackerLastCheckedTime=r),E(this.pm.data,"view_watch_time",r-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=r}},{key:"_clearWatchTimeState",value:function(e,t){this._updateWatchTime(e,t),this._watchTimeTrackerLastCheckedTime=null}}])&&G(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function W(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var K=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,this._playbackTimeTrackerLastPlayheadPosition=-1,this._lastTime=p.now(),this._isAdPlaying=!1,t.on("playbackheartbeat",this._updatePlaybackTime.bind(this)),t.on("playbackheartbeatend",this._clearPlaybackTimeState.bind(this)),t.on("seeking",this._clearPlaybackTimeState.bind(this)),t.on("adplaying",(function(){r._isAdPlaying=!0})),t.on("adended",(function(){r._isAdPlaying=!1})),t.on("adpause",(function(){r._isAdPlaying=!1})),t.on("adbreakstart",(function(){r._isAdPlaying=!1})),t.on("adbreakend",(function(){r._isAdPlaying=!1})),t.on("adplay",(function(){r._isAdPlaying=!1}))}var t,r;return t=e,(r=[{key:"_updatePlaybackTime",value:function(){var e=this.pm.data.player_playhead_time,t=p.now(),r=-1;this._playbackTimeTrackerLastPlayheadPosition>=0&&e>this._playbackTimeTrackerLastPlayheadPosition?r=e-this._playbackTimeTrackerLastPlayheadPosition:this._isAdPlaying&&(r=t-this._lastTime),r>0&&r<=1e3&&E(this.pm.data,"view_content_playback_time",r),this._playbackTimeTrackerLastPlayheadPosition=e,this._lastTime=t}},{key:"_clearPlaybackTimeState",value:function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1}}])&&W(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t;var r=this._updatePlayheadTime.bind(this);t.on("playbackheartbeat",r),t.on("playbackheartbeatend",r),t.on("timeupdate",r),t.on("destroy",(function(){t.off("timeupdate",r)}))}var t,r;return t=e,(r=[{key:"_updateMaxPlayheadPosition",value:function(){this.pm.data.view_max_playhead_position=void 0===this.pm.data.view_max_playhead_position?this.pm.data.player_playhead_time:Math.max(this.pm.data.view_max_playhead_position,this.pm.data.player_playhead_time)}},{key:"_updatePlayheadTime",value:function(e,t){var r=this,n=function(){r.pm.currentFragmentPDT&&r.pm.currentFragmentStart&&(r.pm.data.player_program_time=r.pm.currentFragmentPDT+r.pm.data.player_playhead_time-r.pm.currentFragmentStart)};if(t&&t.player_playhead_time)this.pm.data.player_playhead_time=t.player_playhead_time,n(),this._updateMaxPlayheadPosition();else if(this.pm.getPlayheadTime){var i=this.pm.getPlayheadTime();void 0!==i&&(this.pm.data.player_playhead_time=i,n(),this._updateMaxPlayheadPosition())}}}])&&z(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function X(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Q=3e5,Z=function(e,t,r){return t&&X(e.prototype,t),r&&X(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t.disableRebufferTracking){var r,n=function(e,t){i(t),r=void 0},i=function(e){if(r){var n=e.viewer_time-r;E(t.data,"view_rebuffer_duration",n),r=e.viewer_time,t.data.view_rebuffer_duration>Q&&(t.emit("viewend"),t.send("viewend"),t.mux.log.warn("Ending view after rebuffering for longer than ".concat(Q,"ms, future events will be ignored unless a programchange or videochange occurs.")))}t.data.view_watch_time>=0&&t.data.view_rebuffer_count>0&&(t.data.view_rebuffer_frequency=t.data.view_rebuffer_count/t.data.view_watch_time,t.data.view_rebuffer_percentage=t.data.view_rebuffer_duration/t.data.view_watch_time)};t.on("playbackheartbeat",(function(e,t){return i(t)})),t.on("rebufferstart",(function(e,i){r||(E(t.data,"view_rebuffer_count",1),r=i.viewer_time,t.one("rebufferend",n))})),t.on("viewinit",(function(){r=void 0,t.off("rebufferend",n)}
vendor: 8,370 bytes, line 1
1))}}));function J(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ee=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,t.disableRebufferTracking||t.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,t.on("playbackheartbeat",this._checkIfRebuffering.bind(this)),t.on("playbackheartbeatend",this._cleanupRebufferTracker.bind(this)),t.on("seeking",(function(){r._cleanupRebufferTracker(null,{viewer_time:p.now()})})))}var t,r;return t=e,r=[{key:"_checkIfRebuffering",value:function(e,t){if(this.pm.seekingTracker.isSeeking||this.pm.adTracker.isAdBreak||!this.pm.playbackHeartbeat._playheadShouldBeProgressing)this._cleanupRebufferTracker(e,t);else if(null!==this._lastCheckedTime)if(this._lastPlayheadTime===this.pm.data.player_playhead_time){var r=t.viewer_time-this._lastPlayheadTimeUpdatedTime;"number"==typeof this.pm.sustainedRebufferThreshold&&r>=this.pm.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),this._lastCheckedTime=t.viewer_time}else this._cleanupRebufferTracker(e,t,!0);else this._prepareRebufferTrackerState(t.viewer_time)}},{key:"_clearRebufferTrackerState",value:function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null}},{key:"_prepareRebufferTrackerState",value:function(e){this._lastCheckedTime=e,this._lastPlayheadTime=this.pm.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=e}},{key:"_cleanupRebufferTracker",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.pm.emit("rebufferend",{viewer_time:t.viewer_time});else{if(null===this._lastCheckedTime)return;var n=this.pm.data.player_playhead_time-this._lastPlayheadTime,i=t.viewer_time-this._lastPlayheadTimeUpdatedTime;"number"==typeof this.pm.minimumRebufferDuration&&n>0&&i-n>this.pm.minimumRebufferDuration&&(this._lastCheckedTime=null,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.pm.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+i-n}))}r?this._prepareRebufferTrackerState(t.viewer_time):this._clearRebufferTrackerState()}}],r&&J(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),te=ee;function re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ne=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,t.on("viewinit",(function(){var e=t.data,n=e.view_id;if(!e.view_program_changed){var i=function(e,i){var s=i.viewer_time;"playing"===e.type&&void 0===t.data.view_time_to_first_frame?r.calculateTimeToFirstFrame(s||p.now(),n):"adplaying"!==e.type||void 0!==t.data.view_time_to_first_frame&&!r._inPrerollPosition()||r.calculateTimeToFirstFrame(s||p.now(),n)};t.one("playing",i),t.one("adplaying",i),t.one("viewend",(function(){t.off("playing",i),t.off("adplaying",i)}))}}))}var t,r;return t=e,(r=[{key:"_inPrerollPosition",value:function(){return void 0===this.pm.data.view_content_playback_time||this.pm.data.view_content_playback_time<=1e3}},{key:"calculateTimeToFirstFrame",value:function(e,t){t===this.pm.data.view_id&&(this.pm.watchTimeTracker._updateWatchTime(null,{viewer_time:e}),this.pm.data.view_time_to_first_frame=this.pm.data.view_watch_time,(this.pm.data.player_autoplay_on||this.pm.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.pm.data.view_aggregate_startup_time=this.pm.data.view_start+this.pm.data.view_watch_time-this.NAVIGATION_START))}}])&&re(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var se=function(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.on("viewinit",(function(){r._lastPlayheadPosition=-1})),["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach((function(e){t.on(e,(function(){if(r._lastPlayheadPosition>=0&&t.data.player_playhead_time>=0&&r._lastPlayerWidth>=0&&r._lastSourceWidth>0&&r._lastPlayerHeight>=0&&r._lastSourceHeight>0){var e=t.data.player_playhead_time-r._lastPlayheadPosition;if(e<0)return void(r._lastPlayheadPosition=-1);var n=Math.min(r._lastPlayerWidth/r._lastSourceWidth,r._lastPlayerHeight/r._lastSourceHeight),i=Math.max(0,n-1),s=Math.max(0,1-n);t.data.view_max_upscale_percentage=Math.max(t.data.view_max_upscale_percentage||0,i),t.data.view_max_downscale_percentage=Math.max(t.data.view_max_downscale_percentage||0,s),E(t.data,"view_total_content_playback_time",e),E(t.data,"view_total_upscaling",i*e),E(t.data,"view_total_downscaling",s*e)}r._lastPlayheadPosition=-1}))})),["playing","hb"].forEach((function(e){t.on(e,(function(){r._lastPlayheadPosition=t.data.player_playhead_time,r._lastPlayerWidth=t.data.player_width,r._lastPlayerHeight=t.data.player_height,r._lastSourceWidth=t.data.video_source_width,r._lastSourceHeight=t.data.video_source_height}))}))}));function ae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var oe=function(e,t,r){return t&&ae(e.prototype,t),r&&ae(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isSeeking=!1,t.on("seeking",(function(e,n){Object.assign(t.data,n),r._lastSeekingTime=p.now(),!1===r.isSeeking&&(r.isSeeking=!0,t.send("seeking"))})),t.on("seeked",(function(){r.isSeeking=!1;var e=r._lastSeekingTime||p.now(),n=p.now()-e;E(t.data,"view_seek_count",1),E(t.data,"view_seek_duration",n);var i=t.data.view_max_seek_time||0;t.data.view_max_seek_time=Math.max(i,n)})),t.on("viewend",(function(){r.isSeeking=!1}))}));function le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ce(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function de(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ue=function(e,t){e.push(t),e.sort((function(e,t){return e.viewer_time-t.viewer_time}))},he=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],fe=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,t.on("viewinit",(function(){r.isAdBreak=!1,r._currentAdRequestNumber=0,r._currentAdResponseNumber=0,r._adRequests=[],r._adResponses=[],r._adHasPlayed=!1,r._wouldBeNewAdPlay=!0,r._prerollPlayTime=void 0})),he.forEach((function(e){return t.on(e,r._updateAdData.bind(r))}));var n=function(){r.isAdBreak=!1};t.on("adbreakstart",(function(){r.isAdBreak=!0})),t.on("play",n),t.on("playing",n),t.on("viewend",n),t.on("adrequest",(function(e,n){
1n=Object.assign({ad_request_id:"generatedAdRequestId"+r._currentAdRequestNumber++},n),ue(r._adRequests,n),E(t.data,"view_ad_request_count"),r.inPrerollPosition()&&(t.data.view_preroll_requested=!0,r._adHasPlayed||E(t.data,"view_preroll_request_count"))})),t.on("adresponse",(function(e,n){n=Object.assign({ad_request_id:"generatedAdRequestId"+r._currentAdResponseNumber++},n),ue(r._adResponses,n);var i=r.findAdRequest(n.ad_request_id);i&&E(t.data,"view_ad_request_time",Math.max(0,n.viewer_time-i.viewer_time))})),t.on("adplay",(function(e,n){r._adHasPlayed=!0,r._wouldBeNewAdPlay&&(r._wouldBeNewAdPlay=!1,E(t.data,"view_ad_played_count")),r.inPrerollPosition()&&!t.data.view_preroll_played&&(t.data.view_preroll_played=!0,r._adRequests.length>0&&(t.data.view_preroll_request_time=Math.max(0,n.viewer_time-r._adRequests[0].viewer_time)),t.data.view_start&&(t.data.view_startup_preroll_request_time=Math.max(0,n.viewer_time-t.data.view_start)),r._prerollPlayTime=n.viewer_time)})),t.on("adplaying",(function(e,n){r.inPrerollPosition()&&void 0===t.data.view_preroll_load_time&&void 0!==r._prerollPlayTime&&(t.data.view_preroll_load_time=n.viewer_time-r._prerollPlayTime,t.data.view_startup_preroll_load_time=n.viewer_time-r._prerollPlayTime)})),t.on("adended",(function(){r._wouldBeNewAdPlay=!0})),t.on("aderror",(function(){r._wouldBeNewAdPlay=!0}))}var t,r;return t=e,(r=[{key:"inPrerollPosition",value:function(){return void 0===this.pm.data.view_content_playback_time||this.pm.data.view_content_playback_time<=1e3}},{key:"findAdRequest",value:function(e){for(var t=0;t<this._adRequests.length;t++)if(this._adRequests[t].ad_request_id===e)return this._adRequests[t]}},{key:"_updateAdData",value:function(e,t){if(this.inPrerollPosition()){if(!this.pm.data.view_preroll_ad_tag_hostname&&t.ad_tag_url){var r=le(g(t.ad_tag_url),2),n=r[0],i=r[1];this.pm.data.view_preroll_ad_tag_domain=i,this.pm.data.view_preroll_ad_tag_hostname=n}if(!this.pm.data.view_preroll_ad_asset_hostname&&t.ad_asset_url){var s=le(g(t.ad_asset_url),2),a=s[0],o=s[1];this.pm.data.view_preroll_ad_asset_domain=o,this.pm.data.view_preroll_ad_asset_hostname=a}}this.pm.data.ad_asset_url=null==t?void 0:t.ad_asset_url,this.pm.data.ad_tag_url=null==t?void 0:t.ad_tag_url,this.pm.data.ad_creative_id=null==t?void 0:t.ad_creative_id,this.pm.data.ad_id=null==t?void 0:t.ad_id,this.pm.data.ad_universal_id=null==t?void 0:t.ad_universal_id}}])&&de(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var me=function(e,t,r){return t&&pe(e.prototype,t),r&&pe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(){t.disableRebufferTracking||r&&(E(t.data,"view_waiting_rebuffer_duration",p.now()-r),r=!1,i().clearInterval(n))},a=!1,o=function(){a=!1,s()};t.on("waiting",(function(){a&&(t.disableRebufferTracking||(E(t.data,"view_waiting_rebuffer_count",1),r=p.now(),n=i().setInterval((function(){if(r){var e=p.now();E(t.data,"view_waiting_rebuffer_duration",e-r),r=e}}),250)))})),t.on("playing",(function(){s(),a=!0})),t.on("pause",o),t.on("seeking",o)}));function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ve=function(e,t,r){return t&&ge(e.prototype,t),r&&ge(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(){r.lastWallClockTime=p.now(),t.on("before*",i)},i=function(e){var n=p.now(),i=r.lastWallClockTime;r.lastWallClockTime=n,n-i>3e4&&(t.emit("devicesleep",{viewer_time:i}),Object.assign(t.data,{viewer_time:i}),t.send("devicesleep"),t.emit("devicewake",{viewer_time:n}),Object.assign(t.data,{viewer_time:n}),t.send("devicewake"))};t.one("playbackheartbeat",n),t.on("playbackheartbeatend",(function(){t.off("before*",i),t.one("playbackheartbeat",n)}))})),ye=r(375),be=r(655),Ee=r.n(be),_e="muxData",we=function(){var e;try{e=ye.parse(Ee().get(_e)||"")}catch(t){e={}}return e},Te=function(e){try{Ee().set(_e,ye.stringify(e),{expires:365})}catch(e){}},Se=function(){var e=we();return e.mux_viewer_id=e.mux_viewer_id||s(),e.msn=e.msn||Math.random(),Te(e),{mux_viewer_id:e.mux_viewer_id,mux_sample_number:e.msn}};function Ae(e,t){var r=t.beaconCollectionDomain,n=t.beaconDomain;if(r)return"https://"+r;var i=n||"litix.io";return(e=e||"inferred").match(/^[a-z0-9]+$/)?"https://"+e+"."+i:"https://img.litix.io/a.gif"}var ke=function(){var e;switch(xe()){case"cellular":e="cellular";break;case"ethernet":e="wired";break;case"wifi":e="wifi";break;case void 0:break;default:e="other"}return e},xe=function(){var e=i().navigator,t=e&&(e.connection||e.mozConnection||e.webkitConnection);return t&&t.type};ke.getConnectionFromAPI=xe;var Le=ke,Ie=De({a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"}),Re=De({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cc:"codec",cd:"code",cg:"category",ch:"changed",cl:"canceled",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"c
1onnection",cz:"context",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",dr:"drm",dp:"dropped",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fa:"failed",fi:"first",fm:"family",ft:"format",fp:"fps",fq:"frequency",fr:"frame",fs:"fullscreen",ha:"has",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",un:"universal",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"});function De(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function Ce(e){var t={},r={};return Object.keys(e).forEach((function(n){var i=!1;if(e.hasOwnProperty(n)&&void 0!==e[n]){var s=n.split("_"),a=s[0],o=Ie[a];o||(h.info("Data key word `"+s[0]+"` not expected in "+n),o=a+"_"),s.splice(1).forEach((function(e){"url"===e&&(i=!0),Re[e]?o+=Re[e]:Number(e)&&Math.floor(Number(e))===Number(e)?o+=e:(h.info("Data key word `"+e+"` not expected in "+n),o+="_"+e+"_")})),i?r[o]=e[n]:t[o]=e[n]}})),Object.assign(t,r)}var Pe={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},Oe=["hb","requestcompleted","requestfailed","requestcanceled"],Me="https://img.litix.io",Ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._beaconUrl=e||Me,this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=Object.assign({},Pe,t)};Ne.prototype.queueEvent=function(e,t){var r=Object.assign({},t);return(this._eventQueue.length<=this._options.maxQueueLength||"eventrateexceeded"===e)&&(this._eventQueue.push(r),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength)},Ne.prototype.flushEvents=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&1===this._eventQueue.length?this._eventQueue.pop():(this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending())},Ne.prototype.destroy=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.destroyed=!0,e?this._clearBeaconQueue():this.flushEvents(),i().clearTimeout(this._sendTimeout)},Ne.prototype._clearBeaconQueue=function(){var e=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,t=this._eventQueue.slice(e);e>0&&Object.assign(t[t.length-1],Ce({mux_view_message:"event queue truncated"}));var r=this._createPayload(t);Ue(this._beaconUrl,r,!0,(function(){}))},Ne.prototype._sendBeaconQueue=function(){var e=this;if(!this._postInFlight){var t=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0;var r=this._createPayload(t),n=p.now();Ue(this._beaconUrl,r,!1,(function(r,i){i?(e._eventQueue=t.concat(e._eventQueue),e._failureCount+=1,h.info("Error sending beacon: "+i)):e._failureCount=0,e._roundTripTime=p.now()-n,e._postInFlight=!1}))}},Ne.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var e=Math.pow(2,this._failureCount-1);return(1+(e*=Math.random()))*this._options.baseTimeBetweenBeacons},Ne.prototype._startBeaconSending=function(){var e=this;i().clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=i().setTimeout((function(){e._eventQueue.length&&e._sendBeaconQueue(),e._startBeaconSending()}),this._getNextBeaconTime()))},Ne.prototype._createPayload=function(e){var t,r,n,i=this,s={transmission_timestamp:Math.round(p.now())};this._roundTripTime&&(s.rtt_ms=Math.round(this._roundTripTime));var a=function(){t=JSON.stringify({metadata:s,events:r||e}),n=t.length/1024},o=function(){return n<=i._options.maxPayloadKBSize};return a(),o()||(h.info("Payload size is too big ("+n+" kb). Removing unnecessary events."),r=e.filter((function(e){return-1===Oe.indexOf(e.e)})),a()),o()||(h.info("Payload size still too big ("+n+" kb). Cropping fields.."),r.forEach((function(e){for(var t in e){var r=e[t];"string"==typeof r&&r.length>51200&&(e[t]=r.substring(0,51200))}})),a()),t};var Fe=function(e){return e.length<=57344},Ue=function(e,t,r,n){if(r&&navigator&&navigator.sendBeacon&&navigator.sendBeacon(e,t))n();else if(i().fetch)i().fetch(e,{method:"POST",body:t,headers:{"Content-Type":"text/plain"},keepalive:Fe(t)}).then((function(e){return n(null,e.ok?null:"Error")})).catch((function(e){return n(null,e)}));else{if(i().XMLHttpRequest){var s=new(i().XMLHttpRequest);return s.onreadystatechange=function(){if(4===s.readyState)return n(null,200!==s.status?"error":void 0)},s.open("POST",e),s.setRequestHeader("Content-Type","text/plain"),void s.send(t)}n()}},Be=Ne;function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
vendor: 10,521 bytes, line 1
1t%2?$e(Object(r),!0).forEach((function(t){We(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}function Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function We(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ke=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],ze=["adplay","adplaying","adpause","adfirstquartile","admidpoint","adthirdquartile","adended","adresponse","adrequest"],Ye=["ad_id","ad_creative_id","ad_universal_id"],Xe=["viewstart","error","ended","viewend"],Qe=function(){function e(t,r){var n,s,a,o,l,c,d,u,h,f,p,m,g,v,y,b=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ge(this,e),We(this,"previousBeaconData",null),We(this,"lastEventTime",0),We(this,"rateLimited",!1),this.mux=t,this.envKey=r,this.options=b,this.eventQueue=new Be(Ae(this.envKey,this.options)),this.sampleRate=null!==(n=this.options.sampleRate)&&void 0!==n?n:1,this.disableCookies=null!==(s=this.options.disableCookies)&&void 0!==s&&s,this.respectDoNotTrack=null!==(a=this.options.respectDoNotTrack)&&void 0!==a&&a,this.previousBeaconData=null,this.lastEventTime=0,this.rateLimited=!1,this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:null===(o=this.options.platform)||void 0===o?void 0:o.name,viewer_application_version:null===(l=this.options.platform)||void 0===l?void 0:l.version,viewer_application_engine:null===(c=this.options.platform)||void 0===c?void 0:c.layout,viewer_device_name:null===(d=this.options.platform)||void 0===d?void 0:d.product,viewer_device_category:"",viewer_device_manufacturer:null===(u=this.options.platform)||void 0===u?void 0:u.manufacturer,viewer_os_family:null===(h=this.options.platform)||void 0===h||null===(f=h.os)||void 0===f?void 0:f.family,viewer_os_architecture:null===(p=this.options.platform)||void 0===p||null===(m=p.os)||void 0===m?void 0:m.architecture,viewer_os_version:null===(g=this.options.platform)||void 0===g||null===(v=g.os)||void 0===v?void 0:v.version,viewer_connection_type:Le(),page_url:null===i()||void 0===i()||null===(y=i().location)||void 0===y?void 0:y.href},this.viewerData=this.disableCookies?{}:Se()}var t,r;return t=e,(r=[{key:"send",value:function(e,t){var r;if(e&&null!=t&&t.view_id){if(this.respectDoNotTrack&&f())return h.info("Not sending `"+e+"` because Do Not Track is enabled");if(!t||"object"!==He(t))return h.error("A data object was expected in send() but was not provided");var n,i,a=this.disableCookies?{}:(n=we(),i=p.now(),n.session_start&&(n.sst=n.session_start,delete n.session_start),n.session_id&&(n.sid=n.session_id,delete n.session_id),n.session_expires&&(n.sex=n.session_expires,delete n.session_expires),(!n.sex||n.sex<i)&&(n.sid=s(),n.sst=i),n.sex=i+15e5,Te(n),{session_id:n.sid,session_start:n.sst,session_expires:n.sex}),o=Ve(Ve(Ve(Ve(Ve({},this.pageLevelData),t),a),this.viewerData),{},{event:e,env_key:this.envKey});o.user_id&&(o.viewer_user_id=o.user_id,delete o.user_id);var l=(null!==(r=o.mux_sample_number)&&void 0!==r?r:0)>=this.sampleRate,c=Ce(this._deduplicateBeaconData(e,o));if(this.lastEventTime=this.mux.utils.now(),l)return h.info("Not sending event due to sample rate restriction",e,o,c);if(this.envKey||h.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",e,o,c),!this.rateLimited)if(h.info("Sending event",e,o,c),this.rateLimited=!this.eventQueue.queueEvent(e,c),this.mux.WINDOW_UNLOADING&&"viewend"===e)this.eventQueue.destroy(!0);else if(this.mux.WINDOW_HIDDEN&&"hb"===e?this.eventQueue.flushEvents(!0):Xe.indexOf(e)>=0&&this.eventQueue.flushEvents(),this.rateLimited)return o.event="eventrateexceeded",c=Ce(o),this.eventQueue.queueEvent(o.event,c),h.error("Beaconing disabled due to rate limit.")}}},{key:"destroy",value:function(){this.eventQueue.destroy(!1)}},{key:"_deduplicateBeaconData",value:function(e,t){var r=this,n={},i=t.view_id;if("-1"===i||"viewstart"===e||"viewend"===e||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)n=Ve({},t),i&&(this.previousBeaconData=n),i&&"viewend"===e&&(this.previousBeaconData=null);else{var s=0===e.indexOf("request");Object.entries(t).forEach((function(t){var i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return je(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?je(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),a=i[0],o=i[1];r.previousBeaconData&&(o!==r.previousBeaconData[a]||Ke.indexOf(a)>-1||r.objectHasChanged(s,a,o,r.previousBeaconData[a])||r.eventRequiresKey(e,a))&&(n[a]=o,r.previousBeaconData[a]=o)}))}return n}},{key:"objectHasChanged",value:function(e,t,r,n){return!(!e||0!==t.indexOf("request_")||"request_response_headers"!==t&&"object"===He(r)&&"object"===He(n)&&Object.keys(r||{}).length===Object.keys(n||{}).length)}},{key:"eventRequiresKey",value:function(e,t){return"renditionchange"===e&&0===t.indexOf("video_source_")||!(!Ye.includes(t)||!ze.includes(e))}}])&&qe(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ze(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Je=function(e,t,r){return t&&Ze(e.prototype,t),r&&Ze(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=0,n=0,i=0,s=0,a=0,o=0,l=0;t.on("requestcompleted",(function(e,o){var l,c,d=o.request_start,u=o.request_response_start,h=o.request_response_end,f=o.request_bytes_loaded;if(s++,u?(l=u-(null!=d?d:0),c=(null!=h?h:0)-u):c=(null!=h?h:0)-(null!=d?d:0),c>0&&f&&f>0){var p=f/c*8e3;a++,n+=f,i+=c,t.data.view_min_request_throughput=Math.min(t.data.view_min_request_throughput||1/0,p),t.data.view_average_request_throughput=n/i*8e3,t.data.view_request_count=s,l>0&&(r+=l,t.data.view_max_request_latency=Math.max(t.data.view_max_request_latency||0,l),t.data.view_average_request_latency=r/a)}})),t.on("requestfailed",(function(e,r){s++,o++,t.data.view_request_count=s,t.data.view_request_failed_count=o})),t.on("requestcanceled",(function(e,r){s++,l++,t.data.view_request_count=s,t.data.view_request_canceled_count=l}))}));function et(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var tt=function(e,t,r){return t&&et(e.prototype,t),r&&et(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.on("before*",(function(e,n){var i=n.viewer_time,s=p.now(),a=r._lastEventTime;if(r._lastEventTime=s,a&&s-a>36e5){var o=Object.keys(t.data).reduce((function(e,r){return 0===r.indexOf("video_")?Object.assign(e,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,t.data[r])):e}),{});t.mux.log.info("Received event after at least an hour inactivity, creating a new view"),t.emit("viewinit",Object.assign({viewer_time:i},o)),t.playbackHeartbeat._playheadShouldBeProgressing&&"play"!==e.type&&"adbreakstart"!==e.type&&(t.emit("play",{viewer_time:i}),"playing"!==e.type&&t.emit("playing",{viewer_time:i}))}}))}));function rt(e){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(e)}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function it(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function st(e,t){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},st(e,t)}function at(e,t){if(t&&("object"===rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ot(e)}function ot(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lt(e)}var ct=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],dt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}
1),t&&st(e,t)}(i,e);var t,r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lt(e);if(t){var i=lt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return at(this,r)}}(i);function i(e,t,r){var a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(a=n.call(this)).DOM_CONTENT_LOADED_EVENT_END=y(),a.NAVIGATION_START=b(),a.mux=e,a.id=t,(r=Object.assign({debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(e){return e}},r)).data=r.data||{},r.data.property_key&&(r.data.env_key=r.data.property_key,delete r.data.property_key),h.setLevel(r.debug?"debug":"warn"),a.getPlayheadTime=r.getPlayheadTime,a.getStateData=r.getStateData||function(){return{}},a.getAdData=r.getAdData||function(){},a.minimumRebufferDuration=r.minimumRebufferDuration,a.sustainedRebufferThreshold=r.sustainedRebufferThreshold,a.playbackHeartbeatTime=r.playbackHeartbeatTime,a.disableRebufferTracking=r.disableRebufferTracking,a.disableRebufferTracking&&a.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),a.disablePlayheadRebufferTracking=r.disablePlayheadRebufferTracking,a.errorTranslator=r.errorTranslator,a.playbackEventDispatcher=new Qe(e,r.data.env_key,r),a.data={player_instance_id:s(),mux_sample_rate:r.sampleRate,beacon_domain:r.beaconCollectionDomain?r.beaconCollectionDomain:r.beaconDomain},a.data.view_sequence_number=1,a.data.player_sequence_number=1,a.oldEmit=a.emit,a.emit=function(e,t){t=Object.assign({viewer_time:this.mux.utils.now()},t),this.oldEmit(e,t)};var o=function(){void 0===this.data.view_start&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(ot(a));a.on("viewinit",(function(e,t){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),Object.assign(this.data,t),this._initializeViewData(),this.one("play",o),this.one("adbreakstart",o)}));var l=function(e){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",e)}.bind(ot(a));if(a.on("videochange",(function(e,t){l(t)})),a.on("programchange",(function(e,t){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),l(Object.assign(t,{view_program_changed:!0})),o(),this.emit("play"),this.emit("playing")})),a.on("fragmentchange",(function(e,t){this.currentFragmentPDT=t.currentFragmentPDT,this.currentFragmentStart=t.currentFragmentStart})),a.on("destroy",a.destroy),"undefined"!=typeof window&&"function"==typeof window.addEventListener&&"function"==typeof window.removeEventListener){var c=function(){var e=void 0!==a.data.view_start;a.mux.WINDOW_HIDDEN="hidden"===document.visibilityState,e&&a.mux.WINDOW_HIDDEN&&(a.data.player_is_paused||a.emit("hb"))};window.addEventListener("visibilitychange",c,!1);var d=function(e){e.persisted||a.destroy()};window.addEventListener("pagehide",d,!1),a.on("destroy",(function(){window.removeEventListener("visibilitychange",c),window.removeEventListener("pagehide",d)}))}return a.on("playerready",(function(e,t){Object.assign(this.data,t)})),ct.forEach((function(e){a.on(e,(function(t,r){0!==e.indexOf("ad")&&this._updateStateData(),Object.assign(this.data,r),this._sanitizeData()})),a.on("after"+e,(function(){("error"!==e||this.errorTracker.viewErrored)&&this.send(e)}))})),a.on("viewend",(function(e,t){Object.assign(a.data,t)})),a.one("playerready",(function(e){var t=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=t-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time})),a.longResumeTracker=new tt(ot(a)),a.errorTracker=new H(ot(a)),new ve(ot(a)),a.seekingTracker=new oe(ot(a)),a.playheadTime=new Y(ot(a)),a.playbackHeartbeat=new $(ot(a)),new se(ot(a)),a.watchTimeTracker=new q(ot(a)),new K(ot(a)),a.adTracker=new fe(ot(a)),new te(ot(a)),new Z(ot(a)),new ne(ot(a)),new me(ot(a)),new Je(ot(a)),r.hlsjs&&a.addHLSJS(r),r.dashjs&&a.addD
1ashJS(r),a.emit("viewinit",r.data),a}return t=i,r=[{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,void 0!==this.data.view_start&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),window.clearTimeout(this._heartBeatTimeout))}},{key:"send",value:function(e){if(this.data.view_id){var t=Object.assign({},this.data);if(void 0===t.video_source_is_live&&(t.player_source_duration===1/0||t.video_source_duration===1/0?t.video_source_is_live=!0:(t.player_source_duration>0||t.video_source_duration>0)&&(t.video_source_is_live=!1)),t.video_source_is_live||["player_program_time","player_manifest_newest_program_time","player_live_edge_program_time","player_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"].forEach((function(e){t[e]=void 0})),t.video_source_url=t.video_source_url||t.player_source_url,t.video_source_url){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(g(t.video_source_url),2),n=r[0],i=r[1];t.video_source_domain=i,t.video_source_hostname=n}delete t.ad_request_id,this.playbackEventDispatcher.send(e,t),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat(),"viewend"===e&&delete this.data.view_id}}},{key:"_updateStateData",value:function(){Object.assign(this.data,this.getStateData()),this.playheadTime._updatePlayheadTime(),this._sanitizeData()}},{key:"_sanitizeData",value:function(){var e=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach((function(t){var r=parseInt(e.data[t],10);e.data[t]=isNaN(r)?void 0:r})),["player_source_url","video_source_url"].forEach((function(t){if(e.data[t]){var r=e.data[t].toLowerCase();0!==r.indexOf("data:")&&0!==r.indexOf("blob:")||(e.data[t]="MSE style URL")}}))}},{key:"_resetVideoData",value:function(e,t){var r=this;Object.keys(this.data).forEach((function(e){0===e.indexOf("video_")&&delete r.data[e]}))}},{key:"_resetViewData",value:function(){var e=this;Object.keys(this.data).forEach((function(t){0===t.indexOf("view_")&&delete e.data[t]})),this.data.view_sequence_number=1}},{key:"_resetErrorData",value:function(e,t){delete this.data.player_error_code,delete this.data.player_error_message}},{key:"_initializeViewData",value:function(){var e=this,t=this.data.view_id=s(),r=function(){t===e.data.view_id&&E(e.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",r):r()}},{key:"_restartHeartBeat",value:function(){var e=this;window.clearTimeout(this._heartBeatTimeout),this.errorTracker.viewErrored||(this._heartBeatTimeout=window.setTimeout((function(){e.data.player_is_paused||e.emit("hb")}),1e4))}},{key:"addHLSJS",value:function(e){e.hlsjs?this.hlsjs?this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=e.hlsjs,function(e,t,r){var n=arguments.length>4?arguments[4]:void 0,i=e.log,s=e.utils.secondsToMs,a=function(e){var t,r=parseInt(n.version);return 1===r&&null!==e.programDateTime&&(t=e.programDateTime),0===r&&null!==e.pdt&&(t=e.pdt),t};if(v()){var o=function(r,n){return e.emit(t,r,n)},l=function(e,t){var r=t.levels,n=t.audioTracks,i=t.url,s=t.stats,a=t.networkDetails,l=t.sessionData,c={},d={};r.forEach((function(e,t){c[t]={width:e.width,height:e.height,bitrate:e.bitrate,attrs:e.attrs}}
vendor: 6,466 bytes, line 1
1)),n.forEach((function(e,t){d[t]={name:e.name,language:e.lang,bitrate:e.bitrate}}));var u=I(s),h=u.bytesLoaded,f=u.requestStart,p=u.responseStart,g=u.responseEnd;o("requestcompleted",x(x({},A(l)),{},{request_event_type:e,request_bytes_loaded:h,request_start:f,request_response_start:p,request_response_end:g,request_type:"manifest",request_hostname:m(i),request_response_headers:R(a),request_rendition_lists:{media:c,audio:d,video:{}}}))};r.on(n.Events.MANIFEST_LOADED,l);var c=function(e,t){var r=t.details,n=t.level,i=t.networkDetails,l=t.stats,c=I(l),d=c.bytesLoaded,u=c.requestStart,h=c.responseStart,f=c.responseEnd,p=r.fragments[r.fragments.length-1],g=a(p)+s(p.duration);o("requestcompleted",{request_event_type:e,request_bytes_loaded:d,request_start:u,request_response_start:h,request_response_end:f,request_current_level:n,request_type:"manifest",request_hostname:m(r.url),request_response_headers:R(i),video_holdback:r.holdBack&&s(r.holdBack),video_part_holdback:r.partHoldBack&&s(r.partHoldBack),video_part_target_duration:r.partTarget&&s(r.partTarget),video_target_duration:r.targetduration&&s(r.targetduration),video_source_is_live:r.live,player_manifest_newest_program_time:isNaN(g)?void 0:g})};r.on(n.Events.LEVEL_LOADED,c);var d=function(e,t){var r=t.details,n=t.networkDetails,i=t.stats,s=I(i),a=s.bytesLoaded,l=s.requestStart,c=s.responseStart,d=s.responseEnd;o("requestcompleted",{request_event_type:e,request_bytes_loaded:a,request_start:l,request_response_start:c,request_response_end:d,request_type:"manifest",request_hostname:m(r.url),request_response_headers:R(n)})};r.on(n.Events.AUDIO_TRACK_LOADED,d);var u=function(e,t){var n=t.stats,i=t.networkDetails,s=t.frag;n=n||s.stats;var a=I(n),l=a.bytesLoaded,c=a.requestStart,d=a.responseStart,u=a.responseEnd,h=i?R(i):void 0,f={request_event_type:e,request_bytes_loaded:l,request_start:c,request_response_start:d,request_response_end:u,request_hostname:i?m(i.responseURL):void 0,request_id:h?S(h):void 0,request_response_headers:h,request_media_duration:s.duration,request_url:null==i?void 0:i.responseURL};"main"===s.type?(f.request_type="media",f.request_current_level=s.level,f.request_video_width=(r.levels[s.level]||{}).width,f.request_video_height=(r.levels[s.level]||{}).height,f.request_labeled_bitrate=(r.levels[s.level]||{}).bitrate):f.request_type=s.type,o("requestcompleted",f)};r.on(n.Events.FRAG_LOADED,u);var h=function(e,t){var r=t.frag,n=r.start,i={currentFragmentPDT:a(r),currentFragmentStart:s(n)};o("fragmentchange",i)};r.on(n.Events.FRAG_CHANGED,h);var f=function(e,t){var r=t.type,i=t.details,s=t.response,a=t.fatal,l=t.frag,c=t.networkDetails,d=(null==l?void 0:l.url)||t.url||"",u=c?R(c):void 0;if(i!==n.ErrorDetails.MANIFEST_LOAD_ERROR&&i!==n.ErrorDetails.MANIFEST_LOAD_TIMEOUT&&i!==n.ErrorDetails.FRAG_LOAD_ERROR&&i!==n.ErrorDetails.FRAG_LOAD_TIMEOUT&&i!==n.ErrorDetails.LEVEL_LOAD_ERROR&&i!==n.ErrorDetails.LEVEL_LOAD_TIMEOUT&&i!==n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&i!==n.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT&&i!==n.ErrorDetails.SUBTITLE_LOAD_ERROR&&i!==n.ErrorDetails.SUBTITLE_LOAD_TIMEOUT&&i!==n.ErrorDetails.KEY_LOAD_ERROR&&i!==n.ErrorDetails.KEY_LOAD_TIMEOUT||o("requestfailed",{request_error:i,request_url:d,request_hostname:m(d),request_id:u?S(u):void 0,request_type:i===n.ErrorDetails.FRAG_LOAD_ERROR||i===n.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":i===n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR||i===n.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT?"audio":i===n.ErrorDetails.SUBTITLE_LOAD_ERROR||i===n.ErrorDetails.SUBTITLE_LOAD_TIMEOUT?"subtitle":i===n.ErrorDetails.KEY_LOAD_ERROR||i===n.ErrorDetails.KEY_LOAD_TIMEOUT?"encryption":"manifest",request_error_code:null==s?void 0:s.code,request_error_text:null==s?void 0:s.text}),a){var h,f="".concat(d?"url: ".concat(d,"\n"):"")+"".concat(s&&(s.code||s.text)?"response: ".concat(s.code,", ").concat(s.text,"\n"):"")+"".concat(t.reason?"failure reason: ".concat(t.reason,"\n"):"")+"".concat(t.level?"level: ".concat(t.level,"\n"):"")+"".concat(t.parent?"parent stream controller: ".concat(t.parent,"\n"):"")+"".concat(t.buffer?"buffer length: ".concat(t.buffer,"\n"):"")+"".concat(t.error?"error: ".concat(t.error,"\n"):"")+"".concat(t.event?"event: ".concat(t.event,"\n"):"")+"".concat(t.err?"error message: ".concat(null===(h=t.err)||void 0===h?void 0:h.message,"\n"):"");o("error",{player_error_code:r,player_error_message:i,player_error_context:f})}};r.on(n.Events.ERROR,f);var p=function(e,t){var r=t.frag,n=r&&r._url||"";o("requestcanceled",{request_event_type:e,request_url:n,request_type:"media",request_hostname:m(n)})};r.on(n.Events.FRAG_LOAD_EMERGENCY_ABORTED,p);var g=function(e,t){var n=t.level,s=r.levels[n];if(s&&s.attrs&&s.attrs.BANDWIDTH){var a,l=s.attrs.BANDWIDTH,c=parseFloat(s.attrs["FRAME-RATE"]);isNaN(c)||(a=c),l?o("renditionchange",{video_source_fps:a,video_source_bitrate:l,video_source_width:s.width,video_source_height:s.height,video_source_rendition_name:s.name,video_source_codec:null==s?void 0:s.videoCodec}):i.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};r.on(n.Events.LEVEL_SWITCHED,g),r._stopMuxMonitor=function(){r.off(n.Events.MANIFEST_LOADED,l),r.off(n.Events.LEVEL_LOADED,c),r.off(n.Events.AUDIO_TRACK_LOADED,d),r.off(n.Events.FRAG_LOADED,u),r.off(n.Events.FRAG_CHANGED,h),r.off(n.Events.ERROR,f),r.off(n.Events.FRAG_LOAD_EMERGENCY_ABORTED,p),r.off(n.Events.LEVEL_SWITCHED,g),r.off(n.Events.DESTROYING,r._stopMuxMonitor),delete r._stopMuxMonitor},r.on(n.Events.DESTROYING,r._stopMuxMonitor)}else i.warn("performance timing not supported. Not tracking HLS.js.")}(this.mux,this.id,e.hlsjs,{},e.Hls||window.Hls)):this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")}},{key:"removeHLSJS",value:function(){var e;this.hlsjs&&((e=this.hlsjs)&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor(),this.hlsjs=void 0)}},{key:"addDashJS",value:function(e){e.dashjs?this.dashjs?this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=e.dashjs,function(e,t,r){var n=e.log;if(r&&r.on){var i=function(r,n){return e.emit(t,r,n)},s=function(e){var t=e.type,r=(e.data||{}).url;i("requestcompleted",{request_event_type:t,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:m(r),request_url:r})};r.on("manifestLoaded",s);var a={},o=function(e){var t=e.type,n=e.fragmentModel,s=(e.chunk||{}).mediaInfo||{},o=s.type,l=s.bitrateList,c={};
1(l=l||[]).forEach((function(e,t){c[t]={},c[t].width=e.width,c[t].height=e.height,c[t].bitrate=e.bandwidth,c[t].attrs={}})),"video"===o?a.video=c:"audio"===o?a.audio=c:a.media=c;var d=O(n,r),u=d.requestStart,h=d.requestResponseStart,f=d.requestResponseEnd,p=d.requestResponseHeaders,m=d.requestMediaDuration,g=d.requestHostname,v=d.requestUrl,y=d.requestId;i("requestcompleted",{request_event_type:t,request_start:u,request_response_start:h,request_response_end:f,request_bytes_loaded:-1,request_type:o+"_init",request_response_headers:p,request_hostname:g,request_id:y,request_url:v,request_media_duration:m,request_rendition_lists:a})};r.on("initFragmentLoaded",o);var l=function(e){var t=e.type,n=e.fragmentModel,s=e.chunk||{},a=s.mediaInfo,o=s.start,l=(a||{}).type,c=O(n,r),d=c.requestStart,u=c.requestResponseStart,h=c.requestResponseEnd,f=c.requestBytesLoaded,p=c.requestResponseHeaders,m=c.requestMediaDuration,g=c.requestHostname,v=c.requestUrl,y=c.requestId,b=function(e,t){var r=t.getQualityFor(e),n=t.getCurrentTrackFor(e).bitrateList;return n?{currentLevel:r,renditionWidth:n[r].width||null,renditionHeight:n[r].height||null,renditionBitrate:n[r].bandwidth}:{}}(l,r),E=b.currentLevel,_=b.renditionWidth,w=b.renditionHeight,T=b.renditionBitrate;i("requestcompleted",{request_event_type:t,request_start:d,request_response_start:u,request_response_end:h,request_bytes_loaded:f,request_type:l,request_response_headers:p,request_hostname:g,request_id:y,request_url:v,request_media_start_time:o,request_media_duration:m,request_current_level:E,request_labeled_bitrate:T,request_video_width:_,request_video_height:w})};r.on("mediaFragmentLoaded",l);var c={video:void 0,audio:void 0,totalBitrate:void 0},d=function(e,t,s){if("number"==typeof e.newQuality){var a=e.mediaType;if("audio"===a||"video"===a){var o=r.getBitrateInfoListFor(a).find((function(t){return t.qualityIndex===e.newQuality}));if(o&&"number"==typeof o.bitrate){c[a]=C(C({},o),{},{codec:r.getCurrentTrackFor(a).codec});var l=function(){if(c.video&&"number"==typeof c.video.bitrate){if(c.video.width&&c.video.height){var e=c.video.bitrate;return c.audio&&"number"==typeof c.audio.bitrate&&(e+=c.audio.bitrate),e!==c.totalBitrate?(c.totalBitrate=e,{video_source_bitrate:e,video_source_height:c.video.height,video_source_width:c.video.width,video_source_codec:M(c.video.codec)}):void 0}n.warn("have bitrate info for video but missing width/height")}}();l&&i("renditionchange",l)}else n.warn("missing bitrate info for ".concat(a))}}else n.warn("missing evt.newQuality in qualityChangeRendered event",e)};r.on("qualityChangeRendered",d);var u=function(e){var t=e.request,r=e.mediaType;i("requestcanceled",{request_event_type:(t=t||{}).type+"_"+t.action,request_url:t.url,request_type:r,request_hostname:m(t.url)})};r.on("fragmentLoadingAbandoned",u);var h=function(e){var t,r,n=e.error,s=(null==n||null===(t=n.data)||void 0===t?void 0:t.request)||{},a=(null==n||null===(r=n.data)||void 0===r?void 0:r.response)||{};27===(null==n?void 0:n.code)&&i("requestfailed",{request_error:s.type+"_"+s.action,request_url:s.url,request_hostname:m(s.url),request_type:s.mediaType,request_error_code:a.status,request_error_text:a.statusText});var o="".concat(null!=s&&s.url?"url: ".concat(s.url,"\n"):"")+"".concat(null!=a&&a.status||null!=a&&a.statusText?"response: ".concat(null==a?void 0:a.status,", ").concat(null==a?void 0:a.statusText,"\n"):"");i("error",{player_error_code:null==n?void 0:n.code,player_error_message:null==n?void 0:n.message,player_error_context:o})};r.on("error",h),r._stopMuxMonitor=function(){r.off("manifestLoaded",s),r.off("initFragmentLoaded",o),r.off("mediaFragmentLoaded",l),r.off("qualityChangeRendered",d),r.off("error",h),r.off("fragmentLoadingAbandoned",u),delete r._stopMuxMonitor}}else n.warn("Invalid dash.js player reference. Monitoring blocked.")}(this.mux,this.id,e.dashjs)):this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")}},{key:"removeDashJS",value:function(){var e;this.dashjs&&((e=this.dashjs)&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor(),this.dashjs=void 0)}}],r&&it(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(B),ut=dt,ht=r(153),ft=r.n(ht);function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gt(e,t):void 0}}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vt,yt=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],bt={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"};i()&&i().WeakMap&&(vt=new WeakMap);var Et=function(e){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(e),this.manifest};Et.prototype.process=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.processLine(this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},Et.prototype.processLine=function(e){var t=e.indexOf(":"),r=xt(e,t),n=r[0],i=2===r.length?Tt(r[1]):void 0;if("#"!==n[0])this.currentUri.uri=n,this.manifest.segments.push(this.currentUri),this.manifest.targetDuration&&!("duration"in this.currentUri)&&(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(n){case"#EXT-X-TARGETDURATION":if(!isFinite(i)||i<0)return;this.manifest.targetDuration=i,this.setHoldBack();break;case"#EXT-X-PART-INF":_t(this.manifest,r),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case"#EXT-X-SERVER-CONTROL":_t(this.manifest,r),this.setHoldBack();break;case"#EXTINF":0===i?this.currentUri.duration=.01:i>0&&(this.currentUri.duration=i);break;case"#EXT-X-PROGRAM-DATE-TIME":var s=i,a=new Date(s);this.manifest.dateTimeString||(this.manifest.dateTimeString=s,this.manifest.dateTimeObject=a),this.currentUri.dateTimeString=s,this.currentUri.dateTimeObject=a;break;case"#EXT-X-VERSION":_t(this.manifest,r);break;case"#EXT-X-SESSION-DATA":var o=Lt(r[1]),l=A(o);Object.assign(this.manifest.sessionData,l)}},Et.prototype.setHoldBack=function(){var e=this.manifest,t=e.serverControl,r=e.targetDuration,n=e.partTargetDuration;if(t){var i="holdBack",s="partHoldBack",a=r&&3*r,o=n&&2*n;r&&!t.hasOwnProperty(i)&&(t[i]=a),a&&t[i]<a&&(t[i]=a),n&&!t.hasOwnProperty(s)&&(t[s]=3*n),n&&t[s]<o&&(t[s]=o)}};var _t=function(e,t){var r,n=wt(t[0].replace("#EXT-X-",""));kt(t[1])?(r={},r=Object.assign(At(t[1]),r)):r=Tt(t[1]),e[n]=r},wt=function(e){return e.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()}))},Tt=function(e){if("yes"===e.toLowerCase()||"no"===e.toLowerCase())return"yes"===e.toLowerCase();var t=-1!==e.indexOf(":")?e:parseFloat(e);return isNaN(t)?e:t},St=function(e){var t={},r=e.split("=");return r.length>1&&(t[wt(r[0])]=Tt(r[1])),t},At=function(e){for(var t=e.split(","),r={},n=0;t.length>n;n++){var i=t[n],s=St(i);r=Object.assign(s,r)}return r},kt=function(e){return e.indexOf("=")>-1},xt=function(e,t){return-1===t?[e]:[e.substring(0,t),e.substring(t+1)]},Lt=function(e){var t={};if(e){var r=e.search(",");return[e.slice(0,r),e.slice(r+1)].forEach((function(e,r){for(var n=e.replace(/['"]+/g,"").split("="),i=0;i<n.length;i++)"DATA-ID"===n[i]&&(t["DATA-ID"]=n[1-i]),"VALUE"===n[i]&&(t.VALUE=n[1-i])})),{data:t}}},It=Et,Rt={safeCall:function(e,t,r,n){var i=n;if(e&&"function"==typeof e[t])try{i=e[t].apply(e,r)}catch(e){h.info("safeCall error",e)}return i},safeIncrement:E,getComputedStyle:function(e,t){var r;if(e&&t&&i()&&"function"==typeof i().getComputedStyle)return vt&&vt.has(e)&&(r=vt.get(e)),r||(r=i().getComputedStyle(e,null),vt&&vt.set(e,r)),r.getPropertyValue(t)},secondsToMs:function(e){return Math.floor(1e3*e)},assign:Object.assign,headersStringToObject:T,cdnHeadersToRequestId:S,extractHostnameAndDomain:g,extractHostname:m,manifestParser:It,generateShortID:a,generateUUID:s,now:p.now};function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ct={},Pt=function e(t){var r=arguments;"string"==typeof t?e.hasOwnProperty(t)?i().setTimeout((function(){r=Array.prototype.splice.call(r,1),e[t].apply(null,r)}
1),0):h.warn("`"+t+"` is an unknown task"):"function"==typeof t?i().setTimeout((function(){t(e)}),0):h.warn("`"+t+"` is invalid.")},Ot={loaded:p.now(),NAME:"mux-embed",VERSION:"4.26.0",API_VERSION:"2.1",PLAYER_TRACKED:!1,monitor:function(e,t){return function(e,t,r){var n=mt(l(t),3),i=n[0],s=n[1],a=n[2],o=e.log,c=e.utils.getComputedStyle,d=e.utils.secondsToMs;if(!i)return o.error("No element was found with the `"+s+"` query selector.");if("video"!==a&&"audio"!==a)return o.error("The element of `"+s+"` was not a media element.");i.mux&&(i.mux.destroy(),delete i.mux,o.warn("Already monitoring this video element, replacing existing event listeners")),(r=Object.assign({automaticErrorTracking:!0},r)).data=Object.assign({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:e.VERSION},r.data),r.getPlayheadTime=function(){return d(i.currentTime)},r.getStateData=function(){var e,t,n=this.hlsjs&&this.hlsjs.url,s=this.dashjs&&pt("function"===this.dashjs.getSource)&&this.dashjs.getSource(),a={player_is_paused:i.paused,player_playhead_time:d(i.currentTime),player_width:parseInt(c(i,"width")),player_height:parseInt(c(i,"height")),player_autoplay_on:i.autoplay,player_preload_on:i.preload,player_language_code:i.lang,player_is_fullscreen:ft()&&!!(ft().fullscreenElement||ft().webkitFullscreenElement||ft().mozFullScreenElement||ft().msFullscreenElement),video_poster_url:i.poster,video_source_url:n||s||i.currentSrc,video_source_duration:d(i.duration),video_source_height:i.videoHeight,video_source_width:i.videoWidth,view_dropped_frame_count:null===(e=i)||void 0===e||null===(t=e.getVideoPlaybackQuality)||void 0===t?void 0:t.call(e).droppedVideoFrames},o=r.getPlayheadTime();if(i.getStartDate&&o>0){var l=i.getStartDate();if(l&&"function"==typeof l.getTime&&l.getTime()){var u=l.getTime();if(a.player_program_time=u+o,i.seekable.length>0){var h=u+i.seekable.end(i.seekable.length-1);a.player_live_edge_program_time=h}}}return a},i.mux=i.mux||{},i.mux.deleted=!1,i.mux.emit=function(t,r){e.emit(s,t,r)};var u=function(){o.error("The monitor for this video element has already been destroyed.")};i.mux.destroy=function(){Object.keys(i.mux.listeners).forEach((function(e){i.removeEventListener(e,i.mux.listeners[e],!1)})),delete i.mux.listeners,i.mux.destroy=u,i.mux.swapElement=u,i.mux.emit=u,i.mux.addHLSJS=u,i.mux.addDashJS=u,i.mux.removeHLSJS=u,i.mux.removeDashJS=u,i.mux.deleted=!0,e.emit(s,"destroy")},i.mux.swapElement=function(t){var r=mt(l(t),3),n=r[0],s=r[1],a=r[2];return n?"video"!==a&&"audio"!==a?e.log.error("The element of `"+s+"` was not a media element."):(n.muxId=i.muxId,delete i.muxId,n.mux=n.mux||{},n.mux.listeners=Object.assign({},i.mux.listeners),delete i.mux.listeners,Object.keys(n.mux.listeners).forEach((function(e){i.removeEventListener(e,n.mux.listeners[e],!1),n.addEventListener(e,n.mux.listeners[e],!1)})),n.mux.swapElement=i.mux.swapElement,n.mux.destroy=i.mux.destroy,delete i.mux,void(i=n)):e.log.error("No element was found with the `"+s+"` query selector.")},i.mux.addHLSJS=function(t){e.addHLSJS(s,t)}
1,i.mux.addDashJS=function(t){e.addDashJS(s,t)},i.mux.removeHLSJS=function(){e.removeHLSJS(s)},i.mux.removeDashJS=function(){e.removeDashJS(s)},e.init(s,r),e.emit(s,"playerready"),i.paused||(e.emit(s,"play"),i.readyState>2&&e.emit(s,"playing")),i.mux.listeners={},yt.forEach((function(t){("error"!==t||r.automaticErrorTracking)&&(i.mux.listeners[t]=function(){var r={};if("error"===t){if(!i.error)return;if(1===i.error.code)return;r.player_error_code=i.error.code,r.player_error_message=bt[i.error.code]||i.error.message}e.emit(s,t,r)},i.addEventListener(t,i.mux.listeners[t],!1))}))}(Pt,e,t)},destroyMonitor:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l(e),1)[0];t&&t.mux&&"function"==typeof t.mux.destroy?t.mux.destroy():h.error("A video element monitor for `"+e+"` has not been initialized via `mux.monitor`.")},addHLSJS:function(e,t){var r=o(e);Ct[r]?Ct[r].addHLSJS(t):h.error("A monitor for `"+r+"` has not been initialized.")},addDashJS:function(e,t){var r=o(e);Ct[r]?Ct[r].addDashJS(t):h.error("A monitor for `"+r+"` has not been initialized.")},removeHLSJS:function(e){var t=o(e);Ct[t]?Ct[t].removeHLSJS():h.error("A monitor for `"+t+"` has not been initialized.")},removeDashJS:function(e){var t=o(e);Ct[t]?Ct[t].removeDashJS():h.error("A monitor for `"+t+"` has not been initialized.")},init:function(e,t){f()&&t&&t.respectDoNotTrack&&h.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var r=o(e);Ct[r]=new ut(Pt,r,t)},emit:function(e,t,r){var n=o(e);Ct[n]?(Ct[n].emit(t,r),"destroy"===t&&delete Ct[n]):h.error("A monitor for `"+n+"` has not been initialized.")},checkDoNotTrack:f,log:h,utils:Rt,events:{PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"},WINDOW_HIDDEN:!1,WINDOW_UNLOADING:!1};Object.assign(Pt,Ot),void 0!==i()&&"function"==typeof i().addEventListener&&i().addEventListener("pagehide",(function(e){e.persisted||(Pt.WINDOW_UNLOADING=!0)}),!1);var Mt=Pt},655:function(e,t,r){var n,i;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}!function(a){var o=!1;if(void 0===(i="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=i),o=!0,"object"===s(t)&&(e.exports=a(),o=!0),!o){var l=window.Cookies,c=window.Cookies=a();c.noConflict=function(){return window.Cookies=l,c}}}((function(){var e=function(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t};return function t(r){function n(t,i,s){var a;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(s=e({path:"/"},n.defaults,s)).expires){var o=new Date;o.setMilliseconds(o.getMilliseconds()+864e5*s.expires),s.expires=o}try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(e){}return i=r.write?r.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decode
1URIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",i,s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("")}t||(a={});for(var l=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,d=0;d<l.length;d++){var u=l[d].split("="),h=u.slice(1).join("=");'"'===h.charAt(0)&&(h=h.slice(1,-1));try{var f=u[0].replace(c,decodeURIComponent);if(h=r.read?r.read(h,f):r(h,f)||h.replace(c,decodeURIComponent),this.json)try{h=JSON.parse(h)}catch(e){}if(t===f){a=h;break}t||(a[f]=h)}catch(e){}}return a}}return n.set=n,n.get=function(e){return n.call(n,e)},n.getJSON=function(){return n.apply({json:!0},[].slice.call(arguments))},n.defaults={},n.remove=function(t,r){n(t,"",e(r,{expires:-1}))},n.withConverter=t,n}((function(){}))}))},153:function(e,t,r){var n,i=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},s=r(558);"undefined"!=typeof document?n=document:(n=i["__GLOBAL_DOCUMENT_CACHE@4"])||(n=i["__GLOBAL_DOCUMENT_CACHE@4"]=s),e.exports=n},48:function(e,t,r){var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},e.exports=n},640:function(e,t,r){var n,i;!function(s,a){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?s:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}function o(t,r){for(var i=0;i<n.length;i++){var s=n[i];this[s]=i<t?e:this.methodFactory(s,t,r)}this.log=this.debug}function l(e,r,n){return function(){typeof console!==t&&(o.call(this,r,n),this[e].apply(this,arguments))}}function c(e,t,r){return a(e)||l.apply(this,arguments)}function d(e,r,i){var s,a=this;r=null==r?"WARN":r;var l="loglevel";function d(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}}function u(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(l)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=i||c,a.getLevel=function(){return s},a.setLevel=function(r,n){if("string"==typeof r&&void 0!==a.levels[r.toUpperCase()]&&(r=a.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(s=r,!1!==n&&d(r),o.call(a,r,e),typeof console===t&&r<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){r=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(r,!1),function(){if(typeof window!==t&&l){try{return void window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=r),a.setLevel(h,!1)}var u=new d,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new d(e,u.getLevel(),u.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=f),u},u.getLoggers=function(){return h},u.default=u,u},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},375:function(e,t){"use strict";var r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,s,a=[];for(s in"string"!=typeof t&&(t="?"),e)if(r.call(e,s)){if((n=e[s])||null!=n&&!isNaN(n)||(n=""),s=i(s),n=i(n),null===s||null===n)continue;a.push(s+"="+n)}return a.length?t+a.join("&"):""}
1,t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,i={};t=r.exec(e);){var s=n(t[1]),a=n(t[2]);null===s||null===a||s in i||(i[s]=a)}return i}},558:function(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}return r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r(80)}()},e.exports=t()}()},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(55326)}])},51729:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(85893),i=r(17206),s=r(67294);const a=["block","list","listItem","marks","types"],o=["listItem"],l=["_key"];function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function f(e,t,r){const n=t[r],i=e[r];return"function"===typeof n||n&&"function"===typeof i?n:n?d(d({},i),n):i}const p={textDecoration:"underline"},m=(e,t)=>"[@portabletext/react] Unknown ".concat(e,", specify a component for it in the `components.").concat(t,"` prop"),g=e=>m('block type "'.concat(e,'"'),"types");function v(e){console.warn(e)}const y={display:"none"},b={types:{},block:{normal:e=>{let{children:t}=e;return(0,n.jsx)("p",{children:t})},blockquote:e=>{let{children:t}=e;return(0,n.jsx)("blockquote",{children:t})},h1:e=>{let{children:t}=e;return(0,n.jsx)("h1",{children:t})},h2:e=>{let{children:t}=e;return(0,n.jsx)("h2",{children:t})},h3:e=>{let{children:t}=e;return(0,n.jsx)("h3",{children:t})},h4:e=>{let{children:t}=e;return(0,n.jsx)("h4",{children:t})},h5:e=>{let{children:t}=e;return(0,n.jsx)("h5",{children:t})},h6:e=>{let{children:t}=e;return(0,n.jsx)("h6",{children:t})}},marks:{em:e=>{let{children:t}=e;return(0,n.jsx)("em",{children:t})},strong:e=>{let{children:t}=e;return(0,n.jsx)("strong",{children:t})},code:e=>{let{children:t}=e;return(0,n.jsx)("code",{children:t})},underline:e=>{let{children:t}=e;return(0,n.jsx)("span",{style:p,children:t})},"strike-through":e=>{let{children:t}=e;return(0,n.jsx)("del",{children:t})},link:e=>{let{children:t,value:r}=e;return(0,n.jsx)("a",{href:null==r?void 0:r.href,children:t})}},list:{number:e=>{let{children:t}=e;return(0,n.jsx)("ol",{children:t})},bullet:e=>{let{children:t}=e;return(0,n.jsx)("ul",{children:t})}},listItem:e=>{let{children:t}=e;return(0,n.jsx)("li",{children:t})},hardBreak:()=>(0,n.jsx)("br",{}),unknownType:e=>{let{value:t,isInline:r}=e;const i=g(t._type);return r?(0,n.jsx)("span",{style:y,children:i}):(0,n.jsx)("div",{style:y,children:i})},unknownMark:e=>{let{markType:t,children:r}=e;return(0,n.jsx)("span",{className:"unknown__pt__mark__".concat(t),children:r})},unknownList:e=>{let{children:t}=e;return(0,n.jsx)("ul",{children:t})},unknownListItem:e=>{let{children:t}=e;return(0,n.jsx)("li",{children:t})},unknownBlockStyle:e=>{let{children:t}=e;return(0,n.jsx)("p",{children:t})}};function E(e){let{value:t,components:r,listNestingMode:o,onMissingComponent:l=v}=e;const c=l||T,u=Array.isArray(t)?t:[t],p=(0,i.zL)(u,o||i.RR),m=(0,s.useMemo)((()=>r?function(e,t){const{block:r,list:n,listItem:i,marks:s,types:o}=t,l=h(t,a);return d(d({},e),{},{block:f(e,t,"block"),list:f(e,t,"list"),listItem:f(e,t,"listItem"),marks:f(e,t,"marks"),types:f(e,t,"types")},l)}(b,r):b),[r]),g=(0,s.useMemo)((()=>_(m,c)),[m,c]),y=p.map(((e,t)=>g({node:e,index:t,isInline:!1,renderNode:g})));return(0,n.jsx)(n.Fragment,{children:y})}const _=(e,t)=>
1{function r(s){const{node:a,index:c,isInline:u}=s,f=a._key||"node-".concat(c);return(0,i.qS)(a)?function(i,s,a){const o=i.children.map(((e,t)=>r({node:e._key?e:d(d({},e),{},{_key:"li-".concat(s,"-").concat(t)}),index:t,isInline:!1,renderNode:r}))),l=e.list,c=("function"===typeof l?l:l[i.listItem])||e.unknownList;if(c===e.unknownList){const e=i.listItem||"bullet";t(m('list style "'.concat(e,'"'),"list"),{nodeType:"listStyle",type:e})}return(0,n.jsx)(c,{value:i,index:s,isInline:!1,renderNode:r,children:o},a)}(a,c,f):(0,i.Ii)(a)?function(i,s,a){const l=w({node:i,index:s,isInline:!1,renderNode:r}),c=e.listItem,d=("function"===typeof c?c:c[i.listItem])||e.unknownListItem;if(d===e.unknownListItem){const e=i.listItem||"bullet";t(m('list item style "'.concat(e,'"'),"listItem"),{type:e,nodeType:"listItemStyle"})}let u=l.children;if(i.style&&"normal"!==i.style){const{listItem:e}=i;u=r({node:h(i,o),index:s,isInline:!1,renderNode:r})}return(0,n.jsx)(d,{value:i,index:s,isInline:!1,renderNode:r,children:u},a)}(a,c,f):(0,i.tX)(a)?function(s,a,o){const{markDef:l,markType:c,markKey:d}=s,u=e.marks[c]||e.unknownMark,h=s.children.map(((e,t)=>r({node:e,index:t,isInline:!0,renderNode:r})));u===e.unknownMark&&t((e=>m('mark type "'.concat(e,'"'),"marks"))(c),{nodeType:"mark",type:c});return(0,n.jsx)(u,{text:(0,i.pY)(s),value:l,markType:c,markKey:d,renderNode:r,children:h},o)}(a,0,f):function(t){return t._type in e.types}(a)?function(t,i,s,a){const o={value:t,isInline:a,index:i,renderNode:r},l=e.types[t._type];return l?(0,n.jsx)(l,d({},o),s):null}(a,c,f,u):(0,i.HW)(a)?function(i,s,a,o){const c=w({node:i,index:s,isInline:o,renderNode:r}),{_key:u}=c,f=h(c,l),p=f.node.style||"normal",g=("function"===typeof e.block?e.block:e.block[p])||e.unknownBlockStyle;g===e.unknownBlockStyle&&t(m('block style "'.concat(p,'"'),"block"),{nodeType:"blockStyle",type:p});return(0,n.jsx)(g,d(d({},f),{},{value:f.node,renderNode:r}),a)}(a,c,f,u):(0,i.m9)(a)?function(t,r){if("\n"===t.text){const t=e.hardBreak;return t?(0,n.jsx)(t,{},r):"\n"}return t.text}(a,f):function(i,s,a,o){const l={value:i,isInline:o,index:s,renderNode:r};t(g(i._type),{nodeType:"block",type:i._type});const c=e.unknownType;return(0,n.jsx)(c,d({},l),a)}(a,c,f,u)}return r};function w(e){const{node:t,index:r,isInline:n,renderNode:s}=e,a=(0,i.Ic)(t).map(((e,t)=>s({node:e,isInline:!0,index:t,renderNode:s})));return{_key:t._key||"block-".concat(r),children:a,index:r,isInline:n,node:t}}function T(){}var S=r(85363),A=r(41664),k=r.n(A),x=r(65344),L=r.n(x);function I(e){let{paragraphClasses:t,value:r}=e;const i={block:{normal:e=>{let{children:r}=e;return(0,n.jsx)("p",{className:t,children:r})}},marks:{link:e=>{let{children:t,value:r}=e;var i;return(0,n.jsx)("a",{href:null===(i=r)||void 0===i?void 0:i.href,rel:"noreferrer noopener",target:"_blank",children:t})},linkInternal:e=>{let{children:t,value:r}=e;return(0,n.jsx)(k(),{href:(0,S.c)(r.type,r.slug),children:t})}}};return(0,n.jsx)("div",{className:L().portableText,children:(0,n.jsx)(E,{components:i,value:r})})}},26563:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(85893),i=r(67296);function s(e){const{title:t,url:r,newWindow:s,classNames:a,showArrow:o}=e;return(0,n.jsxs)("a",{className:a,href:r,target:s?"_blank":"_self",children:[o&&(0,n.jsx)(i.Z,{}),t]})}},29170:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(85893),i=r(11163),s=r(60945),a=r(85363),o=r(67296),l=r(4081),c=r.n(l);function d(e){const{title:t,type:r,slug:l,currentPath:d,hasParentLinkTag:u}=e,h=(0,i.useRouter)();return u?(0,n.jsxs)("div",{className:c().internalLink,children:[(0,n.jsx)(o.Z,{}),(0,n.jsx)("span",{children:t})]}):["emailFormReference","modalDonate","modalFriend","modalNewsletter","thePlantLibrary"].includes(r)?(0,n.jsxs)("div",{className:c().internalLink,onClick:()=>{h.push((0,a.c)(r,l,d),void 0,{shallow:!0})},children:[(0,n.jsx)(o.Z,{}),(0,n.jsx)("span",{children:t})]}):(0,n.jsxs)(s.Z,{className:c().internalLink,href:(0,a.c)(r,l,d),children:[(0,n.jsx)(o.Z,{}),(0,n.jsx)("span",{children:t})]})}},60945:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(85893),i=r(41664),s=r.n(i),a=r(93477),o=r.n(a);function l(e){const{href:t,as:r,children:i,className:a,onClick:l}=e;return(0,n.jsx)(s(),{href:t,as:r,className:"".concat(a," ").concat(o().link),scroll:!1,onClick:l,children:i})}},67296:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n,i,s=r(85893),a=r(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
1for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}var l=e=>a.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"long-arrow-right_svg__Layer_1",x:0,y:0,style:{enableBackground:"new 0 0 100 15"},viewBox:"0 0 100 15"},e),n||(n=a.createElement("style",null,".long-arrow-right_svg__st0{fill:none;stroke-miterlimit:10}")),i||(i=a.createElement("path",{d:"M0 7.5h98.5M91.5.5l7 7-.7.7-6.3 6.3",className:"long-arrow-right_svg__st0"}))),c=r(82913),d=r.n(c);function u(){return(0,s.jsx)(l,{className:d().longArrowSVG})}},26901:function(e,t,r){"use strict";r.d(t,{Z:function(){return ga}});var n=r(85893),i=r(57587),s=r.n(i),a=r(67294),o=r(87725),l=r(72853),c=r.n(l),d=r(79449),u=Object.defineProperty,h=(e,t,r)=>(((e,t,r)=>{t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!==typeof t?t+"":t,r),r),f=new Map,p=new WeakMap,m=0,g=void 0;function v(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(r=e.root,r?(p.has(r)||(m+=1,p.set(r,m.toString())),p.get(r)):"0"):e[t]}`;var r})).toString()}function y(e,t,r={},n=g){if("undefined"===typeof window.IntersectionObserver&&void 0!==n){const i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"===typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:s,elements:a}=function(e){let t=v(e),r=f.get(t);if(!r){const n=new Map;let i;const s=new IntersectionObserver((t=>{t.forEach((t=>{var r;const s=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&"undefined"===typeof t.isVisible&&(t.isVisible=s),null==(r=n.get(t.target))||r.forEach((e=>{e(s,t)}))}))}),e);i=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:s,elements:n},f.set(t,r)}return r}(r);let o=a.get(e)||[];return a.has(e)||a.set(e,o),o.push(t),s.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(a.delete(e),s.unobserve(e)),0===a.size&&(s.disconnect(),f.delete(i))}}a.Component;const b={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},E="mediachromeattributes",_="mediacontroller",w={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_P
1LAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive"},T=Object.entries(w),S=T.reduce(((e,[t,r])=>(e[t]=`${r.toLowerCase()}`,e)),{}),A=T.reduce(((e,[t,r])=>(e[t]=`${r.toLowerCase()}`,e)),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange"}),k=(Object.entries(A).reduce(((e,[t,r])=>{const n=S[t];return n&&(e[r]=n),e}),{userinactivechange:"userinactive"}),Object.entries(S).reduce(((e,[t,r])=>{const n=A[t];return n&&(e[r]=n),e}),{userinactive:"userinactivechange"})),x={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},L="disabled",I="showing",R="mouse",D="touch",C="unavailable",P="unsupported",O={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},M={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:e=1}={})=>`current playback rate ${e}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},N={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:e=30}={})=>`seek forward ${e} seconds`,SEEK_BACK_N_SECS:({seekOffset:e=30}={})=>`seek back ${e} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"};function F(e,t=!1){return e.split("_").map((function(e,r){return(r||t?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()})).join("")}const U=e=>new Promise((t=>setTimeout(t,e))),B=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],j=e=>{if("number"!==typeof(t=e)||Number.isNaN(t)||!Number.isFinite(t))return"";var t;const r=Math.abs(e),n=r!==e,i=new Date(0,0,0,0,0,r,0),s=[i.getHours(),i.getMinutes(),i.getSeconds()].map(((e,t)=>e&&((e,t)=>`${e} ${1===e?B[t].singular:B[t].plural}`)(e,t))).filter((e=>e)).join(", ");return`${s}${n?" remaining":""}`};function $(e,t){let r=!1;e<0&&(r=!0,e=0-e),e=e<0?0:e;let n=Math.floor(e%60),i=Math.floor(e/60%60),s=Math.floor(e/3600);const a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=i=n="-"),s=s>0||o>0?s+":":"",i=((s||a>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,(r?"-":"")+s+i+n}Object.freeze({length:0,start(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});const V=(e,t)=>!(!e||!t)&&(!!e.contains(t)||V(e,t.getRootNode().host)),H=(e,t)=>{if(!e)return null;const r=e.closest(t);return r||H(e.getRootNode().host,t)};function G(e,t){var r;let n;for(n of e.querySelectorAll("style")){let e;try{e=null==(r=n.sheet)?void 0:r.cssRules}catch{continue}for(let r of null!=e?e:[])if(r.selectorText===t)return r}return(null==n?void 0:n.sheet)?(n.sheet.insertRule(`${t}{}`,n.sheet.cssRules.length),n.sheet.cssRules[n.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function q(e,t,r=Number.NaN){const n=e.getAttribute(t);return null!=n?+n:r}function W(e,t,r){const n=+r;null==r||Number.isNaN(n)?e.hasAttribute(t)&&e.removeAttribute(t):q(e,t,void 0)!==n&&e.setAttribute(t,`${n}`)}function K(e,t){return e.hasAttribute(t)}function z(e,t,r){null!=r?K(e,t)!=r&&e.toggleAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function Y(e,t,r=null){var n;return null!=(n=e.getAttribute(t))?n:r}function X(e,t,r){if(null==r)return void(e.hasAttribute(t)&&e.removeAttribute(t));const n=`${r}`;Y(e,t,void 0)!==n&&e.setAttribute(t,n)}class Q{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}}const Z={ResizeObserver:class{observe(){}},HTMLElement:class extends Q{},DocumentFragment:class extends Q{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},requestAnimationFrame:function(e){return 1},queueMicrotask:function(e){}},J={createElement:function(){return new Z.HTMLElement},addEventListener(){},removeEventListener(){}},ee="undefined"===typeof window||"undefined"===typeof window.customElements,te=ee?Z:window,re=ee?J:window.document;var ne,ie,se,ae,oe=Object.defineProperty,le=(e,t,r)=>(((e,t,r)=>{t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!==typeof t?t+"":t,r),r),ce=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},de=(e,t,r)=>(ce(e,t,"read from private field"),r?r.call(e):t.get(e)),ue=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},he=(e,t,r,n)=>(ce(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const fe=re.createElement("template");fe.innerHTML="\n<style>\n :host {\n font: var(--media-font,\n var(--media-font-weight, bold)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n padding: var(--media-control-padding, 10px);\n display: inline-flex;
1\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n box-sizing: border-box;\n transition: background .15s linear;\n pointer-events: auto;\n cursor: pointer;\n }\n\n \n :host(:focus-visible) {\n box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);\n outline: 0;\n }\n \n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n\n :host(:hover) {\n background: var(--media-control-hover-background, rgba(50 50 70 / .7));\n }\n\n svg, img, ::slotted(svg), ::slotted(img) {\n width: var(--media-button-icon-width);\n height: var(--media-button-icon-height, var(--media-control-height, 24px));\n transform: var(--media-button-icon-transform);\n transition: var(--media-button-icon-transition);\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n vertical-align: middle;\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n }\n</style>\n";class pe extends te.HTMLElement{constructor(e={}){if(super(),ue(this,ne,void 0),le(this,"preventClick",!1),ue(this,ie,(e=>{this.preventClick||this.handleClick(e)})),ue(this,se,(e=>{const{key:t}=e;this.keysUsed.includes(t)?this.preventClick||this.handleClick(e):this.removeEventListener("keyup",de(this,se))})),ue(this,ae,(e=>{const{metaKey:t,altKey:r,key:n}=e;t||r||!this.keysUsed.includes(n)?this.removeEventListener("keyup",de(this,se)):this.addEventListener("keyup",de(this,se),{once:!0})})),!this.shadowRoot){this.attachShadow({mode:"open"});const t=fe.content.cloneNode(!0);this.nativeEl=t;let r=e.slotTemplate;r||(r=re.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(t)}const{style:t}=G(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",_]}enable(){this.addEventListener("click",de(this,ie)),this.addEventListener("keydown",de(this,ae)),this.tabIndex=0}disable(){this.removeEventListener("click",de(this,ie)),this.removeEventListener("keydown",de(this,ae)),this.removeEventListener("keyup",de(this,se)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===_?(t&&(null==(i=null==(n=de(this,ne))?void 0:n.unassociateElement)||i.call(n,this),he(this,ne,null)),r&&(he(this,ne,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=de(this,ne))?void 0:a.associateElement)||o.call(a,this))):"disabled"===e&&r!==t&&(null==r?this.enable():this.disable())}connectedCallback(){var e,t,r;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");const n=this.getAttribute(_);n&&(he(this,ne,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=de(this,ne))?void 0:t.associateElement)||r.call(t,this))}disconnectedCallback(){var e,t;this.disable(),null==(t=null==(e=de(this,ne))?void 0:e.unassociateElement)||t.call(e,this),he(this,ne,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}}ne=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,te.customElements.get("media-chrome-button")||te.customElements.define("media-chrome-button",pe);const me=re.createElement("template");me.innerHTML='\n <slot name="icon"><svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>\n</svg>\n</slot>\n';class ge extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:me,...e})}connectedCallback(){this.setAttribute("aria-label",N.AIRPLAY()),super.connectedCallback()}get mediaAirplayUnavailable(){return Y(this,S.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){X(this,S.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){const e=new te.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}}te.customElements.get("media-airplay-button")||te.customElements.define("media-airplay-button",ge);const ve=re.createElement("template");ve.innerHTML=`\n <style>\n :host([${S.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {\n display: none !important;\n }\n\n \n :host(:not([${S.MEDIA_IS_CASTING}])) slot:not([name=enter]):not([name=icon]) {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter"><svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg></slot>\n <slot name="exit"><svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg></slot>\n </slot>\n`;const ye=e=>{const t=null!=e.getAttribute(S.MEDIA_IS_CASTING)?N.EXIT_CAST():N.ENTER_CAST();e.setAttribute("aria-label",t)};class be extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_IS_CASTING,S.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ve,...e})}connectedCallback(){ye(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===S.MEDIA_IS_CASTING&&ye(this),super.attributeChangedCallback(e,t,r)}get mediaIsCasting(){return K(this,S.MEDIA_IS_CASTING)}set mediaIsCasting(e){z(this,S.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return Y(this,S.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){X(this,S.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){const e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new te.CustomEvent(e,{composed:!0,bubbles:!0}))}}te.customElements.get("media-cast-button")||te.customElements.define("media-cast-button",be);var Ee,_e=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},we=(e,t,r)=>(_e(e,t,"read from private field"),r?r.call(e):t.get(e)),Te=(e,t,r,n)=>(_e(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const Se=re.createElement("template");Se.innerHTML="\n<style>\n :host {\n display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));\n box-sizing: border-box;\n }\n</style>\n";class Ae extends te.HTMLElement{constructor(e={}){if(super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,Ee,void 0),!this.shadowRoot){const t=this.attachShadow({mode:"open"}),r=Se.content.cloneNode(!0);this.nativeEl=r;let n=e.slotTemplate;n||(n=re.createElement("template"),n.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(n.content.cloneNode(!0)),t.appendChild(r)}}static get observedAttributes(){return[_,S.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===_&&(t&&(null==(i=null==(n=we(this,Ee))?void 0:n.unassociateElement)||i.call(n,this),Te(this,Ee,null)),r&&(Te(this,Ee,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=we(this,Ee))?void 0:a.associateElement)||o.call(a,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Te(this,Ee,function(e){var t;const r=e.getAttribute(_);
1if(r)return null==(t=e.getRootNode())?void 0:t.getElementById(r);return H(e,"media-controller")}(this)),this.getAttribute(_)&&(null==(t=null==(e=we(this,Ee))?void 0:e.associateElement)||t.call(e,this)),null==(r=we(this,Ee))||r.addEventListener("pointerdown",this),null==(n=we(this,Ee))||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(_)&&(null==(t=null==(e=we(this,Ee))?void 0:e.unassociateElement)||t.call(e,this)),null==(r=we(this,Ee))||r.removeEventListener("pointerdown",this),null==(n=we(this,Ee))||n.removeEventListener("click",this),Te(this,Ee,null)}handleEvent(e){var t;const r=null==(t=e.composedPath())?void 0:t[0];if(["video","media-controller"].includes(null==r?void 0:r.localName))if("pointerdown"===e.type)this._pointerType=e.pointerType;else if("click"===e.type){const{clientX:t,clientY:r}=e,{left:n,top:i,width:s,height:a}=this.getBoundingClientRect(),o=t-n,l=r-i;if(o<0||l<0||o>s||l>a||0===s&&0===a)return;const{pointerType:c=this._pointerType}=e;if(this._pointerType=void 0,c===D)return void this.handleTap(e);if(c===R)return void this.handleMouseClick(e)}}get mediaPaused(){return K(this,S.MEDIA_PAUSED)}set mediaPaused(e){z(this,S.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){const t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new te.CustomEvent(t,{composed:!0,bubbles:!0}))}}Ee=new WeakMap,te.customElements.get("media-gesture-receiver")||te.customElements.define("media-gesture-receiver",Ae);const ke={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},xe=re.createElement("template");xe.innerHTML=`\n <style>\n \n :host([${S.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {\n outline: none;\n }\n\n :host {\n box-sizing: border-box;\n position: relative;\n display: inline-block;\n line-height: 0;\n background-color: var(--media-background-color, #000);\n }\n\n :host(:not([${ke.AUDIO}])) [part~=layer]:not([part~=media-layer]) {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-flow: column nowrap;\n align-items: start;\n pointer-events: none;\n background: none;\n }\n\n slot[name=media] {\n display: var(--media-slot-display, contents);\n }\n\n \n :host([${ke.AUDIO}]) slot[name=media] {\n display: var(--media-slot-display, none);\n }\n\n \n :host([${ke.AUDIO}]) [part~=layer][part~=gesture-layer] {\n height: 0;\n display: block;\n }\n\n \n :host(:not([${ke.AUDIO}])[${ke.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),\n :host(:not([${ke.AUDIO}])[${ke.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {\n display: none;\n }\n\n \n ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator)) {\n pointer-events: auto;\n }\n\n :host(:not([${ke.AUDIO}])) *[part~=layer][part~=centered-layer] {\n align-items: center;\n justify-content: center;\n }\n\n :host(:not([${ke.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),\n :host(:not([${ke.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {\n align-self: stretch;\n flex-grow: 1;\n }\n\n slot[name=middle-chrome] {\n display: inline;\n flex-grow: 1;\n pointer-events: none;\n background: none;\n }\n\n \n ::slotted([slot=media]),\n ::slotted([slot=poster]) {\n width: 100%;\n height: 100%;\n }\n\n \n :host(:not([${ke.AUDIO}])) .spacer {\n flex-grow: 1;\n }\n\n \n :host(:-webkit-full-screen) {\n \n width: 100% !important;\n height: 100% !important;\n }\n\n \n ::slotted(:not([slot=media]):not([${ke.NO_AUTOHIDE}])) {\n opacity: 1;\n transition: opacity 0.25s;\n }\n\n \n :host([${ke.USER_INACTIVE}]:not([${S.MEDIA_PAUSED}]):not([${S.MEDIA_IS_CASTING}]):not([${ke.AUDIO}])) ::slotted(:not([slot=media]):not([${ke.NO_AUTOHIDE}])) {\n opacity: 0;\n transition: opacity 1s;\n }\n\n ::slotted(media-control-bar) {\n align-self: stretch;\n }
1\n\n :host([${S.MEDIA_HAS_PLAYED}]) ::slotted([slot=poster]) {\n display: none;\n }\n </style>\n\n <slot name="media" part="layer media-layer"></slot>\n <slot name="poster" part="layer poster-layer"></slot>\n <slot name="gestures-chrome" part="layer gesture-layer">\n <media-gesture-receiver slot="gestures-chrome"></media-gesture-receiver>\n </slot>\n <span part="layer vertical-layer">\n <slot name="top-chrome" part="top chrome"></slot>\n <slot name="middle-chrome" part="middle chrome"></slot>\n <slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>\n \n <slot part="bottom chrome"></slot>\n </span>\n`;const Le=Object.values(S);function Ie(e){const t=e.split(/\s+/);return Object.fromEntries(t.map((e=>e.split(":"))))}function Re(e,t){return Object.keys(e).filter((r=>t.width>=e[r]))}class De extends te.HTMLElement{constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(xe.content.cloneNode(!0)));new MutationObserver((e=>{const t=this.media;for(let r of e)"childList"===r.type&&(r.removedNodes.forEach((e=>{if("media"==e.slot&&r.target==this){let n=r.previousSibling&&r.previousSibling.previousElementSibling;if(n&&t){let t="media"!==n.slot;for(;null!==(n=n.previousSibling);)"media"==n.slot&&(t=!1);t&&this.mediaUnsetCallback(e)}else this.mediaUnsetCallback(e)}})),t&&r.addedNodes.forEach((e=>{e==t&&this.handleMediaUpdated(t).then((e=>this.mediaSetCallback(e)))})))})).observe(this,{childList:!0,subtree:!0});let e=!1;const t=new ResizeObserver((t=>{e||(te.setTimeout((()=>{(e=>{var t;for(const r of e){const e=r.target;if(!e.isConnected)continue;const n=Ie(null!=(t=e.getAttribute(ke.BREAKPOINTS))?t:"sm:384 md:576 lg:768 xl:960"),i=Re(n,r.contentRect);let s=!1;if(Object.keys(n).forEach((t=>{i.includes(t)?e.hasAttribute(`breakpoint${t}`)||(e.setAttribute(`breakpoint${t}`,""),s=!0):e.hasAttribute(`breakpoint${t}`)&&(e.removeAttribute(`breakpoint${t}`),s=!0)})),s){const t=new CustomEvent(A.BREAKPOINTS_CHANGE,{detail:i});e.dispatchEvent(t)}}})(t),e=!1}),16),e=!0)}));this.resizeObserver=t,t.observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",(()=>{n.assignedElements({flatten:!0}).length?this.media&&(r=this.media,this.handleMediaUpdated(this.media).then((e=>this.mediaSetCallback(e)))):this.mediaUnsetCallback(r)}))}static get observedAttributes(){return[ke.AUTOHIDE,ke.GESTURES_DISABLED].concat(Le)}attributeChangedCallback(e,t,r){e.toLowerCase()==ke.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return"SLOT"==(null==e?void 0:e.nodeName)&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{const t=e.paused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new te.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){const t=e=>Promise.resolve(e);if(!e)return r=e,console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',r),Promise.reject(r);var r;const n=e.nodeName.toLowerCase();return n.includes("-")?te.customElements.whenDefined(n).then((()=>t(e))):t(e)}mediaUnsetCallback(e){}connectedCallback(){const e=null!=this.getAttribute(ke.AUDIO)?M.AUDIO_PLAYER():M.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then((e=>this.mediaSetCallback(e))),this.setAttribute(ke.USER_INACTIVE,"");const t=()=>{if(this.autohide<0)return;if(this.hasAttribute(ke.USER_INACTIVE))return;this.setAttribute(ke.USER_INACTIVE,"");const e=new te.CustomEvent(A.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(e)},r=()=>{if(!this.hasAttribute(ke.USER_INACTIVE))return;this.removeAttribute(ke.USER_INACTIVE);const e=new te.CustomEvent(A.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(e)},n=()=>{r(),te.clearTimeout(this._inactiveTimeout),this.autohide<0||(this._inactiveTimeout=te.setTimeout((()=>{t()}),1e3*this.autohide))};this.addEventListener("keyup",(()=>{n()})),this.addEventListener("pointerup",(e=>{"touch"===e.pointerType?[this,this.media].includes(e.target)&&!this.hasAttribute(ke.USER_INACTIVE)?t():n():e.composedPath().some((e=>{var t;return["media-play-button","media-fullscreen-button"].includes(null==(t=null==e?void 0:e.nodeName)?void 0:t.toLowerCase())}))&&n()})),this.addEventListener("pointermove",(e=>{"mouse"===e.pointerType&&(r(),te.clearTimeout(this._inactiveTimeout),[this,this.media].includes(e.target)&&n())})),this.addEventListener("mouseleave",(()=>{t()})),this.addEventListener("keyup",(()=>{this.setAttribute(ke.KEYBOARD_CONTROL,"")})),te.addEventListener("mouseup",(()=>{this.removeAttribute(ke.KEYBOARD_CONTROL)}))}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return void 0===this._autohide?2:this._autohide}}var Ce,Pe,Oe,Me,Ne,Fe,Ue=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Be=(e,t,r)=>(Ue(e,t,"read from private field"),r?r.call(e):t.get(e)),je=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},$e=(e,t,r,n)=>(Ue(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class Ve{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){je(this,Ne),je(this,Ce,void 0),je(this,Pe,void 0),je(this,Oe,void 0),je(this,Me,new Set),$e(this,Ce,e),$e(this,Pe,t),$e(this,Oe,new Set(r))}[Symbol.iterator](){return Be(this,Ne,Fe).values()}get length(){return Be(this,Ne,Fe).size}get value(){var e;return null!=(e=[...Be(this,Ne,Fe)].join(" "))?e:""}set value(e){var t;e!==this.value&&($e(this,Me,new Set),this.add(...null!=(t=null==e?void 0:e.split(" "))?t:[]))}toString(){return this.value}item(e){return[...Be(this,Ne,Fe)][e]}values(){return Be(this,Ne,Fe).values()}forEach(e){Be(this,Ne,Fe).forEach(e)}add(...e){var t,r;e.forEach((e=>Be(this,Me).add(e))),(""!==this.value||(null==(t=Be(this,Ce))?void 0:t.hasAttribute(`${Be(this,Pe)}`)))&&(null==(r=Be(this,Ce))||r.setAttribute(`${Be(this,Pe)}`,`${this.value}`))}remove(...e){var t;e.forEach((e=>Be(this,Me).delete(e))),null==(t=Be(this,Ce))||t.setAttribute(`${Be(this,Pe)}`,`${this.value}`)}contains(e){return Be(this,Ne,Fe).has(e)}
1toggle(e,t){return"undefined"!==typeof t?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}}Ce=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,Me=new WeakMap,Ne=new WeakSet,Fe=function(){return Be(this,Me).size?Be(this,Me):Be(this,Oe)};const He=(e="")=>e.split(/\s+/),Ge=(e="")=>{let[t,r,n]=e.split(":");return t="cc"===t?"captions":"subtitles",{kind:t,language:r,label:n?decodeURIComponent(n):void 0}},qe=(e="",t={})=>He(e).map((e=>{const r=Ge(e);return{...t,...r}})),We=({kind:e,label:t,language:r}={kind:"subtitles"})=>t?`${"captions"===e?"cc":"sb"}:${r}:${encodeURIComponent(t)}`:r,Ke=(e=[])=>Array.prototype.map.call(e,We).join(" "),ze=e=>{const t=Object.entries(e).map((([e,t])=>((e,t)=>r=>r[e]===t)(e,t)));return e=>t.every((t=>t(e)))},Ye=(e,t=[],r=[])=>{const n=(i=r,Array.isArray(i)?i.map((e=>"string"===typeof e?Ge(e):e)):"string"===typeof i?qe(i):[i]).map(ze);var i;Array.from(t).filter((e=>n.some((t=>t(e))))).forEach((t=>{t.mode=e}))},Xe=(e,t=(()=>!0))=>{if(!(null==e?void 0:e.textTracks))return[];const r="function"===typeof t?t:ze(t);return Array.from(e.textTracks).filter(r)},Qe=e=>!!e.getAttribute(S.MEDIA_SUBTITLES_SHOWING),Ze=(e,t)=>{var r,n;const i=Qe(e);if(i||!1===t){const t=e.getAttribute(S.MEDIA_SUBTITLES_SHOWING);if(t){const r=new window.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t});e.dispatchEvent(r)}}else if(i&&!0!==t)console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.");else{const[t]=null!=(n=He(null!=(r=e.getAttribute(S.MEDIA_SUBTITLES_LIST))?r:""))?n:[];if(t){const r=new window.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t});e.dispatchEvent(r)}}},Je={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};let et;
1void 0===re.fullscreenElement&&(Je.enter="webkitRequestFullScreen",Je.exit=null!=re.webkitExitFullscreen?"webkitExitFullscreen":"webkitCancelFullScreen",Je.rootEvents=["webkitfullscreenchange"],Je.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],Je.element="webkitFullscreenElement",Je.error="webkitfullscreenerror",Je.enabled="webkitFullscreenEnabled");const tt=()=>{var e,t;return et||(et=null==(t=null==(e=re)?void 0:e.createElement)?void 0:t.call(e,"video"),et)},rt=((e=tt())=>{let t=re[Je.enabled];return!t&&e&&(t="webkitSupportsFullscreen"in e),t})(),nt=((e=tt())=>"function"===typeof(null==e?void 0:e.requestPictureInPicture))(),it=!!te.WebKitPlaybackTargetAvailabilityEvent,st=!!te.chrome;let at;const ot=(async(e=tt())=>{if(!e)return!1;const t=e.volume;return e.volume=t/2+.1,await U(0),e.volume!==t})().then((e=>(at=e,at))),lt=Object.values(O),ct=e=>Xe(e.media,(e=>[x.SUBTITLES,x.CAPTIONS].includes(e.kind))).sort(((e,t)=>e.kind>=t.kind?1:-1)),dt={MEDIA_PAUSED:{get:function(e){const{media:t}=e;return!t||t.paused},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(e){const{media:t}=e;return!!t&&!t.paused},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(e){const{media:t}=e;return!!t&&t.ended},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(e){const{media:t}=e;return t&&"undefined"!=typeof t.playbackRate?t.playbackRate:1},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(e){const{media:t}=e;return!(!t||"undefined"==typeof t.muted)&&t.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(e){const{media:t}=e;return t&&"undefined"!=typeof t.volume?Number(t.volume):1},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(e){const{media:t}=e;let r="high";if(!t||"undefined"==typeof t.volume)return r;const{muted:n,volume:i}=t;return 0===i||n?r="off":i<.5?r="low":i<.75&&(r="medium"),r},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(e){const{media:t}=e;return t&&"undefined"!=typeof t.currentTime?t.currentTime:0},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(e){const{media:t}=e;return t&&Number.isFinite(t.duration)?t.duration:NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(e){var t;const{media:r}=e;if(!(null==(t=null==r?void 0:r.seekable)?void 0:t.length))return;const n=r.seekable.start(0),i=r.seekable.end(r.seekable.length-1);return n||i?[Number(n.toFixed(3)),Number(i.toFixed(3))]:void 0},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(e){var t;return!!((null==(t=e.media)?void 0:t.readyState)<3)},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(e){var t,r,n;const i=null==(t=e.media)?void 0:t.buffered;return Array.from(null!=(n=null==(r=e.media)?void 0:r.buffered)?n:[]).map(((e,t)=>[Number(i.start(t)).toFixed(3),Number(i.end(t)).toFixed(3)]))},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(e){const{media:t}=e;if(!t)return;const{streamType:r}=t;if(lt.includes(r)){if(r===O.UNKNOWN){const t=e.getAttribute("defaultstreamtype");return[O.LIVE,O.ON_DEMAND].includes(t)?t:void 0}return r}const n=t.duration;if(n===1/0)return O.LIVE;if(Number.isFinite(n))return O.ON_DEMAND;{const t=e.getAttribute("defaultstreamtype");if([O.LIVE,O.ON_DEMAND].includes(t))return t}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(e){const{media:t}=e;if(!t)return Number.NaN;const{targetLiveWindow:r}=t,n=dt.MEDIA_STREAM_TYPE.get(e);return null!=r&&!Number.isNaN(r)||n!==O.LIVE?r:0},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(e){const{media:t}=e;if(!t)return!1;if("number"===typeof t.liveEdgeStart)return!Number.isNaN(t.liveEdgeStart)&&t.currentTime>=t.liveEdgeStart;if(!("live"===dt.MEDIA_STREAM_TYPE.get(e)))return!1;const r=t.seekable;if(!r)return!0;if(!r.length)return!1;const n=e.hasAttribute("liveedgeoffset")?Number(e.getAttribute("liveedgeoffset")):10,i=r.end(r.length-1)-n;return t.currentTime>=i}
1,mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(e,t){var r;const n=e.media;if(n&&void 0===re[Je.element]&&"webkitDisplayingFullscreen"in n)return n.webkitDisplayingFullscreen&&"fullscreen"===n.webkitPresentationMode;let i;if(t){i=re[Je.element]?t.target:null}else i=null!=(r=e.getRootNode().fullscreenElement)?r:re[Je.element];return V(e.fullscreenElement,i)},rootEvents:Je.rootEvents,mediaEvents:Je.mediaEvents},MEDIA_IS_PIP:{get:function(e,t){var r;const n=e.media;if(!n)return!1;if(t)return"enterpictureinpicture"==t.type;{const t=null!=(r=e.getRootNode().pictureInPictureElement)?r:re.pictureInPictureElement;return V(n,t)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(e,t){var r;const{media:n}=e;if(!n)return!1;const i=null==(r=globalThis.CastableVideoElement)?void 0:r.castElement;let s=V(n,i);return"castchange"===(null==t?void 0:t.type)&&"CONNECTING"===(null==t?void 0:t.detail)&&(s="connecting"),s},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(e,t){return it?t&&"available"!==t.availability&&"not-available"===t.availability?C:void 0:P},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var e;const t=null==(e=globalThis.CastableVideoElement)?void 0:e.castState;return st&&t?t.includes("CONNECT")?void 0:C:P},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return rt?void 0:C}},MEDIA_PIP_UNAVAILABLE:{get:function(){return nt?void 0:P}},MEDIA_VOLUME_UNAVAILABLE:{get:function(e){if(void 0!==at&&!at)return P;const{media:t}=e;return t&&"undefined"==typeof t.volume?C:void 0},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(e){return ct(e).map((({kind:e,label:t,language:r})=>({kind:e,label:t,language:r})))},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(e){return!e.hasAttribute("defaultsubtitles")||e.hasAttribute(S.MEDIA_HAS_PLAYED)||e.hasAttribute(S.MEDIA_SUBTITLES_SHOWING)||Ze(e,!0),(e=>Xe(e.media,(e=>e.mode===I&&[x.SUBTITLES,x.CAPTIONS].includes(e.kind))))(e).map((({kind:e,label:t,language:r})=>({kind:e,label:t,language:r})))},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]}},ut={MEDIA_PLAY_REQUEST:(e,t,r)=>{var n;const i=dt.MEDIA_STREAM_TYPE.get(r),s=null===r.getAttribute("noautoseektolive");i==O.LIVE&&s&&ut.MEDIA_SEEK_TO_LIVE_REQUEST(e),null==(n=e.play())||n.catch((()=>{}))},MEDIA_PAUSE_REQUEST:e=>e.pause(),MEDIA_MUTE_REQUEST:e=>e.muted=!0,MEDIA_UNMUTE_REQUEST:e=>{e.muted=!1,0===e.volume&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:(e,t,r)=>{const n=t.detail;if(e.volume=n,n>0&&e.muted&&(e.muted=!1),!r.hasAttribute("novolumepref"))try{te.localStorage.setItem("media-chrome-pref-volume",n.toString())}catch(i){}},MEDIA_ENTER_FULLSCREEN_REQUEST:(e,t,r)=>{rt?(re.pictureInPictureElement&&re.exitPictureInPicture(),r[Je.enter]?r.fullscreenElement[Je.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")):console.warn("Fullscreen support is unavailable; not entering fullscreen")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{re[Je.exit]()},MEDIA_ENTER_PIP_REQUEST:e=>{if(!re.pictureInPictureEnabled)return void console.warn("MediaChrome: Picture-in-picture is not enabled");if(!e.requestPictureInPicture)return void console.warn("MediaChrome: The current media does not support picture-in-picture");re[Je.element]&&re[Je.exit]();const t=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch((r=>{if(11!==r.code)throw r;if(0!==e.readyState||"none"!==e.preload)throw r;{const r=()=>{e.removeEventListener("loadedmetadata",n),e.preload="none"},n=()=>{e.requestPictureInPicture().catch(t),r()};e.addEventListener("loadedmetadata",n),e.preload="metadata",setTimeout((()=>{0===e.readyState&&t(),r()}),1e3)}}))},MEDIA_EXIT_PIP_REQUEST:()=>{re.pictureInPictureElement&&re.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:e=>{var t;(null==(t=globalThis.CastableVideoElement)?void 0:t.castEnabled)&&(re[Je.element]&&re[Je.exit](),e.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(null==(e=globalThis.CastableVideoElement)?void 0:e.castElement)&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(e,t)=>{const r=t.detail;(e.readyState>0||void 0===e.readyState)&&(e.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:(e,t)=>{e.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:(e,t,r)=>{var n;if(!e)return;const i=t.detail;null===i&&r.propagateMediaState(S.MEDIA_PREVIEW_TIME,void 0),r.propagateMediaState(S.MEDIA_PREVIEW_TIME,i);const[s]=Xe(e,{kind:x.METADATA,label:"thumbnails"});if(!s||!s.cues)return;if(null===i)return r.propagateMediaState(S.MEDIA_PREVIEW_IMAGE,void 0),void r.propagateMediaState(S.MEDIA_PREVIEW_COORDS,void 0);const a=Array.prototype.find.call(s.cues,(e=>e.startTime>=i));if(!a)return;const o=/'^(?:[a-z]+:)?\/\//i.test(a.text)||null==(n=e.querySelector('track[label="thumbnails"]'))?void 0:n.src,l=new URL(a.text,o),c=new URLSearchParams(l.hash).get("#xywh");r.propagateMediaState(S.MEDIA_PREVIEW_IMAGE,l.href),r.propagateMediaState(S.MEDIA_PREVIEW_COORDS,c.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(e,t,r)=>{const n=ct(r),{detail:i=[]}=t;Ye(I,n,i)},MEDIA_DISABLE_SUBTITLES_REQUEST:(e,t,r)=>{const n=ct(r),{detail:i=[]}=t;Ye(L,n,i)},MEDIA_AIRPLAY_REQUEST:e=>{e&&(e.webkitShowPlaybackTargetPicker&&te.WebKitPlaybackTargetAvailabilityEvent?e.webkitShowPlaybackTargetPicker():console.warn("received a request to select AirPlay but AirPlay is not supported in this environment"))},MEDIA_SEEK_TO_LIVE_REQUEST:e=>{const t=e.seekable;t?t.length?e.currentTime=t.end(t.length-1):console.warn("MediaController: Media is unable to seek to live."):console.warn("MediaController: Media element does not support seeking to live.")}};var ht,ft,pt,mt,gt,vt,yt=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},bt=(e,t,r)=>(yt(e,t,"read from private field"),r?r.call(e):t.get(e)),Et=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},_t=(e,t,r,n)=>(yt(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),wt=(e,t,r)=>(yt(e,t,"access private method"),r);const Tt=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],St="defaultsubt
1itles",At="defaultstreamtype",kt="fullscreenelement",xt="hotkeys",Lt="keysused",It="nohotkeys";class Rt extends De{constructor(){super(),Et(this,pt),Et(this,gt),Et(this,ht,new Ve(this,xt)),Et(this,ft,void 0),void 0===dt.MEDIA_VOLUME_UNAVAILABLE.get(this)&&ot.then((()=>{this.propagateMediaState(S.MEDIA_VOLUME_UNAVAILABLE,dt.MEDIA_VOLUME_UNAVAILABLE.get(this))})),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ut).forEach((e=>{const t=`_handle${F(e,!0)}`;this[t]=t=>{t.stopPropagation(),this.media?ut[e](this.media,t,this):console.warn("MediaController: No media available.")},this.addEventListener(b[e],this[t])})),this._mediaStatePropagators={},Object.keys(dt).forEach((e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(w[e],dt[e].get(this,t))}})),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(It,xt,At,St)}get fullscreenElement(){var e;return null!=(e=bt(this,ft))?e:this}set fullscreenElement(e){this.hasAttribute(kt)&&this.removeAttribute(kt),_t(this,ft,e)}attributeChangedCallback(e,t,r){var n;if(e===It)r!==t&&""===r?(this.hasAttribute(xt)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&null===r&&this.enableHotkeys();else if(e===xt)bt(this,ht).value=r;else if(e===St&&r!==t&&""===r)Ze(this,!0);else if(e===At)this.propagateMediaState(w.MEDIA_STREAM_TYPE);else if(e===kt){const e=r?null==(n=this.getRootNode())?void 0:n.getElementById(r):void 0;_t(this,ft,e)}super.attributeChangedCallback(e,t,r)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(dt).forEach((t=>{const{mediaEvents:r,rootEvents:n,trackListEvents:i}=dt[t],s=this._mediaStatePropagators[t];null==r||r.forEach((t=>{e.addEventListener(t,s),s()})),null==n||n.forEach((e=>{this.getRootNode().addEventListener(e,s),s()})),null==i||i.forEach((t=>{var r;null==(r=e.textTracks)||r.addEventListener(t,s),s()}))})),!this.hasAttribute("novolumepref"))try{const t=te.localStorage.getItem("media-chrome-pref-volume");null!==t&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(dt).forEach((t=>{const{mediaEvents:r,rootEvents:n,trackListEvents:i}=dt[t],s=this._mediaStatePropagators[t];null==r||r.forEach((t=>{e.removeEventListener(t,s)})),null==n||n.forEach((e=>{this.getRootNode().removeEventListener(e,s)})),null==i||i.forEach((t=>{var r;null==(r=e.textTracks)||r.removeEventListener(t,s)}))}
1)),this.propagateMediaState(w.MEDIA_PAUSED,!0)}propagateMediaState(e,t){const r=e.toLowerCase(),n=this.getAttribute(r);if(Ut(this.mediaStateReceivers,e,t),n===this.getAttribute(r))return;const i=new te.CustomEvent(k[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}associateElement(e){if(!e)return;const{associatedElementSubscriptions:t}=this;if(t.has(e))return;const r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),i=Bt(e,r,n);Object.keys(b).forEach((t=>{e.addEventListener(b[t],this[`_handle${F(t,!0)}`])})),t.set(e,i)}unassociateElement(e){if(!e)return;const{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(b).forEach((t=>{e.removeEventListener(b[t],this[`_handle${F(t,!0)}`])}))}registerMediaStateReceiver(e){if(!e)return;const t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(dt).forEach((t=>{const r=dt[t];Ut([e],w[t],r.get(this))})))}unregisterMediaStateReceiver(e){const t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",wt(this,gt,vt))}disableHotkeys(){this.removeEventListener("keydown",wt(this,gt,vt)),this.removeEventListener("keyup",wt(this,pt,mt))}get hotkeys(){return bt(this,ht)}keyboardShortcutHandler(e){var t,r,n,i;if((null!=(i=null!=(n=null==(t=e.target.getAttribute(Lt))?void 0:t.split(" "))?n:null==(r=e.target)?void 0:r.keysUsed)?i:[]).map((e=>"Space"===e?" ":e)).filter(Boolean).includes(e.key))return;let s,a,o,l,c;if(!bt(this,ht).contains(`no${e.key.toLowerCase()}`)&&(" "!==e.key||!bt(this,ht).contains("nospace")))switch(e.key){case" ":case"k":s=null!=this.getAttribute(S.MEDIA_PAUSED)?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new te.CustomEvent(s,{composed:!0,bubbles:!0}));break;case"m":s="off"===this.getAttribute(S.MEDIA_VOLUME_LEVEL)?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new te.CustomEvent(s,{composed:!0,bubbles:!0}));break;case"f":s=null!=this.getAttribute(S.MEDIA_IS_FULLSCREEN)?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new te.CustomEvent(s,{composed:!0,bubbles:!0}));break;case"c":Ze(this);break;case"ArrowLeft":a=this.getAttribute(S.MEDIA_CURRENT_TIME),o=a&&!Number.isNaN(+a)?+a:0,l=Math.max(o-10,0),c=new te.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:l}),this.dispatchEvent(c);break;case"ArrowRight":a=this.getAttribute(S.MEDIA_CURRENT_TIME),o=a&&!Number.isNaN(+a)?+a:0,l=Math.max(o+10,0),c=new te.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:l}),this.dispatchEvent(c)}}}ht=new WeakMap,ft=new WeakMap,pt=new WeakSet,mt=function(e){const{key:t}=e;Tt.includes(t)?this.keyboardShortcutHandler(e):this.removeEventListener("keyup",wt(this,pt,mt))},gt=new WeakSet,vt=function(e){const{metaKey:t,altKey:r,key:n}=e;t||r||!Tt.includes(n)?this.removeEventListener("keyup",wt(this,pt,mt)):([" ","ArrowLeft","ArrowRight"].includes(n)&&!(bt(this,ht).contains(`no${n.toLowerCase()}`)||" "===n&&bt(this,ht).contains("nospace"))&&e.preventDefault(),this.addEventListener("keyup",wt(this,pt,mt),{once:!0}))};const Dt=Object.values(S),Ct=Object.values(w),Pt=e=>{var t,r,n,i;let{observedAttributes:s}=e.constructor;!s&&(null==(t=e.nodeName)?void 0:t.includes("-"))&&(te.customElements.upgrade(e),({observedAttributes:s}=e.constructor));const a=null==(i=null==(n=null==(r=null==e?void 0:e.getAttribute)?void 0:r.call(e,E))?void 0:n.split)?void 0:i.call(n,/\s+/);return Array.isArray(s||a)?(s||a).filter((e=>Dt.includes(e))):[]},Ot=e=>(e=>{var t,r;return!(null==(t=e.nodeName)?void 0:t.includes("-"))||!te.customElements.get(null==(r=e.nodeName)?void 0:r.toLowerCase())||e instanceof te.customElements.get(e.nodeName.toLowerCase())||te.customElements.upgrade(e),Ct.some((t=>t in e))})(e)||!!Pt(e).length,Mt=e=>{var t;return null==(t=null==e?void 0:e.join)?void 0:t.call(e,":")},Nt={[S.MEDIA_SUBTITLES_LIST]:Ke,[S.MEDIA_SUBTITLES_SHOWING]:Ke,[S.MEDIA_SEEKABLE]:Mt,[S.MEDIA_BUFFERED]:e=>null==e?void 0:e.map(Mt).join(" "),[S.MEDIA_PREVIEW_COORDS]:e=>null==e?void 0:e.join(" ")},Ft=(e,t)=>
1{if((e=>{var t;return!!(null==(t=e.closest)?void 0:t.call(e,'*[slot="media"]'))})(e))return;const r=(e,t)=>{var r,n;Ot(e)&&t(e);const{children:i=[]}=null!=e?e:{};[...i,...null!=(n=null==(r=null==e?void 0:e.shadowRoot)?void 0:r.children)?n:[]].forEach((e=>Ft(e,t)))},n=null==e?void 0:e.nodeName.toLowerCase();!n.includes("-")||Ot(e)?r(e,t):te.customElements.whenDefined(n).then((()=>{r(e,t)}))},Ut=(e,t,r)=>{e.forEach((e=>{if(t in e)return void(e[t]=r);const n=Pt(e),i=t.toLowerCase();n.includes(i)&&(async(e,t,r)=>{var n,i;if(e.isConnected||await U(0),"boolean"===typeof r||null==r)return z(e,t,r);if("number"===typeof r)return W(e,t,r);if("string"===typeof r)return X(e,t,r);if(Array.isArray(r)&&!r.length)return e.removeAttribute(t);const s=null!=(i=null==(n=Nt[t])?void 0:n.call(Nt,r))?i:r;e.setAttribute(t,s)})(e,i,r)}))},Bt=(e,t,r)=>{Ft(e,t);const n=e=>{var r;const n=null!=(r=null==e?void 0:e.composedPath()[0])?r:e.target;t(n)},i=e=>{var t;const n=null!=(t=null==e?void 0:e.composedPath()[0])?t:e.target;r(n)};e.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,n),e.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,i);let s=[];const a=e=>{const n=e.target;"media"!==n.name&&(s.forEach((e=>Ft(e,r))),s=[...n.assignedElements({flatten:!0})],s.forEach((e=>Ft(e,t))))};e.addEventListener("slotchange",a);const o=new MutationObserver((e=>{e.forEach((e=>{const{addedNodes:n=[],removedNodes:i=[],type:s,target:a,attributeName:o}=e;"childList"===s?(Array.prototype.forEach.call(n,(e=>Ft(e,t))),Array.prototype.forEach.call(i,(e=>Ft(e,r)))):"attributes"===s&&o===E&&(Ot(a)?t(a):r(a))}))}));o.observe(e,{childList:!0,attributes:!0,subtree:!0});return()=>{Ft(e,r),e.removeEventListener("slotchange",a),o.disconnect(),e.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,n),e.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,i)}};te.customElements.get("media-controller")||te.customElements.define("media-controller",Rt);var jt,$t,Vt,Ht=Object.defineProperty,Gt=(e,t,r)=>(((e,t,r)=>{t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!==typeof t?t+"":t,r),r),qt=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Wt=(e,t,r)=>(qt(e,t,"read from private field"),r?r.call(e):t.get(e)),Kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},zt=(e,t,r,n)=>(qt(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const Yt=re.createElement("template"),Xt="\n height: var(--thumb-height);
1\n width: var(--media-range-thumb-width, 10px);\n border: var(--media-range-thumb-border, none);\n border-radius: var(--media-range-thumb-border-radius, 10px);\n background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));\n box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);\n cursor: pointer;\n transition: var(--media-range-thumb-transition, none);\n transform: var(--media-range-thumb-transform, none);\n opacity: var(--media-range-thumb-opacity, 1);\n",Qt="\n min-width: 40px;\n height: var(--track-height);\n border: var(--media-range-track-border, none);\n outline: var(--media-range-track-outline);\n outline-offset: var(--media-range-track-outline-offset);\n border-radius: var(--media-range-track-border-radius, 1px);\n background: var(--media-range-track-progress-internal, var(--media-range-track-background, rgb(255 255 255 / .2)));\n backdrop-filter: var(--media-range-track-backdrop-filter);\n box-shadow: var(--media-range-track-box-shadow, none);\n transition: var(--media-range-track-transition, none);\n transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));\n cursor: pointer;\n";Yt.innerHTML=`\n <style>\n :host {\n --thumb-height: var(--media-range-thumb-height, 10px);\n --track-height: var(--media-range-track-height, 4px);\n --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n --_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));\n\n vertical-align: middle;\n box-sizing: border-box;\n display: inline-block;\n position: relative;\n background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n transition: background .15s linear;\n width: 100px;\n height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));\n padding-left: var(--media-range-padding-left, var(--_media-range-padding));\n padding-right: var(--media-range-padding-right, var(--_media-range-padding));\n pointer-events: auto;\n \n font-size: 0;\n box-shadow: var(--_focus-visible-box-shadow, none);\n }\n\n \n input[type=range]:focus {\n outline: 0;\n }\n input[type=range]:focus::-webkit-slider-runnable-track {\n outline: 0;\n }\n\n :host(:hover) {\n background: var(--media-control-hover-background, rgb(50 50 70 / .7));\n }\n\n #container {\n position: relative;\n height: 100%;\n }\n\n input[type=range] {\n \n -webkit-appearance: none; \n background: transparent; \n\n \n min-height: 100%;\n width: var(--media-range-track-width, 100%); \n\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n }\n\n \n input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n ${Xt}\n \n margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);\n }\n\n \n input[type=range]::-moz-range-thumb {\n ${Xt}\n translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);\n }\n\n input[type=range]::-webkit-slider-runnable-track { ${Qt} }\n input[type=range]::-moz-range-track { ${Qt} }\n input[type=range]::-ms-track {\n \n width: 100%;\n cursor: pointer;\n \n background: transparent;\n border-color: transparent;\n color: transparent;\n\n ${Qt}\n }\n\n #background,\n #pointer {\n width: var(--media-range-track-width, 100%);\n height: var(--track-height);\n border-radius: var(--media-range-track-border-radius, 1px);\n position: absolute;\n top: 50%;\n transform: translate(var(--media-range-track-translate-x, 0px), calc(var(--media-range-track-translate-y, 0px) - 50%));\n }\n\n #background {\n min-width: 40px;\n background: var(--media-range-track-background, rgb(255 255 255 / .2));\n backdrop-filter: var(--media-range-track-background-backdrop-filter);\n }\n\n #pointer {\n background: var(--media-range-track-pointer-background);\n border-right: var(--media-range-track-pointer-border-right);\n transition: visibility .25s, opacity .25s;\n visibility: hidden;\n opacity: 0;\n }\n\n :host(:hover) #pointer {\n transition: visibility .5s, opacity .5s;\n visibility: visible;\n opacity: 1;\n }\n\n #hoverzone {\n \n z-index: 1;\n display: var(--media-time-range-hover-display, none);\n position: absolute;\n width: 100%;\n bottom: var(--media-time-range-hover-bottom, -5px);\n height: var(--media-time-range-hover-height, max(calc(100% + 5px), 20px));\n }\n\n #range {\n z-index: 2;\n position: relative;\n height: var(--media-range-track-height, 4px);\n }\n\n input[type=range]:disabled::-webkit-slider-thumb {\n background-color: #777;\n }\n\n input[type=range]:disabled::-webkit-slider-runnable-track {\n background-color: #777;\n }\n </style>\n <div id="container">\n <div id="background"></div>\n <div id="pointer"></div>\n <div id="hoverzone"></div>
1\n <input id="range" type="range" min="0" max="1000" step="any" value="0">\n </div>\n`;class Zt extends te.HTMLElement{constructor(){super(),Gt(this,"thumbWidth"),Kt(this,jt,void 0),Kt(this,$t,(()=>{if(this.range.matches(":focus-visible")){const{style:e}=G(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}})),Kt(this,Vt,(()=>{const{style:e}=G(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")})),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yt.content.cloneNode(!0)));const{style:e}=G(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),this.thumbWidth=parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10)}static get observedAttributes(){return["disabled","aria-disabled",_]}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===_?(t&&(null==(i=null==(n=Wt(this,jt))?void 0:n.unassociateElement)||i.call(n,this),zt(this,jt,null)),r&&(zt(this,jt,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=Wt(this,jt))?void 0:a.associateElement)||o.call(a,this))):("disabled"===e||"aria-disabled"===e&&t!==r)&&(null==r?this.range.removeAttribute(e):this.range.setAttribute(e,r))}connectedCallback(){var e,t,r;const n=this.getAttribute(_);n&&(zt(this,jt,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=Wt(this,jt))?void 0:t.associateElement)||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Wt(this,$t)),this.shadowRoot.addEventListener("focusout",Wt(this,Vt))}disconnectedCallback(){var e,t;null==(t=null==(e=Wt(this,jt))?void 0:e.unassociateElement)||t.call(e,this),zt(this,jt,null),this.shadowRoot.removeEventListener("focusin",Wt(this,$t)),this.shadowRoot.removeEventListener("focusout",Wt(this,Vt))}updatePointerBar(e){const t=this.range.getBoundingClientRect();let r=(e.clientX-t.left)/t.width;r=Math.max(0,Math.min(1,r));const{style:n}=G(this.shadowRoot,"#pointer");n.setProperty("width",r*t.width+"px")}updateBar(){const e=this.getBarColors();let t="linear-gradient(to right, ",r=0;e.forEach((e=>{e[1]<r||(t+=`${e[0]} ${r}%, ${e[0]} ${e[1]}%,`,r=e[1])})),t=t.slice(0,t.length-1)+")";const{style:n}=G(this.shadowRoot,"#range");n.setProperty("--media-range-track-progress-internal",t)}getRelativeValues(){const{range:e}=this;return{relativeValue:e.value-e.min,relativeMax:e.max-e.min}}getBarColors(){const e=this.range,{relativeValue:t,relativeMax:r}=this.getRelativeValues(),n=t/r*100;let i=0;if(t&&t<r){i=this.thumbWidth*(.5-n/100)/e.offsetWidth*100}return[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",n+i],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}}jt=new WeakMap,$t=new WeakMap,Vt=new WeakMap,te.customElements.get("media-chrome-range")||te.customElements.define("media-chrome-range",Zt);var Jt,er=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tr=(e,t,r)=>(er(e,t,"read from private field"),r?r.call(e):t.get(e)),rr=(e,t,r,n)=>(er(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const nr=re.createElement("template");
1nr.innerHTML="\n <style>\n :host {\n \n box-sizing: border-box;\n display: var(--media-control-display, var(--media-control-bar-display, inline-flex));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n --media-loading-indicator-icon-height: 44px;\n }\n\n media-time-range,\n ::slotted(media-time-range),\n ::slotted(media-clip-selector) {\n flex-grow: 1;\n }\n\n media-time-range,\n ::slotted(media-time-range),\n ::slotted(media-clip-selector),\n media-volume-range,\n ::slotted(media-volume-range) {\n height: var(--_range-auto-size, calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding)));\n }\n </style>\n\n <slot></slot>\n";class ir extends te.HTMLElement{constructor(){super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,Jt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(nr.content.cloneNode(!0))),this.shadowRoot.querySelector("slot").addEventListener("slotchange",(({target:e})=>{const t=e.assignedElements({flatten:!0}).every((e=>["media-time-range","media-volume-range"].includes(e.nodeName.toLowerCase()))),{style:r}=G(this.shadowRoot,":host"),n=t?"unset":"initial";r.setProperty("--_range-auto-size",n)}))}static get observedAttributes(){return[_]}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===_&&(t&&(null==(i=null==(n=tr(this,Jt))?void 0:n.unassociateElement)||i.call(n,this),rr(this,Jt,null)),r&&(rr(this,Jt,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=tr(this,Jt))?void 0:a.associateElement)||o.call(a,this)))}connectedCallback(){var e,t,r;const n=this.getAttribute(_);n&&(rr(this,Jt,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=tr(this,Jt))?void 0:t.associateElement)||r.call(t,this))}disconnectedCallback(){var e,t;null==(t=null==(e=tr(this,Jt))?void 0:e.unassociateElement)||t.call(e,this),rr(this,Jt,null)}}Jt=new WeakMap,te.customElements.get("media-control-bar")||te.customElements.define("media-control-bar",ir);var sr,ar=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},or=(e,t,r)=>(ar(e,t,"read from private field"),r?r.call(e):t.get(e)),lr=(e,t,r,n)=>(ar(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const cr=re.createElement("template");
1cr.innerHTML="\n <style>\n :host {\n font: var(--media-font,\n var(--media-font-weight, normal)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));\n padding: var(--media-control-padding, 10px);\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n box-sizing: border-box;\n text-align: center;\n pointer-events: auto;\n }\n\n \n :host(:focus-visible) {\n box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);\n outline: 0;\n }\n\n \n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n </style>\n <slot></slot>\n";class dr extends te.HTMLElement{constructor(){super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,sr,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cr.content.cloneNode(!0)));const{style:e}=G(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[_]}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===_&&(t&&(null==(i=null==(n=or(this,sr))?void 0:n.unassociateElement)||i.call(n,this),lr(this,sr,null)),r&&(lr(this,sr,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=or(this,sr))?void 0:a.associateElement)||o.call(a,this)))}connectedCallback(){var e,t,r;const n=this.getAttribute(_);n&&(lr(this,sr,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=or(this,sr))?void 0:t.associateElement)||r.call(t,this))}disconnectedCallback(){var e,t;null==(t=null==(e=or(this,sr))?void 0:e.unassociateElement)||t.call(e,this),lr(this,sr,null)}}sr=new WeakMap,te.customElements.get("media-text-display")||te.customElements.define("media-text-display",dr);var ur,hr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},fr=(e,t,r)=>(hr(e,t,"read from private field"),r?r.call(e):t.get(e));class pr extends dr{constructor(){var e,t,r,n;super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,ur,void 0),e=this,t=ur,r=this.shadowRoot.querySelector("slot"),hr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),fr(this,ur).textContent=$(0)}static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===S.MEDIA_DURATION&&(fr(this,ur).textContent=$(r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return q(this,S.MEDIA_DURATION)}set mediaDuration(e){W(this,S.MEDIA_DURATION,e)}}ur=new WeakMap,te.customElements.get("media-duration-display")||te.customElements.define("media-duration-display",pr);var mr,gr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},vr=(e,t,r)=>(gr(e,t,"read from private field"),r?r.call(e):t.get(e));const yr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},br=[...Object.values(yr),S.MEDIA_CURRENT_TIME,S.MEDIA_DURATION,S.MEDIA_SEEKABLE],Er=["Enter"," "],_r=(e,{timesSep:t=" / "}={})=>{var r,n,i,s;const a=e.hasAttribute(yr.REMAINING),o=e.hasAttribute(yr.SHOW_DURATION),l=null!=(r=e.mediaCurrentTime)?r:0,[,c]=null!=(n=e.mediaSeekable)?n:[],d=null!=(s=null!=(i=e.mediaDuration)?i:c)?s:0,u=$(a?0-(d-l):l);return o?`${u}${t}${$(d)}`:u};class wr extends dr{constructor(){var e,t,r,n;super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,mr,void 0),e=this,t=mr,r=this.shadowRoot.querySelector("slot"),gr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),vr(this,mr).innerHTML=`${_r(this)}`;const{style:i}=G(this.shadowRoot,":host:not([notoggle])");i.setProperty("cursor","pointer");const{style:s}=G(this.shadowRoot,":host(:hover:not([notoggle]))");s.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...br,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",M.PLAYBACK_TIME());const e=t=>{const{key:r}=t;Er.includes(r)?this.toggleTimeDisplay():this.removeEventListener("keyup",e)};this.addEventListener("keydown",(t=>{const{metaKey:r,altKey:n,key:i}=t;r||n||!Er.includes(i)?this.removeEventListener("keyup",e):this.addEventListener("keyup",e)})),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){br.includes(e)?this.update():"disabled"===e&&r!==t&&(null==r?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return K(this,yr.REMAINING)}set remaining(e){z(this,yr.REMAINING,e)}get showDuration(){return K(this,yr.SHOW_DURATION)}set showDuration(e){z(this,yr.SHOW_DURATION,e)}get noToggle(){return K(this,yr.NO_TOGGLE)}set noToggle(e){z(this,yr.NO_TOGGLE,e)}get mediaDuration(){return q(this,S.MEDIA_DURATION)}set mediaDuration(e){W(this,S.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,S.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){W(this,S.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){const e=this.getAttribute(S.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(S.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(S.MEDIA_SEEKABLE)}update(){const e=_r(this);(e=>{var t;const r=e.mediaCurrentTime,[,n]=null!=(t=e.mediaSeekable)?t:[],i=e.mediaDuration||n;if(null==r||null==i)return void e.setAttribute("aria-valuetext","video not loaded, unknown time.");const s=e.hasAttribute(yr.REMAINING),a=e.hasAttribute(yr.SHOW_DURATION),o=j(s?0-(i-r):r);if(!a)return void e.setAttribute("aria-valuetext",o);const l=`${o} of ${j(i)}`;e.setAttribute("aria-valuetext",l)})(this),e!==vr(this,mr).innerHTML&&(vr(this,mr).innerHTML=e)}}mr=new WeakMap,te.customElements.get("media-time-display")||te.customElements.define("media-time-display",wr);const Tr=re.createElement("template");Tr.innerHTML='\n <style>\n :host([aria-checked="true"]) slot[name=off] {\n display: none !important;\n }\n\n \n :host(:not([aria-checked="true"])) slot[name=on] {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="on"><svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79
10 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>\n</svg></slot>\n <slot name="off"><svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>\n</svg></slot>\n </slot>\n';const Sr=e=>{e.setAttribute("aria-checked",Qe(e))},Ar=(e,t)=>{const r=e.getAttribute(t);return r?qe(r):[]},kr=(e,t,r)=>{if(!(null==r?void 0:r.length))return void e.removeAttribute(t);const n=Ke(r);e.getAttribute(t)!==n&&e.setAttribute(t,n)};class xr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_SUBTITLES_LIST,S.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Tr,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",M.CLOSED_CAPTIONS()),Sr(this)}attributeChangedCallback(e,t,r){e===S.MEDIA_SUBTITLES_SHOWING&&Sr(this),super.attributeChangedCallback(e,t,r)}get mediaSubtitlesList(){return Ar(this,S.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){kr(this,S.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Ar(this,S.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){kr(this,S.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){Ze(this)}}te.customElements.get("media-captions-button")||te.customElements.define("media-captions-button",xr);function Lr(e){const t=Math.abs(e.seekOffset),r=N.SEEK_BACK_N_SECS({seekOffset:t});e.setAttribute("aria-label",r)}function Ir(e){const t=((e,t)=>((e,t)=>{const r=`slot[name="${t}"]`,n=e.shadowRoot.querySelector(r);return n?n.children:[]})(e,t)[0])(e,"icon");((e,t,r=".value")=>{const n=e.querySelector(r);n&&(n.textContent=t)})(t,e.seekOffset)}const Rr="seekoffset",Dr=re.createElement("template");Dr.innerHTML='\n <slot name="icon"><svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">30</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg></slot>\n';class Cr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_CURRENT_TIME,Rr]}constructor(e={}){super({slotTemplate:Dr,...e})}connectedCallback(){Lr(this),Ir(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===Rr&&(Ir(this),Lr(this)),super.attributeChangedCallback(e,t,r)}get seekOffset(){return q(this,Rr,30)}set seekOffset(e){W(this,Rr,e)}get mediaCurrentTime(){return q(this,S.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){W(this,S.MEDIA_CURRENT_TIME,e)}handleClick(){const e=this.mediaCurrentTime+this.seekOffset,t=new te.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}}te.customElements.get("media-seek-forward-button")||te.customElements.define("media-seek-forward-button",Cr);const Pr=re.createElement("template");Pr.innerHTML=`\n <style>\n :host([${S.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]):not([name=icon]) {\n display: none !important;\n }\n\n \n :host(:not([${S.MEDIA_IS_FULLSCREEN}])) slot:not([name=enter]):not([name=icon]) {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter"><svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>\n</svg></slot>\n <slot name="exit"><svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>\n</svg></slot>\n </slot>\n`;const Or=e=>{const t=e.mediaIsFullscreen?N.EXIT_FULLSCREEN():N.ENTER_FULLSCREEN();e.setAttribute("aria-label",t)};class Mr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_IS_FULLSCREEN,S.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Pr,...e})}connectedCallback(){Or(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===S.MEDIA_IS_FULLSCREEN&&Or(this),super.attributeChangedCallback(e,t,r)}get mediaFullscreenUnavailable(){return Y(this,S.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){X(this,S.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return K(this,S.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){z(this,S.MEDIA_IS_FULLSCREEN,e)}handleClick(){const e=this.mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new te.CustomEvent(e,{composed:!0,bubbles:!0}))}}te.customElements.get("media-fullscreen-button")||te.customElements.define("media-fullscreen-button",Mr);const{MEDIA_TIME_IS_LIVE:Nr,MEDIA_PAUSED:Fr}=S,{MEDIA_SEEK_TO_LIVE_REQUEST:Ur,MEDIA_PLAY_REQUEST:Br}=b,jr=re.createElement("template");jr.innerHTML=`\n <style>\n\n slot[name=indicator] > *,\n :host ::slotted([slot=indicator]) {\n \n min-width: auto;\n fill: var(--media-live-button-icon-color, rgb(140, 140, 140));\n color: var(--media-live-button-icon-color, rgb(140, 140, 140));\n }\n\n :host([${Nr}]:not([${Fr}])) slot[name=indicator] > *,\n :host([${Nr}]:not([${Fr}])) ::slotted([slot=indicator]) {\n fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n color: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n }\n\n :host([${Nr}]:not([${Fr}
1])) {\n cursor: not-allowed;\n }\n\n </style>\n\n <slot name="indicator"><svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg></slot>\n \n <slot name="spacer"> </slot><slot name="text">LIVE</slot>\n`;class $r extends pe{static get observedAttributes(){return[...super.observedAttributes,Fr,Nr]}constructor(e={}){super({slotTemplate:jr,...e}),this.setAttribute("aria-label",N.SEEK_LIVE())}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),this.mediaPaused||!this.mediaTimeIsLive?(this.setAttribute("aria-label",N.SEEK_LIVE()),this.removeAttribute("aria-disabled")):(this.setAttribute("aria-label",N.PLAYING_LIVE()),this.setAttribute("aria-disabled","true"))}get mediaPaused(){return K(this,S.MEDIA_PAUSED)}set mediaPaused(e){z(this,S.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return K(this,S.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){z(this,S.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new te.CustomEvent(Ur,{composed:!0,bubbles:!0})),this.hasAttribute(Fr)&&this.dispatchEvent(new te.CustomEvent(Br,{composed:!0,bubbles:!0})))}}te.customElements.get("media-live-button")||te.customElements.define("media-live-button",$r);const{MEDIA_VOLUME_LEVEL:Vr}=S,Hr='<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>\n</svg>',Gr=re.createElement("template");Gr.innerHTML=`\n <style>\n \n :host(:not([${Vr}])) slot:not([name=high]):not([name=icon]), \n :host([${Vr}=high]) slot:not([name=high]):not([name=icon]) {\n display: none !important;\n }\n\n :host([${Vr}=off]) slot:not([name=off]):not([name=icon]) {\n display: none !important;\n }\n\n :host([${Vr}
1=low]) slot:not([name=low]):not([name=icon]) {\n display: none !important;\n }\n\n :host([${Vr}=medium]) slot:not([name=medium]):not([name=icon]) {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="off"><svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>\n</svg></slot>\n <slot name="low">${Hr}</slot>\n <slot name="medium">${Hr}</slot>\n <slot name="high"><svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>\n</svg></slot>\n </slot>\n`;const qr=e=>{const t="off"===e.mediaVolumeLevel?N.UNMUTE():N.MUTE();e.setAttribute("aria-label",t)};class Wr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:Gr,...e})}connectedCallback(){qr(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===S.MEDIA_VOLUME_LEVEL&&qr(this),super.attributeChangedCallback(e,t,r)}get mediaVolumeLevel(){return Y(this,S.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){X(this,S.MEDIA_VOLUME_LEVEL,e)}handleClick(){const e="off"===this.mediaVolumeLevel?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new te.CustomEvent(e,{composed:!0,bubbles:!0}))}}te.customElements.get("media-mute-button")||te.customElements.define("media-mute-button",Wr);const Kr='<svg aria-hidden="true" viewBox="0 0 28 24">\n <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>\n</svg>',zr=re.createElement("template");zr.innerHTML=`\n <style>\n :host([${S.MEDIA_IS_PIP}]) slot:not([name=exit]):not([name=icon]) {\n display: none !important;\n }\n\n \n :host(:not([${S.MEDIA_IS_PIP}])) slot:not([name=enter]):not([name=icon]) {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter">${Kr}</slot>\n <slot name="exit">${Kr}</slot>\n </slot>\n`;const Yr=e=>{const t=e.mediaIsPip?N.EXIT_PIP():N.ENTER_PIP();e.setAttribute("aria-label",t)};class Xr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_IS_PIP,S.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:zr,...e})}connectedCallback(){Yr(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===S.MEDIA_IS_PIP&&Yr(this),super.attributeChangedCallback(e,t,r)}get mediaPipUnavailable(){return Y(this,S.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){X(this,S.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return K(this,S.MEDIA_IS_PIP)}set mediaIsPip(e){z(this,S.MEDIA_IS_PIP,e)}handleClick(){const e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new te.CustomEvent(e,{composed:!0,bubbles:!0}))}}te.customElements.get("media-pip-button")||te.customElements.define("media-pip-button",Xr);const Qr=re.createElement("template");Qr.innerHTML=`\n <style>\n :host([${S.MEDIA_PAUSED}]) slot[name=pause] {\n display: none !important;\n }\n\n :host(:not([${S.MEDIA_PAUSED}])) slot[name=play] {\n display: none !important;\n }\n </style>\n\n <slot name="icon">\n <slot name="play"><svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="m6 21 15-9L6 3v18Z"/>\n</svg></slot>\n <slot name="pause"><svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>\n</svg></slot>\n </slot>\n`;const Zr=e=>{const t=e.mediaPaused?N.PLAY():N.PAUSE();e.setAttribute("aria-label",t)};class Jr extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_PAUSED,S.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Qr,...e})}connectedCallback(){Zr(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===S.MEDIA_PAUSED&&Zr(this),super.attributeChangedCallback(e,t,r)}get mediaPaused(){return K(this,S.MEDIA_PAUSED)}set mediaPaused(e){z(this,S.MEDIA_PAUSED,e)}handleClick(){const e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new te.CustomEvent(e,{composed:!0,bubbles:!0}))}}te.customElements.get("media-play-button")||te.customElements.define("media-play-button",Jr);var en,tn=(e,t,r)=>(((e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)})(e,t,"read from private field"),r?r.call(e):t.get(e));const rn="rates",nn=[1,1.25,1.5,1.75,2],sn=re.createElement("template");sn.innerHTML='\n <span id="container"></span>\n';class an extends pe{constructor(e={}){super({slotTemplate:sn,...e}),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,en,new Ve(this,rn,{defaultValue:nn})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML="1x"}static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_PLAYBACK_RATE,rn]}attributeChangedCallback(e,t,r){if(e===rn&&(tn(this,en).value=r),e===S.MEDIA_PLAYBACK_RATE){const e=r?+r:Number.NaN,t=Number.isNaN(e)?1:e;return this.container.innerHTML=`${t}x`,void this.setAttribute("aria-label",M.PLAYBACK_RATE({playbackRate:t}))}super.attributeChangedCallback(e,t,r)}get rates(){return tn(this,en)}set rates(e){e?Array.isArray(e)&&(tn(this,en).value=e.join(" ")):tn(this,en).value=""}get mediaPlaybackRate(){return q(this,S.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){W(this,S.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;const r=Array.from(this.rates.values(),(e=>+e)).sort(),n=null!=(t=null!=(e=r.find((e=>e>this.mediaPlaybackRate)))?e:r[0])?t:1,i=new te.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(i)}}en=new WeakMap,te.customElements.get("media-playback-rate-button")||te.customElements.define("media-playback-rate-button",an);const on="placeholdersrc",ln="src",cn=re.createElement("template");cn.innerHTML='\n <style>\n :host {\n pointer-events: none;\n display: var(--media-poster-image-display, inline-block);\n box-sizing: border-box;\n }\n\n img {\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n min-height: 100%;\n background-repeat: no-repeat;\n background-position: var(--media-poster-image-background-position, var(--media-object-position, center));\n background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, center);\n }\n </style>\n\n <img aria-hidden="true" id="image"/>\n';class dn extends te.HTMLElement{static get observedAttributes(){return[on,ln]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}
1),this.shadowRoot.appendChild(cn.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===ln&&(null==r?this.image.removeAttribute(ln):this.image.setAttribute(ln,r)),e===on&&(null==r?this.image.style.removeProperty("background-image"):((e,t)=>{e.style["background-image"]=`url('${t}')`})(this.image,r))}get placeholderSrc(){return Y(this,on)}set placeholderSrc(e){X(this,ln,e)}get src(){return Y(this,ln)}set src(e){X(this,ln,e)}}te.customElements.get("media-poster-image")||te.customElements.define("media-poster-image",dn);const un="seekoffset",hn=re.createElement("template");hn.innerHTML='\n <slot name="icon"><svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">30</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg></slot>\n';class fn extends pe{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_CURRENT_TIME,un]}constructor(e={}){super({slotTemplate:hn,...e})}connectedCallback(){Lr(this),Ir(this),super.connectedCallback()}attributeChangedCallback(e,t,r){e===un&&(Ir(this),Lr(this)),super.attributeChangedCallback(e,t,r)}get seekOffset(){return q(this,un,30)}set seekOffset(e){W(this,un,e)}get mediaCurrentTime(){return q(this,S.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){W(this,S.MEDIA_CURRENT_TIME,e)}handleClick(){const e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new te.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}}te.customElements.get("media-seek-backward-button")||te.customElements.define("media-seek-backward-button",fn);var pn,mn=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},gn=(e,t,r)=>(mn(e,t,"read from private field"),r?r.call(e):t.get(e));class vn extends dr{constructor(){var e,t,r,n;super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,pn,void 0),e=this,t=pn,r=this.shadowRoot.querySelector("slot"),mn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),gn(this,pn).textContent=$(0)}static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){e===S.MEDIA_PREVIEW_TIME&&null!=r&&(gn(this,pn).textContent=$(r)),super.attributeChangedCallback(e,t,r)}get mediaPreviewTime(){return q(this,S.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){W(this,S.MEDIA_PREVIEW_TIME,e)}}pn=new WeakMap,te.customElements.get("media-preview-time-display")||te.customElements.define("media-preview-time-display",vn);var yn,bn=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},En=(e,t,r)=>(bn(e,t,"read from private field"),r?r.call(e):t.get(e)),_n=(e,t,r,n)=>(bn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const wn=re.createElement("template");wn.innerHTML='\n <style>\n :host {\n box-sizing: border-box;\n display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));\n overflow: hidden;\n }\n\n img {\n display: none;\n position: relative;\n }\n </style>\n <img crossorigin loading="eager" decoding="async">\n';class Tn extends te.HTMLElement{constructor(){super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,yn,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wn.content.cloneNode(!0)))}static get observedAttributes(){return[_,S.MEDIA_PREVIEW_IMAGE,S.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;const n=this.getAttribute(_);n&&(_n(this,yn,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=En(this,yn))?void 0:t.associateElement)||r.call(t,this))}disconnectedCallback(){var e,t;null==(t=null==(e=En(this,yn))?void 0:e.unassociateElement)||t.call(e,this),_n(this,yn,null)}attributeChangedCallback(e,t,r){var n,i,s,a,o;[S.MEDIA_PREVIEW_IMAGE,S.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===_&&(t&&(null==(i=null==(n=En(this,yn))?void 0:n.unassociateElement)||i.call(n,this),_n(this,yn,null)),r&&(_n(this,yn,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=En(this,yn))?void 0:a.associateElement)||o.call(a,this)))}get mediaPreviewImage(){return Y(this,S.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){X(this,S.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){const e=this.getAttribute(S.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map((e=>+e))}set mediaPreviewCoords(e){e?this.setAttribute(S.MEDIA_PREVIEW_COORDS,e.join(" ")):this.removeAttribute(S.MEDIA_PREVIEW_COORDS)}update(){const e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!e||!t)return;const[r,n,i,s]=e,a=t.split("#")[0],o=getComputedStyle(this),{maxWidth:l,maxHeight:c,minWidth:d,minHeight:u}=o,h=Math.min(parseInt(l)/i,parseInt(c)/s),f=Math.max(parseInt(d)/i,parseInt(u)/s),p=h<1,m=p?h:f>1?f:1,{style:g}=G(this.shadowRoot,":host"),v=G(this.shadowRoot,"img").style,y=this.shadowRoot.querySelector("img"),b=p?"min":"max";g.setProperty(`${b}-width`,"initial","important"),g.setProperty(`${b}-height`,"initial","important"),g.width=i*m+"px",g.height=s*m+"px";const E=()=>{v.width=this.imgWidth*m+"px",v.height=this.imgHeight*m+"px",v.display="block"};y.src!==a&&(y.onload=()=>
1{this.imgWidth=y.naturalWidth,this.imgHeight=y.naturalHeight,E()},y.src=a,E()),E(),v.transform=`translate(-${r*m}px, -${n*m}px)`}}yn=new WeakMap,te.customElements.get("media-preview-thumbnail")||te.customElements.define("media-preview-thumbnail",Tn);var Sn,An,kn,xn,Ln,In,Rn,Dn,Cn,Pn,On,Mn,Nn,Fn,Un,Bn,jn,$n,Vn,Hn,Gn,qn=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Wn=(e,t,r)=>(qn(e,t,"read from private field"),r?r.call(e):t.get(e)),Kn=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},zn=(e,t,r,n)=>(qn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Yn=(e,t,r)=>(qn(e,t,"access private method"),r);const Xn=e=>{const t=e.range,r=j(+t.value),n=j(+t.max),i=r&&n?`${r} of ${n}`:"video not loaded, unknown time.";t.setAttribute("aria-valuetext",i)},Qn=re.createElement("template");Qn.innerHTML=`\n <style>\n :host {\n --media-preview-border-radius: 3px;\n --media-box-padding-left: 10px;\n --media-box-padding-right: 10px;\n }\n\n #preview-rail,\n #current-rail {\n \n width: 1%;\n position: absolute;\n left: 0;\n bottom: 100%;\n pointer-events: none;\n }\n\n [part~="box"] {\n \n position: absolute;\n bottom: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n transform: translateX(-50%);\n }\n\n [part~="preview-box"] {\n transition-property: var(--media-preview-transition-property, visibility, opacity);\n transition-duration: var(--media-preview-transition-duration-out, .25s);\n transition-delay: var(--media-preview-transition-delay-out, 0s);\n visibility: hidden;\n opacity: 0;\n }\n\n :host([${S.MEDIA_PREVIEW_IMAGE}]:hover) [part~="preview-box"],\n :host([${S.MEDIA_PREVIEW_TIME}]:hover) [part~="preview-box"] {\n transition-duration: var(--media-preview-transition-duration-in, .5s);\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n opacity: 1;\n }\n\n media-preview-thumbnail,\n ::slotted(media-preview-thumbnail) {\n visibility: hidden;\n \n transition: visibility 0s .25s;\n transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n background: var(--media-preview-thumbnail-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));\n box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));\n max-width: var(--media-preview-thumbnail-max-width, 180px);\n max-height: var(--media-preview-thumbnail-max-height, 160px);\n min-width: var(--media-preview-thumbnail-min-width, 120px);\n min-height: var(--media-preview-thumbnail-min-height, 80px);\n border: var(--media-preview-thumbnail-border);\n border-radius: var(--media-preview-thumbnail-border-radius,\n var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);\n }\n\n :host([${S.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,\n :host([${S.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n }\n\n media-preview-time-display,\n ::slotted(media-preview-time-display) {\n min-width: 0;\n \n transition: min-width 0s, border-radius 0s;\n transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n background: var(--media-preview-time-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));\n border-radius: var(--media-preview-time-border-radius,\n var(--media-preview-border-radius) var(--media-preview-border-radius)\n var(--media-preview-border-radius) var(--media-preview-border-radius));\n padding: var(--media-preview-time-padding, 1px 10px 0);\n margin: var(--media-preview-time-margin, 0 0 10px);\n text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));\n }\n\n :host([${S.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,\n :host([${S.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n min-width: 100%;\n border-radius: var(--media-preview-time-border-radius,\n 0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));\n }\n\n :host([${S.MEDIA_PREVIEW_TIME}]:hover) {\n --media-time-range-hover-display: block;\n }\n </style>\n <div id="preview-rail">\n <slot name="preview" part="box preview-box">
1\n <media-preview-thumbnail></media-preview-thumbnail>\n <media-preview-time-display></media-preview-time-display>\n </slot>\n </div>\n <div id="current-rail">\n <slot name="current" part="box current-box">\n \n </slot>\n </div>\n`;class Zn extends Zt{constructor(){super(),Kn(this,In),Kn(this,Dn),Kn(this,Pn),Kn(this,$n),Kn(this,Hn),Kn(this,Sn,void 0),Kn(this,An,void 0),Kn(this,kn,void 0),Kn(this,xn,void 0),Kn(this,Ln,void 0),Kn(this,Mn,(e=>{if([...Wn(this,Sn)].some((t=>e.composedPath().includes(t))))return;this.updatePointerBar(e);const t=this.mediaDuration;if(!t)return;const r=this.range.getBoundingClientRect();let n=(e.clientX-r.left-this.thumbWidth/2)/(r.width-this.thumbWidth);n=Math.max(0,Math.min(1,n));const i=Yn(this,Pn,On).call(this,Wn(this,An),n),{style:s}=G(this.shadowRoot,"#preview-rail");s.transform=`translateX(${i})`;const a=n*t,o=new te.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(o)})),Kn(this,Nn,!1),Kn(this,Fn,(e=>{e.composedPath().includes(this)&&![...Wn(this,Sn)].some((t=>e.composedPath().includes(t)))||(te.removeEventListener("pointermove",Wn(this,Fn)),zn(this,Nn,!1),Wn(this,Bn).call(this))})),Kn(this,Un,(()=>{te.addEventListener("pointermove",Wn(this,Mn),!1)})),Kn(this,Bn,(()=>{te.removeEventListener("pointermove",Wn(this,Mn));const e=new te.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(e)})),Kn(this,jn,(()=>{const e=this.getAttribute(S.MEDIA_DURATION);!Wn(this,Nn)&&e&&(zn(this,Nn,!0),Wn(this,Un).call(this),te.addEventListener("pointermove",Wn(this,Fn),!1))})),this.container.appendChild(Qn.content.cloneNode(!0)),this.range.addEventListener("input",(()=>{cancelAnimationFrame(this._refreshId);const e=this.range.value,t=new te.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})),this._refreshBar=()=>{const e=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+e*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},zn(this,Sn,this.shadowRoot.querySelectorAll('[part~="box"]')),zn(this,An,this.shadowRoot.querySelector('[part~="preview-box"]')),zn(this,kn,this.shadowRoot.querySelector('[part~="current-box"]'));const e=getComputedStyle(this);zn(this,xn,parseInt(e.getPropertyValue("--media-box-padding-left"))),zn(this,Ln,parseInt(e.getPropertyValue("--media-box-padding-right"))),Yn(this,$n,Vn).call(this)}static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_PAUSED,S.MEDIA_DURATION,S.MEDIA_SEEKABLE,S.MEDIA_CURRENT_TIME,S.MEDIA_PREVIEW_IMAGE,S.MEDIA_PREVIEW_TIME,S.MEDIA_BUFFERED,S.MEDIA_PLAYBACK_RATE,S.MEDIA_LOADING,S.MEDIA_ENDED]}connectedCallback(){this.range.setAttribute("aria-label",M.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,r){var n,i,s,a,o;e!==S.MEDIA_CURRENT_TIME&&e!==S.MEDIA_PAUSED&&e!==S.MEDIA_ENDED&&e!==S.MEDIA_LOADING||(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Xn(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),this.mediaPaused||this.mediaLoading||(this._refreshId=requestAnimationFrame(this._refreshBar))),e===S.MEDIA_DURATION&&(this.range.max=null!=(i=null!=(n=Wn(this,In,Rn))?n:this.mediaDuration)?i:1e3,Xn(this),this.updateBar(),this.updateCurrentBox()),e===S.MEDIA_SEEKABLE&&(this.range.min=null!=(s=Wn(this,Dn,Cn))?s:0,this.range.max=null!=(o=null!=(a=Wn(this,In,Rn))?a:this.mediaDuration)?o:1e3,Xn(this),this.updateBar()),e===S.MEDIA_BUFFERED&&this.updateBar(),"disabled"===e&&(null==r?Yn(this,$n,Vn).call(this):Yn(this,Hn,Gn).call(this)),super.attributeChangedCallback(e,t,r)}get mediaPaused(){return K(this,S.MEDIA_PAUSED)}set mediaPaused(e){z(this,S.MEDIA_PAUSED,e)}get mediaLoading(){return K(this,S.MEDIA_LOADING)}set mediaLoading(e){z(this,S.MEDIA_LOADING,e)}get mediaDuration(){return q(this,S.MEDIA_DURATION)}set mediaDuration(e){W(this,S.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,S.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){W(this,S.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return q(this,S.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){W(this,S.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){const e=this.getAttribute(S.MEDIA_BUFFERED);return e?e.split(" ").map((e=>e.split(":").map((e=>+e)))):[]}set mediaBuffered(e){if(!e)return void this.removeAttribute(S.MEDIA_BUFFERED);const t=e.map(((e,t)=>`${e}:${t}`)).join(" ");this.setAttribute(S.MEDIA_BUFFERED,t)}get mediaSeekable(){const e=this.getAttribute(S.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(S.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(S.MEDIA_SEEKABLE)}get mediaPreviewImage(){return Y(this,S.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){X(this,S.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return q(this,S.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){W(this,S.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return K(this,S.MEDIA_ENDED)}set mediaEnded(e){z(this,S.MEDIA_ENDED,e)}getRelativeValues(){const e=super.getRelativeValues();return this.mediaEnded?{...e,relativeValue:e.relativeMax}:e}getBarColors(){var e;let t=super.getBarColors();const{range:r}=this,n=r.max-r.min,i=this.mediaBuffered;if(!i.length||!Number.isFinite(n)||n<=0)return t;let s;if(this.mediaEnded)s=n;else{const t=this.mediaCurrentTime,[,n=r.min]=null!=(e=i.find((([e,r])=>e<=t&&t<=r)))?e:[];s=n-r.min}const a=s/n*100;return t.splice(1,0,["var(--media-time-range-buffered-color, rgb(255 255 255 / .4))",a]),t}updateCurrentBox(){if(!Wn(this,kn).assignedElements().length)return;const e=this.range.value/(this.range.max-this.range.min),t=Yn(this,Pn,On).call(this,Wn(this,kn),e),{style:r}=G(this.shadowRoot,"#current-rail");r.transform=`translateX(${t})`}}Sn=new WeakMap,An=new WeakMap,kn=new WeakMap,xn=new WeakMap,Ln=new WeakMap,In=new WeakSet,Rn=function(){var e;const[,t]=null!=(e=this.mediaSeekable)?e:[];return t},Dn=new WeakSet,Cn=function(){var e;const[t]=null!=(e=this.mediaSeekable)?e:[];return t},Pn=new WeakSet,On=function(e,t){var r;let n=100*t*100+"%";const i=e.offsetWidth;if(!i)return n;const s=null!=(r=this.getAttribute("bounds")?H(this,`#${this.getAttribute("bounds")}`):this.parentElement)?r:this,a=this.range.getBoundingClientRect(),o=s.getBoundingClientRect(),l=(Wn(this,xn)-(a.left-o.left-i/2))/a.width*100,c=(o.right-a.left-i/2-Wn(this,Ln))/a.width*100;return Number.isNaN(l)||(n=`max(${100*l}%, ${n})`),Number.isNaN(c)||(n=`min(${n}, ${100*c}%)`),n},Mn=new WeakMap,Nn=new WeakMap,Fn=new WeakMap,Un=new WeakMap,Bn=new WeakMap,jn=new WeakMap,$n=new WeakSet,Vn=function(){this.addEventListener("pointermove",Wn(this,jn),!1)},Hn=new WeakSet,Gn=function(){te.removeEventListener("pointermove",Wn(this,Fn)),this.removeEventListener("pointermove",Wn(this,jn)),zn(this,Nn,!1),Wn(this,Bn).call(this)},te.customElements.get("media-time-range")||te.customElements.define("media-time-range",Zn);var Jn,ei,ti,ri=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ni=(e,t,r)=>(ri(e,t,"read from private field"),r?r.call(e):t.get(e)),ii=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},si=(e,t,r,n)=>(ri(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const ai="loadingdelay",oi=re.createElement("template");oi.innerHTML=`\n<style>\n:host {\n display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));\n vertical-align: middle;\n box-sizing: border-box;\n --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, 500ms);\n}\n\n#status {\n color: rgba(0,0,0,0);\n width: 0px;\n height: 0px;\n}\n\n:host slot[name=icon] > *,\n:host ::slotted([slot=icon]) {\n opacity: var(--media-loading-indicator-opacity, 0);\n transition: opacity 0.15s;\n}\n\n:host([${S.MEDIA_LOADING}]:not([${S.MEDIA_PAUSED}])) slot[name=icon] > *,\n:host([${S.MEDIA_LOADING}]:not([${S.MEDIA_PAUSED}])) ::slotted([slot=icon]) {\n opacity: var(--media-loading-indicator-opacity, 1);\n transition: opacity 0.15s var(--_loading-indicator-delay);\n}\n\n:host #status {\n visibility: var(--media-loading-indicator-opacity, hidden);\n transition: visibility 0.15s;\n}\n\n:host([${S.MEDIA_LOADING}]:not([${S.MEDIA_PAUSED}])) #status {\n visibility: var(--media-loading-indicator-opacity, visible);\n transition: visibility 0.15s var(--_loading-indicator-delay);\n}\n\nsvg, img, ::slotted(svg), ::slotted(img) {\n width: var(--media-loading-indicator-icon-width);\n height: var(--media-loading-indicator-icon-height, 100px);\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n vertical-align: middle;\n}\n</style>\n\n<slot name="icon">\n<svg aria-hidden="true" viewBox="0 0 100 100">\n <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">\n <animateTransform\n attributeName="transform"\n attributeType="XML"\n type="rotate"\n dur="1s"\n from="0 50 50"\n to="360 50 50"\n repeatCount="indef
1inite" />\n </path>\n</svg>\n</slot>\n<div id="status" role="status" aria-live="polite">${M.MEDIA_LOADING()}</div>\n`;class li extends te.HTMLElement{constructor(){if(super(),ii(this,Jn,void 0),ii(this,ei,500),ii(this,ti,void 0),!this.shadowRoot){const e=this.attachShadow({mode:"open"}),t=oi.content.cloneNode(!0);e.appendChild(t)}const{style:e}=G(this.shadowRoot,":host");si(this,ti,e)}static get observedAttributes(){return[_,S.MEDIA_PAUSED,S.MEDIA_LOADING,ai]}attributeChangedCallback(e,t,r){var n,i,s,a,o;e===ai&&t!==r?this.loadingDelay=Number(r):e===_&&(t&&(null==(i=null==(n=ni(this,Jn))?void 0:n.unassociateElement)||i.call(n,this),si(this,Jn,null)),r&&(si(this,Jn,null==(s=this.getRootNode())?void 0:s.getElementById(r)),null==(o=null==(a=ni(this,Jn))?void 0:a.associateElement)||o.call(a,this)))}connectedCallback(){var e,t,r;const n=this.getAttribute(_);n&&(si(this,Jn,null==(e=this.getRootNode())?void 0:e.getElementById(n)),null==(r=null==(t=ni(this,Jn))?void 0:t.associateElement)||r.call(t,this))}disconnectedCallback(){var e,t;null==(t=null==(e=ni(this,Jn))?void 0:e.unassociateElement)||t.call(e,this),si(this,Jn,null)}get loadingDelay(){return ni(this,ei)}set loadingDelay(e){si(this,ei,e),ni(this,ti).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return K(this,S.MEDIA_PAUSED)}set mediaPaused(e){z(this,S.MEDIA_PAUSED,e)}get mediaLoading(){return K(this,S.MEDIA_LOADING)}set mediaLoading(e){z(this,S.MEDIA_LOADING,e)}}Jn=new WeakMap,ei=new WeakMap,ti=new WeakMap,te.customElements.get("media-loading-indicator")||te.customElements.define("media-loading-indicator",li);class ci extends Zt{static get observedAttributes(){return[...super.observedAttributes,S.MEDIA_VOLUME,S.MEDIA_MUTED,S.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=100,this.range.addEventListener("input",(()=>{const e=this.range.value/this.range.max,t=new te.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}))}connectedCallback(){this.range.setAttribute("aria-label",M.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,r){if(e===S.MEDIA_VOLUME||e===S.MEDIA_MUTED){const e=(n=this).mediaMuted?0:Math.round(n.mediaVolume*n.range.max);this.range.value=e,this.range.setAttribute("aria-valuetext",(({value:e,max:t})=>`${Math.round(e/t*100)}%`)(this.range)),this.updateBar()}var n;super.attributeChangedCallback(e,t,r)}
1get mediaVolume(){return q(this,S.MEDIA_VOLUME,1)}set mediaVolume(e){W(this,S.MEDIA_VOLUME,e)}get mediaMuted(){return K(this,S.MEDIA_MUTED)}set mediaMuted(e){z(this,S.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return Y(this,S.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){X(this,S.MEDIA_VOLUME_UNAVAILABLE,e)}}te.customElements.get("media-volume-range")||te.customElements.define("media-volume-range",ci);const di={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox"},ui=(e={})=>Object.entries(e).reduce(((e,[t,r])=>{const n=((e,t)=>di[e]?di[e]:void 0==typeof t||"boolean"===typeof t&&!t?void 0:/[A-Z]/.test(e)?e.toLowerCase():e)(t,r);if(!n)return e;const i=((e,t)=>"boolean"===typeof e?"":Array.isArray(e)?e.join(" "):e)(r);return e[n]=i,e}),{}),hi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-chrome-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-airplay-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-cast-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-gesture-receiver",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-controller",ui({...t,ref:r}),...e)))),fi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-chrome-range",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-control-bar",ui({...t,ref:r}),...e)))),pi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-text-display",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-duration-display",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-time-display",ui({...t,ref:r}),...e)))),mi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-captions-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-seek-forward-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-fullscreen-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-live-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-mute-button",ui({...t,ref:r}),...e)))),gi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-pip-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-play-button",ui({...t,ref:r}),...e)))),vi=(a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-playback-rate-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-poster-image",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-seek-backward-button",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-preview-time-display",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-preview-thumbnail",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-time-range",ui({...t,ref:r}),...e))));a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-loading-indicator",ui({...t,ref:r}),...e))),a.forwardRef((({children:e=[],...t},r)=>a.createElement("media-volume-range",ui({...t,ref:r}),...e)));var yi,bi;function Ei(){return Ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ei.apply(this,arguments)}var _i=e=>a.createElement("svg",Ei({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"XX_ARC_Play_White_svg__Layer_1",x:0,y:0,style:{enableBackground:"new 0 0 767.3 908.6"},viewBox:"0 0 767.3 908.6"},e),yi||(yi=a.createElement("style",null,".XX_ARC_Play_White_svg__st0{fill:#fff}")),bi||(bi=a.createElement("g",{id:"XX_ARC_Play_White_svg__Group_207"},a.createElement("path",{d:"M38.062 908.662c-21 0-38.1-17.1-38.1-38.1v-832.5c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v832.4c.1 21.1-17 38.2-38.1 38.2zM176.362 831.762c-21 0-38.1-17.1-38.1-38.1v-678.7c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v678.7c0 21-17.1 38.1-38.1 38.1zM314.562 754.862c-21 0-38.1-17.1-38.1-38.1v-524.9c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v524.9c0 21.1-17.1 38.1-38.1 38.1zM452.762 677.962c-21 0-38.1-17.1-38.1-38.1v-371.1c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v371.2c0 21-17.1 38-38.1 38zM590.962 601.162c-21 0-38.1-17.1-38.1-38.1v-217.5c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v217.4c0 21.1-17.1 38.2-38.1 38.2zM729.162 524.262c-21 0-38.1-17.1-38.1-38.1v-63.7c0-21 17.1-38.1 38.1-38.1s38.1 17.1 38.1 38.1v63.7c0 21-17.1 38.1-38.1 38.1z",className:"XX_ARC_Play_White_svg__st0"})))),wi=r(50527),Ti=r.n(wi);const Si="white",Ai={"--media-icon-color":Si,"--media-range-thumb-background":Si,"--media-range-bar-color":Si,"--media-range-track-height":"2px","--media-range-thumb-height":"1.333em","--media-range-thumb-width":"1.333em","--media-font-family":'"Grosa Mono", monospace',"--media-font-size":"0.75em","--media-preview-time-display-display":"none",color:Si,width:"100%"},ki=e=>{const{title:t,slug:r,video:i,autoplay:s,autoplayActive:a,classNames:o,setIsPlaying:l}=e;return(0,n.jsx)(d.Z,{className:"".concat(Ti().video," ").concat(o),id:"video-".concat(r),style:{width:"100%",backgroundColor:"var(--background-color)"},playbackId:i.asset.playbackId,slot:"media",poster:"https://image.mux.com/".concat(i.asset.playbackId,"/thumbnail.jpg?thumbtime=").concat(i.asset.thumbTime),metadata:{video_id:r,video_title:t}
1,streamType:"on-demand",controls:!1,loop:s,muted:s,playsInline:s,onPlay:()=>!s&&l(!0),onPause:()=>!s&&l(!1)})};function xi(e){const{title:t,slug:r,video:i,autoplay:s,autoplayActive:o,classNames:l}=e,[c,d]=(0,a.useState)(!1),u=()=>{let e=document.getElementById("video-".concat(r));e&&e.play()},{ref:h,inView:f}=function({threshold:e,delay:t,trackVisibility:r,rootMargin:n,root:i,triggerOnce:s,skip:o,initialInView:l,fallbackInView:c,onChange:d}={}){var u;const[h,f]=a.useState(null),p=a.useRef(),[m,g]=a.useState({inView:!!l,entry:void 0});p.current=d,a.useEffect((()=>{if(o||!h)return;let a;return a=y(h,((e,t)=>{g({inView:e,entry:t}),p.current&&p.current(e,t),t.isIntersecting&&s&&a&&(a(),a=void 0)}),{root:i,rootMargin:n,threshold:e,trackVisibility:r,delay:t},c),()=>{a&&a()}}),[Array.isArray(e)?e.toString():e,h,i,n,s,o,r,c,t]);const v=null==(u=m.entry)?void 0:u.target,b=a.useRef();h||!v||s||o||b.current===v||(b.current=v,g({inView:!!l,entry:void 0}));const E=[f,m.inView,m.entry];return E.ref=E[0],E.inView=E[1],E.entry=E[2],E}({threshold:[0],initialInView:!1,onChange:e=>{e?u():(()=>{let e=document.getElementById("video-".concat(r));e&&e.pause()})()}});return(0,n.jsx)(n.Fragment,{children:s?(0,n.jsx)("div",{ref:h,className:Ti().autoplayWrapper,children:(0,n.jsx)(ki,{title:t,slug:r,video:i,autoplay:s,autoplayActive:o,classNames:l})}):(0,n.jsxs)(hi,{style:Ai,children:[(0,n.jsx)(ki,{title:t,slug:r,video:i,autoplay:s,autoplayActive:o,classNames:l,setIsPlaying:d}),(0,n.jsxs)(fi,{className:"".concat(Ti().mediaControlBar," ").concat(c?Ti().isPlaying:""),children:[(0,n.jsx)(gi,{}),(0,n.jsx)(pi,{disabled:!0,notoggle:!0}),(0,n.jsx)(vi,{}),(0,n.jsx)("div",{className:Ti().mediaTimeRangeProxy,children:(e=>{const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?t.toString()+":":"",s=r.toString(),a=n.toString().padStart(2,"0");return"".concat(i).concat(s,":").concat(a)})(i.asset.data.duration)}),(0,n.jsx)(mi,{})]}),(0,n.jsx)("div",{className:"\n ".concat(Ti().bigPlayButtonWrapper,"\n ").concat(c?Ti().isPlaying:"","\n "),onClick:()=>u(),children:(0,n.jsx)(_i,{className:Ti().bigPlayButton})})]})})}r(76268),r(72048),r(99578);function Li(e){return null!==e&&"object"===typeof e&&"constructor"in e&&e.constructor===Object}function Ii(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach((r=>{"undefined"===typeof e[r]?e[r]=t[r]:Li(t[r])&&Li(e[r])&&Object.keys(t[r]).length>0&&Ii(e[r],t[r])}))}const Ri={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Di(){const e="undefined"!==typeof document?document:{};return Ii(e,Ri),e}const Ci={document:Ri,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"===typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!==typeof setTimeout&&clearTimeout(e)}};function Pi(){const e="undefined"!==typeof window?window:{};return Ii(e,Ci),e}function Oi(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function Mi(){return Date.now()}function Ni(e,t){void 0===t&&(t="x");const r=Pi();let n,i,s;const a=function(e){const t=Pi();let r;return t.getComputedStyle&&(r=t.getComputedStyle(e,null)),!r&&e.currentStyle&&(r=e.currentStyle),r||(r=e.style),r}(e);return r.WebKitCSSMatrix?(i=a.transform||a.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map((e=>e.replace(",","."))).join(", ")),s=new r.WebKitCSSMatrix("none"===i?"":i)):(s=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=s.toString().split(",")),"x"===t&&(i=r.WebKitCSSMatrix?s.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===t&&(i=r.WebKitCSSMatrix?s.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}function Fi(e){return"object"===typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function Ui(e){return"undefined"!==typeof window&&"undefined"!==typeof window.HTMLElement?e instanceof HTMLElement:e&&(1===e.nodeType||11===e.nodeType)}function Bi(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let r=1;r<arguments.length;r+=1){const n=r<0||arguments.length<=r?void 0:arguments[r];if(void 0!==n&&null!==n&&!Ui(n)){const r=Object.keys(Object(n)).filter((e=>t.indexOf(e)<0));for(let t=0,i=r.length;t<i;t+=1){const i=r[t],s=Object.getOwnPropertyDescriptor(n,i);void 0!==s&&s.enumerable&&(Fi(e[i])&&Fi(n[i])?n[i].__swiper__?e[i]=n[i]:Bi(e[i],n[i]):!Fi(e[i])&&Fi(n[i])?(e[i]={},n[i].__swiper__?e[i]=n[i]:Bi(e[i],n[i])):e[i]=n[i])}}}return e}function ji(e,t,r){e.style.setProperty(t,r)}function $i(e){let{swiper:t,targetPosition:r,side:n}=e;const i=Pi(),s=-t.translate;let a,o=null;const l=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const c=r>s?"next":"prev",d=(e,t)=>"next"===c&&e>=t||"prev"===c&&e<=t,u=()=>{a=(new Date).getTime(),null===o&&(o=a);const e=Math.max(Math.min((a-o)/l,1),0),c=.5-Math.cos(e*Math.PI)/2;let h=s+c*(r-s);if(d(h,r)&&(h=r),t.wrapperEl.scrollTo({[n]:h}),d(h,r))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[n]:h})})),void i.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=i.requestAnimationFrame(u)};u()}function Vi(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function Hi(e,t){return void 0===t&&(t=""),[...e.children].filter((e=>e.matches(t)))}function Gi(e,t){void 0===t&&(t=[]);const r=document.createElement(e);return r.classList.add(...Array.isArray(t)?t:[t]),r}function qi(e,t){return Pi().getComputedStyle(e,null).getPropertyValue(t)}function Wi(e){let t,r=e;if(r){for(t=0;null!==(r=r.previousSibling);)1===r.nodeType&&(t+=1);return t}}function Ki(e,t){const r=[];let n=e.parentElement;for(;n;)t?n.matches(t)&&r.push(n):r.push(n),n=n.parentElement;return r}function zi(e,t,r){const n=Pi();return r?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let Yi,Xi,Qi;function Zi(){return Yi||(Yi=function(){const e=Pi(),t=Di();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),Yi}function Ji(e){return void 0===e&&(e={}),Xi||(Xi=function(e){let{userAgent:t}=void 0===e?{}:e;const r=Zi(),n=Pi(),i=n.navigator.platform,s=t||n.navigator.userAgent,a={ios:!1,android:!1},o=n.screen.width,l=n.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/);let d=s.match(/(iPad).*OS\s([\d_]+)/);const u=s.match(/(iPod)(.*OS\s([\d_]+))?/),h=!d&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f="Win32"===i;let p="MacIntel"===i;return!d&&p&&r.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${l}`)>=0&&(d=s.match(/(Version)\/([\d.]+)/),d||(d=[0,1,"13_0_0"]),p=!1),c&&!f&&(a.os="android",a.android=!0),(d||h||u)&&(a.os="ios",a.ios=!0),a}(e)),Xi}function es(){return Qi||(Qi=function(){const e=Pi();let t=!1;function r(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(r()){const r=String(e.navigator.userAgent);if(r.includes("Version/")){const[e,n]=r.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));t=e<16||16===e&&n<2}}return{isSafari:t||r(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWeb
1Kit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),Qi}var ts={on(e,t,r){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!==typeof t)return n;const i=r?"unshift":"push";return e.split(" ").forEach((e=>{n.eventsListeners[e]||(n.eventsListeners[e]=[]),n.eventsListeners[e][i](t)})),n},once(e,t,r){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!==typeof t)return n;function i(){n.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];t.apply(n,s)}return i.__emitterProxy=t,n.on(e,i,r)},onAny(e,t){const r=this;if(!r.eventsListeners||r.destroyed)return r;if("function"!==typeof e)return r;const n=t?"unshift":"push";return r.eventsAnyListeners.indexOf(e)<0&&r.eventsAnyListeners[n](e),r},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const r=t.eventsAnyListeners.indexOf(e);return r>=0&&t.eventsAnyListeners.splice(r,1),t},off(e,t){const r=this;return!r.eventsListeners||r.destroyed?r:r.eventsListeners?(e.split(" ").forEach((e=>{"undefined"===typeof t?r.eventsListeners[e]=[]:r.eventsListeners[e]&&r.eventsListeners[e].forEach(((n,i)=>{(n===t||n.__emitterProxy&&n.__emitterProxy===t)&&r.eventsListeners[e].splice(i,1)}))})),r):r},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,r,n;for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];"string"===typeof s[0]||Array.isArray(s[0])?(t=s[0],r=s.slice(1,s.length),n=e):(t=s[0].events,r=s[0].data,n=s[0].context||e),r.unshift(n);return(Array.isArray(t)?t:t.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(n,[t,...r])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(n,r)}))})),e}};const rs=(e,t)=>{if(!e||e.destroyed||!e.params)return;const r=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(r){const t=r.querySelector(`.${e.params.lazyPreloaderClass}`);t&&t.remove()}},ns=(e,t)=>{if(!e.slides[t])return;const r=e.slides[t].querySelector('[loading="lazy"]');r&&r.removeAttribute("loading")},is=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const r=e.slides.length;if(!r||!t||t<0)return;t=Math.min(t,r);const n="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const r=i,s=[r-t];return s.push(...Array.from({length:t}).map(((e,t)=>r+n+t))),void e.slides.forEach(((t,r)=>{s.includes(t.column)&&ns(e,r)}))}const s=i+n-1;if(e.params.rewind||e.params.loop)for(let a=i-t;a<=s+t;a+=1){const t=(a%r+r)%r;(t<i||t>s)&&ns(e,t)}else for(let a=Math.max(i-t,0);a<=Math.min(s+t,r-1);a+=1)a!==i&&(a>s||a<i)&&ns(e,a)};var ss={updateSize:function(){const e=this;let t,r;const n=e.el;t="undefined"!==typeof e.params.width&&null!==e.params.width?e.params.width:n.clientWidth,r="undefined"!==typeof e.params.height&&null!==e.params.height?e.params.height:n.clientHeight,0===t&&e.isHorizontal()||0===r&&e.isVertical()||(t=t-parseInt(qi(n,"padding-left")||0,10)-parseInt(qi(n,"padding-right")||0,10),r=r-parseInt(qi(n,"padding-top")||0,10)-parseInt(qi(n,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(r)&&(r=0),Object.assign(e,{width:t,height:r,size:e.isHorizontal()?t:r}))},updateSlides:function(){const e=this;function t(t){return e.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function r(e,r){return parseFloat(e.getPropertyValue(t(r))||0)}const n=e.params,{wrapperEl:i,slidesEl:s,size:a,rtlTranslate:o,wrongRTL:l}=e,c=e.virtual&&n.virtual.enabled,d=c?e.virtual.slides.length:e.slides.length,u=Hi(s,`.${e.params.slideClass}, swiper-slide`),h=c?e.virtual.slides.length:u.length;let f=[];const p=[],m=[];let g=n.slidesOffsetBefore;"function"===typeof g&&(g=n.slidesOffsetBefore.call(e));let v=n.slidesOffsetAfter;"function"===typeof v&&(v=n.slidesOffsetAfter.call(e));const y=e.snapGrid.length,b=e.slidesGrid.length;let E=n.spaceBetween,_=-g,w=0,T=0;if("undefined"===typeof a)return;"string"===typeof E&&E.indexOf("%")>=0?E=parseFloat(E.replace("%",""))/100*a:"string"===typeof E&&(E=parseFloat(E)),e.virtualSize=-E,u.forEach((e=>{o?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),n.centeredSlides&&n.cssMode&&(ji(i,"--swiper-centered-offset-before",""),ji(i,"--swiper-centered-offset-after",""));const S=n.grid&&n.grid.rows>1&&e.grid;let A;S&&e.grid.initSlides(h);const k="auto"===n.slidesPerView&&n.breakpoints&&Object.keys(n.breakpoints).filter((e=>"undefined"!==typeof n.breakpoints[e].slidesPerView)).length>0;for(let x=0;x<h;x+=1){let i;if(A=0,u[x]&&(i=u[x]),S&&e.grid.updateSlide(x,i,h,t),!u[x]||"none"!==qi(i,"display")){if("auto"===n.slidesPerView){k&&(u[x].style[t("width")]="");const s=getComputedStyle(i),a=i.style.transform,o=i.style.webkitTransform;if(a&&(i.style.transform="none"),o&&(i.style.webkitTransform="none"),n.roun
vendor: 4,157 bytes, line 1
1dLengths)A=e.isHorizontal()?zi(i,"width",!0):zi(i,"height",!0);else{const e=r(s,"width"),t=r(s,"padding-left"),n=r(s,"padding-right"),a=r(s,"margin-left"),o=r(s,"margin-right"),l=s.getPropertyValue("box-sizing");if(l&&"border-box"===l)A=e+a+o;else{const{clientWidth:r,offsetWidth:s}=i;A=e+t+n+a+o+(s-r)}}a&&(i.style.transform=a),o&&(i.style.webkitTransform=o),n.roundLengths&&(A=Math.floor(A))}else A=(a-(n.slidesPerView-1)*E)/n.slidesPerView,n.roundLengths&&(A=Math.floor(A)),u[x]&&(u[x].style[t("width")]=`${A}px`);u[x]&&(u[x].swiperSlideSize=A),m.push(A),n.centeredSlides?(_=_+A/2+w/2+E,0===w&&0!==x&&(_=_-a/2-E),0===x&&(_=_-a/2-E),Math.abs(_)<.001&&(_=0),n.roundLengths&&(_=Math.floor(_)),T%n.slidesPerGroup===0&&f.push(_),p.push(_)):(n.roundLengths&&(_=Math.floor(_)),(T-Math.min(e.params.slidesPerGroupSkip,T))%e.params.slidesPerGroup===0&&f.push(_),p.push(_),_=_+A+E),e.virtualSize+=A+E,w=A,T+=1}}if(e.virtualSize=Math.max(e.virtualSize,a)+v,o&&l&&("slide"===n.effect||"coverflow"===n.effect)&&(i.style.width=`${e.virtualSize+E}px`),n.setWrapperSize&&(i.style[t("width")]=`${e.virtualSize+E}px`),S&&e.grid.updateWrapperSize(A,f,t),!n.centeredSlides){const t=[];for(let r=0;r<f.length;r+=1){let i=f[r];n.roundLengths&&(i=Math.floor(i)),f[r]<=e.virtualSize-a&&t.push(i)}f=t,Math.floor(e.virtualSize-a)-Math.floor(f[f.length-1])>1&&f.push(e.virtualSize-a)}if(c&&n.loop){const t=m[0]+E;if(n.slidesPerGroup>1){const r=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),i=t*n.slidesPerGroup;for(let e=0;e<r;e+=1)f.push(f[f.length-1]+i)}for(let r=0;r<e.virtual.slidesBefore+e.virtual.slidesAfter;r+=1)1===n.slidesPerGroup&&f.push(f[f.length-1]+t),p.push(p[p.length-1]+t),e.virtualSize+=t}if(0===f.length&&(f=[0]),0!==E){const r=e.isHorizontal()&&o?"marginLeft":t("marginRight");u.filter(((e,t)=>!(n.cssMode&&!n.loop)||t!==u.length-1)).forEach((e=>{e.style[r]=`${E}px`}))}if(n.centeredSlides&&n.centeredSlidesBounds){let e=0;m.forEach((t=>{e+=t+(E||0)})),e-=E;const t=e-a;f=f.map((e=>e<=0?-g:e>t?t+v:e))}if(n.centerInsufficientSlides){let e=0;if(m.forEach((t=>{e+=t+(E||0)})),e-=E,e<a){const t=(a-e)/2;f.forEach(((e,r)=>{f[r]=e-t})),p.forEach(((e,r)=>{p[r]=e+t}))}}if(Object.assign(e,{slides:u,snapGrid:f,slidesGrid:p,slidesSizesGrid:m}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){ji(i,"--swiper-centered-offset-before",-f[0]+"px"),ji(i,"--swiper-centered-offset-after",e.size/2-m[m.length-1]/2+"px");const t=-e.snapGrid[0],r=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+r))}if(h!==d&&e.emit("slidesLengthChange"),f.length!==y&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),p.length!==b&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),!c&&!n.cssMode&&("slide"===n.effect||"fade"===n.effect)){const t=`${n.containerModifierClass}backface-hidden`,r=e.el.classList.contains(t);h<=n.maxBackfaceHiddenSlides?r||e.el.classList.add(t):r&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,r=[],n=t.virtual&&t.params.virtual.enabled;let i,s=0;"number"===typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const a=e=>n?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{r.push(e)}));else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!n)break;r.push(a(e))}else r.push(a(t.activeIndex));for(i=0;i<r.length;i+=1)if("undefined"!==typeof r[i]){const e=r[i].offsetHeight;s=e>s?e:s}(s||0===s)&&(t.wrapperEl.style.height=`${s}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,r=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let n=0;n<t.length;n+=1)t[n].swiperSlideOffset=(e.isHorizontal()?t[n].offsetLeft:t[n].offsetTop)-r-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,r=t.params,{slides:n,rtlTranslate:i,snapGrid:s}=t;if(0===n.length)return;"undefined"===typeof n[0].swiperSlideOffset&&t.updateSlidesOffset();let a=-e;
1i&&(a=e),n.forEach((e=>{e.classList.remove(r.slideVisibleClass)})),t.visibleSlidesIndexes=[],t.visibleSlides=[];let o=r.spaceBetween;"string"===typeof o&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*t.size:"string"===typeof o&&(o=parseFloat(o));for(let l=0;l<n.length;l+=1){const e=n[l];let c=e.swiperSlideOffset;r.cssMode&&r.centeredSlides&&(c-=n[0].swiperSlideOffset);const d=(a+(r.centeredSlides?t.minTranslate():0)-c)/(e.swiperSlideSize+o),u=(a-s[0]+(r.centeredSlides?t.minTranslate():0)-c)/(e.swiperSlideSize+o),h=-(a-c),f=h+t.slidesSizesGrid[l];(h>=0&&h<t.size-1||f>1&&f<=t.size||h<=0&&f>=t.size)&&(t.visibleSlides.push(e),t.visibleSlidesIndexes.push(l),n[l].classList.add(r.slideVisibleClass)),e.progress=i?-d:d,e.originalProgress=i?-u:u}},updateProgress:function(e){const t=this;if("undefined"===typeof e){const r=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*r||0}const r=t.params,n=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:s,isEnd:a,progressLoop:o}=t;const l=s,c=a;if(0===n)i=0,s=!0,a=!0;else{i=(e-t.minTranslate())/n;const r=Math.abs(e-t.minTranslate())<1,o=Math.abs(e-t.maxTranslate())<1;s=r||i<=0,a=o||i>=1,r&&(i=0),o&&(i=1)}if(r.loop){const r=t.getSlideIndexByData(0),n=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[r],s=t.slidesGrid[n],a=t.slidesGrid[t.slidesGrid.length-1],l=Math.abs(e);o=l>=i?(l-i)/a:(l+a-s)/a,o>1&&(o-=1)}Object.assign(t,{progress:i,progressLoop:o,isBeginning:s,isEnd:a}),(r.watchSlidesProgress||r.centeredSlides&&r.autoHeight)&&t.updateSlidesProgress(e),s&&!l&&t.emit("reachBeginning toEdge"),a&&!c&&t.emit("reachEnd toEdge"),(l&&!s||c&&!a)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:r,slidesEl:n,activeIndex:i}=e,s=e.virtual&&r.virtual.enabled,a=e=>Hi(n,`.${r.slideClass}${e}, swiper-slide${e}`)[0];let o;if(t.forEach((e=>{e.classList.remove(r.slideActiveClass,r.slideNextClass,r.slidePrevClass)})),s)if(r.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),o=a(`[data-swiper-slide-index="${t}"]`)}else o=a(`[data-swiper-slide-index="${i}"]`);else o=t[i];if(o){o.classList.add(r.slideActiveClass);let e=function(e,t){const r=[];for(;e.nextElementSibling;){const n=e.nextElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}(o,`.${r.slideClass}, swiper-slide`)[0];r.loop&&!e&&(e=t[0]),e&&e.classList.add(r.slideNextClass);let n=function(e,t){const r=[];for(;e.previousElementSibling;){const n=e.previousElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}(o,`.${r.slideClass}, swiper-slide`)[0];r.loop&&0===!n&&(n=t[t.length-1]),n&&n.classList.add(r.slidePrevClass)}e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,r=t.rtlTranslate?t.translate:-t.translate,{snapGrid:n,params:i,activeIndex:s,realIndex:a,snapIndex:o}=t;let l,c=e;const d=e=>{let r=e-t.virtual.slidesBefore;return r<0&&(r=t.virtual.slides.length+r),r>=t.virtual.slides.length&&(r-=t.virtual.slides.length),r};if("undefined"===typeof c&&(c=function(e){const{slidesGrid:t,params:r}=e,n=e.rtlTranslate?e.translate:-e.translate;let i;for(let s=0;s<t.length;s+=1)"undefined"!==typeof t[s+1]?n>=t[s]&&n<t[s+1]-(t[s+1]-t[s])/2?i=s:n>=t[s]&&n<t[s+1]&&(i=s+1):n>=t[s]&&(i=s);return r.normalizeSlideIndex&&(i<0||"undefined"===typeof i)&&(i=0),i}(t)),n.indexOf(r)>=0)l=n.indexOf(r);else{const e=Math.min(i.slidesPerGroupSkip,c);l=e+Math.floor((c-e)/i.slidesPerGroup)}if(l>=n.length&&(l=n.length-1),c===s)return l!==o&&(t.snapIndex=l,t.emit("snapIndexChange")),void(t.params.loop&&t.virtual&&t.params.virtual.enabled&&(t.realIndex=d(c)));let u;u=t.virtual&&i.virtual.enabled&&i.loop?d(c):t.slides[c]?parseInt(t.slides[c].getAttribute("data-swiper-slide-index")||c,10):c,Object.assign(t,{previousSnapIndex:o,snapIndex:l,previousRealIndex:a,realIndex:u,previousIndex:s,activeIndex:c}),t.initialized&&is(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),a!==u&&t.emit("realIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&t.emit("slideChange")},updateClickedSlide:function(e){const t=this,r=t.params,n=e.closest(`.${r.slideClass}, swiper-slide`);let i,s=!1;if(n)for(let a=0;a<t.slides.length;a+=1)if(t.slides[a]===n){s=!0,i=a;break}if(!n||!s)return t.clickedSlide=void 0,void(t.clickedIndex=void 0);t.clickedSlide=n,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(n.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=i,r.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}};var as={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:r,translate:n,wrapperEl:i}=this;if(t.virtualTranslate)return r?-n:n;if(t.cssMode)return n;let s=Ni(i,e);return s+=this.cssOverflowAdjustment(),r&&(s=-s),s||0},setTranslate:function(e,t){const r=this,{rtlTranslate:n,params:i,wrapperEl:s,progress:a}=r;let o,l=0,c=0;r.isHorizontal()?l=n?-e:e:c=e,i.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),r.previousTranslate=r.translate,r.translate=r.isH
vendor: 3,119 bytes, line 1
1orizontal()?l:c,i.cssMode?s[r.isHorizontal()?"scrollLeft":"scrollTop"]=r.isHorizontal()?-l:-c:i.virtualTranslate||(r.isHorizontal()?l-=r.cssOverflowAdjustment():c-=r.cssOverflowAdjustment(),s.style.transform=`translate3d(${l}px, ${c}px, 0px)`);const d=r.maxTranslate()-r.minTranslate();o=0===d?0:(e-r.minTranslate())/d,o!==a&&r.updateProgress(e),r.emit("setTranslate",r.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,r,n,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===r&&(r=!0),void 0===n&&(n=!0);const s=this,{params:a,wrapperEl:o}=s;if(s.animating&&a.preventInteractionOnTransition)return!1;const l=s.minTranslate(),c=s.maxTranslate();let d;if(d=n&&e>l?l:n&&e<c?c:e,s.updateProgress(d),a.cssMode){const e=s.isHorizontal();if(0===t)o[e?"scrollLeft":"scrollTop"]=-d;else{if(!s.support.smoothScroll)return $i({swiper:s,targetPosition:-d,side:e?"left":"top"}),!0;o.scrollTo({[e?"left":"top"]:-d,behavior:"smooth"})}return!0}return 0===t?(s.setTransition(0),s.setTranslate(d),r&&(s.emit("beforeTransitionStart",t,i),s.emit("transitionEnd"))):(s.setTransition(t),s.setTranslate(d),r&&(s.emit("beforeTransitionStart",t,i),s.emit("transitionStart")),s.animating||(s.animating=!0,s.onTranslateToWrapperTransitionEnd||(s.onTranslateToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onTranslateToWrapperTransitionEnd),s.onTranslateToWrapperTransitionEnd=null,delete s.onTranslateToWrapperTransitionEnd,r&&s.emit("transitionEnd"))}),s.wrapperEl.addEventListener("transitionend",s.onTranslateToWrapperTransitionEnd))),!0}};function os(e){let{swiper:t,runCallbacks:r,direction:n,step:i}=e;const{activeIndex:s,previousIndex:a}=t;let o=n;if(o||(o=s>a?"next":s<a?"prev":"reset"),t.emit(`transition${i}`),r&&s!==a){if("reset"===o)return void t.emit(`slideResetTransition${i}`);t.emit(`slideChangeTransition${i}`),"next"===o?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}var ls={setTransition:function(e,t){const r=this;r.params.cssMode||(r.wrapperEl.style.transitionDuration=`${e}ms`),r.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const r=this,{params:n}=r;n.cssMode||(n.autoHeight&&r.updateAutoHeight(),os({swiper:r,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const r=this,{params:n}=r;r.animating=!1,n.cssMode||(r.setTransition(0),os({swiper:r,runCallbacks:e,direction:t,step:"End"}))}};var cs={slideTo:function(e,t,r,n,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===r&&(r=!0),"string"===typeof e&&(e=parseInt(e,10));const s=this;let a=e;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:c,previousIndex:d,activeIndex:u,rtlTranslate:h,wrapperEl:f,enabled:p}=s;if(s.animating&&o.preventInteractionOnTransition||!p&&!n&&!i)return!1;const m=Math.min(s.params.slidesPerGroupSkip,a);let g=m+Math.floor((a-m)/s.params.slidesPerGroup);g>=l.length&&(g=l.length-1);const v=-l[g];if(o.normalizeSlideIndex)for(let b=0;b<c.length;
1b+=1){const e=-Math.floor(100*v),t=Math.floor(100*c[b]),r=Math.floor(100*c[b+1]);"undefined"!==typeof c[b+1]?e>=t&&e<r-(r-t)/2?a=b:e>=t&&e<r&&(a=b+1):e>=t&&(a=b)}if(s.initialized&&a!==u){if(!s.allowSlideNext&&(h?v>s.translate&&v>s.minTranslate():v<s.translate&&v<s.minTranslate()))return!1;if(!s.allowSlidePrev&&v>s.translate&&v>s.maxTranslate()&&(u||0)!==a)return!1}let y;if(a!==(d||0)&&r&&s.emit("beforeSlideChangeStart"),s.updateProgress(v),y=a>u?"next":a<u?"prev":"reset",h&&-v===s.translate||!h&&v===s.translate)return s.updateActiveIndex(a),o.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),"slide"!==o.effect&&s.setTranslate(v),"reset"!==y&&(s.transitionStart(r,y),s.transitionEnd(r,y)),!1;if(o.cssMode){const e=s.isHorizontal(),r=h?v:-v;if(0===t){const t=s.virtual&&s.params.virtual.enabled;t&&(s.wrapperEl.style.scrollSnapType="none",s._immediateVirtual=!0),t&&!s._cssModeVirtualInitialSet&&s.params.initialSlide>0?(s._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{f[e?"scrollLeft":"scrollTop"]=r}))):f[e?"scrollLeft":"scrollTop"]=r,t&&requestAnimationFrame((()=>{s.wrapperEl.style.scrollSnapType="",s._immediateVirtual=!1}))}else{if(!s.support.smoothScroll)return $i({swiper:s,targetPosition:r,side:e?"left":"top"}),!0;f.scrollTo({[e?"left":"top"]:r,behavior:"smooth"})}return!0}return s.setTransition(t),s.setTranslate(v),s.updateActiveIndex(a),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,n),s.transitionStart(r,y),0===t?s.transitionEnd(r,y):s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(r,y))}),s.wrapperEl.addEventListener("transitionend",s.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===r&&(r=!0),"string"===typeof e){e=parseInt(e,10)}const i=this;let s=e;return i.params.loop&&(i.virtual&&i.params.virtual.enabled?s+=i.virtual.slidesBefore:s=i.getSlideIndexByData(s)),i.slideTo(s,t,r,n)},slideNext:function(e,t,r){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const n=this,{enabled:i,params:s,animating:a}=n;if(!i)return n;let o=s.slidesPerGroup;"auto"===s.slidesPerView&&1===s.slidesPerGroup&&s.slidesPerGroupAuto&&(o=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<s.slidesPerGroupSkip?1:o,c=n.virtual&&s.virtual.enabled;if(s.loop){if(a&&!c&&s.loopPreventsSliding)return!1;n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft}return s.rewind&&n.isEnd?n.slideTo(0,e,t,r):n.slideTo(n.activeIndex+l,e,t,r)},slidePrev:function(e,t,r){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const n=this,{params:i,snapGrid:s,slidesGrid:a,rtlTranslate:o,enabled:l,animating:c}=n;if(!l)return n;const d=n.virtual&&i.virtual.enabled;if(i.loop){if(c&&!d&&i.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}function u(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const h=u(o?n.translate:-n.translate),f=s.map((e=>u(e)));let p=s[f.indexOf(h)-1];if("undefined"===typeof p&&i.cssMode){let e;
1s.forEach(((t,r)=>{h>=t&&(e=r)})),"undefined"!==typeof e&&(p=s[e>0?e-1:e])}let m=0;if("undefined"!==typeof p&&(m=a.indexOf(p),m<0&&(m=n.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(m=m-n.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),i.rewind&&n.isBeginning){const i=n.params.virtual&&n.params.virtual.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(i,e,t,r)}return n.slideTo(m,e,t,r)},slideReset:function(e,t,r){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,r)},slideToClosest:function(e,t,r,n){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===n&&(n=.5);const i=this;let s=i.activeIndex;const a=Math.min(i.params.slidesPerGroupSkip,s),o=a+Math.floor((s-a)/i.params.slidesPerGroup),l=i.rtlTranslate?i.translate:-i.translate;if(l>=i.snapGrid[o]){const e=i.snapGrid[o];l-e>(i.snapGrid[o+1]-e)*n&&(s+=i.params.slidesPerGroup)}else{const e=i.snapGrid[o-1];l-e<=(i.snapGrid[o]-e)*n&&(s-=i.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,i.slidesGrid.length-1),i.slideTo(s,e,t,r)},slideToClickedSlide:function(){const e=this,{params:t,slidesEl:r}=e,n="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,s=e.clickedIndex;const a=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?s<e.loopedSlides-n/2||s>e.slides.length-e.loopedSlides+n/2?(e.loopFix(),s=e.getSlideIndex(Hi(r,`${a}[data-swiper-slide-index="${i}"]`)[0]),Oi((()=>{e.slideTo(s)}))):e.slideTo(s):s>e.slides.length-n?(e.loopFix(),s=e.getSlideIndex(Hi(r,`${a}[data-swiper-slide-index="${i}"]`)[0]),Oi((()=>{e.slideTo(s)}))):e.slideTo(s)}else e.slideTo(s)}};var ds={loopCreate:function(e){const t=this,{params:r,slidesEl:n}=t;if(!r.loop||t.virtual&&t.params.virtual.enabled)return;Hi(n,`.${r.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})),t.loopFix({slideRealIndex:e,direction:r.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:r=!0,direction:n,setTranslate:i,activeSlideIndex:s,byController:a,byMousewheel:o}=void 0===e?{}:e;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:c,allowSlidePrev:d,allowSlideNext:u,slidesEl:h,params:f}=l;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&f.virtual.enabled)return r&&(f.centeredSlides||0!==l.snapIndex?f.centeredSlides&&l.snapIndex<f.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=d,l.allowSlideNext=u,void l.emit("loopFix");const p="auto"===f.slidesPerView?l.slidesPerViewDynamic():Math.ceil(parseFloat(f.slidesPerView,10));let m=f.loopedSlides||p;m%f.slidesPerGroup!==0&&(m+=f.slidesPerGroup-m%f.slidesPerGroup),l.loopedSlides=m;const g=[],v=[];let y=l.activeIndex;"undefined"===typeof s?s=l.getSlideIndex(l.slides.filter((e=>e.classList.contains(f.slideActiveClass)))[0]):y=s;const b="next"===n||!n,E="prev"===n||!n;let _=0,w=0;if(s<m){_=Math.max(m-s,f.slidesPerGroup);for(let e=0;e<m-s;e+=1){const t=e-Math.floor(e/c.length)*c.length;g.push(c.length-t-1)}}else if(s>l.slides.length-2*m){w=Math.max(s-(l.slides.length-2*m),f.slidesPerGroup);for(let e=0;e<w;e+=1){const t=e-Math.floor(e/c.length)*c.length;v.push(t)}}if(E&&g.forEach((e=>{l.slides[e].swiperLoopMoveDOM=!0,h.prepend(l.slides[e]),l.slides[e].swiperLoopMoveDOM=!1})),b&&v.forEach((e=>{l.slides[e].swiperLoopMoveDOM=!0,h.append(l.slides[e]),l.slides[e].swiperLoopMoveDOM=!1})),l.recalcSlides(),"auto"===f.slidesPerView&&l.updateSlides(),f.watchSlidesProgress&&l.updateSlidesOffset(),r)if(g.length>0&&E)if("undefined"===typeof t){const e=l.slidesGrid[y],t=l.slidesGrid[y+_]-e;o?l.setTranslate(l.translate-t):(l.slideTo(y+_,0,!1,!0),i&&(l.touches[l.isHorizontal()?"startX":"startY"]+=t,l.touchEventsData.currentTranslate=l.translate))}else i&&(l.slideToLoop(t,0,!1,!0),l.touchEventsData.currentTranslate=l.translate);else if(v.length>0&&b)if("undefined"===typeof t){const e=l.slidesGrid[y],t=l.slidesGrid[y-w]-e;o?l.setTranslate(l.translate-t):(l.slideTo(y-w,0,!1,!0),i&&(l.touches[l.isHorizontal()?"startX":"startY"]+=t,l.touchEventsData.currentTranslate=l.translate))}else l.slideToLoop(t,0,!1,!0);if(l.allowSlidePrev=d,l.allowSlideNext=u,l.controller&&l.controller.control&&!a){const e={slideRealIndex:t,slideTo:!1,direction:n,setTranslate:i,activeSlideIndex:s,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix(e)})):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix(e)}l.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:r}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const n=[];
1e.slides.forEach((e=>{const t="undefined"===typeof e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;n[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),n.forEach((e=>{r.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}};var us={setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const r="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),r.style.cursor="move",r.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}};function hs(e){const t=this,r=Di(),n=Pi(),i=t.touchEventsData;i.evCache.push(e);const{params:s,touches:a,enabled:o}=t;if(!o)return;if(!s.simulateTouch&&"mouse"===e.pointerType)return;if(t.animating&&s.preventInteractionOnTransition)return;!t.animating&&s.cssMode&&s.loop&&t.loopFix();let l=e;l.originalEvent&&(l=l.originalEvent);let c=l.target;if("wrapper"===s.touchEventsTarget&&!t.wrapperEl.contains(c))return;if("which"in l&&3===l.which)return;if("button"in l&&l.button>0)return;if(i.isTouched&&i.isMoved)return;const d=!!s.noSwipingClass&&""!==s.noSwipingClass,u=e.composedPath?e.composedPath():e.path;d&&l.target&&l.target.shadowRoot&&u&&(c=u[0]);const h=s.noSwipingSelector?s.noSwipingSelector:`.${s.noSwipingClass}`,f=!(!l.target||!l.target.shadowRoot);if(s.noSwiping&&(f?function(e,t){return void 0===t&&(t=this),function t(r){if(!r||r===Di()||r===Pi())return null;r.assignedSlot&&(r=r.assignedSlot);const n=r.closest(e);return n||r.getRootNode?n||t(r.getRootNode().host):null}(t)}(h,c):c.closest(h)))return void(t.allowClick=!0);if(s.swipeHandler&&!c.closest(s.swipeHandler))return;a.currentX=l.pageX,a.currentY=l.pageY;const p=a.currentX,m=a.currentY,g=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,v=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(g&&(p<=v||p>=n.innerWidth-v)){if("prevent"!==g)return;e.preventDefault()}Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=p,a.startY=m,i.touchStartTime=Mi(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,s.threshold>0&&(i.allowThresholdMove=!1);let y=!0;c.matches(i.focusableElements)&&(y=!1,"SELECT"===c.nodeName&&(i.isTouched=!1)),r.activeElement&&r.activeElement.matches(i.focusableElements)&&r.activeElement!==c&&r.activeElement.blur();const b=y&&t.allowTouchMove&&s.touchStartPreventDefault;!s.touchStartForcePreventDefault&&!b||c.isContentEditable||l.preventDefault(),s.freeMode&&s.freeMode.enabled&&t.freeMode&&t.animating&&!s.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",l)}function fs(e){const t=Di(),r=this,n=r.touchEventsData,{params:i,touches:s,rtlTranslate:a,enabled:o}=r;if(!o)return;if(!i.simulateTouch&&"mouse"===e.pointerType)return;let l=e;if(l.originalEvent&&(l=l.originalEvent),!n.isTouched)return void(n.startMoving&&n.isScrolling&&r.emit("touchMoveOpposite",l));const c=n.evCache.findIndex((e=>e.pointerId===l.pointerId));c>=0&&(n.evCache[c]=l);const d=n.evCache.length>1?n.evCache[0]:l,u=d.pageX,h=d.pageY;if(l.preventedByNestedSwiper)return s.startX=u,void(s.startY=h);if(!r.allowTouchMove)return l.target.matches(n.focusableElements)||(r.allowClick=!1),void(n.isTouched&&(Object.assign(s,{startX:u,startY:h,prevX:r.touches.currentX,prevY:r.touches.currentY,currentX:u,currentY:h}),n.touchStartTime=Mi()));if(i.touchReleaseOnEdges&&!i.loop)if(r.isVertical()){if(h<s.startY&&r.translate<=r.maxTranslate()||h>s.startY&&r.translate>=r.minTranslate())return n.isTouched=!1,void(n.isMoved=!1)}else if(u<s.startX&&r.translate<=r.maxTranslate()||u>s.startX&&r.translate>=r.minTranslate())return;if(t.activeElement&&l.target===t.activeElement&&l.target.matches(n.focusableElements))return n.isMoved=!0,void(r.allowClick=!1);if(n.allowTouchCallbacks&&r.emit("touchMove",l),l.targetTouches&&l.targetTouches.length>1)return;s.currentX=u,s.currentY=h;const f=s.currentX-s.startX,p=s.currentY-s.startY;if(r.params.threshold&&Math.sqrt(f**2+p**2)<r.params.threshold)return;if("undefined"===typeof n.isScrolling){let e;r.isHorizontal()&&s.currentY===s.startY||r.isVertical()&&s.currentX===s.startX?n.isScrolling=!1:f*f+p*p>=25&&(e=180*Math.atan2(Math.abs(p),Math.abs(f))/Math.PI,n.isScrolling=r.isH
1orizontal()?e>i.touchAngle:90-e>i.touchAngle)}if(n.isScrolling&&r.emit("touchMoveOpposite",l),"undefined"===typeof n.startMoving&&(s.currentX===s.startX&&s.currentY===s.startY||(n.startMoving=!0)),n.isScrolling||r.zoom&&r.params.zoom&&r.params.zoom.enabled&&n.evCache.length>1)return void(n.isTouched=!1);if(!n.startMoving)return;r.allowClick=!1,!i.cssMode&&l.cancelable&&l.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&l.stopPropagation();let m=r.isHorizontal()?f:p,g=r.isHorizontal()?s.currentX-s.previousX:s.currentY-s.previousY;i.oneWayMovement&&(m=Math.abs(m)*(a?1:-1),g=Math.abs(g)*(a?1:-1)),s.diff=m,m*=i.touchRatio,a&&(m=-m,g=-g);const v=r.touchesDirection;r.swipeDirection=m>0?"prev":"next",r.touchesDirection=g>0?"prev":"next";const y=r.params.loop&&!i.cssMode;if(!n.isMoved){if(y&&r.loopFix({direction:r.swipeDirection}),n.startTranslate=r.getTranslate(),r.setTransition(0),r.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});r.wrapperEl.dispatchEvent(e)}n.allowMomentumBounce=!1,!i.grabCursor||!0!==r.allowSlideNext&&!0!==r.allowSlidePrev||r.setGrabCursor(!0),r.emit("sliderFirstMove",l)}let b;n.isMoved&&v!==r.touchesDirection&&y&&Math.abs(m)>=1&&(r.loopFix({direction:r.swipeDirection,setTranslate:!0}),b=!0),r.emit("sliderMove",l),n.isMoved=!0,n.currentTranslate=m+n.startTranslate;let E=!0,_=i.resistanceRatio;if(i.touchReleaseOnEdges&&(_=0),m>0?(y&&!b&&n.currentTranslate>(i.centeredSlides?r.minTranslate()-r.size/2:r.minTranslate())&&r.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),n.currentTranslate>r.minTranslate()&&(E=!1,i.resistance&&(n.currentTranslate=r.minTranslate()-1+(-r.minTranslate()+n.startTranslate+m)**_))):m<0&&(y&&!b&&n.currentTranslate<(i.centeredSlides?r.maxTranslate()+r.size/2:r.maxTranslate())&&r.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:r.slides.length-("auto"===i.slidesPerView?r.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),n.currentTranslate<r.maxTranslate()&&(E=!1,i.resistance&&(n.currentTranslate=r.maxTranslate()+1-(r.maxTranslate()-n.startTranslate-m)**_))),E&&(l.preventedByNestedSwiper=!0),!r.allowSlideNext&&"next"===r.swipeDirection&&n.currentTranslate<n.startTranslate&&(n.currentTranslate=n.startTranslate),!r.allowSlidePrev&&"prev"===r.swipeDirection&&n.currentTranslate>n.startTranslate&&(n.currentTranslate=n.startTranslate),r.allowSlidePrev||r.allowSlideNext||(n.currentTranslate=n.startTranslate),i.threshold>0){if(!(Math.abs(m)>i.threshold||n.allowThresholdMove))return void(n.currentTranslate=n.startTranslate);
1if(!n.allowThresholdMove)return n.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,n.currentTranslate=n.startTranslate,void(s.diff=r.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}i.followFinger&&!i.cssMode&&((i.freeMode&&i.freeMode.enabled&&r.freeMode||i.watchSlidesProgress)&&(r.updateActiveIndex(),r.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&r.freeMode&&r.freeMode.onTouchMove(),r.updateProgress(n.currentTranslate),r.setTranslate(n.currentTranslate))}function ps(e){const t=this,r=t.touchEventsData,n=r.evCache.findIndex((t=>t.pointerId===e.pointerId));if(n>=0&&r.evCache.splice(n,1),["pointercancel","pointerout","pointerleave"].includes(e.type)){if(!("pointercancel"===e.type&&(t.browser.isSafari||t.browser.isWebView)))return}const{params:i,touches:s,rtlTranslate:a,slidesGrid:o,enabled:l}=t;if(!l)return;if(!i.simulateTouch&&"mouse"===e.pointerType)return;let c=e;if(c.originalEvent&&(c=c.originalEvent),r.allowTouchCallbacks&&t.emit("touchEnd",c),r.allowTouchCallbacks=!1,!r.isTouched)return r.isMoved&&i.grabCursor&&t.setGrabCursor(!1),r.isMoved=!1,void(r.startMoving=!1);i.grabCursor&&r.isMoved&&r.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const d=Mi(),u=d-r.touchStartTime;if(t.allowClick){const e=c.path||c.composedPath&&c.composedPath();t.updateClickedSlide(e&&e[0]||c.target),t.emit("tap click",c),u<300&&d-r.lastClickTime<300&&t.emit("doubleTap doubleClick",c)}if(r.lastClickTime=Mi(),Oi((()=>{t.destroyed||(t.allowClick=!0)})),!r.isTouched||!r.isMoved||!t.swipeDirection||0===s.diff||r.currentTranslate===r.startTranslate)return r.isTouched=!1,r.isMoved=!1,void(r.startMoving=!1);let h;if(r.isTouched=!1,r.isMoved=!1,r.startMoving=!1,h=i.followFinger?a?t.translate:-t.translate:-r.currentTranslate,i.cssMode)return;if(i.freeMode&&i.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});let f=0,p=t.slidesSizesGrid[0];for(let b=0;b<o.length;b+=b<i.slidesPerGroupSkip?1:i.slidesPerGroup){const e=b<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;"undefined"!==typeof o[b+e]?h>=o[b]&&h<o[b+e]&&(f=b,p=o[b+e]-o[b]):h>=o[b]&&(f=b,p=o[o.length-1]-o[o.length-2])}let m=null,g=null;i.rewind&&(t.isBeginning?g=i.virtual&&i.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(m=0));const v=(h-o[f])/p,y=f<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(u>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(v>=i.longSwipesRatio?t.slideTo(i.rewind&&t.isEnd?m:f+y):t.slideTo(f)),"prev"===t.swipeDirection&&(v>1-i.longSwipesRatio?t.slideTo(f+y):null!==g&&v<0&&Math.abs(v)>i.longSwipesRatio?t.slideTo(g):t.slideTo(f))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(c.target===t.navigation.nextEl||c.target===t.navigation.prevEl)?c.target===t.navigation.nextEl?t.slideTo(f+y):t.slideTo(f):("next"===t.swipeDirection&&t.slideTo(null!==m?m:f+y),"prev"===t.swipeDirection&&t.slideTo(null!==g?g:f))}}function ms(){const e=this,{params:t,el:r}=e;if(r&&0===r.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:i,snapGrid:s}=e,a=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const o=a&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||o?e.params.loop&&!a?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=i,e.allowSlideNext=n,e.params.watchOverflow&&s!==e.snapGrid&&e.checkOverflow()}function gs(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function vs(){const e=this,{wrapperEl:t,rtlTranslate:r,enabled:n}=e;if(!n)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const s=e.maxTranslate()-e.minTranslate();i=0===s?0:(e.translate-e.minTranslate())/s,i!==e.progress&&e.updateProgress(r?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function ys(e){const t=this;rs(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update(
1)}let bs=!1;function Es(){}const _s=(e,t)=>{const r=Di(),{params:n,el:i,wrapperEl:s,device:a}=e,o=!!n.nested,l="on"===t?"addEventListener":"removeEventListener",c=t;i[l]("pointerdown",e.onTouchStart,{passive:!1}),r[l]("pointermove",e.onTouchMove,{passive:!1,capture:o}),r[l]("pointerup",e.onTouchEnd,{passive:!0}),r[l]("pointercancel",e.onTouchEnd,{passive:!0}),r[l]("pointerout",e.onTouchEnd,{passive:!0}),r[l]("pointerleave",e.onTouchEnd,{passive:!0}),(n.preventClicks||n.preventClicksPropagation)&&i[l]("click",e.onClick,!0),n.cssMode&&s[l]("scroll",e.onScroll),n.updateOnWindowResize?e[c](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",ms,!0):e[c]("observerUpdate",ms,!0),i[l]("load",e.onLoad,{capture:!0})};var ws={attachEvents:function(){const e=this,t=Di(),{params:r}=e;e.onTouchStart=hs.bind(e),e.onTouchMove=fs.bind(e),e.onTouchEnd=ps.bind(e),r.cssMode&&(e.onScroll=vs.bind(e)),e.onClick=gs.bind(e),e.onLoad=ys.bind(e),bs||(t.addEventListener("touchstart",Es),bs=!0),_s(e,"on")},detachEvents:function(){_s(this,"off")}};const Ts=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var Ss={setBreakpoint:function(){const e=this,{realIndex:t,initialized:r,params:n,el:i}=e,s=n.breakpoints;if(!s||s&&0===Object.keys(s).length)return;const a=e.getBreakpoint(s,e.params.breakpointsBase,e.el);if(!a||e.currentBreakpoint===a)return;const o=(a in s?s[a]:void 0)||e.originalParams,l=Ts(e,n),c=Ts(e,o),d=n.enabled;l&&!c?(i.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),e.emitContainerClasses()):!l&&c&&(i.classList.add(`${n.containerModifierClass}grid`),(o.grid.fill&&"column"===o.grid.fill||!o.grid.fill&&"column"===n.grid.fill)&&i.classList.add(`${n.containerModifierClass}grid-column`),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((t=>{if("undefined"===typeof o[t])return;const r=n[t]&&n[t].enabled,i=o[t]&&o[t].enabled;r&&!i&&e[t].disable(),!r&&i&&e[t].enable()}));const u=o.direction&&o.direction!==n.direction,h=n.loop&&(o.slidesPerView!==n.slidesPerView||u);u&&r&&e.changeDirection(),Bi(e.params,o);const f=e.params.enabled;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),d&&!f?e.disable():!d&&f&&e.enable(),e.currentBreakpoint=a,e.emit("_beforeBreakpoint",o),h&&r&&(e.loopDestroy(),e.loopCreate(t),e.updateSlides()),e.emit("breakpoint",o)},getBreakpoint:function(e,t,r){if(void 0===t&&(t="window"),!e||"container"===t&&!r)return;let n=!1;const i=Pi(),s="window"===t?i.innerHeight:r.clientHeight,a=Object.keys(e).map((e=>{if("string"===typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:s*t,point:e}}return{value:e,point:e}}));a.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let o=0;o<a.length;o+=1){const{point:e,value:s}=a[o];"window"===t?i.matchMedia(`(min-width: ${s}px)`).matches&&(n=e):s<=r.clientWidth&&(n=e)}return n||"max"}};var As={addClasses:function(){const e=this,{classNames:t,params:r,rtl:n,el:i,device:s}=e,a=function(e,t){const r=[];return e.forEach((e=>{"object"===typeof e?Object.keys(e).forEach((n=>{e[n]&&r.push(t+n)})):"string"===typeof e&&r.push(t+e)})),r}(["initialized",r.direction,{"free-mode":e.params.freeMode&&r.freeMode.enabled},{autoheight:r.autoHeight},{rtl:n},{grid:r.grid&&r.grid.rows>1},{"grid-column":r.grid&&r.grid.rows>1&&"column"===r.grid.fill},{android:s.android},{ios:s.ios},{"css-mode":r.cssMode},{centered:r.cssMode&&r.centeredSlides},{"watch-progress":r.watchSlidesProgress}],r.containerModifierClass);t.push(...a),i.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e.classList.remove(...t),this.emitContainerClasses()}};var ks={checkOverflow:function(){const e=this,{isLocked:t,params:r}=e,{slidesOffsetBefore:n}=r;if(n){const t=e.slides.length-1,r=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*n;e.isLocked=e.size>r}else e.isLocked=1===e.snapGrid.length;!0===r.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===r.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},xs={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",
1spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Ls(e,t){return function(r){void 0===r&&(r={});const n=Object.keys(r)[0],i=r[n];"object"===typeof i&&null!==i?(["navigation","pagination","scrollbar"].indexOf(n)>=0&&!0===e[n]&&(e[n]={auto:!0}),n in e&&"enabled"in i?(!0===e[n]&&(e[n]={enabled:!0}),"object"!==typeof e[n]||"enabled"in e[n]||(e[n].enabled=!0),e[n]||(e[n]={enabled:!1}),Bi(t,r)):Bi(t,r)):Bi(t,r)}}const Is={eventsEmitter:ts,update:ss,translate:as,transition:ls,slide:cs,loop:ds,grabCursor:us,events:ws,breakpoints:Ss,checkOverflow:ks,classes:As},Rs={};class Ds{constructor(){let e,t;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];1===n.length&&n[0].constructor&&"Object"===Object.prototype.toString.call(n[0]).slice(8,-1)?t=n[0]:[e,t]=n,t||(t={}),t=Bi({},t),e&&!t.el&&(t.el=e);const s=Di();if(t.el&&"string"===typeof t.el&&s.querySelectorAll(t.el).length>1){const e=[];return s.querySelectorAll(t.el).forEach((r=>{const n=Bi({},t,{el:r});e.push(new Ds(n))})),e}const a=this;a.__swiper__=!0,a.support=Zi(),a.device=Ji({userAgent:t.userAgent}),a.browser=es(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],t.modules&&Array.isArray(t.modules)&&a.modules.push(...t.modules);const o={};a.modules.forEach((e=>{e({params:t,swiper:a,extendParams:Ls(t,o),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})}));const l=Bi({},xs,o);return a.params=Bi({},l,Rs,t),a.originalParams=Bi({},a.params),a.passedParams=Bi({}
vendor: 9,294 bytes, line 1
1,t),a.params&&a.params.on&&Object.keys(a.params.on).forEach((e=>{a.on(e,a.params.on[e])})),a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===a.params.direction,isVertical:()=>"vertical"===a.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}getSlideIndex(e){const{slidesEl:t,params:r}=this,n=Wi(Hi(t,`.${r.slideClass}, swiper-slide`)[0]);return Wi(e)-n}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=Hi(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const r=this;e=Math.min(Math.max(e,0),1);const n=r.minTranslate(),i=(r.maxTranslate()-n)*e+n;r.translateTo(i,"undefined"===typeof t?0:t),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((r=>{const n=e.getSlideClasses(r);t.push({slideEl:r,classNames:n}),e.emit("_slideClass",r,n)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:r,slides:n,slidesGrid:i,slidesSizesGrid:s,size:a,activeIndex:o}=this;let l=1;if(r.centeredSlides){let e,t=n[o]?n[o].swiperSlideSize:0;for(let r=o+1;r<n.length;r+=1)n[r]&&!e&&(t+=n[r].swiperSlideSize,l+=1,t>a&&(e=!0));for(let r=o-1;r>=0;r-=1)n[r]&&!e&&(t+=n[r].swiperSlideSize,l+=1,t>a&&(e=!0))}else if("current"===e)for(let c=o+1;c<n.length;c+=1){(t?i[c]+s[c]-i[o]<a:i[c]-i[o]<a)&&(l+=1)}else for(let c=o-1;c>=0;c-=1){i[o]-i[c]<a&&(l+=1)}return l}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:r}=e;function n(){const t=e.rtlTranslate?-1*e.translate:e.translate,r=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(r),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(r.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach((t=>{t.complete&&rs(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),r.freeMode&&r.freeMode.enabled&&!r.cssMode)n(),r.autoHeight&&e.updateAutoHeight();else{if(("auto"===r.slidesPerView||r.slidesPerView>1)&&e.isEnd&&!r.centeredSlides){const t=e.virtual&&r.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||n()}r.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const r=this,n=r.params.direction;return e||(e="horizontal"===n?"vertical":"horizontal"),e===n||"horizontal"!==e&&"vertical"!==e||(r.el.classList.remove(`${r.params.containerModifierClass}${n}`),r.el.classList.add(`${r.params.containerModifierClass}${e}`),r.emitContainerClasses(),r.params.direction=e,r.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),r.emit("changeDirection"),t&&r.update()),r}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let r=e||t.params.el;if("string"===typeof r&&(r=document.querySelector(r)),!r)return!1;r.swiper=t,r.parentNode&&r.parentNode.host&&"SWIPER-CONTAINER"===r.parentNode.host.nodeName&&(t.isElement=!0);const n=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let i=(()=>{if(r&&r.shadowRoot&&r.shadowRoot.querySelector){return r.shadowRoot.querySelector(n())}return Hi(r,n())[0]})();return!i&&t.params.createElements&&(i=Gi("div",t.params.wrapperClass),r.append(i),Hi(r,`.${t.params.slideClass}`).forEach((e=>{i.append(e)}))),Object.assign(t,{el:r,wrapperEl:i,slidesEl:t.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:i,hostEl:t.isElement?r.parentNode.host:r,mounted:!0,rtl:"rtl"===r.dir.toLowerCase()||"rtl"===qi(r,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===r.dir.toLowerCase()||"rtl"===qi(r,"direction")),wrongRTL:"-webkit-box"===qi(i,"display")}),!0}init(e){const t=this;if(t.initialized)return t;return!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach((e=>{e.complete?rs(t,e):e.addEventListener("load",(e=>{rs(t,e.target)}))})),is(t),t.initialized=!0,is(t),t.emit("init"),t.emit("afterInit")),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const r=this,{params:n,el:i,wrapperEl:s,slides:a}=r;return"undefined"===typeof r.params||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),n.loop&&r.loopDestroy(),t&&(r.removeClasses(),i.removeAttribute("style"),s.removeAttribute("style"),a&&a.length&&a.forEach((e=>{e.classList.remove(n.slideVisibleClass,n.slideActiveClass,n.slideNextClass,n.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),r.emit("destroy"),Object.keys(r.eventsListeners).forEach((e=>{r.off(e)})),!1!==e&&(r.el.swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(r){}try{delete t[e]}catch(r){}}))}(r)),r.destroyed=!0),null}static extendDefaults(e){Bi(Rs,e)}static get extendedDefaults(){return Rs}static get defaults(){return xs}static installModule(e){Ds.prototype.__modules__||(Ds.prototype.__modules__=[]);const t=Ds.prototype.__modules__;"function"===typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>Ds.installModule(e))),Ds):(Ds.installModule(e),Ds)}}Object.keys(Is).forEach((e=>{Object.keys(Is[e]).forEach((t=>{Ds.prototype[t]=Is[e][t]}))})),Ds.use([function(e){let{swiper:t,on:r,emit:n}=e;const i=Pi();let s=null,a=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(n("beforeResize"),n("resize"))},l=()=>{t&&!t.destroyed&&t.initialized&&n("orientationchange")};r("init",(()=>{t.params.resizeObserver&&"undefined"!==typeof i.ResizeObserver?t&&!t.destroyed&&t.initialized&&(s=new ResizeObserver((e=>{a=i.requestAnimationFrame((()=>{const{width:r,height:n}=t;let i=r,s=n;e.forEach((e=>{let{contentBoxSize:r,contentRect:n,target:a}=e;a&&a!==t.el||(i=n?n.width:(r[0]||r).inlineSize,s=n?n.height:(r[0]||r).blockSize)})),i===r&&s===n||o()}))})),s.observe(t.el)):(i.addEventListener("resize",o),i.addEventListener("orientationchange",l))})),r("destroy",(()=>{a&&i.cancelAnimationFrame(a),s&&s.unobserve&&t.el&&(s.unobserve(t.el),s=null),i.removeEventListener("resize",o),i.removeEventListener("orientationchange",l)}))},function(e){let{swiper:t,extendParams:r,on:n,emit:i}=e;const s=[],a=Pi(),o=function(e,r){void 0===r&&(r={});const n=new(a.MutationObserver||a.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void i("observerUpdate",e[0]);const r=function(){i("observerUpdate",e[0])};a.requestAnimationFrame?a.requestAnimationFrame(r):a.setTimeout(r,0)}));n.observe(e,{attributes:"undefined"===typeof r.attributes||r.attributes,childList:"undefined"===typeof r.childList||r.childList,characterData:"undefined"===typeof r.characterData||r.characterData}),s.push(n)};r({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=Ki(t.hostEl);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.hostEl,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}})),n("destroy",(()=>
1{s.forEach((e=>{e.disconnect()})),s.splice(0,s.length)}))}]);const Cs=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Ps(e){return"object"===typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function Os(e,t){const r=["__proto__","constructor","prototype"];Object.keys(t).filter((e=>r.indexOf(e)<0)).forEach((r=>{"undefined"===typeof e[r]?e[r]=t[r]:Ps(t[r])&&Ps(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:Os(e[r],t[r]):e[r]=t[r]}))}function Ms(e){return void 0===e&&(e={}),e.navigation&&"undefined"===typeof e.navigation.nextEl&&"undefined"===typeof e.navigation.prevEl}function Ns(e){return void 0===e&&(e={}),e.pagination&&"undefined"===typeof e.pagination.el}function Fs(e){return void 0===e&&(e={}),e.scrollbar&&"undefined"===typeof e.scrollbar.el}function Us(e){void 0===e&&(e="");const t=e.split(" ").map((e=>e.trim())).filter((e=>!!e)),r=[];return t.forEach((e=>{r.indexOf(e)<0&&r.push(e)})),r.join(" ")}function Bs(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function js(){return js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},js.apply(this,arguments)}function $s(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Vs(e){const t=[];return a.Children.toArray(e).forEach((e=>{$s(e)?t.push(e):e.props&&e.props.children&&Vs(e.props.children).forEach((e=>t.push(e)))})),t}function Hs(e){const t=[],r={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return a.Children.toArray(e).forEach((e=>{if($s(e))t.push(e);else if(e.props&&e.props.slot&&r[e.props.slot])r[e.props.slot].push(e);else if(e.props&&e.props.children){const n=Vs(e.props.children);n.length>0?n.forEach((e=>t.push(e))):r["container-end"].push(e)}else r["container-end"].push(e)})),{slides:t,slots:r}}function Gs(e,t){return"undefined"===typeof window?(0,a.useEffect)(e,t):(0,a.useLayoutEffect)(e,t)}const qs=(0,a.createContext)(null),Ws=(0,a.createContext)(null),Ks=(0,a.forwardRef)((function(e,t){let{className:r,tag:n="div",wrapperTag:i="div",children:s,onSwiper:o,...l}=void 0===e?{}:e,c=!1;const[d,u]=(0,a.useState)("swiper"),[h,f]=(0,a.useState)(null),[p,m]=(0,a.useState)(!1),g=(0,a.useRef)(!1),v=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(null),E=(0,a.useRef)(null),_=(0,a.useRef)(null),w=(0,a.useRef)(null),T=(0,a.useRef)(null),S=(0,a.useRef)(null),{params:A,passedParams:k,rest:x,events:L}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const r={on:{}},n={},i={};Os(r,xs),r._emitClasses=!0,r.init=!1;const s={},a=Cs.map((e=>e.replace(/_/,""))),o=Object.assign({},e);
vendor: 4,178 bytes, line 1
1return Object.keys(o).forEach((o=>{"undefined"!==typeof e[o]&&(a.indexOf(o)>=0?Ps(e[o])?(r[o]={},i[o]={},Os(r[o],e[o]),Os(i[o],e[o])):(r[o]=e[o],i[o]=e[o]):0===o.search(/on[A-Z]/)&&"function"===typeof e[o]?t?n[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:r.on[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:s[o]=e[o])})),["navigation","pagination","scrollbar"].forEach((e=>{!0===r[e]&&(r[e]={}),!1===r[e]&&delete r[e]})),{params:r,passedParams:i,rest:s,events:n}}(l),{slides:I,slots:R}=Hs(s),D=()=>{m(!p)};Object.assign(A.on,{_containerClasses(e,t){u(t)}});const C=()=>{Object.assign(A.on,L),c=!0;const e={...A};if(delete e.wrapperClass,y.current=new Ds(e),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=I;const e={cache:!1,slides:I,renderExternal:f,renderExternalUpdate:!1};Os(y.current.params.virtual,e),Os(y.current.originalParams.virtual,e)}};v.current||C(),y.current&&y.current.on("_beforeBreakpoint",D);return(0,a.useEffect)((()=>()=>{y.current&&y.current.off("_beforeBreakpoint",D)})),(0,a.useEffect)((()=>{!g.current&&y.current&&(y.current.emitSlidesClasses(),g.current=!0)})),Gs((()=>{if(t&&(t.current=v.current),v.current)return y.current.destroyed&&C(),function(e,t){let{el:r,nextEl:n,prevEl:i,paginationEl:s,scrollbarEl:a,swiper:o}=e;Ms(t)&&n&&i&&(o.params.navigation.nextEl=n,o.originalParams.navigation.nextEl=n,o.params.navigation.prevEl=i,o.originalParams.navigation.prevEl=i),Ns(t)&&s&&(o.params.pagination.el=s,o.originalParams.pagination.el=s),Fs(t)&&a&&(o.params.scrollbar.el=a,o.originalParams.scrollbar.el=a),o.init(r)}({el:v.current,nextEl:_.current,prevEl:w.current,paginationEl:T.current,scrollbarEl:S.current,swiper:y.current},A),o&&o(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}}),[]),Gs((()=>{!c&&L&&y.current&&Object.keys(L).forEach((e=>{y.current.on(e,L[e])}));const e=function(e,t,r,n,i){const s=[];if(!t)return s;const a=e=>{s.indexOf(e)<0&&s.push(e)};if(r&&n){const e=n.map(i),t=r.map(i);e.join("")!==t.join("")&&a("children"),n.length!==r.length&&a("children")}return Cs.filter((e=>"_"===e[0])).map((e=>e.replace(/_/,""))).forEach((r=>{if(r in e&&r in t)if(Ps(e[r])&&Ps(t[r])){const n=Object.keys(e[r]),i=Object.keys(t[r]);n.length!==i.length?a(r):(n.forEach((n=>{e[r][n]!==t[r][n]&&a(r)})),i.forEach((n=>{e[r][n]!==t[r][n]&&a(r)})))}else e[r]!==t[r]&&a(r)})),s}(k,b.current,I,E.current,(e=>e.key));return b.current=k,E.current=I,e.length&&y.current&&!y.current.destroyed&&function(e){let{swiper:t,slides:r,passedParams:n,changedParams:i,nextEl:s,prevEl:a,scrollbarEl:o,paginationEl:l}=e;const c=i.filter((e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e)),{params:d,pagination:u,navigation:h,scrollbar:f,virtual:p,thumbs:m}=t;let g,v,y,b,E,_,w,T;i.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&d.thumbs&&!d.thumbs.swiper&&(g=!0),i.includes("controller")&&n.controller&&n.controller.control&&d.controller&&!d.controller.control&&(v=!0),i.includes("pagination")&&n.pagination&&(n.pagination.el||l)&&(d.pagination||!1===d.pagination)&&u&&!u.el&&(y=!0),i.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||o)&&(d.scrollbar||!1===d.scrollbar)&&f&&!f.el&&(b=!0),i.includes("navigation")&&n.navigation&&(n.navigation.prevEl||a)&&(n.navigation.nextEl||s)&&(d.navigation||!1===d.navigation)&&h&&!h.prevEl&&!h.nextEl&&(E=!0);const S=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),d[e].prevEl=void 0,d[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),d[e].el=void 0,t[e].el=void 0))};i.includes("loop")&&t.isElement&&(d.loop&&!n.loop?_=!0:!d.loop&&n.loop?w=!0:T=!0),c.forEach((e=>{if(Ps(d[e])&&Ps(n[e]))Os(d[e],n[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in n[e])||n[e].enabled||S(e);else{const t=n[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?d[e]=n[e]:!1===t&&S(e)}})),c.includes("controller")&&!v&&t.controller&&t.controller.control&&d.controller&&d.controller.control&&(t.controller.control=d.controller.control),i.includes("children")&&r&&p&&d.virtual.enabled&&(p.slides=r,p.update(!0)),i.includes("children")&&r&&d.loop&&(T=!0),g&&m.init(
1)&&m.update(!0);v&&(t.controller.control=d.controller.control),y&&(!t.isElement||l&&"string"!==typeof l||(l=document.createElement("div"),l.classList.add("swiper-pagination"),t.el.appendChild(l)),l&&(d.pagination.el=l),u.init(),u.render(),u.update()),b&&(!t.isElement||o&&"string"!==typeof o||(o=document.createElement("div"),o.classList.add("swiper-scrollbar"),t.el.appendChild(o)),o&&(d.scrollbar.el=o),f.init(),f.updateSize(),f.setTranslate()),E&&(t.isElement&&(s&&"string"!==typeof s||(s=document.createElement("div"),s.classList.add("swiper-button-next"),s.innerHTML=t.hostEl.nextButtonSvg,t.el.appendChild(s)),a&&"string"!==typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-prev"),s.innerHTML=t.hostEl.prevButtonSvg,t.el.appendChild(a))),s&&(d.navigation.nextEl=s),a&&(d.navigation.prevEl=a),h.init(),h.update()),i.includes("allowSlideNext")&&(t.allowSlideNext=n.allowSlideNext),i.includes("allowSlidePrev")&&(t.allowSlidePrev=n.allowSlidePrev),i.includes("direction")&&t.changeDirection(n.direction,!1),(_||T)&&t.loopDestroy(),(w||T)&&t.loopCreate(),t.update()}({swiper:y.current,slides:I,passedParams:k,changedParams:e,nextEl:_.current,prevEl:w.current,scrollbarEl:S.current,paginationEl:T.current}),()=>{L&&y.current&&Object.keys(L).forEach((e=>{y.current.off(e,L[e])}))}})),Gs((()=>{(e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())})(y.current)}),[h]),a.createElement(n,js({ref:v,className:Us(`${d}${r?` ${r}`:""}`)},x),a.createElement(Ws.Provider,{value:y.current},R["container-start"],a.createElement(i,{className:Bs(A.wrapperClass)},R["wrapper-start"],A.virtual?function(e,t,r){if(!r)return null;const n=e=>{let r=e;return e<0?r=t.length+e:r>=t.length&&(r-=t.length),r},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${r.offset}px`}:{top:`${r.offset}px`},{from:s,to:o}=r,l=e.params.loop?-t.length:0,c=e.params.loop?2*t.length:t.length,d=[];for(let a=l;a<c;a+=1)a>=s&&a<=o&&d.push(t[n(a)]);return d.map(((t,r)=>a.cloneElement(t,{swiper:e,style:i,key:`slide-${r}`})))}(y.current,I,h):I.map(((e,t)=>a.cloneElement(e,{swiper:y.current,swiperSlideIndex:t}))),R["wrapper-end"]),Ms(A)&&a.createElement(a.Fragment,null,a.createElement("div",{ref:w,className:"swiper-button-prev"}),a.createElement("div",{ref:_,className:"swiper-button-next"})),Fs(A)&&a.createElement("div",{ref:S,className:"swiper-scrollbar"}),Ns(A)&&a.createElement("div",{ref:T,className:"swiper-pagination"}),R["container-end"]))}));Ks.displayName="Swiper";const zs=(0,a.forwardRef)((function(e,t){let{tag:r="div",children:n,className:i="",swiper:s,zoom:o,lazy:l,virtualIndex:c,swiperSlideIndex:d,...u}=void 0===e?{}:e;const h=(0,a.useRef)(null),[f,p]=(0,a.useState)("swiper-slide"),[m,g]=(0,a.useState)(!1);function v(e,t,r){t===h.current&&p(r)}Gs((()=>{if("undefined"!==typeof d&&(h.current.swiperSlideIndex=d),t&&(t.current=h.current),h.current&&s){if(!s.destroyed)return s.on("_slideClass",v),()=>{s&&s.off("_slideClass",v)};"swiper-slide"!==f&&p("swiper-slide")}})),Gs((()=>{s&&h.current&&!s.destroyed&&p(s.getSlideClasses(h.current))}),[s]);const y={isActive:f.indexOf("swiper-slide-active")>=0,isVisible:f.indexOf("swiper-slide-visible")>=0,isPrev:f.indexOf("swiper-slide-prev")>=0,isNext:f.indexOf("swiper-slide-next")>=0},b=()=>"function"===typeof n?n(y):n;return a.createElement(r,js({ref:h,className:Us(`${f}${i?` ${i}`:""}`),"data-swiper-slide-index":c,onLoad:()=>{g(!0)}},u),o&&a.createElement(qs.Provider,{value:y},a.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"===typeof o?o:void 0},b(),l&&!m&&a.createElement("div",{className:"swiper-lazy-preloader"}))),!o&&a.createElement(qs.Provider,{value:y},b(),l&&!m&&a.createElement("div",{className:"swiper-lazy-preloader"})))}));function Ys(e){let{swiper:t,extendParams:r,on:n,emit:i}=e;const s=Di(),a=Pi();function o(e){if(!t.enabled)return;const{rtlTranslate:r}=t;let n=e;n.originalEvent&&(n=n.originalEvent);
1const o=n.keyCode||n.charCode,l=t.params.keyboard.pageUpDown,c=l&&33===o,d=l&&34===o,u=37===o,h=39===o,f=38===o,p=40===o;if(!t.allowSlideNext&&(t.isHorizontal()&&h||t.isVertical()&&p||d))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&u||t.isVertical()&&f||c))return!1;if(!(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey)&&(!s.activeElement||!s.activeElement.nodeName||"input"!==s.activeElement.nodeName.toLowerCase()&&"textarea"!==s.activeElement.nodeName.toLowerCase())){if(t.params.keyboard.onlyInViewport&&(c||d||u||h||f||p)){let e=!1;if(Ki(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&0===Ki(t.el,`.${t.params.slideActiveClass}`).length)return;const n=t.el,i=n.clientWidth,s=n.clientHeight,o=a.innerWidth,l=a.innerHeight,c=function(e){const t=Pi(),r=Di(),n=e.getBoundingClientRect(),i=r.body,s=e.clientTop||i.clientTop||0,a=e.clientLeft||i.clientLeft||0,o=e===t?t.scrollY:e.scrollTop,l=e===t?t.scrollX:e.scrollLeft;return{top:n.top+o-s,left:n.left+l-a}}(n);r&&(c.left-=n.scrollLeft);const d=[[c.left,c.top],[c.left+i,c.top],[c.left,c.top+s],[c.left+i,c.top+s]];for(let t=0;t<d.length;t+=1){const r=d[t];if(r[0]>=0&&r[0]<=o&&r[1]>=0&&r[1]<=l){if(0===r[0]&&0===r[1])continue;e=!0}}if(!e)return}t.isHorizontal()?((c||d||u||h)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),((d||h)&&!r||(c||u)&&r)&&t.slideNext(),((c||u)&&!r||(d||h)&&r)&&t.slidePrev()):((c||d||f||p)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),(d||p)&&t.slideNext(),(c||f)&&t.slidePrev()),i("keyPress",o)}}function l(){t.keyboard.enabled||(s.addEventListener("keydown",o),t.keyboard.enabled=!0)}function c(){t.keyboard.enabled&&(s.removeEventListener("keydown",o),t.keyboard.enabled=!1)}t.keyboard={enabled:!1},r({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}}),n("init",(()=>{t.params.keyboard.enabled&&l()})),n("destroy",(()=>{t.keyboard.enabled&&c()})),Object.assign(t.keyboard,{enable:l,disable:c})}function Xs(e){let{swiper:t,extendParams:r,on:n,emit:i}=e;r({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const s=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function a(e){let r;return e&&"string"===typeof e&&t.isElement&&(r=t.el.querySelector(e),r)?r:(e&&("string"===typeof e&&(r=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"===typeof e&&r.length>1&&1===t.el.querySelectorAll(e).length&&(r=t.el.querySelector(e))),e&&!r?e:r)}function o(e,r){const n=t.params.navigation;(e=s(e)).forEach((e=>{e&&(e.classList[r?"add":"remove"](...n.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=r),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](n.lockClass))}))}function l(){const{nextEl:e,prevEl:r}=t.navigation;if(t.params.loop)return o(r,!1),void o(e,!1);o(r,t.isBeginning&&!t.params.rewind),o(e,t.isEnd&&!t.params.rewind)}function c(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),i("navigationPrev"))}function d(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),i("navigationNext"))}function u(){const e=t.params.navigation;if(t.params.navigation=function(e,t,r,n){return e.params.createElements&&Object.keys(n).forEach((i=>{if(!r[i]&&!0===r.auto){let s=Hi(e.el,`.${n[i]}`)[0];s||(s=Gi("div",n[i]),s.className=n[i],e.el.append(s)),r[i]=s,t[i]=s}})),r}(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let r=a(e.nextEl),n=a(e.prevEl);Object.assign(t.navigation,{nextEl:r,prevEl:n}),r=s(r),n=s(n);const i=(r,n)=>{r&&r.addEventListener("click","next"===n?d:c),!t.enabled&&r&&r.classList.add(...e.lockClass.split(" "))};r.forEach((e=>i(e,"next"))),n.forEach((e=>i(e,"prev")))}function h(){let{nextEl:e,prevEl:r}=t.navigation;e=s(e),r=s(r);const n=(e,r)=>{e.removeEventListener("click","next"===r?d:c),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((e=>n(e,"next"))),r.forEach((e=>n(e,"prev")))}n("init",(()=>{!1===t.params.navigation.enabled?f():(u(),l())})),n("toEdge fromEdge lock unlock",(()=>{l()})),n("destroy",(()=>{h()})),n("enable disable",(()=>{let{nextEl:e,prevEl:r}=t.navigation;e=s(e),r=s(r),[...e,...r].filter((e=>
vendor: 5,488 bytes, line 1
1!!e)).forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.navigation.lockClass)))})),n("click",((e,r)=>{let{nextEl:n,prevEl:a}=t.navigation;n=s(n),a=s(a);const o=r.target;if(t.params.navigation.hideOnClick&&!a.includes(o)&&!n.includes(o)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===o||t.pagination.el.contains(o)))return;let e;n.length?e=n[0].classList.contains(t.params.navigation.hiddenClass):a.length&&(e=a[0].classList.contains(t.params.navigation.hiddenClass)),i(!0===e?"navigationShow":"navigationHide"),[...n,...a].filter((e=>!!e)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const f=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),h()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),u(),l()},disable:f,update:l,init:u,destroy:h})}function Qs(e){let t,r,{swiper:n,extendParams:i,on:s,emit:a,params:o}=e;n.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,c,d,u,h,f,p,m=o&&o.autoplay?o.autoplay.delay:3e3,g=o&&o.autoplay?o.autoplay.delay:3e3,v=(new Date).getTime;function y(e){n&&!n.destroyed&&n.wrapperEl&&e.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",y),S())}const b=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?c=!0:c&&(g=l,c=!1);const e=n.autoplay.paused?l:v+g-(new Date).getTime();n.autoplay.timeLeft=e,a("autoplayTimeLeft",e,e/m),r=requestAnimationFrame((()=>{b()}))},E=e=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(r),b();let i="undefined"===typeof e?n.params.autoplay.delay:e;m=n.params.autoplay.delay,g=n.params.autoplay.delay;const s=(()=>{let e;if(e=n.virtual&&n.params.virtual.enabled?n.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:n.slides[n.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(s)&&s>0&&"undefined"===typeof e&&(i=s,m=s,g=s),l=i;const o=n.params.speed,c=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(o,!0,!0),a("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,o,!0,!0),a("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(o,!0,!0),a("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,o,!0,!0),a("autoplay")),n.params.cssMode&&(v=(new Date).getTime(),requestAnimationFrame((()=>{E()}))))};return i>0?(clearTimeout(t),t=setTimeout((()=>{c()}),i)):requestAnimationFrame((()=>{c()})),i},_=()=>{n.autoplay.running=!0,E(),a("autoplayStart")},w=()=>{n.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(r),a("autoplayStop")},T=(e,r)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(t),e||(p=!0);const i=()=>{a("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",y):S()};if(n.autoplay.paused=!0,r)return f&&(l=n.params.autoplay.delay),f=!1,void i();const s=l||n.params.autoplay.delay;l=s-((new Date).getTime()-v),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),i())},S=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(v=(new Date).getTime(),p?(p=!1,E(l)):E(),n.autoplay.paused=!1,a("autoplayResume"))},A=()=>{if(n.destroyed||!n.autoplay.running)return;const e=Di();"hidden"===e.visibilityState&&(p=!0,T(!0)),"visible"===e.visibilityState&&S()},k=e=>{"mouse"===e.pointerType&&(p=!0,T(!0))},x=e=>{"mouse"===e.pointerType&&n.autoplay.paused&&S()};s("init",(()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",k),n.el.addEventListener("pointerleave",x)),Di().addEventListener("visibilitychange",A),v=(new Date).getTime(),_())})),s("destroy",(()=>{n.el.removeEventListener("pointerenter",k),n.el.removeEventListener("pointerleave",x),Di().removeEventListener("visibilitychange",A),n.autoplay.running&&w()})),s("beforeTransitionStart",((e,t,r)=>{!n.destroyed&&n.autoplay.running&&(r||!n.params.autoplay.disableOnInteraction?T(!0,!0):w())})),s("sliderFirstMove",(()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?w():(d=!0,u=!1,p=!1,h=setTimeout((()=>{p=!0,u=!0,T(!0)}),200)))})),s("touchEnd",(()=>{if(!n.destroyed&&n.autoplay.running&&d){if(clearTimeout(h),clearTimeout(t),n.params.autoplay.disableOnInteraction)return u=!1,void(d=!1);u&&n.params.cssMode&&S(),u=!1,d=!1}})),s("slideChange",(()=>{!n.destroyed&&n.autoplay.running&&(f=!0)})),Object.assign(n.autoplay,{start:_,stop:w,pause:T,resume:S})}function Zs(e,t){const r=Vi(t);return r!==t&&(r.style.backfaceVisibility="hidden",r.style["-webkit-backface-visibility"]="hidden"),r}function Js(e){let{swiper:t,duration:r,transformElements:n,allSlides:i}=e;const{activeIndex:s}=t;if(t.params.virtualTranslate&&0!==r){let e,r=!1;e=i?n:n.filter((e=>{const r=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(r)===s})),e.forEach((e=>{!function(e,t){t&&e.addEventListener("transitionend",(function r(n){n.target===e&&(t.call(e,n),e.removeEventListener("transitionend",r))}))}(e,(()=>{if(r)return;if(!t||t.destroyed)return;r=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});
1t.wrapperEl.dispatchEvent(e)}))}))}}function ea(e){let{swiper:t,extendParams:r,on:n}=e;r({fadeEffect:{crossFade:!1}});!function(e){const{effect:t,swiper:r,on:n,setTranslate:i,setTransition:s,overwriteParams:a,perspective:o,recreateShadows:l,getEffectParams:c}=e;let d;n("beforeInit",(()=>{if(r.params.effect!==t)return;r.classNames.push(`${r.params.containerModifierClass}${t}`),o&&o()&&r.classNames.push(`${r.params.containerModifierClass}3d`);const e=a?a():{};Object.assign(r.params,e),Object.assign(r.originalParams,e)})),n("setTranslate",(()=>{r.params.effect===t&&i()})),n("setTransition",((e,n)=>{r.params.effect===t&&s(n)})),n("transitionEnd",(()=>{if(r.params.effect===t&&l){if(!c||!c().slideShadows)return;r.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),l()}})),n("virtualUpdate",(()=>{r.params.effect===t&&(r.slides.length||(d=!0),requestAnimationFrame((()=>{d&&r.slides&&r.slides.length&&(i(),d=!1)})))}))}({effect:"fade",swiper:t,on:n,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let r=0;r<e.length;r+=1){const e=t.slides[r];let n=-e.swiperSlideOffset;t.params.virtualTranslate||(n-=t.translate);let i=0;t.isHorizontal()||(i=n,n=0);const s=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),a=Zs(0,e);a.style.opacity=s,a.style.transform=`translate3d(${n}px, ${i}px, 0px)`}},setTransition:e=>{const r=t.slides.map((e=>Vi(e)));r.forEach((t=>{t.style.transitionDuration=`${e}ms`})),Js({swiper:t,duration:e,transformElements:r,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}zs.displayName="SwiperSlide";var ta=r(85518);function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ra.apply(this,arguments)}var na=e=>a.createElement("svg",ra({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",style:{enableBackground:"new 0 0 100 15"},viewBox:"0 0 100 15"},e),a.createElement("path",{d:"m91.7 0-.8.9 5.9 6H0v1.2h96.8l-5.9 6 .8.9 7.5-7.5z",style:{fill:"#fff"}}));function ia(){return ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ia.apply(this,arguments)}var sa=e=>a.createElement("svg",ia({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",style:{enableBackground:"new 0 0 100 15"},viewBox:"0 0 100 15"},e),a.createElement("path",{d:"m8.3 15 .8-.9-5.9-6H100V6.9H3.2l5.9-6-.8-.9L.8 7.5z",style:{fill:"#fff"}}));function aa(e){var t,r;const{title:i,slug:s,leadMedia:l,isHero:d}=e,[u,h]=(0,a.useState)(null),[f,p]=(0,a.useState)(0),m=(0,a.useRef)(),g=(0,a.useRef)(),[v,y]=(0,a.useState)({x:-100,y:-100}),[b,E]=(0,a.useState)("right"),[_,w]=(0,a.useState)(!0),[T,S]=(0,a.useState)(!0),A=e=>{u&&(e.clientX>window.innerWidth/2?u.slideNext():u.slidePrev())};return(0,a.useEffect)((()=>{u&&u.params&&u.navigation&&(u.params.navigation.prevEl=m.current,u.params.navigation.nextEl=g.current,u.navigation.init(),u.navigation.update())}),[u]),(0,a.useEffect)((()=>{ta.tq&&S(!1)}),[]),(0,n.jsxs)("div",{onMouseMove:e=>(e=>{const t=e.target.getBoundingClientRect();y({x:e.clientX-t.left,y:e.clientY-t.top}),E(e.clientX-t.left>t.width/2?"right":"left")})(e),onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),onClick:e=>A(e),className:c().swiperWrapper,children:[(0,n.jsx)("div",{className:"".concat(c().arrowButton," ").concat(c()[b]),style:{top:v.y,left:v.x,opacity:_&&T?1:0},children:"right"===b?(0,n.jsx)(na,{alt:"Next Reference"}):(0,n.jsx)(sa,{alt:"Previous Reference"})}),(0,n.jsx)(Ks,{className:c().swiper,modules:[Qs,Xs,ea,Ys],autoplay:{delay:4e3,disableOnInteraction:!0},effect:"fade",loop:!0,keyboard:!0,navigation:{prevEl:null===(t=m)||void 0===t?void 0:t.current,nextEl:null===(r=g)||void 0===r?void 0:r.current},onSlideChange:e=>p(e.realIndex),onSwiper:h,children:l.map(((e,t)=>(0,n.jsxs)(zs,{onClick:e=>A(e),className:c().swiperSlide,children:["image"===e._type&&(0,n.jsx)(o.E,{image:e,classNames:c().image,width:1200,height:900,mode:"cover"},e._key),"video"===e._type&&(0,n.jsx)(xi,{title:i,slug:s,video:e,autoplay:!0},e._key)]},t)))})]})}function oa(e){const{title:t,slug:r,leadMedia:i,isHero:l}=e,[d,u]=(0,a.useState)(null),[h,f]=(0,a.useState)(0);(0,a.useRef)(),(0,a.useRef)();return(0,n.jsxs)("div",{className:"\n ".concat(c().leadMedia,"\n ").concat(s().leadMedia,"\n ").concat(l?c().isHero:"","\n "),children:[1===i.length&&i.map((e=>"image"===e._type?(0,n.jsx)(o.E,{image:e,classNames:c().image,width:1200,height:900,mode:"cover"},e._key):"video"===e._type?(0,n.jsx)(xi,{title:t,slug:r,video:e,autoplay:!0},e._key):void 0)),i.length>1&&(0,n.jsx)(aa,{title:t,slug:r,leadMedia:i,isHero:l})]})}var la=r(78855),ca=r.n(la),da=r(51729),ua=r(29170),ha=r(11163),fa=r(41648),pa=r(26563);function ma(e){const{title:t,slug:r,textItems:i,noLeadMedia:a,isHero:l,noPhoneIndentation:c}=e,d=(0,ha.useRouter)().asPath,u=(0,fa.Z)(d);return(0,n.jsx)("div",{className:"\n ".concat(ca().textItems," \n ").concat(s().textItems," \n ").concat(a?ca().noLeadMedia:"","\n ").concat(l?ca().isHero:"","\n ").concat(c?ca().noPhoneIndentation:"","\n "),children:i.map((e=>"textItem"===e._type?(0,n.jsxs)("div",{className:"".concat(ca().item," ").concat(ca().textItem),children:[e.title&&(0,n.jsx)("h2",{className:ca().title,children:e.title}),(0,n.jsx)(da.Z,{value:e.text})]},e._key):"internalLink"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().internalLinkItem),children:(0,n.jsx)(ua.Z,{title:e.title,type:e.reference._type,slug:e.reference.slug||"",currentPath:u})},e._key):"externalLink"===e._type||"donationFormLink"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().externalLinkItem),children:(0,n.jsx)(pa.Z,{title:e.title,url:e.url,newWindow:e.newWindow,classNames:ca().link})},e._key):"emailFormReference"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().emailFormReferenceItem),children:(0,n.jsx)(ua.Z,{title:e.title,type:e._type,slug:e.slug,currentPath:u})},e._key):"modalDonate"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().modalDonateItem),children:(0,n.jsx)(ua.Z,{title:e.title,type:e._type,slug:e.slug,currentPath:u})},e._key):"modalFriend"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().modalFriendItem),children:(0,n.jsx)(ua.Z,{title:e.title,type:e._type,slug:e.slug,currentPath:u})},e._key):"modalNewsletter"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().modalNewsletterItem),children:(0,n.jsx)(ua.Z,{title:e.title,type:e._type,slug:e.slug,currentPath:u})},e._key):"inlineImage"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().inlineImageItem),children:(0,n.jsx)(o.E,{image:e,classNames:ca().image},e._key)},e._key):"peopleList"===e._type?(0,n.jsx)("div",{className:"".concat(ca().item," ").concat(ca().peopleListItem),children:e.people&&e.people.length&&(0,n.jsx)("div",{className:ca().peopleList,children:e.people.map((e=>(0,n.jsxs)("div",{className:ca().person,children:[(0,n.jsx)("div",{className:ca().personImage,children:(0,n.jsx)(o.E,{image:e.image,classNames:ca().image,width:900,height:900,mode:"cover"},e._key)}),(0,n.jsxs)("div",{className:ca().personText,children:[(0,n.jsx)("div",{className:ca().personName,children:e.name}),(0,n.jsx)(da.Z,{value:e.body}),e.externalLinks&&e.externalLinks.length&&(0,n.jsx)("div",{className:ca().personLinks,children:e.externalLinks.map((e=>(0,n.jsx)(pa.Z,{title:e.title,url:e.url,newWindow:e.newWindow,classNames:ca().link},e._key)))})]})]},e._key)))})},e._key):(0,n.jsxs)("div",{className:"".concat(ca().item),children:[e._type," is not yet supported"]},e._key)))})}function ga(e){const{title:t,slug:r,block:i,firstBlockIsHero:a,firstBlockIsTextOnly:o,noPhoneIndentation:l}=e,c=i.textItems&&i.textItems.some((e=>"internalLink"===e._type&&e.reference&&"thePlantLibrary"===e.reference._type));return(0,n.jsxs)("div",{className:"\n ".concat(s().pageBuilderBlock," \n ").concat(i.leadMedia&&i.leadMedia.length?s().hasLeadMedia:s().noLeadMedia,"\n ").concat(a?s().firstBlockIsHero:"","\n ").concat(o?s().firstBlockIsTextOnly:"","\n ").concat(c?s().hasThePlantLibraryLink:"","\n ").concat(l?s().noPhoneIndentation:"","\n "),children:[i.leadMedia&&i.leadMedia.length&&(0,n.jsx)(oa,{title:t,slug:r,leadMedia:i.leadMedia,isHero:a}),i.textItems&&i.textItems.length&&(0,n.jsx)(ma,{title:t,slug:r,textItems:i.textItems,noLeadMedia:!i.leadMedia||!i.leadMedia.length,isHero:a,noPhoneIndentation:l})]})}},87725:function(e,t,r){"use strict";r.d(t,{E:function(){return T}});var n=r(85893),i=r(67294),s=/^image-([\da-f]+)-(\d+x\d+)-(\w+)$/,a=e=>{let t=s.exec(e),[,r,n,i]=null!=t?t:[];if(!t||!r||!n||!i)throw new Error(`Could not parse image ID "${e}"`);let[a,o]=n.split("x").map((e=>Number.parseInt(e,10)));if(Number.isNaN(a)||Number.isNaN(o)||!a||!o)throw new Error(`Invalid dimensions "${n}"`);return{assetId:r,dimensions:{height:o,width:a,aspectRatio:a/o},format:i}},o=e=>{let t=e.lastIndexOf("-");return e.slice(6,t)+"."+e.slice(t+1)},l=({id:e,baseUrl:t})=>{let{assetId:r,dimensions:n,format:i}=a(e);return{src:`${t}${r}-${n.width}x${n.height}.${i}`,width:n.width,height:n.height}},c=e=>e<160?[.5,1,2]:e<750?[.5,1,1.5,2]:e<1400?[.25,.5,.75,1,1.5,2]:[.25,.5,.75,1,1.25,1.5,1.75,2],d=({id:e,mode:t="contain",width:r,height:n,hotspot:i,crop:s,queryParams:o,options:{includeMetadata:l=!1}={}})=>{let c=a(e).dimensions,{width:d,height:m,aspectRatio:g}=s?f(c,s):c;if(r||(n?(r=Math.round(n*g),n=void 0):r=Math.round(d/2)),"cover"!==t||r&&n&&r/n!==g?"contain"===t&&n&&(r=Math.min(r,Math.round(n*g)),n=void 0):t="contain",r>d||n&&n>m){let e=n?r/n:g;e>=g?(r=d,n=n&&Math.round(r/e)):(n=m,r=Math.round(n*e))}let v={w:r,q:75,...o};if(v.fm||(v.auto="format"),s&&(v.rect=p(c,s)),"cover"===t)if(v.fit="crop",n&&(v.h=n),i){let e=s?i.x/(1-s.left-s.right):i.x,t=s?i.y/(1-s.top-s.bottom):i.y;v["fp-x"]=h(u(e,0,1),3),v["fp-y"]=h(u(t,0,1),3)}else v.crop="entropy";else v.fit="max";if(l){let e=n||Math.round(r/g);v.metadata={sourceDimensions:c,outputDimensions:{width:r,height:e,aspectRatio:r/e}}}return v},u=(e,t,r)=>
1Math.max(t,Math.min(r,e)),h=(e,t)=>Math.round(e*Math.pow(10,t))/Math.pow(10,t),f=(e,t)=>{if(t.left+t.right>=1||t.top+t.bottom>=1)throw new Error(`Invalid crop: ${JSON.stringify(t)}; crop values must be less than 1`);let r=Math.round(e.width*(1-t.left-t.right)),n=Math.round(e.height*(1-t.top-t.bottom));return{width:r,height:n,aspectRatio:r/n}},p=(e,t)=>{let{width:r,height:n}=f(e,t);return[Math.round(t.left*e.width),Math.round(t.top*e.height),r,n].join(",")},m=e=>new URLSearchParams(Object.entries(e).sort((([e],[t])=>e.localeCompare(t))).map((([e,t])=>[e,String(t)]))).toString().replace(/%2C/g,","),g=({as:e,preview:t,...r})=>{let[n,s]=(0,i.useState)(!1),a=(0,i.useRef)(null),o=()=>{s(!0)};(0,i.useEffect)((()=>{var e;null!=(e=a.current)&&e.complete&&o()}));let l=e||"img";return i.createElement(i.Fragment,null,!n&&i.createElement(l,{alt:r.alt,className:r.className,"data-lqip":!0,height:r.height,id:r.id,src:t,style:r.style,width:r.width}),i.createElement(l,{"data-loading":!n||null,onLoad:o,ref:a,style:n?void 0:{height:"10px !important",opacity:0,pointerEvents:"none",position:"absolute",userSelect:"none",width:"10px !important",zIndex:-10},...r}))},v=({as:e,baseUrl:t,projectId:r,dataset:n,id:s,hotspot:a,crop:u,width:h,height:f,mode:p="contain",preview:v,htmlWidth:y,htmlHeight:b,htmlId:E,queryParams:_,...w})=>{var T,S;if(!s)throw new Error("Missing required `id` prop for <SanityImage>.");if(!t&&(!r||!n))throw new Error("Missing required `baseUrl` or `projectId` and `dataset` props for <SanityImage>.");t=null!=t?t:`https://cdn.sanity.io/images/${r}/${n}/`;let A=s.endsWith("-svg"),k=v&&!A?g:null!=e?e:"img",x={alt:null!=(T=w.alt)?T:"",loading:null!=(S=w.loading)?S:"lazy",id:E,...w};if(A)return i.createElement(k,{...l({id:s,baseUrl:t}),...x});let L={baseUrl:t,id:s,crop:u,hotspot:a,width:h,height:f,mode:p,queryParams:_},{src:I,...R}=(({baseUrl:e,...t})=>{let{metadata:r,...n}=d({...t,options:{includeMetadata:!0}});if(!r)throw new Error("Missing image output metadata");return{src:`${e}${o(t.id)}?${m(n)}`,width:r.outputDimensions.width,height:r.outputDimensions.height}})(L);return x.srcSet=(({id:e,mode:t="contain",width:r,height:n,hotspot:i,crop:s,baseUrl:a,...l})=>{let{w:u,h:h}=d({id:e,mode:t,width:r,height:n,hotspot:i,crop:s}),f=`${a}${o(e)}`,p=c(u).map((r=>{let n=Math.round(u*r),a=h&&Math.round(h*r);if(r<1&&n<50)return null;let o=d({id:e,mode:t,width:n,height:a,hotspot:i,crop:s,...l});return`${f}?${m(o)} ${o.w}w`})).filter((e=>!!e));return Array.from(new Set(p))})(L).join(", "),x.src=I,x.width=null!=y?y:R.width,x.height=null!=b?b:R.height,v&&(x.as=null!=e?e:"img",x.preview=v),i.createElement(k,{...x})},y=r(34364),b=r(36407),E=r.n(b);const _="https://cdn.sanity.io/images/".concat(y.Sx,"/").concat(y.gx,"/"),w=e=>{const{handleImageLoadInParent:t}=e,r={...e};delete r.handleImageLoadInParent;const[s,a]=(0,i.useState)(!1),o=(0,i.useRef)(null);return(0,i.useEffect)((()=>{o&&o.current&&o.current.complete&&a(!0)}),[]),(0,i.useEffect)((()=>{s&&o&&o.current&&(o.current.removeAttribute("data-loading"),t&&t())}),[s]),(0,n.jsx)("img",{ref:o,onLoad:()=>a(!0),"data-loading":!0,...r})},T=e=>{const{image:t,classNames:r,useAspectRatio:i,handleImageLoadInParent:s}=e,{id:a,preview:o,aspectRatio:l}=t,c={...e};return delete c.classNames,delete c.useAspectRatio,delete c.usePreview,delete c.handleImageLoadInParent,(0,n.jsx)(v,{as:w,id:a,baseUrl:_,className:"".concat(E().image," ").concat(r),style:i?{aspectRatio:l}:void 0,handleImageLoadInParent:s,...c},a)}},63729:function(e,t,r){"use strict";r.d(t,{M:function(){return a},m:function(){return o}});var n=r(85893),i=r(67294);const s=(0,i.createContext)();function a(e){let{children:t}=e;const[r,a]=(0,i.useState)(0),o={_id:"all",title:"View all",slug:"all"},[l,c]=(0,i.useState)(o),[d,u]=(0,i.useState)(!1),[h,f]=(0,i.useState)(o);return(0,n.jsx)(s.Provider,{value:{navBackgroundOpacityContext:[r,a],defaultCategory:o,activeEventsCategoryContext:[l,c],showPastEventsContext:[d,u],activeNewsItemsCategoryContext:[h,f]},children:t})}function o(){return(0,i.useContext)(s)}},62999:function(e,t,r){"use strict";r.d(t,{h:function(){return o},s:function(){return l}});var n=r(85893),i=r(67294),s=r(39332);const a=(0,i.createContext)();function o(e){let{children:t}=e;const r=(0,s.usePathname)(),[o,l]=(0,i.useState)(!r||"/"===r);return(0,n.jsx)(a.Provider,{value:[o,l],children:t})}function l(){return(0,i.useContext)(a)}},34364:function(e,t,r){"use strict";r.d(t,{Sx:function(){return a},gx:function(){return s},hH:function(){return i},tW:function(){return o},wc:function(){return l}});var n=r(34155);const i=!1,s=c("production","Missing environment variable: NEXT_PUBLIC_SANITY_DATASET"),a=c("9dcwv191","Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID"),o=(n.env.SANITY_API_READ_TOKEN,n.env.NEXT_PUBLIC_SANITY_API_VERSION||"2023-06-21"),l="preview.secret";function c(e,t){if(void 0===e)throw new Error(t);return e}},85363:function(e,t,r){"use strict";function n(e,t,r){switch(e){case"page":return t?"homepage"===t?"/":"/".concat(t):void 0;
1case"event":return t?"/whats-on/".concat(t):void 0;case"newsItem":return t?"/news/".concat(t):void 0;case"plantLibraryBed":return t?"/the-plant-library/".concat(t):void 0;case"modalDonate":case"modalFriend":case"modalNewsletter":case"emailFormReference":return t?"".concat(r||"/").concat(t):void 0;case"thePlantLibrary":return"".concat(r||"/","?fullWidthModal=the-plant-library");default:return console.warn("Invalid document type:",e),"/"}}r.d(t,{c:function(){return n}})},28530:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return s}});const r=new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}}const i=globalThis.AsyncLocalStorage;function s(){return i?new i:new n}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25182:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return n}});r(67294);function n(e){0}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},31414:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return f},useSearchParams:function(){return p},usePathname:function(){return m},ServerInsertedHTMLContext:function(){return l.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return l.useServerInsertedHTML},useRouter:function(){return g},useParams:function(){return y},useSelectedLayoutSegments:function(){return E},useSelectedLayoutSegment:function(){return _},redirect:function(){return c.redirect},notFound:function(){return d.notFound}});const n=r(67294),i=r(24224),s=r(78463),a=r(25182),o=r(72526),l=r(43014),c=r(48781),d=r(78147),u=Symbol("internal for urlsearchparams readonly");function h(){return new Error("ReadonlyURLSearchParams cannot be modified")}class f{[Symbol.iterator](){return this[u][Symbol.iterator]()}append(){throw h()}delete(){throw h()}set(){throw h()}sort(){throw h()}constructor(e){this[u]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e)}}function p(){(0,a.clientHookInServerComponentError)("useSearchParams");const e=(0,n.useContext)(s.SearchParamsContext);return(0,n.useMemo)((()=>e?new f(e):null),[e])}function m(){return(0,a.clientHookInServerComponentError)("usePathname"),(0,n.useContext)(s.PathnameContext)}function g(){(0,a.clientHookInServerComponentError)("useRouter");const e=(0,n.useContext)(i.AppRouterContext);if(null===e)throw new Error("invariant expected app router to be mounted");return e}function v(e,t){void 0===t&&(t={});const r=e[1];for(const n of Object.values(r)){const e=n[0],r=Array.isArray(e),i=r?e[1]:e;if(!i||i.startsWith("__PAGE__"))continue;r&&("c"===e[2]||"oc"===e[2])?t[e[0]]=e[1].split("/"):r&&(t[e[0]]=e[1]),t=v(n,t)}return t}function y(){(0,a.clientHookInServerComponentError)("useParams");const e=(0,n.useContext)(i.GlobalLayoutRouterContext);return e?v(e.tree):null}function b(e,t,r,n){let i;if(void 0===r&&(r=!0),void 0===n&&(n=[]),r)i=e[1][t];else{const t=e[1];var s;i=null!=(s=t.children)?s:Object.values(t)[0]}if(!i)return n;const a=i[0],l=(0,o.getSegmentValue)(a);return!l||l.startsWith("__PAGE__")?n:(n.push(l),b(i,t,!1,n))}function E(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegments");const{tree:t}=(0,n.useContext)(i.LayoutRouterContext);return b(t,e)}function _(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("use
1SelectedLayoutSegment");const t=E(e);return 0===t.length?null:t[0]}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78147:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{notFound:function(){return n},isNotFoundError:function(){return i}});const r="NEXT_NOT_FOUND";function n(){const e=new Error(r);throw e.digest=r,e}function i(e){return(null==e?void 0:e.digest)===r}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},48781:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectType:function(){return s},getRedirectError:function(){return a},redirect:function(){return o},isRedirectError:function(){return l},getURLFromRedirectError:function(){return c},getRedirectTypeFromError:function(){return d}});const n=r(34505),i="NEXT_REDIRECT";var s;function a(e,t){const r=new Error(i);r.digest="NEXT_REDIRECT;"+t+";"+e;const s=n.requestAsyncStorage.getStore();return s&&(r.mutableCookies=s.mutableCookies),r}function o(e,t){throw void 0===t&&(t="replace"),a(e,t)}function l(e){if("string"!==typeof(null==e?void 0:e.digest))return!1;const[t,r,n]=e.digest.split(";",3);return t===i&&("replace"===r||"push"===r)&&"string"===typeof n}function c(e){return l(e)?e.digest.split(";",3)[2]:null}function d(e){if(!l(e))throw new Error("Not a redirect error");return e.digest.split(";",3)[1]}!function(e){e.push="push",e.replace="replace"}(s||(s={})),("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return n}});const n=(0,r(28530).createAsyncLocalStorage)();("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},72526:function(e,t){"use strict";function r(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13991:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PrefetchKind:function(){return c},ACTION_REFRESH:function(){return r},ACTION_NAVIGATE:function(){return n},ACTION_RESTORE:function(){return i},ACTION_SERVER_PATCH:function(){return s},ACTION_PREFETCH:function(){return a},ACTION_FAST_REFRESH:function(){return o},ACTION_SERVER_ACTION:function(){return l}});const r="refresh",n="navigate",i="restore",s="server-patch",a="prefetch",o="fast-refresh",l="server-action";var c;!function(e){e.AUTO="auto",e.FULL="full",e.TEMPORARY="temporary"}(c||(c={})),("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81516:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}});r(82387);function n(e,t,r,n){return!1}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
1dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},95569:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});const n=r(38754)._(r(67294)),i=r(14532),s=r(83353),a=r(61410),o=r(79064),l=r(370),c=r(69955),d=r(24224),u=r(80508),h=r(81516),f=r(64266),p=r(13991),m=new Set;function g(e,t,r,n,i,a){if(!a&&!(0,s.isLocalURL)(t))return;if(!n.bypassPrefetchedCheck){const i=t+"%"+r+"%"+("undefined"!==typeof n.locale?n.locale:"locale"in e?e.locale:void 0);if(m.has(i))return;m.add(i)}const o=a?e.prefetch(t,i):e.prefetch(t,r,n);Promise.resolve(o).catch((e=>{0}))}function v(e){return"string"===typeof e?e:(0,a.formatUrl)(e)}const y=n.default.forwardRef((function(e,t){let r;const{href:a,as:m,children:y,prefetch:b=null,passHref:E,replace:_,shallow:w,scroll:T,locale:S,onClick:A,onMouseEnter:k,onTouchStart:x,legacyBehavior:L=!1,...I}=e;r=y,!L||"string"!==typeof r&&"number"!==typeof r||(r=n.default.createElement("a",null,r));const R=n.default.useContext(c.RouterContext),D=n.default.useContext(d.AppRouterContext),C=null!=R?R:D,P=!R,O=!1!==b,M=null===b?p.PrefetchKind.AUTO:p.PrefetchKind.FULL;const{href:N,as:F}=n.default.useMemo((()=>{if(!R){const e=v(a);return{href:e,as:m?v(m):e}}const[e,t]=(0,i.resolveHref)(R,a,!0);return{href:e,as:m?(0,i.resolveHref)(R,m):t||e}}),[R,a,m]),U=n.default.useRef(N),B=n.default.useRef(F);let j;L&&(j=n.default.Children.only(r));const $=L?j&&"object"===typeof j&&j.ref:t,[V,H,G]=(0,u.useIntersection)({rootMargin:"200px"}),q=n.default.useCallback((e=>{B.current===F&&U.current===N||(G(),B.current=F,U.current=N),V(e),$&&("function"===typeof $?$(e):"object"===typeof $&&($.current=e))}),[F,$,N,G,V]);n.default.useEffect((()=>{C&&H&&O&&g(C,N,F,{locale:S},{kind:M},P)}),[F,N,H,S,O,null==R?void 0:R.locale,C,P,M]);const W={ref:q,onClick(e){L||"function"!==typeof A||A(e),L&&j.props&&"function"===typeof j.props.onClick&&j.props.onClick(e),C&&(e.defaultPrevented||function(e,t,r,i,a,o,l,c,d,u){const{nodeName:h}=e.currentTarget;if("A"===h.toUpperCase()&&(function(e){const t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!d&&!(0,s.isLocalURL)(r)))return;e.preventDefault();const f=()=>{const e=null==l||l;"beforePopState"in t?t[a?"replace":"push"](r,i,{shallow:o,locale:c,scroll:e}):t[a?"replace":"push"](i||r,{forceOptimisticNavigation:!u,scroll:e})};d?n.default.startTransition(f):f()}(e,C,N,F,_,w,T,S,P,O))},onMouseEnter(e){L||"function"!==typeof k||k(e),L&&j.props&&"function"===typeof j.props.onMouseEnter&&j.props.onMouseEnter(e),C&&(!O&&P||g(C,N,F,{locale:S,priority:!0,bypassPrefetchedCheck:!0},{kind:M},P))},onTouchStart(e){L||"function"!==typeof x||x(e),L&&j.props&&"function"===typeof j.props.onTouchStart&&j.props.onTouchStart(e),C&&(!O&&P||g(C,N,F,{locale:S,priority:!0,bypassPrefetchedCheck:!0},{kind:M},P))}};if((0,o.isAbsoluteUrl)(F))W.href=F;else if(!L||E||"a"===j.type&&!("href"in j.props)){const e="undefined"!==typeof S?S:null==R?void 0:R.locale,t=(null==R?void 0:R.isLocaleDomain)&&(0,h.getDomainLocale)(F,e,null==R?void 0:R.locales,null==R?void 0:R.domainLocales);W.href=t||(0,f.addBasePath)((0,l.addLocale)(F,e,null==R?void 0:R.defaultLocale))}return L?n.default.cloneElement(j,W):n.default.createElement("a",{...I,...W},r)}));("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80508:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return c}});const n=r(67294),i=r(10029),s="function"===typeof IntersectionObserver,a=new Map,o=[];function l(e,t,r){const{id:n,observer:i,elements:s}=function(e){const t={root:e.root||null,margin:e.rootMargin||""},r=o.find((e=>e.root===t.root&&e.margin===t.margin));let n;if(r&&(n=a.get(r),n))return n;const i=new Map,s=new IntersectionObserver((e=>{e.forEach((e=>{const t=i.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)}))}),e);return n={id:t,observer:s,elements:i},o.push(t),a.set(t,n),n}(r);return s.set(e,t),i.observe(e),function(){if(s.delete(e),i.unobserve(e),0===s.size){i.disconnect(),a.delete(n);const e=o.findIndex((e=>e.root===n.root&&e.margin===n.margin));e>-1&&o.splice(e,1)}}}function c(e){let{rootRef:t,rootMargin:r,disabled:a}=e;
1const o=a||!s,[c,d]=(0,n.useState)(!1),u=(0,n.useRef)(null),h=(0,n.useCallback)((e=>{u.current=e}),[]);(0,n.useEffect)((()=>{if(s){if(o||c)return;const e=u.current;if(e&&e.tagName){return l(e,(e=>e&&d(e)),{root:null==t?void 0:t.current,rootMargin:r})}}else if(!c){const e=(0,i.requestIdleCallback)((()=>d(!0)));return()=>(0,i.cancelIdleCallback)(e)}}),[o,r,t,c,u.current]);const f=(0,n.useCallback)((()=>{d(!1)}),[]);return[h,c,f]}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43014:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return s}});const n=r(61757)._(r(67294)),i=n.default.createContext(null);function s(e){const t=(0,n.useContext)(i);t&&t(e)}},55326:function(e,t,r){"use strict";r.r(t),r.d(t,{App:function(){return sn},default:function(){return an}});var n=r(85893),i=r(67294),s=(r(52168),r(11163)),a=r(80727),o=r(14719),l=r(70398),c=r(81879);function d({children:e,features:t,strict:r=!1}){const[,n]=(0,i.useState)(!u(t)),s=(0,i.useRef)(void 0);if(!u(t)){const{renderer:e,...r}=t;s.current=e,(0,c.K)(r)}return(0,i.useEffect)((()=>{u(t)&&t().then((({renderer:e,...t})=>{(0,c.K)(t),s.current=e,n(!0)}))}),[]),i.createElement(l.u.Provider,{value:{renderer:s.current,strict:r}},e)}function u(e){return"function"===typeof e}var h=r(51526),f=r(31150),p=r(4007);const m=(0,f.D)(p.w);var g=r(63729);const v=(0,i.createContext)();function y(e){let{children:t}=e;const[r,a]=(0,i.useState)(null),o=(0,s.useRouter)(),l=e=>{var t;const[r]=(null===(t=e)||void 0===t?void 0:t.split("?"))||[];r!==o.asPath&&a(o.asPath)};(0,i.useEffect)((()=>(o.events.on("beforeHistoryChange",l),()=>{o.events.off("beforeHistoryChange",l)})),[o.asPath]);const c={previousRoute:r,setPreviousRoute:a};return(0,n.jsx)(v.Provider,{value:c,children:t})}var b=r(62999);function E(e){let{preview:t,loading:r}=e;return t?(0,n.jsx)("div",{className:"border-b border-accent-7 bg-accent-7 text-white",children:(0,n.jsxs)("div",{className:"py-2 text-center text-sm",children:[r?"Loading... ":"This page is a preview. ",(0,n.jsx)("a",{href:"/api/exit-preview",className:"underline transition-colors duration-200 hover:text-cyan",children:"Click here"})," ","to exit preview mode."]})}):null}var _,w,T=r(60945),S=r(85363);function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}var k=e=>i.createElement("svg",A({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"menu_svg__Layer_1",x:0,y:0,style:{enableBackground:"new 0 0 32 32"},viewBox:"0 0 32 32"},e),_||(_=i.createElement("style",null,".menu_svg__st0{fill:none;stroke:#000;stroke-width:1.5;stroke-linejoin:bevel}")),w||(w=i.createElement("path",{d:"M16 1.5v29M30.5 16h-29",className:"menu_svg__st0"}))),x=r(77897),L=r.n(x),I=r(41648);function R(e){const{header:t,isSplashActive:r,headerColor:a}=e,{navigation:o}=t,l=(0,s.useRouter)(),c=l.asPath,[d,u]=(0,i.useState)(!1),{navBackgroundOpacityContext:h,defaultCategory:f,activeEventsCategoryContext:p,showPastEventsContext:m}=(0,g.m)(),[v,y]=h,[b,E]=p,[_,w]=m,A=()=>{u(!1)},x=e=>{e.slug===l.asPath&&u(!1),"whats-on"===e.slug&&(E(f),w(!1))};(0,i.useEffect)((()=>{A()}),[c]);const[R,D]=(0,i.useState)(0),[C,P]=(0,i.useState)(!0),O=()=>{const e=window.scrollY,t=e<50||R>e;t&&y(1),D(e),P(t)};return(0,i.useEffect)((()=>(window.addEventListener("scroll",O),()=>window.removeEventListener("scroll",O))),[R,C,O]),(0,n.jsxs)("nav",{className:"\n ".concat(L().nav," \n ").concat(C||d?L().visible:L().hidden,"\n ").concat(r?L().splashActive:"","\n "),style:{"--visible-background-color":a,"--nav-background-opacity":v},children:[(0,n.jsx)("div",{className:L().background}),(0,n.jsxs)("ul",{className:L().navItemsLaptopDesktop,children:[(0,n.jsx)("li",{className:L().navLogo,children:(0,n.jsx)(T.Z,{href:"/",children:"The Serge Hill Project"})}),o.map((e=>(0,n.jsx)("li",{className:"\n ".concat(L().navItem,"\n ").concat((0,S.c)(e._type,e.slug)===(0,I.Z)(l.asPath)?L().active:"","\n "),children:(0,n.jsx)(T.Z,{href:(0,S.c)(e._type,e.slug),onClick:()=>x(e),children:e.title})},e._id)))]}),(0,n.jsxs)("div",{className:L().navItemsPhoneTabletControls,children:[(0,n.jsx)("div",{className:L().navItemsPhoneTabletTitle,children:(0,n.jsx)(T.Z,{href:"/",children:"The Serge Hill Project"})}),(0,n.jsx)("button",{className:L().navItemsPhoneTabletButton,onClick:d?A:()=>{u(!0)},"aria-label":d?"Close Menu":"Open Menu",children:(0,n.jsx)(k,{className:"".concat(L().svg," ").concat(d?L().active:"")})})]}),(0,n.jsxs)("ul",{className:"".concat(L().navItemsPhoneTablet," ").concat(d?L().isActive:""),children:[(0,n.jsx)("li",{className:L().navLogo,children:(0,n.jsx)(T.Z,{href:"/",className:L().navLogoLink,children:"The Serge Hill Project"})}),o.map((e=>(0,n.jsx)("li",{className:"\n ".concat(L().navItem,"\n ").concat((0,S.c)(e._type,e.slug)===(0,I.Z)(l.asPath)?L().active:"","\n "),children:(0,n.jsx)(T.Z,{href:(0,S.c)(e._type,e.slug),onClick:()=>x(e),children:e.title})},e._id)))]})]})}
1var D=r(543),C=r.n(D);function P(e){const{footer:t,isSplashActive:r}=e,{navigation:i,addressInformation:a}=t,o=(0,s.useRouter)().asPath,l=(0,I.Z)(o);return(0,n.jsxs)("div",{className:C().footer,children:[(0,n.jsxs)("div",{className:C().addressWrapperWrapper,children:[a&&a.companyNumber&&(0,n.jsx)("p",{className:C().addressWrapper,children:a.companyNumber}),a&&a.address&&a.googleMapsLink&&(0,n.jsx)("p",{className:C().addressWrapper,children:(0,n.jsx)("a",{className:C().address,href:a.googleMapsLink,target:"_blank",rel:"noopener noreferrer",children:a.address})})]}),(0,n.jsx)("ul",{className:C().navItems,children:i.map((e=>(0,n.jsx)("li",{className:C().navItem,children:["linkExternal","linkDonationForm"].includes(e._type)?(0,n.jsx)("a",{href:e.url,target:e.newWindow?"_blank":"_self",rel:"noopener noreferrer",children:e.title}):(0,n.jsx)(T.Z,{href:(0,S.c)(e._type,e.slug,l),children:e.title})},e._id)))})]})}var O=r(12795),M=r.n(O),N=r(70491),F=r.n(N),U=r(51729),B=r(67296),j=r(87536),$=r(55851);function V(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),function(n,i,s){try{return Promise.resolve(function(a,o){try{var l=(t.context,Promise.resolve(e["sync"===r.mode?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return s.shouldUseNativeValidation&&(0,$.M)({},s),{values:r.raw?n:e,errors:{}}})))}catch(c){return o(c)}return l&&l.then?l.then(void 0,o):l}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:(0,$._)((t=e,r=!s.shouldUseNativeValidation&&"all"===s.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),r){var n=e[t.path].types,i=n&&n[t.type];e[t.path]=(0,j.KN)(t.path,r,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),s)};var t,r})))}catch(a){return Promise.reject(a)}}}var H=r(55760),G=r(59885),q=r(94633),W=r.n(q);const K=Object.prototype.toString,z=Error.prototype.toString,Y=RegExp.prototype.toString,X="undefined"!==typeof Symbol?Symbol.prototype.toString:()=>"",Q=/^Symbol\((.*)\)(.*)$/;function Z(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return X.call(e).replace(Q,"Symbol($1)");const n=K.call(e).slice(8,-1);return"Date"===n?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===n||e instanceof Error?"["+z.call(e)+"]":"RegExp"===n?Y.call(e):null}function J(e,t){let r=Z(e,t);return null!==r?r:JSON.stringify(e,(function(e,r){let n=Z(this[e],t);return null!==n?n:r}),2)}function ee(e){return null==e?[]:[].concat(e)}let te=/\$\{\s*(\w+)\s*\}/g;class re extends Error{static formatError(e,t){const r=t.label||t.path||"this";return r!==t.path&&(t=Object.assign({},t,{path:r})),"string"===typeof e?e.replace(te,((e,r)=>J(t[r]))):"function"===typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=r,this.type=n,this.errors=[],this.inner=[],ee(e).forEach((e=>{re.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,re)}}let ne={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=null!=n&&n!==r?` (cast from the value \`${J(n,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${J(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${J(r,!0)}\``+i}},ie={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},se={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ae={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},oe={isValue:"${path} field must be ${value}"},le={noUnknown:"${path} field has unspecified keys: ${unknown}"},ce={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:ne,string:ie,number:se,date:ae,object:le,array:ce,boolean:oe});const de=e=>e&&e.__isYupSchema__;class ue{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:i}=t,s="function"===typeof r?r:(...e)=>e.every((e=>e===r));return new ue(e,((e,t)=>
1{var r;let a=s(...e)?n:i;return null!=(r=null==a?void 0:a(t))?r:t}))}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),n=this.fn(r,e,t);if(void 0===n||n===e)return e;if(!de(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const he="$",fe=".";class pe{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!==typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===he,this.isValue=this.key[0]===fe,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?he:this.isValue?fe:"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,H.getter)(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}pe.prototype.__isYupRef=!0;const me=e=>null==e;function ge(e){function t({value:t,path:r="",options:n,originalValue:i,schema:s},a,o){const{name:l,test:c,params:d,message:u,skipAbsent:h}=e;let{parent:f,context:p,abortEarly:m=s.spec.abortEarly}=n;function g(e){return pe.isRef(e)?e.getValue(t,f,p):e}function v(e={}){const n=Object.assign({value:t,originalValue:i,label:s.spec.label,path:e.path||r,spec:s.spec},d,e.params);for(const t of Object.keys(n))n[t]=g(n[t]);const a=new re(re.formatError(e.message||u,n),t,n.path,e.type||l);return a.params=n,a}const y=m?a:o;let b={path:r,parent:f,type:l,from:n.from,createError:v,resolve:g,options:n,originalValue:i,schema:s};const E=e=>{re.isError(e)?y(e):e?o(null):y(v())},_=e=>{re.isError(e)?y(e):a(e)},w=h&&me(t);if(!n.sync){try{Promise.resolve(!!w||c.call(b,t,b)).then(E,_)}catch(A){_(A)}return}let T;try{var S;if(T=!!w||c.call(b,t,b),"function"===typeof(null==(S=T)?void 0:S.then))throw new Error(`Validation test of type: "${b.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(A){return void _(A)}E(T)}return t.OPTIONS=e,t}function ve(e,t,r,n=r){let i,s,a;return t?((0,H.forEach)(t,((o,l,c)=>{let d=l?o.slice(1,o.length-1):o,u="tuple"===(e=e.resolve({context:n,parent:i,value:r})).type,h=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(r&&h>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[h],e=u?e.spec.types[h]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=r,r=r&&r[d],e=e.fields[d]}s=d,a=l?"["+o+"]":"."+o})),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class ye extends Set{describe(){const e=[];for(const t of this.values())e.push(pe.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new ye(this.values())}merge(e,t){const r=this.clone();return e.forEach((e=>r.add(e))),t.forEach((e=>r.delete(e))),r}}function be(e,t=new Map){if(de(e)||!e||"object"!==typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=be(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,be(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(be(n,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=be(i,t)}return r}class Ee{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ye,this._blacklist=new ye,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(ne.notType)})),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation((e=>{e.nonNullable()}))}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));
vendor: 10,097 bytes, line 1
1return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=be(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const n=Object.assign({},t.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce(((t,r)=>r.resolve(t,e)),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=e.recursive)?n:this.spec.recursive})}cast(e,t={}){let r=this.resolve(Object.assign({value:e},t)),n="ignore-optionality"===t.assert,i=r._cast(e,t);if(!1!==t.assert&&!r.isType(i)){if(n&&me(i))return i;let s=J(e),a=J(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${s} \n`+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,t){let r=void 0===e?e:this.transforms.reduce(((t,r)=>r.call(this,t,e,this)),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let l=[];for(let c of Object.values(this.internalTests))c&&l.push(c);this.runTests({path:i,value:o,originalValue:s,options:t,tests:l},r,(e=>{if(e.length)return n(e,o);this.runTests({path:i,value:o,originalValue:s,options:t,tests:this.tests},r,n)}))}runTests(e,t,r){let n=!1,{tests:i,value:s,originalValue:a,path:o,options:l}=e,c=e=>{n||(n=!0,t(e,s))},d=e=>{n||(n=!0,r(e,s))},u=i.length,h=[];if(!u)return d([]);let f={value:s,originalValue:a,path:o,options:l,schema:this};for(let p=0;p<i.length;p++){(0,i[p])(f,c,(function(e){e&&(h=h.concat(e)),--u<=0&&d(h)}))}}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:i,options:s}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"===typeof a;let l=r[a];const c=Object.assign({},s,{strict:!0,parent:r,value:l,originalValue:i[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${n||""}[${l?a:`"${a}"`}]`:(n?`${n}.`:"")+e});return(e,t,r)=>this.resolve(c)._validate(l,c,t,r)}validate(e,t){let r=this.resolve(Object.assign({},t,{value:e}));return new Promise(((n,i)=>r._validate(e,t,((e,t)=>{re.isError(e)&&(e.value=t),i(e)}),((e,t)=>{e.length?i(new re(e,t)):n(t)}))))}validateSync(e,t){let r;return this.resolve(Object.assign({},t,{value:e}))._validate(e,Object.assign({},t,{sync:!0}),((e,t)=>{throw re.isError(e)&&(e.value=t),e}),((t,n)=>{if(t.length)throw new re(t,e);r=n})),r}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(re.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(r){if(re.isError(r))return!1;throw r}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"===typeof t?t.call(this,e):be(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=ge({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=ge({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=ne.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=ne.notNull){return this.nullability(!1,e)}required(e=ne.required){return this.clone().withMutation((t=>t.nonNullable(e).defined(e)))}notRequired(){return this.clone().withMutation((e=>e.nullable().optional()))}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"===typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=ne.default),"function"!==typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=ge(t),i=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===n.OPTIONS.test)return!1}return!0})),r.tests.push(n),r}when(e,t){Array.isArray(e)||"string"===typeof e||(t=e,e=".");let r=this.clone(),n=ee(e).map((e=>new pe(e)));return n.forEach((e=>{e.isSibling&&r.deps.push(e.key)})),r.conditions.push("function"===typeof t?new ue(n,t):ue.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=ge({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=ne.oneOf){let r=this.clone();return e.forEach((e=>{r._whitelist.add(e),r._blacklist.delete(e)})),r.internalTests.whiteList=ge({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=ne.notOneOf){let r=this.clone();return e.forEach((e=>{r._blacklist.add(e),r._whitelist.delete(e)})),r.internalTests.blacklist=ge({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:i,nullable:s}=t.spec;return{meta:n,label:r,optional:i,nullable:s,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,r)=>r.findIndex((t=>t.name===e.name))===t))}}}Ee.prototype.__isYupSchema__=!0;for(const on of["validate","validateSync"])Ee.prototype[`${on}At`]=function(e,t,r={}){const{parent:n,parentPath:i,schema:s}=ve(this,e,t,r.context);return s[on](n&&n[i],Object.assign({},r,{parent:n,path:e}))};for(const on of["equals","is"])Ee.prototype[on]=Ee.prototype.oneOf;for(const on of["not","nope"])Ee.prototype[on]=Ee.prototype.notOneOf;function _e(){return new we}class we extends Ee{constructor(){super({type:"boolean",check:e=>(e instanceof Boolean&&(e=e.valueOf()),"boolean"===typeof e)}),this.withMutation((()=>{this.transform(((e,t,r)=>{if(r.spec.coerce&&!r.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}isTrue(e=oe.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>me(e)||!0===e})}isFalse(e=oe.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>me(e)||!1===e})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}_e.prototype=we.prototype;let Te=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Se=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ae=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ke=e=>me(e)||e===e.trim(),xe={}.toString();function Le(){return new Ie}
1class Ie extends Ee{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"===typeof e)}),this.withMutation((()=>{this.transform(((e,t,r)=>{if(!r.spec.coerce||r.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===xe?e:n}))}))}required(e){return super.required(e).withMutation((t=>t.test({message:e||ne.required,name:"required",skipAbsent:!0,test:e=>!!e.length})))}notRequired(){return super.notRequired().withMutation((e=>(e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e)))}length(e,t=ie.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=ie.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=ie.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,n,i=!1;return t&&("object"===typeof t?({excludeEmptyString:i=!1,message:r,name:n}=t):r=t),this.test({name:n||"matches",message:r||ie.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&i||-1!==t.search(e)})}email(e=ie.email){return this.matches(Te,{name:"email",message:e,excludeEmptyString:!0})}url(e=ie.url){return this.matches(Se,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ie.uuid){return this.matches(Ae,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=ie.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:ke})}lowercase(e=ie.lowercase){return this.transform((e=>me(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>me(e)||e===e.toLowerCase()})}uppercase(e=ie.uppercase){return this.transform((e=>me(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>me(e)||e===e.toUpperCase()})}}Le.prototype=Ie.prototype;var Re=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let De=new Date("");function Ce(){return new Pe}class Pe extends Ee{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation((()=>{this.transform(((e,t,r)=>!r.spec.coerce||r.isType(e)||null===e?e:(e=function(e){var t,r,n=[1,4,5,6,7,10,11],i=0;if(r=Re.exec(e)){for(var s,a=0;s=n[a];++a)r[s]=+r[s]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,r[7]=r[7]?String(r[7]).substr(0,3):0,void 0!==r[8]&&""!==r[8]||void 0!==r[9]&&""!==r[9]?("Z"!==r[8]&&void 0!==r[9]&&(i=60*r[10]+r[11],"+"===r[9]&&(i=0-i)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+i,r[6],r[7])):t=+new Date(r[1],r[2],r[3],r[4],r[5],r[6],r[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Pe.INVALID_DATE:new Date(e))))}))}prepareParam(e,t){let r;if(pe.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=ae.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=ae.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function Oe(e,t){let r=1/0;return e.some(((e,n)=>{var i;if(null!=(i=t.path)&&i.includes(e))return r=n,!0})),r}function Me(e){return(t,r)=>Oe(e,t)-Oe(e,r)}Pe.INVALID_DATE=De,Ce.prototype=Pe.prototype,Ce.INVALID_DATE=De;const Ne=(e,t,r)=>{if("string"!==typeof e)return e;let n=e;try{n=JSON.parse(e)}catch(i){}return r.isType(n)?n:e};function Fe(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Fe(n);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=Fe(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(Fe)}
vendor: 4,431 bytes, line 1
1):"optional"in e?e.optional():e}let Ue=e=>"[object Object]"===Object.prototype.toString.call(e);const Be=Me([]);function je(e){return new $e(e)}class $e extends Ee{constructor(e){super({type:"object",check:e=>Ue(e)||"function"===typeof e}),this.fields=Object.create(null),this._sortErrors=Be,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{e&&this.shape(e)}))}_cast(e,t={}){var r;let n=super._cast(e,t);if(void 0===n)return this.getDefault(t);if(!this._typeCheck(n))return n;let i=this.fields,s=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(n).filter((e=>!this._nodes.includes(e)))),o={},l=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),c=!1;for(const d of a){let e=i[d],r=d in n;if(e){let r,i=n[d];l.path=(t.path?`${t.path}.`:"")+d,e=e.resolve({value:i,context:t.context,parent:o});let s=e instanceof Ee?e.spec:void 0,a=null==s?void 0:s.strict;if(null!=s&&s.strip){c=c||d in n;continue}r=t.__validating&&a?n[d]:e.cast(n[d],l),void 0!==r&&(o[d]=r)}else r&&!s&&(o[d]=n[d]);r===d in o&&o[d]===n[d]||(c=!0)}return c?o:n}_validate(e,t={},r,n){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:s},...i],t.__validating=!0,t.originalValue=s,super._validate(e,t,r,((e,i)=>{if(!a||!Ue(i))return void n(e,i);s=s||i;let o=[];for(let r of this._nodes){let e=this.fields[r];e&&!pe.isRef(e)&&o.push(e.asNestedTest({options:t,key:r,parent:i,parentPath:t.path,originalParent:s}))}this.runTests({tests:o,value:i,originalValue:s,options:t},r,(t=>{n(t.sort(this._sortErrors).concat(e),i)}))}))}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[n,i]of Object.entries(this.fields)){const e=r[n];r[n]=void 0===e?i:e}return t.withMutation((t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges])))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach((r=>{var n;const i=this.fields[r];let s=e;null!=(n=s)&&n.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),t[r]=i&&"getDefault"in i?i.getDefault(s):void 0})),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=function(e,t=[]){let r=[],n=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function s(e,t){let s=(0,H.split)(e)[0];n.add(s),i.has(`${t}-${s}`)||r.push([t,s])}for(const a of Object.keys(e)){let t=e[a];n.add(a),pe.isRef(t)&&t.isSibling?s(t.path,a):de(t)&&"deps"in t&&t.deps.forEach((e=>s(e,a)))}return W().array(Array.from(n),r).reverse()}(e,t),r._sortErrors=Me(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation((r=>{let n=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),n)}))}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Fe(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t)}omit(e){const t=Object.assign({},this.fields);for(const r of e)delete t[r];return this.setFields(t)}from(e,t,r){let n=(0,H.getter)(e,!0);return this.transform((i=>{if(!i)return i;let s=i;return((e,t)=>{const r=[...(0,H.normalizePath)(t)];if(1===r.length)return r[0]in e;let n=r.pop(),i=(0,H.getter)((0,H.join)(r),!0)(e);return!(!i||!(n in i))})(i,e)&&(s=Object.assign({},i),r||delete s[e],s[t]=n(i)),s}))}json(){return this.transform(Ne)}noUnknown(e=!0,t=le.noUnknown){"boolean"!==typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=function(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===r.indexOf(e)))}(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=le.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>{if(!t)return t;const r={};for(const n of Object.keys(t))r[e(n)]=t[n];return r}))}camelCase(){return this.transformKeys(G.camelCase)}snakeCase(){return this.transformKeys(G.snakeCase)}constantCase(){return this.transformKeys((e=>(0,G.snakeCase)(e).toUpperCase()))}describe(e){let t=super.describe(e);
1t.fields={};for(const[n,i]of Object.entries(this.fields)){var r;let s=e;null!=(r=s)&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),t.fields[n]=i.describe(s)}return t}}je.prototype=$e.prototype;function Ve(e){var t;const{emailForm:r}=e,s=r.emailSubjects||[],a=r.sections||[],[o,l]=(0,i.useState)({submitted:!1,submitting:!1,info:{error:!1,msg:null}}),c=[{title:"First Name",slug:"firstName",required:!0},{title:"Last Name",slug:"lastName",required:!0},{title:"Email",slug:"email",required:!0},{title:"Phone Number",slug:"phoneNumber"}];let d={subject:Le().default(s[0]).required("A selection is required")};c.forEach((e=>{"email"===e.slug&&e.required?d[e.slug]=Le().required("".concat(e.title," is required")).email("".concat(e.title," is invalid")):e.required?d[e.slug]=Le().required("".concat(e.title," is required")):d[e.slug]=Le()})),a.forEach((e=>{if("furtherInfoField"===e._type){let t={};e.informationItems.forEach((e=>{t[e._key]=Le().required("".concat(e.title," is required"))})),d[e._key]=je().shape(t)}else"tickBoxField"===e._type?d[e._key]=Le().required("A selection is required"):"textField"===e._type?d[e._key]=Le().required("".concat(e.title," is required")).test("len","Must be no more than 2000 characters",(e=>e.length<=2e3)):d[e._key]=Le().required("".concat(e.title," is required"))}));const u=je().shape(d),h={defaultValues:{subject:s[0]},resolver:V(u)},{register:f,handleSubmit:p,reset:m,formState:g,watch:v}=(0,j.cI)(h),{errors:y}=g,b=v("subject");return(0,n.jsxs)("div",{className:F().modalHandlerEmailForm,children:[r.title&&(0,n.jsx)("h2",{className:F().title,children:r.title}),r.formIntro&&(0,n.jsx)("div",{className:F().formIntro,children:(0,n.jsx)(U.Z,{value:r.formIntro})}),(0,n.jsxs)("form",{onSubmit:p((async e=>{l((e=>({...e,submitting:!0})));const t=await fetch("/api/sendgrid",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e.email,to:r.emailTo,subject:e.subject,personalDetails:[{title:"First Name",value:e.firstName},{title:"Last Name",value:e.lastName},{title:"Email",value:e.email},{title:"Phone Number",value:e.phoneNumber}],sections:r.sections.map((t=>"furtherInfoField"===t._type?{title:t.title,value:t.informationItems.map((r=>({title:r.title,value:e[t._key][r._key]}))),type:t._type}:"tickBoxField"===t._type?{title:t.question,value:e[t._key],type:t._type}:{title:t.title,value:e[t._key],type:t._type}))})}),n=await t.text();((e,t)=>{200===e?(l({submitted:!0,submitting:!1,info:{error:!1,msg:t}}),m()):l({submitted:!0,submitting:!1,info:{error:!0,msg:t}})})(t.status,n)})),className:F().form,children:[r.emailSubjects&&r.emailSubjects.length&&r.emailSubjects.length>1&&(0,n.jsx)("fieldset",{className:F().fieldset,children:(0,n.jsxs)("div",{className:F().emailSubjects,children:[r.emailSubjects.map((e=>(0,n.jsxs)("div",{className:"\n ".concat(F().emailSubject,"\n ").concat(e===b?F().active:"","\n "),children:[(0,n.jsx)("input",{id:e,name:"subject",type:"radio",...f("subject"),value:e,className:F().checkbox}),(0,n.jsx)("label",{htmlFor:e,className:F().checkboxLabel,children:e})]},e))),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(t=y.subject)||void 0===t?void 0:t.message})]})}),(0,n.jsxs)("fieldset",{className:F().fieldset,children:[(0,n.jsx)("legend",{className:F().legend,children:"Your Details"}),c&&c.length&&(0,n.jsx)(n.Fragment,{children:c.map((e=>{var t;return(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().label,children:e.title}),(0,n.jsx)("input",{name:e.slug,type:"text",...f(e.slug),placeholder:e.title,className:"".concat(F().input," ").concat(y[e.slug]?F().isInvalid:"")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(t=y[e.slug])||void 0===t?void 0:t.message})]},e.slug)}))})]}),r.sections&&r.sections.length&&(0,n.jsx)("fieldset",{className:F().fieldset,children:r.sections.map((e=>{var t,r;return"textField"==e._type?(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().textareaLabel,children:e.title}),e.description&&(0,n.jsx)("div",{className:F().textareaDescription,children:(0,n.jsx)(U.Z,{value:e.description})},e._key+"-description"),(0,n.jsx)("textarea",{name:e._key,...f(e._key),className:"".concat(F().textarea," ").concat(y[e._key]?F().isInvalid:""),rows:10}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(t=y[e._key])||void 0===t?void 0:t.message})]},e._key):"tickBoxField"===e._type?(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().checkboxQuestion,children:e.question}),e.options&&e.options.length&&(0,n.jsx)("div",{className:F().checkboxOptions,children:e.options.map((t=>(0,n.jsxs)("div",{className:F().checkboxOption,children:[(0,n.jsx)("input",{name:e._key,type:"radio",...f(e._key),value:t,className:"".concat(F().checkbox," ").concat(y[e._key]?F().isInvalid:"")}),(0,n.jsx)("label",{className:F().checkboxLabel,children:t})]},t)))}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(r=y[e._key])||void 0===r?void 0:r.message})]},e._key):"furtherInfoField"===e._type?(0,n.jsxs)("div",{className:F().fieldGroup,children:[(0,n.jsx)("label",{className:F().inputLabel,children:e.title}),e.informationItems&&e.informationItems.length&&(0,n.jsx)("div",{className:F().informationItems,children:e.informationItems.map((t=>{var r;return(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().label,children:t.title}),(0,n.jsx)("input",{name:t._key,type:"text",...f("".concat(e._key,".").concat(t._key)),placeholder:t.title,className:"".concat(F().input," ").concat(y[e._key]&&y[e._key][t._key]?F().isInvalid:"")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:y[e._key]&&(null===(r=y[e._key][t._key])||void 0===r?void 0:r.message)})]},t._key)}
1))})]},e._key):void 0}))}),(0,n.jsxs)("div",{children:[(0,n.jsx)(B.Z,{}),(0,n.jsx)("button",{type:"submit",disabled:o.submitting,className:F().submitButton,children:o.submitting?"Submitting...":o.submitted?"Submitted":"Submit"})]})]}),Object.keys(y).length?(0,n.jsx)("div",{className:F().errorMessage,children:"Please enter all of the required information."}):null,o.info.error&&(0,n.jsxs)("div",{className:F().errorMessage,children:["Error: ",o.info.msg]}),!o.info.error&&o.info.msg&&(0,n.jsx)("div",{className:F().completeMessage,children:o.info.msg})]})}var He,Ge;function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qe.apply(this,arguments)}var We=e=>i.createElement("svg",qe({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"cross_svg__Layer_1",x:0,y:0,style:{enableBackground:"new 0 0 32 32"},viewBox:"0 0 32 32"},e),He||(He=i.createElement("style",null,".cross_svg__st0{fill:none;stroke:#3e4f3b;stroke-width:1.5;stroke-linejoin:bevel}")),Ge||(Ge=i.createElement("path",{d:"M4.7 27.3 27.3 4.7M4.7 4.7l22.6 22.6",className:"cross_svg__st0"})));function Ke(e,t){return function(){return e.apply(t,arguments)}}const{toString:ze}=Object.prototype,{getPrototypeOf:Ye}=Object,Xe=(Qe=Object.create(null),e=>{const t=ze.call(e);return Qe[t]||(Qe[t]=t.slice(8,-1).toLowerCase())});var Qe;const Ze=e=>(e=e.toLowerCase(),t=>Xe(t)===e),Je=e=>t=>typeof t===e,{isArray:et}=Array,tt=Je("undefined");const rt=Ze("ArrayBuffer");const nt=Je("string"),it=Je("function"),st=Je("number"),at=e=>null!==e&&"object"===typeof e,ot=e=>{if("object"!==Xe(e))return!1;const t=Ye(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=Ze("Date"),ct=Ze("File"),dt=Ze("Blob"),ut=Ze("FileList"),ht=Ze("URLSearchParams");function ft(e,t,{allOwnKeys:r=!1}={}){if(null===e||"undefined"===typeof e)return;let n,i;if("object"!==typeof e&&(e=[e]),et(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function pt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const mt="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,gt=e=>!tt(e)&&e!==mt;const vt=(yt="undefined"!==typeof Uint8Array&&Ye(Uint8Array),e=>yt&&e instanceof yt);var yt;const bt=Ze("HTMLFormElement"),Et=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),_t=Ze("RegExp"),wt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ft(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},Tt="abcdefghijklmnopqrstuvwxyz",St="0123456789",At={DIGIT:St,ALPHA:Tt,ALPHA_DIGIT:Tt+Tt.toUpperCase()+St};const kt=Ze("AsyncFunction");var xt={isArray:et,isArrayBuffer:rt,isBuffer:function(e){return null!==e&&!tt(e)&&null!==e.constructor&&!tt(e.constructor)&&it(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||it(e.append)&&("formdata"===(t=Xe(e))||"object"===t&&it(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&rt(e.buffer),t},isString:nt,isNumber:st,isBoolean:e=>!0===e||!1===e,isObject:at,isPlainObject:ot,isUndefined:tt,isDate:lt,isFile:ct,isBlob:dt,isRegExp:_t,isFunction:it,isStream:e=>at(e)&&it(e.pipe),isURLSearchParams:ht,isTypedArray:vt,isFileList:ut,forEach:ft,merge:function e(){const{caseless:t}=gt(this)&&this||{},r={},n=(n,i)=>{const s=t&&pt(r,i)||i;ot(r[s])&&ot(n)?r[s]=e(r[s],n):ot(n)?r[s]=e({},n):et(n)?r[s]=n.slice():r[s]=n};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&ft(arguments[i],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(ft(t,((t,n)=>{r&&it(t)?e[n]=Ke(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,s,a;const o={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],n&&!n(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==r&&Ye(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Xe,kindOfTest:Ze,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(et(e))return e;let t=e.length;if(!st(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>
vendor: 4,283 bytes, line 1
1{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:bt,hasOwnProperty:Et,hasOwnProp:Et,reduceDescriptors:wt,freezeMethods:e=>{wt(e,((t,r)=>{if(it(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];it(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return et(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:pt,global:mt,isContextDefined:gt,ALPHABET:At,generateString:(e=16,t=At.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&it(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(at(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=et(e)?[]:{};return ft(e,((e,t)=>{const s=r(e,n+1);!tt(s)&&(i[t]=s)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:kt,isThenable:e=>e&&(at(e)||it(e))&&it(e.then)&&it(e.catch)};function Lt(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}xt.inherits(Lt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const It=Lt.prototype,Rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Rt[e]={value:e}})),Object.defineProperties(Lt,Rt),Object.defineProperty(It,"isAxiosError",{value:!0}),Lt.from=(e,t,r,n,i,s)=>{const a=Object.create(It);return xt.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Lt.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};var Dt=Lt,Ct=r(48764).lW;function Pt(e){return xt.isPlainObject(e)||xt.isArray(e)}function Ot(e){return xt.endsWith(e,"[]")?e.slice(0,-2):e}function Mt(e,t,r){return e?e.concat(t).map((function(e,t){return e=Ot(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Nt=xt.toFlatObject(xt,{},null,(function(e){return/^is[A-Z]/.test(e)}));var Ft=function(e,t,r){if(!xt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=xt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!xt.isUndefined(t[e])}))).metaTokens,i=r.visitor||c,s=r.dots,a=r.indexes,o=(r.Blob||"undefined"!==typeof Blob&&Blob)&&xt.isSpecCompliantForm(t);if(!xt.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(xt.isDate(e))return e.toISOString();if(!o&&xt.isBlob(e))throw new Dt("Blob is not supported. Use a Buffer instead.");return xt.isArrayBuffer(e)||xt.isTypedArray(e)?o&&"function"===typeof Blob?new Blob([e]):Ct.from(e):e}function c(e,r,i){let o=e;if(e&&!i&&"object"===typeof e)if(xt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(xt.isArray(e)&&function(e){return xt.isArray(e)&&!e.some(Pt)}(e)||(xt.isFileList(e)||xt.endsWith(r,"[]"))&&(o=xt.toArray(e)))return r=Ot(r),o.forEach((function(e,n){!xt.isUndefined(e)&&null!==e&&t.append(!0===a?Mt([r],n,s):null===a?r:r+"[]",l(e))})),!1;return!!Pt(e)||(t.append(Mt(i,r,s),l(e)),!1)}const d=[],u=Object.assign(Nt,{defaultVisitor:c,convertValue:l,isVisitable:Pt});if(!xt.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!xt.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),xt.forEach(r,(function(r,s){!0===(!(xt.isUndefined(r)||null===r)&&i.call(t,r,xt.isString(s)?s.trim():s,n,u))&&e(r,n?n.concat(s):[s])})),d.pop()}}(e),t};
1function Ut(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Bt(e,t){this._pairs=[],e&&Ft(e,this,t)}const jt=Bt.prototype;jt.append=function(e,t){this._pairs.push([e,t])},jt.toString=function(e){const t=e?function(t){return e.call(this,t,Ut)}:Ut;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var $t=Bt;function Vt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ht(e,t,r){if(!t)return e;const n=r&&r.encode||Vt,i=r&&r.serialize;let s;if(s=i?i(t,r):xt.isURLSearchParams(t)?t.toString():new $t(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}var Gt=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){xt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Wt={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:$t,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"===typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!==typeof window&&"undefined"!==typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};var Kt=function(e){function t(e,r,n,i){let s=e[i++];const a=Number.isFinite(+s),o=i>=e.length;if(s=!s&&xt.isArray(n)?n.length:s,o)return xt.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!a;n[s]&&xt.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],i)&&xt.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}(n[s])),!a}if(xt.isFormData(e)&&xt.isFunction(e.entries)){const r={};return xt.forEachEntry(e,((e,n)=>{t(function(e){return xt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null};const zt={"Content-Type":void 0};const Yt={transitional:qt,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=xt.isObject(e);i&&xt.isHTMLForm(e)&&(e=new FormData(e));if(xt.isFormData(e))return n&&n?JSON.stringify(Kt(e)):e;if(xt.isArrayBuffer(e)||xt.isBuffer(e)||xt.isStream(e)||xt.isFile(e)||xt.isBlob(e))return e;if(xt.isArrayBufferView(e))return e.buffer;if(xt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ft(e,new Wt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Wt.isNode&&xt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=xt.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ft(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(xt.isString(e))try{return(t||JSON.parse)(e),xt.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Yt.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&xt.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(i){if(r){if("SyntaxError"===i.name)throw Dt.from(i,Dt.ERR_BAD_RESPONSE,this,null,this.response);throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wt.classes.FormData,Blob:Wt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xt.forEach(["delete","get","head"],(function(e){Yt.headers[e]={}})),xt.forEach(["post","put","patch"],(function(e){Yt.headers[e]=xt.merge(zt)}));var Xt=Yt;const Qt=xt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Zt=Symbol("internals");function Jt(e){return e&&String(e).trim().toLowerCase()}function er(e){return!1===e||null==e?e:xt.isArray(e)?e.map(er):String(e)}function tr(e,t,r,n,i){return xt.isFunction(n)?n.call(this,t,r):(i&&(t=r),xt.isString(t)?xt.isString(n)?-1!==t.indexOf(n):xt.isRegExp(n)?n.test(t):void 0:void 0)}class rr{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Jt(t);if(!i)throw new Error("header name must be a non-empty string");const s=xt.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=er(e))}const s=(e,t)=>xt.forEach(e,((e,r)=>i(e,r,t)));return xt.isPlainObject(e)||e instanceof this.constructor?s(e,t):xt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&Qt[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=Jt(e)){const r=xt.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;
vendor: 5,649 bytes, line 1
1=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(xt.isFunction(t))return t.call(this,e,r);if(xt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Jt(e)){const r=xt.findKey(this,e);return!(!r||void 0===this[r]||t&&!tr(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Jt(e)){const i=xt.findKey(r,e);!i||t&&!tr(0,r[i],i,t)||(delete r[i],n=!0)}}return xt.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!tr(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return xt.forEach(this,((n,i)=>{const s=xt.findKey(r,i);if(s)return t[s]=er(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=er(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return xt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&xt.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[Zt]=this[Zt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Jt(e);t[n]||(!function(e,t){const r=xt.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return xt.isArray(e)?e.forEach(n):n(e),this}}rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xt.freezeMethods(rr.prototype),xt.freezeMethods(rr);var nr=rr;function ir(e,t){const r=this||Xt,n=t||r,i=nr.from(n.headers);let s=n.data;return xt.forEach(e,(function(e){s=e.call(r,s,i.normalize(),t?t.status:void 0)})),i.normalize(),s}function sr(e){return!(!e||!e.__CANCEL__)}function ar(e,t,r){Dt.call(this,null==e?"canceled":e,Dt.ERR_CANCELED,t,r),this.name="CanceledError"}xt.inherits(ar,Dt,{__CANCEL__:!0});var or=ar;var lr=Wt.isStandardBrowserEnv?{write:function(e,t,r,n,i,s){const a=[];a.push(e+"="+encodeURIComponent(t)),xt.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),xt.isString(n)&&a.push("path="+n),xt.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function cr(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var dr=Wt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=xt.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};var ur=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,s=0,a=0;return t=void 0!==t?t:1e3,function(o){const l=Date.now(),c=n[a];i||(i=l),r[s]=o,n[s]=l;let d=a,u=0;for(;d!==s;)u+=r[d++],d%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),l-i<t)return;const h=c&&l-c;return h?Math.round(1e3*u/h):void 0}};function hr(e,t){let r=0;const n=ur(50,250);return i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,o=s-r,l=n(o);r=s;const c={loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:l||void 0,estimated:l&&a&&s<=a?(a-s)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const fr={http:null,xhr:"undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=nr.from(e.headers).normalize(),s=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}xt.isFormData(n)&&(Wt.isStandardBrowserEnv||Wt.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const c=cr(e.baseURL,e.url);function d(){if(!l)return;const n=nr.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Dt("Request failed with status code "+r.status,[Dt.ERR_BAD_REQUEST,Dt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),o()}),(function(e){r(e),o()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),Ht(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)}
1,l.onabort=function(){l&&(r(new Dt("Request aborted",Dt.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new Dt("Network Error",Dt.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||qt;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Dt(t,n.clarifyTimeoutError?Dt.ETIMEDOUT:Dt.ECONNABORTED,e,l)),l=null},Wt.isStandardBrowserEnv){const t=(e.withCredentials||dr(c))&&e.xsrfCookieName&&lr.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in l&&xt.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),xt.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&l.addEventListener("progress",hr(e.onDownloadProgress,!0)),"function"===typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",hr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(r(!t||t.type?new or(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);u&&-1===Wt.protocols.indexOf(u)?r(new Dt("Unsupported protocol "+u+":",Dt.ERR_BAD_REQUEST,e)):l.send(n||null)}))}};xt.forEach(fr,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}}));var pr=e=>{e=xt.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=xt.isString(r)?fr[r.toLowerCase()]:r));i++);
1if(!n){if(!1===n)throw new Dt(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(xt.hasOwnProp(fr,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!xt.isFunction(n))throw new TypeError("adapter is not a function");return n};function mr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new or(null,e)}function gr(e){mr(e),e.headers=nr.from(e.headers),e.data=ir.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return pr(e.adapter||Xt.adapter)(e).then((function(t){return mr(e),t.data=ir.call(e,e.transformResponse,t),t.headers=nr.from(t.headers),t}),(function(t){return sr(t)||(mr(e),t&&t.response&&(t.response.data=ir.call(e,e.transformResponse,t.response),t.response.headers=nr.from(t.response.headers))),Promise.reject(t)}))}const vr=e=>e instanceof nr?e.toJSON():e;function yr(e,t){t=t||{};const r={};function n(e,t,r){return xt.isPlainObject(e)&&xt.isPlainObject(t)?xt.merge.call({caseless:r},e,t):xt.isPlainObject(t)?xt.merge({},t):xt.isArray(t)?t.slice():t}function i(e,t,r){return xt.isUndefined(t)?xt.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!xt.isUndefined(t))return n(void 0,t)}function a(e,t){return xt.isUndefined(t)?xt.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function o(r,i,s){return s in t?n(r,i):s in e?n(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>i(vr(e),vr(t),!0)};return xt.forEach(Object.keys(Object.assign({},e,t)),(function(n){const s=l[n]||i,a=s(e[n],t[n],n);xt.isUndefined(a)&&s!==o||(r[n]=a)})),r}const br="1.4.0",Er={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Er[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const _r={};Er.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,s)=>{if(!1===e)throw new Dt(n(i," has been removed"+(t?" in "+t:"")),Dt.ERR_DEPRECATED);return t&&!_r[i]&&(_r[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,s)}};var wr={assertOptions:function(e,t,r){if("object"!==typeof e)throw new Dt("options must be an object",Dt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],a=t[s];if(a){const t=e[s],r=void 0===t||a(t,s,e);if(!0!==r)throw new Dt("option "+s+" must be "+r,Dt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Dt("Unknown option "+s,Dt.ERR_BAD_OPTION)}},validators:Er};const Tr=wr.validators;class Sr{constructor(e){this.defaults=e,this.interceptors={request:new Gt,response:new Gt}}request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=yr(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let s;void 0!==r&&wr.assertOptions(r,{silentJSONParsing:Tr.transitional(Tr.boolean),forcedJSONParsing:Tr.transitional(Tr.boolean),clarifyTimeoutError:Tr.transitional(Tr.boolean)},!1),null!=n&&(xt.isFunction(n)?t.paramsSerializer={serialize:n}:wr.assertOptions(n,{encode:Tr.function,serialize:Tr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=i&&xt.merge(i.common,i[t.method]),s&&xt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=nr.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!o){const e=[gr.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=a.length;let h=t;for(u=0;
vendor: 1,704 bytes, line 1
1u<d;){const e=a[u++],t=a[u++];try{h=e(h)}catch(f){t.call(this,f);break}}try{c=gr.call(this,h)}catch(f){return Promise.reject(f)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return Ht(cr((e=yr(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}xt.forEach(["delete","get","head","options"],(function(e){Sr.prototype[e]=function(t,r){return this.request(yr(r||{},{method:e,url:t,data:(r||{}).data}))}})),xt.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(yr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Sr.prototype[e]=t(),Sr.prototype[e+"Form"]=t(!0)}));var Ar=Sr;class kr{constructor(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new or(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new kr((function(t){e=t})),cancel:e}}}var xr=kr;const Lr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
1alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Lr).forEach((([e,t])=>{Lr[t]=e}));var Ir=Lr;const Rr=function e(t){const r=new Ar(t),n=Ke(Ar.prototype.request,r);return xt.extend(n,Ar.prototype,r,{allOwnKeys:!0}),xt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(yr(t,r))},n}(Xt);Rr.Axios=Ar,Rr.CanceledError=or,Rr.CancelToken=xr,Rr.isCancel=sr,Rr.VERSION=br,Rr.toFormData=Ft,Rr.AxiosError=Dt,Rr.Cancel=Rr.CanceledError,Rr.all=function(e){return Promise.all(e)},Rr.spread=function(e){return function(t){return e.apply(null,t)}},Rr.isAxiosError=function(e){return xt.isObject(e)&&!0===e.isAxiosError},Rr.mergeConfig=yr,Rr.AxiosHeaders=nr,Rr.formToJSON=e=>Kt(xt.isHTMLForm(e)?new FormData(e):e),Rr.HttpStatusCode=Ir,Rr.default=Rr;var Dr,Cr,Pr=Rr;function Or(){var e,t,r,s;const[a,o]=(0,i.useState)("idle"),[l,c]=(0,i.useState)(null);let d={firstName:Le().required("First name is required"),lastName:Le().required("Last name is required"),email:Le().required("Email is required").email("Email is invalid"),gdpr:_e().required("Please agree to the privacy policy").oneOf([!0],"Please agree to the privacy policy")};const u={resolver:V(je().shape(d))},{register:h,handleSubmit:f,reset:p,formState:m}=(0,j.cI)(u),{errors:g}=m;return(0,n.jsxs)("div",{className:F().modalHandlerNewsletter,children:[(0,n.jsx)("p",{className:F().title,children:"Newsletter"}),(0,n.jsx)("p",{className:F().formIntro,children:"Please fill out the form below to sign up to our newsletter and stay up to date with our latest events and updates."}),(0,n.jsxs)("form",{onSubmit:f((async e=>{const{email:t,firstName:r,lastName:n,gdpr:i}=e;if(o("Loading"),!t||!t.includes("@"))return c("Please enter an email address."),void o("Error");if(!i)return c("Please agree to the privacy policy."),void o("Error");try{await Pr.post("/api/subscribe",{email:t,firstName:r,lastName:n});o("Success"),p()}catch(s){c("generic"),o("Error")}})),className:F().form,noValidate:!0,children:[(0,n.jsxs)("fieldset",{className:F().fieldset,children:[(0,n.jsx)("legend",{className:F().legend,children:"Your Details"}),(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().label,htmlFor:"first-name-input",children:"First Name"}),(0,n.jsx)("input",{className:"".concat(F().input," ").concat(g.firstName?F().isInvalid:""),id:"first-name-input",name:"firstName",type:"text",placeholder:"First Name",...h("firstName")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(e=g.firstName)||void 0===e?void 0:e.message})]}),(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().label,htmlFor:"last-name-input",children:"Last Name"}),(0,n.jsx)("input",{className:"".concat(F().input," ").concat(g.lastName?F().isInvalid:""),id:"last-name-input",name:"lastName",type:"text",placeholder:"Last Name",...h("lastName")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(t=g.lastName)||void 0===t?void 0:t.message})]}),(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{className:F().label,htmlFor:"email-input",children:"Email Address"}),(0,n.jsx)("input",{className:"".concat(F().input," ").concat(g.email?F().isInvalid:""),required:!0,id:"email-input",n
1ame:"email",type:"email",placeholder:"Email Address",...h("email")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(r=g.email)||void 0===r?void 0:r.message})]})]}),(0,n.jsxs)("fieldset",{className:F().fieldset,children:[(0,n.jsx)("legend",{className:F().legend,children:"Privacy Policy"}),(0,n.jsxs)("div",{className:F().checkboxOption,children:[(0,n.jsx)("input",{className:"".concat(F().checkbox," ").concat(g.gdpr?F().isInvalid:""),required:!0,id:"gdpr-checkbox",name:"gdpr",type:"checkbox",...h("gdpr")}),(0,n.jsxs)("label",{className:F().checkboxLabel,htmlFor:"gdpr-checkbox",children:["I agree to The Serge Hill Project\u2019s ",(0,n.jsx)(T.Z,{href:"/privacy-policy",children:"Privacy Policy"})]})]}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(s=g.gdpr)||void 0===s?void 0:s.message})]}),(0,n.jsxs)("button",{disabled:"Loading"===a,type:"submit",className:F().submitButton,children:[(0,n.jsx)(B.Z,{}),"Subscribe"]}),"Error"===a&&(0,n.jsx)("p",{className:F().errorMessage,children:"generic"===l?(0,n.jsxs)(n.Fragment,{children:["Sorry, we were unable to subscribe you. This may be because you have already subscribed. Email ",(0,n.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})," for information."]}):l}),"Success"===a&&(0,n.jsx)("p",{className:F().completeMessage,children:"Thank you, you have successfully been subscribed."})]})]})}function Mr(e){const{settings:t}=e,r=t&&t.emailForms||[],i=(0,s.useRouter)(),{query:a,asPath:o}=i,l=(0,I.Z)(o),c=()=>{i.push(l,void 0,{shallow:!0})},d=a.modal&&a.email&&r.find((e=>e.slug===a.email))||null,u=a.modal&&"newsletter"===a.modal;return(0,n.jsxs)("div",{className:"".concat(F().modalHandler),children:[(0,n.jsx)("div",{className:"".concat(F().modalClose," ").concat(a.modal?F().isActive:""),onClick:()=>c()}),(0,n.jsxs)("div",{className:"".concat(F().modal," ").concat(a.modal?F().isActive:""),children:[(0,n.jsx)("div",{className:F().closeButtonWrapper,children:(0,n.jsx)("button",{onClick:()=>c(),"aria-label":"Close",className:F().closeButton,children:(0,n.jsx)(We,{})})}),d&&(0,n.jsx)(Ve,{emailForm:d}),u&&(0,n.jsx)(Or,{})]})]})}function Nr(){return Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nr.apply(this,arguments)}var Fr=e=>i.createElement("svg",Nr({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"cross-white_svg__Layer_1",x:0,y:0,style:{enableBackground:"new 0 0 32 32"},viewBox:"0 0 32 32"},e),Dr||(Dr=i.createElement("style",null,".cross-white_svg__st0{fill:none;stroke:#fdfdf8;stroke-width:1.5;stroke-linejoin:bevel}")),Cr||(Cr=i.createElement("path",{d:"M4.7 27.3 27.3 4.7M4.7 4.7l22.6 22.6",className:"cross-white_svg__st0"}))),Ur=r(78855),Br=r.n(Ur),jr=r(26901);function $r(e){const{thePlantLibrary:t}=e,{pageBuilderBlocks:r,password:s,postLoginContent:a,downloads:o}=t||{},[l,c]=(0,i.useState)(!1),d={resolver:V(je().shape({password:Le().required("Password is required").oneOf([s],"Incorrect password")}))},{register:u,handleSubmit:h,formState:f}=(0,j.cI)(d),{errors:p}=f,m=()=>{c(!0)};function g(e){if(0===e)return"0 Byte";const t=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}return(0,n.jsx)("div",{className:F().modalHandlerThePlantLibrary,children:l?(0,n.jsx)("div",{className:F().downloadWrapper,children:(0,n.jsxs)("div",{className:"".concat(F().downloadWrapperContent," ").concat(Br().textItems),children:[a&&a.title&&a.text&&(0,n.jsxs)("div",{className:"".concat(Br().item," ").concat(Br().textItem),children:[a.title&&(0,n.jsx)("h2",{className:Br().title,children:a.title}),(0,n.jsx)(U.Z,{value:a.text})]}),o&&o.length&&(0,n.jsx)("div",{className:F().downloads,children:o.map(((e,t)=>(0,n.jsxs)("a",{href:e.file.asset.url+"?dl"+(e.file.asset.originalFilename.split(".").pop()||""),className:F().link,download:!0,children:["Download \u2018",e.title,"\u2019 (",g(e.file.asset.size),")"]},t)))})]})}):r&&r.length?r.map(((e,t)=>{var r;return"pageBuilderBlock"===e._type?(0,n.jsxs)("div",{children:[(0,n.jsx)(jr.Z,{title:"The Plant Library",slug:"?fullWidthModal=the-plant-library",block:e,noPhoneIndentation:!0},t+"-text"),0===t&&(0,n.jsx)("form",{className:"".concat(F().password," ").concat(F().form),onSubmit:h(m),children:(0,n.jsxs)("fieldset",{className:F().fieldset,children:[(0,n.jsx)("legend",{className:F().legend,children:"Enter your password below"}),(0,n.jsxs)("div",{className:F().field,children:[(0,n.jsx)("label",{htmlFor:"password",className:F().label,children:"Password"}),(0,n.jsx)("input",{id:"password",placeholder:"Password",className:"".concat(F().input," ").concat(p.password?F().isInvalid:""),...u("password")}),(0,n.jsx)("div",{className:F().invalidFeedback,children:null===(r=p.password)||void 0===r?void 0:r.message})]}),(0,n.jsxs)("button",{type:"submit",className:F().submitButton,children:[(0,n.jsx)(B.Z,{})," Log in"]})]})},t+"-form")]},t):(0,n.jsxs)("div",{children:["`",e._type,"` block type not supported"]},e._key)}
1)):null})}function Vr(e){const{settings:t}=e,r=t&&t.thePlantLibrary||{},i=(0,s.useRouter)(),{query:a,asPath:o}=i,l=(0,I.Z)(o),c=()=>{i.push(l,void 0,{shallow:!0})};return(0,n.jsxs)("div",{className:"".concat(F().modalHandler," ").concat(F().fullWidth),children:[(0,n.jsx)("div",{className:"".concat(F().modalClose," ").concat(a.fullWidthModal?F().isActive:""),onClick:()=>c()}),(0,n.jsxs)("div",{className:"".concat(F().modal," ").concat(a.fullWidthModal?F().isActive:""),children:[(0,n.jsx)("div",{className:F().closeButtonWrapper,children:(0,n.jsx)("button",{onClick:()=>c(),"aria-label":"Close",className:F().closeButton,children:(0,n.jsx)(Fr,{})})}),(0,n.jsx)($r,{thePlantLibrary:r})]})]})}var Hr=r(47041),Gr=r(41664),qr=r.n(Gr),Wr=r(51911),Kr=r.n(Wr);function zr(e){const{settings:t}=e,[r,s]=(0,i.useState)(!0);(0,i.useEffect)((()=>{s((0,Hr.hasCookie)("localConsent"))}),[]);return!0===r?null:(0,n.jsxs)("div",{className:Kr().consentWrapper,children:[(0,n.jsxs)("div",{className:Kr().consentText,children:["This website uses cookies to ensure you have the best experience. Read our ",(0,n.jsx)(qr(),{href:"privacy-policy",children:"privacy policy"}),"."]}),(0,n.jsxs)("div",{className:Kr().consentOptions,children:[(0,n.jsx)("button",{className:Kr().consentOption,onClick:()=>{s(!0),(0,Hr.setCookie)("localConsent","true",{maxAge:31536e3}),gtag("consent","update",{ad_storage:"granted",analytics_storage:"granted"})},children:"Accept"}),(0,n.jsx)("button",{className:Kr().consentOption,onClick:e=>(s(!0),void(0,Hr.setCookie)("localConsent","false",{maxAge:31536e3})),children:"Reject"})]})]})}function Yr(e){let{preview:t,loading:r,settings:i,headerColor:s,children:a}=e;var o,l;const c=(null===(o=i)||void 0===o?void 0:o.header)||{navigation:[]},d=(null===(l=i)||void 0===l?void 0:l.footer)||{navigation:[],address:""},[u,h]=(0,b.s)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:M().layout,children:[(0,n.jsx)(E,{preview:t,loading:r}),!u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(zr,{settings:i}),(0,n.jsx)(Mr,{settings:i}),(0,n.jsx)(Vr,{settings:i})]}),(0,n.jsxs)("div",{className:M().mainWrapper,children:[!u&&(0,n.jsx)(R,{header:c,isSplashActive:u,headerColor:s}),(0,n.jsx)("main",{className:M().main,children:a}),!u&&(0,n.jsx)(P,{footer:d,isSplashActive:u})]})]})})}var Xr=r(68214),Qr=r(4298),Zr=r.n(Qr);var Jr=()=>(0,i.useEffect)((()=>{let e=Array.from(document.querySelectorAll('link[rel="stylesheet"][data-n-p]')).map((e=>({element:e,href:e.getAttribute("href")})));e.forEach((e=>{let{element:t}=e;return t.removeAttribute("data-n-p")}));const t=[],r=new MutationObserver((r=>{r.filter((e=>{let{target:t}=e;return"STYLE"===t.nodeName&&t.hasAttribute("data-n-href")})).map((e=>{let{target:t}=e;return{element:t,href:t.getAttribute("data-n-href")}})).forEach((e=>{let{element:r,href:n}=e;t.includes(n)?r.remove():(r.setAttribute("data-fouc-fix-n-href",n),r.removeAttribute("data-n-href"),t.push(n))})),e=e.reduce(((e,r)=>{const{element:n,href:i}=r;return t.includes(i)?n.remove():e.push(r),e}),[])}));return r.observe(document.head,{subtree:!0,attributeFilter:["media"]}),()=>r.disconnect()}),[]),en=(r(89359),r(59356),r(21221)),tn=r.n(en);const rn=()=>Promise.all([r.e(990),r.e(46)]).then(r.bind(r,82046)).then((e=>e.default));tn().replacements.push([/([0-9])-([0-9])/g,"$1\u2013\u2013\u2013\u2013\u2013$2"]),tn().replacements.push([/(\s)-(\s)/g,"$1\u2013$2"]),tn().replacements.push([/(.)-(\d)/g,"$1\u2013$2"]),tn().replacements.push([/(\d)-(.)/g,"$1\u2013$2"]),tn().replacements.push([/\s\u2013\s/g,"\u2013"]),tn().replacements.push([/([0-9])x(\s)/g,"$1\xd7$2"]),tn().replacements.push([/(\s)x([0-9])/g,"$1\xd7$2"]),tn().replacements.push([/([0-9])X(\s)/g,"$1\xd7$2"]),tn().replacements.push([/(\s)X([0-9])/g,"$1\xd7$2"]),tn().replacements.push([/(\s)x(\s)/g,"$1\xd7$2"]),tn().replacements.push([/(\s)X(\s)/g,"$1\xd7$2"]),tn().replacements.push([/(\d)cm/g,"$1 cm"]),tn().replacements.push([/(\d)CM/g,"$1 cm"]),tn().replacements.push([/(\d)mm/g,"$1 mm"]),tn().replacements.push([/(\d)MM/g,"$1 mm"]),tn().replacements.push([/(CO2)/g,"CO\u2082"]);const nn=(0,i.lazy)((()=>Promise.all([r.e(584),r.e(136)]).then(r.bind(r,17136))));function sn(e){let{Component:t,pageProps:r,router:a}=e;const{draftMode:o,token:l,loading:c,settings:u}
1=r,{navBackgroundOpacityContext:f}=(0,g.m)(),[p,v]=f,[y,b]=(0,i.useState)("var(--background-color)"),E=(0,s.useRouter)(),_=(0,i.useRef)({}),w=(0,i.useRef)(!1);E.pathname;(0,i.useEffect)((()=>{tn()().listen()}),[]);return(0,i.useEffect)((()=>{E.beforePopState((()=>(w.current=!0,!0)));const e=()=>{const e=E.asPath;_.current[e]=window.scrollY};return E.events.on("routeChangeStart",e),()=>{E.events.off("routeChangeStart",e)}}),[E]),(0,i.useLayoutEffect)((()=>{const e=r&&r.page&&r.page.pageBuilderBlocks||[],t=(0,Xr.Z)(e);let n="var(--background-color)";t&&(n="var(--secondary-background-color)"),y!==n&&(v(0),setTimeout((()=>{b(n)}),250),setTimeout((()=>{v(1)}),500))}),[E.asPath]),(0,n.jsx)(Yr,{preview:o,loading:c,settings:u,headerColor:y,children:(0,n.jsx)(d,{features:rn,children:(0,n.jsx)(h.M,{mode:"wait",initial:!1,onExitComplete:()=>{return e=E.asPath,w.current&&_.current[e]?setTimeout((()=>{window.scroll({top:_.current[e],behavior:"auto"})}),1):setTimeout((()=>{window.scroll({top:0,behavior:"auto"})}),1),void(w.current=!1);var e},children:(0,n.jsx)(m.div,{initial:"pageInitial",animate:"pageAnimate",exit:"pageInitial",variants:{pageInitial:{opacity:0}
1,pageAnimate:{opacity:1}},children:o?(0,n.jsx)(nn,{token:l,children:(0,i.createElement)(t,{...r,key:(0,I.Z)(E.asPath)})}):(0,i.createElement)(t,{...r,key:(0,I.Z)(E.asPath)})},(0,I.Z)(E.asPath))})})})}function an(e){let{Component:t,pageProps:l,router:c}=e;Jr(),(0,i.useEffect)((()=>{"manual"!==history.scrollRestoration&&(history.scrollRestoration="manual"),r.e(337).then(r.t.bind(r,66337,23)),r.e(33).then(r.bind(r,91033)).then((e=>{let{default:t}=e;window.ResizeObserver||(window.ResizeObserver=t)}))}),[]);const d=(0,Hr.getCookie)("localConsent"),u=(0,s.useRouter)().pathname.split("/")[1];return(0,n.jsx)(n.Fragment,{children:u&&"studio"===u?(0,n.jsx)(t,{...l}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Zr(),{strategy:"afterInteractive",src:"https://www.googletagmanager.com/gtag/js?id=G-RTD9NJDZE1"}),(0,n.jsx)(Zr(),{id:"gtag",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n \n gtag('consent', 'default', {\n 'ad_storage': 'denied',\n 'analytics_storage': 'denied'\n });\n\n gtag('js', new Date());\n gtag('config', 'G-RTD9NJDZE1');\n "}}),!0===d&&(0,n.jsx)(Zr(),{id:"consent",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n gtag('consent', 'update', {\n 'ad_storage': 'granted',\n 'analytics_storage': 'granted'\n });\n "}}),(0,n.jsx)(a.WindowInfoProvider,{breakpoints:{phone:"(max-width: 767px)",tablet:"(min-width: 768px)",laptop:"(min-width: 1224px)",desktop:"(min-width: 1748px)"},children:(0,n.jsx)(o.ScrollInfoProvider,{children:(0,n.jsx)(y,{children:(0,n.jsx)(b.h,{children:(0,n.jsx)(g.M,{children:(0,n.jsx)(sn,{Component:t,pageProps:l,router:c})})})})})})]})})}},41648:function(e,t,r){"use strict";function n(e){return e.includes("/work")?"/work":e.split("?")[0]}r.d(t,{Z:function(){return n}})},68214:function(e,t,r){"use strict";function n(e){return e&&e.length&&e.length>1&&"pageBuilderBlock"===e[0]._type&&!(e[0].leadMedia&&e[0].leadMedia.length)&&e[0].textItems&&e[0].textItems.length}r.d(t,{Z:function(){return n}})},72048:function(){},99578:function(){},76268:function(){},89359:function(){},59356:function(){},51911:function(e){e.exports={consentWrapper:"Consent_consentWrapper__lKIQ3",consentText:"Consent_consentText__KSEn9",consentOptions:"Consent_consentOptions__r0lBP",consentOption:"Consent_consentOption__VOUPK"}},543:function(e){e.exports={footer:"Footer_footer__l_nYm",addressWrapperWrapper:"Footer_addressWrapperWrapper__KzTnS",addressWrapper:"Footer_addressWrapper__BAX7u",navItems:"Footer_navItems__yiiqM",navItem:"Footer_navItem__Eno2C"}},77897:function(e){e.exports={nav:"Header_nav__vWET4",navLogo:"Header_navLogo__ir4u8",visible:"Header_visible__J8x0V",hidden:"Header_hidden__koPHL",background:"Header_background__AS8so",navItemsLaptopDesktop:"Header_navItemsLaptopDesktop__7_YZy",navItem:"Header_navItem__6zZhC",navItemsPhoneTablet:"Header_navItemsPhoneTablet__5bZ5j",navItemsPhoneTabletControls:"Header_navItemsPhoneTabletControls__H1nwx",navItemsPhoneTabletButton:"Header_navItemsPhoneTabletButton__EMWTV",svg:"Header_svg__iX6fo",active:"Header_active__lIh_W",navItemsPhoneTabletTitle:"Header_navItemsPhoneTabletTitle__PZfwR",isActive:"Header_isActive__J74h8",navLogoLink:"Header_navLogoLink__KIxnQ"}},12795:function(e){e.exports={layout:"Layout_layout___Vn4y",dark:"Layout_dark__Pa08E",light:"Layout_light__imb53",mainWrapper:"Layout_mainWrapper__m_VMh",main:"Layout_main__01dk9"}},70491:function(e){e.exports={modalHandler:"ModalHandler_modalHandler__i_knD",fullWidth:"ModalHandler_fullWidth__C1Rsq",modal:"ModalHandler_modal__r2Ijz",modalHandlerThePlantLibrary:"ModalHandler_modalHandlerThePlantLibrary__hr26b",form:"ModalHandler_form__FACae",fieldset:"ModalHandler_fieldset__Fraxw",input:"ModalHandler_input__sR7xM",submitButton:"ModalHandler_submitButton__igO3A",downloadWrapper:"ModalHandler_downloadWrapper__BKQEY",downloadWrapperContent:"ModalHandler_downloadWrapperContent__BdLsN",downloads:"ModalHandler_downloads__EtsMJ",link:"ModalHandler_link__jVnBM",modalClose:"ModalHandler_modalClose__rWxVq",isActive:"ModalHandler_isActive__kxEr1",closeButtonWrapper:"ModalHandler_closeButtonWrapper__z6ovR",closeButton:"ModalHandler_closeButton__kNFrU",modalHandlerEmailForm:"ModalHandler_modalHandlerEmailForm__4sap_",title:"ModalHandler_title__kMHEV",modalHandlerNewsletter:"Mod
1alHandler_modalHandlerNewsletter__kRKvi",formIntro:"ModalHandler_formIntro__Fkipu",emailSubjects:"ModalHandler_emailSubjects__1qnop",emailSubject:"ModalHandler_emailSubject__kBl4F",active:"ModalHandler_active__s2X_M",checkboxLabel:"ModalHandler_checkboxLabel__hzXXK",checkbox:"ModalHandler_checkbox__yvubj",legend:"ModalHandler_legend__Mn5vg",field:"ModalHandler_field___8Jql",label:"ModalHandler_label__HLsHy",isInvalid:"ModalHandler_isInvalid__Lnykz",textareaLabel:"ModalHandler_textareaLabel__xpjkz",inputLabel:"ModalHandler_inputLabel__oJ1n7",textareaDescription:"ModalHandler_textareaDescription__gKYWa",textarea:"ModalHandler_textarea__S_Lhs",informationItems:"ModalHandler_informationItems__sH27T",checkboxQuestion:"ModalHandler_checkboxQuestion__YEwrZ",checkboxOptions:"ModalHandler_checkboxOptions__syPV1",checkboxOption:"ModalHandler_checkboxOption___NYto",errorMessage:"ModalHandler_errorMessage__7vx4i",completeMessage:"ModalHandler_completeMessage__s05zz",invalidFeedback:"ModalHandler_invalidFeedback__490KO"}},65344:function(e){e.exports={portableText:"CustomPortableText_portableText__Xs_BY"}},4081:function(e){e.exports={internalLink:"InternalLink_internalLink__PzoTc"}},93477:function(e){e.exports={link:"Link_link__CQAoy"}},82913:function(e){e.exports={longArrowSVG:"LongArrow_longArrowSVG__7aA14"}},50527:function(e){e.exports={video:"MuxVideo_video__zBGtz",autoplayWrapper:"MuxVideo_autoplayWrapper__UGKkz",mediaTimeRangeProxy:"MuxVideo_mediaTimeRangeProxy__cKlGY",mediaControlBar:"MuxVideo_mediaControlBar__f0T_H",isPlaying:"MuxVideo_isPlaying__HYEFo",bigPlayButtonWrapper:"MuxVideo_bigPlayButtonWrapper__qQRn2"}},57587:function(e){e.exports={pageBuilderBlock:"PageBuilderBlock_pageBuilderBlock__9jssH",noPhoneIndentation:"PageBuilderBlock_noPhoneIndentation__L9nMD",textItems:"PageBuilderBlock_textItems__2ETf8",eventText:"PageBuilderBlock_eventText__kqRMi",hasThePlantLibraryLink:"PageBuilderBlock_hasThePlantLibraryLink__6lUik",firstBlockIsHero:"PageBuilderBlock_firstBlockIsHero__lNjBZ",leadMedia:"PageBuilderBlock_leadMedia____mHx",firstBlockIsTextOnly:"PageBuilderBlock_firstBlockIsTextOnly__2_RkI",reverse:"PageBuilderBlock_reverse__BX3ME",eventImage:"PageBuilderBlock_eventImage__vZqAX",noLeadMedia:"PageBuilderBlock_noLeadMedia__fPS10",eventReferenceBlock:"PageBuilderBlock_eventReferenceBlock__s7BPz",image:"PageBuilderBlock_image__fgeS6",categories:"PageBuilderBlock_categories__mR18K",titles:"PageBuilderBlock_titles__p0xzh",description:"PageBuilderBlock_description__yRnaL",location:"PageBuilderBlock_location__JaI6U",date:"PageBuilderBlock_date__iy68N",category:"PageBuilderBlock_category___8snJ"}},72853:function(e){e.exports={leadMedia:"PageBuilderBlockLeadMedia_leadMedia__o6_ud",swiperWrapper:"PageBuilderBlockLeadMedia_swiperWrapper__8EmB_",arrowButton:"PageBuilderBlockLeadMedia_arrowButton__T9qND",left:"PageBuilderBlockLeadMedia_left__Fkdau",right:"PageBuilderBlockLeadMedia_right__upIrw",swiper:"PageBuilderBlockLeadMedia_swiper__oRFn8",swiperSlide:"PageBuilderBlockLeadMedia_swiperSlide__riIH2"}},78855:function(e){e.exports={textItems:"PageBuilderBlockTextItems_textItems__zhtuA",eventText:"PageBuilderBlockTextItems_eventText__SuKea",noLeadMedia:"PageBuilderBlockTextItems_noLeadMedia__9hJ8Y",item:"PageBuilderBlockTextItems_item__dlnc7",externalLinkItem:"PageBuilderBlockTextItems_externalLinkItem__WFVjJ",internalLinkItem:"PageBuilderBlockTextItems_internalLinkItem__lGEz2",emailFormReferenceItem:"PageBuilderBlockTextItems_emailFormReferenceItem__OtGx3",modalDonateItem:"PageBuilderBlockTextItems_modalDonateItem__Q3UPx",modalFriendItem:"PageBuilderBlockTextItems_modalFriendItem__qtCrS",modalNewsletterItem:"PageBuilderBlockTextItems_modalNewsletterItem__1_N5H",textItem:"PageBuilderBlockTextItems_textItem__7EyZb",title:"PageBuilderBlockTextItems_title__pqA3b",link:"PageBuilderBlockTextItems_link__4TxzR",peopleListItem:"PageBuilderBlockTextItems_peopleListItem__G_1M1",peopleList:"PageBuilderBlockTextItems_peopleList__v18Nw",person:"PageBuilderBlockTextItems_person___3M7U",personImage:"PageBuilderBlockTextItems_personImage__AGwPY",image:"PageBuilderBlockTextItems_image__sbrXx",personText:"PageBuilderBlockTextItems_personText__xcFWc",personName:"PageBuilderBlockTextItems_personName__VCWlC",personLinks:"PageBuilderBlockTextItems_personLinks__EkcbI",personLink:"PageBuilderBlockTextItems_personLink__SAgcq"}},36407:function(e){e.exports={image:"SanityImage_image__LQgwN",noTransition:"SanityImage_noTransition__7LNZ_"}},41664:function(e,t,r){e.exports=r(95569)},39332:function(e,t,r){e.exports=r(31414)},11163:function(e,t,r){e.exports=r(96885)},4298:function(e,t,r){e.exports=r(85442)},34155:function(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"===typeof clearTimeout?clearTimeout:s}
vendor: 1,816 bytes, line 1
1catch(e){r=s}}();var o,l=[],c=!1,d=-1;function u(){c&&o&&(c=!1,o.length?l=o.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=a(u);c=!0;for(var t=l.length;t;){for(o=l,l=[];++d<t;)o&&o[d].run();d=-1,t=l.length}o=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||c||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},92703:function(e,t,r){"use strict";var n=r(50414);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,s,a){if(a!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i}
1;return r.PropTypes=r,r}},45697:function(e,t,r){e.exports=r(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},55760:function(e){"use strict";function t(e){this._maxSize=e,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(e){return this._values[e]},t.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=new t(512),l=new t(512),c=new t(512);function d(e){return o.get(e)||o.set(e,u(e).map((function(e){return e.replace(a,"$2")})))}function u(e){return e.match(r)||[""]}function h(e){return"string"===typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function f(e){return!h(e)&&(function(e){return e.match(i)&&!e.match(n)}(e)||function(e){return s.test(e)}(e))}e.exports={Cache:t,split:u,normalizePath:d,setter:function(e){var t=d(e);return l.get(e)||l.set(e,(function(e,r){for(var n=0,i=t.length,s=e;n<i-1;){var a=t[n];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;s=s[t[n++]]}s[t[n]]=r}))},getter:function(e,t){var r=d(e);return c.get(e)||c.set(e,(function(e){for(var n=0,i=r.length;n<i;){if(null==e&&t)return;e=e[r[n++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(h(t)||n.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,r){!function(e,t,r){var n,i,s,a,o=e.length;for(i=0;i<o;i++)(n=e[i])&&(f(n)&&(n='"'+n+'"'),s=!(a=h(n))&&/^\d+$/.test(n),t.call(r,n,a,s,i,e))}(Array.isArray(e)?e:u(e),t,r)}}},85518:function(e,t,r){"use strict";var n,i=r(67294),s=(n=i)&&"object"===typeof n&&"default"in n?n.default:n,a=r(23451),o=new a,l=o.getBrowser(),c=o.getCPU(),d=o.getDevice(),u=o.getEngine(),h=o.getOS(),f=o.getUA(),p=function(e){return o.setUA(e)},m=function(e){if(e){var t=new a(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},g=Object.freeze({ClientUAInstance:o,browser:l,cpu:c,device:d,engine:u,os:h,ua:f,setUa:p,parseUserAgent:m});function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){return y="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_.apply(this,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function T(e,t){return T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},T(e,t)}function S(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(l){o=!0,i=l}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,t)}
vendor: 4,432 bytes, line 1
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L="mobile",I="tablet",R="smarttv",D="console",C="wearable",P="embedded",O=void 0,M={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},N={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},F={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},B=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},j=function(e){var t=B();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},$=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{vendor:U(t.vendor),model:U(t.model),os:U(r.name),osVersion:U(r.version),ua:U(n)})};var V=function(e){return e.type===L},H=function(e){return e.type===I},G=function(e){var t=e.type;return t===L||t===I},q=function(e){return e.type===R},W=function(e){return e.type===O},K=function(e){return e.type===C},z=function(e){return e.type===D},Y=function(e){return e.type===P},X=function(e){var t=e.vendor;return U(t)},Q=function(e){var t=e.model;return U(t)},Z=function(e){var t=e.type;return U(t,"browser")},J=function(e){return e.name===N.Android},ee=function(e){return e.name===N.Windows},te=function(e){return e.name===N.MAC_OS},re=function(e){return e.name===N.WindowsPhone},ne=function(e){return e.name===N.IOS},ie=function(e){var t=e.version;return U(t)},se=function(e){var t=e.name;return U(t)},ae=function(e){return e.name===M.Chrome},oe=function(e){return e.name===M.Firefox},le=function(e){return e.name===M.Chromium},ce=function(e){return e.name===M.Edge},de=function(e){return e.name===M.Yandex},ue=function(e){var t=e.name;return t===M.Safari||t===M.MobileSafari},he=function(e){return e.name===M.MobileSafari},fe=function(e){return e.name===M.Opera},pe=function(e){var t=e.name;return t===M.InternetExplorer||t===M.Ie},me=function(e){return e.name===M.MIUI},ge=function(e){return e.name===M.SamsungBrowser},ve=function(e){var t=e.version;return U(t)},ye=function(e){var t=e.major;return U(t)},be=function(e){var t=e.name;return U(t)},Ee=function(e){var t=e.name;return U(t)},_e=function(e){var t=e.version;return U(t)},we=function(){var e=B(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"===typeof t&&/electron/.test(t)},Te=function(e){return"string"===typeof e&&-1!==e.indexOf("Edg/")},Se=function(){var e=B();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},Ae=function(){return j("iPad")},ke=function(){return j("iPhone")},xe=function(){return j("iPod")},Le=function(e){return U(e)};function Ie(e){var t=e||g,r=t.device,n=t.browser,i=t.os,s=t.engine,a=t.ua;return{isSmartTV:q(r),isConsole:z(r),isWearable:K(r),isEmbedded:Y(r),isMobileSafari:he(n)||Ae(),isChromium:le(n),isMobile:G(r)||Ae(),isMobileOnly:V(r),isTablet:H(r)||Ae(),isBrowser:W(r),isDesktop:W(r),isAndroid:J(i),isWinPhone:re(i),isIOS:ne(i)||Ae(),isChrome:ae(n),isFirefox:oe(n),isSafari:ue(n),isOpera:fe(n),isIE:pe(n),osVersion:ie(i),osName:se(i),fullBrowserVersion:ve(n),browserVersion:ye(n),browserName:be(n),mobileVendor:X(r),mobileModel:Q(r),engineName:Ee(s),engineVersion:_e(s),getUA:Le(a),isEdge:ce(n)||Te(a),isYandex:de(n),deviceType:Z(r),isIOS13:Se(),isIPad13:Ae(),isIPhone13:ke(),isIPod13:xe(),isElectron:we(),isEdgeChromium:Te(a),isLegacyEdge:ce(n)&&!Te(a),isWindows:ee(i),isMacOs:te(i),isMIUI:me(n),isSamsungBrowser:ge(n)}}var Re=q(d),De=z(d),Ce=K(d),Pe=Y(d),Oe=he(l)||Ae(),Me=le(l),Ne=G(d)||Ae(),Fe=V(d),Ue=H(d)||Ae(),Be=W
1(d),je=W(d),$e=J(h),Ve=re(h),He=ne(h)||Ae(),Ge=ae(l),qe=oe(l),We=ue(l),Ke=fe(l),ze=pe(l),Ye=ie(h),Xe=se(h),Qe=ve(l),Ze=ye(l),Je=be(l),et=X(d),tt=Q(d),rt=Ee(u),nt=_e(u),it=Le(f),st=ce(l)||Te(f),at=de(l),ot=Z(d),lt=Se(),ct=Ae(),dt=ke(),ut=xe(),ht=we(),ft=Te(f),pt=ce(l)&&!Te(f),mt=ee(h),gt=te(h),vt=me(l),yt=ge(l);function bt(e){var t=e||window.navigator.userAgent;return m(t)}t.tq=Ne},21221:function(e){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){"use strict";var n=r(1);e.exports=function(e,t){return t=t||{},n.forEach((function(r){var n="function"==typeof r[1]?r[1](t.retainLength):r[1];e=e.replace(r[0],n)})),e}},function(e){"use strict";e.exports=[[/'''/g,function(e){return"\u2034"+(e?"\u2063\u2063":"")}],[/(\W|^)"(\w)/g,"$1\u201c$2"],[/(\u201c[^"]*)"([^"]*$|[^\u201c"]*\u201c)/g,"$1\u201d$2"],[/([^0-9])"/g,"$1\u201d"],[/''/g,function(e){return"\u2033"+(e?"\u2063":"")}],[/(\W|^)'(\S)/g,"$1\u2018$2"],[/([a-z0-9])'([a-z])/gi,"$1\u2019$2"],[/(\u2018)([0-9]{2}[^\u2019]*)(\u2018([^0-9]|$)|$|\u2019[a-z])/gi,"\u2019$2$3"],[/((\u2018[^']*)|[a-z])'([^0-9]|$)/gi,"$1\u2019$3"],[/(\B|^)\u2018(?=([^\u2018\u2019]*\u2019\b)*([^\u2018\u2019]*\B\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1\u2019"],[/"/g,"\u2033"],[/'/g,"\u2032"]]},function(e,t,r){"use strict";function n(e){if(-1===["CODE","PRE","SCRIPT","STYLE","NOSCRIPT"].indexOf(e.nodeName.toUpperCase())){var t,r,o,l="",c=e.childNodes,d=[];for(t=0;t<c.length;t++)(r=c[t]).nodeType===a||"#text"===r.nodeName?(d.push([r,l.length]),l+=r.nodeValue||r.value):r.childNodes&&r.childNodes.length&&(l+=n(r));for(t in l=s(l,{retainLength:!0}),d)(o=d[t])[0].nodeValue?o[0].nodeValue=i(l,o[0].nodeValue,o[1]):o[0].value&&(o[0].value=i(l,o[0].value,o[1]));return l}}function i(e,t,r){return e.substr(r,t.length).replace("\u2063","")}var s=r(0),a="undefined"!=typeof Element&&Element.TEXT_NODE||3;e.exports=function(e){return n(e),e}},function(e,t,r){"use strict";function n(e){return"undefined"!=typeof document&&"undefined"==typeof e?(a.runOnReady((function(){return s(document.body)})),n):"string"==typeof e?o(e):s(e)}var i=r(1),s=r(2),a=r(4),o=r(0);e.exports=n,e.exports.string=o,e.exports.element=s,e.exports.replacements=i,e.exports.listen=a},function(e,t,r){"use strict";function n(e){var t=new MutationObserver((function(e){e.forEach((function(e){var t,r=!0,n=!1;try{for(var s,a,o=e.addedNodes[Symbol.iterator]();!(r=(s=o.next()).done);r=!0)a=s.value,i(a)}catch(e){n=!0,t=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw t}}}))}));return n.runOnReady((function(){t.observe(e||document.body,{childList:!0,subtree:!0})})),t}var i=r(2);r(0),n.runOnReady=function(e){if("loading"!==document.readyState)e();else if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1);else var t=setInterval((function(){"loading"!==document.readyState&&(clearInterval(t),e())}),10)},e.exports=n}])},59885:function(e){const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=e=>e.match(t)||[],n=e=>e[0].toUpperCase()+e.slice(1),i=(e,t)=>r(e).join(t).toLowerCase(),s=e=>r(e).reduce(((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`),"");e.exports={words:r,upperFirst:n,camelCase:s,pascalCase:e=>n(s(e)),snakeCase:e=>i(e,"_"),kebabCase:e=>i(e,"-"),sentenceCase:e=>n(i(e," ")),titleCase:e=>r(e).map(n).join(" ")}},94633:function(e){function t(e,t){var r=e.length,n=new Array(r),i={},s=r,a=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var i=e[r];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),o=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}(e);for(t.forEach((function(e){if(!o.has(e[0])||!o.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));s--;)i[s]||l(e[s],s,new Set);return n;function l(e,t,s){if(s.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(h){c=""}throw new Error("Cyclic dependency"+c)}if(!o.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var d=a.get(e)||new Set;if(t=(d=Array.from(d)).length){s.add(e);do{var u=d[--t];l(u,o.get(u),s)}while(t);s.delete(e)}n[--r]=e}}}
vendor: 4,259 bytes, line 1
1e.exports=function(e){return t(function(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var i=e[r];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},e.exports.array=t},23451:function(e,t,r){var n;!function(i,s){"use strict";var a="function",o="undefined",l="object",c="string",d="major",u="model",h="name",f="type",p="vendor",m="version",g="architecture",v="console",y="mobile",b="tablet",E="smarttv",_="wearable",w="embedded",T="Amazon",S="Apple",A="ASUS",k="BlackBerry",x="Firefox",L="Google",I="Huawei",R="LG",D="Microsoft",C="Motorola",P="Opera",O="Samsung",M="Sharp",N="Sony",F="Xiaomi",U="Zebra",B="Facebook",j="Chromium OS",$="Mac OS",V=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},H=function(e,t){return typeof e===c&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},q=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var r,n,i,o,c,d,u=0;u<t.length&&!c;){var h=t[u],f=t[u+1];for(r=n=0;r<h.length&&!c&&h[r];)if(c=h[r++].exec(e))for(i=0;i<f.length;i++)d=c[++n],typeof(o=f[i])===l&&o.length>0?2===o.length?typeof o[1]==a?this[o[0]]=o[1].call(this,d):this[o[0]]=o[1]:3===o.length?typeof o[1]!==a||o[1].exec&&o[1].test?this[o[0]]=d?d.replace(o[1],o[2]):s:this[o[0]]=d?o[1].call(this,d,o[2]):s:4===o.length&&(this[o[0]]=d?o[3].call(this,d.replace(o[1],o[2])):s):this[o]=d||s;u+=2}},K=function(e,t){for(var r in t)if(typeof t[r]===l&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(H(t[r][n],e))return"?"===r?s:r}else if(H(t[r],e))return"?"===r?s:r;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,m],[/opios[\/ ]+([\w\.]+)/i],[m,[h,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[m,[h,P]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,m],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[h,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[m,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[m,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure Browser"],m],[/\bfocus\/([\w\.]+)/i],[m,[h,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[m,[h,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[h,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[h,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[m,[h,x]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 Browser"]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 Browser"],m],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,m],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,B],m],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[h,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,"Chrome WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[h,"Android Browser"]],[/(chrome|omniweb|arora|[t
vendor: 4,845 bytes, line 1
1izenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[m,K,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[h,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,m],[/(cobalt)\/([\w\.]+)/i],[h,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,G]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,O],[f,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,O],[f,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,S],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,S],[f,b]],[/(macintosh);/i],[u,[p,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,M],[f,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,I],[f,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,I],[f,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,F],[f,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,F],[f,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[f,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[f,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,C],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,C],[f,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,R],[f,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,R],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[f,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[f,y]],[/(pixel c)\b/i],[u,[p,L],[f,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,L],[f,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,N],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,N],[f,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,T],[f,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,T],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[f,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,k],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,A],[f,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,A],[f,y]],[/(nexus 9)/i],[u,[p,"HTC"],[f,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[f,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 8,071 bytes, line 1
1s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[f,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[f,b]],[/(surface duo)/i],[u,[p,D],[f,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[f,y]],[/(u304aa)/i],[u,[p,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[f,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[f,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[f,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[f,b]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[f,b]],[/\b(k88) b/i],[u,[p,"ZTE"],[f,b]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[f,b]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[f,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[f,b]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[f,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[f,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[f,y]],[/\b(ph-1) /i],[u,[p,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[f,b]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[f,b]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[f,b]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[f,b]],[/(sprint) (\w+)/i],[p,u,[f,y]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,D],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,U],[f,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,U],[f,y]],[/smart-tv.+(samsung)/i],[p,[f,E]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,O],[f,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,R],[f,E]],[/(apple) ?tv/i],[p,[u,"Apple TV"],[f,E]],[/crkey/i],[[u,"Chromecast"],[p,L],[f,E]],[/droid.+aft(\w)( bui|\))/i],[u,[p,T],[f,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,M],[f,E]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,N],[f,E]],[/(mitv-\w{5}) bui/i],[u,[p,F],[f,E]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[f,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,q],[u,q],[f,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[f,v]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[f,v]],[/(playstation [345portablevi]+)/i],[u,[p,N],[f,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,D],[f,v]],[/((pebble))app/i],[p,u,[f,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,S],[f,_]],[/droid.+; (glass) \d/i],[u,[p,L],[f,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,U],[f,_]],[/(quest( 2| pro)?)/i],[u,[p,B],[f,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[f,w]],[/(aeobc)\b/i],[u,[p,T],[f,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[f,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[h,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,m],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[m,K,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[m,K,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,$],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,m],[/\(bb(10);/i],[m,[h,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[h,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[h,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,j],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,m],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,m]]},X=function(e,t){if(typeof e===l&&(t=e,e=s),!(this instanceof X))return new X(e,t).getResult();var r=typeof i!==o&&i.navigator?i.navigator:s,n=e||(r&&r.userAgent?r.userAgent:""),d=r&&r.userAgentData?r.userAgentData:s,u=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2===0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(Y,t):Y,h=r&&r.userAgent==n;return this.getBrowser=function(){var e,t={};return t.name=s,t.version=s,W.call(t,n,u.browser),t.major=typeof(e=t.version)===c?e.replace(/[^\d\.]/g,"").split(".")[0]:s,h&&r&&r.brave&&typeof r.brave.isBrave==a&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=s,W.call(e,n,u.cpu),e},this.getDevice=function(){var e={};return e.vendor=s,e.model=s,e.type=s,W.call(e,n,u.device),h&&!e.type&&d&&d.mobile&&(e.type=y),h&&"Macintosh"==e.model&&r&&typeof r.standalone!==o&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e.model="iPad",e.type=b),e},this.getEngine=function(){var e={};return e.name=s,e.version=s,W.call(e,n,u.engine),e},this.getOS=function(){var e={};return e.name=s,e.version=s,W.call(e,n,u.os),h&&!e.name&&d&&"Unknown"!=d.platform&&(e.name=d.platform.replace(/chrome os/i,j).replace(/macos/i,$)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===c&&e.length>350?q(e,350):e,this},this.setUA(n),this};X.VERSION="1.0.35",X.BROWSER=V([h,m,d]),X.CPU=V([g]),X.DEVICE=V([u,p,f,v,y,E,b,_,w]),X.ENGINE=X.OS=V([h,m]),typeof t!==o?(e.exports&&(t=e.exports=X),t.UAParser=X):r.amdO?(n=function(){return X}.call(t,r,t,e))===s||(e.exports=n):typeof i!==o&&(i.UAParser=X);var Q=typeof i!==o&&(i.jQuery||i.Zepto);if(Q&&!Q.ua){var Z=new X;Q.ua=Z.getResult(),Q.ua.get=function(){return Z.getUA()},Q.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)Q.ua[r]=t[r]}}}("object"===typeof window?window:this)},55851:function(e,t,r){"use strict";r.d(t,{M:function(){return s},_:function(){return a}});var n=r(87536),i=function(e,t,r){if(e&&"reportValidity"in e){var i=(0,n.U2)(r,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},s=function(e,t){var r=function(r){var n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?i(n.ref,r,e):n.refs&&n.refs.forEac
1h((function(t){return i(t,r,e)}))};for(var n in t.fields)r(n)},a=function(e,t){t.shouldUseNativeValidation&&s(e,t);var r={};for(var i in e){var a=(0,n.U2)(t.fields,i),c=Object.assign(e[i]||{},{ref:a&&a.ref});if(l(t.names||Object.keys(e),i)){var d=Object.assign({},o((0,n.U2)(r,i)));(0,n.t8)(d,"root",c),(0,n.t8)(r,i,d)}else(0,n.t8)(r,i,c)}return r},o=function(e){return Array.isArray(e)?e.filter(Boolean):[]},l=function(e,t){return e.some((function(e){return e.startsWith(t+".")}))}},79449:function(e,t,r){"use strict";r.d(t,{Z:function(){return ka}});var n=r(67294),i=r(45697),s=r(54125);function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,l={exports:{}};o=l,function(e){var t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=s.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=r.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var d=o.path,u=d.substring(0,d.lastIndexOf("/")+1)+a.path;c.path=s.normalizePath(u)}else c.path=o.path,a.params||(c.params=o.params,a.query||(c.query=o.query));return null===c.path&&(c.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(c)},parseURL:function(e){var r=t.exec(e);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};o.exports=s}();var c=l.exports;function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}const p=Number.isFinite||function(e){return"number"===typeof e&&isFinite(e)};let m=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hl
1sBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e}({}),g=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),v=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({});const y=function(){},b={trace:y,debug:y,log:y,warn:y,info:y,error:y};let E=b;function _(e,...t){t.forEach((function(t){E[t]=e[t]?e[t].bind(e):function(e){const t=self.console[e];return t?t.bind(self.console,`[${e}] >`):y}(t)}))}const w=E,T=/^(\d+)x(\d+)$/,S=/(.+?)=(".*?"|.*?)(?:,|$)/g;class A{constructor(e){"string"===typeof e&&(e=A.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&("X-"===t.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;
vendor: 7,188 bytes, line 1
1const r=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)r[e]=parseInt(t.slice(2*e,2*e+2),16);return r}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=T.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const r={};for(S.lastIndex=0;null!==(t=S.exec(e));){let e=t[2];0===e.indexOf('"')&&e.lastIndexOf('"')===e.length-1&&(e=e.slice(1,-1));r[t[1].trim()]=e}return r}}function k(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class x{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const r=t.attr;for(const t in r)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==r[t]){w.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=f(new A({}),r,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);p(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(p(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&p(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class L{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var I="audio",R="video",D="audiovideo";class C{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[I]:null,[R]:null,[D]:null},this.baseurl=e}setByteRange(e,t){const r=e.split("@",2),n=[];1===r.length?n[0]=t?t.byteRangeEndOffset:0:n[0]=parseInt(r[1]),n[1]=parseInt(r[0])+n[0],this._byteRange=n}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=c.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class P extends C{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new L,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!p(this.programDateTime))return null;const e=p(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,r,n,i,s=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,n),o.endDTS=Math.max(o.endDTS,i)):a[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:s}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[I]=null,e[R]=null,e[D]=null}}class O extends C{constructor(e,t,r,n,i){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new L,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}class M{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&p(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}
1get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function N(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function F(e){const t=e.split(":");let r=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),n=e[e.length-1].split(",");if(2===n.length){const t="base64"===n[0],i=n[1];t?(e.splice(-1,1),r=N(i)):r=function(e){const t=U(e).subarray(0,16),r=new Uint8Array(16);return r.set(t,16-t.length),r}(i)}}return r}function U(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}var B={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},j="org.w3.clearkey",$="com.apple.streamingkeydelivery",V="com.microsoft.playready",H="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function G(e){switch(e){case $:return B.FAIRPLAY;case V:return B.PLAYREADY;case H:return B.WIDEVINE;case j:return B.CLEARKEY}}var q="edef8ba979d64acea3c827dcd51d21ed";function W(e){switch(e){case B.FAIRPLAY:return $;case B.PLAYREADY:return V;case B.WIDEVINE:return H;case B.CLEARKEY:return j}}function K(e){const{drmSystems:t,widevineLicenseUrl:r}=e,n=t?[B.FAIRPLAY,B.WIDEVINE,B.PLAYREADY,B.CLEARKEY].filter((e=>!!t[e])):[];return!n[B.WIDEVINE]&&r&&n.push(B.WIDEVINE),n}const z="undefined"!==typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Y(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}const X=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,Q=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,Z=(e,t)=>{const r=t;let n=0;for(;X(e,t);){n+=10;n+=J(e,t+6),Q(e,t+10)&&(n+=10),t+=n}if(n>0)return e.subarray(r,r+n)},J=(e,t)=>{let r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3],r},ee=(e,t)=>X(e,t)&&J(e,t+6)+10<=e.length-t,te=e=>e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,re=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=J(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},ne=e=>{let t=0;const r=[];for(;X(e,t);){const n=J(e,t+6);t+=10;const i=t+n;for(;t+8<i;){const n=re(e.subarray(t)),i=ie(n);i&&r.push(i),t+=n.size+10}Q(e,t)&&(t+=10)}return r},ie=e=>"PRIV"===e.type?se(e):"W"===e.type[0]?oe(e):ae(e),se=e=>{if(e.size<2)return;const t=ce(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}},ae=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const r=ce(e.data.subarray(t),!0);t+=r.length+1;const n=ce(e.data.subarray(t));return{key:e.type,info:r,data:n}}const t=ce(e.data.subarray(1));return{key:e.type,data:t}},oe=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const r=ce(e.data.subarray(t),!0);t+=r.length+1;const n=ce(e.data.subarray(t));return{key:e.type,info:r,data:n}}const t=ce(e.data);return{key:e.type,data:t}},le=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),r=1&t[3];let n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}},ce=(e,t=!1)=>{const r=ue();if(r){const n=r.decode(e);if(t){const e=n.indexOf("\0");return-1!==e?n.substring(0,e):n}return n.replace(/\0/g,"")}const n=e.length;let i,s,a,o="",l=0;for(;l<n;){if(i=e[l++],0===i&&t)return o;if(0!==i&&3!==i)switch(i>>
14){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:s=e[l++],o+=String.fromCharCode((31&i)<<6|63&s);break;case 14:s=e[l++],a=e[l++],o+=String.fromCharCode((15&i)<<12|(63&s)<<6|(63&a)<<0)}}return o};let de;function ue(){return de||"undefined"===typeof self.TextDecoder||(de=new self.TextDecoder("utf-8")),de}const he=function(e){let t="";for(let r=0;r<e.length;r++){let n=e[r].toString(16);n.length<2&&(n="0"+n),t+=n}return t},fe=Math.pow(2,32)-1,pe=[].push,me={video:1,audio:2,id3:3,text:4};function ge(e){return String.fromCharCode.apply(null,e)}function ve(e,t){const r=e[t]<<8|e[t+1];return r<0?65536+r:r}function ye(e,t){const r=be(e,t);return r<0?4294967296+r:r}function be(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Ee(e,t,r){e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function _e(e,t){const r=[];if(!t.length)return r;const n=e.byteLength;for(let i=0;i<n;){const s=ye(e,i),a=s>1?i+s:n;if(ge(e.subarray(i+4,i+8))===t[0])if(1===t.length)r.push(e.subarray(i+8,a));else{const n=_e(e.subarray(i+8,a),t.slice(1));n.length&&pe.apply(r,n)}i=a}return r}function we(e){const t=[],r=e[0];let n=8;const i=ye(e,n);n+=4;n+=0===r?8:16,n+=2;let s=e.length+0;const a=ve(e,n);n+=2;for(let o=0;o<a;o++){let r=n;const a=ye(e,r);r+=4;const o=2147483647&a;if(1===(2147483648&a)>>>31)return w.warn("SIDX has hierarchical references (not supported)"),null;const l=ye(e,r);r+=4,t.push({referenceSize:o,subsegmentDuration:l,info:{duration:l/i,start:s,end:s+o-1}}),s+=o,r+=4,n=r}return{earliestPresentationTime:0,timescale:i,version:r,referencesCount:a,references:t}}function Te(e){const t=[],r=_e(e,["moov","trak"]);for(let n=0;n<r.length;n++){const e=r[n],i=_e(e,["tkhd"])[0];if(i){let r=i[0],n=0===r?12:20;const s=ye(i,n),a=_e(e,["mdia","mdhd"])[0];if(a){r=a[0],n=0===r?12:20;const i=ye(a,n),o=_e(e,["mdia","hdlr"])[0];if(o){const r=ge(o.subarray(8,12)),n={soun:I,vide:R}[r];if(n){const r=_e(e,["mdia","minf","stbl","stsd"])[0];let a;r&&(a=ge(r.subarray(12,16))),t[s]={timescale:i,type:n},t[n]={timescale:i,id:s,codec:a}}}}}}return _e(e,["moov","mvex","trex"]).forEach((e=>{const r=ye(e,4),n=t[r];n&&(n.default={duration:ye(e,12),flags:ye(e,20)})})),t}function Se(e){const t=_e(e,["schm"])[0];if(t){const r=ge(t.subarray(4,8));if("cbcs"===r||"cenc"===r)return _e(e,["schi","tenc"])[0]}return w.error("[eme] missing 'schm' box"),null}function Ae(e){const t=ye(e,0);let r=8;1&t&&(r+=4),4&t&&(r+=4);let n=0;const i=ye(e,4);for(let s=0;s<i;s++){if(256&t){n+=ye(e,r),r+=4}512&t&&(r+=4),1024&t&&(r+=4),2048&t&&(r+=4)}return n}function ke(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function xe(e,t){const r=[],n=t.samples,i=t.timescale,s=t.id;let a=!1;return _e(n,["moof"]).map((o=>{const l=o.byteOffset-8;_e(o,["traf"]).map((o=>{const c=_e(o,["tfdt"]).map((e=>{const t=e[0];let r=ye(e,4);return 1===t&&(r*=Math.pow(2,32),r+=ye(e,8)),r/i}))[0];return void 0!==c&&(e=c),_e(o,["tfhd"]).map((c=>{const d=ye(c,4),u=16777215&ye(c,0);let h=0;const f=0!==(16&u);let p=0;const m=0!==(32&u);let g=8;d===s&&(0!==(1&u)&&(g+=8),0!==(2&u)&&(g+=4),0!==(8&u)&&(h=ye(c,g),g+=4),f&&(p=ye(c,g),g+=4),m&&(g+=4),"video"===t.type&&(a=function(e){if(!e)return!1;const t=e.indexOf("."),r=t<0?e:e.substring(0,t);return"hvc1"===r||"hev1"===r||"dvh1"===r||"dvhe"===r}(t.codec)),_e(o,["trun"]).map((s=>{const o=s[0],c=16777215&ye(s,0),d=0!==(1&c);let u=0;const f=0!==(4&c),m=0!==(256&c);let g=0;const v=0!==(512&c);let y=0;const b=0!==(1024&c),E=0!==(2048&c);let _=0;const w=ye(s,4);let T=8;d&&(u=ye(s,T),T+=4),f&&(T+=4);let S=u+l;for(let l=0;l<w;l++){if(m?(g=ye(s,T),T+=4):g=h,v?(y=ye(s,T),T+=4):y=p,b&&(T+=4),E&&(_=0===o?ye(s,T):be(s,T),T+=4),t.type===R){let t=0;for(;t<y;){const s=ye(n,S);if(S+=4,Le(a,n[S])){Ie(n.subarray(S,S+s),a?2:1,e+_/i,r)}S+=s,t+=s+4}}e+=g/i}})))}))}))})),r}function Le(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function Ie(e,t,r,n){const i=Re(e);let s=0;s+=t;let a=0,o=0,l=!1,c=0;for(;s<i.length;){a=0;do{if(s>=i.length)break;c=i[s++],a+=c}while(255===c);o=0;do{if(s>=i.length)break;c=i[s++],o+=c}while(255===c);const e=i.length-s;if(!l&&4===a&&s<i.length){l=!0;if(181===i[s++]){const e=ve(i,s);if(s+=2,49===e){const e=ye(i,s);if(s+=4,1195456820===e){const e=i[s++];if(3===e){const t=i[s++],o=31&t,l=64&t,c=l?2+3*o:0,d=new Uint8Array(c);if(l){d[0]=t;for(let e=1;e<c;e++)d[e]=i[s++]}n.push({type:e,payloadType:a,pts:r,bytes:d})}}}}}else if(5===a&&o<e){if(l=!0,o>16){const e=[];for(let r=0;r<16;r++){const t=i[s++].toString(16);e.push(1==t.length?"0"+t:t),3!==r&&5!==r&&7!==r&&9!==r||e.push("-")}const t=o-16,l=new Uint8Array(t);for(let r=0;r<t;r++)l[r]=i[s++];n.push({payloadType:a,pts:r,uuid:e.join(""),userData:ce(l),userDataBytes:l})}}else if(o<e)s+=o;else if(o>e)break}}function Re(e){const t=e.byteLength,r=[];let n=1;for(;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return e;const i=t-r.length,s=new Uint8Array(i);let a=0;for(n=0;n<i;a++,n++)a===r[0]&&(a++,r.shift()),s[n]=e[a];return s}function De(e,t,r){if(16!==e.byteLength)throw new RangeError("Invalid system id");let n,i,s;if(t){n=1,i=new Uint8Array(16*t.length);for(let e=0;e<t.length;e++){const r=t[e];if(16!==r.byteLength)throw new RangeError("Invalid key");i.set(r,16*e)}}else n=0,i=new Uint8Array;n>0?(s=new Uint8Array(4),t.length>0&&new DataView(s.buffer).setUint32(0,t.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(a.buffer).setUint32(0,r.byteLength,!1),function(e,...t){const r=t.length;let n=8,i=r;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=255&n,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}([112,115,115,104],new Uint8Array([n,0,0,0]),e,s,i,a,r||new Uint8Array)}let Ce={};class Pe{static clearKeyUriToKeyIdMap(){Ce={}}constructor(e,t,r,n=[1],i=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pss
1h=null,this.method=e,this.uri=t,this.keyFormat=r,this.keyFormatVersions=n,this.iv=i,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&"AES-128"!==e}isSupported(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case $:case H:case V:case j:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!==typeof e&&("AES-128"!==this.method||this.iv||w.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const t=function(e){const t=new Uint8Array(16);for(let r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}(e);return new Pe(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=F(this.uri);if(t)switch(this.keyFormat){case H:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case V:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=De(e,null,t);const r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(r)),i=n.substring(n.indexOf("<"),n.length),s=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(s){const e=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(e){const t=N(e).subarray(0,16);!function(e){const t=function(e,t,r){const n=e[t];e[t]=e[r],e[r]=n};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Ce[this.uri];if(!e){const t=Object.keys(Ce).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);new DataView(e.buffer,12,4).setUint32(0,t),Ce[this.uri]=e}this.keyId=e}return this}}const Oe=/\{\$([a-zA-Z0-9-_]+)\}/g;function Me(e){return Oe.test(e)}function Ne(e,t,r){if(null!==e.variableList||e.hasVariableRefs)for(let n=r.length;n--;){const i=r[n],s=t[i];s&&(t[i]=Fe(e,s))}}function Fe(e,t){if(null!==e.variableList||e.hasVariableRefs){const r=e.variableList;return t.replace(Oe,(t=>{const n=t.substring(2,t.length-1),i=null==r?void 0:r[n];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${n}"`)),t):i}))}return t}function Ue(e,t,r){let n,i,s=e.variableList;if(s||(e.variableList=s={}),"QUERYPARAM"in t){n=t.QUERYPARAM;try{const e=new self.URL(r).searchParams;if(!e.has(n))throw new Error(`"${n}" does not match any query parameter in URI: "${r}"`);i=e.get(n)}catch(a){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else n=t.NAME,i=t.VALUE;n in s?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${n}"`)):s[n]=i||""}function Be(e,t,r){const n=t.IMPORT;if(r&&n in r){let t=e.variableList;t||(e.variableList=t={}),t[n]=r[n]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function je(){if("undefined"!==typeof self)return self.MediaSource||self.WebKitMediaSource}const $e={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},Ve=je();function He(e,t){var r;return null!=(r=null==Ve?void 0:Ve.isTypeSupported(`${t||"video"}/mp4;codecs="${e}"`))&&r}const Ge=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,qe=/#EXT-X-MEDIA:(.*)/g,We=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ke=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ze=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ye{static findGroup(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.id===t)return n}}static convertAVC1ToAVCOTI(e){const t=e.split(".");if(t.length>2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}static resolve(e,t){return c.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return We.test(e)}static parseMasterPlaylist(e,t){const r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Me(e)},n=[];let i;for(Ge.lastIndex=0;null!=(i=Ge.exec(e));)if(i[1]){var s;const e=new A(i[1]);
vendor: 4,676 bytes, line 1
1Ne(r,e,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const a=Fe(r,i[2]),o={attrs:e,bitrate:e.decimalInteger("AVERAGE-BANDWIDTH")||e.decimalInteger("BANDWIDTH"),name:e.NAME,url:Ye.resolve(a,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Ze((e.CODECS||"").split(/[ ,]+/).filter((e=>e)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=Ye.convertAVC1ToAVCOTI(o.videoCodec)),null!=(s=o.unknownCodecs)&&s.length||n.push(o),r.levels.push(o)}else if(i[3]){const e=i[3],n=i[4];switch(e){case"SESSION-DATA":{const e=new A(n);Ne(r,e,["DATA-ID","LANGUAGE","VALUE","URI"]);const t=e["DATA-ID"];t&&(null===r.sessionData&&(r.sessionData={}),r.sessionData[t]=e);break}case"SESSION-KEY":{const e=Xe(n,t,r);e.encrypted&&e.isSupported()?(null===r.sessionKeys&&(r.sessionKeys=[]),r.sessionKeys.push(e)):w.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${n}"`);break}case"DEFINE":{const e=new A(n);Ne(r,e,["NAME","VALUE","QUERYPARAM"]),Ue(r,e,t)}break;case"CONTENT-STEERING":{const e=new A(n);Ne(r,e,["SERVER-URI","PATHWAY-ID"]),r.contentSteering={uri:Ye.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":r.startTimeOffset=Qe(n)}}const a=n.length>0&&n.length<r.levels.length;return r.levels=a?n:r.levels,0===r.levels.length&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,r){let n;const i={},s=r.levels,a={AUDIO:s.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:s.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(qe.lastIndex=0;null!==(n=qe.exec(e));){const e=new A(n[1]),s=e.TYPE;if(s){const n=a[s],l=i[s]||[];i[s]=l,Ne(r,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const c={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:s,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?Ye.resolve(e.URI,t):""};if(null!=n&&n.length){const e=Ye.findGroup(n,c.groupId)||n[0];Je(c,e,"audioCodec"),Je(c,e,"textCodec")}l.push(c)}}return i}static parseLevelPlaylist(e,t,r,n,i,s){const a=new M(t),o=a.fragments;let l,c,d,u=null,h=0,m=0,g=0,v=0,y=null,b=new P(n,t),E=-1,_=!1;for(Ke.lastIndex=0,a.m3u8=e,a.hasVariableRefs=Me(e);null!==(l=Ke.exec(e));){_&&(_=!1,b=new P(n,t),b.start=g,b.sn=h,b.cc=v,b.level=r,u&&(b.initSegment=u,b.rawProgramDateTime=u.rawProgramDateTime,u.rawProgramDateTime=null));const e=l[1];if(e){b.duration=parseFloat(e);const t=(" "+l[2]).slice(1);b.title=t||null,b.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(p(b.duration)){b.start=g,d&&rt(b,d,a),b.sn=h,b.level=r,b.cc=v,b.urlId=i,o.push(b);const e=(" "+l[3]).slice(1);b.relurl=Fe(a,e),et(b,y),y=b,g+=b.duration,h++,m=0,_=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);y?b.setByteRange(e,y):b.setByteRange(e)}else if(l[5])b.rawProgramDateTime=(" "+l[5]).slice(1),b.tagList.push(["PROGRAM-DATE-TIME",b.rawProgramDateTime]),-1===E&&(E=o.length);else{if(l=l[0].match(ze),!l){w.warn("No matches on slow regex match for level playlist!");continue}for(c=1;c<l.length&&"undefined"===typeof l[c];c++);const e=(" "+l[c]).slice(1),i=(" "+l[c+1]).slice(1),g=l[c+2]?(" "+l[c+2]).slice(1):"";switch(e){case"PLAYLIST-TYPE":a.type=i.toUpperCase();break;case"MEDIA-SEQUENCE":h=a.startSN=parseInt(i);break;case"SKIP":{const e=new A(i);Ne(a,e,["RECENTLY-REMOVED-DATERANGES"]);const t=e.decimalInteger("SKIPPED-SEGMENTS");if(p(t)){a.skippedSegments=t;for(let e=t;e--;)o.unshift(null);h+=t}const r=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");r&&(a.recentlyRemovedDateranges=r.split("\t"));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(i),1);break;case"VERSION":a.version=parseInt(i);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(i||g)&&b.tagList.push(g?[i,g]:[i]);break;case"DISCONTINUITY":v++,b.tagList.push(["DIS"]);break;case"GAP":b.gap=!0,b.tagList.push([e]);break;case"BITRATE":b.tagList.push([e,i]);break;case"DATERANGE":{const e=new A(i);Ne(a,e,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Ne(a,e,e.clientAttrs);const t=new x(e,a.dateRanges[e.ID]);t.isValid||a.skippedSegments?a.dateRanges[t.id]=t:w.warn(`Ignoring invalid DATERANGE tag: "${i}"`),b.tagList.push(["EXT-X-DATERANGE",i]);break}case"DEFINE":{const e=new A(i);Ne(a,e,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in e?Be(a,e,s):Ue(a,e,t)}break;case"DISCONTINUITY-SEQUENCE":v=parseInt(i);break;case"KEY":{const e=Xe(i,t,a);
1if(e.isSupported()){if("NONE"===e.method){d=void 0;break}d||(d={}),d[e.keyFormat]&&(d=f({},d)),d[e.keyFormat]=e}else w.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${i}"`);break}case"START":a.startTimeOffset=Qe(i);break;case"MAP":{const e=new A(i);if(Ne(a,e,["BYTERANGE","URI"]),b.duration){const i=new P(n,t);tt(i,e,r,d),u=i,b.initSegment=u,u.rawProgramDateTime&&!b.rawProgramDateTime&&(b.rawProgramDateTime=u.rawProgramDateTime)}else tt(b,e,r,d),u=b,_=!0;break}case"SERVER-CONTROL":{const e=new A(i);a.canBlockReload=e.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=e.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&e.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),a.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new A(i);a.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=a.partList;e||(e=a.partList=[]);const r=m>0?e[e.length-1]:void 0,n=m++,s=new A(i);Ne(a,s,["BYTERANGE","URI"]);const o=new O(s,b,t,n,r);e.push(o),b.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new A(i);Ne(a,e,["URI"]),a.preloadHint=e;break}case"RENDITION-REPORT":{const e=new A(i);Ne(a,e,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(e);break}default:w.warn(`line parsed but not handled: ${l}`)}}}y&&!y.relurl?(o.pop(),g-=y.duration,a.partList&&(a.fragmentHint=y)):a.partList&&(et(b,y),b.cc=v,a.fragmentHint=b,d&&rt(b,d,a));const T=o.length,S=o[0],k=o[T-1];if(g+=a.skippedSegments*a.targetduration,g>0&&T&&k){a.averagetargetduration=g/T;const e=k.sn;a.endSN="initSegment"!==e?e:0,a.live||(k.endList=!0),S&&(a.startCC=S.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(g+=a.fragmentHint.duration),a.totalduration=g,a.endCC=v,E>0&&function(e,t){let r=e[t];for(let n=t;n--;){const t=e[n];if(!t)return;t.programDateTime=r.programDateTime-1e3*t.duration,r=t}}(o,E),a}}function Xe(e,t,r){var n,i;const s=new A(e);Ne(r,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=null!=(n=s.METHOD)?n:"",o=s.URI,l=s.hexadecimalInteger("IV"),c=s.KEYFORMATVERSIONS,d=null!=(i=s.KEYFORMAT)?i:"identity";o&&s.IV&&!l&&w.error(`Invalid IV: ${s.IV}`);const u=o?Ye.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Pe(a,u,d,h,l)}function Qe(e){const t=new A(e).decimalFloatingPoint("TIME-OFFSET");return p(t)?t:null}function Ze(e,t){["video","audio","text"].forEach((r=>{const n=e.filter((e=>function(e,t){const r=$e[t];return!!r&&!0===r[e.slice(0,4)]}(e,r)));if(n.length){const i=n.filter((e=>0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)));t[`${r}Codec`]=i.length>0?i[0]:n[0],e=e.filter((e=>-1===n.indexOf(e)))}})),t.unknownCodecs=e}function Je(e,t,r){const n=t[r];n&&(e[r]=n)}function et(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),p(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function tt(e,t,r,n){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",n&&(e.levelkeys=n),e.initSegment=null}function rt(e,t,r){e.levelkeys=t;const{encryptedFragments:n}=r;n.length&&n[n.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||n.push(e)}var nt="manifest",it="level",st="audioTrack",at="subtitleTrack",ot="main",lt="audio",ct="subtitle";function dt(e){const{type:t}=e;switch(t){case st:return lt;case at:return ct;default:return ot}}function ut(e,t){let r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}class ht{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:nt,url:r,deliveryDirectives:null})}onLevelLoading(e,t){const{id:r,level:n,url:i,deliveryDirectives:s}=t;this.load({id:r,level:n,responseType:"text",type:it,url:i,deliveryDirectives:s})}onAudioTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:st,url:i,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:at,url:i,deliveryDirectives:s})}load(e){var t;const r=this.hls.config;let n,i=this.getInternalLoader(e);if(i){const t=i.context;if(t&&t.url===e.url)return void w.trace("[playlist-loader]: playlist request ongoing");w.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}if(n=e.type===nt?r.manifestLoadPolicy.default:f({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part){let t;if(e.type===it&&null!==e.level?t=this.hls.levels[e.level].details:e.type===st&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===at&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,r=t.targetduration;if(e&&r){const t=1e3*Math.max(3*e,.8*r);n=f({},n,{maxTimeToFirstByteMs:Math.min(t,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,n.maxTimeToFirstByteMs)})}}}const s=n.errorRetry||n.timeoutRetry||{},a={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},o={onSuccess:(e,t,r,n)=>{const i=this.getInternalLoader(r);this.resetInternalLoader(r.type);const s=e.data;0===s.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Ye.isMediaPlaylist(s)?this.handleTrackOrLevelPlaylist(e,t,r,n||null,i):this.handleMasterPlaylist(e,t,r,n)):this.handleManifestParsingError(e,r,new Error("no EXTM3U delimiter"),n||null,t)},onError:(e,t,r,n)=>{this.handleNetworkError(t,r,!1,e,n)},onTimeout:(e,t,r)=>{this.handleNetworkError(t,r,!0,void 0,e)}};i.load(e,a,o)}handleMasterPlaylist(e,t,r,n){const i=this.hls,s=e.data,a=ut(e,r),o=Ye.parseMasterPlaylist(s,a);if(o.playlistParsingError)return void this.handleManifestParsingError(e,r,o.playlistParsingError,n,t);const{contentSteering:l,levels:c,sessionData:d,sessionKeys:u,startTimeOffset:h,variableList:f}=o;this.variableList=f;const{AUDIO:p=[],SUBTITLES:g,"CLOSED-CAPTIONS":v}=Ye.parseMasterPlaylistMedia(s,a,o);if(p.length){p.some((e=>!e.url))||!c[0].audioCodec||c[0].attrs.AUDIO||(w.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new A({}),bitrate:0,url:""}))}i.trigger(m.MANIFEST_LOADED,{levels:c,audioTracks:p,subtitles:g,captions:v,contentSteering:l,url:a,stats:t,networkDetails:n,sessionData:d,sessionKeys:u,startTimeOffset:h,variableList:f})}handleTrackOrLevelPlaylist(e,t,r,n,i){const s=this.hls,{id:a,level:o,type:l}=r,c=ut(e,r),d=p(a)?a:0,u=p(o)?o:d,h=dt(r),f=Ye.parseLevelPlaylist(e.data,c,u,h,d,this.variableList);if(l===nt){const e={attrs:new A({}),bitrate:0,details:f,name:"",url:c};s.trigger(m.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:c,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=f,this.handlePlaylistLoaded(f,e,t,r,n,i)}handleManifestParsingError(e,t,r,n,i){this.hls.trigger(m.ERROR,{type:g.NETWORK_E
1RROR,details:v.MANIFEST_PARSING_ERROR,fatal:t.type===nt,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:n,stats:i})}handleNetworkError(e,t,r=!1,n,i){let s=`A network ${r?"timeout":"error"+(n?" (status "+n.code+")":"")} occurred while loading ${e.type}`;e.type===it?s+=`: ${e.level} id: ${e.id}`:e.type!==st&&e.type!==at||(s+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(s);w.warn(`[playlist-loader]: ${s}`);let o=v.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case nt:o=r?v.MANIFEST_LOAD_TIMEOUT:v.MANIFEST_LOAD_ERROR,l=!0;break;case it:o=r?v.LEVEL_LOAD_TIMEOUT:v.LEVEL_LOAD_ERROR,l=!1;break;case st:o=r?v.AUDIO_TRACK_LOAD_TIMEOUT:v.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case at:o=r?v.SUBTITLE_TRACK_LOAD_TIMEOUT:v.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(e.type);const d={type:g.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:i};if(n){const r=(null==t?void 0:t.url)||e.url;d.response=u({url:r,data:void 0},n)}this.hls.trigger(m.ERROR,d)}handlePlaylistLoaded(e,t,r,n,i,s){const a=this.hls,{type:o,level:l,id:c,groupId:d,deliveryDirectives:u}=n,h=ut(t,n),f=dt(n),p="number"===typeof n.level&&f===ot?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void a.trigger(m.ERROR,{type:g.NETWORK_ERROR,details:v.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:e,reason:e.message,response:t,context:n,level:p,parent:f,networkDetails:i,stats:r})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const y=e.playlistParsingError;if(y)a.trigger(m.ERROR,{type:g.NETWORK_ERROR,details:v.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:y,reason:y.message,response:t,context:n,level:p,parent:f,networkDetails:i,stats:r});else switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case nt:case it:a.trigger(m.LEVEL_LOADED,{details:e,level:p||0,id:c||0,stats:r,networkDetails:i,deliveryDirectives:u});break;case st:a.trigger(m.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:d||"",stats:r,networkDetails:i,deliveryDirectives:u});break;case at:a.trigger(m.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:d||"",stats:r,networkDetails:i,deliveryDirectives:u})}}}function ft(e,t){let r;try{r=new Event("addtrack")}catch(n){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function pt(e,t){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){w.debug(`[texttrack-utils]: ${n}`);const r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}"disabled"===r&&(e.mode=r)}function mt(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function gt(e,t,r,n){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0){const i=function(e,t,r){const n=[],i=function(e,t){if(t<e[0].startTime)return 0;const r=e.length-1;if(t>e[r].endTime)return-1;let n=0,i=r;for(;n<=i;){const s=Math.floor((i+n)/2);if(t<e[s].startTime)i=s-1;else{if(!(t>e[s].startTime&&n<r))return s;n=s+1}}return e[n].startTime-t<t-e[i].startTime?n:i}(e,t);if(i>-1)for(let s=i,a=e.length;s<a;s++){const i=e[s];if(i.startTime>=t&&i.endTime<=r)n.push(i);else if(i.startTime>r)return n}return n}(e.cues,t,r);for(let t=0;t<i.length;t++)n&&!n(i[t])||e.removeCue(i[t])}"disabled"===i&&(e.mode=i)}var vt="org.id3",yt="com.apple.quicktime.HLS",bt="https://aomedia.org/emsg/ID3";function Et(){if("undefined"!==typeof self)return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const _t=(()=>{const e=Et();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function wt(e,t){return e.getTime()/1e3-t}class Tt{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(mt(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const r=e[t];if("metadata"===r.kind&&"id3"===r.label)return ft(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:r,enableID3MetadataCues:n}}}=this;if(!r&&!n)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Et();for(let a=0;a<i.length;a++){const e=i[a].type;if(e===bt&&!r||!n)continue;const t=ne(i[a].data);if(t){const r=i[a].pts;let n=r+i[a].duration;n>_t&&(n=_t);n-r<=0&&(n=r+.25);for(let i=0;i<t.length;i++){const a=t[i];if(!te(a)){this.updateId3CueEnds(r,e);const t=new s(r,n,"");t.value=a,e&&(t.type=e),this.id3Track.addCue(t)}}}}}updateId3CueEnds(e,t){var r;const n=null==(r=this.id3Track)?void 0:r.cues;if(n)for(let i=n.length;i--;){const r=n[i];r.type===t&&r.startTime<e&&r.endTime===_t&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:n}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=s;if(i&&(a||o)){let e;e="audio"===n?e=>e.type===vt&&o:"video"===n?e=>e.type===bt&&a:e=>e.type===vt&&o||e.type===bt&&a,gt(i,t,r,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:r,id3Track:n}=this,{dateRanges:i}=t,s=Object.keys(i);if(n){const e=Object.keys(r).filter((e=>!s.includes(e)));for(let t=e.length;t--;){const i=e[t];Object.keys(r[i].cues).forEach((e=>{n.removeCue(r[i].cues[e])})),delete r[i]}}const a=t.fragments[t.fragments.length-1];if(0===s.length||!p(null==a?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=a.programDateTime/1e3-a.start,l=Et();for(let u=0;u<s.length;u++){const e=s[u],t=i[e],n=r[e],a=(null==n?void 0:n.cues)||{};let h=(null==n?void 0:n.durationKnown)||!1;const f=wt(t.startDate,o);let p=_t;const m=t.endDate;if(m)p=wt(m,o),h=!0;else if(t.endOnNext&&!h){const e=s.reduce(((e,r)=>{const n=i[r];return n.class===t.class&&n.id!==r&&n.startDate>t.startDate&&e.push(n),e}),[]).sort(((e,t)=>e.startDate.getTime()-t.startDate.getTime()))[0];e&&(p=wt(e.startDate,o),h=!0)}const g=Object.keys(t.attr);for(let r=0;r<g.length;r++){const i=g[r];if("ID"===(d=i)||"CLASS"===d||"START-DATE"===d||"DURATION"===d||"END-DATE"===d||"END-ON-NEXT"===d)continue;let s=a[i];if(s)h&&!n.durationKnown&&(s.endTime=p);else{let r=t.attr[i];s=new l(f,p,""),k(i)&&(c=r,r=Uint8Array.from(c.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),s.value={key:i,data:r},s.type=yt,s.id=e,this.id3Track.addCue(s),a[i]=s}}r[e]={cues:a,dateRange:t,durationKnown:h}}var c,d}}class St{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:r,targetduration:n}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&r||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==i?i:s*n);const c=n;return l+Math.min(1*this.stallCount,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;const n=r.edge,i=e-t-this.edgeStalled,s=n-r.totalduration,a=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,i),a)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}
1registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(m.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(m.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var r;t.details===v.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(r=this.levelDetails)&&r.live&&w.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const r=this.computeLatency();if(null===r)return;this._latency=r;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:i}=this.config;if(!n||1===i)return;const s=this.targetLatency;if(null===s)return;const a=r-s,o=a<Math.min(this.maxLatency,s+t.targetduration);if(t.live&&o&&a>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,i)),r=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,r))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const At=["NONE","TYPE-0","TYPE-1",null];var kt="",xt="YES",Lt="v2";class It{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Rt{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>e)).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}get textGroupId(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function Dt(e,t){const r=t.startPTS;if(p(r)){let n,i=0;t.sn>e.sn?(i=r-e.start,n=e):(i=e.start-r,n=t),n.duration!==i&&(n.duration=i)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration}else t.start=Math.max(e.start-t.duration,0)}function Ct(e,t,r,n,i,s){n-r<=0&&(w.warn("Fragment should have a positive duration",t),n=r+t.duration,s=i+t.duration);let a=r,o=n;const l=t.startPTS,c=t.endPTS;if(p(l)){const e=Math.abs(l-r);p(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,a=Math.max(r,l),r=Math.min(r,l),i=Math.min(i,t.startDTS),o=Math.min(n,c),n=Math.max(n,c),s=Math.max(s,t.endDTS)}const d=r-t.start;0!==t.start&&(t.start=r),t.duration=n-t.start,t.startPTS=r,t.maxStartPTS=a,t.startDTS=i,t.endPTS=n,t.minEndPTS=o,t.endDTS=s;const u=t.sn;if(!e||u<e.startSN||u>e.endSN)return 0;let h;const f=u-e.startSN,m=e.fragments;for(m[f]=t,h=f;h>0;h--)Dt(m[h],m[h-1]);for(h=f;h<m.length-1;h++)Dt(m[h],m[h+1]);return e.fragmentHint&&Dt(m[m.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function Pt(e,t){let r=null;const n=e.fragments;for(let l=n.length-1;l>=0;l--){const e=n[l].initSegment;if(e){r=e;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let i,s=0;if(function(e,t,r){const n=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(n?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let c=i;c<=s;c++){const e=l[a+c];let i=o[c];n&&!i&&c<n&&(i=t.fragments[c]=e),e&&i&&r(e,i)}}(e,t,((e,n)=>{e.relurl&&(s=e.cc-n.cc),p(e.startPTS)&&p(e.endPTS)&&(n.start=n.startPTS=e.startPTS,n.startDTS=e.startDTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.duration=e.endPTS-e.startPTS,n.duration&&(i=n),t.PTSKnown=t.alignedSliding=!0),n.elementaryStreams=e.elementaryStreams,n.loader=e.loader,n.stats=e.stats,n.urlId=e.urlId,e.initSegment&&(n.initSegment=e.initSegment,r=e.initSegment)})),r){(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEac
1h((e=>{var t;e.initSegment&&e.initSegment.relurl!==(null==(t=r)?void 0:t.relurl)||(e.initSegment=r)}))}if(t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((e=>!e)),t.deltaUpdateFailed){w.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,r){const n=f({},e);r&&r.forEach((e=>{delete n[e]}));return Object.keys(t).forEach((e=>{const r=new x(t[e].attr,n[e]);r.isValid?n[e]=r:w.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)})),n}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const a=t.fragments;if(s){w.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e<a.length;e++)a[e].cc+=s}t.skippedSegments&&(t.startCC=t.fragments[0].cc),function(e,t,r){if(e&&t){let n=0;for(let i=0,s=e.length;i<=s;i++){const s=e[i],a=t[i+n];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?r(s,a):n--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),i?Ct(t,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Ot(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function Ot(e,t){const r=t.startSN+t.skippedSegments-e.startSN,n=e.fragments;r<0||r>=n.length||Mt(t,n[r].start)}function Mt(e,t){if(t){const r=e.fragments;for(let n=e.skippedSegments;n<r.length;n++)r[n].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function Nt(e,t,r){var n;return null!=e&&e.details?Ft(null==(n=e.details)?void 0:n.partList,t,r):null}function Ft(e,t,r){if(e)for(let n=e.length;n--;){const i=e[n];if(i.index===r&&i.fragment.sn===t)return i}return null}function Ut(e){switch(e.details){case v.FRAG_LOAD_TIMEOUT:case v.KEY_LOAD_TIMEOUT:case v.LEVEL_LOAD_TIMEOUT:case v.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Bt(e,t){const r=Ut(t);return e.default[(r?"timeout":"error")+"Retry"]}function jt(e,t){const r="linear"===e.backoff?1:Math.pow(2,t);return Math.min(r*e.retryDelayMs,e.maxRetryDelayMs)}function $t(e){return u(u({},e),{errorRetry:null,timeoutRetry:null})}function Vt(e,t,r,n){return!!e&&t<e.maxNumRetry&&(function(e){return 0===e&&!1===navigator.onLine||!!e&&(e<400||e>499)}(n)||!!r)}const Ht=function(e,t){let r=0,n=e.length-1,i=null,s=null;for(;r<=n;){i=(r+n)/2|0,s=e[i];const a=t(s);if(a>0)r=i+1;else{if(!(a<0))return s;n=i-1}}return null};function Gt(e,t,r=0,n=0){let i=null;if(e?i=t[e.sn-t[0].sn+1]||null:0===r&&0===t[0].start&&(i=t[0]),i&&0===qt(r,n,i))return i;const s=Ht(t,qt.bind(null,r,n));return!s||s===e&&i?i:s}function qt(e=0,t=0,r){if(r.start<=e&&r.start+r.duration>e)return 0;const n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function Wt(e,t,r){const n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>e}var Kt=0,zt=2,Yt=5,Xt=0,Qt=1,Zt=2;function Jt(e,t,r){if(performance.now()-e.lastErrorPerfMs>3e5)return!0;const n=e.details;if(t.details===v.FRAG_GAP&&n&&t.frag){const e=t.frag.start,r=Gt(null,n.fragments,e);if(r&&!r.gap)return!0}if(r&&e.errors.length<r.errors.length){const r=e.errors[e.errors.length-1];if(n&&r.frag&&t.frag&&Math.abs(r.frag.start-t.frag.start)>3*n.targetduration)return!0}return!1}class er{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=w.log.bind(w,`${t}:`),this.warn=w.warn.bind(w,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const r=null==t?void 0:t.renditionReports;if(r){let i=-1;for(let s=0;s<r.length;s++){const a=r[s];let o;try{o=new self.URL(a.URI,t.url).href}catch(n){w.warn(`Could not construct new URL for Rendition Report: ${n}`),o=a.URI||""}if(o===e){i=s;break}o===e.substring(0,o.length)&&(i=s)}if(-1!==i){const e=r[i],n=parseInt(e["LAST-MSN"])||(null==t?void 0:t.lastPartSn);let s=parseInt(e["LAST-PART"])||(null==t?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);s>=0&&e>t.partTarget&&(s+=1)}return new It(n,s>=0?s:void 0,kt)}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,r){const{details:n,stats:i}=t,s=self.performance.now(),a=i.loading.first?Math.max(0,s-i.loading.first):0;if(n.advancedDateTime=Date.now()-a,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED"}`),r&&n.fragments.length>0&&Pt(r,n),!this.canLoad||!n.live)return;let a,o,l;if(n.canBlockReload&&n.endSN&&n.advanced){const e=this.hls.config.lowLatencyMode,i=n.lastPartSn,s=n.endSN,c=n.lastPartIndex,d=i===s,u=e?0:c;-1!==c?(o=d?s+1:i,l=d?u:c+1):o=s+1;
1const h=n.age,f=h+n.ageHeader;let p=Math.min(f-n.partTarget,1.5*n.targetduration);if(p>0){if(r&&p>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${p} with playlist age: ${n.age}`),p=0;else{const e=Math.floor(p/n.targetduration);if(o+=e,void 0!==l){l+=Math.round(p%n.targetduration/n.partTarget)}this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${p} skip sn ${e} to part ${l}`)}n.tuneInGoal=p}if(a=this.getDeliveryDirectives(n,t.deliveryDirectives,o,l),e||!d)return void this.loadPlaylist(a)}else n.canBlockReload&&(a=this.getDeliveryDirectives(n,t.deliveryDirectives,o,l));const c=this.hls.mainForwardBufferInfo,d=c?c.end-c.len:0,u=function(e,t=1/0){let r=1e3*e.targetduration;if(e.updated){const n=e.fragments,i=4;if(n.length&&r*i>t){const e=1e3*n[n.length-1].duration;e<r&&(r=e)}}else r/=2;return Math.round(r)}(n,1e3*(n.edge-d));n.updated&&s>this.requestScheduled+u&&(this.requestScheduled=i.loading.start),void 0!==o&&n.canBlockReload?this.requestScheduled=i.loading.first+u-(1e3*n.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+u<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=u);let h=this.requestScheduled-s;h=Math.max(0,h),this.log(`reload live playlist ${e} in ${Math.round(h)} ms`),this.timer=self.setTimeout((()=>this.loadPlaylist(a)),h)}else this.clearTimer()}getDeliveryDirectives(e,t,r,n){let i=function(e,t){const{canSkipUntil:r,canSkipDateRanges:n,endSN:i}=e;return r&&(void 0!==t?t-i:0)<r?n?Lt:xt:kt}(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,i=kt),new It(r,n,i)}checkRetry(e){const t=e.details,r=Ut(e),n=e.errorAction,{action:i,retryCount:s=0,retryConfig:a}=n||{},o=!!n&&!!a&&(i===Yt||!n.resolved&&i===zt);if(o){var l;if(this.requestScheduled=-1,s>=a.maxNumRetry)return!1;if(r&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=jt(a,s);this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,n.resolved=!0}return o}}let tr;class rr extends er{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const r=[],n={};let i;t.levels.forEach((e=>{var t;const s=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(tr||(tr=/chrome|firefox/i.test(navigator.userAgent)),tr&&(e.audioCodec=void 0));const{AUDIO:a,CODECS:o,"FRAME-RATE":l,"PATHWAY-ID":c,RESOLUTION:d,SUBTITLES:u}=s,h=`${`${c||"."}-`}${e.bitrate}-${d}-${l}-${o}`;i=n[h],i?i.addFallback(e):(i=new Rt(e),n[h]=i,r.push(i)),nr(i,"audio",a),nr(i,"text",u)})),this.filterAndSortMediaOptions(r,t)}filterAndSortMediaOptions(e,t){let r=[],n=[],i=!1,s=!1,a=!1,o=e.filter((({audioCodec:e,videoCodec:t,width:r,height:n,unknownCodecs:o})=>(i||(i=!(!r||!n)),s||(s=!!t),a||(a=!!e),!(null!=o&&o.length)&&(!e||He(e,"audio"))&&(!t||He(t,"video")))));if((i||s)&&a&&(o=o.filter((({videoCodec:e,width:t,height:r})=>!!e||!(!t||!r)))),0===o.length)return void Promise.resolve().then((()=>
1{if(this.hls){const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}));t.audioTracks&&(r=t.audioTracks.filter((e=>!e.audioCodec||He(e.audioCodec,"audio"))),ir(r)),t.subtitles&&(n=t.subtitles,ir(n));const l=o.slice(0);o.sort(((e,t)=>e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):i&&e.height!==t.height?e.height-t.height:0));let c=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let h=0;h<l.length;h++)if(l[h].pathwayId===o[0].pathwayId){c=l[h];break}this._levels=o;for(let h=0;h<o.length;h++)if(o[h]===c){this._firstLevel=h,this.log(`manifest loaded, ${o.length} level(s) found, first bitrate: ${c.bitrate}`);break}const d=a&&!s,u={levels:o,audioTracks:r,subtitleTracks:n,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:s,altAudio:!d&&r.some((e=>!!e.url))};this.hls.trigger(m.MANIFEST_PARSED,u),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const r=new Error("invalid level idx"),n=e<0;if(this.hls.trigger(m.ERROR,{type:g.OTHER_ERROR,details:v.LEVEL_SWITCH_ERROR,level:e,fatal:n,error:r,reason:r.message}),n)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,n=this.currentLevel,i=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],a=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&s.details&&n&&i===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${r}${i?" with Pathway "+i:""}`);const o=f({},s,{level:e,maxBitrate:s.maxBitrate,attrs:s.attrs,uri:s.uri,urlId:s.urlId});delete o._attrs,delete o._urlId,this.hls.trigger(m.LEVEL_SWITCHING,o);const l=s.details;if(!l||l.live){const e=this.switchParams(s.uri,null==n?void 0:n.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===it&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(void 0!==t&&t.type===ot){const e=this._levels[t.level];void 0!==e&&(e.loadError=0)}}onLevelLoaded(e,t){var r;const{level:n,details:i}=t,s=this._levels[n];var a;if(!s)return this.warn(`Invalid level index ${n}`),void(null!=(a=t.deliveryDirectives)&&a.skip&&(i.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0),this.playlistLoaded(n,t,s.details)):null!=(r=t.deliveryDirectives)&&r.skip&&(i.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const r=this.currentLevel;if(!r)return;const n=this.hls.audioTracks[t.id].groupId;if(r.audioGroupIds&&r.audioGroupId!==n){let e=-1;for(let t=0;t<r.audioGroupIds.length;t++)if(r.audioGroupIds[t]===n){e=t;break}-1!==e&&e!==r.urlId&&(r.urlId=e,this.canLoad&&this.startLoad())}}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,r=this.currentLevel;if(r&&this.shouldLoadPlaylist(r)){const i=r.urlId;let s=r.uri;if(e)try{s=e.addDirectives(s)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}const a=r.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""} with${a?" Pathway "+a:""} URI ${i+1}/${r.url.length} ${s}`),this.clearTimer(),this.hls.trigger(m.LEVEL_LOADING,{url:s,level:t,id:i,deliveryDirectives:e||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e,t){const r=(e,r)=>r!==t,n=this._levels.filter(((n,i)=>i!==e||(n.url.length>1&&void 0!==t?(n.url=n.url.filter(r),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(r)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(r)),n.urlId=0,!0):(this.steering&&this.steering.removeLevel(n),!1))));this.hls.trigger(m.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){t.forEach(((e,t)=>{const{details:r}=e;
1null!=r&&r.fragments&&r.fragments.forEach((e=>{e.level=t}))})),this._levels=t}}function nr(e,t,r){r&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=r):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=r))}function ir(e){const t={};e.forEach((e=>{const r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++}))}var sr="NOT_LOADED",ar="APPENDING",or="PARTIAL",lr="OK";class cr{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(m.BUFFER_APPENDED,this.onBufferAppended,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.BUFFER_APPENDED,this.onBufferAppended,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let n=r.length;n--;){const t=r[n];if(!t)break;const i=t.end;if(t.start<=e&&null!==i&&e<=i)return t}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:r}=this,n=Object.keys(r);for(let i=n.length;i--;){const s=r[n[i]];if((null==s?void 0:s.body.type)===t&&s.buffered){const t=s.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,r,n){this.timeRanges&&(this.timeRanges[e]=t);const i=(null==n?void 0:n.fragment.sn)||-1;Object.keys(this.fragments).forEach((n=>{const s=this.fragments[n];if(!s)return;if(i>=s.body.sn)return;if(!s.buffered&&!s.loaded)return void(s.body.type===r&&this.removeFragment(s.body));const a=s.range[e];a&&a.time.some((e=>{const r=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&this.removeFragment(s.body),r}))}))}detectPartialFragments(e){const t=this.timeRanges,{frag:r,part:n}=e;if(!t||"initSegment"===r.sn)return;const i=ur(r),s=this.fragments[i];if(!s)return;const a=!r.relurl;Object.keys(t).forEach((e=>{const i=r.elementaryStreams[e];if(!i)return;const o=t[e],l=a||!0===i.partial;s.range[e]=this.getBufferedTimes(r,n,l,o)})),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,s.body.endList&&(this.endListFragments[s.body.type]=s),dr(s)||this.removeParts(r.sn-1,r.type)):this.removeFragment(s.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter((t=>t.fragment.sn>=e)))}fragBuffered(e,t){const r=ur(e);let n=this.fragments[r];!n&&t&&(n=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,n.buffered=!0)}getBufferedTimes(e,t,r,n){const i={time:[],partial:r},s=e.start,a=e.end,o=e.minEndPTS||a,l=e.maxStartPTS||s;for(let c=0;c<n.length;c++){const e=n.start(c)-this.bufferPadding,t=n.end(c)+this.bufferPadding;if(l>=e&&o<=t){i.time.push({startPTS:Math.max(s,n.start(c)),endPTS:Math.min(a,n.end(c))});break}if(s<t&&a>e)i.partial=!0,i.time.push({startPTS:Math.max(s,n.start(c)),endPTS:Math.min(a,n.end(c))});else if(a<=e)break}return i}getPartialFragment(e){let t,r,n,i=null,s=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach((l=>{const c=o[l];c&&dr(c)&&(r=c.body.start-a,n=c.body.end+a,e>=r&&e<=n&&(t=Math.min(e-r,n-e),s<=t&&(i=c.body,s=t)))})),i}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||dr(t))}getState(e){const t=ur(e),r=this.fragments[t];return r?r.buffered?dr(r)?or:lr:ar:sr}isTimeBuffered(e,t,r){let n,i;for(let s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1}onFragLoaded(e,t){const{frag:r,part:n}=t;if("initSegment"===r.sn||r.bitrateTest)return;const i=n?null:t,s=ur(r);this.fragments[s]={body:r,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:n,timeRanges:i}=t;if("initSegment"===r.sn)return;const s=r.type;if(n){let e=this.activePartLists[s];e||(this.activePartLists[s]=e=[]),e.push(n)}
vendor: 1,191 bytes, line 1
1this.timeRanges=i,Object.keys(i).forEach((e=>{const t=i[e];this.detectEvictedFragments(e,t,s,n)}))}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ur(e);return!!this.fragments[t]}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,r,n,i){n&&!this.hasGaps||Object.keys(this.fragments).forEach((s=>{const a=this.fragments[s];if(!a)return;const o=a.body;o.type!==r||n&&!o.gap||o.start<t&&o.end>e&&(a.buffered||i)&&this.removeFragment(o)}))}removeFragment(e){const t=ur(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const t=e.sn;this.activePartLists[e.type]=r.filter((e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function dr(e){var t,r,n;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(r=e.range.audio)?void 0:r.partial)||(null==(n=e.range.audiovideo)?void 0:n.partial))}function ur(e){return`${e.type}_${e.level}_${e.urlId}_${e.sn}
1`}const hr=Math.pow(2,17);class fr{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const r=e.url;if(!r)return Promise.reject(new gr({type:g.NETWORK_ERROR,details:v.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(r?"part list":"url")),networkDetails:null}));this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap)return void o(mr(e));const l=this.loader=e.loader=i?new i(n):new s(n),c=pr(e),d=$t(n.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:hr};e.stats=l.stats,l.load(c,h,{onSuccess:(t,r,n,i)=>{this.resetLoader(e,l);let s=t.data;n.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),a({frag:e,part:null,payload:s,networkDetails:i})},onError:(t,n,i,s)=>{this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:u({url:r,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:i,stats:s}))},onAbort:(t,r,n)=>{this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:n,stats:t}))},onTimeout:(t,r,n)=>{this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:n,stats:t}))},onProgress:(r,n,i,s)=>{t&&t({frag:e,part:null,payload:i,networkDetails:s})}})}))}loadPart(e,t,r){this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void o(mr(e,t));const l=this.loader=e.loader=i?new i(n):new s(n),c=pr(e,t),d=$t(n.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:hr};t.stats=l.stats,l.load(c,h,{onSuccess:(n,i,s,o)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const c={frag:e,part:t,payload:n.data,networkDetails:o};r(c),a(c)},onError:(r,n,i,s)=>{this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:u({url:c.url,data:void 0},r),error:new Error(`HTTP Error ${r.code} ${r.text}`),networkDetails:i,stats:s}))},onAbort:(r,n,i)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:i,stats:r}))},onTimeout:(r,n,i)=>{this.resetLoader(e,l),o(new gr({type:g.NETWORK_ERROR,details:v.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:i,stats:r}))}})}))}updateStatsFromPart(e,t){const r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){const n=Math.round(e.duration/t.duration),s=Math.min(Math.round(r.loaded/i),n),a=(n-s)*Math.round(r.loaded/s);r.total=r.loaded+a}else r.total=Math.max(r.loaded,r.total);const s=r.loading,a=n.loading;s.start?s.first+=a.first-a.start:(s.start=a.start,s.first=a.first),s.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function pr(e,t=null){const r=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=r.byteRangeStartOffset,s=r.byteRangeEndOffset;if(p(i)&&p(s)){var a;let t=i,r=s;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){const e=s-i;e%16&&(r=s+(16-e%16)),0!==i&&(n.resetIV=!0,t=i-16)}n.rangeStart=t,n.rangeEnd=r}return n}function mr(e,t){const r=new Error(`GAP ${e.gap?"tag":"attribute"} found`),n={type:g.MEDIA_ERROR,details:v.FRAG_GAP,fatal:!1,frag:e,error:r,networkDetails:null};return t&&(n.part=t),(t||e).stats.aborted=!0,new gr(n)}class gr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class vr{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const t in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[t].loader;if(r){if(e&&e!==r.context.frag.type)return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=v.KEY_LOAD_ERROR,r,n,i){return new gr({type:g.NETWORK_E
1RROR,details:t,fatal:!1,frag:e,response:i,error:r,networkDetails:n})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:r,cc:n}=e;for(let e=0;e<t.length;e++){const i=t[e];if(n<=i.cc&&("initSegment"===r||"initSegment"===i.sn||r<i.sn)){this.emeController.selectKeySystemFormat(i).then((e=>{i.setKeyFormat(e)}));break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var r,n;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const r=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,v.KEY_LOAD_ERROR,r))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,v.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let a=this.keyUriToKeyInfo[s];if(null!=(r=a)&&r.decryptdata.key)return i.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});var o;if(null!=(n=a)&&n.keyLoadPromise)switch(null==(o=a.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then((t=>(i.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:a})))}switch(a=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===i.keyFormat?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,v.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(r);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,r)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,n=new(0,r.loader)(r);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise(((i,s)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},o=r.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,r,n)=>{const{frag:a,keyInfo:o,url:l}=r;if(!a.decryptdata||o!==this.keyUriToKeyInfo[l])return s(this.createKeyLoadError(a,v.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),n));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,i({frag:a,keyInfo:o})},onError:(e,r,n,i)=>{this.resetLoader(r),s(this.createKeyLoadError(t,v.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),n,u({url:a.url,data:void 0},e)))},onTimeout:(e,r,n)=>{this.resetLoader(r),s(this.createKeyLoadError(t,v.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),n))},onAbort:(e,r,n)=>{this.resetLoader(r),s(this.createKeyLoadError(t,v.INTERNAL_ABORTED,new Error("key loading aborted"),n))}};n.load(a,l,c)}))}resetLoader(e){const{frag:t,keyInfo:r,url:n}=e,i=r.loader;t.keyLoader===i&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[n],i&&i.destroy()}}const yr={length:0,start:()=>0,end:()=>0};class br{static isBuffered(e,t){try{if(e){const r=br.getBuffered(e);for(let e=0;e<r.length;e++)if(t>=r.start(e)&&t<=r.end(e))return!0}}catch(r){}return!1}static bufferInfo(e,t,r){try{if(e){const n=br.getBuffered(e),i=[];let s;for(s=0;s<n.length;s++)i.push({start:n.start(s),end:n.end(s)});return this.bufferedInfo(i,t,r)}}catch(n){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.sort((function(e,t){const r=e.start-t.start;return r||t.end-e.end}));let n=[];if(r)for(let l=0;l<e.length;l++){const t=n.length;if(t){const i=n[t-1].end;e[l].start-i<r?e[l].end>i&&(n[t-1].end=e[l].end):n.push(e[l])}else n.push(e[l])}else n=e;let i,s=0,a=t,o=t;for(let l=0;l<n.length;l++){const e=n[l].start,c=n[l].end;if(t+r>=e&&t<c)a=e,o=c,s=o-t;else if(t+r<e){i=e;break}}return{len:s,start:a||0,end:o||0,nextStart:i}}static getBuffered(e){try{return e.buffered}catch(t){return w.log("failed to get media.buffered",t),yr}}}class Er{constructor(e,t,r,n=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=i,this.partial=s}}function _r(e,t){let r=null;for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i&&i.cc===t){r=i;break}}return r}function wr(e,t){if(e){const r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}function Tr(e,t){const r=t.fragments;for(let n=0,i=r.length;n<i;n++)wr(r[n],e);t.fragmentHint&&wr(t.fragmentHint,e),t.alignedSliding=!0}function Sr(e,t,r){t&&(!function(e,t,r){if(function(e,t,r){return!(!t.details||!(r.endCC>r.startCC||e&&e.cc<r.startCC))}(e,r,t)){const e=function(e,t,r=0){const n=e.fragments,i=t.fragments;if(!i.length||!n.length)return void w.log("No fragments to align");const s=_r(n,i[0].cc);
1if(s&&(!s||s.startPTS))return s;w.log("No frag in previous level to align on")}(r.details,t);e&&p(e.start)&&(w.log(`Adjusting PTS using last level due to CC increase within current level ${t.url}`),Tr(e.start,t))}}(e,r,t),!r.alignedSliding&&t.details&&function(e,t){if(!t.fragments.length||!e.hasProgramDateTime||!t.hasProgramDateTime)return;const r=t.fragments[0].programDateTime,n=e.fragments[0].programDateTime,i=(n-r)/1e3+t.fragments[0].start;i&&p(i)&&(w.log(`Adjusting PTS using programDateTime delta ${n-r}ms, sliding:${i.toFixed(3)} ${e.url} `),Tr(i,e))}(r,t.details),r.alignedSliding||!t.details||r.skippedSegments||Ot(t.details,r))}function Ar(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const r=e.fragments,n=t.fragments;if(!r.length||!n.length)return;const i=n[Math.round(n.length/2)-1],s=_r(r,i.cc)||r[Math.round(r.length/2)-1],a=i.programDateTime,o=s.programDateTime;if(null===a||null===o)return;Tr((o-a)/1e3-(s.start-i.start),e)}class kr{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class xr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class Lr{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),r=new Uint32Array(4);for(let n=0;n<4;n++)r[n]=t.getUint32(4*n);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],s=r[2],a=r[3],o=this.invSubMix,l=o[0],c=o[1],d=o[2],u=o[3],h=new Uint32Array(256);let f=0,p=0,m=0;for(m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){let r=p^p<<1^p<<2^p<<3^p<<4;r=r>>>8^255&r^99,e[f]=r,t[r]=f;const o=h[f],m=h[o],g=h[m];let v=257*h[r]^16843008*r;n[f]=v<<24|v>>>8,i[f]=v<<16|v>>>16,s[f]=v<<8|v>>>24,a[f]=v,v=16843009*g^65537*m^257*o^16843008*f,l[r]=v<<24|v>>>8,c[r]=v<<16|v>>>16,d[r]=v<<8|v>>>24,u[r]=v,f?(f=o^h[h[h[g^o]]],p^=h[h[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,n=0;for(;n<t.length&&r;)r=t[n]===this.key[n],n++;if(r)return;this.key=t;const i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);const s=this.ksRows=4*(i+6+1);let a,o;const l=this.keySchedule=new Uint32Array(s),c=this.invKeySchedule=new Uint32Array(s),d=this.sBox,u=this.rcon,h=this.invSubMix,f=h[0],p=h[1],m=h[2],g=h[3];let v,y;for(a=0;a<s;a++)a<i?v=l[a]=t[a]:(y=v,a%i===0?(y=y<<8|y>>>24,y=d[y>>>24]<<24|d[y>>>16&255]<<16|d[y>>>8&255]<<8|d[255&y],y^=u[a/i|0]<<24):i>6&&a%i===4&&(y=d[y>>>24]<<24|d[y>>>16&255]<<16|d[y>>>8&255]<<8|d[255&y]),l[a]=v=(l[a-i]^y)>>>0);for(o=0;o<s;o++)a=s-o,y=3&o?l[a]:l[a-4],c[o]=o<4||a<=4?y:f[d[y>>>24]]^p[d[y>>>16&255]]^m[d[y>>>8&255]]^g[d[255&y]],c[o]=c[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,r){const n=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],c=a[2],d=a[3],u=this.uint8ArrayToUint32Array_(r);let h=u[0],f=u[1],p=u[2],m=u[3];const g=new Int32Array(e),v=new Int32Array(g.length);let y,b,E,_,w,T,S,A,k,x,L,I,R,D;const C=this.networkToHostOrderSwap;for(;t<g.length;){for(k=C(g[t]),x=C(g[t+1]),L=C(g[t+2]),I=C(g[t+3]),w=k^i[0],T=I^i[1],S=L^i[2],A=x^i[3],R=4,D=1;D<n;D++)y=o[w>>>24]^l[T>>16&255]^c[S>>8&255]^d[255&A]^i[R],b=o[T>>>24]^l[S>>16&255]^c[A>>8&255]^d[255&w]^i[R+1],E=o[S>>>24]^l[A>>16&255]^c[w>>8&255]^d[255&T]^i[R+2],_=o[A>>>24]^l[w>>16&255]^c[T>>8&255]^d[255&S]^i[R+3],w=y,T=b,S=E,A=_,R+=4;y=s[w>>>24]<<24^s[T>>16&255]<<16^s[S>>8&255]<<8^s[255&A]^i[R],b=s[T>>>24]<<24^s[S>>16&255]<<16^s[A>>8&255]<<8^s[255&w]^i[R+1],E=s[S>>>24]<<24^s[A>>16&255]<<16^s[w>>8&255]<<8^s[255&T]^i[R+2],_=s[A>>>24]<<24^s[w>>16&255]<<16^s[T>>8&255]<<8^s[255&S]^i[R+3],v[t]=C(y^h),v[t+1]=C(_^f),v[t+2]=C(E^p),v[t+3]=C(b^m),h=k,f=x,p=L,m=I,t+=4}return v.buffer}}class Ir{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftw
vendor: 8,966 bytes, line 1
1areAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(r){}null===this.subtle&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,r=t&&new DataView(e.buffer).getUint8(t-1);return r?Y(e,0,t-r):e}(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r){return this.useSoftware?new Promise(((n,i)=>{this.softwareDecrypt(new Uint8Array(e),t,r);const s=this.flush();s?n(s.buffer):i(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,r)}softwareDecrypt(e,t,r){const{currentIV:n,currentResult:i,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=ke(s,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;n&&(r=n);let o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new Lr),o.expandKey(t);const l=i;return this.currentResult=o.decrypt(a.buffer,0,r),this.currentIV=Y(a,-16).buffer,l||null}webCryptoDecrypt(e,t,r){const n=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new xr(n,t)),this.fastAesKey.expandKey().then((t=>{if(!n)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new kr(n,new Uint8Array(r)).decrypt(e.buffer,t)})).catch((n=>(w.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,r))))}onWebCryptoError(e,t,r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r);const n=this.flush();if(n)return n.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%16;return r!==e.length&&(t=Y(e,0,r),this.remainderData=Y(e,r)),t}logOnce(e){this.logEnabled&&(w.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Rr=function(e){let t="";const r=e.length;for(let n=0;n<r;n++)t+=`[${e.start(n).toFixed(3)}-${e.end(n).toFixed(3)}]`;return t},Dr="STOPPED",Cr="IDLE",Pr="KEY_LOADING",Or="FRAG_LOADING",Mr="FRAG_LOADING_WAITING_RETRY",Nr="WAITING_TRACK",Fr="PARSING",Ur="PARSED",Br="ENDED",jr="ERROR",$r="WAITING_INIT_PTS",Vr="WAITING_LEVEL";class Hr extends class{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}{constructor(e,t,r,n,i){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Dr,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=i,this.logPrefix=n,this.log=w.log.bind(w,`${n}:`),this.warn=w.warn.bind(w,`${n}:`),this.hls=e,this.fragmentLoader=new fr(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Ir(e.config),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Dr}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const r=t.partList;if(null!=r&&r.length){const e=r[r.length-1];return br.isBuffered(this.media,e.start+e.duration/2)}const n=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(n)}getLevelDetails(){var e;if(this.levels&&null!==this.levelLastLoaded)return null==(e=this.levels[this.levelLastLoaded])?void 0:e.details}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);const n=this.config;this.levels&&n.autoStartLoad&&this.state===Dr&&this.startLoad(n.startPosition)}onMediaDetaching(){const e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:r,mediaBuffer:n,state:i}=this,s=r?r.currentTime:0,a=br.bufferInfo(n||r,s,e.maxBufferHole);if(this.log(`media seeking to ${p(s)?s.toFixed(3):s}, state: ${i}`),this.state===Br)this.resetLoadingState();else if(t){const r=e.maxFragLookUpTolerance,n=t.start-r,i=t.start+t.duration+r;if(!a.len||i<a.start||n>a.end){const e=s>i;(s<n||e)&&(e&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}r&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),this.loadedmetadata||a.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.stopLoad(),super.onHandlerDestroying()}onHandlerDestroyed(){this.state=Dr,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,r){this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){this._doFragLoad(e,t,r,(t=>{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const r=this.state;this.fragContextChanged(e)?(r===Or||!this.fragCurrent&&r===Fr)&&(this.fragmentTracker.removeFragment(e),this.state=Cr):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(m.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((t=>{this.state!==Dr&&this.state!==jr&&(this.warn(t),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===ar){const t=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,t),i=Math.max(e.duration,n?n.len:this.config.maxBufferLength);this.reduceMaxBufferLength(i)&&r.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===or&&r.removeFragment(e))}flushMainBuffer(e,t,r=null){if(!(e-t))return;const n={startOffset:e,endOffset:t,type:r};this.hls.trigger(m.BUFFER_FLUSHING,n)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:r}=this,{payload:n}=t,i=e.decryptdata;if(n&&n.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){const s=self.performance.now();
1return this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch((t=>{throw r.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((n=>{const i=self.performance.now();return r.trigger(m.FRAG_DECRYPTED,{frag:e,payload:n,stats:{tstart:s,tdecrypt:i}}),t.payload=n,t}))}return t})).then((r=>{const{fragCurrent:n,hls:i,levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=Cr,t.fragmentError=0,e.data=new Uint8Array(r.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),r.frag===n&&i.trigger(m.FRAG_BUFFERED,{stats:a,frag:n,part:null,id:e.type}),this.tick()})).catch((t=>{this.state!==Dr&&this.state!==jr&&(this.warn(t),this.resetFragmentLoading(e))}))}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var r,n,i,s;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===ot?"level":"track"} ${e.level} (frag:[${(null!=(r=e.startPTS)?r:NaN).toFixed(3)}-${(null!=(n=e.endPTS)?n:NaN).toFixed(3)}] > buffer:${a?Rr(br.getBuffered(a)):"(detached)"})`),this.state=Cr,a&&(!this.loadedmetadata&&e.type==ot&&a.buffered.length&&(null==(i=this.fragCurrent)?void 0:i.sn)===(null==(s=this.fragPrevious)?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:n,partsLoaded:i}=e,s=!i||0===i.length||i.some((e=>!e)),a=new Er(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,n){var i;const s=null==t?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Pr,this.fragCurrent=e,a=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(m.KEY_LOADED,e),this.state===Pr&&(this.state=Cr),e})),this.hls.trigger(m.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),r=Math.max(e.start,r||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){const i=s.partList;if(i&&n){r>e.end&&s.fragmentHint&&(e=s.fragmentHint);const o=this.getNextPart(i,e,r);if(o>-1){const l=i[o];let c;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${o}-${i.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Or,c=a?a.then((r=>!r||this.fragContextChanged(r.frag)?null:this.doFragPartsLoad(e,l,t,n))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,l,t,n).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(m.FRAG_LOADING,{frag:e,part:l,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c}if(!e.url||this.loadedEndOfParts(i,r))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),p(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Or;const o=this.config.progressive;let l;return l=o&&a?a.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,n))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,o?n:void 0),a]).then((([e])=>(!o&&e&&n&&n(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(m.FRAG_LOADING,{frag:e,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,r,n){return new Promise(((i,s)=>{var a;const o=[],l=null==(a=r.details)?void 0:a.partList,c=t=>{this.fragmentLoader.loadPart(e,t,n).then((n=>{o[t.index]=n;const s=n.part;this.hls.trigger(m.FRAG_LOADED,n);const a=Nt(r,e.sn,t.index+1)||Ft(l,e.sn,t.index+1);if(!a)return i({frag:e,part:s,partsLoaded:o});c(a)})).catch(s)};c(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===v.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(m.ERROR,t)}else this.hls.trigger(m.ERROR,{type:g.OTHER_ERROR,details:v.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Fr)return void(this.fragCurrent||this.state===Dr||this.state===jr||(this.state=Cr));const{frag:r,part:n,level:i}=t,s=self.performance.now();r.stats.parsing.end=s,n&&(n.stats.parsing.end=s),this.updateLevelTiming(r,n,i,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:n,sn:i,part:s}=e;if(null==t||!t[n])return this.warn(`Levels object was unset while buffering fragment ${i} of level ${n}. The current chunk will not be buffered.`),null;const a=t[n],o=s>-1?Nt(a,i,s):null,l=o?o.fragment:function(e,t,r){if(null==e||!e.details)return null;const n=e.details;let i=n.fragments[t-n.startSN];
vendor: 4,359 bytes, line 1
1return i||(i=n.fragmentHint,i&&i.sn===t?i:t<n.startSN&&r&&r.sn===t?r:null)}(a,i,r);return l?(r&&r!==l&&(l.stats=r.stats),{frag:l,part:o,level:a}):null}bufferFragmentData(e,t,r,n){var i;if(!e||this.state!==Fr)return;const{data1:s,data2:a}=e;let o=s;if(s&&a&&(o=ke(s,a)),null==(i=o)||!i.length)return;const l={type:e.type,frag:t,part:r,chunkMeta:n,parent:t.type,data:o};this.hls.trigger(m.BUFFER_APPENDING,l),e.dropped&&e.independent&&!r&&this.flushBufferGap(t)}flushBufferGap(e){const t=this.media;if(!t)return;if(!br.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const r=t.currentTime,n=br.bufferInfo(t,r,0),i=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),a=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const r=this.getLoadPosition();return p(r)?this.getFwdBufferInfoAtPos(e,r,t):null}getFwdBufferInfoAtPos(e,t,r){const{config:{maxBufferHole:n}}=this,i=br.bufferInfo(e,t,n);if(0===i.len&&void 0!==i.nextStart){const s=this.fragmentTracker.getBufferedFrag(t,r);if(s&&i.nextStart<s.end)return br.bufferInfo(e,t,Math.max(i.nextStart,n))}return i}getMaxBufferLength(e){const{config:t}=this;let r;return r=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,r=e||t.maxBufferLength;return t.maxMaxBufferLength>=r&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getAppendedFrag(e,t=ot){const r=this.fragmentTracker.getAppendedFrag(e,ot);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,n=r.length;if(!n)return null;const{config:i}=this,s=r[0].start;let a;if(t.live){const s=i.initialLiveManifestSize;if(n<s)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${s})`),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(a=this.getInitialLiveFragment(t,r),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=s&&(a=r[0]);if(!a){const r=i.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,r,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===lr||r===or&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,n,i){const s=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,s&&e&&!e.gap&&r.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n);if(null!==t&&r.len+t.len>=i)return this.log(`buffer full after gaps in "${n}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,r){let n=-1,i=!1,s=!0;for(let a=0,o=e.length;a<o;a++){const o=e[a];if(s=s&&!o.independent,n>-1&&r<o.start)break;const l=o.loaded;l?n=-1:(i||o.independent||s)&&o.fragment===t&&(n=a),i=l}return n}loadedEndOfParts(e,t){const r=e[e.length-1];return r&&t>r.start&&r.loaded}getInitialLiveFragment(e,t){const r=this.fragPrevious;let n=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),n=function(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!p(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;r=r||0;for(let n=0;n<e.length;++n){const i=e[n];if(Wt(t,r,i))return i}return null}(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){const i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];r.cc===s.cc&&(n=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${n.sn}`))}n||(n=function(e,t){return Ht(e,(e=>e.cc<t?1:e.cc>t?-1:0))}(t,r.cc),n&&this.log(`Live playlist, switching playlist, load frag with same CC: ${n.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(n=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n}getFragmentAtPosition(e,t,r){const{config:n}=this;let{fragPrevious:i}=this,{fragments:s,endSN:a}=r;const{fragmentHint:o}=r,l=n.maxFragLookUpTolerance,c=r.partList,d=!!(n.lowLatencyMode&&null!=c&&c.length&&o);let u;if(d&&o&&!this.bitrateTest&&(s=s.concat(o),a=o.sn),e<t){u=Gt(i,s,e,e>t-l?0:l)}else u=s[s.length-1];
1if(u){const e=u.sn-r.startSN,t=this.fragmentTracker.getState(u);if((t===lr||t===or&&u.gap)&&(i=u),i&&u.sn===i.sn&&(!d||c[0].fragment.sn>u.sn)){if(i&&u.level===i.level){const t=s[e+1];u=u.sn<a&&this.fragmentTracker.getState(t)!==lr?t:null}}}return u}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const n=this.hls.liveSyncPosition,i=r.currentTime,s=e.fragments[0].start,a=e.edge,o=i>=s-t.maxFragLookUpTolerance&&i<=a;if(null!==n&&r.duration>n&&(i<n||!o)){const s=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!o&&r.readyState<4||i<a-s)&&(this.loadedmetadata||(this.nextLoadPosition=n),r.readyState&&(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${n.toFixed(3)}`),r.currentTime=n))}}alignPlaylists(e,t){const{levels:r,levelLastLoaded:n,fragPrevious:i}=this,s=null!==n?r[n]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;const o=e.fragments[0].start,l=!t,c=e.alignedSliding&&p(o);if(l||!c&&!o){Sr(i,s,e);const r=e.fragments[0].start;return this.log(`Live playlist sliding: ${r.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${i?i.sn:"na"} fragments: ${a}`),r}return o}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let r=this.startPosition;if(r<t&&(r=-1),-1===r||-1===this.lastCurrentTime){const n=null!==this.startTimeOffset,i=n?this.startTimeOffset:e.startTimeOffset;null!==i&&p(i)?(r=t+i,i<0&&(r+=e.totalduration),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Start time offset ${i} found in ${n?"multivariant":"media"} playlist, adjust startPosition to ${r}`),this.startPosition=r):e.live?r=this.hls.liveSyncPosition||t:this.startPosition=r=0,this.lastCurrentTime=r}this.nextLoadPosition=r}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===Mr)||(this.state=Cr)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;var n;if(this.fragContextChanged(r))return void this.warn(`Frag load error must match current frag to retry ${r.url} > ${null==(n=this.fragCurrent)?void 0:n.url}`);const i=t.details===v.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(r,!0);const s=t.errorAction,{action:a,retryCount:o=0,retryConfig:l}=s||{};if(s&&a===Yt&&l){var c;this.resetStartWhenNotLoaded(null!=(c=this.levelLastLoaded)?c:r.level);const n=jt(l,o);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${n}ms`),s.resolved=!0,this.retryDate=self.performance.now()+n,this.state=Mr}else l&&s?(this.resetFragmentErrors(e),o<l.maxNumRetry?i||(s.resolved=!0):w.warn(`${t.details} reached or exceeded max retry (${o})`)):(null==s?void 0:s.action)===zt?this.state=Vr:this.state=jr;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===Fr||this.state===Ur){const t=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,t),n=r&&r.len>.5;n&&this.reduceMaxBufferLength(r.len);const i=!n;return i&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),i}return!1}resetFragmentErrors(e){e===lt&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Dr&&(this.state=Cr)}afterBufferFlushed(e,t,r){if(!e)return;const n=br.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===Br&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Cr}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){var t;this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,n){var i;const s=r.details;if(!s)return void this.warn("level.details undefined");if(Object.keys(e.elementaryStreams).reduce(((t,i)=>{const a=e.elementaryStreams[i];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${i} duration reliably (${o})`),t||!1;const l=n?0:Ct(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:s,level:r,drift:l,type:i,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1))r.fragmentError=0;else if(null===(null==(i=this.transmuxer)?void 0:i.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${r.id} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Ur,this.hls.trigger(m.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){var t,r,n;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(r=this.levelLastLoaded)?r:null==(n=this.fragCurrent)?void 0:n.level)?t:0),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Gr(){return self.SourceBuffer||self.WebKitSourceBuffer}function qr(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}
vendor: 9,839 bytes, line 1
1class Wr{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=ke(this.cachedData,e),this.cachedData=null);let r,n=Z(e,0),i=n?n.length:0;const s=this._audioTrack,a=this._id3Track,o=n?(e=>{const t=ne(e);for(let r=0;r<t.length;r++){const e=t[r];if(te(e))return le(e)}})(n):void 0,l=e.length;for((null===this.basePTS||0===this.frameIndex&&p(o))&&(this.basePTS=Kr(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:vt,duration:Number.POSITIVE_INFINITY});i<l;){if(this.canParse(e,i)){const t=this.appendFrame(s,e,i);t?(this.frameIndex++,this.lastPTS=t.sample.pts,i+=t.length,r=i):i=l}else ee(e,i)?(n=Z(e,i),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:vt,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===l&&r!==l){const t=Y(e,r);this.cachedData?this.cachedData=ke(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:qr(),id3Track:a,textTrack:qr()}}demuxSampleAes(e,t,r){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:qr(),id3Track:this._id3Track,textTrack:qr()}}destroy(){}}const Kr=(e,t,r)=>{if(p(e))return 90*e;return 9e4*t+(r?9e4*r.baseTime/r.timescale:0)};function zr(e,t){return 255===e[t]&&240===(246&e[t+1])}function Yr(e,t){return 1&e[t+1]?7:9}function Xr(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Qr(e,t){return t+1<e.length&&zr(e,t)}function Zr(e,t){if(Qr(e,t)){const r=Yr(e,t);if(t+r>=e.length)return!1;const n=Xr(e,t);if(n<=r)return!1;const i=t+n;return i===e.length||Qr(e,i)}return!1}function Jr(e,t,r,n,i){if(!e.samplerate){const s=function(e,t,r,n){let i,s,a,o;const l=navigator.userAgent.toLowerCase(),c=n,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=1+((192&t[r+2])>>>6);const u=(60&t[r+2])>>>2;if(!(u>d.length-1))return a=(1&t[r+2])<<2,a|=(192&t[r+3])>>>6,w.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),s=u-3):(i=2,o=new Array(2),s=u):-1!==l.indexOf("android")?(i=2,o=new Array(2),s=u):(i=5,o=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&u>=6?s=u-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(u>=6&&1===a||/vivaldi/i.test(l))||!n&&1===a)&&(i=2,o=new Array(2)),s=u)),o[0]=i<<3,o[0]|=(14&u)>>1,o[1]|=(1&u)<<7,o[1]|=a<<3,5===i&&(o[1]|=(14&s)>>1,o[2]=(1&s)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:d[u],channelCount:a,codec:"mp4a.40."+i,manifestCodec:c};e.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${u}`})}(t,r,n,i);if(!s)return;e.config=s.config,e.samplerate=s.samplerate,e.channelCount=s.channelCount,e.codec=s.codec,e.manifestCodec=s.manifestCodec,w.log(`parsed codec:${e.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function en(e){return 9216e4/e}function tn(e,t,r,n,i){const s=n+i*en(e.samplerate),a=function(e,t){const r=Yr(e,t);if(t+r<=e.length){const n=Xr(e,t)-r;if(n>0)return{headerLength:r,frameLength:n}}}(t,r);let o;if(a){const{frameLength:n,headerLength:i}=a,l=i+n,c=Math.max(0,r+l-t.length);c?(o=new Uint8Array(l-i),o.set(t.subarray(r+i,t.length),0)):o=t.subarray(r+i,r+l);const d={unit:o,pts:s};return c||e.samples.push(d),{sample:d,length:l,missing:c}}const l=t.length-r;o=new Uint8Array(l),o.set(t.subarray(r,t.length),0);return{sample:{unit:o,pts:s},length:l,missing:-1}}const rn=/\/emsg[-/]ID3/i;let nn=null;const sn=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],an=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],on=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],ln=[0,1,1,4];function cn(e,t,r,n,i){if(r+24>t.length)return;const s=dn(t,r);if(s&&r+s.frameLength<=t.length){const a=n+i*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:t.subarray(r,r+s.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}function dn(e,t){const r=e[t+1]>>3&3,n=e[t+1]>>1&3,i=e[t+2]>>4&15,s=e[t+2]>>2&3;if(1!==r&&0!==i&&15!==i&&3!==s){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*sn[14*(3===r?3-n:3===n?3:4)+i-1],c=an[3*(3===r?0:2===r?1:2)+s],d=3===o?1:2,u=on[r][n],h=ln[n],f=8*u*h,p=Math.floor(u*l/c+a)*h;if(null===nn){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);nn=e?parseInt(e[1]):0}return!!nn&&nn<=87&&2===n&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:d,frameLength:p,samplesPerFrame:f}}}function un(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])}function hn(e,t){return t+1<e.length&&un(e,t)}function fn(e,t){if(t+1<e.length&&un(e,t)){const r=4,n=dn(e,t);let i=r;null!=n&&n.frameLength&&(i=n.frameLength);const s=t+i;return s===e.length||hn(e,s)}return!1}class pn{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&w.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(0!==(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,r=8,n=8;for(let i=0;i<e;i++)0!==n&&(t=this.readEG(),n=(r+t+256)%256),r=0===n?r:n}readSPS(){let e,t,r,n=0,i=0,s=0,a=0;const o=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),d=this.readBoolean.bind(this),u=this.skipBits.bind(this),h=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);o();const m=o();if(l(5),u(3),o(),f(),100===m||110===m||122===m||244===m||44===m||83===m||86===m||118===m||128===m){const e=c();if(3===e&&u(1),f(),f(),u(1),d())for(t=3!==e?8:12,r=0;r<t;r++)d()&&p(r<6?16:64)}f();const g=c();if(0===g)c();else if(1===g)for(u(1),h(),h(),e=c(),r=0;r<e;r++)h();f(),u(1);const v=c(),y=c(),b=l(1);0===b&&u(1),u(1),d()&&(n=c(),i=c(),s=c(),a=c());let E=[1,1];if(d()&&d()){switch(o()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[o()<<8|o(),o()<<8|o()]}}return{width:Math.ceil(16*(v+1)-2*n-2*i),height:(2-b)*(y+1)*16-(b?2:4)*(s+a),pixelRatio:E}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class mn{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Ir(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,r){const n=e[t].unit;if(n.length<=16)return;const i=n.subarray(16,n.length-n.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then((i=>{const s=new Uint8Array(i);n.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}))}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)e.set(r.subarray(n,n+16),i);return e}decryptAvcSample(e,t,r,n,i){const s=Re(i.data),a=this.getAvcEncryptedData(s);this.decryptBuffer(a.buffer).then((a=>{i.data=this.getAvcDecryptedUnit(s,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,n)}))}decryptAvcSamples(e,t,r,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void n();const i=e[t].units;for(;!(r>=i.length);r++){const s=i[r];
1if(!(s.data.length<=48||1!==s.type&&5!==s.type)&&(this.decryptAvcSample(e,t,r,n,s),!this.decrypter.isSync()))return}}}}const gn=188;class vn{constructor(e,t,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=r}static probe(e){const t=vn.syncOffset(e);return t>0&&w.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),-1!==t}static syncOffset(e){const t=e.length;let r=Math.min(940,e.length-gn)+1,n=0;for(;n<r;){let i=!1,s=-1,a=0;for(let o=n;o<t;o+=gn){if(71!==e[o]){if(a)return-1;break}if(a++,-1===s&&(s=o,0!==s&&(r=Math.min(s+18612,e.length-gn)+1)),i||(i=0===bn(e,o)),i&&a>1&&(0===s&&a>2||o+gn>r))return s}n++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:me[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=vn.createTrack("video"),this._audioTrack=vn.createTrack("audio",n),this._id3Track=vn.createTrack("id3"),this._txtTrack=vn.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r,this._duration=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,r=!1,n=!1){let i;r||(this.sampleAes=null);const s=this._avcTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=s.pid,d=s.pesData,u=a.pid,h=o.pid,f=a.pesData,p=o.pesData,y=null,b=this.pmtParsed,E=this._pmtId,_=e.length;if(this.remainderData&&(_=(e=ke(this.remainderData,e)).length,this.remainderData=null),_<gn&&!n)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};const T=Math.max(0,vn.syncOffset(e));_-=(_-T)%gn,_<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,_,e.buffer.byteLength-_));let S=0;for(let m=T;m<_;m+=gn)if(71===e[m]){const t=!!(64&e[m+1]),n=bn(e,m);let g;if((48&e[m+3])>>4>1){if(g=m+5+e[m+4],g===m+gn)continue}else g=m+4;switch(n){case c:t&&(d&&(i=wn(d))&&this.parseAVCPES(s,l,i,!1),d={data:[],size:0}),d&&(d.data.push(e.subarray(g,m+gn)),d.size+=m+gn-g);break;case u:if(t){if(f&&(i=wn(f)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,i);break;case"mp3":this.parseMPEGPES(a,i)}f={data:[],size:0}}f&&(f.data.push(e.subarray(g,m+gn)),f.size+=m+gn-g);break;case h:t&&(p&&(i=wn(p))&&this.parseID3PES(o,i),p={data:[],size:0}),p&&(p.data.push(e.subarray(g,m+gn)),p.size+=m+gn-g);break;case 0:t&&(g+=e[g]+1),E=this._pmtId=En(e,g);break;case E:{t&&(g+=e[g]+1);const n=_n(e,g,this.typeSupported,r);c=n.avc,c>0&&(s.pid=c),u=n.audio,u>0&&(a.pid=u,a.segmentCodec=n.segmentCodec),h=n.id3,h>0&&(o.pid=h),null===y||b||(w.warn(`MPEG-TS PMT found at ${m} after unknown PID '${y}'. Backtracking to sync byte @${T} to parse all TS packets.`),y=null,m=T-188),b=this.pmtParsed=!0;break}case 17:case 8191:break;default:y=n}}else S++;if(S>0){const e=new Error(`Found ${S} TS packet/s that do not start with 0x47`);this.observer.emit(m.ERROR,m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}s.pesData=d,a.pesData=f,o.pesData=p;const A={audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};return n&&this.extractRemainingSamples(A),A}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:n,textTrack:i}=e,s=r.pesData,a=t.pesData,o=n.pesData;let l;if(s&&(l=wn(s))?(this.parseAVCPES(r,i,l,!0),r.pesData=null):r.pesData=s,a&&(l=wn(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l)}t.pesData=null}else null!=a&&a.size&&w.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=wn(o))?(this.parseID3PES(n,l),n.pesData=null):n.pesData=o}demuxSampleAes(e,t,r){const n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new mn(this.observer,this.config,t);return this.decrypt(n,i)}decrypt(e,t){return new Promise((r=>{const{audioTrack:n,videoTrack:i}=e;n.samples&&"aac"===n.segmentCodec?t.decryptAacSamples(n.samples,0,(()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,(()=>{r(e)})):r(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(()=>{r(e)}))}))}destroy(){this._duration=0}parseAVCPES(e,t,r,n){const i=this.parseAVCNALu(e,r.data);let s,a=this.avcSample,o=!1;r.data=null,a&&i.length&&!e.audFound&&(Tn(a,e),a=this.avcSample=yn(!1,r.pts,r.dts,"")),i.forEac
1h((n=>{switch(n.type){case 1:{s=!0,a||(a=this.avcSample=yn(!0,r.pts,r.dts,"")),a.frame=!0;const e=n.data;if(o&&e.length>4){const t=new pn(e).readSliceType();2!==t&&4!==t&&7!==t&&9!==t||(a.key=!0)}break}case 5:s=!0,a||(a=this.avcSample=yn(!0,r.pts,r.dts,"")),a.key=!0,a.frame=!0;break;case 6:s=!0,Ie(n.data,1,r.pts,t.samples);break;case 7:if(s=!0,o=!0,!e.sps){const t=n.data,r=new pn(t).readSPS();e.width=r.width,e.height=r.height,e.pixelRatio=r.pixelRatio,e.sps=[t],e.duration=this._duration;const i=t.subarray(1,4);let s="avc1.";for(let e=0;e<3;e++){let t=i[e].toString(16);t.length<2&&(t="0"+t),s+=t}e.codec=s}break;case 8:s=!0,e.pps||(e.pps=[n.data]);break;case 9:s=!1,e.audFound=!0,a&&Tn(a,e),a=this.avcSample=yn(!1,r.pts,r.dts,"");break;case 12:s=!0;break;default:s=!1,a&&(a.debug+="unknown NAL "+n.type+" ")}if(a&&s){a.units.push(n)}})),n&&a&&(Tn(a,e),this.avcSample=null)}getLastNalUnit(e){var t;let r,n=this.avcSample;if(n&&0!==n.units.length||(n=e[e.length-1]),null!=(t=n)&&t.units){const e=n.units;r=e[e.length-1]}return r}parseAVCNALu(e,t){const r=t.byteLength;let n=e.naluState||0;const i=n,s=[];let a,o,l,c=0,d=-1,u=0;for(-1===n&&(d=0,u=31&t[0],n=0,c=1);c<r;)if(a=t[c++],n)if(1!==n)if(a)if(1===a){if(d>=0){const e={data:t.subarray(d,c-n-1),type:u};s.push(e)}else{const r=this.getLastNalUnit(e.samples);if(r&&(i&&c<=4-i&&r.state&&(r.data=r.data.subarray(0,r.data.byteLength-i)),o=c-n-1,o>0)){const e=new Uint8Array(r.data.byteLength+o);e.set(r.data,0),e.set(t.subarray(0,o),r.data.byteLength),r.data=e,r.state=0}}c<r?(l=31&t[c],d=c,u=l,n=0):n=-1}else n=0;else n=3;else n=a?0:2;else n=a?0:1;if(d>=0&&n>=0){const e={data:t.subarray(d,r),type:u,state:n};s.push(e)}if(0===s.length){const r=this.getLastNalUnit(e.samples);if(r){const e=new Uint8Array(r.data.byteLength+t.byteLength);e.set(r.data,0),e.set(t,r.data.byteLength),r.data=e}}return e.naluState=n,s}parseAACPES(e,t){let r=0;const n=this.aacOverFlow;let i,s,a,o=t.data;if(n){this.aacOverFlow=null;const t=n.missing,i=n.sample.unit.byteLength;if(-1===t){const e=new Uint8Array(i+o.byteLength);e.set(n.sample.unit,0),e.set(o,i),o=e}else{const s=i-t;n.sample.unit.set(o.subarray(0,t),s),e.samples.push(n.sample),r=n.missing}}for(i=r,s=o.length;i<s-1&&!Qr(o,i);i++);if(i!==r){let e;const t=i<s-1;e=t?`AAC PES did not start with ADTS header,offset:${i}`:"No ADTS header found in AAC PES";const r=new Error(e);
1if(w.warn(`parsing error: ${e}`),this.observer.emit(m.ERROR,m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:r,reason:e}),!t)return}if(Jr(e,this.observer,o,i,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!n)return void w.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=en(e.samplerate);a=n.sample.pts+t}}let l,c=0;for(;i<s;){if(l=tn(e,o,i,a,c),i+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;i<s-1&&!Qr(o,i);i++);}}parseMPEGPES(e,t){const r=t.data,n=r.length;let i=0,s=0;const a=t.pts;if(void 0!==a)for(;s<n;)if(hn(r,s)){const t=cn(e,r,s,a,i);if(!t)break;s+=t.length,i++}else s++;else w.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseID3PES(e,t){if(void 0===t.pts)return void w.warn("[tsdemuxer]: ID3 PES unknown PTS");const r=f({},t,{type:this._avcTrack?bt:vt,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function yn(e,t,r,n){return{key:e,frame:!1,pts:t,dts:r,units:[],debug:n,length:0}}function bn(e,t){return((31&e[t+1])<<8)+e[t+2]}function En(e,t){return(31&e[t+10])<<8|e[t+11]}function _n(e,t,r,n){const i={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<s;){const s=bn(e,t);switch(e[t]){case 207:if(!n){w.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===i.audio&&(i.audio=s);break;case 21:-1===i.id3&&(i.id3=s);break;case 219:if(!n){w.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===i.avc&&(i.avc=s);break;case 3:case 4:!0!==r.mpeg&&!0!==r.mp3?w.log("MPEG audio found, not supported in this browser"):-1===i.audio&&(i.audio=s,i.segmentCodec="mp3");break;case 36:w.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return i}function wn(e){let t,r,n,i,s,a=0;const o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;){const e=new Uint8Array(o[0].length+o[1].length);e.set(o[0]),e.set(o[1],o[0].length),o[0]=e,o.splice(1,1)}t=o[0];if(1===(t[0]<<16)+(t[1]<<8)+t[2]){if(r=(t[4]<<8)+t[5],r&&r>e.size-6)return null;const l=t[7];192&l&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,i-s>54e5&&(w.warn(`${Math.round((i-s)/9e4)}s delta between PTS and DTS, align them`),i=s)):s=i),n=t[8];let c=n+9;if(e.size<=c)return null;e.size-=c;const d=new Uint8Array(e.size);for(let e=0,r=o.length;e<r;e++){t=o[e];let r=t.byteLength;if(c){if(c>r){c-=r;continue}t=t.subarray(c),r-=c,c=0}d.set(t,a),a+=r}return r&&(r-=n+3),{data:d,pts:i,dts:s,len:r}}return null}function Tn(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const r=t.samples,n=r.length;if(!n)return void t.dropped++;{const t=r[n-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&w.log(e.pts+"/"+e.dts+":"+e.debug)}class Sn{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const An=Math.pow(2,32)-1;class kn{static init(){let e;for(e in kn.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},kn.types)kn.types.hasOwnProperty(e)&&(kn.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new
vendor: 4,547 bytes, line 1
1Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);kn.HDLR_TYPES={video:t,audio:r};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);kn.STTS=kn.STSC=kn.STCO=i,kn.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),kn.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),kn.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),kn.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);kn.FTYP=kn.box(kn.types.ftyp,s,o,s,a),kn.DINF=kn.box(kn.types.dinf,kn.box(kn.types.dref,n))}static box(e,...t){let r=8,n=t.length;const i=n;for(;n--;)r+=t[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=255&r,s.set(e,4),n=0,r=8;n<i;n++)s.set(t[n],r),r+=t[n].byteLength;return s}static hdlr(e){return kn.box(kn.types.hdlr,kn.HDLR_TYPES[e])}static mdat(e){return kn.box(kn.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(An+1)),n=Math.floor(t%(An+1));return kn.box(kn.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))}static mdia(e){return kn.box(kn.types.mdia,kn.mdhd(e.timescale,e.duration),kn.hdlr(e.type),kn.minf(e))}static mfhd(e){return kn.box(kn.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?kn.box(kn.types.minf,kn.box(kn.types.smhd,kn.SMHD),kn.DINF,kn.stbl(e)):kn.box(kn.types.minf,kn.box(kn.types.vmhd,kn.VMHD),kn.DINF,kn.stbl(e))}static moof(e,t,r){return kn.box(kn.types.moof,kn.mfhd(e),kn.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=kn.trak(e[t]);return kn.box.apply(null,[kn.types.moov,kn.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(kn.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=kn.trex(e[t]);return kn.box.apply(null,[kn.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(An+1)),n=Math.floor(t%(An+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return kn.box(kn.types.mvhd,i)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let n,i;for(n=0;n<t.length;n++)i=t[n].flags,r[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return kn.box(kn.types.sdtp,r)}static stbl(e){return kn.box(kn.types.stbl,kn.stsd(e),kn.box(kn.types.stts,kn.STTS),kn.box(kn.types.stsc,kn.STSC),kn.box(kn.types.stsz,kn.STSZ),kn.box(kn.types.stco,kn.STCO))}static avc1(e){let t,r,n,i=[],s=[];for(t=0;t<e.sps.length;t++)r=e.sps[t],n=r.byteLength,i.push(n>>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(r));for(t=0;t<e.pps.length;t++)r=e.pps[t],n=r.byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(r));const a=kn.box(kn.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(s))),o=e.width,l=e.height,c=e.pixelRatio[0],d=e.pixelRatio[1];return kn.box(kn.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,kn.box(kn.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),kn.box(kn.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return kn.box(kn.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),kn.box(kn.types.esds,kn.esds(e)))}static mp3(e){const t=e.samplerate;return kn.box(kn.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?kn.box(kn.types.stsd,kn.STSD,kn.mp3(e)):kn.box(kn.types.stsd,kn.STSD,kn.mp4a(e)):kn.box(kn.types.stsd,kn.STSD,kn.avc1(e))}static tkhd(e){const t=e.id,r=e.duration*e.timescale,n=e.width,i=e.he
1ight,s=Math.floor(r/(An+1)),a=Math.floor(r%(An+1));return kn.box(kn.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}static traf(e,t){const r=kn.sdtp(e),n=e.id,i=Math.floor(t/(An+1)),s=Math.floor(t%(An+1));return kn.box(kn.types.traf,kn.box(kn.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),kn.box(kn.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s])),kn.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,kn.box(kn.types.trak,kn.tkhd(e),kn.mdia(e))}static trex(e){const t=e.id;return kn.box(kn.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],n=r.length,i=12+16*n,s=new Uint8Array(i);let a,o,l,c,d,u;for(t+=8+i,s.set(["video"===e.type?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a<n;a++)o=r[a],l=o.duration,c=o.size,d=o.flags,u=o.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,61440&d.degradPrio,15&d.degradPrio,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*a);return kn.box(kn.types.trun,s)}static initSegment(e){kn.types||kn.init();const t=kn.moov(e),r=new Uint8Array(kn.FTYP.byteLength+t.byteLength);return r.set(kn.FTYP),r.set(t,kn.FTYP.byteLength),r}}kn.types=void 0,kn.HDLR_TYPES=void 0,kn.STTS=void 0,kn.STSC=void 0,kn.STCO=void 0,kn.STSZ=void 0,kn.VMHD=void 0,kn.SMHD=void 0,kn.STSD=void 0,kn.FTYP=void 0,kn.DINF=void 0;function xn(e,t,r=1,n=!1){const i=e*t*r;return n?Math.round(i):i}function Ln(e,t=!1){return xn(e,1e3,1/9e4,t)}let In,Rn=null,Dn=null;class Cn{constructor(e,t,r,n=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===Rn){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Rn=e?parseInt(e[1]):0}if(null===Dn){const e=navigator.userAgent.match(/Safari\/(\d+)/i);Dn=e?parseInt(e[1]):0}}destroy(){}resetTimeStamp(e){w.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){w.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){w.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const r=e.reduce(((e,r)=>{const n=r.pts-e;return n<-4294967296?(t=!0,Pn(e,r.pts)):n>0?e:r.pts}),e[0].pts);return t&&w.debug("PTS rollover detected"),r}remux(e,t,r,n,i,s,a,o){let l,c,d,u,h,f,p=i,m=i;const g=e.pid>-1,v=t.pid>-1,y=t.samples.length,b=e.samples.length>0,E=a&&y>0||y>1;if((!g||b)&&(!v||E)||this.ISGenerated||a){this.ISGenerated||(d=this.generateIS(e,t,i,s));const r=this.isVideoContiguous;let n,a=-1;if(E&&(a=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!r&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){w.warn(`[mp4-remuxer]: Dropped ${a} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,m+=(t.samples[0].pts-e)/t.inputTimeScale,n=m}else-1===a&&(w.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(b&&E){const r=this.getVideoStartPts(t.samples),n=(Pn(e.samples[0].pts,r)-r)/t.inputTimeScale;p+=Math.max(0,n),m+=Math.max(0,-n)}if(b){if(e.samplerate||(w.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,i,s)),c=this.remuxAudio(e,p,this.isAudioContiguous,s,v||E||o===lt?m:void 0),E){const n=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(w.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,i,s)),l=this.remuxVideo(t,m,r,n)}}else E&&(l=this.remuxVideo(t,m,r,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=n)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(h=On(r,i,this._initPTS,this._initDTS)),n.samples.length&&(u=Mn(n,i,this._initPTS))),{audio:c,video:l,initSegment:d,independent:f,text:u,id3:h}}generateIS(e,t,r,n){const i=e.samples,s=t.samples,a=this.typeSupp
1orted,o={},l=this._initPTS;let c,d,u,h=!l||n,f="audio/mp4";if(h&&(c=d=1/0),e.config&&i.length){if(e.timescale=e.samplerate,"mp3"===e.segmentCodec)a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):kn.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(u=e.inputTimeScale,l&&u===l.timescale?h=!1:c=d=i[0].pts-Math.round(u*r))}if(t.sps&&t.pps&&s.length&&(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:kn.initSegment([t]),metadata:{width:t.width,height:t.height}},h))if(u=t.inputTimeScale,l&&u===l.timescale)h=!1;else{const e=this.getVideoStartPts(s),t=Math.round(u*r);d=Math.min(d,Pn(s[0].dts,e)-t),c=Math.min(c,e-t)}if(Object.keys(o).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:c,timescale:u},this._initDTS={baseTime:d,timescale:u}):c=u=void 0,{tracks:o,initPTS:c,timescale:u}}remuxVideo(e,t,r,n){const i=e.inputTimeScale,s=e.samples,a=[],o=s.length,l=this._initPTS;let c,d,u=this.nextAvcDts,h=8,p=this.videoSampleDuration,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,E=!1;if(!r||null===u){u=t*i-(s[0].pts-Pn(s[0].dts,s[0].pts))}const _=l.baseTime*i/l.timescale;for(let f=0;f<o;f++){const e=s[f];e.pts=Pn(e.pts-_,u),e.dts=Pn(e.dts-_,u),e.dts<s[f>0?f-1:f].dts&&(E=!0)}E&&s.sort((function(e,t){const r=e.dts-t.dts,n=e.pts-t.pts;return r||n})),c=s[0].dts,d=s[s.length-1].dts;const T=d-c,S=T?Math.round(T/(o-1)):p||e.inputTimeScale/30;if(r){const e=c-u,t=e>S,r=e<-1;if((t||r)&&(t?w.warn(`AVC: ${Ln(e,!0)} ms (${e}dts) hole between fragments detected, filling it`):w.warn(`AVC: ${Ln(-e,!0)} ms (${e}dts) overlapping between fragments detected`),!r||u>=s[0].pts)){c=u;const t=s[0].pts-e;s[0].dts=c,s[0].pts=t,w.log(`Video: First PTS/DTS adjusted: ${Ln(t,!0)}/${Ln(c,!0)}, delta: ${Ln(e,!0)} ms`)}}c=Math.max(0,c);let A=0,k=0;for(let f=0;f<o;f++){const e=s[f],t=e.units,r=t.length;let n=0;for(let i=0;i<r;i++)n+=t[i].data.length;k+=n,A+=r,e.length=n,e.dts=Math.max(e.dts,c),y=Math.min(e.pts,y),b=Math.max(e.pts,b)}d=s[o-1].dts;const x=k+4*A+8;let L;try{L=new Uint8Array(x)}catch(N){return void this.observer.emit(m.ERROR,m.ERROR,{type:g.MUX_ERROR,details:v.REMUX_ALLOC_ERROR,fatal:!1,error:N,bytes:x,reason:`fail allocating video mdat ${x}`})}const I=new DataView(L.buffer);I.setUint32(0,x),L.set(kn.types.mdat,4);let R=!1,D=Number.POSITIVE_INFINITY,C=Number.POSITIVE_INFINITY,P=Number.NEGATIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(let f=0;f<o;f++){const e=s[f],t=e.units;let r,l=0;for(let n=0,i=t.length;n<i;n++){const e=t[n],r=e.data,i=e.data.byteLength;I.setUint32(h,i),h+=4,L.set(r,h),h+=i,l+=4+i}if(f<o-1)p=s[f+1].dts-e.dts,r=s[f+1].pts-e.pts;else{const t=this.config,a=f>0?e.dts-s[f-1].dts:S;if(r=f>0?e.pts-s[f-1].pts:S,t.stretchShortVideoTrack&&null!==this.nextAudioPts){const r=Math.floor(t.maxBufferHole*i),s=(n?y+n*i:this.nextAudioPts)-e.pts;s>r?(p=s-a,p<0?p=a:R=!0,w.log(`[mp4-remuxer]: It is approximately ${s/90} ms to the next segment; using duration ${p/90} ms for the last video frame.`)):p=a}else p=a}const c=Math.round(e.pts-e.dts);D=Math.min(D,p),P=Math.max(P,p),C=Math.min(C,r),O=Math.max(O,r),a.push(new Nn(e.key,p,l,c))}if(a.length)if(Rn){if(Rn<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(Dn&&O-C<P-D&&S/P<.025&&0===a[0].cts){w.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=c;for(let t=0,r=a.length;t<r;t++){const n=e+a[t].duration,i=e+a[t].cts;if(t<r-1){const e=n+a[t+1].cts;a[t].duration=e-i}else a[t].duration=t?a[t-1].duration:S;a[t].cts=0,e=n}}p=R||!p?S:p,this.nextAvcDts=u=d+p,this.videoSampleDuration=p,this.isVideoContiguous=!0;const M={data1:kn.moof(e.sequenceNumber++,c,f({},e,{samples:a})),data2:L,startPTS:y/i,endPTS:(b+p)/i,startDTS:c/i,endDTS:u/i,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,M}remuxAudio(e,t,r,n,i){const s=e.inputTimeScale,a=s/(e.samplerate?e.samplerate:s),o="aac"===e.segmentCodec?1024:1152,l=o*a,c=this._initPTS,d="mp3"===e.segmentCodec&&this.typeSupp
vendor: 4,428 bytes, line 1
1orted.mpeg,u=[],h=void 0!==i;let p=e.samples,y=d?0:8,b=this.nextAudioPts||-1;const E=t*s,_=c.baseTime*s/c.timescale;if(this.isAudioContiguous=r=r||p.length&&b>0&&(n&&Math.abs(E-b)<9e3||Math.abs(Pn(p[0].pts-_,E)-b)<20*l),p.forEach((function(e){e.pts=Pn(e.pts-_,E)})),!r||b<0){if(p=p.filter((e=>e.pts>=0)),!p.length)return;b=0===i?0:n&&!h?Math.max(0,E):p[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let r=0,n=b;r<p.length;r++){const i=p[r],a=i.pts,o=a-n,c=Math.abs(1e3*o/s);if(o<=-t*l&&h)0===r&&(w.warn(`Audio frame @ ${(a/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*o/s)} ms.`),this.nextAudioPts=b=n=a);else if(o>=t*l&&c<1e4&&h){let t=Math.round(o/l);n=a-t*l,n<0&&(t--,n+=l),0===r&&(this.nextAudioPts=b=n),w.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(n/s).toFixed(3)}s due to ${Math.round(1e3*o/s)} ms gap.`);for(let s=0;s<t;s++){const t=Math.max(n,0);let s=Sn.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);s||(w.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),s=i.unit.subarray()),p.splice(r,0,{unit:s,pts:t}),n+=l,r++}}i.pts=n,n+=l}}let T,S=null,A=null,k=0,x=p.length;for(;x--;)k+=p[x].unit.byteLength;for(let f=0,w=p.length;f<w;f++){const t=p[f],n=t.unit;let i=t.pts;if(null!==A){u[f-1].duration=Math.round((i-A)/a)}else{if(r&&"aac"===e.segmentCodec&&(i=b),S=i,!(k>0))return;k+=y;try{T=new Uint8Array(k)}catch(O){return void this.observer.emit(m.ERROR,m.ERROR,{type:g.MUX_ERROR,details:v.REMUX_ALLOC_ERROR,fatal:!1,error:O,bytes:k,reason:`fail allocating audio mdat ${k}`})}if(!d){new DataView(T.buffer).setUint32(0,k),T.set(kn.types.mdat,4)}}T.set(n,y);const s=n.byteLength;y+=s,u.push(new Nn(!0,o,s,0)),A=i}const L=u.length;if(!L)return;const I=u[u.length-1];this.nextAudioPts=b=A+a*I.duration;const R=d?new Uint8Array(0):kn.moof(e.sequenceNumber++,S/a,f({},e,{samples:u}));e.samples=[];const D=S/s,C=b/s,P={data1:R,data2:T,startPTS:D,endPTS:C,startDTS:D,endDTS:C,type:"audio",hasAudio:!0,hasVideo:!1,nb:L};return this.isAudioContiguous=!0,P}remuxEmptyAudio(e,t,r,n){const i=e.inputTimeScale,s=i/(e.samplerate?e.samplerate:i),a=this.nextAudioPts,o=this._initDTS,l=9e4*o.baseTime/o.timescale,c=(null!==a?a:n.startDTS*i)+l,d=n.endDTS*i+l,u=1024*s,h=Math.ceil((d-c)/u),f=Sn.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(w.warn("[mp4-remuxer]: remux empty Audio"),!f)return void w.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const p=[];for(let m=0;m<h;m++){const e=c+m*u;p.push({unit:f,pts:e,dts:e})}return e.samples=p,this.remuxAudio(e,t,r,!1)}}function Pn(e,t){let r;if(null===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}function On(e,t,r,n){const i=e.samples.length;if(!i)return;const s=e.inputTimeScale;for(let o=0;o<i;o++){const i=e.samples[o];i.pts=Pn(i.pts-r.baseTime*s/r.timescale,t*s)/s,i.dts=Pn(i.dts-n.baseTime*s/n.timescale,t*s)/s}const a=e.samples;return e.samples=[],{samples:a}}function Mn(e,t,r){const n=e.samples.length;if(!n)return;const i=e.inputTimeScale;for(let a=0;a<n;a++){const n=e.samples[a];n.pts=Pn(n.pts-9e4*r.baseTime/r.timescale,t*i)/i}e.samples.sort(((e,t)=>e.pts-t.pts));const s=e.samples;return e.samples=[],{samples:s}}class Nn{constructor(e,t,r,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=n,this.flags=new Fn(e)}}class Fn{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}function Un(e,t){const r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.6.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===R?"avc1.42e01e":"mp4a.40.5"}try{In=self.performance.now.bind(self.performance)}catch(xa){w.debug("Unable to use Performance API on this environment"),In="undefined"!==typeof self&&self.Date.now}const Bn=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,r,n){const i=this.videoTrack=qr("video",1),s=this.audioTrack=qr("audio",1),a=this.txtTrack=qr("text",1);if(this.id3Track=qr("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=Te(e);
1if(o.video){const{id:e,timescale:t,codec:r}=o.video;i.id=e,i.timescale=a.timescale=t,i.codec=r}if(o.audio){const{id:e,timescale:t,codec:r}=o.audio;s.id=e,s.timescale=t,s.codec=r}a.id=me.text,i.sampleDuration=0,i.duration=s.duration=n}resetContiguity(){this.remainderData=null}static probe(e){return _e(e=e.length>16384?e.subarray(0,16384):e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let r=e;const n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=ke(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},r=_e(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;const n=r[r.length-1];return t.valid=Y(e,0,n.byteOffset-8),t.remainder=Y(e,n.byteOffset-8),t}(r);this.remainderData=t.remainder,n.samples=t.valid||new Uint8Array}else n.samples=r;const s=this.extractID3Track(n,t);return i.samples=xe(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const n=this.extractID3Track(t,this.timeOffset);
vendor: 4,431 bytes, line 1
1return r.samples=xe(e,t),{videoTrack:t,audioTrack:qr(),id3Track:n,textTrack:qr()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const n=_e(e.samples,["emsg"]);n&&n.forEach((e=>{const n=function(e){const t=e[0];let r="",n="",i=0,s=0,a=0,o=0,l=0,c=0;if(0===t){for(;"\0"!==ge(e.subarray(c,c+1));)r+=ge(e.subarray(c,c+1)),c+=1;for(r+=ge(e.subarray(c,c+1)),c+=1;"\0"!==ge(e.subarray(c,c+1));)n+=ge(e.subarray(c,c+1)),c+=1;n+=ge(e.subarray(c,c+1)),c+=1,i=ye(e,12),s=ye(e,16),o=ye(e,20),l=ye(e,24),c=28}else if(1===t){c+=4,i=ye(e,c),c+=4;const t=ye(e,c);c+=4;const s=ye(e,c);for(c+=4,a=2**32*t+s,Number.isSafeInteger(a)||(a=Number.MAX_SAFE_INTEGER,w.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=ye(e,c),c+=4,l=ye(e,c),c+=4;"\0"!==ge(e.subarray(c,c+1));)r+=ge(e.subarray(c,c+1)),c+=1;for(r+=ge(e.subarray(c,c+1)),c+=1;"\0"!==ge(e.subarray(c,c+1));)n+=ge(e.subarray(c,c+1)),c+=1;n+=ge(e.subarray(c,c+1)),c+=1}return{schemeIdUri:r,value:n,timeScale:i,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:e.subarray(c,e.byteLength)}}(e);if(rn.test(n.schemeIdUri)){const e=p(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let i=4294967295===n.eventDuration?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;i<=.001&&(i=Number.POSITIVE_INFINITY);const s=n.payload;r.samples.push({data:s,len:s.byteLength,dts:e,pts:e,type:bt,duration:i})}}))}return r}demuxSampleAes(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,r,n){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(function(e,t){if(!e||!t)return e;const r=t.keyId;r&&t.isCommonEncryption&&_e(e,["moov","trak"]).forEach((e=>{const t=_e(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let n=_e(t,["enca"]);const i=n.length>0;i||(n=_e(t,["encv"])),n.forEach((e=>{_e(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=Se(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(w.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${he(e)} -> ${he(r)}`),t.set(r,8))}}))}))}));return e}(e,n)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const n=this.initData=Te(e);t||(t=Un(n.audio,I)),r||(r=Un(n.video,R));const i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:w.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,r,n,i,s){var a,o;let{initPTS:l,lastEndTime:c}=this;const d={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};p(c)||(c=this.lastEndTime=i||0);const u=t.samples;if(null==u||!u.length)return d;const h={initPTS:void 0,timescale:1};let f=this.initData;if(null!=(a=f)&&a.length||(this.generateInitSegment(u),f=this.initData),null==(o=f)||!o.length)return w.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const m=function(e,t){let r=0,n=0,i=0;const s=_e(e,["moof","traf"]);for(let a=0;a<s.length;a++){const e=s[a],o=_e(e,["tfhd"])[0],l=t[ye(o,4)];if(!l)continue;const c=l.default,d=ye(o,0)|(null==c?void 0:c.flags);let u=null==c?void 0:c.duration;8&d&&(u=ye(o,2&d?12:8));const h=l.timescale||9e4,f=_e(e,["trun"]);for(let t=0;t<f.length;t++)r=Ae(f[t]),!r&&u&&(r=u*ye(f[t],4)),l.type===R?n+=r/h:l.type===I&&(i+=r/h)}if(0===n&&0===i){let t=0;const r=_e(e,["sidx"]);for(let e=0;e<r.length;e++){const n=we(r[e]);null!=n&&n.references&&(t+=n.references.reduce(((e,t)=>e+t.info.duration||0),0))}return t}return n||i}(u,f),g=function(e,t){return _e(t,["moof","traf"]).reduce(((t,r)=>{const n=_e(r,["tfdt"])[0],i=n[0],s=_e(r,["tfhd"]).reduce(((t,r)=>{const s=ye(r,4),a=e[s];if(a){let e=ye(n,4);if(1===i){if(e===fe)return w.warn("[mp4-demuxer]: Ignoring assumed invali
1d signed 64-bit track fragment decode time"),t;e*=fe+1,e+=ye(n,8)}const r=e/(a.timescale||9e4);if(isFinite(r)&&(null===t||r<t))return r}return t}),null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t}),null)}(f,u),v=null===g?i:g;(function(e,t,r,n){if(null===e)return!0;const i=Math.max(n,1),s=t-e.baseTime/e.timescale;return Math.abs(s-r)>i}(l,v,i,m)||h.timescale!==l.timescale&&s)&&(h.initPTS=v-i,l&&1===l.timescale&&w.warn("Adjusting initPTS by "+(h.initPTS-l.baseTime)),this.initPTS=l={baseTime:h.initPTS,timescale:1});const y=e?v-l.baseTime/l.timescale:c,b=y+m;!function(e,t,r){_e(t,["moof","traf"]).forEach((t=>{_e(t,["tfhd"]).forEach((n=>{const i=ye(n,4),s=e[i];if(!s)return;const a=s.timescale||9e4;_e(t,["tfdt"]).forEach((e=>{const t=e[0];let n=ye(e,4);if(0===t)n-=r*a,n=Math.max(n,0),Ee(e,4,n);else{n*=Math.pow(2,32),n+=ye(e,8),n-=r*a,n=Math.max(n,0);const t=Math.floor(n/(fe+1)),i=Math.floor(n%(fe+1));Ee(e,4,t),Ee(e,8,i)}}))}))}))}(f,u,l.baseTime/l.timescale),m>0?this.lastEndTime=b:(w.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const E=!!f.audio,_=!!f.video;let T="";E&&(T+="audio"),_&&(T+="video");const S={data1:u,startPTS:y,startDTS:y,endPTS:b,endDTS:b,type:T,hasAudio:E,hasVideo:_,nb:1,dropped:0};return d.audio="audio"===S.type?S:void 0,d.video="audio"!==S.type?S:void 0,d.initSegment=h,d.id3=On(r,i,l,l),n.samples.length&&(d.text=Mn(n,i,l)),d}}},{demux:vn,remux:Cn},{demux:class extends Wr{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(Z(e,0)||[]).length;for(let r=e.length;t<r;t++)if(Zr(e,t))return w.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&zr(e,t)&&Xr(e,t)<=e.length-t}(e,t)}appendFrame(e,t,r){Jr(e,this.observer,t,r,e.manifestCodec);const n=tn(e,t,r,this.basePTS,this.frameIndex);if(n&&0===n.missing)return n}},remux:Cn},{demux:class extends Wr{resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(Z(e,0)||[]).length;for(let r=e.length;t<r;t++)if(fn(e,t))return w.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return un(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,r){if(null!==this.basePTS)return cn(e,t,r,this.basePTS,this.frameIndex)}},remux:Cn}];class jn{constructor(e,t,r,n,i){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n,this.id=i}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,n){const i=r.transmuxing;i.executeStart=In();let s=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;n&&(this.currentTransmuxState=n);const{contiguous:l,discontinuity:c,trackSwitch:d,accurateTimeOffset:u,timeOffset:h,initSegmentChange:f}=n||a,{audioCodec:p,videoCodec:y,defaultInitPts:b,duration:E,initSegmentData:_}=o,T=function(e,t){let r=null;e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t);return r}(s,t);if(T&&"AES-128"===T.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(s,T.key.buffer,T.iv.buffer).then((e=>{const t=this.push(e,null,r);return this.decryptionPromise=null,t})),this.decryptionPromise;{let t=e.softwareDecrypt(s,T.key.buffer,T.iv.buffer);if(r.part>-1&&(t=e.flush()),!t)return i.executeEnd=In(),$n(r);s=new Uint8Array(t)}}const S=this.needsProbing(c,d);if(S){const e=this.configureTransmuxer(s);if(e)return w.warn(`[transmuxer] ${e.message}
1`),this.observer.emit(m.ERROR,m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),i.executeEnd=In(),$n(r)}(c||d||f||S)&&this.resetInitSegment(_,p,y,E,t),(c||f||S)&&this.resetInitialTimestamp(b),l||this.resetContiguity();const A=this.transmux(s,T,h,u,r),k=this.currentTransmuxState;return k.contiguous=!0,k.discontinuity=!1,k.trackSwitch=!1,i.executeEnd=In(),A}flush(e){const t=e.transmuxing;t.executeStart=In();const{decrypter:r,currentTransmuxState:n,decryptionPromise:i}=this;if(i)return i.then((()=>this.flush(e)));const s=[],{timeOffset:a}=n;if(r){const t=r.flush();t&&s.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=In(),[$n(e)];const c=o.flush(a);return Vn(c)?c.then((t=>(this.flushRemux(s,t,e),s))):(this.flushRemux(s,c,e),s)}flushRemux(e,t,r){const{audioTrack:n,videoTrack:i,id3Track:s,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;w.log(`[transmuxer.ts]: Flushed fragment ${r.sn}${r.part>-1?" p: "+r.part:""} of level ${r.level}`);const c=this.remuxer.remux(n,i,s,a,l,o,!0,this.id);e.push({remuxResult:c,chunkMeta:r}),r.transmuxing.executeEnd=In()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,n,i){const{demuxer:s,remuxer:a}=this;s&&a&&(s.resetInitSegment(e,t,r,n),a.resetInitSegment(e,t,r,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,n,i){let s;return s=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,n,i):this.transmuxUnencrypted(e,r,n,i),s}transmuxUnencrypted(e,t,r,n){const{audioTrack:i,videoTrack:s,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,a,o,t,r,!1,this.id),chunkMeta:n}}transmuxSampleAes(e,t,r,n,i){return this.demuxer.demuxSampleAes(e,t,r).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,n,!1,this.id),chunkMeta:i})))}
vendor: 4,627 bytes, line 1
1configureTransmuxer(e){const{config:t,observer:r,typeSupported:n,vendor:i}=this;let s;for(let d=0,u=Bn.length;d<u;d++)if(Bn[d].demux.probe(e)){s=Bn[d];break}if(!s)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=s.remux,c=s.demux;o&&o instanceof l||(this.remuxer=new l(r,t,n,i)),a&&a instanceof c||(this.demuxer=new c(r,t,n),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Ir(this.config)),e}}const $n=e=>({remuxResult:{},chunkMeta:e});function Vn(e){return"then"in e&&e.then instanceof Function}class Hn{constructor(e,t,r,n,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=n,this.defaultInitPts=i||null}}class Gn{constructor(e,t,r,n,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=s}}var qn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var o=new i(n,s||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,s,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,c,d=this._events[o],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,i),!0;case 5:return d.fn.call(d.context,t,n,i,s),!0;case 6:return d.fn.call(d.context,t,n,i,s,a),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var h,f=d.length;for(c=0;c<f;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,n);break;case 4:d[c].fn.call(d[c].context,t,n,i);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];d[c].fn.apply(d[c].context,l)}}return!0},o.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,c=[],d=o.length;l<d;l++)(o[l].fn!==t||i&&!o[l].once||n&&o[l].context!==n)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(qn);var Wn=a(qn.exports);const Kn=je()||{isTypeSupported:()=>!1};class zn{constructor(e,t,r,n){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=r,this.onFlush=n;const s=(e,t)=>{(t=t||{}).frag=this.frag,t.id=this.id,e===m.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new Wn,this.observer.on(m.FRAG_DECRYPTED,s),this.observer.on(m.ERROR,s);
1const a={mp4:Kn.isTypeSupported("video/mp4"),mpeg:Kn.isTypeSupported("audio/mpeg"),mp3:Kn.isTypeSupported('audio/mp4; codecs="mp3"')},o=navigator.vendor;if(this.useWorker&&"undefined"!==typeof Worker){if(i.workerPath||"function"===typeof __HLS_WORKER_BUNDLE__){try{i.workerPath?(w.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=function(e){const t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(i.workerPath)):(w.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const r=new Error(`${e.message} (${e.filename}:${e.lineno})`);i.enableWorker=!1,w.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(m.ERROR,{type:g.OTHER_ERROR,details:v.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:r})},e.postMessage({cmd:"init",typeSupported:a,vendor:o,id:t,config:JSON.stringify(i)})}catch(xa){w.warn(`Error setting up "${t}" Web Worker, fallback to inline`,xa),this.resetWorker(),this.error=null,this.transmuxer=new jn(this.observer,a,i,o,t)}return}}this.transmuxer=new jn(this.observer,a,i,o,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,r,n,i,s,a,o,l,c){var d,u;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,f=s?s.start:i.start,p=i.decryptdata,m=this.frag,g=!(m&&i.cc===m.cc),v=!(m&&l.level===m.level),y=m?l.sn-m.sn:-1,b=this.part?l.part-this.part.index:-1,E=0===y&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),_=!v&&(1===y||0===y&&(1===b||E&&b<=0)),T=self.performance.now();(v||y||0===i.stats.parsing.start)&&(i.stats.parsing.start=T),!s||!b&&_||(s.stats.parsing.start=T);const S=!(m&&(null==(d=i.initSegment)?void 0:d.url)===(null==(u=m.initSegment)?void 0:u.url)),A=new Gn(g,_,o,v,f,S);if(!_||g||S){w.log(`[transmuxer-interface, ${i.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${g}\n trackSwitch: ${v}\n contiguous: ${_}\n accurateTimeOffset: ${o}\n timeOffset: ${f}\n initSegmentChange: ${S}`);const e=new Hn(r,n,t,a,c);this.configureTransmuxer(e)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:p,chunkMeta:l,state:A},e instanceof ArrayBuffer?[e]:[]);else if(h){const t=h.push(e,p,l,A);Vn(t)?(h.async=!0,t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}))):(h.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let r=t.flush(e);Vn(r)||t.async?(Vn(r)||(r=Promise.resolve(r)),r.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}))):this.handleFlushResult(r,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}onWorkerMessage(e){const t=e.data,r=this.hls;switch(t.event){case"init":{var n;const e=null==(n=this.workerContext)?void 0:n.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":w[t.data.logType]&&w[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class Yn{constructor(e,t,r,n){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:r,media:n,stalled:i}=this;if(null===n)return;const{currentTime:s,seeking:a}=n,o=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,s!==e){if(this.moved=!0,null!==i){if(this.stallReported){const e=self.performance.now()-i;w.warn(`playback not stuck anymore @${s}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||o)return void(this.stalled=null);if(n.paused&&!a||n.ended||0===n.playbackRate||!br.getBuffered(n).length)return;const c=br.bufferInfo(n,s,0),d=c.len>0,u=c.nextStart||0;if(!d&&!u)return;if(a){const e=c.len>2,r=!u||t&&t.start<=s||u-s>2&&!this.fragmentTracker.getPartialFragment(s);if(e||r)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var h;
1const e=Math.max(u,c.start||0)-s,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,r=(null==t||null==(h=t.details)?void 0:h.live)?2*t.details.targetduration:2,n=this.fragmentTracker.getPartialFragment(s);if(e>0&&(e<=r||n))return void this._trySkipBufferHole(n)}const f=self.performance.now();if(null===i)return void(this.stalled=f);const p=f-i;if(!a&&p>=250&&(this._reportStall(c),!this.media))return;const m=br.bufferInfo(n,s,r.maxBufferHole);this._tryFixBufferStall(m,p)}_tryFixBufferStall(e,t){const{config:r,fragmentTracker:n,media:i}=this;if(null===i)return;const s=i.currentTime,a=n.getPartialFragment(s);if(a){if(this._trySkipBufferHole(a)||!this.media)return}(e.len>r.maxBufferHole||e.nextStart&&e.nextStart-s<r.maxBufferHole)&&t>1e3*r.highBufferWatchdogPeriod&&(w.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:r,stallReported:n}=this;if(!n&&r){this.stallReported=!0;const n=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${JSON.stringify(e)})`);w.warn(n.message),t.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:r,media:n}=this;if(null===n)return 0;const i=n.currentTime,s=br.bufferInfo(n,i,0),a=i<s.start?s.start:s.nextStart;if(a){const o=s.len<=t.maxBufferHole,l=s.len>0&&s.len<1&&n.readyState<3,c=a-i;if(c>0&&(o||l)){if(c>t.maxBufferHole){const{fragmentTracker:t}=this;let r=!1;if(0===i){const e=t.getAppendedFrag(0,ot);e&&a<e.end&&(r=!0)}if(!r){const r=e||t.getAppendedFrag(i,ot);if(r){let e=!1,n=r.end;for(;n<a;){const r=t.getPartialFragment(n);if(!r){e=!0;break}n+=r.duration}if(e)return 0}}}const s=Math.max(a+.05,i+.1);if(w.warn(`skipping hole, adjusting currentTime from ${i} to ${s}`),this.moved=!0,this.stalled=null,n.currentTime=s,e&&!e.gap){const t=new Error(`fragment loaded with buffer holes, seeking from ${i} to ${s}`);r.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,frag:e})}return s}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:r,nudgeRetry:n}=this;if(null===r)return;const i=r.currentTime;if(this.nudgeRetry++,n<e.nudgeMaxRetry){const s=i+(n+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${i} to ${s}`);w.warn(a.message),r.currentTime=s,t.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const r=new Error(`Playhead still not moving while enough data buffered @${i} after ${e.nudgeMaxRetry} nudges`);w.error(r.message),t.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_STALLED_ERROR,error:r,fatal:!0})}}}class Xn extends Hr{constructor(e,t,r){super(e,t,r,"[stream-controller]",ot),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(m.ERROR,this.onError,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(m.ERROR,this.onError,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),this.onMediaDetaching()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=r.startLevel;-1===e&&(r.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=r.nextAutoLevel),this.level=r.nextLoadLevel=e,this.loadedmetadata=!1}t>0&&-1===e&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=Cr,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Dr}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Vr:{var e;const{levels:t,level:r}=this,n=null==t||null==(e=t[r])?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=Cr;break}if(this.hls.nextLoadLevel!==this.level){this.state=Cr;break}break}case Mr:{var t;const e=self.performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Cr)}}this.state===Cr&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:n}=this,{config:i,nextLoadLevel:s}=e;if(null===t||!n&&(this.startFragRequested||!i.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(null==r||!r[s])return;const a=r[s],o=this.getMainFwdBufferInfo();if(null===o)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(m.BUFFER_EOS,e),void(this.state=Br)}e.loadLevel!==s&&-1===e.manualLevel&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const c=a.details;if(!c||this.state===Vr||c.live&&this.levelLastLoaded!==s)return this.level=s,void(this.state=Vr);const d=o.len,u=this.getMaxBufferLength(a.maxBitrate);if(d>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:o.end;let f=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&f&&"initSegment"!==f.sn&&this.fragmentTracker.getState(f)!==lr){var p;const e=(null!=(p=this.backtrackFragment)?p:f).sn-c.startSN,t=c.fragments[e-1];t&&f.cc===t.cc&&(f=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,h)){if(!f.gap){const e=this.audioOnly&&!this.altAudio?I:R,t=(e===R?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,ot)}f=this.getNextFragmentLoopLoading(f,c,o,ot,u)}f&&(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,a,h))}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);this.fragCurrent=e,n===sr||n===or?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ot)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let r;const n=this.getAppendedFrag(t.currentTime);n&&n.start>1&&this.flushMainBuffer(0,n.start-1);const i=this.getLevelDetails();if(null!=i&&i.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*i.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],n=this.fragLastKbps;r=n&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*n)+1:0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const e=this.followingBufferedFrag(s);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,r=e.duration,n=Math.max(s.end,t+Math.min(Math.max(r-this.config.maxFragLookUpTolerance,.5*r),.75*r));this.flushMainBuffer(n,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Pr:case Or:case Mr:case Fr:case Ur:this.state=Cr}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new Yn(this.config,r,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;p(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const r=this.getMainFwdBufferInfo();null!==r&&0!==r.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${r?r.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(m.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}onManifestParsed(e,t){let r,n=!1,i=!1;
1t.levels.forEach((e=>{r=e.audioCodec,r&&(-1!==r.indexOf("mp4a.40.2")&&(n=!0),-1!==r.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=n&&i&&!function(){var e;const t=Gr();return"function"===typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==Cr)return;const n=r[t.level];(!n.details||n.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(n.details))&&(this.state=Vr)}onLevelLoaded(e,t){var r;const{levels:n}=this,i=t.level,s=t.details,a=s.totalduration;if(!n)return void this.warn(`Levels were reset while loading level ${i}`);this.log(`Level ${i} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${a}`);const o=n[i],l=this.fragCurrent;!l||this.state!==Or&&this.state!==Mr||l.level===t.level&&l.urlId===o.urlId||!l.loader||this.abortCurrentFrag();let c=0;if(s.live||null!=(r=o.details)&&r.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;c=this.alignPlaylists(s,o.details)}if(o.details=s,this.levelLastLoaded=i,this.hls.trigger(m.LEVEL_UPDATED,{details:s,level:i}),this.state===Vr){if(this.waitForCdnTuneIn(s))return;this.state=Cr}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:n,payload:i}=e,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const a=s[r.level],o=a.details;if(!o)return this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),void this.fragmentTracker.removeFragment(r);const l=a.videoCodec,c=o.PTSKnown||!o.live,d=null==(t=r.initSegment)?void 0:t.data,u=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new zn(this.hls,ot,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=n?n.index:-1,p=-1!==f,m=new Er(r.level,r.sn,r.stats.chunkCount,i.byteLength,f,p),g=this.initPTS[r.cc];h.push(i,d,u,l,r,n,o.totalduration,c,m,g)}onAudioTrackSwitching(e,t){const r=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;r&&(e.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(m.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=t.id,n=!!this.hls.audioTracks[r].url;if(n){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=n,this.tick()}onBufferCreated(e,t){const r=t.tracks;let n,i,s=!1;for(const a in r){const e=r[a];if("main"===e.id){if(i=a,n=e,"video"===a){const e=r[a];e&&(this.videoBuffer=e.buffer)}}else s=!0}s&&n?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r&&r.type!==ot)return;if(this.fragContextChanged(r))return this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Ur&&(this.state=Cr));const i=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}onError(e,t){var r;if(t.fatal)this.state=jr;else switch(t.details){case v.FRAG_GAP:case v.FRAG_PARSING_ERROR:case v.FRAG_DECRYPT_ERROR:case v.FRAG_LOAD_ERROR:case v.FRAG_LOAD_TIMEOUT:case v.KEY_LOAD_ERROR:case v.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ot,t);break;case v.LEVEL_LOAD_ERROR:case v.LEVEL_LOAD_TIMEOUT:case v.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Vr||(null==(r=t.context)?void 0:r.type)!==it||(this.state=Cr);break;case v.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case v.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}
1checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!br.getBuffered(e).length){const e=this.state!==Cr?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Cr,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==I||this.audioOnly&&!this.altAudio){const e=(t===R?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,ot)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t<r){if(e.seeking)return void this.log(`could not seek to ${r}, already seeking at ${t}`);const n=br.getBuffered(e),i=(n.length?n.start(0):0)-r;i>0&&(i<this.config.maxBufferHole||i<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${i} to match buffer start`),r+=i,this.startPosition=r),this.log(`seek to target start position ${r} from current time ${t}`),e.currentTime=r}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((r=>{const{hls:n}=this;if(!r||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Cr,this.startFragRequested=!1,this.bitrateTest=!1;const i=e.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),n.trigger(m.FRAG_LOADED,r),e.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const r="main",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{video:d,text:u,id3:h,initSegment:f}=i,{details:g}=c,v=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o))return void this.fragmentTracker.removeFragment(o);if(this.state=Fr,f){if(null!=f&&f.tracks){const e=o.initSegment||o;this._bufferInitSegment(c,f.tracks,e,s),n.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:f.tracks})}const e=f.initPTS,t=f.timescale;p(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},n.trigger(m.INIT_PTS_FOUND,{frag:o,id:r,initPTS:e,timescale:t}))}const y=o.sn!==(null==g?void 0:g.startSN);if(d&&!1!==i.independent){if(g){const{startPTS:e,endPTS:t,startDTS:r,endDTS:n}=d;if(l)l.elementaryStreams[d.type]={startPTS:e,endPTS:t,startDTS:r,endDTS:n};else if(d.firstKeyFrame&&d.independent&&1===s.id&&(this.couldBacktrack=!0),d.dropped&&d.independent){const r=this.getMainFwdBufferInfo(),i=(r?r.end:this.getLoadPosition())+this.config.maxBufferHole,s=d.firstKeyFramePTS?d.firstKeyFramePTS:e;if(y&&i<s-this.config.maxBufferHole)return void this.backtrack(o);o.setElementaryStreamInfo(d.type,o.start,t,o.start,n,!0)}o.setElementaryStreamInfo(d.type,e,t,r,n),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(d,o,l,s)}}else if(y&&!1===i.independent)return void this.backtrack(o);if(v){const{startPTS:e,endPTS:t,startDTS:r,endDTS:n}=v;l&&(l.elementaryStreams[I]={startPTS:e,endPTS:t,startDTS:r,endDTS:n}),o.setElementaryStreamInfo(I,e,t,r,n),this.bufferFragmentData(v,o,l,s)}if(g&&null!=h&&null!=(t=h.samples)&&t.length){const e={id:r,frag:o,details:g,samples:h.samples};n.trigger(m.FRAG_PARSING_METADATA,e)}if(g&&u){const e={id:r,frag:o,details:g,samples:u.samples};n.trigger(m.FRAG_PARSING_USERDATA,e)}}_bufferInitSegment(e,t,r,n){if(this.state!==Fr)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:i,video:s,audiovideo:a}=t;if(i){let t=e.audioCodec;const r=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==i.metadata.channelCount&&-1===r.indexOf("firefox")&&(t="mp4a.40.5")),-1!==r.indexOf("android")&&"audio/mpeg"!==i.container&&(t="mp4a.40.2",this.log(`Android: force audio codec to ${t}`)),e.audioCodec&&e.audioCodec!==t&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${t}"`),i.levelCodec=t,i.id="main",this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${t||""}/${e.audioCodec||""}/${i.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.attrs.CODECS||""}/${a.codec}]`),this.hls.trigger(m.BUFFER_CODECS,t),Object.keys(t).forEach((e=>{const i=t[e].initSegment;null!=i&&i.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:e,data:i,frag:r,part:null,chunkMeta:n,parent:r.type})})),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,ot)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Cr}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const r=e.currentTime;if(br.isBuffered(e,r)?t=this.getAppendedFrag(r):br.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,r=t.level;e&&t.sn===e.sn&&e.level===r&&t.urlId===e.urlId||(this.fragPlaying=t,this.hls.trigger(m.FRAG_CHANGED,{frag:t}),e&&e.level===r||this.hls.trigger(m.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,r=this.currentFrag;if(r&&p(t)&&p(r.programDateTime)){const e=r.programDateTime+1e3*(t-r.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Qn{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}
1getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Zn{constructor(e,t,r,n=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Qn(e),this.fast_=new Qn(t),this.defaultTTFB_=n,this.ttfb_=new Qn(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:i}=this;r.halfLife!==e&&(this.slow_=new Qn(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new Qn(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new Qn(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){const r=(e=Math.max(e,this.minDelayMs_))/1e3,n=8*t/r;this.fast_.sample(r,n),this.slow_.sample(r,n)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Jn{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;return e.length?(r=1===e.length?e[0]:function(e,t){const r=new Uint8Array(t);let n=0;for(let i=0;i<e.length;i++){const t=e[i];r.set(t,n),n+=t.length}return r}(e,t),this.reset(),r):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}function ei(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!ti(e[r].attrs,t[r].attrs))return!1;return!0}function ti(e,t){const r=e["STABLE-RENDITION-ID"];return r?r===t["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some((r=>e[r]!==t[r]))}class ri{constructor(e){this.buffered=void 0;const t=(t,r,n)=>{if((r>>>=0)>n-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${n})`);return e[r][t]};this.buffered={get length(){return e.length},end:r=>t("end",r,e.length),start:r=>t("start",r,e.length)}}}function ni(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];"subtitles"!==n.kind&&"captions"!==n.kind||!n.label||t.push(e[r])}return t}class ii{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t){const r=this.queues[t];r.push(e),1===r.length&&this.buffers[t]&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const r=new Promise((e=>{t=e})),n={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(n,e),r}executeNext(e){const{buffers:t,queues:r}=this,n=t[e],i=r[e];if(i.length){const t=i[0];try{t.execute()}catch(s){w.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),t.onError(s),null!=n&&n.updating||(i.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const si=je(),ai=/([ha]vc.)(?:\.[^.,]+)+/;const oi={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},li=function(e){let t=e;return oi.hasOwnProperty(e)&&(t=oi[e]),String.fromCharCode(t)}
vendor: 8,332 bytes, line 1
1,ci=15,di=100,ui={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},hi={17:2,18:4,21:6,22:8,23:10,19:13,20:15},fi={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},pi={25:2,26:4,29:6,30:8,31:10,27:13,28:15},mi=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class gi{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r="function"===typeof t?t():t;w.log(`${this.time} [${e}] ${r}`)}}}const vi=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class yi{constructor(e,t,r,n,i){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=n||"black",this.flash=i||!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let r=0;r<t.length;r++){const n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class bi{constructor(e,t,r,n,i,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new yi(t,r,n,i,s)}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Ei{constructor(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(let t=0;t<di;t++)this.chars.push(new bi);this.logger=e,this.pos=0,this.currPenState=new yi}equals(e){let t=!0;for(let r=0;r<di;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t}copy(e){for(let t=0;t<di;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<di;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>di&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=di)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=li(e);this.pos>=di?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<di;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let r=0;r<di;r++){const n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e);this.chars[this.pos].setPenState(this.currPenState)}}class _i{constructor(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(let t=0;t<ci;t++)this.rows.push(new Ei(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}reset(){for(let e=0;e<ci;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let r=0;r<ci;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<ci;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<ci;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e);this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let t=0;t<ci;t++)this.rows[t].clear();const e=this.currRow+1-this.nrRollUpRows,r=this.lastOutputScreen;if(r){const n=r.rows[e].cueStartTime,i=this.logger.time;if(n&&null!==i&&n<i)for(let s=0;s<this.nrRollUpRows;s++)this.rows[t-this.nrRollUpRows+s+1].copy(r.rows[e+s])}}this.currRow=t;const r=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,n=Math.max(t-1,0);r.setCursor(e.indent),e.color=r.chars[n].penState.foreground}const n={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(n)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",n=-1;for(let i=0;i<ci;i++){const r=this.rows[i].getTextString();r&&(n=i+1,e?t.push("Row "+n+": '"+r+"'"):t.push(r.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}getTextAndFormat(){return this.rows}}class wi{constructor(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new _i(r),this.nonDisplayedMemory=new _i(r),this.lastOutputScreen=new _i(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}
1ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[r]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Ti{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const n=new gi;this.channels=[null,new wi(e,t,n),new wi(e+1,r,n)],this.cmdHistory={a:null,b:null},this.logger=n}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let r,n,i,s=!1;this.logger.time=e;for(let a=0;a<t.length;a+=2)if(n=127&t[a],i=127&t[a+1],0!==n||0!==i){if(this.logger.log(3,"["+vi([t[a],t[a+1]])+"] -> ("+vi([n,i])+")"),r=this.parseCmd(n,i),r||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),!r&&(s=this.parseChars(n,i),s)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(s)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||s||this.logger.log(2,"Couldn't parse cleaned data "+vi([n,i])+" orig: "+vi([t[a],t[a+1]]))}}parseCmd(e,t){const{cmdHistory:r}=this;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(Ai(e,t,r))return Si(null,null,r),this.logger.log(3,"Repeated command ("+vi([e,t])+") is dropped"),!0;const n=20===e||21===e||23===e?1:2,i=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),Si(e,t,r),this.currentChannel=n,!0}parseMidrow(e,t){let r=0;if((17===e||25===e)&&t>=32&&t<=47){if(r=17===e?1:2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const n=this.channels[r];return!!n&&(n.ccMIDROW(t),this.logger.log(3,"MIDROW ("+vi([e,t])+")"),!0)}return!1}parsePAC(e,t){let r;const n=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(Ai(e,t,n))return Si(null,null,n),!0;const i=e<=23?1:2;r=t>=64&&t<=95?1===i?ui[e]:fi[e]:1===i?hi[e]:pi[e];const s=this.channels[i];return!!s&&(s.setPAC(this.interpretPAC(r,t)),Si(e,t,n),this.currentChannel=i,!0)}interpretPAC(e,t){let r;const n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=1===(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n}parseChars(e,t){let r,n=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&i<=19){let e;e=17===i?t+80:18===i?t+112:t+144,this.logger.log(2,"Special char '"+li(e)+"' in channel "+r),n=[e]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);if(n){const r=vi(n);this.logger.log(3,"Char codes = "+r.join(",")),Si(e,t,this.cmdHistory)}return n}
vendor: 13,882 bytes, line 1
1parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let r;const n={};16===e||24===e?(r=Math.floor((t-32)/2),n.background=mi[r],t%2===1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));const i=e<=23?1:2;return this.channels[i].setBkgData(n),Si(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function Si(e,t,r){r.a=e,r.b=t}function Ai(e,t,r){return r.a===e&&r.b===t}class ki{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var xi=function(){if("undefined"!==typeof self&&self.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!==typeof t)return!1;if(!Array.isArray(e))return!1;const r=t.toLowerCase();return!!~e.indexOf(r)&&r}function n(e){return r(t,e)}function i(e,...t){let r=1;for(;r<arguments.length;r++){const t=arguments[r];for(const r in t)e[r]=t[r]}return e}function s(t,s,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",d=!1,u=t,h=s,f=a,p=null,m="",g=!0,v="auto",y="start",b=50,E="middle",_=50,w="middle";Object.defineProperty(o,"id",i({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",i({},l,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(o,"startTime",i({},l,{get:function(){return u},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");u=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",i({},l,{get:function(){return h},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",i({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",i({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",i({},l,{get:function(){return m},set:function(t){const n=function(t){return r(e,t)}(t);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");m=n,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",i({},l,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",i({},l,{get:function(){return v},set:function(e){if("number"!==typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",i({},l,{get:function(){return y},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",i({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",i({},l,{get:function(){return E},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",i({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",i({},l,{get:function(){return w},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Li{decode(e,t){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ii(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(n||0)}const r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}class Ri{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function Di(e,t,r,n){const i=n?e.split(n):[e];for(const s in i){if("string"!==typeof i[s])continue;const e=i[s].split(r);if(2!==e.length)continue;t(e[0],e[1])}}const Ci=new xi(0,0,""),Pi="middle"===Ci.align?"middle":"center";function Oi(e,t,r){const n=e;function i(){const t=Ii(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=i(),s(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.slice(3),s(),t.endTime=i(),s(),function(e,t){const n=new Ri;Di(e,(function(e,t){let i;switch(e){case"region":for(let i=r.length-1;i>=0;i--)if(r[i].id===t){n.set(e,r[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),n.integer(e,i[0]),n.percent(e,i[0])&&n.set("snapToLines",!1),n.alt(e,i[0],["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",Pi,"end"]);break;case"position":i=t.split(","),n.percent(e,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",Pi,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",Pi,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");let i=n.get("line","auto");"auto"===i&&-1===Ci.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",Pi);let s=n.get("position","auto");"auto"===s&&50===Ci.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function Mi(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Ni{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Li,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function r(){let e=t.buffer,r=0;for(e=Mi(e);r<e.length&&"\r"!==e[r]&&"\n"!==e[r];)++r;const n=e.slice(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.slice(r),n}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=r();const n=e.match(/^(\xef\xbb\xbf)?WEBVTT([ \t].*)?$/);if(null==n||!n[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let i=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(i?i=!1:e=r(),t.state){case"HEADER":/:/.test(e)?Di(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new xi(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Oi(e,t.cue,t.regionList)}catch(n){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const r=-1!==e.indexOf("--\x3e");if(!e||r&&(i=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(n){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Fi=/\r\n|\n\r|\n|\r/g,Ui=function(e,t,r=0){return e.slice(r,r+t.length)===t},Bi=function(e){let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()};function ji(e,t,r){return Bi(e.toString())+Bi(t.toString())+Bi(r)}function $i(e,t,r,n,i,s,a){const o=new Ni,l=ce(new Uint8Array(e)).trim().replace(Fi,"\n").split("\n"),c=[],d=t?function(e,t=1){return xn(e,9e4,1/t)}(t.baseTime,t.timescale):0;let u,h="00:00.000",f=0,m=0,g=!0;o.oncue=function(e){const s=r[n];let a=r.ccOffset;const o=(f-d)/9e4;if(null!=s&&s.new&&(void 0!==m?a=r.ccOffset=s.start:function(e,t,r){let n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;null!=(s=i)&&s.new;){var s;e.ccOffset+=n.start-i.start,n.new=!1,n=i,i=e[n.prevCC]}e.presentationOffset=r}(r,n,o)),o){if(!t)return void(u=new Error("Missing initPTS for VTT MPEGTS"));a=o-r.presentationOffset}const l=e.endTime-e.startTime,h=Pn(9e4*(e.startTime+a-m),9e4*i)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+l,0);const p=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(p)),e.id||(e.id=ji(e.startTime,e.endTime,p)),e.endTime>0&&c.push(e)},o.onparsingerror=function(e){u=e},o.onflush=function(){u?a(u):s(c)},l.forEach((e=>{if(g){if(Ui(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{Ui(e,"LOCAL:")?h=e.slice(6):Ui(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))}));try{m=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!p(t)||!p(r)||!p(n)||!p(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=6e4*n,t+=36e5*i,t}(h)/1e3}catch(t){u=t}return}""===e&&(g=!1)}o.parse(e+"\n")})),o.flush()}const Vi="stpp.ttml.im1t",Hi=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Gi=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,qi={left:"start",center:"center",right:"end",start:"start",end:"end"};function Wi(e,t,r,n){const i=_e(new Uint8Array(e),["mdat"]);if(0===i.length)return void n(new Error("Could not parse IMSC1 mdat"));const s=i.map((e=>ce(e))),a=function(e,t,r=1,n=!1){return xn(e,t,1/r,n)}(t.baseTime,1,t.timescale);try{s.forEach((e=>r(function(e,t){const r=new DOMParser,n=r.parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce(((e,t)=>(e[t]=n.getAttribute(`ttp:${t}`)||i[t],e)),{}),a="preserve"!==n.getAttribute("xml:space"),o=zi(Ki(n,"styling","style")),l=zi(Ki(n,"layout","region")),c=Ki(n,"body","[begin]");return[].map.call(c,(e=>{const r=Yi(e,a);if(!r||!e.hasAttribute("begin"))return null;const n=Zi(e.getAttribute("begin"),s),i=Zi(e.getAttribute("dur"),s);let c=Zi(e.getAttribute("end"),s);if(null===n)throw Qi(e);if(null===c){if(null===i)throw Qi(e);c=n+i}const d=new xi(n-t,c-t,r);d.id=ji(d.startTime,d.endTime,d.text);const u=function(e,t,r){const n="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;a&&r.hasOwnProperty(a)&&(i=r[a]);return s.reduce(((r,s)=>{const a=Xi(t,n,s)||Xi(e,n,s)||Xi(i,n,s);return a&&(r[s]=a),r}),{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:h}=u;if(h){const e=qi[h];e&&(d.lineAlign=e),d.align=h}return f(d,u),d})).filter((e=>null!==e))}(e,a))))}catch(o){n(o)}}function Ki(e,t,r){const n=e.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function zi(e){return e.reduce(((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e}),{})}function Yi(e,t){return[].slice.call(e.childNodes).reduce(((e,r,n)=>{var i;return"br"===r.nodeName&&n?e+"\n":null!=(i=r.childNodes)&&i.length?Yi(r,t):t?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent}),"")}function Xi(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function Qi(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Zi(e,t){if(!e)return null;let r=Ii(e);return null===r&&(Hi.test(e)?r=function(e,t){const r=Hi.exec(e),n=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+n/t.frameRate}(e,t):Gi.test(e)&&(r=function(e,t){const r=Gi.exec(e),n=Number(r[1]);switch(r[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),r}function Ji(e,t){return!!e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}class es{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(m.MEDIA_ATTA
1CHING,this.onMediaAttaching,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}onManifestParsed(e,t){const r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter(((t,r)=>this.isLevelAllowed(t)&&r<=e));return this.clientRect=null,es.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.
1width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,r){if(null==e||!e.length)return-1;let n=e.length-1;for(let a=0;a<e.length;a+=1){const o=e[a];if((o.width>=t||o.height>=r)&&(i=o,!(s=e[a+1])||i.width!==s.width||i.height!==s.height)){n=a;break}}var i,s;return n}}const ts="[eme]";class rs{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=rs.CDMCleanupPromise?[rs.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=w.debug.bind(w,ts),this.log=w.log.bind(w,ts),this.warn=w.warn.bind(w,ts),this.error=w.error.bind(w,ts),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}
vendor: 2,281 bytes, line 1
1registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,n=t[e];if(n)return n.licenseUrl;if(e===B.WIDEVINE&&r)return r;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(e,t,r)=>!!e&&r.indexOf(e)===t,n=t.map((e=>e.audioCodec)).filter(r),i=t.map((e=>e.videoCodec)).filter(r);return n.length+i.length===0&&i.push("avc1.42e01e"),new Promise(((t,r)=>{const s=e=>{const a=e.shift();this.getMediaKeysPromise(a,n,i).then((e=>t({keySystem:a,mediaKeys:e}))).catch((t=>{e.length?s(e):r(t instanceof ns?t:new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};s(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if("function"!==typeof r){let e=`Configured requestMediaKeySystemAccess is not a function ${r}`;return null===z&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return r(e,t)}getMediaKeysPromise(e,t,r){const n=function(e,t,r,n){let i;switch(e){case B.FAIRPLAY:i=["cenc","sinf"];break;case B.WIDEVINE:case B.PLAYREADY:i=["cenc"];break;case B.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,r,n){return[{initDataTypes:e,persistentState:n.persistentState||"not-allowed",distinctiveIdentifier:n.distinctiveIdentifier||"not-allowed",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs="${e}
1"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null}))),videoCapabilities:r.map((e=>({contentType:`video/mp4; codecs="${e}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null})))}]}(i,t,r,n)}(e,t,r,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=null==i?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(n)}`),s=this.requestMediaKeySystemAccess(e,n);const t=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),s.then((r=>{this.log(`Access for key-system "${r.keySystem}" obtained`);const n=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=r.createMediaKeys().then((t=>(this.log(`Media-keys created for "${e}"`),n.then((r=>r?this.setMediaKeysServerCertificate(t,e,r):t))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return s.then((()=>i.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${he(e.keyId||[])}`);const n=r.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),n=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,i,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return he(e.keyId)}updateKeySession(e,t){var r;const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyID ${he((null==(r=e.decryptdata)?void 0:r.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),n.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise(((t,r)=>{const n=K(this.config),i=e.map(G).filter((e=>!!e&&-1!==n.indexOf(e)));return this.getKeySystemSelectionPromise(i).then((({keySystem:e})=>{const n=W(e);n?t(n):r(new Error(`Unable to find format for key-system "${e}"`))})).catch(r)}))}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),n=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);let i=this.keyIdToKeySessionPromise[r];return i||(i=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(t).then((({keySystem:r,mediaKeys:i})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(r,i).then((()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:r,mediaKeys:i,decryptdata:t});return this.generateRequestWithPreferredKeySession(e,"cenc",t.pssh,"playlist-key")}))))),i.catch((e=>this.handleError(e)))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ns?this.hls.trigger(m.ERROR,e.data):this.hls.trigger(m.ERROR,{type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const t=G(e.keyFormat),r=t?[t]:K(this.config);return this.attemptKeySystemAccess(r)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=K(this.config)),0===e.length)throw new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:r}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===r)return;let n,i;if("sinf"===t&&this.config.drmSystems[B.FAIRPLAY]){const e=ge(new Uint8Array(r));try{const t=N(JSON.parse(e).sinf),r=Se(new Uint8Array(t));if(!r)return;n=r.subarray(8,24),i=B.FAIRPLAY}catch(c){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},r=new DataView(e),n=r.getUint32(0);if(e.byteLength!==n&&n>44)return null;if(1886614376!==r.getUint32(4))return null;if(t.version=r.getUint32(8)>>>24,t.version>1)return null;
1t.systemId=he(new Uint8Array(e,12,16));const i=r.getUint32(28);if(0===t.version){if(n-32<i)return null;t.data=new Uint8Array(e,32,i)}else if(1===t.version){t.kids=[];for(let r=0;r<i;r++)t.kids.push(new Uint8Array(e,32+16*r,16))}return t}(r);if(null===e)return;0===e.version&&e.systemId===q&&e.data&&(n=e.data.subarray(8,24)),i=function(e){if(e===q)return B.WIDEVINE}(e.systemId)}if(!i||!n)return;const s=he(n),{keyIdToKeySessionPromise:a,mediaKeySessions:o}=this;let l=a[s];for(let d=0;d<o.length;d++){const e=o[d],i=e.decryptdata;if(i.pssh||!i.keyId)continue;const c=he(i.keyId);if(s===c||-1!==i.uri.replace(/-/g,"").indexOf(s)){l=a[c],delete a[c],i.pssh=new Uint8Array(r),i.keyId=n,l=a[s]=l.then((()=>this.generateRequestWithPreferredKeySession(e,t,r,"encrypted-event-key-match")));break}}l||(l=a[s]=this.getKeySystemSelectionPromise([i]).then((({keySystem:e,mediaKeys:i})=>{var a;this.throwIfDestroyed();const o=new Pe("ISO-23001-7",s,null!=(a=W(e))?a:"");return o.pssh=new Uint8Array(r),o.keyId=n,this.attemptSetMediaKeys(e,i).then((()=>{this.throwIfDestroyed();const n=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:i});return this.generateRequestWithPreferredKeySession(n,t,r,"encrypted-event-no-match")}))}))),l.catch((e=>this.handleError(e)))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(r).then((()=>
vendor: 4,722 bytes, line 1
1{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(n),n.then((()=>{this.log(`Media-keys set for "${e}"`),r.push(n),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===r.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,r,n){var i,s;const a=null==(i=this.config.drmSystems)||null==(s=i[e.keySystem])?void 0:s.generateRequest;if(a)try{const n=a.call(this.hls,t,r,e);if(!n)throw new Error("Invalid response from configured generateRequest filter");t=n.initDataType,r=e.decryptdata.pssh=n.initData?new Uint8Array(n.initData):null}catch(u){var o;if(this.warn(u.message),null!=(o=this.hls)&&o.config.debug)throw u}if(null===r)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${n}": ${l} (init data type: ${t} length: ${r?r.byteLength:null})`);const c=new Wn;e.mediaKeysSession.onmessage=t=>{const r=e.mediaKeysSession;if(!r)return void c.emit("error",new Error("invalid state"));const{messageType:n,message:i}=t;this.log(`"${n}" message event for session "${r.sessionId}" message size: ${i.byteLength}`),"license-request"===n||"license-renewal"===n?this.renewLicense(e,i).catch((e=>{this.handleError(e),c.emit("error",e)})):"license-release"===n?e.keySystem===B.FAIRPLAY&&(this.updateKeySession(e,U("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${n}"`)},e.mediaKeysSession.onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void c.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const r=e.keyStatus;c.emit("keyStatus",r),"expired"===r&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const d=new Promise(((e,t)=>{c.on("error",t),c.on("keyStatus",(r=>{r.startsWith("usable")?e():"output-restricted"===r?t(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===r?t(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${r}"`)):"expired"===r?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${r}"`)}))}));return e.mediaKeysSession.generateRequest(t,r).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)})).catch((e=>{throw new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>d)).catch((t=>{throw c.removeAllListeners(),this.removeSession(e),t})).then((()=>(c.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,r)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${he("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${he(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,r=new(0,t.loader)(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching serverCertificate for "${e}"`),new Promise(((i,s)=>{const a={responseType:"arraybuffer",url:n},o=t.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,r,n)=>{i(e.data)},onError:(t,r,i,o)=>{s(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:u({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${n}). Status: ${t.code} (${t.text})`))},onTimeout:(t,r,i)=>{s(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(e,t,r)=>{s(new Error("aborted"))}};r.load(a,l,c)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise(((n,i)=>{e.setServerCertificate(r).then((i=>{this.log(`setServerCertificate ${i?"success":"not supported by CDM"} (${null==r?void 0:r.byteLength}) on "${t}"`),n(e)})).catch((e=>{i(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}setupLicenseXHR(e,t,r,n){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then((()=>
1{if(!r.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,r,n)})).catch((s=>{if(!r.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,r,n)})).then((r=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:r||n}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:n}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise(((n,i)=>{const s=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${s}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const r=this.config.licenseResponseCallback;if(r)try{t=r.call(this.hls,a,s,e)}catch(o){this.error(o)}n(t)}else{const o=r.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)i(new ns({type:g.KEY_SYSTEM_ERROR,details:v.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:s,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${s}). Status: ${a.status} (${a.statusText})`));else{const r=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${r} attempts left`),this.requestLicense(e,t).then(n,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,s,e,t).then((({xhr:e,licenseChallenge:t})=>{e.send(t)}))}))}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Pe.clearKeyUriToKeyIdMap();const r=t.length;rs.CDMCleanupPromise=Promise.all(t.map((e=>this.removeSession(e))).concat(null==e?void 0:e.setMediaKeys(null).catch((t=>{this.log(`Could not clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)})))).then((()=>{r&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)})).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)}))}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),t.onmessage=null,t.onkeystatuseschange=null,r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const n=this.mediaKeySessions.indexOf(e);return n>-1&&this.mediaKeySessions.splice(n,1),t.remove().catch((e=>{this.log(`Could not remove session: ${e}`)})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`)}))}}}rs.CDMCleanupPromise=void 0;
1class ns extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var is="m",ss="a",as="v",os="av",ls="i",cs="tt";class ds{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:is,su:!this.initialized})}catch(t){w.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=e=>{try{const t=e.frag,r=this.hls.levels[t.level],n=this.getObjectType(t),i={d:1e3*t.duration,ot:n};n!==as&&n!==ss&&n!=os||(i.br=r.bitrate/1e3,i.tb=this.getTopBandwidth(n)/1e3,i.bl=this.getBufferLength(n)),this.apply(e,i)}catch(t){w.warn("Could not generate segment CMCD data.",t)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;null!=r&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||ds.uuid(),this.cid=r.contentId,this.useHeaders=!0===r.useHeaders,this.registerListeners())}registerListeners(){const e=this.hls;
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHED,this.onMediaDetached,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHED,this.onMediaDetached,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var r,n;this.audioBuffer=null==(r=t.tracks.audio)?void 0:r.buffer,this.videoBuffer=null==(n=t.tracks.video)?void 0:n.buffer}createData(){var e;return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){f(t,this.createData());const r=t.ot===ls||t.ot===as||t.ot===os;if(this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.useHeaders){const r=ds.toHeaders(t);if(!Object.keys(r).length)return;e.headers||(e.headers={}),f(e.headers,r)}else{const r=ds.toQuery(t);if(!r)return;e.url=ds.appendQueryToUri(e.url,r)}}getObjectType(e){const{type:t}=e;return"subtitle"===t?cs:"initSegment"===e.sn?ls:"audio"===t?ss:"main"===t?this.hls.audioTracks.length?as:os:void 0}getTopBandwidth(e){let t,r=0;const n=this.hls;if(e===ss)t=n.audioTracks;else{const e=n.maxAutoLevel,r=e>-1?e+1:n.levels.length;t=n.levels.slice(0,r)}for(const i of t)i.bitrate>r&&(r=i.bitrate);return r>0?r:NaN}getBufferLength(e){const t=this.hls.media,r=e===ss?this.audioBuffer:this.videoBuffer;if(!r||!t)return NaN;return 1e3*br.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,n){t(e),this.loader.load(e,r,n)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,n){t(e),this.loader.load(e,r,n)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],r=e=>!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e,n=e=>Math.round(e),i=e=>100*n(e/100),s={br:n,d:n,bl:i,dl:i,mtp:i,nor:e=>encodeURIComponent(e),rtp:i,tb:n},a=Object.keys(e||{}).sort();for(const o of a){let n=e[o];if(!r(n))continue;if("v"===o&&1===n)continue;if("pr"==o&&1===n)continue;const i=s[o];i&&(n=i(n));const a=typeof n;let l;l="ot"===o||"sf"===o||"st"===o?`${o}=${n}`:"boolean"===a?o:"number"===a?`${o}=${n}`:`${o}=${JSON.stringify(n)}`,t.push(l)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),r={},n=["Object","Request","Session","Status"],i=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const a of t){i[null!=s[a]?s[a]:1][a]=e[a]}for(let a=0;a<i.length;a++){const e=ds.serialize(i[a]);e&&(r[`CMCD-${n[a]}`]=e)}return r}
1static toQuery(e){return`CMCD=${encodeURIComponent(ds.serialize(e))}`}static appendQueryToUri(e,t){if(!t)return e;const r=e.includes("?")?"&":"?";return`${e}${r}${t}`}}function us(e,t,r,n){e&&Object.keys(t).forEach((i=>{const s=e.filter((e=>e.groupId===i)).map((e=>{const s=f({},e);return s.details=void 0,s.attrs=new A(s.attrs),s.url=s.attrs.URI=hs(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),s.groupId=s.attrs["GROUP-ID"]=t[i],s.attrs["PATHWAY-ID"]=n,s}));e.push(...s)}))}function hs(e,t,r,n){const{HOST:i,PARAMS:s,[r]:a}=n;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return i&&!o&&(l.host=i),s&&Object.keys(s).sort().forEach((e=>{e&&l.searchParams.set(e,s[e])})),l.href}const fs=/^age:\s*[\d.]+\s*$/im;class ps{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new L,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0,n.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then((()=>
1{if(!this.stats.aborted)return i(r,t.url)})).catch((e=>(r.open("GET",t.url,!0),i(r,t.url)))).then((()=>{this.stats.aborted||this.openAndSendXhr(r,t,e)})).catch((e=>{this.callbacks.onError({code:r.status,text:e.message},t,r,n)})):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const n=this.context.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=r.loadPolicy;if(n)for(const a in n)e.setRequestHeader(a,n[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=i&&p(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const n=t.readyState,i=this.config;if(!r.aborted&&n>=2&&(0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),4===n)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,s="text"!==t.responseType;if(n>=200&&n<300&&(s&&t.response||null!==t.responseText)){r.loading.end=Math.max(self.performance.now(),r.loading.first);const i=s?t.response:t.responseText,a="arraybuffer"===t.responseType?i.byteLength:i.length;if(r.loaded=r.total=a,r.bwEstimate=8e3*r.total/(r.loading.end-r.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(r,e,i,t),!this.callbacks)return;const l={url:t.responseURL,data:i,code:n};this.callbacks.onSuccess(l,r,e,t)}else{const s=i.loadPolicy.errorRetry;Vt(s,r.retry,!1,n)?this.retry(s):(w.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,r))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(Vt(t,this.stats.retry,!0))this.retry(t);else{w.warn(`timeout while loading ${this.context.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=jt(e,r.retry),r.retry++,w.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${r.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&fs.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const ms=/(\d+)-(\d+)\/(\d+)/;class gs{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||vs,this.controller=new self.AbortController,this.stats=new L}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();const i=function(e,t){const r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(f({},e.headers))};e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return r}(e,this.controller.signal),s=r.onProgress,a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=l&&p(l)?l:c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),r.onTimeout(n,e,this.response)}),t.timeout),self.fetch(this.request).then((i=>{this.response=this.loader=i;const o=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),r.onTimeout(n,e,this.response)}),c-(o-n.loading.start)),!i.ok){const{status:e,statusText:t}=i;throw new ys(t||"fetch, bad network response",e,i)}return n.loading.first=o,n.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=ms.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(p(e))return e}const r=e.get("Content-Length");if(r)return parseInt(r)}(i.headers)||n.total,s&&p(t.highWaterMark)?this.loadProgressively(i,n,e,t.highWaterMark,s):a?i.arrayBuffer():"json"===e.responseType?i.json():i.text()})).then((i=>{const{response:a}=this;self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const l=i[o];l&&(n.loaded=n.total=l);const c={url:a.url,data:i,code:a.status};s&&!p(t.highWaterMark)&&s(n,e,i,a),r.onSuccess(c,n,e,a)})).catch((t=>{if(self.clearTimeout(this.requestTimeout),n.aborted)return;const i=t&&t.code||0,s=t?t.message:null;r.onError({code:i,text:s},e,t?t.details:null,n)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,n=0,i){const s=new Jn,a=e.body.getReader(),o=()=>a.read().then((a=>
1{if(a.done)return s.dataLength&&i(t,r,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=a.value,c=l.length;return t.loaded+=c,c<n||s.dataLength?(s.push(l),s.dataLength>=n&&i(t,r,s.flush(),e)):i(t,r,l,e),o()})).catch((()=>Promise.reject()));return o()}}function vs(e,t){return new self.Request(e.url,t)}class ys extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const bs=/\s/,Es={newCue(e,t,r,n){const i=[];let s,a,o,l,c;const d=self.VTTCue||self.TextTrackCue;for(let h=0;h<n.rows.length;h++)if(s=n.rows[h],o=!0,l=0,c="",!s.isEmpty()){var u;for(let e=0;e<s.chars.length;e++)bs.test(s.chars[e].uchar)&&o?l++:(c+=s.chars[e].uchar,o=!1);s.cueStartTime=t,t===r&&(r+=1e-4),l>=16?l--:l++;const n=Mi(c.trim()),f=ji(t,r,n);null!=e&&null!=(u=e.cues)&&u.getCueById(f)||(a=new d(t,r,n),a.id=f,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),i.push(a))}return e&&i.length&&(i.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),i.forEach((t=>pt(e,t)))),i}},_s=u(u({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ps,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new Zn(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var r;const n=t.frag;this.ignoreFragment(n)||(this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,r,n){return e+r/t+(n?this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const r=this.hls.config,{total:n,bwEstimate:i}=t.stats;p(n)&&p(i)&&(this.lastLevelLoadSec=8*n/i),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{autoLevelEnabled:n,media:i}=r;if(!e||!i)return;const s=performance.now(),a=t?t.stats:e.stats,o=t?t.duration:e.duration,l=s-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!n||i.paused||!i.playbackRate||!i.readyState)return;const c=r.mainForwardBufferInfo;if(null===c)return;const d=this.bwEstimator.getEstimateTTFB(),u=Math.abs(i.playbackRate);if(l<=Math.max(d,o/(2*u)*1e3))return;const h=c.len/u;if(h>=2*o/u)return;const f=a.loading.first?a.loading.first-a.loading.start:-1,g=a.loaded&&f>-1,v=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:b}=r,E=y[e.level],_=a.total||Math.max(a.loaded,Math.round(o*E.maxBitrate/8));let T=l-f;T<1&&g&&(T=Math.min(l,8*a.loaded/v));const S=g?1e3*a.loaded/T:0,A=S?(_-a.loaded)/S:8*_/v+d/1e3;if(A<=h)return;const k=S?8*S:v;let x,L=Number.POSITIVE_INFINITY;for(x=e.level-1;x>b;x--){const e=y[x].maxBitrate;if(L=this.getTimeToLoadFrag(d/1e3,k,o*e,!y[x].details),L<h)break}L>=A||L>
110*o||(r.nextLoadLevel=x,g?this.bwEstimator.sample(l-Math.min(d,f),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),w.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${h.toFixed(3)} s\n Estimated load time for current fragment: ${A.toFixed(3)} s\n Estimated load time for down switch fragment: ${L.toFixed(3)} s\n TTFB estimate: ${f}\n Current BW estimate: ${p(v)?(v/1024).toFixed(3):"Unknown"} Kb/s\n New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s\n Aborting and switching to level ${x}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),r.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:r}){const n=r?r.stats:t.stats;if(t.type===ot&&this.bwEstimator.sampleTTFB(n.loading.first-n.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const e=r?r.duration:t.duration,i=this.hls.levels[t.level],s=(i.loaded?i.loaded.bytes:0)+n.loaded,a=(i.loaded?i.loaded.duration:0)+e;i.loaded={bytes:s,duration:a},i.realBitrate=Math.round(8*s/a)}if(t.bitrateTest){const e={stats:n,frag:t,part:r,id:t.type};this.onFragBuffered(m.FRAG_BUFFERED,e),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:r,part:n}=t,i=null!=n&&n.stats.loaded?n.stats:r.stats;if(i.aborted)return;if(this.ignoreFragment(r))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ot||"initSegment"===e.sn}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;let r=this.getNextABRAutoLevel();if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return-1!==e&&(r=Math.min(e,r)),r}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{maxAutoLevel:n,config:i,minAutoLevel:s,media:a}=r,o=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,d=r.mainForwardBufferInfo,u=(d?d.len:0)/l;let h=this.findBestLevel(c,s,n,u,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(h>=0)return h;w.trace(`[abr] ${u?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let f=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,m=i.abrBandWidthUpFactor;if(!u){const e=this.bitrateTestDelay;if(e){f=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-e,w.trace(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*f)} ms`),p=m=1}}return h=this.findBestLevel(c,s,n,u+f,p,m),Math.max(h,0)}findBestLevel(e,t,r,n,i,s){var a;const{fragCurrent:o,partCurrent:l,lastLoadedFragLevel:c}=this,{levels:d}=this.hls,u=d[c],h=!(null==u||null==(a=u.details)||!a.live),f=null==u?void 0:u.codecSet,m=l?l.duration:o?o.duration:0,g=this.bwEstimator.getEstimateTTFB()/1e3;let v=t,y=-1;for(let b=r;b>=t;b--){const t=d[b];if(!t||f&&t.codecSet!==f){t&&(v=Math.min(b,v),y=Math.max(b,y));continue}-1!==y&&w.trace(`[abr] Skipped level(s) ${v}-${y} with CODECS:"${d[y].attrs.CODECS}"; not compatible with "${u.attrs.CODECS}"`);const r=t.details,a=(l?null==r?void 0:r.partTarget:null==r?void 0:r.averagetargetduration)||m;let o;o=b<=c?i*e:s*e;const E=d[b].maxBitrate,_=this.getTimeToLoadFrag(g,o,E*a,void 0===r);if(w.trace(`[abr] level:${b} adjustedbw-bitrate:${Math.round(o-E)} avgDuration:${a.toFixed(1)} maxFetchDuration:${n.toFixed(1)} fetchDuration:${_.toFixed(1)}`),o>E&&(0===_||!p(_)||h&&!this.bitrateTestDelay||_<n))return b}return-1}set nextAutoLevel(e){this._nextAutoLevel=e}},bufferController:class{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;w.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(m.MEDIA_ATTA
1CHED,{media:e})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{w.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{w.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:t}=this;e&&e.src!==t&&w.error(`Media element src was set while attaching MediaSource (${t} > ${e.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_APPENDING,this.onBufferAppending,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.BUFFER_EOS,this.onBufferEos,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.FRAG_PARSED,this.onFragParsed,this),e.on(m.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;
1e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_APPENDING,this.onBufferAppending,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_EOS,this.onBufferEos,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.FRAG_PARSED,this.onFragParsed,this),e.off(m.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new ii(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,w.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const r=this.media=t.media;if(r&&si){const e=this.mediaSource=new si;e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(e),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:r}=this;if(t){if(w.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(xa){w.warn(`[buffer-controller]: onMediaDetaching: ${xa.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):w.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(m.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(xa){w.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,xa)}})),this._initSourceBuffer()}onBufferCodecs(e,t){const r=this.getSourceBufferTypes().length;Object.keys(t).forEach((e=>{if(r){const r=this.tracks[e];if(r&&"function"===typeof r.buffer.changeType){const{id:n,codec:i,levelCodec:s,container:a,metadata:o}=t[e],l=(r.levelCodec||r.codec).replace(ai,"$1"),c=(s||i).replace(ai,"$1");if(l!==c){const t=`${a};codecs=${s||i}`;this.appendChangeType(e,t),w.log(`[buffer-controller]: switching codec ${l} to ${c}`),this.tracks[e]={buffer:r.buffer,codec:i,container:a,levelCodec:s,metadata:o,id:n}}}}else this.pendingTracks[e]=t[e]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:r}=this,n={execute:()=>{const n=this.sourceBuffer[e];n&&(w.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),n.changeType(t)),r.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{w.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,t)}};r.append(n,e)}onBufferAppending(e,t){const{hls:r,operationQueue:n,tracks:i}=this,{data:s,type:a,frag:o,part:l,chunkMeta:c}=t,d=c.buffering[a],u=self.performance.now();d.start=u;const h=o.stats.buffering,f=l?l.stats.buffering:null;0===h.start&&(h.start=u),f&&0===f.start&&(f.start=u);const p=i.audio;let y=!1;"audio"===a&&"audio/mpeg"===(null==p?void 0:p.container)&&(y=!this.lastMpegAudioChunk||1===c.id||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const b=o.start,E={execute:()=>{if(d.executeStart=self.performance.now(),y){const e=this.sourceBuffer[a];if(e){const t=b-e.timestampOffset;Math.abs(t)>=.1&&(w.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${b} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=b)}}this.appendExecutor(s,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();d.executeEnd=d.end=e,0===h.first&&(h.first=e),f&&0===f.first&&(f.first=e);const{sourceBuffer:t}=this,r={};for(const n in t)r[n]=br.getBuffered(t[n]);this.appendError=0,this.hls.trigger(m.BUFFER_APPENDED,{type:a,frag:o,part:l,chunkMeta:c,parent:o.type,timeRanges:r})},onError:e=>{w.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,e);const t={type:g.MEDIA_ERROR,parent:o.type,details:v.BUFFER_APPEND_ERROR,frag:o,part:l,chunkMeta:c,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=v.BUFFER_FULL_ERROR:(this.appendError++,t.details=v.BUFFER_APPEND_ERROR,this.appendError>
1r.config.appendErrorMaxRetry&&(w.error(`[buffer-controller]: Failed ${r.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),t.fatal=!0)),r.trigger(m.ERROR,t)}};n.append(E,a)}onBufferFlushing(e,t){const{operationQueue:r}=this,n=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:e})},onError:t=>{w.warn(`[buffer-controller]: Failed to remove from ${e} SourceBuffer`,t)}});t.type?r.append(n(t.type),t.type):this.getSourceBufferTypes().forEach((e=>{r.append(n(e),e)}))}onFragParsed(e,t){const{frag:r,part:n}=t,i=[],s=n?n.elementaryStreams:r.elementaryStreams;s[D]?i.push("audiovideo"):(s[I]&&i.push("audio"),s[R]&&i.push("video"));0===i.length&&w.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers((()=>{const e=self.performance.now();r.stats.buffering.end=e,n&&(n.stats.buffering.end=e);const t=n?n.stats:r.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:r,part:n,stats:t,id:r.type})}),i)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){this.getSourceBufferTypes().reduce(((e,r)=>{const n=this.sourceBuffer[r];return!n||t.type&&t.type!==r||(n.ending=!0,n.ended||(n.ended=!0,w.log(`[buffer-controller]: ${r} sourceBuffer now EOS`))),e&&!(n&&!n.ended)}),!0)&&(w.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)}));const{mediaSource:e}=this;e&&"open"===e.readyState?(w.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&w.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:r,sourceBuffer:n}=this;if(!r||null===t)return;const i=this.getSourceBufferTypes();if(!i.length)return;const s=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(!p(s)||s<0)return;const a=r.currentTime,o=t.levelTargetDuration,l=Math.max(s,o),c=Math.floor(a/o)*o-l;i.forEach((r=>{const i=n[r];if(i){const n=br.getBuffered(i);if(n.length>0&&c>n.start(0)){if(e.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(i.ended&&n.end(n.length-1)-a<2*o)return void w.info(`[buffer-controller]: Cannot flush ${r} back buffer while SourceBuffer is in ended state`);e.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:r})}}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:r,mediaSource:n}=this,i=e.fragments[0].start+e.totalduration,s=r.duration,a=p(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(w.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(i>a&&i>s||!p(s))&&(w.log(`[buffer-controller]: Updating Media Source duration to ${i.toFixed(3)}`),n.duration=i)}updateSeekableRange(e){const t=this.mediaSource,r=e.fragments;if(r.length&&e.live&&null!=t&&t.setLiveSeekableRange){const n=Math.max(0,r[0].start),i=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,i)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:r}=this,n=Object.keys(r).length;if(n&&!e||2===n){this.createSourceBuffers(r),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(m.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((e=>{t.executeNext(e)}));else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:r}=this;if(!r)throw Error("createSourceBuffers called when mediaSource was null");for(const n in e)if(!t[n]){const i=e[n];if(!i)throw Error(`source buffer exists for track ${n}, however track does not`);const s=i.levelCodec||i.codec,a=`${i.container};codecs=${s}`;w.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const e=t[n]=r.addSourceBuffer(a),o=n;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[n]={buffer:e,codec:s,container:i.container,levelCodec:i.levelCodec,metadata:i.metadata,id:i.id}}catch(xa){w.error(`[buffer-controller]: error while trying to add sourceBuffer: ${xa.message}`),this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:xa,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const r=new Error(`${e} SourceBuffer error`);w.error(`[buffer-controller]: ${r}`,t),this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.BUFFER_APPENDING_ERROR,error:r,fatal:!1});const n=this.operationQueue.current(e);n&&n.onError(t)}removeExecutor(e,t,r){const{media:n,mediaSource:i,operationQueue:s,sourceBuffer:a}=this,o=a[e];if(!n||!i||!o)return w.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void s.shiftAndExecuteNext(e);const l=p(n.duration)?n.duration:1/0,c=p(i.duration)?i.duration:1/0,d=Math.max(0,t),u=Math.min(r,l,c);u>
1d&&!o.ending?(o.ended=!1,w.log(`[buffer-controller]: Removing [${d},${u}] from the ${e} SourceBuffer`),o.remove(d,u)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:r,sourceBuffer:n}=this,i=n[t];if(!i)return w.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),void r.shiftAndExecuteNext(t);i.ended=!1,i.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return w.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:r}=this,n=t.map((e=>r.appendBlocker(e)));Promise.all(n).then((()=>{e(),t.forEach((e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||r.shiftAndExecuteNext(e)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,r){const n=this.sourceBuffer[e];if(!n)return;const i=r.bind(this,e);this.listeners[e].push({event:t,listener:i}),n.addEventListener(t,i)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach((e=>{t.removeEventListener(e.event,e.listener)}))}},capLevelController:es,errorController:class{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=w.log.bind(w,"[info]:"),this.warn=w.warn.bind(w,"[warning]:"),this.error=w.error.bind(w,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.ERROR,this.onError,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.ERROR,this.onError,this),e.off(m.ERROR,this.onErrorOut,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(null==e?void 0:e.type)===ot?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const n=this.hls,i=t.context;switch(t.details){case v.FRAG_LOAD_ERROR:case v.FRAG_LOAD_TIMEOUT:case v.KEY_LOAD_ERROR:case v.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case v.FRAG_GAP:case v.FRAG_PARSING_ERROR:case v.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=zt);case v.LEVEL_EMPTY_ERROR:case v.LEVEL_PARSING_ERROR:{var s,a;const e=t.parent===ot?t.level:n.loadLevel;t.details===v.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(a=s.levelDetails)&&a.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case v.LEVEL_LOAD_ERROR:case v.LEVEL_LOAD_TIMEOUT:return void("number"===typeof(null==i?void 0:i.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level)));case v.AUDIO_TRACK_LOAD_ERROR:case v.AUDIO_TRACK_LOAD_TIMEOUT:case v.SUBTITLE_LOAD_ERROR:case v.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const e=n.levels[n.loadLevel];if(e&&(i.type===st&&i.groupId===e.audioGroupId||i.type===at&&i.groupId===e.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=zt,void(t.errorAction.flags=Qt)}return;case v.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=n.levels[n.loadLevel],r=null==e?void 0:e.attrs["HDCP-LEVEL"];r&&(t.errorAction={action:zt,flags:Zt,hdcpLevel:r})}return;case v.BUFFER_ADD_CODEC_ERROR:case v.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(r=t.level)?r:n.loadLevel));case v.INTERNAL_EXCEPTION:case v.BUFFER_APPENDING_ERROR:case v.BUFFER_APPEND_ERROR:case v.BUFFER_FULL_ERROR:case v.LEVEL_SWITCH_ERROR:case v.BUFFER_STALLED_ERROR:case v.BUFFER_SEEK_OVER_HOLE:case v.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:Kt,flags:Xt})}if(t.type===g.KEY_SYSTEM_ERROR){const e=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,e))}}getPlaylistRetryOrSwitchAction(e,t){var r;
1const n=Bt(this.hls.config.playlistLoadPolicy,e),i=this.playlistError++,s=null==(r=e.response)?void 0:r.code;if(Vt(n,i,Ut(e),s))return{action:Yt,flags:Xt,retryConfig:n,retryCount:i};const a=this.getLevelSwitchAction(e,t);return n&&(a.retryConfig=n,a.retryCount=i),a}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,a=Bt(e.details.startsWith("key")?s:i,e),o=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(n){var l;e.details!==v.FRAG_GAP&&n.fragmentError++;const t=null==(l=e.response)?void 0:l.code;if(Vt(a,o,Ut(e),t))return{action:Yt,flags:Xt,retryConfig:a,retryCount:o}}const c=this.getLevelSwitchAction(e,r);return a&&(c.retryConfig=a,c.retryCount=o),c}getLevelSwitchAction(e,t){const r=this.hls;null!==t&&void 0!==t||(t=r.loadLevel);const n=this.hls.levels[t];if(n&&(n.loadError++,r.autoLevelEnabled)){var i,s;let t=-1;const{levels:a,loadLevel:o,minAutoLevel:l,maxAutoLevel:c}=r,d=null==(i=e.frag)?void 0:i.type,{type:u,groupId:h}=null!=(s=e.context)?s:{};for(let r=a.length;r--;){const i=(r+o)%a.length;if(i!==o&&i>=l&&i<=c&&0===a[i].loadError){const r=a[i];if(e.details===v.FRAG_GAP&&e.frag){const t=a[i].details;if(t){const r=Gt(e.frag,t.fragments,e.frag.start);if(null!=r&&r.gap)continue}}else{if(u===st&&h===r.audioGroupId||u===at&&h===r.textGroupId)continue;if(d===lt&&n.audioGroupId===r.audioGroupId||d===ct&&n.textGroupId===r.textGroupId)continue}t=i;break}}if(t>-1&&r.loadLevel!==t)return e.levelRetry=!0,this.playlistError=0,{action:zt,flags:Xt,nextAutoLevel:t}}return{action:zt,flags:Qt}}onErrorOut(e,t){var r;switch(null==(r=t.errorAction)?void 0:r.action){case Kt:break;case zt:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===v.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:n,hdcpLevel:i,nextAutoLevel:s}=r;switch(n){case Xt:this.switchLevel(e,s);break;case Qt:r.resolved||(r.resolved=this.redundantFailover(e));break;case Zt:i&&(t.maxHdcpLevel=At[At.indexOf(i)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}r.resolved||this.switchLevel(e,s)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:r}=this,n=e.parent===ot?e.level:t.loadLevel,i=t.levels[n],s=i.url.length,a=e.frag?e.frag.urlId:i.urlId;i.urlId!==a||e.frag&&!i.details||this.penalizeRendition(i,e);for(let o=1;o<s;o++){const l=(a+o)%s,c=r[l];if(!c||Jt(c,e,r[a]))return this.warn(`Switching to Redundant Stream ${l+1}/${s}: "${i.url[l]}" after ${e.details}`),this.playlistError=0,t.levels.forEach((e=>{e.urlId=l})),t.nextLoadLevel=n,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:r}=this,n=r[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};n.lastErrorPerfMs=performance.now(),n.errors.push(t),n.details=e.details,r[e.urlId]=n}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}
1registerListeners(){this.hls.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"===typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,r){const n=performance.now();if(t){if(this.lastTime){const e=n-this.lastTime,i=r-this.lastDroppedFrames,s=t-this.lastDecodedFrames,a=1e3*i/e,o=this.hls;if(o.trigger(m.FPS_DROP,{currentDropped:i,currentDecoded:s,totalDroppedFrames:r}),a>0&&i>o.config.fpsDroppedMonitoringThreshold*s){let e=o.currentLevel;w.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:z,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:Es,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Hr{constructor(e,t,r){super(e,t,r,"[subtitle-stream-controller]",ct),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.ERROR,this.onError,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.ERROR,this.onError,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Cr,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:n}=t;if(this.fragPrevious=r,this.state=Cr,!n)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const a=r.start;for(let l=0;l<i.length;l++)if(a>=i[l].start&&a<=i[l].end){s=i[l];break}const o=r.start+r.duration;s?s.end=o:(s={start:a,end:o},i.push(s)),this.fragmentTracker.fragBuffered(r)}onBufferFlushing(e,t){const{startOffset:r,endOffset:n}=t;if(0===r&&n!==Number.POSITIVE_INFINITY){const e=n-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let r=0;r<t.length;)if(t[r].end<=e)t.shift();else{if(!(t[r].start<e))break;t[r].start=e,r++}})),this.fragmentTracker.removeFragmentsInRange(r,e,ct)}}onFragBuffered(e,t){var r;this.loadedmetadata||t.frag.type!==ot||null!=(r=this.media)&&r.buffered.length&&(this.loadedmetadata=!0)}onError(e,t){const r=t.frag;(null==r?void 0:r.type)===ct&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Dr&&(this.state=Cr))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){ei(this.levels,t)?this.levels=t.map((e=>new Rt(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Rt(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ct),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var r;const{details:n,id:i}=t,{currentTrackId:s,levels:a}=this;if(!a.length)return;const o=a[s];if(i>=a.length||i!==s||!o)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(n.live||null!=(r=o.details)&&r.live){const e=this.mainDetails;if(n.deltaUpdateFailed||!e)return;const t=e.fragments[0];o.details?(l=this.alignPlaylists(n,o.details),0===l&&t&&(l=t.start,Mt(n,l))):n.hasProgramDateTime&&e.hasProgramDateTime?(Ar(n,e),l=n.fragments[0].start):t&&(l=t.start,Mt(n,l))}if(o.details=n,this.levelLastLoaded=i,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(o.details,l),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===Cr){Gt(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,n=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){const e=performance.now();
1this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch((e=>{throw i.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((r=>{const n=performance.now();i.trigger(m.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:e,tdecrypt:n}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=Cr}))}}doTick(){if(this.media){if(this.state===Cr){const{currentTrackId:e,levels:t}=this,r=t[e];if(!t.length||!r||!r.details)return;const{config:n}=this,i=this.getLoadPosition(),s=br.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),{end:a,len:o}=s,l=this.getFwdBufferInfo(this.media,ot),c=r.details;if(o>this.getMaxBufferLength(null==l?void 0:l.len)+c.levelTargetDuration)return;const d=c.fragments,u=d.length,h=c.edge;let f=null;const p=this.fragPrevious;if(a<h){const e=n.maxFragLookUpTolerance,t=a>h-e?0:e;f=Gt(p,d,Math.max(d[0].start,a),t),!f&&p&&p.start<d[0].start&&(f=d[0])}else f=d[u-1];if(!f)return;if(f=this.mapToInitFragWhenRequired(f),"initSegment"!==f.sn){const e=d[f.sn-c.startSN-1];e&&e.cc===f.cc&&this.fragmentTracker.getState(e)===sr&&(f=e)}this.fragmentTracker.getState(f)===sr&&this.loadFragment(f,r,a)}}else this.state=Cr}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,r){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,r))}get mediaBufferTimeRanges(){return new ri(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends er{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;
vendor: 1,598 bytes, line 1
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);
1ni(this.media.textTracks).forEach((e=>{mt(e)})),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,details:n}=t,{trackId:i}=this,s=this.tracksInGroup[i];if(!s)return void this.warn(`Invalid subtitle track id ${r}`);const a=s.details;s.details=t.details,this.log(`subtitle track ${r} loaded [${n.startSN}-${n.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.textGroupIds)return;const r=t.textGroupIds[t.urlId],n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==r){const e=this.tracks.filter((e=>!r||e.groupId===r));this.tracksInGroup=e;const t=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=r||null;const i={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${r}" group-id`),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,i),-1!==t&&this.setSubtitleTrack(t,n)}else this.shouldReloadPlaylist(n)&&this.setSubtitleTrack(this.trackId,n)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if((!this.selectDefaultTrack||n.default)&&(!e||e===n.name))return n.id}return-1}onError(e,t){!t.fatal&&t.context&&t.context.type===at&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1;const t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(m.SUBTITLE_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(e){const{media:t,trackId:r}=this;if(!t)return;const n=ni(t.textTracks),i=n.filter((e=>e.groupId===this.groupId));if(-1===e)[].slice.call(n).forEach((e=>{e.mode="disabled"}));else{const e=i[r];e&&(e.mode="disabled")}const s=i[e];s&&(s.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var r;const n=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(-1===e||null!=(r=n[e])&&r.details)||e<-1||e>=n.length)return;this.clearTimer();const i=n[e];if(this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:"")),this.trackId=e,i){const{id:e,groupId:r="",name:n,type:s,url:a}=i;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:e,groupId:r,name:n,type:s,url:a});const o=this.switchParams(i.url,null==t?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=ni(this.media.textTracks);for(let r=0;r<t.length;r++)if("hidden"===t[r].mode)e=r;else if("showing"===t[r].mode){e=r;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},timelineController:class{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new ki(this,"textTrack1"),t=new ki(this,"textTrack2"),r=new ki(this,"textTrack3"),n=new ki(this,"textTrack4");this.cea608Parser1=new Ti(1,e,t),this.cea608Parser2=new Ti(3,r,n)}
1e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,r,n,i){let s=!1;for(let d=i.length;d--;){const e=i[d],n=(a=e[0],o=e[1],l=t,c=r,Math.min(o,c)-Math.max(a,l));if(n>=0&&(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],r),s=!0,n/(r-t)>.5))return}var a,o,l,c;if(s||i.push([t,r]),this.config.renderTextTracksNatively){const i=this.captionsTracks[e];this.Cues.newCue(i,t,r,n)}else{const i=this.Cues.newCue(null,t,r,n);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i}){const{unparsedVttFrags:s}=this;"main"===r&&(this.initPTS[t.cc]={baseTime:n,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach((e=>{this.onFragLoaded(m.FRAG_LOADED,e)})))}getExistingTrack(e){const{media:t}=this;if(t)for(let r=0;r<t.textTracks.length;r++){const n=t.textTracks[r];if(n[e])return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:n}=this,{label:i,languageCode:s}=t[e],a=this.getExistingTrack(e);if(a)r[e]=a,mt(r[e]),ft(r[e],n);else{const t=this.createTextTrack("captions",i,s);t&&(t[e]=!0,r[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,r){const n=this.media;if(n)return n.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach((t=>{mt(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let r=0;r<t.length;r++)mt(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],n=r.some((e=>e.textCodec===Vi));if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(ei(this.tracks,r))return void(this.tracks=r);if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const e=this.media?this.media.textTracks:null;this.tracks.forEach(((t,r)=>{let n;if(e&&r<e.length){let r=null;for(let n=0;n<e.length;n++)if(Ji(e[n],t)){r=e[n];break}r&&(n=r)}if(n)mt(n);else{const e=this._captionsOrSubtitlesFromCharacteristics(t);n=this.createTextTrack(e,t.name,t.lang),n&&(n.mode="disabled")}n&&(n.groupId=t.groupId,this.textTracks.push(n))}))}else if(this.tracks.length){const e=this.tracks.map((e=>
1({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),r=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&r)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const r=`textTrack${t[1]}`,n=this.captionsProperties[r];n&&(n.label=e.name,e.lang&&(n.languageCode=e.lang),n.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:r,cea608Parser2:n,lastSn:i,lastPartIndex:s}=this;if(this.enabled&&r&&n&&t.frag.type===ot){var a,o;const e=t.frag.sn,l=null!=(a=null==t||null==(o=t.part)?void 0:o.index)?a:-1;e===i+1||e===i&&l===s+1||(r.reset(),n.reset()),this.lastSn=e,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:r,payload:n}=t;if(r.type===ct)if(n.byteLength){const e=r.decryptdata,i="stats"in t;if(null==e||!e.encrypted||i){const e=this.tracks[r.level],i=this.vttCCs;i[r.cc]||(i[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),e&&e.textCodec===Vi?this._parseIMSC1(r,n):this._parseVTTs(t)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;Wi(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),r.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{w.log(`Failed to parse IMSC1: ${t}`),r.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:r,payload:n}=e,{initPTS:i,unparsedVttFrags:s}=this,a=i.length-1;if(!i[r.cc]&&-1===a)return void s.push(e);const o=this.hls;$i(null!=(t=r.initSegment)&&t.data?ke(r.initSegment.data,new Uint8Array(n)):n,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,(e=>{this._appendCues(e,r.level),o.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})}),(t=>{const i="Missing initPTS for VTT MPEGTS"===t.message;i?s.push(e):this._fallbackToIMSC1(r,n),w.log(`Failed to parse VTT cue: ${t}`),i&&a>r.cc||o.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})}))}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||Wi(t,this.initPTS[e.cc],(()=>{r.textCodec=Vi,this._parseIMSC1(e,t)}),(()=>{r.textCodec="wvtt"}))}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach((e=>pt(r,e)))}else{const n=this.tracks[t];if(!n)return;const i=n.default?"default":"subtitles"+t;r.trigger(m.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===ct&&this.onFragLoaded(m.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:r,cea608Parser2:n}=this;if(!this.enabled||!r||!n)return;const{frag:i,samples:s}=t;if(i.type!==ot||"NONE"!==this.closedCaptionsForLevel(i))for(let a=0;a<s.length;a++){const e=s[a].bytes;if(e){const t=this.extractCea608Data(e);r.addData(s[a].pts,t[0]),n.addData(s[a].pts,t[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:n,type:i}){const{media:s}=this;if(s&&!(s.currentTime<r)){if(!i||"video"===i){const{captionsTracks:e}=this;Object.keys(e).forEach((n=>gt(e[n],t,r)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==n){const{textTracks:e}=this;Object.keys(e).forEach((r=>gt(e[r],t,n)))}}}extractCea608Data(e){const t=[[],[]],r=31&e[0];let n=2;for(let i=0;i<r;i++){const r=e[n++],i=127&e[n++],s=127&e[n++];if(0===i&&0===s)continue;if(0!==(4&r)){const e=3&r;0!==e&&1!==e||(t[e].push(i),t[e].push(s))}}return t}},audioStreamController:class extends Hr{constructor(e,t,r){super(e,t,r,"[audio-stream-controller]",lt),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;
1e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i}){if("main"===r){const e=t.cc;this.initPTS[t.cc]={baseTime:n,timescale:i},this.log(`InitPTS for cc: ${e} found from main: ${n}`),this.videoTrackCC=e,this.state===$r&&this.tick()}}startLoad(e){if(!this.levels)return this.startPosition=e,void(this.state=Dr);const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),t>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=Cr):(this.loadedmetadata=!1,this.state=Nr),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Cr:this.doTickIdle();break;case Nr:{var e;const{levels:t,trackId:r}=this,n=null==t||null==(e=t[r])?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=$r}break}case Mr:{var t;const e=performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Cr);break}case $r:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:n,complete:i}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Or;const e={frag:t,part:r,payload:n.flush(),networkDetails:null};this._handleFragmentLoadProgress(e),i&&super._handleFragmentLoadComplete(e)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),r=br.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole);qt(r.end,this.config.maxFragLookUpTolerance,t)<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${r.end} is needed`),this.clearWaitingFragment())}}else this.state=Cr}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Cr)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:r,trackId:n}=this,i=e.config;if(null==t||!t[n])return;if(!r&&(this.startFragRequested||!i.startFragPrefetch))return;const s=t[n],a=s.details;if(!a||a.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(a))return void(this.state=Nr);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,I,lt));const l=this.getFwdBufferInfo(o,lt);if(null===l)return;const{bufferedTrack:c,switchingTrack:d}=this;if(!d&&this._streamEnded(l,a))return e.trigger(m.BUFFER_EOS,{type:"audio"}),void(this.state=Br);const u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,ot),h=l.len,f=this.getMaxBufferLength(null==u?void 0:u.len);if(h>=f&&!d)return;const p=a.fragments[0].start;let g=l.end;if(d&&r){const e=this.getLoadPosition();c&&d.attrs!==c.attrs&&(g=e),a.PTSKnown&&e<p&&(l.end>p||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=p+.05)}let v=this.getNextFragment(g,a),y=!1;if(v&&this.isLoopLoading(v,g)&&(y=!!v.gap,v=this.getNextFragmentLoopLoading(v,a,l,ot,f)),!v)return void(this.bufferFlushed=!0);const b=u&&v.start>u.end+a.targetduration;if(b||(null==u||!u.len)&&l.len){const e=this.getAppendedFrag(v.start,ot);if(null===e)return;if(y||(y=!!e.gap||!!b&&0===u.len),b&&!y||y&&l.nextStart&&l.nextStart<e.end)return}this.loadFragment(v,s,g)}getMaxBufferLength(e){const t=super.getMaxBufferLength();
1return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Rt(e)))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.switchingTrack=t,this.state=Cr):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Dr),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(m.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var r;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:n}=this,{details:i,id:s}=t;if(!n)return void this.warn(`Audio tracks were reset while loading level ${s}`);this.log(`Track ${s} loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const a=n[s];let o=0;if(i.live||null!=(r=a.details)&&r.live){const e=this.mainDetails;if(i.fragments[0]||(i.deltaUpdateFailed=!0),i.deltaUpdateFailed||!e)return;!a.details&&i.hasProgramDateTime&&e.hasProgramDateTime?(Ar(i,e),o=i.fragments[0].start):o=this.alignPlaylists(i,a.details)}a.details=i,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(a.details,o),this.state!==Nr||this.waitForCdnTuneIn(i)||(this.state=Cr),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:n,payload:i}=e,{config:s,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(r.start);const d=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let u=this.transmuxer;u||(u=this.transmuxer=new zn(this.hls,lt,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[r.cc],f=null==(t=r.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=n?n.index:-1,s=-1!==t,a=new Er(r.level,r.sn,r.stats.chunkCount,i.byteLength,t,s);u.push(i,f,d,"",r,n,c.totalduration,e,a,h)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:r,part:n,cache:new Jn,complete:!1};e.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=$r}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r.type===lt)if(this.fragContextChanged(r))this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==r.sn){this.fragPrevious=r;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,u({},e)))}this.fragBufferedComplete(r,n)}else if(!this.loadedmetadata&&r.type===ot){const e=this.videoBuffer||this.media;if(e){br.getBuffered(e).length&&(this.loadedmetadata=!0)}}}onError(e,t){var r;if(t.fatal)this.state=jr;else switch(t.details){case v.FRAG_GAP:case v.FRAG_PARSING_ERROR:case v.FRAG_DECRYPT_ERROR:case v.FRAG_LOAD_ERROR:case v.FRAG_LOAD_TIMEOUT:case v.KEY_LOAD_ERROR:case v.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(lt,t);break;case v.AUDIO_TRACK_LOAD_ERROR:case v.AUDIO_TRACK_LOAD_TIMEOUT:case v.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Nr||(null==(r=t.context)?void 0:r.type)!==st||(this.state=Cr);break;case v.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case v.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushed(e,{type:t}){t===I&&(this.bufferFlushed=!0,this.state===Br&&(this.state=Cr))}_handleTransmuxComplete(e){var t;const r="audio",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{details:d}=c,{audio:u,text:h,id3:p,initSegment:g}=i;if(!this.fragContextChanged(o)&&d){if(this.state=Fr,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const e=o.initSegment||o;this._bufferInitSegment(g.tracks,e,s),n.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:g.tracks})}if(u){const{startPTS:e,endPTS:t,startDTS:r,endDTS:n}=u;l&&(l.elementaryStreams[I]={startPTS:e,endPTS:t,startDTS:r,endDTS:n}),o.setElementaryStreamInfo(I,e,t,r,n),this.bufferFragmentData(u,o,l,s)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=f({id:r,frag:o,details:d},p);n.trigger(m.FRAG_PARSING_METADATA,e)}if(h){const e=f({id:r,frag:o,details:d},h);n.trigger(m.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,r){if(this.state!==Fr)return;e.video&&delete e.video;const n=e.audio;if(!n)return;n.levelCodec=n.codec,n.id="audio",this.log(`Init audio buffer, container:${n.container}, codecs[parsed]=[${n.codec}]`),this.hls.trigger(m.BUFFER_CODECS,e);const i=n.initSegment;if(null!=i&&i.byteLength){const e={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:i};this.hls.trigger(m.BUFFER_APPENDING,e)}this.tick()}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);var i;(this.fragCurrent=e,this.switchingTrack||n===sr||n===or)?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(i=t.details)&&i.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=$r):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:r,bufferedTrack:n}=this,i=null==n?void 0:n.attrs,s=e.attrs;r&&i&&(i.CHANNELS!==s.CHANNELS||i.NAME!==s.NAME||i.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(m.AUDIO_TRACK_SWITCHED,u({},e))}},audioTrackController:class extends er{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];
1if(!s||s.groupId!==n)return void this.warn(`Track with id:${r} and group:${n} not found in active group ${s.groupId}`);const a=s.details;s.details=t.details,this.log(`audio-track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.audioGroupIds)return;const r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r||null;const e=this.tracks.filter((e=>!r||e.groupId===r));this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),this.tracksInGroup=e;const t={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group:${r}`),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,t),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&t.context.type===st&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn("Invalid id passed to audio-track controller");this.clearTimer();const r=this.currentTrack;t[this.trackId];const n=t[e],{groupId:i,name:s}=n;if(this.log(`Switching to audio-track ${e} "${s}" lang:${n.lang} group:${i}`),this.trackId=e,this.currentTrack=n,this.selectDefaultTrack=!1,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,u({},n)),n.details&&!n.details.live)return;const a=this.switchParams(n.url,null==r?void 0:r.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{const t=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(m.ERROR,{type:g.MEDIA_ERROR,details:v.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if(!this.selectDefaultTrack||n.default){if(!e||void 0!==e.attrs["STABLE-RENDITION-ID"]&&e.attrs["STABLE-RENDITION-ID"]===n.attrs["STABLE-RENDITION-ID"])return n.id;if(e.name===n.name&&e.lang===n.lang)return n.id}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}this.log(`loading audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(m.AUDIO_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}},emeController:rs,cmcdController:ds,contentSteeringController:class{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=w.log.bind(w,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.ERROR,this.onError,this))}startLoad(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){const e=Math.max(1e3*this.timeToLoad-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:r}=t;null!==r&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((null==r?void 0:r.action)===zt&&r.flags===Qt){let e=this.pathwayPriority;const t=this.pathwayId;this.penalizedPathways[t]||(this.penalizedPathways[t]=performance.now()),!e&&this.levels&&(e=this.levels.reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])),e&&e.length>1&&(this.updatePathwayPriority(e),r.resolved=this.pathwayId!==t)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this.pathwayPriority=e;const r=this.penalizedPathways,n=performance.now();Object.keys(r).forEach((e=>{n-r[e]>3e5&&delete r[e]}));for(let i=0;i<e.length;i++){const n=e[i];if(r[n])continue;if(n===this.pathwayId)return;const s=this.hls.nextLoadLevel,a=this.hls.levels[s];if(t=this.getLevelsForPathway(n),t.length>0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,this.hls.trigger(m.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[s];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=s);break}}}clonePathways(e){const t=this.levels;if(!t)return;const r={},n={};e.forEach((e=>{const{ID:i,"BASE-ID":s,"URI-REPLACEMENT":a}=e;if(t.some((e=>e.pathwayId===i)))return;const o=this.getLevelsForPathway(s).map((e=>{const t=f({},e);t.details=void 0,t.url=hs(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a);const s=new A(e.attrs);s["PATHWAY-ID"]=i;const o=s.AUDIO&&`${s.AUDIO}_clone_${i}`,l=s.SUBTITLES&&`${s.SUBTITLES}_clone_${i}`;
1o&&(r[s.AUDIO]=o,s.AUDIO=o),l&&(n[s.SUBTITLES]=l,s.SUBTITLES=l),t.attrs=s;const c=new Rt(t);return nr(c,"audio",o),nr(c,"text",l),c}));t.push(...o),us(this.audioTracks,r,a,i),us(this.subtitleTracks,n,a,i)}))}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;let n;this.loader&&this.loader.destroy(),this.loader=new r(t);try{n=new self.URL(e)}catch(c){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==n.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+e)}const i={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,a=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,r,i)=>{this.log(`Loaded steering manifest: "${n}"`);const s=e.data;if(1!==s.VERSION)return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=s;if(a)try{this.uri=new self.URL(a,n).href}catch(c){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||r.url),o&&this.clonePathways(o),l&&this.updatePathwayPriority(l)},onError:(e,t,r,n)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let i=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,i);else{const e=this.loader;if("function"===typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(i=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,r)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(i,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((()=>{this.loadSteeringManifest(e)}),t)}}});function ws(e){return e&&"object"===typeof e?Array.isArray(e)?e.map(ws):Object.keys(e).reduce(((t,r)=>(t[r]=ws(e[r]),t)),{}):e}function Ts(e){const t=e.loader;if(t!==gs&&t!==ps)w.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=gs,e.progressive=!0,e.enableSoftwareAES=!0,w.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Ss{static get version(){return"1.4.8"}static isSupported(){return function(){const e=je();if(!e)return!1;const t=Gr(),r=e&&"function"===typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"===typeof t.prototype.appendBuffer&&"function"===typeof t.prototype.remove;return!!r&&!!n}()}static get Events(){return m}static get ErrorTypes(){return g}static get ErrorDetails(){return v}static get DefaultConfig(){return Ss.defaultConfig?Ss.defaultConfig:_s}static set DefaultConfig(e){Ss.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Wn,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,function(e,t){if(self.console&&!0===e||"object"===typeof e){_(e,"debug","log","info","warn","error");try{E.log(`Debug logs enabled for "${t}" in hls.js version 1.4.8`)}catch(r){E=b}}else E=b}(e.debug||!1,"Hls instance");const t=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=ws(e),n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const i=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[i],a=[];
1n.forEach((n=>{const o=`${e}Loading${n}`,l=t[o];if(void 0!==l&&s){a.push(o);const e=r[i].default;switch(t[i]={default:e},n){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),a.length&&w.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${i}": ${JSON.stringify(t[i])}`)})),u(u({},r),t)}(Ss.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&Ts(t);const{abrController:r,bufferController:n,capLevelController:i,errorController:s,fpsController:a}=t,o=new s(this),l=this.abrController=new r(this),c=this.bufferController=new n(this),d=this.capLevelController=new i(this),h=new a(this),f=new ht(this),p=new Tt(this),g=t.contentSteeringController,v=g?new g(this):null,y=this.levelController=new rr(this,v),T=new cr(this),S=new vr(this.config),A=this.streamController=new Xn(this,T,S);d.setStreamController(A),h.setStreamController(A);const k=[f,y,A];v&&k.splice(1,0,v),this.networkControllers=k;const x=[l,c,d,h,p,T];this.audioTrackController=this.createController(t.audioTrackController,k);const L=t.audioStreamController;L&&k.push(new L(this,T,S)),this.subtitleTrackController=this.createController(t.subtitleTrackController,k);const I=t.subtitleStreamController;I&&k.push(new I(this,T,S)),this.createController(t.timelineController,x),S.emeController=this.emeController=this.createController(t.emeController,x),this.cmcdController=this.createController(t.cmcdController,x),this.latencyController=this.createController(St,x),this.coreComponents=x,k.push(o);const R=o.onErrorOut;"function"===typeof R&&this.on(m.ERROR,R,o)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,n){this._emitter.off(e,t,r,n)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){w.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(m.ERROR,{type:g.OTHER_ERROR,details:v.INTERNAL_EXCEPTION,fatal:!1,event:e,error:r})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){w.log("destroy"),this.trigger(m.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){w.log("attachMedia"),this._media=e,this.trigger(m.MEDIA_ATTA
1CHING,{media:e})}detachMedia(){w.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,r=this.url,n=this.url=c.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});w.log(`loadSource:${n}`),t&&r&&(r!==n||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(m.MANIFEST_LOADING,{url:e})}startLoad(e=-1){w.log(`startLoad(${e})`),this.networkControllers.forEach((t=>{t.startLoad(e)}))}stopLoad(){w.log("stopLoad"),this.networkControllers.forEach((e=>{e.stopLoad()}))}swapAudioCodec(){w.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){w.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){w.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){w.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){w.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){w.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){w.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(w.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){At.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const r=e.length;for(let n=0;n<r;n++)if(e[n].maxBitrate>=t)return n;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let n;if(n=-1===t&&e&&e.length?e.length-1:t,r)for(let i=n;i--;){const t=e[i].attrs["HDCP-LEVEL"];if(t&&t<=r)return i}return n}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Ss.defaultConfig=void 0;
1var As=Ss,ks=class extends Error{constructor(e,t=ks.MEDIA_ERR_CUSTOM,r,n){var i;super(e),this.name="MediaError",this.code=t,this.context=n,this.fatal=null!=r?r:t>=ks.MEDIA_ERR_NETWORK&&t<=ks.MEDIA_ERR_ENCRYPTED,this.message||(this.message=null!=(i=ks.defaultMessages[this.code])?i:"")}},xs=ks;xs.MEDIA_ERR_ABORTED=1,xs.MEDIA_ERR_NETWORK=2,xs.MEDIA_ERR_DECODE=3,xs.MEDIA_ERR_SRC_NOT_SUPPORTED=4,xs.MEDIA_ERR_ENCRYPTED=5,xs.MEDIA_ERR_CUSTOM=100,xs.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."};var Ls=(e,t)=>!(e=>null==e)(t)&&e in t,Is={ANY:"any",MUTED:"muted"},Rs={ON_DEMAND:"on-demand",LIVE:"live",UNKNOWN:"unknown"},Ds={MSE:"mse",NATIVE:"native"},Cs={HEADER:"header",QUERY:"query",NONE:"none"},Ps=(Object.values(Cs),{M3U8:"application/vnd.apple.mpegurl",MP4:"video/mp4"}),Os={HLS:Ps.M3U8},Ms=(Object.keys(Os),[...Object.values(Ps),"hls","HLS"]),Ns=(e,t,r,n,i=e)=>{i.addEventListener(t,r,n),e.addEventListener("teardown",(()=>{i.removeEventListener(t,r)}),{once:!0})};var Fs=e=>{let t=e.type;if(t){let e=t.toUpperCase();return Ls(e,Os)?Os[e]:t}let{src:r}=e;return r?js(r):""},Us=e=>"VOD"===e?Rs.ON_DEMAND:Rs.LIVE,Bs=e=>"EVENT"===e?Number.POSITIVE_INFINITY:"VOD"===e?Number.NaN:0,js=e=>{let t="";try{t=new URL(e).pathname}catch{console.error("invalid url")}let r=t.lastIndexOf(".");if(r<0)return"";let n=t.slice(r+1).toUpperCase();return Ls(n,Ps)?Ps[n]:""},$s=Object.values(Is),Vs=e=>"boolean"==typeof e||"string"==typeof e&&$s.includes(e),Hs=(e,t)=>{if(!t)return;let r=e.muted,n=()=>e.muted=r;switch(t){case Is.ANY:e.play().catch((()=>{e.muted=!0,e.play().catch(n)}));break;case Is.MUTED:e.muted=!0,e.play().catch(n);break;default:e.play().catch((()=>{}))}};function Gs(e,t,r,n,i){let s=document.createElement("track");return s.kind=t,s.label=r,n&&(s.srclang=n),i&&(s.id=i),s.track.mode=["subtitles","captions"].includes(t)?"disabled":"hidden",s.setAttribute("data-removeondestroy",""),e.append(s),s.track}var qs="cuepoints",Ws=Object.freeze({label:qs}),Ks=(e,{label:t=qs}=Ws)=>{var r;return null==(r=Array.from(e.querySelectorAll("track")).find((e=>e.track.label===t&&"metadata"===e.track.kind)))?void 0:r.track};var zs=e=>({time:e.startTime,value:JSON.parse(e.text)});async function Ys(e,t=Ws){return new Promise((r=>{Ns(e,"loadstart",(async()=>{let n=await async function(e,t,r=Ws){let n=Ks(e,r);if(!n){let{label:t=qs}=r;n=Gs(e,"metadata",t),n.mode="hidden",await new Promise((e=>setTimeout((()=>e(void 0)),0)))}return"hidden"!==n.mode&&(n.mode="hidden"),[...t].sort((({time:e},{time:t})=>t-e)).forEach((({time:t,value:r})=>{var i,s;let a=Array.prototype.findIndex.call(null==n?void 0:n.cues,(e=>e.startTime>=t)),o=null==(i=null==n?void 0:n.cues)?void 0:i[a],l=o?o.startTime:Number.isFinite(e.duration)?e.duration:Number.MAX_SAFE_INTEGER,c=null==(s=null==n?void 0:n.cues)?void 0:s[a-1];c&&(c.endTime=t);let d=new VTTCue(t,l,JSON.stringify(null!=r?r:null));n.addCue(d)})),n}(e,[],t);Ns(e,"cuechange",(()=>{let t=function(e,t={label:qs}){var r,n;let i=Ks(e,t);if(null==(r=null==i?void 0:i.activeCues)||!r.length)return;let{currentTime:s}=e,a=Array.prototype.find.call(null!=(n=i.activeCues)?n:[],(({startTime:e,endTime:t})=>e<=s&&t>s));return zs(a)}(e);if(t){let r=new CustomEvent("cuepointchange",{composed:!0,bubbles:!0,detail:t});e.dispatchEvent(r)}}),{},n),r(n)}))}))}var Xs,Qs,Zs,Js,ea=async(e,t)=>{if(t===Ps.MP4)return{streamType:Rs.ON_DEMAND,targetLiveWindow:Number.NaN,liveEdgeStartOffset:void 0};if(t===Ps.M3U8){let t=await(async e=>fetch(e).then((e=>e.text())).then((e=>{let t=e.split("\n").find(((e,t,r)=>t&&r[t-1].startsWith("#EXT-X-STREAM-INF")));return fetch(t).then((e=>e.text())).then((e=>e.split("\n")))})))(e);return(e=>{var t,r;let n,i=null==(r=(null!=(t=e.find((e=>e.startsWith("#EXT-X-PLAYLIST-TYPE"))))?t:"").split(":")[1])?void 0:r.trim(),s=Us(i),a=Bs(i);if(s===Rs.LIVE){let t=e.find((e=>e.startsWith("#EXT-X-PART-INF")));
1n=t?2*+t.split(":")[1].split("=")[1]:3*+e.find((e=>e.startsWith("#EXT-X-TARGETDURATION"))).split(":")[1]}return{streamType:s,targetLiveWindow:a,liveEdgeStartOffset:n}})(t)}return console.error(`Media type ${t} is an unrecognized or unsupported type for src ${e}.`),{streamType:void 0,targetLiveWindow:void 0,liveEdgeStartOffset:void 0}},ta=async(e,t,r=Fs({src:e}))=>{var n,i,s;let{streamType:a,targetLiveWindow:o,liveEdgeStartOffset:l}=await ea(e,r);(null!=(n=ia.get(t))?n:{}).liveEdgeStartOffset=l,(null!=(i=ia.get(t))?i:{}).targetLiveWindow=o,t.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0})),(null!=(s=ia.get(t))?s:{}).streamType=a,t.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}))},ra=(e,t,r)=>{var n,i,s,a,o,l,c,d;let{streamType:u,targetLiveWindow:h,liveEdgeStartOffset:f,lowLatency:p}=(e=>{var t;let r,n=e.type,i=Us(n),s=Bs(n),a=!(null==(t=e.partList)||!t.length);return i===Rs.LIVE&&(r=a?2*e.partTarget:3*e.targetduration),{streamType:i,targetLiveWindow:s,liveEdgeStartOffset:r,lowLatency:a}})(e);if(u===Rs.LIVE){p?(r.config.backBufferLength=null!=(n=r.userConfig.backBufferLength)?n:4,r.config.maxFragLookUpTolerance=null!=(i=r.userConfig.maxFragLookUpTolerance)?i:.001,r.config.abrBandWidthUpFactor=null!=(s=r.userConfig.abrBandWidthUpFactor)?s:r.config.abrBandWidthFactor):r.config.backBufferLength=null!=(a=r.userConfig.backBufferLength)?a:8;let e=Object.freeze({get length(){return t.seekable.length},start:e=>t.seekable.start(e),end(e){var n;return e>this.length?t.seekable.end(e):null!=(n=r.liveSyncPosition)?n:t.seekable.end(e)}});(null!=(o=ia.get(t))?o:{}).seekable=e}(null!=(l=ia.get(t))?l:{}).liveEdgeStartOffset=f,(null!=(c=ia.get(t))?c:{}).targetLiveWindow=h,t.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0})),(null!=(d=ia.get(t))?d:{}).streamType=u,t.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}))},na=-1!==(null!=(Qs=null==(Xs=null==globalThis?void 0:globalThis.navigator)?void 0:Xs.userAgent)?Qs:"").toLowerCase().indexOf("android"),ia=new WeakMap,sa="mux.com",aa=null==(Js=(Zs=As).isSupported)?void 0:Js.call(Zs),oa=na,la=s.utils.generateUUID,ca=(e,{domain:t=sa,maxResolution:r=""}={})=>{if(!e)return;let[n,i=""]=(e=>{let t=e.indexOf("?");return t<0?[e]:[e.slice(0,t),e.slice(t)]})(e),s=new URL(`https://stream.${t}/${n}.m3u8${i}`);return r&&s.searchParams.set("max_resolution",r),s.toString()},da=e=>{var t,r,n;return null!=(t=null==e?void 0:e.metadata)&&t.video_id?e.metadata.video_id:ya(e)&&null!=(n=null!=(r=(e=>{if(!e)return;let[t]=e.split("?");return t||void 0})(e.playbackId))?r:(e=>{if(!e||!e.startsWith("https://stream."))return;let[t]=new URL(e).pathname.slice(1).split(".m3u8");return t||void 0})(e.src))?n:e.src},ua=(e,t,r=.001)=>e>t||((e,t,r=.001)=>Math.abs(e-t)<=r)(e,t,r),ha=(e,t)=>e.loop||t?e.ended:e.ended||(e=>e.paused&&ua(e.currentTime,e.duration))(e),fa=(e,t,r)=>{pa(t,r);let{metadata:n={}}=e,{view_session_id:i=la()}=n,s=da(e);n.view_session_id=i,n.video_id=s,e.metadata=n,ia.set(t,{});let a=ga(e,t);ba(e,t,a),Ea(e,t,a),Ys(t);let o=(({autoplay:e},t,r)=>{let n=!1,i=!1,s=Vs(e)?e:!!e,a=()=>{n||Ns(t,"playing",(()=>{n=!0}),{once:!0})};if(a(),Ns(t,"loadstart",(()=>{n=!1,a(),Hs(t,s)}),{once:!0}),Ns(t,"loadstart",(()=>{r||(i=!Number.isFinite(t.duration)),Hs(t,s)}),{once:!0}),r&&r.once(As.Events.LEVEL_LOADED,((e,t)=>{var r;i=null!=(r=t.details.live)&&r})),!s){let e=()=>{!i||(null!=r&&r.liveSyncPosition?t.currentTime=r.liveSyncPosition:Number.isFinite(t.seekable.end(0))&&(t.currentTime=t.seekable.end(0)))};r&&Ns(t,"play",(()=>{"metadata"===t.preload?r.once(As.Events.LEVEL_UPDATED,e):e()}),{once:!0})}return e=>{n||(s=Vs(e)?e:!!e,Hs(t,s))}})(e,t,a),l=(({preload:e,src:t},r,n)=>{let i=e=>{null!=e&&["","none","metadata","auto"].includes(e)?r.setAttribute("preload",e):r.removeAttribute("preload")};if(!n)return i(e),i;let s=!1,a=!1,o=n.config.maxBufferLength,l=n.config.maxBufferSize,c=e=>{i(e);let t=null!=e?e:r.preload;a||"none"===t||("metadata"===t?(n.config.maxBufferLength=1,n.config.maxBufferSize=1):(n.config.maxBufferLength=o,n.config.maxBufferSize=l),d())},d=()=>{!s&&t&&(s=!0,n.loadSource(t))};return Ns(r,"play",(()=>{a=!0,n.config.maxBufferLength=o,n.config.maxBufferSize=l,d()}),{once:!0}),c(e),c})(e,t,a);return{engine:a,setAutoplay:o,setPreload:l}},pa=(e,t)=>{let r=null==t?void 0:t.engine;
1r&&(r.detachMedia(),r.destroy()),(null==e?void 0:e.mux)&&!e.mux.deleted&&(e.mux.destroy(),delete e.mux),e&&(e.removeAttribute("src"),e.load(),e.removeEventListener("error",wa),e.removeEventListener("error",Ta),e.removeEventListener("durationchange",_a),ia.delete(e),e.dispatchEvent(new Event("teardown")))};function ma(e,t){var r;let n=Fs(e);if(n!==Ps.M3U8)return!0;let i=!n||null==(r=t.canPlayType(n))||r,{preferPlayback:s}=e;return i&&(s===Ds.NATIVE||!(aa&&(s===Ds.MSE||oa)))}var ga=(e,t)=>{let{debug:r,streamType:n,startTime:i=-1,metadata:s,preferCmcd:a}=e,o=Fs(e)===Ps.M3U8,l=ma(e,t);if(o&&!l&&aa){let e={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0},t=va(n),o=a!==Cs.NONE?{useHeaders:a===Cs.HEADER,sessionId:null==s?void 0:s.view_session_id,contentId:null==s?void 0:s.video_id}:void 0;return new As({debug:r,startPosition:i,cmcd:o,...e,...t})}},va=e=>e===Rs.LIVE?{backBufferLength:8}:{},ya=({playbackId:e,src:t,customDomain:r})=>{if(e)return!0;if("string"!=typeof t)return!1;let n=null==window?void 0:window.location.href,i=new URL(t,n).hostname.toLocaleLowerCase();return i.includes(sa)||!!r&&i.includes(r.toLocaleLowerCase())},ba=(e,t,r)=>{var n;let{envKey:i}=e,a=ya(e);if(i||a){let{playerInitTime:a,playerSoftwareName:o,playerSoftwareVersion:l,beaconCollectionDomain:c,debug:d,disableCookies:u}=e,h={...e.metadata,video_title:(null==(n=null==e?void 0:e.metadata)?void 0:n.video_title)||void 0},f=t=>"string"!=typeof t.player_error_code&&("function"==typeof e.errorTranslator?e.errorTranslator(t):t);s.monitor(t,{debug:d,beaconCollectionDomain:c,hlsjs:r,Hls:r?As:void 0,automaticErrorTracking:!1,errorTranslator:f,disableCookies:u,data:{...i?{env_key:i}:{},player_software_name:o,player_software:o,player_software_version:l,player_init_time:a,...h}})}},Ea=(e,t,r)=>{var n;let i=ma(e,t),{src:s}=e;if(t&&i){let r=Fs(e);"string"==typeof s?("none"===t.preload?Ns(t,"loadstart",(()=>ta(s,t,r))):ta(s,t,r),t.setAttribute("src",s),e.startTime&&((null!=(n=ia.get(t))?n:{}).startTime=e.startTime,t.addEventListener("durationchange",_a,{once:!0}))):t.removeAttribute("src"),t.addEventListener("error",wa),t.addEventListener("error",Ta),t.addEventListener("emptied",(()=>{t.querySelectorAll("track[data-removeondestroy]").forEach((e=>{e.remove()}))}),{once:!0});let i=()=>{t.ended||!ha(t)||t.dispatchEvent(new Event("ended"))};Ns(t,"pause",i),Ns(t,"seeked",i),Ns(t,"play",(()=>{t.ended||!ua(t.currentTime,t.duration)||(t.currentTime=t.seekable.start(0))}))}else r&&s?(r.once(As.Events.LEVEL_LOADED,((e,n)=>{ra(n.details,t,r)})),r.on(As.Events.ERROR,((e,r)=>{let n={[As.ErrorTypes.NETWORK_ERROR]:xs.MEDIA_ERR_NETWORK,[As.ErrorTypes.MEDIA_ERROR]:xs.MEDIA_ERR_DECODE},i=new xs("",n[r.type]);i.fatal=r.fatal,i.data=r,t.dispatchEvent(new CustomEvent("error",{detail:i}))}
1)),t.addEventListener("error",Ta),function(e,t){t.on(As.Events.NON_NATIVE_TEXT_TRACKS_FOUND,((r,{tracks:n})=>{n.forEach((r=>{var n;let i=null!=(n=r.subtitleTrack)?n:r.closedCaptions,s=t.subtitleTracks.findIndex((({lang:e,name:t,type:n})=>e==(null==i?void 0:i.lang)&&t===r.label&&n.toLowerCase()===r.kind));Gs(e,r.kind,r.label,null==i?void 0:i.lang,`${r.kind}${s}`)}))}));let r=()=>{var r;if(!t.subtitleTracks.length)return;let n=Array.from(e.textTracks).find((e=>e.id&&"showing"===e.mode&&["subtitles","captions"].includes(e.kind))),i=`${null==(r=t.subtitleTracks[t.subtitleTrack])?void 0:r.type.toLowerCase()}${t.subtitleTrack}`;if(n&&(t.subtitleTrack<0||(null==n?void 0:n.id)!==i)){let e=t.subtitleTracks.findIndex((({lang:e,name:t,type:r})=>e==n.language&&t===n.label&&r.toLowerCase()===n.kind));t.subtitleTrack=e}n&&(null==n?void 0:n.id)===i&&n.cues&&Array.from(n.cues).forEach((e=>{n.addCue(e)}))};e.textTracks.addEventListener("change",r),t.on(As.Events.CUES_PARSED,((t,{track:r,cues:n})=>{let i=e.textTracks.getTrackById(r);if(!i)return;let s="disabled"===i.mode;s&&(i.mode="hidden"),n.forEach((e=>{var t;null!=(t=i.cues)&&t.getCueById(e.id)||i.addCue(e)})),s&&(i.mode="disabled")})),t.once(As.Events.DESTROYING,(()=>{e.textTracks.removeEventListener("change",r),e.querySelectorAll("track[data-removeondestroy]").forEach((e=>{e.remove()}))}));let n=()=>
1{Array.from(e.textTracks).forEach((t=>{var r,n;if(!["subtitles","caption"].includes(t.kind)&&"thumbnails"===t.label){if(null==(r=t.cues)||!r.length){let t=e.querySelector('track[label="thumbnails"]'),r=null!=(n=null==t?void 0:t.getAttribute("src"))?n:"";null==t||t.removeAttribute("src"),setTimeout((()=>{null==t||t.setAttribute("src",r)}),0)}"hidden"!==t.mode&&(t.mode="hidden")}}))};t.once(As.Events.MANIFEST_LOADED,n),t.once(As.Events.MEDIA_ATTACHED,n)}(t,r),r.attachMedia(t)):console.error("It looks like the video you're trying to play will not work on this system! If possible, try upgrading to the newest versions of your browser or software.")};function _a(e){var t;let r=e.target,n=null==(t=ia.get(r))?void 0:t.startTime;if(n&&function(e,t,r){t&&r>t&&(r=t);for(let n=0;n<e.length;n++)if(e.start(n)<=r&&e.end(n)>=r)return!0;return!1}(r.seekable,r.duration,n)){let e="auto"===r.preload;e&&(r.preload="none"),r.currentTime=n,e&&(r.preload="auto")}}async function wa(e){if(!e.isTrusted)return;e.stopImmediatePropagation();let t=e.target;if(null==t||!t.error)return;let{message:r,code:n}=t.error,i=new xs(r,n);if(t.src&&(n!==xs.MEDIA_ERR_DECODE||void 0!==n))try{let{status:e}=await fetch(t.src);i.data={response:{code:e}}}catch{}t.dispatchEvent(new CustomEvent("error",{detail:i}))}function Ta(e){var t,r;if(!(e instanceof CustomEvent)||!(e.detail instanceof xs))return;let n=e.target,i=e.detail;!i||!i.fatal||((null!=(t=ia.get(n))?t:{}).error=i,null==(r=n.mux)||r.emit("error",{player_error_code:i.code,player_error_message:i.message,player_error_context:i.context}))}var Sa=(()=>{try{return"0.7.15"}catch{}return"UNKNOWN"})(),Aa=n.forwardRef(((e,t)=>{var r;let{playbackId:i,src:a,children:o,autoPlay:l,preload:c,...d}=e,[u]=(0,n.useState)(s.utils.now()),[h,f]=(0,n.useState)(null!=(r=ca(i))?r:a),p=(0,n.useRef)(void 0),m=((...e)=>{let t=(0,n.useRef)(null);return(0,n.useEffect)((()=>{e.forEach((e=>{!e||("function"==typeof e?e(t.current):e.current=t.current)}))}),[e]),t})((0,n.useRef)(null),t);return(0,n.useEffect)((()=>{var e;f(null!=(e=ca(i))?e:a)}),[a,i]),(0,n.useEffect)((()=>{let t={...e,src:h,playerInitTime:u,playerSoftwareName:"mux-video-react",playerSoftwareVersion:Sa,autoplay:l},r=m.current;return r&&(p.current=fa(t,r,p.current)),()=>{pa(r,p.current),r=void 0,p.current=void 0}}),[h]),(0,n.useEffect)((()=>{var e;null==(e=p.current)||e.setAutoplay(l)}),[l]),(0,n.useEffect)((()=>{var e;null==(e=p.current)||e.setPreload(c)}),[c]),n.createElement("video",{ref:m,...d},o)}));Aa.propTypes={envKey:i.string,debug:i.bool,disableCookies:i.bool,metadata:i.any,beaconCollectionDomain:i.string,playbackId:i.string,playerInitTime:i.number,preferPlayback:i.oneOf(Object.values(Ds)),type:i.oneOf(Ms),streamType:i.oneOf(Object.values(Rs)),startTime:i.number};var ka=Aa},17206:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return"span"===e._type&&"text"in e&&"string"===typeof e.text&&("undefined"===typeof e.marks||Array.isArray(e.marks)&&e.marks.every((e=>"string"===typeof e)))}function o(e){return"string"===typeof e._type&&"@"!==e._type[0]&&(!("markDefs"in e)||Array.isArray(e.markDefs)&&e.markDefs.every((e=>"string"===typeof e._key)))&&"children"in e&&Array.isArray(e.children)&&e.children.every((e=>
1"object"===typeof e&&"_type"in e))}function l(e){return o(e)&&"listItem"in e&&"string"===typeof e.listItem&&("undefined"===typeof e.level||"number"===typeof e.level)}function c(e){return"@list"===e._type}function d(e){return"@span"===e._type}function u(e){return"@text"===e._type}r.d(t,{HW:function(){return o},Ic:function(){return p},Ii:function(){return l},Kv:function(){return _},RR:function(){return T},m9:function(){return u},pY:function(){return w},qS:function(){return c},tX:function(){return d},zL:function(){return m}});const h=["strong","em","code","underline","strike-through"];function f(e,t,r){if(!a(e)||!e.marks)return[];if(!e.marks.length)return[];const n=e.marks.slice(),i={};return n.forEach((e=>{i[e]=1;for(let n=t+1;n<r.length;n++){const t=r[n];if(!(t&&a(t)&&Array.isArray(t.marks)&&-1!==t.marks.indexOf(e)))break;i[e]++}})),n.sort(((e,t)=>function(e,t,r){const n=e[t],i=e[r];if(n!==i)return i-n;const s=h.indexOf(t),a=h.indexOf(r);if(s!==a)return s-a;return t.localeCompare(r)}(i,e,t)))}function p(e){var t;const{children:r,markDefs:n=[]}=e;if(!r||!r.length)return[];const i=r.map(f),s={_type:"@span",children:[],markType:"<unknown>"};let o=[s];for(let l=0;l<r.length;l++){const e=r[l];if(!e)continue;const s=i[l]||[];let c=1;if(o.length>1)for(;c<o.length;c++){const e=(null==(t=o[c])?void 0:t.markKey)||"",r=s.indexOf(e);if(-1===r)break;s.splice(r,1)}o=o.slice(0,c);let d=o[o.length-1];if(d){for(const t of s){const r=n.find((e=>e._key===t)),i=r?r._type:t,s={_type:"@span",_key:e._key,children:[],markDef:r,markType:i,markKey:t};d.children.push(s),o.push(s),d=s}if(a(e)){const t=e.text.split("\n");for(let e=t.length;e-- >1;)t.splice(e,0,"\n");d.children=d.children.concat(t.map((e=>({_type:"@text",text:e}))))}else d.children=d.children.concat(e)}}return s.children}function m(e,t){const r=[];let n;for(let s=0;s<e.length;s++){const a=e[s];if(a)if(l(a))if(n)if(g(a,n))n.children.push(a);else if((a.level||1)>n.level){const e=v(a,s,t);if("html"===t){const t=n.children[n.children.length-1],r=i(i({},t),{},{children:[...t.children,e]});n.children[n.children.length-1]=r}else n.children.push(e);n=e}else if((a.level||1)<n.level){const e=r[r.length-1],i=e&&y(e,a);if(i){n=i,n.children.push(a);continue}n=v(a,s,t),r.push(n)}else if(a.listItem===n.listItem)console.warn("Unknown state encountered for block",a),r.push(a);else{const e=r[r.length-1],i=e&&y(e,{level:a.level||1});if(i&&i.listItem===a.listItem){n=i,n.children.push(a);continue}n=v(a,s,t),r.push(n)}else n=v(a,s,t),r.push(n);else r.push(a),n=void 0}return r}function g(e,t){return(e.level||1)===t.level&&e.listItem===t.listItem}function v(e,t,r){return{_type:"@list",_key:"".concat(e._key||"".concat(t),"-parent"),mode:r,level:e.level||1,listItem:e.listItem,children:[e]}}function y(e,t){const r=t.level||1,n=t.listItem||"normal",i="string"===typeof t.listItem;if(c(e)&&(e.level||1)===r&&i&&(e.listItem||"normal")===n)return e;if(!("children"in e))return;const s=e.children[e.children.length-1];return s&&!a(s)?y(s,t):void 0}const b=/^\s/,E=/^\s/;function _(e){const t=Array.isArray(e)?e:[e];let r="";return t.forEach(((e,n)=>{if(!o(e))return;let i=!1;e.children.forEach((e=>{a(e)?(r+=i&&r&&!E.test(r)&&!b.test(e.text)?" ":"",r+=e.text,i=!1):i=!0})),n!==t.length-1&&(r+="\n\n")})),r}function w(e){let t="";return e.children.forEach((e=>{u(e)?t+=e.text:d(e)&&(t+=w(e))})),t}const T="html"},2445:function(e,t,r){"use strict";function n(e){return"object"===typeof e&&"function"===typeof e.start}r.d(t,{H:function(){return n}})},48488:function(e,t,r){"use strict";r.d(t,{C:function(){return n}});const n=e=>Array.isArray(e)},51526:function(e,t,r){"use strict";r.d(t,{M:function(){return g}});var n=r(67294),i=r(66405),s=r(58868);function a(){const e=(0,n.useRef)(!1);return(0,s.L)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}var o=r(240),l=r(96681);class c extends n.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function d({children:e,isPresent:t}){const r=(0,n.useId)(),i=(0,n.useRef)(null),s=(0,n.useRef)({width:0,height:0,top:0,left:0});return(0,n.useInsertionEffect)((()=>{const{width:e,height:n,top:a,left:o}=s.current;if(t||!i.current||!e||!n)return;i.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${n}px !important;\n top: ${a}px !important;\n left: ${o}px !important;\n }\n `),()=>{document.head.removeChild(l)}}),[t]),n.createElement(c,{isPresent:t,childRef:i,sizeRef:s},n.cloneElement(e,{ref:i}))}const u=({children:e,initial:t,isPresent:r,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:c})=>{const u=(0,l.h)(h),f=(0,n.useId)(),p=(0,n.useMemo)((()=>({id:f,initial:t,isPresent:r,custom:s,onExitComplete:e=>{u.set(e,!0);for(const t of u.values())if(!t)return;i&&i()},register:e=>(u.set(e,!1),()=>u.delete(e))})),a?void 0:[r]);return(0,n.useMemo)((()=>{u.forEach(((e,t)=>u.set(t,!1)))}),[r]),n.useEffect((()=>{!r&&!u.size&&i&&i()}),[r]),"popLayout"===c&&(e=n.createElement(d,{isPresent:r},e)),n.createElement(o.O.Provider,{value:p},e)};function h(){return new Map}var f=r(25364);var p=r(45487);const m=e=>e.key||"";const g=({children:e,custom:t,initial:r=!0,onExitComplete:o,exitBeforeEnter:l,presenceAffectsLayout:c=!0,mode:d="sync"})=>{(0,p.k)(!l,"Replace exitBeforeEnter with mode='wait'");const h=(0,n.useContext)(f.p).forceRender||function(){const e=a(),[t,r]=(0,n.use
1State)(0),s=(0,n.useCallback)((()=>{e.current&&r(t+1)}),[t]);return[(0,n.useCallback)((()=>i.Wi.postRender(s)),[s]),t]}()[0],g=a(),v=function(e){const t=[];return n.Children.forEach(e,(e=>{(0,n.isValidElement)(e)&&t.push(e)})),t}(e);let y=v;const b=(0,n.useRef)(new Map).current,E=(0,n.useRef)(y),_=(0,n.useRef)(new Map).current,w=(0,n.useRef)(!0);var T;if((0,s.L)((()=>{w.current=!1,function(e,t){e.forEach((e=>{const r=m(e);t.set(r,e)}))}(v,_),E.current=y})),T=()=>{w.current=!0,_.clear(),b.clear()},(0,n.useEffect)((()=>()=>T()),[]),w.current)return n.createElement(n.Fragment,null,y.map((e=>n.createElement(u,{key:m(e),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:c,mode:d},e))));y=[...y];const S=E.current.map(m),A=v.map(m),k=S.length;for(let n=0;n<k;n++){const e=S[n];-1!==A.indexOf(e)||b.has(e)||b.set(e,void 0)}return"wait"===d&&b.size&&(y=[]),b.forEach(((e,r)=>{if(-1!==A.indexOf(r))return;const i=_.get(r);if(!i)return;const s=S.indexOf(r);let a=e;if(!a){const e=()=>{_.delete(r),b.delete(r);const e=E.current.findIndex((e=>e.key===r));if(E.current.splice(e,1),!b.size){if(E.current=v,!1===g.current)return;h(),o&&o()}};a=n.createElement(u,{key:m(i),isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:c,mode:d},i),b.set(r,a)}y.splice(s,0,a)})),y=y.map((e=>{const t=e.key;return b.has(t)?e:n.createElement(u,{key:m(e),isPresent:!0,presenceAffectsLayout:c,mode:d},e)})),n.createElement(n.Fragment,null,b.size?y:y.map((e=>(0,n.cloneElement)(e))))}},25364:function(e,t,r){"use strict";r.d(t,{p:function(){return n}});const n=(0,r(67294).createContext)({})},70398:function(e,t,r){"use strict";r.d(t,{u:function(){return n}});const n=(0,r(67294).createContext)({strict:!1})},24451:function(e,t,r){"use strict";r.d(t,{v:function(){return n}});const n=(0,r(67294).createContext)({})},240:function(e,t,r){"use strict";r.d(t,{O:function(){return n}});const n=(0,r(67294).createContext)(null)},41705:function(e,t,r){"use strict";r.d(t,{g:function(){return n}});const n=(0,r(67294).createContext)({})},37367:function(e,t,r){"use strict";r.d(t,{frameData:function(){return n}});const n={delta:0,timestamp:0,isProcessing:!1}},66405:function(e,t,r){"use strict";r.d(t,{Pn:function(){return u},Wi:function(){return d},S6:function(){return o}});var n=r(37367);let i=!0,s=!1;const a=["read","update","preRender","render","postRender"],o=a.reduce(((e,t)=>(e[t]=function(e){let t=[],r=[],n=0,i=!1,s=!1;const a=new WeakSet,o={schedule:(e,s=!1,o=!1)=>{const l=o&&i,c=l?t:r;return s&&a.add(e),-1===c.indexOf(e)&&(c.push(e),l&&i&&(n=t.length)),e},cancel:e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1),a.delete(e)},process:l=>{if(i)s=!0;else{if(i=!0,[t,r]=[r,t],r.length=0,n=t.length,n)for(let r=0;r<n;r++){const n=t[r];n(l),a.has(n)&&(o.schedule(n),e())}i=!1,s&&(s=!1,o.process(l))}}};return o}((()=>s=!0)),e)),{}),l=e=>o[e].process(n.frameData),c=e=>{s=!1,n.frameData.delta=i?1e3/60:Math.max(Math.min(e-n.frameData.timestamp,40),1),n.frameData.timestamp=e,n.frameData.isProcessing=!0,a.forEach(l),n.frameData.isProcessing=!1,s&&(i=!1,requestAnimationFrame(c))},d=a.reduce(((e,t)=>{const r=o[t];return e[t]=(e,t=!1,a=!1)=>(s||(s=!0,i=!0,n.frameData.isProcessing||requestAnimationFrame(c)),r.schedule(e,t,a)),e}),{});function u(e){a.forEach((t=>o[t].cancel(e)))}},9442:function(e,t,r){"use strict";r.d(t,{A:function(){return i}});const n={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},i={};for(const s in n)i[s]={isEnabled:e=>n[s].some((t=>!!e[t]))}},81879:function(e,t,r){"use strict";r.d(t,{K:function(){return i}});var n=r(9442);function i(e){for(const t in e)n.A[t]={...n.A[t],...e[t]}}},56816:function(e,t,r){"use strict";r.d(t,{j:function(){return s}});var n=r(64561),i=r(94714);function s(e,{layout:t,layoutId:r}){return i.G.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!n.P[e]||"opacity"===e)}},64561:function(e,t,r){"use strict";r.d(t,{B:function(){return i},P:function(){return n}});const n={};function i(e){Object.assign(n,e)}},31150:function(e,t,r){"use strict";r.d(t,{D:function(){return _}});var n=r(67294);const i=(0,n.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var s=r(24451),a=r(240),o=r(58868),l=r(70398);var c=r(51804);var d=r(97732),u=r(7504);function h(e){const{initial:t,animate:r}=function(e,t){if((0,u.G)(e)){const{initial:t,animate:r}=e;return{initial:!1===t||(0,d.$)(t)?t:void 0,animate:(0,d.$)(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,n.useContext)(s.v));return(0,n.useMemo)((()=>({initial:t,animate:r})),[f(t),f(r)])}function f(e){return Array.isArray(e)?e.join(" "):e}var p=r(81879),m=r(11741),g=r(25364),v=r(41705);const y=Symbol.for("motionComponentSymbol");function b({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:d,Component:u}){e&&(0,p.K)(e);const f=(0,n.forwardRef)((function(f,p){let g;const y={...(0,n.useContext)(i),...f,layoutId:E(f)},{isStatic:b}=y,_=h(f),w=d(f,b);if(!b&&m.j){_.visualElement=function(e,t,r,c){const{visualElement:d}=(0,n.useContext)(s.v),u=(0,n.useContext)(l.u),h=(0,n.useContext)(a.O),f=(0,n.useContext)(i).reducedMotion,p=(0,n.useRef)();c=c||u.renderer,!p.current&&c&&(p.current=c(e,{visualState:t,parent:d,props:r,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:f}));const m=p.current;return(0,n.useInsertionEffect)((()=>{m&&m.update(r,h)})),(0,o.L)((()=>{m&&m.render()})),(0,n.useEffect)((()=>{m&&m.updateFeatures()})),(window.HandoffAppearAnimations?o.L:n.useEffect)((()=>{m&&m.animationState&&m.animationState.animateChanges()})),m}(u,w,y,t);const r=(0,n.useContext)(v.g),c=(0,n.useContext)(l.u).strict;_.visualElement&&(g=_.visualElement.loadFeatures(y,c,e,r))}return n.createElement(s.v.Provider,{value:_},g&&_.visualElement?n.createElement(g,{visualElement:_.visualElement,...y}):null,r(u,f,function(e,t,r){return(0,n.useCallback)((n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"===typeof r?r(n):(0,c.I)(r)&&(r.current=n))}),[t])}(w,_.visualElement,p),w,b,_.visualElement))}));return f[y]=u,f}function E({layoutId:e}){const t=(0,n.useContext)(g.p).id;return t&&void 0!==e?t+"-"+e:e}function _(e){function t(t,r={}){return b(e(t,r))}if("undefined"===typeof Proxy)return t;const r=new Map;return new Proxy(t,{get:(e,n)=>(r.has(n)||r.set(n,t(n)),r.get(n))})}},93193:function(e,t,r){"use strict";r.d(t,{D:function(){return n}});const n=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},4007:function(e,t,r){"use strict";r.d(t,{w:function(){return O}});var n=r(62627),i=r(67294),s=r(56816),a=r(40406),o=r(38057);const l=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function c(e,t,r){for(const n in t)(0,a.i)(t[n])||(0,s.j)(n,r)||(e[n]=t[n])}function d(e,t,r){const n={};return c(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t,r){return(0,i.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return(0,o.r)(n,t,{enableHardwareAcceleration:!r},e),Object.assign({},n.vars,n.style)}),[t])}(e,t,r)),e.transformValues?e.transformValues(n):n}function u(e,t,r){const n={},i=d(e,t,r);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTa
1p||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const h=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function f(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||h.has(e)}let p=e=>!f(e);try{(m=require("@emotion/is-prop-valid").default)&&(p=e=>e.startsWith("on")?!f(e):m(e))}catch(M){}var m;var g=r(85415);const v=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});var y=r(79854);function b(e,t,r,n){const s=(0,i.useMemo)((()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return(0,g.i)(r,t,{enableHardwareAcceleration:!1},(0,y.a)(n),e.transformTemplate),{...r.attrs,style:{...r.style}}}),[t]);if(e.style){const t={};c(t,e.style,e),s.style={...t,...s.style}}return s}function E(e=!1){return(t,r,s,{latestValues:o},l)=>{const c=((0,n.q)(t)?b:u)(r,o,l,t),d=function(e,t,r){const n={};for(const i in e)"values"===i&&"object"===typeof e.values||(p(i)||!0===r&&f(i)||!t&&!f(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}(r,"string"===typeof t,e),h={...d,...c,ref:s},{children:m}=r,g=(0,i.useMemo)((()=>(0,a.i)(m)?m.get():m),[m]);return(0,i.createElement)(t,{...h,children:g})}}var _=r(68504),w=r(16832),T=r(2445),S=r(240),A=r(79432),k=r(96681),x=r(16399),L=r(24451),I=r(7504);const R=e=>(t,r)=>{const n=(0,i.useContext)(L.v),s=(0,i.useContext)(S.O),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,s){const a={latestValues:D(n,i,s,e),renderState:t()};return r&&(a.mount=e=>r(n,e,a)),a}(e,t,n,s);return r?a():(0,k.h)(a)};function D(e,t,r,n){const i={},s=n(e,{});for(const h in s)i[h]=(0,x.b)(s[h]);let{initial:a,animate:o}=e;const l=(0,I.G)(e),c=(0,I.M)(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===o&&(o=t.animate));let d=!!r&&!1===r.initial;d=d||!1===a;const u=d?o:a;if(u&&"boolean"!==typeof u&&!(0,T.H)(u)){(Array.isArray(u)?u:[u]).forEach((t=>{const r=(0,A.o)(e,t);if(!r)return;const{transitionEnd:n,transition:s,...a}=r;for(const e in a){let t=a[e];if(Array.isArray(t)){t=t[d?t.length-1:0]}null!==t&&(i[e]=t)}for(const e in n)i[e]=n[e]}))}return i}const C={useVisualState:R({scrapeMotionValuesFromProps:w.U,createRenderState:v,onMount:(e,t,{renderState:r,latestValues:n})=>{try{r.dimensions="function"===typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(i){r.dimensions={x:0,y:0,width:0,height:0}}(0,g.i)(r,n,{enableHardwareAcceleration:!1},(0,y.a)(t.tagName),e.transformTemplate),(0,_.K)(t,r)}})};const P={useVisualState:R({scrapeMotionValuesFromProps:r(50189).U,createRenderState:l})};function O(e,{forwardMotionProps:t=!1},r,i){return{...(0,n.q)(e)?C:P,preloadedFeatures:r,useRender:E(t),createVisualElement:i,Component:e}}},57630:function(e,t,r){"use strict";r.d(t,{Xp:function(){return a},f9:function(){return i},tm:function(){return s}});const n=e=>t=>"string"===typeof t&&t.startsWith(e),i=n("--"),s=n("var(--"),a=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?
1:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g},62627:function(e,t,r){"use strict";r.d(t,{q:function(){return i}});const n=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function i(e){return"string"===typeof e&&!e.includes("-")&&!!(n.indexOf(e)>-1||/[A-Z]/.test(e))}},36173:function(e,t,r){"use strict";r.d(t,{j:function(){return a}});var n=r(61649),i=r(96190);const s={...n.Rx,transform:Math.round},a={borderWidth:i.px,borderTopWidth:i.px,borderRightWidth:i.px,borderBottomWidth:i.px,borderLeftWidth:i.px,borderRadius:i.px,radius:i.px,borderTopLeftRadius:i.px,borderTopRightRadius:i.px,borderBottomRightRadius:i.px,borderBottomLeftRadius:i.px,width:i.px,maxWidth:i.px,height:i.px,maxHeight:i.px,size:i.px,top:i.px,right:i.px,bottom:i.px,left:i.px,padding:i.px,paddingTop:i.px,paddingRight:i.px,paddingBottom:i.px,paddingLeft:i.px,margin:i.px,marginTop:i.px,marginRight:i.px,marginBottom:i.px,marginLeft:i.px,rotate:i.RW,rotateX:i.RW,rotateY:i.RW,rotateZ:i.RW,scale:n.bA,scaleX:n.bA,scaleY:n.bA,scaleZ:n.bA,skew:i.RW,skewX:i.RW,skewY:i.RW,distance:i.px,translateX:i.px,translateY:i.px,translateZ:i.px,x:i.px,y:i.px,z:i.px,perspective:i.px,transformPerspective:i.px,opacity:n.Fq,originX:i.$C,originY:i.$C,originZ:i.px,zIndex:s,fillOpacity:n.Fq,strokeOpacity:n.Fq,numOctaves:s}},38057:function(e,t,r){"use strict";r.d(t,{r:function(){return c}});var n=r(94714);const i={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},s=n._.length;var a=r(57630);const o=(e,t)=>t&&"number"===typeof e?t.transform(e):e;var l=r(36173);function c(e,t,r,c){const{style:d,vars:u,transform:h,transformOrigin:f}=e;let p=!1,m=!1,g=!0;for(const i in t){const e=t[i];if((0,a.f9)(i)){u[i]=e;continue}const r=l.j[i],s=o(e,r);if(n.G.has(i)){if(p=!0,h[i]=s,!g)continue;e!==(r.default||0)&&(g=!1)}else i.startsWith("origin")?(m=!0,f[i]=s):d[i]=s}if(t.transform||(p||c?d.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:r=!0},a,o){let l="";for(let c=0;c<s;c++){const t=n._[c];void 0!==e[t]&&(l+=`${i[t]||t}(${e[t]}) `)}return t&&!e.z&&(l+="translateZ(0)"),l=l.trim(),o?l=o(e,a?"":l):r&&a&&(l="none"),l}(e.transform,r,g,c):d.transform&&(d.transform="none")),m){const{originX:e="50%",originY:t="50%",originZ:r=0}=f;d.transformOrigin=`${e} ${t} ${r}`}}},34242:function(e,t,r){"use strict";function n(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const s in r)e.style.setProperty(s,r[s])}r.d(t,{N:function(){return n}})},50189:function(e,t,r){"use strict";r.d(t,{U:function(){return s}});var n=r(56816),i=r(40406);function s(e,t){const{style:r}=e,s={};for(const a in r)((0,i.i)(r[a])||t.style&&(0,i.i)(t.style[a])||(0,n.j)(a,e))&&(s[a]=r[a]);return s}},94714:function(e,t,r){"use strict";r.d(t,{G:function(){return i},_:function(){return n}});const n=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],i=new Set(n)},85415:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(38057),i=r(96190);function s(e,t,r){return"string"===typeof e?e:i.px.transform(t+r*e)}const a={offset:"stroke-dashoffset",array:"stroke-dasharray"},o={offset:"strokeDashoffset",array:"strokeDasharray"};function l(e,{attrX:t,attrY:r,attrScale:l,originX:c,originY:d,pathLength:u,pathSpacing:h=1,pathOffset:f=0,...p},m,g,v){if((0,n.r)(e,p,m,v),g)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:y,style:b,dimensions:E}=e;y.transform&&(E&&(b.transform=y.transform),delete y.transform),E&&(void 0!==c||void 0!==d||b.transform)&&(b.transformOrigin=function(e,t,r){return`${s(t,e.x,e.width)} ${s(r,e.y,e.height)}`}(E,void 0!==c?c:.5,void 0!==d?d:.5)),void 0!==t&&(y.x=t),void 0!==r&&(y.y=r),void 0!==l&&(y.scale=l),void 0!==u&&function(e,t,r=1,n=0,s=!0){e.pathLength=1;const l=s?a:o;e[l.offset]=i.px.transform(-n);const c=i.px.transform(t),d=i.px.transform(r);e[l.array]=`${c} ${d}`}(y,u,h,f,!1)}},77302:function(e,t,r){"use strict";r.d(t,{s:function(){return n}});const n=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"])},79854:function(e,t,r){"use strict";r.d(t,{a:function(){return n}});const n=e=>"string"===typeof e&&"svg"===e.toLowerCase()},68504:function(e,t,r){"use strict";r.d(t,{K:function(){return a}});var n=r(93193),i=r(34242),s=r(77302);function a(e,t,r,a){(0,i.N)(e,t,void 0,a);for(const i in t.attrs)e.setAttribute(s.s.has(i)?i:(0,n.D)(i),t.attrs[i])}},16832:function(e,t,r){"use strict";r.d(t,{U:function(){return a}});var n=r(40406),i=r(50189),s=r(94714);function a(e,t){const r=(0,i.U)(e,t);for(const i in e)if((0,n.i)(e[i])||(0,n.i)(t[i])){r[-1!==s._.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}},7504:function(e,t,r){"use strict";r.d(t,{G:function(){return a},M:function(){return o}});var n=r(2445),i=r(97732),s=r(22963);function a(e){return(0,n.H)(e.animate)||s.V.some((t=>(0,i.$)(e[t])))}function o(e){return Boolean(a(e)||e.variants)}},97732:function(e,t,r){"use strict";function n(e){return"string"===typeof e||Array.isArray(e)}r.d(t,{$:function(){return n}})},79432:function(e,t,r){"use strict";function n(e,t,r,n={},i={}){return"function"===typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),"string"===typeof t&&(t=e.variants&&e.variants[t]),"function"===typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),t}r.d(t,{o:function(){return n}})},22963:function(e,t,r){"use strict";r.d(t,{V:function(){return i},e:function(){return n}});const n=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],i=["initial",...n]},24169:function(e,t,r){"use strict";r.d(t,{u:function(){return n}});const n=(e,t,r)=>
1Math.min(Math.max(r,e),t)},45487:function(e,t,r){"use strict";r.d(t,{K:function(){return i},k:function(){return s}});var n=r(81662);let i=n.Z,s=n.Z},11741:function(e,t,r){"use strict";r.d(t,{j:function(){return n}});const n="undefined"!==typeof document},51804:function(e,t,r){"use strict";function n(e){return"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}r.d(t,{I:function(){return n}})},81662:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});const n=e=>e},8715:function(e,t,r){"use strict";r.d(t,{Y:function(){return s},p:function(){return i}});var n=r(48488);const i=e=>Boolean(e&&"object"===typeof e&&e.mix&&e.toValue),s=e=>(0,n.C)(e)?e[e.length-1]||0:e},96681:function(e,t,r){"use strict";r.d(t,{h:function(){return i}});var n=r(67294);function i(e){const t=(0,n.useRef)(null);return null===t.current&&(t.current=e()),t.current}},58868:function(e,t,r){"use strict";r.d(t,{L:function(){return i}});var n=r(67294);const i=r(11741).j?n.useLayoutEffect:n.useEffect},61649:function(e,t,r){"use strict";r.d(t,{Fq:function(){return s},Rx:function(){return i},bA:function(){return a}});var n=r(24169);const i={test:e=>"number"===typeof e,parse:parseFloat,transform:e=>e},s={...i,transform:e=>(0,n.u)(0,1,e)},a={...i,default:1}},96190:function(e,t,r){"use strict";r.d(t,{$C:function(){return d},RW:function(){return s},aQ:function(){return a},px:function(){return o},vh:function(){return l},vw:function(){return c}});var n=r(36430);const i=e=>({test:t=>(0,n.HD)(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),s=i("deg"),a=i("%"),o=i("px"),l=i("vh"),c=i("vw"),d={...a,parse:e=>a.parse(e)/100,transform:e=>a.transform(100*e)}},36430:function(e,t,r){"use strict";r.d(t,{HD:function(){return o},KP:function(){return i},Nw:function(){return n},dA:function(){return s},mj:function(){return a}});const n=e=>Math.round(1e5*e)/1e5,i=/(-)?([\d]*\.?[\d])+/g,s=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,a=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function o(e){return"string"===typeof e}},40406:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});const n=e=>Boolean(e&&e.getVelocity)},16399:function(e,t,r){"use strict";r.d(t,{b:function(){return s}});var n=r(8715),i=r(40406);function s(e){const t=(0,i.i)(e)?e.get():e;return(0,n.p)(t)?t.toValue():t}},87536:function(e,t,r){"use strict";r.d(t,{KN:function(){return W},Qr:function(){return q},U2:function(){return m},cI:function(){return Le},t8:function(){return H}});var n=r(67294),i=e=>"checkbox"===e.type,s=e=>e instanceof Date,a=e=>null==e;const o=e=>"object"===typeof e;var l=e=>!a(e)&&!Array.isArray(e)&&o(e)&&!s(e),c=e=>l(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,d=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),u="undefined"!==typeof window&&"undefined"!==typeof window.HTMLElement&&"undefined"!==typeof document;function h(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(u&&(e instanceof Blob||e instanceof FileList)||!r&&!l(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return l(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=h(e[r]));else t=e}return t}var f=e=>Array.isArray(e)?e.filter(Boolean):[],p=e=>void 0===e,m=(e,t,r)=>{if(!t||!l(e))return r;const n=f(t.split(/[,[\].]+?/)).reduce(((e,t)=>a(e)?e:e[t]),e);return p(n)||n===e?p(e[t])?r:e[t]:n};const g="blur",v="focusout",y="change",b="onBlur",E="onChange",_="onSubmit",w="onTouched",T="all",S="max",A="min",k="maxLength",x="minLength",L="pattern",I="required",R="validate",D=n.createContext(null),C=()=>n.useContext(D);var P=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const i=s;return t._proxyFormState[i]!==T&&(t._proxyFormState[i]=!n||T),r&&(r[i]=!0),e[i]}});return i},O=e=>l(e)&&!Object.keys(e).length,M=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return O(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find((e=>t[e]===(!n||T)))},N=e=>Array.isArray(e)?e:[e],F=(e,t,r)=>r&&t?e===t||Array.isArray(e)&&e.some((e=>e&&r&&e===t)):!e||!t||e===t||N(e).some((e=>e&&(e.startsWith(t)||t.startsWith(e))));function U(e){const t=n.useRef(e);t.current=e,n.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}var B=e=>"string"===typeof e,j=(e,t,r,n,i)=>B(e)?(n&&t.watch.add(e),m(r,e,i)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),m(r,e)))):(n&&(t.watchAll=!0),r);var $=e=>/^\w*$/.test(e),V=e=>f(e.replace(/["|']|\]/g,"").split(/\.|\[/));function H(e,t,r){let n=-1;const i=$(t)?[t]:V(t),s=i.length,a=s-1;for(;++n<s;){const t=i[n];let s=r;if(n!==a){const r=e[t];
vendor: 4,423 bytes, line 1
1s=l(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}e[t]=s,e=e[t]}return e}function G(e){const t=C(),{name:r,disabled:i,control:s=t.control,shouldUnregister:a}=e,o=d(s._names.array,r),l=function(e){const t=C(),{control:r=t.control,name:i,defaultValue:s,disabled:a,exact:o}=e||{},l=n.useRef(i);l.current=i,U({disabled:a,subject:r._subjects.values,next:e=>{F(l.current,e.name,o)&&d(h(j(l.current,r._names,e.values||r._formValues,!1,s)))}});const[c,d]=n.useState(r._getWatch(i,s));return n.useEffect((()=>r._removeUnmounted())),c}({control:s,name:r,defaultValue:m(s._formValues,r,m(s._defaultValues,r,e.defaultValue)),exact:!0}),u=function(e){const t=C(),{control:r=t.control,disabled:i,name:s,exact:a}=e||{},[o,l]=n.useState(r._formState),c=n.useRef(!0),d=n.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=n.useRef(s);return u.current=s,U({disabled:i,next:e=>c.current&&F(u.current,e.name,a)&&M(e,d.current,r._updateFormState)&&l({...r._formState,...e}),subject:r._subjects.state}),n.useEffect((()=>(c.current=!0,d.current.isValid&&r._updateValid(!0),()=>{c.current=!1})),[r]),P(o,r,d.current,!1)}({control:s,name:r}),f=n.useRef(s.register(r,{...e.rules,value:l}));return f.current=s.register(r,e.rules),n.useEffect((()=>{const e=s._options.shouldUnregister||a,t=(e,t)=>{const r=m(s._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=h(m(s._options.defaultValues,r));H(s._defaultValues,r,e),p(m(s._formValues,r))&&H(s._formValues,r,e)}return()=>{(o?e&&!s._state.action:e)?s.unregister(r):t(r,!1)}}),[r,s,o,a]),n.useEffect((()=>{s._updateDisabledField({disabled:i,fields:s._fields,name:r})}),[i,r,s]),{field:{name:r,value:l,disabled:i,onChange:n.useCallback((e=>f.current.onChange({target:{value:c(e),name:r},type:y})),[r]),onBlur:n.useCallback((()=>f.current.onBlur({target:{value:m(s._formValues,r),name:r},type:g})),[r,s]),ref:e=>{const t=m(s._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!m(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!m(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!m(u.touchedFields,r)},error:{enumerable:!0,get:()=>m(u.errors,r)}})}}const q=e=>e.render(G(e));var W=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{};const K=(e,t,r)=>{for(const n of r||Object.keys(e)){const r=m(e,n);if(r){const{_f:e,...n}=r;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else l(n)&&K(n,t)}}};var z=e=>({isOnSubmit:!e||e===_,isOnBlur:e===b,isOnChange:e===E,isOnAll:e===T,isOnTouch:e===w}),Y=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),X=(e,t,r)=>{const n=f(m(e,r));return H(n,"root",t[r]),H(e,r,n),e},Q=e=>"boolean"===typeof e,Z=e=>"file"===e.type,J=e=>"function"===typeof e,ee=e=>{if(!u)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},te=e=>B(e),re=e=>"radio"===e.type,ne=e=>e instanceof RegExp;const ie={value:!1,isValid:!1},se={value:!0,isValid:!0};var ae=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!p(e[0].attributes.value)?p(e[0].value)||""===e[0].value?se:{value:e[0].value,isValid:!0}:se:ie}return ie};const oe={isValid:!1,value:null};var le=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),oe):oe;function ce(e,t,r="validate"){if(te(e)||Array.isArray(e)&&e.every(te)||Q(e)&&!e)return{type:r,message:te(e)?e:"",ref:t}}var de=e=>l(e)&&!ne(e)?e:{value:e,message:""},ue=async(e,t,r,n,s)=>{const{ref:o,refs:c,required:d,maxLength:u,minLength:h,min:f,max:g,pattern:v,validate:y,name:b,valueAsNumber:E,mount:_,disabled:w}=e._f,T=m(t,b);if(!_||w)return{};const D=c?c[0]:o,C=e=>{n&&D.reportValidity&&(D.setCustomValidity(Q(e)?"":e||""),D.reportValidity())},P={},M=re(o),N=i(o),F=M||N,U=(E||Z(o))&&p(o.value)&&p(T)||ee(o)&&""===o.value||""===T||Array.isArray(T)&&!T.length,j=W.bind(null,b,r,P),$=(e,t,r,n=k,i=x)=>{const s=e?t:r;P[b]={type:e?n:i,message:s,ref:o,...j(e?n:i,s)}};if(s?!Array.isArray(T)||!T.length:d&&(!F&&(U||a(T))||Q(T)&&!T||N&&
vendor: 2,371 bytes, line 1
1!ae(c).isValid||M&&!le(c).isValid)){const{value:e,message:t}=te(d)?{value:!!d,message:d}:de(d);if(e&&(P[b]={type:I,message:t,ref:D,...j(I,t)},!r))return C(t),P}if(!U&&(!a(f)||!a(g))){let e,t;const n=de(g),i=de(f);if(a(T)||isNaN(T)){const r=o.valueAsDate||new Date(T),s=e=>new Date((new Date).toDateString()+" "+e),a="time"==o.type,l="week"==o.type;B(n.value)&&T&&(e=a?s(T)>s(n.value):l?T>n.value:r>new Date(n.value)),B(i.value)&&T&&(t=a?s(T)<s(i.value):l?T<i.value:r<new Date(i.value))}else{const r=o.valueAsNumber||(T?+T:T);a(n.value)||(e=r>n.value),a(i.value)||(t=r<i.value)}if((e||t)&&($(!!e,n.message,i.message,S,A),!r))return C(P[b].message),P}if((u||h)&&!U&&(B(T)||s&&Array.isArray(T))){const e=de(u),t=de(h),n=!a(e.value)&&T.length>+e.value,i=!a(t.value)&&T.length<+t.value;if((n||i)&&($(n,e.message,t.message),!r))return C(P[b].message),P}if(v&&!U&&B(T)){const{value:e,message:t}=de(v);if(ne(e)&&!T.match(e)&&(P[b]={type:L,message:t,ref:o,...j(L,t)},!r))return C(t),P}if(y)if(J(y)){const e=ce(await y(T,t),D);if(e&&(P[b]={...e,...j(R,e.message)},!r))return C(e.message),P}else if(l(y)){let e={};for(const n in y){if(!O(e)&&!r)break;const i=ce(await y[n](T,t),D,n);i&&(e={...i,...j(n,i.message)},C(i.message),r&&(P[b]=e))}if(!O(e)&&(P[b]={ref:D,...e},!r))return P}return C(!0),P};function he(e,t){const r=Array.isArray(t)?t:$(t)?[t]:V(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=p(e)?n++:e[t[n++]];return e}(e,r),i=r.length-1,s=r[i];return n&&delete n[s],0!==i&&(l(n)&&O(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!p(e[t]))return!1;return!0}(n))&&he(e,r.slice(0,-1)),e}function fe(){let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var pe=e=>a(e)||!o(e);function me(e,t){if(pe(e)||pe(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const r=e[i];if(!n.includes(i))return!1;if("ref"!==i){const e=t[i];if(s(r)&&s(e)||l(r)&&l(e)||Array.isArray(r)&&Array.isArray(e)?!me(r,e):r!==e)return!1}}return!0}var ge=e=>"select-multiple"===e.type,ve=e=>ee(e)&&e.isConnected,ye=e=>{for(const t in e)if(J(e[t]))return!0;return!1};function be(e,t={}){const r=Array.isArray(e);
vendor: 5,560 bytes, line 1
1if(l(e)||r)for(const n in e)Array.isArray(e[n])||l(e[n])&&!ye(e[n])?(t[n]=Array.isArray(e[n])?[]:{},be(e[n],t[n])):a(e[n])||(t[n]=!0);return t}function Ee(e,t,r){const n=Array.isArray(e);if(l(e)||n)for(const i in e)Array.isArray(e[i])||l(e[i])&&!ye(e[i])?p(t)||pe(r[i])?r[i]=Array.isArray(e[i])?be(e[i],[]):{...be(e[i])}:Ee(e[i],a(t)?{}:t[i],r[i]):r[i]=!me(e[i],t[i]);return r}var _e=(e,t)=>Ee(e,t,be(t)),we=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>p(e)?e:t?""===e?NaN:e?+e:e:r&&B(e)?new Date(e):n?n(e):e;function Te(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Z(t)?t.files:re(t)?le(e.refs).value:ge(t)?[...t.selectedOptions].map((({value:e})=>e)):i(t)?ae(e.refs).value:we(p(t.value)?e.ref.value:t.value,e)}var Se=e=>p(e)?e:ne(e)?e.source:l(e)?ne(e.value)?e.value.source:e.value:e;function Ae(e,t,r){const n=m(e,r);if(n||$(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const n=i.join("."),s=m(t,n),a=m(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(a&&a.type)return{name:n,error:a};i.pop()}return{name:r}}const ke={mode:_,reValidateMode:E,shouldFocusError:!0};function xe(e={},t){let r,n={...ke,...e},o={submitCount:0,isDirty:!1,isLoading:J(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},y={},b=(l(n.defaultValues)||l(n.values))&&h(n.defaultValues||n.values)||{},E=n.shouldUnregister?{}:h(b),_={action:!1,mount:!1,watch:!1},w={mount:new Set,unMount:new Set,array:new Set,watch:new Set},S=0;const A={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:fe(),array:fe(),state:fe()},x=e.resetOptions&&e.resetOptions.keepDirtyValues,L=z(n.mode),I=z(n.reValidateMode),R=n.criteriaMode===T,D=async e=>{if(A.isValid||e){const e=n.resolver?O((await U()).errors):await $(y,!0);e!==o.isValid&&k.state.next({isValid:e})}},C=e=>A.isValidating&&k.state.next({isValidating:e}),P=(e,t,r,n)=>{const i=m(y,e);if(i){const s=m(E,e,p(r)?m(b,e):r);p(s)||n&&n.defaultChecked||t?H(E,e,t?s:Te(i._f)):q(e,s),_.mount&&D()}},M=(e,t,r,n,i)=>{let s=!1,a=!1;const l={name:e};if(!r||n){A.isDirty&&(a=o.isDirty,o.isDirty=l.isDirty=V(),s=a!==l.isDirty);const r=me(m(b,e),t);a=m(o.dirtyFields,e),r?he(o.dirtyFields,e):H(o.dirtyFields,e,!0),l.dirtyFields=o.dirtyFields,s=s||A.dirtyFields&&a!==!r}if(r){const t=m(o.touchedFields,e);t||(H(o.touchedFields,e,r),l.touchedFields=o.touchedFields,s=s||A.touchedFields&&t!==r)}return s&&i&&k.state.next(l),s?l:{}},F=(t,n,i,s)=>{const a=m(o.errors,t),l=A.isValid&&Q(n)&&o.isValid!==n;var c;if(e.delayError&&i?(c=()=>((e,t)=>{H(o.errors,e,t),k.state.next({errors:o.errors})})(t,i),r=e=>{clearTimeout(S),S=setTimeout(c,e)},r(e.delayError)):(clearTimeout(S),r=null,i?H(o.errors,t,i):he(o.errors,t)),(i?!me(a,i):a)||!O(s)||l){const e={...s,...l&&Q(n)?{isValid:n}:{},errors:o.errors,name:t};o={...o,...e},k.state.next(e)}C(!1)},U=async e=>n.resolver(E,n.context,((e,t,r,n)=>{const i={};for(const s of e){const e=m(t,s);e&&H(i,s,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}})(e||w.mount,y,n.criteriaMode,n.shouldUseNativeValidation)),$=async(e,t,r={valid:!0})=>{for(const i in e){const s=e[i];if(s){const{_f:e,...i}=s;if(e){const i=w.array.has(e.name),a=await ue(s,E,R,n.shouldUseNativeValidation&&!t,i);if(a[e.name]&&(r.valid=!1,t))break;!t&&(m(a,e.name)?i?X(o.errors,a,e.name):H(o.errors,e.name,a[e.name]):he(o.errors,e.name))}i&&await $(i,t,r)}}return r.valid},V=(e,t)=>(e&&t&&H(E,e,t),!me(se(),b)),G=(e,t,r)=>j(e,w,{..._.mount?E:p(t)?b:B(e)?{[e]:t}:t},r,t),q=(e,t,r={})=>{const n=m(y,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&H(E,e,we(t,r)),s=ee(r.ref)&&a(t)?"":t,ge(r.ref)?[...r.ref.options].forEach((e=>e.selected=s.includes(e.value))):r.refs?i(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find((t=>t===e.value)):s===e.value))):r.refs[0]&&(r.refs[0].checked=!!s):r.refs.forEach((e=>e.checked=e.value===s)):Z(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||k.values.next({name:e,values:{...E}})))}(r.shouldDirty||r.shouldTouch)&&M(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&ie(e)},W=(e,t,r)=>{for(const n in t){const i=t[n],a=`${e}.${n}`,o=m(y,a);!w.array.has(e)&&pe(i)&&(!o||o._f)||s(i)?q(a,i,r):W(a,i,r)}},te=(e,r,n={})=>{const i=m(y,e),s=w.array.has(e),l=h(r);H(E,e,l),s?(k.array.next({name:e,values:{...E}}),(A.isDirty||A.dirtyFields)&&n.shouldDirty&&k.state.next({name:e,dirtyFields:_e(b,E),isDirty:V(e,l)})):!i||i._f||a(l)?q(e,l,n):W(e,l,n),Y(e,w)&&k.state.next({...o}),k.values.next({name:e,values:{...E}}),!_.mount&&t()},ne=async e=>{const t=e.target;let i=t.name,s=!0;const a=m(y,i);if(a){let d,u;const h=t.type?Te(a._f):c(e),f=e.type===g||e.type===v,p=!((l=a._f).mount&&(l.required||l.min||l.max||l.maxLength||l.minLength||l.pattern||l.validate))&&!n.resolver&&!m(o.errors,i)&&!a._f.deps||((e,t,r,n,i)=>!i.isOnAll&&(!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:!(r?n.isOnChange:i.isOnChange)||e))(f,m(o.touchedFields,i),o.isSubmitted,I,L),b=Y(i,w,f);H(E,i,h),f?(a._f.onBlur&&a._f.onBlur(e),r&&r(0)):a._f.onChange&&a._f.onChange(e);const _=M(i,h,f,!1),T=!O(_)||b;if(!f&&k.values.next({name:i,type:e.type,values:{...E}}),p)return A.isValid&&D(),T&&k.state.next({name:i,...b?{}:_});if(!f&&b&&k.state.next({...o}),C(!0),n.resolver){const{errors:e}=await U([i]),t=Ae(o.errors,y,i),r=Ae(e,y,t.name||i);d=r.error,i=r.name,u=O(e)}else d=(await ue(a,E,R,n.shouldUseNativeValidation))[i],s=isNaN(h)||h===m(E,i,h),s&&(d?u=!1:A.isValid&&
vendor: 4,136 bytes, line 1
1(u=await $(y,!0)));s&&(a._f.deps&&ie(a._f.deps),F(i,u,d,_))}var l},ie=async(e,t={})=>{let r,i;const s=N(e);if(C(!0),n.resolver){const t=await(async e=>{const{errors:t}=await U(e);if(e)for(const r of e){const e=m(t,r);e?H(o.errors,r,e):he(o.errors,r)}else o.errors=t;return t})(p(e)?e:s);r=O(t),i=e?!s.some((e=>m(t,e))):r}else e?(i=(await Promise.all(s.map((async e=>{const t=m(y,e);return await $(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||o.isValid)&&D()):i=r=await $(y);return k.state.next({...!B(e)||A.isValid&&r!==o.isValid?{}:{name:e},...n.resolver||!e?{isValid:r}:{},errors:o.errors,isValidating:!1}),t.shouldFocus&&!i&&K(y,(e=>e&&m(o.errors,e)),e?s:w.mount),i},se=e=>{const t={...b,..._.mount?E:{}};return p(e)?t:B(e)?m(t,e):e.map((e=>m(t,e)))},ae=(e,t)=>({invalid:!!m((t||o).errors,e),isDirty:!!m((t||o).dirtyFields,e),isTouched:!!m((t||o).touchedFields,e),error:m((t||o).errors,e)}),oe=(e,t,r)=>{const n=(m(y,e,{_f:{}})._f||{}).ref;H(o.errors,e,{...t,ref:n}),k.state.next({name:e,errors:o.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},le=(e,t={})=>{for(const r of e?N(e):w.mount)w.mount.delete(r),w.array.delete(r),t.keepValue||(he(y,r),he(E,r)),!t.keepError&&he(o.errors,r),!t.keepDirty&&he(o.dirtyFields,r),!t.keepTouched&&he(o.touchedFields,r),!n.shouldUnregister&&!t.keepDefaultValue&&he(b,r);k.values.next({values:{...E}}),k.state.next({...o,...t.keepDirty?{isDirty:V()}:{}}),!t.keepIsValid&&D()},ce=({disabled:e,name:t,field:r,fields:n})=>{if(Q(e)){const i=e?void 0:m(E,t,Te(r?r._f:m(n,t)._f));H(E,t,i),M(t,i,!1,!1,!0)}},de=(e,t={})=>{let r=m(y,e);const s=Q(t.disabled);return H(y,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),w.mount.add(e),r?ce({field:r,disabled:t.disabled,name:e}):P(e,!0,t.value),{...s?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:Se(t.min),max:Se(t.max),minLength:Se(t.minLength),maxLength:Se(t.maxLength),pattern:Se(t.pattern)}:{},name:e,onChange:ne,onBlur:ne,ref:s=>{if(s){de(e,t),r=m(y,e);const n=p(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>re(e)||i(e))(n),o=r._f.refs||[];if(a?o.find((e=>e===n)):n===r._f.ref)return;H(y,e,{_f:{...r._f,...a?{refs:[...o.filter(ve),n,...Array.isArray(m(b,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),P(e,!1,void 0,n)}else r=m(y,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!d(w.array,e)||!_.action)&&w.unMount.add(e)}}},ye=()=>n.shouldFocusError&&K(y,(e=>e&&m(o.errors,e)),w.mount),be=(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let i=h(E);if(k.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await U();o.errors=e,i=t}else await $(y);he(o.errors,"root"),O(o.errors)?(k.state.next({errors:{}}),await e(i,r)):(t&&await t({...o.errors},r),ye(),setTimeout(ye)),k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:O(o.errors),submitCount:o.submitCount+1,errors:o.errors})},Ee=(r,n={})=>{const i=r?h(r):b,s=h(i),a=r&&!O(r)?s:b;if(n.keepDefaultValues||(b=i),!n.keepValues){if(n.keepDirtyValues||x)for(const e of w.mount)m(o.dirtyFields,e)?H(a,e,m(E,e)):te(e,m(a,e));else{if(u&&p(r))for(const e of w.mount){const t=m(y,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(ee(e)){const t=e.closest("form");if(t){t.reset();break}}}}y={}}E=e.shouldUnregister?n.keepDefaultValues?h(b):{}:h(a),k.array.next({values:{...a}}),k.values.next({values:{...a}})}w={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!_.mount&&t(),_.mount=!A.isValid||!!n.keepIsValid,_.watch=!!e.shouldUnregister,k.state.next({submitCount:n.keepSubmitCount?o.submitCount:0,isDirty:n.keepDirty?o.isDirty:!(!n.keepDefaultValues||me(r,b)),isSubmitted:!!n.keepIsSubmitted&&o.isSubmitted,dirtyFields:n.keepDirtyValues?o.dirtyFields:n.keepDefaultValues&&r?_e(b,r):{},touchedFields:n.keepTouched?o.touchedFields:{},errors:n.keepErrors?o.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},xe=(e,t)=>Ee(J(e)?e(E):e,t);return{control:{register:de,unregister:le,getFieldState:ae,handleSubmit:be,setError:oe,_executeSchema:U,_getWatch:G,_getDirty:V,_updateV
vendor: 2,689 bytes, line 1
1alid:D,_removeUnmounted:()=>{for(const e of w.unMount){const t=m(y,e);t&&(t._f.refs?t._f.refs.every((e=>!ve(e))):!ve(t._f.ref))&&le(e)}w.unMount=new Set},_updateFieldArray:(e,t=[],r,n,i=!0,s=!0)=>{if(n&&r){if(_.action=!0,s&&Array.isArray(m(y,e))){const t=r(m(y,e),n.argA,n.argB);i&&H(y,e,t)}if(s&&Array.isArray(m(o.errors,e))){const t=r(m(o.errors,e),n.argA,n.argB);i&&H(o.errors,e,t),((e,t)=>{!f(m(e,t)).length&&he(e,t)})(o.errors,e)}if(A.touchedFields&&s&&Array.isArray(m(o.touchedFields,e))){const t=r(m(o.touchedFields,e),n.argA,n.argB);i&&H(o.touchedFields,e,t)}A.dirtyFields&&(o.dirtyFields=_e(b,E)),k.state.next({name:e,isDirty:V(e,t),dirtyFields:o.dirtyFields,errors:o.errors,isValid:o.isValid})}else H(E,e,t)},_updateDisabledField:ce,_getFieldArray:t=>f(m(_.mount?E:b,t,e.shouldUnregister?m(b,t,[]):[])),_reset:Ee,_resetDefaultValues:()=>J(n.defaultValues)&&n.defaultValues().then((e=>{xe(e,n.resetOptions),k.state.next({isLoading:!1})})),_updateFormState:e=>{o={...o,...e}},_subjects:k,_proxyFormState:A,get _fields(){return y},get _formValues(){return E},get _state(){return _},set _state(e){_=e},get _defaultValues(){return b},get _names(){return w},set _names(e){w=e},get _formState(){return o},set _formState(e){o=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:ie,register:de,handleSubmit:be,watch:(e,t)=>J(e)?k.values.subscribe({next:r=>e(G(void 0,t),r)}):G(e,t,!0),setValue:te,getValues:se,reset:xe,resetField:(e,t={})=>{m(y,e)&&(p(t.defaultValue)?te(e,m(b,e)):(te(e,t.defaultValue),H(b,e,t.defaultValue)),t.keepTouched||he(o.touchedFields,e),t.keepDirty||(he(o.dirtyFields,e),o.isDirty=t.defaultValue?V(e,m(b,e)):V()),t.keepError||(he(o.errors,e),A.isValid&&D()),k.state.next({...o}))},clearErrors:e=>{e&&N(e).forEach((e=>he(o.errors,e))),k.state.next({errors:e?o.errors:{}})},unregister:le,setError:oe,setFocus:(e,t={})=>{const r=m(y,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:ae}}function Le(e={}){const t=n.useRef(),r=n.useRef(),[i,s]=n.useState({isDirty:!1,isValidating:!1,isLoading:J(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:J(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...xe(e,(()=>s((e=>({...e}))))),formState:i});const a=t.current.control;return a._options=e,U({subject:a._subjects.state,next:e=>{M(e,a._proxyFormState,a._updateFormState,!0)&&s({...a._formState})}}),n.useEffect((()=>{e.values&&!me(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()}),[e.values,a]),n.useEffect((()=>
1{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()})),t.current.formState=P(i,a),t.current}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],(function(){return t(6840),t(96885)}));var r=e.O();_N_E=r}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.