@libmedia/avplayer 1.0.1 → 1.1.0

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.
Files changed (117) hide show
  1. package/dist/esm/1.avplayer.js +1 -1
  2. package/dist/esm/134.avplayer.js +1 -0
  3. package/dist/esm/158.avplayer.js +1 -0
  4. package/dist/esm/236.avplayer.js +1 -1
  5. package/dist/esm/243.avplayer.js +1 -1
  6. package/dist/esm/265.avplayer.js +1 -1
  7. package/dist/esm/272.avplayer.js +1 -0
  8. package/dist/esm/276.avplayer.js +1 -1
  9. package/dist/esm/29.avplayer.js +1 -1
  10. package/dist/esm/293.avplayer.js +1 -0
  11. package/dist/esm/351.avplayer.js +1 -0
  12. package/dist/esm/383.avplayer.js +1 -0
  13. package/dist/esm/426.avplayer.js +1 -0
  14. package/dist/esm/434.avplayer.js +1 -0
  15. package/dist/esm/471.avplayer.js +1 -0
  16. package/dist/esm/473.avplayer.js +1 -0
  17. package/dist/esm/484.avplayer.js +1 -1
  18. package/dist/esm/519.avplayer.js +1 -1
  19. package/dist/esm/520.avplayer.js +1 -1
  20. package/dist/esm/521.avplayer.js +1 -1
  21. package/dist/esm/561.avplayer.js +1 -0
  22. package/dist/esm/625.avplayer.js +1 -1
  23. package/dist/esm/634.avplayer.js +1 -0
  24. package/dist/esm/652.avplayer.js +1 -1
  25. package/dist/esm/724.avplayer.js +1 -0
  26. package/dist/esm/726.avplayer.js +1 -0
  27. package/dist/esm/728.avplayer.js +1 -1
  28. package/dist/esm/765.avplayer.js +1 -0
  29. package/dist/esm/779.avplayer.js +1 -1
  30. package/dist/esm/888.avplayer.js +1 -1
  31. package/dist/esm/931.avplayer.js +1 -0
  32. package/dist/esm/967.avplayer.js +1 -0
  33. package/dist/esm/avplayer.js +1 -1
  34. package/dist/umd/1.avplayer.js +1 -1
  35. package/dist/umd/134.avplayer.js +1 -0
  36. package/dist/umd/158.avplayer.js +1 -0
  37. package/dist/umd/236.avplayer.js +1 -1
  38. package/dist/umd/243.avplayer.js +1 -1
  39. package/dist/umd/265.avplayer.js +1 -1
  40. package/dist/umd/272.avplayer.js +1 -0
  41. package/dist/umd/276.avplayer.js +1 -1
  42. package/dist/umd/29.avplayer.js +1 -1
  43. package/dist/umd/293.avplayer.js +1 -0
  44. package/dist/umd/351.avplayer.js +1 -0
  45. package/dist/umd/383.avplayer.js +1 -0
  46. package/dist/umd/426.avplayer.js +1 -0
  47. package/dist/umd/434.avplayer.js +1 -0
  48. package/dist/umd/471.avplayer.js +1 -0
  49. package/dist/umd/473.avplayer.js +1 -0
  50. package/dist/umd/484.avplayer.js +1 -1
  51. package/dist/umd/519.avplayer.js +1 -1
  52. package/dist/umd/520.avplayer.js +1 -1
  53. package/dist/umd/521.avplayer.js +1 -1
  54. package/dist/umd/561.avplayer.js +1 -0
  55. package/dist/umd/625.avplayer.js +1 -1
  56. package/dist/umd/634.avplayer.js +1 -0
  57. package/dist/umd/652.avplayer.js +1 -1
  58. package/dist/umd/724.avplayer.js +1 -0
  59. package/dist/umd/726.avplayer.js +1 -0
  60. package/dist/umd/728.avplayer.js +1 -1
  61. package/dist/umd/765.avplayer.js +1 -0
  62. package/dist/umd/779.avplayer.js +1 -1
  63. package/dist/umd/888.avplayer.js +1 -1
  64. package/dist/umd/931.avplayer.js +1 -0
  65. package/dist/umd/967.avplayer.js +1 -0
  66. package/dist/umd/avplayer.js +1 -1
  67. package/package.json +13 -12
  68. package/dist/esm/106.avplayer.js +0 -1
  69. package/dist/esm/140.avplayer.js +0 -1
  70. package/dist/esm/160.avplayer.js +0 -1
  71. package/dist/esm/192.avplayer.js +0 -1
  72. package/dist/esm/214.avplayer.js +0 -1
  73. package/dist/esm/230.avplayer.js +0 -1
  74. package/dist/esm/286.avplayer.js +0 -1
  75. package/dist/esm/338.avplayer.js +0 -1
  76. package/dist/esm/494.avplayer.js +0 -1
  77. package/dist/esm/54.avplayer.js +0 -1
  78. package/dist/esm/549.avplayer.js +0 -1
  79. package/dist/esm/588.avplayer.js +0 -1
  80. package/dist/esm/612.avplayer.js +0 -1
  81. package/dist/esm/711.avplayer.js +0 -1
  82. package/dist/esm/725.avplayer.js +0 -1
  83. package/dist/esm/730.avplayer.js +0 -1
  84. package/dist/esm/759.avplayer.js +0 -1
  85. package/dist/esm/772.avplayer.js +0 -1
  86. package/dist/esm/885.avplayer.js +0 -1
  87. package/dist/esm/887.avplayer.js +0 -1
  88. package/dist/esm/90.avplayer.js +0 -1
  89. package/dist/esm/908.avplayer.js +0 -1
  90. package/dist/esm/913.avplayer.js +0 -1
  91. package/dist/esm/969.avplayer.js +0 -1
  92. package/dist/esm/981.avplayer.js +0 -1
  93. package/dist/umd/106.avplayer.js +0 -1
  94. package/dist/umd/140.avplayer.js +0 -1
  95. package/dist/umd/160.avplayer.js +0 -1
  96. package/dist/umd/192.avplayer.js +0 -1
  97. package/dist/umd/214.avplayer.js +0 -1
  98. package/dist/umd/230.avplayer.js +0 -1
  99. package/dist/umd/286.avplayer.js +0 -1
  100. package/dist/umd/338.avplayer.js +0 -1
  101. package/dist/umd/494.avplayer.js +0 -1
  102. package/dist/umd/54.avplayer.js +0 -1
  103. package/dist/umd/549.avplayer.js +0 -1
  104. package/dist/umd/588.avplayer.js +0 -1
  105. package/dist/umd/612.avplayer.js +0 -1
  106. package/dist/umd/711.avplayer.js +0 -1
  107. package/dist/umd/725.avplayer.js +0 -1
  108. package/dist/umd/730.avplayer.js +0 -1
  109. package/dist/umd/759.avplayer.js +0 -1
  110. package/dist/umd/772.avplayer.js +0 -1
  111. package/dist/umd/885.avplayer.js +0 -1
  112. package/dist/umd/887.avplayer.js +0 -1
  113. package/dist/umd/90.avplayer.js +0 -1
  114. package/dist/umd/908.avplayer.js +0 -1
  115. package/dist/umd/913.avplayer.js +0 -1
  116. package/dist/umd/969.avplayer.js +0 -1
  117. package/dist/umd/981.avplayer.js +0 -1
@@ -0,0 +1 @@
1
+ export const __webpack_esm_id__=931;export const __webpack_esm_ids__=[931];export const __webpack_esm_modules__={834:(e,t,a)=>{a.d(t,{Ag:()=>x,Cr:()=>s,GZ:()=>y,Pb:()=>P,Qb:()=>v,Wg:()=>A,Wy:()=>p,Y0:()=>u,aL:()=>B,eG:()=>h,hK:()=>g,jt:()=>I,pf:()=>N,qi:()=>l,qp:()=>f});var r=a(17283),i=a(21782),n=a(82915),c=a(58650);const o="packages/avformat/src/formats/matroska/imatroska.ts",d=BigInt(20971520),s={19899:{type:9,isArray:!0,filedName:"entry",child:{21419:{type:1,filedName:"id"},21420:{type:2,filedName:"pos"}}}},l={29604:{type:2,filedName:"segmentUUID"},2807729:{type:1,filedName:"timestampScale"},17545:{type:5,filedName:"duration"},31657:{type:7,filedName:"title"},19840:{type:7,filedName:"muxingApp"},22337:{type:7,filedName:"writingApp"},17505:{type:8,filedName:"dateUTC"}},p={174:{type:9,isArray:!0,filedName:"entry",child:{215:{type:1,filedName:"number"},29637:{type:1,filedName:"uid"},131:{type:1,filedName:"type"},21358:{type:7,filedName:"name"},136:{type:10,filedName:"default"},185:{type:10,filedName:"enabled"},2274716:{type:7,filedName:"language"},2306383:{type:6,filedName:"timeScale"},134:{type:7,filedName:"codecId"},2459272:{type:7,filedName:"codecName"},25506:{type:8,filedName:"codecPrivate"},225:{type:9,filedName:"audio",child:{181:{type:5,filedName:"sampleRate"},30901:{type:5,filedName:"outSampleRate"},25188:{type:1,filedName:"bitDepth"},159:{type:1,filedName:"channels"}}},224:{type:9,filedName:"video",child:{2327523:{type:1,filedName:"framerate"},21680:{type:1,filedName:"displayWidth"},21690:{type:1,filedName:"displayHeight"},176:{type:1,filedName:"pixelWidth"},186:{type:1,filedName:"pixelHeight"},3061028:{type:8,filedName:"colorSpace"},21440:{type:1,filedName:"alphaMode"},21936:{type:9,filedName:"color",child:{21937:{type:1,filedName:"matrixCoefficients"},21938:{type:1,filedName:"bitsPerChannel"},21941:{type:1,filedName:"cbSubHorz"},21942:{type:1,filedName:"cbSubVert"},21939:{type:1,filedName:"chromaSubHorz"},21940:{type:1,filedName:"chromaSubVert"},21943:{type:1,filedName:"chromaSitingHorz"},21944:{type:1,filedName:"chromaSitingVert"},21945:{type:1,filedName:"range"},21946:{type:1,filedName:"transferCharacteristics"},21947:{type:1,filedName:"primaries"},21948:{type:1,filedName:"maxCll"},21949:{type:1,filedName:"maxFall"},21968:{type:9,filedName:"masteringMeta",child:{21969:{type:5,filedName:"rx"},21970:{type:5,filedName:"ry"},21971:{type:5,filedName:"gx"},21972:{type:5,filedName:"gy"},21973:{type:5,filedName:"bx"},21974:{type:5,filedName:"by"},21975:{type:5,filedName:"whiteX"},21976:{type:5,filedName:"whiteY"},21978:{type:5,isArray:!0,filedName:"minLuminance"},21977:{type:5,filedName:"maxLuminance"}}}}},30320:{type:9,filedName:"projection",child:{30321:{type:1,filedName:"type"},30322:{type:8,filedName:"private"},30323:{type:5,filedName:"yaw"},30324:{type:5,filedName:"pitch"},30325:{type:5,filedName:"roll"}}},21682:{type:1,filedName:"displayUnit"},154:{type:1,filedName:"interlaced"},157:{type:1,filedName:"fieldOrder"},21432:{type:1,filedName:"stereoMode"},21683:{type:1,filedName:"aspectRatio"}}},226:{type:9,filedName:"operations",child:{227:{type:9,isArray:!0,filedName:"entry",child:{228:{type:9,isArray:!0,filedName:"planes",child:{230:{type:1,filedName:"type"},229:{type:1,filedName:"uid"}}}}}}},28032:{type:9,filedName:"encodings",child:{25152:{type:9,isArray:!0,filedName:"entry",child:{20530:{type:1,filedName:"scope"},20531:{type:1,filedName:"type"},20532:{type:9,filedName:"compression",child:{16980:{type:1,filedName:"algo"},16981:{type:8,filedName:"settings"}}},20533:{type:9,filedName:"encryption",child:{18401:{type:1,filedName:"algo"},18402:{type:8,filedName:"keyId"}}}}}}}}}},f={24999:{type:9,isArray:!0,filedName:"entry",child:{18094:{type:1,filedName:"uid"},18030:{type:7,filedName:"name"},18016:{type:7,filedName:"mime"},18046:{type:7,filedName:"description"},18012:{type:8,filedName:"data"}}}},u={17849:{type:9,isArray:!0,filedName:"entry",child:{182:{type:9,isArray:!0,filedName:"atom",child:{145:{type:2,filedName:"start"},146:{type:2,filedName:"end"},29636:{type:1,filedName:"uid"},128:{type:9,filedName:"display",child:{133:{type:7,filedName:"title"},17276:{type:7,filedName:"language"}}}}}}}},h={187:{type:9,isArray:!0,filedName:"entry",child:{179:{type:2,filedName:"time"},183:{type:9,isArray:!0,filedName:"pos",child:{247:{type:1,filedName:"track"},241:{type:2,filedName:"pos"}}}}}},m={17827:{type:7,filedName:"name"},17543:{type:7,filedName:"string"},17530:{type:7,filedName:"language"},17540:{type:1,filedName:"default"},17588:{type:1,filedName:"default"},26568:{type:9,filedName:"sub"}};m[26568].child=m;const g={29555:{type:9,isArray:!0,filedName:"entry",child:{26568:{type:9,filedName:"tag",child:m,isArray:!0},25536:{type:9,filedName:"target",child:{25546:{type:7,filedName:"type"},26826:{type:1,filedName:"typeValue"},25541:{type:1,filedName:"trackUid"},25540:{type:1,filedName:"chapterUid"},25542:{type:1,filedName:"attachUid"}}}}}},A={161:{type:8,filedName:"block"},30113:{type:9,filedName:"additions",child:{166:{type:9,isArray:!0,filedName:"entry",child:{238:{type:1,filedName:"additionalId"},165:{type:8,filedName:"additional"}}}}},155:{type:2,filedName:"duration"},30114:{type:4,filedName:"discardPadding"},251:{type:4,isArray:!0,filedName:"reference"},164:{type:10,filedName:"nonSimple"}},y={163:{type:8,filedName:"block"},160:{type:9,filedName:"blockGroup",child:A},231:{type:2,filedName:"timeCode"},167:{type:2,filedName:"pos"},171:{type:2,filedName:"prevSize"}},I={17030:{type:1,filedName:"version"},17143:{type:1,filedName:"readVersion"},17138:{type:1,filedName:"maxIdLength"},17139:{type:1,filedName:"maxSizeLength"},17026:{type:7,filedName:"docType"},17031:{type:1,filedName:"docTypeVersion"},17029:{type:1,filedName:"docTypeReadVersion"}};async function x(e,t){const a=e.getPos();let r=await e.readUint8();if(!r)return n.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,765),c.LR;let i=1;for(;!(128&r);)i++,r<<=1;if(r&=127,i>t)return n.z3(`Length ${i} indicated by an EBML number's first byte ${r.toString(16)} at pos ${a} exceeds max length ${t}.`,o,778),c.LR;let d=r>>>i-1;for(;--i;)d<<=8,d|=await e.readUint8();return d}async function N(e,t){const a=e.getPos();return await x(e,t)-((1<<7*Number(BigInt.asIntN(32,e.getPos()-a))-1)-1)}async function v(e,t){const a=e.getPos();let r=await e.readUint8(),i=1;if(!r)return n.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,812),BigInt(c.LR);for(;!(128&r);)i++,r<<=1;if(r&=127,i>t)return n.z3(`Length ${i} indicated by an EBML number's first byte ${r.toString(16)} at pos ${a} exceeds max length ${t}.`,o,823),BigInt(c.LR);let d=BigInt(Math.floor(r>>>i-1));for(;--i;){d<<=BigInt(8);const t=await e.readUint8();d|=BigInt(Math.floor(t))}return d}async function b(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readUint8();case BigInt(2):return e.ioReader.readUint16();case BigInt(3):return e.ioReader.readUint24();case BigInt(4):return e.ioReader.readUint32();case BigInt(8):return e.ioReader.readUint64()}let a=BigInt(0),r=0;for(;r++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return a}async function S(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readInt8();case BigInt(2):return e.ioReader.readInt16();case BigInt(4):return e.ioReader.readInt32();case BigInt(8):return e.ioReader.readInt64()}let a=BigInt(0),r=0;for(;r++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return t===BigInt(3)?Number(BigInt.asIntN(32,BigInt.asIntN(24,a))):BigInt.asIntN(64,a)}async function B(e,t){const a=e.ioReader.getPos();let r=await e.ioReader.peekUint8();if(!r)return n.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,908),c.LR;let i=1;for(;!(128&r);)i++,r<<=1;if(i>t)return n.z3(`Length ${i} indicated by an EBML number's first byte ${r.toString(16)} at pos ${a} exceeds max length ${t}.`,o,920),c.LR;let d=0;for(;i--;)d<<=8,d|=await e.ioReader.readUint8();return d}async function P(e,t,a,n={},c=[]){return await async function(e,t,a){const r=e.privateData,i=e.ioReader.getPos();for(;e.ioReader.getPos()<i+t;){const t=await B(e,r.header.maxIdLength),i=await v(e.ioReader,r.header.maxSizeLength);if(e.ioReader.getPos(),!1===await a(t,i))return}}(e,t,(async(t,o)=>{if(a[t]){const i=a[t];let c;switch(i.type){case 1:c=await b(e,o);break;case 2:c=await b(e,o),r.ai(c)&&(c=BigInt(c));break;case 3:c=await S(e,o);break;case 4:c=await S(e,o),r.ai(c)&&(c=BigInt(c));break;case 6:case 5:c=await async function(e,t){return t===BigInt(4)?e.ioReader.readFloat():t===BigInt(8)?e.ioReader.readDouble():(await e.ioReader.skip(Number(BigInt.asIntN(32,t))),0)}(e,o);break;case 7:c=await e.ioReader.readString(Number(BigInt.asIntN(32,o))),c&&0===c.charCodeAt(c.length-1)&&(c=c.substring(0,c.length-1));break;case 10:c=!!await b(e,o);break;case 8:c={pos:e.ioReader.getPos(),size:o,data:o<d?await e.ioReader.readBuffer(Number(BigInt.asIntN(32,o))):null};break;case 9:c=i.child?await P(e,o,i.child):{};break;default:await e.ioReader.skip(Number(BigInt.asIntN(32,o)))}if(null!=c)if(i.isArray){const e=n[i.filedName]||[];e.push(c),n[i.filedName]=e}else n[i.filedName]=c}else await e.ioReader.skip(Number(BigInt.asIntN(32,o)));if(c.length&&i.zy(c,t))return!1})),n}},7702:(e,t,a)=>{var r=a(94608),i=a(42298),n=a(13261),c=a(26709);e.exports=function(e){var t=r(this),a=c(e);return!(i(t)>a.size)&&!1!==n(t,(function(e){if(!a.includes(e))return!1}),!0)}},12832:(e,t,a)=>{var r=a(41199);a(92833),e.exports=r},13261:(e,t,a)=>{var r=a(88099);e.exports=function(e,t,a){return a?r(e.keys(),t,!0):e.forEach(t)}},15475:e=>{e.exports=function(e){try{var t=new Set,a={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](a);return 1===r.size&&4===r.values().next().value}catch(e){return!1}}},15633:(e,t,a)=>{var r=a(75068);e.exports=r},16712:()=>{},18616:(e,t,a)=>{var r=a(94608),i=a(86874),n=a(59470),c=a(42298),o=a(26709),d=a(13261),s=a(88099),l=i.has,p=i.remove;e.exports=function(e){var t=r(this),a=o(e),i=n(t);return c(t)<=a.size?d(t,(function(e){a.includes(e)&&p(i,e)})):s(a.getIterator(),(function(e){l(i,e)&&p(i,e)})),i}},19863:(e,t,a)=>{var r=a(94608),i=a(86874).add,n=a(59470),c=a(26709),o=a(88099);e.exports=function(e){var t=r(this),a=c(e).getIterator(),d=n(t);return o(a,(function(e){i(d,e)})),d}},21263:()=>{},23874:(e,t,a)=>{var r=a(89838),i=a(55701),n=a(89624),c=a(61726),o=a(35021),d=a(22890),s=a(54028),l=a(42391),p=a(46998),f=a(32354),u=a(59862),h=a(25563),m=a(51219),g=h("replace"),A=TypeError,y=n("".indexOf),I=n("".replace),x=n("".slice),N=Math.max;r({target:"String",proto:!0},{replaceAll:function(e,t){var a,r,n,h,v,b,S,B,P,k,R=c(this),w=0,D="";if(d(e)){if((a=s(e))&&(r=l(c(f(e))),!~y(r,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(n=p(e,g))return i(n,e,R,t);if(m&&a)return I(l(R),e,t)}for(h=l(R),v=l(e),(b=o(t))||(t=l(t)),S=v.length,B=N(1,S),P=y(h,v);-1!==P;)k=b?l(t(v,P,h)):u(v,h,P,[],void 0,t),D+=x(h,w,P)+k,w=P+S,P=P+B>h.length?-1:y(h,v,P+B);return w<h.length&&(D+=x(h,w)),D}})},26665:(e,t,a)=>{var r=a(94608),i=a(86874).has,n=a(42298),c=a(26709),o=a(13261),d=a(88099),s=a(37579);e.exports=function(e){var t=r(this),a=c(e);if(n(t)<=a.size)return!1!==o(t,(function(e){if(a.includes(e))return!1}),!0);var l=a.getIterator();return!1!==d(l,(function(e){if(i(t,e))return s(l,"normal",!1)}))}},26709:(e,t,a)=>{var r=a(50850),i=a(66415),n=a(55701),c=a(74371),o=a(29567),d="Invalid size",s=RangeError,l=TypeError,p=Math.max,f=function(e,t){this.set=e,this.size=p(t,0),this.has=r(e.has),this.keys=r(e.keys)};f.prototype={getIterator:function(){return o(i(n(this.keys,this.set)))},includes:function(e){return n(this.has,this.set,e)}},e.exports=function(e){i(e);var t=+e.size;if(t!=t)throw new l(d);var a=c(t);if(a<0)throw new s(d);return new f(e,a)}},27843:(e,t,a)=>{a.d(t,{IC:()=>o,dd:()=>c,gi:()=>i,mO:()=>d,nz:()=>n,t6:()=>s});var r=a(51915);const i={1:65541,2:69638,3:65557,6:65543,7:65542,10:86052,16:69664,17:69633,23:69664,32:69646,34:86037,49:86046,50:86046,56:73728,66:86068,69:69643,20:69643,64:69643,80:86016,85:86017,87:73728,88:73729,97:69635,98:69634,100:69643,105:69633,117:86079,131:86069,255:86018,273:86068,304:86057,309:86106,352:86023,353:86024,354:86053,355:86054,357:86095,358:86096,384:86116,512:69644,533:86022,534:86022,624:86047,654:86111,655:69660,848:86114,1025:86043,1026:86074,1280:86081,1281:86081,5376:86046,5377:86037,5632:86018,5634:86065,8192:86019,8193:86020,8264:86085,8738:86069,27765:65542,28781:86018,16707:86018,16768:86116,22858:81922,29338:86069,33152:86116,41216:86068,41222:86018,41225:86051,61868:86028,65534:86112,21318:69645,22127:86021},n={[(0,r.A)("H261")]:3,[(0,r.A)("H263")]:4,[(0,r.A)("X263")]:4,[(0,r.A)("T263")]:4,[(0,r.A)("L263")]:4,[(0,r.A)("VX1K")]:4,[(0,r.A)("ZyGo")]:4,[(0,r.A)("M263")]:4,[(0,r.A)("lsvm")]:4,[(0,r.A)("I263")]:20,[(0,r.A)("U263")]:4,[(0,r.A)("VSM4")]:4,[(0,r.A)("H264")]:27,[(0,r.A)("h264")]:27,[(0,r.A)("X264")]:27,[(0,r.A)("x264")]:27,[(0,r.A)("avc1")]:27,[(0,r.A)("DAVC")]:27,[(0,r.A)("SMV2")]:27,[(0,r.A)("VSSH")]:27,[(0,r.A)("Q264")]:27,[(0,r.A)("V264")]:27,[(0,r.A)("GAVC")]:27,[(0,r.A)("UMSV")]:27,[(0,r.A)("tshd")]:27,[(0,r.A)("INMC")]:27,[(0,r.A)("FMP4")]:12,[(0,r.A)("DIVX")]:12,[(0,r.A)("DX50")]:12,[(0,r.A)("XVID")]:12,[(0,r.A)("MP4S")]:12,[(0,r.A)("M4S2")]:12,[(0,r.A)("DIVX")]:12,4:12,[(0,r.A)("ZMP4")]:12,[(0,r.A)("DIV1")]:12,[(0,r.A)("BLZ0")]:12,[(0,r.A)("mp4v")]:12,[(0,r.A)("UMP4")]:12,[(0,r.A)("WV1F")]:12,[(0,r.A)("SEDG")]:12,[(0,r.A)("RMP4")]:12,[(0,r.A)("3IV2")]:12,[(0,r.A)("WAWV")]:12,[(0,r.A)("FFDS")]:12,[(0,r.A)("FVFW")]:12,[(0,r.A)("DCOD")]:12,[(0,r.A)("MVXM")]:12,[(0,r.A)("PM4V")]:12,[(0,r.A)("SMP4")]:12,[(0,r.A)("DXGM")]:12,[(0,r.A)("VIDM")]:12,[(0,r.A)("M4T3")]:12,[(0,r.A)("GEOX")]:12,[(0,r.A)("G264")]:12,[(0,r.A)("HDX4")]:12,[(0,r.A)("DM4V")]:12,[(0,r.A)("DMK2")]:12,[(0,r.A)("DYM4")]:12,[(0,r.A)("DIGI")]:12,[(0,r.A)("EPHV")]:12,[(0,r.A)("EM4A")]:12,[(0,r.A)("M4CC")]:12,[(0,r.A)("SN40")]:12,[(0,r.A)("VSPX")]:12,[(0,r.A)("ULDX")]:12,[(0,r.A)("GEOV")]:12,[(0,r.A)("SIPP")]:12,[(0,r.A)("SM4V")]:12,[(0,r.A)("XVIX")]:12,[(0,r.A)("DreX")]:12,[(0,r.A)("QMP4")]:12,[(0,r.A)("PLV1")]:12,[(0,r.A)("GLV4")]:12,[(0,r.A)("GMP4")]:12,[(0,r.A)("MNM4")]:12,[(0,r.A)("GTM4")]:12,[(0,r.A)("MPG4")]:14,[(0,r.A)("MP41")]:14,[(0,r.A)("MP42")]:15,[(0,r.A)("DIV2")]:15,[(0,r.A)("MP43")]:16,[(0,r.A)("DIV3")]:16,[(0,r.A)("MPG3")]:16,[(0,r.A)("DIV5")]:16,[(0,r.A)("DIV6")]:16,[(0,r.A)("DIV4")]:16,[(0,r.A)("DVX3")]:16,[(0,r.A)("AP41")]:16,[(0,r.A)("COL1")]:16,[(0,r.A)("COL0")]:16,[(0,r.A)("WMV1")]:17,[(0,r.A)("WMV2")]:18,[(0,r.A)("GXVE")]:18,[(0,r.A)("dvsd")]:24,[(0,r.A)("dvhd")]:24,[(0,r.A)("dvh1")]:24,[(0,r.A)("dvsl")]:24,[(0,r.A)("dv25")]:24,[(0,r.A)("dv50")]:24,[(0,r.A)("cdvc")]:24,[(0,r.A)("CDVH")]:24,[(0,r.A)("CDV5")]:24,[(0,r.A)("dvc ")]:24,[(0,r.A)("dvcs")]:24,[(0,r.A)("dvh1")]:24,[(0,r.A)("dvis")]:24,[(0,r.A)("pdvc")]:24,[(0,r.A)("SL25")]:24,[(0,r.A)("SLDV")]:24,[(0,r.A)("AVd1")]:24,[(0,r.A)("mpg1")]:2,[(0,r.A)("mpg2")]:2,[(0,r.A)("MPEG")]:2,[(0,r.A)("PIM1")]:2,[(0,r.A)("PIM2")]:2,[(0,r.A)("VCR2")]:2,268435457:2,268435458:2,268435460:2,[(0,r.A)("DVR ")]:2,[(0,r.A)("MMES")]:2,[(0,r.A)("LMP2")]:2,[(0,r.A)("slif")]:2,[(0,r.A)("EM2V")]:2,[(0,r.A)("M701")]:2,[(0,r.A)("M702")]:2,[(0,r.A)("M703")]:2,[(0,r.A)("M704")]:2,[(0,r.A)("M705")]:2,[(0,r.A)("mpgv")]:2,[(0,r.A)("BW10")]:2,[(0,r.A)("XMPG")]:2,[(0,r.A)("MJPG")]:7,[(0,r.A)("RV40")]:69,[(0,r.A)("AV01")]:225,[(0,r.A)("VP80")]:139,[(0,r.A)("VP90")]:167,[(0,r.A)("HEVC")]:173,[(0,r.A)("H265")]:173},c="00001000800000AA00389B71",o="2107D3118644C8C1CA000000",d="0000000000001000800000AA",s={"2C806DE046DBCF11B4D100805F6CBBEA":86019,BFAA23E958CB7144A119FFFA01E4CE62:86055,D242E147BA368D4D88FC61654F8C836C:86104,AF87FBA7022DFB42A4D405CD93843BDD:86056,"2B806DE046DBCF11B4D100805F6CBBEA":86016,"82EC1F6ACADB1945BDE756D3B3EF981D":69673,"3AC1FA38811D4361A40DCE53CA607CD1":86112}},28079:(e,t,a)=>{a(28301)},28301:(e,t,a)=>{a(43116)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a(28050))},29567:e=>{e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},36606:(e,t,a)=>{a(21263),a(16712),a(23874);var r=a(42244);e.exports=r("String","replaceAll")},41199:(e,t,a)=>{a(71768),a(99627),a(28079),a(83746),a(57980),a(51125),a(91148),a(45459),a(61400),a(94906),a(58940);var r=a(72071);e.exports=r.Set},41980:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,zk:()=>i}),a(41450);var r=a(79627);const i={0:"Main",1:"High",2:"Professional"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=4){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new r.A(e.length);t.appendBuffer(e),t.readU1(),t.readU(7);const a=t.readU(3),i=t.readU(5),n=t.readU1();let c=t.readU1()?10:8;return t.readU1()&&(c=12),{profile:a,level:i,tier:n,bitDepth:c,monochrome:t.readU1(),chromaSubsamplingX:t.readU1(),chromaSubsamplingY:t.readU1(),chromaSamplePosition:t.readU(2)}}},42298:e=>{e.exports=function(e){return e.size}},45459:(e,t,a)=>{var r=a(89838),i=a(65399);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("isSupersetOf",(function(e){return!e}))},{isSupersetOf:i})},46128:(e,t,a)=>{a.d(t,{Au:()=>y,He:()=>I,XC:()=>x,Y2:()=>m,hG:()=>g,oz:()=>A});var r=a(46630);const i=[44100,48e3,32e3,0],n=[22050,24e3,16e3,0],c=[11025,12e3,8e3,0],o=[0,1152,1152,384],d=[0,576,1152,384],s=[0,576,1152,384],l=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],p=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],f=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],u=[0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,-1],h=[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1];function m(e,t){switch(e){case 0:return c[t];case 2:return n[t];case 3:return i[t]}return r.N_}function g(e,t){switch(e){case 0:return s[t];case 2:return d[t];case 3:return o[t]}return r.N_}function A(e,t,a){switch(t){case 1:switch(e){case 0:case 2:return h[a];case 3:return f[a]}break;case 2:switch(e){case 0:case 2:return h[a];case 3:return p[a]}case 3:switch(e){case 0:case 2:return u[a];case 3:return l[a]}}return r.N_}function y(e){switch(e){case 1:return 34;case 2:return 33;case 3:return 32}return r.N_}const I={32:"Layer1",33:"Layer2",34:"Layer3"};function x(e,t){if(t&&t.length>=4){const a=t[1]>>>3&3,r=(6&t[1])>>1,i=(12&t[2])>>>2,n=3&~(t[3]>>>6)?2:1,c=y(r),o=m(a,i);e.codecpar.profile=c,e.codecpar.sampleRate=o,e.codecpar.chLayout.nbChannels=n}}},46316:e=>{e.exports=function(){return!1}},50463:(e,t,a)=>{function r(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.uid===t)return e[a]}a.d(t,{A:()=>r})},50549:(e,t,a)=>{a.d(t,{Bq:()=>p,En:()=>d,Ij:()=>l,XC:()=>s,f7:()=>f,hY:()=>o,uF:()=>n});var r=a(46630),i=a(79627);const n={1:"Main",2:"LC",3:"SSR",4:"LTP",5:"HE",6:"SCALABLE",29:"HEv2",23:"LD",39:"ELD"},c={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12},o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,r.N_,r.N_,r.N_],d=[r.N_,1,2,3,4,5,6,7];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t){const{profile:a,sampleRate:i,channels:n}=function(e){let t=r.N_,a=r.N_,i=r.N_;return e.length>=2&&(t=e[0]>>3&31,a=o[(7&e[0])<<1|e[1]>>7],i=d[e[1]>>3&15]),{profile:t,sampleRate:a,channels:i}}(t);e.codecpar.profile=a,e.codecpar.sampleRate=i,e.codecpar.chLayout.nbChannels=n,e.codecpar.frameSize=5===a?2048:1024,e.codecpar.format=8}}function l(e){const t=c[e.sampleRate],a=e.chLayout.nbChannels,i=e.profile===r.N_?2:e.profile,n=new Uint8Array(2);return n[0]=(31&i)<<3|(14&t)>>1,n[1]=(1&t)<<7|(15&a)<<3,n}function p(e){if(e.length<7)return-1;const t=e[0]<<4|e[1]>>4;if(4095!==t)return-1;const a=1&e[1],r=(192&e[2])>>>6,i=(60&e[2])>>>2,n=(1&e[2])<<2|(192&e[3])>>>6,c=(3&e[3])<<11|e[4]<<3|(224&e[5])>>>5,s=3&e[6];let l=1===a?7:9,p=c-l;return{syncWord:t,profile:r+1,sampleRate:o[i],channels:d[n],aacFrameLength:c,numberOfRawDataBlocksInFrame:s,headerLength:l,framePayloadLength:p}}function f(e,t){function a(){const e=t.readU(2);let a=0;for(let r=0;r<=e;r++)a<<=8,a|=t.readU(8);return a}t||(t=new i.A).appendBuffer(e);const r=t.getPointer(),n={syncWord:0,profile:0,sampleRate:0,channels:0,useSameStreamMux:!1,headerLength:0,framePayloadLength:0,muxLengthBytes:0},c=t.readU(11);if(695!==c)return-1;n.syncWord=c,n.muxLengthBytes=t.readU(13);const s=1===t.readU1();if(n.useSameStreamMux=s,!s){const e=1===t.readU1();if(e&&1===t.readU1())return-1;if(e&&a(),1!==t.readU1())return-1;if(0!==t.readU(6))return-1;if(0!==t.readU(4))return-1;if(0!==t.readU(3))return-1;let r=e?a():0;const i=t.readU(5);r-=5;const c=t.readU(4);r-=4;const s=t.readU(4);if(r-=4,t.readU(3),r-=3,r>0&&t.readU(r),0!==t.readU(3))return-1;if(t.readU(8),1===t.readU1())if(e)a();else{let e=0;for(;;){e<<=8;const a=1===t.readU1();if(e+=t.readU(8),!a)break}}1===t.readU1()&&t.readU(8),n.profile=i+1,n.sampleRate=o[c],n.channels=d[s]}let l=0;for(;;){const e=t.readU(8);if(l+=e,255!==e)break}return n.framePayloadLength=l,n.headerLength=t.getPointer()-r+(8===t.getBitLeft()?0:1),n}},51125:(e,t,a)=>{var r=a(89838),i=a(26665);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("isDisjointFrom",(function(e){return!e}))},{isDisjointFrom:i})},51915:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(82915);const i="packages/avformat/src/function/mktagle.ts";function n(e){4!==e.length&&r.R8(`tag length is not 4, tag: ${e}`,i,30);let t=0;for(let a=3;a>=0;a--)t=t<<8|e.charCodeAt(a);return t}},55907:(e,t,a)=>{a(63745);var r=a(74654);e.exports=r},56548:(e,t,a)=>{a.d(t,{_B:()=>n,_r:()=>c,pj:()=>i});var r=a(51915);const i={[(0,r.A)("mp4v")]:12,[(0,r.A)("DIVX")]:12,[(0,r.A)("XVID")]:12,[(0,r.A)("3IV2")]:12,[(0,r.A)("vvc1")]:196,[(0,r.A)("vvi1")]:196,[(0,r.A)("hev1")]:173,[(0,r.A)("hvc1")]:173,[(0,r.A)("dvhe")]:173,[(0,r.A)("hev1")]:173,[(0,r.A)("avc1")]:27,[(0,r.A)("avc2")]:27,[(0,r.A)("avc3")]:27,[(0,r.A)("avc4")]:27,[(0,r.A)("ai5p")]:27,[(0,r.A)("ai5q")]:27,[(0,r.A)("ai52")]:27,[(0,r.A)("ai53")]:27,[(0,r.A)("ai55")]:27,[(0,r.A)("ai56")]:27,[(0,r.A)("ai1p")]:27,[(0,r.A)("ai1q")]:27,[(0,r.A)("ai12")]:27,[(0,r.A)("ai13")]:27,[(0,r.A)("ai15")]:27,[(0,r.A)("ai16")]:27,[(0,r.A)("AVin")]:27,[(0,r.A)("aivx")]:27,[(0,r.A)("rv64")]:27,[(0,r.A)("xalg")]:27,[(0,r.A)("avlg")]:27,[(0,r.A)("dva1")]:27,[(0,r.A)("dvav")]:27,[(0,r.A)("vp08")]:139,[(0,r.A)("vp09")]:167,[(0,r.A)("av01")]:225},n={[(0,r.A)("mp4a")]:86018,[(0,r.A)("ac-3")]:86019,[(0,r.A)("sac3")]:86019,[(0,r.A)("ac-4")]:86119,[(0,r.A)("dtsc")]:86020,[(0,r.A)("dtsh")]:86020,[(0,r.A)("dtsl")]:86020,[(0,r.A)("dtse")]:86020,[(0,r.A)("DTS ")]:86020,[(0,r.A)("ec-3")]:86056,[(0,r.A)(".mp3")]:86017,[(0,r.A)("mp3 ")]:86017,1836253269:86017,[(0,r.A)("spex")]:86051,[(0,r.A)("SPXN")]:86051,[(0,r.A)("fLaC")]:86028,[(0,r.A)("Opus")]:86076,[(0,r.A)("alaw")]:65543,[(0,r.A)("ulaw")]:65542,[(0,r.A)("fl32")]:65557,[(0,r.A)("fl64")]:65559,[(0,r.A)("twos")]:65537,[(0,r.A)("lpcm")]:65536,[(0,r.A)("sowt")]:65536,[(0,r.A)("in24")]:65548,[(0,r.A)("in32")]:65544,[(0,r.A)("sowt")]:65540,[(0,r.A)("raw ")]:65541,[(0,r.A)("NONE")]:65541},c={[(0,r.A)("text")]:94213,[(0,r.A)("tx3g")]:94213,[(0,r.A)("c608")]:94218}},56902:(e,t,a)=>{var r=a(94608),i=a(86874),n=a(42298),c=a(26709),o=a(13261),d=a(88099),s=i.Set,l=i.add,p=i.has;e.exports=function(e){var t=r(this),a=c(e),i=new s;return n(t)>a.size?d(a.getIterator(),(function(e){p(t,e)&&l(i,e)})):o(t,(function(e){a.includes(e)&&l(i,e)})),i}},57980:(e,t,a)=>{var r=a(89838),i=a(81767),n=a(56902);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("intersection",(function(e){return 2===e.size&&e.has(1)&&e.has(2)}))||i((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:n})},59470:(e,t,a)=>{var r=a(86874),i=a(13261),n=r.Set,c=r.add;e.exports=function(e){var t=new n;return i(e,(function(e){c(t,e)})),t}},59862:(e,t,a)=>{var r=a(89624),i=a(76157),n=Math.floor,c=r("".charAt),o=r("".replace),d=r("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,a,r,p,f){var u=a+e.length,h=r.length,m=l;return void 0!==p&&(p=i(p),m=s),o(f,m,(function(i,o){var s;switch(c(o,0)){case"$":return"$";case"&":return e;case"`":return d(t,0,a);case"'":return d(t,u);case"<":s=p[d(o,1,-1)];break;default:var l=+o;if(0===l)return i;if(l>h){var f=n(l/10);return 0===f?i:f<=h?void 0===r[f-1]?c(o,1):r[f-1]+c(o,1):i}s=r[l-1]}return void 0===s?"":s}))}},61400:(e,t,a)=>{var r=a(89838),i=a(91098),n=a(15475);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("symmetricDifference")||!n("symmetricDifference")},{symmetricDifference:i})},63745:(e,t,a)=>{a(23874)},64457:(e,t,a)=>{a.d(t,{Nk:()=>i,eP:()=>r,xz:()=>n});const r={A_AAC:86018,A_AC3:86019,A_ALAC:86032,A_DTS:86020,A_EAC3:86056,A_FLAC:86028,A_MLP:86045,"A_MPEG/L2":86016,"A_MPEG/L1":86058,"A_MPEG/L3":86017,A_OPUS:86076,"A_OPUS/EXPERIMENTAL":86076,"A_PCM/FLOAT/IEEE":65557,"A_PCM/INT/BIG":65537,"A_PCM/INT/LIT":65536,"A_QUICKTIME/QDMC":86066,"A_QUICKTIME/QDM2":86035,"A_REAL/14_4":77824,"A_REAL/28_8":77825,"A_REAL/ATRC":86047,"A_REAL/COOK":86036,"A_REAL/SIPR":86057,A_TRUEHD:86060,A_TTA1:86038,A_VORBIS:86021,A_WAVPACK4:86041,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226,"S_TEXT/UTF8":94225,"S_TEXT/ASCII":94210,"S_TEXT/ASS":94230,"S_TEXT/SSA":94230,"S_TEXT/WEBVTT":94226,S_ASS:94230,S_SSA:94230,S_VOBSUB:94208,S_DVBSUB:94209,"S_HDMV/PGS":94214,"S_HDMV/TEXTST":94231,V_AV1:225,V_DIRAC:116,V_FFV1:33,V_MJPEG:7,V_MPEG1:1,V_MPEG2:2,"V_MPEG4/ISO/ASP":12,"V_MPEG4/ISO/AP":12,"V_MPEG4/ISO/SP":12,"V_MPEG4/ISO/AVC":27,"V_MPEGH/ISO/HEVC":173,"V_MPEGH/ISO/VVC":196,"V_MPEG4/MS/V3":16,V_PRORES:147,"V_REAL/RV10":5,"V_REAL/RV20":6,"V_REAL/RV30":68,"V_REAL/RV40":69,V_SNOW:208,V_THEORA:30,V_UNCOMPRESSED:13,V_VP8:139,V_VP9:167},i={V_VP8:139,V_VP9:167,V_AV1:225,A_VORBIS:86021,A_OPUS:86076,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226},n={"image/gif":97,"image/jpeg":7,"image/png":61,"image/tiff":96}},65399:(e,t,a)=>{var r=a(94608),i=a(86874).has,n=a(42298),c=a(26709),o=a(88099),d=a(37579);e.exports=function(e){var t=r(this),a=c(e);if(n(t)<a.size)return!1;var s=a.getIterator();return!1!==o(s,(function(e){if(!i(t,e))return d(s,"normal",!1)}))}},66192:(e,t,a)=>{a.d(t,{A:()=>i});var r=a(82563);class i{constructor(){(0,r.A)(this,"type",-1),(0,r.A)(this,"onStreamAdd",void 0)}async destroy(e){}}},73211:(e,t,a)=>{a.d(t,{Ij:()=>s,XC:()=>d,kt:()=>o});var r=a(54163),i=a(75138),n=a(4742);const c=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];function o(e){let t=0,a=0,r=0;if(e.length<1)return 0;switch(t=e[0],a=c[t>>3],3&t){case 0:r=1;break;case 1:case 2:r=2;break;case 3:if(e.length<2)return 0;r=63&e[1]}return r*a}function d(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=19){const a=new i.A(t,!1);a.skip(9),e.codecpar.chLayout.nbChannels=a.readUint8(),e.codecpar.initialPadding=a.readUint16(),e.codecpar.sampleRate=a.readUint32(),e.codecpar.seekPreroll=Number((0,r.k)(BigInt(80),{den:1e3,num:1},{den:48e3,num:1}))}}function s(e){const t=new Uint8Array(19),a=new n.A(t,!1);return a.writeString("OpusHead"),a.writeUint8(1),a.writeUint8(e.chLayout.nbChannels),a.writeUint16(e.initialPadding),a.writeUint32(e.sampleRate),t}},74229:(e,t,a)=>{e.exports=a(55907)},74654:(e,t,a)=>{var r=a(15633);e.exports=r},75068:(e,t,a)=>{var r=a(53457),i=a(36606),n=String.prototype;e.exports=function(e){var t=e.replaceAll;return"string"==typeof e||e===n||r(n,e)&&t===n.replaceAll?i:t}},80490:(e,t,a)=>{a.d(t,{DK:()=>o,XC:()=>s,Xr:()=>d,jA:()=>n,ob:()=>i,oe:()=>c});var r=a(75138);const i=34,n=8,c=[0,8,12,0,16,20,24,32],o=[0,88200,176400,192e3,8e3,16e3,22050,24e3,32e3,44100,48e3,96e3,0,0,0,0],d=[0,192,576,1152,2304,4608,0,0,256,512,1024,2048,4096,8192,16384,32768];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length===i){const{bitsPerRawSample:a,sampleRate:i,channels:n}=function(e){const t=new r.A(e);t.skip(10);const a=t.readUint24();return{sampleRate:a>>4,channels:1+((15&a)>>>1),bitsPerRawSample:1+((1&a)<<4|(240&t.readUint8())>>>4)}}(t);e.codecpar.bitsPerRawSample=a,e.codecpar.sampleRate=i,e.codecpar.chLayout.nbChannels=n}}},82088:(e,t,a)=>{a.d(t,{Ui:()=>n,XC:()=>i});var r=a(79627);function i(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=n(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function n(e){const t=new r.A(e.length);return t.appendBuffer(e.subarray(4)),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},82393:(e,t,a)=>{e.exports=a(74229)},83746:(e,t,a)=>{var r=a(89838),i=a(18616),n=a(81767);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("difference",(function(e){return 0===e.size}))||n((function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var a=e++>1;return t.has(1)&&t.clear(),{done:a,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size}))},{difference:i})},84997:(e,t,a)=>{e.exports=a(12832)},86423:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,wN:()=>i});var r=a(79627);const i={0:"Profile0",1:"Profile1",2:"Profile2",3:"Profile3"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new r.A(e.length);return t.appendBuffer(e),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},86874:(e,t,a)=>{var r=a(86927),i=a(47035),n=r("Set"),c=n.prototype;e.exports={Set:n,add:i("add",1),has:i("has",1),remove:i("delete",1),proto:c}},88099:(e,t,a)=>{var r=a(55701);e.exports=function(e,t,a){for(var i,n,c=a?e:e.iterator,o=e.next;!(i=r(o,c)).done;)if(void 0!==(n=t(i.value)))return n}},89684:(e,t,a)=>{function r(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.number===t)return e[a]}a.d(t,{A:()=>r})},91098:(e,t,a)=>{var r=a(94608),i=a(86874),n=a(59470),c=a(26709),o=a(88099),d=i.add,s=i.has,l=i.remove;e.exports=function(e){var t=r(this),a=c(e).getIterator(),i=n(t);return o(a,(function(e){s(t,e)?l(i,e):d(i,e)})),i}},91148:(e,t,a)=>{var r=a(89838),i=a(7702);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("isSubsetOf",(function(e){return e}))},{isSubsetOf:i})},94608:(e,t,a)=>{var r=a(21951),i=TypeError;e.exports=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw new i(r(e)+" is not a set")}},94906:(e,t,a)=>{var r=a(89838),i=a(19863),n=a(15475);r({target:"Set",proto:!0,real:!0,forced:!a(46316)("union")||!n("union")},{union:i})},95338:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ue});var r=a(82563),i=a(23339),n=a.n(i),c=a(1193),o=a.n(c),d=a(18811),s=a.n(d),l=a(22887),p=a.n(l),f=a(92983),u=a.n(f),h=a(76713),m=a.n(h),g=a(50442),A=a.n(g),y=a(82393),I=a.n(y),x=a(84997),N=a.n(x),v=a(9538),b=a.n(v),S=a(41450),B=a.n(S),P=a(26367),k=a(59650),R=a(53508),w=a(3029),D=a(35536),_=a(25149),C=a(66192),V=a(64457),M=a(834),U=a(50463),L=a(89684),E=a(27843),T=a(56548),z=a(58650),O=a(83602),X=a(63624),G=a(54163),F=a(46630),W=a(30185),H=a(60783),$=a(50549),Y=a(41980),j=a(80490),Q=a(24540),K=a(21464),q=a(46128),Z=a(73211),J=a(86423),ee=a(82088),te=a(99723),ae=a(17283),re=a(92814),ie=a(21782),ne=a(34492),ce=a(82915),oe=a(10700),de=a(51670),se=a(79872),le=a(75138);const pe="packages/avformat/src/formats/IMatroskaFormat.ts";function fe(e){e<0&&(e=BigInt(0));const t=Math.round(Number(BigInt.asIntN(32,e%BigInt(1e3)))/10),a=Number(BigInt.asIntN(32,e/BigInt(1e3)%BigInt(60))),r=Number(BigInt.asIntN(32,e/BigInt(1e3)/BigInt(60)%BigInt(60))),i=Number(BigInt.asIntN(32,e/BigInt(1e3)/BigInt(3600)));return re.GP("%s:%02d:%02d.%02d",i,r,a,t)}class ue extends C.A{constructor(){super(),(0,r.A)(this,"type",8),(0,r.A)(this,"context",void 0),(0,r.A)(this,"blockReader",void 0)}init(e){e.ioReader&&e.ioReader.setEndian(!0);const t={isLive:!0,firstCluster:-BigInt(1),segmentStart:-BigInt(1),header:{version:0,readVersion:0,maxIdLength:4,maxSizeLength:8,docType:"",docTypeVersion:0,docTypeReadVersion:0},seekHead:null,info:null,tracks:null,attachments:null,chapters:null,cues:null,tags:null,maxPts:F.Dh,currentCluster:{timeCode:BigInt(0),pos:-BigInt(1),block:{pos:-BigInt(1),size:-BigInt(1)},blockGroup:{block:null}},clusterIndexes:[],clusterIndexesPosMap:new(n())};e.privateData=this.context=t}analyzeStreams(e){let t=F.Dh;const a="webm"===this.context.header.docType?V.Nk:V.eP;var r;if(this.context.tracks&&ie.__(this.context.tracks.entry,(t=>{var r,i,n;const c=e.createStream();switch(c.privData=t,c.codecpar.codecId=a[t.codecId]||0,t.type){case 2:c.codecpar.codecType=1;break;case 1:c.codecpar.codecType=0,c.codecpar.flags|=4;break;case 17:c.codecpar.codecType=3;break;default:c.codecpar.codecType=-1}t.language&&(c.metadata.language=t.language),t.name&&(c.metadata.title=t.name),t.audio?("A_PCM/FLOAT/IEEE"===t.codecName?64===t.audio.bitDepth?c.codecpar.codecId=65559:32===t.audio.bitDepth&&(c.codecpar.codecId=65557):"A_PCM/INT/BIG"===t.codecName?16===t.audio.bitDepth?c.codecpar.codecId=65537:24===t.audio.bitDepth?c.codecpar.codecId=65549:32===t.audio.bitDepth&&(c.codecpar.codecId=65545):"A_PCM/INT/LIT"===t.codecName&&(8===t.audio.bitDepth?c.codecpar.codecId=65541:16===t.audio.bitDepth?c.codecpar.codecId=65536:24===t.audio.bitDepth?c.codecpar.codecId=65548:32===t.audio.bitDepth&&(c.codecpar.codecId=65544)),c.codecpar.chLayout.nbChannels=t.audio.channels,c.codecpar.sampleRate=0|t.audio.sampleRate,c.codecpar.bitsPerCodedSample=t.audio.bitDepth):t.video&&(c.codecpar.width=t.video.pixelWidth,c.codecpar.height=t.video.pixelHeight,t.video.color&&(ae.ai(t.video.color.primaries)&&(c.codecpar.colorPrimaries=t.video.color.primaries),ae.ai(t.video.color.transferCharacteristics)&&(c.codecpar.colorTrc=t.video.color.transferCharacteristics),ae.ai(t.video.color.range)&&(c.codecpar.colorRange=t.video.color.range),ae.ai(t.video.color.matrixCoefficients)&&(c.codecpar.colorSpace=t.video.color.matrixCoefficients)));let d=0;if("V_MS/VFW/FOURCC"===t.codecId&&(null===(r=t.codecPrivate)||void 0===r?void 0:r.size)>=40)c.codecpar.bitsPerCodedSample=t.codecPrivate.data[15]<<8|t.codecPrivate.data[14],c.codecpar.codecTag=t.codecPrivate.data[19]<<24|t.codecPrivate.data[18]<<16|t.codecPrivate.data[17]<<8|t.codecPrivate.data[16],c.codecpar.codecId=E.nz[c.codecpar.codecTag]||0,0===c.codecpar.codecId&&(c.codecpar.codecId,T.pj[c.codecpar.codecTag]),d=40;else if("V_QUICKTIME"===t.codecId&&(null===(i=t.codecPrivate)||void 0===i?void 0:i.size)>=21){const e=1===c.codecpar.codecType?T._B:T.pj;c.codecpar.codecTag=t.codecPrivate.data[3]<<24|t.codecPrivate.data[2]<<16|t.codecPrivate.data[1]<<8|t.codecPrivate.data[0];let a=e[c.codecpar.codecTag];if(a){const e=new Uint8Array(4),a=Number(BigInt.asIntN(32,t.codecPrivate.size));e[0]=a>>>24&255,e[1]=a>>>16&255,e[2]=a>>>8&255,e[3]=255&a,t.codecPrivate.size+=BigInt(4),t.codecPrivate.data=(0,de.A)(Uint8Array,[e,t.codecPrivate.data])}else c.codecpar.codecTag=t.codecPrivate.data[7]<<24|t.codecPrivate.data[6]<<16|t.codecPrivate.data[5]<<8|t.codecPrivate.data[4],a=e[c.codecpar.codecTag];c.codecpar.codecId=a||0}if(null!==(n=t.codecPrivate)&&void 0!==n&&n.data&&t.codecPrivate.size-BigInt(Math.floor(d))>0){let e=t.codecPrivate.data.subarray(d);if(94212===c.codecpar.codecId||94230===c.codecpar.codecId){t.ass={hasLayer:!1};let a,r=oe.decode(e).split(/\r?\n/);for(let e=0;e<r.length;e++){var l;if("[Events]"===o()(l=r[e]).call(l)){r[e+1]&&/^Format:/.test(r[e+1])&&(a=r[e+1]),r=s()(r).call(r,0,e);break}}if(a){var f,h;a=a.replace(/^Format:/,"");const e=p()(f=u()(h=a.split(",")).call(h,(e=>o()(e).call(e)))).call(f,(e=>"Start"!==e&&"End"!==e));t.ass.hasLayer="Layer"===e[0],t.ass.hasLayer?m()(e).call(e,1,0,"Start","End"):(e.unshift("End"),e.unshift("Start")),a=`Format: ${e.join(", ")}`}r.push("[Events]"),r.push(a||"Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"),a||(t.ass.hasLayer=!0),e=oe.encode(r.join("\n"))}if(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,X.sY)(e.length),(0,P.lW)(c.codecpar.extradata,e.length,e),c.codecpar.extradata)switch(c.codecpar.codecId){case 27:{const e=(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize);Q.XC(c,e),H.Bs(e)&&(c.codecpar.flags|=1);break}case 173:{const e=(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize);K.XC(c,e),H.Bs(e)&&(c.codecpar.flags|=1);break}case 196:{const e=(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize);te.XC(c,e),H.Bs(e)&&(c.codecpar.flags|=1);break}case 225:Y.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 139:ee.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 167:J.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86018:$.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86017:q.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86076:Z.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86028:if(c.codecpar.extradataSize>j.ob){const e=new le.A((0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize));if("fLaC"===e.readString(4))for(;e.remainingSize();){const t=e.readUint8(),a=e.readUint24(),r=-129&t;if(0===r){const t=e.readBuffer(a);(0,X.Eb)(c.codecpar.extradata),c.codecpar.extradata=(0,X.sY)(t.length),c.codecpar.extradataSize=t.length,(0,P.lW)(c.codecpar.extradata,t.length,t);break}e.skip(r)}}c.codecpar.extradataSize===j.ob&&j.XC(c,(0,P.s3)(c.codecpar.extradata,c.codecpar.extradataSize))}else{let e;86018===c.codecpar.codecId&&(e=$.Ij(c.codecpar)),e&&(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,X.sY)(c.codecpar.extradataSize),(0,P.lW)(c.codecpar.extradata,c.codecpar.extradataSize,e))}}this.context.info&&(c.timeBase.num=1,this.context.info.timestampScale?c.timeBase.den=1e3*F.SF/this.context.info.timestampScale|0:(c.timeBase.den=1e3,this.context.info.timestampScale=F.SF),this.context.info.duration&&(c.duration=BigInt(Math.floor(this.context.info.duration)))),(null==t.default||t.default)&&(c.disposition|=1),94226===c.codecpar.codecId&&("D_WEBVTT/CAPTIONS"===t.codecId?c.disposition|=65536:("D_WEBVTT/DESCRIPTIONS"===t.codecId||"D_WEBVTT/METADATA"===t.codecId)&&c.disposition),t.encodings&&ie.__(t.encodings.entry,(e=>{e.compression&&(0,se.A)(e.compression.algo)&&(t.needDecompression=!0),e.encryption&&(0,se.A)(e.encryption.algo)&&(t.needDecryption=!0)}))})),this.context.attachments&&ie.__(this.context.attachments.entry,(t=>{const a=e.createStream();if(a.codecpar.codecType=4,a.privData=t,t.name&&(a.metadata.title=t.name),t.mime&&(a.metadata.mime=t.mime),t.description&&(a.metadata.description=t.description),t.data)if(V.xz[t.mime]){a.codecpar.codecId=V.xz[t.mime],a.codecpar.codecType=0,a.disposition|=1024,a.attachedPic=(0,O._5)(),w.M[15](a.attachedPic+32,a.index);const e=(0,X.sY)(Number(BigInt.asUintN(32,t.data.size)));(0,P.lW)(e,Number(BigInt.asUintN(32,t.data.size)),t.data.data),(0,O.NX)(a.attachedPic,e,Number(BigInt.asIntN(32,t.data.size))),w.M[15](a.attachedPic+36,1|R.f[15](a.attachedPic+36))}else a.codecpar.extradataSize=Number(BigInt.asIntN(32,t.data.size)),a.codecpar.extradata=(0,X.sY)(a.codecpar.extradataSize),(0,P.lW)(a.codecpar.extradata,a.codecpar.extradataSize,t.data.data)})),this.context.tags&&ie.__(this.context.tags.entry,(a=>{var r;a.tag&&A()(r=a.tag).call(r,(r=>{const i=r.name;let n=r.string;if(a.target){if("DURATION"===i){var c;let e=I()(c=r.string).call(c,"\0","").split("."),t=e[0].split(":");n=BigInt(+t[0])*BigInt(36e8)+BigInt(+t[1])*BigInt(6e7)+BigInt(+t[2])*BigInt(1e6)+BigInt(+e[1])/BigInt(1e3)}if(a.target.chapterUid)for(let t=0;t<e.chapters.length;t++){const r=e.chapters[t];r.id===a.target.chapterUid&&(r.metadata[i]=n)}else if(a.target.trackUid||a.target.attachUid){const r=(0,U.A)(e.streams,a.target.trackUid||a.target.attachUid);r&&("DURATION"===i?(r.duration=(0,G.k)(n,F.KR,r.timeBase),n>t&&(t=n)):r.metadata[i]=n)}else e.metadata[i]=n}else e.metadata[i]=n}))})),this.context.info&&(this.context.info.muxingApp&&(e.metadata.encoder=this.context.info.muxingApp),this.context.info.title&&(e.metadata.title=this.context.info.title),8===(null===(r=this.context.info.dateUTC)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.byteLength))){const t=new DataView(this.context.info.dateUTC.data.buffer).getBigUint64(0)/BigInt(1e6)+BigInt(9783072e5);e.metadata.creationTime=new Date(Number(t)).toISOString()}if(this.context.chapters&&(ie.__(this.context.chapters.entry,(t=>{const a=t.atom;a&&ie.__(a,(t=>{var a,r,i,n;e.chapters.push({id:t.uid,start:null!==(a=t.start)&&void 0!==a?a:F.Dh,end:null!==(r=t.end)&&void 0!==r?r:F.Dh,timeBase:{num:1,den:1e9},metadata:{title:(null===(i=t.display)||void 0===i?void 0:i.title)||"",language:(null===(n=t.display)||void 0===n?void 0:n.language)||""}})}))})),e.chapters.length)){for(let t=0;t<e.chapters.length-1;t++)e.chapters[t].end===F.Dh&&(e.chapters[t].end=e.chapters[t+1].start);e.chapters[e.chapters.length-1].end===F.Dh&&(e.chapters[e.chapters.length-1].end=(0,G.k)(t,F.KR,e.chapters[e.chapters.length-1].timeBase))}}async readHeader(e){if(440786851!==await(0,M.aL)(e,this.context.header.maxIdLength))return ce.z3("not matroska format",pe,618),z.LR;const t=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);if(this.context.header=ne.extend(this.context.header,await(0,M.Pb)(e,t,M.jt)),408125543!==await(0,M.aL)(e,this.context.header.maxIdLength))return ce.z3("not matroska format",pe,627),z.LR;const a=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);this.context.segmentStart=e.ioReader.getPos();const r=e.ioReader.getPos()+a,i=new(N());let n=!1,c=!1;for(;e.ioReader.getPos()<r||!n||!c;){const t=e.ioReader.getPos(),a=await(0,M.aL)(e,this.context.header.maxIdLength);if(a===z.LR){await this.syncTopLevelElement(e,2);continue}const r=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);if(r!==BigInt(0|z.LR)){if(290298740===a)this.context.isLive=!1,this.context.seekHead=await(0,M.Pb)(e,r,M.Cr);else if(475249515===a)this.context.isLive=!1,this.context.cues=await(0,M.Pb)(e,r,M.eG);else if(272869232===a)this.context.isLive=!1,this.context.chapters=await(0,M.Pb)(e,r,M.Y0);else if(357149030===a)this.context.info=await(0,M.Pb)(e,r,M.qi);else if(307544935===a)this.context.tags=await(0,M.Pb)(e,r,M.hK);else if(423732329===a)this.context.attachments=await(0,M.Pb)(e,r,M.qp);else if(374648427===a)n=!0,this.context.tracks=await(0,M.Pb)(e,r,M.Wy);else if(524531317===a){if(c=!0,this.context.firstCluster=t,this.context.isLive||!this.context.seekHead||!(1&b()(e.ioReader)))break;const a=this.context.seekHead.entry;let r=0;for(;r<a.length;r++)if(!i.has(a[r].id)){await e.ioReader.seek(a[r].pos+this.context.segmentStart);break}if(r===a.length)break}else await e.ioReader.skip(Number(BigInt.asIntN(32,r)));i.add(a)}else await this.syncTopLevelElement(e,2)}return this.context.firstCluster>0&&await e.ioReader.seek(this.context.firstCluster),this.analyzeStreams(e),0}parseAdditions(e,t,a){for(let n=0;n<t.entry.length;n++){var r;const c=t.entry[n];if(null!==(r=c.additional)&&void 0!==r&&r.size)if(4===c.additionalId&&ce.R8("ITU_T_T35 not support now",pe,721),94226===a.codecpar.codecId){const t=oe.decode(c.additional.data).split("\n");if(t.length>=2){if(t[0]){const a=oe.encode(t[0]),r=(0,X.sY)(a.length);(0,P.lW)(r,a.length,a),(0,O.Ow)(e,17,r,a.length)}if(t[1]){const a=oe.encode(t[1]),r=(0,X.sY)(a.length);(0,P.lW)(r,a.length,a),(0,O.Ow)(e,16,r,a.length)}}}else{var i;const t=(0,X.sY)(c.additional.data.length+8);W.Cv(t,BigInt(null!==(i=c.additionalId)&&void 0!==i?i:1)),(0,P.lW)(t+8,c.additional.data.length,c.additional.data),(0,O.Ow)(e,15,t,c.additional.data.length+8),1!==c.additionalId||139!==a.codecpar.codecId&&167!==a.codecpar.codecId&&225!==a.codecpar.codecId||(a.codecpar.flags|=8)}}}processAss(e,t){var a;const r=t.privData,i=oe.decode((0,O.iI)(e)),n=u()(a=i.split(",")).call(a,(e=>o()(e).call(e)));n.shift();const c=fe((0,G.k)(R.f[17](e+8),(0,_.A)(e+72,D.Q),F.i0)),d=fe((0,G.k)(R.f[17](e+8)+R.f[17](e+48),(0,_.A)(e+72,D.Q),F.i0));r.ass.hasLayer?m()(n).call(n,1,0,c,d):(n.unshift(d),n.unshift(c));const s=oe.encode(`Dialogue: ${n.join(",")}`),l=(0,X.sY)(s.length);(0,P.lW)(l,s.length,s),(0,O.NX)(e,l,s.length)}async parseBlock(e,t){var a,r,i;const n=(null===(a=this.context.currentCluster.block)||void 0===a?void 0:a.data)||this.context.currentCluster.blockGroup.block.data;let c=null===(r=this.context.currentCluster.block)||void 0===r?void 0:r.pos;c<0&&(c=this.context.currentCluster.blockGroup.block.pos);let o,d=-1,s=BigInt(0);null!==(i=this.context.currentCluster.blockGroup)&&void 0!==i&&i.block&&(o=this.context.currentCluster.blockGroup.additions,d=this.context.currentCluster.blockGroup.reference?0===this.context.currentCluster.blockGroup.reference.length?1:0:1,this.context.currentCluster.blockGroup.duration&&(s=this.context.currentCluster.blockGroup.duration)),this.blockReader?this.blockReader.resetBuffer(n):this.blockReader=new le.A(n);const l=this.blockReader.getPos(),p=Number(BigInt.asUintN(32,await(0,M.Qb)(this.blockReader,8))),f=(0,L.A)(e.streams,p);if(!f)return ce.z3(`invalid track number ${p}`,pe,825),z.OY;const u=this.blockReader.readInt16(),h=this.blockReader.readUint8();-1===d&&(d=128&h?1:0);let m=0,g=[];switch(h>>>1&3){case 1:{m=this.blockReader.readUint8()+1;let e=0;for(let t=0;t<m-1;t++){let t=0;for(;;){const e=this.blockReader.readUint8();if(0===e)break;if(255!==e){t+=e;break}t+=255}e+=t,g.push(t)}g.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-l))-e);break}case 3:{m=this.blockReader.readUint8()+1,g.push(await(0,M.Ag)(this.blockReader,4));let e=g[0];for(let t=1;t<m-1;t++){let a=await(0,M.pf)(this.blockReader,4)+g[t-1];e+=a,g.push(a)}g.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-l))-e);break}case 2:m=this.blockReader.readUint8()+1;const e=(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-l)))/m;for(let t=0;t<m;t++)g.push(e);break;case 0:m=1,g.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-l)))}const A=f.privData,y=A.timeScale||1;if(A.needDecryption)throw new Error("not support encryption stream");let I=(this.context.currentCluster.timeCode+BigInt(Math.floor(u*y)))*BigInt(0|this.context.info.timestampScale);A.codecDelay&&(I-=A.codecDelay),I/=BigInt(1e3),I=(0,G.k)(I,F.KR,f.timeBase),s=BigInt(Math.floor(Number(BigInt.asIntN(32,s))*y))*BigInt(0|this.context.info.timestampScale),s/=BigInt(1e3),s=(0,G.k)(s,F.KR,f.timeBase);for(let a=0;a<m;a++){const r=0!==a?(0,O._5)():t;let i,n=g[a],l=0;if(A.needDecompression){var x;const e=B()(x=A.encodings.entry).call(x,(e=>!!e.compression));3===e.compression.algo?(i=e.compression.settings.data,n+=i.length,l=i.length):ce.h2(`not support compression stream, algo: ${e.compression.algo}`,pe,935)}w.M[17](r+56,c+this.blockReader.getPos()),w.M[15](r+32,f.index),(0,P.Mr)(r+72,f.timeBase[k.o9],8),w.M[17](r+8,I),w.M[15](r+28,n),w.M[17](r+48,s);const p=(0,X.sY)(n);i&&(0,P.lW)(p,l,i),(0,P.lW)(p+l,g[a],this.blockReader.readBuffer(g[a])),(0,O.NX)(r,p,n),0!==f.codecpar.codecType?(w.M[15](r+36,1|R.f[15](r+36)),w.M[17](r+16,I)):(d&&w.M[15](r+36,1|R.f[15](r+36)),27!==f.codecpar.codecId&&173!==f.codecpar.codecId&&196!==f.codecpar.codecId||(1&b()(f.codecpar)?w.M[15](r+36,64|R.f[15](r+36)):w.M[15](r+36,-65&R.f[15](r+36)))),o&&this.parseAdditions(r,o,f),94212!==f.codecpar.codecId&&94230!==f.codecpar.codecId||this.processAss(r,f),0!==a&&e.interval.packetBuffer.push(r),this.context.maxPts<I&&(this.context.maxPts=I)}return this.context.currentCluster.block={pos:-BigInt(1),size:-BigInt(1)},this.context.currentCluster.blockGroup={block:null},0}addClusterIndex(e){if(this.context.clusterIndexesPosMap.has(e.pos))return;const t=ie.El(this.context.clusterIndexes,(t=>t.time<e.time?1:-1));var a;t>-1?(this.context.clusterIndexesPosMap.set(e.pos,t),m()(a=this.context.clusterIndexes).call(a,t,0,e)):(this.context.clusterIndexesPosMap.set(e.pos,this.context.clusterIndexes.length),this.context.clusterIndexes.push(e))}async readAVPacket_(e,t){const a=e.ioReader.getPos(),r=await(0,M.aL)(e,this.context.header.maxIdLength);if(r===z.LR)return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);const i=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);if(i===BigInt(z.LR))return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);if(524531317===r){this.context.currentCluster.pos=a,this.context.currentCluster.timeCode=BigInt(0),await(0,M.Pb)(e,i,M.GZ,this.context.currentCluster,[163,160]),this.context.isLive||this.addClusterIndex({time:this.context.currentCluster.timeCode,pos:a});let r=await this.parseBlock(e,t);if(r===z.OY)return this.readAVPacket_(e,t);if(r<0)return r}else if(163===r){this.context.currentCluster.block={pos:e.ioReader.getPos(),size:i,data:await e.ioReader.readBuffer(Number(BigInt.asIntN(32,i)))};let a=await this.parseBlock(e,t);if(a===z.OY)return this.readAVPacket_(e,t);if(a<0)return a}else{if(160!==r)return 475249515===r||307544935===r||423732329===r||272869232===r||357149030===r||374648427===r||290298740===r?(await e.ioReader.skip(Number(BigInt.asIntN(32,i))),this.readAVPacket_(e,t)):(await this.syncTopLevelElement(e),this.readAVPacket_(e,t));{await(0,M.Pb)(e,i,M.Wg,this.context.currentCluster.blockGroup);let a=await this.parseBlock(e,t);if(a===z.OY)return this.readAVPacket_(e,t);if(a<0)return a}}return 0}async readAVPacket(e,t){try{return await this.readAVPacket_(e,t)}catch(t){return-1048576!==e.ioReader.error&&-1048572!==e.ioReader.error?(ce.z3(`read packet error, ${t}`,pe,1124),z.LR):e.ioReader.error}}async syncTopLevelElement(e,t=3){let a=F.Dh;for(;;)try{if(8&b()(e.ioReader))break;const r=e.ioReader.getPos(),i=await e.ioReader.peekUint32();if(524531317===i||475249515===i||307544935===i||423732329===i||272869232===i||357149030===i||374648427===i||290298740===i){a=r;let i=0;await e.ioReader.skip(4);const n=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);if(n===BigInt(z.LR)){await e.ioReader.seek(r+BigInt(1));continue}for(await e.ioReader.skip(Number(BigInt.asIntN(32,n)));i<=t;){const t=await(0,M.aL)(e,this.context.header.maxIdLength),a=await(0,M.Qb)(e.ioReader,this.context.header.maxSizeLength);if(524531317!==t&&475249515!==t&&307544935!==t&&423732329!==t&&272869232!==t&&357149030!==t&&374648427!==t&&290298740!==t)break;i++,await e.ioReader.skip(Number(BigInt.asIntN(32,a)))}if(!(i<t))break;await e.ioReader.seek(a+BigInt(1)),a=F.Dh}else await e.ioReader.skip(1),a=F.Dh}catch(e){break}a!==F.Dh&&await e.ioReader.seek(a)}async seek(e,t,a,r){var i;const n=e.ioReader.getPos();if(2&r)return await e.ioReader.seek(a),n;const c=(0,G.k)(a,t.timeBase,F.KR);let o=F.Dh;if(null!==(i=this.context.cues)&&void 0!==i&&i.entry.length){const e=t.privData;for(let t=0;t<this.context.cues.entry.length;t++)if((this.context.cues.entry[t].time||BigInt(0))*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){const a=this.context.cues.entry[Math.max(t-1,0)].pos;if(a.length){const t=B()(a).call(a,(t=>t.track===e.number));if(t){o=t.pos+this.context.segmentStart;break}}}}if(o===F.Dh&&this.context.clusterIndexes.length){for(let e=0;e<this.context.clusterIndexes.length;e++)if(this.context.clusterIndexes[e].time*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){o=this.context.clusterIndexes[Math.max(e-1,0)].pos;break}o===F.Dh&&(o=this.context.clusterIndexes[this.context.clusterIndexes.length-1].pos)}return o!==F.Dh?(await e.ioReader.seek(o),n):BigInt(z.E$)}getAnalyzeStreamsCount(){return 0}}},null:()=>{__webpack_require__(16434)}};
@@ -0,0 +1 @@
1
+ export const __webpack_esm_id__=967;export const __webpack_esm_ids__=[967];export const __webpack_esm_modules__={915:(t,i,e)=>{e.d(i,{FJ:()=>s,U5:()=>r});const s={10:86018,2:86017,11:86051,1:69645,4:86049,5:86049,6:86049,7:65543,8:65542},r={7:27,12:173,9:12,2:4,3:86,4:92,5:106,6:131}},1639:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(82563),r=e(10700);class n{constructor(t=1048576,i=!0,e){if((0,s.A)(this,"data",void 0),(0,s.A)(this,"buffer",void 0),(0,s.A)(this,"pointer",void 0),(0,s.A)(this,"pos",void 0),(0,s.A)(this,"size",void 0),(0,s.A)(this,"littleEndian",void 0),(0,s.A)(this,"error",void 0),(0,s.A)(this,"onFlush",void 0),(0,s.A)(this,"onSeek",void 0),this.pointer=0,this.pos=BigInt(0),this.size=t,this.littleEndian=!i,this.error=0,e&&e.view)this.size=e.length,this.buffer=e,this.data=e.view;else if(e&&!e.byteOffset)this.size=e.length,this.buffer=e,this.data=new DataView(this.buffer.buffer);else{if(e)throw new Error("not support subarray of ArrayBuffer");this.buffer=new Uint8Array(this.size),this.data=new DataView(this.buffer.buffer)}}writeUint8(t){this.remainingLength()<1&&this.flush(),this.data.setUint8(this.pointer,t),this.pointer++,this.pos++}writeUint16(t){this.remainingLength()<2&&this.flush(),this.data.setUint16(this.pointer,t,this.littleEndian),this.pointer+=2,this.pos+=BigInt(2)}writeUint24(t){this.remainingLength()<3&&this.flush();const i=(16711680&t)>>16,e=(65280&t)>>8,s=255&t;this.littleEndian?(this.writeUint8(s),this.writeUint8(e),this.writeUint8(i)):(this.writeUint8(i),this.writeUint8(e),this.writeUint8(s))}writeUint32(t){this.remainingLength()<4&&this.flush(),this.data.setUint32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}writeUint64(t){this.remainingLength()<8&&this.flush(),this.data.setBigUint64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}writeInt8(t){this.remainingLength()<1&&this.flush(),this.data.setInt8(this.pointer,t),this.pointer++,this.pos++}writeInt16(t){this.remainingLength()<2&&this.flush(),this.data.setInt16(this.pointer,t,this.littleEndian),this.pointer+=2,this.pos+=BigInt(2)}writeInt24(t){this.writeUint24(t<0?t+16777216:t)}writeInt32(t){this.remainingLength()<4&&this.flush(),this.data.setInt32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}writeInt64(t){this.remainingLength()<8&&this.flush(),this.data.setBigInt64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}writeFloat(t){this.remainingLength()<4&&this.flush(),this.data.setFloat32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}writeDouble(t){this.remainingLength()<8&&this.flush(),this.data.setFloat64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}getPointer(){return this.pointer}getPos(){return this.pos}remainingLength(){return this.size-this.pointer}writeBuffer(t){if(!t.length)return;let i=t.length;if(this.remainingLength()<i){let e=0;for(;i>0;){this.flush();const s=Math.min(this.size,i);this.buffer.set(t.subarray(e,e+s),this.pointer),this.pointer+=s,this.pos+=BigInt(s),e+=s,i-=s}}else this.buffer.set(t,this.pointer),this.pointer+=i,this.pos+=BigInt(i)}writeString(t){const i=r.encode(t);return this.writeBuffer(i),i.length}flush(){if(!this.onFlush)throw this.error=-1048574,Error("IOWriter error, flush failed because of no flush callback");if(this.pointer){const t=this.onFlush(this.buffer.subarray(0,this.pointer));if(0!==t)throw this.error=t,Error("IOWriter error, flush failed")}this.pointer=0}flushToPos(t){if(!this.onFlush)throw this.error=-1048574,Error("IOWriter error, flush failed because of no flush callback");if(this.pointer){const i=this.onFlush(this.buffer.subarray(0,this.pointer),t);if(0!==i)throw this.error=i,Error("IOWriter error, flush failed")}this.pointer=0}seek(t){if(!this.onSeek)throw this.error=-1048574,Error("IOWriter error, seek failed because of no seek callback");this.flush();const i=this.onSeek(t);if(0!==i)throw this.error=i,Error("IOWriter error, seek failed");this.pos=t}seekInline(t){const i=this.pointer;this.pointer=Math.max(0,Math.min(this.size,t)),this.pos+=BigInt(this.pointer-i)}skip(t){const i=this.pointer;this.pointer=Math.min(this.size,this.pointer+t),this.pos+=BigInt(this.pointer-i)}back(t){const i=this.pointer;this.pointer=Math.max(0,this.pointer-t),this.pos+=BigInt(this.pointer-i)}getBuffer(){return this.buffer.subarray(0,this.pointer)}setEndian(t){this.littleEndian=!t}reset(){this.pointer=0,this.pos=BigInt(0),this.error=0}getBufferSize(){return this.size}}},3944:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(82563),r=e(10700);class n{constructor(t=1048576,i=!0,e){if((0,s.A)(this,"data",void 0),(0,s.A)(this,"buffer",void 0),(0,s.A)(this,"pointer",void 0),(0,s.A)(this,"pos",void 0),(0,s.A)(this,"size",void 0),(0,s.A)(this,"littleEndian",void 0),(0,s.A)(this,"error",void 0),(0,s.A)(this,"onFlush",void 0),(0,s.A)(this,"onSeek",void 0),this.pointer=0,this.pos=BigInt(0),this.size=t,this.littleEndian=!i,this.error=0,e&&e.view)this.size=e.length,this.buffer=e,this.data=e.view;else if(e&&!e.byteOffset)this.size=e.length,this.buffer=e,this.data=new DataView(this.buffer.buffer);else{if(e)throw new Error("not support subarray of ArrayBuffer");this.buffer=new Uint8Array(this.size),this.data=new DataView(this.buffer.buffer)}}async writeUint8(t){this.remainingLength()<1&&await this.flush(),this.data.setUint8(this.pointer,t),this.pointer++,this.pos++}async writeUint16(t){this.remainingLength()<2&&await this.flush(),this.data.setUint16(this.pointer,t,this.littleEndian),this.pointer+=2,this.pos+=BigInt(2)}async writeUint24(t){this.remainingLength()<3&&await this.flush();const i=(16711680&t)>>16,e=(65280&t)>>8,s=255&t;this.littleEndian?(await this.writeUint8(s),await this.writeUint8(e),await this.writeUint8(i)):(await this.writeUint8(i),await this.writeUint8(e),await this.writeUint8(s))}async writeUint32(t){this.remainingLength()<4&&await this.flush(),this.data.setUint32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}async writeUint64(t){this.remainingLength()<8&&await this.flush(),this.data.setBigUint64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}async writeInt8(t){this.remainingLength()<1&&await this.flush(),this.data.setInt8(this.pointer,t),this.pointer++,this.pos++}async writeInt16(t){this.remainingLength()<2&&await this.flush(),this.data.setInt16(this.pointer,t,this.littleEndian),this.pointer+=2,this.pos+=BigInt(2)}async writeInt24(t){await this.writeUint24(t<0?t+16777216:t)}async writeInt32(t){this.remainingLength()<4&&await this.flush(),this.data.setInt32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}async writeInt64(t){this.remainingLength()<8&&await this.flush(),this.data.setBigInt64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}async writeFloat(t){this.remainingLength()<4&&await this.flush(),this.data.setFloat32(this.pointer,t,this.littleEndian),this.pointer+=4,this.pos+=BigInt(4)}async writeDouble(t){this.remainingLength()<8&&await this.flush(),this.data.setFloat64(this.pointer,t,this.littleEndian),this.pointer+=8,this.pos+=BigInt(8)}getPointer(){return this.pointer}getPos(){return this.pos}remainingLength(){return this.size-this.pointer}async writeBuffer(t){if(!t.length)return;let i=t.length;if(this.remainingLength()<i){let e=0;for(;i>0;){await this.flush();const s=Math.min(this.size,i);this.buffer.set(t.subarray(e,e+s),this.pointer),this.pointer+=s,this.pos+=BigInt(s),e+=s,i-=s}}else this.buffer.set(t,this.pointer),this.pointer+=i,this.pos+=BigInt(i)}async writeString(t){const i=r.encode(t);return await this.writeBuffer(i),i.length}async flush(){if(!this.onFlush)throw this.error=-1048574,Error("IOWriter error, flush failed because of no flush callback");if(this.pointer){const t=await this.onFlush(this.buffer.subarray(0,this.pointer));if(0!==t)throw this.error=t,Error("IOWriter error, flush failed")}this.pointer=0}async flushToPos(t){if(!this.onFlush)throw this.error=-1048574,Error("IOWriter error, flush failed because of no flush callback");if(this.pointer){const i=await this.onFlush(this.buffer.subarray(0,this.pointer),t);if(0!==i)throw this.error=i,Error("IOWriter error, flush failed")}this.pointer=0}async seek(t){if(!this.onSeek)throw this.error=-1048574,Error("IOWriter error, seek failed because of no seek callback");await this.flush();const i=await this.onSeek(t);if(0!==i)throw this.error=i,Error("IOWriter error, seek failed");this.pos=t}seekInline(t){const i=this.pointer;this.pointer=Math.max(0,Math.min(this.size,t)),this.pos+=BigInt(this.pointer-i)}skip(t){const i=this.pointer;this.pointer=Math.min(this.size,this.pointer+t),this.pos+=BigInt(this.pointer-i)}back(t){const i=this.pointer;this.pointer=Math.max(0,this.pointer-t),this.pos+=BigInt(this.pointer-i)}getBuffer(){return this.buffer.subarray(0,this.pointer)}setEndian(t){this.littleEndian=!t}reset(){this.pointer=0,this.pos=BigInt(0),this.error=0}getBufferSize(){return this.size}}},4974:(t,i,e)=>{e.d(i,{Tl:()=>o,an:()=>a,s2:()=>h});var s=e(82563),r=e(63856),n=e.n(r);class a{constructor(){(0,s.A)(this,"list",[])}}async function h(t){return new(n())((i=>{t.list.push(i),1===t.list.length&&i()}))}function o(t){t.list.shift(),t.list.length&&t.list[0]()}},5463:(t,i,e)=>{t.exports=e(28789)},8836:(t,i,e)=>{var s=e(89624),r=e(81767),n=e(41725).start,a=RangeError,h=isFinite,o=Math.abs,f=Date.prototype,u=f.toISOString,l=s(f.getTime),d=s(f.getUTCDate),p=s(f.getUTCFullYear),c=s(f.getUTCHours),g=s(f.getUTCMilliseconds),w=s(f.getUTCMinutes),b=s(f.getUTCMonth),y=s(f.getUTCSeconds);t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!r((function(){u.call(new Date(NaN))}))?function(){if(!h(l(this)))throw new a("Invalid time value");var t=this,i=p(t),e=g(t),s=i<0?"-":i>9999?"+":"";return s+n(o(i),s?6:4,0)+"-"+n(b(t)+1,2,0)+"-"+n(d(t),2,0)+"T"+n(c(t),2,0)+":"+n(w(t),2,0)+":"+n(y(t),2,0)+"."+n(e,3,0)+"Z"}:u},9538:(t,i,e)=>{t.exports=e(55564)},14908:(t,i,e)=>{e.r(i),e.d(i,{default:()=>k});var s=e(82563),r=e(50442),n=e.n(r),a=e(18811),h=e.n(a),o=e(44046),f=e(79872),u=e(32536),l=e(3944),d=e(1639),p=e(75138),c=e(54805),g=e(22227),w=e(55978),b=e(39710),y=e(38902),m=e(60346),v=e(79300);class k extends y.A{constructor(...t){super(...t),(0,s.A)(this,"info",void 0),(0,s.A)(this,"socket",void 0),(0,s.A)(this,"session",void 0),(0,s.A)(this,"ioReader",void 0),(0,s.A)(this,"ioWriter",void 0),(0,s.A)(this,"flvWriter",void 0),(0,s.A)(this,"flvHeader",void 0),(0,s.A)(this,"packetQueue",void 0),(0,s.A)(this,"flvHeaderWrote",void 0),(0,s.A)(this,"hasMetadata",void 0),(0,s.A)(this,"bufferReader",void 0)}writeFlvData(t){this.flvWriter.writeUint8(t.type),this.flvWriter.writeUint24(t.payload.length),this.flvWriter.writeUint24(t.timestamp),this.flvWriter.writeUint8(t.timestamp>>24),this.flvWriter.writeUint24(0),this.flvWriter.writeBuffer(t.payload),this.flvWriter.writeUint32(t.payload.length+11),this.flvWriter.flush()}async handleRtmpPacket(t){if(this.flvHeaderWrote)this.writeFlvData(t);else{if(this.packetQueue.push(t),8===t.type)this.flvHeader.hasAudio=!0;else if(9===t.type)this.flvHeader.hasVideo=!0;else if(18===t.type&&(this.bufferReader?this.bufferReader.resetBuffer(t.payload):this.bufferReader=new p.A(t.payload),"onMetaData"===await c.$x(this.bufferReader,BigInt(t.payload.length)))){this.hasMetadata=!0;const i=await c.$x(this.bufferReader,BigInt(t.payload.length));this.flvHeader.hasAudio=(0,f.A)(i.audiocodecid),this.flvHeader.hasVideo=(0,f.A)(i.videocodecid)}if(this.packetQueue.length>10||this.hasMetadata){var i;if(this.flvHeader.write(this.flvWriter),this.flvWriter.writeUint32(0),!this.hasMetadata&&this.session.getDuration()){const t=new b.A;t.onMetaData={duration:this.session.getDuration()},t.write(this.flvWriter)}n()(i=this.packetQueue).call(i,(t=>{this.writeFlvData(t)})),this.packetQueue.length=0,this.flvHeaderWrote=!0}}}async send(t){return this.socket?(await this.socket.send(t),0):-1048574}async open(t){this.info=t,this.status=1,3===t.subProtocol?(this.socket=new v.A(this.options),await this.socket.open({url:t.url,webtransportOptions:t.webtransportOptions})):(this.socket=new m.A(this.options),await this.socket.open({url:t.url})),this.ioReader=new u.A,this.ioReader.onFlush=async t=>this.socket.read(t),this.ioReader.onSeek=async t=>this.socket.seek(t),this.ioReader.onSize=async()=>this.socket.size(),this.ioWriter=new l.A,this.ioWriter.onFlush=async t=>this.socket.write(t),this.ioWriter.onSeek=async t=>this.socket.seek(t),this.flvWriter=new d.A,this.flvWriter.onFlush=t=>(this.readQueue.push(h()(t).call(t)),this.consume&&this.consume(),0),this.flvHeader=new w.A,this.packetQueue=[],this.flvHeaderWrote=!1,this.hasMetadata=!1,this.session=new g.A(this.ioReader,this.ioWriter,{isLive:this.options.isLive,isPull:!0}),this.session.onMediaPacket=async(t,i)=>this.handleRtmpPacket(t),this.session.onError=()=>{this.status=3,this.consume&&this.consume()},await this.session.handshake();const i=o.qg(this.info.uri),e=i.pathname.split("/");await this.session.connect(e[1],`rtmp://${i.host}${i.port?":"+i.port:""}/${e[1]}`);const s=h()(e).call(e,2);return this.session.play((s.length>1?s.join("/"):s[0])||""),0}async seek(t){return await this.session.seek(Number(t)),0}async size(){return BigInt(0)}async stop(){this.socket&&(await this.socket.stop(),this.socket=null),this.status=4}}},21061:(t,i,e)=>{var s=e(74371),r=e(42391),n=e(61726),a=RangeError;t.exports=function(t){var i=r(n(this)),e="",h=s(t);if(h<0||h===1/0)throw new a("Wrong number of repetitions");for(;h>0;(h>>>=1)&&(i+=i))1&h&&(e+=i);return e}},21727:()=>{},22227:(t,i,e)=>{e.d(i,{A:()=>A});var s=e(82563),r=e(23339),n=e.n(r),a=e(63856),h=e.n(a),o=e(50442),f=e.n(o),u=e(96279),l=e(60255),d=e(46984),p=e(54805),c=e(17283),g=e(21782),w=e(82915),b=e(79579),y=e(13135),m=e(75138),v=e(4742),k=e(80030),U=e(4974);const I="packages/avprotocol/src/rtmp/RtmpSession.ts";class A{constructor(t,i,e){(0,s.A)(this,"ioReader",void 0),(0,s.A)(this,"ioWriter",void 0),(0,s.A)(this,"prevReadPacket",void 0),(0,s.A)(this,"prevWritePacket",void 0),(0,s.A)(this,"inChunkSize",void 0),(0,s.A)(this,"outChunkSize",void 0),(0,s.A)(this,"seq",void 0),(0,s.A)(this,"bufferWriter",void 0),(0,s.A)(this,"bufferReader",void 0),(0,s.A)(this,"requestMap",void 0),(0,s.A)(this,"state",void 0),(0,s.A)(this,"maxSentUnacked",void 0),(0,s.A)(this,"receiveReportSize",void 0),(0,s.A)(this,"duration",void 0),(0,s.A)(this,"options",void 0),(0,s.A)(this,"streamIdMap",void 0),(0,s.A)(this,"sendAsync",void 0),(0,s.A)(this,"onMediaPacket",void 0),(0,s.A)(this,"onError",void 0),this.ioReader=t,this.ioWriter=i,this.options=e,this.prevReadPacket=new(n()),this.prevWritePacket=new(n()),this.requestMap=new(n()),this.streamIdMap=new(n()),this.inChunkSize=128,this.outChunkSize=128,this.seq=0,this.maxSentUnacked=25e5,this.receiveReportSize=1048576,this.sendAsync=new U.an,this.bufferWriter=new v.A(new Uint8Array(1)),this.bufferReader=new m.A(new Uint8Array(1)),this.state=0}async handshake(){const t=(0,b.A)();await this.ioWriter.writeUint8(3),await this.ioWriter.writeUint32(0),await this.ioWriter.writeUint32(0);const i=new Uint8Array(1528);(0,k.A)(i),await this.ioWriter.writeBuffer(i),await this.ioWriter.flush(),await this.ioReader.readUint8();const e=await this.ioReader.readUint32();await this.ioReader.skip(4);const s=await this.ioReader.readBuffer(1528);await this.ioWriter.writeUint32(e),await this.ioWriter.writeUint32((0,b.A)()-t),await this.ioWriter.writeBuffer(s),await this.ioWriter.flush(),await this.ioReader.skip(1536),this.readRtmpPacket()}async sendPacket(t){await U.s2(this.sendAsync),await(0,d.U)(this.ioWriter,this.outChunkSize,t,this.prevWritePacket.get(t.channelId)),this.prevWritePacket.set(t.channelId,t),U.Tl(this.sendAsync)}async readPacket(){const t=await(0,d.w)(this.ioReader,this.inChunkSize,this.prevReadPacket);return this.prevReadPacket.set(t.channelId,t),t}handleChunkSize(t){t.payload.length>=4&&(this.bufferReader.resetBuffer(t.payload),this.inChunkSize=this.bufferReader.readUint32())}handleUserControl(t){t.payload.length>=2&&(this.bufferReader.resetBuffer(t.payload),6===this.bufferReader.readUint16()&&this.sendPong(t,this.bufferReader.readUint32()))}handleSetPeerBW(t){t.payload.length>=4&&(this.bufferReader.resetBuffer(t.payload),this.maxSentUnacked=this.bufferReader.readUint32(),w.Yz(`Max sent, unacked = ${this.maxSentUnacked}`,I,215))}handleWindowSizeACK(t){t.payload.length>=4&&(this.bufferReader.resetBuffer(t.payload),this.receiveReportSize=this.bufferReader.readUint32(),w.Yz(`Window acknowledgement size = ${this.receiveReportSize}`,I,222),this.receiveReportSize>>=1)}async handleInvoke(t){this.bufferReader.resetBuffer(t.payload);const i=BigInt(t.payload.length),e=await p.$x(this.bufferReader,i),s=await p.$x(this.bufferReader,i);if("_result"===e||"_error"===e){if(this.requestMap.has(s)){const t=await p.$x(this.bufferReader,i),r=await p.$x(this.bufferReader,i);"_result"===e?this.requestMap.get(s).resolve({options:t,info:r}):this.requestMap.get(s).reject({options:t,info:r}),this.requestMap.delete(s)}}else if("onStatus"===e){const t=await p.$x(this.bufferReader,i);let e=await p.$x(this.bufferReader,i);if("error"===e.level)w.z3(`Server error: ${e.description}, ${e.code}`,I,258),this.requestMap.has(s)?(this.requestMap.get(s).reject({options:t,info:e}),this.requestMap.delete(s)):this.onError&&this.onError();else{switch(e.code){case"NetStream.Play.Start":case"NetStream.Seek.Notify":this.state=3;break;case"NetStream.Play.Stop":case"NetStream.Play.UnpublishNotify":this.state=8;break;case"NetStream.Publish.Start":this.state=5}this.requestMap.has(s)&&(this.requestMap.get(s).resolve({options:t,info:e}),this.requestMap.delete(s))}}else"onBWDone"===e&&await this.sendCheckBW()}async handleNotify(t){this.bufferReader.resetBuffer(t.payload),"@setDataFrame"===await p.$x(this.bufferReader,BigInt(t.payload.length))&&(t.payload=t.payload.subarray(Number(this.bufferReader.getPos()))),t.payload.length&&this.onMediaPacket&&await this.onMediaPacket(t,this.streamIdMap.get(t.extra))}async readRtmpPacket(){for(;;)try{const t=await this.readPacket();switch(t.type){case 3:default:break;case 1:this.handleChunkSize(t);break;case 4:this.handleUserControl(t);break;case 6:this.handleSetPeerBW(t);break;case 5:this.handleWindowSizeACK(t);break;case 20:await this.handleInvoke(t);break;case 18:await this.handleNotify(t);break;case 22:case 8:case 9:this.onMediaPacket&&await this.onMediaPacket(t,this.streamIdMap.get(t.extra))}}catch(t){break}}async sendPong(t,i){if(t.payload.length<6)return void w.R8(`Too short ping packet (${t.payload.length})`,I,358);const e=new u.u(2,4,t.timestamp+1,6);this.bufferWriter.resetBuffer(e.payload),this.bufferWriter.writeUint16(7),this.bufferWriter.writeUint32(i),this.sendPacket(e)}async sendWindowAckSize(){const t=new u.u(2,5,0,4);this.bufferWriter.resetBuffer(t.payload),this.bufferWriter.writeUint32(this.maxSentUnacked),await this.sendPacket(t)}async sendBufferTime(t){const i=new u.u(2,4,1,10);this.bufferWriter.resetBuffer(i.payload),this.bufferWriter.writeUint16(3),this.bufferWriter.writeUint32(t),this.bufferWriter.writeUint32(this.options.clientBufferTime||3e3),await this.sendPacket(i)}async sendFCSubscribe(t){const i=new u.u(3,20,0,27+t.length);this.bufferWriter.resetBuffer(i.payload),p.bD(this.bufferWriter,"FCSubscribe"),p.bD(this.bufferWriter,++this.seq),p.bD(this.bufferWriter,null),p.bD(this.bufferWriter,t),await this.sendPacket(i)}async sendFCPublish(t){const i=new u.u(3,20,0,25+t.length);this.bufferWriter.resetBuffer(i.payload),p.bD(this.bufferWriter,"FCPublish"),p.bD(this.bufferWriter,++this.seq),p.bD(this.bufferWriter,null),p.bD(this.bufferWriter,t),await this.sendPacket(i)}async sendReleaseStream(t){const i=new u.u(3,20,0,29+t.length);this.bufferWriter.resetBuffer(i.payload),p.bD(this.bufferWriter,"releaseStream"),p.bD(this.bufferWriter,++this.seq),p.bD(this.bufferWriter,null),p.bD(this.bufferWriter,t),await this.sendPacket(i)}async sendCheckBW(){const t=new u.u(3,20,0,21);this.bufferWriter.resetBuffer(t.payload),p.bD(this.bufferWriter,"_checkbw"),p.bD(this.bufferWriter,++this.seq),p.bD(this.bufferWriter,null),await this.sendPacket(t)}async request(t,i){const e=new u.u(3,20,0,4096+l.iD);return this.bufferWriter.resetBuffer(e.payload),p.bD(this.bufferWriter,t),p.bD(this.bufferWriter,++this.seq),g.__(i,(t=>{p.bD(this.bufferWriter,t)})),e.payload=e.payload.subarray(0,this.bufferWriter.getPos()),new(h())(((t,i)=>{this.requestMap.set(this.seq,{resolve:t,reject:i}),this.sendPacket(e)}))}async connect(t,i){await this.request("connect",[{app:t,fourCcList:["hvc1","av01","vp09"],flashVer:"LNX 9,0,124,2",tcUrl:i,fpad:0,capabilities:15,audioCodecs:4071,videoCodecs:252,videoFunction:1}]),this.options.isPull&&await this.sendWindowAckSize()}async createStream(){return(await this.request("createStream",[null])).info}async play(t){const i=await this.createStream();if(this.streamIdMap.set(i,t),!this.options.isLive){const i=await h().race([this.request("getStreamLength",[null,t]),new y.A(1)]);c.ai(i)||(this.duration=i.info)}await this.sendFCSubscribe(t),this.request("play",[null,t,-1,-1,!0]),await this.sendBufferTime(i)}async publish(t){await this.sendReleaseStream(t),await this.sendFCPublish(t);const i=await this.createStream();this.streamIdMap.set(i,t),await this.request("publish",[null,t,"live"])}async sendStreamPacket(t,i){var e;let s=0;f()(e=this.streamIdMap).call(e,((t,e)=>{t===i&&(s=e)})),t.extra=s,await this.sendPacket(t)}async seek(t){const i=new u.u(3,20,0,26);this.bufferWriter.resetBuffer(i.payload),p.bD(this.bufferWriter,"seek"),p.bD(this.bufferWriter,0),p.bD(this.bufferWriter,null),p.bD(this.bufferWriter,t),await this.sendPacket(i)}async pause(t,i){const e=new u.u(3,20,0,29);this.bufferWriter.resetBuffer(e.payload),p.bD(this.bufferWriter,"pause"),p.bD(this.bufferWriter,0),p.bD(this.bufferWriter,null),p.bD(this.bufferWriter,t),p.bD(this.bufferWriter,i),await this.sendPacket(e)}getDuration(){return this.duration}}},26942:(t,i,e)=>{e(29643),e(41630);var s=e(72071),r=e(83105);s.JSON||(s.JSON={stringify:JSON.stringify}),t.exports=function(t,i,e){return r(s.JSON.stringify,null,arguments)}},28035:(t,i,e)=>{e(21727);var s=e(32354);t.exports=s},28789:(t,i,e)=>{var s=e(90216);t.exports=s},29074:(t,i,e)=>{var s=e(89838),r=e(89624),n=e(58352),a=r([].reverse),h=[1,2];s({target:"Array",proto:!0,forced:String(h)===String(h.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),a(this)}})},29643:(t,i,e)=>{var s=e(89838),r=e(55701),n=e(76157),a=e(62113),h=e(8836),o=e(76280);s({target:"Date",proto:!0,forced:e(81767)((function(){return null!==new Date(NaN).toJSON()||1!==r(Date.prototype.toJSON,{toISOString:function(){return 1}})}))},{toJSON:function(t){var i=n(this),e=a(i,"number");return"number"!=typeof e||isFinite(e)?"toISOString"in i||"Date"!==o(i)?i.toISOString():r(h,i):null}})},32354:(t,i,e)=>{var s=e(55701),r=e(95497),n=e(53457),a=e(95397),h=e(79827),o=RegExp.prototype;t.exports=a.correct?function(t){return t.flags}:function(t){return a.correct||!n(o,t)||r(t,"flags")?t.flags:s(h,t)}},32536:(t,i,e)=>{e.d(i,{A:()=>u});var s=e(82563),r=e(63856),n=e.n(r),a=e(82915),h=e(10700),o=e(13135);const f="packages/common/src/io/IOReader.ts";class u{constructor(t=1048576,i=!0,e){if((0,s.A)(this,"data",void 0),(0,s.A)(this,"buffer",void 0),(0,s.A)(this,"pointer",void 0),(0,s.A)(this,"endPointer",void 0),(0,s.A)(this,"pos",void 0),(0,s.A)(this,"size",void 0),(0,s.A)(this,"littleEndian",void 0),(0,s.A)(this,"fileSize_",void 0),(0,s.A)(this,"error",void 0),(0,s.A)(this,"onFlush",void 0),(0,s.A)(this,"onSeek",void 0),(0,s.A)(this,"onSize",void 0),(0,s.A)(this,"flags",void 0),(0,s.A)(this,"flushResolve",void 0),this.pos=BigInt(0),this.pointer=0,this.error=0,this.endPointer=0,this.littleEndian=!i,this.flags=0,e&&e.view)this.size=e.length,this.buffer=e,this.data=e.view;else if(e&&!e.byteOffset)this.size=e.length,this.buffer=e,this.data=new DataView(this.buffer.buffer);else{if(e)throw new Error("not support subarray of ArrayBuffer");this.size=Math.max(t,102400),this.buffer=new Uint8Array(this.size),this.data=new DataView(this.buffer.buffer)}}async readUint8(){this.remainingLength()<1&&await this.flush(1);const t=this.data.getUint8(this.pointer);return this.pointer++,this.pos++,t}async peekUint8(){return this.remainingLength()<1&&await this.flush(1),this.data.getUint8(this.pointer)}async readUint16(){this.remainingLength()<2&&await this.flush(2);const t=this.data.getUint16(this.pointer,this.littleEndian);return this.pointer+=2,this.pos+=BigInt(2),t}async peekUint16(){return this.remainingLength()<2&&await this.flush(2),this.data.getUint16(this.pointer,this.littleEndian)}async readUint24(){this.remainingLength()<3&&await this.flush(3);const t=await this.readUint16(),i=await this.readUint8();return this.littleEndian?i<<16|t:t<<8|i}async peekUint24(){this.remainingLength()<3&&await this.flush(3);const t=this.pointer,i=this.pos,e=await this.readUint16(),s=await this.readUint8(),r=this.littleEndian?s<<16|e:e<<8|s;return this.pointer=t,this.pos=i,r}async readUint32(){this.remainingLength()<4&&await this.flush(4);const t=this.data.getUint32(this.pointer,this.littleEndian);return this.pointer+=4,this.pos+=BigInt(4),t}async peekUint32(){return this.remainingLength()<4&&await this.flush(4),this.data.getUint32(this.pointer,this.littleEndian)}async readUint64(){this.remainingLength()<8&&await this.flush(8);const t=this.data.getBigUint64(this.pointer,this.littleEndian);return this.pointer+=8,this.pos+=BigInt(8),t}async peekUint64(){return this.remainingLength()<8&&await this.flush(8),this.data.getBigUint64(this.pointer,this.littleEndian)}async readInt8(){this.remainingLength()<1&&await this.flush(1);const t=this.data.getInt8(this.pointer);return this.pointer++,this.pos++,t}async peekInt8(){return this.remainingLength()<1&&await this.flush(1),this.data.getInt8(this.pointer)}async readInt16(){this.remainingLength()<2&&await this.flush(2);const t=this.data.getInt16(this.pointer,this.littleEndian);return this.pointer+=2,this.pos+=BigInt(2),t}async peekInt16(){return this.remainingLength()<2&&await this.flush(2),this.data.getInt16(this.pointer,this.littleEndian)}async readInt24(){const t=await this.readUint24();return 8388608&t?t-16777216:t}async peekInt24(){const t=await this.peekUint24();return 8388608&t?t-16777216:t}async readInt32(){this.remainingLength()<4&&await this.flush(4);const t=this.data.getInt32(this.pointer,this.littleEndian);return this.pointer+=4,this.pos+=BigInt(4),t}async peekInt32(){return this.remainingLength()<4&&await this.flush(4),this.data.getInt32(this.pointer,this.littleEndian)}async readInt64(){this.remainingLength()<8&&await this.flush(8);const t=this.data.getBigInt64(this.pointer,this.littleEndian);return this.pointer+=8,this.pos+=BigInt(8),t}async peekInt64(){return this.remainingLength()<8&&await this.flush(8),this.data.getBigInt64(this.pointer,this.littleEndian)}async readFloat(){this.remainingLength()<4&&await this.flush(4);const t=this.data.getFloat32(this.pointer,this.littleEndian);return this.pointer+=4,this.pos+=BigInt(4),t}async peekFloat(){return this.remainingLength()<4&&await this.flush(4),this.data.getFloat32(this.pointer,this.littleEndian)}async readDouble(){this.remainingLength()<8&&await this.flush(8);const t=this.data.getFloat64(this.pointer,this.littleEndian);return this.pointer+=8,this.pos+=BigInt(8),t}async peekDouble(){return this.remainingLength()<8&&await this.flush(8),this.data.getFloat64(this.pointer,this.littleEndian)}async readHex(t=1){let i="";for(let e=0;e<t;e++){const t=(await this.readUint8()).toString(16);i+=1===t.length?"0"+t:t}return i}async peekHex(t=1){t>this.size&&(this.error=-1048574,a.h2("peekHex, length too large",f,416)),this.remainingLength()<t&&await this.flush(t);const i=this.pointer,e=this.pos;let s="";for(let i=0;i<t;i++){const t=(await this.readUint8()).toString(16);s+=1===t.length?"0"+t:t}return this.pointer=i,this.pos=e,s}async readBuffer(t,i){if(i||(i=new Uint8Array(t)),this.remainingLength()<t){let e=0;if(this.remainingLength()>0){const s=this.remainingLength();i.set(this.buffer.subarray(this.pointer,this.pointer+s),e),e+=s,this.pointer+=s,this.pos+=BigInt(s),t-=s}for(;t>0;){await this.flush();const s=Math.min(this.endPointer-this.pointer,t);i.set(this.buffer.subarray(this.pointer,this.pointer+s),e),e+=s,this.pointer+=s,this.pos+=BigInt(s),t-=s}}else i.set(this.buffer.subarray(this.pointer,this.pointer+t),0),this.pointer+=t,this.pos+=BigInt(t);return i}async peekBuffer(t,i){return t>this.size&&(this.error=-1048574,a.h2("peekBuffer, length too large",f,501)),this.remainingLength()<t&&await this.flush(t),i||(i=new Uint8Array(t)),i.set(this.buffer.subarray(this.pointer,this.pointer+t),0),i}async readToBuffer(t,i){if(this.remainingLength()<t){let e=0;if(this.remainingLength()>0){const s=this.remainingLength();i.set(this.buffer.subarray(this.pointer,this.pointer+s),e),e+=s,this.pointer+=s,this.pos+=BigInt(s),t-=s}for(;t>0;){try{await this.flush()}catch(t){if(-1048576===this.error&&e)return e;throw t}const s=Math.min(this.endPointer-this.pointer,t);i.set(this.buffer.subarray(this.pointer,this.pointer+s),e),e+=s,this.pointer+=s,this.pos+=BigInt(s),t-=s}return e}return i.set(this.buffer.subarray(this.pointer,this.pointer+t),0),this.pointer+=t,this.pos+=BigInt(t),t}async readString(t=1){const i=await this.readBuffer(t);return h.decode(i)}async peekString(t=1){const i=await this.peekBuffer(t);return h.decode(i)}async readLine(){let t="";for(;;){let i=!1;for(let e=this.pointer;e<this.endPointer;e++)if(10===this.buffer[e]||13===this.buffer[e]){e!==this.pointer&&(t+=await this.readString(e-this.pointer)),i=!0;break}if(i)break;t+=await this.readString(this.remainingLength()),await this.flush()}let i=await this.peekUint8();return 10!==i&&13!==i||(this.pointer++,13===i&&(i=await this.peekUint8(),10===i&&this.pointer++)),t}async peekLine(){if(this.remainingLength()<this.size)try{await this.flush()}catch(t){if(-1048576!==this.error)throw t}let t="",i=!1;for(let e=this.pointer;e<this.endPointer;e++)if(10===this.buffer[e]||13===this.buffer[e]){t+=await this.peekString(e-this.pointer),i=!0;break}return i||(this.error=-1048574,a.h2("peekLine, out of buffer",f,659)),t}getPointer(){return this.pointer}getPos(){return this.pos}async skip(t){const i=t;for(;this.remainingLength()<t;)t-=this.remainingLength(),this.pointer=this.endPointer,await this.flush();this.remainingLength()>=t&&(this.pointer+=t),this.pos+=BigInt(i)}remainingLength(){return this.endPointer-this.pointer}async flush_(t){return new(n())((async i=>{for(this.flushResolve=i;;){const e=await this.onFlush(t);if(-1048575!==e){this.flushResolve=null,i(e);break}await new o.A(0)}}))}async flush(t=0){if(this.onFlush||(this.error=-1048574,a.h2("IOReader error, flush failed because of no flush callback",f,738)),!(this.size-this.remainingLength()<=0)){if(t=Math.min(t,this.size),this.pointer<this.endPointer?(this.buffer.set(this.buffer.subarray(this.pointer,this.endPointer),0),this.endPointer=this.endPointer-this.pointer):this.endPointer=0,this.pointer=0,t)for(;this.remainingLength()<t;){const t=await this.flush_(this.buffer.subarray(this.endPointer));if(t<0)throw this.error=t,new Error(`IOReader error, flush ${-1048576===t?"ended":"failed"}, ret: ${t}`);this.endPointer+=t}else{const t=await this.flush_(this.buffer.subarray(this.endPointer));if(t<0)throw this.error=t,new Error(`IOReader error, flush ${-1048576===t?"ended":"failed"}, ret: ${t}`);this.endPointer+=t}this.error=0}}async seek(t,i=!1,e=!0){if(!i){const i=Number(t-this.pos);if(i<0&&Math.abs(i)<=this.pointer)return this.pointer+=i,void(this.pos=t);if(i>0&&this.pointer+i<this.endPointer)return this.pointer+=i,void(this.pos=t);if(0===i)return}this.onSeek||(this.error=-1048574,a.h2("IOReader error, seek failed because of no seek callback",f,809)),this.pointer=this.endPointer=0,this.pos=t;const s=await this.onSeek(t);0!==s&&(this.error=s,a.h2("IOReader error, seek failed",f,818)),e&&await this.flush()}getBuffer(){return this.buffer}appendBuffer(t){if(this.size-this.endPointer>=t.length)this.buffer.set(t,this.endPointer),this.endPointer+=t.length;else if(this.buffer.set(this.buffer.subarray(this.pointer,this.endPointer),0),this.endPointer=this.endPointer-this.pointer,this.pointer=0,this.size-this.endPointer>=t.length)this.buffer.set(t,this.endPointer),this.endPointer+=t.length;else{const i=Math.min(this.size-this.endPointer,t.length);this.buffer.set(t.subarray(0,i),this.endPointer),this.endPointer+=i,a.R8("IOReader, call appendBuffer but the buffer's size is lagger then the remaining size",f,856)}}reset(){this.pointer=this.endPointer=0,this.pos=BigInt(0),this.error=0}setEndian(t){this.littleEndian=!t}isBigEndian(){return!this.littleEndian}async fileSize(){if(this.fileSize_)return this.fileSize_;if(!this.onSize)return a.R8("IOReader error, fileSize failed because of no onSize callback",f,898),BigInt(0);try{this.fileSize_=await this.onSize()}catch(t){a.R8(`IOReader error, call fileSize failed: ${t}`,f,905),this.fileSize_=BigInt(0)}return this.fileSize_}getBufferSize(){return this.size}async pipe(t,i){if(i)if(this.remainingLength()<i){if(this.remainingLength()>0){const e=this.remainingLength();await t.writeBuffer(this.buffer.subarray(this.pointer,this.pointer+e)),this.pointer+=e,this.pos+=BigInt(e),i-=e}for(;i>0;){await this.flush();const e=Math.min(this.remainingLength(),i);await t.writeBuffer(this.buffer.subarray(this.pointer,this.pointer+e)),this.pointer+=e,this.pos+=BigInt(e),i-=e}}else await t.writeBuffer(this.buffer.subarray(this.pointer,this.pointer+i)),this.pointer+=i,this.pos+=BigInt(i);else{if(this.remainingLength()>0){const i=this.remainingLength();await t.writeBuffer(this.buffer.subarray(this.pointer,this.pointer+i)),this.pointer+=i,this.pos+=BigInt(i)}for(;await this.flush_(this.buffer.subarray(0))>0;){const i=this.remainingLength();await t.writeBuffer(this.buffer.subarray(this.pointer,this.pointer+i)),this.pointer+=i,this.pos+=BigInt(i)}}}abort(){this.error=-1048572,this.flushResolve&&(this.flushResolve(-1048572),this.flushResolve=null)}}},33236:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(82915);const r="packages/avformat/src/function/mktag.ts";function n(t){4!==t.length&&s.R8(`tag length is not 4, tag: ${t}`,r,31);let i=0;for(let e=0;e<4;e++)i=i<<8|t.charCodeAt(e);return i}},35536:(t,i,e)=>{e.d(i,{Q:()=>u});var s,r,n=e(82563),a=e(23339),h=e.n(a),o=e(59650),f=e(73556);class u{constructor(t){(0,n.A)(this,"num",1),(0,n.A)(this,"den",1),t&&(this.den=t.den,this.num=t.num)}}s=u.prototype,(r=new(h())).set("num",{0:15,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}),r.set("den",{0:15,1:0,2:0,3:0,4:0,5:0,6:0,7:4,8:0}),(0,f.A)(s,o.Og,!0),(0,f.A)(s,o.dc,4),(0,f.A)(s,o.g7,8),(0,f.A)(s,o.JY,r)},35651:(t,i,e)=>{var s=e(26942);t.exports=s},39710:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(82563),r=e(18811),n=e.n(r),a=e(82816),h=e(54805),o=e(58650),f=e(82915),u=e(51670),l=e(1639);class d{constructor(){(0,s.A)(this,"onMetaData",void 0),this.onMetaData={canSeekToEnd:!1}}async read(t,i){const e=t.getPos(),s=e+BigInt(Math.floor(i)),r=await h.$x(t,s),n=await h.$x(t,s);this[r]=n,s>t.getPos()&&await t.skip(Number(BigInt.asIntN(32,s-t.getPos())));const a=Number(t.getPos()-e),u=await t.readUint32();return a+11!==u?(f.R8(`script size not match, size: ${a+11}, previousTagSize: ${u}`,"packages/avformat/src/formats/flv/FlvScriptTag.ts",60),o.LR):0}computeSize(){const t=[],i=new l.A;return i.onFlush=i=>(t.push(n()(i).call(i)),0),h.bD(i,"onMetaData"),h.bD(i,this.onMetaData),i.flush(),(0,u.A)(Uint8Array,t).length}write(t){if(this.onMetaData){const i=[],e=new l.A;e.onFlush=t=>(i.push(n()(t).call(t)),0),h.bD(e,"onMetaData"),h.bD(e,this.onMetaData),e.flush();const s=(0,u.A)(Uint8Array,i);a.M5(t,18,BigInt(0),void 0,s)}}dts2Position(t){if(this.canSeek()){let i=-1;const e=this.onMetaData.keyframes.times,s=this.onMetaData.keyframes.filepositions;let r;for(r=0;r<e.length;r++){if(e[r]===t){i=r;break}if(e[r]>t){i=Math.max(r-1,0);break}}return r&&r===e.length&&(i=e.length-1),{pos:s[i],dts:e[i]}}return{pos:-1,dts:-1}}position2DTS(t){if(this.canSeek()){let e=-1;const s=this.onMetaData.keyframes.times,r=this.onMetaData.keyframes.filepositions;let n=0;for(n=0;n<r.length;n++)if(r[n]>t){e=n;break}var i;return n===r.length?null!==(i=this.onMetaData.duration)&&void 0!==i?i:s[s.length-1]:s[e]}return-1}canSeek(){return!!(this.onMetaData.keyframes&&this.onMetaData.keyframes.filepositions&&this.onMetaData.keyframes.filepositions.length)}}},41725:(t,i,e)=>{var s=e(89624),r=e(36086),n=e(42391),a=e(21061),h=e(61726),o=s(a),f=s("".slice),u=Math.ceil,l=function(t){return function(i,e,s){var a,l,d=n(h(i)),p=r(e),c=d.length,g=void 0===s?" ":n(s);return p<=c||""===g?d:((l=o(g,u((a=p-c)/g.length))).length>a&&(l=f(l,0,a)),t?d+l:l+d)}};t.exports={start:l(!1),end:l(!0)}},44046:(t,i,e)=>{e.d(i,{ll:()=>b,qg:()=>f}),e(42399);var s=e(1193),r=e.n(s),n=(e(49497),e(5463)),a=e.n(n),h=e(22608),o=e.n(h);function f(t){const i=t,e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],s=/:\/\/([^\/@]*@?)\[(\S+)\]/;let r="";s.test(t)&&(t=t.replace(s,((t,i,e)=>(r=e,`://${i||""}a.b`))));const n={},a=/^(?:(?![^:@\/]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*)(?::([^:@\/]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t);let h=14;for(;h--;){var o;n[e[h]]=null!==(o=a[h])&&void 0!==o?o:""}return r&&(n.host=r,n.source=i,n.authority=r+(n.port?":"+n.port:"")),{protocol:n.protocol,file:n.file,host:n.host,port:n.port,user:n.user,password:n.password,origin:`${n.protocol}://${n.authority}`,pathname:n.path,search:`?${n.query}`,hash:n.anchor?`#${n.anchor}`:""}}const u=/(?:\/|^)\.(?=\/)/g,l=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,d=/^(?=([^\/?#]*))\1([^]*)$/,p=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;function c(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}function g(t){const i=p.exec(t);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null}function w(t){var i,e;for(t=a()(i=t.split("")).call(i).join("").replace(u,"");t.length!==(t=t.replace(l,"")).length;);return a()(e=t.split("")).call(e).join("")}function b(t,i,e){if(e=e||{},t=r()(t).call(t),!(i=r()(i).call(i))){if(!e.alwaysNormalize)return t;let i=g(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=w(i.path),c(i)}let s=g(i);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return e.alwaysNormalize?(s.path=w(s.path),c(s)):i;let n=g(t);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&"/"!==n.path[0]){let t=d.exec(n.path);n.netLoc=t[1],n.path=t[2]}n.netLoc&&!n.path&&(n.path="/");const a={scheme:n.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(a.netLoc=n.netLoc,"/"!==s.path[0]))if(s.path){let t=n.path,i=t.substring(0,o()(t).call(t,"/")+1)+s.path;a.path=w(i)}else a.path=n.path,s.params||(a.params=n.params,s.query||(a.query=n.query));return null===a.path&&(a.path=e.alwaysNormalize?w(s.path):s.path),c(a)}},44241:(t,i,e)=>{var s=e(53457),r=e(28035),n=RegExp.prototype;t.exports=function(t){return t===n||s(n,t)?r(t):t.flags}},44292:(t,i,e)=>{e(29074);var s=e(42244);t.exports=s("Array","reverse")},46630:(t,i,e)=>{e.d(i,{Dh:()=>r,FQ:()=>l,H3:()=>o,KR:()=>f,N_:()=>n,SF:()=>a,f7:()=>g,go:()=>d,i0:()=>u,pu:()=>w,qs:()=>h,vh:()=>p,zg:()=>c});var s=e(35536);const r=-BigInt(1),n=-1,a=1e6,h=1e3,o=1e9,f=new s.Q({den:a,num:1}),u=new s.Q({den:h,num:1}),l=new s.Q({den:o,num:1}),d=(new s.Q({den:1,num:1}),2147483647),p=BigInt(0x8000000000000000),c=65535,g=4294967295,w=(BigInt(0x10000000000000000),8)},46984:(t,i,e)=>{e.d(i,{U:()=>o,w:()=>f});var s=e(96279),r=e(82915),n=e(51670);const a="packages/avprotocol/src/rtmp/util.ts";async function h(t,i,e){if(i<64)await t.writeUint8(i|e<<6);else if(i<320)await t.writeUint8(e<<6),await t.writeUint8(i-64);else{await t.writeUint8(1|e<<6);const s=i-64;await t.writeUint8(255&s),await t.writeUint8(s>>>8)}}async function o(t,i,e,s){const r=s&&s.extra===e.extra&&e.timestamp>=s.timestamp;let n=e.timestamp;r&&(n-=s.timestamp),e.tsField=n>16777215?16777215:n;let a=0;r&&(e.type===s.type&&e.payload.length===s.payload.length?(a=2,e.tsField===s.tsField&&(a=3)):a=1),await h(t,e.channelId,a),3!==a&&(await t.writeUint24(e.tsField),2!==a&&(await t.writeUint24(e.payload.length),await t.writeUint8(e.type),0===a&&(await t.writeUint8(e.extra),await t.writeUint8(e.extra>>8),await t.writeUint8(e.extra>>16),await t.writeUint8(e.extra>>24)))),16777215===e.tsField&&await t.writeUint32(n);let o=0;for(;o<e.payload.length;){const s=Math.min(i,e.payload.length-o);await t.writeBuffer(e.payload.subarray(o,o+s)),o+=s,o<e.payload.length&&(await h(t,e.channelId,3),16777215===e.tsField&&await t.writeUint32(n))}await t.flush()}async function f(t,i,e){const h=[],o=await t.readUint8();let f=63&o;f<2&&(f=0===await t.readUint8()?await t.readUint8()+64:64+(await t.readUint8()|await t.readUint8()<<8));const u=o>>>6,l=e.get(f);let d=l?l.payload.length:0,p=l?l.type:0,c=l?l.extra:0,g=0,w=0;if(3===u?g=l.tsField:(g=await t.readUint24(),2!==u&&(d=await t.readUint24(),p=await t.readUint8(),0===u&&(c=await t.readUint8(),c|=await t.readUint8()<<8,c|=await t.readUint8()<<16,c|=await t.readUint8()<<24))),w=16777215===g?await t.readUint32():g,0!==u&&(l?w+=l.timestamp:r.R8(`got invalid message fmt, channel id ${f} can not find prev message with fmt ${u}`,a,177)),d<i)h.push(await t.readBuffer(d));else{let e=d;for(;e;){const s=Math.min(i,e);if(h.push(await t.readBuffer(s)),e-=s,e){const i=63&await t.readUint8();i<2&&await t.skip(i+1),16777215===g&&await t.skip(4)}}}const b=new s.u(f,p,w,(0,n.A)(Uint8Array,h));return b.tsField=g,b.extra=c,b}},49497:(t,i,e)=>{t.exports=e(35651)},54163:(t,i,e)=>{e.d(i,{FP:()=>o,Mr:()=>h,iU:()=>l,j2:()=>u,k:()=>a,lb:()=>f});var s=e(53508),r=e(46630),n=e(61615);function a(t,i,e){return t*BigInt(i.num)*BigInt(e.den)/(BigInt(i.den)*BigInt(e.num))}function h(t,i,e){return t*BigInt(s.f[15](i))*BigInt(e.den)/(BigInt(s.f[15](i+4))*BigInt(e.num))}function o(t,i,e){return t*BigInt(i.num)*BigInt(s.f[15](e+4))/(BigInt(i.den)*BigInt(s.f[15](e)))}function f(t){return t.num/t.den}function u(t,i){if(isNaN(19))return{den:0,num:0};if(Math.abs(t)>r.go+3)return{den:0,num:t<0?-1:1};const e=t>1?{den:Math.floor(i/t+.5),num:i}:{den:i,num:Math.floor(t*i+.5)};return l(e),e}function l(t){const i=(0,n.A)(t.num,t.den);i<=1||(t.den/=i,t.num/=i)}},54805:(t,i,e)=>{e.d(i,{$x:()=>h,bD:()=>o});var s=e(17283),r=e(21782),n=e(34492);async function a(t,i){return{key:await t.readString(await t.readUint16()),value:await h(t,i)}}async function h(t,i){let e;switch(await t.readUint8()){case 0:e=await t.readDouble();break;case 1:e=!!await t.readUint8();break;case 2:e=await t.readString(await t.readUint16());break;case 3:for(e={};t.getPos()<i;){const{key:s,value:r}=await a(t,i);if(e[s]=r,9==(16777215&await t.peekUint24())){await t.skip(3);break}}break;case 8:for(e={},await t.skip(4);t.getPos()<i;){const{key:s,value:r}=await a(t,i);if(e[s]=r,9==(16777215&await t.peekUint24())){await t.skip(3);break}}break;case 9:case 5:e=null;break;case 10:e=[];const s=await t.readUint32();for(let r=0;r<s;r++)e.push(await h(t,i));break;case 11:const r=await t.readDouble(),n=await t.readInt16();e=new Date(r+60*n*1e3);break;case 12:e=await t.readString(await t.readUint32())}return e}function o(t,i){s.ai(i)?(t.writeUint8(0),t.writeDouble(i)):s.o(i)?(t.writeUint8(0),t.writeDouble(Number(i))):s.zM(i)?(t.writeUint8(1),t.writeUint8(i?1:0)):s.Yj(i)?i.length>=65536?(t.writeUint8(12),t.writeUint32(i.length),t.writeString(i)):(t.writeUint8(2),t.writeUint16(i.length),t.writeString(i)):s.YO(i)?(t.writeUint8(10),t.writeUint32(i.length),r.__(i,(i=>{o(t,i)}))):s.Ik(i)?(t.writeUint8(3),n.each(i,((i,e)=>{t.writeUint16(e.length),t.writeString(e),o(t,i)})),t.writeUint24(9)):i instanceof Date?(t.writeUint8(11),t.writeDouble(i.getTime()),t.writeInt16(0)):null==i&&t.writeUint8(5)}},55564:(t,i,e)=>{var s=e(44241);t.exports=s},55978:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(82563),r=e(9538),n=e.n(r);class a{constructor(){(0,s.A)(this,"signature",void 0),(0,s.A)(this,"version",void 0),(0,s.A)(this,"flags",void 0),(0,s.A)(this,"dataOffset",void 0),(0,s.A)(this,"hasVideo",void 0),(0,s.A)(this,"hasAudio",void 0),this.signature="FLV",this.version=1,this.flags=0,this.dataOffset=9,this.hasAudio=!1,this.hasVideo=!1}async read(t){this.signature=await t.readString(3),this.version=await t.readUint8(),this.flags=await t.readUint8(),this.dataOffset=await t.readUint32(),this.hasAudio=!!(4&n()(this)),this.hasVideo=!!(1&n()(this))}write(t){this.flags=0,this.hasAudio&&(this.flags|=4),this.hasVideo&&(this.flags|=1),t.writeString(this.signature),t.writeUint8(this.version),t.writeUint8(n()(this)),t.writeUint32(this.dataOffset)}}},60255:(t,i,e)=>{e.d(i,{iD:()=>s});const s=1024},61615:(t,i,e)=>{function s(t,i){for(;0!==i;)[t,i]=[i,t%i];return t}e.d(i,{A:()=>s})},79827:(t,i,e)=>{var s=e(66415);t.exports=function(){var t=s(this),i="";return t.hasIndices&&(i+="d"),t.global&&(i+="g"),t.ignoreCase&&(i+="i"),t.multiline&&(i+="m"),t.dotAll&&(i+="s"),t.unicode&&(i+="u"),t.unicodeSets&&(i+="v"),t.sticky&&(i+="y"),i}},80030:(t,i,e)=>{let s;function r(t){s.getRandomValues(t)}e.d(i,{A:()=>r}),"undefined"!=typeof crypto&&(s=crypto)},82816:(t,i,e)=>{e.d(i,{M5:()=>n});var s=e(17283);function r(t,i,e){const s=t.getPos(),r=t.getPointer(),n=s-BigInt(Math.floor(r));i<s&&i>=n?(t.seekInline(r+Number(i-s)),t.writeUint24(e),t.seekInline(r)):(t.seek(i),t.writeUint24(e),t.seek(s))}function n(t,i,e,n,a,h){t.flush(),t.writeUint8(i);const o=t.getPos();t.writeUint24(0),t.writeUint24(Number(e&BigInt(16777215))),t.writeUint8(Number(e>>BigInt(24)&BigInt(255))),t.writeUint24(0);const f=t.getPos();n&&n(t),s.Pc(a)?(a(t),r(t,o,Number(t.getPos()-f))):a&&(r(t,o,a.length+Number(t.getPos()-f)),t.writeBuffer(a));const u=Number(t.getPos()-o)+1;h&&h(u),t.writeUint32(u)}},90216:(t,i,e)=>{var s=e(53457),r=e(44292),n=Array.prototype;t.exports=function(t){var i=t.reverse;return t===n||s(n,t)&&i===n.reverse?r:i}},95397:(t,i,e)=>{var s=e(58184),r=e(81767),n=s.RegExp,a=!r((function(){var t=!0;try{n(".","d")}catch(i){t=!1}var i={},e="",s=t?"dgimsy":"gimsy",r=function(t,s){Object.defineProperty(i,t,{get:function(){return e+=s,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var h in t&&(a.hasIndices="d"),a)r(h,a[h]);return Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(i)!==s||e!==s}));t.exports={correct:a}},96279:(t,i,e)=>{e.d(i,{u:()=>r});var s=e(82563);class r{constructor(t,i,e,r){(0,s.A)(this,"channelId",void 0),(0,s.A)(this,"type",void 0),(0,s.A)(this,"timestamp",void 0),(0,s.A)(this,"tsField",0),(0,s.A)(this,"extra",0),(0,s.A)(this,"payload",void 0),this.channelId=t,this.type=i,this.timestamp=e,this.payload=r instanceof Uint8Array?r:new Uint8Array(r)}}},null:()=>{__webpack_require__(1193)}};