@byomakase/omakase-react-components 0.0.1-SNAPSHOT.1743070950
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/README.md +3 -0
- package/dist/index.cjs.js +213 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.d.ts +2 -0
- package/dist/index.es.js +3959 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +213 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/omakase-react-components.css +1 -0
- package/dist/react/omakase-components/src/components/OmakaseMarkerListComponent/OmakaseMarkerListComponent.d.ts +10 -0
- package/dist/react/omakase-components/src/components/OmakaseMarkerListComponent/index.d.ts +1 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerComponent/OmakasePlayerComponent.d.ts +12 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerComponent/OmakasePlayerHotKeyHandler.d.ts +5 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerComponent/index.d.ts +1 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineComponent/OmakasePlayerTimelineComponent.d.ts +9 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineComponent/OmaksePlayerTimelineBuilder.d.ts +21 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineComponent/index.d.ts +2 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineControlsToolbar/OmakaseButton.d.ts +12 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineControlsToolbar/OmakasePlayerTimelineControlsToolbar.d.ts +25 -0
- package/dist/react/omakase-components/src/components/OmakasePlayerTimelineControlsToolbar/index.d.ts +1 -0
- package/dist/react/omakase-components/src/components/OmakaseTamsPlayerComponent/OmakaseTamsPlayerComponent.d.ts +17 -0
- package/dist/react/omakase-components/src/components/OmakaseTamsPlayerComponent/index.d.ts +1 -0
- package/dist/react/omakase-components/src/components/OmakaseTamsPlayerComponent/virtual-manifest/m3u8-exporter.d.ts +2 -0
- package/dist/react/omakase-components/src/components/OmakaseTamsPlayerComponent/virtual-manifest/m3u8.d.ts +79 -0
- package/dist/react/omakase-components/src/components/OmakaseTamsPlayerComponent/virtual-manifest/m3u8.model.d.ts +127 -0
- package/dist/react/omakase-components/src/components/OmakaseTimeRangePicker/OmakaseTimeRangePicker.d.ts +11 -0
- package/dist/react/omakase-components/src/components/OmakaseTimeRangePicker/index.d.ts +1 -0
- package/dist/react/omakase-components/src/components/index.d.ts +7 -0
- package/dist/react/omakase-components/src/icons/Back3Icon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/DeleteMarkerIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/Forward3Icon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/LeftBracketIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/LeftDoubleBracketIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/LeftMarkerIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/PlusIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/RefreshIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/RightBracketIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/RightDoubleBracketIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/RightMarkerIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/SplitMarkerIcon.d.ts +3 -0
- package/dist/react/omakase-components/src/icons/index.d.ts +1 -0
- package/dist/react/omakase-components/src/index.d.ts +3 -0
- package/dist/react/omakase-components/src/types/tams/index.d.ts +1 -0
- package/dist/react/omakase-components/src/types/tams/model/audio-codec-parameters.d.ts +19 -0
- package/dist/react/omakase-components/src/types/tams/model/audio-flow-essence-parameters.d.ts +21 -0
- package/dist/react/omakase-components/src/types/tams/model/audio-flow.d.ts +104 -0
- package/dist/react/omakase-components/src/types/tams/model/avc-codec-parameters.d.ts +23 -0
- package/dist/react/omakase-components/src/types/tams/model/collection-item.d.ts +15 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping-audio-track.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping-isobmff-container.d.ts +18 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping-mp2ts-container.d.ts +18 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping-mxf-container.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping.d.ts +21 -0
- package/dist/react/omakase-components/src/types/tams/model/container-mapping1.d.ts +21 -0
- package/dist/react/omakase-components/src/types/tams/model/contentformat.d.ts +19 -0
- package/dist/react/omakase-components/src/types/tams/model/data-flow-essence-parameters.d.ts +18 -0
- package/dist/react/omakase-components/src/types/tams/model/data-flow.d.ts +104 -0
- package/dist/react/omakase-components/src/types/tams/model/deletion-request-error.d.ts +30 -0
- package/dist/react/omakase-components/src/types/tams/model/deletion-request.d.ts +56 -0
- package/dist/react/omakase-components/src/types/tams/model/event-stream-mechanism.d.ts +26 -0
- package/dist/react/omakase-components/src/types/tams/model/flow-core-segment-duration.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/flow-segment-get-urls-inner.d.ts +19 -0
- package/dist/react/omakase-components/src/types/tams/model/flow-segment.d.ts +38 -0
- package/dist/react/omakase-components/src/types/tams/model/flow-segment1.d.ts +38 -0
- package/dist/react/omakase-components/src/types/tams/model/flow-storage-post.d.ts +18 -0
- package/dist/react/omakase-components/src/types/tams/model/flow.d.ts +14 -0
- package/dist/react/omakase-components/src/types/tams/model/http-request.d.ts +32 -0
- package/dist/react/omakase-components/src/types/tams/model/image-flow-essence-parameters.d.ts +19 -0
- package/dist/react/omakase-components/src/types/tams/model/image-flow.d.ts +104 -0
- package/dist/react/omakase-components/src/types/tams/model/media-bucket-object-store-media-objects-inner.d.ts +12 -0
- package/dist/react/omakase-components/src/types/tams/model/media-bucket-object-store-pre-inner.d.ts +19 -0
- package/dist/react/omakase-components/src/types/tams/model/media-bucket-object-store.d.ts +16 -0
- package/dist/react/omakase-components/src/types/tams/model/models.d.ts +41 -0
- package/dist/react/omakase-components/src/types/tams/model/multi-essence-flow.d.ts +102 -0
- package/dist/react/omakase-components/src/types/tams/model/register-webhook.d.ts +50 -0
- package/dist/react/omakase-components/src/types/tams/model/register-webhook1.d.ts +50 -0
- package/dist/react/omakase-components/src/types/tams/model/service-media-store.d.ts +24 -0
- package/dist/react/omakase-components/src/types/tams/model/service.d.ts +32 -0
- package/dist/react/omakase-components/src/types/tams/model/source.d.ts +61 -0
- package/dist/react/omakase-components/src/types/tams/model/uncompressed-audio-parameters.d.ts +23 -0
- package/dist/react/omakase-components/src/types/tams/model/uncompressed-video-parameters.d.ts +36 -0
- package/dist/react/omakase-components/src/types/tams/model/update-service-info.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/video-flow-essence-parameters-aspect-ratio.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/video-flow-essence-parameters-frame-rate.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/video-flow-essence-parameters-pixel-aspect-ratio.d.ts +22 -0
- package/dist/react/omakase-components/src/types/tams/model/video-flow-essence-parameters.d.ts +78 -0
- package/dist/react/omakase-components/src/types/tams/model/video-flow.d.ts +104 -0
- package/dist/react/omakase-components/src/types/user-agent.d.ts +2 -0
- package/dist/react/omakase-components/src/util/array-util.d.ts +3 -0
- package/dist/react/omakase-components/src/util/blob-util.d.ts +7 -0
- package/dist/react/omakase-components/src/util/color-util.d.ts +21 -0
- package/dist/react/omakase-components/src/util/crypto-util.d.ts +3 -0
- package/dist/react/omakase-components/src/util/frame-rate-util.d.ts +3 -0
- package/dist/react/omakase-components/src/util/object-util.d.ts +1 -0
- package/dist/react/omakase-components/src/util/player-util.d.ts +3 -0
- package/dist/react/omakase-components/src/util/rxjs-util.d.ts +2 -0
- package/dist/react/omakase-components/src/util/string-util.d.ts +9 -0
- package/dist/react/omakase-components/src/util/time-range-util.d.ts +38 -0
- package/dist/react/omakase-components/src/util/timecode-util.d.ts +10 -0
- package/dist/react/omakase-components/src/util/window-util.d.ts +6 -0
- package/dist/react/omakase-components/vite.config.d.ts +2 -0
- package/package.json +32 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";var nn=Object.defineProperty;var rn=(e,t,n)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var v=(e,t,n)=>rn(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("@byomakase/omakase-player"),p=require("react");class on{constructor(t){v(this,"_lanes",[]);v(this,"_markersLaneMap",new Map);v(this,"_laneNodenMap",new Map);this.omakasePlayer=t}addMarkerLane(t){const n={config:t,type:"marker"};this._lanes.push(n)}addMarkers(t,n){this._markersLaneMap.get(t)===void 0&&this._markersLaneMap.set(t,[]),this._markersLaneMap.get(t).push(...n)}addTimelineNode(t,n){this._laneNodenMap.get(t)||this._laneNodenMap.set(t,[]),this._laneNodenMap.get(t).push(n)}addThumbnailLane(t){const n={config:t,type:"thumbnail"};this._lanes.push(n)}buildAndAttachTimeline(t){this.omakasePlayer.createTimeline(t).subscribe({next:n=>{this.buildAttachedTimeline(n)}})}buildAttachedTimeline(t){this._lanes.forEach(n=>this._createAndAttachLane(t,n))}_createAndAttachLane(t,n){let r;if(n.type==="marker"){r=new q.MarkerLane(n.config),t.addTimelineLane(r);const o=this._markersLaneMap.get(r.id);o==null||o.forEach(s=>r.addMarker(s))}else n.type==="thumbnail"&&(r=new q.ThumbnailLane(n.config),t.addTimelineLane(r));const i=this._laneNodenMap.get(r.id);i==null||i.forEach(o=>{r.addTimelineNode(o.config)})}}var Je=function(e,t){return Je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Je(e,t)};function xe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Je(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function sn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(c){try{u(r.next(c))}catch(d){s(d)}}function l(c){try{u(r.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function St(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function be(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Be(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function ve(e){return this instanceof ve?(this.v=e,this):new ve(e)}function an(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(h){return function(b){return Promise.resolve(b).then(h,d)}}function a(h,b){r[h]&&(i[h]=function(g){return new Promise(function(_,L){o.push([h,g,_,L])>1||l(h,g)})},b&&(i[h]=b(i[h])))}function l(h,b){try{u(r[h](b))}catch(g){f(o[0][3],g)}}function u(h){h.value instanceof ve?Promise.resolve(h.value.v).then(c,d):f(o[0][2],h)}function c(h){l("next",h)}function d(h){l("throw",h)}function f(h,b){h(b),o.shift(),o.length&&l(o[0][0],o[0][1])}}function un(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof be=="function"?be(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,l){s=e[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function R(e){return typeof e=="function"}function at(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ze=at(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
|
+
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Qe(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ze=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=be(s),l=a.next();!l.done;l=a.next()){var u=l.value;u.remove(this)}}catch(g){t={error:g}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else s.remove(this);var c=this.initialTeardown;if(R(c))try{c()}catch(g){o=g instanceof ze?g.errors:[g]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=be(d),h=f.next();!h.done;h=f.next()){var b=h.value;try{ft(b)}catch(g){o=o??[],g instanceof ze?o=Be(Be([],Fe(o)),Fe(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new ze(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ft(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Qe(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Qe(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Ct=Ze.EMPTY;function Tt(e){return e instanceof Ze||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function ft(e){R(e)?e():e.unsubscribe()}var ln={Promise:void 0},cn={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Be([e,t],Fe(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Lt(e){cn.setTimeout(function(){throw e})}function et(){}function Re(e){e()}var ut=function(e){xe(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Tt(n)&&n.add(r)):r.destination=hn,r}return t.create=function(n,r,i){return new tt(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ze),fn=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){Ne(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Ne(r)}else Ne(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Ne(n)}},e}(),tt=function(e){xe(t,e);function t(n,r,i){var o=e.call(this)||this,s;return R(n)||!n?s={next:n??void 0,error:r??void 0,complete:i??void 0}:s=n,o.destination=new fn(s),o}return t}(ut);function Ne(e){Lt(e)}function dn(e){throw e}var hn={closed:!0,next:et,error:dn,complete:et},lt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $e(e){return e}function mn(e){return e.length===0?$e:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Z=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=gn(t)?t:new tt(t,n,r);return Re(function(){var s=i,a=s.operator,l=s.source;o.add(a?a.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=dt(n),new n(function(i,o){var s=new tt({next:function(a){try{t(a)}catch(l){o(l),s.unsubscribe()}},error:o,complete:i});r.subscribe(s)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[lt]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mn(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=dt(t),new t(function(r,i){var o;n.subscribe(function(s){return o=s},function(s){return i(s)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function dt(e){var t;return(t=e??ln.Promise)!==null&&t!==void 0?t:Promise}function pn(e){return e&&R(e.next)&&R(e.error)&&R(e.complete)}function gn(e){return e&&e instanceof ut||pn(e)&&Tt(e)}function vn(e){return R(e==null?void 0:e.lift)}function ie(e){return function(t){if(vn(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function oe(e,t,n,r,i){return new bn(e,t,n,r,i)}var bn=function(e){xe(t,e);function t(n,r,i,o,s,a){var l=e.call(this,n)||this;return l.onFinalize=s,l.shouldUnsubscribe=a,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:e.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(ut),wn=at(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ue=function(e){xe(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new ht(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new wn},t.prototype.next=function(n){var r=this;Re(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var s=be(r.currentObservers),a=s.next();!a.done;a=s.next()){var l=a.value;l.next(n)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Re(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;Re(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,s=i.isStopped,a=i.observers;return o||s?Ct:(this.currentObservers=null,a.push(n),new Ze(function(){r.currentObservers=null,Qe(a,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,s=r.isStopped;i?n.error(o):s&&n.complete()},t.prototype.asObservable=function(){var n=new Z;return n.source=this,n},t.create=function(n,r){return new ht(n,r)},t}(Z),ht=function(e){xe(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Ct},t}(ue),En=new Z(function(e){return e.complete()});function Sn(e){return e&&R(e.schedule)}function _t(e){return e[e.length-1]}function Cn(e){return R(_t(e))?e.pop():void 0}function Tn(e){return Sn(_t(e))?e.pop():void 0}var yt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function xt(e){return R(e==null?void 0:e.then)}function Ot(e){return R(e[lt])}function It(e){return Symbol.asyncIterator&&R(e==null?void 0:e[Symbol.asyncIterator])}function Nt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ln(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var At=Ln();function Mt(e){return R(e==null?void 0:e[At])}function kt(e){return an(this,arguments,function(){var n,r,i,o;return St(this,function(s){switch(s.label){case 0:n=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,ve(n.read())];case 3:return r=s.sent(),i=r.value,o=r.done,o?[4,ve(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,ve(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Rt(e){return R(e==null?void 0:e.getReader)}function qe(e){if(e instanceof Z)return e;if(e!=null){if(Ot(e))return _n(e);if(yt(e))return yn(e);if(xt(e))return xn(e);if(It(e))return Dt(e);if(Mt(e))return On(e);if(Rt(e))return In(e)}throw Nt(e)}function _n(e){return new Z(function(t){var n=e[lt]();if(R(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function yn(e){return new Z(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function xn(e){return new Z(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Lt)})}function On(e){return new Z(function(t){var n,r;try{for(var i=be(e),o=i.next();!o.done;o=i.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Dt(e){return new Z(function(t){Nn(e,t).catch(function(n){return t.error(n)})})}function In(e){return Dt(kt(e))}function Nn(e,t){var n,r,i,o;return sn(this,void 0,void 0,function(){var s,a;return St(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=un(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(s=r.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ne(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function Vt(e,t){return t===void 0&&(t=0),ie(function(n,r){n.subscribe(oe(r,function(i){return ne(r,e,function(){return r.next(i)},t)},function(){return ne(r,e,function(){return r.complete()},t)},function(i){return ne(r,e,function(){return r.error(i)},t)}))})}function Ft(e,t){return t===void 0&&(t=0),ie(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function An(e,t){return qe(e).pipe(Ft(t),Vt(t))}function Mn(e,t){return qe(e).pipe(Ft(t),Vt(t))}function kn(e,t){return new Z(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Rn(e,t){return new Z(function(n){var r;return ne(n,t,function(){r=e[At](),ne(n,t,function(){var i,o,s;try{i=r.next(),o=i.value,s=i.done}catch(a){n.error(a);return}s?n.complete():n.next(o)},0,!0)}),function(){return R(r==null?void 0:r.return)&&r.return()}})}function Bt(e,t){if(!e)throw new Error("Iterable cannot be null");return new Z(function(n){ne(n,t,function(){var r=e[Symbol.asyncIterator]();ne(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Dn(e,t){return Bt(kt(e),t)}function Vn(e,t){if(e!=null){if(Ot(e))return An(e,t);if(yt(e))return kn(e,t);if(xt(e))return Mn(e,t);if(It(e))return Bt(e,t);if(Mt(e))return Rn(e,t);if(Rt(e))return Dn(e,t)}throw Nt(e)}function Ht(e,t){return t?Vn(e,t):qe(e)}var Ut=at(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Fn(e,t){return ie(function(n,r){var i=0;n.subscribe(oe(r,function(o){r.next(e.call(t,o,i++))}))})}var Bn=Array.isArray;function Hn(e,t){return Bn(t)?e.apply(void 0,Be([],Fe(t))):e(t)}function Un(e){return Fn(function(t){return Hn(e,t)})}var Pn=Array.isArray,Zn=Object.getPrototypeOf,$n=Object.prototype,qn=Object.keys;function Wn(e){if(e.length===1){var t=e[0];if(Pn(t))return{args:t,keys:null};if(Xn(t)){var n=qn(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function Xn(e){return e&&typeof e=="object"&&Zn(e)===$n}function jn(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function Kn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Tn(e),r=Cn(e),i=Wn(e),o=i.args,s=i.keys;if(o.length===0)return Ht([],n);var a=new Z(zn(o,n,s?function(l){return jn(s,l)}:$e));return r?a.pipe(Un(r)):a}function zn(e,t,n){return n===void 0&&(n=$e),function(r){mt(t,function(){for(var i=e.length,o=new Array(i),s=i,a=i,l=function(c){mt(t,function(){var d=Ht(e[c],t),f=!1;d.subscribe(oe(r,function(h){o[c]=h,f||(f=!0,a--),a||r.next(n(o.slice()))},function(){--s||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function mt(e,t,n){e?ne(n,e,t):t()}function Gn(e,t){return ie(function(n,r){var i=0;n.subscribe(oe(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function Yn(e){return ie(function(t,n){var r=!1;t.subscribe(oe(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}function Jn(e){return e<=0?function(){return En}:ie(function(t,n){var r=0;t.subscribe(oe(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function Qn(e){return e===void 0&&(e=er),ie(function(t,n){var r=!1;t.subscribe(oe(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}function er(){return new Ut}function ge(e,t){var n=arguments.length>=2;return function(r){return r.pipe($e,Jn(1),n?Yn(t):Qn(function(){return new Ut}))}}function U(e){return ie(function(t,n){qe(e).subscribe(oe(n,function(){return n.complete()},et)),!n.closed&&t.subscribe(n)})}const tr=p.memo(({omakasePlayer:e,timelinePopulateFn:t,timelineConfig:n})=>(p.useEffect(()=>{n.timelineHTMLElementId===void 0&&(n.timelineHTMLElementId="omakase-timeline"),e.createTimeline(n).subscribe({next:r=>{Kn([e.timeline.onReady$,e.video.onVideoLoaded$.pipe(Gn(i=>!!i))]).subscribe({next:()=>t(r)})}})},[e]),p.createElement("div",{id:n.timelineHTMLElementId}))),Le=[.25,.5,.75,1,2,4,8];class nr{static handleKeyboardEvent(t,n,r){var s;const i=t.target;if(["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"].includes(i.tagName.toUpperCase()))return!1;if(n&&n.video){if(t.code==="Space"&&(r!=="safari"||!n.video.isFullscreen()))return n.video.togglePlayPause(),!0;if(t.code==="KeyS"&&!t.shiftKey&&!t.ctrlKey)return n.video.toggleMuteUnmute(),!0;if(t.code==="Backslash"){let a=10,l=t.shiftKey?1:-1,u=n.video.getVolume()*100+a*l;u>=100?u=100:u<=0&&(u=0),n.video.setVolume(u/100)}if(t.key==="'"&&((s=n.timeline)==null||s.toggleTimecodeEdit()),t.code==="KeyD"&&!(t.ctrlKey&&t.shiftKey))return n.subtitles.toggleShowHideActiveTrack(),!0;if(t.code==="KeyK"&&(n.video.setPlaybackRate(1),n.video.pause()),t.code==="KeyL"){let a=t.shiftKey?1:-1;const l=Le.indexOf(n.video.getPlaybackRate())+a;let u;return l<0?u=Le.at(0):l>=Le.length?u=Le.at(-1):u=Le.at(l),n.video.setPlaybackRate(u),n.video.isPaused()&&n.video.play(),!0}if(n.video.isVideoLoaded()){if(["ArrowLeft","ArrowRight"].includes(t.key)&&!t.metaKey&&!t.altKey){let a=t.key==="ArrowRight"?1:-1,l=t.shiftKey?10:1;return n.video.isPlaying()&&n.video.pause(),n.video.seekFromCurrentFrame(l*a),!0}if(t.code==="Digit1"&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey||t.code==="Home")return n.video.pause().subscribe(()=>n.video.seekToFrame(0)),!0;if(t.code==="Digit1"&&t.ctrlKey||t.code==="End")return n.video.isPlaying()?n.video.pause().subscribe(()=>n.video.seekToEnd()):n.video.seekToEnd(),!0}if(t.code==="KeyF")return n.video.toggleFullscreen(),!0;if(t.code==="Digit0")return n.timeline.zoomToEased(100),!0;if(t.key==="=")return n.timeline.zoomInEased(),!0;if(t.key==="-")return n.timeline.zoomOutEased(),!0}return!1}}const Pt=p.memo(function({videoUrl:t,fps:n,config:r,videoLoadOptions:i,setOmakasePlayer:o,enableHotkeys:s}){return p.useEffect(()=>{var c,d;const a={...r,playerHTMLElementId:"omakase-player"};let l=new q.OmakasePlayer(a);o&&o(f=>f??l),s&&((c=document.querySelector("media-controller"))==null||c.setAttribute("nohotkeys",""),(d=document.querySelector("media-controller"))==null||d.setAttribute("tabindex","-1"),window.onkeydown=f=>{nr.handleKeyboardEvent(f,l)&&(f.stopPropagation(),f.preventDefault())});const u={...i,protocol:"hls"};return l.loadVideo(t,n,u),()=>{s&&(window.onkeydown=null)}},[t,n]),p.createElement("div",{id:"omakase-player"})}),rr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M10.5675 21C10.2375 21 9.9675 20.73 9.9675 20.4V16.7925L5.6325 12.3675L9.9675 8.235V3.6C9.9675 3.27 10.2375 3 10.5675 3C10.8975 3 11.1675 3.27 11.1675 3.6V8.7525L7.3425 12.3975L11.1675 16.305V20.4C11.1675 20.73 10.8975 21 10.5675 21Z",fill:"#CACFEA"}),p.createElement("path",{d:"M17.7675 17.145C17.61 17.145 17.46 17.085 17.34 16.965L12.8325 12.3675L17.355 8.0625C17.595 7.8375 17.9775 7.845 18.2025 8.085C18.4275 8.325 18.42 8.7075 18.18 8.9325L14.5425 12.3975L18.195 16.125C18.4275 16.365 18.42 16.74 18.1875 16.9725C18.075 17.085 17.9175 17.145 17.7675 17.145Z",fill:"#CACFEA"})),ir=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M13.4325 21C13.7625 21 14.0325 20.73 14.0325 20.4V16.7925L18.3675 12.3675L14.0325 8.235V3.6C14.0325 3.27 13.7625 3 13.4325 3C13.1025 3 12.8325 3.27 12.8325 3.6V8.7525L16.6575 12.3975L12.8325 16.305V20.4C12.8325 20.73 13.1025 21 13.4325 21Z",fill:"#CACFEA"}),p.createElement("path",{d:"M6.2325 17.145C6.39 17.145 6.54 17.085 6.66 16.965L11.1675 12.3675L6.645 8.0625C6.405 7.8375 6.0225 7.845 5.7975 8.085C5.5725 8.325 5.58 8.7075 5.82 8.9325L9.4575 12.3975L5.805 16.125C5.5725 16.365 5.58 16.74 5.8125 16.9725C5.925 17.085 6.0825 17.145 6.2325 17.145Z",fill:"#CACFEA"})),or=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M14.1675 21C13.8375 21 13.5675 20.73 13.5675 20.4V16.7925L9.2325 12.3675L13.5675 8.235V3.6C13.5675 3.27 13.8375 3 14.1675 3C14.4975 3 14.7675 3.27 14.7675 3.6V8.7525L10.9425 12.3975L14.7675 16.305V20.4C14.7675 20.73 14.4975 21 14.1675 21Z",fill:"#CACFEA"})),sr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M9.8325 21C10.1625 21 10.4325 20.73 10.4325 20.4V16.7925L14.7675 12.3675L10.4325 8.235V3.6C10.4325 3.27 10.1625 3 9.8325 3C9.5025 3 9.2325 3.27 9.2325 3.6V8.7525L13.0575 12.3975L9.2325 16.305V20.4C9.2325 20.73 9.5025 21 9.8325 21Z",fill:"#CACFEA"})),ar=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M11.3475 3H5.775V21L11.3475 17.0475V3Z",fill:"#CACFEA"}),p.createElement("path",{d:"M18.225 21L12.6525 17.0475V3H18.225V21ZM13.7775 16.47L17.1 18.825V4.125H13.7775V16.47Z",fill:"#CACFEA"})),ur=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M4.6875 3V21L8.0625 17.0475L11.4375 21V3H4.6875Z",fill:"#CACFEA"}),p.createElement("path",{d:"M12.5625 3V21L15.9375 17.0475L19.3125 21V3H12.5625Z",fill:"#CACFEA"})),lr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M6.39001 3V21L12 17.0175L17.61 21V3H6.38251H6.39001ZM16.44 3.84L7.23001 18.7125V3.84H16.44ZM12 15.9975L8.25751 18.6525L16.77 4.89V19.3725L12 15.9825V15.9975Z",fill:"#CACFEA"})),cr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M12.3075 8.0175L14.4525 5.8725C14.6175 5.7075 14.6175 5.43 14.4525 5.265L12.3 3.12C12.135 2.955 11.8575 2.955 11.6925 3.12C11.5275 3.285 11.5275 3.5625 11.6925 3.7275L13.1025 5.1375H6.64499C5.22749 5.1375 4.07249 6.2925 4.07249 7.71V16.2825C4.07249 17.7 5.22749 18.855 6.64499 18.855C6.87749 18.855 7.07249 18.66 7.07249 18.4275C7.07249 18.195 6.87749 18 6.64499 18C5.69249 18 4.93499 17.2275 4.93499 16.29V7.7175C4.93499 6.765 5.70749 6.0075 6.64499 6.0075H13.11L11.7 7.4175C11.535 7.5825 11.535 7.86 11.7 8.025C11.865 8.19 12.1425 8.19 12.3075 8.025V8.0175Z",fill:"#CACFEA"}),p.createElement("path",{d:"M17.355 18.8625C18.7725 18.8625 19.9275 17.7075 19.9275 16.29V7.7175C19.9275 6.3 18.7725 5.145 17.355 5.145C17.1225 5.145 16.9275 5.34 16.9275 5.5725C16.9275 5.805 17.1225 6 17.355 6C18.3075 6 19.065 6.7725 19.065 7.71V16.2825C19.065 17.235 18.2925 17.9925 17.355 17.9925H10.89L12.3075 16.5825C12.3825 16.5075 12.435 16.395 12.435 16.2825C12.435 16.17 12.3975 16.0575 12.3075 15.9825C12.15 15.8175 11.8575 15.825 11.7 15.9825L9.52501 18.1575V18.18C9.45751 18.255 9.42751 18.345 9.42751 18.435C9.42751 18.555 9.46501 18.66 9.55501 18.735L11.7 20.88C11.8575 21.045 12.15 21.045 12.3075 20.88C12.4725 20.715 12.4725 20.4375 12.3075 20.2725L10.89 18.8625H17.355Z",fill:"#CACFEA"})),fr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("g",{clipPath:"url(#clip0_3377_237)"},p.createElement("path",{d:"M13.02 19.95C17.42 19.95 21 16.37 21 11.97C21 7.57 17.42 4 13.02 4C8.88 4 5.39 7.24 5.08 11.37L5.02 12.14L3.56 10.68C3.49 10.61 3.41 10.58 3.33 10.58C3.25 10.58 3.17 10.61 3.1 10.68C3.03 10.75 3 10.83 3 10.92C3 11 3.03 11.08 3.1 11.15L5.22 13.27C5.35 13.4 5.55 13.43 5.65 13.3L7.8 11.15C7.87 11.08 7.9 11 7.9 10.92C7.9 10.84 7.86 10.76 7.8 10.69C7.73 10.62 7.65 10.59 7.57 10.59C7.49 10.59 7.41 10.62 7.34 10.69L5.9 12.13L6.03 11.11C6.45 7.57 9.46 4.91 13.02 4.91C16.91 4.91 20.08 8.08 20.08 11.97C20.08 15.86 16.91 19.03 13.02 19.03C12.77 19.03 12.56 19.24 12.56 19.49C12.56 19.74 12.77 19.95 13.02 19.95Z",fill:"#CACFEA"}),p.createElement("path",{d:"M14.95 13.19C14.95 13.72 14.75 14.14 14.36 14.45C13.97 14.76 13.43 14.91 12.75 14.91C12.16 14.91 11.69 14.81 11.32 14.62V13.53C11.7 13.81 12.14 13.95 12.65 13.95C12.98 13.95 13.23 13.88 13.41 13.74C13.59 13.6 13.67 13.41 13.67 13.17C13.67 12.93 13.56 12.72 13.34 12.58C13.12 12.44 12.82 12.37 12.43 12.37H11.92V11.41H12.39C13.13 11.41 13.5 11.16 13.5 10.67C13.5 10.21 13.22 9.98 12.65 9.98C12.26 9.98 11.89 10.1 11.54 10.35V9.33C11.93 9.13 12.4 9.03 12.94 9.03C13.48 9.03 13.94 9.16 14.28 9.41C14.62 9.66 14.79 10.01 14.79 10.44C14.79 11.19 14.41 11.65 13.66 11.84V11.86C14.06 11.91 14.37 12.05 14.61 12.29C14.85 12.53 14.96 12.83 14.96 13.19H14.95Z",fill:"#CACFEA"})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_3377_237"},p.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),dr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("g",{clipPath:"url(#clip0_3377_260)"},p.createElement("path",{d:"M10.98 19.95C6.58 19.95 3 16.37 3 11.98C3 7.58 6.58 4 10.98 4C15.12 4 18.61 7.24 18.93 11.37L18.99 12.14L20.45 10.68C20.52 10.61 20.6 10.58 20.68 10.58C20.76 10.58 20.84 10.61 20.91 10.68C20.98 10.75 21.01 10.83 21.01 10.91C21.01 10.99 20.98 11.07 20.91 11.14L18.79 13.26C18.66 13.39 18.46 13.42 18.36 13.29L16.21 11.14C16.14 11.07 16.11 10.99 16.11 10.91C16.11 10.83 16.15 10.75 16.21 10.68C16.28 10.61 16.36 10.58 16.44 10.58C16.52 10.58 16.6 10.61 16.67 10.68L18.11 12.12L17.98 11.1C17.55 7.57 14.54 4.91 10.98 4.91C7.09 4.91 3.92 8.08 3.92 11.97C3.92 15.86 7.09 19.03 10.98 19.03C11.23 19.03 11.44 19.24 11.44 19.49C11.44 19.74 11.23 19.95 10.98 19.95Z",fill:"#CACFEA"}),p.createElement("path",{d:"M12.91 13.19C12.91 13.72 12.71 14.14 12.32 14.45C11.93 14.76 11.39 14.91 10.71 14.91C10.12 14.91 9.65 14.81 9.28 14.62V13.53C9.66 13.81 10.1 13.95 10.61 13.95C10.94 13.95 11.19 13.88 11.37 13.74C11.55 13.6 11.63 13.41 11.63 13.17C11.63 12.93 11.52 12.72 11.3 12.58C11.08 12.44 10.78 12.37 10.39 12.37H9.88V11.41H10.35C11.09 11.41 11.46 11.16 11.46 10.67C11.46 10.21 11.18 9.98 10.61 9.98C10.22 9.98 9.85 10.1 9.5 10.35V9.33C9.89 9.13 10.36 9.03 10.9 9.03C11.44 9.03 11.9 9.16 12.24 9.41C12.58 9.66 12.75 10.01 12.75 10.44C12.75 11.19 12.37 11.65 11.62 11.84V11.86C12.02 11.91 12.33 12.05 12.57 12.29C12.81 12.53 12.92 12.83 12.92 13.19H12.91Z",fill:"#CACFEA"})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_3377_260"},p.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),$=({Icon:e,onClick:t,width:n,height:r,text:i,disabled:o})=>p.createElement("button",{disabled:o,onClick:t},p.createElement(e,{width:n,height:r})," ",i),hr=({width:e,height:t})=>p.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M12.6525 17.0475L18.225 21V3H12.6525V17.0475Z",fill:"#CACFEA"}),p.createElement("path",{d:"M5.775 3H11.3475V17.0475L5.775 21V3ZM10.2225 4.125H6.9V18.825L10.2225 16.47V4.125Z",fill:"#CACFEA"})),mr=({width:e,height:t})=>p.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("rect",{x:"0.5",y:"0.5",width:"13",height:"13",rx:"2.5",stroke:"#CACFEA"}),p.createElement("path",{d:"M7.16667 6.33333V6.83333H7.66667H10.3333C10.4257 6.83333 10.5 6.90769 10.5 7C10.5 7.09231 10.4257 7.16667 10.3333 7.16667H7.66667H7.16667V7.66667V10.3333C7.16667 10.4257 7.09231 10.5 7 10.5C6.90769 10.5 6.83333 10.4257 6.83333 10.3333V7.66667V7.16667H6.33333H3.66667C3.57468 7.16667 3.5 7.09199 3.5 7C3.5 6.90801 3.57468 6.83333 3.66667 6.83333H6.33333H6.83333V6.33333V3.66667C6.83333 3.57468 6.90801 3.5 7 3.5C7.09199 3.5 7.16667 3.57468 7.16667 3.66667V6.33333Z",fill:"#CACFEA",stroke:"#CACFEA"}));function X(e){e.next(),e.complete()}function Ae(e,t,n){if(!e||!(e instanceof q.PeriodMarker))return!0;const r=e.timeObservation.start,i=e.timeObservation.end;if(r==null||i==null)return!0;const o=n.video.calculateTimeToFrame(i),s=n.video.getCurrentFrame();return t<r||o-s<2}function Ge(e,t){if(e===void 0)return!0;const n=e.timeObservation.start;return n==null||n>t}function pr(e){return!(e.timeObservation.start==null||e.timeObservation.end==null)}const gr=({selectedMarker:e,omakasePlayer:t,markerListApi:n,segmentationLanes:r,setSegmentationLanes:i,setSelectedMarker:o,onMarkerClickCallback:s,setSource:a,source:l,constants:u})=>{const c=p.useRef(void 0),d=p.useRef(void 0),f=new ue,[h,b]=p.useState(void 0),[g,_]=p.useState(Ae(e,t.video.getCurrentTime(),t)),[L,D]=p.useState(void 0),[y,M]=p.useState(Ge(L,t.video.getCurrentTime()));p.useEffect(()=>{if(L&&L!==e){const E=r.find(C=>C.getMarker(L.id));E==null||E.removeMarker(L.id),D(void 0)}},[e,L,r,D]),p.useEffect(()=>()=>X(f),[]),p.useEffect(()=>{if(e){const E=Ae(e,t.video.getCurrentTime(),t);_(E);const C=t.video.onVideoTimeChange$.pipe(U(f)).subscribe({next:x=>{_(I=>Ae(e,x.currentTime,t))}});return()=>C.unsubscribe()}},[e]),p.useEffect(()=>{if(L===void 0)return;const E=t.video.onVideoTimeChange$.pipe(U(f)).subscribe({next:C=>{M(Ge(L,C.currentTime))}});return()=>E.unsubscribe()},[L]),p.useEffect(()=>{const E=r.map(C=>C.onMarkerUpdate$.pipe(U(f)).subscribe({next:x=>{(e==null?void 0:e.id)===x.marker.id&&_(I=>Ae(e,t.video.getCurrentTime(),t))}}));return()=>E.forEach(C=>C.unsubscribe())},[r,e]),p.useEffect(()=>{h&&(h.marker.style={...h.marker.style,color:h.color},h.marker.timeObservation={...h.marker.timeObservation},b(void 0))},[e]),p.useEffect(()=>{if(l){const E=l.onMarkerDelete$.pipe(U(f)).subscribe({next:C=>{const x=C.marker;b(I=>{if((I==null?void 0:I.marker.id)!==x.id)return I}),o(I=>{if((I==null?void 0:I.id)!==x.id)return I}),D(I=>{if((I==null?void 0:I.id)!==x.id)return I})}});return()=>E.unsubscribe()}},[l]);const ce=(E,C)=>{if(C===void 0)return;const x=C.timeObservation;E.video.seekToTime(x.start)},W=(E,C)=>{if(C===void 0)return;const x=C.timeObservation;E.video.seekToTime(x.end)},Ee=(E,C)=>{C instanceof q.PeriodMarker&&C.timeObservation.start!==void 0&&(C.timeObservation={...C.timeObservation,start:E.video.getCurrentTime()})},fe=(E,C)=>{C instanceof q.PeriodMarker&&C.timeObservation.end!==void 0&&(C.timeObservation={...C.timeObservation,end:E.video.getCurrentTime()})},ae=(E,C)=>{c.current&&X(c.current),c.current=new ue,E.video.pause();const x=E.video.getCurrentFrame(),I=E.video.getFrameRate(),me=x-C*I,pe=me>=0?me:0;E.video.seekToFrame(pe).pipe(ge()).subscribe(()=>{}),E.video.play(),E.video.onVideoTimeChange$.pipe(U(c.current),U(f)).subscribe(Ie=>{Ie.frame>=x-1&&(E.video.pause().subscribe(()=>{E.video.seekToFrame(x).pipe(ge()).subscribe(()=>{})}),X(c.current))})},Se=(E,C)=>{c.current&&X(c.current),c.current=new ue,d.current&&X(d.current),d.current=new ue;const x=E.video.getCurrentFrame(),I=E.video.getFrameRate(),me=x+C*I;E.video.play(),E.video.onVideoTimeChange$.pipe(U(c.current),U(f)).subscribe(pe=>{pe.frame>=me-1&&(E.video.pause().subscribe(()=>{E.video.seekToFrame(x).pipe(ge()).subscribe(()=>{})}),X(c.current))}),E.video.onEnded$.pipe(U(d.current),U(f)).subscribe(pe=>{setTimeout(()=>{E.video.seekToFrame(x).pipe(ge()).subscribe(()=>{})},1),X(d.current)})},H=E=>{l.removeMarker(E.id),(L==null?void 0:L.id)===E.id&&D(void 0)},de=(E,C)=>{if(!(C instanceof q.PeriodMarker))return;const x=C.timeObservation.start,I=C.timeObservation.end,me=E.video.getCurrentTime();if(x==null||I==null)return;E.video.calculateTimeToFrame(x),E.video.calculateTimeToFrame(I);const pe=x,Ie=me,en=Ie+1/E.video.getFrameRate(),tn=I;H(C);const Ke=new q.PeriodMarker({style:u.PERIOD_MARKER_STYLE,timeObservation:{start:pe,end:Ie},editable:!0});Ke.onClick$.subscribe({next:()=>s(Ke)});const Te=new q.PeriodMarker({style:u.SELECTED_PERIOD_MARKER_STYLE,timeObservation:{start:en,end:tn},editable:!0});Te.onClick$.subscribe({next:()=>s(Te)}),l.addMarker(Ke),l.addMarker(Te),s(Te),setTimeout(()=>{b({marker:Te,color:u.PERIOD_MARKER_STYLE.color})},0)},he=()=>{const E=t.video.getCurrentTime(),C=new q.PeriodMarker({timeObservation:{start:E},style:u.PERIOD_MARKER_STYLE,editable:!0});C.onClick$.subscribe({next:()=>s(C)}),l.addMarker(C),D(C),M(Ge(C,t.video.getCurrentTime())),s(C)},Ce=()=>{const E=t.video.getCurrentTime();L.timeObservation={...L.timeObservation,end:E},D(void 0)},V=E=>{c.current&&X(c.current),c.current=new ue,d.current&&X(d.current),d.current=new ue;const C=t.video.calculateTimeToFrame(E.timeObservation.start),x=t.video.calculateTimeToFrame(E.timeObservation.end);t.video.pause(),t.video.seekToFrame(C),t.video.play(),t.video.onVideoTimeChange$.pipe(U(c.current),U(f)).subscribe(I=>{I.frame>=x-1&&(t.video.pause().subscribe(()=>{t.video.seekToFrame(C).pipe(ge()).subscribe(()=>{})}),X(c.current))}),t.video.onEnded$.pipe(U(d.current),U(f)).subscribe(I=>{setTimeout(()=>{t.video.seekToFrame(C).pipe(ge()).subscribe(()=>{})},1),X(d.current)})},O=()=>{const E=r.length,C=`Segmentation ${r.length+1}`,x=new q.MarkerLane({description:C,style:u.TIMELINE_LANE_STYLE});t.timeline.addTimelineLaneAtIndex(x,E+1),i([...r,x]),s(void 0),a(x)};return p.createElement("div",{className:"control-panel-wrapper"},p.createElement("div",{className:"control-panel"},p.createElement($,{Icon:rr,onClick:()=>ce(t,e),disabled:e===void 0}),p.createElement($,{Icon:ir,onClick:()=>W(t,e),disabled:e===void 0}),p.createElement($,{Icon:or,onClick:()=>Ee(t,e),disabled:e===void 0}),p.createElement($,{Icon:sr,onClick:()=>fe(t,e),disabled:e===void 0}),L===void 0?p.createElement($,{Icon:ar,onClick:he}):p.createElement($,{Icon:hr,onClick:Ce,disabled:y}),p.createElement($,{Icon:lr,onClick:()=>H(e),disabled:e===void 0}),p.createElement($,{Icon:ur,onClick:()=>de(t,e),disabled:g||e===void 0}),p.createElement($,{Icon:cr,onClick:()=>V(e),disabled:!(e instanceof q.PeriodMarker&&pr(e))}),p.createElement($,{Icon:fr,onClick:()=>ae(t,3)}),p.createElement($,{Icon:dr,onClick:()=>Se(t,3)})),p.createElement("div",{className:"control-panel"},p.createElement("div",{className:"segmentation-button-wrapper"},p.createElement($,{Icon:mr,text:"NEW SEGMENTATION",onClick:()=>O(),disabled:r.length>=3}))))};class _e{static createBlob(t,n){return new Blob(t,n)}static createObjectURL(t){const n=URL.createObjectURL(t);return this._blobs.add(n),n}static revokeObjectURL(t){return this._blobs.delete(t),URL.revokeObjectURL(t)}static revokeAll(){this._blobs.forEach(t=>this.revokeObjectURL(t))}}v(_e,"_blobs",new Set);class le{static isNullUndefinedOrWhitespace(t){return typeof t===void 0||t==null?!0:`${t}`.replace(/\s/g,"").length<1}static isNonEmpty(t){return!le.isNullUndefinedOrWhitespace(t)}static endsWith(t,n){return!le.isNullUndefinedOrWhitespace(t)&&!le.isNullUndefinedOrWhitespace(n)?t.indexOf(n,t.length-n.length)!==-1:!1}static toMixedCase(t){let n={NBCU:"NBCU",REDBEE:"Red Bee",CMORE:"C More",TV2:"TV2",BBC:"BBC"};return t.replace(/_/g," ").split(" ").map(r=>r in n?n[r]:`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()}`).join(" ")}static replaceWhitespace(t,n){return t&&t.trim().replace(/([\n ]*,[\n ]*|[\n ]+)/g,n).replace(new RegExp(`${n}$`),"")}static whitespacesToCommas(t){return le.replaceWhitespace(t,",")}static tokenizeWhitespaceSeparated(t){return t?le.replaceWhitespace(t," ").split(" "):void 0}}/*!
|
|
4
|
+
* decimal.js v10.5.0
|
|
5
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
6
|
+
* https://github.com/MikeMcl/decimal.js
|
|
7
|
+
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
8
|
+
* MIT Licence
|
|
9
|
+
*/var nt=9e15,se=1e9,rt="0123456789abcdef",He="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ue="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",it={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:nt,crypto:!1},Zt,J,T=!0,We="[DecimalError] ",re=We+"Invalid argument: ",$t=We+"Precision limit exceeded",qt=We+"crypto unavailable",Wt="[object Decimal]",B=Math.floor,k=Math.pow,vr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,br=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Xt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,K=1e7,S=7,Er=9007199254740991,Sr=He.length-1,ot=Ue.length-1,m={toStringTag:Wt};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),w(e)};m.ceil=function(){return w(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(re+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)};m.comparedTo=m.cmp=function(e){var t,n,r,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(r=s.length,i=a.length,t=0,n=r<i?r:i;t<n;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1};m.cosine=m.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+S,r.rounding=1,n=Cr(r,Yt(r,n)),r.precision=e,r.rounding=t,w(J==2||J==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,n,r,i,o,s,a,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(T=!1,o=c.s*k(c.s*c,1/3),!o||Math.abs(o)==1/0?(n=F(c.d),e=c.e,(o=(e-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=k(n,1/3),e=B((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?n="5e"+e:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new d(n),r.s=c.s):r=new d(o.toString()),s=(e=d.precision)+3;;)if(a=r,l=a.times(a).times(a),u=l.plus(c),r=N(u.plus(c).times(a),u.plus(l),s+2,1),F(a.d).slice(0,s)===(n=F(r.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!i&&n=="4999"){if(!i&&(w(a,e+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(w(r,e+1,1),t=!r.times(r).times(r).eq(c));break}return T=!0,w(r,e,d.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-B(this.e/S))*S,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n};m.dividedBy=m.div=function(e){return N(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,n=t.constructor;return w(N(t,new n(e),0,1,1),n.precision,n.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return w(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/je(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=we(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return w(o,s.precision=n,s.rounding=r,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=we(o,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/je(5,e)),i=we(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=n,w(i,t,n,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,N(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)};m.inverseCosine=m.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n!==-1?n===0?e.isNeg()?G(t,r,i):new t(0):new t(NaN):e.isZero()?G(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,T=!1,n=n.times(n).minus(1).sqrt().plus(n),T=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,T=!1,n=n.times(n).plus(1).sqrt().plus(n),T=!0,r.precision=e,r.rounding=t,n.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?w(new o(i),e,t,!0):(o.precision=n=r-i.e,i=N(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,t!==-1?t===0?(e=G(o,n+4,r).times(.5),e.s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=ot)return s=G(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=ot)return s=G(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=a=d+10,c.rounding=1,n=Math.min(28,a/S+2|0),e=n;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(T=!1,t=Math.ceil(a/S),r=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),s=o.plus(i.div(r+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),T=!0,w(s,c.precision=d,c.rounding=f,!0)};m.isFinite=function(){return!!this.d};m.isInteger=m.isInt=function(){return!!this.d&&B(this.e/S)>this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,h=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=i!==1}if(T=!1,a=d+h,s=te(u,a),r=t?Pe(c,a+10):te(e,a),l=N(s,r,a,1),ye(l.d,i=d,f))do if(a+=10,s=te(u,a),r=t?Pe(c,a+10):te(e,a),l=N(s,r,a,1),!o){+F(l.d).slice(i+1,i+15)+1==1e14&&(l=w(l,d+1,0));break}while(ye(l.d,i+=10,f));return T=!0,w(l,d,f)};m.minus=m.sub=function(e){var t,n,r,i,o,s,a,l,u,c,d,f,h=this,b=h.constructor;if(e=new b(e),!h.d||!e.d)return!h.s||!e.s?e=new b(NaN):h.d?e.s=-e.s:e=new b(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(u=h.d,f=e.d,a=b.precision,l=b.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else if(u[0])e=new b(h);else return new b(l===3?-0:0);return T?w(e,a,l):e}if(n=B(e.e/S),c=B(h.e/S),u=u.slice(),o=c-n,o){for(d=o<0,d?(t=u,o=-o,s=f.length):(t=f,n=c,s=u.length),r=Math.max(Math.ceil(a/S),s)+2,o>r&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for(r=u.length,s=f.length,d=r<s,d&&(s=r),r=0;r<s;r++)if(u[r]!=f[r]){d=u[r]<f[r];break}o=0}for(d&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,r=f.length-s;r>0;--r)u[s++]=0;for(r=f.length;r>o;){if(u[--r]<f[r]){for(i=r;i&&u[--i]===0;)u[i]=K-1;--u[i],u[r]+=K}u[r]-=f[r]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=Xe(u,n),T?w(e,a,l):e):new b(l===3?-0:0)};m.modulo=m.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?w(new r(n),r.precision,r.rounding):(T=!1,r.modulo==9?(t=N(n,e.abs(),0,3,1),t.s*=e.s):t=N(n,e,0,r.modulo,1),t=t.times(e),T=!0,n.minus(t))};m.naturalExponential=m.exp=function(){return st(this)};m.naturalLogarithm=m.ln=function(){return te(this)};m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,w(e)};m.plus=m.add=function(e){var t,n,r,i,o,s,a,l,u,c,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(u=d.d,c=e.d,a=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(e=new f(d)),T?w(e,a,l):e;if(o=B(d.e/S),r=B(e.e/S),u=u.slice(),i=o-r,i){for(i<0?(n=u,i=-i,s=c.length):(n=c,r=o,s=u.length),o=Math.ceil(a/S),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,n=c,c=u,u=n),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/K|0,u[i]%=K;for(t&&(u.unshift(t),++r),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Xe(u,r),T?w(e,a,l):e};m.precision=m.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(re+e);return n.d?(t=jt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return w(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+S,r.rounding=1,n=Lr(r,Yt(r,n)),r.precision=e,r.rounding=t,w(J>2?n.neg():n,e,t,!0)):new r(NaN)};m.squareRoot=m.sqrt=function(){var e,t,n,r,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(T=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=F(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=B((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),r=new c(t)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(o=r,r=o.plus(N(s,o,n+2,1)).times(.5),F(o.d).slice(0,n)===(t=F(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!i&&t=="4999"){if(!i&&(w(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(w(r,l+1,1),e=!r.times(r).eq(s));break}return T=!0,w(r,l,c.rounding,e)};m.tangent=m.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=N(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,w(J==2||J==4?n.neg():n,e,t,!0)):new r(NaN)};m.times=m.mul=function(e){var t,n,r,i,o,s,a,l,u,c=this,d=c.constructor,f=c.d,h=(e=new d(e)).d;if(e.s*=c.s,!f||!f[0]||!h||!h[0])return new d(!e.s||f&&!f[0]&&!h||h&&!h[0]&&!f?NaN:!f||!h?e.s/0:e.s*0);for(n=B(c.e/S)+B(e.e/S),l=f.length,u=h.length,l<u&&(o=f,f=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)a=o[i]+h[r]*f[i-r-1]+t,o[i--]=a%K|0,t=a/K|0;o[i]=(o[i]+t)%K|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=Xe(o,n),T?w(e,d.precision,d.rounding):e};m.toBinary=function(e,t){return ct(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(P(e,0,se),t===void 0?t=r.rounding:P(t,0,8),w(n,e+n.e+1,t))};m.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Y(r,!0):(P(e,0,se),t===void 0?t=i.rounding:P(t,0,8),r=w(new i(r),e+1,t),n=Y(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};m.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?n=Y(i):(P(e,0,se),t===void 0?t=o.rounding:P(t,0,8),r=w(new o(i),e+i.e+1,t),n=Y(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};m.toFraction=function(e){var t,n,r,i,o,s,a,l,u,c,d,f,h=this,b=h.d,g=h.constructor;if(!b)return new g(h);if(u=n=new g(1),r=l=new g(0),t=new g(r),o=t.e=jt(b)-h.e-1,s=o%S,t.d[0]=k(10,s<0?S+s:s),e==null)e=o>0?t:u;else{if(a=new g(e),!a.isInt()||a.lt(u))throw Error(re+a);e=a.gt(t)?o>0?t:u:a}for(T=!1,a=new g(F(b)),c=g.precision,g.precision=o=b.length*S*2;d=N(a,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=u,u=l.plus(d.times(i)),l=i,i=t,t=a.minus(d.times(i)),a=i;return i=N(e.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=h.s,f=N(u,r,o,1).minus(h).abs().cmp(N(l,n,o,1).minus(h).abs())<1?[u,r]:[l,n],g.precision=c,T=!0,f};m.toHexadecimal=m.toHex=function(e,t){return ct(this,16,e,t)};m.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:P(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(T=!1,n=N(n,e,0,t,1).times(e),T=!0,w(n)):(e.s=n.s,n=e),n};m.toNumber=function(){return+this};m.toOctal=function(e,t){return ct(this,8,e,t)};m.toPower=m.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(k(+a,u));if(a=new l(a),a.eq(1))return a;if(r=l.precision,o=l.rounding,e.eq(1))return w(a,r,o);if(t=B(e.e/S),t>=e.d.length-1&&(n=u<0?-u:u)<=Er)return i=Kt(l,a,n,r),e.s<0?new l(1).div(i):w(i,r,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return n=k(+a,u),t=n==0||!isFinite(n)?B(u*(Math.log("0."+F(a.d))/Math.LN10+a.e+1)):new l(n+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(T=!1,l.rounding=a.s=1,n=Math.min(12,(t+"").length),i=st(e.times(te(a,r+n)),r),i.d&&(i=w(i,r+5,1),ye(i.d,r,o)&&(t=r+10,i=w(st(e.times(te(a,t+n)),t),t+5,1),+F(i.d).slice(r+1,r+15)+1==1e14&&(i=w(i,r+1,0)))),i.s=s,T=!0,l.rounding=o,w(i,r,o))};m.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Y(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(P(e,1,se),t===void 0?t=i.rounding:P(t,0,8),r=w(new i(r),e,t),n=Y(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n};m.toSignificantDigits=m.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(P(e,1,se),t===void 0?t=r.rounding:P(t,0,8)),w(new r(n),e,t)};m.toString=function(){var e=this,t=e.constructor,n=Y(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n};m.truncated=m.trunc=function(){return w(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,n=Y(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function F(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=S-r.length,n&&(o+=Q(n)),o+=r;s=e[t],r=s+"",n=S-r.length,n&&(o+=Q(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function P(e,t,n){if(e!==~~e||e<t||e>n)throw Error(re+e)}function ye(e,t,n,r){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=S,i=0):(i=Math.ceil((t+1)/S),t%=S),o=k(10,S-t),a=e[i]%o|0,r==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(e[i+1]/o/100|0)==k(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(r||n<4)&&a==9999||!r&&n>3&&a==4999):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==k(10,t-3)-1,s}function De(e,t,n){for(var r,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=rt.indexOf(e.charAt(s++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Cr(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/je(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=we(e,1,t.times(i),new e(1));for(var o=n;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}var N=function(){function e(r,i,o){var s,a=0,l=r.length;for(r=r.slice();l--;)s=r[l]*i+a,r[l]=s%o|0,a=s/o|0;return a&&r.unshift(a),r}function t(r,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(r[a]!=i[a]){l=r[a]>i[a]?1:-1;break}return l}function n(r,i,o,s){for(var a=0;o--;)r[o]-=a,a=r[o]<i[o]?1:0,r[o]=a*s+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s,a,l){var u,c,d,f,h,b,g,_,L,D,y,M,ce,W,Ee,fe,ae,Se,H,de,he=r.constructor,Ce=r.s==i.s?1:-1,V=r.d,O=i.d;if(!V||!V[0]||!O||!O[0])return new he(!r.s||!i.s||(V?O&&V[0]==O[0]:!O)?NaN:V&&V[0]==0||!O?Ce*0:Ce/0);for(l?(h=1,c=r.e-i.e):(l=K,h=S,c=B(r.e/h)-B(i.e/h)),H=O.length,ae=V.length,L=new he(Ce),D=L.d=[],d=0;O[d]==(V[d]||0);d++);if(O[d]>(V[d]||0)&&c--,o==null?(W=o=he.precision,s=he.rounding):a?W=o+(r.e-i.e)+1:W=o,W<0)D.push(1),b=!0;else{if(W=W/h+2|0,d=0,H==1){for(f=0,O=O[0],W++;(d<ae||f)&&W--;d++)Ee=f*l+(V[d]||0),D[d]=Ee/O|0,f=Ee%O|0;b=f||d<ae}else{for(f=l/(O[0]+1)|0,f>1&&(O=e(O,f,l),V=e(V,f,l),H=O.length,ae=V.length),fe=H,y=V.slice(0,H),M=y.length;M<H;)y[M++]=0;de=O.slice(),de.unshift(0),Se=O[0],O[1]>=l/2&&++Se;do f=0,u=t(O,y,H,M),u<0?(ce=y[0],H!=M&&(ce=ce*l+(y[1]||0)),f=ce/Se|0,f>1?(f>=l&&(f=l-1),g=e(O,f,l),_=g.length,M=y.length,u=t(g,y,_,M),u==1&&(f--,n(g,H<_?de:O,_,l))):(f==0&&(u=f=1),g=O.slice()),_=g.length,_<M&&g.unshift(0),n(y,g,M,l),u==-1&&(M=y.length,u=t(O,y,H,M),u<1&&(f++,n(y,H<M?de:O,M,l))),M=y.length):u===0&&(f++,y=[0]),D[d++]=f,u&&y[0]?y[M++]=V[fe]||0:(y=[V[fe]],M=1);while((fe++<ae||y[0]!==void 0)&&W--);b=y[0]!==void 0}D[0]||D.shift()}if(h==1)L.e=c,Zt=b;else{for(d=1,f=D[0];f>=10;f/=10)d++;L.e=d+c*h-1,w(L,a?o+L.e+1:o,s,b)}return L}}();function w(e,t,n,r){var i,o,s,a,l,u,c,d,f,h=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=S,s=t,c=d[f=0],l=c/k(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/S),a=d.length,f>=a)if(r){for(;a++<=f;)d.push(0);c=l=0,i=1,o%=S,s=o-S+1}else break e;else{for(c=a=d[f],i=1;a>=10;a/=10)i++;o%=S,s=o-S+i,l=s<0?0:c/k(10,i-s-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(s<0?c:c%k(10,i-s-1)),u=n<4?(l||r)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(o>0?s>0?c/k(10,i-s):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=k(10,(S-t%S)%S),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=f,a=1,f--):(d.length=f+1,a=k(10,S-o),d[f]=s>0?(c/k(10,i-s)%k(10,s)|0)*a:0),u)for(;;)if(f==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==K&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=K)break;d[f--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return T&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Y(e,t,n){if(!e.isFinite())return Gt(e);var r,i=e.e,o=F(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Q(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Q(-i-1)+o,n&&(r=n-s)>0&&(o+=Q(r))):i>=s?(o+=Q(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Q(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Q(r))),o}function Xe(e,t){var n=e[0];for(t*=S;n>=10;n/=10)t++;return t}function Pe(e,t,n){if(t>Sr)throw T=!0,n&&(e.precision=n),Error($t);return w(new e(He),t,1,!0)}function G(e,t,n){if(t>ot)throw Error($t);return w(new e(Ue),t,n,!0)}function jt(e){var t=e.length-1,n=t*S+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Q(e){for(var t="";e--;)t+="0";return t}function Kt(e,t,n,r){var i,o=new e(1),s=Math.ceil(r/S+4);for(T=!1;;){if(n%2&&(o=o.times(t),gt(o.d,s)&&(i=!0)),n=B(n/2),n===0){n=o.d.length-1,i&&o.d[n]===0&&++o.d[n];break}t=t.times(t),gt(t.d,s)}return T=!0,o}function pt(e){return e.d[e.d.length-1]&1}function zt(e,t,n){for(var r,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}r=o.cmp(i),(r===n||r===0&&o.s===n)&&(o=i)}return o}function st(e,t){var n,r,i,o,s,a,l,u=0,c=0,d=0,f=e.constructor,h=f.rounding,b=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(T=!1,l=b):l=t,a=new f(.03125);e.e>-2;)e=e.times(a),d+=5;for(r=Math.log(k(2,d))/Math.LN10*2+5|0,l+=r,n=o=s=new f(1),f.precision=l;;){if(o=w(o.times(e),l,1),n=n.times(++c),a=s.plus(N(o,n,l,1)),F(a.d).slice(0,l)===F(s.d).slice(0,l)){for(i=d;i--;)s=w(s.times(s),l,1);if(t==null)if(u<3&&ye(s.d,l-r,h,u))f.precision=l+=10,n=o=a=new f(1),c=0,u++;else return w(s,f.precision=b,h,T=!0);else return f.precision=b,s}s=a}}function te(e,t){var n,r,i,o,s,a,l,u,c,d,f,h=1,b=10,g=e,_=g.d,L=g.constructor,D=L.rounding,y=L.precision;if(g.s<0||!_||!_[0]||!g.e&&_[0]==1&&_.length==1)return new L(_&&!_[0]?-1/0:g.s!=1?NaN:_?0:g);if(t==null?(T=!1,c=y):c=t,L.precision=c+=b,n=F(_),r=n.charAt(0),Math.abs(o=g.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=F(g.d),r=n.charAt(0),h++;o=g.e,r>1?(g=new L("0."+n),o++):g=new L(r+"."+n.slice(1))}else return u=Pe(L,c+2,y).times(o+""),g=te(new L(r+"."+n.slice(1)),c-b).plus(u),L.precision=y,t==null?w(g,y,D,T=!0):g;for(d=g,l=s=g=N(g.minus(1),g.plus(1),c,1),f=w(g.times(g),c,1),i=3;;){if(s=w(s.times(f),c,1),u=l.plus(N(s,new L(i),c,1)),F(u.d).slice(0,c)===F(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(Pe(L,c+2,y).times(o+""))),l=N(l,new L(h),c,1),t==null)if(ye(l.d,c-b,D,a))L.precision=c+=b,u=s=g=N(d.minus(1),d.plus(1),c,1),f=w(g.times(g),c,1),i=a=1;else return w(l,L.precision=y,D,T=!0);else return L.precision=y,l;l=u,i+=2}}function Gt(e){return String(e.s*e.s/0)}function Ve(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%S,n<0&&(r+=S),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=S;r<i;)e.d.push(+t.slice(r,r+=S));t=t.slice(r),r=S-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),T&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Tr(e,t){var n,r,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Xt.test(t))return Ve(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(br.test(t))n=16,t=t.toLowerCase();else if(vr.test(t))n=2;else if(wr.test(t))n=8;else throw Error(re+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,r=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Kt(r,new r(n),o,o*2)),u=De(t,n,K),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new r(e.s*0):(e.e=Xe(u,c),e.d=u,T=!1,s&&(e=N(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?k(2,l):Oe.pow(2,l))),T=!0,e)}function Lr(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:we(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/je(5,n)),t=we(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function we(e,t,n,r,i){var o,s,a,l,u=e.precision,c=Math.ceil(u/S);for(T=!1,l=n.times(n),a=new e(r);;){if(s=N(a.times(l),new e(t++*t++),u,1),a=i?r.plus(s):r.minus(s),r=N(s.times(l),new e(t++*t++),u,1),s=a.plus(r),s.d[c]!==void 0){for(o=c;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=r,r=s,s=o}return T=!0,s.d.length=c+1,s}function je(e,t){for(var n=e;--t;)n*=e;return n}function Yt(e,t){var n,r=t.s<0,i=G(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return J=r?4:1,t;if(n=t.divToInt(i),n.isZero())J=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(o))return J=pt(n)?r?2:3:r?4:1,t;J=pt(n)?r?1:4:r?3:2}return t.minus(i).abs()}function ct(e,t,n,r){var i,o,s,a,l,u,c,d,f,h=e.constructor,b=n!==void 0;if(b?(P(n,1,se),r===void 0?r=h.rounding:P(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())c=Gt(e);else{for(c=Y(e),s=c.indexOf("."),b?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,s>=0&&(c=c.replace(".",""),f=new h(1),f.e=c.length-s,f.d=De(Y(f),10,i),f.e=f.d.length),d=De(c,10,i),o=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=b?"0p+0":"0";else{if(s<0?o--:(e=new h(e),e.d=d,e.e=o,e=N(e,f,n,r,0,i),d=e.d,o=e.e,u=Zt),s=d[n],a=i/2,u=u||d[n+1]!==void 0,u=r<4?(s!==void 0||u)&&(r===0||r===(e.s<0?3:2)):s>a||s===a&&(r===4||u||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,u)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=rt.charAt(d[s]);if(b){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(d=De(c,i,t),l=d.length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=rt.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function gt(e,t){if(e.length>t)return e.length=t,!0}function _r(e){return new this(e).abs()}function yr(e){return new this(e).acos()}function xr(e){return new this(e).acosh()}function Or(e,t){return new this(e).plus(t)}function Ir(e){return new this(e).asin()}function Nr(e){return new this(e).asinh()}function Ar(e){return new this(e).atan()}function Mr(e){return new this(e).atanh()}function kr(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=G(this,o,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?G(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=G(this,o,1).times(.5),n.s=e.s):t.s<0?(this.precision=o,this.rounding=1,n=this.atan(N(e,t,o,1)),t=G(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(N(e,t,o,1)),n}function Rr(e){return new this(e).cbrt()}function Dr(e){return w(e=new this(e),e.e+1,2)}function Vr(e,t,n){return new this(e).clamp(t,n)}function Fr(e){if(!e||typeof e!="object")throw Error(We+"Object expected");var t,n,r,i=e.defaults===!0,o=["precision",1,se,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,nt,"maxE",0,nt,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=it[n]),(r=e[n])!==void 0)if(B(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(re+n+": "+r);if(n="crypto",i&&(this[n]=it[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(qt);else this[n]=!1;else throw Error(re+n+": "+r);return this}function Br(e){return new this(e).cos()}function Hr(e){return new this(e).cosh()}function Jt(e){var t,n,r;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,vt(o)){u.s=o.s,T?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;T?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return Ve(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),Xt.test(o)?Ve(u,o):Tr(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,Ve(u,o.toString());throw Error(re+o)}if(i.prototype=m,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Fr,i.clone=Jt,i.isDecimal=vt,i.abs=_r,i.acos=yr,i.acosh=xr,i.add=Or,i.asin=Ir,i.asinh=Nr,i.atan=Ar,i.atanh=Mr,i.atan2=kr,i.cbrt=Rr,i.ceil=Dr,i.clamp=Vr,i.cos=Br,i.cosh=Hr,i.div=Ur,i.exp=Pr,i.floor=Zr,i.hypot=$r,i.ln=qr,i.log=Wr,i.log10=jr,i.log2=Xr,i.max=Kr,i.min=zr,i.mod=Gr,i.mul=Yr,i.pow=Jr,i.random=Qr,i.round=ei,i.sign=ti,i.sin=ni,i.sinh=ri,i.sqrt=ii,i.sub=oi,i.sum=si,i.tan=ai,i.tanh=ui,i.trunc=li,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Ur(e,t){return new this(e).div(t)}function Pr(e){return new this(e).exp()}function Zr(e){return w(e=new this(e),e.e+1,3)}function $r(){var e,t,n=new this(0);for(T=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return T=!0,new this(1/0);n=t}return T=!0,n.sqrt()}function vt(e){return e instanceof Oe||e&&e.toStringTag===Wt||!1}function qr(e){return new this(e).ln()}function Wr(e,t){return new this(e).log(t)}function Xr(e){return new this(e).log(2)}function jr(e){return new this(e).log(10)}function Kr(){return zt(this,arguments,-1)}function zr(){return zt(this,arguments,1)}function Gr(e,t){return new this(e).mod(t)}function Yr(e,t){return new this(e).mul(t)}function Jr(e,t){return new this(e).pow(t)}function Qr(e){var t,n,r,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:P(e,1,se),r=Math.ceil(e/S),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);o<r;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=r/4}else throw Error(qt);else for(;o<r;)a[o++]=Math.random()*1e7|0;for(r=a[--o],e%=S,r&&e&&(i=k(10,S-e),a[o]=(r/i|0)*i);a[o]===0;o--)a.pop();if(o<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=S)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<S&&(n-=S-r)}return s.e=n,s.d=a,s}function ei(e){return w(e=new this(e),e.e+1,this.rounding)}function ti(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ni(e){return new this(e).sin()}function ri(e){return new this(e).sinh()}function ii(e){return new this(e).sqrt()}function oi(e,t){return new this(e).sub(t)}function si(){var e=0,t=arguments,n=new this(t[e]);for(T=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return T=!0,w(n,this.precision,this.rounding)}function ai(e){return new this(e).tan()}function ui(e){return new this(e).tanh()}function li(e){return w(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString;m[Symbol.toStringTag]="Decimal";var Oe=m.constructor=Jt(it);He=new Oe(He);Ue=new Oe(Ue);class ee{static formatToTimecode(t,n,r=!1){let i=new Oe(n),o,s=i.round();o=i.mul(t).floor();let a,l,u,c,d=s.mul(86400),f=o.mod(d),h=s.mul(3600),b=s.mul(60);return c=f.divToInt(h),f=f.minus(c.mul(h)),u=f.divToInt(b),f=f.minus(u.mul(b)),l=f.divToInt(s),a=f.minus(l.mul(s)),ee.formatTimecodeText(c.toNumber(),u.toNumber(),l.toNumber(),a.toNumber(),r)}static formatTimecodeText(t,n,r,i,o=!1){let s=o?".":":";return`${ee.padZero(t)}:${ee.padZero(n)}:${ee.padZero(r)}${s}${ee.padZero(i)}`}static padZero(t){return t<10?`0${t}`:`${t}`}}class ci{static resolveFrameRateValueFromFraction(t){return 30}}const j=class j{static parseTimeMoment(t){const[n,r]=t.split(":").map(Number);return[n,r]}static parseTimeRange(t){const n=t.match(this.timeRangePattern);if(!n)throw new Error("Not valid timerange: "+t);const r=n[1]==="[",i=n[5]==="]",o=n[2]?this.parseTimeMoment(n[2]):void 0,s=n[4]?this.parseTimeMoment(n[4]):void 0;return{start:o,end:s,isStartInclusive:r,isEndInclusive:i}}static timeMomentToSeconds(t){return j.timeMomentToMilliseconds(t)/1e3}static timeMomentToMilliseconds(t){return t[0]*1e3+t[1]/1e6}static timeMomentToDate(t){const r=t[0]*1e3+t[1]/1e6;return new Date(r)}static formatTimeMomentToTimecodeText(t,n,r=!1){let i=ci.resolveFrameRateValueFromFraction(n);return ee.formatToTimecode(j.timeMomentToSeconds(t),i,r)}static formatTimerangeToTimecodeText(t,n,r=!1){let i=j.parseTimeRange(t),o=i.start?j.formatTimeMomentToTimecodeText(i.start,n,r):"?",s=i.end?j.formatTimeMomentToTimecodeText(i.end,n,r):"?";return`${o} - ${s}`}static nanosecondsToSeconds(t){return t/1e9}static nanosecondsToTimeMoment(t){const n=Math.floor(t/1e9),r=Math.ceil(t%1e9);return[n,r]}static secondsToTimeMoment(t){return this.nanosecondsToTimeMoment(t*1e9)}static timerangeExprDuration(t){return this.timeRangeDuration(this.parseTimeRange(t))}static timeRangeDuration(t){const{start:n,end:r}=t;if(n===void 0||r===void 0)return 0;{const i=r[0]-n[0],o=r[1]-n[1],s=i+o/1e9;return parseFloat(s.toFixed(3))}}static formatTimeMomentExpr(t){return`${t[0]}:${t[1]}`}static formatNanosecondsToTimeMomentExpr(t){return this.formatTimeMomentExpr(this.nanosecondsToTimeMoment(t))}static toTimeRange(t,n,r=!0,i=!0){return{start:t,end:n,isStartInclusive:r,isEndInclusive:i}}static formatTimeRangeExpr(t){const n=t.isStartInclusive?"[":"(",r=t.isEndInclusive?"]":")",i=t.start?`${t.start[0]}:${t.start[1]}`:"",o=t.end?`${t.end[0]}:${t.end[1]}`:"";return`${n}${i}_${o}${r}`}static timerangeDuration(t){let n=j.parseTimeRange(t);if(n.start===void 0||n.end===void 0)return 1/0;{let r=j.timeMomentToSeconds(n.start);return j.timeMomentToSeconds(n.end)-r}}static padZero(t){return t<10?`0${t}`:`${t}`}};v(j,"timeRangePattern",/^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$/);let z=j;class fi{constructor(t=3,n=!1){v(this,"version");v(this,"independentSegments");v(this,"targetDuration",null);v(this,"mediaSequence",null);v(this,"programDateTime",null);v(this,"playlistType",null);v(this,"streams",[]);v(this,"media",[]);v(this,"segments",[]);v(this,"endList",!1);v(this,"startOffset");this.version=t,this.independentSegments=n}}class Ye{constructor(t,n,r,i,o){v(this,"bandwidth");v(this,"averageBandwidth");v(this,"resolution");v(this,"frameRate");v(this,"uri");this.bandwidth=t,this.averageBandwidth=n,this.resolution=r,this.frameRate=i,this.uri=o}}class di{constructor(t,n,r,i,o,s,a){v(this,"type");v(this,"groupId");v(this,"name");v(this,"isDefault");v(this,"autoSelect");v(this,"channels");v(this,"uri");this.type=t,this.groupId=n,this.name=r,this.isDefault=i,this.autoSelect=o,this.channels=s,this.uri=a}}class hi{constructor(t,n){v(this,"duration");v(this,"uri");this.duration=t,this.uri=n}}class mi{constructor(){v(this,"playlist");this.playlist=new fi}setVersion(t){return this.playlist.version=t,this}setIndependentSegments(t){return this.playlist.independentSegments=t,this}setTargetDuration(t){return this.playlist.targetDuration=t,this}setMediaSequence(t){return this.playlist.mediaSequence=t,this}setProgramDateTime(t){return this.playlist.programDateTime=t,this}setPlaylistType(t){return this.playlist.playlistType=t,this}addStreamInfo(t){return this.playlist.streams.push(t),this}addMedia(t){return this.playlist.media.push(t),this}addSegment(t){return this.playlist.segments.push(t),this}setEndList(){return this.playlist.endList=!0,this}setStartOffset(t){return this.playlist.startOffset=t,this}build(){return this.playlist}}class bt{static write(t){let n=`#EXTM3U
|
|
10
|
+
`;return n+=`#EXT-X-VERSION:${t.version}
|
|
11
|
+
`,t.independentSegments&&(n+=`#EXT-X-INDEPENDENT-SEGMENTS
|
|
12
|
+
`),t.targetDuration!==null&&(n+=`#EXT-X-TARGETDURATION:${t.targetDuration}
|
|
13
|
+
`),t.mediaSequence!==null&&(n+=`#EXT-X-MEDIA-SEQUENCE:${t.mediaSequence}
|
|
14
|
+
`),t.programDateTime&&(n+=`#EXT-X-PROGRAM-DATE-TIME:${t.programDateTime}
|
|
15
|
+
`),t.playlistType&&(n+=`#EXT-X-PLAYLIST-TYPE:${t.playlistType}
|
|
16
|
+
`),t.startOffset!==void 0&&(n+=`#EXT-X-START:TIME-OFFSET=${t.startOffset}
|
|
17
|
+
`),t.streams.forEach(r=>{n+=`#EXT-X-STREAM-INF:BANDWIDTH=${r.bandwidth},AVERAGE-BANDWIDTH=${r.averageBandwidth}`,r.resolution&&(n+=`,RESOLUTION=${r.resolution.width}x${r.resolution.height}`),r.frameRate&&(n+=`,FRAME-RATE=${r.frameRate}`),r.uri&&(n+=`
|
|
18
|
+
${r.uri}`),n+=`
|
|
19
|
+
`}),t.media.forEach(r=>{n+=`#EXT-X-MEDIA:TYPE=${r.type},GROUP-ID="${r.groupId}",NAME="${r.name}",DEFAULT=${r.isDefault?"YES":"NO"},AUTOSELECT=${r.autoSelect?"YES":"NO"}`,r.channels&&(n+=`,CHANNELS="${r.channels}"`),n+=`,URI="${r.uri}"
|
|
20
|
+
`}),t.segments.forEach(r=>{n+=`#EXTINF:${r.duration},
|
|
21
|
+
${r.uri}
|
|
22
|
+
`}),t.endList&&(n+=`#EXT-X-ENDLIST
|
|
23
|
+
`),n}}function Qt(e,t,n,r){const i=new mi().setVersion(3);if(e.format==="urn:x-nmos:format:multi"){if(i.setIndependentSegments(!0),!n||n.length<1||!r||r.size<1)return"undefined";let a=n.map(u=>({flow:u,manifestUrl:Qt(u,r.get(u.id))}));a.filter(u=>u.flow.format==="urn:x-nmos:format:video").forEach(u=>{let c=u.flow,d=u.manifestUrl,f=c.essence_parameters,h=null,b={width:f.frame_width,height:f.frame_height};f.frame_rate&&(h=f.frame_rate.denominator?f.frame_rate.numerator/f.frame_rate.denominator:f.frame_rate.numerator),i.addStreamInfo(new Ye(c.avg_bit_rate?c.avg_bit_rate:0,c.avg_bit_rate?c.avg_bit_rate:0,b,h,d))}),a.filter(u=>u.flow.format==="urn:x-nmos:format:audio").forEach((u,c)=>{let d=u.flow,f=u.manifestUrl,h=d.essence_parameters;i.addMedia(new di("AUDIO","audio",le.isNullUndefinedOrWhitespace(d.description)?"":d.description,c===0,!0,`${h.channels}`,f))});let l=bt.write(i.build());_e.createObjectURL(_e.createBlob([l],{type:"application/vnd.apple.mpegurl"}))}else if(e.format==="urn:x-nmos:format:video"||e.format==="urn:x-nmos:format:audio"){if(i.setPlaylistType("VOD").setEndList(),e.format==="urn:x-nmos:format:video"){let a=e.essence_parameters,l=null,u={width:a.frame_width,height:a.frame_height};a.frame_rate&&(l=a.frame_rate.denominator?a.frame_rate.numerator/a.frame_rate.denominator:a.frame_rate.numerator),i.addStreamInfo(new Ye(e.avg_bit_rate?e.avg_bit_rate:0,e.avg_bit_rate?e.avg_bit_rate:0,u,l,null))}else e.format==="urn:x-nmos:format:audio"&&i.addStreamInfo(new Ye(e.avg_bit_rate?e.avg_bit_rate:0,e.avg_bit_rate?e.avg_bit_rate:0,null,null,null));t&&t.length>0&&t.forEach((a,l)=>{let u=z.timerangeExprDuration(a.timerange);e.format,i.addSegment(new hi(u,a.get_urls.at(-1).url)),l===0&&i.setTargetDuration(u)})}let o=bt.write(i.build());return _e.createObjectURL(_e.createBlob([o],{type:"application/x-mpegurl"}))}const pi=p.memo(function({flow:t,childFlows:n,flowSegments:r,childFlowsSegments:i,fps:o,videoLoadOptions:s,setOmakasePlayer:a,config:l,timerange:u,enableHotkey:c}){const d=p.useMemo(()=>Qt(t,r,n,i),[t,r,n,i,u]);return p.createElement(Pt,{videoUrl:d,fps:o,videoLoadOptions:s,setOmakasePlayer:a,config:l,enableHotkeys:c})});function Me(e){const t=new Date(e*1e3),n=t.getUTCHours(),r=t.getUTCMinutes();return`${n}h ${r}min`}const gi=`
|
|
24
|
+
.omakase-time-range-selector-segments {
|
|
25
|
+
display: flex;
|
|
26
|
+
width: 700px;
|
|
27
|
+
position: relative;
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.omakase-time-range-selector-container {
|
|
32
|
+
max-width: 700px;
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.omakase-time-range-selector-segment {
|
|
37
|
+
flex-grow: 1;
|
|
38
|
+
position: relative;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.omakase-time-range-selector-segment-marker {
|
|
45
|
+
background-color: #2E313D;
|
|
46
|
+
border: 1px solid #655372;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.omakase-time-range-selector-segment-tick {
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 10px;
|
|
54
|
+
border-left: 1px solid #655372;
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.omakase-time-range-selector-segment:last-child .omakase-time-range-selector-segment-tick {
|
|
59
|
+
border-right: 1px solid #655372;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.omakase-time-range-selector-segment-label {
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
margin-top: 5px;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.omakase-time-range-selector-segment:first-child .omakase-time-range-selector-segment-label {
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 25px;
|
|
71
|
+
left: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.omakase-time-range-selector-segment:not(:first-child) .omakase-time-range-selector-segment-label {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 25px;
|
|
77
|
+
left: 0;
|
|
78
|
+
transform: translateX(-50%);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.omakase-time-range-selector-segment:last-child {
|
|
82
|
+
position: relative;
|
|
83
|
+
direction: rtl;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.omakase-time-range-selector-segment:last-child .omakase-time-range-selector-segment-first-label {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 25px;
|
|
89
|
+
left: 0;
|
|
90
|
+
transform: translateX(-50%);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.omakase-time-range-selector-segment:last-child .omakase-time-range-selector-segment-second-label {
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 25px;
|
|
96
|
+
right: -100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.omakase-time-range-selector-range-selector {
|
|
100
|
+
height: 20px;
|
|
101
|
+
background-color: #662D91;
|
|
102
|
+
position: absolute;
|
|
103
|
+
cursor: grab;
|
|
104
|
+
width: 300px;
|
|
105
|
+
z-index: 2;
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.omakase-time-range-selector-range-selector-handle {
|
|
111
|
+
height: 32px;
|
|
112
|
+
min-width: 4px;
|
|
113
|
+
background-color: #662D91;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
z-index: 2;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.omakase-time-range-selector-range-selector-duration {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
font-size: 13px;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
text-wrap: nowrap;
|
|
125
|
+
text-overflow: clip;
|
|
126
|
+
color: #ffffff;
|
|
127
|
+
z-index: 3;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.omakase-time-range-selector-range-selector-duration:hover {
|
|
131
|
+
font-size: 13px;
|
|
132
|
+
overflow: visible;
|
|
133
|
+
color: #ffffff;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.omakase-time-range-selector-button-container {
|
|
137
|
+
z-index: 3;
|
|
138
|
+
position: absolute;
|
|
139
|
+
right: 0px;
|
|
140
|
+
top: 10px;
|
|
141
|
+
display: flex;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.omakase-time-range-selector-button-container svg {
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.omakase-time-range-selector-invisible {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.omakase-time-range-selector-button-container button,
|
|
153
|
+
.omakase-time-range-selector-button-container input[type="submit"],
|
|
154
|
+
.omakase-time-range-selector-button-container input[type="reset"] {
|
|
155
|
+
background: none;
|
|
156
|
+
color: inherit;
|
|
157
|
+
border: none;
|
|
158
|
+
padding: 0;
|
|
159
|
+
font: inherit;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
outline: inherit;
|
|
162
|
+
}
|
|
163
|
+
`,vi=`
|
|
164
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
165
|
+
<g filter="url(#filter0_d_5782_463)">
|
|
166
|
+
<circle cx="16" cy="12" r="12" fill="#424850"/>
|
|
167
|
+
<g clip-path="url(#clip0_5782_463)">
|
|
168
|
+
<path d="M21.8411 8.37562C21.5993 8.1332 21.2772 8 20.9346 8C20.5921 8 20.2703 8.13348 20.0278 8.37562L14.4994 13.904L12.1886 11.5932C11.6886 11.0932 10.8751 11.0932 10.3751 11.5932C9.87506 12.0932 9.87506 12.9068 10.3751 13.4068L13.5927 16.6244C13.8348 16.8665 14.1569 17 14.4994 17C14.842 17 15.1644 16.8665 15.4062 16.6244L21.8411 10.1892C22.0836 9.94705 22.2168 9.62493 22.2168 9.2824C22.2168 8.93988 22.0836 8.61804 21.8414 8.37562H21.8411Z" fill="#00E9A3"/>
|
|
169
|
+
</g>
|
|
170
|
+
</g>
|
|
171
|
+
<defs>
|
|
172
|
+
<filter id="filter0_d_5782_463" x="0" y="0" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
173
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
174
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
175
|
+
<feOffset dy="4"/>
|
|
176
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
177
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
178
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
179
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5782_463"/>
|
|
180
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5782_463" result="shape"/>
|
|
181
|
+
</filter>
|
|
182
|
+
<clipPath id="clip0_5782_463">
|
|
183
|
+
<rect width="12.2168" height="9" fill="white" transform="translate(10 8)"/>
|
|
184
|
+
</clipPath>
|
|
185
|
+
</defs>
|
|
186
|
+
</svg>
|
|
187
|
+
`,bi=`
|
|
188
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
189
|
+
<g filter="url(#filter0_d_5782_462)">
|
|
190
|
+
<circle cx="16" cy="12" r="12" fill="#424850"/>
|
|
191
|
+
<g clip-path="url(#clip0_5782_462)">
|
|
192
|
+
<path d="M20.6618 8.96972L17.6319 12L20.6618 15.0301C21.1125 15.4809 21.1125 16.2113 20.6618 16.6621C20.4366 16.8873 20.1414 17 19.8463 17C19.5507 17 19.2555 16.8875 19.0305 16.6621L15.9999 13.6317L12.9696 16.6621C12.7444 16.8873 12.4492 17 12.1538 17C11.8586 17 11.5635 16.8875 11.3382 16.6621C10.8875 16.2114 10.8875 15.4811 11.3382 15.03L14.368 11.9999L11.338 8.96972C10.8873 8.51903 10.8873 7.78852 11.338 7.33783C11.7886 6.88749 12.5187 6.88749 12.9694 7.33783L15.9999 10.3681L19.0301 7.33783C19.481 6.88749 20.2111 6.88749 20.6616 7.33783C21.1125 7.78852 21.1125 8.51903 20.6618 8.96972Z" fill="#F03838"/>
|
|
193
|
+
</g>
|
|
194
|
+
</g>
|
|
195
|
+
<defs>
|
|
196
|
+
<filter id="filter0_d_5782_462" x="0" y="0" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
197
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
198
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
199
|
+
<feOffset dy="4"/>
|
|
200
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
201
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
202
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
203
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5782_462"/>
|
|
204
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5782_462" result="shape"/>
|
|
205
|
+
</filter>
|
|
206
|
+
<clipPath id="clip0_5782_462">
|
|
207
|
+
<rect width="9.99982" height="10" fill="white" transform="translate(11 7)"/>
|
|
208
|
+
</clipPath>
|
|
209
|
+
</defs>
|
|
210
|
+
</svg>
|
|
211
|
+
|
|
212
|
+
`,A={container:"omakase-time-range-selector-container",segments:"omakase-time-range-selector-segments",segment:"omakase-time-range-selector-segment",segmentMarker:"omakase-time-range-selector-segment-marker",segmentTick:"omakase-time-range-selector-segment-tick",segmentLabel:"omakase-time-range-selector-segment-label",firstSegmentLabel:"omakase-time-range-selector-segment-first-label",secondSegmentLabel:"omakase-time-range-selector-segment-second-label",rangeSelector:"omakase-time-range-selector-range-selector",rangeSelectorHandle:"omakase-time-range-selector-range-selector-handle",rangeSelectorDuration:"omakase-time-range-selector-range-selector-duration",buttonContainer:"omakase-time-range-selector-button-container",invisible:"omakase-time-range-selector-invisible"},ke={leftHandle:"omakase-time-range-selector-range-selector-left-handle",rightHandle:"omakase-time-range-selector-range-selector-right-handle",rangeDuration:"omakase-time-range-selector-range-selector-range-duration",segments:"omakase-time-range-selector-segments"};class wt extends HTMLElement{constructor(){super();v(this,"_container");v(this,"_rangeSelector");v(this,"_rangeSelectorLeftHandle");v(this,"_rangeSelectorRightHandle");v(this,"_rangeSelectorRangeDisplay");v(this,"_buttonContainer");v(this,"_segments");v(this,"_numberOfSegments",5);v(this,"_firstLabelIndex",0);v(this,"_initialFirstLabelIndex",0);v(this,"_labels",[]);v(this,"minWidth",10);v(this,"minValue");v(this,"maxValue");v(this,"maxRange");v(this,"segmentSize");v(this,"sliderStart");v(this,"sliderEnd");v(this,"onCheckmarkClickCallback");v(this,"currentStart",0);v(this,"currentEnd",100);v(this,"resetSegments",()=>{this._container.removeChild(this._segments),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.classList.add(A.segments),this._container.append(this._segments)});v(this,"getBounds",()=>({wrapperLeft:this._container.offsetLeft,wrapperRight:this._container.offsetLeft+this._container.offsetWidth,wrapperWidth:this._container.offsetWidth,selectorLeft:this._rangeSelector.offsetLeft,selectorWidth:this._rangeSelector.offsetWidth}));v(this,"getSliderValues",()=>{const{wrapperWidth:n,selectorLeft:r,selectorWidth:i}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),s=this._labels.at(this.lastLabelIndex),a=Math.round(o+r/n*(s-o)),l=Math.round(o+(r+i)/n*(s-o));return{start:a,end:l}});v(this,"getSelectorBounds",(n,r)=>{const{wrapperWidth:i}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),s=this._labels.at(this.lastLabelIndex),a=Math.round((n-o)/(s-o)*i),l=Math.round((r-n)/(s-o)*i);return{selectorLeft:a,selectorWidth:l}});v(this,"initSlider",(n,r)=>{const i=this.getSelectorBounds(n,r);this._rangeSelector.style.left=i.selectorLeft.toString()+"px",this._rangeSelector.style.width=i.selectorWidth.toString()+"px",this.updateDuration()});v(this,"showButtons",()=>{const{start:n,end:r}=this.getSliderValues();n===this.currentStart&&r===this.currentEnd||this._buttonContainer.classList.remove(A.invisible)});v(this,"hideButtons",()=>{this._buttonContainer.classList.add(A.invisible)});v(this,"updateDuration",()=>{const{start:n,end:r}=this.getSliderValues(),i=r-n;this._rangeSelectorRangeDisplay.textContent=Me(i)});v(this,"onXclick",()=>{this.firstLabelIndex=this._initialFirstLabelIndex,this.resetSegments();const n=this.getSelectorBounds(this.currentStart,this.currentEnd);this._rangeSelector.style.left=n.selectorLeft.toString()+"px",this._rangeSelector.style.width=n.selectorWidth.toString()+"px",this.updateDuration(),this.hideButtons()});v(this,"onCheckmarkClick",()=>{const{start:n,end:r}=this.getSliderValues();this.currentStart=n,this.currentEnd=r,this._initialFirstLabelIndex=this.firstLabelIndex,this.updateDuration(),this.hideButtons(),this.onCheckmarkClickCallback!==void 0&&this.onCheckmarkClickCallback(n,r)});v(this,"onMouseDownRight",n=>{n.preventDefault();const r=n.clientX,{selectorWidth:i,wrapperWidth:o,selectorLeft:s}=this.getBounds();let a=null,l=null;const u=d=>{let f=d.clientX-r,h=Math.max(this.minWidth,i+f);const b=Math.min(o,o-s),g=h>b,_=performance.now();g?a===null&&(a=_,l=window.setTimeout(()=>{this.outOfBoundsCallback(!0),l=window.setInterval(()=>this.outOfBoundsCallback(!0),400)},500)):(l!==null&&(clearTimeout(l),clearInterval(l),l=null),a=null),h=Math.min(h,b),this._rangeSelector.style.width=`${h}px`,this.updateDuration()},c=()=>{this.showButtons(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c),l!==null&&(clearTimeout(l),clearInterval(l),l=null),a=null};document.addEventListener("mousemove",u),document.addEventListener("mouseup",c)});v(this,"onMouseDownLeft",n=>{n.preventDefault();const r=n.clientX,{selectorLeft:i,selectorWidth:o,wrapperWidth:s}=this.getBounds();let a=null,l=null;const u=d=>{let f=d.clientX-r,h=i+f;const b=h<0,g=performance.now();b?a===null&&(a=g,l=window.setTimeout(()=>{this.outOfBoundsCallback(!1),l=window.setInterval(()=>this.outOfBoundsCallback(!1),400)},500)):(l!==null&&(clearTimeout(l),clearInterval(l),l=null),a=null),h<0&&(f=-i,h=0);let _=Math.min(Math.max(this.minWidth,o-f),s);h+_>s&&(h=s-_),_>this.minWidth&&(this._rangeSelector.style.left=`${h}px`,this._rangeSelector.style.width=`${_}px`),this.updateDuration()},c=()=>{this.showButtons(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c),l!==null&&(clearTimeout(l),clearInterval(l),l=null),a=null};document.addEventListener("mousemove",u),document.addEventListener("mouseup",c)});v(this,"outOfBoundsCallback",n=>{n?this.firstLabelIndex+=1:this.firstLabelIndex-=1,this.resetSegments()});v(this,"onMouseDownDrag",n=>{if(n.target instanceof HTMLElement&&n.target.classList.contains(A.rangeSelectorHandle))return;n.preventDefault();const r=n.clientX,{selectorLeft:i,selectorWidth:o,wrapperWidth:s}=this.getBounds();let a=null,l=null;const u=d=>{let f=d.clientX-r,h=i+f;const b=s-o,g=h<0||h>b,_=performance.now();if(g){if(a===null){const L=h>b;a=_,l=window.setTimeout(()=>{this.outOfBoundsCallback(L),l=window.setInterval(()=>this.outOfBoundsCallback(L),400)},500)}}else l!==null&&(clearTimeout(l),clearInterval(l),l=null),a=null;h=Math.max(0,Math.min(h,b)),this._rangeSelector.style.left=`${h}px`,this.updateDuration()},c=()=>{this.showButtons(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c),l!==null&&(clearTimeout(l),clearInterval(l))};document.addEventListener("mousemove",u),document.addEventListener("mouseup",c)})}set numberOfSegments(n){n>2&&(this._numberOfSegments=n)}get numberOfSegments(){return this._numberOfSegments}static get observedAttributes(){return["minValue","maxValue","maxRange","segmentSize","sliderStart","sliderEnd","numberOfSegments"]}get firstLabelIndex(){return this._firstLabelIndex}set firstLabelIndex(n){if(n+this._numberOfSegments+1>=this._labels.length){this._firstLabelIndex=this._labels.length-1-this.numberOfSegments;return}if(n<0){this._firstLabelIndex=0;return}this._firstLabelIndex=n}get lastLabelIndex(){return this._firstLabelIndex+this._numberOfSegments}connectedCallback(){if(this.minValue=Number.parseInt(this.getAttribute("minValue")??"NaN"),this.maxValue=Number.parseInt(this.getAttribute("maxValue")??"NaN"),this.maxRange=Number.parseInt(this.getAttribute("maxRange")??"NaN"),this.segmentSize=Number.parseInt(this.getAttribute("segmentSize")??"NaN"),this.getAttribute("numberOfSegments")){const c=Number.parseInt(this.getAttribute("numberOfSegments"));if(Number.isNaN(c))throw new Error("Invalid atribute value");this._numberOfSegments=c}if(Number.isNaN(this.minValue)||Number.isNaN(this.maxValue)||Number.isNaN(this.maxRange)||Number.isNaN(this.segmentSize))throw new Error("Invalid attribute values.");const n=this.maxValue-this.minValue;if(n<this.numberOfSegments*this.segmentSize&&(this.segmentSize=n/this.numberOfSegments),this._labels=this.calculateLabels(),this.maxValue<this.minValue)throw new Error("Max value is lesser than min value");let r,i;if(this.getAttribute("sliderStart")&&this.getAttribute("sliderEnd")){if(r=Number.parseFloat(this.getAttribute("sliderStart")),i=Number.parseFloat(this.getAttribute("sliderEnd")),r>i)throw new Error("Slider start is bigger than slider end");if(r<this.minValue)throw new Error("Slider start is smaller than minimal value");i>this.maxValue&&(i=this.maxValue),this.currentStart=r,this.currentEnd=i}else r=this.minValue,i=this.segmentSize;this.resolveInitialSegment(r,i),this._container=document.createElement("div"),this._container.classList.add(A.container);const o=document.createElement("style");o.textContent=gi,this._container.append(o),this._buttonContainer=document.createElement("div"),this._buttonContainer.classList.add(A.buttonContainer,A.invisible);const s=this.createButtonSvg(vi),a=this.createButtonSvg(bi);s.onclick=this.onCheckmarkClick,a.onclick=this.onXclick,this._buttonContainer.append(s,a),this._container.append(this._buttonContainer),this._rangeSelector=document.createElement("div"),this._rangeSelector.classList.add(A.rangeSelector),this._rangeSelectorLeftHandle=document.createElement("div"),this._rangeSelectorLeftHandle.classList.add(A.rangeSelectorHandle),this._rangeSelectorLeftHandle.id=ke.leftHandle,this._rangeSelectorRightHandle=document.createElement("div"),this._rangeSelectorRightHandle.classList.add(A.rangeSelectorHandle),this._rangeSelectorRightHandle.id=ke.rightHandle,this._rangeSelectorRangeDisplay=document.createElement("div"),this._rangeSelectorRangeDisplay.classList.add(A.rangeSelectorDuration),this._rangeSelectorRangeDisplay.id=ke.rangeDuration,this._rangeSelector.append(this._rangeSelectorLeftHandle,this._rangeSelectorRangeDisplay,this._rangeSelectorRightHandle),this._container.append(this._rangeSelector),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.id=ke.segments,this._segments.classList.add(A.segments),this._container.append(this._segments),this._rangeSelectorLeftHandle.addEventListener("mousedown",this.onMouseDownLeft),this._rangeSelectorRightHandle.addEventListener("mousedown",this.onMouseDownRight),this._rangeSelector.addEventListener("mousedown",this.onMouseDownDrag),this.append(this._container),this.initSlider(r,i);const{start:l,end:u}=this.getSliderValues();this.currentStart=l,this.currentEnd=u,this.updateDuration()}resolveInitialSegment(n,r){debugger;const i=this._numberOfSegments*this.segmentSize,o=r-n,s=this.maxValue-this.minValue,a=n-this.minValue,l=Math.ceil(s/this.segmentSize);let u=Math.floor(a/s*l);u+=Math.floor((i-o)/this.segmentSize);const d=u+Math.ceil(o/this.segmentSize)-this._numberOfSegments-1;this.firstLabelIndex=d,this._initialFirstLabelIndex=d}createButtonSvg(n){const r=document.createElement("button");return r.innerHTML=n,r}calculateLabels(){const n=this.minValue,r=this.maxValue,i=Math.floor((this.maxValue-this.minValue)/this.segmentSize)-1,o=[n];let s=this.minValue;for(let a=0;a<i;a++)s+=this.segmentSize,o.push(s);return o.push(r),o}buildSegments(n){const r=document.createElement("div");n.slice(0,-2).forEach(u=>{const c=document.createElement("div");c.classList.add(A.segment);const d=document.createElement("div");d.classList.add(A.segmentMarker);const f=document.createElement("div");f.classList.add(A.segmentTick);const h=document.createElement("div");h.classList.add(A.segmentLabel),h.innerHTML=Me(u),c.append(d,f,h),r.append(c)});const i=document.createElement("div");i.classList.add(A.segment);const o=document.createElement("div");o.classList.add(A.segmentMarker);const s=document.createElement("div");s.classList.add(A.segmentTick);const a=document.createElement("div");a.classList.add(A.segmentLabel,A.firstSegmentLabel),a.innerHTML=Me(n.at(-2));const l=document.createElement("div");return l.classList.add(A.segmentLabel,A.secondSegmentLabel),l.innerHTML=Me(n.at(-1)),i.append(o,s,a,l),r.append(i),r}}const Et="omakase-time-range-selector-react-div",wi=({timeRange:e,maxTimeRange:t,numberOfSegments:n,segmentSize:r,maxSliderRange:i,onCheckmarkClickCallback:o})=>(customElements.get("omakase-time-range-selector")||customElements.define("omakase-time-range-selector",wt),p.useEffect(()=>{var h;const s=z.parseTimeRange(t),a=z.timeMomentToSeconds(s.start),l=z.timeMomentToSeconds(s.end),u=z.parseTimeRange(e),c=z.timeMomentToSeconds(u.start),d=z.timeMomentToSeconds(u.end),f=new wt;f.setAttribute("minValue",a.toString()),f.setAttribute("maxValue",l.toString()),f.setAttribute("maxRange",i.toString()),f.setAttribute("segmentSize",r.toString()),f.setAttribute("numberOfSegments",n.toString()),f.setAttribute("sliderStart",c.toString()),f.setAttribute("sliderEnd",d.toString()),f.onCheckmarkClickCallback=o,(h=document.getElementById(Et))==null||h.append(f)},[]),p.createElement("div",{id:Et})),Ei=p.memo(({omakasePlayer:e,config:t,onCreateMarkerListCallback:n})=>(p.useEffect(()=>{const r=e.createMarkerList(t).subscribe({next:i=>{n==null||n(i)}});return()=>{r.unsubscribe()}},[t.source]),p.createElement("div",{id:t.markerListHTMLElementId})));exports.OmakaseMarkerListComponent=Ei;exports.OmakasePlayerComponent=Pt;exports.OmakasePlayerTimelineBuilder=on;exports.OmakasePlayerTimelineComponent=tr;exports.OmakasePlayerTimelineControlsToolbar=gr;exports.OmakaseTamsPlayerComponent=pi;exports.OmakaseTimeRangePicker=wi;exports.TimeRangeUtil=z;exports.TimecodeUtil=ee;
|
|
213
|
+
//# sourceMappingURL=index.cjs.js.map
|