UNPKG

@byomakase/omakase-player

Version:

## Omakase Player - Open source JavaScript framework for building frame accurate video experiences

3 lines • 4.6 MB
(function(LA,UB){typeof exports=="object"&&typeof module<"u"?UB(exports,require("hls.js")):typeof define=="function"&&define.amd?define(["exports","hls.js"],UB):(LA=typeof globalThis<"u"?globalThis:LA||self,UB(LA.omakase={},LA.Hls))})(this,function(LA,UB){"use strict";var cC=typeof document<"u"?document.currentScript:null,es=function(g,A){return es=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Q){B.__proto__=Q}||function(B,Q){for(var I in Q)Object.prototype.hasOwnProperty.call(Q,I)&&(B[I]=Q[I])},es(g,A)};function dI(g,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");es(g,A);function B(){this.constructor=g}g.prototype=A===null?Object.create(A):(B.prototype=A.prototype,new B)}function wd(g,A,B,Q){function I(E){return E instanceof B?E:new B(function(C){C(E)})}return new(B||(B=Promise))(function(E,C){function i(o){try{e(Q.next(o))}catch(s){C(s)}}function t(o){try{e(Q.throw(o))}catch(s){C(s)}}function e(o){o.done?E(o.value):I(o.value).then(i,t)}e((Q=Q.apply(g,A||[])).next())})}function wn(g,A){var B={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},Q,I,E,C=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return C.next=i(0),C.throw=i(1),C.return=i(2),typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function i(e){return function(o){return t([e,o])}}function t(e){if(Q)throw new TypeError("Generator is already executing.");for(;C&&(C=0,e[0]&&(B=0)),B;)try{if(Q=1,I&&(E=e[0]&2?I.return:e[0]?I.throw||((E=I.return)&&E.call(I),0):I.next)&&!(E=E.call(I,e[1])).done)return E;switch(I=0,E&&(e=[e[0]&2,E.value]),e[0]){case 0:case 1:E=e;break;case 4:return B.label++,{value:e[1],done:!1};case 5:B.label++,I=e[1],e=[0];continue;case 7:e=B.ops.pop(),B.trys.pop();continue;default:if(E=B.trys,!(E=E.length>0&&E[E.length-1])&&(e[0]===6||e[0]===2)){B=0;continue}if(e[0]===3&&(!E||e[1]>E[0]&&e[1]<E[3])){B.label=e[1];break}if(e[0]===6&&B.label<E[1]){B.label=E[1],E=e;break}if(E&&B.label<E[2]){B.label=E[2],B.ops.push(e);break}E[2]&&B.ops.pop(),B.trys.pop();continue}e=A.call(g,B)}catch(o){e=[6,o],I=0}finally{Q=E=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}function wC(g){var A=typeof Symbol=="function"&&Symbol.iterator,B=A&&g[A],Q=0;if(B)return B.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&Q>=g.length&&(g=void 0),{value:g&&g[Q++],done:!g}}};throw new TypeError(A?"Object is not iterable.":"Symbol.iterator is not defined.")}function UE(g,A){var B=typeof Symbol=="function"&&g[Symbol.iterator];if(!B)return g;var Q=B.call(g),I,E=[],C;try{for(;(A===void 0||A-- >0)&&!(I=Q.next()).done;)E.push(I.value)}catch(i){C={error:i}}finally{try{I&&!I.done&&(B=Q.return)&&B.call(Q)}finally{if(C)throw C.error}}return E}function GC(g,A,B){if(B||arguments.length===2)for(var Q=0,I=A.length,E;Q<I;Q++)(E||!(Q in A))&&(E||(E=Array.prototype.slice.call(A,0,Q)),E[Q]=A[Q]);return g.concat(E||Array.prototype.slice.call(A))}function FC(g){return this instanceof FC?(this.v=g,this):new FC(g)}function Gd(g,A,B){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Q=B.apply(g,A||[]),I,E=[];return I=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",C),I[Symbol.asyncIterator]=function(){return this},I;function C(D){return function(r){return Promise.resolve(r).then(D,s)}}function i(D,r){Q[D]&&(I[D]=function(n){return new Promise(function(h,G){E.push([D,n,h,G])>1||t(D,n)})},r&&(I[D]=r(I[D])))}function t(D,r){try{e(Q[D](r))}catch(n){a(E[0][3],n)}}function e(D){D.value instanceof FC?Promise.resolve(D.value.v).then(o,s):a(E[0][2],D)}function o(D){t("next",D)}function s(D){t("throw",D)}function a(D,r){D(r),E.shift(),E.length&&t(E[0][0],E[0][1])}}function Fd(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var A=g[Symbol.asyncIterator],B;return A?A.call(g):(g=typeof wC=="function"?wC(g):g[Symbol.iterator](),B={},Q("next"),Q("throw"),Q("return"),B[Symbol.asyncIterator]=function(){return this},B);function Q(E){B[E]=g[E]&&function(C){return new Promise(function(i,t){C=g[E](C),I(i,t,C.done,C.value)})}}function I(E,C,i,t){Promise.resolve(t).then(function(e){E({value:e,done:i})},C)}}typeof SuppressedError=="function"&&SuppressedError;function lB(g){return typeof g=="function"}function ne(g){var A=function(Q){Error.call(Q),Q.stack=new Error().stack},B=g(A);return B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B}var os=ne(function(g){return function(B){g(this),this.message=B?B.length+` errors occurred during unsubscription: `+B.map(function(Q,I){return I+1+") "+Q.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=B}});function he(g,A){if(g){var B=g.indexOf(A);0<=B&&g.splice(B,1)}}var Ki=function(){function g(A){this.initialTeardown=A,this.closed=!1,this._parentage=null,this._finalizers=null}return g.prototype.unsubscribe=function(){var A,B,Q,I,E;if(!this.closed){this.closed=!0;var C=this._parentage;if(C)if(this._parentage=null,Array.isArray(C))try{for(var i=wC(C),t=i.next();!t.done;t=i.next()){var e=t.value;e.remove(this)}}catch(n){A={error:n}}finally{try{t&&!t.done&&(B=i.return)&&B.call(i)}finally{if(A)throw A.error}}else C.remove(this);var o=this.initialTeardown;if(lB(o))try{o()}catch(n){E=n instanceof os?n.errors:[n]}var s=this._finalizers;if(s){this._finalizers=null;try{for(var a=wC(s),D=a.next();!D.done;D=a.next()){var r=D.value;try{ln(r)}catch(n){E=E??[],n instanceof os?E=GC(GC([],UE(E)),UE(n.errors)):E.push(n)}}}catch(n){Q={error:n}}finally{try{D&&!D.done&&(I=a.return)&&I.call(a)}finally{if(Q)throw Q.error}}}if(E)throw new os(E)}},g.prototype.add=function(A){var B;if(A&&A!==this)if(this.closed)ln(A);else{if(A instanceof g){if(A.closed||A._hasParent(this))return;A._addParent(this)}(this._finalizers=(B=this._finalizers)!==null&&B!==void 0?B:[]).push(A)}},g.prototype._hasParent=function(A){var B=this._parentage;return B===A||Array.isArray(B)&&B.includes(A)},g.prototype._addParent=function(A){var B=this._parentage;this._parentage=Array.isArray(B)?(B.push(A),B):B?[B,A]:A},g.prototype._removeParent=function(A){var B=this._parentage;B===A?this._parentage=null:Array.isArray(B)&&he(B,A)},g.prototype.remove=function(A){var B=this._finalizers;B&&he(B,A),A instanceof g&&A._removeParent(this)},g.EMPTY=function(){var A=new g;return A.closed=!0,A}(),g}(),Gn=Ki.EMPTY;function Fn(g){return g instanceof Ki||g&&"closed"in g&&lB(g.remove)&&lB(g.add)&&lB(g.unsubscribe)}function ln(g){lB(g)?g():g.unsubscribe()}var dn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Rn={setTimeout:function(g,A){for(var B=[],Q=2;Q<arguments.length;Q++)B[Q-2]=arguments[Q];return setTimeout.apply(void 0,GC([g,A],UE(B)))},clearTimeout:function(g){var A=Rn.delegate;return((A==null?void 0:A.clearTimeout)||clearTimeout)(g)},delegate:void 0};function Un(g){Rn.setTimeout(function(){throw g})}function ce(){}function we(g){g()}var as=function(g){dI(A,g);function A(B){var Q=g.call(this)||this;return Q.isStopped=!1,B?(Q.destination=B,Fn(B)&&B.add(Q)):Q.destination=Ud,Q}return A.create=function(B,Q,I){return new Ge(B,Q,I)},A.prototype.next=function(B){this.isStopped||this._next(B)},A.prototype.error=function(B){this.isStopped||(this.isStopped=!0,this._error(B))},A.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},A.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,g.prototype.unsubscribe.call(this),this.destination=null)},A.prototype._next=function(B){this.destination.next(B)},A.prototype._error=function(B){try{this.destination.error(B)}finally{this.unsubscribe()}},A.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},A}(Ki),ld=Function.prototype.bind;function ss(g,A){return ld.call(g,A)}var dd=function(){function g(A){this.partialObserver=A}return g.prototype.next=function(A){var B=this.partialObserver;if(B.next)try{B.next(A)}catch(Q){Fe(Q)}},g.prototype.error=function(A){var B=this.partialObserver;if(B.error)try{B.error(A)}catch(Q){Fe(Q)}else Fe(A)},g.prototype.complete=function(){var A=this.partialObserver;if(A.complete)try{A.complete()}catch(B){Fe(B)}},g}(),Ge=function(g){dI(A,g);function A(B,Q,I){var E=g.call(this)||this,C;if(lB(B)||!B)C={next:B??void 0,error:Q??void 0,complete:I??void 0};else{var i;E&&dn.useDeprecatedNextContext?(i=Object.create(B),i.unsubscribe=function(){return E.unsubscribe()},C={next:B.next&&ss(B.next,i),error:B.error&&ss(B.error,i),complete:B.complete&&ss(B.complete,i)}):C=B}return E.destination=new dd(C),E}return A}(as);function Fe(g){Un(g)}function Rd(g){throw g}var Ud={closed:!0,next:ce,error:Rd,complete:ce},Ds=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function kE(g){return g}function kd(g){return g.length===0?kE:g.length===1?g[0]:function(B){return g.reduce(function(Q,I){return I(Q)},B)}}var cA=function(){function g(A){A&&(this._subscribe=A)}return g.prototype.lift=function(A){var B=new g;return B.source=this,B.operator=A,B},g.prototype.subscribe=function(A,B,Q){var I=this,E=Md(A)?A:new Ge(A,B,Q);return we(function(){var C=I,i=C.operator,t=C.source;E.add(i?i.call(E,t):t?I._subscribe(E):I._trySubscribe(E))}),E},g.prototype._trySubscribe=function(A){try{return this._subscribe(A)}catch(B){A.error(B)}},g.prototype.forEach=function(A,B){var Q=this;return B=kn(B),new B(function(I,E){var C=new Ge({next:function(i){try{A(i)}catch(t){E(t),C.unsubscribe()}},error:E,complete:I});Q.subscribe(C)})},g.prototype._subscribe=function(A){var B;return(B=this.source)===null||B===void 0?void 0:B.subscribe(A)},g.prototype[Ds]=function(){return this},g.prototype.pipe=function(){for(var A=[],B=0;B<arguments.length;B++)A[B]=arguments[B];return kd(A)(this)},g.prototype.toPromise=function(A){var B=this;return A=kn(A),new A(function(Q,I){var E;B.subscribe(function(C){return E=C},function(C){return I(C)},function(){return Q(E)})})},g.create=function(A){return new g(A)},g}();function kn(g){var A;return(A=g??dn.Promise)!==null&&A!==void 0?A:Promise}function yd(g){return g&&lB(g.next)&&lB(g.error)&&lB(g.complete)}function Md(g){return g&&g instanceof as||yd(g)&&Fn(g)}function Sd(g){return lB(g==null?void 0:g.lift)}function DQ(g){return function(A){if(Sd(A))return A.lift(function(B){try{return g(B,this)}catch(Q){this.error(Q)}});throw new TypeError("Unable to lift unknown Observable type")}}function YB(g,A,B,Q,I){return new Nd(g,A,B,Q,I)}var Nd=function(g){dI(A,g);function A(B,Q,I,E,C,i){var t=g.call(this,B)||this;return t.onFinalize=C,t.shouldUnsubscribe=i,t._next=Q?function(e){try{Q(e)}catch(o){B.error(o)}}:g.prototype._next,t._error=E?function(e){try{E(e)}catch(o){B.error(o)}finally{this.unsubscribe()}}:g.prototype._error,t._complete=I?function(){try{I()}catch(e){B.error(e)}finally{this.unsubscribe()}}:g.prototype._complete,t}return A.prototype.unsubscribe=function(){var B;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var Q=this.closed;g.prototype.unsubscribe.call(this),!Q&&((B=this.onFinalize)===null||B===void 0||B.call(this))}},A}(as),Ld=ne(function(g){return function(){g(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),y=function(g){dI(A,g);function A(){var B=g.call(this)||this;return B.closed=!1,B.currentObservers=null,B.observers=[],B.isStopped=!1,B.hasError=!1,B.thrownError=null,B}return A.prototype.lift=function(B){var Q=new yn(this,this);return Q.operator=B,Q},A.prototype._throwIfClosed=function(){if(this.closed)throw new Ld},A.prototype.next=function(B){var Q=this;we(function(){var I,E;if(Q._throwIfClosed(),!Q.isStopped){Q.currentObservers||(Q.currentObservers=Array.from(Q.observers));try{for(var C=wC(Q.currentObservers),i=C.next();!i.done;i=C.next()){var t=i.value;t.next(B)}}catch(e){I={error:e}}finally{try{i&&!i.done&&(E=C.return)&&E.call(C)}finally{if(I)throw I.error}}}})},A.prototype.error=function(B){var Q=this;we(function(){if(Q._throwIfClosed(),!Q.isStopped){Q.hasError=Q.isStopped=!0,Q.thrownError=B;for(var I=Q.observers;I.length;)I.shift().error(B)}})},A.prototype.complete=function(){var B=this;we(function(){if(B._throwIfClosed(),!B.isStopped){B.isStopped=!0;for(var Q=B.observers;Q.length;)Q.shift().complete()}})},A.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(A.prototype,"observed",{get:function(){var B;return((B=this.observers)===null||B===void 0?void 0:B.length)>0},enumerable:!1,configurable:!0}),A.prototype._trySubscribe=function(B){return this._throwIfClosed(),g.prototype._trySubscribe.call(this,B)},A.prototype._subscribe=function(B){return this._throwIfClosed(),this._checkFinalizedStatuses(B),this._innerSubscribe(B)},A.prototype._innerSubscribe=function(B){var Q=this,I=this,E=I.hasError,C=I.isStopped,i=I.observers;return E||C?Gn:(this.currentObservers=null,i.push(B),new Ki(function(){Q.currentObservers=null,he(i,B)}))},A.prototype._checkFinalizedStatuses=function(B){var Q=this,I=Q.hasError,E=Q.thrownError,C=Q.isStopped;I?B.error(E):C&&B.complete()},A.prototype.asObservable=function(){var B=new cA;return B.source=this,B},A.create=function(B,Q){return new yn(B,Q)},A}(cA),yn=function(g){dI(A,g);function A(B,Q){var I=g.call(this)||this;return I.destination=B,I.source=Q,I}return A.prototype.next=function(B){var Q,I;(I=(Q=this.destination)===null||Q===void 0?void 0:Q.next)===null||I===void 0||I.call(Q,B)},A.prototype.error=function(B){var Q,I;(I=(Q=this.destination)===null||Q===void 0?void 0:Q.error)===null||I===void 0||I.call(Q,B)},A.prototype.complete=function(){var B,Q;(Q=(B=this.destination)===null||B===void 0?void 0:B.complete)===null||Q===void 0||Q.call(B)},A.prototype._subscribe=function(B){var Q,I;return(I=(Q=this.source)===null||Q===void 0?void 0:Q.subscribe(B))!==null&&I!==void 0?I:Gn},A}(y),iB=function(g){dI(A,g);function A(B){var Q=g.call(this)||this;return Q._value=B,Q}return Object.defineProperty(A.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),A.prototype._subscribe=function(B){var Q=g.prototype._subscribe.call(this,B);return!Q.closed&&B.next(this._value),Q},A.prototype.getValue=function(){var B=this,Q=B.hasError,I=B.thrownError,E=B._value;if(Q)throw I;return this._throwIfClosed(),E},A.prototype.next=function(B){g.prototype.next.call(this,this._value=B)},A}(y),ud={now:function(){return Date.now()},delegate:void 0},Jd=function(g){dI(A,g);function A(B,Q){return g.call(this)||this}return A.prototype.schedule=function(B,Q){return this},A}(Ki),Mn={setInterval:function(g,A){for(var B=[],Q=2;Q<arguments.length;Q++)B[Q-2]=arguments[Q];return setInterval.apply(void 0,GC([g,A],UE(B)))},clearInterval:function(g){return clearInterval(g)},delegate:void 0},Hd=function(g){dI(A,g);function A(B,Q){var I=g.call(this,B,Q)||this;return I.scheduler=B,I.work=Q,I.pending=!1,I}return A.prototype.schedule=function(B,Q){var I;if(Q===void 0&&(Q=0),this.closed)return this;this.state=B;var E=this.id,C=this.scheduler;return E!=null&&(this.id=this.recycleAsyncId(C,E,Q)),this.pending=!0,this.delay=Q,this.id=(I=this.id)!==null&&I!==void 0?I:this.requestAsyncId(C,this.id,Q),this},A.prototype.requestAsyncId=function(B,Q,I){return I===void 0&&(I=0),Mn.setInterval(B.flush.bind(B,this),I)},A.prototype.recycleAsyncId=function(B,Q,I){if(I===void 0&&(I=0),I!=null&&this.delay===I&&this.pending===!1)return Q;Q!=null&&Mn.clearInterval(Q)},A.prototype.execute=function(B,Q){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var I=this._execute(B,Q);if(I)return I;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},A.prototype._execute=function(B,Q){var I=!1,E;try{this.work(B)}catch(C){I=!0,E=C||new Error("Scheduled action threw falsy error")}if(I)return this.unsubscribe(),E},A.prototype.unsubscribe=function(){if(!this.closed){var B=this,Q=B.id,I=B.scheduler,E=I.actions;this.work=this.state=this.scheduler=null,this.pending=!1,he(E,this),Q!=null&&(this.id=this.recycleAsyncId(I,Q,null)),this.delay=null,g.prototype.unsubscribe.call(this)}},A}(Jd),Sn=function(){function g(A,B){B===void 0&&(B=g.now),this.schedulerActionCtor=A,this.now=B}return g.prototype.schedule=function(A,B,Q){return B===void 0&&(B=0),new this.schedulerActionCtor(this,A).schedule(Q,B)},g.now=ud.now,g}(),pd=function(g){dI(A,g);function A(B,Q){Q===void 0&&(Q=Sn.now);var I=g.call(this,B,Q)||this;return I.actions=[],I._active=!1,I}return A.prototype.flush=function(B){var Q=this.actions;if(this._active){Q.push(B);return}var I;this._active=!0;do if(I=B.execute(B.state,B.delay))break;while(B=Q.shift());if(this._active=!1,I){for(;B=Q.shift();)B.unsubscribe();throw I}},A}(Sn),lC=new pd(Hd),md=lC,rs=new cA(function(g){return g.complete()});function Nn(g){return g&&lB(g.schedule)}function ns(g){return g[g.length-1]}function hs(g){return lB(ns(g))?g.pop():void 0}function le(g){return Nn(ns(g))?g.pop():void 0}function Yd(g,A){return typeof ns(g)=="number"?g.pop():A}var cs=function(g){return g&&typeof g.length=="number"&&typeof g!="function"};function Ln(g){return lB(g==null?void 0:g.then)}function un(g){return lB(g[Ds])}function Jn(g){return Symbol.asyncIterator&&lB(g==null?void 0:g[Symbol.asyncIterator])}function Hn(g){return new TypeError("You provided "+(g!==null&&typeof g=="object"?"an invalid object":"'"+g+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Kd(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pn=Kd();function mn(g){return lB(g==null?void 0:g[pn])}function Yn(g){return Gd(this,arguments,function(){var B,Q,I,E;return wn(this,function(C){switch(C.label){case 0:B=g.getReader(),C.label=1;case 1:C.trys.push([1,,9,10]),C.label=2;case 2:return[4,FC(B.read())];case 3:return Q=C.sent(),I=Q.value,E=Q.done,E?[4,FC(void 0)]:[3,5];case 4:return[2,C.sent()];case 5:return[4,FC(I)];case 6:return[4,C.sent()];case 7:return C.sent(),[3,2];case 8:return[3,10];case 9:return B.releaseLock(),[7];case 10:return[2]}})})}function Kn(g){return lB(g==null?void 0:g.getReader)}function rQ(g){if(g instanceof cA)return g;if(g!=null){if(un(g))return bd(g);if(cs(g))return fd(g);if(Ln(g))return nA(g);if(Jn(g))return bn(g);if(mn(g))return Vd(g);if(Kn(g))return Wd(g)}throw Hn(g)}function bd(g){return new cA(function(A){var B=g[Ds]();if(lB(B.subscribe))return B.subscribe(A);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function fd(g){return new cA(function(A){for(var B=0;B<g.length&&!A.closed;B++)A.next(g[B]);A.complete()})}function nA(g){return new cA(function(A){g.then(function(B){A.closed||(A.next(B),A.complete())},function(B){return A.error(B)}).then(null,Un)})}function Vd(g){return new cA(function(A){var B,Q;try{for(var I=wC(g),E=I.next();!E.done;E=I.next()){var C=E.value;if(A.next(C),A.closed)return}}catch(i){B={error:i}}finally{try{E&&!E.done&&(Q=I.return)&&Q.call(I)}finally{if(B)throw B.error}}A.complete()})}function bn(g){return new cA(function(A){xd(g,A).catch(function(B){return A.error(B)})})}function Wd(g){return bn(Yn(g))}function xd(g,A){var B,Q,I,E;return wd(this,void 0,void 0,function(){var C,i;return wn(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,11]),B=Fd(g),t.label=1;case 1:return[4,B.next()];case 2:if(Q=t.sent(),!!Q.done)return[3,4];if(C=Q.value,A.next(C),A.closed)return[2];t.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=t.sent(),I={error:i},[3,11];case 6:return t.trys.push([6,,9,10]),Q&&!Q.done&&(E=B.return)?[4,E.call(B)]:[3,8];case 7:t.sent(),t.label=8;case 8:return[3,10];case 9:if(I)throw I.error;return[7];case 10:return[7];case 11:return A.complete(),[2]}})})}function RI(g,A,B,Q,I){Q===void 0&&(Q=0),I===void 0&&(I=!1);var E=A.schedule(function(){B(),I?g.add(this.schedule(null,Q)):this.unsubscribe()},Q);if(g.add(E),!I)return E}function fn(g,A){return A===void 0&&(A=0),DQ(function(B,Q){B.subscribe(YB(Q,function(I){return RI(Q,g,function(){return Q.next(I)},A)},function(){return RI(Q,g,function(){return Q.complete()},A)},function(I){return RI(Q,g,function(){return Q.error(I)},A)}))})}function Vn(g,A){return A===void 0&&(A=0),DQ(function(B,Q){Q.add(g.schedule(function(){return B.subscribe(Q)},A))})}function Zd(g,A){return rQ(g).pipe(Vn(A),fn(A))}function Td(g,A){return rQ(g).pipe(Vn(A),fn(A))}function Od(g,A){return new cA(function(B){var Q=0;return A.schedule(function(){Q===g.length?B.complete():(B.next(g[Q++]),B.closed||this.schedule())})})}function vd(g,A){return new cA(function(B){var Q;return RI(B,A,function(){Q=g[pn](),RI(B,A,function(){var I,E,C;try{I=Q.next(),E=I.value,C=I.done}catch(i){B.error(i);return}C?B.complete():B.next(E)},0,!0)}),function(){return lB(Q==null?void 0:Q.return)&&Q.return()}})}function Wn(g,A){if(!g)throw new Error("Iterable cannot be null");return new cA(function(B){RI(B,A,function(){var Q=g[Symbol.asyncIterator]();RI(B,A,function(){Q.next().then(function(I){I.done?B.complete():B.next(I.value)})},0,!0)})})}function qd(g,A){return Wn(Yn(g),A)}function Xd(g,A){if(g!=null){if(un(g))return Zd(g,A);if(cs(g))return Od(g,A);if(Ln(g))return Td(g,A);if(Jn(g))return Wn(g,A);if(mn(g))return vd(g,A);if(Kn(g))return qd(g,A)}throw Hn(g)}function qB(g,A){return A?Xd(g,A):rQ(g)}function PB(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=le(g);return qB(g,B)}var ws=ne(function(g){return function(){g(this),this.name="EmptyError",this.message="no elements in sequence"}});function wA(g,A){return new Promise(function(B,Q){var I=new Ge({next:function(E){B(E),I.unsubscribe()},error:Q,complete:function(){Q(new ws)}});g.subscribe(I)})}function xn(g){return g instanceof Date&&!isNaN(g)}var zd=ne(function(g){return function(B){B===void 0&&(B=null),g(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=B}});function Dg(g,A){var B=xn(g)?{first:g}:typeof g=="number"?{each:g}:g,Q=B.first,I=B.each,E=B.with,C=E===void 0?Pd:E,i=B.scheduler,t=i===void 0?lC:i,e=B.meta,o=e===void 0?null:e;if(Q==null&&I==null)throw new TypeError("No timeout provided.");return DQ(function(s,a){var D,r,n=null,h=0,G=function(w){r=RI(a,t,function(){try{D.unsubscribe(),rQ(C({meta:o,lastValue:n,seen:h})).subscribe(a)}catch(d){a.error(d)}},w)};D=s.subscribe(YB(a,function(w){r==null||r.unsubscribe(),h++,a.next(n=w),I>0&&G(I)},void 0,void 0,function(){r!=null&&r.closed||r==null||r.unsubscribe(),n=null})),!h&&G(Q!=null?typeof Q=="number"?Q:+Q-t.now():I)})}function Pd(g){throw new zd(g)}function fA(g,A){return DQ(function(B,Q){var I=0;B.subscribe(YB(Q,function(E){Q.next(g.call(A,E,I++))}))})}var jd=Array.isArray;function _d(g,A){return jd(A)?g.apply(void 0,GC([],UE(A))):g(A)}function Gs(g){return fA(function(A){return _d(g,A)})}var $d=Array.isArray,AR=Object.getPrototypeOf,BR=Object.prototype,QR=Object.keys;function Zn(g){if(g.length===1){var A=g[0];if($d(A))return{args:A,keys:null};if(gR(A)){var B=QR(A);return{args:B.map(function(Q){return A[Q]}),keys:B}}}return{args:g,keys:null}}function gR(g){return g&&typeof g=="object"&&AR(g)===BR}function Tn(g,A){return g.reduce(function(B,Q,I){return B[Q]=A[I],B},{})}function UI(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=le(g),Q=hs(g),I=Zn(g),E=I.args,C=I.keys;if(E.length===0)return qB([],B);var i=new cA(IR(E,B,C?function(t){return Tn(C,t)}:kE));return Q?i.pipe(Gs(Q)):i}function IR(g,A,B){return B===void 0&&(B=kE),function(Q){On(A,function(){for(var I=g.length,E=new Array(I),C=I,i=I,t=function(o){On(A,function(){var s=qB(g[o],A),a=!1;s.subscribe(YB(Q,function(D){E[o]=D,a||(a=!0,i--),i||Q.next(B(E.slice()))},function(){--C||Q.complete()}))},Q)},e=0;e<I;e++)t(e)},Q)}}function On(g,A,B){g?RI(B,g,A):A()}function ER(g,A,B,Q,I,E,C,i){var t=[],e=0,o=0,s=!1,a=function(){s&&!t.length&&!e&&A.complete()},D=function(n){return e<Q?r(n):t.push(n)},r=function(n){e++;var h=!1;rQ(B(n,o++)).subscribe(YB(A,function(G){A.next(G)},function(){h=!0},void 0,function(){if(h)try{e--;for(var G=function(){var w=t.shift();C||r(w)};t.length&&e<Q;)G();a()}catch(w){A.error(w)}}))};return g.subscribe(YB(A,D,function(){s=!0,a()})),function(){}}function ZI(g,A,B){return B===void 0&&(B=1/0),lB(A)?ZI(function(Q,I){return fA(function(E,C){return A(Q,E,I,C)})(rQ(g(Q,I)))},B):(typeof A=="number"&&(B=A),DQ(function(Q,I){return ER(Q,I,g,B)}))}function Fs(g){return g===void 0&&(g=1/0),ZI(kE,g)}function CR(){return Fs(1)}function vn(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];return CR()(qB(g,le(g)))}function iR(g){return new cA(function(A){rQ(g()).subscribe(A)})}function QQ(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=hs(g),Q=Zn(g),I=Q.args,E=Q.keys,C=new cA(function(i){var t=I.length;if(!t){i.complete();return}for(var e=new Array(t),o=t,s=t,a=function(r){var n=!1;rQ(I[r]).subscribe(YB(i,function(h){n||(n=!0,s--),e[r]=h},function(){return o--},void 0,function(){(!o||!n)&&(s||i.next(E?Tn(E,e):e),i.complete())}))},D=0;D<t;D++)a(D)});return B?C.pipe(Gs(B)):C}var tR=["addListener","removeListener"],eR=["addEventListener","removeEventListener"],oR=["on","off"];function TA(g,A,B,Q){if(lB(B)&&(Q=B,B=void 0),Q)return TA(g,A,B).pipe(Gs(Q));var I=UE(DR(g)?eR.map(function(i){return function(t){return g[i](A,t,B)}}):aR(g)?tR.map(qn(g,A)):sR(g)?oR.map(qn(g,A)):[],2),E=I[0],C=I[1];if(!E&&cs(g))return ZI(function(i){return TA(i,A,B)})(rQ(g));if(!E)throw new TypeError("Invalid event target");return new cA(function(i){var t=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return i.next(1<e.length?e:e[0])};return E(t),function(){return C(t)}})}function qn(g,A){return function(B){return function(Q){return g[B](A,Q)}}}function aR(g){return lB(g.addListener)&&lB(g.removeListener)}function sR(g){return lB(g.on)&&lB(g.off)}function DR(g){return lB(g.addEventListener)&&lB(g.removeEventListener)}function yE(g,A,B){g===void 0&&(g=0),B===void 0&&(B=md);var Q=-1;return A!=null&&(Nn(A)?B=A:Q=A),new cA(function(I){var E=xn(g)?+g-B.now():g;E<0&&(E=0);var C=0;return B.schedule(function(){I.closed||(I.next(C++),0<=Q?this.schedule(void 0,Q):I.complete())},E)})}function ls(g,A){return g===void 0&&(g=0),A===void 0&&(A=lC),g<0&&(g=0),yE(g,g,A)}function kQ(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=le(g),Q=Yd(g,1/0),I=g;return I.length?I.length===1?rQ(I[0]):Fs(Q)(qB(I,B)):rs}var rR=Array.isArray;function Xn(g){return g.length===1&&rR(g[0])?g[0]:g}function GA(g,A){return DQ(function(B,Q){var I=0;B.subscribe(YB(Q,function(E){return g.call(A,E,I++)&&Q.next(E)}))})}function nR(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];return g=Xn(g),g.length===1?rQ(g[0]):new cA(hR(g))}function hR(g){return function(A){for(var B=[],Q=function(E){B.push(rQ(g[E]).subscribe(YB(A,function(C){if(B){for(var i=0;i<B.length;i++)i!==E&&B[i].unsubscribe();B=null}A.next(C)})))},I=0;B&&!A.closed&&I<g.length;I++)Q(I)}}function ME(){for(var g=[],A=0;A<arguments.length;A++)g[A]=arguments[A];var B=hs(g),Q=Xn(g);return Q.length?new cA(function(I){var E=Q.map(function(){return[]}),C=Q.map(function(){return!1});I.add(function(){E=C=null});for(var i=function(e){rQ(Q[e]).subscribe(YB(I,function(o){if(E[e].push(o),E.every(function(a){return a.length})){var s=E.map(function(a){return a.shift()});I.next(B?B.apply(void 0,GC([],UE(s))):s),E.some(function(a,D){return!a.length&&C[D]})&&I.complete()}},function(){C[e]=!0,!E[e].length&&I.complete()}))},t=0;!I.closed&&t<Q.length;t++)i(t);return function(){E=C=null}}):rs}function Zg(g){return DQ(function(A,B){var Q=null,I=!1,E;Q=A.subscribe(YB(B,void 0,void 0,function(C){E=rQ(g(C,Zg(g)(A))),Q?(Q.unsubscribe(),Q=null,E.subscribe(B)):I=!0})),I&&(Q.unsubscribe(),Q=null,E.subscribe(B))})}function cR(g,A,B,Q,I){return function(E,C){var i=B,t=A,e=0;E.subscribe(YB(C,function(o){var s=e++;t=i?g(t,o,s):(i=!0,o)},function(){i&&C.next(t),C.complete()}))}}function wR(g,A){return DQ(cR(g,A,arguments.length>=2,!1,!0))}var GR=function(g,A){return g.push(A),g};function ds(){return DQ(function(g,A){wR(GR,[])(g).subscribe(A)})}function Rs(g,A){return lB(A)?ZI(g,A,1):ZI(g,1)}function rg(g,A){return A===void 0&&(A=lC),DQ(function(B,Q){var I=null,E=null,C=null,i=function(){if(I){I.unsubscribe(),I=null;var e=E;E=null,Q.next(e)}};function t(){var e=C+g,o=A.now();if(o<e){I=this.schedule(void 0,e-o),Q.add(I);return}i()}B.subscribe(YB(Q,function(e){E=e,C=A.now(),I||(I=A.schedule(t,g),Q.add(I))},function(){i(),Q.complete()},void 0,function(){E=I=null}))})}function FR(g){return DQ(function(A,B){var Q=!1;A.subscribe(YB(B,function(I){Q=!0,B.next(I)},function(){Q||B.next(g),B.complete()}))})}function OA(g){return g<=0?function(){return rs}:DQ(function(A,B){var Q=0;A.subscribe(YB(B,function(I){++Q<=g&&(B.next(I),g<=Q&&B.complete())}))})}function lR(g){return fA(function(){return g})}function dR(g,A){return ZI(function(B,Q){return rQ(g(B,Q)).pipe(OA(1),lR(B))})}function RR(g,A){A===void 0&&(A=lC);var B=yE(g,A);return dR(function(){return B})}function Us(g,A){return A===void 0&&(A=kE),g=g??UR,DQ(function(B,Q){var I,E=!0;B.subscribe(YB(Q,function(C){var i=A(C);(E||!g(I,i))&&(E=!1,I=i,Q.next(C))}))})}function UR(g,A){return g===A}function kR(g){return g===void 0&&(g=yR),DQ(function(A,B){var Q=!1;A.subscribe(YB(B,function(I){Q=!0,B.next(I)},function(){return Q?B.complete():B.error(g())}))})}function yR(){return new ws}function Tg(g,A){var B=arguments.length>=2;return function(Q){return Q.pipe(kE,OA(1),B?FR(A):kR(function(){return new ws}))}}function MR(g){return DQ(function(A,B){var Q=!1,I=null;A.subscribe(YB(B,function(E){Q=!0,I=E})),rQ(g).subscribe(YB(B,function(){if(Q){Q=!1;var E=I;I=null,B.next(E)}},ce))})}function ks(g,A){return A===void 0&&(A=lC),MR(ls(g,A))}function zn(g){return GA(function(A,B){return g<=B})}function dC(g,A){return DQ(function(B,Q){var I=null,E=0,C=!1,i=function(){return C&&!I&&Q.complete()};B.subscribe(YB(Q,function(t){I==null||I.unsubscribe();var e=0,o=E++;rQ(g(t,o)).subscribe(I=YB(Q,function(s){return Q.next(A?A(t,s,o,e++):s)},function(){I=null,i()}))},function(){C=!0,i()}))})}function c(g){return DQ(function(A,B){rQ(g).subscribe(YB(B,function(){return B.complete()},ce)),!B.closed&&A.subscribe(B)})}function SE(g,A,B){var Q=lB(g)||A||B?{next:g,error:A,complete:B}:g;return Q?DQ(function(I,E){var C;(C=Q.subscribe)===null||C===void 0||C.call(Q);var i=!0;I.subscribe(YB(E,function(t){var e;(e=Q.next)===null||e===void 0||e.call(Q,t),E.next(t)},function(){var t;i=!1,(t=Q.complete)===null||t===void 0||t.call(Q),E.complete()},function(t){var e;i=!1,(e=Q.error)===null||e===void 0||e.call(Q,t),E.error(t)},function(){var t,e;i&&((t=Q.unsubscribe)===null||t===void 0||t.call(Q)),(e=Q.finalize)===null||e===void 0||e.call(Q)}))}):kE}class de{constructor(A){this.onChange$=new y,this.style={...A}}get style(){return this._style}set style(A){let B=JSON.stringify(this._style);this._style={...this._style,...A},B!==JSON.stringify(this._style)&&this.onChange$.next(this._style)}}class jB{static isNullUndefinedOrWhitespace(A){return typeof A===void 0||A==null?!0:`${A}`.replace(/\s/g,"").length<1}static isNonEmpty(A){return!this.isNullUndefinedOrWhitespace(A)}static isEmpty(A){return!this.isNonEmpty(A)}static toArrayBuffer(A){return new TextEncoder().encode(A).buffer}}class kB extends Error{constructor(A,B){super(A),this.name=jB.isNullUndefinedOrWhitespace(B)?"OmpError":B}}class Pn extends kB{constructor(A){super(A,"OmpBroadcastChannelError")}}class jn extends kB{constructor(A){super(A,"OmpBroadcastChannelTimeoutError")}}class nQ extends kB{constructor(A){super(A,"OmpVideoWindowPlaybackError")}}var oB;(function(g){g.assertEqual=I=>I;function A(I){}g.assertIs=A;function B(I){throw new Error}g.assertNever=B,g.arrayToEnum=I=>{const E={};for(const C of I)E[C]=C;return E},g.getValidEnumValues=I=>{const E=g.objectKeys(I).filter(i=>typeof I[I[i]]!="number"),C={};for(const i of E)C[i]=I[i];return g.objectValues(C)},g.objectValues=I=>g.objectKeys(I).map(function(E){return I[E]}),g.objectKeys=typeof Object.keys=="function"?I=>Object.keys(I):I=>{const E=[];for(const C in I)Object.prototype.hasOwnProperty.call(I,C)&&E.push(C);return E},g.find=(I,E)=>{for(const C of I)if(E(C))return C},g.isInteger=typeof Number.isInteger=="function"?I=>Number.isInteger(I):I=>typeof I=="number"&&isFinite(I)&&Math.floor(I)===I;function Q(I,E=" | "){return I.map(C=>typeof C=="string"?`'${C}'`:C).join(E)}g.joinValues=Q,g.jsonStringifyReplacer=(I,E)=>typeof E=="bigint"?E.toString():E})(oB||(oB={}));var ys;(function(g){g.mergeShapes=(A,B)=>({...A,...B})})(ys||(ys={}));const UA=oB.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),TI=g=>{switch(typeof g){case"undefined":return UA.undefined;case"string":return UA.string;case"number":return isNaN(g)?UA.nan:UA.number;case"boolean":return UA.boolean;case"function":return UA.function;case"bigint":return UA.bigint;case"symbol":return UA.symbol;case"object":return Array.isArray(g)?UA.array:g===null?UA.null:g.then&&typeof g.then=="function"&&g.catch&&typeof g.catch=="function"?UA.promise:typeof Map<"u"&&g instanceof Map?UA.map:typeof Set<"u"&&g instanceof Set?UA.set:typeof Date<"u"&&g instanceof Date?UA.date:UA.object;default:return UA.unknown}},EA=oB.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),SR=g=>JSON.stringify(g,null,2).replace(/"([^"]+)":/g,"$1:");class qQ extends Error{constructor(A){super(),this.issues=[],this.addIssue=Q=>{this.issues=[...this.issues,Q]},this.addIssues=(Q=[])=>{this.issues=[...this.issues,...Q]};const B=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,B):this.__proto__=B,this.name="ZodError",this.issues=A}get errors(){return this.issues}format(A){const B=A||function(E){return E.message},Q={_errors:[]},I=E=>{for(const C of E.issues)if(C.code==="invalid_union")C.unionErrors.map(I);else if(C.code==="invalid_return_type")I(C.returnTypeError);else if(C.code==="invalid_arguments")I(C.argumentsError);else if(C.path.length===0)Q._errors.push(B(C));else{let i=Q,t=0;for(;t<C.path.length;){const e=C.path[t];t===C.path.length-1?(i[e]=i[e]||{_errors:[]},i[e]._errors.push(B(C))):i[e]=i[e]||{_errors:[]},i=i[e],t++}}};return I(this),Q}static assert(A){if(!(A instanceof qQ))throw new Error(`Not a ZodError: ${A}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oB.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(A=B=>B.message){const B={},Q=[];for(const I of this.issues)I.path.length>0?(B[I.path[0]]=B[I.path[0]]||[],B[I.path[0]].push(A(I))):Q.push(A(I));return{formErrors:Q,fieldErrors:B}}get formErrors(){return this.flatten()}}qQ.create=g=>new qQ(g);const RC=(g,A)=>{let B;switch(g.code){case EA.invalid_type:g.received===UA.undefined?B="Required":B=`Expected ${g.expected}, received ${g.received}`;break;case EA.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(g.expected,oB.jsonStringifyReplacer)}`;break;case EA.unrecognized_keys:B=`Unrecognized key(s) in object: ${oB.joinValues(g.keys,", ")}`;break;case EA.invalid_union:B="Invalid input";break;case EA.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${oB.joinValues(g.options)}`;break;case EA.invalid_enum_value:B=`Invalid enum value. Expected ${oB.joinValues(g.options)}, received '${g.received}'`;break;case EA.invalid_arguments:B="Invalid function arguments";break;case EA.invalid_return_type:B="Invalid function return type";break;case EA.invalid_date:B="Invalid date";break;case EA.invalid_string:typeof g.validation=="object"?"includes"in g.validation?(B=`Invalid input: must include "${g.validation.includes}"`,typeof g.validation.position=="number"&&(B=`${B} at one or more positions greater than or equal to ${g.validation.position}`)):"startsWith"in g.validation?B=`Invalid input: must start with "${g.validation.startsWith}"`:"endsWith"in g.validation?B=`Invalid input: must end with "${g.validation.endsWith}"`:oB.assertNever(g.validation):g.validation!=="regex"?B=`Invalid ${g.validation}`:B="Invalid";break;case EA.too_small:g.type==="array"?B=`Array must contain ${g.exact?"exactly":g.inclusive?"at least":"more than"} ${g.minimum} element(s)`:g.type==="string"?B=`String must contain ${g.exact?"exactly":g.inclusive?"at least":"over"} ${g.minimum} character(s)`:g.type==="number"?B=`Number must be ${g.exact?"exactly equal to ":g.inclusive?"greater than or equal to ":"greater than "}${g.minimum}`:g.type==="date"?B=`Date must be ${g.exact?"exactly equal to ":g.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(g.minimum))}`:B="Invalid input";break;case EA.too_big:g.type==="array"?B=`Array must contain ${g.exact?"exactly":g.inclusive?"at most":"less than"} ${g.maximum} element(s)`:g.type==="string"?B=`String must contain ${g.exact?"exactly":g.inclusive?"at most":"under"} ${g.maximum} character(s)`:g.type==="number"?B=`Number must be ${g.exact?"exactly":g.inclusive?"less than or equal to":"less than"} ${g.maximum}`:g.type==="bigint"?B=`BigInt must be ${g.exact?"exactly":g.inclusive?"less than or equal to":"less than"} ${g.maximum}`:g.type==="date"?B=`Date must be ${g.exact?"exactly":g.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(g.maximum))}`:B="Invalid input";break;case EA.custom:B="Invalid input";break;case EA.invalid_intersection_types:B="Intersection results could not be merged";break;case EA.not_multiple_of:B=`Number must be a multiple of ${g.multipleOf}`;break;case EA.not_finite:B="Number must be finite";break;default:B=A.defaultError,oB.assertNever(g)}return{message:B}};let _n=RC;function NR(g){_n=g}function Re(){return _n}const Ue=g=>{const{data:A,path:B,errorMaps:Q,issueData:I}=g,E=[...B,...I.path||[]],C={...I,path:E};if(I.message!==void 0)return{...I,path:E,message:I.message};let i="";const t=Q.filter(e=>!!e).slice().reverse();for(const e of t)i=e(C,{data:A,defaultError:i}).message;return{...I,path:E,message:i}},LR=[];function FA(g,A){const B=Re(),Q=Ue({issueData:A,data:g.data,path:g.path,errorMaps:[g.common.contextualErrorMap,g.schemaErrorMap,B,B===RC?void 0:RC].filter(I=>!!I)});g.common.issues.push(Q)}class uQ{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(A,B){const Q=[];for(const I of B){if(I.status==="aborted")return xA;I.status==="dirty"&&A.dirty(),Q.push(I.value)}return{status:A.value,value:Q}}static async mergeObjectAsync(A,B){const Q=[];for(const I of B){const E=await I.key,C=await I.value;Q.push({key:E,value:C})}return uQ.mergeObjectSync(A,Q)}static mergeObjectSync(A,B){const Q={};for(const I of B){const{key:E,value:C}=I;if(E.status==="aborted"||C.status==="aborted")return xA;E.status==="dirty"&&A.dirty(),C.status==="dirty"&&A.dirty(),E.value!=="__proto__"&&(typeof C.value<"u"||I.alwaysSet)&&(Q[E.value]=C.value)}return{status:A.value,value:Q}}}const xA=Object.freeze({status:"aborted"}),UC=g=>({status:"dirty",value:g}),KQ=g=>({status:"valid",value:g}),Ms=g=>g.status==="aborted",Ss=g=>g.status==="dirty",bi=g=>g.status==="valid",fi=g=>typeof Promise<"u"&&g instanceof Promise;function ke(g,A,B,Q){if(typeof A=="function"?g!==A||!Q:!A.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return A.get(g)}function $n(g,A,B,Q,I){if(typeof A=="function"?g!==A||!I:!A.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return A.set(g,B),B}typeof SuppressedError=="function"&&SuppressedError;var HA;(function(g){g.errToObj=A=>typeof A=="string"?{message:A}:A||{},g.toString=A=>typeof A=="string"?A:A==null?void 0:A.message})(HA||(HA={}));var Vi,Wi;class Og{constructor(A,B,Q,I){this._cachedPath=[],this.parent=A,this.data=B,this._path=Q,this._key=I}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ah=(g,A)=>{if(bi(A))return{success:!0,data:A.value};if(!g.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const B=new qQ(g.common.issues);return this._error=B,this._error}}};function PA(g){if(!g)return{};const{errorMap:A,invalid_type_error:B,required_error:Q,description:I}=g;if(A&&(B||Q))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return A?{errorMap:A,description:I}:{errorMap:(C,i)=>{var t,e;const{message:o}=g;return C.code==="invalid_enum_value"?{message:o??i.defaultError}:typeof i.data>"u"?{message:(t=o??Q)!==null&&t!==void 0?t:i.defaultError}:C.code!=="invalid_type"?{message:i.defaultError}:{message:(e=o??B)!==null&&e!==void 0?e:i.defaultError}},description:I}}class AB{constructor(A){this.spa=this.safeParseAsync,this._def=A,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(A){return TI(A.data)}_getOrReturnCtx(A,B){return B||{common:A.parent.common,data:A.data,parsedType:TI(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new uQ,ctx:{common:A.parent.common,data:A.data,parsedType:TI(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){const B=this._parse(A);if(fi(B))throw new Error("Synchronous parse encountered promise.");return B}_parseAsync(A){const B=this._parse(A);return Promise.resolve(B)}parse(A,B){const Q=this.safeParse(A,B);if(Q.success)return Q.data;throw Q.error}safeParse(A,B){var Q;const I={common:{issues:[],async:(Q=B==null?void 0:B.async)!==null&&Q!==void 0?Q:!1,contextualErrorMap:B==null?void 0:B.errorMap},path:(B==null?void 0:B.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:TI(A)},E=this._parseSync({data:A,path:I.path,parent:I});return Ah(I,E)}async parseAsync(A,B){const Q=await this.safeParseAsync(A,B);if(Q.success)return Q.data;throw Q.error}async safeParseAsync(A,B){const Q={common:{issues:[],contextualErrorMap:B==null?void 0:B.errorMap,async:!0},path:(B==null?void 0:B.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:TI(A)},I=this._parse({data:A,path:Q.path,parent:Q}),E=await(fi(I)?I:Promise.resolve(I));return Ah(Q,E)}refine(A,B){const Q=I=>typeof B=="string"||typeof B>"u"?{message:B}:typeof B=="function"?B(I):B;return this._refinement((I,E)=>{const C=A(I),i=()=>E.addIssue({code:EA.custom,...Q(I)});return typeof Promise<"u"&&C instanceof Promise?C.then(t=>t?!0:(i(),!1)):C?!0:(i(),!1)})}refinement(A,B){return this._refinement((Q,I)=>A(Q)?!0:(I.addIssue(typeof B=="function"?B(Q,I):B),!1))}_refinement(A){return new kg({schema:this,typeName:VA.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}optional(){return qg.create(this,this._def)}nullable(){return XI.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ug.create(this,this._def)}promise(){return SC.create(this,this._def)}or(A){return Oi.create([this,A],this._def)}and(A){return vi.create(this,A,this._def)}transform(A){return new kg({...PA(this._def),schema:this,typeName:VA.ZodEffects,effect:{type:"transform",transform:A}})}default(A){const B=typeof A=="function"?A:()=>A;return new ji({...PA(this._def),innerType:this,defaultValue:B,typeName:VA.ZodDefault})}brand(){return new us({typeName:VA.ZodBranded,type:this,...PA(this._def)})}catch(A){const B=typeof A=="function"?A:()=>A;return new _i({...PA(this._def),innerType:this,catchValue:B,typeName:VA.ZodCatch})}describe(A){const B=this.constructor;return new B({...this._def,description:A})}pipe(A){return $i.create(this,A)}readonly(){return At.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uR=/^c[^\s-]{8,}$/i,JR=/^[0-9a-z]+$/,HR=/^[0-9A-HJKMNP-TV-Z]{26}$/,pR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mR=/^[a-z0-9_-]{21}$/i,YR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ns;const fR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VR=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,WR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xR=new RegExp(`^${Bh}$`);function Qh(g){let A="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return g.precision?A=`${A}\\.\\d{${g.precision}}`:g.precision==null&&(A=`${A}(\\.\\d+)?`),A}function ZR(g){return new RegExp(`^${Qh(g)}$`)}function gh(g){let A=`${Bh}T${Qh(g)}`;const B=[];return B.push(g.local?"Z?":"Z"),g.offset&&B.push("([+-]\\d{2}:?\\d{2})"),A=`${A}(${B.join("|")})`,new RegExp(`^${A}$`)}function TR(g,A){return!!((A==="v4"||!A)&&fR.test(g)||(A==="v6"||!A)&&VR.test(g))}class Rg extends AB{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==UA.string){const E=this._getOrReturnCtx(A);return FA(E,{code:EA.invalid_type,expected:UA.string,received:E.parsedType}),xA}const Q=new uQ;let I;for(const E of this._def.checks)if(E.kind==="min")A.data.length<E.value&&(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.too_small,minimum:E.value,type:"string",inclusive:!0,exact:!1,message:E.message}),Q.dirty());else if(E.kind==="max")A.data.length>E.value&&(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.too_big,maximum:E.value,type:"string",inclusive:!0,exact:!1,message:E.message}),Q.dirty());else if(E.kind==="length"){const C=A.data.length>E.value,i=A.data.length<E.value;(C||i)&&(I=this._getOrReturnCtx(A,I),C?FA(I,{code:EA.too_big,maximum:E.value,type:"string",inclusive:!0,exact:!0,message:E.message}):i&&FA(I,{code:EA.too_small,minimum:E.value,type:"string",inclusive:!0,exact:!0,message:E.message}),Q.dirty())}else if(E.kind==="email")KR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"email",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="emoji")Ns||(Ns=new RegExp(bR,"u")),Ns.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"emoji",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="uuid")pR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"uuid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="nanoid")mR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"nanoid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="cuid")uR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"cuid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="cuid2")JR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"cuid2",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="ulid")HR.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"ulid",code:EA.invalid_string,message:E.message}),Q.dirty());else if(E.kind==="url")try{new URL(A.data)}catch{I=this._getOrReturnCtx(A,I),FA(I,{validation:"url",code:EA.invalid_string,message:E.message}),Q.dirty()}else E.kind==="regex"?(E.regex.lastIndex=0,E.regex.test(A.data)||(I=this._getOrReturnCtx(A,I),FA(I,{validation:"regex",code:EA.invalid_string,message:E.message}),Q.dirty())):E.kind==="trim"?A.data=A.data.trim():E.kind==="includes"?A.data.includes(E.value,E.position)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{includes:E.value,position:E.position},message:E.message}),Q.dirty()):E.kind==="toLowerCase"?A.data=A.data.toLowerCase():E.kind==="toUpperCase"?A.data=A.data.toUpperCase():E.kind==="startsWith"?A.data.startsWith(E.value)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{startsWith:E.value},message:E.message}),Q.dirty()):E.kind==="endsWith"?A.data.endsWith(E.value)||(I=this._getOrReturnCtx(A,I),FA(I,{code:EA.invalid_string,validation:{endsWith:E.