@jxstjh/jhvideo
Version:
HTML5 jhvideo base on MPEG2-TS Stream Player
3 lines • 1.15 MB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.jhvideo=e():t.jhvideo=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=37)}([function(t,e,i){"use strict";var n=i(5),r=i.n(n),s=function(){function t(){}return t.e=function(e,i){e&&!t.FORCE_GLOBAL_TAG||(e=t.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(i);t.ENABLE_CALLBACK&&t.emitter.emit("log","error",n),t.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},t.i=function(e,i){e&&!t.FORCE_GLOBAL_TAG||(e=t.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(i);t.ENABLE_CALLBACK&&t.emitter.emit("log","info",n),t.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},t.w=function(e,i){e&&!t.FORCE_GLOBAL_TAG||(e=t.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(i);t.ENABLE_CALLBACK&&t.emitter.emit("log","warn",n),t.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},t.d=function(e,i){e&&!t.FORCE_GLOBAL_TAG||(e=t.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(i);t.ENABLE_CALLBACK&&t.emitter.emit("log","debug",n),t.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},t.v=function(e,i){e&&!t.FORCE_GLOBAL_TAG||(e=t.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(i);t.ENABLE_CALLBACK&&t.emitter.emit("log","verbose",n),t.ENABLE_VERBOSE&&console.log(n)},t}();s.GLOBAL_TAG="mpegts.js",s.FORCE_GLOBAL_TAG=!1,s.ENABLE_ERROR=!0,s.ENABLE_INFO=!0,s.ENABLE_WARN=!0,s.ENABLE_DEBUG=!0,s.ENABLE_VERBOSE=!0,s.ENABLE_CALLBACK=!1,s.emitter=new r.a,e.a=s},function(t,e,i){"use strict";e.a={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint",ESSCRIPTDATA_ARRIVED:"esscriptdata_arrived",ESDATA_ARRIVED:"esdata_arrived",JSON_INFORMATION:"json_information"}},function(t,e,i){"use strict";i.d(e,"c",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return o}));var n=i(3),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},s={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof",STRING_DATA:"StringData",JSON_DATA:"jsonData"},o=function(){function t(t){this._type=t||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null,this._information=null}return t.prototype.destroy=function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null,this._information=null},t.prototype.isWorking=function(){return this._status===r.kConnecting||this._status===r.kBuffering},Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(t){this._onContentLengthKnown=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(t){this._onURLRedirect=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(t){this._onDataArrival=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onError",{get:function(){return this._onError},set:function(t){this._onError=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onComplete",{get:function(){return this._onComplete},set:function(t){this._onComplete=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInformation",{get:function(){return this._information},set:function(t){this._information=t},enumerable:!1,configurable:!0}),t.prototype.open=function(t,e){throw new n.c("Unimplemented abstract function!")},t.prototype.abort=function(){throw new n.c("Unimplemented abstract function!")},t}()},function(t,e,i){"use strict";i.d(e,"d",(function(){return s})),i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return l}));var n,r=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=function(){function t(t){this._message=t}return Object.defineProperty(t.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.name+": "+this.message},t}(),o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),e}(s),a=function(t){function e(e){return t.call(this,e)||this}return r(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),e}(s),l=function(t){function e(e){return t.call(this,e)||this}return r(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),e}(s)},function(t,e,i){"use strict";var n={};!function(){var t=self.navigator.userAgent.toLowerCase(),e=/(edge)\/([\w.]+)/.exec(t)||/(opr)[\/]([\w.]+)/.exec(t)||/(chrome)[ \/]([\w.]+)/.exec(t)||/(iemobile)[\/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(t)||[],i=/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(android)/.exec(t)||/(windows)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||[],r={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",majorVersion:e[4]||e[2]||"0",platform:i[0]||""},s={};if(r.browser){s[r.browser]=!0;var o=r.majorVersion.split(".");s.version={major:parseInt(r.majorVersion,10),string:r.version},o.length>1&&(s.version.minor=parseInt(o[1],10)),o.length>2&&(s.version.build=parseInt(o[2],10))}if(r.platform&&(s[r.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;r.browser="msie",s.msie=!0}if(s.edge){delete s.edge;r.browser="msedge",s.msedge=!0}if(s.opr){r.browser="opera",s.opera=!0}if(s.safari&&s.android){r.browser="android",s.android=!0}for(var a in s.name=r.browser,s.platform=r.platform,n)n.hasOwnProperty(a)&&delete n[a];Object.assign(n,s)}(),e.a=n},function(t,e,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,s),n(i)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}v(t,e,s,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&v(t,"error",e,i)}(t,r,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,i,n){var r,s,o,a;if(c(i),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),o=s[e]),void 0===o)o=s[e]=i,++t._eventsCount;else if("function"==typeof o?o=s[e]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(r=h(t))>0&&o.length>r&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function p(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):g(r,r.length)}function m(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function g(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function v(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(s){n.once&&t.removeEventListener(e,r),i(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)s(l,this,e);else{var c=l.length,h=g(l,c);for(i=0;i<c;++i)s(h[i],this,e)}return!0},a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},a.prototype.removeListener=function(t,e){var i,n,r,s,o;if(c(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,s=i.length-1;s>=0;s--)if(i[s]===e||i[s].listener===e){o=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,s=Object.keys(i);for(n=0;n<s.length;++n)"removeListener"!==(r=s[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,i){"use strict";e.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(t,e,i){"use strict";(function(t){i.d(e,"a",(function(){return z})),i.d(e,"b",(function(){return B}));var n=function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=Object.defineProperty,s=function(t,e,i){return function(t,e,i){e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},o=function(t,e,i){if(!e.has(t))throw TypeError("Cannot "+i)},a=function(t,e,i){return o(t,e,"read from private field"),i?i.call(t):e.get(t)},l=function(t,e,i){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},c=function(t,e,i,n){return o(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i},h=function(t,e,i){return o(t,e,"access private method"),i};typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof t<"u"||typeof self<"u"&&self;function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d={exports:{}};d.exports=function(){var t=6e4,e=36e5,i="millisecond",n="second",r="minute",s="hour",o="day",a="week",l="month",c="quarter",h="year",u="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},g=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},v={s:g,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),r=i%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var n=12*(i.year()-e.year())+(i.month()-e.month()),r=e.clone().add(n,l),s=i-r<0,o=e.clone().add(n+(s?-1:1),l);return+(-(n+(i-r)/(s?r-o:o-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:l,y:h,w:a,d:o,D:u,h:s,m:r,s:n,ms:i,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",_={};_[y]=m;var b="$isDayjsObject",w=function(t){return t instanceof T||!(!t||!t[b])},S=function t(e,i,n){var r;if(!e)return y;if("string"==typeof e){var s=e.toLowerCase();_[s]&&(r=s),i&&(_[s]=i,r=s);var o=e.split("-");if(!r&&o.length>1)return t(o[0])}else{var a=e.name;_[a]=e,r=a}return!n&&r&&(y=r),r||!n&&y},C=function(t,e){if(w(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new T(i)},x=v;x.l=S,x.i=w,x.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var T=function(){function m(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var g=m.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var r=n[2]-1||0,s=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return x},g.isValid=function(){return this.$d.toString()!==d},g.isSame=function(t,e){var i=C(t);return this.startOf(e)<=i&&i<=this.endOf(e)},g.isAfter=function(t,e){return C(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<C(t)},g.$g=function(t,e,i){return x.u(t)?this[e]:this.set(i,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,e){var i=this,c=!!x.u(e)||e,d=x.p(t),f=function(t,e){var n=x.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return c?n:n.endOf(o)},p=function(t,e){return x.w(i.toDate()[t].apply(i.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},m=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case h:return c?f(1,0):f(31,11);case l:return c?f(1,g):f(0,g+1);case a:var _=this.$locale().weekStart||0,b=(m<_?m+7:m)-_;return f(c?v-b:v+(6-b),g);case o:case u:return p(y+"Hours",0);case s:return p(y+"Minutes",1);case r:return p(y+"Seconds",2);case n:return p(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,e){var a,c=x.p(t),d="set"+(this.$u?"UTC":""),f=(a={},a[o]=d+"Date",a[u]=d+"Date",a[l]=d+"Month",a[h]=d+"FullYear",a[s]=d+"Hours",a[r]=d+"Minutes",a[n]=d+"Seconds",a[i]=d+"Milliseconds",a)[c],p=c===o?this.$D+(e-this.$W):e;if(c===l||c===h){var m=this.clone().set(u,1);m.$d[f](p),m.init(),this.$d=m.set(u,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[x.p(t)]()},g.add=function(i,c){var u,d=this;i=Number(i);var f=x.p(c),p=function(t){var e=C(d);return x.w(e.date(e.date()+Math.round(t*i)),d)};if(f===l)return this.set(l,this.$M+i);if(f===h)return this.set(h,this.$y+i);if(f===o)return p(1);if(f===a)return p(7);var m=(u={},u[r]=t,u[s]=e,u[n]=1e3,u)[f]||1,g=this.$d.getTime()+i*m;return x.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=x.z(this),s=this.$H,o=this.$m,a=this.$M,l=i.weekdays,c=i.months,h=i.meridiem,u=function(t,i,r,s){return t&&(t[i]||t(e,n))||r[i].slice(0,s)},f=function(t){return x.s(s%12||12,t,"0")},m=h||function(t,e,i){var n=t<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(p,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return x.s(e.$y,4,"0");case"M":return a+1;case"MM":return x.s(a+1,2,"0");case"MMM":return u(i.monthsShort,a,c,3);case"MMMM":return u(c,a);case"D":return e.$D;case"DD":return x.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return u(i.weekdaysMin,e.$W,l,2);case"ddd":return u(i.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(s);case"HH":return x.s(s,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(s,o,!0);case"A":return m(s,o,!1);case"m":return String(o);case"mm":return x.s(o,2,"0");case"s":return String(e.$s);case"ss":return x.s(e.$s,2,"0");case"SSS":return x.s(e.$ms,3,"0");case"Z":return r}return null}(t)||r.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(i,u,d){var f,p=this,m=x.p(u),g=C(i),v=(g.utcOffset()-this.utcOffset())*t,y=this-g,_=function(){return x.m(p,g)};switch(m){case h:f=_()/12;break;case l:f=_();break;case c:f=_()/3;break;case a:f=(y-v)/6048e5;break;case o:f=(y-v)/864e5;break;case s:f=y/e;break;case r:f=y/t;break;case n:f=y/1e3;break;default:f=y}return d?f:x.a(f)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return _[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),n=S(t,e,!0);return n&&(i.$L=n),i},g.clone=function(){return x.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),E=T.prototype;return C.prototype=E,[["$ms",i],["$s",n],["$m",r],["$H",s],["$W",o],["$M",l],["$y",h],["$D",u]].forEach((function(t){E[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),C.extend=function(t,e){return t.$i||(t(e,T,C),t.$i=!0),C},C.locale=S,C.isDayjs=w,C.unix=function(t){return C(1e3*t)},C.en=_[y],C.Ls=_,C.p={},C}();var f,p,m,g,v,y,_,b,w,S,C,x,T,E,A,k,D,O,P,M,L,I,R=u(d.exports),B=function(t,e){return void 0===e&&(e="MM/DD HH:mm"),R(t).format(e)},j=function(t,e){var i,n=0;return function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];var o=Date.now(),a=o-n;!n||a>=e?(n=o,t.apply(void 0,r)):i||(i=setTimeout((function(){n=o,t.apply(void 0,r),i=null}),e-a))}},F=function(t){var e=t.xCenterPoint,i=t.cfg,n=t.timePerPixel,r=t.timeSpacing,s=t.currentTime,o=t.$canvas,a=t.screenScaleCount,l=t.scaleHeight,c=t.startTime,h=t.drawLine,u=t.drawText,d=t.drawArea,f=i.thresholdsConfig[r];f&&function(t){var f=t.space,p=t.scaleTimeFormat,m=t.bgTimeFormat,g=t.pointerTimeFormat;u({x:o.width-e/10,y:6,text:B(s,m),fontSize:"".concat(o.height-5,"px"),align:"right",baseLine:"top",color:i.bgTextColor});for(var v=c%r,y=v/n,_=0;_<a;_++){var b=_*i.scaleSpacing-y-i.pointerWidth/2,w=c+_*r-v;w%(r*f)!=0?h({x:b,y:l.short}):(h({x:b,y:l.long}),u({x:b,y:o.height-l.long-5,text:B(w,p),baseLine:"bottom"}))}h({x:e-i.pointerWidth/2,y:o.height,width:i.pointerWidth,color:i.pointerColor}),d({startX:e-i.pointerDisplayWidth/2,startY:4,endX:e+i.pointerDisplayWidth/2,endY:4+i.pointerDisplayHeight,bgColor:i.pointerColor}),u({x:e,y:i.pointerDisplayHeight/2+5,text:B(s,g),align:"center",baseLine:"middle"})}({space:f.space,scaleTimeFormat:f.scaleTimeFormat,bgTimeFormat:f.bgTimeFormat,pointerTimeFormat:f.pointerTimeFormat})},N={fill:!0,width:1e3,height:60,bgColor:"rgba(0,0,0,0.5)",textColor:"#ffffff",fontFamily:"Arial",scaleColor:"#ffffff",scaleSpacing:7,areaBgColor:"#ffffff55",pointerColor:"#00aeec",pointerWidth:3,pointerDisplayWidth:100,pointerDisplayHeight:14,fps:60,zoom:3,isDrawScale:!1,timeNumber:600,timeSpacingList:[5e3,1e4,6e4,6e5,36e5],thresholdsConfig:{10:{scaleTimeFormat:"mm:ss:SSS",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss:SSS",space:10},100:{scaleTimeFormat:"mm:ss",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss:SSS",space:10},5e3:{scaleTimeFormat:"mm:ss",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss",space:10},1e4:{scaleTimeFormat:"HH:mm:ss",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss",space:12},6e4:{scaleTimeFormat:"HH:mm",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss",space:10},6e5:{scaleTimeFormat:"HH:mm",bgTimeFormat:"YYYY/MM/DD",pointerTimeFormat:"HH:mm:ss",space:10},36e5:{scaleTimeFormat:"MM/DD HH:mm",bgTimeFormat:"YYYY/MM",pointerTimeFormat:"MM/DD HH:mm",space:12},864e5:{scaleTimeFormat:"MM/DD HH:mm",bgTimeFormat:"YYYY/MM",pointerTimeFormat:"YYYY/MM/DD HH:mm",space:12},6048e5:{scaleTimeFormat:"YYYY/MM/DD",bgTimeFormat:"YYYY",pointerTimeFormat:"YYYY/MM/DD",space:10}}},z=function(){function t(t,e){var i=this;if(l(this,b),l(this,S),l(this,x),l(this,E),l(this,k),l(this,L),s(this,"$canvas"),s(this,"$canvasParent"),s(this,"ctx"),s(this,"cfg"),l(this,f,function(t){return{all:t=t||new Map,on:function(e,i){var n=t.get(e);n?n.push(i):t.set(e,[i])},off:function(e,i){var n=t.get(e);n&&(i?n.splice(n.indexOf(i)>>>0,1):t.set(e,[]))},emit:function(e,i){var n=t.get(e);n&&n.slice().map((function(t){t(i)})),(n=t.get("*"))&&n.slice().map((function(t){t(e,i)}))}}}()),l(this,p,0),l(this,m,void 0),l(this,g,void 0),l(this,v,void 0),l(this,y,!1),l(this,_,null),l(this,O,(function(t){var e=t.x,n=t.y,r=t.width,s=void 0===r?1:r,o=t.color,a=void 0===o?i.cfg.scaleColor:o;i.ctx.beginPath(),i.ctx.moveTo(e,i.$canvas.height),i.ctx.lineTo(e,i.$canvas.height-n),i.ctx.closePath(),i.ctx.strokeStyle=a,i.ctx.lineWidth=s,i.ctx.stroke()})),l(this,P,(function(t){var e=t.x,n=t.y,r=t.text,s=t.color,o=void 0===s?i.cfg.textColor:s,a=t.fontSize,l=void 0===a?"11px":a,c=t.align,h=void 0===c?"center":c,u=t.baseLine,d=void 0===u?"alphabetic":u;i.ctx.beginPath(),i.ctx.font="".concat(l," ").concat(i.cfg.fontFamily),i.ctx.fillStyle=o,i.ctx.textAlign=h,i.ctx.textBaseline=d,i.ctx.fillText(r,e,n)})),l(this,M,(function(t){var e=t.startX,n=t.startY,r=t.endX,s=t.endY,o=t.bgColor;i.ctx.beginPath(),i.ctx.rect(e,n,r-e,s-n),i.ctx.fillStyle=o,i.ctx.fill()})),!t)throw new Error("canvas Element Or Element ID is required!");this.$canvas="string"==typeof t?document.querySelector(t):t,this.ctx=this.$canvas.getContext("2d"),this.cfg=n(n({},N),e),null!=e&&e.pointColor&&(this.cfg.pointerColor=e.pointColor),null!=e&&e.pointWidth&&(this.cfg.pointerWidth=e.pointWidth);var r=this.cfg,o=r.fill,a=r.width,u=r.height,d=r.zoom,A=r.timeSpacingList,D=r.scaleHeight,I=r.textColor;if(r.bgTextColor||(this.cfg.bgTextColor=function(t,e){var i=document.createElement("canvas");i.width=i.height=1;var n=i.getContext("2d");n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data;return"rgba(".concat(r[0],", ").concat(r[1],", ").concat(r[2],", ").concat(e,")")}(I,.18)),d<0||d>=A.length||d%1!=0)throw new Error("zoom must be 0 ~ ".concat(A.length-1,", and must be an integer"));if(o){var R=this.$canvas.parentElement;this.$canvasParent=R,this.$canvas.width=R.clientWidth,this.$canvas.height=R.clientHeight,new ResizeObserver(j(h(this,x,T).bind(this),200)).observe(R)}else this.$canvas.width=a,this.$canvas.height=u;c(this,g,A[d]),null!=D&&D.long&&null!=D&&D.short?c(this,v,D):c(this,v,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw(),this.$canvas.addEventListener("wheel",h(this,S,C).bind(this),{passive:!1}),this.$canvas.addEventListener("mousedown",h(this,b,w).bind(this))}return t.prototype.setTimeMove=function(t,e){var i=t.timestamp,n=t.direction;if(void 0===e&&(e=!0),!a(this,_)&&!a(this,y)){var r=i;e||(r=n?a(this,p)+i:a(this,p)-i),this.draw({currentTime:r,areas:a(this,m),_privateFlag:!0})}},t.prototype.draw=function(t){var e=this,i=void 0===t?{}:t,n=i.currentTime,r=i.areas,s=i._privateFlag;if(!a(this,y)||s){c(this,p,n||Date.now()),c(this,m,r||[]);var o=Math.ceil(this.$canvas.width/this.cfg.scaleSpacing),l=o*a(this,g),u=a(this,p)-l/2,d=a(this,p)+l/2,f=this.$canvas.width/2,_=l/this.$canvas.width;h(this,E,A).call(this),a(this,M).call(this,{startX:0,startY:0,endX:this.$canvas.width,endY:this.$canvas.height,bgColor:this.cfg.bgColor}),a(this,m).forEach((function(t){var i=t.startTime<=u?0:Math.round((t.startTime-u)/_),n=t.endTime>=d?e.$canvas.width:Math.round((t.endTime-u)/_);i<e.$canvas.width&&n>0&&a(e,M).call(e,{startX:i,startY:0,endX:n,endY:e.$canvas.height,bgColor:t.bgColor||e.cfg.areaBgColor})})),F.bind(this)({xCenterPoint:f,screenScaleCount:o,startTime:u,timePerPixel:_,scaleHeight:a(this,v),timeSpacing:a(this,g),currentTime:a(this,p),$canvas:this.$canvas,cfg:this.cfg,drawLine:a(this,O).bind(this),drawText:a(this,P).bind(this),drawArea:a(this,M).bind(this)}),this.cfg.isDrawScale&&h(this,k,D).call(this)}},t.prototype.getCurrentTime=function(){return a(this,p)},t.prototype.setZoom=function(t){var e=this;void 0===t&&(t=!0);var i=this.cfg.timeSpacingList.findIndex((function(t){return t===a(e,g)}));return i>0&&t&&(c(this,g,this.cfg.timeSpacingList[i-1]),this.draw({currentTime:a(this,p),areas:a(this,m),_privateFlag:!0})),i<this.cfg.timeSpacingList.length-1&&!t&&(c(this,g,this.cfg.timeSpacingList[i+1]),this.draw({currentTime:a(this,p),areas:a(this,m),_privateFlag:!0})),a(this,g)},t.prototype.clear=function(){this.ctx&&this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)},t.prototype.on=function(t,e){a(this,f).on(t,e)},t.prototype.off=function(t,e){a(this,f).off(t,e)},t}();f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,_=new WeakMap,b=new WeakSet,w=function(t){var e=this;c(this,y,!0);var i=0,n=a(this,p),r=j((function(r){var s=r.offsetX;if(a(e,y)){var o=s-t.offsetX;n=Math.round(a(e,p)-a(e,g)/e.cfg.scaleSpacing*(o-i)),i=o,e.draw({currentTime:n,areas:a(e,m),_privateFlag:!0})}}),1e3/this.cfg.fps),s=function(t){var i=t.offsetX,n=t.offsetY;(i<3||i>e.$canvas.width-3||n<3||n>e.$canvas.height-3)&&(e.$canvas.removeEventListener("mousemove",r),e.$canvas.removeEventListener("mousemove",s))},o=function(){e.$canvas.removeEventListener("mousemove",r),e.$canvas.removeEventListener("mousemove",s),document.removeEventListener("mouseup",o),c(e,y,!1),a(e,_)&&(clearTimeout(a(e,_)),c(e,_,null)),c(e,_,setTimeout((function(){h(e,L,I).call(e,"dragged",n),c(e,_,null)}),e.cfg.timeNumber))};this.$canvas.addEventListener("mousemove",r),this.$canvas.addEventListener("mousemove",s),document.addEventListener("mouseup",o)},S=new WeakSet,C=function(t){var e=this;t.preventDefault();var i=this.cfg.timeSpacingList.findIndex((function(t){return t===a(e,g)}));t.deltaY<0&&i>0?(c(this,g,this.cfg.timeSpacingList[i-1]),this.draw({currentTime:a(this,p),areas:a(this,m),_privateFlag:!0})):t.deltaY>0&&i<this.cfg.timeSpacingList.length-1&&(c(this,g,this.cfg.timeSpacingList[i+1]),this.draw({currentTime:a(this,p),areas:a(this,m),_privateFlag:!0})),h(this,L,I).call(this,"zoom",a(this,g))},x=new WeakSet,T=function(){this.$canvasParent&&(this.$canvas.width=this.$canvasParent.clientWidth,this.$canvas.height=this.$canvasParent.clientHeight,this.cfg.scaleHeight||c(this,v,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw({currentTime:a(this,p),areas:a(this,m)}))},E=new WeakSet,A=function(){this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)},k=new WeakSet,D=function(){var t=this;a(this,P).call(this,{x:this.cfg.scaleSpacing+12,y:9,text:a(t,g)<1e3?"".concat(a(t,g),"ms"):a(t,g)<6e4?"".concat(Math.round(a(t,g)/100)/10,"sec"):a(t,g)<36e5?"".concat(Math.round(a(t,g)/100/60)/10,"min"):a(t,g)<864e5?"".concat(Math.round(a(t,g)/100/60/60)/10,"hours"):a(t,g)<6048e5?"".concat(Math.round(a(t,g)/100/60/60/24)/10,"days"):"".concat(Math.round(a(t,g)/100/60/60/24/7)/10,"weeks"),align:"left",baseLine:"middle"}),this.ctx.beginPath(),this.ctx.moveTo(5,6),this.ctx.lineTo(5,10),this.ctx.lineTo(this.cfg.scaleSpacing+6,10),this.ctx.lineTo(this.cfg.scaleSpacing+6,6),this.ctx.strokeStyle=this.cfg.scaleColor,this.ctx.lineWidth=1.5,this.ctx.stroke()},O=new WeakMap,P=new WeakMap,M=new WeakMap,L=new WeakSet,I=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];(t=a(this,f)).emit.apply(t,e)}}).call(this,i(12))},function(t,e,i){"use strict";i.d(e,"d",(function(){return n})),i.d(e,"b",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"c",(function(){return o}));var n=function(t,e,i,n,r){this.dts=t,this.pts=e,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null},r=function(){function t(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return t.prototype.appendSyncPoint=function(t){t.isSyncPoint=!0,this.syncPoints.push(t)},t}(),s=function(){function t(){this._list=[]}return t.prototype.clear=function(){this._list=[]},t.prototype.appendArray=function(t){var e=this._list;0!==t.length&&(e.length>0&&t[0].originalDts<e[e.length-1].originalDts&&this.clear(),Array.prototype.push.apply(e,t))},t.prototype.getLastSyncPointBeforeDts=function(t){if(0==this._list.length)return null;var e=this._list,i=0,n=e.length-1,r=0,s=0,o=n;for(t<e[0].dts&&(i=0,s=o+1);s<=o;){if((r=s+Math.floor((o-s)/2))===n||t>=e[r].dts&&t<e[r+1].dts){i=r;break}e[r].dts<t?s=r+1:o=r-1}return this._list[i]},t}(),o=function(){function t(t){this._type=t,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this._list.length},t.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},t.prototype._searchNearestSegmentBefore=function(t){var e=this._list;if(0===e.length)return-2;var i=e.length-1,n=0,r=0,s=i,o=0;if(t<e[0].originalBeginDts)return o=-1;for(;r<=s;){if((n=r+Math.floor((s-r)/2))===i||t>e[n].lastSample.originalDts&&t<e[n+1].originalBeginDts){o=n;break}e[n].originalBeginDts<t?r=n+1:s=n-1}return o},t.prototype._searchNearestSegmentAfter=function(t){return this._searchNearestSegmentBefore(t)+1},t.prototype.append=function(t){var e=this._list,i=t,n=this._lastAppendLocation,r=0;-1!==n&&n<e.length&&i.originalBeginDts>=e[n].lastSample.originalDts&&(n===e.length-1||n<e.length-1&&i.originalBeginDts<e[n+1].originalBeginDts)?r=n+1:e.length>0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)},t.prototype.getLastSegmentBefore=function(t){var e=this._searchNearestSegmentBefore(t);return e>=0?this._list[e]:null},t.prototype.getLastSampleBefore=function(t){var e=this.getLastSegmentBefore(t);return null!=e?e.lastSample:null},t.prototype.getLastSyncPointBefore=function(t){for(var e=this._searchNearestSegmentBefore(t),i=this._list[e].syncPoints;0===i.length&&e>0;)e--,i=this._list[e].syncPoints;return i.length>0?i[i.length-1]:null},t}()},function(t,e,i){"use strict";var n=function(){function t(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return t.prototype.isComplete=function(){var t=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,e=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&t&&e},t.prototype.isSeekable=function(){return!0===this.hasKeyframesIndex},t.prototype.getNearestKeyframe=function(t){if(null==this.keyframesIndex)return null;var e=this.keyframesIndex,i=this._search(e.times,t);return{index:i,milliseconds:e.times[i],fileposition:e.filepositions[i]}},t.prototype._search=function(t,e){var i=0,n=t.length-1,r=0,s=0,o=n;for(e<t[0]&&(i=0,s=o+1);s<=o;){if((r=s+Math.floor((o-s)/2))===n||e>=t[r]&&e<t[r+1]){i=r;break}t[r]<e?s=r+1:o=r-1}return i},t}();e.a=n},function(t,e,i){(function(t){
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
var n,r,s,o,a,l,c,h,u,d,f,p,m,g,v,y,_,b,w,S,C,x,T=T||{version:"4.6.0"};if(e.fabric=T,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?T.document=document:T.document=document.implementation.createHTMLDocument(""),T.window=window;else{var E=new(i(33).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;T.document=E.document,T.jsdomImplForWrapper=i(34).implForWrapper,T.nodeCanvas=i(35).Canvas,T.window=E,DOMParser=T.window.DOMParser}function A(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var s=i.height-n.height;r.drawImage(i,0,s,n.width,n.height,0,0,n.width,n.height)}function k(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,r=e.destinationHeight,s=n*r*4,o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,n,r,t.RGBA,t.UNSIGNED_BYTE,o);var l=new ImageData(a,n,r);i.putImageData(l,0,0)}T.isTouchSupported="ontouchstart"in T.window||"ontouchstart"in T.document||T.window&&T.window.navigator&&T.window.navigator.maxTouchPoints>0,T.isLikelyNode=void 0!==t&&"undefined"==typeof window,T.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],T.DPI=96,T.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",T.commaWsp="(?:\\s+,?\\s*|,\\s*)",T.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,T.reNonWord=/[ \n\.,;!\?\-]/,T.fontPaths={},T.iMatrix=[1,0,0,1,0,0],T.svgNS="http://www.w3.org/2000/svg",T.perfLimitSizeTotal=2097152,T.maxCacheSideLimit=4096,T.minCacheSideLimit=256,T.charWidthsCache={},T.textureSize=2048,T.disableStyleCopyPaste=!1,T.enableGLFiltering=!0,T.devicePixelRatio=T.window.devicePixelRatio||T.window.webkitDevicePixelRatio||T.window.mozDevicePixelRatio||1,T.browserShadowBlurConstant=1,T.arcToSegmentsCache={},T.boundsOfCurveCache={},T.cachesBoundsOfCurve=!0,T.forceGLPutImageData=!1,T.initFilterBackend=function(){return T.enableGLFiltering&&T.isWebglSupported&&T.isWebglSupported(T.textureSize)?(console.log("max texture size: "+T.maxTextureSize),new T.WebglFilterBackend({tileSize:T.textureSize})):T.Canvas2dFilterBackend?new T.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=T),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:T.util.array.fill(i,!1)}}function e(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}T.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,e||{});return this.__eventListeners[t]=i.filter((function(t){return!1!==t})),this},on:function(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this},once:function(t,i){if(1===arguments.length)for(var n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this},off:function(e,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this}}}(),T.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var n=this._objects;return i?n[e]=t:n.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(t=e.indexOf(arguments[n]))&&(i=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)t.call(e,i[n],n,i);return this},getObjects:function(t){return void 0===t?this._objects.concat():this._objects.filter((function(e){return e.type===t}))},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(t,e){return this._objects.indexOf(t)>-1||!!e&&this._objects.some((function(e){return"function"==typeof e.contains&&e.contains(t,!0)}))},complexity:function(){return this._objects.reduce((function(t,e){return t+=e.complexity?e.complexity():0}),0)}},T.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof T.Gradient||this.set(e,new T.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof T.Pattern?i&&i():this.set(e,new T.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},n=e,r=Math.sqrt,s=Math.atan2,o=Math.pow,a=Math.PI/180,l=Math.PI/2,T.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/l){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*a},radiansToDegrees:function(t){return t/a},rotatePoint:function(t,e,i){var n=new T.Point(t.x-e.x,t.y-e.y),r=T.util.rotateVector(n,i);return new T.Point(r.x,r.y).addEquals(e)},rotateVector:function(t,e){var i=T.util.sin(e),n=T.util.cos(e);return{x:t.x*n-t.y*i,y:t.x*i+t.y*n}},transformPoint:function(t,e,i){return i?new T.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new T.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i<t.length;i++)t[i]=T.util.transformPoint(t[i],e);var n=[t[0].x,t[1].x,t[2].x,t[3].x],r=T.util.array.min(n),s=T.util.array.max(n)-r,o=[t[0].y,t[1].y,t[2].y,t[3].y],a=T.util.array.min(o);return{left:r,top:a,width:s,height:T.util.array.max(o)-a}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],n=T.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),n=parseFloat(t);switch(e||(e=T.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*T.DPI/25.4;case"cm":return n*T.DPI/2.54;case"in":return n*T.DPI;case"pt":return n*T.DPI/72;case"pc":return n*T.DPI/72*12;case"em":return n*e;default:return n}},falseFunction:function(){return!1},getKlass:function(t,e){return t=T.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),T.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},resolveNamespace:function(t){if(!t)return T;var e,i=t.split("."),r=i.length,s=n||T.window;for(e=0;e<r;++e)s=s[i[e]];return s},loadImage:function(t,e,i,n){if(t){var r=T.util.createImage(),s=function(){e&&e.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=s,r.onerror=function(){T.log("Error loading "+r.src),e&&e.call(i,null,!0),r=r.onload=r.onerror=null},0!==t.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===t.substring(0,14)&&(r.onload=null,T.util.loadImageInDom(r,s)),r.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=T.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),T.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,i,n){var r=[],s=0,o=(t=t||[]).length;function a(){++s===o&&e&&e(r.filter((function(t){return t})))}o?t.forEach((function(t,e){t&&t.type?T.util.getKlass(t.type,i).fromObject(t,(function(i,s){s||(r[e]=i),n&&n(t,i,s),a()})):a()})):e&&e(r)},enlivenPatterns:function(t,e){function i(){++r===s&&e&&e(n)}var n=[],r=0,s=(t=t||[]).length;s?t.forEach((function(t,e){t&&t.source?new T.Pattern(t,(function(t){n[e]=t,i()})):(n[e]=t,i())})):e&&e(n)},groupSVGElements:function(t,e,i){var n;return t&&1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),n=new T.Group(t,e),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(t,e,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in t&&(e[i[n]]=t[i[n]])},drawDashedLine:function(t,e,i,n,o,a){var l=n-e,c=o-i,h=r(l*l+c*c),u=s(c,l),d=a.length,f=0,p=!0;for(t.save(),t.translate(e,i),t.moveTo(0,0),t.rotate(u),e=0;h>e;)(e+=a[f++%d])>h&&(e=h),t[p?"lineTo":"moveTo"](e,0),p=!p;t.restore()},createCanvasElement:function(){return T.document.createElement("canvas")},copyCanvasElement:function(t){var e=T.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return T.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=s(t[1],t[0]),i=o(t[0],2)+o(t[1],2),n=r(i),l=(t[0]*t[3]-t[2]*t[1])/n,c=s(t[0]*t[2]+t[1]*t[3],i);return{angle:e/a,scaleX:n,scaleY:l,skewX:c/a,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return T.iMatrix.concat();var e=T.util.degreesToRadians(t.angle),i=T.util.cos(e),n=T.util.sin(e);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,i=void 0===t.scaleY?1:t.scaleY,n=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],r=T.util.multiplyTransformMatrices,s=T.util.degreesToRadians;return t.skewX&&(n=r(n,[1,0,Math.tan(s(t.skewX)),1],!0)),t.skewY&&(n=r(n,[1,Math.tan(s(t.skewY)),0,1],!0)),n},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=T.util.multiplyTransformMatrices;return t.angle&&(e=i(e,T.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,T.util.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,n){n>0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,s=!0,o=t.getImageData(e,i,2*n||1,2*n||1),a=o.data.length;for(r=3;r<a&&!1!=(s=o.data[r]<=0);r+=4);return o=null,s},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",n=t.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(e=i,i="meet"):n.length&&(e=n.pop())),{meetOrSlice:i,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?T.charWidthsCache[t]&&delete T.charWidthsCache[t]:T.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),n=Math.floor(e/i);return{x:Math.floor(i),y:n}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map((function(t){return T.util.toFixed(t,T.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(t,e){var i=T.util.invertTransform(e),n=T.util.multiplyTransformMatrices(i,t.calcOwnMatrix());T.util