@byomakase/omakase-react-components 1.2.3 → 1.3.0-RC2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs.js +94 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.d.ts +121 -10
- package/dist/index.es.js +14736 -3360
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +94 -52
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1,64 +1,106 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
* decimal.js v10.
|
|
1
|
+
"use strict";var ap=Object.defineProperty;var up=(e,t,r)=>t in e?ap(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var k=(e,t,r)=>up(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("@byomakase/omakase-player"),$=require("react");/*!
|
|
2
|
+
* decimal.js v10.6.0
|
|
3
3
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
4
4
|
* https://github.com/MikeMcl/decimal.js
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
6
6
|
* MIT Licence
|
|
7
|
-
*/var rt=9e15,he=1e9,it="0123456789abcdef",Pe="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Be="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ot={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:rt,crypto:!1},Wt,ae,A=!0,$e="[DecimalError] ",me=$e+"Invalid argument: ",jt=$e+"Precision limit exceeded",Gt=$e+"crypto unavailable",Yt="[object Decimal]",q=Math.floor,U=Math.pow,Bn=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Un=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Kn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,zt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,te=1e7,C=7,Hn=9007199254740991,$n=Pe.length-1,st=Be.length-1,g={toStringTag:Yt};g.absoluteValue=g.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),y(t)};g.ceil=function(){return y(new this.constructor(this),this.e+1,2)};g.clampedTo=g.clamp=function(t,e){var n,r=this,i=r.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(me+e);return n=r.cmp(t),n<0?t:r.cmp(e)>0?e:new i(r)};g.comparedTo=g.cmp=function(t){var e,n,r,i,o=this,s=o.d,u=(t=new o.constructor(t)).d,c=o.s,a=t.s;if(!s||!u)return!c||!a?NaN:c!==a?c:s===u?0:!s^c<0?1:-1;if(!s[0]||!u[0])return s[0]?c:u[0]?-a:0;if(c!==a)return c;if(o.e!==t.e)return o.e>t.e^c<0?1:-1;for(r=s.length,i=u.length,e=0,n=r<i?r:i;e<n;++e)if(s[e]!==u[e])return s[e]>u[e]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1};g.cosine=g.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+C,r.rounding=1,n=Zn(r,nn(r,n)),r.precision=t,r.rounding=e,y(ae==2||ae==3?n.neg():n,t,e,!0)):new r(1):new r(NaN)};g.cubeRoot=g.cbrt=function(){var t,e,n,r,i,o,s,u,c,a,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(A=!1,o=l.s*U(l.s*l,1/3),!o||Math.abs(o)==1/0?(n=$(l.d),t=l.e,(o=(t-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=U(n,1/3),t=q((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?n="5e"+t:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),r=new f(n),r.s=l.s):r=new f(o.toString()),s=(t=f.precision)+3;;)if(u=r,c=u.times(u).times(u),a=c.plus(l),r=D(a.plus(l).times(u),a.plus(c),s+2,1),$(u.d).slice(0,s)===(n=$(r.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!i&&n=="4999"){if(!i&&(y(u,t+1,0),u.times(u).times(u).eq(l))){r=u;break}s+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(y(r,t+1,1),e=!r.times(r).times(r).eq(l));break}return A=!0,y(r,t,f.rounding,e)};g.decimalPlaces=g.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-q(this.e/C))*C,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};g.dividedBy=g.div=function(t){return D(this,new this.constructor(t))};g.dividedToIntegerBy=g.divToInt=function(t){var e=this,n=e.constructor;return y(D(e,new n(t),0,1,1),n.precision,n.rounding)};g.equals=g.eq=function(t){return this.cmp(t)===0};g.floor=function(){return y(new this.constructor(this),this.e+1,3)};g.greaterThan=g.gt=function(t){return this.cmp(t)>0};g.greaterThanOrEqualTo=g.gte=function(t){var e=this.cmp(t);return e==1||e===0};g.hyperbolicCosine=g.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,u=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return u;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(t=Math.ceil(i/3),e=(1/qe(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Se(s,1,o.times(e),new s(1),!0);for(var c,a=t,l=new s(8);a--;)c=o.times(o),o=u.minus(c.times(l.minus(c.times(l))));return y(o,s.precision=n,s.rounding=r,!0)};g.hyperbolicSine=g.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=Se(o,2,i,i,!0);else{t=1.4*Math.sqrt(r),t=t>16?16:t|0,i=i.times(1/qe(5,t)),i=Se(o,2,i,i,!0);for(var s,u=new o(5),c=new o(16),a=new o(20);t--;)s=i.times(i),i=i.times(u.plus(s.times(c.times(s).plus(a))))}return o.precision=e,o.rounding=n,y(i,e,n,!0)};g.hyperbolicTangent=g.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,D(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)};g.inverseCosine=g.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return r!==-1?r===0?e.isNeg()?ee(n,i,o):new n(0):new n(NaN):e.isZero()?ee(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=ee(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))};g.inverseHyperbolicCosine=g.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,A=!1,n=n.times(n).minus(1).sqrt().plus(n),A=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)};g.inverseHyperbolicSine=g.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,A=!1,n=n.times(n).plus(1).sqrt().plus(n),A=!0,r.precision=t,r.rounding=e,n.ln())};g.inverseHyperbolicTangent=g.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?y(new o(i),t,e,!0):(o.precision=n=r-i.e,i=D(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)};g.inverseSine=g.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,e!==-1?e===0?(t=ee(o,n+4,r).times(.5),t.s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))};g.inverseTangent=g.atan=function(){var t,e,n,r,i,o,s,u,c,a=this,l=a.constructor,f=l.precision,d=l.rounding;if(a.isFinite()){if(a.isZero())return new l(a);if(a.abs().eq(1)&&f+4<=st)return s=ee(l,f+4,d).times(.25),s.s=a.s,s}else{if(!a.s)return new l(NaN);if(f+4<=st)return s=ee(l,f+4,d).times(.5),s.s=a.s,s}for(l.precision=u=f+10,l.rounding=1,n=Math.min(28,u/C+2|0),t=n;t;--t)a=a.div(a.times(a).plus(1).sqrt().plus(1));for(A=!1,e=Math.ceil(u/C),r=1,c=a.times(a),s=new l(a),i=a;t!==-1;)if(i=i.times(c),o=s.minus(i.div(r+=2)),i=i.times(c),s=o.plus(i.div(r+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<<n-1)),A=!0,y(s,l.precision=f,l.rounding=d,!0)};g.isFinite=function(){return!!this.d};g.isInteger=g.isInt=function(){return!!this.d&&q(this.e/C)>this.d.length-2};g.isNaN=function(){return!this.s};g.isNegative=g.isNeg=function(){return this.s<0};g.isPositive=g.isPos=function(){return this.s>0};g.isZero=function(){return!!this.d&&this.d[0]===0};g.lessThan=g.lt=function(t){return this.cmp(t)<0};g.lessThanOrEqualTo=g.lte=function(t){return this.cmp(t)<1};g.logarithm=g.log=function(t){var e,n,r,i,o,s,u,c,a=this,l=a.constructor,f=l.precision,d=l.rounding,m=5;if(t==null)t=new l(10),e=!0;else{if(t=new l(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new l(NaN);e=t.eq(10)}if(n=a.d,a.s<0||!n||!n[0]||a.eq(1))return new l(n&&!n[0]?-1/0:a.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=i!==1}if(A=!1,u=f+m,s=fe(a,u),r=e?Ue(l,u+10):fe(t,u),c=D(s,r,u,1),Me(c.d,i=f,d))do if(u+=10,s=fe(a,u),r=e?Ue(l,u+10):fe(t,u),c=D(s,r,u,1),!o){+$(c.d).slice(i+1,i+15)+1==1e14&&(c=y(c,f+1,0));break}while(Me(c.d,i+=10,d));return A=!0,y(c,f,d)};g.minus=g.sub=function(t){var e,n,r,i,o,s,u,c,a,l,f,d,m=this,h=m.constructor;if(t=new h(t),!m.d||!t.d)return!m.s||!t.s?t=new h(NaN):m.d?t.s=-t.s:t=new h(t.d||m.s!==t.s?m:NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(a=m.d,d=t.d,u=h.precision,c=h.rounding,!a[0]||!d[0]){if(d[0])t.s=-t.s;else if(a[0])t=new h(m);else return new h(c===3?-0:0);return A?y(t,u,c):t}if(n=q(t.e/C),l=q(m.e/C),a=a.slice(),o=l-n,o){for(f=o<0,f?(e=a,o=-o,s=d.length):(e=d,n=l,s=a.length),r=Math.max(Math.ceil(u/C),s)+2,o>r&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for(r=a.length,s=d.length,f=r<s,f&&(s=r),r=0;r<s;r++)if(a[r]!=d[r]){f=a[r]<d[r];break}o=0}for(f&&(e=a,a=d,d=e,t.s=-t.s),s=a.length,r=d.length-s;r>0;--r)a[s++]=0;for(r=d.length;r>o;){if(a[--r]<d[r]){for(i=r;i&&a[--i]===0;)a[i]=te-1;--a[i],a[r]+=te}a[r]-=d[r]}for(;a[--s]===0;)a.pop();for(;a[0]===0;a.shift())--n;return a[0]?(t.d=a,t.e=Ze(a,n),A?y(t,u,c):t):new h(c===3?-0:0)};g.modulo=g.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?y(new r(n),r.precision,r.rounding):(A=!1,r.modulo==9?(e=D(n,t.abs(),0,3,1),e.s*=t.s):e=D(n,t,0,r.modulo,1),e=e.times(t),A=!0,n.minus(e))};g.naturalExponential=g.exp=function(){return at(this)};g.naturalLogarithm=g.ln=function(){return fe(this)};g.negated=g.neg=function(){var t=new this.constructor(this);return t.s=-t.s,y(t)};g.plus=g.add=function(t){var e,n,r,i,o,s,u,c,a,l,f=this,d=f.constructor;if(t=new d(t),!f.d||!t.d)return!f.s||!t.s?t=new d(NaN):f.d||(t=new d(t.d||f.s===t.s?f:NaN)),t;if(f.s!=t.s)return t.s=-t.s,f.minus(t);if(a=f.d,l=t.d,u=d.precision,c=d.rounding,!a[0]||!l[0])return l[0]||(t=new d(f)),A?y(t,u,c):t;if(o=q(f.e/C),r=q(t.e/C),a=a.slice(),i=o-r,i){for(i<0?(n=a,i=-i,s=l.length):(n=l,r=o,s=a.length),o=Math.ceil(u/C),s=o>s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=a.length,i=l.length,s-i<0&&(i=s,n=l,l=a,a=n),e=0;i;)e=(a[--i]=a[i]+l[i]+e)/te|0,a[i]%=te;for(e&&(a.unshift(e),++r),s=a.length;a[--s]==0;)a.pop();return t.d=a,t.e=Ze(a,r),A?y(t,u,c):t};g.precision=g.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(me+t);return n.d?(e=Jt(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};g.round=function(){var t=this,e=t.constructor;return y(new e(t),t.e+1,e.rounding)};g.sine=g.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+C,r.rounding=1,n=Xn(r,nn(r,n)),r.precision=t,r.rounding=e,y(ae>2?n.neg():n,t,e,!0)):new r(NaN)};g.squareRoot=g.sqrt=function(){var t,e,n,r,i,o,s=this,u=s.d,c=s.e,a=s.s,l=s.constructor;if(a!==1||!u||!u[0])return new l(!a||a<0&&(!u||u[0])?NaN:u?s:1/0);for(A=!1,a=Math.sqrt(+s),a==0||a==1/0?(e=$(u),(e.length+c)%2==0&&(e+="0"),a=Math.sqrt(e),c=q((c+1)/2)-(c<0||c%2),a==1/0?e="5e"+c:(e=a.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),r=new l(e)):r=new l(a.toString()),n=(c=l.precision)+3;;)if(o=r,r=o.plus(D(s,o,n+2,1)).times(.5),$(o.d).slice(0,n)===(e=$(r.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!i&&e=="4999"){if(!i&&(y(o,c+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(y(r,c+1,1),t=!r.times(r).eq(s));break}return A=!0,y(r,c,l.rounding,t)};g.tangent=g.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,n=n.sin(),n.s=1,n=D(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,y(ae==2||ae==4?n.neg():n,t,e,!0)):new r(NaN)};g.times=g.mul=function(t){var e,n,r,i,o,s,u,c,a,l=this,f=l.constructor,d=l.d,m=(t=new f(t)).d;if(t.s*=l.s,!d||!d[0]||!m||!m[0])return new f(!t.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?t.s/0:t.s*0);for(n=q(l.e/C)+q(t.e/C),c=d.length,a=m.length,c<a&&(o=d,d=m,m=o,s=c,c=a,a=s),o=[],s=c+a,r=s;r--;)o.push(0);for(r=a;--r>=0;){for(e=0,i=c+r;i>r;)u=o[i]+m[r]*d[i-r-1]+e,o[i--]=u%te|0,e=u/te|0;o[i]=(o[i]+e)%te|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=Ze(o,n),A?y(t,f.precision,f.rounding):t};g.toBinary=function(t,e){return ht(this,2,t,e)};g.toDecimalPlaces=g.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(W(t,0,he),e===void 0?e=r.rounding:W(e,0,8),y(n,t+n.e+1,e))};g.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=ie(r,!0):(W(t,0,he),e===void 0?e=i.rounding:W(e,0,8),r=y(new i(r),t+1,e),n=ie(r,!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n};g.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?n=ie(i):(W(t,0,he),e===void 0?e=o.rounding:W(e,0,8),r=y(new o(i),t+i.e+1,e),n=ie(r,!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};g.toFraction=function(t){var e,n,r,i,o,s,u,c,a,l,f,d,m=this,h=m.d,p=m.constructor;if(!h)return new p(m);if(a=n=new p(1),r=c=new p(0),e=new p(r),o=e.e=Jt(h)-m.e-1,s=o%C,e.d[0]=U(10,s<0?C+s:s),t==null)t=o>0?e:a;else{if(u=new p(t),!u.isInt()||u.lt(a))throw Error(me+u);t=u.gt(e)?o>0?e:a:u}for(A=!1,u=new p($(h)),l=p.precision,p.precision=o=h.length*C*2;f=D(u,e,0,1,1),i=n.plus(f.times(r)),i.cmp(t)!=1;)n=r,r=i,i=a,a=c.plus(f.times(i)),c=i,i=e,e=u.minus(f.times(i)),u=i;return i=D(t.minus(n),r,0,1,1),c=c.plus(i.times(a)),n=n.plus(i.times(r)),c.s=a.s=m.s,d=D(a,r,o,1).minus(m).abs().cmp(D(c,n,o,1).minus(m).abs())<1?[a,r]:[c,n],p.precision=l,A=!0,d};g.toHexadecimal=g.toHex=function(t,e){return ht(this,16,t,e)};g.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),t==null){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),e===void 0?e=r.rounding:W(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(A=!1,n=D(n,t,0,e,1).times(t),A=!0,y(n)):(t.s=n.s,n=t),n};g.toNumber=function(){return+this};g.toOctal=function(t,e){return ht(this,8,t,e)};g.toPower=g.pow=function(t){var e,n,r,i,o,s,u=this,c=u.constructor,a=+(t=new c(t));if(!u.d||!t.d||!u.d[0]||!t.d[0])return new c(U(+u,a));if(u=new c(u),u.eq(1))return u;if(r=c.precision,o=c.rounding,t.eq(1))return y(u,r,o);if(e=q(t.e/C),e>=t.d.length-1&&(n=a<0?-a:a)<=Hn)return i=Qt(c,u,n,r),t.s<0?new c(1).div(i):y(i,r,o);if(s=u.s,s<0){if(e<t.d.length-1)return new c(NaN);if((t.d[e]&1)==0&&(s=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=s,u}return n=U(+u,a),e=n==0||!isFinite(n)?q(a*(Math.log("0."+$(u.d))/Math.LN10+u.e+1)):new c(n+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):(A=!1,c.rounding=u.s=1,n=Math.min(12,(e+"").length),i=at(t.times(fe(u,r+n)),r),i.d&&(i=y(i,r+5,1),Me(i.d,r,o)&&(e=r+10,i=y(at(t.times(fe(u,e+n)),e),e+5,1),+$(i.d).slice(r+1,r+15)+1==1e14&&(i=y(i,r+1,0)))),i.s=s,A=!0,c.rounding=o,y(i,r,o))};g.toPrecision=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=ie(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(W(t,1,he),e===void 0?e=i.rounding:W(e,0,8),r=y(new i(r),t,e),n=ie(r,t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n};g.toSignificantDigits=g.toSD=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(W(t,1,he),e===void 0?e=r.rounding:W(e,0,8)),y(new r(n),t,e)};g.toString=function(){var t=this,e=t.constructor,n=ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};g.truncated=g.trunc=function(){return y(new this.constructor(this),this.e+1,1)};g.valueOf=g.toJSON=function(){var t=this,e=t.constructor,n=ie(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function $(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;e<i;e++)r=t[e]+"",n=C-r.length,n&&(o+=ce(n)),o+=r;s=t[e],r=s+"",n=C-r.length,n&&(o+=ce(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function W(t,e,n){if(t!==~~t||t<e||t>n)throw Error(me+t)}function Me(t,e,n,r){var i,o,s,u;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=C,i=0):(i=Math.ceil((e+1)/C),e%=C),o=U(10,C-e),u=t[i]%o|0,r==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),s=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):s=(n<4&&u+1==o||n>3&&u+1==o/2)&&(t[i+1]/o/100|0)==U(10,e-2)-1||(u==o/2||u==0)&&(t[i+1]/o/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),s=(r||n<4)&&u==9999||!r&&n>3&&u==4999):s=((r||n<4)&&u+1==o||!r&&n>3&&u+1==o/2)&&(t[i+1]/o/1e3|0)==U(10,e-3)-1,s}function Fe(t,e,n){for(var r,i=[0],o,s=0,u=t.length;s<u;){for(o=i.length;o--;)i[o]*=e;for(i[0]+=it.indexOf(t.charAt(s++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Zn(t,e){var n,r,i;if(e.isZero())return e;r=e.d.length,r<32?(n=Math.ceil(r/3),i=(1/qe(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=Se(t,1,e.times(i),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}var D=function(){function t(r,i,o){var s,u=0,c=r.length;for(r=r.slice();c--;)s=r[c]*i+u,r[c]=s%o|0,u=s/o|0;return u&&r.unshift(u),r}function e(r,i,o,s){var u,c;if(o!=s)c=o>s?1:-1;else for(u=c=0;u<o;u++)if(r[u]!=i[u]){c=r[u]>i[u]?1:-1;break}return c}function n(r,i,o,s){for(var u=0;o--;)r[o]-=u,u=r[o]<i[o]?1:0,r[o]=u*s+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s,u,c){var a,l,f,d,m,h,p,w,E,I,M,N,k,x,G,ne,Y,ve,H,oe,se=r.constructor,be=r.s==i.s?1:-1,P=r.d,_=i.d;if(!P||!P[0]||!_||!_[0])return new se(!r.s||!i.s||(P?_&&P[0]==_[0]:!_)?NaN:P&&P[0]==0||!_?be*0:be/0);for(c?(m=1,l=r.e-i.e):(c=te,m=C,l=q(r.e/m)-q(i.e/m)),H=_.length,Y=P.length,E=new se(be),I=E.d=[],f=0;_[f]==(P[f]||0);f++);if(_[f]>(P[f]||0)&&l--,o==null?(x=o=se.precision,s=se.rounding):u?x=o+(r.e-i.e)+1:x=o,x<0)I.push(1),h=!0;else{if(x=x/m+2|0,f=0,H==1){for(d=0,_=_[0],x++;(f<Y||d)&&x--;f++)G=d*c+(P[f]||0),I[f]=G/_|0,d=G%_|0;h=d||f<Y}else{for(d=c/(_[0]+1)|0,d>1&&(_=t(_,d,c),P=t(P,d,c),H=_.length,Y=P.length),ne=H,M=P.slice(0,H),N=M.length;N<H;)M[N++]=0;oe=_.slice(),oe.unshift(0),ve=_[0],_[1]>=c/2&&++ve;do d=0,a=e(_,M,H,N),a<0?(k=M[0],H!=N&&(k=k*c+(M[1]||0)),d=k/ve|0,d>1?(d>=c&&(d=c-1),p=t(_,d,c),w=p.length,N=M.length,a=e(p,M,w,N),a==1&&(d--,n(p,H<w?oe:_,w,c))):(d==0&&(a=d=1),p=_.slice()),w=p.length,w<N&&p.unshift(0),n(M,p,N,c),a==-1&&(N=M.length,a=e(_,M,H,N),a<1&&(d++,n(M,H<N?oe:_,N,c))),N=M.length):a===0&&(d++,M=[0]),I[f++]=d,a&&M[0]?M[N++]=P[ne]||0:(M=[P[ne]],N=1);while((ne++<Y||M[0]!==void 0)&&x--);h=M[0]!==void 0}I[0]||I.shift()}if(m==1)E.e=l,Wt=h;else{for(f=1,d=I[0];d>=10;d/=10)f++;E.e=f+l*m-1,y(E,u?o+E.e+1:o,s,h)}return E}}();function y(t,e,n,r){var i,o,s,u,c,a,l,f,d,m=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,u=f[0];u>=10;u/=10)i++;if(o=e-i,o<0)o+=C,s=e,l=f[d=0],c=l/U(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/C),u=f.length,d>=u)if(r){for(;u++<=d;)f.push(0);l=c=0,i=1,o%=C,s=o-C+1}else break e;else{for(l=u=f[d],i=1;u>=10;u/=10)i++;o%=C,s=o-C+i,c=s<0?0:l/U(10,i-s-1)%10|0}if(r=r||e<0||f[d+1]!==void 0||(s<0?l:l%U(10,i-s-1)),a=n<4?(c||r)&&(n==0||n==(t.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(o>0?s>0?l/U(10,i-s):0:f[d-1])%10&1||n==(t.s<0?8:7)),e<1||!f[0])return f.length=0,a?(e-=t.e+1,f[0]=U(10,(C-e%C)%C),t.e=-e||0):f[0]=t.e=0,t;if(o==0?(f.length=d,u=1,d--):(f.length=d+1,u=U(10,C-o),f[d]=s>0?(l/U(10,i-s)%U(10,s)|0)*u:0),a)for(;;)if(d==0){for(o=1,s=f[0];s>=10;s/=10)o++;for(s=f[0]+=u,u=1;s>=10;s/=10)u++;o!=u&&(t.e++,f[0]==te&&(f[0]=1));break}else{if(f[d]+=u,f[d]!=te)break;f[d--]=0,u=1}for(o=f.length;f[--o]===0;)f.pop()}return A&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function ie(t,e,n){if(!t.isFinite())return tn(t);var r,i=t.e,o=$(t.d),s=o.length;return e?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+ce(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+ce(-i-1)+o,n&&(r=n-s)>0&&(o+=ce(r))):i>=s?(o+=ce(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+ce(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=ce(r))),o}function Ze(t,e){var n=t[0];for(e*=C;n>=10;n/=10)e++;return e}function Ue(t,e,n){if(e>$n)throw A=!0,n&&(t.precision=n),Error(jt);return y(new t(Pe),e,1,!0)}function ee(t,e,n){if(e>st)throw Error(jt);return y(new t(Be),e,n,!0)}function Jt(t){var e=t.length-1,n=e*C+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function ce(t){for(var e="";t--;)e+="0";return e}function Qt(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/C+4);for(A=!1;;){if(n%2&&(o=o.times(e),Ot(o.d,s)&&(i=!0)),n=q(n/2),n===0){n=o.d.length-1,i&&o.d[n]===0&&++o.d[n];break}e=e.times(e),Ot(e.d,s)}return A=!0,o}function It(t){return t.d[t.d.length-1]&1}function en(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;)if(r=new t(e[o]),r.s)i[n](r)&&(i=r);else{i=r;break}return i}function at(t,e){var n,r,i,o,s,u,c,a=0,l=0,f=0,d=t.constructor,m=d.rounding,h=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(A=!1,c=h):c=e,u=new d(.03125);t.e>-2;)t=t.times(u),f+=5;for(r=Math.log(U(2,f))/Math.LN10*2+5|0,c+=r,n=o=s=new d(1),d.precision=c;;){if(o=y(o.times(t),c,1),n=n.times(++l),u=s.plus(D(o,n,c,1)),$(u.d).slice(0,c)===$(s.d).slice(0,c)){for(i=f;i--;)s=y(s.times(s),c,1);if(e==null)if(a<3&&Me(s.d,c-r,m,a))d.precision=c+=10,n=o=u=new d(1),l=0,a++;else return y(s,d.precision=h,m,A=!0);else return d.precision=h,s}s=u}}function fe(t,e){var n,r,i,o,s,u,c,a,l,f,d,m=1,h=10,p=t,w=p.d,E=p.constructor,I=E.rounding,M=E.precision;if(p.s<0||!w||!w[0]||!p.e&&w[0]==1&&w.length==1)return new E(w&&!w[0]?-1/0:p.s!=1?NaN:w?0:p);if(e==null?(A=!1,l=M):l=e,E.precision=l+=h,n=$(w),r=n.charAt(0),Math.abs(o=p.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=$(p.d),r=n.charAt(0),m++;o=p.e,r>1?(p=new E("0."+n),o++):p=new E(r+"."+n.slice(1))}else return a=Ue(E,l+2,M).times(o+""),p=fe(new E(r+"."+n.slice(1)),l-h).plus(a),E.precision=M,e==null?y(p,M,I,A=!0):p;for(f=p,c=s=p=D(p.minus(1),p.plus(1),l,1),d=y(p.times(p),l,1),i=3;;){if(s=y(s.times(d),l,1),a=c.plus(D(s,new E(i),l,1)),$(a.d).slice(0,l)===$(c.d).slice(0,l))if(c=c.times(2),o!==0&&(c=c.plus(Ue(E,l+2,M).times(o+""))),c=D(c,new E(m),l,1),e==null)if(Me(c.d,l-h,I,u))E.precision=l+=h,a=s=p=D(f.minus(1),f.plus(1),l,1),d=y(p.times(p),l,1),i=u=1;else return y(c,E.precision=M,I,A=!0);else return E.precision=M,c;c=a,i+=2}}function tn(t){return String(t.s*t.s/0)}function ut(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;r++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(r,i),e){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%C,n<0&&(r+=C),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=C;r<i;)t.d.push(+e.slice(r,r+=C));e=e.slice(r),r=C-e.length}else r-=i;for(;r--;)e+="0";t.d.push(+e),A&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function qn(t,e){var n,r,i,o,s,u,c,a,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),zt.test(e))return ut(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Un.test(e))n=16,e=e.toLowerCase();else if(Bn.test(e))n=2;else if(Kn.test(e))n=8;else throw Error(me+e);for(o=e.search(/p/i),o>0?(c=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,r=t.constructor,s&&(e=e.replace(".",""),u=e.length,o=u-o,i=Qt(r,new r(n),o,o*2)),a=Fe(e,n,te),l=a.length-1,o=l;a[o]===0;--o)a.pop();return o<0?new r(t.s*0):(t.e=Ze(a,l),t.d=a,A=!1,s&&(t=D(t,i,u*4)),c&&(t=t.times(Math.abs(c)<54?U(2,c):Le.pow(2,c))),A=!0,t)}function Xn(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:Se(t,2,e,e);n=1.4*Math.sqrt(r),n=n>16?16:n|0,e=e.times(1/qe(5,n)),e=Se(t,2,e,e);for(var i,o=new t(5),s=new t(16),u=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(u))));return e}function Se(t,e,n,r,i){var o,s,u,c,a=t.precision,l=Math.ceil(a/C);for(A=!1,c=n.times(n),u=new t(r);;){if(s=D(u.times(c),new t(e++*e++),a,1),u=i?r.plus(s):r.minus(s),r=D(s.times(c),new t(e++*e++),a,1),s=u.plus(r),s.d[l]!==void 0){for(o=l;s.d[o]===u.d[o]&&o--;);if(o==-1)break}o=u,u=r,r=s,s=o}return A=!0,s.d.length=l+1,s}function qe(t,e){for(var n=t;--e;)n*=t;return n}function nn(t,e){var n,r=e.s<0,i=ee(t,t.precision,1),o=i.times(.5);if(e=e.abs(),e.lte(o))return ae=r?4:1,e;if(n=e.divToInt(i),n.isZero())ae=r?3:2;else{if(e=e.minus(n.times(i)),e.lte(o))return ae=It(n)?r?2:3:r?4:1,e;ae=It(n)?r?1:4:r?3:2}return e.minus(i).abs()}function ht(t,e,n,r){var i,o,s,u,c,a,l,f,d,m=t.constructor,h=n!==void 0;if(h?(W(n,1,he),r===void 0?r=m.rounding:W(r,0,8)):(n=m.precision,r=m.rounding),!t.isFinite())l=tn(t);else{for(l=ie(t),s=l.indexOf("."),h?(i=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):i=e,s>=0&&(l=l.replace(".",""),d=new m(1),d.e=l.length-s,d.d=Fe(ie(d),10,i),d.e=d.d.length),f=Fe(l,10,i),o=c=f.length;f[--c]==0;)f.pop();if(!f[0])l=h?"0p+0":"0";else{if(s<0?o--:(t=new m(t),t.d=f,t.e=o,t=D(t,d,n,r,0,i),f=t.d,o=t.e,a=Wt),s=f[n],u=i/2,a=a||f[n+1]!==void 0,a=r<4?(s!==void 0||a)&&(r===0||r===(t.s<0?3:2)):s>u||s===u&&(r===4||a||r===6&&f[n-1]&1||r===(t.s<0?8:7)),f.length=n,a)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(c=f.length;!f[c-1];--c);for(s=0,l="";s<c;s++)l+=it.charAt(f[s]);if(h){if(c>1)if(e==16||e==8){for(s=e==16?4:3,--c;c%s;c++)l+="0";for(f=Fe(l,i,e),c=f.length;!f[c-1];--c);for(s=1,l="1.";s<c;s++)l+=it.charAt(f[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>c)for(o-=c;o--;)l+="0";else o<c&&(l=l.slice(0,o)+"."+l.slice(o))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return t.s<0?"-"+l:l}function Ot(t,e){if(t.length>e)return t.length=e,!0}function Wn(t){return new this(t).abs()}function jn(t){return new this(t).acos()}function Gn(t){return new this(t).acosh()}function Yn(t,e){return new this(t).plus(e)}function zn(t){return new this(t).asin()}function Jn(t){return new this(t).asinh()}function Qn(t){return new this(t).atan()}function er(t){return new this(t).atanh()}function tr(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=ee(this,o,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?ee(this,r,i):new this(0),n.s=t.s):!t.d||e.isZero()?(n=ee(this,o,1).times(.5),n.s=t.s):e.s<0?(this.precision=o,this.rounding=1,n=this.atan(D(t,e,o,1)),e=ee(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(D(t,e,o,1)),n}function nr(t){return new this(t).cbrt()}function rr(t){return y(t=new this(t),t.e+1,2)}function ir(t,e,n){return new this(t).clamp(e,n)}function or(t){if(!t||typeof t!="object")throw Error($e+"Object expected");var e,n,r,i=t.defaults===!0,o=["precision",1,he,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,rt,"maxE",0,rt,"minE",-9e15,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=ot[n]),(r=t[n])!==void 0)if(q(r)===r&&r>=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(me+n+": "+r);if(n="crypto",i&&(this[n]=ot[n]),(r=t[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Gt);else this[n]=!1;else throw Error(me+n+": "+r);return this}function sr(t){return new this(t).cos()}function ar(t){return new this(t).cosh()}function rn(t){var e,n,r;function i(o){var s,u,c,a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,_t(o)){a.s=o.s,A?!o.d||o.e>i.maxE?(a.e=NaN,a.d=null):o.e<i.minE?(a.e=0,a.d=[0]):(a.e=o.e,a.d=o.d.slice()):(a.e=o.e,a.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){a.s=1/o<0?-1:1,a.e=0,a.d=[0];return}if(o<0?(o=-o,a.s=-1):a.s=1,o===~~o&&o<1e7){for(s=0,u=o;u>=10;u/=10)s++;A?s>i.maxE?(a.e=NaN,a.d=null):s<i.minE?(a.e=0,a.d=[0]):(a.e=s,a.d=[o]):(a.e=s,a.d=[o]);return}else if(o*0!==0){o||(a.s=NaN),a.e=NaN,a.d=null;return}return ut(a,o.toString())}else if(c!=="string")throw Error(me+o);return(u=o.charCodeAt(0))===45?(o=o.slice(1),a.s=-1):(u===43&&(o=o.slice(1)),a.s=1),zt.test(o)?ut(a,o):qn(a,o)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=or,i.clone=rn,i.isDecimal=_t,i.abs=Wn,i.acos=jn,i.acosh=Gn,i.add=Yn,i.asin=zn,i.asinh=Jn,i.atan=Qn,i.atanh=er,i.atan2=tr,i.cbrt=nr,i.ceil=rr,i.clamp=ir,i.cos=sr,i.cosh=ar,i.div=ur,i.exp=cr,i.floor=lr,i.hypot=fr,i.ln=dr,i.log=mr,i.log10=pr,i.log2=hr,i.max=gr,i.min=vr,i.mod=br,i.mul=wr,i.pow=Er,i.random=Sr,i.round=Tr,i.sign=yr,i.sin=Cr,i.sinh=Mr,i.sqrt=Lr,i.sub=Ar,i.sum=xr,i.tan=Ir,i.tanh=Or,i.trunc=_r,t===void 0&&(t={}),t&&t.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function ur(t,e){return new this(t).div(e)}function cr(t){return new this(t).exp()}function lr(t){return y(t=new this(t),t.e+1,3)}function fr(){var t,e,n=new this(0);for(A=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return A=!0,new this(1/0);n=e}return A=!0,n.sqrt()}function _t(t){return t instanceof Le||t&&t.toStringTag===Yt||!1}function dr(t){return new this(t).ln()}function mr(t,e){return new this(t).log(e)}function hr(t){return new this(t).log(2)}function pr(t){return new this(t).log(10)}function gr(){return en(this,arguments,"lt")}function vr(){return en(this,arguments,"gt")}function br(t,e){return new this(t).mod(e)}function wr(t,e){return new this(t).mul(e)}function Er(t,e){return new this(t).pow(e)}function Sr(t){var e,n,r,i,o=0,s=new this(1),u=[];if(t===void 0?t=this.precision:W(t,1,he),r=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)i=e[o],i>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);o<r;)i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,o):(u.push(i%1e7),o+=4);o=r/4}else throw Error(Gt);else for(;o<r;)u[o++]=Math.random()*1e7|0;for(r=u[--o],t%=C,r&&t&&(i=U(10,C-t),u[o]=(r/i|0)*i);u[o]===0;o--)u.pop();if(o<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=C)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<C&&(n-=C-r)}return s.e=n,s.d=u,s}function Tr(t){return y(t=new this(t),t.e+1,this.rounding)}function yr(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Cr(t){return new this(t).sin()}function Mr(t){return new this(t).sinh()}function Lr(t){return new this(t).sqrt()}function Ar(t,e){return new this(t).sub(e)}function xr(){var t=0,e=arguments,n=new this(e[t]);for(A=!1;n.s&&++t<e.length;)n=n.plus(e[t]);return A=!0,y(n,this.precision,this.rounding)}function Ir(t){return new this(t).tan()}function Or(t){return new this(t).tanh()}function _r(t){return y(t=new this(t),t.e+1,1)}g[Symbol.for("nodejs.util.inspect.custom")]=g.toString;g[Symbol.toStringTag]="Decimal";var Le=g.constructor=rn(ot);Pe=new Le(Pe);Be=new Le(Be);class re{static formatToTimecode(e,n,r=!1,i=!1){let o=new Le(n),s,u=o.round();s=o.mul(e).floor();let c,a,l,f,d=u.mul(86400),m=s.mod(d),h=u.mul(3600),p=u.mul(60);return f=m.divToInt(h),m=m.minus(f.mul(h)),l=m.divToInt(p),m=m.minus(l.mul(p)),a=m.divToInt(u),c=m.minus(a.mul(u)),re.formatTimecodeText(f.toNumber(),l.toNumber(),a.toNumber(),c.toNumber(),r,i)}static formatTimecodeText(e,n,r,i,o=!1,s=!1){let u=s?".":o?";":":";return`${re.padZero(e)}:${re.padZero(n)}:${re.padZero(r)}${u}${re.padZero(i)}`}static padZero(e){return e<10?`0${e}`:`${e}`}}class Nr{static resolveFrameRateValueFromFraction(e){return 30}}const Q=class Q{static parseTimeMoment(e){const[n,r]=e.split(":").map(Number);return[n,r]}static parseTimeRange(e){const n=e.match(this.timeRangePattern);if(!n)throw new Error("Not valid timerange: "+e);const r=n[1]==="[",i=n[5]==="]",o=n[2]?this.parseTimeMoment(n[2]):void 0,s=n[4]?this.parseTimeMoment(n[4]):void 0;return{start:o,end:s,isStartInclusive:r,isEndInclusive:i}}static timeMomentToSeconds(e){return Q.timeMomentToMilliseconds(e)/1e3}static timeMomentToMilliseconds(e){return e[0]*1e3+e[1]/1e6}static timeMomentToDate(e){const r=e[0]*1e3+e[1]/1e6;return new Date(r)}static formatTimeMomentToTimecodeText(e,n,r=!1){let i=Nr.resolveFrameRateValueFromFraction(n);return re.formatToTimecode(Q.timeMomentToSeconds(e),i,r)}static formatTimerangeToTimecodeText(e,n,r=!1){let i=Q.parseTimeRange(e),o=i.start?Q.formatTimeMomentToTimecodeText(i.start,n,r):"?",s=i.end?Q.formatTimeMomentToTimecodeText(i.end,n,r):"?";return`${o} - ${s}`}static nanosecondsToSeconds(e){return e/1e9}static nanosecondsToTimeMoment(e){const n=Math.floor(e/1e9),r=Math.ceil(e%1e9);return[n,r]}static secondsToTimeMoment(e){return this.nanosecondsToTimeMoment(e*1e9)}static timerangeExprDuration(e){return this.timeRangeDuration(this.parseTimeRange(e))}static timeRangeDuration(e){const{start:n,end:r}=e;if(n===void 0||r===void 0)return 0;{const i=r[0]-n[0],o=r[1]-n[1],s=i+o/1e9;return parseFloat(s.toFixed(3))}}static formatTimeMomentExpr(e){return`${e[0]}:${e[1]}`}static formatNanosecondsToTimeMomentExpr(e){return this.formatTimeMomentExpr(this.nanosecondsToTimeMoment(e))}static toTimeRange(e,n,r=!0,i=!0){return{start:e,end:n,isStartInclusive:r,isEndInclusive:i}}static formatTimeRangeExpr(e){const n=e.isStartInclusive?"[":"(",r=e.isEndInclusive?"]":")",i=e.start?`${e.start[0]}:${e.start[1]}`:"",o=e.end?`${e.end[0]}:${e.end[1]}`:"";return`${n}${i}_${o}${r}`}static timerangeDuration(e){let n=Q.parseTimeRange(e);if(n.start===void 0||n.end===void 0)return 1/0;{let r=Q.timeMomentToSeconds(n.start);return Q.timeMomentToSeconds(n.end)-r}}static padZero(e){return e<10?`0${e}`:`${e}`}};Q.timeRangePattern=/^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$/;let B=Q;function kr(t){return t.format==="urn:x-nmos:format:data"&&t.container==="text/vtt"}function Rr(t){var e,n,r;return{id:on(t.id),label:((e=t.tags)==null?void 0:e.hls_name)??t.label??"Subtitles",default:((n=t.tags)==null?void 0:n.hls_default)==="YES",language:((r=t.tags)==null?void 0:r.hls_language)??"unknown",embedded:!1}}function on(t){return`subtitles-${t}`}function Dr(t,e){const n=t.filter(f=>e.get(f.id).length>0).map(f=>{const d=e.get(f.id);let m,h=!1;if(f.format==="urn:x-nmos:format:video"){const p=f.essence_parameters.frame_rate;p&&(m=p.numerator/(p.denominator??1),(p.numerator===6e4||p.numerator===3e4)&&p.denominator===1001&&(h=!0))}return{start:B.timeMomentToSeconds(B.parseTimeRange(d.at(0).timerange).start),frameRate:m,dropFrame:h}}).sort((f,d)=>f.start-d.start),r=n.find(f=>f.frameRate!==void 0),i=(r==null?void 0:r.start)??n.at(0).start,o=new Date(i*1e3),s=o.getUTCHours(),u=o.getUTCMinutes(),c=o.getUTCSeconds(),a=o.getUTCMilliseconds(),l=s*3600+u*60+c+a/1e3;return r===void 0?{ffom:re.formatToTimecode(l,100,!1,!0),mediaStartTime:i,frameRate:100,dropFrame:!1}:{ffom:re.formatToTimecode(l,r.frameRate,r.dropFrame),mediaStartTime:r.start,frameRate:r.frameRate,dropFrame:r.dropFrame}}class Fr{constructor(e){T(this,"_lanes",[]);T(this,"_markersLaneMap",new Map);T(this,"_laneNodenMap",new Map);this.omakasePlayer=e}addMarkerLane(e){const n={config:e,type:"marker"};this._lanes.push(n)}addMarkers(e,n){this._markersLaneMap.get(e)===void 0&&this._markersLaneMap.set(e,[]),this._markersLaneMap.get(e).push(...n)}addTimelineNode(e,n){this._laneNodenMap.get(e)||this._laneNodenMap.set(e,[]),this._laneNodenMap.get(e).push(n)}addThumbnailLane(e){const n={config:e,type:"thumbnail"};this._lanes.push(n)}addLabelLane(e){const n={config:e,type:"label"};this._lanes.push(n)}addSubtitlesLane(e){const n={config:e,type:"subtitles"};this._lanes.push(n)}buildAndAttachTimeline(e){this.omakasePlayer.createTimeline(e).subscribe({next:n=>{this.buildAttachedTimeline(n)}})}buildAttachedTimeline(e){this._lanes.forEach(n=>this._createAndAttachLane(e,n))}_createAndAttachLane(e,n){let r;if(n.type==="marker"){r=new F.MarkerLane(n.config),e.addTimelineLane(r);const o=this._markersLaneMap.get(r.id);o==null||o.forEach(s=>r.addMarker(s))}else n.type==="thumbnail"?(r=new F.ThumbnailLane(n.config),e.addTimelineLane(r)):n.type==="label"?(r=new F.LabelLane(n.config),e.addTimelineLane(r)):n.type==="subtitles"&&(r=new F.SubtitlesLane(n.config),e.addTimelineLane(r));const i=this._laneNodenMap.get(r.id);i==null||i.forEach(o=>{r.addTimelineNode(o.config)})}}var ct=function(t,e){return ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ct(t,e)};function Ae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ct(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Vr(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(l){try{a(r.next(l))}catch(f){s(f)}}function c(l){try{a(r.throw(l))}catch(f){s(f)}}function a(l){l.done?o(l.value):i(l.value).then(u,c)}a((r=r.apply(t,e||[])).next())})}function sn(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(a){return function(l){return c([a,l])}}function c(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(n=0)),n;)try{if(r=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return n.label++,{value:a[1],done:!1};case 5:n.label++,i=a[1],a=[0];continue;case 7:a=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1],o=a;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(a);break}o[2]&&n.ops.pop(),n.trys.pop();continue}a=e.call(t,n)}catch(l){a=[6,l],i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function Te(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ke(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function He(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Ee(t){return this instanceof Ee?(this.v=t,this):new Ee(t)}function Pr(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(m){return function(h){return Promise.resolve(h).then(m,f)}}function u(m,h){r[m]&&(i[m]=function(p){return new Promise(function(w,E){o.push([m,p,w,E])>1||c(m,p)})},h&&(i[m]=h(i[m])))}function c(m,h){try{a(r[m](h))}catch(p){d(o[0][3],p)}}function a(m){m.value instanceof Ee?Promise.resolve(m.value.v).then(l,f):d(o[0][2],m)}function l(m){c("next",m)}function f(m){c("throw",m)}function d(m,h){m(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Br(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Te=="function"?Te(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(s){return new Promise(function(u,c){s=t[o](s),i(u,c,s.done,s.value)})}}function i(o,s,u,c){Promise.resolve(c).then(function(a){o({value:a,done:u})},s)}}function K(t){return typeof t=="function"}function pt(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ze=pt(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
8
|
-
|
|
9
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function lt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Xe=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var u=Te(s),c=u.next();!c.done;c=u.next()){var a=c.value;a.remove(this)}}catch(p){e={error:p}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else s.remove(this);var l=this.initialTeardown;if(K(l))try{l()}catch(p){o=p instanceof ze?p.errors:[p]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var d=Te(f),m=d.next();!m.done;m=d.next()){var h=m.value;try{Nt(h)}catch(p){o=o??[],p instanceof ze?o=He(He([],Ke(o)),Ke(p.errors)):o.push(p)}}}catch(p){r={error:p}}finally{try{m&&!m.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(o)throw new ze(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Nt(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&<(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&<(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),an=Xe.EMPTY;function un(t){return t instanceof Xe||t&&"closed"in t&&K(t.remove)&&K(t.add)&&K(t.unsubscribe)}function Nt(t){K(t)?t():t.unsubscribe()}var Ur={Promise:void 0},Kr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,He([t,e],Ke(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function cn(t){Kr.setTimeout(function(){throw t})}function ft(){}function Ve(t){t()}var gt=function(t){Ae(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,un(n)&&n.add(r)):r.destination=Zr,r}return e.create=function(n,r,i){return new dt(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Xe),Hr=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Oe(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Oe(r)}else Oe(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Oe(n)}},t}(),dt=function(t){Ae(e,t);function e(n,r,i){var o=t.call(this)||this,s;return K(n)||!n?s={next:n??void 0,error:r??void 0,complete:i??void 0}:s=n,o.destination=new Hr(s),o}return e}(gt);function Oe(t){cn(t)}function $r(t){throw t}var Zr={closed:!0,next:ft,error:$r,complete:ft},vt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function We(t){return t}function qr(t){return t.length===0?We:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var j=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=Wr(e)?e:new dt(e,n,r);return Ve(function(){var s=i,u=s.operator,c=s.source;o.add(u?u.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=kt(n),new n(function(i,o){var s=new dt({next:function(u){try{e(u)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});r.subscribe(s)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[vt]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return qr(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=kt(e),new e(function(r,i){var o;n.subscribe(function(s){return o=s},function(s){return i(s)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function kt(t){var e;return(e=t??Ur.Promise)!==null&&e!==void 0?e:Promise}function Xr(t){return t&&K(t.next)&&K(t.error)&&K(t.complete)}function Wr(t){return t&&t instanceof gt||Xr(t)&&un(t)}function jr(t){return K(t==null?void 0:t.lift)}function pe(t){return function(e){if(jr(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ue(t,e,n,r,i){return new Gr(t,e,n,r,i)}var Gr=function(t){Ae(e,t);function e(n,r,i,o,s,u){var c=t.call(this,n)||this;return c.onFinalize=s,c.shouldUnsubscribe=u,c._next=r?function(a){try{r(a)}catch(l){n.error(l)}}:t.prototype._next,c._error=o?function(a){try{o(a)}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(a){n.error(a)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(gt),Yr=pt(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),le=function(t){Ae(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Rt(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Yr},e.prototype.next=function(n){var r=this;Ve(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var s=Te(r.currentObservers),u=s.next();!u.done;u=s.next()){var c=u.value;c.next(n)}}catch(a){i={error:a}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Ve(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;Ve(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,s=i.isStopped,u=i.observers;return o||s?an:(this.currentObservers=null,u.push(n),new Xe(function(){r.currentObservers=null,lt(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,s=r.isStopped;i?n.error(o):s&&n.complete()},e.prototype.asObservable=function(){var n=new j;return n.source=this,n},e.create=function(n,r){return new Rt(n,r)},e}(j),Rt=function(t){Ae(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:an},e}(le),zr=new j(function(t){return t.complete()});function Jr(t){return t&&K(t.schedule)}function ln(t){return t[t.length-1]}function fn(t){return K(ln(t))?t.pop():void 0}function Qr(t){return Jr(ln(t))?t.pop():void 0}var dn=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function mn(t){return K(t==null?void 0:t.then)}function hn(t){return K(t[vt])}function pn(t){return Symbol.asyncIterator&&K(t==null?void 0:t[Symbol.asyncIterator])}function gn(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ei(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vn=ei();function bn(t){return K(t==null?void 0:t[vn])}function wn(t){return Pr(this,arguments,function(){var n,r,i,o;return sn(this,function(s){switch(s.label){case 0:n=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Ee(n.read())];case 3:return r=s.sent(),i=r.value,o=r.done,o?[4,Ee(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Ee(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function En(t){return K(t==null?void 0:t.getReader)}function xe(t){if(t instanceof j)return t;if(t!=null){if(hn(t))return ti(t);if(dn(t))return ni(t);if(mn(t))return ri(t);if(pn(t))return Sn(t);if(bn(t))return ii(t);if(En(t))return oi(t)}throw gn(t)}function ti(t){return new j(function(e){var n=t[vt]();if(K(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ni(t){return new j(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function ri(t){return new j(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,cn)})}function ii(t){return new j(function(e){var n,r;try{for(var i=Te(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Sn(t){return new j(function(e){si(t,e).catch(function(n){return e.error(n)})})}function oi(t){return Sn(wn(t))}function si(t,e){var n,r,i,o;return Vr(this,void 0,void 0,function(){var s,u;return sn(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Br(t),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(s=r.value,e.next(s),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),i={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function de(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Tn(t,e){return e===void 0&&(e=0),pe(function(n,r){n.subscribe(ue(r,function(i){return de(r,t,function(){return r.next(i)},e)},function(){return de(r,t,function(){return r.complete()},e)},function(i){return de(r,t,function(){return r.error(i)},e)}))})}function yn(t,e){return e===void 0&&(e=0),pe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function ai(t,e){return xe(t).pipe(yn(e),Tn(e))}function ui(t,e){return xe(t).pipe(yn(e),Tn(e))}function ci(t,e){return new j(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function li(t,e){return new j(function(n){var r;return de(n,e,function(){r=t[vn](),de(n,e,function(){var i,o,s;try{i=r.next(),o=i.value,s=i.done}catch(u){n.error(u);return}s?n.complete():n.next(o)},0,!0)}),function(){return K(r==null?void 0:r.return)&&r.return()}})}function Cn(t,e){if(!t)throw new Error("Iterable cannot be null");return new j(function(n){de(n,e,function(){var r=t[Symbol.asyncIterator]();de(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function fi(t,e){return Cn(wn(t),e)}function di(t,e){if(t!=null){if(hn(t))return ai(t,e);if(dn(t))return ci(t,e);if(mn(t))return ui(t,e);if(pn(t))return Cn(t,e);if(bn(t))return li(t,e);if(En(t))return fi(t,e)}throw gn(t)}function Mn(t,e){return e?di(t,e):xe(t)}var Ln=pt(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function mi(t,e){return pe(function(n,r){var i=0;n.subscribe(ue(r,function(o){r.next(t.call(e,o,i++))}))})}var hi=Array.isArray;function pi(t,e){return hi(e)?t.apply(void 0,He([],Ke(e))):t(e)}function An(t){return mi(function(e){return pi(t,e)})}var gi=Array.isArray,vi=Object.getPrototypeOf,bi=Object.prototype,wi=Object.keys;function xn(t){if(t.length===1){var e=t[0];if(gi(e))return{args:e,keys:null};if(Ei(e)){var n=wi(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Ei(t){return t&&typeof t=="object"&&vi(t)===bi}function In(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function Si(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qr(t),r=fn(t),i=xn(t),o=i.args,s=i.keys;if(o.length===0)return Mn([],n);var u=new j(Ti(o,n,s?function(c){return In(s,c)}:We));return r?u.pipe(An(r)):u}function Ti(t,e,n){return n===void 0&&(n=We),function(r){Dt(e,function(){for(var i=t.length,o=new Array(i),s=i,u=i,c=function(l){Dt(e,function(){var f=Mn(t[l],e),d=!1;f.subscribe(ue(r,function(m){o[l]=m,d||(d=!0,u--),u||r.next(n(o.slice()))},function(){--s||r.complete()}))},r)},a=0;a<i;a++)c(a)},r)}}function Dt(t,e,n){t?de(n,t,e):e()}function yi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fn(t),r=xn(t),i=r.args,o=r.keys,s=new j(function(u){var c=i.length;if(!c){u.complete();return}for(var a=new Array(c),l=c,f=c,d=function(h){var p=!1;xe(i[h]).subscribe(ue(u,function(w){p||(p=!0,f--),a[h]=w},function(){return l--},void 0,function(){(!l||!p)&&(f||u.next(o?In(o,a):a),u.complete())}))},m=0;m<c;m++)d(m)});return n?s.pipe(An(n)):s}function Ci(t,e){return pe(function(n,r){var i=0;n.subscribe(ue(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function Mi(t){return pe(function(e,n){var r=!1;e.subscribe(ue(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function Li(t){return t<=0?function(){return zr}:pe(function(e,n){var r=0;e.subscribe(ue(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Ai(t){return t===void 0&&(t=xi),pe(function(e,n){var r=!1;e.subscribe(ue(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function xi(){return new Ln}function we(t,e){var n=arguments.length>=2;return function(r){return r.pipe(We,Li(1),n?Mi(e):Ai(function(){return new Ln}))}}function Z(t){return pe(function(e,n){xe(t).subscribe(ue(n,function(){return n.complete()},ft)),!n.closed&&e.subscribe(n)})}class Ii{constructor(){T(this,"actionZoomIn");T(this,"actionZoomOut");T(this,"actionResetZoom");T(this,"actionToggleNextAudioTrack");T(this,"actionTogglePreviousAudioTrack");T(this,"actionToggleCti")}getKeyboardShortcutsHelpMenuGroup(){let e=(...i)=>i.join(" + "),n="shift".toUpperCase();return{name:"Timeline function shortcuts",items:[{description:"Timeline Zoom In",name:e("=")},{description:"Timeline Zoom Out",name:e("-")},{description:"Timeline Zoom level 100%",name:e("0")},{description:"Toggle Next Audio Track",name:e(n,"e")},{description:"Toggle Previous Audio Track",name:e("e")},{description:"Toggle CTI into / out-of Interactive Mode",name:e("'")}]}}handleKeyboardEvent(e){const n=e.target;return["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"].includes(n.tagName.toUpperCase())?!1:e.code==="Equal"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionZoomIn&&this.actionZoomIn(),!0):e.code==="Minus"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionZoomOut&&this.actionZoomOut(),!0):e.code==="Digit0"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionResetZoom&&this.actionResetZoom(),!0):e.code==="KeyE"&&!e.ctrlKey&&!e.metaKey?(e.shiftKey?this.actionToggleNextAudioTrack&&this.actionToggleNextAudioTrack():this.actionTogglePreviousAudioTrack&&this.actionTogglePreviousAudioTrack(),!0):e.code==="Quote"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionToggleCti&&this.actionToggleCti(),!0):!1}}const Oi=v.memo(({omakasePlayer:t,onTimelineCreatedCallback:e,timelineConfig:n,enableHotKeys:r})=>(v.useEffect(()=>{if(n.timelineHTMLElementId===void 0&&(n.timelineHTMLElementId="omakase-timeline"),t.createTimeline(n).subscribe({next:i=>{Si([t.timeline.onReady$,t.video.onVideoLoaded$.pipe(Ci(o=>!!o))]).subscribe({next:()=>e(i)})}}),r===void 0||r){const i=new Ii;i.actionToggleCti=()=>{var u;return(u=t.timeline)==null?void 0:u.toggleTimecodeEdit()},i.actionResetZoom=()=>{var u;return(u=t.timeline)==null?void 0:u.zoomToEased(100)},i.actionZoomIn=()=>{var u;return(u=t.timeline)==null?void 0:u.zoomInEased()},i.actionZoomOut=()=>{var u;return(u=t.timeline)==null?void 0:u.zoomOutEased()};const o=u=>{const c=t.audio.getAudioTracks(),a=t.audio.getActiveAudioTrack(),f=c.findIndex(d=>d.id===(a==null?void 0:a.id))+(u?-1:1);f>=0&&f<c.length&&t.audio.setActiveAudioTrack(c.at(f).id)};i.actionTogglePreviousAudioTrack=()=>o(!0),i.actionToggleNextAudioTrack=()=>o(!1);const s=u=>{i.handleKeyboardEvent(u)&&(u.preventDefault(),u.stopPropagation())};return window.addEventListener("keydown",s),t.chroming.appendHelpMenuGroup(i.getKeyboardShortcutsHelpMenuGroup()),()=>{window.removeEventListener("keydown",s)}}},[t]),v.createElement("div",{id:n.timelineHTMLElementId})));class On{static get window(){return window}static get navigator(){return window.navigator}static get userAgent(){var n;const e=((n=this.navigator)==null?void 0:n.userAgent)||"";return/Android/i.test(e)?"android":/Firefox/i.test(e)?"firefox":/Edg/i.test(e)?"edge":(/Chrome/i.test(e)||/CriOS/i.test(e))&&!/Edg/i.test(e)?"chrome":/Chrome/i.test(e)||/CriOS/i.test(e)?"chromium":/Safari/i.test(e)?"safari":"unknown"}static get platform(){var n,r,i;const e=((r=(n=this.navigator)==null?void 0:n.userAgentData)==null?void 0:r.platform)||((i=this.navigator)==null?void 0:i.platform);return e!=null&&e.toUpperCase().includes("MAC")?"macos":e!=null&&e.toUpperCase().includes("WIN")?"windows":e!=null&&e.toUpperCase().includes("LINUX")?"linux":"unknown"}static isUserAgent(e){return this.userAgent===e}static isPlatform(e){return this.platform===e}static open(e,n="_blank"){this.window.open(e,n)}}const Ce=[.25,.5,.75,1,2,4,8];class Ft{static getKeyboardShortcutsHelpMenuGroup(){let e=(...o)=>o.join(" + "),n="shift".toUpperCase(),r="ctrl".toUpperCase();return{name:"Playback function shortcuts",items:[{description:"Play / Pause",name:e("Space")},{description:"Toggle Sound",name:e("s")},{description:"Toggle Text On / Off",name:e("d")},{description:"Toggle Full Screen",name:e("f")},{description:"Increase Volume",name:e(n,"\\")},{description:"Reduce Volume",name:e("\\")},{description:"One Frame Forward",name:e("Right Arrow")},{description:"One Frame Backward",name:e("Left Arrow")},{description:"10 Frames Forward",name:e(n,"Right Arrow")},{description:"10 Frames Backwards",name:e(n,"Left Arrow")},{description:"Stop shuttle and pause",name:e("k")},{description:"Decrease Shuttle Forwards",name:e("l")},{description:"Increase Shuttle Forwards",name:e(n,"l")},{description:"Set playhead to Start of Media and Stop",name:e("1 / Home")},{description:"Set playhead to End of Media and Stop",name:e(r,"1")+" / End"}]}}static handleKeyboardEvent(e,n){const r=e.target,i=["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"],o=On.userAgent;if(i.includes(r.tagName.toUpperCase()))return!1;if(n&&n.video){if(e.code==="Space"&&(o!=="safari"||!n.video.isFullscreen()))return n.video.togglePlayPause(),!0;if(e.code==="KeyS"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)return n.video.toggleMuteUnmute(),!0;if(e.code==="Backslash"){let s=10,u=e.shiftKey?1:-1,c=n.video.getVolume()*100+s*u;c>=100?c=100:c<=0&&(c=0),n.video.setVolume(c/100)}if(e.code==="KeyD"&&!(e.ctrlKey&&e.shiftKey&&e.metaKey))return n.subtitles.toggleShowHideActiveTrack(),!0;if(e.code==="KeyK"&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey&&(n.video.setPlaybackRate(1),n.video.pause()),e.code==="KeyL"&&!e.ctrlKey&&!e.metaKey){let s=e.shiftKey?1:-1;const u=Ce.indexOf(n.video.getPlaybackRate())+s;let c;return u<0?c=Ce.at(0):u>=Ce.length?c=Ce.at(-1):c=Ce.at(u),n.video.setPlaybackRate(c),n.video.isPaused()&&n.video.play(),!0}if(n.video.isVideoLoaded()){if(["ArrowLeft","ArrowRight"].includes(e.key)&&!e.metaKey&&!e.altKey){let s=e.key==="ArrowRight"?1:-1,u=e.shiftKey?10:1;return n.video.isPlaying()&&n.video.pause(),n.video.seekFromCurrentFrame(u*s),!0}if(e.code==="Digit1"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey||e.code==="Home")return n.video.pause().subscribe(()=>n.video.seekToFrame(0)),!0;if(e.code==="Digit1"&&e.ctrlKey||e.code==="End")return n.video.isPlaying()?n.video.pause().subscribe(()=>n.video.seekToEnd()):n.video.seekToEnd(),!0}if(e.code==="KeyF"&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey)return n.video.toggleFullscreen(),!0}return!1}}const _n=v.memo(function({videoUrl:e,config:n,videoLoadOptions:r,onVideoLoadedCallback:i,enableHotkeys:o}){return n&&(n==null?void 0:n.playerHTMLElementId)===void 0&&(n.playerHTMLElementId="omakase-player"),v.useEffect(()=>{var c,a;let s=new F.OmakasePlayer(n);const u=l=>{Ft.handleKeyboardEvent(l,s)&&(l.stopPropagation(),l.preventDefault())};return(o===void 0||o)&&((c=document.querySelector("media-controller"))==null||c.setAttribute("nohotkeys",""),(a=document.querySelector("media-controller"))==null||a.setAttribute("tabindex","-1"),window.addEventListener("keydown",u),s.chroming.appendHelpMenuGroup(Ft.getKeyboardShortcutsHelpMenuGroup())),s.loadVideo(e,r).subscribe({next:l=>{i&&i(s,l)}}),()=>{(o===void 0||o)&&window.removeEventListener("keydown",u)}},[e]),v.createElement("div",{id:n.playerHTMLElementId})}),_i=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M10.5675 21C10.2375 21 9.9675 20.73 9.9675 20.4V16.7925L5.6325 12.3675L9.9675 8.235V3.6C9.9675 3.27 10.2375 3 10.5675 3C10.8975 3 11.1675 3.27 11.1675 3.6V8.7525L7.3425 12.3975L11.1675 16.305V20.4C11.1675 20.73 10.8975 21 10.5675 21Z",fill:"#CACFEA"}),v.createElement("path",{d:"M17.7675 17.145C17.61 17.145 17.46 17.085 17.34 16.965L12.8325 12.3675L17.355 8.0625C17.595 7.8375 17.9775 7.845 18.2025 8.085C18.4275 8.325 18.42 8.7075 18.18 8.9325L14.5425 12.3975L18.195 16.125C18.4275 16.365 18.42 16.74 18.1875 16.9725C18.075 17.085 17.9175 17.145 17.7675 17.145Z",fill:"#CACFEA"})),Ni=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M13.4325 21C13.7625 21 14.0325 20.73 14.0325 20.4V16.7925L18.3675 12.3675L14.0325 8.235V3.6C14.0325 3.27 13.7625 3 13.4325 3C13.1025 3 12.8325 3.27 12.8325 3.6V8.7525L16.6575 12.3975L12.8325 16.305V20.4C12.8325 20.73 13.1025 21 13.4325 21Z",fill:"#CACFEA"}),v.createElement("path",{d:"M6.2325 17.145C6.39 17.145 6.54 17.085 6.66 16.965L11.1675 12.3675L6.645 8.0625C6.405 7.8375 6.0225 7.845 5.7975 8.085C5.5725 8.325 5.58 8.7075 5.82 8.9325L9.4575 12.3975L5.805 16.125C5.5725 16.365 5.58 16.74 5.8125 16.9725C5.925 17.085 6.0825 17.145 6.2325 17.145Z",fill:"#CACFEA"})),ki=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M14.1675 21C13.8375 21 13.5675 20.73 13.5675 20.4V16.7925L9.2325 12.3675L13.5675 8.235V3.6C13.5675 3.27 13.8375 3 14.1675 3C14.4975 3 14.7675 3.27 14.7675 3.6V8.7525L10.9425 12.3975L14.7675 16.305V20.4C14.7675 20.73 14.4975 21 14.1675 21Z",fill:"#CACFEA"})),Ri=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M9.8325 21C10.1625 21 10.4325 20.73 10.4325 20.4V16.7925L14.7675 12.3675L10.4325 8.235V3.6C10.4325 3.27 10.1625 3 9.8325 3C9.5025 3 9.2325 3.27 9.2325 3.6V8.7525L13.0575 12.3975L9.2325 16.305V20.4C9.2325 20.73 9.5025 21 9.8325 21Z",fill:"#CACFEA"})),Di=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M11.3475 3H5.775V21L11.3475 17.0475V3Z",fill:"#CACFEA"}),v.createElement("path",{d:"M18.225 21L12.6525 17.0475V3H18.225V21ZM13.7775 16.47L17.1 18.825V4.125H13.7775V16.47Z",fill:"#CACFEA"})),Fi=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M4.6875 3V21L8.0625 17.0475L11.4375 21V3H4.6875Z",fill:"#CACFEA"}),v.createElement("path",{d:"M12.5625 3V21L15.9375 17.0475L19.3125 21V3H12.5625Z",fill:"#CACFEA"})),Vi=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M6.39001 3V21L12 17.0175L17.61 21V3H6.38251H6.39001ZM16.44 3.84L7.23001 18.7125V3.84H16.44ZM12 15.9975L8.25751 18.6525L16.77 4.89V19.3725L12 15.9825V15.9975Z",fill:"#CACFEA"})),Pi=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M12.3075 8.0175L14.4525 5.8725C14.6175 5.7075 14.6175 5.43 14.4525 5.265L12.3 3.12C12.135 2.955 11.8575 2.955 11.6925 3.12C11.5275 3.285 11.5275 3.5625 11.6925 3.7275L13.1025 5.1375H6.64499C5.22749 5.1375 4.07249 6.2925 4.07249 7.71V16.2825C4.07249 17.7 5.22749 18.855 6.64499 18.855C6.87749 18.855 7.07249 18.66 7.07249 18.4275C7.07249 18.195 6.87749 18 6.64499 18C5.69249 18 4.93499 17.2275 4.93499 16.29V7.7175C4.93499 6.765 5.70749 6.0075 6.64499 6.0075H13.11L11.7 7.4175C11.535 7.5825 11.535 7.86 11.7 8.025C11.865 8.19 12.1425 8.19 12.3075 8.025V8.0175Z",fill:"#CACFEA"}),v.createElement("path",{d:"M17.355 18.8625C18.7725 18.8625 19.9275 17.7075 19.9275 16.29V7.7175C19.9275 6.3 18.7725 5.145 17.355 5.145C17.1225 5.145 16.9275 5.34 16.9275 5.5725C16.9275 5.805 17.1225 6 17.355 6C18.3075 6 19.065 6.7725 19.065 7.71V16.2825C19.065 17.235 18.2925 17.9925 17.355 17.9925H10.89L12.3075 16.5825C12.3825 16.5075 12.435 16.395 12.435 16.2825C12.435 16.17 12.3975 16.0575 12.3075 15.9825C12.15 15.8175 11.8575 15.825 11.7 15.9825L9.52501 18.1575V18.18C9.45751 18.255 9.42751 18.345 9.42751 18.435C9.42751 18.555 9.46501 18.66 9.55501 18.735L11.7 20.88C11.8575 21.045 12.15 21.045 12.3075 20.88C12.4725 20.715 12.4725 20.4375 12.3075 20.2725L10.89 18.8625H17.355Z",fill:"#CACFEA"})),Bi=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{clipPath:"url(#clip0_3377_237)"},v.createElement("path",{d:"M13.02 19.95C17.42 19.95 21 16.37 21 11.97C21 7.57 17.42 4 13.02 4C8.88 4 5.39 7.24 5.08 11.37L5.02 12.14L3.56 10.68C3.49 10.61 3.41 10.58 3.33 10.58C3.25 10.58 3.17 10.61 3.1 10.68C3.03 10.75 3 10.83 3 10.92C3 11 3.03 11.08 3.1 11.15L5.22 13.27C5.35 13.4 5.55 13.43 5.65 13.3L7.8 11.15C7.87 11.08 7.9 11 7.9 10.92C7.9 10.84 7.86 10.76 7.8 10.69C7.73 10.62 7.65 10.59 7.57 10.59C7.49 10.59 7.41 10.62 7.34 10.69L5.9 12.13L6.03 11.11C6.45 7.57 9.46 4.91 13.02 4.91C16.91 4.91 20.08 8.08 20.08 11.97C20.08 15.86 16.91 19.03 13.02 19.03C12.77 19.03 12.56 19.24 12.56 19.49C12.56 19.74 12.77 19.95 13.02 19.95Z",fill:"#CACFEA"}),v.createElement("path",{d:"M14.95 13.19C14.95 13.72 14.75 14.14 14.36 14.45C13.97 14.76 13.43 14.91 12.75 14.91C12.16 14.91 11.69 14.81 11.32 14.62V13.53C11.7 13.81 12.14 13.95 12.65 13.95C12.98 13.95 13.23 13.88 13.41 13.74C13.59 13.6 13.67 13.41 13.67 13.17C13.67 12.93 13.56 12.72 13.34 12.58C13.12 12.44 12.82 12.37 12.43 12.37H11.92V11.41H12.39C13.13 11.41 13.5 11.16 13.5 10.67C13.5 10.21 13.22 9.98 12.65 9.98C12.26 9.98 11.89 10.1 11.54 10.35V9.33C11.93 9.13 12.4 9.03 12.94 9.03C13.48 9.03 13.94 9.16 14.28 9.41C14.62 9.66 14.79 10.01 14.79 10.44C14.79 11.19 14.41 11.65 13.66 11.84V11.86C14.06 11.91 14.37 12.05 14.61 12.29C14.85 12.53 14.96 12.83 14.96 13.19H14.95Z",fill:"#CACFEA"})),v.createElement("defs",null,v.createElement("clipPath",{id:"clip0_3377_237"},v.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),Ui=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{clipPath:"url(#clip0_3377_260)"},v.createElement("path",{d:"M10.98 19.95C6.58 19.95 3 16.37 3 11.98C3 7.58 6.58 4 10.98 4C15.12 4 18.61 7.24 18.93 11.37L18.99 12.14L20.45 10.68C20.52 10.61 20.6 10.58 20.68 10.58C20.76 10.58 20.84 10.61 20.91 10.68C20.98 10.75 21.01 10.83 21.01 10.91C21.01 10.99 20.98 11.07 20.91 11.14L18.79 13.26C18.66 13.39 18.46 13.42 18.36 13.29L16.21 11.14C16.14 11.07 16.11 10.99 16.11 10.91C16.11 10.83 16.15 10.75 16.21 10.68C16.28 10.61 16.36 10.58 16.44 10.58C16.52 10.58 16.6 10.61 16.67 10.68L18.11 12.12L17.98 11.1C17.55 7.57 14.54 4.91 10.98 4.91C7.09 4.91 3.92 8.08 3.92 11.97C3.92 15.86 7.09 19.03 10.98 19.03C11.23 19.03 11.44 19.24 11.44 19.49C11.44 19.74 11.23 19.95 10.98 19.95Z",fill:"#CACFEA"}),v.createElement("path",{d:"M12.91 13.19C12.91 13.72 12.71 14.14 12.32 14.45C11.93 14.76 11.39 14.91 10.71 14.91C10.12 14.91 9.65 14.81 9.28 14.62V13.53C9.66 13.81 10.1 13.95 10.61 13.95C10.94 13.95 11.19 13.88 11.37 13.74C11.55 13.6 11.63 13.41 11.63 13.17C11.63 12.93 11.52 12.72 11.3 12.58C11.08 12.44 10.78 12.37 10.39 12.37H9.88V11.41H10.35C11.09 11.41 11.46 11.16 11.46 10.67C11.46 10.21 11.18 9.98 10.61 9.98C10.22 9.98 9.85 10.1 9.5 10.35V9.33C9.89 9.13 10.36 9.03 10.9 9.03C11.44 9.03 11.9 9.16 12.24 9.41C12.58 9.66 12.75 10.01 12.75 10.44C12.75 11.19 12.37 11.65 11.62 11.84V11.86C12.02 11.91 12.33 12.05 12.57 12.29C12.81 12.53 12.92 12.83 12.92 13.19H12.91Z",fill:"#CACFEA"})),v.createElement("defs",null,v.createElement("clipPath",{id:"clip0_3377_260"},v.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),z=({Icon:t,onClick:e,width:n,height:r,text:i,disabled:o})=>v.createElement("button",{disabled:o,onClick:e},v.createElement(t,{width:n,height:r})," ",i),Ki=({width:t,height:e})=>v.createElement("svg",{width:t??24,height:e??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M12.6525 17.0475L18.225 21V3H12.6525V17.0475Z",fill:"#CACFEA"}),v.createElement("path",{d:"M5.775 3H11.3475V17.0475L5.775 21V3ZM10.2225 4.125H6.9V18.825L10.2225 16.47V4.125Z",fill:"#CACFEA"})),Hi=({width:t,height:e})=>v.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{x:"0.5",y:"0.5",width:"13",height:"13",rx:"2.5",stroke:"#CACFEA"}),v.createElement("path",{d:"M7.16667 6.33333V6.83333H7.66667H10.3333C10.4257 6.83333 10.5 6.90769 10.5 7C10.5 7.09231 10.4257 7.16667 10.3333 7.16667H7.66667H7.16667V7.66667V10.3333C7.16667 10.4257 7.09231 10.5 7 10.5C6.90769 10.5 6.83333 10.4257 6.83333 10.3333V7.66667V7.16667H6.33333H3.66667C3.57468 7.16667 3.5 7.09199 3.5 7C3.5 6.90801 3.57468 6.83333 3.66667 6.83333H6.33333H6.83333V6.33333V3.66667C6.83333 3.57468 6.90801 3.5 7 3.5C7.09199 3.5 7.16667 3.57468 7.16667 3.66667V6.33333Z",fill:"#CACFEA",stroke:"#CACFEA"}));function J(t){t.next(),t.complete()}class $i{constructor(){T(this,"actionMarkerInOut");T(this,"actionMarkerSplit");T(this,"actionMarkerDelete");T(this,"actionPreviousMarkerToggle");T(this,"actionNextMarkerToggle");T(this,"actionSetMarkerStartToPlayhead");T(this,"actionSetMarkerEndToPlayhead");T(this,"actionSetPlayheadToMarkerStart");T(this,"actionSetPlayheadToMarkerEnd");T(this,"actionRewind3SecondsAndPlayToCurrent");T(this,"actionPlay3SecondsAndRewindToCurrent");T(this,"actionLoopActiveMarker")}getKeyboardShortcutsHelpMenuGroup(){let e=(...s)=>s.join(" + "),n="shift".toUpperCase();const r=On.platform;let i=r==="windows"?"win":r==="linux"?"super":"cmd";return{name:"Segmentation function shortcuts",items:[{description:"Mark In / Out",name:e("m")},{description:"Split Active Marker",name:e(".")},{description:"Delete Active Marker",name:e("n")},{description:"Toggle Previous Marker",name:e("/")},{description:"Toggle Next Marker",name:e(n,"/")},{description:"Set Start of Active Marker to Playhead Position",name:e("i")},{description:"Set End of Active Marker to Playhead Position",name:e("o")},{description:"Set Playhead to Start of Active Marker",name:e("[")},{description:"Set Playhead to End of Active Marker",name:e("]")},{description:"Rewind 3 Seconds and Play to Current Playhead",name:e(i,"Arrow Left")},{description:"Play 3 Seconds and Rewind to Current Playhead",name:e(i,"Arrow Right")},{description:"Loop on Active Marker",name:e("p")}]}}handleKeyboardEvent(e,n){const r=e.target;return["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"].includes(r.tagName.toUpperCase())?!1:e.code==="KeyM"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionMarkerInOut&&this.actionMarkerInOut(),!0):e.code==="Period"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionMarkerSplit&&this.actionMarkerSplit(),!0):e.code==="KeyN"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionMarkerDelete&&this.actionMarkerDelete(),!0):e.code==="Slash"&&!e.ctrlKey&&!e.metaKey?(e.shiftKey?this.actionNextMarkerToggle&&this.actionNextMarkerToggle():this.actionPreviousMarkerToggle&&this.actionPreviousMarkerToggle(),!0):e.code==="KeyI"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionSetMarkerStartToPlayhead&&this.actionSetMarkerStartToPlayhead(),!0):e.code==="KeyO"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionSetMarkerEndToPlayhead&&this.actionSetMarkerEndToPlayhead(),!0):e.code==="BracketLeft"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionSetPlayheadToMarkerStart&&this.actionSetPlayheadToMarkerStart(),!0):e.code==="BracketRight"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionSetPlayheadToMarkerEnd&&this.actionSetPlayheadToMarkerEnd(),!0):e.code==="ArrowLeft"&&!e.shiftKey&&!e.ctrlKey&&e.metaKey?(this.actionRewind3SecondsAndPlayToCurrent&&this.actionRewind3SecondsAndPlayToCurrent(),!0):e.code==="ArrowRight"&&!e.shiftKey&&!e.ctrlKey&&e.metaKey?(this.actionPlay3SecondsAndRewindToCurrent&&this.actionPlay3SecondsAndRewindToCurrent(),!0):e.code==="KeyP"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(this.actionLoopActiveMarker&&this.actionLoopActiveMarker(),!0):!1}}const _e=(t,e,n)=>t.getMarkers().reduce((r,i)=>{if(e.id===i.id)return r;if(i instanceof F.PeriodMarker&&i.timeObservation.start!=null&&i.timeObservation.end!=null){const o=e.timeObservation,s=i.timeObservation.start,u=i.timeObservation.end,c=o.start,a=n??o.end;if(c!=null&&a!=null)return r||c<=u&&a>=s}return r},!1);function Ne(t,e,n){if(!t||!(t instanceof F.PeriodMarker))return!0;const r=t.timeObservation.start,i=t.timeObservation.end;if(r==null||i==null)return!0;const o=n.video.calculateTimeToFrame(i),s=n.video.calculateTimeToFrame(r),u=n.video.getCurrentFrame();return e<r||o-u<2||u-s<1}function ke(t){return!(t.timeObservation.start==null||t.timeObservation.end==null)}const Zi=({selectedMarker:t,omakasePlayer:e,markerListApi:n,enableHotKeys:r,segmentationLanes:i,setSegmentationLanes:o,setSelectedMarker:s,onMarkerClickCallback:u,setSource:c,source:a,constants:l})=>{const f=v.useRef(void 0),d=v.useRef(void 0),m=new le,h=v.useRef(!1),p=(b,S,L)=>{const R=S??e.video.getCurrentTime();return b.getMarkers().reduce((O,X)=>X instanceof F.PeriodMarker&&X.timeObservation.start!==void 0&&X.timeObservation.end!==void 0&&X.id!==(L==null?void 0:L.id)?O||R>=X.timeObservation.start&&R<=X.timeObservation.end:O,!1)},w=b=>{if(x===void 0)return!0;const S=x.timeObservation.start,L=b??e.video.getCurrentTime();return!!(S==null||S>=L||_e(a,x,L))},E=b=>x!==void 0||a===void 0?!0:p(a,b,x),[I,M]=v.useState(void 0),[N,k]=v.useState(Ne(t,e.video.getCurrentTime(),e)),[x,G]=v.useState(void 0),[ne,Y]=v.useState(w()),[ve,H]=v.useState(E()),oe=b=>{if(b===void 0||a===void 0||!(b instanceof F.PeriodMarker))return!0;const S=_e(a,b,e.video.getCurrentTime());if(S)return S;if(b instanceof F.PeriodMarker){const L=b.timeObservation.end;if(L!=null&&e.video.getCurrentTime()>=L)return!0}return!1},se=b=>{if(b===void 0||a===void 0||!(b instanceof F.PeriodMarker))return!0;const S=_e(a,b,e.video.getCurrentTime());if(S)return S;if(b instanceof F.PeriodMarker){if(b.timeObservation.end==null)return!0;const L=b.timeObservation.start;if(L!=null&&e.video.getCurrentTime()<=L)return!0}return!1},[be,P]=v.useState(oe(t)),[_,je]=v.useState(se(t));v.useEffect(()=>{if(Y(()=>w()),H(()=>E()),x&&x!==t){const b=i.find(S=>S.getMarker(x.id));b==null||b.removeMarker(x.id),G(void 0)}},[t,x,i,G]),v.useEffect(()=>()=>J(m),[]),v.useEffect(()=>{if(P(oe(t)),je(se(t)),t){const b=Ne(t,e.video.getCurrentTime(),e);k(b);const S=e.video.onVideoTimeChange$.pipe(Z(m)).subscribe({next:L=>{k(R=>Ne(t,L.currentTime,e)),P(()=>oe(t)),je(()=>se(t))}});return()=>S.unsubscribe()}},[t]),v.useEffect(()=>{e.video.onSeeking$.pipe(Z(m)).subscribe({next:S=>{Y(()=>w(S.toTime)),H(()=>E(S.toTime))}});const b=e.video.onVideoTimeChange$.pipe(Z(m)).subscribe({next:S=>{Y(()=>w()),H(()=>E())}});return()=>b.unsubscribe()},[x,a]),v.useEffect(()=>{const b=i.map(S=>S.onMarkerUpdate$.pipe(Z(m)).subscribe({next:L=>{(t==null?void 0:t.id)===L.marker.id&&(k(R=>Ne(t,e.video.getCurrentTime(),e)),P(()=>oe(t)),je(()=>se(t)))}}));return()=>b.forEach(S=>S.unsubscribe())},[i,t]),v.useEffect(()=>{I&&(I.marker.style={...I.marker.style,color:I.color},I.marker.timeObservation={...I.marker.timeObservation},M(void 0))},[t]),v.useEffect(()=>{if(a){Y(()=>w()),H(()=>E());const b=a.onMarkerDelete$.pipe(Z(m)).subscribe({next:L=>{const R=L.marker;M(O=>{if((O==null?void 0:O.marker.id)!==R.id)return O}),s(O=>{if((O==null?void 0:O.id)!==R.id)return O}),G(O=>{if((O==null?void 0:O.id)!==R.id)return O}),Y(()=>w()),H(()=>E())}}),S=a.onMarkerUpdate$.pipe(Z(m)).subscribe({next:()=>{Y(()=>w()),H(()=>E())}});return()=>{b.unsubscribe(),S.unsubscribe()}}},[a]);const bt=(b,S)=>{if(S===void 0)return;const L=S.timeObservation;b.video.seekToTime(L.start)},wt=(b,S)=>{if(S===void 0)return;const L=S.timeObservation;b.video.seekToTime(L.end)},Et=(b,S)=>{S instanceof F.PeriodMarker&&S.timeObservation.start!==void 0&&(S.timeObservation={...S.timeObservation,start:b.video.getCurrentTime()})},St=(b,S)=>{S instanceof F.PeriodMarker&&S.timeObservation.end!==void 0&&(S.timeObservation={...S.timeObservation,end:b.video.getCurrentTime()})},Tt=(b,S)=>{f.current&&J(f.current),f.current=new le,b.video.pause();const L=b.video.getCurrentFrame(),R=b.video.getFrameRate(),O=L-S*R,X=O>=0?O:0;b.video.seekToFrame(X).pipe(we()).subscribe(()=>{}),b.video.play(),b.video.onVideoTimeChange$.pipe(Z(f.current),Z(m)).subscribe(Ie=>{Ie.frame>=L-1&&(b.video.pause().subscribe(()=>{b.video.seekToFrame(L).pipe(we()).subscribe(()=>{})}),J(f.current))})},yt=(b,S)=>{f.current&&J(f.current),f.current=new le,d.current&&J(d.current),d.current=new le;const L=b.video.getCurrentFrame(),R=b.video.getFrameRate(),O=L+S*R;b.video.play(),b.video.onVideoTimeChange$.pipe(Z(f.current),Z(m)).subscribe(X=>{X.frame>=O-1&&(b.video.pause().subscribe(()=>{b.video.seekToFrame(L).pipe(we()).subscribe(()=>{})}),J(f.current))}),b.video.onEnded$.pipe(Z(d.current),Z(m)).subscribe(X=>{setTimeout(()=>{b.video.seekToFrame(L).pipe(we()).subscribe(()=>{})},1),J(d.current)})},Ge=b=>{a.removeMarker(b.id),(x==null?void 0:x.id)===b.id&&G(void 0)},Ct=(b,S)=>{if(!(S instanceof F.PeriodMarker))return;const L=S.timeObservation.start,R=S.timeObservation.end,O=b.video.getCurrentTime();if(L==null||R==null)return;const X=L,Ie=O,Dn=Ie+1/b.video.getFrameRate(),Fn=R;Ge(S);const Ye=new F.PeriodMarker({style:l.PERIOD_MARKER_STYLE,timeObservation:{start:X,end:Ie},editable:!0});Ye.onClick$.subscribe({next:()=>u(Ye)});const ye=new F.PeriodMarker({style:l.HIGHLIGHTED_PERIOD_MARKER_STYLE,timeObservation:{start:Dn,end:Fn},editable:!0});ye.onClick$.subscribe({next:()=>u(ye)}),a.addMarker(Ye),a.addMarker(ye),u(ye),setTimeout(()=>{M({marker:ye,color:l.PERIOD_MARKER_STYLE.color})},0)},Mt=()=>{const b=e.video.getCurrentTime(),S=new F.PeriodMarker({timeObservation:{start:b},style:l.PERIOD_MARKER_STYLE,editable:!0});S.onClick$.subscribe({next:()=>u(S)}),a.addMarker(S),G(S),Y(w()),u(S)},Lt=()=>{const b=e.video.getCurrentTime();x.timeObservation={...x.timeObservation,end:b},G(void 0)},At=b=>{f.current&&J(f.current),f.current=new le,d.current&&J(d.current),d.current=new le;const S=e.video.calculateTimeToFrame(b.timeObservation.start),L=e.video.calculateTimeToFrame(b.timeObservation.end);e.video.pause(),e.video.seekToFrame(S),e.video.play(),e.video.onVideoTimeChange$.pipe(Z(f.current),Z(m)).subscribe(R=>{R.frame>=L-1&&(e.video.pause().subscribe(()=>{e.video.seekToFrame(S).pipe(we()).subscribe(()=>{})}),J(f.current))}),e.video.onEnded$.pipe(Z(d.current),Z(m)).subscribe(R=>{setTimeout(()=>{e.video.seekToFrame(S).pipe(we()).subscribe(()=>{})},1),J(d.current)})},Rn=()=>{const b=i.length,S=`Segmentation ${i.length+1}`,L=new F.MarkerLane({style:l.TIMELINE_LANE_STYLE,description:S});L.onMarkerUpdate$.subscribe({next:R=>{_e(L,R.marker)&&(R.marker.timeObservation=R.oldValue.timeObservation)}}),e.timeline.addTimelineLaneAtIndex(L,b+1),o([...i,L]),u(void 0),c(L)},xt=b=>{if(!a)return;const S=a.getMarkers().filter(O=>O instanceof F.PeriodMarker).sort((O,X)=>O.timeObservation.start??0-(X.timeObservation.start??0));if(t===void 0){u(S.at(0));return}const R=S.findIndex(O=>O.id===t.id)+(b?-1:1);R>=0&&R<S.length&&u(S.at(R))};return v.useEffect(()=>{if(!r)return;const b=new $i;b.actionLoopActiveMarker=()=>t instanceof F.PeriodMarker&&ke(t)&&At(t),b.actionSetPlayheadToMarkerStart=()=>t&&bt(e,t),b.actionSetPlayheadToMarkerEnd=()=>t&&t instanceof F.PeriodMarker&&ke(t)&&wt(e,t),b.actionSetMarkerStartToPlayhead=()=>!be&&Et(e,t),b.actionSetMarkerEndToPlayhead=()=>!_&&St(e,t),b.actionMarkerSplit=()=>!N&&Ct(e,t),b.actionMarkerDelete=()=>t&&Ge(t),b.actionMarkerInOut=()=>{x===void 0?!ve&&Mt():!ne&&Lt()},b.actionPlay3SecondsAndRewindToCurrent=()=>yt(e,3),b.actionRewind3SecondsAndPlayToCurrent=()=>Tt(e,3),b.actionNextMarkerToggle=()=>xt(!1),b.actionPreviousMarkerToggle=()=>xt(!0);const S=L=>{b.handleKeyboardEvent(L,e)&&(L.stopPropagation(),L.preventDefault())};return window.addEventListener("keydown",S),h.current||(e.chroming.appendHelpMenuGroup(b.getKeyboardShortcutsHelpMenuGroup()),h.current=!0),()=>window.removeEventListener("keydown",S)}),v.createElement("div",{className:"control-panel-wrapper"},v.createElement("div",{className:"control-panel"},v.createElement(z,{Icon:_i,onClick:()=>bt(e,t),disabled:t===void 0}),v.createElement(z,{Icon:Ni,onClick:()=>wt(e,t),disabled:t===void 0||t instanceof F.PeriodMarker&&!ke(t)}),v.createElement(z,{Icon:ki,onClick:()=>Et(e,t),disabled:be}),v.createElement(z,{Icon:Ri,onClick:()=>St(e,t),disabled:_}),x===void 0?v.createElement(z,{Icon:Di,onClick:Mt,disabled:ve}):v.createElement(z,{Icon:Ki,onClick:Lt,disabled:ne}),v.createElement(z,{Icon:Vi,onClick:()=>Ge(t),disabled:t===void 0}),v.createElement(z,{Icon:Fi,onClick:()=>Ct(e,t),disabled:N||t===void 0}),v.createElement(z,{Icon:Pi,onClick:()=>At(t),disabled:!(t instanceof F.PeriodMarker&&ke(t))}),v.createElement(z,{Icon:Bi,onClick:()=>Tt(e,3)}),v.createElement(z,{Icon:Ui,onClick:()=>yt(e,3)})),v.createElement("div",{className:"control-panel"},v.createElement("div",{className:"segmentation-button-wrapper"},v.createElement(z,{Icon:Hi,text:"NEW SEGMENTATION",onClick:()=>Rn(),disabled:i.length>=3}))))};class ge{static isNullUndefinedOrWhitespace(e){return typeof e===void 0||e==null?!0:`${e}`.replace(/\s/g,"").length<1}static isNonEmpty(e){return!ge.isNullUndefinedOrWhitespace(e)}static endsWith(e,n){return!ge.isNullUndefinedOrWhitespace(e)&&!ge.isNullUndefinedOrWhitespace(n)?e.indexOf(n,e.length-n.length)!==-1:!1}static toMixedCase(e){let n={NBCU:"NBCU",REDBEE:"Red Bee",CMORE:"C More",TV2:"TV2",BBC:"BBC"};return e.replace(/_/g," ").split(" ").map(r=>r in n?n[r]:`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()}`).join(" ")}static replaceWhitespace(e,n){return e&&e.trim().replace(/([\n ]*,[\n ]*|[\n ]+)/g,n).replace(new RegExp(`${n}$`),"")}static whitespacesToCommas(e){return ge.replaceWhitespace(e,",")}static tokenizeWhitespaceSeparated(e){return e?ge.replaceWhitespace(e," ").split(" "):void 0}}class qi{constructor(e=3,n=!1){this.targetDuration=null,this.mediaSequence=null,this.programDateTime=null,this.playlistType=null,this.streams=[],this.media=[],this.segments=[],this.endList=!1,this.version=e,this.independentSegments=n}}class mt{constructor(e,n,r,i,o){this.bandwidth=e,this.averageBandwidth=n,this.resolution=r,this.frameRate=i,this.uri=o}}class Xi{constructor(e,n,r,i,o,s,u){this.type=e,this.groupId=n,this.name=r,this.isDefault=i,this.autoSelect=o,this.channels=s,this.uri=u}}class Wi{constructor(e,n){this.duration=e,this.uri=n}}class Vt{constructor(){this.playlist=new qi}setVersion(e){return this.playlist.version=e,this}setIndependentSegments(e){return this.playlist.independentSegments=e,this}setTargetDuration(e){return this.playlist.targetDuration=e,this}setMediaSequence(e){return this.playlist.mediaSequence=e,this}setProgramDateTime(e){return this.playlist.programDateTime=e,this}setPlaylistType(e){return this.playlist.playlistType=e,this}addStreamInfo(e){return this.playlist.streams.push(e),this}addMedia(e){return this.playlist.media.push(e),this}addSegment(e,n=!1){const r={...e,gap:n};return this.playlist.segments.push(r),this}setEndList(){return this.playlist.endList=!0,this}setStartOffset(e){return this.playlist.startOffset=e,this}build(){return this.playlist}}class Pt{static write(e){let n=`#EXTM3U
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`),
|
|
13
|
-
`),
|
|
14
|
-
`),
|
|
15
|
-
`),
|
|
16
|
-
`),
|
|
17
|
-
`),
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
`),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`),n}}function ji(t,e){if(!t.some(l=>{var f;return l.streamInfo||((f=l.mediaInfo)==null?void 0:f.type)==="AUDIO"}))throw new Error("Can't create an hls manifest without audio or video source");const r=new Vt().setVersion(10).setIndependentSegments(e.independentSegments);let i=t.some(({streamInfo:l,mediaInfo:f})=>l&&!f),o=!1;for(let l=0;l<t.length;l++){const{segments:f,metadata:d,streamInfo:m,mediaInfo:h}=t[l];let p=d.targetDuration;p===void 0&&(p=Math.max(...f.map(k=>k.duration),1));const w=new Vt().setVersion(d.version??3).setIndependentSegments(d.independentSegments??!0).setTargetDuration(Math.ceil(p));d.programDateTime&&w.setProgramDateTime(d.programDateTime),d.playlistType&&w.setPlaylistType(d.playlistType),f.forEach(k=>w.addSegment(k,k.uri==="http://byomakase.org/non-playable-gap")),w.setEndList();const E=w.build(),I=Pt.write(E),M=new Blob([I],{type:"application/vnd.apple.mpegurl"}),N=URL.createObjectURL(M);if(m&&!h){const k=new mt(m.bandwidth,m.averageBandwidth,m.resolution,m.frameRate,N);r.addStreamInfo(k)}else if(h){const k=new Xi(h.type,h.groupId??h.type.toLowerCase(),h.name??"",h.isDefault,h.autoSelect,h.channels,N);if(r.addMedia(k),!i&&h.type==="AUDIO"&&!o){const x=new mt((m==null?void 0:m.bandwidth)??0,(m==null?void 0:m.averageBandwidth)??0,null,null,N);r.addStreamInfo(x),o=!0}}}const s=r.build(),u=Pt.write(s),c=new Blob([u],{type:"application/vnd.apple.mpegurl"});return URL.createObjectURL(c)}function Gi(t){return t===void 0?t:t.flatMap((e,n)=>{var u;if(t.length-1===n)return[e];const r=t.at(n+1),i=B.timeMomentToSeconds(B.parseTimeRange(e.timerange).end),o=B.timeMomentToSeconds(B.parseTimeRange(r.timerange).start);if(Math.abs(i-o)<.001)return[e];const s=B.toTimeRange(B.secondsToTimeMoment(i),B.secondsToTimeMoment(o),!0,!1);return[e,{timerange:B.formatTimeRangeExpr(s),ts_offset:e.ts_offset,get_urls:(u=e.get_urls)==null?void 0:u.map(()=>"http://byomakase.org/non-playable-gap"),object_id:"non-playable-gap"}]})}function Yi(t,e,n){const r=[],i=Math.max(...[t,...e??[]].filter(c=>c.format==="urn:x-nmos:format:audio").map(c=>c.essence_parameters.channels)),o=[t,...e??[]].filter(c=>c.format==="urn:x-nmos:format:audio").find(c=>c.essence_parameters.channels===i),s=(c,a)=>{var m;if(c.format!=="urn:x-nmos:format:video"&&c.format!=="urn:x-nmos:format:audio")return;const l=((m=Gi(a))==null?void 0:m.map(h=>{var w,E;const p=B.timerangeExprDuration(h.timerange);return new Wi(p,((E=(w=h.get_urls)==null?void 0:w.at(-1))==null?void 0:E.url)??"http://byomakase.org/non-playable-gap")}))??[],f=Math.max(...l.map(h=>h.duration),1),d={playlistType:"VOD",targetDuration:Math.ceil(f),version:3,independentSegments:!0};if(c.format==="urn:x-nmos:format:video"){const p=c.essence_parameters,w={width:p.frame_width,height:p.frame_height},E=p.frame_rate?p.frame_rate.denominator?p.frame_rate.numerator/p.frame_rate.denominator:p.frame_rate.numerator:null,I=new mt(c.avg_bit_rate??0,c.avg_bit_rate??0,w,E,"");r.push({segments:l,metadata:d,streamInfo:I})}else if(c.format==="urn:x-nmos:format:audio"){const p=c.essence_parameters,w={type:"AUDIO",groupId:"audio",name:ge.isNullUndefinedOrWhitespace(c.description)?"":c.description,isDefault:(o==null?void 0:o.id)===c.id,autoSelect:!0,channels:p.channels.toString()},E={bandwidth:c.avg_bit_rate??0,averageBandwidth:c.avg_bit_rate??0,resolution:null,frameRate:null,uri:""};r.push({segments:l,metadata:d,mediaInfo:w,streamInfo:E})}};return t.format==="urn:x-nmos:format:multi"?e==null||e.forEach(c=>{const a=n==null?void 0:n.get(c.id);a!=null&&a.length&&s(c,a)}):s(t,n==null?void 0:n.get(t.id)),ji(r,{independentSegments:!0})}var Je,Bt;function Nn(){if(Bt)return Je;Bt=1;function t(c,a){this.message=c,this.error=a}t.prototype=Object.create(Error.prototype);const e=/([0-9]+)?:?([0-9]{2}):([0-9]{2}\.[0-9]{2,3})/;function n(c,a){a||(a={});const{meta:l=!1,strict:f=!0}=a;if(typeof c!="string")throw new t("Input must be a string");c=c.trim(),c=c.replace(/\r\n/g,`
|
|
25
|
-
`),c=c.replace(/\r/g,`
|
|
26
|
-
`);const
|
|
7
|
+
*/var at=9e15,Ke=1e9,Br="0123456789abcdef",$n="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Kr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-at,maxE:at,crypto:!1},hu,Ne,A=!0,Pn="[DecimalError] ",Re=Pn+"Invalid argument: ",gu=Pn+"Precision limit exceeded",vu=Pn+"crypto unavailable",bu="[object Decimal]",ce=Math.floor,ne=Math.pow,cp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,lp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ie=1e7,O=7,dp=9007199254740991,fp=$n.length-1,Jr=wn.length-1,_={toStringTag:bu};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),E(e)};_.ceil=function(){return E(new this.constructor(this),this.e+1,2)};_.clampedTo=_.clamp=function(e,t){var r,i=this,n=i.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(Re+t);return r=i.cmp(e),r<0?e:i.cmp(t)>0?t:new n(i)};_.comparedTo=_.cmp=function(e){var t,r,i,n,o=this,a=o.d,u=(e=new o.constructor(e)).d,s=o.s,c=e.s;if(!a||!u)return!s||!c?NaN:s!==c?s:a===u?0:!a^s<0?1:-1;if(!a[0]||!u[0])return a[0]?s:u[0]?-c:0;if(s!==c)return s;if(o.e!==e.e)return o.e>e.e^s<0?1:-1;for(i=a.length,n=u.length,t=0,r=i<n?i:n;t<r;++t)if(a[t]!==u[t])return a[t]>u[t]^s<0?1:-1;return i===n?0:i>n^s<0?1:-1};_.cosine=_.cos=function(){var e,t,r=this,i=r.constructor;return r.d?r.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(r.e,r.sd())+O,i.rounding=1,r=mp(i,ku(i,r)),i.precision=e,i.rounding=t,E(Ne==2||Ne==3?r.neg():r,e,t,!0)):new i(1):new i(NaN)};_.cubeRoot=_.cbrt=function(){var e,t,r,i,n,o,a,u,s,c,l=this,d=l.constructor;if(!l.isFinite()||l.isZero())return new d(l);for(A=!1,o=l.s*ne(l.s*l,1/3),!o||Math.abs(o)==1/0?(r=oe(l.d),e=l.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=ne(r,1/3),e=ce((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),i=new d(r),i.s=l.s):i=new d(o.toString()),a=(e=d.precision)+3;;)if(u=i,s=u.times(u).times(u),c=s.plus(l),i=G(c.plus(l).times(u),c.plus(s),a+2,1),oe(u.d).slice(0,a)===(r=oe(i.d)).slice(0,a))if(r=r.slice(a-3,a+1),r=="9999"||!n&&r=="4999"){if(!n&&(E(u,e+1,0),u.times(u).times(u).eq(l))){i=u;break}a+=4,n=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(E(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return A=!0,E(i,e,d.rounding,t)};_.decimalPlaces=_.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ce(this.e/O))*O,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};_.dividedBy=_.div=function(e){return G(this,new this.constructor(e))};_.dividedToIntegerBy=_.divToInt=function(e){var t=this,r=t.constructor;return E(G(t,new r(e),0,1,1),r.precision,r.rounding)};_.equals=_.eq=function(e){return this.cmp(e)===0};_.floor=function(){return E(new this.constructor(this),this.e+1,3)};_.greaterThan=_.gt=function(e){return this.cmp(e)>0};_.greaterThanOrEqualTo=_.gte=function(e){var t=this.cmp(e);return t==1||t===0};_.hyperbolicCosine=_.cosh=function(){var e,t,r,i,n,o=this,a=o.constructor,u=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return u;r=a.precision,i=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,n=o.d.length,n<32?(e=Math.ceil(n/3),t=(1/Cn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=st(a,1,o.times(t),new a(1),!0);for(var s,c=e,l=new a(8);c--;)s=o.times(o),o=u.minus(s.times(l.minus(s.times(l))));return E(o,a.precision=r,a.rounding=i,!0)};_.hyperbolicSine=_.sinh=function(){var e,t,r,i,n=this,o=n.constructor;if(!n.isFinite()||n.isZero())return new o(n);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(n.e,n.sd())+4,o.rounding=1,i=n.d.length,i<3)n=st(o,2,n,n,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,n=n.times(1/Cn(5,e)),n=st(o,2,n,n,!0);for(var a,u=new o(5),s=new o(16),c=new o(20);e--;)a=n.times(n),n=n.times(u.plus(a.times(s.times(a).plus(c))))}return o.precision=t,o.rounding=r,E(n,t,r,!0)};_.hyperbolicTangent=_.tanh=function(){var e,t,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,G(r.sinh(),r.cosh(),i.precision=e,i.rounding=t)):new i(r.s)};_.inverseCosine=_.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),i=t.precision,n=t.rounding;return r!==-1?r===0?e.isNeg()?Te(t,i,n):new t(0):new t(NaN):e.isZero()?Te(t,i+4,n).times(.5):(t.precision=i+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=i,t.rounding=n,e.times(2))};_.inverseHyperbolicCosine=_.acosh=function(){var e,t,r=this,i=r.constructor;return r.lte(1)?new i(r.eq(1)?0:NaN):r.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(r.e),r.sd())+4,i.rounding=1,A=!1,r=r.times(r).minus(1).sqrt().plus(r),A=!0,i.precision=e,i.rounding=t,r.ln()):new i(r)};_.inverseHyperbolicSine=_.asinh=function(){var e,t,r=this,i=r.constructor;return!r.isFinite()||r.isZero()?new i(r):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,i.rounding=1,A=!1,r=r.times(r).plus(1).sqrt().plus(r),A=!0,i.precision=e,i.rounding=t,r.ln())};_.inverseHyperbolicTangent=_.atanh=function(){var e,t,r,i,n=this,o=n.constructor;return n.isFinite()?n.e>=0?new o(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(e=o.precision,t=o.rounding,i=n.sd(),Math.max(i,e)<2*-n.e-1?E(new o(n),e,t,!0):(o.precision=r=i-n.e,n=G(n.plus(1),new o(1).minus(n),r+e,1),o.precision=e+4,o.rounding=1,n=n.ln(),o.precision=e,o.rounding=t,n.times(.5))):new o(NaN)};_.inverseSine=_.asin=function(){var e,t,r,i,n=this,o=n.constructor;return n.isZero()?new o(n):(t=n.abs().cmp(1),r=o.precision,i=o.rounding,t!==-1?t===0?(e=Te(o,r+4,i).times(.5),e.s=n.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,n=n.div(new o(1).minus(n.times(n)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=i,n.times(2)))};_.inverseTangent=_.atan=function(){var e,t,r,i,n,o,a,u,s,c=this,l=c.constructor,d=l.precision,f=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&d+4<=Jr)return a=Te(l,d+4,f).times(.25),a.s=c.s,a}else{if(!c.s)return new l(NaN);if(d+4<=Jr)return a=Te(l,d+4,f).times(.5),a.s=c.s,a}for(l.precision=u=d+10,l.rounding=1,r=Math.min(28,u/O+2|0),e=r;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(A=!1,t=Math.ceil(u/O),i=1,s=c.times(c),a=new l(c),n=c;e!==-1;)if(n=n.times(s),o=a.minus(n.div(i+=2)),n=n.times(s),a=o.plus(n.div(i+=2)),a.d[t]!==void 0)for(e=t;a.d[e]===o.d[e]&&e--;);return r&&(a=a.times(2<<r-1)),A=!0,E(a,l.precision=d,l.rounding=f,!0)};_.isFinite=function(){return!!this.d};_.isInteger=_.isInt=function(){return!!this.d&&ce(this.e/O)>this.d.length-2};_.isNaN=function(){return!this.s};_.isNegative=_.isNeg=function(){return this.s<0};_.isPositive=_.isPos=function(){return this.s>0};_.isZero=function(){return!!this.d&&this.d[0]===0};_.lessThan=_.lt=function(e){return this.cmp(e)<0};_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1};_.logarithm=_.log=function(e){var t,r,i,n,o,a,u,s,c=this,l=c.constructor,d=l.precision,f=l.rounding,m=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new l(r&&!r[0]?-1/0:c.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(n=r[0];n%10===0;)n/=10;o=n!==1}if(A=!1,u=d+m,a=Ze(c,u),i=t?Sn(l,u+10):Ze(e,u),s=G(a,i,u,1),It(s.d,n=d,f))do if(u+=10,a=Ze(c,u),i=t?Sn(l,u+10):Ze(e,u),s=G(a,i,u,1),!o){+oe(s.d).slice(n+1,n+15)+1==1e14&&(s=E(s,d+1,0));break}while(It(s.d,n+=10,f));return A=!0,E(s,d,f)};_.minus=_.sub=function(e){var t,r,i,n,o,a,u,s,c,l,d,f,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,f=e.d,u=g.precision,s=g.rounding,!c[0]||!f[0]){if(f[0])e.s=-e.s;else if(c[0])e=new g(m);else return new g(s===3?-0:0);return A?E(e,u,s):e}if(r=ce(e.e/O),l=ce(m.e/O),c=c.slice(),o=l-r,o){for(d=o<0,d?(t=c,o=-o,a=f.length):(t=f,r=l,a=c.length),i=Math.max(Math.ceil(u/O),a)+2,o>i&&(o=i,t.length=1),t.reverse(),i=o;i--;)t.push(0);t.reverse()}else{for(i=c.length,a=f.length,d=i<a,d&&(a=i),i=0;i<a;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}o=0}for(d&&(t=c,c=f,f=t,e.s=-e.s),a=c.length,i=f.length-a;i>0;--i)c[a++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(n=i;n&&c[--n]===0;)c[n]=Ie-1;--c[n],c[i]+=Ie}c[i]-=f[i]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=An(c,r),A?E(e,u,s):e):new g(s===3?-0:0)};_.modulo=_.mod=function(e){var t,r=this,i=r.constructor;return e=new i(e),!r.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||r.d&&!r.d[0]?E(new i(r),i.precision,i.rounding):(A=!1,i.modulo==9?(t=G(r,e.abs(),0,3,1),t.s*=e.s):t=G(r,e,0,i.modulo,1),t=t.times(e),A=!0,r.minus(t))};_.naturalExponential=_.exp=function(){return Gr(this)};_.naturalLogarithm=_.ln=function(){return Ze(this)};_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s,E(e)};_.plus=_.add=function(e){var t,r,i,n,o,a,u,s,c,l,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(c=d.d,l=e.d,u=f.precision,s=f.rounding,!c[0]||!l[0])return l[0]||(e=new f(d)),A?E(e,u,s):e;if(o=ce(d.e/O),i=ce(e.e/O),c=c.slice(),n=o-i,n){for(n<0?(r=c,n=-n,a=l.length):(r=l,i=o,a=c.length),o=Math.ceil(u/O),a=o>a?o+1:a+1,n>a&&(n=a,r.length=1),r.reverse();n--;)r.push(0);r.reverse()}for(a=c.length,n=l.length,a-n<0&&(n=a,r=l,l=c,c=r),t=0;n;)t=(c[--n]=c[n]+l[n]+t)/Ie|0,c[n]%=Ie;for(t&&(c.unshift(t),++i),a=c.length;c[--a]==0;)c.pop();return e.d=c,e.e=An(c,i),A?E(e,u,s):e};_.precision=_.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Re+e);return r.d?(t=yu(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};_.round=function(){var e=this,t=e.constructor;return E(new t(e),e.e+1,t.rounding)};_.sine=_.sin=function(){var e,t,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(e=i.precision,t=i.rounding,i.precision=e+Math.max(r.e,r.sd())+O,i.rounding=1,r=hp(i,ku(i,r)),i.precision=e,i.rounding=t,E(Ne>2?r.neg():r,e,t,!0)):new i(NaN)};_.squareRoot=_.sqrt=function(){var e,t,r,i,n,o,a=this,u=a.d,s=a.e,c=a.s,l=a.constructor;if(c!==1||!u||!u[0])return new l(!c||c<0&&(!u||u[0])?NaN:u?a:1/0);for(A=!1,c=Math.sqrt(+a),c==0||c==1/0?(t=oe(u),(t.length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=ce((s+1)/2)-(s<0||s%2),c==1/0?t="5e"+s:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+s),i=new l(t)):i=new l(c.toString()),r=(s=l.precision)+3;;)if(o=i,i=o.plus(G(a,o,r+2,1)).times(.5),oe(o.d).slice(0,r)===(t=oe(i.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!n&&t=="4999"){if(!n&&(E(o,s+1,0),o.times(o).eq(a))){i=o;break}r+=4,n=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(E(i,s+1,1),e=!i.times(i).eq(a));break}return A=!0,E(i,s,l.rounding,e)};_.tangent=_.tan=function(){var e,t,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,r=r.sin(),r.s=1,r=G(r,new i(1).minus(r.times(r)).sqrt(),e+10,0),i.precision=e,i.rounding=t,E(Ne==2||Ne==4?r.neg():r,e,t,!0)):new i(NaN)};_.times=_.mul=function(e){var t,r,i,n,o,a,u,s,c,l=this,d=l.constructor,f=l.d,m=(e=new d(e)).d;if(e.s*=l.s,!f||!f[0]||!m||!m[0])return new d(!e.s||f&&!f[0]&&!m||m&&!m[0]&&!f?NaN:!f||!m?e.s/0:e.s*0);for(r=ce(l.e/O)+ce(e.e/O),s=f.length,c=m.length,s<c&&(o=f,f=m,m=o,a=s,s=c,c=a),o=[],a=s+c,i=a;i--;)o.push(0);for(i=c;--i>=0;){for(t=0,n=s+i;n>i;)u=o[n]+m[i]*f[n-i-1]+t,o[n--]=u%Ie|0,t=u/Ie|0;o[n]=(o[n]+t)%Ie|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=An(o,r),A?E(e,d.precision,d.rounding):e};_.toBinary=function(e,t){return fi(this,2,e,t)};_.toDecimalPlaces=_.toDP=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(me(e,0,Ke),t===void 0?t=i.rounding:me(t,0,8),E(r,e+r.e+1,t))};_.toExponential=function(e,t){var r,i=this,n=i.constructor;return e===void 0?r=Ee(i,!0):(me(e,0,Ke),t===void 0?t=n.rounding:me(t,0,8),i=E(new n(i),e+1,t),r=Ee(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};_.toFixed=function(e,t){var r,i,n=this,o=n.constructor;return e===void 0?r=Ee(n):(me(e,0,Ke),t===void 0?t=o.rounding:me(t,0,8),i=E(new o(n),e+n.e+1,t),r=Ee(i,!1,e+i.e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};_.toFraction=function(e){var t,r,i,n,o,a,u,s,c,l,d,f,m=this,g=m.d,h=m.constructor;if(!g)return new h(m);if(c=r=new h(1),i=s=new h(0),t=new h(i),o=t.e=yu(g)-m.e-1,a=o%O,t.d[0]=ne(10,a<0?O+a:a),e==null)e=o>0?t:c;else{if(u=new h(e),!u.isInt()||u.lt(c))throw Error(Re+u);e=u.gt(t)?o>0?t:c:u}for(A=!1,u=new h(oe(g)),l=h.precision,h.precision=o=g.length*O*2;d=G(u,t,0,1,1),n=r.plus(d.times(i)),n.cmp(e)!=1;)r=i,i=n,n=c,c=s.plus(d.times(n)),s=n,n=t,t=u.minus(d.times(n)),u=n;return n=G(e.minus(r),i,0,1,1),s=s.plus(n.times(c)),r=r.plus(n.times(i)),s.s=c.s=m.s,f=G(c,i,o,1).minus(m).abs().cmp(G(s,r,o,1).minus(m).abs())<1?[c,i]:[s,r],h.precision=l,A=!0,f};_.toHexadecimal=_.toHex=function(e,t){return fi(this,16,e,t)};_.toNearest=function(e,t){var r=this,i=r.constructor;if(r=new i(r),e==null){if(!r.d)return r;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:me(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(A=!1,r=G(r,e,0,t,1).times(e),A=!0,E(r)):(e.s=r.s,r=e),r};_.toNumber=function(){return+this};_.toOctal=function(e,t){return fi(this,8,e,t)};_.toPower=_.pow=function(e){var t,r,i,n,o,a,u=this,s=u.constructor,c=+(e=new s(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new s(ne(+u,c));if(u=new s(u),u.eq(1))return u;if(i=s.precision,o=s.rounding,e.eq(1))return E(u,i,o);if(t=ce(e.e/O),t>=e.d.length-1&&(r=c<0?-c:c)<=dp)return n=$u(s,u,r,i),e.s<0?new s(1).div(n):E(n,i,o);if(a=u.s,a<0){if(t<e.d.length-1)return new s(NaN);if((e.d[t]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return r=ne(+u,c),t=r==0||!isFinite(r)?ce(c*(Math.log("0."+oe(u.d))/Math.LN10+u.e+1)):new s(r+"").e,t>s.maxE+1||t<s.minE-1?new s(t>0?a/0:0):(A=!1,s.rounding=u.s=1,r=Math.min(12,(t+"").length),n=Gr(e.times(Ze(u,i+r)),i),n.d&&(n=E(n,i+5,1),It(n.d,i,o)&&(t=i+10,n=E(Gr(e.times(Ze(u,t+r)),t),t+5,1),+oe(n.d).slice(i+1,i+15)+1==1e14&&(n=E(n,i+1,0)))),n.s=a,A=!0,s.rounding=o,E(n,i,o))};_.toPrecision=function(e,t){var r,i=this,n=i.constructor;return e===void 0?r=Ee(i,i.e<=n.toExpNeg||i.e>=n.toExpPos):(me(e,1,Ke),t===void 0?t=n.rounding:me(t,0,8),i=E(new n(i),e,t),r=Ee(i,e<=i.e||i.e<=n.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+r:r};_.toSignificantDigits=_.toSD=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(me(e,1,Ke),t===void 0?t=i.rounding:me(t,0,8)),E(new i(r),e,t)};_.toString=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};_.truncated=_.trunc=function(){return E(new this.constructor(this),this.e+1,1)};_.valueOf=_.toJSON=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function oe(e){var t,r,i,n=e.length-1,o="",a=e[0];if(n>0){for(o+=a,t=1;t<n;t++)i=e[t]+"",r=O-i.length,r&&(o+=Le(r)),o+=i;a=e[t],i=a+"",r=O-i.length,r&&(o+=Le(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}function me(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Re+e)}function It(e,t,r,i){var n,o,a,u;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=O,n=0):(n=Math.ceil((t+1)/O),t%=O),o=ne(10,O-t),u=e[n]%o|0,i==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),a=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):a=(r<4&&u+1==o||r>3&&u+1==o/2)&&(e[n+1]/o/100|0)==ne(10,t-2)-1||(u==o/2||u==0)&&(e[n+1]/o/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),a=(i||r<4)&&u==9999||!i&&r>3&&u==4999):a=((i||r<4)&&u+1==o||!i&&r>3&&u+1==o/2)&&(e[n+1]/o/1e3|0)==ne(10,t-3)-1,a}function gn(e,t,r){for(var i,n=[0],o,a=0,u=e.length;a<u;){for(o=n.length;o--;)n[o]*=t;for(n[0]+=Br.indexOf(e.charAt(a++)),i=0;i<n.length;i++)n[i]>r-1&&(n[i+1]===void 0&&(n[i+1]=0),n[i+1]+=n[i]/r|0,n[i]%=r)}return n.reverse()}function mp(e,t){var r,i,n;if(t.isZero())return t;i=t.d.length,i<32?(r=Math.ceil(i/3),n=(1/Cn(4,r)).toString()):(r=16,n="2.3283064365386962890625e-10"),e.precision+=r,t=st(e,1,t.times(n),new e(1));for(var o=r;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}var G=(function(){function e(i,n,o){var a,u=0,s=i.length;for(i=i.slice();s--;)a=i[s]*n+u,i[s]=a%o|0,u=a/o|0;return u&&i.unshift(u),i}function t(i,n,o,a){var u,s;if(o!=a)s=o>a?1:-1;else for(u=s=0;u<o;u++)if(i[u]!=n[u]){s=i[u]>n[u]?1:-1;break}return s}function r(i,n,o,a){for(var u=0;o--;)i[o]-=u,u=i[o]<n[o]?1:0,i[o]=u*a+i[o]-n[o];for(;!i[0]&&i.length>1;)i.shift()}return function(i,n,o,a,u,s){var c,l,d,f,m,g,h,v,w,T,z,L,F,j,ee,te,Y,Ce,ie,Ue,De=i.constructor,rt=i.s==n.s?1:-1,Q=i.d,V=n.d;if(!Q||!Q[0]||!V||!V[0])return new De(!i.s||!n.s||(Q?V&&Q[0]==V[0]:!V)?NaN:Q&&Q[0]==0||!V?rt*0:rt/0);for(s?(m=1,l=i.e-n.e):(s=Ie,m=O,l=ce(i.e/m)-ce(n.e/m)),ie=V.length,Y=Q.length,w=new De(rt),T=w.d=[],d=0;V[d]==(Q[d]||0);d++);if(V[d]>(Q[d]||0)&&l--,o==null?(j=o=De.precision,a=De.rounding):u?j=o+(i.e-n.e)+1:j=o,j<0)T.push(1),g=!0;else{if(j=j/m+2|0,d=0,ie==1){for(f=0,V=V[0],j++;(d<Y||f)&&j--;d++)ee=f*s+(Q[d]||0),T[d]=ee/V|0,f=ee%V|0;g=f||d<Y}else{for(f=s/(V[0]+1)|0,f>1&&(V=e(V,f,s),Q=e(Q,f,s),ie=V.length,Y=Q.length),te=ie,z=Q.slice(0,ie),L=z.length;L<ie;)z[L++]=0;Ue=V.slice(),Ue.unshift(0),Ce=V[0],V[1]>=s/2&&++Ce;do f=0,c=t(V,z,ie,L),c<0?(F=z[0],ie!=L&&(F=F*s+(z[1]||0)),f=F/Ce|0,f>1?(f>=s&&(f=s-1),h=e(V,f,s),v=h.length,L=z.length,c=t(h,z,v,L),c==1&&(f--,r(h,ie<v?Ue:V,v,s))):(f==0&&(c=f=1),h=V.slice()),v=h.length,v<L&&h.unshift(0),r(z,h,L,s),c==-1&&(L=z.length,c=t(V,z,ie,L),c<1&&(f++,r(z,ie<L?Ue:V,L,s))),L=z.length):c===0&&(f++,z=[0]),T[d++]=f,c&&z[0]?z[L++]=Q[te]||0:(z=[Q[te]],L=1);while((te++<Y||z[0]!==void 0)&&j--);g=z[0]!==void 0}T[0]||T.shift()}if(m==1)w.e=l,hu=g;else{for(d=1,f=T[0];f>=10;f/=10)d++;w.e=d+l*m-1,E(w,u?o+w.e+1:o,a,g)}return w}})();function E(e,t,r,i){var n,o,a,u,s,c,l,d,f,m=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(n=1,u=d[0];u>=10;u/=10)n++;if(o=t-n,o<0)o+=O,a=t,l=d[f=0],s=l/ne(10,n-a-1)%10|0;else if(f=Math.ceil((o+1)/O),u=d.length,f>=u)if(i){for(;u++<=f;)d.push(0);l=s=0,n=1,o%=O,a=o-O+1}else break e;else{for(l=u=d[f],n=1;u>=10;u/=10)n++;o%=O,a=o-O+n,s=a<0?0:l/ne(10,n-a-1)%10|0}if(i=i||t<0||d[f+1]!==void 0||(a<0?l:l%ne(10,n-a-1)),c=r<4?(s||i)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||i||r==6&&(o>0?a>0?l/ne(10,n-a):0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=ne(10,(O-t%O)%O),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=f,u=1,f--):(d.length=f+1,u=ne(10,O-o),d[f]=a>0?(l/ne(10,n-a)%ne(10,a)|0)*u:0),c)for(;;)if(f==0){for(o=1,a=d[0];a>=10;a/=10)o++;for(a=d[0]+=u,u=1;a>=10;a/=10)u++;o!=u&&(e.e++,d[0]==Ie&&(d[0]=1));break}else{if(d[f]+=u,d[f]!=Ie)break;d[f--]=0,u=1}for(o=d.length;d[--o]===0;)d.pop()}return A&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function Ee(e,t,r){if(!e.isFinite())return Su(e);var i,n=e.e,o=oe(e.d),a=o.length;return t?(r&&(i=r-a)>0?o=o.charAt(0)+"."+o.slice(1)+Le(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):n<0?(o="0."+Le(-n-1)+o,r&&(i=r-a)>0&&(o+=Le(i))):n>=a?(o+=Le(n+1-a),r&&(i=r-n-1)>0&&(o=o+"."+Le(i))):((i=n+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),r&&(i=r-a)>0&&(n+1===a&&(o+="."),o+=Le(i))),o}function An(e,t){var r=e[0];for(t*=O;r>=10;r/=10)t++;return t}function Sn(e,t,r){if(t>fp)throw A=!0,r&&(e.precision=r),Error(gu);return E(new e($n),t,1,!0)}function Te(e,t,r){if(t>Jr)throw Error(gu);return E(new e(wn),t,r,!0)}function yu(e){var t=e.length-1,r=t*O+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Le(e){for(var t="";e--;)t+="0";return t}function $u(e,t,r,i){var n,o=new e(1),a=Math.ceil(i/O+4);for(A=!1;;){if(r%2&&(o=o.times(t),Sa(o.d,a)&&(n=!0)),r=ce(r/2),r===0){r=o.d.length-1,n&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Sa(t.d,a)}return A=!0,o}function wa(e){return e.d[e.d.length-1]&1}function wu(e,t,r){for(var i,n,o=new e(t[0]),a=0;++a<t.length;){if(n=new e(t[a]),!n.s){o=n;break}i=o.cmp(n),(i===r||i===0&&o.s===r)&&(o=n)}return o}function Gr(e,t){var r,i,n,o,a,u,s,c=0,l=0,d=0,f=e.constructor,m=f.rounding,g=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(A=!1,s=g):s=t,u=new f(.03125);e.e>-2;)e=e.times(u),d+=5;for(i=Math.log(ne(2,d))/Math.LN10*2+5|0,s+=i,r=o=a=new f(1),f.precision=s;;){if(o=E(o.times(e),s,1),r=r.times(++l),u=a.plus(G(o,r,s,1)),oe(u.d).slice(0,s)===oe(a.d).slice(0,s)){for(n=d;n--;)a=E(a.times(a),s,1);if(t==null)if(c<3&&It(a.d,s-i,m,c))f.precision=s+=10,r=o=u=new f(1),l=0,c++;else return E(a,f.precision=g,m,A=!0);else return f.precision=g,a}a=u}}function Ze(e,t){var r,i,n,o,a,u,s,c,l,d,f,m=1,g=10,h=e,v=h.d,w=h.constructor,T=w.rounding,z=w.precision;if(h.s<0||!v||!v[0]||!h.e&&v[0]==1&&v.length==1)return new w(v&&!v[0]?-1/0:h.s!=1?NaN:v?0:h);if(t==null?(A=!1,l=z):l=t,w.precision=l+=g,r=oe(v),i=r.charAt(0),Math.abs(o=h.e)<15e14){for(;i<7&&i!=1||i==1&&r.charAt(1)>3;)h=h.times(e),r=oe(h.d),i=r.charAt(0),m++;o=h.e,i>1?(h=new w("0."+r),o++):h=new w(i+"."+r.slice(1))}else return c=Sn(w,l+2,z).times(o+""),h=Ze(new w(i+"."+r.slice(1)),l-g).plus(c),w.precision=z,t==null?E(h,z,T,A=!0):h;for(d=h,s=a=h=G(h.minus(1),h.plus(1),l,1),f=E(h.times(h),l,1),n=3;;){if(a=E(a.times(f),l,1),c=s.plus(G(a,new w(n),l,1)),oe(c.d).slice(0,l)===oe(s.d).slice(0,l))if(s=s.times(2),o!==0&&(s=s.plus(Sn(w,l+2,z).times(o+""))),s=G(s,new w(m),l,1),t==null)if(It(s.d,l-g,T,u))w.precision=l+=g,c=a=h=G(d.minus(1),d.plus(1),l,1),f=E(h.times(h),l,1),n=u=1;else return E(s,w.precision=z,T,A=!0);else return w.precision=z,s;s=c,n+=2}}function Su(e){return String(e.s*e.s/0)}function vn(e,t){var r,i,n;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(r<0&&(r=i),r+=+t.slice(i+1),t=t.substring(0,i)):r<0&&(r=t.length),i=0;t.charCodeAt(i)===48;i++);for(n=t.length;t.charCodeAt(n-1)===48;--n);if(t=t.slice(i,n),t){if(n-=i,e.e=r=r-i-1,e.d=[],i=(r+1)%O,r<0&&(i+=O),i<n){for(i&&e.d.push(+t.slice(0,i)),n-=O;i<n;)e.d.push(+t.slice(i,i+=O));t=t.slice(i),i=O-t.length}else i-=n;for(;i--;)t+="0";e.d.push(+t),A&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function pp(e,t){var r,i,n,o,a,u,s,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),_u.test(t))return vn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(sp.test(t))r=16,t=t.toLowerCase();else if(cp.test(t))r=2;else if(lp.test(t))r=8;else throw Error(Re+t);for(o=t.search(/p/i),o>0?(s=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),a=o>=0,i=e.constructor,a&&(t=t.replace(".",""),u=t.length,o=u-o,n=$u(i,new i(r),o,o*2)),c=gn(t,r,Ie),l=c.length-1,o=l;c[o]===0;--o)c.pop();return o<0?new i(e.s*0):(e.e=An(c,l),e.d=c,A=!1,a&&(e=G(e,n,u*4)),s&&(e=e.times(Math.abs(s)<54?ne(2,s):Dt.pow(2,s))),A=!0,e)}function hp(e,t){var r,i=t.d.length;if(i<3)return t.isZero()?t:st(e,2,t,t);r=1.4*Math.sqrt(i),r=r>16?16:r|0,t=t.times(1/Cn(5,r)),t=st(e,2,t,t);for(var n,o=new e(5),a=new e(16),u=new e(20);r--;)n=t.times(t),t=t.times(o.plus(n.times(a.times(n).minus(u))));return t}function st(e,t,r,i,n){var o,a,u,s,c=e.precision,l=Math.ceil(c/O);for(A=!1,s=r.times(r),u=new e(i);;){if(a=G(u.times(s),new e(t++*t++),c,1),u=n?i.plus(a):i.minus(a),i=G(a.times(s),new e(t++*t++),c,1),a=u.plus(i),a.d[l]!==void 0){for(o=l;a.d[o]===u.d[o]&&o--;);if(o==-1)break}o=u,u=i,i=a,a=o}return A=!0,a.d.length=l+1,a}function Cn(e,t){for(var r=e;--t;)r*=e;return r}function ku(e,t){var r,i=t.s<0,n=Te(e,e.precision,1),o=n.times(.5);if(t=t.abs(),t.lte(o))return Ne=i?4:1,t;if(r=t.divToInt(n),r.isZero())Ne=i?3:2;else{if(t=t.minus(r.times(n)),t.lte(o))return Ne=wa(r)?i?2:3:i?4:1,t;Ne=wa(r)?i?1:4:i?3:2}return t.minus(n).abs()}function fi(e,t,r,i){var n,o,a,u,s,c,l,d,f,m=e.constructor,g=r!==void 0;if(g?(me(r,1,Ke),i===void 0?i=m.rounding:me(i,0,8)):(r=m.precision,i=m.rounding),!e.isFinite())l=Su(e);else{for(l=Ee(e),a=l.indexOf("."),g?(n=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):n=t,a>=0&&(l=l.replace(".",""),f=new m(1),f.e=l.length-a,f.d=gn(Ee(f),10,n),f.e=f.d.length),d=gn(l,10,n),o=s=d.length;d[--s]==0;)d.pop();if(!d[0])l=g?"0p+0":"0";else{if(a<0?o--:(e=new m(e),e.d=d,e.e=o,e=G(e,f,r,i,0,n),d=e.d,o=e.e,c=hu),a=d[r],u=n/2,c=c||d[r+1]!==void 0,c=i<4?(a!==void 0||c)&&(i===0||i===(e.s<0?3:2)):a>u||a===u&&(i===4||c||i===6&&d[r-1]&1||i===(e.s<0?8:7)),d.length=r,c)for(;++d[--r]>n-1;)d[r]=0,r||(++o,d.unshift(1));for(s=d.length;!d[s-1];--s);for(a=0,l="";a<s;a++)l+=Br.charAt(d[a]);if(g){if(s>1)if(t==16||t==8){for(a=t==16?4:3,--s;s%a;s++)l+="0";for(d=gn(l,n,t),s=d.length;!d[s-1];--s);for(a=1,l="1.";a<s;a++)l+=Br.charAt(d[a])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>s)for(o-=s;o--;)l+="0";else o<s&&(l=l.slice(0,o)+"."+l.slice(o))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function Sa(e,t){if(e.length>t)return e.length=t,!0}function gp(e){return new this(e).abs()}function vp(e){return new this(e).acos()}function bp(e){return new this(e).acosh()}function _p(e,t){return new this(e).plus(t)}function yp(e){return new this(e).asin()}function $p(e){return new this(e).asinh()}function wp(e){return new this(e).atan()}function Sp(e){return new this(e).atanh()}function kp(e,t){e=new this(e),t=new this(t);var r,i=this.precision,n=this.rounding,o=i+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Te(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Te(this,i,n):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Te(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(G(e,t,o,1)),t=Te(this,o,1),this.precision=i,this.rounding=n,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(G(e,t,o,1)),r}function Ip(e){return new this(e).cbrt()}function xp(e){return E(e=new this(e),e.e+1,2)}function Tp(e,t,r){return new this(e).clamp(t,r)}function zp(e){if(!e||typeof e!="object")throw Error(Pn+"Object expected");var t,r,i,n=e.defaults===!0,o=["precision",1,Ke,"rounding",0,8,"toExpNeg",-at,0,"toExpPos",0,at,"maxE",0,at,"minE",-at,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],n&&(this[r]=Kr[r]),(i=e[r])!==void 0)if(ce(i)===i&&i>=o[t+1]&&i<=o[t+2])this[r]=i;else throw Error(Re+r+": "+i);if(r="crypto",n&&(this[r]=Kr[r]),(i=e[r])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(vu);else this[r]=!1;else throw Error(Re+r+": "+i);return this}function Ep(e){return new this(e).cos()}function Op(e){return new this(e).cosh()}function Iu(e){var t,r,i;function n(o){var a,u,s,c=this;if(!(c instanceof n))return new n(o);if(c.constructor=n,ka(o)){c.s=o.s,A?!o.d||o.e>n.maxE?(c.e=NaN,c.d=null):o.e<n.minE?(c.e=0,c.d=[0]):(c.e=o.e,c.d=o.d.slice()):(c.e=o.e,c.d=o.d?o.d.slice():o.d);return}if(s=typeof o,s==="number"){if(o===0){c.s=1/o<0?-1:1,c.e=0,c.d=[0];return}if(o<0?(o=-o,c.s=-1):c.s=1,o===~~o&&o<1e7){for(a=0,u=o;u>=10;u/=10)a++;A?a>n.maxE?(c.e=NaN,c.d=null):a<n.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[o]):(c.e=a,c.d=[o]);return}if(o*0!==0){o||(c.s=NaN),c.e=NaN,c.d=null;return}return vn(c,o.toString())}if(s==="string")return(u=o.charCodeAt(0))===45?(o=o.slice(1),c.s=-1):(u===43&&(o=o.slice(1)),c.s=1),_u.test(o)?vn(c,o):pp(c,o);if(s==="bigint")return o<0?(o=-o,c.s=-1):c.s=1,vn(c,o.toString());throw Error(Re+o)}if(n.prototype=_,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=zp,n.clone=Iu,n.isDecimal=ka,n.abs=gp,n.acos=vp,n.acosh=bp,n.add=_p,n.asin=yp,n.asinh=$p,n.atan=wp,n.atanh=Sp,n.atan2=kp,n.cbrt=Ip,n.ceil=xp,n.clamp=Tp,n.cos=Ep,n.cosh=Op,n.div=Up,n.exp=Dp,n.floor=Np,n.hypot=jp,n.ln=Pp,n.log=Ap,n.log10=Lp,n.log2=Cp,n.max=Zp,n.min=Mp,n.mod=Rp,n.mul=Fp,n.pow=Vp,n.random=Bp,n.round=Kp,n.sign=Jp,n.sin=Gp,n.sinh=Wp,n.sqrt=Hp,n.sub=qp,n.sum=Xp,n.tan=Yp,n.tanh=Qp,n.trunc=eh,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(r=i[t++])||(e[r]=this[r]);return n.config(e),n}function Up(e,t){return new this(e).div(t)}function Dp(e){return new this(e).exp()}function Np(e){return E(e=new this(e),e.e+1,3)}function jp(){var e,t,r=new this(0);for(A=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return A=!0,new this(1/0);r=t}return A=!0,r.sqrt()}function ka(e){return e instanceof Dt||e&&e.toStringTag===bu||!1}function Pp(e){return new this(e).ln()}function Ap(e,t){return new this(e).log(t)}function Cp(e){return new this(e).log(2)}function Lp(e){return new this(e).log(10)}function Zp(){return wu(this,arguments,-1)}function Mp(){return wu(this,arguments,1)}function Rp(e,t){return new this(e).mod(t)}function Fp(e,t){return new this(e).mul(t)}function Vp(e,t){return new this(e).pow(t)}function Bp(e){var t,r,i,n,o=0,a=new this(1),u=[];if(e===void 0?e=this.precision:me(e,1,Ke),i=Math.ceil(e/O),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));o<i;)n=t[o],n>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=n%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);o<i;)n=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),n>=214e7?crypto.randomBytes(4).copy(t,o):(u.push(n%1e7),o+=4);o=i/4}else throw Error(vu);else for(;o<i;)u[o++]=Math.random()*1e7|0;for(i=u[--o],e%=O,i&&e&&(n=ne(10,O-e),u[o]=(i/n|0)*n);u[o]===0;o--)u.pop();if(o<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=O)u.shift();for(i=1,n=u[0];n>=10;n/=10)i++;i<O&&(r-=O-i)}return a.e=r,a.d=u,a}function Kp(e){return E(e=new this(e),e.e+1,this.rounding)}function Jp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Gp(e){return new this(e).sin()}function Wp(e){return new this(e).sinh()}function Hp(e){return new this(e).sqrt()}function qp(e,t){return new this(e).sub(t)}function Xp(){var e=0,t=arguments,r=new this(t[e]);for(A=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return A=!0,E(r,this.precision,this.rounding)}function Yp(e){return new this(e).tan()}function Qp(e){return new this(e).tanh()}function eh(e){return E(e=new this(e),e.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString;_[Symbol.toStringTag]="Decimal";var Dt=_.constructor=Iu(Kr);$n=new Dt($n);wn=new Dt(wn);class xe{static formatToTimecode(t,r,i=!1,n=!1){let o=new Dt(r),a,u=o.round();a=o.mul(t).floor();let s,c,l,d,f=u.mul(86400),m=a.mod(f),g=u.mul(3600),h=u.mul(60);return d=m.divToInt(g),m=m.minus(d.mul(g)),l=m.divToInt(h),m=m.minus(l.mul(h)),c=m.divToInt(u),s=m.minus(c.mul(u)),xe.formatTimecodeText(d.toNumber(),l.toNumber(),c.toNumber(),s.toNumber(),i,n)}static formatTimecodeText(t,r,i,n,o=!1,a=!1){let u=a?".":o?";":":";return`${xe.padZero(t)}:${xe.padZero(r)}:${xe.padZero(i)}${u}${xe.padZero(n)}`}static padZero(t){return t<10?`0${t}`:`${t}`}}class th{static resolveFrameRateValueFromFraction(t){return 30}}const Se=class Se{static parseTimeMoment(t){const[r,i]=t.split(":").map(Number);return[r,i]}static parseTimeRange(t){const r=t.match(this.timeRangePattern);if(!r)throw new Error("Not valid timerange: "+t);const i=r[1]==="[",n=r[5]==="]",o=r[2]?this.parseTimeMoment(r[2]):void 0,a=r[4]?this.parseTimeMoment(r[4]):void 0;return{start:o,end:a,isStartInclusive:i,isEndInclusive:n}}static timeMomentToSeconds(t){return Se.timeMomentToMilliseconds(t)/1e3}static timeMomentToMilliseconds(t){return t[0]*1e3+t[1]/1e6}static timeMomentToDate(t){const i=t[0]*1e3+t[1]/1e6;return new Date(i)}static formatTimeMomentToTimecodeText(t,r,i=!1){let n=th.resolveFrameRateValueFromFraction(r);return xe.formatToTimecode(Se.timeMomentToSeconds(t),n,i)}static formatTimerangeToTimecodeText(t,r,i=!1){let n=Se.parseTimeRange(t),o=n.start?Se.formatTimeMomentToTimecodeText(n.start,r,i):"?",a=n.end?Se.formatTimeMomentToTimecodeText(n.end,r,i):"?";return`${o} - ${a}`}static nanosecondsToSeconds(t){return t/1e9}static nanosecondsToTimeMoment(t){const r=Math.floor(t/1e9),i=Math.ceil(t%1e9);return[r,i]}static secondsToTimeMoment(t){return this.nanosecondsToTimeMoment(t*1e9)}static timerangeExprDuration(t){return this.timeRangeDuration(this.parseTimeRange(t))}static timeRangeDuration(t){const{start:r,end:i}=t;if(r===void 0||i===void 0)return 0;{const n=i[0]-r[0],o=i[1]-r[1],a=n+o/1e9;return parseFloat(a.toFixed(3))}}static formatTimeMomentExpr(t){return`${t[0]}:${t[1]}`}static formatNanosecondsToTimeMomentExpr(t){return this.formatTimeMomentExpr(this.nanosecondsToTimeMoment(t))}static toTimeRange(t,r,i=!0,n=!0){return{start:t,end:r,isStartInclusive:i,isEndInclusive:n}}static formatTimeRangeExpr(t){const r=t.isStartInclusive?"[":"(",i=t.isEndInclusive?"]":")",n=t.start?`${t.start[0]}:${t.start[1]}`:"",o=t.end?`${t.end[0]}:${t.end[1]}`:"";return`${r}${n}_${o}${i}`}static timerangeDuration(t){let r=Se.parseTimeRange(t);if(r.start===void 0||r.end===void 0)return 1/0;{let i=Se.timeMomentToSeconds(r.start);return Se.timeMomentToSeconds(r.end)-i}}static padZero(t){return t<10?`0${t}`:`${t}`}};Se.timeRangePattern=/^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$/;let N=Se;function nh(e){return`subtitles-${e}`}function rh(e,t,r){const i=e.filter(f=>t.get(f.id).length>0).map(f=>{const m=t.get(f.id);let g,h=!1;if(f.format==="urn:x-nmos:format:video"){const v=f.essence_parameters.frame_rate;v&&(g=v.numerator/(v.denominator??1),(v.numerator===6e4||v.numerator===3e4)&&v.denominator===1001&&(h=!0))}return{start:N.timeMomentToSeconds(N.parseTimeRange(m.at(0).timerange).start),frameRate:g,dropFrame:h}}).sort((f,m)=>f.start-m.start),n=i.find(f=>f.frameRate!==void 0),o=(n==null?void 0:n.start)??i.at(0).start,a=new Date(o*1e3),u=Math.max(a.getUTCHours()+(r??0),0),s=a.getUTCMinutes(),c=a.getUTCSeconds(),l=a.getUTCMilliseconds(),d=u*3600+s*60+c+l/1e3;return n===void 0?{ffom:xe.formatToTimecode(d,100,!1,!0),mediaStartTime:o,frameRate:100,dropFrame:!1}:{ffom:xe.formatToTimecode(d,n.frameRate,n.dropFrame),mediaStartTime:n.start,frameRate:n.frameRate,dropFrame:n.dropFrame}}function xu(e){var t;return((t=e.tags)==null?void 0:t.hls_name)??e.description??""}function Tu(e){var t;return((t=e.tags)==null?void 0:t.hls_name)??e.description??""}class ih{constructor(t=3,r=!1){this.targetDuration=null,this.mediaSequence=null,this.programDateTime=null,this.playlistType=null,this.streams=[],this.media=[],this.segments=[],this.endList=!1,this.version=t,this.independentSegments=r}}class Wr{constructor(t,r,i,n,o){this.bandwidth=t,this.averageBandwidth=r,this.resolution=i,this.frameRate=n,this.uri=o}}class oh{constructor(t,r,i,n,o,a,u){this.type=t,this.groupId=r,this.name=i,this.isDefault=n,this.autoSelect=o,this.channels=a,this.uri=u}}class Ia{constructor(t,r){this.duration=t,this.uri=r}}class xa{constructor(){this.playlist=new ih}setVersion(t){return this.playlist.version=t,this}setIndependentSegments(t){return this.playlist.independentSegments=t,this}setTargetDuration(t){return this.playlist.targetDuration=t,this}setMediaSequence(t){return this.playlist.mediaSequence=t,this}setProgramDateTime(t){return this.playlist.programDateTime=t,this}setPlaylistType(t){return this.playlist.playlistType=t,this}addStreamInfo(t){return this.playlist.streams.push(t),this}addMedia(t){return this.playlist.media.push(t),this}addSegment(t,r=!1){const i={...t,gap:r};return this.playlist.segments.push(i),this}setEndList(){return this.playlist.endList=!0,this}setStartOffset(t){return this.playlist.startOffset=t,this}build(){return this.playlist}}class Ta{static write(t){let r=`#EXTM3U
|
|
8
|
+
`;return r+=`#EXT-X-VERSION:${t.version}
|
|
9
|
+
`,t.independentSegments&&(r+=`#EXT-X-INDEPENDENT-SEGMENTS
|
|
10
|
+
`),t.targetDuration!==null&&(r+=`#EXT-X-TARGETDURATION:${t.targetDuration}
|
|
11
|
+
`),t.mediaSequence!==null&&(r+=`#EXT-X-MEDIA-SEQUENCE:${t.mediaSequence}
|
|
12
|
+
`),t.programDateTime&&(r+=`#EXT-X-PROGRAM-DATE-TIME:${t.programDateTime}
|
|
13
|
+
`),t.playlistType&&(r+=`#EXT-X-PLAYLIST-TYPE:${t.playlistType}
|
|
14
|
+
`),t.startOffset!==void 0&&(r+=`#EXT-X-START:TIME-OFFSET=${t.startOffset}
|
|
15
|
+
`),t.streams.forEach(i=>{r+=`#EXT-X-STREAM-INF:BANDWIDTH=${i.bandwidth},AVERAGE-BANDWIDTH=${i.averageBandwidth}`,i.resolution&&(r+=`,RESOLUTION=${i.resolution.width}x${i.resolution.height}`),i.frameRate&&(r+=`,FRAME-RATE=${i.frameRate}`),i.uri&&(r+=`
|
|
16
|
+
${i.uri}`),r+=`
|
|
17
|
+
`}),t.media.forEach(i=>{r+=`#EXT-X-MEDIA:TYPE=${i.type},GROUP-ID="${i.groupId}",NAME="${i.name}",DEFAULT=${i.isDefault?"YES":"NO"},AUTOSELECT=${i.autoSelect?"YES":"NO"}`,i.channels&&(r+=`,CHANNELS="${i.channels}"`),r+=`,URI="${i.uri}"
|
|
18
|
+
`}),t.segments.forEach(i=>{i.gap&&(r+=`#EXT-X-GAP
|
|
19
|
+
`),r+=`#EXTINF:${i.duration},
|
|
20
|
+
${i.uri}
|
|
21
|
+
`}),t.endList&&(r+=`#EXT-X-ENDLIST
|
|
22
|
+
`),r}}function ah(e,t){const r=new Map,i=new Map,n=new Map;if(!e.some(m=>{var g;return m.streamInfo||((g=m.mediaInfo)==null?void 0:g.type)==="AUDIO"}))throw new Error("Can't create an hls manifest without audio or video source");const a=new xa().setVersion(10).setIndependentSegments(t.independentSegments);let u=e.some(({streamInfo:m,mediaInfo:g})=>m&&!g),s=!1;for(let m=0;m<e.length;m++){const{segments:g,metadata:h,streamInfo:v,mediaInfo:w,id:T}=e[m];let z=h.targetDuration;z===void 0&&(z=Math.max(...g.map(Y=>Y.duration),1));const L=new xa().setVersion(h.version??3).setIndependentSegments(h.independentSegments??!0).setTargetDuration(Math.ceil(z));h.programDateTime&&L.setProgramDateTime(h.programDateTime),h.playlistType&&L.setPlaylistType(h.playlistType),g.forEach(Y=>L.addSegment(Y,Y.uri==="http://byomakase.org/non-playable-gap")),L.setEndList();const F=L.build(),j=Ta.write(F),ee=new Blob([j],{type:"application/vnd.apple.mpegurl"}),te=URL.createObjectURL(ee);if(v&&!w){const Y=new Wr(v.bandwidth,v.averageBandwidth,v.resolution,v.frameRate,te);r.set(T??(r.size+1).toString(),te),a.addStreamInfo(Y)}else if(w){const Y=new oh(w.type,w.groupId??w.type.toLowerCase(),w.name??"",w.isDefault,w.autoSelect,w.channels,te);if(w.type==="AUDIO"?i.set(T??w.name??(i.size+1).toString(),te):w.type!=="VIDEO"&&n.set(T??w.name??(n.size+1).toString(),te),a.addMedia(Y),!u&&w.type==="AUDIO"&&!s){const Ce=new Wr((v==null?void 0:v.bandwidth)??0,(v==null?void 0:v.averageBandwidth)??0,null,null,te);a.addStreamInfo(Ce),s=!0}}}const c=a.build(),l=Ta.write(c),d=new Blob([l],{type:"application/vnd.apple.mpegurl"});return{url:URL.createObjectURL(d),video:r,audio:i,text:n}}function zu(e){return e===void 0?e:e.flatMap((t,r)=>{var u;if(e.length-1===r)return[t];const i=e.at(r+1),n=N.timeMomentToSeconds(N.parseTimeRange(t.timerange).end),o=N.timeMomentToSeconds(N.parseTimeRange(i.timerange).start);if(Math.abs(n-o)<.001)return[t];const a=N.toTimeRange(N.secondsToTimeMoment(n),N.secondsToTimeMoment(o),!0,!1);return[t,{timerange:N.formatTimeRangeExpr(a),ts_offset:t.ts_offset,get_urls:(u=t.get_urls)==null?void 0:u.map(()=>"http://byomakase.org/non-playable-gap"),object_id:"non-playable-gap"}]})}function Eu(e){return e&&e.map((t,r)=>{if(e.length-1===r)return t;const i=e.at(r+1),n=N.timeMomentToSeconds(N.parseTimeRange(t.timerange).start),o=N.timeMomentToSeconds(N.parseTimeRange(i.timerange).start),a=N.toTimeRange(N.secondsToTimeMoment(n),N.secondsToTimeMoment(o),!0,!1);return{...t,timerange:N.formatTimeRangeExpr(a)}})}function za(e){return{width:e.frame_width,height:e.frame_height}}function Ea(e){return e.frame_rate?e.frame_rate.denominator?e.frame_rate.numerator/e.frame_rate.denominator:e.frame_rate.numerator:null}function uh(e){return e.reduce((t,r)=>(t.averageBitRate+=r.avg_bit_rate??0,t.maxBitRate+=r.max_bit_rate??0,t),{averageBitRate:0,maxBitRate:0})}function Ou(e,t,r){var i;if(e.format==="urn:x-nmos:format:multi"&&e.container){const n=(t==null?void 0:t.filter(a=>a.format==="urn:x-nmos:format:multi"&&a.container).length)??!1,o=((i=r==null?void 0:r.get(e.id))==null?void 0:i.length)??!1;if(n)return{valid:!1,message:"Muxed flow has a muxed child flow as well"};if(!o)return{valid:!1,message:"Muxed flow has no muxed segments"}}if(e.format==="urn:x-nmos:format:multi"&&!e.container){const n=(t==null?void 0:t.filter(s=>s.format==="urn:x-nmos:format:video"))??[],o=(t==null?void 0:t.filter(s=>s.format==="urn:x-nmos:format:audio"))??[],a=n.map(s=>r==null?void 0:r.get(s.id)).filter(s=>s).length??!1,u=o.map(s=>r==null?void 0:r.get(s.id)).filter(s=>s).length??!1;if(!n.length&&!o.length)return{valid:!1,message:"Multiflow has no audio or video subflows"};if(!a&&!u)return{valid:!1,message:"Multiflow's child flows have no segments"}}return(e.format==="urn:x-nmos:format:audio"||e.format==="urn:x-nmos:format:video")&&!((r==null?void 0:r.get(e.id))!==void 0)?{valid:!1,message:"Mono essence flow has no segments"}:e.format!=="urn:x-nmos:format:audio"&&e.format!=="urn:x-nmos:format:multi"&&e.format!=="urn:x-nmos:format:video"?{valid:!1,message:"Playback not possible for flows that are not audio, video or multi"}:{valid:!0}}function Uu(e,t,r){const i=[],n=Math.max(...[e,...t??[]].filter(s=>s.format==="urn:x-nmos:format:audio").map(s=>s.essence_parameters.channels)),o=[e,...t??[]].filter(s=>s.format==="urn:x-nmos:format:audio").find(s=>s.essence_parameters.channels===n),a=(s,c,l)=>{var g,h;if(s.format!=="urn:x-nmos:format:video"&&s.format!=="urn:x-nmos:format:audio"&&!(s.format==="urn:x-nmos:format:multi"&&s.container)&&!(s.format==="urn:x-nmos:format:data"&&s.container==="text/vtt"))return;let d;s.format!=="urn:x-nmos:format:data"?d=((g=zu(c))==null?void 0:g.map(v=>{var T,z;const w=N.timerangeExprDuration(v.timerange);return new Ia(w,((z=(T=v.get_urls)==null?void 0:T.at(-1))==null?void 0:z.url)??"http://byomakase.org/non-playable-gap")}))??[]:d=((h=Eu(c))==null?void 0:h.map(v=>{var T,z;const w=N.timerangeExprDuration(v.timerange);return new Ia(w,((z=(T=v.get_urls)==null?void 0:T.at(-1))==null?void 0:z.url)??"http://byomakase.org/non-playable-gap")}))??[];const f=Math.max(...d.map(v=>v.duration),1),m={playlistType:"VOD",targetDuration:Math.ceil(f),version:3,independentSegments:!0};if(s.format==="urn:x-nmos:format:video"){const w=s.essence_parameters,T=za(w),z=Ea(w),L=new Wr(s.max_bit_rate??s.avg_bit_rate??0,s.avg_bit_rate??0,T,z,"");i.push({segments:d,metadata:m,streamInfo:L})}else if(s.format==="urn:x-nmos:format:audio"){const w=s.essence_parameters,T={type:"AUDIO",groupId:"audio",name:xu(s),isDefault:(o==null?void 0:o.id)===s.id,autoSelect:!0,channels:w.channels.toString()},z={bandwidth:s.avg_bit_rate??0,averageBandwidth:s.avg_bit_rate??0,resolution:null,frameRate:null,uri:""};i.push({segments:d,metadata:m,mediaInfo:T,streamInfo:z,id:s.id})}else if(s.format==="urn:x-nmos:format:multi"){const v=l==null?void 0:l.find(F=>F.format==="urn:x-nmos:format:video"),w=v?za(v.essence_parameters):null,T=v?Ea(v.essence_parameters):null,z=uh(l??[]),L={bandwidth:z.maxBitRate,averageBandwidth:z.averageBitRate,resolution:w,frameRate:T,uri:""};i.push({segments:d,metadata:m,streamInfo:L,id:s.id})}else if(s.format==="urn:x-nmos:format:data"&&s.container==="text/vtt"){const v={type:"SUBTITLES",name:Tu(s),isDefault:!1,autoSelect:!1,channels:null};i.push({segments:d,metadata:m,mediaInfo:v,id:s.id})}};return e.format==="urn:x-nmos:format:multi"&&!e.container?t==null||t.forEach(s=>{const c=r==null?void 0:r.get(s.id);c!=null&&c.length&&a(s,c)}):a(e,r==null?void 0:r.get(e.id),t),ah(i,{independentSegments:!0})}var Hr=function(e,t){return Hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Hr(e,t)};function Nt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function qr(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,o=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}function Yr(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,o;i<n;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function je(e){return typeof e=="function"}function Du(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Cr=Du(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
23
|
+
`+r.map(function(i,n){return n+1+") "+i.toString()}).join(`
|
|
24
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Qr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ln=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=qr(a),s=u.next();!s.done;s=u.next()){var c=s.value;c.remove(this)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(je(l))try{l()}catch(h){o=h instanceof Cr?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=qr(d),m=f.next();!m.done;m=f.next()){var g=m.value;try{Oa(g)}catch(h){o=o??[],h instanceof Cr?o=Yr(Yr([],Xr(o)),Xr(h.errors)):o.push(h)}}}catch(h){i={error:h}}finally{try{m&&!m.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(o)throw new Cr(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Oa(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Qr(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Qr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Nu=Ln.EMPTY;function ju(e){return e instanceof Ln||e&&"closed"in e&&je(e.remove)&&je(e.add)&&je(e.unsubscribe)}function Oa(e){je(e)?e():e.unsubscribe()}var ch={Promise:void 0},sh={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Yr([e,t],Xr(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function lh(e){sh.setTimeout(function(){throw e})}function Ua(){}function bn(e){e()}var Pu=(function(e){Nt(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,ju(r)&&r.add(i)):i.destination=mh,i}return t.create=function(r,i,n){return new ei(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Ln),dh=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){an(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){an(i)}else an(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){an(r)}},e})(),ei=(function(e){Nt(t,e);function t(r,i,n){var o=e.call(this)||this,a;return je(r)||!r?a={next:r??void 0,error:i??void 0,complete:n??void 0}:a=r,o.destination=new dh(a),o}return t})(Pu);function an(e){lh(e)}function fh(e){throw e}var mh={closed:!0,next:Ua,error:fh,complete:Ua},ph=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function hh(e){return e}function gh(e){return e.length===0?hh:e.length===1?e[0]:function(r){return e.reduce(function(i,n){return n(i)},r)}}var xt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,o=bh(t)?t:new ei(t,r,i);return bn(function(){var a=n,u=a.operator,s=a.source;o.add(u?u.call(o,s):s?n._subscribe(o):n._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Da(r),new r(function(n,o){var a=new ei({next:function(u){try{t(u)}catch(s){o(s),a.unsubscribe()}},error:o,complete:n});i.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[ph]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return gh(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Da(t),new t(function(i,n){var o;r.subscribe(function(a){return o=a},function(a){return n(a)},function(){return i(o)})})},e.create=function(t){return new e(t)},e})();function Da(e){var t;return(t=e??ch.Promise)!==null&&t!==void 0?t:Promise}function vh(e){return e&&je(e.next)&&je(e.error)&&je(e.complete)}function bh(e){return e&&e instanceof Pu||vh(e)&&ju(e)}var _h=Du(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ut=(function(e){Nt(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Na(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new _h},t.prototype.next=function(r){var i=this;bn(function(){var n,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=qr(i.currentObservers),u=a.next();!u.done;u=a.next()){var s=u.value;s.next(r)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;bn(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;bn(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,o=n.hasError,a=n.isStopped,u=n.observers;return o||a?Nu:(this.currentObservers=null,u.push(r),new Ln(function(){i.currentObservers=null,Qr(u,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,o=i.thrownError,a=i.isStopped;n?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new xt;return r.source=this,r},t.create=function(r,i){return new Na(r,i)},t})(xt),Na=(function(e){Nt(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Nu},t})(ut),yh=(function(e){Nt(t,e);function t(r){var i=e.call(this)||this;return i._value=r,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var i=e.prototype._subscribe.call(this,r);return!i.closed&&r.next(this._value),i},t.prototype.getValue=function(){var r=this,i=r.hasError,n=r.thrownError,o=r._value;if(i)throw n;return this._throwIfClosed(),o},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(ut);class Au{constructor(t){k(this,"_player");k(this,"_proxy");k(this,"_mediaStartTime");k(this,"_loadOptions");k(this,"_onVideoLoaded$",new yh(void 0));k(this,"_onVideoLoading$",new ut);k(this,"_isTamsLoading",!1);k(this,"_lastVideoLoadedEvent$");k(this,"_tamsVideo");this._player=t;const r=this;this._player.video.onVideoLoading$.subscribe(i=>{var n;this._onVideoLoading$.next({...i,isTamsLoading:((n=this._loadOptions)==null?void 0:n.protocol)===void 0})}),this._player.video.onVideoLoaded$.subscribe(i=>{var n;this._isTamsLoading?this._lastVideoLoadedEvent$=i:i?this._onVideoLoaded$.next({...i,isTamsLoaded:((n=this._loadOptions)==null?void 0:n.protocol)===void 0}):this._onVideoLoaded$.next(i)}),this._proxy=new Proxy(t.video,{get(i,n,o){if(n==="getVideo")return()=>{const u=r._player.video.getVideo();return!u||!r._tamsVideo?u:{...u,...r._tamsVideo}};if(n==="isTamsLoaded")return()=>{var u;return r._player.video.isVideoLoaded()&&((u=r._loadOptions)==null?void 0:u.protocol)===void 0};if(n==="onVideoLoading$")return r._onVideoLoading$;if(n==="onVideoLoaded$")return r._onVideoLoaded$;const a=Reflect.get(i,n,o);return typeof a=="function"?a.bind(i):a}})}get proxy(){return this._proxy}get mediaStartTime(){return this._mediaStartTime}get loadOptions(){return this._loadOptions}set loadOptions(t){this._loadOptions=t,(t==null?void 0:t.protocol)===void 0?this._isTamsLoading=!0:this._isTamsLoading=!1}set mediaStartTime(t){this._mediaStartTime=t}setTamsVideo(t){this._tamsVideo=t}emitVideoLoadedEvent(){if(!this._lastVideoLoadedEvent$){console.error("Can't emit video loaded event since no video has been loaded");return}this._tamsVideo?this._onVideoLoaded$.next({...this._lastVideoLoadedEvent$,video:this._tamsVideo,isTamsLoaded:!0}):this._onVideoLoaded$.next({...this._lastVideoLoadedEvent$})}}function ja(e){if(!e)return{};const t={},r=e.split(",");for(const i of r){const n=i.match(/<([^>]+)>;\s*rel="([^"]+)"/);n&&(t[n[2]]=n[1])}return t}class $h{constructor(t,r){k(this,"apiEndpoint");k(this,"headersFunction");this.headersFunction=r,this.apiEndpoint=t}setEndpoint(t){this.apiEndpoint=t}getEndpoint(){return this.apiEndpoint}setHeadersFunction(t){this.headersFunction=t}getHeadersFunction(){return this.headersFunction}async makeRequest(t,r,i={}){const n=`${this.apiEndpoint}${r}`,o=this.headersFunction?this.headersFunction(n).headers:{},a=await fetch(n,{method:t,headers:{...o,...i.headers},body:i.body?JSON.stringify(i.body):void 0});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);const u=a.headers.get("link"),s=u?ja(u):{};return{data:t==="GET"?await a.json():a.status,headers:a.headers,nextLink:s.next}}async makeRequestWithUrl(t,r,i={}){const n=this.headersFunction?this.headersFunction(r).headers:{},o=await fetch(r,{method:t,headers:{...n,...i.headers},body:i.body?JSON.stringify(i.body):void 0});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const a=o.headers.get("link"),u=a?ja(a):{};return{data:t==="GET"?await o.json():o.status,headers:o.headers,nextLink:u.next}}async get(t,r={}){return this.makeRequest("GET",t,r)}async put(t,r,i={}){return this.makeRequest("PUT",t,{...i,body:r})}async del(t,r={}){return this.makeRequest("DELETE",t,r)}async post(t,r,i={}){return this.makeRequest("POST",t,{...i,body:r})}async getUrl(t,r={}){return this.makeRequestWithUrl("GET",t,r)}}const wh=(e,t)=>new $h(e,t),Cu=Object.freeze({status:"aborted"});function p(e,t,r){function i(u,s){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:s,constr:a,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,s);const c=a.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){const f=l[d];f in u||(u[f]=c[f].bind(u))}}const n=(r==null?void 0:r.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(u){var s;const c=r!=null&&r.Parent?new o:this;i(c,u),(s=c._zod).deferred??(s.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>{var s,c;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(c=(s=u==null?void 0:u._zod)==null?void 0:s.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}const Lu=Symbol("zod_brand");class Xe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Zn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const kn={};function se(e){return e&&Object.assign(kn,e),kn}function Sh(e){return e}function kh(e){return e}function Ih(e){}function xh(e){throw new Error("Unexpected value in exhaustive check")}function Th(e){}function mi(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function y(e,t="|"){return e.map(r=>U(r)).join(t)}function In(e,t){return typeof t=="bigint"?t.toString():t}function jt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function tt(e){return e==null}function Mn(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zu(e,t){const r=(e.toString().split(".")[1]||"").length,i=t.toString();let n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){const s=i.match(/\d?e-(\d?)/);s!=null&&s[1]&&(n=Number.parseInt(s[1]))}const o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),u=Number.parseInt(t.toFixed(o).replace(".",""));return a%u/10**o}const Pa=Symbol("evaluating");function M(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==Pa)return i===void 0&&(i=Pa,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function zh(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Je(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Oe(...e){const t={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function Eh(e){return Oe(e._zod.def)}function Oh(e,t){return t?t.reduce((r,i)=>r==null?void 0:r[i],e):e}function Uh(e){const t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{const n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function Dh(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function ti(e){return JSON.stringify(e)}function Mu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ru=jt(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ye(e){if(lt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(lt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Rn(e){return Ye(e)?{...e}:Array.isArray(e)?[...e]:e}function Nh(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const jh=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},xn=new Set(["string","number","symbol"]),Fu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function b(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ph(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function U(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Vu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Bu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ku={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ju(e,t){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Oe(e._zod.def,{get shape(){const a={};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(a[u]=r.shape[u])}return Je(this,"shape",a),a},checks:[]});return $e(e,o)}function Gu(e,t){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Oe(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete a[u]}return Je(this,"shape",a),a},checks:[]});return $e(e,o)}function Wu(e,t){if(!Ye(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Oe(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Je(this,"shape",o),o}});return $e(e,n)}function Hu(e,t){if(!Ye(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Oe(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Je(this,"shape",i),i}});return $e(e,r)}function qu(e,t){const r=Oe(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Je(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return $e(e,r)}function Xu(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Oe(t._zod.def,{get shape(){const u=t._zod.def.shape,s={...u};if(r)for(const c in r){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(s[c]=e?new e({type:"optional",innerType:u[c]}):u[c])}else for(const c in u)s[c]=e?new e({type:"optional",innerType:u[c]}):u[c];return Je(this,"shape",s),s},checks:[]});return $e(t,a)}function Yu(e,t,r){const i=Oe(t._zod.def,{get shape(){const n=t._zod.def.shape,o={...n};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return Je(this,"shape",o),o}});return $e(t,i)}function qe(e,t=0){var r;if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(((r=e.issues[i])==null?void 0:r.continue)!==!0)return!0;return!1}function ke(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function kt(e){return typeof e=="string"?e:e==null?void 0:e.message}function ye(e,t,r){var n,o,a,u,s,c;const i={...e,path:e.path??[]};if(!e.message){const l=kt((a=(o=(n=e.inst)==null?void 0:n._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,e))??kt((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??kt((s=r.customError)==null?void 0:s.call(r,e))??kt((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";i.message=l}return delete i.inst,delete i.continue,t!=null&&t.reportInput||delete i.input,i}function Fn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Vn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function D(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function dt(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function Ah(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Qu(e){const t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function ec(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ch(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Qu(t+r)}function Lh(e){return ec(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zh(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function Mh(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class Rh{constructor(...t){}}const tc=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Ku,Class:Rh,NUMBER_FORMAT_RANGES:Bu,aborted:qe,allowsEval:Ru,assert:Th,assertEqual:Sh,assertIs:Ih,assertNever:xh,assertNotEqual:kh,assignProp:Je,base64ToUint8Array:Qu,base64urlToUint8Array:Ch,cached:jt,captureStackTrace:pi,cleanEnum:Ah,cleanRegex:Mn,clone:$e,cloneDef:Eh,createTransparentProxy:Ph,defineLazy:M,esc:ti,escapeRegex:Pe,extend:Wu,finalizeIssue:ye,floatSafeRemainder:Zu,getElementAtPath:Oh,getEnumValues:mi,getLengthableOrigin:Vn,getParsedType:jh,getSizableOrigin:Fn,hexToUint8Array:Zh,isObject:lt,isPlainObject:Ye,issue:dt,joinValues:y,jsonStringifyReplacer:In,merge:qu,mergeDefs:Oe,normalizeParams:b,nullish:tt,numKeys:Nh,objectClone:zh,omit:Gu,optionalKeys:Vu,parsedType:D,partial:Xu,pick:Ju,prefixIssues:ke,primitiveTypes:Fu,promiseAllObject:Uh,propertyKeyTypes:xn,randomString:Dh,required:Yu,safeExtend:Hu,shallowClone:Rn,slugify:Mu,stringifyPrimitive:U,uint8ArrayToBase64:ec,uint8ArrayToBase64url:Lh,uint8ArrayToHex:Mh,unwrapMessage:kt},Symbol.toStringTag,{value:"Module"})),nc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,In,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hi=p("$ZodError",nc),he=p("$ZodError",nc,{Parent:Error});function gi(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function vi(e,t=r=>r.message){const r={_errors:[]},i=n=>{for(const o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,u=0;for(;u<o.path.length;){const s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(t(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(e),r}function rc(e,t=r=>r.message){const r={errors:[]},i=(n,o=[])=>{var a,u;for(const s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},s.path));else if(s.code==="invalid_key")i({issues:s.issues},s.path);else if(s.code==="invalid_element")i({issues:s.issues},s.path);else{const c=[...o,...s.path];if(c.length===0){r.errors.push(t(s));continue}let l=r,d=0;for(;d<c.length;){const f=c[d],m=d===c.length-1;typeof f=="string"?(l.properties??(l.properties={}),(a=l.properties)[f]??(a[f]={errors:[]}),l=l.properties[f]):(l.items??(l.items=[]),(u=l.items)[f]??(u[f]={errors:[]}),l=l.items[f]),m&&l.errors.push(t(s)),d++}}};return i(e),r}function ic(e){const t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(const i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function oc(e){var i;const t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(const n of r)t.push(`✖ ${n.message}`),(i=n.path)!=null&&i.length&&t.push(` → at ${ic(n.path)}`);return t.join(`
|
|
25
|
+
`)}const Pt=e=>(t,r,i,n)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Xe;if(a.issues.length){const u=new((n==null?void 0:n.Err)??e)(a.issues.map(s=>ye(s,o,se())));throw pi(u,n==null?void 0:n.callee),u}return a.value},ni=Pt(he),At=e=>async(t,r,i,n)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const u=new((n==null?void 0:n.Err)??e)(a.issues.map(s=>ye(s,o,se())));throw pi(u,n==null?void 0:n.callee),u}return a.value},ri=At(he),Ct=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Xe;return o.issues.length?{success:!1,error:new(e??hi)(o.issues.map(a=>ye(a,n,se())))}:{success:!0,data:o.value}},ac=Ct(he),Lt=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>ye(a,n,se())))}:{success:!0,data:o.value}},uc=Lt(he),bi=e=>(t,r,i)=>{const n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Pt(e)(t,r,n)},Fh=bi(he),_i=e=>(t,r,i)=>Pt(e)(t,r,i),Vh=_i(he),yi=e=>async(t,r,i)=>{const n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return At(e)(t,r,n)},Bh=yi(he),$i=e=>async(t,r,i)=>At(e)(t,r,i),Kh=$i(he),wi=e=>(t,r,i)=>{const n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ct(e)(t,r,n)},Jh=wi(he),Si=e=>(t,r,i)=>Ct(e)(t,r,i),Gh=Si(he),ki=e=>async(t,r,i)=>{const n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Lt(e)(t,r,n)},Wh=ki(he),Ii=e=>async(t,r,i)=>Lt(e)(t,r,i),Hh=Ii(he),cc=/^[cC][^\s-]{8,}$/,sc=/^[0-9a-z]+$/,lc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dc=/^[0-9a-vA-V]{20}$/,fc=/^[A-Za-z0-9]{27}$/,mc=/^[a-zA-Z0-9_-]{21}$/,pc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qh=/^[-+]?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)?)??$/,hc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ft=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xh=ft(4),Yh=ft(6),Qh=ft(7),gc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eg=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tg=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,vc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ng=vc,rg=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ig="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bc(){return new RegExp(ig,"u")}const _c=/^(?:(?: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])$/,yc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$c=e=>{const t=Pe(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},wc=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Sc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xi=/^[A-Za-z0-9_-]*$/,Ic=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,xc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Tc=/^\+[1-9]\d{6,14}$/,zc="(?:(?:\\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])))",Ec=new RegExp(`^${zc}$`);function Oc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Uc(e){return new RegExp(`^${Oc(e)}$`)}function Dc(e){const t=Oc({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${zc}T(?:${i})$`)}const Nc=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},jc=/^-?\d+n?$/,Pc=/^-?\d+$/,Ti=/^-?\d+(?:\.\d+)?$/,Ac=/^(?:true|false)$/i,Cc=/^null$/i,Lc=/^undefined$/i,Zc=/^[^A-Z]*$/,Mc=/^[^a-z]*$/,Rc=/^[0-9a-fA-F]*$/;function Zt(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Mt(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const og=/^[0-9a-fA-F]{32}$/,ag=Zt(22,"=="),ug=Mt(22),cg=/^[0-9a-fA-F]{40}$/,sg=Zt(27,"="),lg=Mt(27),dg=/^[0-9a-fA-F]{64}$/,fg=Zt(43,"="),mg=Mt(43),pg=/^[0-9a-fA-F]{96}$/,hg=Zt(64,""),gg=Mt(64),vg=/^[0-9a-fA-F]{128}$/,bg=Zt(86,"=="),_g=Mt(86),zi=Object.freeze(Object.defineProperty({__proto__:null,base64:kc,base64url:xi,bigint:jc,boolean:Ac,browserEmail:rg,cidrv4:wc,cidrv6:Sc,cuid:cc,cuid2:sc,date:Ec,datetime:Dc,domain:xc,duration:pc,e164:Tc,email:gc,emoji:bc,extendedDuration:qh,guid:hc,hex:Rc,hostname:Ic,html5Email:eg,idnEmail:ng,integer:Pc,ipv4:_c,ipv6:yc,ksuid:fc,lowercase:Zc,mac:$c,md5_base64:ag,md5_base64url:ug,md5_hex:og,nanoid:mc,null:Cc,number:Ti,rfc5322Email:tg,sha1_base64:sg,sha1_base64url:lg,sha1_hex:cg,sha256_base64:fg,sha256_base64url:mg,sha256_hex:dg,sha384_base64:hg,sha384_base64url:gg,sha384_hex:pg,sha512_base64:bg,sha512_base64url:_g,sha512_hex:vg,string:Nc,time:Uc,ulid:lc,undefined:Lc,unicodeEmail:vc,uppercase:Mc,uuid:ft,uuid4:Xh,uuid6:Yh,uuid7:Qh,xid:dc},Symbol.toStringTag,{value:"Module"})),q=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Fc={number:"number",bigint:"bigint",object:"date"},Ei=p("$ZodCheckLessThan",(e,t)=>{q.init(e,t);const r=Fc[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oi=p("$ZodCheckGreaterThan",(e,t)=>{q.init(e,t);const r=Fc[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vc=p("$ZodCheckMultipleOf",(e,t)=>{q.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Zu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Bc=p("$ZodCheckNumberFormat",(e,t)=>{var a;q.init(e,t),t.format=t.format||"float64";const r=(a=t.format)==null?void 0:a.includes("int"),i=r?"int":"number",[n,o]=Bu[t.format];e._zod.onattach.push(u=>{const s=u._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o,r&&(s.pattern=Pc)}),e._zod.check=u=>{const s=u.value;if(r){if(!Number.isInteger(s)){u.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?u.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):u.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<n&&u.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&u.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Kc=p("$ZodCheckBigIntFormat",(e,t)=>{q.init(e,t);const[r,i]=Ku[t.format];e._zod.onattach.push(n=>{const o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{const o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Jc=p("$ZodCheckMaxSize",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const n=i.value;n.size<=t.maximum||i.issues.push({origin:Fn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Gc=p("$ZodCheckMinSize",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const n=i.value;n.size>=t.minimum||i.issues.push({origin:Fn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wc=p("$ZodCheckSizeEquals",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{const n=i.value,o=n.size;if(o===t.size)return;const a=o>t.size;i.issues.push({origin:Fn(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Hc=p("$ZodCheckMaxLength",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const n=i.value;if(n.length<=t.maximum)return;const a=Vn(n);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qc=p("$ZodCheckMinLength",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const n=i.value;if(n.length>=t.minimum)return;const a=Vn(n);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xc=p("$ZodCheckLengthEquals",(e,t)=>{var r;q.init(e,t),(r=e._zod.def).when??(r.when=i=>{const n=i.value;return!tt(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{const n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{const n=i.value,o=n.length;if(o===t.length)return;const a=Vn(n),u=o>t.length;i.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Rt=p("$ZodCheckStringFormat",(e,t)=>{var r,i;q.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Yc=p("$ZodCheckRegex",(e,t)=>{Rt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qc=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zc),Rt.init(e,t)}),es=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mc),Rt.init(e,t)}),ts=p("$ZodCheckIncludes",(e,t)=>{q.init(e,t);const r=Pe(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ns=p("$ZodCheckStartsWith",(e,t)=>{q.init(e,t);const r=new RegExp(`^${Pe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),rs=p("$ZodCheckEndsWith",(e,t)=>{q.init(e,t);const r=new RegExp(`.*${Pe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Aa(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues))}const is=p("$ZodCheckProperty",(e,t)=>{q.init(e,t),e._zod.check=r=>{const i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Aa(n,r,t.property));Aa(i,r,t.property)}}),os=p("$ZodCheckMimeType",(e,t)=>{q.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),as=p("$ZodCheckOverwrite",(e,t)=>{q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class us{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
|
|
26
|
+
`).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,r=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
|
|
27
|
+
`))}}const cs={major:4,minor:3,patch:6},C=p("$ZodType",(e,t)=>{var n;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cs;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const a of o._zod.onattach)a(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),(n=e._zod.deferred)==null||n.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,s,c)=>{let l=qe(u),d;for(const f of s){if(f._zod.def.when){if(!f._zod.def.when(u))continue}else if(l)continue;const m=u.issues.length,g=f._zod.check(u);if(g instanceof Promise&&(c==null?void 0:c.async)===!1)throw new Xe;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,u.issues.length!==m&&(l||(l=qe(u,m)))});else{if(u.issues.length===m)continue;l||(l=qe(u,m))}}return d?d.then(()=>u):u},a=(u,s,c)=>{if(qe(u))return u.aborted=!0,u;const l=o(s,i,c);if(l instanceof Promise){if(c.async===!1)throw new Xe;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(u,s)=>{if(s.skipChecks)return e._zod.parse(u,s);if(s.direction==="backward"){const l=e._zod.parse({value:u.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(d=>a(d,u,s)):a(l,u,s)}const c=e._zod.parse(u,s);if(c instanceof Promise){if(s.async===!1)throw new Xe;return c.then(l=>o(l,i,s))}return o(c,i,s)}}M(e,"~standard",()=>({validate:o=>{var a;try{const u=ac(e,o);return u.success?{value:u.data}:{issues:(a=u.error)==null?void 0:a.issues}}catch{return uc(e,o).then(s=>{var c;return s.success?{value:s.data}:{issues:(c=s.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),Ft=p("$ZodString",(e,t)=>{var r;C.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Nc(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),W=p("$ZodStringFormat",(e,t)=>{Rt.init(e,t),Ft.init(e,t)}),ss=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hc),W.init(e,t)}),ls=p("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ft(i))}else t.pattern??(t.pattern=ft());W.init(e,t)}),ds=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gc),W.init(e,t)}),fs=p("$ZodURL",(e,t)=>{W.init(e,t),e._zod.check=r=>{try{const i=r.value.trim(),n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ms=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bc()),W.init(e,t)}),ps=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=mc),W.init(e,t)}),hs=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cc),W.init(e,t)}),gs=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sc),W.init(e,t)}),vs=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lc),W.init(e,t)}),bs=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dc),W.init(e,t)}),_s=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fc),W.init(e,t)}),ys=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Dc(t)),W.init(e,t)}),$s=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ec),W.init(e,t)}),ws=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Uc(t)),W.init(e,t)}),Ss=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=pc),W.init(e,t)}),ks=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_c),W.init(e,t),e._zod.bag.format="ipv4"}),Is=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yc),W.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),xs=p("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$c(t.delimiter)),W.init(e,t),e._zod.bag.format="mac"}),Ts=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wc),W.init(e,t)}),zs=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sc),W.init(e,t),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[n,o]=i;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ui(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Es=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kc),W.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ui(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Os(e){if(!xi.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ui(r)}const Us=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xi),W.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Os(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ds=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Tc),W.init(e,t)});function Ns(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const js=p("$ZodJWT",(e,t)=>{W.init(e,t),e._zod.check=r=>{Ns(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ps=p("$ZodCustomStringFormat",(e,t)=>{W.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Di=p("$ZodNumber",(e,t)=>{C.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ti,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),As=p("$ZodNumberFormat",(e,t)=>{Bc.init(e,t),Di.init(e,t)}),Ni=p("$ZodBoolean",(e,t)=>{C.init(e,t),e._zod.pattern=Ac,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ji=p("$ZodBigInt",(e,t)=>{C.init(e,t),e._zod.pattern=jc,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Cs=p("$ZodBigIntFormat",(e,t)=>{Kc.init(e,t),ji.init(e,t)}),Ls=p("$ZodSymbol",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Zs=p("$ZodUndefined",(e,t)=>{C.init(e,t),e._zod.pattern=Lc,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{const n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Ms=p("$ZodNull",(e,t)=>{C.init(e,t),e._zod.pattern=Cc,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Rs=p("$ZodAny",(e,t)=>{C.init(e,t),e._zod.parse=r=>r}),Fs=p("$ZodUnknown",(e,t)=>{C.init(e,t),e._zod.parse=r=>r}),Vs=p("$ZodNever",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Bs=p("$ZodVoid",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Ks=p("$ZodDate",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function Ca(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}const Js=p("$ZodArray",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const o=[];for(let a=0;a<n.length;a++){const u=n[a],s=t.element._zod.run({value:u,issues:[]},i);s instanceof Promise?o.push(s.then(c=>Ca(c,r,a))):Ca(s,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function Tn(e,t,r,i,n){if(e.issues.length){if(n&&!(r in i))return;t.issues.push(...ke(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}function Gs(e){var i,n,o,a;const t=Object.keys(e.shape);for(const u of t)if(!((a=(o=(n=(i=e.shape)==null?void 0:i[u])==null?void 0:n._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const r=Vu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Ws(e,t,r,i,n,o){const a=[],u=n.keySet,s=n.catchall._zod,c=s.def.type,l=s.optout==="optional";for(const d in t){if(u.has(d))continue;if(c==="never"){a.push(d);continue}const f=s.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(m=>Tn(m,r,d,t,l))):Tn(f,r,d,t,l)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Hs=p("$ZodObject",(e,t)=>{C.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const s={...u};return Object.defineProperty(t,"shape",{value:s}),s}})}const i=jt(()=>Gs(t));M(e._zod,"propValues",()=>{const u=t.shape,s={};for(const c in u){const l=u[c]._zod;if(l.values){s[c]??(s[c]=new Set);for(const d of l.values)s[c].add(d)}}return s});const n=lt,o=t.catchall;let a;e._zod.parse=(u,s)=>{a??(a=i.value);const c=u.value;if(!n(c))return u.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),u;u.value={};const l=[],d=a.shape;for(const f of a.keys){const m=d[f],g=m._zod.optout==="optional",h=m._zod.run({value:c[f],issues:[]},s);h instanceof Promise?l.push(h.then(v=>Tn(v,u,f,c,g))):Tn(h,u,f,c,g)}return o?Ws(l,c,u,s,i.value,e):l.length?Promise.all(l).then(()=>u):u}}),qs=p("$ZodObjectJIT",(e,t)=>{Hs.init(e,t);const r=e._zod.parse,i=jt(()=>Gs(t)),n=f=>{var z;const m=new us(["shape","payload","ctx"]),g=i.value,h=L=>{const F=ti(L);return`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let w=0;for(const L of g.keys)v[L]=`key_${w++}`;m.write("const newResult = {};");for(const L of g.keys){const F=v[L],j=ti(L),ee=f[L],te=((z=ee==null?void 0:ee._zod)==null?void 0:z.optout)==="optional";m.write(`const ${F} = ${h(L)};`),te?m.write(`
|
|
28
|
+
if (${F}.issues.length) {
|
|
29
|
+
if (${j} in input) {
|
|
30
|
+
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
31
|
+
...iss,
|
|
32
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
33
|
+
})));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (${F}.value === undefined) {
|
|
38
|
+
if (${j} in input) {
|
|
39
|
+
newResult[${j}] = undefined;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
newResult[${j}] = ${F}.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`):m.write(`
|
|
46
|
+
if (${F}.issues.length) {
|
|
47
|
+
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
48
|
+
...iss,
|
|
49
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (${F}.value === undefined) {
|
|
54
|
+
if (${j} in input) {
|
|
55
|
+
newResult[${j}] = undefined;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
newResult[${j}] = ${F}.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");const T=m.compile();return(L,F)=>T(f,L,F)};let o;const a=lt,u=!kn.jitless,c=u&&Ru.value,l=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=i.value);const g=f.value;return a(g)?u&&c&&(m==null?void 0:m.async)===!1&&m.jitless!==!0?(o||(o=n(t.shape)),f=o(f,m),l?Ws([],g,f,m,d,e):f):r(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function La(e,t,r,i){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const n=e.filter(o=>!qe(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>ye(a,i,se())))}),t)}const Bn=p("$ZodUnion",(e,t)=>{C.init(e,t),M(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),M(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),M(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),M(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Mn(o.source)).join("|")})$`)}});const r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1;const u=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)u.push(c),a=!0;else{if(c.issues.length===0)return c;u.push(c)}}return a?Promise.all(u).then(s=>La(s,n,e,o)):La(u,n,e,o)}});function Za(e,t,r,i){const n=e.filter(o=>o.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>ye(a,i,se())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}const Xs=p("$ZodXor",(e,t)=>{Bn.init(e,t),t.inclusive=!1;const r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1;const u=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(u.push(c),a=!0):u.push(c)}return a?Promise.all(u).then(s=>Za(s,n,e,o)):Za(u,n,e,o)}}),Ys=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bn.init(e,t);const r=e._zod.parse;M(e._zod,"propValues",()=>{const n={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[u,s]of Object.entries(a)){n[u]||(n[u]=new Set);for(const c of s)n[u].add(c)}}return n});const i=jt(()=>{var a;const n=t.options,o=new Map;for(const u of n){const s=(a=u._zod.propValues)==null?void 0:a[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,u)}}return o});e._zod.parse=(n,o)=>{const a=n.value;if(!lt(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const u=i.value.get(a==null?void 0:a[t.discriminator]);return u?u._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),Qs=p("$ZodIntersection",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value,o=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([s,c])=>Ma(r,s,c)):Ma(r,o,a)}});function ii(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ye(e)&&Ye(t)){const r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(const o of i){const a=ii(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],o=t[i],a=ii(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ma(e,t,r){const i=new Map;let n;for(const u of t.issues)if(u.code==="unrecognized_keys"){n??(n=u);for(const s of u.keys)i.has(s)||i.set(s,{}),i.get(s).l=!0}else e.issues.push(u);for(const u of r.issues)if(u.code==="unrecognized_keys")for(const s of u.keys)i.has(s)||i.set(s,{}),i.get(s).r=!0;else e.issues.push(u);const o=[...i].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(o.length&&n&&e.issues.push({...n,keys:o}),qe(e))return e;const a=ii(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Pi=p("$ZodTuple",(e,t)=>{C.init(e,t);const r=t.items;e._zod.parse=(i,n)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];const a=[],u=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),s=u===-1?0:r.length-u;if(!t.rest){const l=o.length>r.length,d=o.length<s-1;if(l||d)return i.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),i}let c=-1;for(const l of r){if(c++,c>=o.length&&c>=s)continue;const d=l._zod.run({value:o[c],issues:[]},n);d instanceof Promise?a.push(d.then(f=>un(f,i,c))):un(d,i,c)}if(t.rest){const l=o.slice(r.length);for(const d of l){c++;const f=t.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(m=>un(m,i,c))):un(f,i,c)}}return a.length?Promise.all(a).then(()=>i):i}});function un(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}const el=p("$ZodRecord",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Ye(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const o=[],a=t.keyType._zod.values;if(a){r.value={};const u=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){u.add(typeof c=="number"?c.toString():c);const l=t.valueType._zod.run({value:n[c],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...ke(c,d.issues)),r.value[c]=d.value})):(l.issues.length&&r.issues.push(...ke(c,l.issues)),r.value[c]=l.value)}let s;for(const c in n)u.has(c)||(s=s??[],s.push(c));s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:s})}else{r.value={};for(const u of Reflect.ownKeys(n)){if(u==="__proto__")continue;let s=t.keyType._zod.run({value:u,issues:[]},i);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ti.test(u)&&s.issues.length){const d=t.keyType._zod.run({value:Number(u),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(s=d)}if(s.issues.length){t.mode==="loose"?r.value[u]=n[u]:r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(d=>ye(d,i,se())),input:u,path:[u],inst:e});continue}const l=t.valueType._zod.run({value:n[u],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...ke(u,d.issues)),r.value[s.value]=d.value})):(l.issues.length&&r.issues.push(...ke(u,l.issues)),r.value[s.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),tl=p("$ZodMap",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const o=[];r.value=new Map;for(const[a,u]of n){const s=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:u,issues:[]},i);s instanceof Promise||c instanceof Promise?o.push(Promise.all([s,c]).then(([l,d])=>{Ra(l,d,r,a,n,e,i)})):Ra(s,c,r,a,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Ra(e,t,r,i,n,o,a){e.issues.length&&(xn.has(typeof i)?r.issues.push(...ke(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(u=>ye(u,a,se()))})),t.issues.length&&(xn.has(typeof i)?r.issues.push(...ke(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(u=>ye(u,a,se()))})),r.value.set(e.value,t.value)}const nl=p("$ZodSet",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const o=[];r.value=new Set;for(const a of n){const u=t.valueType._zod.run({value:a,issues:[]},i);u instanceof Promise?o.push(u.then(s=>Fa(s,r))):Fa(u,r)}return o.length?Promise.all(o).then(()=>r):r}});function Fa(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const rl=p("$ZodEnum",(e,t)=>{C.init(e,t);const r=mi(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(n=>xn.has(typeof n)).map(n=>typeof n=="string"?Pe(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{const a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),il=p("$ZodLiteral",(e,t)=>{if(C.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Pe(i):i?Pe(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),ol=p("$ZodFile",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),al=p("$ZodTransform",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zn(e.constructor.name);const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new Xe;return r.value=n,r}});function Va(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ai=p("$ZodOptional",(e,t)=>{C.init(e,t),e._zod.optin="optional",e._zod.optout="optional",M(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),M(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mn(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Va(o,r.value)):Va(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),ul=p("$ZodExactOptional",(e,t)=>{Ai.init(e,t),M(e._zod,"values",()=>t.innerType._zod.values),M(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),cl=p("$ZodNullable",(e,t)=>{C.init(e,t),M(e._zod,"optin",()=>t.innerType._zod.optin),M(e._zod,"optout",()=>t.innerType._zod.optout),M(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mn(r.source)}|null)$`):void 0}),M(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),sl=p("$ZodDefault",(e,t)=>{C.init(e,t),e._zod.optin="optional",M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Ba(o,t)):Ba(n,t)}});function Ba(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ll=p("$ZodPrefault",(e,t)=>{C.init(e,t),e._zod.optin="optional",M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),dl=p("$ZodNonOptional",(e,t)=>{C.init(e,t),M(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Ka(o,e)):Ka(n,e)}});function Ka(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const fl=p("$ZodSuccess",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zn("ZodSuccess");const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ml=p("$ZodCatch",(e,t)=>{C.init(e,t),M(e._zod,"optin",()=>t.innerType._zod.optin),M(e._zod,"optout",()=>t.innerType._zod.optout),M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>ye(a,i,se()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>ye(o,i,se()))},input:r.value}),r.issues=[]),r)}}),pl=p("$ZodNaN",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),hl=p("$ZodPipe",(e,t)=>{C.init(e,t),M(e._zod,"values",()=>t.in._zod.values),M(e._zod,"optin",()=>t.in._zod.optin),M(e._zod,"optout",()=>t.out._zod.optout),M(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>cn(a,t.in,i)):cn(o,t.in,i)}const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>cn(o,t.out,i)):cn(n,t.out,i)}});function cn(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Ci=p("$ZodCodec",(e,t)=>{C.init(e,t),M(e._zod,"values",()=>t.in._zod.values),M(e._zod,"optin",()=>t.in._zod.optin),M(e._zod,"optout",()=>t.out._zod.optout),M(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(a=>sn(a,t,i)):sn(o,t,i)}else{const o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>sn(a,t,i)):sn(o,t,i)}}});function sn(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){const n=t.transform(e.value,e);return n instanceof Promise?n.then(o=>ln(e,o,t.out,r)):ln(e,n,t.out,r)}else{const n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>ln(e,o,t.in,r)):ln(e,n,t.in,r)}}function ln(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}const gl=p("$ZodReadonly",(e,t)=>{C.init(e,t),M(e._zod,"propValues",()=>t.innerType._zod.propValues),M(e._zod,"values",()=>t.innerType._zod.values),M(e._zod,"optin",()=>{var r,i;return(i=(r=t.innerType)==null?void 0:r._zod)==null?void 0:i.optin}),M(e._zod,"optout",()=>{var r,i;return(i=(r=t.innerType)==null?void 0:r._zod)==null?void 0:i.optout}),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(Ja):Ja(n)}});function Ja(e){return e.value=Object.freeze(e.value),e}const vl=p("$ZodTemplateLiteral",(e,t)=>{C.init(e,t);const r=[];for(const i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||Fu.has(typeof i))r.push(Pe(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),bl=p("$ZodFunction",(e,t)=>(C.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){const n=e._def.input?ni(e._def.input,i):i,o=Reflect.apply(r,this,n);return e._def.output?ni(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){const n=e._def.input?await ri(e._def.input,i):i,o=await Reflect.apply(r,this,n);return e._def.output?await ri(e._def.output,o):o}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{const i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Pi({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{const i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),_l=p("$ZodPromise",(e,t)=>{C.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),yl=p("$ZodLazy",(e,t)=>{C.init(e,t),M(e._zod,"innerType",()=>t.getter()),M(e._zod,"pattern",()=>{var r,i;return(i=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:i.pattern}),M(e._zod,"propValues",()=>{var r,i;return(i=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:i.propValues}),M(e._zod,"optin",()=>{var r,i;return((i=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:i.optin)??void 0}),M(e._zod,"optout",()=>{var r,i;return((i=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:i.optout)??void 0}),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),$l=p("$ZodCustom",(e,t)=>{q.init(e,t),C.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>Ga(o,r,i,e));Ga(n,r,i,e)}});function Ga(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(dt(n))}}const yg=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}const r={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${u}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${u}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${U(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${r[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${y(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function $g(){return{localeError:yg()}}const wg=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${u}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${u}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${U(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Sg(){return{localeError:wg()}}function Wa(e,t,r,i){const n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}const kg=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}const r={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},i={nan:"NaN",number:"лік",array:"масіў"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${u}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${u}`}case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${U(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);if(a){const u=Number(n.maximum),s=Wa(u,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${a.verb} ${o}${n.maximum.toString()} ${s}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);if(a){const u=Number(n.minimum),s=Wa(u,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${a.verb} ${o}${n.minimum.toString()} ${s}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${r[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${y(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function Ig(){return{localeError:kg()}}const xg=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(n){return e[n]??null}const r={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},i={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${u}`:`Невалиден вход: очакван ${o}, получен ${u}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${U(n.values[0])}`:`Невалидна опция: очаквано едно от ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${o}${n.maximum.toString()} ${a.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Твърде малко: очаква се ${n.origin} да съдържа ${o}${n.minimum.toString()} ${a.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let a="Невалиден";return o.format==="emoji"&&(a="Невалидно"),o.format==="datetime"&&(a="Невалидно"),o.format==="date"&&(a="Невалидна"),o.format==="time"&&(a="Невалидно"),o.format==="duration"&&(a="Невалидна"),`${a} ${r[o.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function Tg(){return{localeError:xg()}}const zg=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${u}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${u}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${U(n.values[0])}`:`Opció invàlida: s'esperava una de ${y(n.values," o ")}`;case"too_big":{const o=n.inclusive?"com a màxim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"com a mínim":"més de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${r[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function Eg(){return{localeError:zg()}}const Og=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}const r={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${u}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${u}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${U(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${y(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function Ug(){return{localeError:Og()}}const Dg=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}const r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${u}`:`Ugyldigt input: forventede ${o}, fik ${u}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${U(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin),u=i[n.origin]??n.origin;return a?`For stor: forventede ${u??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin),u=i[n.origin]??n.origin;return a?`For lille: forventede ${u} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${u} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function Ng(){return{localeError:Dg()}}const jg=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}const r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${u}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${u}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${U(n.values[0])}`:`Ungültige Option: erwartet eine von ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function Pg(){return{localeError:jg()}}const Ag=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return`Invalid input: expected ${o}, received ${u}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${U(n.values[0])}`:`Invalid option: expected one of ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function wl(){return{localeError:Ag()}}const Cg=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}const r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${u}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${u}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${U(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Lg(){return{localeError:Cg()}}const Zg=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}const r={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${u}`:`Entrada inválida: se esperaba ${o}, recibido ${u}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${U(n.values[0])}`:`Opción inválida: se esperaba una de ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin),u=i[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${u??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${u??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin),u=i[n.origin]??n.origin;return a?`Demasiado pequeño: se esperaba que ${u} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${u} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${r[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function Mg(){return{localeError:Zg()}}const Rg=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}const r={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},i={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: میبایست instanceof ${n.expected} میبود، ${u} دریافت شد`:`ورودی نامعتبر: میبایست ${o} میبود، ${u} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: میبایست ${U(n.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${y(n.values,"|")} میبود`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{const o=n;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${r[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${y(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function Fg(){return{localeError:Rg()}}const Vg=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}const r={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${u}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${u}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${U(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Bg(){return{localeError:Vg()}}const Kg=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${u} reçu`:`Entrée invalide : ${o} attendu, ${u} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${U(n.values[0])} attendu`:`Option invalide : une valeur parmi ${y(n.values,"|")} attendue`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Jg(){return{localeError:Kg()}}const Gg=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${u}`:`Entrée invalide : attendu ${o}, reçu ${u}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${U(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"≤":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"≥":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Wg(){return{localeError:Gg()}}const Hg=()=>{const e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},r=c=>c?e[c]:void 0,i=c=>{const l=r(c);return l?l.label:c??e.unknown.label},n=c=>`ה${i(c)}`,o=c=>{const l=r(c);return((l==null?void 0:l.gender)??"m")==="f"?"צריכה להיות":"צריך להיות"},a=c=>c?t[c]??null:null,u={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},s={nan:"NaN"};return c=>{var l;switch(c.code){case"invalid_type":{const d=c.expected,f=s[d??""]??i(d),m=D(c.input),g=s[m]??((l=e[m])==null?void 0:l.label)??m;return/^[A-Z]/.test(c.expected)?`קלט לא תקין: צריך להיות instanceof ${c.expected}, התקבל ${g}`:`קלט לא תקין: צריך להיות ${f}, התקבל ${g}`}case"invalid_value":{if(c.values.length===1)return`ערך לא תקין: הערך חייב להיות ${U(c.values[0])}`;const d=c.values.map(g=>U(g));if(c.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;const f=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${f}`}case"too_big":{const d=a(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${(d==null?void 0:d.longLabel)??"ארוך"} מדי: ${f} צריכה להכיל ${c.maximum.toString()} ${(d==null?void 0:d.unit)??""} ${c.inclusive?"או פחות":"לכל היותר"}`.trim();if(c.origin==="number"){const h=c.inclusive?`קטן או שווה ל-${c.maximum}`:`קטן מ-${c.maximum}`;return`גדול מדי: ${f} צריך להיות ${h}`}if(c.origin==="array"||c.origin==="set"){const h=c.origin==="set"?"צריכה":"צריך",v=c.inclusive?`${c.maximum} ${(d==null?void 0:d.unit)??""} או פחות`:`פחות מ-${c.maximum} ${(d==null?void 0:d.unit)??""}`;return`גדול מדי: ${f} ${h} להכיל ${v}`.trim()}const m=c.inclusive?"<=":"<",g=o(c.origin??"value");return d!=null&&d.unit?`${d.longLabel} מדי: ${f} ${g} ${m}${c.maximum.toString()} ${d.unit}`:`${(d==null?void 0:d.longLabel)??"גדול"} מדי: ${f} ${g} ${m}${c.maximum.toString()}`}case"too_small":{const d=a(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${(d==null?void 0:d.shortLabel)??"קצר"} מדי: ${f} צריכה להכיל ${c.minimum.toString()} ${(d==null?void 0:d.unit)??""} ${c.inclusive?"או יותר":"לפחות"}`.trim();if(c.origin==="number"){const h=c.inclusive?`גדול או שווה ל-${c.minimum}`:`גדול מ-${c.minimum}`;return`קטן מדי: ${f} צריך להיות ${h}`}if(c.origin==="array"||c.origin==="set"){const h=c.origin==="set"?"צריכה":"צריך";if(c.minimum===1&&c.inclusive){const w=(c.origin==="set","לפחות פריט אחד");return`קטן מדי: ${f} ${h} להכיל ${w}`}const v=c.inclusive?`${c.minimum} ${(d==null?void 0:d.unit)??""} או יותר`:`יותר מ-${c.minimum} ${(d==null?void 0:d.unit)??""}`;return`קטן מדי: ${f} ${h} להכיל ${v}`.trim()}const m=c.inclusive?">=":">",g=o(c.origin??"value");return d!=null&&d.unit?`${d.shortLabel} מדי: ${f} ${g} ${m}${c.minimum.toString()} ${d.unit}`:`${(d==null?void 0:d.shortLabel)??"קטן"} מדי: ${f} ${g} ${m}${c.minimum.toString()}`}case"invalid_format":{const d=c;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;const f=u[d.format],m=(f==null?void 0:f.label)??d.format,h=((f==null?void 0:f.gender)??"m")==="f"?"תקינה":"תקין";return`${m} לא ${h}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${c.divisor}`;case"unrecognized_keys":return`מפתח${c.keys.length>1?"ות":""} לא מזוה${c.keys.length>1?"ים":"ה"}: ${y(c.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(c.origin??"array")}`;default:return"קלט לא תקין"}}};function qg(){return{localeError:Hg()}}const Xg=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${u}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${u}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${U(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function Yg(){return{localeError:Xg()}}function Ha(e,t,r){return Math.abs(e)===1?t:r}function it(e){if(!e)return"";const t=["ա","ե","ը","ի","ո","ու","օ"],r=e[e.length-1];return e+(t.includes(r)?"ն":"ը")}const Qg=()=>{const e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(n){return e[n]??null}const r={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},i={nan:"NaN",number:"թիվ",array:"զանգված"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${u}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${u}`}case"invalid_value":return n.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${U(n.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);if(a){const u=Number(n.maximum),s=Ha(u,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${it(n.origin??"արժեք")} կունենա ${o}${n.maximum.toString()} ${s}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${it(n.origin??"արժեք")} լինի ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);if(a){const u=Number(n.minimum),s=Ha(u,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${it(n.origin)} կունենա ${o}${n.minimum.toString()} ${s}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${it(n.origin)} լինի ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${r[o.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${y(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${it(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${it(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function ev(){return{localeError:Qg()}}const tv=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${u}`:`Input tidak valid: diharapkan ${o}, diterima ${u}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${U(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function nv(){return{localeError:tv()}}const rv=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(n){return e[n]??null}const r={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${u} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${u} þar sem á að vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${U(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${y(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function iv(){return{localeError:rv()}}const ov=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${u}`:`Input non valido: atteso ${o}, ricevuto ${u}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${U(n.values[0])}`:`Opzione non valida: atteso uno tra ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${y(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function av(){return{localeError:ov()}}const uv=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}const r={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},i={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${u}が入力されました`:`無効な入力: ${o}が期待されましたが、${u}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${U(n.values[0])}が期待されました`:`無効な選択: ${y(n.values,"、")}のいずれかである必要があります`;case"too_big":{const o=n.inclusive?"以下である":"より小さい",a=t(n.origin);return a?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${a.unit??"要素"}${o}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{const o=n.inclusive?"以上である":"より大きい",a=t(n.origin);return a?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${a.unit}${o}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${r[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${y(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function cv(){return{localeError:uv()}}const sv=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(n){return e[n]??null}const r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},i={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${u}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${u}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${U(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${y(n.values,"|")}-დან`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${r[o.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${y(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function lv(){return{localeError:sv()}}const dv=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}const r={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${u}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${u}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${U(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${y(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Sl(){return{localeError:dv()}}function fv(){return Sl()}const mv=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}const r={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${u}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${u}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${U(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${y(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=n.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",u=t(n.origin),s=(u==null?void 0:u.unit)??"요소";return u?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${s} ${o}${a}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${a}`}case"too_small":{const o=n.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",u=t(n.origin),s=(u==null?void 0:u.unit)??"요소";return u?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${s} ${o}${a}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${y(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function pv(){return{localeError:mv()}}const wt=e=>e.charAt(0).toUpperCase()+e.slice(1);function qa(e){const t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}const hv=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(n,o,a,u){const s=e[n]??null;return s===null?s:{unit:s.unit[o],verb:s.verb[u][a?"inclusive":"notInclusive"]}}const r={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${u}, o tikėtasi - instanceof ${n.expected}`:`Gautas tipas ${u}, o tikėtasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo būti ${U(n.values[0])}`:`Privalo būti vienas iš ${y(n.values,"|")} pasirinkimų`;case"too_big":{const o=i[n.origin]??n.origin,a=t(n.origin,qa(Number(n.maximum)),n.inclusive??!1,"smaller");if(a!=null&&a.verb)return`${wt(o??n.origin??"reikšmė")} ${a.verb} ${n.maximum.toString()} ${a.unit??"elementų"}`;const u=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${wt(o??n.origin??"reikšmė")} turi būti ${u} ${n.maximum.toString()} ${a==null?void 0:a.unit}`}case"too_small":{const o=i[n.origin]??n.origin,a=t(n.origin,qa(Number(n.minimum)),n.inclusive??!1,"bigger");if(a!=null&&a.verb)return`${wt(o??n.origin??"reikšmė")} ${a.verb} ${n.minimum.toString()} ${a.unit??"elementų"}`;const u=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${wt(o??n.origin??"reikšmė")} turi būti ${u} ${n.minimum.toString()} ${a==null?void 0:a.unit}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${y(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const o=i[n.origin]??n.origin;return`${wt(o??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function gv(){return{localeError:hv()}}const vv=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}const r={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},i={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${u}`:`Грешен внес: се очекува ${o}, примено ${u}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${U(n.values[0])}`:`Грешана опција: се очекува една ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${y(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function bv(){return{localeError:vv()}}const _v=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${u}`:`Input tidak sah: dijangka ${o}, diterima ${u}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${U(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function yv(){return{localeError:_v()}}const $v=()=>{const e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}const r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${u}`:`Ongeldige invoer: verwacht ${o}, ontving ${u}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${U(n.values[0])}`:`Ongeldige optie: verwacht één van ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin),u=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${u}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${u}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin),u=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${u}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${u}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function wv(){return{localeError:$v()}}const Sv=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}const r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${u}`:`Ugyldig input: forventet ${o}, fikk ${u}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${U(n.values[0])}`:`Ugyldig valg: forventet en av ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function kv(){return{localeError:Sv()}}const Iv=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}const r={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${u}`:`Fâsit giren: umulan ${o}, alınan ${u}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${U(n.values[0])}`:`Fâsit tercih: mûteberler ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${r[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function xv(){return{localeError:Iv()}}const Tv=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}const r={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},i={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${u} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${u} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${U(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${y(n.values,"|")} څخه وای`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${r[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${y(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function zv(){return{localeError:Tv()}}const Ev=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}const r={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${u}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${u}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${U(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ov(){return{localeError:Ev()}}const Uv=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${u}`:`Tipo inválido: esperado ${o}, recebido ${u}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${U(n.values[0])}`:`Opção inválida: esperada uma das ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${r[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function Dv(){return{localeError:Uv()}}function Xa(e,t,r,i){const n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}const Nv=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}const r={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},i={nan:"NaN",number:"число",array:"массив"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${u}`:`Неверный ввод: ожидалось ${o}, получено ${u}`}case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${U(n.values[0])}`:`Неверный вариант: ожидалось одно из ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);if(a){const u=Number(n.maximum),s=Xa(u,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${s}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);if(a){const u=Number(n.minimum),s=Xa(u,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${s}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${r[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function jv(){return{localeError:Nv()}}const Pv=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${u}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${u}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${U(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${y(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Av(){return{localeError:Pv()}}const Cv=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}const r={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${u}`:`Ogiltig inmatning: förväntat ${o}, fick ${u}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${U(n.values[0])}`:`Ogiltigt val: förväntade en av ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${y(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Lv(){return{localeError:Cv()}}const Zv=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}const r={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${u}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${u}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${U(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${y(n.values,"|")} இல் ஒன்று`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=n;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Mv(){return{localeError:Zv()}}const Rv=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}const r={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${u}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${u}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${U(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(n.origin);return a?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"อย่างน้อย":"มากกว่า",a=t(n.origin);return a?`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${y(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Fv(){return{localeError:Rv()}}const Vv=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return e[n]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${u}`:`Geçersiz değer: beklenen ${o}, alınan ${u}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${U(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Bv(){return{localeError:Vv()}}const Kv=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}const r={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},i={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${u}`:`Неправильні вхідні дані: очікується ${o}, отримано ${u}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${U(n.values[0])}`:`Неправильна опція: очікується одне з ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Занадто велике: очікується, що ${n.origin??"значення"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Занадто мале: очікується, що ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${r[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${y(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function kl(){return{localeError:Kv()}}function Jv(){return kl()}const Gv=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}const r={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${u} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${u} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${U(n.values[0])} متوقع تھا`:`غلط آپشن: ${y(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=n;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${r[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${y(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Wv(){return{localeError:Gv()}}const Hv=()=>{const e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(n){return e[n]??null}const r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${u}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${u}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${U(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function qv(){return{localeError:Hv()}}const Xv=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}const r={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},i={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${u}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${u}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${U(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Quá nhỏ: mong đợi ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${r[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${y(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Yv(){return{localeError:Xv()}}const Qv=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}const r={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},i={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${u}`:`无效输入:期望 ${o},实际接收 ${u}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${U(n.values[0])}`:`无效选项:期望以下之一 ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${r[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function e1(){return{localeError:Qv()}}const t1=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}const r={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${u}`:`無效的輸入值:預期為 ${o},但收到 ${u}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${U(n.values[0])}`:`無效的選項:預期為以下其中之一 ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${a.unit}`:`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${r[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${y(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function n1(){return{localeError:t1()}}const r1=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return e[n]??null}const r={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},i={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{const o=i[n.expected]??n.expected,a=D(n.input),u=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${u}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${u}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${U(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${y(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${n.maximum}`}case"too_small":{const o=n.inclusive?">=":">",a=t(n.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${n.minimum}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${r[o.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${y(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function i1(){return{localeError:r1()}}const Il=Object.freeze(Object.defineProperty({__proto__:null,ar:$g,az:Sg,be:Ig,bg:Tg,ca:Eg,cs:Ug,da:Ng,de:Pg,en:wl,eo:Lg,es:Mg,fa:Fg,fi:Bg,fr:Jg,frCA:Wg,he:qg,hu:Yg,hy:ev,id:nv,is:iv,it:av,ja:cv,ka:lv,kh:fv,km:Sl,ko:pv,lt:gv,mk:bv,ms:yv,nl:wv,no:kv,ota:xv,pl:Ov,ps:zv,pt:Dv,ru:jv,sl:Av,sv:Lv,ta:Mv,th:Fv,tr:Bv,ua:Jv,uk:kl,ur:Wv,uz:qv,vi:Yv,yo:i1,zhCN:e1,zhTW:n1},Symbol.toStringTag,{value:"Module"}));var Ya;const xl=Symbol("ZodOutput"),Tl=Symbol("ZodInput");class zl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const n={...i,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Li(){return new zl}(Ya=globalThis).__zod_globalRegistry??(Ya.__zod_globalRegistry=Li());const be=globalThis.__zod_globalRegistry;function El(e,t){return new e({type:"string",...b(t)})}function Ol(e,t){return new e({type:"string",coerce:!0,...b(t)})}function Zi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function zn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function Mi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function Ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function Fi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function Vi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function Kn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function Bi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function Ki(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function Ji(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function Gi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function Wi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function Hi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function qi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function Xi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function Yi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function Ul(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...b(t)})}function Qi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function eo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function to(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function no(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function ro(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function io(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}const Dl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Nl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function jl(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function Pl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function Al(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function Cl(e,t){return new e({type:"number",checks:[],...b(t)})}function Ll(e,t){return new e({type:"number",coerce:!0,checks:[],...b(t)})}function Zl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(t)})}function Ml(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...b(t)})}function Rl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...b(t)})}function Fl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...b(t)})}function Vl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...b(t)})}function Bl(e,t){return new e({type:"boolean",...b(t)})}function Kl(e,t){return new e({type:"boolean",coerce:!0,...b(t)})}function Jl(e,t){return new e({type:"bigint",...b(t)})}function Gl(e,t){return new e({type:"bigint",coerce:!0,...b(t)})}function Wl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...b(t)})}function Hl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...b(t)})}function ql(e,t){return new e({type:"symbol",...b(t)})}function Xl(e,t){return new e({type:"undefined",...b(t)})}function Yl(e,t){return new e({type:"null",...b(t)})}function Ql(e){return new e({type:"any"})}function ed(e){return new e({type:"unknown"})}function td(e,t){return new e({type:"never",...b(t)})}function nd(e,t){return new e({type:"void",...b(t)})}function rd(e,t){return new e({type:"date",...b(t)})}function id(e,t){return new e({type:"date",coerce:!0,...b(t)})}function od(e,t){return new e({type:"nan",...b(t)})}function Fe(e,t){return new Ei({check:"less_than",...b(t),value:e,inclusive:!1})}function _e(e,t){return new Ei({check:"less_than",...b(t),value:e,inclusive:!0})}function Ve(e,t){return new Oi({check:"greater_than",...b(t),value:e,inclusive:!1})}function fe(e,t){return new Oi({check:"greater_than",...b(t),value:e,inclusive:!0})}function oo(e){return Ve(0,e)}function ao(e){return Fe(0,e)}function uo(e){return _e(0,e)}function co(e){return fe(0,e)}function mt(e,t){return new Vc({check:"multiple_of",...b(t),value:e})}function _t(e,t){return new Jc({check:"max_size",...b(t),maximum:e})}function Be(e,t){return new Gc({check:"min_size",...b(t),minimum:e})}function Vt(e,t){return new Wc({check:"size_equals",...b(t),size:e})}function Bt(e,t){return new Hc({check:"max_length",...b(t),maximum:e})}function Qe(e,t){return new qc({check:"min_length",...b(t),minimum:e})}function Kt(e,t){return new Xc({check:"length_equals",...b(t),length:e})}function Jn(e,t){return new Yc({check:"string_format",format:"regex",...b(t),pattern:e})}function Gn(e){return new Qc({check:"string_format",format:"lowercase",...b(e)})}function Wn(e){return new es({check:"string_format",format:"uppercase",...b(e)})}function Hn(e,t){return new ts({check:"string_format",format:"includes",...b(t),includes:e})}function qn(e,t){return new ns({check:"string_format",format:"starts_with",...b(t),prefix:e})}function Xn(e,t){return new rs({check:"string_format",format:"ends_with",...b(t),suffix:e})}function so(e,t,r){return new is({check:"property",property:e,schema:t,...b(r)})}function Yn(e,t){return new os({check:"mime_type",mime:e,...b(t)})}function Ae(e){return new as({check:"overwrite",tx:e})}function Qn(e){return Ae(t=>t.normalize(e))}function er(){return Ae(e=>e.trim())}function tr(){return Ae(e=>e.toLowerCase())}function nr(){return Ae(e=>e.toUpperCase())}function rr(){return Ae(e=>Mu(e))}function ad(e,t,r){return new e({type:"array",element:t,...b(r)})}function o1(e,t,r){return new e({type:"union",options:t,...b(r)})}function a1(e,t,r){return new e({type:"union",options:t,inclusive:!1,...b(r)})}function u1(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...b(i)})}function c1(e,t,r){return new e({type:"intersection",left:t,right:r})}function s1(e,t,r,i){const n=r instanceof C,o=n?i:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...b(o)})}function l1(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...b(i)})}function d1(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...b(i)})}function f1(e,t,r){return new e({type:"set",valueType:t,...b(r)})}function m1(e,t,r){const i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...b(r)})}function p1(e,t,r){return new e({type:"enum",entries:t,...b(r)})}function h1(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...b(r)})}function ud(e,t){return new e({type:"file",...b(t)})}function g1(e,t){return new e({type:"transform",transform:t})}function v1(e,t){return new e({type:"optional",innerType:t})}function b1(e,t){return new e({type:"nullable",innerType:t})}function _1(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Rn(r)}})}function y1(e,t,r){return new e({type:"nonoptional",innerType:t,...b(r)})}function $1(e,t){return new e({type:"success",innerType:t})}function w1(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function S1(e,t,r){return new e({type:"pipe",in:t,out:r})}function k1(e,t){return new e({type:"readonly",innerType:t})}function I1(e,t,r){return new e({type:"template_literal",parts:t,...b(r)})}function x1(e,t){return new e({type:"lazy",getter:t})}function T1(e,t){return new e({type:"promise",innerType:t})}function cd(e,t,r){const i=b(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function sd(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function ld(e){const t=dd(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(dt(i,r.value,t._zod.def));else{const n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(dt(n))}},e(r.value,r)));return t}function dd(e,t){const r=new q({check:"custom",...b(t)});return r._zod.check=e,r}function fd(e){const t=new q({check:"describe"});return t._zod.onattach=[r=>{const i=be.get(r)??{};be.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function md(e){const t=new q({check:"meta"});return t._zod.onattach=[r=>{const i=be.get(r)??{};be.add(r,{...i,...e})}],t._zod.check=()=>{},t}function pd(e,t){const r=b(t);let i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));const o=new Set(i),a=new Set(n),u=e.Codec??Ci,s=e.Boolean??Ni,c=e.String??Ft,l=new c({type:"string",error:r.error}),d=new s({type:"boolean",error:r.error}),f=new u({type:"pipe",in:l,out:d,transform:((m,g)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:a.has(h)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:g.value,inst:f,continue:!1}),{})}),reverseTransform:((m,g)=>m===!0?i[0]||"true":n[0]||"false"),error:r.error});return f}function Jt(e,t,r,i={}){const n=b(i),o={...b(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:u=>r.test(u),...n};return r instanceof RegExp&&(o.pattern=r),new e(o)}function pt(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??be,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function K(e,t,r={path:[],schemaPath:[]}){var l,d;var i;const n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const u=(d=(l=e._zod).toJSONSchema)==null?void 0:d.call(l);if(u)a.schema=u;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{const g=a.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,g,f)}const m=e._zod.parent;m&&(a.ref||(a.ref=m),K(m,t,f),t.seen.get(m).isParent=!0)}const s=t.metadataRegistry.get(e);return s&&Object.assign(a.schema,s),t.io==="input"&&de(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function ht(e,t){var a,u,s,c;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const l of e.seen.entries()){const d=(a=e.metadataRegistry.get(l[0]))==null?void 0:a.id;if(d){const f=i.get(d);if(f&&f!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(d,l[0])}}const n=l=>{var h;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(h=e.external.registry.get(l[0]))==null?void 0:h.id,w=e.external.uri??(z=>z);if(v)return{ref:w(v)};const T=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=T,{defId:T,ref:`${w("__shared")}#/${d}/${T}`}}if(l[1]===r)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},o=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:f,defId:m}=n(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const h in g)delete g[h];g.$ref=f};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${(u=d.cycle)==null?void 0:u.join("/")}/<root>
|
|
27
62
|
|
|
28
|
-
`),m=d.shift();if(!m.startsWith("WEBVTT"))throw new t('Must start with "WEBVTT"');const h=m.split(`
|
|
29
|
-
`),
|
|
30
|
-
`)
|
|
31
|
-
`),h?{identifier:f,start:d,end:m,text:h,styles:p}:!1}function s(c){return e.test(c)}function u(c){const a=c.match(e);let l=parseFloat(a[1]||0)*60*60;return l+=parseFloat(a[2])*60,l+=parseFloat(a[3]),l}return Je={ParserError:t,parse:n},Je}var Qe,Ut;function zi(){if(Ut)return Qe;Ut=1;function t(a,l){this.message=a,this.error=l}t.prototype=Object.create(Error.prototype);function e(a){if(!a)throw new t("Input must be non-null");if(typeof a!="object")throw new t("Input must be an object");if(Array.isArray(a))throw new t("Input cannot be array");if(!a.valid)throw new t("Input must be valid");let l=`WEBVTT
|
|
32
|
-
`;if(a.meta){if(typeof a.meta!="object"||Array.isArray(a.meta))throw new t("Metadata must be an object");Object.entries(a.meta).forEach(d=>{if(typeof d[1]!="string")throw new t(`Metadata value for "${d[0]}" must be string`);l+=`${d[0]}: ${d[1]}
|
|
33
|
-
`})}let f=null;return a.cues.forEach((d,m)=>{if(f&&f>d.start)throw new t(`Cue number ${m} is not in chronological order`);f=d.start,l+=`
|
|
34
|
-
`,l+=n(d),l+=`
|
|
35
|
-
`}),l}function n(a){if(typeof a!="object")throw new t("Cue malformed: not of type object");if(typeof a.identifier!="string"&&typeof a.identifier!="number"&&a.identifier!==null)throw new t(`Cue malformed: identifier value is not a string.
|
|
36
|
-
${JSON.stringify(a)}`);if(isNaN(a.start))throw new t(`Cue malformed: null start value.
|
|
37
|
-
${JSON.stringify(a)}`);if(isNaN(a.end))throw new t(`Cue malformed: null end value.
|
|
38
|
-
${JSON.stringify(a)}`);if(a.start>=a.end)throw new t(`Cue malformed: start timestamp greater than end
|
|
39
|
-
${JSON.stringify(a)}`);if(typeof a.text!="string")throw new t(`Cue malformed: null text value.
|
|
40
|
-
${JSON.stringify(a)}`);if(typeof a.styles!="string")throw new t(`Cue malformed: null styles value.
|
|
41
|
-
${JSON.stringify(a)}`);let l="";a.identifier.length>0&&(l+=`${a.identifier}
|
|
42
|
-
`);const f=r(a.start),d=r(a.end);return l+=`${f} --> ${d}`,l+=a.styles?` ${a.styles}`:"",l+=`
|
|
43
|
-
${a.text}`,l}function r(a){const l=i(o(a),2),f=i(s(a),2),d=i(u(a),2),m=i(c(a),3);return`${l}:${f}:${d}.${m}`}function i(a,l){let f=`${a}`;for(;f.length<l;)f=`0${f}`;return f}function o(a){return Math.floor(a/60/60)}function s(a){return Math.floor(a/60)%60}function u(a){return Math.floor(a%60)}function c(a){return Math.floor((a%1).toFixed(4)*1e3)}return Qe={CompilerError:t,compile:e},Qe}var et,Kt;function kn(){if(Kt)return et;Kt=1;const t=Nn().parse;function e(s,u){u=u||10;const c=t(s),a=[];let l=[],f=null,d=0,m=0;return c.cues.forEach((h,p)=>{const w=p===0,E=p===c.cues.length-1,I=h.start,M=h.end,N=E?1/0:c.cues[p+1].start,k=w?M:M-I,x=w?0:I-c.cues[p-1].end;d=d+k+x,`${p}`,a.length+1,f&&(l.push(f),d+=f.end-m,f=null),l.push(h);let G=N-M<u&&x<u&&d>u;if(n(m,u,N,x)){const ne=r(E,M,u,d,m);a.push({duration:ne,cues:l}),m+=ne,d=0,l=[]}else G=!1;G&&(f=h)}),a}function n(s,u,c,a){const l=i(a,u);return(a<=u||l+s<c)&&c-s>=u}function r(s,u,c,a,l){let f=c;return a>c&&(f=i(a-c,c)),s?f=parseFloat((u-l).toFixed(2)):f=Math.round(f),f}function i(s,u){return s+=u-s%u,s}function o(s){}return et={segment:e},et}var tt,Ht;function Ji(){if(Ht)return tt;Ht=1;const t=kn().segment;function e(l,f,d){typeof d>"u"&&(d="900000");const m=t(l,f),h=[];return m.forEach((p,w)=>{const E=`WEBVTT
|
|
44
|
-
X-TIMESTAMP-MAP=MPEGTS:${d},LOCAL:00:00:00.000
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){o(l);continue}if(e.external){const m=(s=e.external.registry.get(l[0]))==null?void 0:s.id;if(t!==l[0]&&m){o(l);continue}}if((c=e.metadataRegistry.get(l[0]))==null?void 0:c.id){o(l);continue}if(d.cycle){o(l);continue}if(d.count>1&&e.reused==="ref"){o(l);continue}}}function gt(e,t){var a,u,s;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=c=>{const l=e.seen.get(c);if(l.ref===null)return;const d=l.def??l.schema,f={...d},m=l.ref;if(l.ref=null,m){i(m);const h=e.seen.get(m),v=h.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),c._zod.parent===m)for(const T in d)T==="$ref"||T==="allOf"||T in f||delete d[T];if(v.$ref&&h.def)for(const T in d)T==="$ref"||T==="allOf"||T in h.def&&JSON.stringify(d[T])===JSON.stringify(h.def[T])&&delete d[T]}const g=c._zod.parent;if(g&&g!==m){i(g);const h=e.seen.get(g);if(h!=null&&h.schema.$ref&&(d.$ref=h.schema.$ref,h.def))for(const v in d)v==="$ref"||v==="allOf"||v in h.def&&JSON.stringify(d[v])===JSON.stringify(h.def[v])&&delete d[v]}e.override({zodSchema:c,jsonSchema:d,path:l.path??[]})};for(const c of[...e.seen.entries()].reverse())i(c[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(u=e.external.registry.get(t))==null?void 0:u.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,r.def??r.schema);const o=((s=e.external)==null?void 0:s.defs)??{};for(const c of e.seen.entries()){const l=c[1];l.def&&l.defId&&(o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{const c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Tt(t,"input",e.processors),output:Tt(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function de(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return de(i.element,r);if(i.type==="set")return de(i.valueType,r);if(i.type==="lazy")return de(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return de(i.innerType,r);if(i.type==="intersection")return de(i.left,r)||de(i.right,r);if(i.type==="record"||i.type==="map")return de(i.keyType,r)||de(i.valueType,r);if(i.type==="pipe")return de(i.in,r)||de(i.out,r);if(i.type==="object"){for(const n in i.shape)if(de(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(const n of i.options)if(de(n,r))return!0;return!1}if(i.type==="tuple"){for(const n of i.items)if(de(n,r))return!0;return!!(i.rest&&de(i.rest,r))}return!1}const hd=(e,t={})=>r=>{const i=pt({...r,processors:t});return K(e,i),ht(i,e),gt(i,e)},Tt=(e,t,r={})=>i=>{const{libraryOptions:n,target:o}=i??{},a=pt({...n??{},target:o,io:t,processors:r});return K(e,a),ht(a,e),gt(a,e)},z1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gd=(e,t,r,i)=>{const n=r;n.type="string";const{minimum:o,maximum:a,format:u,patterns:s,contentEncoding:c}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),u&&(n.format=z1[u]??u,n.format===""&&delete n.format,u==="time"&&delete n.format),c&&(n.contentEncoding=c),s&&s.size>0){const l=[...s];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vd=(e,t,r,i)=>{const n=r,{minimum:o,maximum:a,format:u,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof u=="string"&&u.includes("int")?n.type="integer":n.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l),typeof o=="number"&&(n.minimum=o,typeof l=="number"&&t.target!=="draft-04"&&(l>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c),typeof a=="number"&&(n.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof s=="number"&&(n.multipleOf=s)},bd=(e,t,r,i)=>{r.type="boolean"},_d=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},yd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},$d=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Sd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},kd=(e,t,r,i)=>{r.not={}},Id=(e,t,r,i)=>{},xd=(e,t,r,i)=>{},Td=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},zd=(e,t,r,i)=>{const n=e._zod.def,o=mi(n.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Ed=(e,t,r,i)=>{const n=e._zod.def,o=[];for(const a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Od=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ud=(e,t,r,i)=>{const n=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Dd=(e,t,r,i)=>{const n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:u,mime:s}=e._zod.bag;a!==void 0&&(o.minLength=a),u!==void 0&&(o.maxLength=u),s?s.length===1?(o.contentMediaType=s[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=s.map(c=>({contentMediaType:c}))):Object.assign(n,o)},Nd=(e,t,r,i)=>{r.type="boolean"},jd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Pd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ad=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Cd=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ld=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Zd=(e,t,r,i)=>{const n=r,o=e._zod.def,{minimum:a,maximum:u}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof u=="number"&&(n.maxItems=u),n.type="array",n.items=K(o.element,t,{...i,path:[...i.path,"items"]})},Md=(e,t,r,i)=>{var c;const n=r,o=e._zod.def;n.type="object",n.properties={};const a=o.shape;for(const l in a)n.properties[l]=K(a[l],t,{...i,path:[...i.path,"properties",l]});const u=new Set(Object.keys(a)),s=new Set([...u].filter(l=>{const d=o.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));s.size>0&&(n.required=Array.from(s)),((c=o.catchall)==null?void 0:c._zod.def.type)==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=K(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},lo=(e,t,r,i)=>{const n=e._zod.def,o=n.inclusive===!1,a=n.options.map((u,s)=>K(u,t,{...i,path:[...i.path,o?"oneOf":"anyOf",s]}));o?r.oneOf=a:r.anyOf=a},Rd=(e,t,r,i)=>{const n=e._zod.def,o=K(n.left,t,{...i,path:[...i.path,"allOf",0]}),a=K(n.right,t,{...i,path:[...i.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,s=[...u(o)?o.allOf:[o],...u(a)?a.allOf:[a]];r.allOf=s},Fd=(e,t,r,i)=>{const n=r,o=e._zod.def;n.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=o.items.map((f,m)=>K(f,t,{...i,path:[...i.path,a,m]})),c=o.rest?K(o.rest,t,{...i,path:[...i.path,u,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=s,c&&(n.items=c)):t.target==="openapi-3.0"?(n.items={anyOf:s},c&&n.items.anyOf.push(c),n.minItems=s.length,c||(n.maxItems=s.length)):(n.items=s,c&&(n.additionalItems=c));const{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},Vd=(e,t,r,i)=>{const n=r,o=e._zod.def;n.type="object";const a=o.keyType,u=a._zod.bag,s=u==null?void 0:u.patterns;if(o.mode==="loose"&&s&&s.size>0){const l=K(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(const d of s)n.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=K(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=K(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const c=a._zod.values;if(c){const l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},Bd=(e,t,r,i)=>{const n=e._zod.def,o=K(n.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Kd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType},Jd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Gd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Wd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Hd=(e,t,r,i)=>{const n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;K(o,t,i);const a=t.seen.get(e);a.ref=o},qd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},Xd=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType},fo=(e,t,r,i)=>{const n=e._zod.def;K(n.innerType,t,i);const o=t.seen.get(e);o.ref=n.innerType},Yd=(e,t,r,i)=>{const n=e._zod.innerType;K(n,t,i);const o=t.seen.get(e);o.ref=n},oi={string:gd,number:vd,boolean:bd,bigint:_d,symbol:yd,null:$d,undefined:wd,void:Sd,never:kd,any:Id,unknown:xd,date:Td,enum:zd,literal:Ed,nan:Od,template_literal:Ud,file:Dd,success:Nd,custom:jd,function:Pd,transform:Ad,map:Cd,set:Ld,array:Zd,object:Md,union:lo,intersection:Rd,tuple:Fd,record:Vd,nullable:Bd,nonoptional:Kd,default:Jd,prefault:Gd,catch:Wd,pipe:Hd,readonly:qd,promise:Xd,optional:fo,lazy:Yd};function Qd(e,t){if("_idmap"in e){const i=e,n=pt({...t,processors:oi}),o={};for(const s of i._idmap.entries()){const[c,l]=s;K(l,n)}const a={},u={registry:i,uri:t==null?void 0:t.uri,defs:o};n.external=u;for(const s of i._idmap.entries()){const[c,l]=s;ht(n,l),a[c]=gt(n,l)}if(Object.keys(o).length>0){const s=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:o}}return{schemas:a}}const r=pt({...t,processors:oi});return K(e,r),ht(r,e),gt(r,e)}class E1{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=(t==null?void 0:t.target)??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=pt({processors:oi,target:r,...(t==null?void 0:t.metadata)&&{metadata:t.metadata},...(t==null?void 0:t.unrepresentable)&&{unrepresentable:t.unrepresentable},...(t==null?void 0:t.override)&&{override:t.override},...(t==null?void 0:t.io)&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return K(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),ht(this.ctx,t);const i=gt(this.ctx,t),{"~standard":n,...o}=i;return o}}const O1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),U1=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:Rs,$ZodArray:Js,$ZodAsyncError:Xe,$ZodBase64:Es,$ZodBase64URL:Us,$ZodBigInt:ji,$ZodBigIntFormat:Cs,$ZodBoolean:Ni,$ZodCIDRv4:Ts,$ZodCIDRv6:zs,$ZodCUID:hs,$ZodCUID2:gs,$ZodCatch:ml,$ZodCheck:q,$ZodCheckBigIntFormat:Kc,$ZodCheckEndsWith:rs,$ZodCheckGreaterThan:Oi,$ZodCheckIncludes:ts,$ZodCheckLengthEquals:Xc,$ZodCheckLessThan:Ei,$ZodCheckLowerCase:Qc,$ZodCheckMaxLength:Hc,$ZodCheckMaxSize:Jc,$ZodCheckMimeType:os,$ZodCheckMinLength:qc,$ZodCheckMinSize:Gc,$ZodCheckMultipleOf:Vc,$ZodCheckNumberFormat:Bc,$ZodCheckOverwrite:as,$ZodCheckProperty:is,$ZodCheckRegex:Yc,$ZodCheckSizeEquals:Wc,$ZodCheckStartsWith:ns,$ZodCheckStringFormat:Rt,$ZodCheckUpperCase:es,$ZodCodec:Ci,$ZodCustom:$l,$ZodCustomStringFormat:Ps,$ZodDate:Ks,$ZodDefault:sl,$ZodDiscriminatedUnion:Ys,$ZodE164:Ds,$ZodEmail:ds,$ZodEmoji:ms,$ZodEncodeError:Zn,$ZodEnum:rl,$ZodError:hi,$ZodExactOptional:ul,$ZodFile:ol,$ZodFunction:bl,$ZodGUID:ss,$ZodIPv4:ks,$ZodIPv6:Is,$ZodISODate:$s,$ZodISODateTime:ys,$ZodISODuration:Ss,$ZodISOTime:ws,$ZodIntersection:Qs,$ZodJWT:js,$ZodKSUID:_s,$ZodLazy:yl,$ZodLiteral:il,$ZodMAC:xs,$ZodMap:tl,$ZodNaN:pl,$ZodNanoID:ps,$ZodNever:Vs,$ZodNonOptional:dl,$ZodNull:Ms,$ZodNullable:cl,$ZodNumber:Di,$ZodNumberFormat:As,$ZodObject:Hs,$ZodObjectJIT:qs,$ZodOptional:Ai,$ZodPipe:hl,$ZodPrefault:ll,$ZodPromise:_l,$ZodReadonly:gl,$ZodRealError:he,$ZodRecord:el,$ZodRegistry:zl,$ZodSet:nl,$ZodString:Ft,$ZodStringFormat:W,$ZodSuccess:fl,$ZodSymbol:Ls,$ZodTemplateLiteral:vl,$ZodTransform:al,$ZodTuple:Pi,$ZodType:C,$ZodULID:vs,$ZodURL:fs,$ZodUUID:ls,$ZodUndefined:Zs,$ZodUnion:Bn,$ZodUnknown:Fs,$ZodVoid:Bs,$ZodXID:bs,$ZodXor:Xs,$brand:Lu,$constructor:p,$input:Tl,$output:xl,Doc:us,JSONSchema:O1,JSONSchemaGenerator:E1,NEVER:Cu,TimePrecision:Dl,_any:Ql,_array:ad,_base64:to,_base64url:no,_bigint:Jl,_boolean:Bl,_catch:w1,_check:dd,_cidrv4:Qi,_cidrv6:eo,_coercedBigint:Gl,_coercedBoolean:Kl,_coercedDate:id,_coercedNumber:Ll,_coercedString:Ol,_cuid:Ji,_cuid2:Gi,_custom:cd,_date:rd,_decode:_i,_decodeAsync:$i,_default:_1,_discriminatedUnion:u1,_e164:ro,_email:Zi,_emoji:Bi,_encode:bi,_encodeAsync:yi,_endsWith:Xn,_enum:m1,_file:ud,_float32:Ml,_float64:Rl,_gt:Ve,_gte:fe,_guid:zn,_includes:Hn,_int:Zl,_int32:Fl,_int64:Wl,_intersection:c1,_ipv4:Xi,_ipv6:Yi,_isoDate:jl,_isoDateTime:Nl,_isoDuration:Al,_isoTime:Pl,_jwt:io,_ksuid:qi,_lazy:x1,_length:Kt,_literal:h1,_lowercase:Gn,_lt:Fe,_lte:_e,_mac:Ul,_map:d1,_max:_e,_maxLength:Bt,_maxSize:_t,_mime:Yn,_min:fe,_minLength:Qe,_minSize:Be,_multipleOf:mt,_nan:od,_nanoid:Ki,_nativeEnum:p1,_negative:ao,_never:td,_nonnegative:co,_nonoptional:y1,_nonpositive:uo,_normalize:Qn,_null:Yl,_nullable:b1,_number:Cl,_optional:v1,_overwrite:Ae,_parse:Pt,_parseAsync:At,_pipe:S1,_positive:oo,_promise:T1,_property:so,_readonly:k1,_record:l1,_refine:sd,_regex:Jn,_safeDecode:Si,_safeDecodeAsync:Ii,_safeEncode:wi,_safeEncodeAsync:ki,_safeParse:Ct,_safeParseAsync:Lt,_set:f1,_size:Vt,_slugify:rr,_startsWith:qn,_string:El,_stringFormat:Jt,_stringbool:pd,_success:$1,_superRefine:ld,_symbol:ql,_templateLiteral:I1,_toLowerCase:tr,_toUpperCase:nr,_transform:g1,_trim:er,_tuple:s1,_uint32:Vl,_uint64:Hl,_ulid:Wi,_undefined:Xl,_union:o1,_unknown:ed,_uppercase:Wn,_url:Kn,_uuid:Mi,_uuidv4:Ri,_uuidv6:Fi,_uuidv7:Vi,_void:nd,_xid:Hi,_xor:a1,clone:$e,config:se,createStandardJSONSchemaMethod:Tt,createToJSONSchemaMethod:hd,decode:Vh,decodeAsync:Kh,describe:fd,encode:Fh,encodeAsync:Bh,extractDefs:ht,finalize:gt,flattenError:gi,formatError:vi,globalConfig:kn,globalRegistry:be,initializeContext:pt,isValidBase64:Ui,isValidBase64URL:Os,isValidJWT:Ns,locales:Il,meta:md,parse:ni,parseAsync:ri,prettifyError:oc,process:K,regexes:zi,registry:Li,safeDecode:Gh,safeDecodeAsync:Hh,safeEncode:Jh,safeEncodeAsync:Wh,safeParse:ac,safeParseAsync:uc,toDotPath:ic,toJSONSchema:Qd,treeifyError:rc,util:tc,version:cs},Symbol.toStringTag,{value:"Module"})),D1=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Xn,gt:Ve,gte:fe,includes:Hn,length:Kt,lowercase:Gn,lt:Fe,lte:_e,maxLength:Bt,maxSize:_t,mime:Yn,minLength:Qe,minSize:Be,multipleOf:mt,negative:ao,nonnegative:co,nonpositive:uo,normalize:Qn,overwrite:Ae,positive:oo,property:so,regex:Jn,size:Vt,slugify:rr,startsWith:qn,toLowerCase:tr,toUpperCase:nr,trim:er,uppercase:Wn},Symbol.toStringTag,{value:"Module"})),mo=p("ZodISODateTime",(e,t)=>{ys.init(e,t),H.init(e,t)});function ef(e){return Nl(mo,e)}const po=p("ZodISODate",(e,t)=>{$s.init(e,t),H.init(e,t)});function tf(e){return jl(po,e)}const ho=p("ZodISOTime",(e,t)=>{ws.init(e,t),H.init(e,t)});function nf(e){return Pl(ho,e)}const go=p("ZodISODuration",(e,t)=>{Ss.init(e,t),H.init(e,t)});function rf(e){return Al(go,e)}const of=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:po,ZodISODateTime:mo,ZodISODuration:go,ZodISOTime:ho,date:tf,datetime:ef,duration:rf,time:nf},Symbol.toStringTag,{value:"Module"})),af=(e,t)=>{hi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>vi(e,r)},flatten:{value:r=>gi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,In,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,In,2)}},isEmpty:{get(){return e.issues.length===0}}})},N1=p("ZodError",af),ge=p("ZodError",af,{Parent:Error}),uf=Pt(ge),cf=At(ge),sf=Ct(ge),lf=Lt(ge),df=bi(ge),ff=_i(ge),mf=yi(ge),pf=$i(ge),hf=wi(ge),gf=Si(ge),vf=ki(ge),bf=Ii(ge),Z=p("ZodType",(e,t)=>(C.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Tt(e,"input"),output:Tt(e,"output")}}),e.toJSONSchema=hd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Oe(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>$e(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>uf(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>sf(e,r,i),e.parseAsync=async(r,i)=>cf(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>lf(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>df(e,r,i),e.decode=(r,i)=>ff(e,r,i),e.encodeAsync=async(r,i)=>mf(e,r,i),e.decodeAsync=async(r,i)=>pf(e,r,i),e.safeEncode=(r,i)=>hf(e,r,i),e.safeDecode=(r,i)=>gf(e,r,i),e.safeEncodeAsync=async(r,i)=>vf(e,r,i),e.safeDecodeAsync=async(r,i)=>bf(e,r,i),e.refine=(r,i)=>e.check(aa(r,i)),e.superRefine=r=>e.check(ua(r)),e.overwrite=r=>e.check(Ae(r)),e.optional=()=>Et(e),e.exactOptional=()=>Fo(e),e.nullable=()=>Ot(e),e.nullish=()=>Et(Ot(e)),e.nonoptional=r=>Wo(e,r),e.array=()=>Yt(e),e.or=r=>kr([e,r]),e.and=r=>Do(e,r),e.transform=r=>Ut(e,xr(r)),e.default=r=>Ko(e,r),e.prefault=r=>Go(e,r),e.catch=r=>Xo(e,r),e.pipe=r=>Ut(e,r),e.readonly=()=>ea(e),e.describe=r=>{const i=e.clone();return be.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=be.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return be.get(e);const i=e.clone();return be.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ir=p("_ZodString",(e,t)=>{Ft.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(i,n,o)=>gd(e,i,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Jn(...i)),e.includes=(...i)=>e.check(Hn(...i)),e.startsWith=(...i)=>e.check(qn(...i)),e.endsWith=(...i)=>e.check(Xn(...i)),e.min=(...i)=>e.check(Qe(...i)),e.max=(...i)=>e.check(Bt(...i)),e.length=(...i)=>e.check(Kt(...i)),e.nonempty=(...i)=>e.check(Qe(1,...i)),e.lowercase=i=>e.check(Gn(i)),e.uppercase=i=>e.check(Wn(i)),e.trim=()=>e.check(er()),e.normalize=(...i)=>e.check(Qn(...i)),e.toLowerCase=()=>e.check(tr()),e.toUpperCase=()=>e.check(nr()),e.slugify=()=>e.check(rr())}),Gt=p("ZodString",(e,t)=>{Ft.init(e,t),ir.init(e,t),e.email=r=>e.check(Zi(or,r)),e.url=r=>e.check(Kn(Wt,r)),e.jwt=r=>e.check(io(yr,r)),e.emoji=r=>e.check(Bi(ar,r)),e.guid=r=>e.check(zn(zt,r)),e.uuid=r=>e.check(Mi(ze,r)),e.uuidv4=r=>e.check(Ri(ze,r)),e.uuidv6=r=>e.check(Fi(ze,r)),e.uuidv7=r=>e.check(Vi(ze,r)),e.nanoid=r=>e.check(Ki(ur,r)),e.guid=r=>e.check(zn(zt,r)),e.cuid=r=>e.check(Ji(cr,r)),e.cuid2=r=>e.check(Gi(sr,r)),e.ulid=r=>e.check(Wi(lr,r)),e.base64=r=>e.check(to(vr,r)),e.base64url=r=>e.check(no(br,r)),e.xid=r=>e.check(Hi(dr,r)),e.ksuid=r=>e.check(qi(fr,r)),e.ipv4=r=>e.check(Xi(mr,r)),e.ipv6=r=>e.check(Yi(pr,r)),e.cidrv4=r=>e.check(Qi(hr,r)),e.cidrv6=r=>e.check(eo(gr,r)),e.e164=r=>e.check(ro(_r,r)),e.datetime=r=>e.check(ef(r)),e.date=r=>e.check(tf(r)),e.time=r=>e.check(nf(r)),e.duration=r=>e.check(rf(r))});function En(e){return El(Gt,e)}const H=p("ZodStringFormat",(e,t)=>{W.init(e,t),ir.init(e,t)}),or=p("ZodEmail",(e,t)=>{ds.init(e,t),H.init(e,t)});function _f(e){return Zi(or,e)}const zt=p("ZodGUID",(e,t)=>{ss.init(e,t),H.init(e,t)});function yf(e){return zn(zt,e)}const ze=p("ZodUUID",(e,t)=>{ls.init(e,t),H.init(e,t)});function $f(e){return Mi(ze,e)}function wf(e){return Ri(ze,e)}function Sf(e){return Fi(ze,e)}function kf(e){return Vi(ze,e)}const Wt=p("ZodURL",(e,t)=>{fs.init(e,t),H.init(e,t)});function If(e){return Kn(Wt,e)}function xf(e){return Kn(Wt,{protocol:/^https?$/,hostname:xc,...b(e)})}const ar=p("ZodEmoji",(e,t)=>{ms.init(e,t),H.init(e,t)});function Tf(e){return Bi(ar,e)}const ur=p("ZodNanoID",(e,t)=>{ps.init(e,t),H.init(e,t)});function zf(e){return Ki(ur,e)}const cr=p("ZodCUID",(e,t)=>{hs.init(e,t),H.init(e,t)});function Ef(e){return Ji(cr,e)}const sr=p("ZodCUID2",(e,t)=>{gs.init(e,t),H.init(e,t)});function Of(e){return Gi(sr,e)}const lr=p("ZodULID",(e,t)=>{vs.init(e,t),H.init(e,t)});function Uf(e){return Wi(lr,e)}const dr=p("ZodXID",(e,t)=>{bs.init(e,t),H.init(e,t)});function Df(e){return Hi(dr,e)}const fr=p("ZodKSUID",(e,t)=>{_s.init(e,t),H.init(e,t)});function Nf(e){return qi(fr,e)}const mr=p("ZodIPv4",(e,t)=>{ks.init(e,t),H.init(e,t)});function jf(e){return Xi(mr,e)}const vo=p("ZodMAC",(e,t)=>{xs.init(e,t),H.init(e,t)});function Pf(e){return Ul(vo,e)}const pr=p("ZodIPv6",(e,t)=>{Is.init(e,t),H.init(e,t)});function Af(e){return Yi(pr,e)}const hr=p("ZodCIDRv4",(e,t)=>{Ts.init(e,t),H.init(e,t)});function Cf(e){return Qi(hr,e)}const gr=p("ZodCIDRv6",(e,t)=>{zs.init(e,t),H.init(e,t)});function Lf(e){return eo(gr,e)}const vr=p("ZodBase64",(e,t)=>{Es.init(e,t),H.init(e,t)});function Zf(e){return to(vr,e)}const br=p("ZodBase64URL",(e,t)=>{Us.init(e,t),H.init(e,t)});function Mf(e){return no(br,e)}const _r=p("ZodE164",(e,t)=>{Ds.init(e,t),H.init(e,t)});function Rf(e){return ro(_r,e)}const yr=p("ZodJWT",(e,t)=>{js.init(e,t),H.init(e,t)});function Ff(e){return io(yr,e)}const yt=p("ZodCustomStringFormat",(e,t)=>{Ps.init(e,t),H.init(e,t)});function Vf(e,t,r={}){return Jt(yt,e,t,r)}function Bf(e){return Jt(yt,"hostname",Ic,e)}function Kf(e){return Jt(yt,"hex",Rc,e)}function Jf(e,t){const r=(t==null?void 0:t.enc)??"hex",i=`${e}_${r}`,n=zi[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Jt(yt,i,n,t)}const Ht=p("ZodNumber",(e,t)=>{Di.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(i,n,o)=>vd(e,i,n),e.gt=(i,n)=>e.check(Ve(i,n)),e.gte=(i,n)=>e.check(fe(i,n)),e.min=(i,n)=>e.check(fe(i,n)),e.lt=(i,n)=>e.check(Fe(i,n)),e.lte=(i,n)=>e.check(_e(i,n)),e.max=(i,n)=>e.check(_e(i,n)),e.int=i=>e.check(On(i)),e.safe=i=>e.check(On(i)),e.positive=i=>e.check(Ve(0,i)),e.nonnegative=i=>e.check(fe(0,i)),e.negative=i=>e.check(Fe(0,i)),e.nonpositive=i=>e.check(_e(0,i)),e.multipleOf=(i,n)=>e.check(mt(i,n)),e.step=(i,n)=>e.check(mt(i,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function bo(e){return Cl(Ht,e)}const nt=p("ZodNumberFormat",(e,t)=>{As.init(e,t),Ht.init(e,t)});function On(e){return Zl(nt,e)}function Gf(e){return Ml(nt,e)}function Wf(e){return Rl(nt,e)}function Hf(e){return Fl(nt,e)}function qf(e){return Vl(nt,e)}const qt=p("ZodBoolean",(e,t)=>{Ni.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>bd(e,r,i)});function _o(e){return Bl(qt,e)}const Xt=p("ZodBigInt",(e,t)=>{ji.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(i,n,o)=>_d(e,i),e.gte=(i,n)=>e.check(fe(i,n)),e.min=(i,n)=>e.check(fe(i,n)),e.gt=(i,n)=>e.check(Ve(i,n)),e.gte=(i,n)=>e.check(fe(i,n)),e.min=(i,n)=>e.check(fe(i,n)),e.lt=(i,n)=>e.check(Fe(i,n)),e.lte=(i,n)=>e.check(_e(i,n)),e.max=(i,n)=>e.check(_e(i,n)),e.positive=i=>e.check(Ve(BigInt(0),i)),e.negative=i=>e.check(Fe(BigInt(0),i)),e.nonpositive=i=>e.check(_e(BigInt(0),i)),e.nonnegative=i=>e.check(fe(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(mt(i,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Xf(e){return Jl(Xt,e)}const $r=p("ZodBigIntFormat",(e,t)=>{Cs.init(e,t),Xt.init(e,t)});function Yf(e){return Wl($r,e)}function Qf(e){return Hl($r,e)}const yo=p("ZodSymbol",(e,t)=>{Ls.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>yd(e,r)});function em(e){return ql(yo,e)}const $o=p("ZodUndefined",(e,t)=>{Zs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>wd(e,r)});function tm(e){return Xl($o,e)}const wo=p("ZodNull",(e,t)=>{Ms.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>$d(e,r,i)});function So(e){return Yl(wo,e)}const ko=p("ZodAny",(e,t)=>{Rs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Id()});function nm(){return Ql(ko)}const Io=p("ZodUnknown",(e,t)=>{Fs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>xd()});function et(){return ed(Io)}const xo=p("ZodNever",(e,t)=>{Vs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>kd(e,r,i)});function wr(e){return td(xo,e)}const To=p("ZodVoid",(e,t)=>{Bs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Sd(e,r)});function rm(e){return nd(To,e)}const Sr=p("ZodDate",(e,t)=>{Ks.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Td(e,i),e.min=(i,n)=>e.check(fe(i,n)),e.max=(i,n)=>e.check(_e(i,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function im(e){return rd(Sr,e)}const zo=p("ZodArray",(e,t)=>{Js.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Zd(e,r,i,n),e.element=t.element,e.min=(r,i)=>e.check(Qe(r,i)),e.nonempty=r=>e.check(Qe(1,r)),e.max=(r,i)=>e.check(Bt(r,i)),e.length=(r,i)=>e.check(Kt(r,i)),e.unwrap=()=>e.element});function Yt(e,t){return ad(zo,e,t)}function om(e){const t=e._zod.def.shape;return Ir(Object.keys(t))}const Qt=p("ZodObject",(e,t)=>{qs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Md(e,r,i,n),M(e,"shape",()=>t.shape),e.keyof=()=>Ir(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:et()}),e.loose=()=>e.clone({...e._zod.def,catchall:et()}),e.strict=()=>e.clone({...e._zod.def,catchall:wr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Wu(e,r),e.safeExtend=r=>Hu(e,r),e.merge=r=>qu(e,r),e.pick=r=>Ju(e,r),e.omit=r=>Gu(e,r),e.partial=(...r)=>Xu(Tr,e,r[0]),e.required=(...r)=>Yu(zr,e,r[0])});function am(e,t){const r={type:"object",shape:e??{},...b(t)};return new Qt(r)}function um(e,t){return new Qt({type:"object",shape:e,catchall:wr(),...b(t)})}function cm(e,t){return new Qt({type:"object",shape:e,catchall:et(),...b(t)})}const en=p("ZodUnion",(e,t)=>{Bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lo(e,r,i,n),e.options=t.options});function kr(e,t){return new en({type:"union",options:e,...b(t)})}const Eo=p("ZodXor",(e,t)=>{en.init(e,t),Xs.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lo(e,r,i,n),e.options=t.options});function sm(e,t){return new Eo({type:"union",options:e,inclusive:!1,...b(t)})}const Oo=p("ZodDiscriminatedUnion",(e,t)=>{en.init(e,t),Ys.init(e,t)});function lm(e,t,r){return new Oo({type:"union",options:t,discriminator:e,...b(r)})}const Uo=p("ZodIntersection",(e,t)=>{Qs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Rd(e,r,i,n)});function Do(e,t){return new Uo({type:"intersection",left:e,right:t})}const No=p("ZodTuple",(e,t)=>{Pi.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Fd(e,r,i,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function jo(e,t,r){const i=t instanceof C,n=i?r:t,o=i?t:null;return new No({type:"tuple",items:e,rest:o,...b(n)})}const tn=p("ZodRecord",(e,t)=>{el.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Vd(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function Po(e,t,r){return new tn({type:"record",keyType:e,valueType:t,...b(r)})}function dm(e,t,r){const i=$e(e);return i._zod.values=void 0,new tn({type:"record",keyType:i,valueType:t,...b(r)})}function fm(e,t,r){return new tn({type:"record",keyType:e,valueType:t,mode:"loose",...b(r)})}const Ao=p("ZodMap",(e,t)=>{tl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Cd(e,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Be(...r)),e.nonempty=r=>e.check(Be(1,r)),e.max=(...r)=>e.check(_t(...r)),e.size=(...r)=>e.check(Vt(...r))});function mm(e,t,r){return new Ao({type:"map",keyType:e,valueType:t,...b(r)})}const Co=p("ZodSet",(e,t)=>{nl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ld(e,r),e.min=(...r)=>e.check(Be(...r)),e.nonempty=r=>e.check(Be(1,r)),e.max=(...r)=>e.check(_t(...r)),e.size=(...r)=>e.check(Vt(...r))});function pm(e,t){return new Co({type:"set",valueType:e,...b(t)})}const vt=p("ZodEnum",(e,t)=>{rl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(i,n,o)=>zd(e,i,n),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const o={};for(const a of i)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new vt({...t,checks:[],...b(n),entries:o})},e.exclude=(i,n)=>{const o={...t.entries};for(const a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new vt({...t,checks:[],...b(n),entries:o})}});function Ir(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new vt({type:"enum",entries:r,...b(t)})}function hm(e,t){return new vt({type:"enum",entries:e,...b(t)})}const Lo=p("ZodLiteral",(e,t)=>{il.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ed(e,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gm(e,t){return new Lo({type:"literal",values:Array.isArray(e)?e:[e],...b(t)})}const Zo=p("ZodFile",(e,t)=>{ol.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Dd(e,r,i),e.min=(r,i)=>e.check(Be(r,i)),e.max=(r,i)=>e.check(_t(r,i)),e.mime=(r,i)=>e.check(Yn(Array.isArray(r)?r:[r],i))});function vm(e){return ud(Zo,e)}const Mo=p("ZodTransform",(e,t)=>{al.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ad(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zn(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(dt(o,r.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(dt(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function xr(e){return new Mo({type:"transform",transform:e})}const Tr=p("ZodOptional",(e,t)=>{Ai.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>fo(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Et(e){return new Tr({type:"optional",innerType:e})}const Ro=p("ZodExactOptional",(e,t)=>{ul.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>fo(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Fo(e){return new Ro({type:"optional",innerType:e})}const Vo=p("ZodNullable",(e,t)=>{cl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Bd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Ot(e){return new Vo({type:"nullable",innerType:e})}function bm(e){return Et(Ot(e))}const Bo=p("ZodDefault",(e,t)=>{sl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Jd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ko(e,t){return new Bo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Rn(t)}})}const Jo=p("ZodPrefault",(e,t)=>{ll.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Gd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Go(e,t){return new Jo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Rn(t)}})}const zr=p("ZodNonOptional",(e,t)=>{dl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Kd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Wo(e,t){return new zr({type:"nonoptional",innerType:e,...b(t)})}const Ho=p("ZodSuccess",(e,t)=>{fl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Nd(e,r,i),e.unwrap=()=>e._zod.def.innerType});function _m(e){return new Ho({type:"success",innerType:e})}const qo=p("ZodCatch",(e,t)=>{ml.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Wd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xo(e,t){return new qo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Yo=p("ZodNaN",(e,t)=>{pl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Od(e,r)});function ym(e){return od(Yo,e)}const Er=p("ZodPipe",(e,t)=>{hl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Hd(e,r,i,n),e.in=t.in,e.out=t.out});function Ut(e,t){return new Er({type:"pipe",in:e,out:t})}const Or=p("ZodCodec",(e,t)=>{Er.init(e,t),Ci.init(e,t)});function $m(e,t,r){return new Or({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}const Qo=p("ZodReadonly",(e,t)=>{gl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>qd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function ea(e){return new Qo({type:"readonly",innerType:e})}const ta=p("ZodTemplateLiteral",(e,t)=>{vl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ud(e,r,i)});function wm(e,t){return new ta({type:"template_literal",parts:e,...b(t)})}const na=p("ZodLazy",(e,t)=>{yl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Yd(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function ra(e){return new na({type:"lazy",getter:e})}const ia=p("ZodPromise",(e,t)=>{_l.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Xd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Sm(e){return new ia({type:"promise",innerType:e})}const oa=p("ZodFunction",(e,t)=>{bl.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Pd(e,r)});function Un(e){return new oa({type:"function",input:Array.isArray(e==null?void 0:e.input)?jo(e==null?void 0:e.input):(e==null?void 0:e.input)??Yt(et()),output:(e==null?void 0:e.output)??et()})}const nn=p("ZodCustom",(e,t)=>{$l.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,i,n)=>jd(e,r)});function km(e){const t=new q({check:"custom"});return t._zod.check=e,t}function Im(e,t){return cd(nn,e??(()=>!0),t)}function aa(e,t={}){return sd(nn,e,t)}function ua(e){return ld(e)}const xm=fd,Tm=md;function zm(e,t={}){const r=new nn({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...b(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}const Em=(...e)=>pd({Codec:Or,Boolean:qt,String:Gt},...e);function Om(e){const t=ra(()=>kr([En(e),bo(),_o(),So(),Yt(t),Po(En(),t)]));return t}function Um(e,t){return Ut(xr(e),t)}const j1=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:ko,ZodArray:zo,ZodBase64:vr,ZodBase64URL:br,ZodBigInt:Xt,ZodBigIntFormat:$r,ZodBoolean:qt,ZodCIDRv4:hr,ZodCIDRv6:gr,ZodCUID:cr,ZodCUID2:sr,ZodCatch:qo,ZodCodec:Or,ZodCustom:nn,ZodCustomStringFormat:yt,ZodDate:Sr,ZodDefault:Bo,ZodDiscriminatedUnion:Oo,ZodE164:_r,ZodEmail:or,ZodEmoji:ar,ZodEnum:vt,ZodExactOptional:Ro,ZodFile:Zo,ZodFunction:oa,ZodGUID:zt,ZodIPv4:mr,ZodIPv6:pr,ZodIntersection:Uo,ZodJWT:yr,ZodKSUID:fr,ZodLazy:na,ZodLiteral:Lo,ZodMAC:vo,ZodMap:Ao,ZodNaN:Yo,ZodNanoID:ur,ZodNever:xo,ZodNonOptional:zr,ZodNull:wo,ZodNullable:Vo,ZodNumber:Ht,ZodNumberFormat:nt,ZodObject:Qt,ZodOptional:Tr,ZodPipe:Er,ZodPrefault:Jo,ZodPromise:ia,ZodReadonly:Qo,ZodRecord:tn,ZodSet:Co,ZodString:Gt,ZodStringFormat:H,ZodSuccess:Ho,ZodSymbol:yo,ZodTemplateLiteral:ta,ZodTransform:Mo,ZodTuple:No,ZodType:Z,ZodULID:lr,ZodURL:Wt,ZodUUID:ze,ZodUndefined:$o,ZodUnion:en,ZodUnknown:Io,ZodVoid:To,ZodXID:dr,ZodXor:Eo,_ZodString:ir,_default:Ko,_function:Un,any:nm,array:Yt,base64:Zf,base64url:Mf,bigint:Xf,boolean:_o,catch:Xo,check:km,cidrv4:Cf,cidrv6:Lf,codec:$m,cuid:Ef,cuid2:Of,custom:Im,date:im,describe:xm,discriminatedUnion:lm,e164:Rf,email:_f,emoji:Tf,enum:Ir,exactOptional:Fo,file:vm,float32:Gf,float64:Wf,function:Un,guid:yf,hash:Jf,hex:Kf,hostname:Bf,httpUrl:xf,instanceof:zm,int:On,int32:Hf,int64:Yf,intersection:Do,ipv4:jf,ipv6:Af,json:Om,jwt:Ff,keyof:om,ksuid:Nf,lazy:ra,literal:gm,looseObject:cm,looseRecord:fm,mac:Pf,map:mm,meta:Tm,nan:ym,nanoid:zf,nativeEnum:hm,never:wr,nonoptional:Wo,null:So,nullable:Ot,nullish:bm,number:bo,object:am,optional:Et,partialRecord:dm,pipe:Ut,prefault:Go,preprocess:Um,promise:Sm,readonly:ea,record:Po,refine:aa,set:pm,strictObject:um,string:En,stringFormat:Vf,stringbool:Em,success:_m,superRefine:ua,symbol:em,templateLiteral:wm,transform:xr,tuple:jo,uint32:qf,uint64:Qf,ulid:Uf,undefined:tm,union:kr,unknown:et,url:If,uuid:$f,uuidv4:wf,uuidv6:Sf,uuidv7:kf,void:rm,xid:Df,xor:sm},Symbol.toStringTag,{value:"Module"})),P1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function A1(e){se({customError:e})}function C1(){return se().customError}var ai;ai||(ai={});const I={...j1,...D1,iso:of},L1=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Z1(e,t){const r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function M1(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;const i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){const n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Dm(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return I.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return I.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);const o=M1(n,t),a=ue(o,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){const n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return I.null();if(n.length===0)return I.never();if(n.length===1)return I.literal(n[0]);if(n.every(a=>typeof a=="string"))return I.enum(n);const o=n.map(a=>I.literal(a));return o.length<2?o[0]:I.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return I.literal(e.const);const r=e.type;if(Array.isArray(r)){const n=r.map(o=>{const a={...e,type:o};return Dm(a,t)});return n.length===0?I.never():n.length===1?n[0]:I.union(n)}if(!r)return I.any();let i;switch(r){case"string":{let n=I.string();if(e.format){const o=e.format;o==="email"?n=n.check(I.email()):o==="uri"||o==="uri-reference"?n=n.check(I.url()):o==="uuid"||o==="guid"?n=n.check(I.uuid()):o==="date-time"?n=n.check(I.iso.datetime()):o==="date"?n=n.check(I.iso.date()):o==="time"?n=n.check(I.iso.time()):o==="duration"?n=n.check(I.iso.duration()):o==="ipv4"?n=n.check(I.ipv4()):o==="ipv6"?n=n.check(I.ipv6()):o==="mac"?n=n.check(I.mac()):o==="cidr"?n=n.check(I.cidrv4()):o==="cidr-v6"?n=n.check(I.cidrv6()):o==="base64"?n=n.check(I.base64()):o==="base64url"?n=n.check(I.base64url()):o==="e164"?n=n.check(I.e164()):o==="jwt"?n=n.check(I.jwt()):o==="emoji"?n=n.check(I.emoji()):o==="nanoid"?n=n.check(I.nanoid()):o==="cuid"?n=n.check(I.cuid()):o==="cuid2"?n=n.check(I.cuid2()):o==="ulid"?n=n.check(I.ulid()):o==="xid"?n=n.check(I.xid()):o==="ksuid"&&(n=n.check(I.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?I.number().int():I.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),i=n;break}case"boolean":{i=I.boolean();break}case"null":{i=I.null();break}case"object":{const n={},o=e.properties||{},a=new Set(e.required||[]);for(const[s,c]of Object.entries(o)){const l=ue(c,t);n[s]=a.has(s)?l:l.optional()}if(e.propertyNames){const s=ue(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?ue(e.additionalProperties,t):I.any();if(Object.keys(n).length===0){i=I.record(s,c);break}const l=I.object(n).passthrough(),d=I.looseRecord(s,c);i=I.intersection(l,d);break}if(e.patternProperties){const s=e.patternProperties,c=Object.keys(s),l=[];for(const f of c){const m=ue(s[f],t),g=I.string().regex(new RegExp(f));l.push(I.looseRecord(g,m))}const d=[];if(Object.keys(n).length>0&&d.push(I.object(n).passthrough()),d.push(...l),d.length===0)i=I.object({}).passthrough();else if(d.length===1)i=d[0];else{let f=I.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=I.intersection(f,d[m]);i=f}break}const u=I.object(n);e.additionalProperties===!1?i=u.strict():typeof e.additionalProperties=="object"?i=u.catchall(ue(e.additionalProperties,t)):i=u.passthrough();break}case"array":{const n=e.prefixItems,o=e.items;if(n&&Array.isArray(n)){const a=n.map(s=>ue(s,t)),u=o&&typeof o=="object"&&!Array.isArray(o)?ue(o,t):void 0;u?i=I.tuple(a).rest(u):i=I.tuple(a),typeof e.minItems=="number"&&(i=i.check(I.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(I.maxLength(e.maxItems)))}else if(Array.isArray(o)){const a=o.map(s=>ue(s,t)),u=e.additionalItems&&typeof e.additionalItems=="object"?ue(e.additionalItems,t):void 0;u?i=I.tuple(a).rest(u):i=I.tuple(a),typeof e.minItems=="number"&&(i=i.check(I.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(I.maxLength(e.maxItems)))}else if(o!==void 0){const a=ue(o,t);let u=I.array(a);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),i=u}else i=I.array(I.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}function ue(e,t){if(typeof e=="boolean")return e?I.any():I.never();let r=Dm(e,t);const i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const u=e.anyOf.map(c=>ue(c,t)),s=I.union(u);r=i?I.intersection(r,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){const u=e.oneOf.map(c=>ue(c,t)),s=I.xor(u);r=i?I.intersection(r,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:I.any();else{let u=i?r:ue(e.allOf[0],t);const s=i?0:1;for(let c=s;c<e.allOf.length;c++)u=I.intersection(u,ue(e.allOf[c],t));r=u}e.nullable===!0&&t.version==="openapi-3.0"&&(r=I.nullable(r)),e.readOnly===!0&&(r=I.readonly(r));const n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const u of o)u in e&&(n[u]=e[u]);const a=["contentEncoding","contentMediaType","contentSchema"];for(const u of a)u in e&&(n[u]=e[u]);for(const u of Object.keys(e))L1.has(u)||(n[u]=e[u]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function R1(e,t){if(typeof e=="boolean")return e?I.any():I.never();const r=Z1(e,t==null?void 0:t.defaultTarget),i=e.$defs||e.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:(t==null?void 0:t.registry)??be};return ue(e,n)}function F1(e){return Ol(Gt,e)}function V1(e){return Ll(Ht,e)}function B1(e){return Kl(qt,e)}function K1(e){return Gl(Xt,e)}function J1(e){return id(Sr,e)}const G1=Object.freeze(Object.defineProperty({__proto__:null,bigint:K1,boolean:B1,date:J1,number:V1,string:F1},Symbol.toStringTag,{value:"Module"}));se(wl());const Qa=Object.freeze(Object.defineProperty({__proto__:null,$brand:Lu,$input:Tl,$output:xl,NEVER:Cu,TimePrecision:Dl,ZodAny:ko,ZodArray:zo,ZodBase64:vr,ZodBase64URL:br,ZodBigInt:Xt,ZodBigIntFormat:$r,ZodBoolean:qt,ZodCIDRv4:hr,ZodCIDRv6:gr,ZodCUID:cr,ZodCUID2:sr,ZodCatch:qo,ZodCodec:Or,ZodCustom:nn,ZodCustomStringFormat:yt,ZodDate:Sr,ZodDefault:Bo,ZodDiscriminatedUnion:Oo,ZodE164:_r,ZodEmail:or,ZodEmoji:ar,ZodEnum:vt,ZodError:N1,ZodExactOptional:Ro,ZodFile:Zo,get ZodFirstPartyTypeKind(){return ai},ZodFunction:oa,ZodGUID:zt,ZodIPv4:mr,ZodIPv6:pr,ZodISODate:po,ZodISODateTime:mo,ZodISODuration:go,ZodISOTime:ho,ZodIntersection:Uo,ZodIssueCode:P1,ZodJWT:yr,ZodKSUID:fr,ZodLazy:na,ZodLiteral:Lo,ZodMAC:vo,ZodMap:Ao,ZodNaN:Yo,ZodNanoID:ur,ZodNever:xo,ZodNonOptional:zr,ZodNull:wo,ZodNullable:Vo,ZodNumber:Ht,ZodNumberFormat:nt,ZodObject:Qt,ZodOptional:Tr,ZodPipe:Er,ZodPrefault:Jo,ZodPromise:ia,ZodReadonly:Qo,ZodRealError:ge,ZodRecord:tn,ZodSet:Co,ZodString:Gt,ZodStringFormat:H,ZodSuccess:Ho,ZodSymbol:yo,ZodTemplateLiteral:ta,ZodTransform:Mo,ZodTuple:No,ZodType:Z,ZodULID:lr,ZodURL:Wt,ZodUUID:ze,ZodUndefined:$o,ZodUnion:en,ZodUnknown:Io,ZodVoid:To,ZodXID:dr,ZodXor:Eo,_ZodString:ir,_default:Ko,_function:Un,any:nm,array:Yt,base64:Zf,base64url:Mf,bigint:Xf,boolean:_o,catch:Xo,check:km,cidrv4:Cf,cidrv6:Lf,clone:$e,codec:$m,coerce:G1,config:se,core:U1,cuid:Ef,cuid2:Of,custom:Im,date:im,decode:ff,decodeAsync:pf,describe:xm,discriminatedUnion:lm,e164:Rf,email:_f,emoji:Tf,encode:df,encodeAsync:mf,endsWith:Xn,enum:Ir,exactOptional:Fo,file:vm,flattenError:gi,float32:Gf,float64:Wf,formatError:vi,fromJSONSchema:R1,function:Un,getErrorMap:C1,globalRegistry:be,gt:Ve,gte:fe,guid:yf,hash:Jf,hex:Kf,hostname:Bf,httpUrl:xf,includes:Hn,instanceof:zm,int:On,int32:Hf,int64:Yf,intersection:Do,ipv4:jf,ipv6:Af,iso:of,json:Om,jwt:Ff,keyof:om,ksuid:Nf,lazy:ra,length:Kt,literal:gm,locales:Il,looseObject:cm,looseRecord:fm,lowercase:Gn,lt:Fe,lte:_e,mac:Pf,map:mm,maxLength:Bt,maxSize:_t,meta:Tm,mime:Yn,minLength:Qe,minSize:Be,multipleOf:mt,nan:ym,nanoid:zf,nativeEnum:hm,negative:ao,never:wr,nonnegative:co,nonoptional:Wo,nonpositive:uo,normalize:Qn,null:So,nullable:Ot,nullish:bm,number:bo,object:am,optional:Et,overwrite:Ae,parse:uf,parseAsync:cf,partialRecord:dm,pipe:Ut,positive:oo,prefault:Go,preprocess:Um,prettifyError:oc,promise:Sm,property:so,readonly:ea,record:Po,refine:aa,regex:Jn,regexes:zi,registry:Li,safeDecode:gf,safeDecodeAsync:bf,safeEncode:hf,safeEncodeAsync:vf,safeParse:sf,safeParseAsync:lf,set:pm,setErrorMap:A1,size:Vt,slugify:rr,startsWith:qn,strictObject:um,string:En,stringFormat:Vf,stringbool:Em,success:_m,superRefine:ua,symbol:em,templateLiteral:wm,toJSONSchema:Qd,toLowerCase:tr,toUpperCase:nr,transform:xr,treeifyError:rc,trim:er,tuple:jo,uint32:qf,uint64:Qf,ulid:Uf,undefined:tm,union:kr,unknown:et,uppercase:Wn,url:If,util:tc,uuid:$f,uuidv4:wf,uuidv6:Sf,uuidv7:kf,void:rm,xid:Df,xor:sm},Symbol.toStringTag,{value:"Module"}));function eu(e){const t=e.match(/^(.+)\/(flows|sources)\/([^/]+)$/);return t?[t[1],t[3]]:null}function W1(e){const t=e.filter(a=>a.timerange),r=t.filter(a=>a.format==="urn:x-nmos:format:video"||a.format==="urn:x-nmos:format:multi"),i=r.length?r:t;if(!i.length)return"()";const[n,o]=i.reduce(([a,u],s)=>{const c=N.parseTimeRange(s.timerange);let l=c.start?N.timeMomentToSeconds(c.start):null,d=c.end?N.timeMomentToSeconds(c.end):null;return(a===null||l!==null&&l<a)&&(a=l),(u===null||d!==null&&d>u)&&(u=d),[a,u]},[null,null]);return n===null||o===null?"()":N.formatTimeRangeExpr({start:N.secondsToTimeMoment(n),end:N.secondsToTimeMoment(o),isStartInclusive:!0,isEndInclusive:!1})}function tu(e,t){const r=N.parseTimeRange(t);if(r.start===void 0||r.end===void 0)throw new B.OmpError("Can't convert duration to timerange. Timerange is missing start and/or end.");const i=N.timeMomentToSeconds(r.start),n=N.timeMomentToSeconds(r.end);if(n-i<e)return console.warn("Provided duration is longer than timerange, using total timerange",t),t;const o=n-e;return N.formatTimeRangeExpr({start:N.secondsToTimeMoment(o),end:r.end,isEndInclusive:r.isEndInclusive,isStartInclusive:r.isStartInclusive})}function H1(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.substring(t.lastIndexOf("/")+1)}function nu(e){switch(e.type){case"basic":{const t=btoa(`${e.username}:${e.password}`);return()=>({headers:{Authorization:`Basic ${t}`}})}case"bearer":return()=>({headers:{Authorization:`Bearer ${e.token}`}});case"custom":return e.headers}}function q1(e){return Qa.object({ffomTimeZoneOffset:Qa.number().int().min(-23).max(23).optional()}).safeParse(e).success}const _n="omakase-virtual-flow";class ru{constructor(t,r){k(this,"_tamsApi");this._tamsApi=wh(t,r)}async fetchTamsResource(t){const i=(await this._tamsApi.getUrl(t)).data;return i.source_id?{flow:i}:{source:i}}fetchManifestResources(t,r){return new xt(i=>{(async()=>{try{const n=await this.fetchTamsResource(t);let o;if(n.flow?o=await this._fetchFlow(n.flow.id):o=await this._fetchFirstFlowBySourceId(n.source.id),!o)throw new B.OmpError("Source has no flow representations");const a=await this.fetchFlowResources(o,r);i.next(a),i.complete()}catch(n){i.error(n)}})()})}async fetchFlowResources(t,r){var s;const i=t.id===_n,n=await this._fetchSubflows(((s=t.flow_collection)==null?void 0:s.map(c=>c.id))??[]),o=W1(i?n:[t,...n]);if(o==="()")throw new B.OmpError("Provided TAMS media has no timerange");let a;r?typeof r=="number"?a=tu(r,o):a=N.timerangeDuration(r)>N.timerangeDuration(o)?o:r:a=tu(600,o);const u=await Promise.all([t,...n].map(async c=>[c.id,await this._fetchFlowSegments(c.id,a)]));return{flow:t,subflows:n,flowsSegments:new Map(u??[]),timerange:a}}async _fetchSubflows(t){let r=await Promise.all(t.map(async i=>await this._fetchFlow(i)));return r=r.filter(i=>!this._isFlowHlsIncompatible(i)),r}async _fetchFlow(t){return(await this._tamsApi.get(`/flows/${t}?include_timerange=true`)).data}async _fetchFirstFlowBySourceId(t){const i=(await this._tamsApi.get(`/flows?source_id=${t}`)).data.at(0);return i?await this._fetchFlow(i.id):void 0}async _fetchFlowSegments(t,r,i){if(t===_n)return[];const n=`/flows/${t}/segments${r?`?timerange=${r}`:""}${r?"&":"?"}limit=300`;let o=await this._tamsApi.get(n),a=o.data;for(;o.nextLink&&(!i||a.length<i);)o=await this._tamsApi.getUrl(o.nextLink),a=a.concat(o.data);return i&&(a=a.slice(0,i)),a}_isFlowHlsIncompatible(t){return!1}fetchManifestResourcesForMultipleFlows(t,r){return new xt(i=>{(async()=>{try{const n=await Promise.all(t.map(l=>this.fetchTamsResource(l)));if(n.some(l=>l.source))throw new Error("Source found in array of flows");const a=n.map(l=>l.flow);if(a.some(l=>l.format==="urn:x-nmos:format:multi"))throw new Error("Multiflow found in array of flows");if(a.filter(l=>l.format==="urn:x-nmos:format:video").length>1)throw new Error("Multiple video flows found in array of flows");const c=await this.fetchFlowResources({id:_n,source_id:"",format:"urn:x-nmos:format:multi",flow_collection:a.map(l=>({id:l.id,role:""}))},r);i.next(c),i.complete()}catch(n){i.error(n)}})()})}}var Lr,iu;function Nm(){if(iu)return Lr;iu=1;function e(s,c){this.message=s,this.error=c}e.prototype=Object.create(Error.prototype);const t=/([0-9]+)?:?([0-9]{2}):([0-9]{2}\.[0-9]{2,3})/;function r(s,c){c||(c={});const{meta:l=!1,strict:d=!0}=c;if(typeof s!="string")throw new e("Input must be a string");s=s.trim(),s=s.replace(/\r\n/g,`
|
|
64
|
+
`),s=s.replace(/\r/g,`
|
|
65
|
+
`);const f=s.split(`
|
|
45
66
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
`),m=f.shift();if(!m.startsWith("WEBVTT"))throw new e('Must start with "WEBVTT"');const g=m.split(`
|
|
68
|
+
`),h=g[0].replace("WEBVTT","");if(h.length>0&&h[0]!==" "&&h[0]!==" ")throw new e("Header comment must start with space or tab");if(f.length===0&&g.length===1)return{valid:!0,strict:d,cues:[],errors:[]};if(!l&&g.length>1&&g[1]!=="")throw new e("Missing blank line after signature");const{cues:v,errors:w}=n(f,d);if(d&&w.length>0)throw w[0];const T=l?i(g):null,z={valid:w.length===0,strict:d,cues:v,errors:w};return l&&(z.meta=T),z}function i(s){const c={};return s.slice(1).forEach(l=>{const d=l.indexOf(":"),f=l.slice(0,d).trim(),m=l.slice(d+1).trim();c[f]=m}),Object.keys(c).length>0?c:null}function n(s,c){const l=[];return{cues:s.map((f,m)=>{try{return o(f,m,c)}catch(g){return l.push(g),null}}).filter(Boolean),errors:l}}function o(s,c,l){let d="",f=0,m=.01,g="",h="";const v=s.split(`
|
|
69
|
+
`).filter(Boolean);if(v.length>0&&v[0].trim().startsWith("NOTE"))return null;if(v.length===1&&!v[0].includes("-->"))throw new e(`Cue identifier cannot be standalone (cue #${c})`);if(v.length>1&&!(v[0].includes("-->")||v[1].includes("-->"))){const T=`Cue identifier needs to be followed by timestamp (cue #${c})`;throw new e(T)}v.length>1&&v[1].includes("-->")&&(d=v.shift());const w=typeof v[0]=="string"&&v[0].split(" --> ");if(w.length!==2||!a(w[0])||!a(w[1]))throw new e(`Invalid cue timestamp (cue #${c})`);if(f=u(w[0]),m=u(w[1]),l){if(f>m)throw new e(`Start timestamp greater than end (cue #${c})`);if(m<=f)throw new e(`End must be greater than start (cue #${c})`)}if(!l&&m<f)throw new e(`End must be greater or equal to start when not strict (cue #${c})`);return h=w[1].replace(t,"").trim(),v.shift(),g=v.join(`
|
|
70
|
+
`),g?{identifier:d,start:f,end:m,text:g,styles:h}:!1}function a(s){return t.test(s)}function u(s){const c=s.match(t);let l=parseFloat(c[1]||0)*60*60;return l+=parseFloat(c[2])*60,l+=parseFloat(c[3]),l}return Lr={ParserError:e,parse:r},Lr}var Zr,ou;function X1(){if(ou)return Zr;ou=1;function e(c,l){this.message=c,this.error=l}e.prototype=Object.create(Error.prototype);function t(c){if(!c)throw new e("Input must be non-null");if(typeof c!="object")throw new e("Input must be an object");if(Array.isArray(c))throw new e("Input cannot be array");if(!c.valid)throw new e("Input must be valid");let l=`WEBVTT
|
|
71
|
+
`;if(c.meta){if(typeof c.meta!="object"||Array.isArray(c.meta))throw new e("Metadata must be an object");Object.entries(c.meta).forEach(f=>{if(typeof f[1]!="string")throw new e(`Metadata value for "${f[0]}" must be string`);l+=`${f[0]}: ${f[1]}
|
|
72
|
+
`})}let d=null;return c.cues.forEach((f,m)=>{if(d&&d>f.start)throw new e(`Cue number ${m} is not in chronological order`);d=f.start,l+=`
|
|
73
|
+
`,l+=r(f),l+=`
|
|
74
|
+
`}),l}function r(c){if(typeof c!="object")throw new e("Cue malformed: not of type object");if(typeof c.identifier!="string"&&typeof c.identifier!="number"&&c.identifier!==null)throw new e(`Cue malformed: identifier value is not a string.
|
|
75
|
+
${JSON.stringify(c)}`);if(isNaN(c.start))throw new e(`Cue malformed: null start value.
|
|
76
|
+
${JSON.stringify(c)}`);if(isNaN(c.end))throw new e(`Cue malformed: null end value.
|
|
77
|
+
${JSON.stringify(c)}`);if(c.start>=c.end)throw new e(`Cue malformed: start timestamp greater than end
|
|
78
|
+
${JSON.stringify(c)}`);if(typeof c.text!="string")throw new e(`Cue malformed: null text value.
|
|
79
|
+
${JSON.stringify(c)}`);if(typeof c.styles!="string")throw new e(`Cue malformed: null styles value.
|
|
80
|
+
${JSON.stringify(c)}`);let l="";c.identifier.length>0&&(l+=`${c.identifier}
|
|
81
|
+
`);const d=i(c.start),f=i(c.end);return l+=`${d} --> ${f}`,l+=c.styles?` ${c.styles}`:"",l+=`
|
|
82
|
+
${c.text}`,l}function i(c){const l=n(o(c),2),d=n(a(c),2),f=n(u(c),2),m=n(s(c),3);return`${l}:${d}:${f}.${m}`}function n(c,l){let d=`${c}`;for(;d.length<l;)d=`0${d}`;return d}function o(c){return Math.floor(c/60/60)}function a(c){return Math.floor(c/60)%60}function u(c){return Math.floor(c%60)}function s(c){return Math.floor((c%1).toFixed(4)*1e3)}return Zr={CompilerError:e,compile:t},Zr}var Mr,au;function jm(){if(au)return Mr;au=1;const e=Nm().parse;function t(a,u){u=u||10;const s=e(a),c=[];let l=[],d=null,f=0,m=0;return s.cues.forEach((g,h)=>{const v=h===0,w=h===s.cues.length-1,T=g.start,z=g.end,L=w?1/0:s.cues[h+1].start,F=v?z:z-T,j=v?0:T-s.cues[h-1].end;f=f+F+j,`${h}`,c.length+1,d&&(l.push(d),f+=d.end-m,d=null),l.push(g);let ee=L-z<u&&j<u&&f>u;if(r(m,u,L,j)){const te=i(w,z,u,f,m);c.push({duration:te,cues:l}),m+=te,f=0,l=[]}else ee=!1;ee&&(d=g)}),c}function r(a,u,s,c){const l=n(c,u);return(c<=u||l+a<s)&&s-a>=u}function i(a,u,s,c,l){let d=s;return c>s&&(d=n(c-s,s)),a?d=parseFloat((u-l).toFixed(2)):d=Math.round(d),d}function n(a,u){return a+=u-a%u,a}function o(a){}return Mr={segment:t},Mr}var Rr,uu;function Y1(){if(uu)return Rr;uu=1;const e=jm().segment;function t(l,d,f){typeof f>"u"&&(f="900000");const m=e(l,d),g=[];return m.forEach((h,v)=>{const w=`WEBVTT
|
|
83
|
+
X-TIMESTAMP-MAP=MPEGTS:${f},LOCAL:00:00:00.000
|
|
84
|
+
|
|
85
|
+
${u(h.cues)}
|
|
86
|
+
`,T=n(v);g.push({filename:T,content:w})}),g}function r(l,d){const f=e(l,d),m=o(f);return`#EXTM3U
|
|
87
|
+
#EXT-X-TARGETDURATION:${Math.round(a(f))}
|
|
49
88
|
#EXT-X-VERSION:3
|
|
50
89
|
#EXT-X-MEDIA-SEQUENCE:0
|
|
51
90
|
#EXT-X-PLAYLIST-TYPE:VOD
|
|
52
91
|
${m}
|
|
53
92
|
#EXT-X-ENDLIST
|
|
54
|
-
`}function
|
|
55
|
-
${
|
|
56
|
-
`)}function
|
|
93
|
+
`}function i(l,d){return`${"0".repeat(Math.max(0,d-l.toString().length))}${l}`}function n(l){return`${l}.vtt`}function o(l){const d=[];return l.forEach((f,m)=>{d.push(`#EXTINF:${f.duration.toFixed(5)},
|
|
94
|
+
${n(m)}`)}),d.join(`
|
|
95
|
+
`)}function a(l){let d=0;return l.forEach(f=>{f.duration>d&&(d=f.duration)}),d}function u(l){const d=[];return l.forEach(f=>{d.push(s(f))}),d.join(`
|
|
57
96
|
|
|
58
|
-
`)}function
|
|
59
|
-
`)}function
|
|
97
|
+
`)}function s(l){const d=[];l.identifier&&d.push(l.identifier);const f=c(l.start),m=c(l.end),g=l.styles?`${l.styles}`:"";return d.push(`${f} --> ${m} ${g}`),d.push(l.text),d.join(`
|
|
98
|
+
`)}function c(l){const d=(l%1).toFixed(3);l=Math.round(l-d);const f=Math.floor(l/3600),m=Math.floor((l-f*3600)/60),g=l-f*3600-m*60;return`${`${i(f,2)}:`}${i(m,2)}:${i(g,2)}.${i(d*1e3,3)}`}return Rr={hlsSegment:t,hlsSegmentPlaylist:r},Rr}var Fr,cu;function Q1(){if(cu)return Fr;cu=1;const e=Nm().parse,t=X1().compile,r=jm().segment,i=Y1();return Fr={parse:e,compile:t,segment:r,hls:i},Fr}var eb=Q1();async function tb(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch: ${e}`);const r=await t.arrayBuffer();return new TextDecoder("utf-8").decode(r)}function su(e){e<0&&(e=0);const t=Math.floor(e/3600).toString().padStart(2,"0"),r=Math.floor(e%3600/60).toString().padStart(2,"0"),i=(e%60).toFixed(3).padStart(6,"0");return`${t}:${r}:${i}`}async function nb(e,t){return e.length?await Promise.all(e.map(async i=>{const n=await tb(i),o=eb.parse(n,{strict:!1,meta:!0});let a=o.cues;t!==void 0&&(a=a.map(l=>({...l,start:l.start-t,end:l.end-t})).filter(l=>l.end>0).map(l=>({...l,start:Math.max(0,l.start),end:Math.max(0,l.end)})));const u=[];u.push("WEBVTT"),o.meta&&o.meta["X-TIMESTAMP-MAP=LOCAL"]&&u.push(`X-TIMESTAMP-MAP=LOCAL${o.meta["X-TIMESTAMP-MAP=LOCAL"]}`),u.push("");for(const l of a)u.push(`${su(l.start)} --> ${su(l.end)}`),u.push(l.text),u.push("");const s=u.join(`
|
|
60
99
|
`).trim()+`
|
|
61
|
-
`,
|
|
100
|
+
`,c=new Blob([s],{type:"text/vtt"});return URL.createObjectURL(c)})):[]}class rb{static slewSubtitlesFlows(t,r){return new xt(i=>{(async()=>{var n;try{const o=(n=t.subflows)==null?void 0:n.filter(a=>a.format==="urn:x-nmos:format:data"&&a.container==="text/vtt");o!=null&&o.length&&await Promise.all(o.map(async a=>{const u=t.flowsSegments.get(a.id),s=u.map(l=>{var d;return(d=l.get_urls)==null?void 0:d.at(-1).url});let c=await nb(s,r.mediaStartTime);c=c.map(l=>H1(l)),u.forEach((l,d)=>{l.get_urls=[{url:c.at(d)}]})})),i.next(),i.complete()}catch(o){i.error(o)}})()})}}class ib{static resolveLowestQualityImageFlow(t){const r=t.filter(n=>n.format==="urn:x-tam:format:image");return r.length===0?void 0:r.reduce((n,o)=>{if(n===void 0)return o;const a=n.essence_parameters.frame_width*n.essence_parameters.frame_height;return o.essence_parameters.frame_height*o.essence_parameters.frame_width<a?o:n},void 0)}static generateThumbnailVtt(t,r,i){let n=["WEBVTT",""];return t.forEach((o,a)=>{if((o.get_urls||[]).length===0)return;const s=N.timeMomentToSeconds(N.parseTimeRange(o.timerange).start);let c;if(a===t.length-1?c=r-.001:c=N.timeMomentToSeconds(N.parseTimeRange(t.at(a+1).timerange).start)-.001,c<=s){console.debug(`Malformed thumbnail vtt cue, skipped ${s} --> ${c}`);return}const l=this.toTimestamp(s-i),d=this.toTimestamp(c-i);n.push(`${l} --> ${d}`),n.push(o.get_urls.at(-1).url),n.push("")}),n.join(`
|
|
101
|
+
`)}static generateThumbnailVttBlob(t,r,i){const n=this.generateThumbnailVtt(t,r,i),o=new Blob([n],{type:"text/vtt"});return URL.createObjectURL(o)}static toTimestamp(t){const r=Math.floor(t/3600),i=Math.floor(t%3600/60),n=Math.floor(t%60),o=Math.round(t%1*1e3);return`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}.${String(o).padStart(3,"0")}`}static generateThumbnailTrackUrl(t,r,i,n){const o=this.resolveLowestQualityImageFlow(t);return o?this.generateThumbnailVttBlob(r.get(o.id),i,n):void 0}}class Pm{constructor(t){k(this,"_player");k(this,"_videoApiProxy");k(this,"_authenticationData");k(this,"_tamsEndpoint");this._player=new B.OmakasePlayer(t),this._videoApiProxy=new Au(this._player),this._authenticationData=t==null?void 0:t.authentication}loadVideo(t,r){if(r!=null&&r.duration&&(r!=null&&r.timerange)&&console.warn("Duration and timerange are both set. Using timerange."),this._videoApiProxy.loadOptions=structuredClone(r),typeof t=="string")if((r==null?void 0:r.protocol)===void 0){const i=this._tamsEndpoint??eu(t).at(0);if(i===null)throw Error("Provided URL is not pointing to TAMS");const n=new ru(i,this._authenticationData?nu(this._authenticationData):void 0),o=(r==null?void 0:r.timerange)??(r==null?void 0:r.duration),a=new ut;return n.fetchManifestResources(t,o).subscribe(u=>{r!=null&&r.duration&&(r.duration=N.timerangeDuration(u.timerange)),this._loadTamsMedia(u,r).subscribe(s=>{a.next(s),a.complete()})}),a}else return this._player.loadVideo(t,r);else if(Array.isArray(t)){if(r!=null&&r.protocol)throw new Error(`Protocol ${r.protocol} can't be used with TAMS media`);const i=this._tamsEndpoint??eu(t.at(0)).at(0);if(i===null)throw Error("Provided URL is not pointing to TAMS");const n=new ru(i,this._authenticationData?nu(this._authenticationData):void 0),o=new ut,a=(r==null?void 0:r.timerange)??(r==null?void 0:r.duration);return n.fetchManifestResourcesForMultipleFlows(t,a).subscribe(u=>{this._loadTamsMedia(u,r).subscribe(s=>{var c;s.tamsMediaData&&(s.tamsMediaData.flow=void 0,(c=s.tamsMediaData.flowsSegments)==null||c.delete(_n)),o.next(s),o.complete()})}),o}else return this._loadTamsMedia(t,r)}_loadTamsMedia(t,r){const i=new ut,n=rh([t.flow,...t.subflows??[]],t.flowsSegments,r==null?void 0:r.ffomTimeZoneOffset),o={protocol:"hls",ffom:n.ffom,frameRate:n.frameRate,dropFrame:n.dropFrame};let a;r?(r.protocol="hls",a={...o,...r,ffom:o.ffom}):a=o;const u=Ou(t.flow,t.subflows,t.flowsSegments);if(!u.valid)throw new Error(u.message);if(r&&!q1(r))throw new Error("Invalid ffomTimeZoneOffset");return rb.slewSubtitlesFlows(t,n).subscribe(()=>{const s=Uu(t.flow,t.subflows,t.flowsSegments);this._player.loadVideo(s.url,a).subscribe(c=>{this._videoApiProxy.mediaStartTime=n.mediaStartTime;const l=ib.generateThumbnailTrackUrl(t.subflows??[],t.flowsSegments,this._player.video.getDuration()+n.mediaStartTime,n.mediaStartTime);l&&this._player.chroming.setThumbnailVttUrl(l);const d={...c,mediaStartTime:n.mediaStartTime,tamsMediaData:r!=null&&r.returnTamsMediaData?t:void 0,thumbnailVttTrackUrl:l,videoUrls:s.video,audioUrls:s.audio,textUrls:s.text};this._videoApiProxy.setTamsVideo(d),i.next(d),i.complete(),this._videoApiProxy.emitVideoLoadedEvent()})}),i}createTimeline(t){return this._player.createTimeline(t)}createMarkerList(t){return this._player.createMarkerList(t)}initializeRouterVisualization(t){return this._player.initializeRouterVisualization(t)}setAuthentication(t){return this._authenticationData=t,this._player.setAuthentication(t)}get timeline(){return this._player.timeline}get audio(){return this._player.audio}get subtitles(){return this._player.subtitles}get config(){return this._player.config}set config(t){this._player.config=t}get chroming(){return this._player.chroming}destroy(){return this._player.destroy()}get video(){return this._videoApiProxy.proxy}setTamsEndpoint(t){this._tamsEndpoint=t}}class ob{constructor(t){k(this,"_lanes",[]);k(this,"_markersLaneMap",new Map);k(this,"_laneNodenMap",new Map);this.omakasePlayer=t}addMarkerLane(t){const r={config:t,type:"marker"};this._lanes.push(r)}addMarkers(t,r){this._markersLaneMap.get(t)===void 0&&this._markersLaneMap.set(t,[]),this._markersLaneMap.get(t).push(...r)}addTimelineNode(t,r){this._laneNodenMap.get(t)||this._laneNodenMap.set(t,[]),this._laneNodenMap.get(t).push(r)}addThumbnailLane(t){const r={config:t,type:"thumbnail"};this._lanes.push(r)}addLabelLane(t){const r={config:t,type:"label"};this._lanes.push(r)}addSubtitlesLane(t){const r={config:t,type:"subtitles"};this._lanes.push(r)}buildAndAttachTimeline(t){this.omakasePlayer.createTimeline(t).subscribe({next:r=>{this.buildAttachedTimeline(r)}})}buildAttachedTimeline(t){this._lanes.forEach(r=>this._createAndAttachLane(t,r))}_createAndAttachLane(t,r){let i;if(r.type==="marker"){i=new B.MarkerLane(r.config),t.addTimelineLane(i);const o=this._markersLaneMap.get(i.id);o==null||o.forEach(a=>i.addMarker(a))}else r.type==="thumbnail"?(i=new B.ThumbnailLane(r.config),t.addTimelineLane(i)):r.type==="label"?(i=new B.LabelLane(r.config),t.addTimelineLane(i)):r.type==="subtitles"&&(i=new B.SubtitlesLane(r.config),t.addTimelineLane(i));const n=this._laneNodenMap.get(i.id);n==null||n.forEach(o=>{i.addTimelineNode(o.config)})}}var ui=function(e,t){return ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},ui(e,t)};function rn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ui(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function ab(e,t,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(l){try{c(i.next(l))}catch(d){a(d)}}function s(l){try{c(i.throw(l))}catch(d){a(d)}}function c(l){l.done?o(l.value):n(l.value).then(u,s)}c((i=i.apply(e,t||[])).next())})}function Am(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function bt(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,o=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}function Nn(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,o;i<n;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function ct(e){return this instanceof ct?(this.v=e,this):new ct(e)}function ub(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(m){return function(g){return Promise.resolve(g).then(m,d)}}function u(m,g){i[m]&&(n[m]=function(h){return new Promise(function(v,w){o.push([m,h,v,w])>1||s(m,h)})},g&&(n[m]=g(n[m])))}function s(m,g){try{c(i[m](g))}catch(h){f(o[0][3],h)}}function c(m){m.value instanceof ct?Promise.resolve(m.value.v).then(l,d):f(o[0][2],m)}function l(m){s("next",m)}function d(m){s("throw",m)}function f(m,g){m(g),o.shift(),o.length&&s(o[0][0],o[0][1])}}function cb(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof bt=="function"?bt(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(u,s){a=e[o](a),n(u,s,a.done,a.value)})}}function n(o,a,u,s){Promise.resolve(s).then(function(c){o({value:c,done:u})},a)}}function re(e){return typeof e=="function"}function ca(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Vr=ca(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
102
|
+
`+r.map(function(i,n){return n+1+") "+i.toString()}).join(`
|
|
103
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function ci(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ur=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=bt(a),s=u.next();!s.done;s=u.next()){var c=s.value;c.remove(this)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(re(l))try{l()}catch(h){o=h instanceof Vr?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=bt(d),m=f.next();!m.done;m=f.next()){var g=m.value;try{lu(g)}catch(h){o=o??[],h instanceof Vr?o=Nn(Nn([],Dn(o)),Dn(h.errors)):o.push(h)}}}catch(h){i={error:h}}finally{try{m&&!m.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(o)throw new Vr(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)lu(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&ci(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ci(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Cm=Ur.EMPTY;function Lm(e){return e instanceof Ur||e&&"closed"in e&&re(e.remove)&&re(e.add)&&re(e.unsubscribe)}function lu(e){re(e)?e():e.unsubscribe()}var sb={Promise:void 0},lb={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Nn([e,t],Dn(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Zm(e){lb.setTimeout(function(){throw e})}function si(){}function yn(e){e()}var sa=(function(e){rn(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Lm(r)&&r.add(i)):i.destination=mb,i}return t.create=function(r,i,n){return new li(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Ur),db=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){dn(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){dn(i)}else dn(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){dn(r)}},e})(),li=(function(e){rn(t,e);function t(r,i,n){var o=e.call(this)||this,a;return re(r)||!r?a={next:r??void 0,error:i??void 0,complete:n??void 0}:a=r,o.destination=new db(a),o}return t})(sa);function dn(e){Zm(e)}function fb(e){throw e}var mb={closed:!0,next:si,error:fb,complete:si},la=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Dr(e){return e}function pb(e){return e.length===0?Dr:e.length===1?e[0]:function(r){return e.reduce(function(i,n){return n(i)},r)}}var pe=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,o=gb(t)?t:new li(t,r,i);return yn(function(){var a=n,u=a.operator,s=a.source;o.add(u?u.call(o,s):s?n._subscribe(o):n._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=du(r),new r(function(n,o){var a=new li({next:function(u){try{t(u)}catch(s){o(s),a.unsubscribe()}},error:o,complete:n});i.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[la]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return pb(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=du(t),new t(function(i,n){var o;r.subscribe(function(a){return o=a},function(a){return n(a)},function(){return i(o)})})},e.create=function(t){return new e(t)},e})();function du(e){var t;return(t=e??sb.Promise)!==null&&t!==void 0?t:Promise}function hb(e){return e&&re(e.next)&&re(e.error)&&re(e.complete)}function gb(e){return e&&e instanceof sa||hb(e)&&Lm(e)}function vb(e){return re(e==null?void 0:e.lift)}function Ge(e){return function(t){if(vb(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function We(e,t,r,i,n){return new bb(e,t,r,i,n)}var bb=(function(e){rn(t,e);function t(r,i,n,o,a,u){var s=e.call(this,r)||this;return s.onFinalize=a,s.shouldUnsubscribe=u,s._next=i?function(c){try{i(c)}catch(l){r.error(l)}}:e.prototype._next,s._error=o?function(c){try{o(c)}catch(l){r.error(l)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=n?function(){try{n()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(sa),_b=ca(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),He=(function(e){rn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new fu(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new _b},t.prototype.next=function(r){var i=this;yn(function(){var n,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=bt(i.currentObservers),u=a.next();!u.done;u=a.next()){var s=u.value;s.next(r)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;yn(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;yn(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,o=n.hasError,a=n.isStopped,u=n.observers;return o||a?Cm:(this.currentObservers=null,u.push(r),new Ur(function(){i.currentObservers=null,ci(u,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,o=i.thrownError,a=i.isStopped;n?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new pe;return r.source=this,r},t.create=function(r,i){return new fu(r,i)},t})(pe),fu=(function(e){rn(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Cm},t})(He),yb=new pe(function(e){return e.complete()});function $b(e){return e&&re(e.schedule)}function Mm(e){return e[e.length-1]}function wb(e){return re(Mm(e))?e.pop():void 0}function Sb(e){return $b(Mm(e))?e.pop():void 0}var Rm=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Fm(e){return re(e==null?void 0:e.then)}function Vm(e){return re(e[la])}function Bm(e){return Symbol.asyncIterator&&re(e==null?void 0:e[Symbol.asyncIterator])}function Km(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function kb(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Jm=kb();function Gm(e){return re(e==null?void 0:e[Jm])}function Wm(e){return ub(this,arguments,function(){var r,i,n,o;return Am(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ct(r.read())];case 3:return i=a.sent(),n=i.value,o=i.done,o?[4,ct(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ct(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Hm(e){return re(e==null?void 0:e.getReader)}function Nr(e){if(e instanceof pe)return e;if(e!=null){if(Vm(e))return Ib(e);if(Rm(e))return xb(e);if(Fm(e))return Tb(e);if(Bm(e))return qm(e);if(Gm(e))return zb(e);if(Hm(e))return Eb(e)}throw Km(e)}function Ib(e){return new pe(function(t){var r=e[la]();if(re(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function xb(e){return new pe(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Tb(e){return new pe(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Zm)})}function zb(e){return new pe(function(t){var r,i;try{for(var n=bt(e),o=n.next();!o.done;o=n.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function qm(e){return new pe(function(t){Ob(e,t).catch(function(r){return t.error(r)})})}function Eb(e){return qm(Wm(e))}function Ob(e,t){var r,i,n,o;return ab(this,void 0,void 0,function(){var a,u;return Am(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),r=cb(e),s.label=1;case 1:return[4,r.next()];case 2:if(i=s.sent(),!!i.done)return[3,4];if(a=i.value,t.next(a),t.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),n={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),i&&!i.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Me(e,t,r,i,n){i===void 0&&(i=0),n===void 0&&(n=!1);var o=t.schedule(function(){r(),n?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!n)return o}function Xm(e,t){return t===void 0&&(t=0),Ge(function(r,i){r.subscribe(We(i,function(n){return Me(i,e,function(){return i.next(n)},t)},function(){return Me(i,e,function(){return i.complete()},t)},function(n){return Me(i,e,function(){return i.error(n)},t)}))})}function Ym(e,t){return t===void 0&&(t=0),Ge(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function Ub(e,t){return Nr(e).pipe(Ym(t),Xm(t))}function Db(e,t){return Nr(e).pipe(Ym(t),Xm(t))}function Nb(e,t){return new pe(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function jb(e,t){return new pe(function(r){var i;return Me(r,t,function(){i=e[Jm](),Me(r,t,function(){var n,o,a;try{n=i.next(),o=n.value,a=n.done}catch(u){r.error(u);return}a?r.complete():r.next(o)},0,!0)}),function(){return re(i==null?void 0:i.return)&&i.return()}})}function Qm(e,t){if(!e)throw new Error("Iterable cannot be null");return new pe(function(r){Me(r,t,function(){var i=e[Symbol.asyncIterator]();Me(r,t,function(){i.next().then(function(n){n.done?r.complete():r.next(n.value)})},0,!0)})})}function Pb(e,t){return Qm(Wm(e),t)}function Ab(e,t){if(e!=null){if(Vm(e))return Ub(e,t);if(Rm(e))return Nb(e,t);if(Fm(e))return Db(e,t);if(Bm(e))return Qm(e,t);if(Gm(e))return jb(e,t);if(Hm(e))return Pb(e,t)}throw Km(e)}function ep(e,t){return t?Ab(e,t):Nr(e)}var tp=ca(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Cb(e,t){return Ge(function(r,i){var n=0;r.subscribe(We(i,function(o){i.next(e.call(t,o,n++))}))})}var Lb=Array.isArray;function Zb(e,t){return Lb(t)?e.apply(void 0,Nn([],Dn(t))):e(t)}function Mb(e){return Cb(function(t){return Zb(e,t)})}var Rb=Array.isArray,Fb=Object.getPrototypeOf,Vb=Object.prototype,Bb=Object.keys;function Kb(e){if(e.length===1){var t=e[0];if(Rb(t))return{args:t,keys:null};if(Jb(t)){var r=Bb(t);return{args:r.map(function(i){return t[i]}),keys:r}}}return{args:e,keys:null}}function Jb(e){return e&&typeof e=="object"&&Fb(e)===Vb}function Gb(e,t){return e.reduce(function(r,i,n){return r[i]=t[n],r},{})}function Wb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Sb(e),i=wb(e),n=Kb(e),o=n.args,a=n.keys;if(o.length===0)return ep([],r);var u=new pe(Hb(o,r,a?function(s){return Gb(a,s)}:Dr));return i?u.pipe(Mb(i)):u}function Hb(e,t,r){return r===void 0&&(r=Dr),function(i){mu(t,function(){for(var n=e.length,o=new Array(n),a=n,u=n,s=function(l){mu(t,function(){var d=ep(e[l],t),f=!1;d.subscribe(We(i,function(m){o[l]=m,f||(f=!0,u--),u||i.next(r(o.slice()))},function(){--a||i.complete()}))},i)},c=0;c<n;c++)s(c)},i)}}function mu(e,t,r){e?Me(r,e,t):t()}function qb(e,t){return Ge(function(r,i){var n=0;r.subscribe(We(i,function(o){return e.call(t,o,n++)&&i.next(o)}))})}function Xb(e){return Ge(function(t,r){var i=!1;t.subscribe(We(r,function(n){i=!0,r.next(n)},function(){i||r.next(e),r.complete()}))})}function Yb(e){return e<=0?function(){return yb}:Ge(function(t,r){var i=0;t.subscribe(We(r,function(n){++i<=e&&(r.next(n),e<=i&&r.complete())}))})}function Qb(e){return e===void 0&&(e=e_),Ge(function(t,r){var i=!1;t.subscribe(We(r,function(n){i=!0,r.next(n)},function(){return i?r.complete():r.error(e())}))})}function e_(){return new tp}function ot(e,t){var r=arguments.length>=2;return function(i){return i.pipe(Dr,Yb(1),r?Xb(t):Qb(function(){return new tp}))}}function ae(e){return Ge(function(t,r){Nr(e).subscribe(We(r,function(){return r.complete()},si)),!r.closed&&t.subscribe(r)})}class t_{constructor(){k(this,"actionZoomIn");k(this,"actionZoomOut");k(this,"actionResetZoom");k(this,"actionToggleNextAudioTrack");k(this,"actionTogglePreviousAudioTrack");k(this,"actionToggleCti")}getKeyboardShortcutsHelpMenuGroup(){let t=(...n)=>n.join(" + "),r="shift".toUpperCase();return{name:"Timeline function shortcuts",items:[{description:"Timeline Zoom In",name:t("=")},{description:"Timeline Zoom Out",name:t("-")},{description:"Timeline Zoom level 100%",name:t("0")},{description:"Toggle Next Audio Track",name:t(r,"e")},{description:"Toggle Previous Audio Track",name:t("e")},{description:"Toggle CTI into / out-of Interactive Mode",name:t("'")}]}}handleKeyboardEvent(t){const r=t.target;return["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"].includes(r.tagName.toUpperCase())?!1:t.code==="Equal"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionZoomIn&&this.actionZoomIn(),!0):t.code==="Minus"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionZoomOut&&this.actionZoomOut(),!0):t.code==="Digit0"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionResetZoom&&this.actionResetZoom(),!0):t.code==="KeyE"&&!t.ctrlKey&&!t.metaKey?(t.shiftKey?this.actionToggleNextAudioTrack&&this.actionToggleNextAudioTrack():this.actionTogglePreviousAudioTrack&&this.actionTogglePreviousAudioTrack(),!0):t.code==="Quote"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionToggleCti&&this.actionToggleCti(),!0):!1}}const n_=$.memo(({omakasePlayer:e,onTimelineCreatedCallback:t,timelineConfig:r,enableHotKeys:i})=>($.useEffect(()=>{if(r.timelineHTMLElementId===void 0&&(r.timelineHTMLElementId="omakase-timeline"),e.createTimeline(r).subscribe({next:n=>{Wb([e.timeline.onReady$,e.video.onVideoLoaded$.pipe(qb(o=>!!o))]).subscribe({next:()=>t(n)})}}),i===void 0||i){const n=new t_;n.actionToggleCti=()=>{var u;return(u=e.timeline)==null?void 0:u.toggleTimecodeEdit()},n.actionResetZoom=()=>{var u;return(u=e.timeline)==null?void 0:u.zoomToEased(100)},n.actionZoomIn=()=>{var u;return(u=e.timeline)==null?void 0:u.zoomInEased()},n.actionZoomOut=()=>{var u;return(u=e.timeline)==null?void 0:u.zoomOutEased()};const o=u=>{const s=e.audio.getAudioTracks(),c=e.audio.getActiveAudioTrack(),d=s.findIndex(f=>f.id===(c==null?void 0:c.id))+(u?-1:1);d>=0&&d<s.length&&e.audio.setActiveAudioTrack(s.at(d).id)};n.actionTogglePreviousAudioTrack=()=>o(!0),n.actionToggleNextAudioTrack=()=>o(!1);const a=u=>{n.handleKeyboardEvent(u)&&(u.preventDefault(),u.stopPropagation())};return window.addEventListener("keydown",a),e.chroming.appendHelpMenuGroup(n.getKeyboardShortcutsHelpMenuGroup()),()=>{window.removeEventListener("keydown",a)}}},[e]),$.createElement("div",{id:r.timelineHTMLElementId})));class np{static get window(){return window}static get navigator(){return window.navigator}static get userAgent(){var r;const t=((r=this.navigator)==null?void 0:r.userAgent)||"";return/Android/i.test(t)?"android":/Firefox/i.test(t)?"firefox":/Edg/i.test(t)?"edge":(/Chrome/i.test(t)||/CriOS/i.test(t))&&!/Edg/i.test(t)?"chrome":/Chrome/i.test(t)||/CriOS/i.test(t)?"chromium":/Safari/i.test(t)?"safari":"unknown"}static get platform(){var r,i,n;const t=((i=(r=this.navigator)==null?void 0:r.userAgentData)==null?void 0:i.platform)||((n=this.navigator)==null?void 0:n.platform);return t!=null&&t.toUpperCase().includes("MAC")?"macos":t!=null&&t.toUpperCase().includes("WIN")?"windows":t!=null&&t.toUpperCase().includes("LINUX")?"linux":"unknown"}static isUserAgent(t){return this.userAgent===t}static isPlatform(t){return this.platform===t}static open(t,r="_blank"){this.window.open(t,r)}}const St=[.25,.5,.75,1,2,4,8];class jn{static getKeyboardShortcutsHelpMenuGroup(){let t=(...o)=>o.join(" + "),r="shift".toUpperCase(),i="ctrl".toUpperCase();return{name:"Playback function shortcuts",items:[{description:"Play / Pause",name:t("Space")},{description:"Toggle Sound",name:t("s")},{description:"Toggle Text On / Off",name:t("d")},{description:"Toggle Full Screen",name:t("f")},{description:"Increase Volume",name:t(r,"\\")},{description:"Reduce Volume",name:t("\\")},{description:"One Frame Forward",name:t("Right Arrow")},{description:"One Frame Backward",name:t("Left Arrow")},{description:"10 Frames Forward",name:t(r,"Right Arrow")},{description:"10 Frames Backwards",name:t(r,"Left Arrow")},{description:"Stop shuttle and pause",name:t("k")},{description:"Decrease Shuttle Forwards",name:t("l")},{description:"Increase Shuttle Forwards",name:t(r,"l")},{description:"Set playhead to Start of Media and Stop",name:t("1 / Home")},{description:"Set playhead to End of Media and Stop",name:t(i,"1")+" / End"}]}}static handleKeyboardEvent(t,r){const i=t.target,n=["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"],o=np.userAgent;if(n.includes(i.tagName.toUpperCase()))return!1;if(r&&r.video){if(t.code==="Space"&&(o!=="safari"||!r.video.isFullscreen()))return r.video.togglePlayPause(),!0;if(t.code==="KeyS"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey)return r.audio.toggleAudioOutputMuteUnmute(),!0;if(t.code==="Backslash"){let a=10,u=t.shiftKey?1:-1,s=r.audio.getAudioOutputVolume()*100+a*u;s>=100?s=100:s<=0&&(s=0),r.audio.setAudioOutputVolume(s/100)}if(t.code==="KeyD"&&!(t.ctrlKey&&t.shiftKey&&t.metaKey))return r.subtitles.toggleShowHideActiveTrack(),!0;if(t.code==="KeyK"&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey&&(r.video.setPlaybackRate(1),r.video.pause()),t.code==="KeyL"&&!t.ctrlKey&&!t.metaKey){let a=t.shiftKey?1:-1;const u=St.indexOf(r.video.getPlaybackRate())+a;let s;return u<0?s=St.at(0):u>=St.length?s=St.at(-1):s=St.at(u),r.video.setPlaybackRate(s),r.video.isPaused()&&r.video.play(),!0}if(r.video.isVideoLoaded()){if(["ArrowLeft","ArrowRight"].includes(t.key)&&!t.metaKey&&!t.altKey){let a=t.key==="ArrowRight"?1:-1,u=t.shiftKey?10:1;return r.video.isPlaying()&&r.video.pause(),r.video.seekFromCurrentFrame(u*a),!0}if(t.code==="Digit1"&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey||t.code==="Home")return r.video.pause().subscribe(()=>r.video.seekToFrame(0)),!0;if(t.code==="Digit1"&&t.ctrlKey||t.code==="End")return r.video.isPlaying()?r.video.pause().subscribe(()=>r.video.seekToEnd()):r.video.seekToEnd(),!0}if(t.code==="KeyF"&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey)return r.video.toggleFullscreen(),!0}return!1}}const r_=$.memo(function({videoUrl:t,config:r,videoLoadOptions:i,onVideoLoadedCallback:n,enableHotkeys:o}){return r&&(r==null?void 0:r.playerHTMLElementId)===void 0&&(r.playerHTMLElementId="omakase-player"),$.useEffect(()=>{var s,c;let a=new B.OmakasePlayer(r);const u=l=>{jn.handleKeyboardEvent(l,a)&&(l.stopPropagation(),l.preventDefault())};return(o===void 0||o)&&((s=document.querySelector("media-controller"))==null||s.setAttribute("nohotkeys",""),(c=document.querySelector("media-controller"))==null||c.setAttribute("tabindex","-1"),window.addEventListener("keydown",u),a.chroming.appendHelpMenuGroup(jn.getKeyboardShortcutsHelpMenuGroup())),a.loadVideo(t,i).subscribe({next:l=>{n&&n(a,l)}}),()=>{(o===void 0||o)&&window.removeEventListener("keydown",u)}},[t]),$.createElement("div",{id:r.playerHTMLElementId})}),i_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M10.5675 21C10.2375 21 9.9675 20.73 9.9675 20.4V16.7925L5.6325 12.3675L9.9675 8.235V3.6C9.9675 3.27 10.2375 3 10.5675 3C10.8975 3 11.1675 3.27 11.1675 3.6V8.7525L7.3425 12.3975L11.1675 16.305V20.4C11.1675 20.73 10.8975 21 10.5675 21Z",fill:"#CACFEA"}),$.createElement("path",{d:"M17.7675 17.145C17.61 17.145 17.46 17.085 17.34 16.965L12.8325 12.3675L17.355 8.0625C17.595 7.8375 17.9775 7.845 18.2025 8.085C18.4275 8.325 18.42 8.7075 18.18 8.9325L14.5425 12.3975L18.195 16.125C18.4275 16.365 18.42 16.74 18.1875 16.9725C18.075 17.085 17.9175 17.145 17.7675 17.145Z",fill:"#CACFEA"})),o_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M13.4325 21C13.7625 21 14.0325 20.73 14.0325 20.4V16.7925L18.3675 12.3675L14.0325 8.235V3.6C14.0325 3.27 13.7625 3 13.4325 3C13.1025 3 12.8325 3.27 12.8325 3.6V8.7525L16.6575 12.3975L12.8325 16.305V20.4C12.8325 20.73 13.1025 21 13.4325 21Z",fill:"#CACFEA"}),$.createElement("path",{d:"M6.2325 17.145C6.39 17.145 6.54 17.085 6.66 16.965L11.1675 12.3675L6.645 8.0625C6.405 7.8375 6.0225 7.845 5.7975 8.085C5.5725 8.325 5.58 8.7075 5.82 8.9325L9.4575 12.3975L5.805 16.125C5.5725 16.365 5.58 16.74 5.8125 16.9725C5.925 17.085 6.0825 17.145 6.2325 17.145Z",fill:"#CACFEA"})),a_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M14.1675 21C13.8375 21 13.5675 20.73 13.5675 20.4V16.7925L9.2325 12.3675L13.5675 8.235V3.6C13.5675 3.27 13.8375 3 14.1675 3C14.4975 3 14.7675 3.27 14.7675 3.6V8.7525L10.9425 12.3975L14.7675 16.305V20.4C14.7675 20.73 14.4975 21 14.1675 21Z",fill:"#CACFEA"})),u_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M9.8325 21C10.1625 21 10.4325 20.73 10.4325 20.4V16.7925L14.7675 12.3675L10.4325 8.235V3.6C10.4325 3.27 10.1625 3 9.8325 3C9.5025 3 9.2325 3.27 9.2325 3.6V8.7525L13.0575 12.3975L9.2325 16.305V20.4C9.2325 20.73 9.5025 21 9.8325 21Z",fill:"#CACFEA"})),c_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M11.3475 3H5.775V21L11.3475 17.0475V3Z",fill:"#CACFEA"}),$.createElement("path",{d:"M18.225 21L12.6525 17.0475V3H18.225V21ZM13.7775 16.47L17.1 18.825V4.125H13.7775V16.47Z",fill:"#CACFEA"})),s_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M4.6875 3V21L8.0625 17.0475L11.4375 21V3H4.6875Z",fill:"#CACFEA"}),$.createElement("path",{d:"M12.5625 3V21L15.9375 17.0475L19.3125 21V3H12.5625Z",fill:"#CACFEA"})),l_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M6.39001 3V21L12 17.0175L17.61 21V3H6.38251H6.39001ZM16.44 3.84L7.23001 18.7125V3.84H16.44ZM12 15.9975L8.25751 18.6525L16.77 4.89V19.3725L12 15.9825V15.9975Z",fill:"#CACFEA"})),d_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M12.3075 8.0175L14.4525 5.8725C14.6175 5.7075 14.6175 5.43 14.4525 5.265L12.3 3.12C12.135 2.955 11.8575 2.955 11.6925 3.12C11.5275 3.285 11.5275 3.5625 11.6925 3.7275L13.1025 5.1375H6.64499C5.22749 5.1375 4.07249 6.2925 4.07249 7.71V16.2825C4.07249 17.7 5.22749 18.855 6.64499 18.855C6.87749 18.855 7.07249 18.66 7.07249 18.4275C7.07249 18.195 6.87749 18 6.64499 18C5.69249 18 4.93499 17.2275 4.93499 16.29V7.7175C4.93499 6.765 5.70749 6.0075 6.64499 6.0075H13.11L11.7 7.4175C11.535 7.5825 11.535 7.86 11.7 8.025C11.865 8.19 12.1425 8.19 12.3075 8.025V8.0175Z",fill:"#CACFEA"}),$.createElement("path",{d:"M17.355 18.8625C18.7725 18.8625 19.9275 17.7075 19.9275 16.29V7.7175C19.9275 6.3 18.7725 5.145 17.355 5.145C17.1225 5.145 16.9275 5.34 16.9275 5.5725C16.9275 5.805 17.1225 6 17.355 6C18.3075 6 19.065 6.7725 19.065 7.71V16.2825C19.065 17.235 18.2925 17.9925 17.355 17.9925H10.89L12.3075 16.5825C12.3825 16.5075 12.435 16.395 12.435 16.2825C12.435 16.17 12.3975 16.0575 12.3075 15.9825C12.15 15.8175 11.8575 15.825 11.7 15.9825L9.52501 18.1575V18.18C9.45751 18.255 9.42751 18.345 9.42751 18.435C9.42751 18.555 9.46501 18.66 9.55501 18.735L11.7 20.88C11.8575 21.045 12.15 21.045 12.3075 20.88C12.4725 20.715 12.4725 20.4375 12.3075 20.2725L10.89 18.8625H17.355Z",fill:"#CACFEA"})),f_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("g",{clipPath:"url(#clip0_3377_237)"},$.createElement("path",{d:"M13.02 19.95C17.42 19.95 21 16.37 21 11.97C21 7.57 17.42 4 13.02 4C8.88 4 5.39 7.24 5.08 11.37L5.02 12.14L3.56 10.68C3.49 10.61 3.41 10.58 3.33 10.58C3.25 10.58 3.17 10.61 3.1 10.68C3.03 10.75 3 10.83 3 10.92C3 11 3.03 11.08 3.1 11.15L5.22 13.27C5.35 13.4 5.55 13.43 5.65 13.3L7.8 11.15C7.87 11.08 7.9 11 7.9 10.92C7.9 10.84 7.86 10.76 7.8 10.69C7.73 10.62 7.65 10.59 7.57 10.59C7.49 10.59 7.41 10.62 7.34 10.69L5.9 12.13L6.03 11.11C6.45 7.57 9.46 4.91 13.02 4.91C16.91 4.91 20.08 8.08 20.08 11.97C20.08 15.86 16.91 19.03 13.02 19.03C12.77 19.03 12.56 19.24 12.56 19.49C12.56 19.74 12.77 19.95 13.02 19.95Z",fill:"#CACFEA"}),$.createElement("path",{d:"M14.95 13.19C14.95 13.72 14.75 14.14 14.36 14.45C13.97 14.76 13.43 14.91 12.75 14.91C12.16 14.91 11.69 14.81 11.32 14.62V13.53C11.7 13.81 12.14 13.95 12.65 13.95C12.98 13.95 13.23 13.88 13.41 13.74C13.59 13.6 13.67 13.41 13.67 13.17C13.67 12.93 13.56 12.72 13.34 12.58C13.12 12.44 12.82 12.37 12.43 12.37H11.92V11.41H12.39C13.13 11.41 13.5 11.16 13.5 10.67C13.5 10.21 13.22 9.98 12.65 9.98C12.26 9.98 11.89 10.1 11.54 10.35V9.33C11.93 9.13 12.4 9.03 12.94 9.03C13.48 9.03 13.94 9.16 14.28 9.41C14.62 9.66 14.79 10.01 14.79 10.44C14.79 11.19 14.41 11.65 13.66 11.84V11.86C14.06 11.91 14.37 12.05 14.61 12.29C14.85 12.53 14.96 12.83 14.96 13.19H14.95Z",fill:"#CACFEA"})),$.createElement("defs",null,$.createElement("clipPath",{id:"clip0_3377_237"},$.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),m_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("g",{clipPath:"url(#clip0_3377_260)"},$.createElement("path",{d:"M10.98 19.95C6.58 19.95 3 16.37 3 11.98C3 7.58 6.58 4 10.98 4C15.12 4 18.61 7.24 18.93 11.37L18.99 12.14L20.45 10.68C20.52 10.61 20.6 10.58 20.68 10.58C20.76 10.58 20.84 10.61 20.91 10.68C20.98 10.75 21.01 10.83 21.01 10.91C21.01 10.99 20.98 11.07 20.91 11.14L18.79 13.26C18.66 13.39 18.46 13.42 18.36 13.29L16.21 11.14C16.14 11.07 16.11 10.99 16.11 10.91C16.11 10.83 16.15 10.75 16.21 10.68C16.28 10.61 16.36 10.58 16.44 10.58C16.52 10.58 16.6 10.61 16.67 10.68L18.11 12.12L17.98 11.1C17.55 7.57 14.54 4.91 10.98 4.91C7.09 4.91 3.92 8.08 3.92 11.97C3.92 15.86 7.09 19.03 10.98 19.03C11.23 19.03 11.44 19.24 11.44 19.49C11.44 19.74 11.23 19.95 10.98 19.95Z",fill:"#CACFEA"}),$.createElement("path",{d:"M12.91 13.19C12.91 13.72 12.71 14.14 12.32 14.45C11.93 14.76 11.39 14.91 10.71 14.91C10.12 14.91 9.65 14.81 9.28 14.62V13.53C9.66 13.81 10.1 13.95 10.61 13.95C10.94 13.95 11.19 13.88 11.37 13.74C11.55 13.6 11.63 13.41 11.63 13.17C11.63 12.93 11.52 12.72 11.3 12.58C11.08 12.44 10.78 12.37 10.39 12.37H9.88V11.41H10.35C11.09 11.41 11.46 11.16 11.46 10.67C11.46 10.21 11.18 9.98 10.61 9.98C10.22 9.98 9.85 10.1 9.5 10.35V9.33C9.89 9.13 10.36 9.03 10.9 9.03C11.44 9.03 11.9 9.16 12.24 9.41C12.58 9.66 12.75 10.01 12.75 10.44C12.75 11.19 12.37 11.65 11.62 11.84V11.86C12.02 11.91 12.33 12.05 12.57 12.29C12.81 12.53 12.92 12.83 12.92 13.19H12.91Z",fill:"#CACFEA"})),$.createElement("defs",null,$.createElement("clipPath",{id:"clip0_3377_260"},$.createElement("rect",{width:"18",height:"15.95",fill:"white",transform:"translate(3 4)"})))),ve=({Icon:e,onClick:t,width:r,height:i,text:n,disabled:o})=>$.createElement("button",{disabled:o,onClick:t},$.createElement(e,{width:r,height:i})," ",n),p_=({width:e,height:t})=>$.createElement("svg",{width:e??24,height:t??24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M12.6525 17.0475L18.225 21V3H12.6525V17.0475Z",fill:"#CACFEA"}),$.createElement("path",{d:"M5.775 3H11.3475V17.0475L5.775 21V3ZM10.2225 4.125H6.9V18.825L10.2225 16.47V4.125Z",fill:"#CACFEA"})),h_=({width:e,height:t})=>$.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$.createElement("rect",{x:"0.5",y:"0.5",width:"13",height:"13",rx:"2.5",stroke:"#CACFEA"}),$.createElement("path",{d:"M7.16667 6.33333V6.83333H7.66667H10.3333C10.4257 6.83333 10.5 6.90769 10.5 7C10.5 7.09231 10.4257 7.16667 10.3333 7.16667H7.66667H7.16667V7.66667V10.3333C7.16667 10.4257 7.09231 10.5 7 10.5C6.90769 10.5 6.83333 10.4257 6.83333 10.3333V7.66667V7.16667H6.33333H3.66667C3.57468 7.16667 3.5 7.09199 3.5 7C3.5 6.90801 3.57468 6.83333 3.66667 6.83333H6.33333H6.83333V6.33333V3.66667C6.83333 3.57468 6.90801 3.5 7 3.5C7.09199 3.5 7.16667 3.57468 7.16667 3.66667V6.33333Z",fill:"#CACFEA",stroke:"#CACFEA"}));function we(e){e.next(),e.complete()}class g_{constructor(){k(this,"actionMarkerInOut");k(this,"actionMarkerSplit");k(this,"actionMarkerDelete");k(this,"actionPreviousMarkerToggle");k(this,"actionNextMarkerToggle");k(this,"actionSetMarkerStartToPlayhead");k(this,"actionSetMarkerEndToPlayhead");k(this,"actionSetPlayheadToMarkerStart");k(this,"actionSetPlayheadToMarkerEnd");k(this,"actionRewind3SecondsAndPlayToCurrent");k(this,"actionPlay3SecondsAndRewindToCurrent");k(this,"actionLoopActiveMarker")}getKeyboardShortcutsHelpMenuGroup(){let t=(...a)=>a.join(" + "),r="shift".toUpperCase();const i=np.platform;let n=i==="windows"?"win":i==="linux"?"super":"cmd";return{name:"Segmentation function shortcuts",items:[{description:"Mark In / Out",name:t("m")},{description:"Split Active Marker",name:t(".")},{description:"Delete Active Marker",name:t("n")},{description:"Toggle Previous Marker",name:t("/")},{description:"Toggle Next Marker",name:t(r,"/")},{description:"Set Start of Active Marker to Playhead Position",name:t("i")},{description:"Set End of Active Marker to Playhead Position",name:t("o")},{description:"Set Playhead to Start of Active Marker",name:t("[")},{description:"Set Playhead to End of Active Marker",name:t("]")},{description:"Rewind 3 Seconds and Play to Current Playhead",name:t(n,"Arrow Left")},{description:"Play 3 Seconds and Rewind to Current Playhead",name:t(n,"Arrow Right")},{description:"Loop on Active Marker",name:t("p")}]}}handleKeyboardEvent(t,r){const i=t.target;return["INPUT","TEXTAREA","OMAKASE-MARKER-LIST"].includes(i.tagName.toUpperCase())?!1:t.code==="KeyM"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionMarkerInOut&&this.actionMarkerInOut(),!0):t.code==="Period"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionMarkerSplit&&this.actionMarkerSplit(),!0):t.code==="KeyN"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionMarkerDelete&&this.actionMarkerDelete(),!0):t.code==="Slash"&&!t.ctrlKey&&!t.metaKey?(t.shiftKey?this.actionNextMarkerToggle&&this.actionNextMarkerToggle():this.actionPreviousMarkerToggle&&this.actionPreviousMarkerToggle(),!0):t.code==="KeyI"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionSetMarkerStartToPlayhead&&this.actionSetMarkerStartToPlayhead(),!0):t.code==="KeyO"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionSetMarkerEndToPlayhead&&this.actionSetMarkerEndToPlayhead(),!0):t.code==="BracketLeft"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionSetPlayheadToMarkerStart&&this.actionSetPlayheadToMarkerStart(),!0):t.code==="BracketRight"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionSetPlayheadToMarkerEnd&&this.actionSetPlayheadToMarkerEnd(),!0):t.code==="ArrowLeft"&&!t.shiftKey&&!t.ctrlKey&&t.metaKey?(this.actionRewind3SecondsAndPlayToCurrent&&this.actionRewind3SecondsAndPlayToCurrent(),!0):t.code==="ArrowRight"&&!t.shiftKey&&!t.ctrlKey&&t.metaKey?(this.actionPlay3SecondsAndRewindToCurrent&&this.actionPlay3SecondsAndRewindToCurrent(),!0):t.code==="KeyP"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey?(this.actionLoopActiveMarker&&this.actionLoopActiveMarker(),!0):!1}}const fn=(e,t,r)=>e.getMarkers().reduce((i,n)=>{if(t.id===n.id)return i;if(n instanceof B.PeriodMarker&&n.timeObservation.start!=null&&n.timeObservation.end!=null){const o=t.timeObservation,a=n.timeObservation.start,u=n.timeObservation.end,s=o.start,c=r??o.end;if(s!=null&&c!=null)return i||s<=u&&c>=a}return i},!1);function mn(e,t,r){if(!e||!(e instanceof B.PeriodMarker))return!0;const i=e.timeObservation.start,n=e.timeObservation.end;if(i==null||n==null)return!0;const o=r.video.calculateTimeToFrame(n),a=r.video.calculateTimeToFrame(i),u=r.video.getCurrentFrame();return t<i||o-u<2||u-a<1}function pn(e){return!(e.timeObservation.start==null||e.timeObservation.end==null)}const v_=({selectedMarker:e,omakasePlayer:t,markerListApi:r,enableHotKeys:i,segmentationLanes:n,setSegmentationLanes:o,setSelectedMarker:a,onMarkerClickCallback:u,setSource:s,source:c,constants:l})=>{const d=$.useRef(void 0),f=$.useRef(void 0),m=new He,g=$.useRef(!1),h=(S,x,P)=>{const J=x??t.video.getCurrentTime();return S.getMarkers().reduce((R,le)=>le instanceof B.PeriodMarker&&le.timeObservation.start!==void 0&&le.timeObservation.end!==void 0&&le.id!==(P==null?void 0:P.id)?R||J>=le.timeObservation.start&&J<=le.timeObservation.end:R,!1)},v=S=>{if(j===void 0)return!0;const x=j.timeObservation.start,P=S??t.video.getCurrentTime();return!!(x==null||x>=P||fn(c,j,P))},w=S=>j!==void 0||c===void 0?!0:h(c,S,j),[T,z]=$.useState(void 0),[L,F]=$.useState(mn(e,t.video.getCurrentTime(),t)),[j,ee]=$.useState(void 0),[te,Y]=$.useState(v()),[Ce,ie]=$.useState(w()),Ue=S=>{if(S===void 0||c===void 0||!(S instanceof B.PeriodMarker))return!0;const x=fn(c,S,t.video.getCurrentTime());if(x)return x;if(S instanceof B.PeriodMarker){const P=S.timeObservation.end;if(P!=null&&t.video.getCurrentTime()>=P)return!0}return!1},De=S=>{if(S===void 0||c===void 0||!(S instanceof B.PeriodMarker))return!0;const x=fn(c,S,t.video.getCurrentTime());if(x)return x;if(S instanceof B.PeriodMarker){if(S.timeObservation.end==null)return!0;const P=S.timeObservation.start;if(P!=null&&t.video.getCurrentTime()<=P)return!0}return!1},[rt,Q]=$.useState(Ue(e)),[V,jr]=$.useState(De(e));$.useEffect(()=>{if(Y(()=>v()),ie(()=>w()),j&&j!==e){const S=n.find(x=>x.getMarker(j.id));S==null||S.removeMarker(j.id),ee(void 0)}},[e,j,n,ee]),$.useEffect(()=>()=>we(m),[]),$.useEffect(()=>{if(Q(Ue(e)),jr(De(e)),e){const S=mn(e,t.video.getCurrentTime(),t);F(S);const x=t.video.onVideoTimeChange$.pipe(ae(m)).subscribe({next:P=>{F(J=>mn(e,P.currentTime,t)),Q(()=>Ue(e)),jr(()=>De(e))}});return()=>x.unsubscribe()}},[e]),$.useEffect(()=>{t.video.onSeeking$.pipe(ae(m)).subscribe({next:x=>{Y(()=>v(x.toTime)),ie(()=>w(x.toTime))}});const S=t.video.onVideoTimeChange$.pipe(ae(m)).subscribe({next:x=>{Y(()=>v()),ie(()=>w())}});return()=>S.unsubscribe()},[j,c]),$.useEffect(()=>{const S=n.map(x=>x.onMarkerUpdate$.pipe(ae(m)).subscribe({next:P=>{(e==null?void 0:e.id)===P.marker.id&&(F(J=>mn(e,t.video.getCurrentTime(),t)),Q(()=>Ue(e)),jr(()=>De(e)))}}));return()=>S.forEach(x=>x.unsubscribe())},[n,e]),$.useEffect(()=>{T&&(T.marker.style={...T.marker.style,color:T.color},T.marker.timeObservation={...T.marker.timeObservation},z(void 0))},[e]),$.useEffect(()=>{if(c){Y(()=>v()),ie(()=>w());const S=c.onMarkerDelete$.pipe(ae(m)).subscribe({next:P=>{const J=P.marker;z(R=>{if((R==null?void 0:R.marker.id)!==J.id)return R}),a(R=>{if((R==null?void 0:R.id)!==J.id)return R}),ee(R=>{if((R==null?void 0:R.id)!==J.id)return R}),Y(()=>v()),ie(()=>w())}}),x=c.onMarkerUpdate$.pipe(ae(m)).subscribe({next:()=>{Y(()=>v()),ie(()=>w())}});return()=>{S.unsubscribe(),x.unsubscribe()}}},[c]);const da=(S,x)=>{if(x===void 0)return;const P=x.timeObservation;S.video.seekToTime(P.start)},fa=(S,x)=>{if(x===void 0)return;const P=x.timeObservation;S.video.seekToTime(P.end)},ma=(S,x)=>{x instanceof B.PeriodMarker&&x.timeObservation.start!==void 0&&(x.timeObservation={...x.timeObservation,start:S.video.getCurrentTime()})},pa=(S,x)=>{x instanceof B.PeriodMarker&&x.timeObservation.end!==void 0&&(x.timeObservation={...x.timeObservation,end:S.video.getCurrentTime()})},ha=(S,x)=>{d.current&&we(d.current),d.current=new He,S.video.pause();const P=S.video.getCurrentFrame(),J=S.video.getFrameRate(),R=P-x*J,le=R>=0?R:0;S.video.seekToFrame(le).pipe(ot()).subscribe(()=>{}),S.video.play(),S.video.onVideoTimeChange$.pipe(ae(d.current),ae(m)).subscribe(on=>{on.frame>=P-1&&(S.video.pause().subscribe(()=>{S.video.seekToFrame(P).pipe(ot()).subscribe(()=>{})}),we(d.current))})},ga=(S,x)=>{d.current&&we(d.current),d.current=new He,f.current&&we(f.current),f.current=new He;const P=S.video.getCurrentFrame(),J=S.video.getFrameRate(),R=P+x*J;S.video.play(),S.video.onVideoTimeChange$.pipe(ae(d.current),ae(m)).subscribe(le=>{le.frame>=R-1&&(S.video.pause().subscribe(()=>{S.video.seekToFrame(P).pipe(ot()).subscribe(()=>{})}),we(d.current))}),S.video.onEnded$.pipe(ae(f.current),ae(m)).subscribe(le=>{setTimeout(()=>{S.video.seekToFrame(P).pipe(ot()).subscribe(()=>{})},1),we(f.current)})},Pr=S=>{c.removeMarker(S.id),(j==null?void 0:j.id)===S.id&&ee(void 0)},va=(S,x)=>{if(!(x instanceof B.PeriodMarker))return;const P=x.timeObservation.start,J=x.timeObservation.end,R=S.video.getCurrentTime();if(P==null||J==null)return;const le=P,on=R,ip=on+1/S.video.getFrameRate(),op=J;Pr(x);const Ar=new B.PeriodMarker({style:l.PERIOD_MARKER_STYLE,timeObservation:{start:le,end:on},editable:!0});Ar.onClick$.subscribe({next:()=>u(Ar)});const $t=new B.PeriodMarker({style:l.HIGHLIGHTED_PERIOD_MARKER_STYLE,timeObservation:{start:ip,end:op},editable:!0});$t.onClick$.subscribe({next:()=>u($t)}),c.addMarker(Ar),c.addMarker($t),u($t),setTimeout(()=>{z({marker:$t,color:l.PERIOD_MARKER_STYLE.color})},0)},ba=()=>{const S=t.video.getCurrentTime(),x=new B.PeriodMarker({timeObservation:{start:S},style:l.PERIOD_MARKER_STYLE,editable:!0});x.onClick$.subscribe({next:()=>u(x)}),c.addMarker(x),ee(x),Y(v()),u(x)},_a=()=>{const S=t.video.getCurrentTime();j.timeObservation={...j.timeObservation,end:S},ee(void 0)},ya=S=>{d.current&&we(d.current),d.current=new He,f.current&&we(f.current),f.current=new He;const x=t.video.calculateTimeToFrame(S.timeObservation.start),P=t.video.calculateTimeToFrame(S.timeObservation.end);t.video.pause(),t.video.seekToFrame(x),t.video.play(),t.video.onVideoTimeChange$.pipe(ae(d.current),ae(m)).subscribe(J=>{J.frame>=P-1&&(t.video.pause().subscribe(()=>{t.video.seekToFrame(x).pipe(ot()).subscribe(()=>{})}),we(d.current))}),t.video.onEnded$.pipe(ae(f.current),ae(m)).subscribe(J=>{setTimeout(()=>{t.video.seekToFrame(x).pipe(ot()).subscribe(()=>{})},1),we(f.current)})},rp=()=>{const S=n.length,x=`Segmentation ${n.length+1}`,P=new B.MarkerLane({style:l.TIMELINE_LANE_STYLE,description:x});P.onMarkerUpdate$.subscribe({next:J=>{fn(P,J.marker)&&(J.marker.timeObservation=J.oldValue.timeObservation)}}),t.timeline.addTimelineLaneAtIndex(P,S+1),o([...n,P]),u(void 0),s(P)},$a=S=>{if(!c)return;const x=c.getMarkers().filter(R=>R instanceof B.PeriodMarker).sort((R,le)=>(R.timeObservation.start??0)-(le.timeObservation.start??0));if(e===void 0){u(x.at(0));return}const J=x.findIndex(R=>R.id===e.id)+(S?-1:1);J>=0&&J<x.length&&u(x.at(J))};return $.useEffect(()=>{if(!i)return;const S=new g_;S.actionLoopActiveMarker=()=>e instanceof B.PeriodMarker&&pn(e)&&ya(e),S.actionSetPlayheadToMarkerStart=()=>e&&da(t,e),S.actionSetPlayheadToMarkerEnd=()=>e&&e instanceof B.PeriodMarker&&pn(e)&&fa(t,e),S.actionSetMarkerStartToPlayhead=()=>!rt&&ma(t,e),S.actionSetMarkerEndToPlayhead=()=>!V&&pa(t,e),S.actionMarkerSplit=()=>!L&&va(t,e),S.actionMarkerDelete=()=>e&&Pr(e),S.actionMarkerInOut=()=>{j===void 0?!Ce&&ba():!te&&_a()},S.actionPlay3SecondsAndRewindToCurrent=()=>ga(t,3),S.actionRewind3SecondsAndPlayToCurrent=()=>ha(t,3),S.actionNextMarkerToggle=()=>$a(!1),S.actionPreviousMarkerToggle=()=>$a(!0);const x=P=>{S.handleKeyboardEvent(P,t)&&(P.stopPropagation(),P.preventDefault())};return window.addEventListener("keydown",x),g.current||(t.chroming.appendHelpMenuGroup(S.getKeyboardShortcutsHelpMenuGroup()),g.current=!0),()=>window.removeEventListener("keydown",x)}),$.createElement("div",{className:"control-panel-wrapper"},$.createElement("div",{className:"control-panel"},$.createElement(ve,{Icon:i_,onClick:()=>da(t,e),disabled:e===void 0}),$.createElement(ve,{Icon:o_,onClick:()=>fa(t,e),disabled:e===void 0||e instanceof B.PeriodMarker&&!pn(e)}),$.createElement(ve,{Icon:a_,onClick:()=>ma(t,e),disabled:rt}),$.createElement(ve,{Icon:u_,onClick:()=>pa(t,e),disabled:V}),j===void 0?$.createElement(ve,{Icon:c_,onClick:ba,disabled:Ce}):$.createElement(ve,{Icon:p_,onClick:_a,disabled:te}),$.createElement(ve,{Icon:l_,onClick:()=>Pr(e),disabled:e===void 0}),$.createElement(ve,{Icon:s_,onClick:()=>va(t,e),disabled:L||e===void 0}),$.createElement(ve,{Icon:d_,onClick:()=>ya(e),disabled:!(e instanceof B.PeriodMarker&&pn(e))}),$.createElement(ve,{Icon:f_,onClick:()=>ha(t,3)}),$.createElement(ve,{Icon:m_,onClick:()=>ga(t,3)})),$.createElement("div",{className:"control-panel"},$.createElement("div",{className:"segmentation-button-wrapper"},$.createElement(ve,{Icon:h_,text:"NEW SEGMENTATION",onClick:()=>rp(),disabled:n.length>=3}))))},b_=$.memo(function({flow:t,subflows:r,flowsSegments:i,onVideoLoadedCallback:n,config:o,timerange:a,videoLoadOptions:u,enableHotkeys:s}){return o&&(o==null?void 0:o.playerHTMLElementId)===void 0&&(o.playerHTMLElementId="omakase-player"),$.useEffect(()=>{var d,f;let c=new Pm(o);const l=m=>{jn.handleKeyboardEvent(m,c)&&(m.stopPropagation(),m.preventDefault())};return(s===void 0||s)&&((d=document.querySelector("media-controller"))==null||d.setAttribute("nohotkeys",""),(f=document.querySelector("media-controller"))==null||f.setAttribute("tabindex","-1"),window.addEventListener("keydown",l),c.video.appendHelpMenuGroup(jn.getKeyboardShortcutsHelpMenuGroup())),c.loadVideo({flow:t,subflows:r,flowsSegments:i},u).subscribe({next:m=>{n&&n(c,m)}}),()=>{(s===void 0||s)&&window.removeEventListener("keydown",l)}},[t,a]),$.createElement("div",{id:o.playerHTMLElementId})});function __(e){const t=Math.round(e/60)*60,r=new Date(t*1e3);return`${r.getUTCHours()}h ${r.getUTCMinutes()}min`}const y_=`
|
|
62
104
|
.omakase-time-range-selector-segments {
|
|
63
105
|
display: flex;
|
|
64
106
|
width: 700px;
|
|
@@ -203,7 +245,7 @@ ${i(m)}`)}),f.join(`
|
|
|
203
245
|
cursor: pointer;
|
|
204
246
|
outline: inherit;
|
|
205
247
|
}
|
|
206
|
-
|
|
248
|
+
`,$_=`
|
|
207
249
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
208
250
|
<g filter="url(#filter0_d_5782_463)">
|
|
209
251
|
<circle cx="16" cy="12" r="12" fill="#424850"/>
|
|
@@ -227,7 +269,7 @@ ${i(m)}`)}),f.join(`
|
|
|
227
269
|
</clipPath>
|
|
228
270
|
</defs>
|
|
229
271
|
</svg>
|
|
230
|
-
`,
|
|
272
|
+
`,w_=`
|
|
231
273
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
232
274
|
<g filter="url(#filter0_d_5782_462)">
|
|
233
275
|
<circle cx="16" cy="12" r="12" fill="#424850"/>
|
|
@@ -252,5 +294,5 @@ ${i(m)}`)}),f.join(`
|
|
|
252
294
|
</defs>
|
|
253
295
|
</svg>
|
|
254
296
|
|
|
255
|
-
`,V={container:"omakase-time-range-selector-container",segments:"omakase-time-range-selector-segments",segment:"omakase-time-range-selector-segment",segmentMarker:"omakase-time-range-selector-segment-marker",segmentTick:"omakase-time-range-selector-segment-tick",segmentLabel:"omakase-time-range-selector-segment-label",firstSegmentLabel:"omakase-time-range-selector-segment-first-label",secondSegmentLabel:"omakase-time-range-selector-segment-second-label",rangeSelector:"omakase-time-range-selector-range-selector",rangeSelectorHandle:"omakase-time-range-selector-range-selector-handle",rangeSelectorDuration:"omakase-time-range-selector-range-selector-duration",buttonContainer:"omakase-time-range-selector-button-container",invisible:"omakase-time-range-selector-invisible"},De={leftHandle:"omakase-time-range-selector-range-selector-left-handle",rightHandle:"omakase-time-range-selector-range-selector-right-handle",rangeDuration:"omakase-time-range-selector-range-selector-range-duration",segments:"omakase-time-range-selector-segments"};class qt extends HTMLElement{constructor(){super();T(this,"_container");T(this,"_rangeSelector");T(this,"_rangeSelectorLeftHandle");T(this,"_rangeSelectorRightHandle");T(this,"_rangeSelectorRangeDisplay");T(this,"_buttonContainer");T(this,"_segments");T(this,"_numberOfSegments",5);T(this,"_firstLabelIndex",0);T(this,"_initialFirstLabelIndex",0);T(this,"_labels",[]);T(this,"minWidth",10);T(this,"minValue");T(this,"maxValue");T(this,"maxRange");T(this,"segmentSize");T(this,"sliderStart");T(this,"sliderEnd");T(this,"maxWidthPercent");T(this,"onCheckmarkClickCallback");T(this,"currentStart",0);T(this,"currentEnd",100);T(this,"resetSegments",()=>{this._container.removeChild(this._segments),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.classList.add(V.segments),this._container.append(this._segments)});T(this,"getBounds",()=>({wrapperLeft:this._container.offsetLeft,wrapperRight:this._container.offsetLeft+this._container.offsetWidth,wrapperWidth:this._container.offsetWidth,selectorLeft:this._rangeSelector.offsetLeft,selectorWidth:this._rangeSelector.offsetWidth}));T(this,"getSliderValues",()=>{const{wrapperWidth:n,selectorLeft:r,selectorWidth:i}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),s=this._labels.at(this.lastLabelIndex),u=Math.round(o+r/n*(s-o)),c=Math.round(o+(r+i)/n*(s-o));return{start:u,end:c}});T(this,"getSelectorBounds",(n,r)=>{const{wrapperWidth:i}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),s=this._labels.at(this.lastLabelIndex),u=Math.round((n-o)/(s-o)*i),c=Math.round((r-n)/(s-o)*i);return{selectorLeft:u,selectorWidth:c}});T(this,"initSlider",(n,r)=>{const i=this.getSelectorBounds(n,r);this._rangeSelector.style.left=i.selectorLeft.toString()+"px",this._rangeSelector.style.width=i.selectorWidth.toString()+"px",this.updateDuration()});T(this,"showButtons",()=>{const{start:n,end:r}=this.getSliderValues();n===this.currentStart&&r===this.currentEnd||this._buttonContainer.classList.remove(V.invisible)});T(this,"hideButtons",()=>{this._buttonContainer.classList.add(V.invisible)});T(this,"updateDuration",()=>{const{start:n,end:r}=this.getSliderValues(),i=r-n;this._rangeSelectorRangeDisplay.textContent=Re(i)});T(this,"onXclick",()=>{this.firstLabelIndex=this._initialFirstLabelIndex,this.resetSegments();const n=this.getSelectorBounds(this.currentStart,this.currentEnd);this._rangeSelector.style.left=n.selectorLeft.toString()+"px",this._rangeSelector.style.width=n.selectorWidth.toString()+"px",this.updateDuration(),this.hideButtons()});T(this,"onCheckmarkClick",()=>{const{start:n,end:r}=this.getSliderValues();this.currentStart=n,this.currentEnd=r,this._initialFirstLabelIndex=this.firstLabelIndex,this.updateDuration(),this.hideButtons(),this.onCheckmarkClickCallback!==void 0&&this.onCheckmarkClickCallback(n,r)});T(this,"onMouseDownRight",n=>{n.preventDefault();const r=n.clientX,{selectorWidth:i,wrapperWidth:o,selectorLeft:s}=this.getBounds();let u=null,c=null;const a=f=>{let d=f.clientX-r,m=Math.max(this.minWidth,i+d);const h=Math.min(o*this.maxWidthPercent,o-s),p=m>h,w=performance.now();p?u===null&&(u=w,c=window.setTimeout(()=>{this.outOfBoundsCallback(!0),c=window.setInterval(()=>this.outOfBoundsCallback(!0),400)},500)):(c!==null&&(clearTimeout(c),clearInterval(c),c=null),u=null),m=Math.min(m,h),this._rangeSelector.style.width=`${m}px`,this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l),c!==null&&(clearTimeout(c),clearInterval(c),c=null),u=null};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)});T(this,"onMouseDownLeft",n=>{n.preventDefault();const r=n.clientX,{selectorLeft:i,selectorWidth:o,wrapperWidth:s}=this.getBounds();let u=null,c=null;const a=f=>{let d=f.clientX-r,m=i+d;const h=m<0,p=performance.now();h?u===null&&(u=p,c=window.setTimeout(()=>{this.outOfBoundsCallback(!1),c=window.setInterval(()=>this.outOfBoundsCallback(!1),400)},500)):(c!==null&&(clearTimeout(c),clearInterval(c),c=null),u=null),m<0&&(d=-i,m=0);let w=Math.min(Math.max(this.minWidth,o-d),s);m+w>s&&(m=s-w),w>this.minWidth&&w<s*this.maxWidthPercent&&(this._rangeSelector.style.left=`${m}px`,this._rangeSelector.style.width=`${w}px`),this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l),c!==null&&(clearTimeout(c),clearInterval(c),c=null),u=null};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)});T(this,"outOfBoundsCallback",n=>{n?this.firstLabelIndex+=1:this.firstLabelIndex-=1,this.resetSegments()});T(this,"onMouseDownDrag",n=>{if(n.target instanceof HTMLElement&&n.target.classList.contains(V.rangeSelectorHandle))return;n.preventDefault();const r=n.clientX,{selectorLeft:i,selectorWidth:o,wrapperWidth:s}=this.getBounds();let u=null,c=null;const a=f=>{let d=f.clientX-r,m=i+d;const h=s-o,p=m<0||m>h,w=performance.now();if(p){if(u===null){const E=m>h;u=w,c=window.setTimeout(()=>{this.outOfBoundsCallback(E),c=window.setInterval(()=>this.outOfBoundsCallback(E),400)},500)}}else c!==null&&(clearTimeout(c),clearInterval(c),c=null),u=null;m=Math.max(0,Math.min(m,h)),this._rangeSelector.style.left=`${m}px`,this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l),c!==null&&(clearTimeout(c),clearInterval(c))};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)})}set numberOfSegments(n){n>2&&(this._numberOfSegments=n)}get numberOfSegments(){return this._numberOfSegments}static get observedAttributes(){return["minValue","maxValue","maxRange","segmentSize","sliderStart","sliderEnd","numberOfSegments"]}get firstLabelIndex(){return this._firstLabelIndex}set firstLabelIndex(n){if(n+this._numberOfSegments+1>=this._labels.length){this._firstLabelIndex=this._labels.length-1-this.numberOfSegments;return}if(n<0){this._firstLabelIndex=0;return}this._firstLabelIndex=n}get lastLabelIndex(){return this._firstLabelIndex+this._numberOfSegments}connectedCallback(){if(this.minValue=Number.parseInt(this.getAttribute("minValue")??"NaN"),this.maxValue=Number.parseInt(this.getAttribute("maxValue")??"NaN"),this.maxRange=Number.parseInt(this.getAttribute("maxRange")??"NaN"),this.segmentSize=Number.parseInt(this.getAttribute("segmentSize")??"NaN"),this.getAttribute("numberOfSegments")){const l=Number.parseInt(this.getAttribute("numberOfSegments"));if(Number.isNaN(l))throw new Error("Invalid atribute value");this._numberOfSegments=l}if(Number.isNaN(this.minValue)||Number.isNaN(this.maxValue)||Number.isNaN(this.maxRange)||Number.isNaN(this.segmentSize))throw new Error("Invalid attribute values.");const n=this.maxValue-this.minValue;if(n<this.numberOfSegments*this.segmentSize&&(this.segmentSize=n/this.numberOfSegments),this.maxWidthPercent=this.maxRange>this.numberOfSegments*this.segmentSize?1:this.maxRange/(this.numberOfSegments*this.segmentSize),this._labels=this.calculateLabels(),this.maxValue<this.minValue)throw new Error("Max value is lesser than min value");let r,i;if(this.getAttribute("sliderStart")&&this.getAttribute("sliderEnd")){if(r=Number.parseFloat(this.getAttribute("sliderStart")),i=Number.parseFloat(this.getAttribute("sliderEnd")),r>i)throw new Error("Slider start is bigger than slider end");if(r<this.minValue)throw new Error("Slider start is smaller than minimal value");i>this.maxValue&&(i=this.maxValue),this.currentStart=r,this.currentEnd=i}else r=this.minValue,i=this.segmentSize;this.resolveInitialSegment(r,i),this._container=document.createElement("div"),this._container.classList.add(V.container);const o=document.createElement("style");o.textContent=io,this._container.append(o),this._buttonContainer=document.createElement("div"),this._buttonContainer.classList.add(V.buttonContainer,V.invisible);const s=this.createButtonSvg(oo),u=this.createButtonSvg(so);s.onclick=this.onCheckmarkClick,u.onclick=this.onXclick,this._buttonContainer.append(s,u),this._container.append(this._buttonContainer),this._rangeSelector=document.createElement("div"),this._rangeSelector.classList.add(V.rangeSelector),this._rangeSelectorLeftHandle=document.createElement("div"),this._rangeSelectorLeftHandle.classList.add(V.rangeSelectorHandle),this._rangeSelectorLeftHandle.id=De.leftHandle,this._rangeSelectorRightHandle=document.createElement("div"),this._rangeSelectorRightHandle.classList.add(V.rangeSelectorHandle),this._rangeSelectorRightHandle.id=De.rightHandle,this._rangeSelectorRangeDisplay=document.createElement("div"),this._rangeSelectorRangeDisplay.classList.add(V.rangeSelectorDuration),this._rangeSelectorRangeDisplay.id=De.rangeDuration,this._rangeSelector.append(this._rangeSelectorLeftHandle,this._rangeSelectorRangeDisplay,this._rangeSelectorRightHandle),this._container.append(this._rangeSelector),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.id=De.segments,this._segments.classList.add(V.segments),this._container.append(this._segments),this._rangeSelectorLeftHandle.addEventListener("mousedown",this.onMouseDownLeft),this._rangeSelectorRightHandle.addEventListener("mousedown",this.onMouseDownRight),this._rangeSelector.addEventListener("mousedown",this.onMouseDownDrag),this.append(this._container),this.initSlider(r,i);const{start:c,end:a}=this.getSliderValues();this.currentStart=c,this.currentEnd=a,this.updateDuration()}resolveInitialSegment(n,r){const i=this._numberOfSegments*this.segmentSize,o=r-n,s=this.maxValue-this.minValue,u=n-this.minValue,c=Math.ceil(s/this.segmentSize);let a=Math.floor(u/s*c);a+=Math.floor((i-o)/this.segmentSize);const f=a+Math.ceil(o/this.segmentSize)-this._numberOfSegments;this.firstLabelIndex=f,this._initialFirstLabelIndex=f}createButtonSvg(n){const r=document.createElement("button");return r.innerHTML=n,r}calculateLabels(){const n=this.minValue,r=this.maxValue,i=Math.floor((this.maxValue-this.minValue)/this.segmentSize)-1,o=[n];let s=this.minValue;for(let u=0;u<i;u++)s+=this.segmentSize,o.push(s);return o.push(r),o}buildSegments(n){const r=document.createElement("div");n.slice(0,-2).forEach(a=>{const l=document.createElement("div");l.classList.add(V.segment);const f=document.createElement("div");f.classList.add(V.segmentMarker);const d=document.createElement("div");d.classList.add(V.segmentTick);const m=document.createElement("div");m.classList.add(V.segmentLabel),m.innerHTML=Re(a),l.append(f,d,m),r.append(l)});const i=document.createElement("div");i.classList.add(V.segment);const o=document.createElement("div");o.classList.add(V.segmentMarker);const s=document.createElement("div");s.classList.add(V.segmentTick);const u=document.createElement("div");u.classList.add(V.segmentLabel,V.firstSegmentLabel),u.innerHTML=Re(n.at(-2));const c=document.createElement("div");return c.classList.add(V.segmentLabel,V.secondSegmentLabel),c.innerHTML=Re(n.at(-1)),i.append(o,s,u,c),r.append(i),r}}const Xt="omakase-time-range-selector-react-div",ao=({timeRange:t,maxTimeRange:e,numberOfSegments:n,segmentSize:r,maxSliderRange:i,onCheckmarkClickCallback:o})=>(customElements.get("omakase-time-range-selector")||customElements.define("omakase-time-range-selector",qt),v.useEffect(()=>{var m;const s=B.parseTimeRange(e),u=B.timeMomentToSeconds(s.start),c=B.timeMomentToSeconds(s.end),a=B.parseTimeRange(t),l=B.timeMomentToSeconds(a.start),f=B.timeMomentToSeconds(a.end),d=new qt;d.setAttribute("minValue",u.toString()),d.setAttribute("maxValue",c.toString()),d.setAttribute("maxRange",i.toString()),d.setAttribute("segmentSize",r.toString()),d.setAttribute("numberOfSegments",n.toString()),d.setAttribute("sliderStart",l.toString()),d.setAttribute("sliderEnd",f.toString()),d.onCheckmarkClickCallback=o,(m=document.getElementById(Xt))==null||m.append(d)},[]),v.createElement("div",{id:Xt})),uo=v.memo(({omakasePlayer:t,config:e,onCreateMarkerListCallback:n})=>(v.useEffect(()=>{const r=t.createMarkerList(e).subscribe({next:i=>{n==null||n(i)}});return()=>{r.unsubscribe()}},[e.source]),v.createElement("div",{id:e.markerListHTMLElementId})));exports.AudioFlow=void 0;(t=>{t.FormatEnum={UrnxNmosformataudio:"urn:x-nmos:format:audio"}})(exports.AudioFlow||(exports.AudioFlow={}));const co={Video:"urn:x-nmos:format:video",Audio:"urn:x-nmos:format:audio",Data:"urn:x-nmos:format:data",Multi:"urn:x-nmos:format:multi"};exports.DataFlow=void 0;(t=>{t.FormatEnum={UrnxNmosformatdata:"urn:x-nmos:format:data"}})(exports.DataFlow||(exports.DataFlow={}));exports.DeletionRequest=void 0;(t=>{t.StatusEnum={Created:"created",Started:"started",Done:"done",Error:"error"}})(exports.DeletionRequest||(exports.DeletionRequest={}));exports.MediaBucketObjectStorePreInner=void 0;(t=>{t.ActionEnum={CreateBucket:"create_bucket"}})(exports.MediaBucketObjectStorePreInner||(exports.MediaBucketObjectStorePreInner={}));exports.MultiEssenceFlow=void 0;(t=>{t.FormatEnum={UrnxNmosformatmulti:"urn:x-nmos:format:multi"}})(exports.MultiEssenceFlow||(exports.MultiEssenceFlow={}));exports.ServiceMediaStore=void 0;(t=>{t.TypeEnum={HttpObjectStore:"http_object_store"}})(exports.ServiceMediaStore||(exports.ServiceMediaStore={}));exports.Source=void 0;(t=>{t.FormatEnum={Video:"urn:x-nmos:format:video",Audio:"urn:x-nmos:format:audio",Data:"urn:x-nmos:format:data",Multi:"urn:x-nmos:format:multi"}})(exports.Source||(exports.Source={}));exports.UncompressedAudioParameters=void 0;(t=>{t.UncTypeEnum={Interleaved:"interleaved",Planar:"planar",Pairs:"pairs"}})(exports.UncompressedAudioParameters||(exports.UncompressedAudioParameters={}));exports.UncompressedVideoParameters=void 0;(t=>{t.UncTypeEnum={Planar:"planar",Yuyv:"YUYV",Uyvy:"UYVY",Ayuv:"AYUV",V210:"v210",V216:"v216",Rgb:"RGB",Rgbx:"RGBx",XRgb:"xRGB",Bgrx:"BGRx",XBgr:"xBGR",Rgba:"RGBA",Argb:"ARGB",Bgra:"BGRA",Abgr:"ABGR",Alpha:"alpha"}})(exports.UncompressedVideoParameters||(exports.UncompressedVideoParameters={}));exports.VideoFlow=void 0;(t=>{t.FormatEnum={UrnxNmosformatvideo:"urn:x-nmos:format:video"}})(exports.VideoFlow||(exports.VideoFlow={}));exports.VideoFlowEssenceParameters=void 0;(t=>{t.InterlaceModeEnum={Progressive:"progressive",InterlacedTff:"interlaced_tff",InterlacedBff:"interlaced_bff",InterlacedPsf:"interlaced_psf"},t.ColorspaceEnum={Bt601:"BT601",Bt709:"BT709",Bt2020:"BT2020",Bt2100:"BT2100"},t.TransferCharacteristicEnum={Sdr:"SDR",Hlg:"HLG",Pq:"PQ"},t.ComponentTypeEnum={YcbCr:"YCbCr",Rgb:"RGB"}})(exports.VideoFlowEssenceParameters||(exports.VideoFlowEssenceParameters={}));exports.ImageFlow=void 0;(t=>{t.FormatEnum={UrnxNmosformatdata:"urn:x-tam:format:image"}})(exports.ImageFlow||(exports.ImageFlow={}));exports.Contentformat=co;exports.OmakaseMarkerListComponent=uo;exports.OmakasePlayerComponent=_n;exports.OmakasePlayerTimelineBuilder=Fr;exports.OmakasePlayerTimelineComponent=Oi;exports.OmakasePlayerTimelineControlsToolbar=Zi;exports.OmakaseTamsPlayerComponent=ro;exports.OmakaseTimeRangePicker=ao;exports.TimeRangeUtil=B;exports.TimecodeUtil=re;exports.convertFlowIdToSubtitlesId=on;
|
|
297
|
+
`,X={container:"omakase-time-range-selector-container",segments:"omakase-time-range-selector-segments",segment:"omakase-time-range-selector-segment",segmentMarker:"omakase-time-range-selector-segment-marker",segmentTick:"omakase-time-range-selector-segment-tick",segmentLabel:"omakase-time-range-selector-segment-label",firstSegmentLabel:"omakase-time-range-selector-segment-first-label",secondSegmentLabel:"omakase-time-range-selector-segment-second-label",rangeSelector:"omakase-time-range-selector-range-selector",rangeSelectorHandle:"omakase-time-range-selector-range-selector-handle",rangeSelectorDuration:"omakase-time-range-selector-range-selector-duration",buttonContainer:"omakase-time-range-selector-button-container",invisible:"omakase-time-range-selector-invisible"},hn={leftHandle:"omakase-time-range-selector-range-selector-left-handle",rightHandle:"omakase-time-range-selector-range-selector-right-handle",rangeDuration:"omakase-time-range-selector-range-selector-range-duration",segments:"omakase-time-range-selector-segments"};class di extends HTMLElement{constructor(){super();k(this,"_container");k(this,"_rangeSelector");k(this,"_rangeSelectorLeftHandle");k(this,"_rangeSelectorRightHandle");k(this,"_rangeSelectorRangeDisplay");k(this,"_buttonContainer");k(this,"_segments");k(this,"_numberOfSegments",5);k(this,"_firstLabelIndex",0);k(this,"_initialFirstLabelIndex",0);k(this,"_labels",[]);k(this,"minWidth",10);k(this,"minValue");k(this,"maxValue");k(this,"maxRange");k(this,"segmentSize");k(this,"sliderStart");k(this,"sliderEnd");k(this,"maxWidthPercent");k(this,"labelFormatter",__);k(this,"onCheckmarkClickCallback");k(this,"currentStart",0);k(this,"currentEnd",100);k(this,"resetSegments",()=>{this._container.removeChild(this._segments),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.classList.add(X.segments),this._container.append(this._segments)});k(this,"getBounds",()=>({wrapperLeft:this._container.offsetLeft,wrapperRight:this._container.offsetLeft+this._container.offsetWidth,wrapperWidth:this._container.offsetWidth,selectorLeft:this._rangeSelector.offsetLeft,selectorWidth:this._rangeSelector.offsetWidth}));k(this,"getSliderValues",()=>{const{wrapperWidth:r,selectorLeft:i,selectorWidth:n}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),a=this._labels.at(this.lastLabelIndex),u=Math.round(o+i/r*(a-o)),s=Math.round(o+(i+n)/r*(a-o));return{start:u,end:s}});k(this,"getSelectorBounds",(r,i)=>{const{wrapperWidth:n}=this.getBounds(),o=this._labels.at(this.firstLabelIndex),a=this._labels.at(this.lastLabelIndex),u=Math.round((r-o)/(a-o)*n),s=Math.round((i-r)/(a-o)*n);return{selectorLeft:u,selectorWidth:s}});k(this,"initSlider",(r,i)=>{const n=this.getSelectorBounds(r,i);this._rangeSelector.style.left=n.selectorLeft.toString()+"px",this._rangeSelector.style.width=n.selectorWidth.toString()+"px",this.updateDuration()});k(this,"showButtons",()=>{const{start:r,end:i}=this.getSliderValues();r===this.currentStart&&i===this.currentEnd||this._buttonContainer.classList.remove(X.invisible)});k(this,"hideButtons",()=>{this._buttonContainer.classList.add(X.invisible)});k(this,"updateDuration",()=>{const{start:r,end:i}=this.getSliderValues(),n=i-r;this._rangeSelectorRangeDisplay.textContent=this.labelFormatter(n)});k(this,"onXclick",()=>{this.firstLabelIndex=this._initialFirstLabelIndex,this.resetSegments();const r=this.getSelectorBounds(this.currentStart,this.currentEnd);this._rangeSelector.style.left=r.selectorLeft.toString()+"px",this._rangeSelector.style.width=r.selectorWidth.toString()+"px",this.updateDuration(),this.hideButtons()});k(this,"onCheckmarkClick",()=>{const{start:r,end:i}=this.getSliderValues();this.currentStart=r,this.currentEnd=i,this._initialFirstLabelIndex=this.firstLabelIndex,this.updateDuration(),this.hideButtons(),this.onCheckmarkClickCallback!==void 0&&this.onCheckmarkClickCallback(r,i)});k(this,"onMouseDownRight",r=>{r.preventDefault();const i=r.clientX,{selectorWidth:n,wrapperWidth:o,selectorLeft:a}=this.getBounds();let u=null,s=null;const c=d=>{let f=d.clientX-i,m=Math.max(this.minWidth,n+f);const g=Math.min(o*this.maxWidthPercent,o-a),h=m>g,v=performance.now();h?u===null&&(u=v,s=window.setTimeout(()=>{this.outOfBoundsCallback(!0),s=window.setInterval(()=>this.outOfBoundsCallback(!0),400)},500)):(s!==null&&(clearTimeout(s),clearInterval(s),s=null),u=null),m=Math.min(m,g),this._rangeSelector.style.width=`${m}px`,this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",l),s!==null&&(clearTimeout(s),clearInterval(s),s=null),u=null};document.addEventListener("mousemove",c),document.addEventListener("mouseup",l)});k(this,"onMouseDownLeft",r=>{r.preventDefault();const i=r.clientX,{selectorLeft:n,selectorWidth:o,wrapperWidth:a}=this.getBounds();let u=null,s=null;const c=d=>{let f=d.clientX-i,m=n+f;const g=m<0,h=performance.now();g?u===null&&(u=h,s=window.setTimeout(()=>{this.outOfBoundsCallback(!1),s=window.setInterval(()=>this.outOfBoundsCallback(!1),400)},500)):(s!==null&&(clearTimeout(s),clearInterval(s),s=null),u=null),m<0&&(f=-n,m=0);let v=Math.min(Math.max(this.minWidth,o-f),a);m+v>a&&(m=a-v),v>this.minWidth&&v<a*this.maxWidthPercent&&(this._rangeSelector.style.left=`${m}px`,this._rangeSelector.style.width=`${v}px`),this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",l),s!==null&&(clearTimeout(s),clearInterval(s),s=null),u=null};document.addEventListener("mousemove",c),document.addEventListener("mouseup",l)});k(this,"outOfBoundsCallback",r=>{r?this.firstLabelIndex+=1:this.firstLabelIndex-=1,this.resetSegments()});k(this,"onMouseDownDrag",r=>{if(r.target instanceof HTMLElement&&r.target.classList.contains(X.rangeSelectorHandle))return;r.preventDefault();const i=r.clientX,{selectorLeft:n,selectorWidth:o,wrapperWidth:a}=this.getBounds();let u=null,s=null;const c=d=>{let f=d.clientX-i,m=n+f;const g=a-o,h=m<0||m>g,v=performance.now();if(h){if(u===null){const w=m>g;u=v,s=window.setTimeout(()=>{this.outOfBoundsCallback(w),s=window.setInterval(()=>this.outOfBoundsCallback(w),400)},500)}}else s!==null&&(clearTimeout(s),clearInterval(s),s=null),u=null;m=Math.max(0,Math.min(m,g)),this._rangeSelector.style.left=`${m}px`,this.updateDuration()},l=()=>{this.showButtons(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",l),s!==null&&(clearTimeout(s),clearInterval(s))};document.addEventListener("mousemove",c),document.addEventListener("mouseup",l)})}set numberOfSegments(r){r>2&&(this._numberOfSegments=r)}get numberOfSegments(){return this._numberOfSegments}static get observedAttributes(){return["minValue","maxValue","maxRange","segmentSize","sliderStart","sliderEnd","numberOfSegments"]}get firstLabelIndex(){return this._firstLabelIndex}set firstLabelIndex(r){if(r+this._numberOfSegments+1>=this._labels.length){this._firstLabelIndex=this._labels.length-1-this.numberOfSegments;return}if(r<0){this._firstLabelIndex=0;return}this._firstLabelIndex=r}get lastLabelIndex(){return this._firstLabelIndex+this._numberOfSegments}connectedCallback(){if(this.minValue=Number.parseInt(this.getAttribute("minValue")??"NaN"),this.maxValue=Number.parseInt(this.getAttribute("maxValue")??"NaN"),this.maxRange=Number.parseInt(this.getAttribute("maxRange")??"NaN"),this.segmentSize=Number.parseInt(this.getAttribute("segmentSize")??"NaN"),this.getAttribute("numberOfSegments")){const l=Number.parseInt(this.getAttribute("numberOfSegments"));if(Number.isNaN(l))throw new Error("Invalid atribute value");this._numberOfSegments=l}if(Number.isNaN(this.minValue)||Number.isNaN(this.maxValue)||Number.isNaN(this.maxRange)||Number.isNaN(this.segmentSize))throw new Error("Invalid attribute values.");const r=this.maxValue-this.minValue;if(r<this.numberOfSegments*this.segmentSize&&(this.segmentSize=r/this.numberOfSegments),this.maxWidthPercent=this.maxRange>this.numberOfSegments*this.segmentSize?1:this.maxRange/(this.numberOfSegments*this.segmentSize),this._labels=this.calculateLabels(),this.maxValue<this.minValue)throw new Error("Max value is lesser than min value");let i,n;if(this.getAttribute("sliderStart")&&this.getAttribute("sliderEnd")){if(i=Number.parseFloat(this.getAttribute("sliderStart")),n=Number.parseFloat(this.getAttribute("sliderEnd")),i>n)throw new Error("Slider start is bigger than slider end");if(i<this.minValue)throw new Error("Slider start is smaller than minimal value");n>this.maxValue&&(n=this.maxValue),this.currentStart=i,this.currentEnd=n}else i=this.minValue,n=this.segmentSize;this.resolveInitialSegment(i,n),this._container=document.createElement("div"),this._container.classList.add(X.container);const o=document.createElement("style");o.textContent=y_,this._container.append(o),this._buttonContainer=document.createElement("div"),this._buttonContainer.classList.add(X.buttonContainer,X.invisible);const a=this.createButtonSvg($_),u=this.createButtonSvg(w_);a.onclick=this.onCheckmarkClick,u.onclick=this.onXclick,this._buttonContainer.append(a,u),this._container.append(this._buttonContainer),this._rangeSelector=document.createElement("div"),this._rangeSelector.classList.add(X.rangeSelector),this._rangeSelectorLeftHandle=document.createElement("div"),this._rangeSelectorLeftHandle.classList.add(X.rangeSelectorHandle),this._rangeSelectorLeftHandle.id=hn.leftHandle,this._rangeSelectorRightHandle=document.createElement("div"),this._rangeSelectorRightHandle.classList.add(X.rangeSelectorHandle),this._rangeSelectorRightHandle.id=hn.rightHandle,this._rangeSelectorRangeDisplay=document.createElement("div"),this._rangeSelectorRangeDisplay.classList.add(X.rangeSelectorDuration),this._rangeSelectorRangeDisplay.id=hn.rangeDuration,this._rangeSelector.append(this._rangeSelectorLeftHandle,this._rangeSelectorRangeDisplay,this._rangeSelectorRightHandle),this._container.append(this._rangeSelector),this._segments=this.buildSegments(this._labels.slice(this.firstLabelIndex,this.lastLabelIndex+1)),this._segments.id=hn.segments,this._segments.classList.add(X.segments),this._container.append(this._segments),this._rangeSelectorLeftHandle.addEventListener("mousedown",this.onMouseDownLeft),this._rangeSelectorRightHandle.addEventListener("mousedown",this.onMouseDownRight),this._rangeSelector.addEventListener("mousedown",this.onMouseDownDrag),this.append(this._container),this.initSlider(i,n);const{start:s,end:c}=this.getSliderValues();this.currentStart=s,this.currentEnd=c,this.updateDuration()}resolveInitialSegment(r,i){const n=this._numberOfSegments*this.segmentSize,o=i-r,a=this.maxValue-this.minValue,u=r-this.minValue,s=Math.ceil(a/this.segmentSize);let c=Math.floor(u/a*s);c+=Math.floor((n-o)/this.segmentSize);const d=c+Math.ceil(o/this.segmentSize)-this._numberOfSegments;this.firstLabelIndex=d,this._initialFirstLabelIndex=d}createButtonSvg(r){const i=document.createElement("button");return i.innerHTML=r,i}calculateLabels(){const r=this.minValue,i=this.maxValue,n=Math.floor((this.maxValue-this.minValue)/this.segmentSize)-1,o=[r];let a=this.minValue;for(let u=0;u<n;u++)a+=this.segmentSize,o.push(a);return o.push(i),o}buildSegments(r){const i=document.createElement("div");r.slice(0,-2).forEach(c=>{const l=document.createElement("div");l.classList.add(X.segment);const d=document.createElement("div");d.classList.add(X.segmentMarker);const f=document.createElement("div");f.classList.add(X.segmentTick);const m=document.createElement("div");m.classList.add(X.segmentLabel),m.innerHTML=this.labelFormatter(c),l.append(d,f,m),i.append(l)});const n=document.createElement("div");n.classList.add(X.segment);const o=document.createElement("div");o.classList.add(X.segmentMarker);const a=document.createElement("div");a.classList.add(X.segmentTick);const u=document.createElement("div");u.classList.add(X.segmentLabel,X.firstSegmentLabel),u.innerHTML=this.labelFormatter(r.at(-2));const s=document.createElement("div");return s.classList.add(X.segmentLabel,X.secondSegmentLabel),s.innerHTML=this.labelFormatter(r.at(-1)),n.append(o,a,u,s),i.append(n),i}}customElements.get("omakase-time-range-selector")||customElements.define("omakase-time-range-selector",di);const pu="omakase-time-range-selector-react-div",S_=({timeRange:e,maxTimeRange:t,numberOfSegments:r,segmentSize:i,maxSliderRange:n,onCheckmarkClickCallback:o,labelFormatter:a})=>(customElements.get("omakase-time-range-selector")||customElements.define("omakase-time-range-selector",di),$.useEffect(()=>{var g;const u=N.parseTimeRange(t),s=N.timeMomentToSeconds(u.start),c=N.timeMomentToSeconds(u.end),l=N.parseTimeRange(e),d=N.timeMomentToSeconds(l.start),f=N.timeMomentToSeconds(l.end),m=new di;m.setAttribute("minValue",s.toString()),m.setAttribute("maxValue",c.toString()),m.setAttribute("maxRange",n.toString()),m.setAttribute("segmentSize",i.toString()),m.setAttribute("numberOfSegments",r.toString()),m.setAttribute("sliderStart",d.toString()),m.setAttribute("sliderEnd",f.toString()),m.onCheckmarkClickCallback=o,a&&(m.labelFormatter=a),(g=document.getElementById(pu))==null||g.append(m)},[]),$.createElement("div",{id:pu})),k_=$.memo(({omakasePlayer:e,config:t,onCreateMarkerListCallback:r})=>($.useEffect(()=>{const i=e.createMarkerList(t).subscribe({next:n=>{r==null||r(n)}});return()=>{i.unsubscribe()}},[t.source]),$.createElement("div",{id:t.markerListHTMLElementId})));exports.AudioFlow=void 0;(e=>{e.FormatEnum={UrnxNmosformataudio:"urn:x-nmos:format:audio"}})(exports.AudioFlow||(exports.AudioFlow={}));const I_={Video:"urn:x-nmos:format:video",Audio:"urn:x-nmos:format:audio",Data:"urn:x-nmos:format:data",Multi:"urn:x-nmos:format:multi"};exports.DataFlow=void 0;(e=>{e.FormatEnum={UrnxNmosformatdata:"urn:x-nmos:format:data"}})(exports.DataFlow||(exports.DataFlow={}));exports.DeletionRequest=void 0;(e=>{e.StatusEnum={Created:"created",Started:"started",Done:"done",Error:"error"}})(exports.DeletionRequest||(exports.DeletionRequest={}));exports.MediaBucketObjectStorePreInner=void 0;(e=>{e.ActionEnum={CreateBucket:"create_bucket"}})(exports.MediaBucketObjectStorePreInner||(exports.MediaBucketObjectStorePreInner={}));exports.MultiEssenceFlow=void 0;(e=>{e.FormatEnum={UrnxNmosformatmulti:"urn:x-nmos:format:multi"}})(exports.MultiEssenceFlow||(exports.MultiEssenceFlow={}));exports.ServiceMediaStore=void 0;(e=>{e.TypeEnum={HttpObjectStore:"http_object_store"}})(exports.ServiceMediaStore||(exports.ServiceMediaStore={}));exports.Source=void 0;(e=>{e.FormatEnum={Video:"urn:x-nmos:format:video",Audio:"urn:x-nmos:format:audio",Data:"urn:x-nmos:format:data",Multi:"urn:x-nmos:format:multi"}})(exports.Source||(exports.Source={}));exports.UncompressedAudioParameters=void 0;(e=>{e.UncTypeEnum={Interleaved:"interleaved",Planar:"planar",Pairs:"pairs"}})(exports.UncompressedAudioParameters||(exports.UncompressedAudioParameters={}));exports.UncompressedVideoParameters=void 0;(e=>{e.UncTypeEnum={Planar:"planar",Yuyv:"YUYV",Uyvy:"UYVY",Ayuv:"AYUV",V210:"v210",V216:"v216",Rgb:"RGB",Rgbx:"RGBx",XRgb:"xRGB",Bgrx:"BGRx",XBgr:"xBGR",Rgba:"RGBA",Argb:"ARGB",Bgra:"BGRA",Abgr:"ABGR",Alpha:"alpha"}})(exports.UncompressedVideoParameters||(exports.UncompressedVideoParameters={}));exports.VideoFlow=void 0;(e=>{e.FormatEnum={UrnxNmosformatvideo:"urn:x-nmos:format:video"}})(exports.VideoFlow||(exports.VideoFlow={}));exports.VideoFlowEssenceParameters=void 0;(e=>{e.InterlaceModeEnum={Progressive:"progressive",InterlacedTff:"interlaced_tff",InterlacedBff:"interlaced_bff",InterlacedPsf:"interlaced_psf"},e.ColorspaceEnum={Bt601:"BT601",Bt709:"BT709",Bt2020:"BT2020",Bt2100:"BT2100"},e.TransferCharacteristicEnum={Sdr:"SDR",Hlg:"HLG",Pq:"PQ"},e.ComponentTypeEnum={YcbCr:"YCbCr",Rgb:"RGB"}})(exports.VideoFlowEssenceParameters||(exports.VideoFlowEssenceParameters={}));exports.ImageFlow=void 0;(e=>{e.FormatEnum={UrnxNmosformatdata:"urn:x-tam:format:image"}})(exports.ImageFlow||(exports.ImageFlow={}));exports.Contentformat=I_;exports.OmakaseMarkerListComponent=k_;exports.OmakasePlayerComponent=r_;exports.OmakasePlayerTimelineBuilder=ob;exports.OmakasePlayerTimelineComponent=n_;exports.OmakasePlayerTimelineControlsToolbar=v_;exports.OmakaseTamsPlayer=Pm;exports.OmakaseTamsPlayerComponent=b_;exports.OmakaseTimeRangePicker=S_;exports.TimeRangeUtil=N;exports.TimecodeUtil=xe;exports.VideoApiProxy=Au;exports.convertFlowIdToSubtitlesId=nh;exports.gatherAndExportToManifest=Uu;exports.removeGapsInSegments=zu;exports.removeGapsInSegmentsByExtending=Eu;exports.resolveAudioManifestName=xu;exports.resolveTextManifestName=Tu;exports.validateTamsPayload=Ou;
|
|
256
298
|
//# sourceMappingURL=index.cjs.js.map
|