@vibecontrols/agent 2026.601.30

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 (108) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +558 -0
  3. package/dist/agent-config-85pskv43.js +2 -0
  4. package/dist/agent-ready-tracker-zp6p8e6f.js +2 -0
  5. package/dist/app-yvjadjmh.js +2 -0
  6. package/dist/bootstrap-workspace-zpm20zez.js +2 -0
  7. package/dist/bootstrap.service-pjmnpxha.js +2 -0
  8. package/dist/bridge-client-341r9rry.js +2 -0
  9. package/dist/cli.js +5 -0
  10. package/dist/daemon-profile-vas1vf2t.js +2 -0
  11. package/dist/esm-9fpye77x.js +2 -0
  12. package/dist/finalize-retry-handle-registry-vv241fsq.js +2 -0
  13. package/dist/finalize-retry-worker-xp1nhv3c.js +2 -0
  14. package/dist/gateway-client-43gzvj5s.js +2 -0
  15. package/dist/getMachineId-bsd-a56s0v8c.js +2 -0
  16. package/dist/getMachineId-darwin-w9k0yw9r.js +3 -0
  17. package/dist/getMachineId-linux-anh31jbf.js +2 -0
  18. package/dist/getMachineId-unsupported-5hv3pwca.js +2 -0
  19. package/dist/getMachineId-win-njb8tery.js +2 -0
  20. package/dist/highlights-8d9mgr01.js +2 -0
  21. package/dist/highlights-eq9cgrbb.scm +604 -0
  22. package/dist/highlights-ghv9g403.scm +205 -0
  23. package/dist/highlights-hk7bwhj4.scm +284 -0
  24. package/dist/highlights-jwvdxm9x.js +2 -0
  25. package/dist/highlights-qbx2vnme.js +2 -0
  26. package/dist/highlights-r3m83kn9.js +2 -0
  27. package/dist/highlights-r812a2qc.scm +150 -0
  28. package/dist/highlights-s7mqapt6.js +2 -0
  29. package/dist/highlights-x6tmsnaa.scm +115 -0
  30. package/dist/index-01qzsnwd.js +16 -0
  31. package/dist/index-0248afsn.js +3 -0
  32. package/dist/index-04n4qgvd.js +407 -0
  33. package/dist/index-0ckffygp.js +5 -0
  34. package/dist/index-0cn9bv8z.js +4 -0
  35. package/dist/index-1hnw0rhc.js +178 -0
  36. package/dist/index-1zw3kea7.js +10 -0
  37. package/dist/index-2gsarrbn.js +4 -0
  38. package/dist/index-2xs9cvjn.js +28 -0
  39. package/dist/index-3ys16efc.js +231 -0
  40. package/dist/index-4wgjx8bf.js +3 -0
  41. package/dist/index-52cp759f.js +3 -0
  42. package/dist/index-5mw3eshk.js +4 -0
  43. package/dist/index-678rwfc0.js +5 -0
  44. package/dist/index-6jq17k9s.js +7 -0
  45. package/dist/index-6jzsthh9.js +3 -0
  46. package/dist/index-6mprnf7p.js +9 -0
  47. package/dist/index-8kvc8ttn.js +15 -0
  48. package/dist/index-8sm0nkh8.js +3 -0
  49. package/dist/index-9bqd8veb.js +21 -0
  50. package/dist/index-b5dhmybd.js +4 -0
  51. package/dist/index-c58g96mb.js +26 -0
  52. package/dist/index-cs78wq6y.js +3 -0
  53. package/dist/index-d5ysy1yn.js +3 -0
  54. package/dist/index-dm6yjmgq.js +3 -0
  55. package/dist/index-e1bw1bwr.js +4 -0
  56. package/dist/index-ef95xr4z.js +9 -0
  57. package/dist/index-g2raeeh4.js +11 -0
  58. package/dist/index-g3ap3xpr.js +5 -0
  59. package/dist/index-g8zv1gta.js +17 -0
  60. package/dist/index-h8a8s8sn.js +3 -0
  61. package/dist/index-hrdamx5j.js +2 -0
  62. package/dist/index-jw1k4vbk.js +3 -0
  63. package/dist/index-mtm8cfyt.js +158 -0
  64. package/dist/index-mxc61yr1.js +3 -0
  65. package/dist/index-n7qyrdr1.js +3 -0
  66. package/dist/index-qfz9fy56.js +3 -0
  67. package/dist/index-rc79x8fw.js +3 -0
  68. package/dist/index-rdp5xq4r.js +15 -0
  69. package/dist/index-scsjyj4m.js +171 -0
  70. package/dist/index-ssjmzqcz.js +13 -0
  71. package/dist/index-tmrbs96r.js +11 -0
  72. package/dist/index-tp4y9jde.js +83 -0
  73. package/dist/index-v9fx5wab.js +83 -0
  74. package/dist/index-vdahdt49.js +2 -0
  75. package/dist/index-x1h8r7pr.js +3 -0
  76. package/dist/index-xjzmb1pn.js +3 -0
  77. package/dist/index-yrgm89r8.js +3 -0
  78. package/dist/index-yy1mm8zs.js +3 -0
  79. package/dist/index-z5a4yxzz.js +8 -0
  80. package/dist/index.js +5 -0
  81. package/dist/injections-73j83es3.scm +27 -0
  82. package/dist/injections-srewsjcz.js +2 -0
  83. package/dist/interactive-22ta89hc.js +2 -0
  84. package/dist/key.cmd-wgcq6kt8.js +2 -0
  85. package/dist/log-shipper-k24m8yw5.js +2 -0
  86. package/dist/path-utils-35re7qf9.js +2 -0
  87. package/dist/plugin-system-c916v9an.js +2 -0
  88. package/dist/postinstall-shim-fix.cjs +382 -0
  89. package/dist/prereqs-runner-ca4kt803.js +2 -0
  90. package/dist/preuninstall.cjs +254 -0
  91. package/dist/profile-mount-npcknw6v.js +2 -0
  92. package/dist/prune-stale-shims-nkx9vq5m.js +2 -0
  93. package/dist/register-core-qrawzyym.js +2 -0
  94. package/dist/secondary-profile-attach-db5cr3e1.js +2 -0
  95. package/dist/subprocess-g9sk1ep9.js +2 -0
  96. package/dist/telemetry-tnq47dcs.js +2 -0
  97. package/dist/tree-sitter-javascript-3h25c6bs.js +2 -0
  98. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  99. package/dist/tree-sitter-markdown-3nemcjhe.js +2 -0
  100. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  101. package/dist/tree-sitter-markdown_inline-16ftwa53.js +2 -0
  102. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  103. package/dist/tree-sitter-typescript-f6mq6ze6.js +2 -0
  104. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  105. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  106. package/dist/tree-sitter-zig-s2trkm2d.js +2 -0
  107. package/dist/tunnel-bootstrap-2kg79ng8.js +2 -0
  108. package/package.json +122 -0
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import{ee as NG,fe as i,he as I1}from"./index-yy1mm8zs.js";var k1=i((tY,g1)=>{var d=1000,u=d*60,f=u*60,g=f*24,c0=g*7,b0=g*365.25;g1.exports=function(G,Y){Y=Y||{};var $=typeof G;if($==="string"&&G.length>0)return y0(G);else if($==="number"&&isFinite(G))return Y.long?p0(G):m0(G);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(G))};function y0(G){if(G=String(G),G.length>100)return;var Y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(G);if(!Y)return;var $=parseFloat(Y[1]),J=(Y[2]||"ms").toLowerCase();switch(J){case"years":case"year":case"yrs":case"yr":case"y":return $*b0;case"weeks":case"week":case"w":return $*c0;case"days":case"day":case"d":return $*g;case"hours":case"hour":case"hrs":case"hr":case"h":return $*f;case"minutes":case"minute":case"mins":case"min":case"m":return $*u;case"seconds":case"second":case"secs":case"sec":case"s":return $*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return $;default:return}}function m0(G){var Y=Math.abs(G);if(Y>=g)return Math.round(G/g)+"d";if(Y>=f)return Math.round(G/f)+"h";if(Y>=u)return Math.round(G/u)+"m";if(Y>=d)return Math.round(G/d)+"s";return G+"ms"}function p0(G){var Y=Math.abs(G);if(Y>=g)return J1(G,Y,g,"day");if(Y>=f)return J1(G,Y,f,"hour");if(Y>=u)return J1(G,Y,u,"minute");if(Y>=d)return J1(G,Y,d,"second");return G+" ms"}function J1(G,Y,$,J){var Q=Y>=$*1.5;return Math.round(G/$)+" "+J+(Q?"s":"")}});var R1=i((rY,c1)=>{function l0(G){$.debug=$,$.default=$,$.coerce=V,$.disable=q,$.enable=Q,$.enabled=M,$.humanize=k1(),$.destroy=W,Object.keys(G).forEach((K)=>{$[K]=G[K]}),$.names=[],$.skips=[],$.formatters={};function Y(K){let j=0;for(let _=0;_<K.length;_++)j=(j<<5)-j+K.charCodeAt(_),j|=0;return $.colors[Math.abs(j)%$.colors.length]}$.selectColor=Y;function $(K){let j,_=null,O,y;function I(...A){if(!I.enabled)return;let h=I,r=Number(new Date),D0=r-(j||r);if(h.diff=D0,h.prev=j,h.curr=r,j=r,A[0]=$.coerce(A[0]),typeof A[0]!=="string")A.unshift("%O");let e=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(j1,A0)=>{if(j1==="%%")return"%";e++;let H1=$.formatters[A0];if(typeof H1==="function"){let C0=A[e];j1=H1.call(h,C0),A.splice(e,1),e--}return j1}),$.formatArgs.call(h,A),(h.log||$.log).apply(h,A)}if(I.namespace=K,I.useColors=$.useColors(),I.color=$.selectColor(K),I.extend=J,I.destroy=$.destroy,Object.defineProperty(I,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(_!==null)return _;if(O!==$.namespaces)O=$.namespaces,y=$.enabled(K);return y},set:(A)=>{_=A}}),typeof $.init==="function")$.init(I);return I}function J(K,j){let _=$(this.namespace+(typeof j>"u"?":":j)+K);return _.log=this.log,_}function Q(K){$.save(K),$.namespaces=K,$.names=[],$.skips=[];let j=(typeof K==="string"?K:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of j)if(_[0]==="-")$.skips.push(_.slice(1));else $.names.push(_)}function Z(K,j){let _=0,O=0,y=-1,I=0;while(_<K.length)if(O<j.length&&(j[O]===K[_]||j[O]==="*"))if(j[O]==="*")y=O,I=_,O++;else _++,O++;else if(y!==-1)O=y+1,I++,_=I;else return!1;while(O<j.length&&j[O]==="*")O++;return O===j.length}function q(){let K=[...$.names,...$.skips.map((j)=>"-"+j)].join(",");return $.enable(""),K}function M(K){for(let j of $.skips)if(Z(K,j))return!1;for(let j of $.names)if(Z(K,j))return!0;return!1}function V(K){if(K instanceof Error)return K.stack||K.message;return K}function W(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return $.enable($.load()),$}c1.exports=l0});var y1=i((b1,Q1)=>{b1.formatArgs=u0;b1.save=f0;b1.load=s0;b1.useColors=d0;b1.storage=o0();b1.destroy=(()=>{let G=!1;return()=>{if(!G)G=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();b1.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function d0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let G;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(G=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(G[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u0(G){if(G[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+G[0]+(this.useColors?"%c ":" ")+"+"+Q1.exports.humanize(this.diff),!this.useColors)return;let Y="color: "+this.color;G.splice(1,0,Y,"color: inherit");let $=0,J=0;G[0].replace(/%[a-zA-Z%]/g,(Q)=>{if(Q==="%%")return;if($++,Q==="%c")J=$}),G.splice(J,0,Y)}b1.log=console.debug||console.log||(()=>{});function f0(G){try{if(G)b1.storage.setItem("debug",G);else b1.storage.removeItem("debug")}catch(Y){}}function s0(){let G;try{G=b1.storage.getItem("debug")||b1.storage.getItem("DEBUG")}catch(Y){}if(!G&&typeof process<"u"&&"env"in process)G=process.env.DEBUG;return G}function o0(){try{return localStorage}catch(G){}}Q1.exports=R1()(b1);var{formatters:i0}=Q1.exports;i0.j=function(G){try{return JSON.stringify(G)}catch(Y){return"[UnexpectedJSONParseError]: "+Y.message}}});var d1=i((p1,K1)=>{var $G=I1("tty"),Z1=I1("util");p1.init=VG;p1.log=KG;p1.formatArgs=QG;p1.save=qG;p1.load=MG;p1.useColors=JG;p1.destroy=Z1.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");p1.colors=[6,2,3,4,5,1];try{let G=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(G&&(G.stderr||G).level>=2)p1.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(G){}p1.inspectOpts=Object.keys(process.env).filter((G)=>{return/^debug_/i.test(G)}).reduce((G,Y)=>{let $=Y.substring(6).toLowerCase().replace(/_([a-z])/g,(Q,Z)=>{return Z.toUpperCase()}),J=process.env[Y];if(/^(yes|on|true|enabled)$/i.test(J))J=!0;else if(/^(no|off|false|disabled)$/i.test(J))J=!1;else if(J==="null")J=null;else J=Number(J);return G[$]=J,G},{});function JG(){return"colors"in p1.inspectOpts?Boolean(p1.inspectOpts.colors):$G.isatty(process.stderr.fd)}function QG(G){let{namespace:Y,useColors:$}=this;if($){let J=this.color,Q="\x1B[3"+(J<8?J:"8;5;"+J),Z=` ${Q};1m${Y} \x1B[0m`;G[0]=Z+G[0].split(`
3
+ `).join(`
4
+ `+Z),G.push(Q+"m+"+K1.exports.humanize(this.diff)+"\x1B[0m")}else G[0]=ZG()+Y+" "+G[0]}function ZG(){if(p1.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function KG(...G){return process.stderr.write(Z1.formatWithOptions(p1.inspectOpts,...G)+`
5
+ `)}function qG(G){if(G)process.env.DEBUG=G;else delete process.env.DEBUG}function MG(){return process.env.DEBUG}function VG(G){G.inspectOpts={};let Y=Object.keys(p1.inspectOpts);for(let $=0;$<Y.length;$++)G.inspectOpts[Y[$]]=p1.inspectOpts[Y[$]]}K1.exports=R1()(p1);var{formatters:m1}=K1.exports;m1.o=function(G){return this.inspectOpts.colors=this.useColors,Z1.inspect(G,this.inspectOpts).split(`
6
+ `).map((Y)=>Y.trim()).join(" ")};m1.O=function(G){return this.inspectOpts.colors=this.useColors,Z1.inspect(G,this.inspectOpts)}});var u1=i((Y$,U1)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)U1.exports=y1();else U1.exports=d1()});/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var L1={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},L0={};for(let[G,Y]of Object.entries(L1))L0[Y]=Number.parseInt(G,10);var G1;function x0(){if(typeof globalThis.TextDecoder>"u")return;return G1!==null&&G1!==void 0?G1:G1=new globalThis.TextDecoder("utf-8")}var m=32768,L=65533;function x1(G,Y="utf-8"){switch(Y.toLowerCase()){case"utf-8":case"utf8":{let $=x0();return $?$.decode(G):T0(G)}case"utf-16le":return S0(G);case"us-ascii":case"ascii":return v0(G);case"latin1":case"iso-8859-1":return h0(G);case"windows-1252":return z0(G);default:throw RangeError(`Encoding '${Y}' not supported`)}}function P1(G,Y){if(Y.length===0)return;G.push(String.fromCharCode.apply(null,Y)),Y.length=0}function N(G,Y,$){if(Y.push($),Y.length>=m)P1(G,Y)}function E0(G,Y,$){if($<=65535){N(G,Y,$);return}$-=65536,N(G,Y,55296+($>>10)),N(G,Y,56320+($&1023))}function T0(G){let Y=[],$=[],J=0;if(G.length>=3&&G[0]===239&&G[1]===187&&G[2]===191)J=3;while(J<G.length){let Q=G[J];if(Q<=127){N(Y,$,Q),J++;continue}if(Q<194||Q>244){N(Y,$,L),J++;continue}if(Q<=223){if(J+1>=G.length){N(Y,$,L),J++;continue}let K=G[J+1];if((K&192)!==128){N(Y,$,L),J++;continue}let j=(Q&31)<<6|K&63;N(Y,$,j),J+=2;continue}if(Q<=239){if(J+2>=G.length){N(Y,$,L),J++;continue}let K=G[J+1],j=G[J+2];if(!((K&192)===128&&(j&192)===128&&!(Q===224&&K<160)&&!(Q===237&&K>=160))){N(Y,$,L),J++;continue}let O=(Q&15)<<12|(K&63)<<6|j&63;N(Y,$,O),J+=3;continue}if(J+3>=G.length){N(Y,$,L),J++;continue}let Z=G[J+1],q=G[J+2],M=G[J+3];if(!((Z&192)===128&&(q&192)===128&&(M&192)===128&&!(Q===240&&Z<144)&&!(Q===244&&Z>143))){N(Y,$,L),J++;continue}let W=(Q&7)<<18|(Z&63)<<12|(q&63)<<6|M&63;E0(Y,$,W),J+=4}return P1(Y,$),Y.join("")}function S0(G){let Y=[],$=[],J=G.length,Q=0;while(Q+1<J){let Z=G[Q]|G[Q+1]<<8;if(Q+=2,Z>=55296&&Z<=56319){if(Q+1<J){let q=G[Q]|G[Q+1]<<8;if(q>=56320&&q<=57343)N(Y,$,Z),N(Y,$,q),Q+=2;else N(Y,$,L)}else N(Y,$,L);continue}if(Z>=56320&&Z<=57343){N(Y,$,L);continue}N(Y,$,Z)}if(Q<J)N(Y,$,L);return P1(Y,$),Y.join("")}function v0(G){let Y=[];for(let $=0;$<G.length;$+=m){let J=Math.min(G.length,$+m),Q=Array(J-$);for(let Z=$,q=0;Z<J;Z++,q++)Q[q]=G[Z]&127;Y.push(String.fromCharCode.apply(null,Q))}return Y.join("")}function h0(G){let Y=[];for(let $=0;$<G.length;$+=m){let J=Math.min(G.length,$+m),Q=Array(J-$);for(let Z=$,q=0;Z<J;Z++,q++)Q[q]=G[Z];Y.push(String.fromCharCode.apply(null,Q))}return Y.join("")}function z0(G){let Y=[],$="";for(let J=0;J<G.length;J++){let Q=G[J],Z=Q>=128&&Q<=159?L1[Q]:void 0;if($+=Z!==null&&Z!==void 0?Z:String.fromCharCode(Q),$.length>=m)Y.push($),$=""}if($)Y.push($);return Y.join("")}function U(G){return new DataView(G.buffer,G.byteOffset)}var E1={len:1,get(G,Y){return U(G).getUint8(Y)},put(G,Y,$){return U(G).setUint8(Y,$),Y+1}},X={len:2,get(G,Y){return U(G).getUint16(Y,!0)},put(G,Y,$){return U(G).setUint16(Y,$,!0),Y+2}},z={len:2,get(G,Y){return U(G).getUint16(Y)},put(G,Y,$){return U(G).setUint16(Y,$),Y+2}};var F={len:4,get(G,Y){return U(G).getUint32(Y,!0)},put(G,Y,$){return U(G).setUint32(Y,$,!0),Y+4}},F1={len:4,get(G,Y){return U(G).getUint32(Y)},put(G,Y,$){return U(G).setUint32(Y,$),Y+4}};var T1={len:4,get(G,Y){return U(G).getInt32(Y)},put(G,Y,$){return U(G).setInt32(Y,$),Y+4}};var S1={len:8,get(G,Y){return U(G).getBigUint64(Y,!0)},put(G,Y,$){return U(G).setBigUint64(Y,$,!0),Y+8}};class R{constructor(G,Y){this.len=G,this.encoding=Y}get(G,Y=0){let $=G.subarray(Y,Y+this.len);return x1($,this.encoding)}}class P extends Error{constructor(){super("End-Of-Stream");this.name="EndOfStreamError"}}class p extends Error{constructor(G="The operation was aborted"){super(G);this.name="AbortError"}}class l{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(G,Y=!1){let $=await this.read(G,Y);return this.peekQueue.push(G.subarray(0,$)),$}async read(G,Y=!1){if(G.length===0)return 0;let $=this.readFromPeekBuffer(G);if(!this.endOfStream)$+=await this.readRemainderFromStream(G.subarray($),Y);if($===0&&!Y)throw new P;return $}readFromPeekBuffer(G){let Y=G.length,$=0;while(this.peekQueue.length>0&&Y>0){let J=this.peekQueue.pop();if(!J)throw Error("peekData should be defined");let Q=Math.min(J.length,Y);if(G.set(J.subarray(0,Q),$),$+=Q,Y-=Q,Q<J.length)this.peekQueue.push(J.subarray(Q))}return $}async readRemainderFromStream(G,Y){let $=0;while($<G.length&&!this.endOfStream){if(this.interrupted)throw new p;let J=await this.readFromStream(G.subarray($),Y);if(J===0)break;$+=J}if(!Y&&$<G.length)throw new P;return $}}class X1 extends l{constructor(G){super();this.reader=G}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class Y1 extends X1{async readFromStream(G,Y){if(G.length===0)return 0;let $=await this.reader.read(new Uint8Array(G.length),{min:Y?void 0:G.length});if($.done)this.endOfStream=$.done;if($.value)return G.set($.value),$.value.length;return 0}}class o extends l{constructor(G){super();this.reader=G,this.buffer=null}writeChunk(G,Y){let $=Math.min(Y.length,G.length);if(G.set(Y.subarray(0,$)),$<Y.length)this.buffer=Y.subarray($);else this.buffer=null;return $}async readFromStream(G,Y){if(G.length===0)return 0;let $=0;if(this.buffer)$+=this.writeChunk(G,this.buffer);while($<G.length&&!this.endOfStream){let J=await this.reader.read();if(J.done){this.endOfStream=!0;break}if(J.value)$+=this.writeChunk(G.subarray($),J.value)}if(!Y&&$===0&&this.endOfStream)throw new P;return $}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}function _1(G){try{let Y=G.getReader({mode:"byob"});if(Y instanceof ReadableStreamDefaultReader)return new o(Y);return new Y1(Y)}catch(Y){if(Y instanceof TypeError)return new o(G.getReader());throw Y}}class S{constructor(G){if(this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=G?.onClose,G?.abortSignal)G.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(G,Y=this.position){let $=new Uint8Array(G.len);if(await this.readBuffer($,{position:Y})<G.len)throw new P;return G.get($,0)}async peekToken(G,Y=this.position){let $=new Uint8Array(G.len);if(await this.peekBuffer($,{position:Y})<G.len)throw new P;return G.get($,0)}async readNumber(G){if(await this.readBuffer(this.numBuffer,{length:G.len})<G.len)throw new P;return G.get(this.numBuffer,0)}async peekNumber(G){if(await this.peekBuffer(this.numBuffer,{length:G.len})<G.len)throw new P;return G.get(this.numBuffer,0)}async ignore(G){if(G<0)throw RangeError("ignore length must be \u2265 0 bytes");if(this.fileInfo.size!==void 0){let Y=this.fileInfo.size-this.position;if(G>Y)return this.position+=Y,Y}return this.position+=G,G}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(G,Y){if(!this.supportsRandomAccess()&&Y&&Y.position!==void 0&&Y.position<this.position)throw Error("`options.position` must be equal or greater than `tokenizer.position`");return{...{mayBeLess:!1,offset:0,length:G.length,position:this.position},...Y}}abort(){return Promise.resolve()}}var k0=256000;class w1 extends S{constructor(G,Y){super(Y);this.streamReader=G,this.fileInfo=Y?.fileInfo??{}}async readBuffer(G,Y){let $=this.normalizeOptions(G,Y),J=$.position-this.position;if(J>0)return await this.ignore(J),this.readBuffer(G,Y);if(J<0)throw Error("`options.position` must be equal or greater than `tokenizer.position`");if($.length===0)return 0;let Q=await this.streamReader.read(G.subarray(0,$.length),$.mayBeLess);if(this.position+=Q,(!Y||!Y.mayBeLess)&&Q<$.length)throw new P;return Q}async peekBuffer(G,Y){let $=this.normalizeOptions(G,Y),J=0;if($.position){let Q=$.position-this.position;if(Q>0){let Z=new Uint8Array($.length+Q);return J=await this.peekBuffer(Z,{mayBeLess:$.mayBeLess}),G.set(Z.subarray(Q)),J-Q}if(Q<0)throw Error("Cannot peek from a negative offset in a stream")}if($.length>0){try{J=await this.streamReader.peek(G.subarray(0,$.length),$.mayBeLess)}catch(Q){if(Y?.mayBeLess&&Q instanceof P)return 0;throw Q}if(!$.mayBeLess&&J<$.length)throw new P}return J}async ignore(G){if(G<0)throw RangeError("ignore length must be \u2265 0 bytes");let Y=Math.min(k0,G),$=new Uint8Array(Y),J=0;while(J<G){let Q=G-J,Z=await this.readBuffer($,{length:Math.min(Y,Q)});if(Z<0)return Z;J+=Z}return J}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}class N1 extends S{constructor(G,Y){super(Y);this.uint8Array=G,this.fileInfo={...Y?.fileInfo??{},...{size:G.length}}}async readBuffer(G,Y){if(Y?.position)this.position=Y.position;let $=await this.peekBuffer(G,Y);return this.position+=$,$}async peekBuffer(G,Y){let $=this.normalizeOptions(G,Y),J=Math.min(this.uint8Array.length-$.position,$.length);if(!$.mayBeLess&&J<$.length)throw new P;return G.set(this.uint8Array.subarray($.position,$.position+J)),J}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(G){this.position=G}}class O1 extends S{constructor(G,Y){super(Y);this.blob=G,this.fileInfo={...Y?.fileInfo??{},...{size:G.size,mimeType:G.type}}}async readBuffer(G,Y){if(Y?.position)this.position=Y.position;let $=await this.peekBuffer(G,Y);return this.position+=$,$}async peekBuffer(G,Y){let $=this.normalizeOptions(G,Y),J=Math.min(this.blob.size-$.position,$.length);if(!$.mayBeLess&&J<$.length)throw new P;let Q=await this.blob.slice($.position,$.position+J).arrayBuffer();return G.set(new Uint8Array(Q)),J}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(G){this.position=G}}function v1(G,Y){let $=_1(G),J=Y??{},Q=J.onClose;return J.onClose=async()=>{if(await $.close(),Q)return Q()},new w1($,J)}function h1(G,Y){return new N1(G,Y)}function z1(G,Y){return new O1(G,Y)}var i1=NG(u1(),1);var c={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},B1={get(G){return{signature:F.get(G,0),compressedSize:F.get(G,8),uncompressedSize:F.get(G,12)}},len:16},f1={get(G){let Y=X.get(G,6);return{signature:F.get(G,0),minVersion:X.get(G,4),dataDescriptor:!!(Y&8),compressedMethod:X.get(G,8),compressedSize:F.get(G,18),uncompressedSize:F.get(G,22),filenameLength:X.get(G,26),extraFieldLength:X.get(G,28),filename:null}},len:30},s1={get(G){return{signature:F.get(G,0),nrOfThisDisk:X.get(G,4),nrOfThisDiskWithTheStart:X.get(G,6),nrOfEntriesOnThisDisk:X.get(G,8),nrOfEntriesOfSize:X.get(G,10),sizeOfCd:F.get(G,12),offsetOfStartOfCd:F.get(G,16),zipFileCommentLength:X.get(G,20)}},len:22},o1={get(G){let Y=X.get(G,8);return{signature:F.get(G,0),minVersion:X.get(G,6),dataDescriptor:!!(Y&8),compressedMethod:X.get(G,10),compressedSize:F.get(G,20),uncompressedSize:F.get(G,24),filenameLength:X.get(G,28),extraFieldLength:X.get(G,30),fileCommentLength:X.get(G,32),relativeOffsetOfLocalHeader:F.get(G,42),filename:null}},len:46};function n1(G){let Y=new Uint8Array(F.len);return F.put(Y,0,G),Y}var x=i1.default("tokenizer:inflate"),D1=262144,OG=n1(c.DataDescriptor),q1=n1(c.EndOfCentralDirectory);class b{constructor(G){this.tokenizer=G,this.syncBuffer=new Uint8Array(D1)}async isZip(){return await this.peekSignature()===c.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(F)}async findEndOfCentralDirectoryLocator(){let G=this.tokenizer,Y=Math.min(16384,G.fileInfo.size),$=this.syncBuffer.subarray(0,Y);await this.tokenizer.readBuffer($,{position:G.fileInfo.size-Y});for(let J=$.length-4;J>=0;J--)if($[J]===q1[0]&&$[J+1]===q1[1]&&$[J+2]===q1[2]&&$[J+3]===q1[3])return G.fileInfo.size-Y+J;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){x("Cannot reading central-directory without random-read support");return}x("Reading central-directory...");let G=this.tokenizer.position,Y=await this.findEndOfCentralDirectoryLocator();if(Y>0){x("Central-directory 32-bit signature found");let $=await this.tokenizer.readToken(s1,Y),J=[];this.tokenizer.setPosition($.offsetOfStartOfCd);for(let Q=0;Q<$.nrOfEntriesOfSize;++Q){let Z=await this.tokenizer.readToken(o1);if(Z.signature!==c.CentralFileHeader)throw Error("Expected Central-File-Header signature");Z.filename=await this.tokenizer.readToken(new R(Z.filenameLength,"utf-8")),await this.tokenizer.ignore(Z.extraFieldLength),await this.tokenizer.ignore(Z.fileCommentLength),J.push(Z),x(`Add central-directory file-entry: n=${Q+1}/${J.length}: filename=${J[Q].filename}`)}return this.tokenizer.setPosition(G),J}this.tokenizer.setPosition(G)}async unzip(G){let Y=await this.readCentralDirectory();if(Y)return this.iterateOverCentralDirectory(Y,G);let $=!1;do{let J=await this.readLocalFileHeader();if(!J)break;let Q=G(J);$=!!Q.stop;let Z;if(await this.tokenizer.ignore(J.extraFieldLength),J.dataDescriptor&&J.compressedSize===0){let q=[],M=D1;x("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let V=-1;while(V<0&&M===D1){M=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),V=RG(this.syncBuffer.subarray(0,M),OG);let W=V>=0?V:M;if(Q.handler){let K=new Uint8Array(W);await this.tokenizer.readBuffer(K),q.push(K)}else await this.tokenizer.ignore(W)}if(x(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),Q.handler)await this.inflate(J,IG(q),Q.handler)}else if(Q.handler)x(`Reading compressed-file-data: ${J.compressedSize} bytes`),Z=new Uint8Array(J.compressedSize),await this.tokenizer.readBuffer(Z),await this.inflate(J,Z,Q.handler);else x(`Ignoring compressed-file-data: ${J.compressedSize} bytes`),await this.tokenizer.ignore(J.compressedSize);if(x(`Reading data-descriptor at pos=${this.tokenizer.position}`),J.dataDescriptor){if((await this.tokenizer.readToken(B1)).signature!==134695760)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-B1.len}`)}}while(!$)}async iterateOverCentralDirectory(G,Y){for(let $ of G){let J=Y($);if(J.handler){this.tokenizer.setPosition($.relativeOffsetOfLocalHeader);let Q=await this.readLocalFileHeader();if(Q){await this.tokenizer.ignore(Q.extraFieldLength);let Z=new Uint8Array($.compressedSize);await this.tokenizer.readBuffer(Z),await this.inflate(Q,Z,J.handler)}}if(J.stop)break}}async inflate(G,Y,$){if(G.compressedMethod===0)return $(Y);if(G.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${G.compressedMethod}`);x(`Decompress filename=${G.filename}, compressed-size=${Y.length}`);let J=await b.decompressDeflateRaw(Y);return $(J)}static async decompressDeflateRaw(G){let Y=new ReadableStream({start(Q){Q.enqueue(G),Q.close()}}),$=new DecompressionStream("deflate-raw"),J=Y.pipeThrough($);try{let Z=await new Response(J).arrayBuffer();return new Uint8Array(Z)}catch(Q){let Z=Q instanceof Error?`Failed to deflate ZIP entry: ${Q.message}`:"Unknown decompression error in ZIP entry";throw TypeError(Z)}}async readLocalFileHeader(){let G=await this.tokenizer.peekToken(F);if(G===c.LocalFileHeader){let Y=await this.tokenizer.readToken(f1);return Y.filename=await this.tokenizer.readToken(new R(Y.filenameLength,"utf-8")),Y}if(G===c.CentralFileHeader)return!1;if(G===3759263696)throw Error("Encrypted ZIP");throw Error("Unexpected signature")}}function RG(G,Y){let $=G.length,J=Y.length;if(J>$)return-1;for(let Q=0;Q<=$-J;Q++){let Z=!0;for(let q=0;q<J;q++)if(G[Q+q]!==Y[q]){Z=!1;break}if(Z)return Q}return-1}function IG(G){let Y=G.reduce((Q,Z)=>Q+Z.length,0),$=new Uint8Array(Y),J=0;for(let Q of G)$.set(Q,J),J+=Q.length;return $}class M1{constructor(G){this.tokenizer=G}inflate(){let G=this.tokenizer;return new ReadableStream({async pull(Y){let $=new Uint8Array(1024),J=await G.readBuffer($,{mayBeLess:!0});if(J===0){Y.close();return}Y.enqueue($.subarray(0,J))}}).pipeThrough(new DecompressionStream("gzip"))}}var UG=Object.prototype.toString;function BG(G,Y,$){if(!G)return!1;if(G.constructor===Y)return!0;return UG.call(G)===$}function DG(G){return BG(G,Uint8Array,"[object Uint8Array]")}function AG(G){if(!DG(G))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof G}\``)}function a1(G,Y){if(G.length===0)return new Uint8Array(0);Y??=G.reduce((Q,Z)=>Q+Z.length,0);let $=new Uint8Array(Y),J=0;for(let Q of G)AG(Q),$.set(Q,J),J+=Q.length;return $}var j$={utf8:new globalThis.TextDecoder("utf8")};var P$=new globalThis.TextEncoder;var F$=Array.from({length:256},(G,Y)=>Y.toString(16).padStart(2,"0"));function A1(G){let{byteLength:Y}=G;if(Y===6)return G.getUint16(0)*4294967296+G.getUint32(2);if(Y===5)return G.getUint8(0)*4294967296+G.getUint32(1);if(Y===4)return G.getUint32(0);if(Y===3)return G.getUint8(0)*65536+G.getUint16(1);if(Y===2)return G.getUint16(0);if(Y===1)return G.getUint8(0)}function t1(G,Y){if(Y==="utf-16le"){let $=[];for(let J=0;J<G.length;J++){let Q=G.charCodeAt(J);$.push(Q&255,Q>>8&255)}return $}if(Y==="utf-16be"){let $=[];for(let J=0;J<G.length;J++){let Q=G.charCodeAt(J);$.push(Q>>8&255,Q&255)}return $}return[...G].map(($)=>$.charCodeAt(0))}function r1(G,Y=0){let $=Number.parseInt(new R(6).get(G,148).replace(/\0.*$/v,"").trim(),8);if(Number.isNaN($))return!1;let J=256;for(let Q=Y;Q<Y+148;Q++)J+=G[Q];for(let Q=Y+156;Q<Y+512;Q++)J+=G[Q];return $===J}var e1={get:(G,Y)=>G[Y+3]&127|(G[Y+2]&127)<<7|(G[Y+1]&127)<<14|(G[Y]&127)<<21,len:4};var G0=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat","key","numbers","pages"],Y0=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x-ms-shortcut","application/x-ft-apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x-ft-fbx","application/vnd.visio","application/vnd.android.package-archive","application/x-ft-draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data","application/vnd.apple.keynote","application/vnd.apple.numbers","application/vnd.apple.pages"];var B=16777216;class C extends Error{}function V1(G,Y,$){if(!Number.isFinite(G)||G<0||G>Y)throw new C(`${$} has invalid size ${G} (maximum ${Y} bytes)`);return G}async function D(G,Y,{maximumLength:$=16777216,reason:J="skip"}={}){let Q=V1(Y,$,J);await G.ignore(Q)}async function a(G,Y,$,{maximumLength:J=Y.length,reason:Q="read"}={}){let Z=$?.length??Y.length,q=V1(Z,J,Q);return G.readBuffer(Y,{...$,length:q})}function H(G,Y,$){$={offset:0,...$};for(let[J,Q]of Y.entries())if($.mask){if(Q!==($.mask[J]&G[J+$.offset]))return!1}else if(Q!==G[J+$.offset])return!1;return!0}function w(G){let Y=G.fileInfo.size;return!Number.isFinite(Y)||Y===Number.MAX_SAFE_INTEGER}function E(G,Y,$){return w(G)&&G.position-Y>$}var T=1048576,$0=1024,CG=2147483647,J0=T,HG=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),LG=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],xG=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]);async function EG(G,{maximumLength:Y=T}={}){let Q=new ReadableStream({start(W){W.enqueue(G),W.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),Z=[],q=0;try{for(;;){let{done:W,value:K}=await Q.read();if(W)break;if(q+=K.length,q>Y)throw await Q.cancel(),Error(`ZIP entry decompressed data exceeds ${Y} bytes`);Z.push(K)}}finally{Q.releaseLock()}let M=new Uint8Array(q),V=0;for(let W of Z)M.set(W,V),V+=W.length;return M}function TG(G,Y){let $=new Uint8Array(Y),J=0;for(let Q of G)$.set(Q,J),J+=Q.length;return $}function SG(G){let Y=G.fileInfo.size,$=Number.isFinite(Y)?Math.max(0,Y-G.position):Number.MAX_SAFE_INTEGER;return Math.min($,CG)}function vG(G){if(G instanceof P)return!0;if(G instanceof C)return!0;if(!(G instanceof Error))return!1;if(HG.has(G.message))return!0;if(xG.has(G.code))return!0;for(let Y of LG)if(G.message.startsWith(Y))return!0;return!1}function Q0(G,Y=T){let $=[G.compressedSize,G.uncompressedSize];for(let J of $)if(!Number.isFinite(J)||J<0||J>Y)return!1;return!0}function hG(){return{hasDocumentEntry:!1,hasMasterSlideEntry:!1,hasTablesEntry:!1,hasCalculationEngineEntry:!1}}function zG(G,Y){if(Y==="Index/Document.iwa")G.hasDocumentEntry=!0;if(Y.startsWith("Index/MasterSlide"))G.hasMasterSlideEntry=!0;if(Y.startsWith("Index/Tables/"))G.hasTablesEntry=!0;if(Y==="Index/CalculationEngine.iwa")G.hasCalculationEngineEntry=!0}function Z0(G){if(!G.hasDocumentEntry)return;if(G.hasMasterSlideEntry)return{ext:"key",mime:"application/vnd.apple.keynote"};if(G.hasTablesEntry)return{ext:"numbers",mime:"application/vnd.apple.numbers"};return{ext:"pages",mime:"application/vnd.apple.pages"}}function K0(G){switch(G=G.toLowerCase(),G){case"application/epub+zip":return{ext:"epub",mime:G};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:G};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:G};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:G};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:G};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:G};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:G};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:G};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:G};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:G};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:G};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:G};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:G};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:G};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:G};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:G};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function gG(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function kG(G,Y){if(Y.startsWith("word/"))G.hasWordDirectory=!0;if(Y.startsWith("ppt/"))G.hasPresentationDirectory=!0;if(Y.startsWith("xl/"))G.hasSpreadsheetDirectory=!0;if(Y.startsWith("3D/")&&Y.endsWith(".model"))G.hasThreeDimensionalModelEntry=!0}function M0(G){if(G.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(G.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(G.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(G.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}function q0(G){if(!G.hasContentTypesEntry||G.hasUnparseableContentTypes||G.isParsingContentTypes||G.hasParsedContentTypesEntry)return;return M0(G)}function cG(G){let Y=G.indexOf('.main+xml"');if(Y===-1){if(G.includes('ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"'))return"application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return}let $=G.slice(0,Y),J=$.lastIndexOf('"');return $.slice(J+1)}var V0=134695760,W1=16,bG=W1-1;function yG(G,Y){if(G.length<W1)return-1;let $=G.length-W1;for(let J=0;J<=$;J++)if(F.get(G,J)===V0&&F.get(G,J+8)===Y+J)return J;return-1}async function mG(G,{shouldBuffer:Y,maximumLength:$=T}={}){let{syncBuffer:J}=G,{length:Q}=J,Z=[],q=0;for(;;){let M=await G.tokenizer.peekBuffer(J,{mayBeLess:!0}),V=yG(J.subarray(0,M),q),W=V>=0?0:M===Q?Math.min(bG,M-1):0,K=V>=0?V:M-W;if(K===0)break;if(q+=K,q>$)throw Error(`ZIP entry compressed data exceeds ${$} bytes`);if(Y){let j=new Uint8Array(K);await G.tokenizer.readBuffer(j),Z.push(j)}else await G.tokenizer.ignore(K);if(V>=0)break}if(!w(G.tokenizer))G.knownSizeDescriptorScannedBytes+=q;if(!Y)return;return TG(Z,q)}function pG(G,Y){if(w(G.tokenizer))return Math.max(0,B-(G.tokenizer.position-Y));return Math.max(0,T-G.knownSizeDescriptorScannedBytes)}async function lG(G,Y,{shouldBuffer:$,maximumDescriptorLength:J=T}={}){if(Y.dataDescriptor&&Y.compressedSize===0)return mG(G,{shouldBuffer:$,maximumLength:J});if(!$){await D(G.tokenizer,Y.compressedSize,{maximumLength:w(G.tokenizer)?T:G.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let Q=SG(G.tokenizer);if(!Number.isFinite(Y.compressedSize)||Y.compressedSize<0||Y.compressedSize>Q)throw Error(`ZIP entry compressed data exceeds ${Q} bytes`);let Z=new Uint8Array(Y.compressedSize);return await G.tokenizer.readBuffer(Z),Z}b.prototype.inflate=async function(G,Y,$){if(G.compressedMethod===0)return $(Y);if(G.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${G.compressedMethod}`);let J=await EG(Y,{maximumLength:T});return $(J)};b.prototype.unzip=async function(G){let Y=!1,$=0,J=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(E(this.tokenizer,J,B))throw new C(`ZIP stream probing exceeds ${B} bytes`);let Q=await this.readLocalFileHeader();if(!Q)break;if($++,$>$0)throw Error(`ZIP entry count exceeds ${$0}`);let Z=G(Q);Y=Boolean(Z.stop),await this.tokenizer.ignore(Q.extraFieldLength);let q=await lG(this,Q,{shouldBuffer:Boolean(Z.handler),maximumDescriptorLength:Math.min(T,pG(this,J))});if(Z.handler)await this.inflate(Q,q,Z.handler);if(Q.dataDescriptor){let M=new Uint8Array(W1);if(await this.tokenizer.readBuffer(M),F.get(M,0)!==V0)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-M.length}`)}if(E(this.tokenizer,J,B))throw new C(`ZIP stream probing exceeds ${B} bytes`)}while(!Y)};async function W0(G){let Y,$=gG(),J=hG();try{await new b(G).unzip((Z)=>{if(kG($,Z.filename),zG(J,Z.filename),J.hasDocumentEntry&&(J.hasMasterSlideEntry||J.hasTablesEntry))return Y=Z0(J),{stop:!0};let q=Z.filename==="[Content_Types].xml",M=q0($);if(!q&&M)return Y=M,{stop:!0};switch(Z.filename){case"META-INF/mozilla.rsa":return Y={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return Y={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":if(!Q0(Z,J0))return{};return{async handler(V){let W=new TextDecoder("utf-8").decode(V).trim();Y=K0(W)},stop:!0};case"[Content_Types].xml":{if($.hasContentTypesEntry=!0,!Q0(Z,J0))return $.hasUnparseableContentTypes=!0,{};return $.isParsingContentTypes=!0,{async handler(V){let W=new TextDecoder("utf-8").decode(V),K=cG(W);if(K)Y=K0(K);$.hasParsedContentTypesEntry=!0,$.isParsingContentTypes=!1},stop:!0}}default:if(/classes\d*\.dex/v.test(Z.filename))return Y={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0};return{}}})}catch(Z){if(!vG(Z))throw Z;if($.isParsingContentTypes)$.isParsingContentTypes=!1,$.hasUnparseableContentTypes=!0;if(!Y&&Z instanceof P&&!$.hasContentTypesEntry)Y=M0($)}let Q=w(G)&&J.hasDocumentEntry&&!J.hasMasterSlideEntry&&!J.hasTablesEntry&&!J.hasCalculationEngineEntry?void 0:Z0(J);return Y??q0($)??Q??{ext:"zip",mime:"application/zip"}}var j0=64,P0=1048576,dG=256;async function F0(G){async function Y(){let M=await G.peekNumber(E1),V=128,W=0;while((M&V)===0&&V!==0)++W,V>>=1;let K=new Uint8Array(W+1);return await a(G,K,void 0,{maximumLength:K.length,reason:"EBML field"}),K}async function $(){let M=await Y(),V=await Y();V[0]^=128>>V.length-1;let W=Math.min(6,V.length),K=new DataView(M.buffer),j=new DataView(V.buffer,V.length-W,W);return{id:A1(K),len:A1(j)}}async function J(M){let V=0;while(M>0){if(V++,V>dG)return;if(E(G,Z,B))return;let W=G.position,K=await $();if(K.id===17026){if(K.len>j0)return;let j=V1(K.len,j0,"EBML DocType");return(await G.readToken(new R(j))).replaceAll(/\0.*$/gv,"")}if(w(G)&&(!Number.isFinite(K.len)||K.len<0||K.len>P0))return;if(await D(G,K.len,{maximumLength:w(G)?P0:G.fileInfo.size,reason:"EBML payload"}),--M,G.position<=W)return}}let Q=await $(),Z=G.position;switch(await J(Q.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:}}var uG=512,fG=16777216,X0=1048576;function sG(G){return(G.codePointAt(0)&32)!==0}async function _0(G){let Y={ext:"png",mime:"image/png"},$={ext:"apng",mime:"image/apng"};await G.ignore(8);async function J(){return{length:await G.readToken(T1),type:await G.readToken(new R(4,"latin1"))}}let Q=w(G),Z=G.position,q=0,M=!1;do{if(q++,q>uG)break;if(E(G,Z,fG))break;let V=G.position,W=await J();if(W.length<0)return;if(W.type==="IHDR"){if(W.length!==13)return;M=!0}switch(W.type){case"IDAT":return Y;case"acTL":return $;default:if(!M&&W.type!=="CgBI")return;if(Q&&W.length>X0)return M&&sG(W.type)?Y:void 0;try{await D(G,W.length+4,{maximumLength:Q?X0+4:G.fileInfo.size,reason:"PNG chunk payload"})}catch(K){if(!Q&&(K instanceof C||K instanceof P))return Y;throw K}}if(G.position<=V)break}while(G.position+8<G.fileInfo.size);return Y}var oG=512,w0=1048576;async function N0(G){let Y=!1;try{async function $(){let q=new Uint8Array(16);return await a(G,q,void 0,{maximumLength:q.length,reason:"ASF header GUID"}),{id:q,size:Number(await G.readToken(S1))}}await D(G,30,{maximumLength:30,reason:"ASF header prelude"});let J=w(G),Q=G.position,Z=0;while(G.position+24<G.fileInfo.size){if(Z++,Z>oG)break;if(E(G,Q,B))break;let q=G.position,M=await $(),V=M.size-24;if(!Number.isFinite(V)||V<0){Y=!0;break}if(H(M.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let W=new Uint8Array(16);if(V-=await a(G,W,void 0,{maximumLength:W.length,reason:"ASF stream type GUID"}),H(W,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(H(W,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(J&&V>w0){Y=!0;break}if(await D(G,V,{maximumLength:J?w0:G.fileInfo.size,reason:"ASF header payload"}),G.position<=q){Y=!0;break}}}catch($){if($ instanceof P||$ instanceof C){if(w(G))Y=!0}else throw $}if(Y)return;return{ext:"asf",mime:"application/vnd.ms-asf"}}var t=4100,iG=t-2,nG=B,aG=1,O0=100,C1=B,tG=512,R0=256,rG=1048576,I0=B;function eG(G){if(!Number.isFinite(G))return t;return Math.max(1,Math.trunc(G))}function GY(G){if(!Number.isFinite(G))return 0;return Math.max(0,Math.min(iG,Math.trunc(G)))}function YY(G){if(!Number.isFinite(G))return Number.MAX_SAFE_INTEGER;return Math.max(0,G)}function U0(G){return import(G)}function $Y(G){return G.pipeThrough(new TransformStream)}function B0(G,Y){if(Y===void 0)return G.read();return Y.throwIfAborted(),Promise.race([G.read(),new Promise(($,J)=>{Y.addEventListener("abort",()=>{J(Y.reason),G.cancel(Y.reason).catch(()=>{})},{once:!0})})])}function JY(G,Y){let $=G.getReader(),J=0,Q=!1,Z=!1,q=async(M)=>{if(Q||Z)return;Z=!0,await $.cancel(M)};return new ReadableStream({async pull(M){if(J>=Y){M.close(),await q();return}let{done:V,value:W}=await $.read();if(V||!W){Q=!0,M.close();return}let K=Y-J;if(W.length>K){M.enqueue(W.subarray(0,K)),J+=K,M.close(),await q();return}M.enqueue(W),J+=W.length},async cancel(M){await q(M)}})}async function b$(G,Y){return new v(Y).fromStream(G)}async function y$(G,Y){return new v(Y).fromBuffer(G)}async function m$(G,Y){return new v(Y).fromBlob(G)}async function p$(G,Y){return new v(Y).fromTokenizer(G)}async function l$(G,Y){return new v(Y).toDetectionStream(G,Y)}class v{constructor(G){let Y=GY(G?.mpegOffsetTolerance);this.options={...G,mpegOffsetTolerance:Y},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(G){return v1($Y(G),this.getTokenizerOptions())}async parseTokenizer(G,Y=0){this.detectionReentryCount=Y;let $=G.position;for(let J of this.detectors){let Q;try{Q=await J.detect(G)}catch(Z){if(Z instanceof P)return;if(Z instanceof C)return;throw Z}if(Q)return Q;if($!==G.position)return}}async fromTokenizer(G){try{return await this.parseTokenizer(G)}finally{await G.close()}}async fromBuffer(G){if(!(G instanceof Uint8Array||G instanceof ArrayBuffer))throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof G}\``);let Y=G instanceof Uint8Array?G:new Uint8Array(G);if(!(Y?.length>1))return;return this.fromTokenizer(h1(Y,this.getTokenizerOptions()))}async fromBlob(G){this.options.signal?.throwIfAborted();let Y=z1(G,this.getTokenizerOptions());return this.fromTokenizer(Y)}async fromStream(G){this.options.signal?.throwIfAborted();let Y=this.createTokenizerFromWebStream(G);return this.fromTokenizer(Y)}async fromFile(G){this.options.signal?.throwIfAborted();let[{default:Y},{FileTokenizer:$}]=await Promise.all([U0("node:fs/promises"),U0("strtok3")]),J=await Y.open(G,Y.constants.O_RDONLY|Y.constants.O_NONBLOCK),Q=await J.stat();if(!Q.isFile()){await J.close();return}let Z=new $(J,{...this.getTokenizerOptions(),fileInfo:{path:G,size:Q.size}});return this.fromTokenizer(Z)}async toDetectionStream(G,Y){this.options.signal?.throwIfAborted();let $=eG(Y?.sampleSize??t),J,Q=!1,Z=G.getReader(),q=[],M=0;try{while(M<$){let{value:K,done:j}=await B0(Z,this.options.signal);if(j||!K){Q=!0;break}q.push(K),M+=K.length}if(!Q&&M===$){let{value:K,done:j}=await B0(Z,this.options.signal);if(j||!K)Q=!0;else q.push(K),M+=K.length}}finally{Z.releaseLock()}if(M>0){let K=q.length===1?q[0]:a1(q);try{J=await this.fromBuffer(K.subarray(0,$))}catch(j){if(!(j instanceof P))throw j;J=void 0}if(!Q&&J?.ext==="pages")J={ext:"zip",mime:"application/zip"}}let V=new TransformStream({start(K){for(let j of q)K.enqueue(j)},transform(K,j){j.enqueue(K)}}),W=G.pipeThrough(V);return W.fileType=J,W}async detectGzip(G){if(this.gzipProbeDepth>=aG)return{ext:"gz",mime:"application/gzip"};let Y=new M1(G),$=JY(Y.inflate(),nG),J=w(G),Q,Z,q,M;if(J){let V=new AbortController;Q=setTimeout(()=>{V.abort(new DOMException(`Operation timed out after ${O0} ms`,"TimeoutError"))},O0),Z=this.options.signal===void 0?V.signal:AbortSignal.any([this.options.signal,V.signal]),q=new v({...this.options,signal:Z}),q.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{M=await(q??this).fromStream($)}catch(V){if(V?.name==="AbortError"&&Z?.reason?.name!=="TimeoutError")throw V}finally{if(clearTimeout(Q),!J)this.gzipProbeDepth--}if(M?.ext==="tar")return{ext:"tar.gz",mime:"application/gzip"};return{ext:"gz",mime:"application/gzip"}}check(G,Y){return H(this.buffer,G,Y)}checkString(G,Y){return this.check(t1(G,Y?.encoding),Y)}detectConfident=async(G)=>{if(this.buffer=new Uint8Array(t),G.fileInfo.size===void 0)G.fileInfo.size=Number.MAX_SAFE_INTEGER;if(this.tokenizer=G,w(G)){if(await G.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8]))return this.detectGzip(G)}if(await G.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33])){if(await G.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14}))return{ext:"eps",mime:"application/eps"};return{ext:"ps",mime:"application/postscript"}}if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191])){if(this.detectionReentryCount>=R0)return;return this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(G)}if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(G);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await D(G,6,{maximumLength:6,reason:"ID3 header prefix"});let Y=await G.readToken(e1),$=w(G);if(!Number.isFinite(Y)||Y<0||$&&(Y>C1||G.position+Y>C1))return;if(G.position+Y>G.fileInfo.size){if($)return;return{ext:"mp3",mime:"audio/mpeg"}}try{await D(G,Y,{maximumLength:$?C1:G.fileInfo.size,reason:"ID3 payload"})}catch(J){if(J instanceof P)return;throw J}if(this.detectionReentryCount>=R0)return;return this.detectionReentryCount++,this.parseTokenizer(G,this.detectionReentryCount)}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255])){if(this.check([247],{offset:3}))return{ext:"jls",mime:"image/jls"};return{ext:"jpg",mime:"image/jpeg"}}if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4]))return W0(G);if(this.checkString("OggS")){await G.ignore(28);let Y=new Uint8Array(8);if(await G.readBuffer(Y),H(Y,[79,112,117,115,72,101,97,100]))return{ext:"opus",mime:"audio/ogg; codecs=opus"};if(H(Y,[128,116,104,101,111,114,97]))return{ext:"ogv",mime:"video/ogg"};if(H(Y,[1,118,105,100,101,111,0]))return{ext:"ogm",mime:"video/ogg"};if(H(Y,[127,70,76,65,67]))return{ext:"oga",mime:"audio/ogg"};if(H(Y,[83,112,101,101,120,32,32]))return{ext:"spx",mime:"audio/ogg"};if(H(Y,[1,118,111,114,98,105,115]))return{ext:"ogg",mime:"audio/ogg"};return{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let Y=await this.readTiffHeader(!1);if(Y)return Y}if(this.check([77,77])){let Y=await this.readTiffHeader(!0);if(Y)return Y}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163]))return F0(G);if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString(String.raw`{\rtf`))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let Y=F1.get(this.buffer,4),$=z.get(this.buffer,6);if(Y>0&&Y<=30)return{ext:"macho",mime:"application/x-mach-binary"};if($>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/x-ft-draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let Y=new R(4,"latin1").get(this.buffer,2);if(/^\d+$/v.test(Y)&&Y>=1000&&Y<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){if(await G.ignore(8),await G.readToken(new R(13,"ascii"))==="debian-binary")return{ext:"deb",mime:"application/x-deb"};return{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&[`
7
+ `,"\r","\t"," ","\x00"].some((Y)=>this.checkString(Y,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10]))return _0(G);if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let Y=new R(4,"latin1").get(this.buffer,8).replace("\x00"," ").trim();switch(Y){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:if(Y.startsWith("3g")){if(Y.startsWith("3g2"))return{ext:"3g2",mime:"video/3gpp2"};return{ext:"3gp",mime:"video/3gpp"}}return{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
8
+ `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217]))return N0(G);if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await G.ignore(20),await G.readToken(new R(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255])){if(this.checkString("<?xml ",{offset:2,encoding:"utf-16be"}))return{ext:"xml",mime:"application/xml"};return}if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await G.peekBuffer(this.buffer,{length:Math.min(256,G.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let Y=new DataView(this.buffer.buffer).getUint32(12,!0);if(Y>12&&this.buffer.length>=Y+16)try{let $=new TextDecoder().decode(this.buffer.subarray(16,Y+16));if(JSON.parse($).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x-ms-shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x-ft-apple.alias"};if(this.checkString("Kaydara FBX Binary \x00"))return{ext:"fbx",mime:"application/x-ft-fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await G.peekBuffer(this.buffer,{length:Math.min(512,G.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\x00",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&r1(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){if(this.checkString("<?xml ",{offset:2,encoding:"utf-16le"}))return{ext:"xml",mime:"application/xml"};if(this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:"utf-16le"}))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString(`Windows Registry Editor Version 5.00\r
9
+ `,{offset:2,encoding:"utf-16le"}))return{ext:"reg",mime:"application/x-ms-regedit"};return}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async(G)=>{this.buffer=new Uint8Array(t);let Y=YY(G.fileInfo.size);if(await G.peekBuffer(this.buffer,{length:Math.min(8,Y),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await G.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,Y),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let $=0;$<=this.options.mpegOffsetTolerance;++$){let J=this.scanMpeg($);if(J)return J}};async readTiffTag(G){let Y=await this.tokenizer.readToken(G?z:X);switch(await this.tokenizer.ignore(10),Y){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(G){let Y=await this.tokenizer.readToken(G?z:X);if(Y>tG)return;if(w(this.tokenizer)&&2+Y*12>I0)return;for(let $=0;$<Y;++$){let J=await this.readTiffTag(G);if(J)return J}}async readTiffHeader(G){let Y={ext:"tif",mime:"image/tiff"},$=(G?z:X).get(this.buffer,2),J=(G?F1:F).get(this.buffer,4);if($===42){if(J>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(J>=8){let q=(G?z:X).get(this.buffer,8),M=(G?z:X).get(this.buffer,10);if(q===28&&M===254||q===31&&M===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(w(this.tokenizer)&&J>rG)return Y;let Q=w(this.tokenizer)?I0:this.tokenizer.fileInfo.size;try{await D(this.tokenizer,J,{maximumLength:Q,reason:"TIFF IFD offset"})}catch(q){if(q instanceof P)return;throw q}let Z;try{Z=await this.readTiffIFD(G)}catch(q){if(q instanceof P)return;throw q}return Z??Y}if($===43)return Y}scanMpeg(G){if(this.check([255,224],{offset:G,mask:[255,224]})){if(this.check([16],{offset:G+1,mask:[22]})){if(this.check([8],{offset:G+1,mask:[8]}))return{ext:"aac",mime:"audio/aac"};return{ext:"aac",mime:"audio/aac"}}if(this.check([2],{offset:G+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:G+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:G+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}var d$=new Set(G0),u$=new Set(Y0);async function f$(G,Y){return new v(Y).fromFile(G)}export{u$ as supportedMimeTypes,d$ as supportedExtensions,t as reasonableDetectionSizeInBytes,eG as normalizeSampleSize,l$ as fileTypeStream,p$ as fileTypeFromTokenizer,b$ as fileTypeFromStream,f$ as fileTypeFromFile,y$ as fileTypeFromBuffer,m$ as fileTypeFromBlob,v as FileTypeParser};