UNPKG

@byomakase/omakase-player

Version:

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

3 lines • 1.71 MB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Qt=require("hls.js");var gg=function(r,e){return gg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},gg(r,e)};function Ms(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");gg(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Vb(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(d){try{l(i.next(d))}catch(c){a(c)}}function A(d){try{l(i.throw(d))}catch(c){a(c)}}function l(d){d.done?n(d.value):s(d.value).then(o,A)}l((i=i.apply(r,e||[])).next())})}function ZC(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(d){return A([l,d])}}function A(l){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(t=0)),t;)try{if(i=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){t.label=l[1];break}if(l[0]===6&&t.label<n[1]){t.label=n[1],n=l;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(l);break}n[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(d){l=[6,d],s=0}finally{i=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function fA(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Na(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function pA(r,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,n;i<s;i++)(n||!(i in e))&&(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return r.concat(n||Array.prototype.slice.call(e))}function eA(r){return this instanceof eA?(this.v=r,this):new eA(r)}function Gb(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),s[Symbol.asyncIterator]=function(){return this},s;function a(m){return function(g){return Promise.resolve(g).then(m,c)}}function o(m,g){i[m]&&(s[m]=function(u){return new Promise(function(f,v){n.push([m,u,f,v])>1||A(m,u)})},g&&(s[m]=g(s[m])))}function A(m,g){try{l(i[m](g))}catch(u){h(n[0][3],u)}}function l(m){m.value instanceof eA?Promise.resolve(m.value.v).then(d,c):h(n[0][2],m)}function d(m){A("next",m)}function c(m){A("throw",m)}function h(m,g){m(g),n.shift(),n.length&&A(n[0][0],n[0][1])}}function Ub(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof fA=="function"?fA(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,A){a=r[n](a),s(o,A,a.done,a.value)})}}function s(n,a,o,A){Promise.resolve(A).then(function(l){n({value:l,done:o})},a)}}function Ct(r){return typeof r=="function"}function wu(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var fm=wu(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: `+t.map(function(i,s){return s+1+") "+i.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=t}});function bh(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var wd=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,s,n;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=fA(a),A=o.next();!A.done;A=o.next()){var l=A.value;l.remove(this)}}catch(u){e={error:u}}finally{try{A&&!A.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;if(Ct(d))try{d()}catch(u){n=u instanceof fm?u.errors:[u]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=fA(c),m=h.next();!m.done;m=h.next()){var g=m.value;try{sp(g)}catch(u){n=n??[],u instanceof fm?n=pA(pA([],Na(n)),Na(u.errors)):n.push(u)}}}catch(u){i={error:u}}finally{try{m&&!m.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}}if(n)throw new fm(n)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)sp(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&bh(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&bh(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),qC=wd.EMPTY;function KC(r){return r instanceof wd||r&&"closed"in r&&Ct(r.remove)&&Ct(r.add)&&Ct(r.unsubscribe)}function sp(r){Ct(r)?r():r.unsubscribe()}var zb={Promise:void 0},Wb={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,pA([r,e],Na(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function XC(r){Wb.setTimeout(function(){throw r})}function Ih(){}function Tc(r){r()}var Pf=(function(r){Ms(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,KC(t)&&t.add(i)):i.destination=qb,i}return e.create=function(t,i,s){return new kh(t,i,s)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(wd),Yb=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){Yd(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Yd(i)}else Yd(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Yd(t)}},r})(),kh=(function(r){Ms(e,r);function e(t,i,s){var n=r.call(this)||this,a;return Ct(t)||!t?a={next:t??void 0,error:i??void 0,complete:s??void 0}:a=t,n.destination=new Yb(a),n}return e})(Pf);function Yd(r){XC(r)}function Zb(r){throw r}var qb={closed:!0,next:Ih,error:Zb,complete:Ih},xf=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function za(r){return r}function Kb(r){return r.length===0?za:r.length===1?r[0]:function(t){return r.reduce(function(i,s){return s(i)},t)}}var de=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,i){var s=this,n=Jb(e)?e:new kh(e,t,i);return Tc(function(){var a=s,o=a.operator,A=a.source;n.add(o?o.call(n,A):A?s._subscribe(n):s._trySubscribe(n))}),n},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var i=this;return t=np(t),new t(function(s,n){var a=new kh({next:function(o){try{e(o)}catch(A){n(A),a.unsubscribe()}},error:n,complete:s});i.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[xf]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kb(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=np(e),new e(function(i,s){var n;t.subscribe(function(a){return n=a},function(a){return s(a)},function(){return i(n)})})},r.create=function(e){return new r(e)},r})();function np(r){var e;return(e=r??zb.Promise)!==null&&e!==void 0?e:Promise}function Xb(r){return r&&Ct(r.next)&&Ct(r.error)&&Ct(r.complete)}function Jb(r){return r&&r instanceof Pf||Xb(r)&&KC(r)}function jb(r){return Ct(r?.lift)}function vi(r){return function(e){if(jb(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Rt(r,e,t,i,s){return new eI(r,e,t,i,s)}var eI=(function(r){Ms(e,r);function e(t,i,s,n,a,o){var A=r.call(this,t)||this;return A.onFinalize=a,A.shouldUnsubscribe=o,A._next=i?function(l){try{i(l)}catch(d){t.error(d)}}:r.prototype._next,A._error=n?function(l){try{n(l)}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._error,A._complete=s?function(){try{s()}catch(l){t.error(l)}finally{this.unsubscribe()}}:r.prototype._complete,A}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(Pf),tI=wu(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),I=(function(r){Ms(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new ap(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new tI},e.prototype.next=function(t){var i=this;Tc(function(){var s,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=fA(i.currentObservers),o=a.next();!o.done;o=a.next()){var A=o.value;A.next(t)}}catch(l){s={error:l}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var i=this;Tc(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var s=i.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;Tc(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,s=this,n=s.hasError,a=s.isStopped,o=s.observers;return n||a?qC:(this.currentObservers=null,o.push(t),new wd(function(){i.currentObservers=null,bh(o,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,s=i.hasError,n=i.thrownError,a=i.isStopped;s?t.error(n):a&&t.complete()},e.prototype.asObservable=function(){var t=new de;return t.source=this,t},e.create=function(t,i){return new ap(t,i)},e})(de),ap=(function(r){Ms(e,r);function e(t,i){var s=r.call(this)||this;return s.destination=t,s.source=i,s}return e.prototype.next=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,t)},e.prototype.error=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&s!==void 0?s:qC},e})(I),nt=(function(r){Ms(e,r);function e(t){var i=r.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=r.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,s=t.thrownError,n=t._value;if(i)throw s;return this._throwIfClosed(),n},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e})(I),Mf={now:function(){return(Mf.delegate||Date).now()},delegate:void 0},JC=(function(r){Ms(e,r);function e(t,i,s){t===void 0&&(t=1/0),i===void 0&&(i=1/0),s===void 0&&(s=Mf);var n=r.call(this)||this;return n._bufferSize=t,n._windowTime=i,n._timestampProvider=s,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=i===1/0,n._bufferSize=Math.max(1,t),n._windowTime=Math.max(1,i),n}return e.prototype.next=function(t){var i=this,s=i.isStopped,n=i._buffer,a=i._infiniteTimeWindow,o=i._timestampProvider,A=i._windowTime;s||(n.push(t),!a&&n.push(o.now()+A)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(t),s=this,n=s._infiniteTimeWindow,a=s._buffer,o=a.slice(),A=0;A<o.length&&!t.closed;A+=n?1:2)t.next(o[A]);return this._checkFinalizedStatuses(t),i},e.prototype._trimBuffer=function(){var t=this,i=t._bufferSize,s=t._timestampProvider,n=t._buffer,a=t._infiniteTimeWindow,o=(a?1:2)*i;if(i<1/0&&o<n.length&&n.splice(0,n.length-o),!a){for(var A=s.now(),l=0,d=1;d<n.length&&n[d]<=A;d+=2)l=d;l&&n.splice(0,l+1)}},e})(I),iI=(function(r){Ms(e,r);function e(t,i){return r.call(this)||this}return e.prototype.schedule=function(t,i){return this},e})(wd),op={setInterval:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,pA([r,e],Na(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},rI=(function(r){Ms(e,r);function e(t,i){var s=r.call(this,t,i)||this;return s.scheduler=t,s.work=i,s.pending=!1,s}return e.prototype.schedule=function(t,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var n=this.id,a=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(a,n,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(a,this.id,i),this},e.prototype.requestAsyncId=function(t,i,s){return s===void 0&&(s=0),op.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&op.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var s=!1,n;try{this.work(t)}catch(a){s=!0,n=a||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,s=t.scheduler,n=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,bh(n,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(iI),Ap=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},r.now=Mf.now,r})(),sI=(function(r){Ms(e,r);function e(t,i){i===void 0&&(i=Ap.now);var s=r.call(this,t,i)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,s){for(;t=i.shift();)t.unsubscribe();throw s}},e})(Ap),QA=new sI(rI),nI=QA,Rf=new de(function(r){return r.complete()});function jC(r){return r&&Ct(r.schedule)}function Ff(r){return r[r.length-1]}function Lf(r){return Ct(Ff(r))?r.pop():void 0}function bu(r){return jC(Ff(r))?r.pop():void 0}function aI(r,e){return typeof Ff(r)=="number"?r.pop():e}var Nf=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function ev(r){return Ct(r?.then)}function tv(r){return Ct(r[xf])}function iv(r){return Symbol.asyncIterator&&Ct(r?.[Symbol.asyncIterator])}function rv(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function oI(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var sv=oI();function nv(r){return Ct(r?.[sv])}function av(r){return Gb(this,arguments,function(){var t,i,s,n;return ZC(this,function(a){switch(a.label){case 0:t=r.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,eA(t.read())];case 3:return i=a.sent(),s=i.value,n=i.done,n?[4,eA(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,eA(s)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ov(r){return Ct(r?.getReader)}function Ei(r){if(r instanceof de)return r;if(r!=null){if(tv(r))return AI(r);if(Nf(r))return lI(r);if(ev(r))return Ae(r);if(iv(r))return Av(r);if(nv(r))return dI(r);if(ov(r))return cI(r)}throw rv(r)}function AI(r){return new de(function(e){var t=r[xf]();if(Ct(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function lI(r){return new de(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Ae(r){return new de(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,XC)})}function dI(r){return new de(function(e){var t,i;try{for(var s=fA(r),n=s.next();!n.done;n=s.next()){var a=n.value;if(e.next(a),e.closed)return}}catch(o){t={error:o}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}e.complete()})}function Av(r){return new de(function(e){hI(r,e).catch(function(t){return e.error(t)})})}function cI(r){return Av(av(r))}function hI(r,e){var t,i,s,n;return Vb(this,void 0,void 0,function(){var a,o;return ZC(this,function(A){switch(A.label){case 0:A.trys.push([0,5,6,11]),t=Ub(r),A.label=1;case 1:return[4,t.next()];case 2:if(i=A.sent(),!!i.done)return[3,4];if(a=i.value,e.next(a),e.closed)return[2];A.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=A.sent(),s={error:o},[3,11];case 6:return A.trys.push([6,,9,10]),i&&!i.done&&(n=t.return)?[4,n.call(t)]:[3,8];case 7:A.sent(),A.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function tn(r,e,t,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var n=e.schedule(function(){t(),s?r.add(this.schedule(null,i)):this.unsubscribe()},i);if(r.add(n),!s)return n}function lv(r,e){return e===void 0&&(e=0),vi(function(t,i){t.subscribe(Rt(i,function(s){return tn(i,r,function(){return i.next(s)},e)},function(){return tn(i,r,function(){return i.complete()},e)},function(s){return tn(i,r,function(){return i.error(s)},e)}))})}function dv(r,e){return e===void 0&&(e=0),vi(function(t,i){i.add(r.schedule(function(){return t.subscribe(i)},e))})}function uI(r,e){return Ei(r).pipe(dv(e),lv(e))}function mI(r,e){return Ei(r).pipe(dv(e),lv(e))}function gI(r,e){return new de(function(t){var i=0;return e.schedule(function(){i===r.length?t.complete():(t.next(r[i++]),t.closed||this.schedule())})})}function fI(r,e){return new de(function(t){var i;return tn(t,e,function(){i=r[sv](),tn(t,e,function(){var s,n,a;try{s=i.next(),n=s.value,a=s.done}catch(o){t.error(o);return}a?t.complete():t.next(n)},0,!0)}),function(){return Ct(i?.return)&&i.return()}})}function cv(r,e){if(!r)throw new Error("Iterable cannot be null");return new de(function(t){tn(t,e,function(){var i=r[Symbol.asyncIterator]();tn(t,e,function(){i.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function pI(r,e){return cv(av(r),e)}function CI(r,e){if(r!=null){if(tv(r))return uI(r,e);if(Nf(r))return gI(r,e);if(ev(r))return mI(r,e);if(iv(r))return cv(r,e);if(nv(r))return fI(r,e);if(ov(r))return pI(r,e)}throw rv(r)}function $t(r,e){return e?CI(r,e):Ei(r)}function Ot(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=bu(r);return $t(r,t)}var Of=wu(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function ce(r,e){return new Promise(function(t,i){var s=new kh({next:function(n){t(n),s.unsubscribe()},error:i,complete:function(){i(new Of)}});r.subscribe(s)})}function hv(r){return r instanceof Date&&!isNaN(r)}var vI=wu(function(r){return function(t){t===void 0&&(t=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function Pr(r,e){var t=hv(r)?{first:r}:typeof r=="number"?{each:r}:r,i=t.first,s=t.each,n=t.with,a=n===void 0?EI:n,o=t.scheduler,A=o===void 0?QA:o,l=t.meta,d=l===void 0?null:l;if(i==null&&s==null)throw new TypeError("No timeout provided.");return vi(function(c,h){var m,g,u=null,f=0,v=function(E){g=tn(h,A,function(){try{m.unsubscribe(),Ei(a({meta:d,lastValue:u,seen:f})).subscribe(h)}catch(_){h.error(_)}},E)};m=c.subscribe(Rt(h,function(E){g?.unsubscribe(),f++,h.next(u=E),s>0&&v(s)},void 0,void 0,function(){g?.closed||g?.unsubscribe(),u=null})),!f&&v(i!=null?typeof i=="number"?i:+i-A.now():s)})}function EI(r){throw new vI(r)}function Se(r,e){return vi(function(t,i){var s=0;t.subscribe(Rt(i,function(n){i.next(r.call(e,n,s++))}))})}var _I=Array.isArray;function wI(r,e){return _I(e)?r.apply(void 0,pA([],Na(e))):r(e)}function $f(r){return Se(function(e){return wI(r,e)})}var bI=Array.isArray,II=Object.getPrototypeOf,kI=Object.prototype,yI=Object.keys;function uv(r){if(r.length===1){var e=r[0];if(bI(e))return{args:e,keys:null};if(BI(e)){var t=yI(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:r,keys:null}}function BI(r){return r&&typeof r=="object"&&II(r)===kI}function mv(r,e){return r.reduce(function(t,i,s){return t[i]=e[s],t},{})}function Mr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=bu(r),i=Lf(r),s=uv(r),n=s.args,a=s.keys;if(n.length===0)return $t([],t);var o=new de(SI(n,t,a?function(A){return mv(a,A)}:za));return i?o.pipe($f(i)):o}function SI(r,e,t){return t===void 0&&(t=za),function(i){lp(e,function(){for(var s=r.length,n=new Array(s),a=s,o=s,A=function(d){lp(e,function(){var c=$t(r[d],e),h=!1;c.subscribe(Rt(i,function(m){n[d]=m,h||(h=!0,o--),o||i.next(t(n.slice()))},function(){--a||i.complete()}))},i)},l=0;l<s;l++)A(l)},i)}}function lp(r,e,t){r?tn(t,r,e):e()}function TI(r,e,t,i,s,n,a,o){var A=[],l=0,d=0,c=!1,h=function(){c&&!A.length&&!l&&e.complete()},m=function(u){return l<i?g(u):A.push(u)},g=function(u){l++;var f=!1;Ei(t(u,d++)).subscribe(Rt(e,function(v){e.next(v)},function(){f=!0},void 0,function(){if(f)try{l--;for(var v=function(){var E=A.shift();a||g(E)};A.length&&l<i;)v();h()}catch(E){e.error(E)}}))};return r.subscribe(Rt(e,m,function(){c=!0,h()})),function(){}}function nn(r,e,t){return t===void 0&&(t=1/0),Ct(e)?nn(function(i,s){return Se(function(n,a){return e(i,n,s,a)})(Ei(r(i,s)))},t):(typeof e=="number"&&(t=e),vi(function(i,s){return TI(i,s,r,t)}))}function Hf(r){return r===void 0&&(r=1/0),nn(za,r)}function DI(){return Hf(1)}function pm(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return DI()($t(r,bu(r)))}function QI(r){return new de(function(e){Ei(r()).subscribe(e)})}function mi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Lf(r),i=uv(r),s=i.args,n=i.keys,a=new de(function(o){var A=s.length;if(!A){o.complete();return}for(var l=new Array(A),d=A,c=A,h=function(g){var u=!1;Ei(s[g]).subscribe(Rt(o,function(f){u||(u=!0,c--),l[g]=f},function(){return d--},void 0,function(){(!d||!u)&&(c||o.next(n?mv(n,l):l),o.complete())}))},m=0;m<A;m++)h(m)});return t?a.pipe($f(t)):a}var PI=["addListener","removeListener"],xI=["addEventListener","removeEventListener"],MI=["on","off"];function De(r,e,t,i){if(Ct(t)&&(i=t,t=void 0),i)return De(r,e,t).pipe($f(i));var s=Na(LI(r)?xI.map(function(o){return function(A){return r[o](e,A,t)}}):RI(r)?PI.map(dp(r,e)):FI(r)?MI.map(dp(r,e)):[],2),n=s[0],a=s[1];if(!n&&Nf(r))return nn(function(o){return De(o,e,t)})(Ei(r));if(!n)throw new TypeError("Invalid event target");return new de(function(o){var A=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return o.next(1<l.length?l:l[0])};return n(A),function(){return a(A)}})}function dp(r,e){return function(t){return function(i){return r[t](e,i)}}}function RI(r){return Ct(r.addListener)&&Ct(r.removeListener)}function FI(r){return Ct(r.on)&&Ct(r.off)}function LI(r){return Ct(r.addEventListener)&&Ct(r.removeEventListener)}function Vn(r,e,t){r===void 0&&(r=0),t===void 0&&(t=nI);var i=-1;return e!=null&&(jC(e)?t=e:i=e),new de(function(s){var n=hv(r)?+r-t.now():r;n<0&&(n=0);var a=0;return t.schedule(function(){s.closed||(s.next(a++),0<=i?this.schedule(void 0,i):s.complete())},n)})}function Iu(r,e){return r===void 0&&(r=0),e===void 0&&(e=QA),r<0&&(r=0),Vn(r,r,e)}function fi(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=bu(r),i=aI(r,1/0),s=r;return s.length?s.length===1?Ei(s[0]):Hf(i)($t(s,t)):Rf}var NI=Array.isArray;function gv(r){return r.length===1&&NI(r[0])?r[0]:r}function he(r,e){return vi(function(t,i){var s=0;t.subscribe(Rt(i,function(n){return r.call(e,n,s++)&&i.next(n)}))})}function OI(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r=gv(r),r.length===1?Ei(r[0]):new de($I(r))}function $I(r){return function(e){for(var t=[],i=function(n){t.push(Ei(r[n]).subscribe(Rt(e,function(a){if(t){for(var o=0;o<t.length;o++)o!==n&&t[o].unsubscribe();t=null}e.next(a)})))},s=0;t&&!e.closed&&s<r.length;s++)i(s)}}function Wa(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Lf(r),i=gv(r);return i.length?new de(function(s){var n=i.map(function(){return[]}),a=i.map(function(){return!1});s.add(function(){n=a=null});for(var o=function(l){Ei(i[l]).subscribe(Rt(s,function(d){if(n[l].push(d),n.every(function(h){return h.length})){var c=n.map(function(h){return h.shift()});s.next(t?t.apply(void 0,pA([],Na(c))):c),n.some(function(h,m){return!h.length&&a[m]})&&s.complete()}},function(){a[l]=!0,!n[l].length&&s.complete()}))},A=0;!s.closed&&A<i.length;A++)o(A);return function(){n=a=null}}):Rf}function ks(r){return vi(function(e,t){var i=null,s=!1,n;i=e.subscribe(Rt(t,void 0,void 0,function(a){n=Ei(r(a,ks(r)(e))),i?(i.unsubscribe(),i=null,n.subscribe(t)):s=!0})),s&&(i.unsubscribe(),i=null,n.subscribe(t))})}function HI(r,e,t,i,s){return function(n,a){var o=t,A=e,l=0;n.subscribe(Rt(a,function(d){var c=l++;A=o?r(A,d,c):(o=!0,d)},(function(){o&&a.next(A),a.complete()})))}}function VI(r,e){return vi(HI(r,e,arguments.length>=2,!1,!0))}var GI=function(r,e){return r.push(e),r};function fg(){return vi(function(r,e){VI(GI,[])(r).subscribe(e)})}function pg(r,e){return Ct(e)?nn(r,e,1):nn(r,1)}function Rr(r,e){return e===void 0&&(e=QA),vi(function(t,i){var s=null,n=null,a=null,o=function(){if(s){s.unsubscribe(),s=null;var l=n;n=null,i.next(l)}};function A(){var l=a+r,d=e.now();if(d<l){s=this.schedule(void 0,l-d),i.add(s);return}o()}t.subscribe(Rt(i,function(l){n=l,a=e.now(),s||(s=e.schedule(A,r),i.add(s))},function(){o(),i.complete()},void 0,function(){n=s=null}))})}function UI(r){return vi(function(e,t){var i=!1;e.subscribe(Rt(t,function(s){i=!0,t.next(s)},function(){i||t.next(r),t.complete()}))})}function Oe(r){return r<=0?function(){return Rf}:vi(function(e,t){var i=0;e.subscribe(Rt(t,function(s){++i<=r&&(t.next(s),r<=i&&t.complete())}))})}function zI(r){return Se(function(){return r})}function WI(r,e){return nn(function(t,i){return Ei(r(t,i)).pipe(Oe(1),zI(t))})}function YI(r,e){e===void 0&&(e=QA);var t=Vn(r,e);return WI(function(){return t})}function Vf(r,e){return e===void 0&&(e=za),r=r??ZI,vi(function(t,i){var s,n=!0;t.subscribe(Rt(i,function(a){var o=e(a);(n||!r(s,o))&&(n=!1,s=o,i.next(a))}))})}function ZI(r,e){return r===e}function qI(r){return r===void 0&&(r=KI),vi(function(e,t){var i=!1;e.subscribe(Rt(t,function(s){i=!0,t.next(s)},function(){return i?t.complete():t.error(r())}))})}function KI(){return new Of}function zn(r,e){var t=arguments.length>=2;return function(i){return i.pipe(za,Oe(1),t?UI(e):qI(function(){return new Of}))}}function XI(r){return vi(function(e,t){var i=!1,s=null;e.subscribe(Rt(t,function(n){i=!0,s=n})),Ei(r).subscribe(Rt(t,function(){if(i){i=!1;var n=s;s=null,t.next(n)}},Ih))})}function ku(r,e){return e===void 0&&(e=QA),XI(Iu(r,e))}function cp(r){return he(function(e,t){return r<=t})}function Oa(r,e){return vi(function(t,i){var s=null,n=0,a=!1,o=function(){return a&&!s&&i.complete()};t.subscribe(Rt(i,function(A){s?.unsubscribe();var l=0,d=n++;Ei(r(A,d)).subscribe(s=Rt(i,function(c){return i.next(e?e(A,c,d,l++):c)},function(){s=null,o()}))},function(){a=!0,o()}))})}function p(r){return vi(function(e,t){Ei(r).subscribe(Rt(t,function(){return t.complete()},Ih)),!t.closed&&e.subscribe(t)})}function rn(r,e,t){var i=Ct(r)||e||t?{next:r,error:e,complete:t}:r;return i?vi(function(s,n){var a;(a=i.subscribe)===null||a===void 0||a.call(i);var o=!0;s.subscribe(Rt(n,function(A){var l;(l=i.next)===null||l===void 0||l.call(i,A),n.next(A)},function(){var A;o=!1,(A=i.complete)===null||A===void 0||A.call(i),n.complete()},function(A){var l;o=!1,(l=i.error)===null||l===void 0||l.call(i,A),n.error(A)},function(){var A,l;o&&((A=i.unsubscribe)===null||A===void 0||A.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):za}class yu{constructor(e){this.onChange$=new I,this.style={...e}}get style(){return this._style}set style(e){let t=JSON.stringify(this._style);this._style={...this._style,...e},t!==JSON.stringify(this._style)&&this.onChange$.next(this._style)}}class si{static isNullUndefinedOrWhitespace(e){return typeof e===void 0||e==null?!0:`${e}`.replace(/\s/g,"").length<1}static isNonEmpty(e){return!this.isNullUndefinedOrWhitespace(e)}static isEmpty(e){return!this.isNonEmpty(e)}static toArrayBuffer(e){return new TextEncoder().encode(e).buffer}}class Ge extends Error{constructor(e,t){super(e),this.name=si.isNullUndefinedOrWhitespace(t)?"OmpError":t}}class fv extends Ge{constructor(e){super(e,"OmpBroadcastChannelError")}}class pv extends Ge{constructor(e){super(e,"OmpBroadcastChannelTimeoutError")}}class jt extends Ge{constructor(e){super(e,"OmpVideoWindowPlaybackError")}}var dt;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const n={};for(const a of s)n[a]=a;return n},r.getValidEnumValues=s=>{const n=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of n)a[o]=s[o];return r.objectValues(a)},r.objectValues=s=>r.objectKeys(s).map(function(n){return s[n]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&n.push(a);return n},r.find=(s,n)=>{for(const a of s)if(n(a))return a},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,n=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}r.joinValues=i,r.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(dt||(dt={}));var Cg;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Cg||(Cg={}));const ge=dt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xn=r=>{switch(typeof r){case"undefined":return ge.undefined;case"string":return ge.string;case"number":return isNaN(r)?ge.nan:ge.number;case"boolean":return ge.boolean;case"function":return ge.function;case"bigint":return ge.bigint;case"symbol":return ge.symbol;case"object":return Array.isArray(r)?ge.array:r===null?ge.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?ge.promise:typeof Map<"u"&&r instanceof Map?ge.map:typeof Set<"u"&&r instanceof Set?ge.set:typeof Date<"u"&&r instanceof Date?ge.date:ge.object;default:return ge.unknown}},J=dt.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"]),JI=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class dr extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(n){return n.message},i={_errors:[]},s=n=>{for(const a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)i._errors.push(t(a));else{let o=i,A=0;for(;A<a.path.length;){const l=a.path[A];A===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(a))):o[l]=o[l]||{_errors:[]},o=o[l],A++}}};return s(this),i}static assert(e){if(!(e instanceof dr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,dt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}dr.create=r=>new dr(r);const CA=(r,e)=>{let t;switch(r.code){case J.invalid_type:r.received===ge.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case J.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,dt.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:t=`Unrecognized key(s) in object: ${dt.joinValues(r.keys,", ")}`;break;case J.invalid_union:t="Invalid input";break;case J.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${dt.joinValues(r.options)}`;break;case J.invalid_enum_value:t=`Invalid enum value. Expected ${dt.joinValues(r.options)}, received '${r.received}'`;break;case J.invalid_arguments:t="Invalid function arguments";break;case J.invalid_return_type:t="Invalid function return type";break;case J.invalid_date:t="Invalid date";break;case J.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:dt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case J.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case J.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case J.custom:t="Invalid input";break;case J.invalid_intersection_types:t="Intersection results could not be merged";break;case J.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case J.not_finite:t="Number must be finite";break;default:t=e.defaultError,dt.assertNever(r)}return{message:t}};let Cv=CA;function jI(r){Cv=r}function yh(){return Cv}const Bh=r=>{const{data:e,path:t,errorMaps:i,issueData:s}=r,n=[...t,...s.path||[]],a={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let o="";const A=i.filter(l=>!!l).slice().reverse();for(const l of A)o=l(a,{data:e,defaultError:o}).message;return{...s,path:n,message:o}},ek=[];function ue(r,e){const t=yh(),i=Bh({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===CA?void 0:CA].filter(s=>!!s)});r.common.issues.push(i)}class Fi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const s of t){if(s.status==="aborted")return Le;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const s of t){const n=await s.key,a=await s.value;i.push({key:n,value:a})}return Fi.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const s of t){const{key:n,value:a}=s;if(n.status==="aborted"||a.status==="aborted")return Le;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(i[n.value]=a.value)}return{status:e.value,value:i}}}const Le=Object.freeze({status:"aborted"}),Vo=r=>({status:"dirty",value:r}),Zi=r=>({status:"valid",value:r}),vg=r=>r.status==="aborted",Eg=r=>r.status==="dirty",Wl=r=>r.status==="valid",Yl=r=>typeof Promise<"u"&&r instanceof Promise;function Sh(r,e,t,i){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function vv(r,e,t,i,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var ke;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(ke||(ke={}));var il,rl;class Ts{constructor(e,t,i,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=s}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 hp=(r,e)=>{if(Wl(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new dr(r.common.issues);return this._error=t,this._error}}};function Ze(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:s}=r;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{var A,l;const{message:d}=r;return a.code==="invalid_enum_value"?{message:d??o.defaultError}:typeof o.data>"u"?{message:(A=d??i)!==null&&A!==void 0?A:o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:(l=d??t)!==null&&l!==void 0?l:o.defaultError}},description:s}}class Je{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return xn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fi,ctx:{common:e.parent.common,data:e.data,parsedType:xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Yl(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const s={common:{issues:[],async:(i=t?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xn(e)},n=this._parseSync({data:e,path:s.path,parent:s});return hp(s,n)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xn(e)},s=this._parse({data:e,path:i.path,parent:i}),n=await(Yl(s)?s:Promise.resolve(s));return hp(i,n)}refine(e,t){const i=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,n)=>{const a=e(s),o=()=>n.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(A=>A?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof t=="function"?t(i,s):t),!1))}_refinement(e){return new is({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ys.create(this,this._def)}nullable(){return qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this,this._def)}promise(){return EA.create(this,this._def)}or(e){return Xl.create([this,e],this._def)}and(e){return Jl.create(this,e,this._def)}transform(e){return new is({...Ze(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new rd({...Ze(this._def),innerType:this,defaultValue:t,typeName:xe.ZodDefault})}brand(){return new Gf({typeName:xe.ZodBranded,type:this,...Ze(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new sd({...Ze(this._def),innerType:this,catchValue:t,typeName:xe.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return bd.create(this,e)}readonly(){return nd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tk=/^c[^\s-]{8,}$/i,ik=/^[0-9a-z]+$/,rk=/^[0-9A-HJKMNP-TV-Z]{26}$/,sk=/^[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,nk=/^[a-z0-9_-]{21}$/i,ak=/^[-+]?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)?)??$/,ok=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ak="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cm;const lk=/^(?:(?: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])$/,dk=/^(([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})))$/,ck=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ev="((\\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])))",hk=new RegExp(`^${Ev}$`);function _v(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function uk(r){return new RegExp(`^${_v(r)}$`)}function wv(r){let e=`${Ev}T${_v(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mk(r,e){return!!((e==="v4"||!e)&&lk.test(r)||(e==="v6"||!e)&&dk.test(r))}class qr extends Je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ge.string){const n=this._getOrReturnCtx(e);return ue(n,{code:J.invalid_type,expected:ge.string,received:n.parsedType}),Le}const i=new Fi;let s;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:J.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")e.data.length>n.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:J.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){const a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?ue(s,{code:J.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&ue(s,{code:J.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")ok.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"email",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")Cm||(Cm=new RegExp(Ak,"u")),Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"emoji",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")sk.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"uuid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")nk.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"nanoid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")tk.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"cuid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")ik.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"cuid2",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")rk.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"ulid",code:J.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ue(s,{validation:"url",code:J.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"regex",code:J.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(e,s),ue(s,{code:J.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(s=this._getOrReturnCtx(e,s),ue(s,{code:J.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?e.dat