New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@jxstjh/jhvideo

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jxstjh/jhvideo - npm Package Compare versions

Comparing version

to
0.2.21-beat5

@@ -0,0 +0,0 @@ import { MPEG4AudioObjectTypes, MPEG4SamplingFrequencyIndex } from "./mpeg4-audio";

@@ -0,0 +0,0 @@ import MediaInfo from '../core/media-info';

@@ -0,0 +0,0 @@ export declare enum H264NaluType {

@@ -0,0 +0,0 @@ export declare enum MPEG4AudioObjectTypes {

@@ -0,0 +0,0 @@ interface ProgramToPMTPIDMap {

@@ -0,0 +0,0 @@ export declare class PESPrivateData {

@@ -0,0 +0,0 @@ import BaseDemuxer from './base-demuxer';

@@ -0,0 +0,0 @@ import h5msClient from './h5msClient.js';

@@ -0,0 +0,0 @@ import H5msClient from './h5msClient.js';

@@ -0,0 +0,0 @@ export declare type DeviceType = 'pvg67' | 'pvgplus' | 'rtsp' | 'gb28181';

@@ -0,0 +0,0 @@ export declare const ERRORMSG: {

@@ -0,0 +0,0 @@ import JPlayer from "../jplayer";

@@ -0,0 +0,0 @@ export interface RecordItem {

@@ -0,0 +0,0 @@ declare const closeSvg = "<svg t=\"1626059564788\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2540\" ><path d=\"M568.9344 521.4208l300.2368-300.2368a39.3216 39.3216 0 0 0 0-55.296l-1.6384-1.6384a39.3216 39.3216 0 0 0-55.296 0L512 464.896 211.7632 164.2496a39.3216 39.3216 0 0 0-55.296 0l-1.6384 1.6384a38.5536 38.5536 0 0 0 0 55.296l300.2368 300.2368-300.2368 300.2368a39.3216 39.3216 0 0 0 0 55.296l1.6384 1.6384a39.3216 39.3216 0 0 0 55.296 0L512 578.3552l300.2368 300.2368a39.3216 39.3216 0 0 0 55.296 0l1.6384-1.6384a39.3216 39.3216 0 0 0 0-55.296l-300.2368-300.2368z\" p-id=\"2541\"></path></svg>";

@@ -0,0 +0,0 @@ import { MPEG4AudioObjectTypes, MPEG4SamplingFrequencyIndex } from "./mpeg4-audio";

@@ -0,0 +0,0 @@ import MediaInfo from '../core/media-info';

@@ -0,0 +0,0 @@ export declare enum H264NaluType {

@@ -0,0 +0,0 @@ export declare enum MPEG4AudioObjectTypes {

@@ -0,0 +0,0 @@ interface ProgramToPMTPIDMap {

@@ -0,0 +0,0 @@ export declare class PESPrivateData {

@@ -0,0 +0,0 @@ import BaseDemuxer from './base-demuxer';

@@ -0,0 +0,0 @@ export declare const STATUS_TYPE: {

@@ -0,0 +0,0 @@ import h5msClient from './h5msClient.js';

@@ -0,0 +0,0 @@ import { Direction, PlayerMode, StreamOpt, StreamSpeed, StyleSize } from './model/playerModel';

@@ -0,0 +0,0 @@ import JPlayer from "./jplayer";

@@ -0,0 +0,0 @@ export type DeviceType = 'pvg67' | 'pvgplus' | 'rtsp' | 'gb28181';

declare function toggleCall(e: any): void;
export default toggleCall;

@@ -0,0 +0,0 @@ export declare const ERRORMSG: {

@@ -0,0 +0,0 @@ import JPlayer from "../jplayer";

@@ -0,0 +0,0 @@ export interface RecordItem {

@@ -0,0 +0,0 @@ export declare class rectDraw {

@@ -0,0 +0,0 @@ declare const closeSvg = "<svg t=\"1626059564788\" class='JPlayer-svg-icon' viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2540\" ><path d=\"M568.9344 521.4208l300.2368-300.2368a39.3216 39.3216 0 0 0 0-55.296l-1.6384-1.6384a39.3216 39.3216 0 0 0-55.296 0L512 464.896 211.7632 164.2496a39.3216 39.3216 0 0 0-55.296 0l-1.6384 1.6384a38.5536 38.5536 0 0 0 0 55.296l300.2368 300.2368-300.2368 300.2368a39.3216 39.3216 0 0 0 0 55.296l1.6384 1.6384a39.3216 39.3216 0 0 0 55.296 0L512 578.3552l300.2368 300.2368a39.3216 39.3216 0 0 0 55.296 0l1.6384-1.6384a39.3216 39.3216 0 0 0 0-55.296l-300.2368-300.2368z\" p-id=\"2541\"></path></svg>";

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ export declare const STATUS_TYPE: {

@@ -0,0 +0,0 @@ interface ProgramPMTPIDMap {

@@ -0,0 +0,0 @@ /**

@@ -9,4 +9,5 @@ import { Direction, PlayerMode, StreamOpt, StreamSpeed, StyleSize } from "./model/playerModel";

private $stop;
private subscriptiontimer;
constructor(mediaElement: unknown, time: any);
constructor(mediaElement: unknown, options?: {
mimeType: string;
});
on(event: any, listener: any): void;

@@ -213,3 +214,3 @@ off(event: any, listener: any): void;

ratioAdjust(W?: number, H?: number): void;
record(time?: number): Promise<void>;
record(): void;
screenshot(): void;

@@ -216,0 +217,0 @@ toggleSetting(): void;

@@ -0,0 +0,0 @@ /// <reference types="node" />

/// <reference types="node/events" />
/// <reference types="cors/node_modules/@types/node/events" />
/// <reference types="node/events" />
/// <reference types=".store/pcm-player@0.0.16/node_modules/pcm-player" />
import { StreamOpt } from "../model/playerModel";

@@ -4,0 +5,0 @@ import { EventEmitter } from "events";

{
"name": "@jxstjh/jhvideo",
"version": "0.2.21-beat42",
"version": "0.2.21-beat5",
"description": "HTML5 jhvideo base on MPEG2-TS Stream Player",

@@ -5,0 +5,0 @@ "main": "./dist/jhvideo.js",

@@ -0,0 +0,0 @@ mpegts.js [![npm](https://img.shields.io/npm/v/mpegts.js.svg?style=flat)](https://www.npmjs.com/package/mpegts.js)

@@ -0,0 +0,0 @@ mpegts.js [![npm](https://img.shields.io/npm/v/mpegts.js.svg?style=flat)](https://www.npmjs.com/package/mpegts.js)

@@ -0,0 +0,0 @@ ```typescript

@@ -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,0 @@ /*

@@ -0,0 +0,0 @@ import Log from "../utils/logger";

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ import MediaInfo from '../core/media-info';

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ import Log from "../utils/logger";

@@ -0,0 +0,0 @@ export enum MPEG4AudioObjectTypes {

@@ -0,0 +0,0 @@ interface ProgramToPMTPIDMap {

@@ -0,0 +0,0 @@ // ISO/IEC 13818-1 PES packets containing private data (stream_type=0x06)

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ import httpClient from './core/httpClient'

@@ -0,0 +0,0 @@ import httpClient from './core/httpClient'

@@ -0,0 +0,0 @@ // entry/index file

@@ -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,0 @@ /*

@@ -0,0 +0,0 @@ import JPlayer from "./jplayer";

@@ -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,0 @@ import EventEmitter from 'events';

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ import { EventEmitter } from 'events'

@@ -0,0 +0,0 @@ import {audioOnSvg, audioOffSvg} from "../icons";

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ const wlErr = {

@@ -0,0 +0,0 @@ /* Author: @UnrealSec */

@@ -0,0 +0,0 @@ import JPlayer from "../jplayer";

@@ -0,0 +0,0 @@ import { min } from "../../node_modules/rxjs/dist/types/index"

@@ -0,0 +0,0 @@ import { fabric } from 'fabric'

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*! Hammer.JS - v2.0.8 - 2016-04-23

@@ -0,0 +0,0 @@ const closeSvg = `<svg t="1626059564788" class='JPlayer-svg-icon' viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2540" ><path d="M568.9344 521.4208l300.2368-300.2368a39.3216 39.3216 0 0 0 0-55.296l-1.6384-1.6384a39.3216 39.3216 0 0 0-55.296 0L512 464.896 211.7632 164.2496a39.3216 39.3216 0 0 0-55.296 0l-1.6384 1.6384a38.5536 38.5536 0 0 0 0 55.296l300.2368 300.2368-300.2368 300.2368a39.3216 39.3216 0 0 0 0 55.296l1.6384 1.6384a39.3216 39.3216 0 0 0 55.296 0L512 578.3552l300.2368 300.2368a39.3216 39.3216 0 0 0 55.296 0l1.6384-1.6384a39.3216 39.3216 0 0 0 0-55.296l-300.2368-300.2368z" p-id="2541"></path></svg>`

@@ -0,0 +0,0 @@ import httpClient from '../core/httpClient'

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ // 云台控制工具集

@@ -0,0 +0,0 @@ import {EventEmitter} from 'events'

@@ -0,0 +0,0 @@ import {callOnSvg, callOffSvg} from "./icons";

@@ -0,0 +0,0 @@ import Hammer from 'hammerjs'

@@ -0,0 +0,0 @@ /*

@@ -1,3 +0,1 @@

import { Decoder, tools, Reader } from './EBML.js'
// Generate four random hex digits.

@@ -183,29 +181,1 @@ function S4() {

}
export function getSeekableBlob(inputBlob, mimeType, callback) {
const reader = new Reader();
const decoder = new Decoder();
const tool = tools;
const fileReader = new FileReader();
fileReader.onload = function (e) {
const ebmlElms = decoder.decode(this.result)
ebmlElms.forEach(function (element) {
reader.read(element)
})
reader.stop()
const refinedMetadataBuf = tool.makeMetadataSeekable(
reader.metadatas,
reader.duration,
reader.cues
)
const body = this.result.slice(reader.metadataSize)
const newBlob = new Blob([refinedMetadataBuf, body], {
type: mimeType
})
callback(newBlob)
}
fileReader.readAsArrayBuffer(inputBlob);
}

@@ -0,0 +0,0 @@ import {StreamOpt, StreamSpeed} from "../../model/playerModel";

@@ -0,0 +0,0 @@ var Yt = Object.defineProperty;

var $timeline=function(d){"use strict";var At=Object.defineProperty;var Pt=(d,T,y)=>T in d?At(d,T,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[T]=y;var st=(d,T,y)=>(Pt(d,typeof T!="symbol"?T+"":T,y),y),Tt=(d,T,y)=>{if(!T.has(d))throw TypeError("Cannot "+y)};var r=(d,T,y)=>(Tt(d,T,"read from private field"),y?y.call(d):T.get(d)),C=(d,T,y)=>{if(T.has(d))throw TypeError("Cannot add the same private member more than once");T instanceof WeakSet?T.add(d):T.set(d,y)},O=(d,T,y,nt)=>(Tt(d,T,"write to private field"),nt?nt.call(d,y):T.set(d,y),y);var Z=(d,T,y)=>(Tt(d,T,"access private method"),y);var U,F,W,g,R,j,P,at,Yt,ot,xt,ht,Ft,ct,Ct,ut,Ht,lt,Q,q,K,Dt;function T(f){return{all:f=f||new Map,on:function(i,n){var o=f.get(i);o?o.push(n):f.set(i,[n])},off:function(i,n){var o=f.get(i);o&&(n?o.splice(o.indexOf(n)>>>0,1):f.set(i,[]))},emit:function(i,n){var o=f.get(i);o&&o.slice().map(function(l){l(n)}),(o=f.get("*"))&&o.slice().map(function(l){l(i,n)})}}}var y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var wt={exports:{}};(function(f,i){(function(n,o){f.exports=o()})(y,function(){var n=1e3,o=6e4,l=36e5,$="millisecond",v="second",D="minute",M="hour",S="day",H="week",w="month",z="quarter",_="year",N="date",ft="Invalid Date",vt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,pt=/\[([^\]]+)]|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,mt={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(h){var s=["th","st","nd","rd"],t=h%100;return"["+h+(s[(t-20)%10]||s[t]||s[0])+"]"}},tt=function(h,s,t){var a=String(h);return!a||a.length>=s?h:""+Array(s+1-a.length).join(t)+h},V={s:tt,z:function(h){var s=-h.utcOffset(),t=Math.abs(s),a=Math.floor(t/60),e=t%60;return(s<=0?"+":"-")+tt(a,2,"0")+":"+tt(e,2,"0")},m:function h(s,t){if(s.date()<t.date())return-h(t,s);var a=12*(t.year()-s.year())+(t.month()-s.month()),e=s.clone().add(a,w),c=t-e<0,u=s.clone().add(a+(c?-1:1),w);return+(-(a+(t-e)/(c?e-u:u-e))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:w,y:_,w:H,d:S,D:N,h:M,m:D,s:v,ms:$,Q:z}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},I="en",A={};A[I]=mt;var yt="$isDayjsObject",Mt=function(h){return h instanceof gt||!(!h||!h[yt])},dt=function h(s,t,a){var e;if(!s)return I;if(typeof s=="string"){var c=s.toLowerCase();A[c]&&(e=c),t&&(A[c]=t,e=c);var u=s.split("-");if(!e&&u.length>1)return h(u[0])}else{var p=s.name;A[p]=s,e=p}return!a&&e&&(I=e),e||!a&&I},Y=function(h,s){if(Mt(h))return h.clone();var t=typeof s=="object"?s:{};return t.date=h,t.args=arguments,new gt(t)},m=V;m.l=dt,m.i=Mt,m.w=function(h,s){return Y(h,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var gt=function(){function h(t){this.$L=dt(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[yt]=!0}var s=h.prototype;return s.parse=function(t){this.$d=function(a){var e=a.date,c=a.utc;if(e===null)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(vt);if(u){var p=u[2]-1||0,b=(u[7]||"0").substring(0,3);return c?new Date(Date.UTC(u[1],p,u[3]||1,u[4]||0,u[5]||0,u[6]||0,b)):new Date(u[1],p,u[3]||1,u[4]||0,u[5]||0,u[6]||0,b)}}return new Date(e)}(t),this.init()},s.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()},s.$utils=function(){return m},s.isValid=function(){return this.$d.toString()!==ft},s.isSame=function(t,a){var e=Y(t);return this.startOf(a)<=e&&e<=this.endOf(a)},s.isAfter=function(t,a){return Y(t)<this.startOf(a)},s.isBefore=function(t,a){return this.endOf(a)<Y(t)},s.$g=function(t,a,e){return m.u(t)?this[a]:this.set(e,t)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(t,a){var e=this,c=!!m.u(a)||a,u=m.p(t),p=function(J,E){var X=m.w(e.$u?Date.UTC(e.$y,E,J):new Date(e.$y,E,J),e);return c?X:X.endOf(S)},b=function(J,E){return m.w(e.toDate()[J].apply(e.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(E)),e)},x=this.$W,L=this.$M,k=this.$D,G="set"+(this.$u?"UTC":"");switch(u){case _:return c?p(1,0):p(31,11);case w:return c?p(1,L):p(0,L+1);case H:var B=this.$locale().weekStart||0,et=(x<B?x+7:x)-B;return p(c?k-et:k+(6-et),L);case S:case N:return b(G+"Hours",0);case M:return b(G+"Minutes",1);case D:return b(G+"Seconds",2);case v:return b(G+"Milliseconds",3);default:return this.clone()}},s.endOf=function(t){return this.startOf(t,!1)},s.$set=function(t,a){var e,c=m.p(t),u="set"+(this.$u?"UTC":""),p=(e={},e[S]=u+"Date",e[N]=u+"Date",e[w]=u+"Month",e[_]=u+"FullYear",e[M]=u+"Hours",e[D]=u+"Minutes",e[v]=u+"Seconds",e[$]=u+"Milliseconds",e)[c],b=c===S?this.$D+(a-this.$W):a;if(c===w||c===_){var x=this.clone().set(N,1);x.$d[p](b),x.init(),this.$d=x.set(N,Math.min(this.$D,x.daysInMonth())).$d}else p&&this.$d[p](b);return this.init(),this},s.set=function(t,a){return this.clone().$set(t,a)},s.get=function(t){return this[m.p(t)]()},s.add=function(t,a){var e,c=this;t=Number(t);var u=m.p(a),p=function(L){var k=Y(c);return m.w(k.date(k.date()+Math.round(L*t)),c)};if(u===w)return this.set(w,this.$M+t);if(u===_)return this.set(_,this.$y+t);if(u===S)return p(1);if(u===H)return p(7);var b=(e={},e[D]=o,e[M]=l,e[v]=n,e)[u]||1,x=this.$d.getTime()+t*b;return m.w(x,this)},s.subtract=function(t,a){return this.add(-1*t,a)},s.format=function(t){var a=this,e=this.$locale();if(!this.isValid())return e.invalidDate||ft;var c=t||"YYYY-MM-DDTHH:mm:ssZ",u=m.z(this),p=this.$H,b=this.$m,x=this.$M,L=e.weekdays,k=e.months,G=e.meridiem,B=function(E,X,it,$t){return E&&(E[X]||E(a,c))||it[X].slice(0,$t)},et=function(E){return m.s(p%12||12,E,"0")},J=G||function(E,X,it){var $t=E<12?"AM":"PM";return it?$t.toLowerCase():$t};return c.replace(pt,function(E,X){return X||function(it){switch(it){case"YY":return String(a.$y).slice(-2);case"YYYY":return m.s(a.$y,4,"0");case"M":return x+1;case"MM":return m.s(x+1,2,"0");case"MMM":return B(e.monthsShort,x,k,3);case"MMMM":return B(k,x);case"D":return a.$D;case"DD":return m.s(a.$D,2,"0");case"d":return String(a.$W);case"dd":return B(e.weekdaysMin,a.$W,L,2);case"ddd":return B(e.weekdaysShort,a.$W,L,3);case"dddd":return L[a.$W];case"H":return String(p);case"HH":return m.s(p,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return J(p,b,!0);case"A":return J(p,b,!1);case"m":return String(b);case"mm":return m.s(b,2,"0");case"s":return String(a.$s);case"ss":return m.s(a.$s,2,"0");case"SSS":return m.s(a.$ms,3,"0");case"Z":return u}return null}(E)||u.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(t,a,e){var c,u=this,p=m.p(a),b=Y(t),x=(b.utcOffset()-this.utcOffset())*o,L=this-b,k=function(){return m.m(u,b)};switch(p){case _:c=k()/12;break;case w:c=k();break;case z:c=k()/3;break;case H:c=(L-x)/6048e5;break;case S:c=(L-x)/864e5;break;case M:c=L/l;break;case D:c=L/o;break;case v:c=L/n;break;default:c=L}return e?c:m.a(c)},s.daysInMonth=function(){return this.endOf(w).$D},s.$locale=function(){return A[this.$L]},s.locale=function(t,a){if(!t)return this.$L;var e=this.clone(),c=dt(t,a,!0);return c&&(e.$L=c),e},s.clone=function(){return m.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},h}(),St=gt.prototype;return Y.prototype=St,[["$ms",$],["$s",v],["$m",D],["$H",M],["$W",S],["$M",w],["$y",_],["$D",N]].forEach(function(h){St[h[1]]=function(s){return this.$g(s,h[0],h[1])}}),Y.extend=function(h,s){return h.$i||(h(s,gt,Y),h.$i=!0),Y},Y.locale=dt,Y.isDayjs=Mt,Y.unix=function(h){return Y(1e3*h)},Y.en=A[I],Y.Ls=A,Y.p={},Y})})(wt);var Lt=wt.exports;const Ot=nt(Lt),rt=(f,i="MM/DD HH:mm")=>Ot(f).format(i),bt=(f,i)=>{let n,o=0;return(...l)=>{const $=Date.now(),v=$-o;!o||v>=i?(o=$,f.apply(void 0,l)):n||(n=setTimeout(()=>{o=$,f.apply(void 0,l),n=null},i-v))}},_t=(f,i)=>{const n=document.createElement("canvas");n.width=n.height=1;const o=n.getContext("2d");o.fillStyle=f,o.fillRect(0,0,1,1);const l=o.getImageData(0,0,1,1).data;return`rgba(${l[0]}, ${l[1]}, ${l[2]}, ${i})`},Et=({xCenterPoint:f,cfg:i,timePerPixel:n,timeSpacing:o,currentTime:l,$canvas:$,screenScaleCount:v,scaleHeight:D,startTime:M,drawLine:S,drawText:H,drawArea:w})=>{const z=({space:N,scaleTimeFormat:ft,bgTimeFormat:vt,pointerTimeFormat:pt})=>{H({x:$.width-f/10,y:6,text:rt(l,vt),fontSize:`${$.height-5}px`,align:"right",baseLine:"top",color:i.bgTextColor});const mt=M%o,tt=mt/n;for(let V=0;V<v;V++){const I=V*i.scaleSpacing-tt-i.pointerWidth/2,A=M+V*o-mt;if(A%(o*N)===0){S({x:I,y:D.long}),H({x:I,y:$.height-D.long-5,text:rt(A,ft),baseLine:"bottom"});continue}S({x:I,y:D.short})}S({x:f-i.pointerWidth/2,y:$.height,width:i.pointerWidth,color:i.pointerColor}),w({startX:f-i.pointerDisplayWidth/2,startY:4,endX:f+i.pointerDisplayWidth/2,endY:4+i.pointerDisplayHeight,bgColor:i.pointerColor}),H({x:f,y:i.pointerDisplayHeight/2+5,text:rt(l,pt),align:"center",baseLine:"middle"})},_=i.thresholdsConfig[o];_&&z({space:_.space,scaleTimeFormat:_.scaleTimeFormat,bgTimeFormat:_.bgTimeFormat,pointerTimeFormat:_.pointerTimeFormat})},Wt={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}}};class kt{constructor(i,n){C(this,at);C(this,ot);C(this,ht);C(this,ct);C(this,ut);C(this,K);st(this,"$canvas");st(this,"$canvasParent");st(this,"ctx");st(this,"cfg");C(this,U,T());C(this,F,0);C(this,W,void 0);C(this,g,void 0);C(this,R,void 0);C(this,j,!1);C(this,P,null);C(this,lt,({x:i,y:n,width:o=1,color:l=this.cfg.scaleColor})=>{this.ctx.beginPath(),this.ctx.moveTo(i,this.$canvas.height),this.ctx.lineTo(i,this.$canvas.height-n),this.ctx.closePath(),this.ctx.strokeStyle=l,this.ctx.lineWidth=o,this.ctx.stroke()});C(this,Q,({x:i,y:n,text:o,color:l=this.cfg.textColor,fontSize:$="11px",align:v="center",baseLine:D="alphabetic"})=>{this.ctx.beginPath(),this.ctx.font=`${$} ${this.cfg.fontFamily}`,this.ctx.fillStyle=l,this.ctx.textAlign=v,this.ctx.textBaseline=D,this.ctx.fillText(o,i,n)});C(this,q,({startX:i,startY:n,endX:o,endY:l,bgColor:$})=>{this.ctx.beginPath(),this.ctx.rect(i,n,o-i,l-n),this.ctx.fillStyle=$,this.ctx.fill()});if(!i)throw new Error("canvas Element Or Element ID is required!");typeof i=="string"?this.$canvas=document.querySelector(i):this.$canvas=i,this.ctx=this.$canvas.getContext("2d"),this.cfg={...Wt,...n},n!=null&&n.pointColor&&(this.cfg.pointerColor=n.pointColor),n!=null&&n.pointWidth&&(this.cfg.pointerWidth=n.pointWidth);const{fill:o,width:l,height:$,zoom:v,timeSpacingList:D,scaleHeight:M,textColor:S,bgTextColor:H}=this.cfg;if(H||(this.cfg.bgTextColor=_t(S,.18)),v<0||v>=D.length||v%1!==0)throw new Error(`zoom must be 0 ~ ${D.length-1}, and must be an integer`);if(o){const w=this.$canvas.parentElement;this.$canvasParent=w,this.$canvas.width=w.clientWidth,this.$canvas.height=w.clientHeight,new ResizeObserver(bt(Z(this,ht,Ft).bind(this),200)).observe(w)}else this.$canvas.width=l,this.$canvas.height=$;O(this,g,D[v]),M!=null&&M.long&&(M!=null&&M.short)?O(this,R,M):O(this,R,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw(),this.$canvas.addEventListener("wheel",Z(this,ot,xt).bind(this),{passive:!1}),this.$canvas.addEventListener("mousedown",Z(this,at,Yt).bind(this))}setTimeMove({timestamp:i,direction:n},o=!0){if(!r(this,P)&&!r(this,j)){let l=i;o||(l=n?r(this,F)+i:r(this,F)-i),this.draw({currentTime:l,areas:r(this,W),_privateFlag:!0})}}draw({currentTime:i,areas:n,_privateFlag:o}={}){if(r(this,j)&&!o)return;O(this,F,i||Date.now()),O(this,W,n||[]);const l=Math.ceil(this.$canvas.width/this.cfg.scaleSpacing),$=l*r(this,g),v=r(this,F)-$/2,D=r(this,F)+$/2,M=this.$canvas.width/2,S=$/this.$canvas.width;Z(this,ct,Ct).call(this),r(this,q).call(this,{startX:0,startY:0,endX:this.$canvas.width,endY:this.$canvas.height,bgColor:this.cfg.bgColor}),r(this,W).forEach(H=>{const w=H.startTime<=v?0:Math.round((H.startTime-v)/S),z=H.endTime>=D?this.$canvas.width:Math.round((H.endTime-v)/S);w<this.$canvas.width&&z>0&&r(this,q).call(this,{startX:w,startY:0,endX:z,endY:this.$canvas.height,bgColor:H.bgColor||this.cfg.areaBgColor})}),Et.bind(this)({xCenterPoint:M,screenScaleCount:l,startTime:v,timePerPixel:S,scaleHeight:r(this,R),timeSpacing:r(this,g),currentTime:r(this,F),$canvas:this.$canvas,cfg:this.cfg,drawLine:r(this,lt).bind(this),drawText:r(this,Q).bind(this),drawArea:r(this,q).bind(this)}),this.cfg.isDrawScale&&Z(this,ut,Ht).call(this)}getCurrentTime(){return r(this,F)}setZoom(i=!0){const n=this.cfg.timeSpacingList.findIndex(o=>o===r(this,g));return n>0&&i&&(O(this,g,this.cfg.timeSpacingList[n-1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),n<this.cfg.timeSpacingList.length-1&&!i&&(O(this,g,this.cfg.timeSpacingList[n+1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),r(this,g)}clear(){this.ctx&&this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)}on(i,n){r(this,U).on(i,n)}off(i,n){r(this,U).off(i,n)}}return U=new WeakMap,F=new WeakMap,W=new WeakMap,g=new WeakMap,R=new WeakMap,j=new WeakMap,P=new WeakMap,at=new WeakSet,Yt=function(i){O(this,j,!0);let n=0,o=r(this,F);const l=bt(({offsetX:D})=>{if(!r(this,j))return;const M=D-i.offsetX;o=Math.round(r(this,F)-r(this,g)/this.cfg.scaleSpacing*(M-n)),n=M,this.draw({currentTime:o,areas:r(this,W),_privateFlag:!0})},1e3/this.cfg.fps),$=({offsetX:D,offsetY:M})=>{(D<3||D>this.$canvas.width-3||M<3||M>this.$canvas.height-3)&&(this.$canvas.removeEventListener("mousemove",l),this.$canvas.removeEventListener("mousemove",$))},v=()=>{this.$canvas.removeEventListener("mousemove",l),this.$canvas.removeEventListener("mousemove",$),document.removeEventListener("mouseup",v),O(this,j,!1),r(this,P)&&(clearTimeout(r(this,P)),O(this,P,null)),O(this,P,setTimeout(()=>{Z(this,K,Dt).call(this,"dragged",o),O(this,P,null)},this.cfg.timeNumber))};this.$canvas.addEventListener("mousemove",l),this.$canvas.addEventListener("mousemove",$),document.addEventListener("mouseup",v)},ot=new WeakSet,xt=function(i){i.preventDefault();const n=this.cfg.timeSpacingList.findIndex(o=>o===r(this,g));i.deltaY<0&&n>0?(O(this,g,this.cfg.timeSpacingList[n-1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})):i.deltaY>0&&n<this.cfg.timeSpacingList.length-1&&(O(this,g,this.cfg.timeSpacingList[n+1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),Z(this,K,Dt).call(this,"zoom",r(this,g))},ht=new WeakSet,Ft=function(){this.$canvasParent&&(this.$canvas.width=this.$canvasParent.clientWidth,this.$canvas.height=this.$canvasParent.clientHeight,this.cfg.scaleHeight||O(this,R,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw({currentTime:r(this,F),areas:r(this,W)}))},ct=new WeakSet,Ct=function(){this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)},ut=new WeakSet,Ht=function(){const i=()=>r(this,g)<1e3?`${r(this,g)}ms`:r(this,g)<6e4?`${Math.round(r(this,g)/100)/10}sec`:r(this,g)<36e5?`${Math.round(r(this,g)/100/60)/10}min`:r(this,g)<864e5?`${Math.round(r(this,g)/100/60/60)/10}hours`:r(this,g)<6048e5?`${Math.round(r(this,g)/100/60/60/24)/10}days`:`${Math.round(r(this,g)/100/60/60/24/7)/10}weeks`;r(this,Q).call(this,{x:this.cfg.scaleSpacing+12,y:9,text:i(),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()},lt=new WeakMap,Q=new WeakMap,q=new WeakMap,K=new WeakSet,Dt=function(...i){r(this,U).emit(...i)},d.default=kt,d.format=rt,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),d}({});
(function(m,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(m=typeof globalThis<"u"?globalThis:m||self,d(m.$timeline={}))})(this,function(m){"use strict";var At=Object.defineProperty;var Pt=(m,d,b)=>d in m?At(m,d,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[d]=b;var st=(m,d,b)=>(Pt(m,typeof d!="symbol"?d+"":d,b),b),Tt=(m,d,b)=>{if(!d.has(m))throw TypeError("Cannot "+b)};var r=(m,d,b)=>(Tt(m,d,"read from private field"),b?b.call(m):d.get(m)),C=(m,d,b)=>{if(d.has(m))throw TypeError("Cannot add the same private member more than once");d instanceof WeakSet?d.add(m):d.set(m,b)},O=(m,d,b,nt)=>(Tt(m,d,"write to private field"),nt?nt.call(m,b):d.set(m,b),b);var Z=(m,d,b)=>(Tt(m,d,"access private method"),b);var U,F,W,$,R,j,P,at,xt,ot,Yt,ht,Ft,ct,Ct,ut,Ht,lt,Q,q,K,Dt;function d(f){return{all:f=f||new Map,on:function(i,n){var o=f.get(i);o?o.push(n):f.set(i,[n])},off:function(i,n){var o=f.get(i);o&&(n?o.splice(o.indexOf(n)>>>0,1):f.set(i,[]))},emit:function(i,n){var o=f.get(i);o&&o.slice().map(function(l){l(n)}),(o=f.get("*"))&&o.slice().map(function(l){l(i,n)})}}}var b=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var wt={exports:{}};(function(f,i){(function(n,o){f.exports=o()})(b,function(){var n=1e3,o=6e4,l=36e5,p="millisecond",v="second",D="minute",T="hour",S="day",H="week",w="month",z="quarter",_="year",N="date",ft="Invalid Date",pt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,vt=/\[([^\]]+)]|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,mt={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(h){var s=["th","st","nd","rd"],t=h%100;return"["+h+(s[(t-20)%10]||s[t]||s[0])+"]"}},tt=function(h,s,t){var a=String(h);return!a||a.length>=s?h:""+Array(s+1-a.length).join(t)+h},V={s:tt,z:function(h){var s=-h.utcOffset(),t=Math.abs(s),a=Math.floor(t/60),e=t%60;return(s<=0?"+":"-")+tt(a,2,"0")+":"+tt(e,2,"0")},m:function h(s,t){if(s.date()<t.date())return-h(t,s);var a=12*(t.year()-s.year())+(t.month()-s.month()),e=s.clone().add(a,w),c=t-e<0,u=s.clone().add(a+(c?-1:1),w);return+(-(a+(t-e)/(c?e-u:u-e))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:w,y:_,w:H,d:S,D:N,h:T,m:D,s:v,ms:p,Q:z}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},I="en",A={};A[I]=mt;var bt="$isDayjsObject",Mt=function(h){return h instanceof gt||!(!h||!h[bt])},dt=function h(s,t,a){var e;if(!s)return I;if(typeof s=="string"){var c=s.toLowerCase();A[c]&&(e=c),t&&(A[c]=t,e=c);var u=s.split("-");if(!e&&u.length>1)return h(u[0])}else{var M=s.name;A[M]=s,e=M}return!a&&e&&(I=e),e||!a&&I},x=function(h,s){if(Mt(h))return h.clone();var t=typeof s=="object"?s:{};return t.date=h,t.args=arguments,new gt(t)},g=V;g.l=dt,g.i=Mt,g.w=function(h,s){return x(h,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var gt=function(){function h(t){this.$L=dt(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[bt]=!0}var s=h.prototype;return s.parse=function(t){this.$d=function(a){var e=a.date,c=a.utc;if(e===null)return new Date(NaN);if(g.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(pt);if(u){var M=u[2]-1||0,y=(u[7]||"0").substring(0,3);return c?new Date(Date.UTC(u[1],M,u[3]||1,u[4]||0,u[5]||0,u[6]||0,y)):new Date(u[1],M,u[3]||1,u[4]||0,u[5]||0,u[6]||0,y)}}return new Date(e)}(t),this.init()},s.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()},s.$utils=function(){return g},s.isValid=function(){return this.$d.toString()!==ft},s.isSame=function(t,a){var e=x(t);return this.startOf(a)<=e&&e<=this.endOf(a)},s.isAfter=function(t,a){return x(t)<this.startOf(a)},s.isBefore=function(t,a){return this.endOf(a)<x(t)},s.$g=function(t,a,e){return g.u(t)?this[a]:this.set(e,t)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(t,a){var e=this,c=!!g.u(a)||a,u=g.p(t),M=function(J,E){var X=g.w(e.$u?Date.UTC(e.$y,E,J):new Date(e.$y,E,J),e);return c?X:X.endOf(S)},y=function(J,E){return g.w(e.toDate()[J].apply(e.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(E)),e)},Y=this.$W,L=this.$M,k=this.$D,G="set"+(this.$u?"UTC":"");switch(u){case _:return c?M(1,0):M(31,11);case w:return c?M(1,L):M(0,L+1);case H:var B=this.$locale().weekStart||0,et=(Y<B?Y+7:Y)-B;return M(c?k-et:k+(6-et),L);case S:case N:return y(G+"Hours",0);case T:return y(G+"Minutes",1);case D:return y(G+"Seconds",2);case v:return y(G+"Milliseconds",3);default:return this.clone()}},s.endOf=function(t){return this.startOf(t,!1)},s.$set=function(t,a){var e,c=g.p(t),u="set"+(this.$u?"UTC":""),M=(e={},e[S]=u+"Date",e[N]=u+"Date",e[w]=u+"Month",e[_]=u+"FullYear",e[T]=u+"Hours",e[D]=u+"Minutes",e[v]=u+"Seconds",e[p]=u+"Milliseconds",e)[c],y=c===S?this.$D+(a-this.$W):a;if(c===w||c===_){var Y=this.clone().set(N,1);Y.$d[M](y),Y.init(),this.$d=Y.set(N,Math.min(this.$D,Y.daysInMonth())).$d}else M&&this.$d[M](y);return this.init(),this},s.set=function(t,a){return this.clone().$set(t,a)},s.get=function(t){return this[g.p(t)]()},s.add=function(t,a){var e,c=this;t=Number(t);var u=g.p(a),M=function(L){var k=x(c);return g.w(k.date(k.date()+Math.round(L*t)),c)};if(u===w)return this.set(w,this.$M+t);if(u===_)return this.set(_,this.$y+t);if(u===S)return M(1);if(u===H)return M(7);var y=(e={},e[D]=o,e[T]=l,e[v]=n,e)[u]||1,Y=this.$d.getTime()+t*y;return g.w(Y,this)},s.subtract=function(t,a){return this.add(-1*t,a)},s.format=function(t){var a=this,e=this.$locale();if(!this.isValid())return e.invalidDate||ft;var c=t||"YYYY-MM-DDTHH:mm:ssZ",u=g.z(this),M=this.$H,y=this.$m,Y=this.$M,L=e.weekdays,k=e.months,G=e.meridiem,B=function(E,X,it,$t){return E&&(E[X]||E(a,c))||it[X].slice(0,$t)},et=function(E){return g.s(M%12||12,E,"0")},J=G||function(E,X,it){var $t=E<12?"AM":"PM";return it?$t.toLowerCase():$t};return c.replace(vt,function(E,X){return X||function(it){switch(it){case"YY":return String(a.$y).slice(-2);case"YYYY":return g.s(a.$y,4,"0");case"M":return Y+1;case"MM":return g.s(Y+1,2,"0");case"MMM":return B(e.monthsShort,Y,k,3);case"MMMM":return B(k,Y);case"D":return a.$D;case"DD":return g.s(a.$D,2,"0");case"d":return String(a.$W);case"dd":return B(e.weekdaysMin,a.$W,L,2);case"ddd":return B(e.weekdaysShort,a.$W,L,3);case"dddd":return L[a.$W];case"H":return String(M);case"HH":return g.s(M,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return J(M,y,!0);case"A":return J(M,y,!1);case"m":return String(y);case"mm":return g.s(y,2,"0");case"s":return String(a.$s);case"ss":return g.s(a.$s,2,"0");case"SSS":return g.s(a.$ms,3,"0");case"Z":return u}return null}(E)||u.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(t,a,e){var c,u=this,M=g.p(a),y=x(t),Y=(y.utcOffset()-this.utcOffset())*o,L=this-y,k=function(){return g.m(u,y)};switch(M){case _:c=k()/12;break;case w:c=k();break;case z:c=k()/3;break;case H:c=(L-Y)/6048e5;break;case S:c=(L-Y)/864e5;break;case T:c=L/l;break;case D:c=L/o;break;case v:c=L/n;break;default:c=L}return e?c:g.a(c)},s.daysInMonth=function(){return this.endOf(w).$D},s.$locale=function(){return A[this.$L]},s.locale=function(t,a){if(!t)return this.$L;var e=this.clone(),c=dt(t,a,!0);return c&&(e.$L=c),e},s.clone=function(){return g.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},h}(),St=gt.prototype;return x.prototype=St,[["$ms",p],["$s",v],["$m",D],["$H",T],["$W",S],["$M",w],["$y",_],["$D",N]].forEach(function(h){St[h[1]]=function(s){return this.$g(s,h[0],h[1])}}),x.extend=function(h,s){return h.$i||(h(s,gt,x),h.$i=!0),x},x.locale=dt,x.isDayjs=Mt,x.unix=function(h){return x(1e3*h)},x.en=A[I],x.Ls=A,x.p={},x})})(wt);var Lt=wt.exports;const Ot=nt(Lt),rt=(f,i="MM/DD HH:mm")=>Ot(f).format(i),yt=(f,i)=>{let n,o=0;return(...l)=>{const p=Date.now(),v=p-o;!o||v>=i?(o=p,f.apply(void 0,l)):n||(n=setTimeout(()=>{o=p,f.apply(void 0,l),n=null},i-v))}},_t=(f,i)=>{const n=document.createElement("canvas");n.width=n.height=1;const o=n.getContext("2d");o.fillStyle=f,o.fillRect(0,0,1,1);const l=o.getImageData(0,0,1,1).data;return`rgba(${l[0]}, ${l[1]}, ${l[2]}, ${i})`},Et=({xCenterPoint:f,cfg:i,timePerPixel:n,timeSpacing:o,currentTime:l,$canvas:p,screenScaleCount:v,scaleHeight:D,startTime:T,drawLine:S,drawText:H,drawArea:w})=>{const z=({space:N,scaleTimeFormat:ft,bgTimeFormat:pt,pointerTimeFormat:vt})=>{H({x:p.width-f/10,y:6,text:rt(l,pt),fontSize:`${p.height-5}px`,align:"right",baseLine:"top",color:i.bgTextColor});const mt=T%o,tt=mt/n;for(let V=0;V<v;V++){const I=V*i.scaleSpacing-tt-i.pointerWidth/2,A=T+V*o-mt;if(A%(o*N)===0){S({x:I,y:D.long}),H({x:I,y:p.height-D.long-5,text:rt(A,ft),baseLine:"bottom"});continue}S({x:I,y:D.short})}S({x:f-i.pointerWidth/2,y:p.height,width:i.pointerWidth,color:i.pointerColor}),w({startX:f-i.pointerDisplayWidth/2,startY:4,endX:f+i.pointerDisplayWidth/2,endY:4+i.pointerDisplayHeight,bgColor:i.pointerColor}),H({x:f,y:i.pointerDisplayHeight/2+5,text:rt(l,vt),align:"center",baseLine:"middle"})},_=i.thresholdsConfig[o];_&&z({space:_.space,scaleTimeFormat:_.scaleTimeFormat,bgTimeFormat:_.bgTimeFormat,pointerTimeFormat:_.pointerTimeFormat})},Wt={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}}};class kt{constructor(i,n){C(this,at);C(this,ot);C(this,ht);C(this,ct);C(this,ut);C(this,K);st(this,"$canvas");st(this,"$canvasParent");st(this,"ctx");st(this,"cfg");C(this,U,d());C(this,F,0);C(this,W,void 0);C(this,$,void 0);C(this,R,void 0);C(this,j,!1);C(this,P,null);C(this,lt,({x:i,y:n,width:o=1,color:l=this.cfg.scaleColor})=>{this.ctx.beginPath(),this.ctx.moveTo(i,this.$canvas.height),this.ctx.lineTo(i,this.$canvas.height-n),this.ctx.closePath(),this.ctx.strokeStyle=l,this.ctx.lineWidth=o,this.ctx.stroke()});C(this,Q,({x:i,y:n,text:o,color:l=this.cfg.textColor,fontSize:p="11px",align:v="center",baseLine:D="alphabetic"})=>{this.ctx.beginPath(),this.ctx.font=`${p} ${this.cfg.fontFamily}`,this.ctx.fillStyle=l,this.ctx.textAlign=v,this.ctx.textBaseline=D,this.ctx.fillText(o,i,n)});C(this,q,({startX:i,startY:n,endX:o,endY:l,bgColor:p})=>{this.ctx.beginPath(),this.ctx.rect(i,n,o-i,l-n),this.ctx.fillStyle=p,this.ctx.fill()});if(!i)throw new Error("canvas Element Or Element ID is required!");typeof i=="string"?this.$canvas=document.querySelector(i):this.$canvas=i,this.ctx=this.$canvas.getContext("2d"),this.cfg={...Wt,...n},n!=null&&n.pointColor&&(this.cfg.pointerColor=n.pointColor),n!=null&&n.pointWidth&&(this.cfg.pointerWidth=n.pointWidth);const{fill:o,width:l,height:p,zoom:v,timeSpacingList:D,scaleHeight:T,textColor:S,bgTextColor:H}=this.cfg;if(H||(this.cfg.bgTextColor=_t(S,.18)),v<0||v>=D.length||v%1!==0)throw new Error(`zoom must be 0 ~ ${D.length-1}, and must be an integer`);if(o){const w=this.$canvas.parentElement;this.$canvasParent=w,this.$canvas.width=w.clientWidth,this.$canvas.height=w.clientHeight,new ResizeObserver(yt(Z(this,ht,Ft).bind(this),200)).observe(w)}else this.$canvas.width=l,this.$canvas.height=p;O(this,$,D[v]),T!=null&&T.long&&(T!=null&&T.short)?O(this,R,T):O(this,R,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw(),this.$canvas.addEventListener("wheel",Z(this,ot,Yt).bind(this),{passive:!1}),this.$canvas.addEventListener("mousedown",Z(this,at,xt).bind(this))}setTimeMove({timestamp:i,direction:n},o=!0){if(!r(this,P)&&!r(this,j)){let l=i;o||(l=n?r(this,F)+i:r(this,F)-i),this.draw({currentTime:l,areas:r(this,W),_privateFlag:!0})}}draw({currentTime:i,areas:n,_privateFlag:o}={}){if(r(this,j)&&!o)return;O(this,F,i||Date.now()),O(this,W,n||[]);const l=Math.ceil(this.$canvas.width/this.cfg.scaleSpacing),p=l*r(this,$),v=r(this,F)-p/2,D=r(this,F)+p/2,T=this.$canvas.width/2,S=p/this.$canvas.width;Z(this,ct,Ct).call(this),r(this,q).call(this,{startX:0,startY:0,endX:this.$canvas.width,endY:this.$canvas.height,bgColor:this.cfg.bgColor}),r(this,W).forEach(H=>{const w=H.startTime<=v?0:Math.round((H.startTime-v)/S),z=H.endTime>=D?this.$canvas.width:Math.round((H.endTime-v)/S);w<this.$canvas.width&&z>0&&r(this,q).call(this,{startX:w,startY:0,endX:z,endY:this.$canvas.height,bgColor:H.bgColor||this.cfg.areaBgColor})}),Et.bind(this)({xCenterPoint:T,screenScaleCount:l,startTime:v,timePerPixel:S,scaleHeight:r(this,R),timeSpacing:r(this,$),currentTime:r(this,F),$canvas:this.$canvas,cfg:this.cfg,drawLine:r(this,lt).bind(this),drawText:r(this,Q).bind(this),drawArea:r(this,q).bind(this)}),this.cfg.isDrawScale&&Z(this,ut,Ht).call(this)}getCurrentTime(){return r(this,F)}setZoom(i=!0){const n=this.cfg.timeSpacingList.findIndex(o=>o===r(this,$));return n>0&&i&&(O(this,$,this.cfg.timeSpacingList[n-1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),n<this.cfg.timeSpacingList.length-1&&!i&&(O(this,$,this.cfg.timeSpacingList[n+1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),r(this,$)}clear(){this.ctx&&this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)}on(i,n){r(this,U).on(i,n)}off(i,n){r(this,U).off(i,n)}}U=new WeakMap,F=new WeakMap,W=new WeakMap,$=new WeakMap,R=new WeakMap,j=new WeakMap,P=new WeakMap,at=new WeakSet,xt=function(i){O(this,j,!0);let n=0,o=r(this,F);const l=yt(({offsetX:D})=>{if(!r(this,j))return;const T=D-i.offsetX;o=Math.round(r(this,F)-r(this,$)/this.cfg.scaleSpacing*(T-n)),n=T,this.draw({currentTime:o,areas:r(this,W),_privateFlag:!0})},1e3/this.cfg.fps),p=({offsetX:D,offsetY:T})=>{(D<3||D>this.$canvas.width-3||T<3||T>this.$canvas.height-3)&&(this.$canvas.removeEventListener("mousemove",l),this.$canvas.removeEventListener("mousemove",p))},v=()=>{this.$canvas.removeEventListener("mousemove",l),this.$canvas.removeEventListener("mousemove",p),document.removeEventListener("mouseup",v),O(this,j,!1),r(this,P)&&(clearTimeout(r(this,P)),O(this,P,null)),O(this,P,setTimeout(()=>{Z(this,K,Dt).call(this,"dragged",o),O(this,P,null)},this.cfg.timeNumber))};this.$canvas.addEventListener("mousemove",l),this.$canvas.addEventListener("mousemove",p),document.addEventListener("mouseup",v)},ot=new WeakSet,Yt=function(i){i.preventDefault();const n=this.cfg.timeSpacingList.findIndex(o=>o===r(this,$));i.deltaY<0&&n>0?(O(this,$,this.cfg.timeSpacingList[n-1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})):i.deltaY>0&&n<this.cfg.timeSpacingList.length-1&&(O(this,$,this.cfg.timeSpacingList[n+1]),this.draw({currentTime:r(this,F),areas:r(this,W),_privateFlag:!0})),Z(this,K,Dt).call(this,"zoom",r(this,$))},ht=new WeakSet,Ft=function(){this.$canvasParent&&(this.$canvas.width=this.$canvasParent.clientWidth,this.$canvas.height=this.$canvasParent.clientHeight,this.cfg.scaleHeight||O(this,R,{long:this.$canvas.height/3,medium:this.$canvas.height/6,short:this.$canvas.height/10}),this.draw({currentTime:r(this,F),areas:r(this,W)}))},ct=new WeakSet,Ct=function(){this.ctx.clearRect(0,0,this.$canvas.width,this.$canvas.height)},ut=new WeakSet,Ht=function(){const i=()=>r(this,$)<1e3?`${r(this,$)}ms`:r(this,$)<6e4?`${Math.round(r(this,$)/100)/10}sec`:r(this,$)<36e5?`${Math.round(r(this,$)/100/60)/10}min`:r(this,$)<864e5?`${Math.round(r(this,$)/100/60/60)/10}hours`:r(this,$)<6048e5?`${Math.round(r(this,$)/100/60/60/24)/10}days`:`${Math.round(r(this,$)/100/60/60/24/7)/10}weeks`;r(this,Q).call(this,{x:this.cfg.scaleSpacing+12,y:9,text:i(),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()},lt=new WeakMap,Q=new WeakMap,q=new WeakMap,K=new WeakSet,Dt=function(...i){r(this,U).emit(...i)},m.default=kt,m.format=rt,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

@@ -0,0 +0,0 @@ {

{ "extends": "dtslint/dt.json" }

@@ -0,0 +0,0 @@ // TypeScript Version: 2.3

@@ -0,0 +0,0 @@ import mpegts from '../';

@@ -0,0 +0,0 @@ {

@@ -48,3 +48,2 @@ const webpack = require('webpack');

test: /\.(css)$/,
exclude: /node-modules/,
use: [

@@ -57,3 +56,2 @@ MiniCssExtractPlugin.loader,

test: /\.(less)$/,
exclude: /node-modules/,
use: [

@@ -67,3 +65,2 @@ MiniCssExtractPlugin.loader,

test: /\.(sass|scss)$/,
exclude: /node-modules/,
use: [

@@ -77,4 +74,4 @@ // MiniCssExtractPlugin.loader,

test: /\.(ts|js)$/,
exclude: /node-modules/,
use: 'ts-loader',
exclude: /node-modules/
},

@@ -84,8 +81,6 @@ {

test: /\.js$/,
exclude: /node-modules/,
use: 'source-map-loader',
use: 'source-map-loader'
},
{
test: /\.worker\.(c|m)?js$/i,
exclude: /node-modules/,
loader: "worker-loader",

@@ -96,3 +91,3 @@ options: { inline: "fallback" },

test: /\.worklet\.js$/,
exclude: /node-modules/,
exclude: [/node_modules/],
use: {

@@ -99,0 +94,0 @@ loader: 'worklet-loader',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display