@omer-x/buttler 0.5.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -0
- package/drizzle/{0000_illegal_mattie_franklin.sql → 0000_bored_night_thrasher.sql} +31 -5
- package/drizzle/meta/0000_snapshot.json +190 -12
- package/drizzle/meta/_journal.json +2 -2
- package/package.json +27 -25
- package/ui/.next/BUILD_ID +1 -1
- package/ui/.next/app-build-manifest.json +68 -52
- package/ui/.next/app-path-routes-manifest.json +1 -1
- package/ui/.next/build-manifest.json +13 -13
- package/ui/.next/prerender-manifest.json +1 -1
- package/ui/.next/react-loadable-manifest.json +192 -192
- package/ui/.next/required-server-files.json +1 -1
- package/ui/.next/routes-manifest.json +1 -1
- package/ui/.next/server/app/_not-found/page.js +1 -1
- package/ui/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/_not-found.html +1 -1
- package/ui/.next/server/app/_not-found.rsc +9 -9
- package/ui/.next/server/app/api/db/backup/route.js +1 -0
- package/ui/.next/server/app/api/db/backup/route.js.nft.json +1 -0
- package/ui/.next/server/app/api/logs/route.js +1 -1
- package/ui/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/ui/.next/server/app/index.html +1 -1
- package/ui/.next/server/app/index.rsc +9 -9
- package/ui/.next/server/app/page.js +1 -1
- package/ui/.next/server/app/page.js.nft.json +1 -1
- package/ui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/services/[id]/databases/page.js +1 -0
- package/ui/.next/server/app/services/[id]/databases/page.js.nft.json +1 -0
- package/ui/.next/server/app/services/[id]/databases/page_client-reference-manifest.js +1 -0
- package/ui/.next/server/app/services/[id]/edit/page.js +1 -22
- package/ui/.next/server/app/services/[id]/edit/page.js.nft.json +1 -1
- package/ui/.next/server/app/services/[id]/edit/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/services/[id]/page.js +1 -1
- package/ui/.next/server/app/services/[id]/page.js.nft.json +1 -1
- package/ui/.next/server/app/services/[id]/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/services/page.js +1 -1
- package/ui/.next/server/app/services/page.js.nft.json +1 -1
- package/ui/.next/server/app/services/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/settings/page.js +1 -1
- package/ui/.next/server/app/settings/page.js.nft.json +1 -1
- package/ui/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/ui/.next/server/app/settings.html +1 -1
- package/ui/.next/server/app/settings.rsc +19 -13
- package/ui/.next/server/app/webhook/route.js +1 -1
- package/ui/.next/server/app/webhook/route.js.nft.json +1 -1
- package/ui/.next/server/app-paths-manifest.json +3 -1
- package/ui/.next/server/chunks/116.js +13 -0
- package/ui/.next/server/chunks/269.js +2 -0
- package/ui/.next/server/chunks/361.js +1 -0
- package/ui/.next/server/chunks/549.js +1 -0
- package/ui/.next/server/chunks/659.js +1 -0
- package/ui/.next/server/chunks/681.js +1 -0
- package/ui/.next/server/chunks/682.js +1 -1
- package/ui/.next/server/chunks/719.js +1 -0
- package/ui/.next/server/chunks/863.js +1 -0
- package/ui/.next/server/chunks/871.js +2 -0
- package/ui/.next/server/chunks/902.js +13 -0
- package/ui/.next/server/chunks/948.js +2 -2
- package/ui/.next/server/edge-instrumentation.js +1 -1
- package/ui/.next/server/instrumentation.js +1 -1
- package/ui/.next/server/middleware-build-manifest.js +1 -1
- package/ui/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/ui/.next/server/pages/404.html +1 -1
- package/ui/.next/server/pages/500.html +1 -1
- package/ui/.next/server/pages/_document.js +1 -1
- package/ui/.next/server/pages/_error.js +1 -1
- package/ui/.next/server/pages-manifest.json +1 -1
- package/ui/.next/server/server-reference-manifest.js +1 -1
- package/ui/.next/server/server-reference-manifest.json +1 -1
- package/ui/.next/static/chunks/117-3b8d34fa94485032.js +2 -0
- package/ui/.next/static/chunks/146-5b9462531053a4c5.js +1 -0
- package/ui/.next/static/chunks/303-c65efd1cc09d56fd.js +1 -0
- package/ui/.next/static/chunks/355-1e51ac955ff8955f.js +1 -0
- package/ui/.next/static/chunks/391-496467ca6f95afde.js +1 -0
- package/ui/.next/static/chunks/392-27b37c7f04898266.js +1 -0
- package/ui/.next/static/chunks/581-2e3e69ca13e0474f.js +1 -0
- package/ui/.next/static/chunks/734-02b6331f3bd9c318.js +1 -0
- package/ui/.next/static/chunks/857-f888440b100832b8.js +1 -0
- package/ui/.next/static/chunks/app/_not-found/{page-9bc2013f97c28031.js → page-31d3ea3db635cbc2.js} +1 -1
- package/ui/.next/static/chunks/app/layout-dd91aec6218093d2.js +1 -0
- package/ui/.next/static/chunks/app/page-6b7dd63af3dd45de.js +1 -0
- package/ui/.next/static/chunks/app/services/[id]/databases/page-0ab83677f41e4872.js +1 -0
- package/ui/.next/static/chunks/app/services/[id]/edit/page-4e855fc95079d3b0.js +1 -0
- package/ui/.next/static/chunks/app/services/[id]/page-91c945af4fe4b38f.js +1 -0
- package/ui/.next/static/chunks/app/services/page-e1eb6d0670544d2c.js +1 -0
- package/ui/.next/static/chunks/app/settings/page-972e8f623bc80dde.js +1 -0
- package/ui/.next/static/chunks/{fd9d1056-24ea3e12f0a8c7d7.js → fd9d1056-2fd070b6bf76421a.js} +1 -1
- package/ui/.next/static/chunks/framework-00a8ba1a63cfdc9e.js +1 -33
- package/ui/.next/static/chunks/main-003047948bd01e37.js +1 -0
- package/ui/.next/static/chunks/main-app-65b07a3d5b8df539.js +1 -0
- package/ui/.next/static/chunks/pages/{_app-037b5d058bd9a820.js → _app-15e2daefa259f0b5.js} +1 -1
- package/ui/.next/static/chunks/pages/{_error-6ae619510b1539d6.js → _error-28b803cb2479b966.js} +1 -1
- package/ui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/ui/.next/static/chunks/{webpack-a69de51c95087569.js → webpack-87d7cc477c47986b.js} +1 -1
- package/ui/.next/static/css/59996bdb2e04e5fb.css +1 -0
- package/ui/.next/static/css/ec6ebd6699fb7dbb.css +1 -0
- package/ui/.next/static/ic2Pne1q67YkpAtfOBAwJ/_buildManifest.js +1 -0
- package/ui/package.json +27 -25
- package/ui/server.js +1 -1
- package/ui/.next/prerender-manifest.js +0 -1
- package/ui/.next/server/chunks/128.js +0 -6
- package/ui/.next/server/chunks/458.js +0 -6
- package/ui/.next/server/chunks/464.js +0 -13
- package/ui/.next/server/chunks/517.js +0 -1
- package/ui/.next/server/chunks/600.js +0 -1
- package/ui/.next/server/chunks/714.js +0 -13
- package/ui/.next/server/chunks/827.js +0 -1
- package/ui/.next/static/HUP7QT-BtU9-VXVKv3OI0/_buildManifest.js +0 -1
- package/ui/.next/static/chunks/151-46879dbab8c0ed1c.js +0 -22
- package/ui/.next/static/chunks/18-19cb1460c934b1a8.js +0 -1
- package/ui/.next/static/chunks/23-183860dbd7a502f2.js +0 -2
- package/ui/.next/static/chunks/508-7fbca57bc23a46cc.js +0 -1
- package/ui/.next/static/chunks/639-3f0c9c7673d380a4.js +0 -5
- package/ui/.next/static/chunks/824-4f9913604319416f.js +0 -1
- package/ui/.next/static/chunks/933-5422e499f41ee2f7.js +0 -1
- package/ui/.next/static/chunks/app/layout-9f2eff975cdd2857.js +0 -1
- package/ui/.next/static/chunks/app/page-f1feecfbf4f80a3c.js +0 -1
- package/ui/.next/static/chunks/app/services/[id]/edit/page-cb9cb899f8faac60.js +0 -1
- package/ui/.next/static/chunks/app/services/[id]/page-bd90f56996cc0ee2.js +0 -1
- package/ui/.next/static/chunks/app/services/page-c14dd182383d5d34.js +0 -1
- package/ui/.next/static/chunks/app/settings/page-10a77957ef23a28b.js +0 -5
- package/ui/.next/static/chunks/main-app-7ff9233e6544c70c.js +0 -1
- package/ui/.next/static/chunks/main-d0cf040bf9860ba2.js +0 -1
- package/ui/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -1
- package/ui/.next/static/css/294dd07620d1a861.css +0 -1
- package/ui/.next/static/css/475865983e61b131.css +0 -1
- package/ui/.next/static/css/ce0509a911764719.css +0 -1
- /package/ui/.next/static/{HUP7QT-BtU9-VXVKv3OI0 → ic2Pne1q67YkpAtfOBAwJ}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=517,exports.ids=[517],exports.modules={39300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(21528))},21528:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(57147),i=n(r(19092)).default("@kwsites/file-exists");t.exists=function(e,r=t.READABLE){return function(e,t,r){i("checking %s",e);try{let n=s.statSync(e);if(n.isFile()&&t)return i("[OK] path represents a file"),!0;if(n.isDirectory()&&r)return i("[OK] path represents a directory"),!0;return i("[FAIL] path represents something other than a file or directory"),!1}catch(e){if("ENOENT"===e.code)return i("[FAIL] path is not accessible: %o",e),!1;throw i("[FATAL] %o",e),e}}(e,(r&t.FILE)>0,(r&t.FOLDER)>0)},t.FILE=1,t.FOLDER=2,t.READABLE=t.FILE+t.FOLDER},68275:(e,t)=>{"use strict";function r(){let e,t;let r="pending";return{promise:new Promise((r,n)=>{e=r,t=n}),done(t){"pending"===r&&(r="resolved",e(t))},fail(e){"pending"===r&&(r="rejected",t(e))},get fulfilled(){return"pending"!==r},get status(){return r}}}t.dD=t.gX=void 0,t.gX=r,t.dD=r},52888:e=>{function t(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}e.exports={isBuffer:function(e){return Buffer.isBuffer(e)||e instanceof Uint8Array},isEncoding:function(e){return Buffer.isEncoding(e)},alloc:function(e,t,r){return Buffer.alloc(e,t,r)},allocUnsafe:function(e){return Buffer.allocUnsafe(e)},allocUnsafeSlow:function(e){return Buffer.allocUnsafeSlow(e)},byteLength:function(e,t){return Buffer.byteLength(e,t)},compare:function(e,t){return Buffer.compare(e,t)},concat:function(e,t){return Buffer.concat(e,t)},copy:function(e,r,n,s,i){return t(e).copy(r,n,s,i)},equals:function(e,r){return t(e).equals(r)},fill:function(e,r,n,s,i){return t(e).fill(r,n,s,i)},from:function(e,t,r){return Buffer.from(e,t,r)},includes:function(e,r,n,s){return t(e).includes(r,n,s)},indexOf:function(e,r,n,s){return t(e).indexOf(r,n,s)},lastIndexOf:function(e,r,n,s){return t(e).lastIndexOf(r,n,s)},swap16:function(e){return t(e).swap16()},swap32:function(e){return t(e).swap32()},swap64:function(e){return t(e).swap64()},toBuffer:t,toString:function(e,r,n,s){return t(e).toString(r,n,s)},write:function(e,r,n,s,i){return t(e).write(r,n,s,i)},writeDoubleLE:function(e,r,n){return t(e).writeDoubleLE(r,n)},writeFloatLE:function(e,r,n){return t(e).writeFloatLE(r,n)},writeUInt32LE:function(e,r,n){return t(e).writeUInt32LE(r,n)},writeInt32LE:function(e,r,n){return t(e).writeInt32LE(r,n)},readDoubleLE:function(e,r){return t(e).readDoubleLE(r)},readFloatLE:function(e,r){return t(e).readFloatLE(r)},readUInt32LE:function(e,r){return t(e).readUInt32LE(r)},readInt32LE:function(e,r){return t(e).readInt32LE(r)}}},93050:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){let e;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(30783)(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},30783:(e,t,r)=>{e.exports=function(e){function t(e){let r,s,i;let a=null;function o(...e){if(!o.enabled)return;let n=Number(new Date),s=n-(r||n);o.diff=s,o.prev=r,o.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";i++;let s=t.formatters[n];if("function"==typeof s){let t=e[i];r=s.call(o,t),e.splice(i,1),i--}return r}),t.formatArgs.call(o,e),(o.log||t.log).apply(o,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,r){let n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(s),...t.skips.map(s).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];let n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(r=0;r<s;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(RegExp("^"+e.slice(1)+"$")):t.names.push(RegExp("^"+e+"$")))},t.enabled=function(e){let r,n;if("*"===e[e.length-1])return!0;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(13974),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},19092:(e,t,r)=>{"undefined"==typeof process||"renderer"===process.type||process.__nwjs?e.exports=r(93050):e.exports=r(12226)},12226:(e,t,r)=>{let n=r(76224),s=r(73837);t.init=function(e){e.inspectOpts={};let r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(s.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){let{namespace:n,useColors:s}=this;if(s){let t=this.color,s="\x1b[3"+(t<8?t:"8;5;"+t),i=` ${s};1m${n} \u001B[0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(s+"m+"+e.exports.humanize(this.diff)+"\x1b[0m")}else r[0]=(t.inspectOpts.hideDate?"":new Date().toISOString()+" ")+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:n.isatty(process.stderr.fd)},t.destroy=s.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=r(67057);e&&(e.stderr||e).level>=2&&(t.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(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r(30783)(t);let{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}},14949:(e,t,r)=>{var n=r(17337),s=function(){},i=function(e,t,r){if("function"==typeof t)return i(e,null,t);t||(t={}),r=n(r||s);var a=e._writableState,o=e._readableState,u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,c=!1,d=function(){e.writable||h()},h=function(){l=!1,u||r.call(e)},p=function(){u=!1,l||r.call(e)},f=function(t){r.call(e,t?Error("exited with error code: "+t):null)},m=function(t){r.call(e,t)},g=function(){process.nextTick(_)},_=function(){if(!c&&(u&&!(o&&o.ended&&!o.destroyed)||l&&!(a&&a.ended&&!a.destroyed)))return r.call(e,Error("premature close"))},y=function(){e.req.on("finish",h)};return e.setHeader&&"function"==typeof e.abort?(e.on("complete",h),e.on("abort",g),e.req?y():e.on("request",y)):l&&!a&&(e.on("end",d),e.on("close",d)),e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length&&e.on("exit",f),e.on("end",p),e.on("finish",h),!1!==t.error&&e.on("error",m),e.on("close",g),function(){c=!0,e.removeListener("complete",h),e.removeListener("abort",g),e.removeListener("request",y),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",f),e.removeListener("end",p),e.removeListener("error",m),e.removeListener("close",g)}};e.exports=i},89511:e=>{e.exports=class{constructor(e){if(!(e>0)||(e-1&e)!=0)throw Error("Max size for a FixedFIFO should be a power of two");this.buffer=Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},13531:(e,t,r)=>{let n=r(89511);e.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){0!==this.length&&this.length--;let e=this.tail.shift();if(void 0===e&&this.tail.next){let e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){let e=this.tail.peek();return void 0===e&&this.tail.next?this.tail.next.peek():e}isEmpty(){return 0===this.length}}},72616:e=>{"use strict";e.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return -1!==n&&(-1===s||n<s)}},13974:e=>{function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,s,i=typeof e;if("string"===i&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===i&&isFinite(e))return r.long?(n=Math.abs(e))>=864e5?t(e,n,864e5,"day"):n>=36e5?t(e,n,36e5,"hour"):n>=6e4?t(e,n,6e4,"minute"):n>=1e3?t(e,n,1e3,"second"):e+" ms":(s=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":s>=36e5?Math.round(e/36e5)+"h":s>=6e4?Math.round(e/6e4)+"m":s>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},17337:(e,t,r)=>{var n=r(94643);function s(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(s),e.exports.strict=n(i),s.proto=s(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})})},98597:(e,t,r)=>{var n=r(17337),s=r(14949),i=r(57147),a=function(){},o=/^v?\.0/.test(process.version),u=function(e){return"function"==typeof e},l=function(e,t,r,l){l=n(l);var c=!1;e.on("close",function(){c=!0}),s(e,{readable:t,writable:r},function(e){if(e)return l(e);c=!0,l()});var d=!1;return function(t){if(!c&&!d){if(d=!0,o&&i&&(e instanceof(i.ReadStream||a)||e instanceof(i.WriteStream||a))&&u(e.close))return e.close(a);if(e.setHeader&&u(e.abort))return e.abort();if(u(e.destroy))return e.destroy();l(t||Error("stream was destroyed"))}}},c=function(e){e()},d=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=u(t[t.length-1]||a)&&t.pop()||a;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw Error("pump requires two streams per minimum");var n=t.map(function(s,i){var a=i<t.length-1;return l(s,a,i>0,function(t){e||(e=t),t&&n.forEach(c),a||(n.forEach(c),r(e))})});return t.reduce(d)}},84057:(e,t,r)=>{e.exports="undefined"!=typeof process&&"function"==typeof process.nextTick?process.nextTick.bind(process):r(13093)},13093:e=>{e.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},43047:(e,t,r)=>{let{EventEmitter:n}=r(82361),s=Error("Stream was destroyed"),i=Error("Premature close"),a=r(84057),o=r(13531),u=r(82281),l=Symbol.asyncIterator||Symbol("asyncIterator");class c{constructor(e,{highWaterMark:t=16384,map:r=null,mapWritable:n,byteLength:s,byteLengthWritable:i}={}){this.stream=e,this.queue=new o,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=i||s||j,this.map=n||r,this.afterWrite=_.bind(this),this.afterUpdateNextTick=v.bind(this)}get ended(){return(8388608&this.stream._duplexState)!=0}push(e){return(null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark)?(this.stream._duplexState|=2097152,!0):(this.stream._duplexState|=6291456,!1)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=534773759),e}end(e){"function"==typeof e?this.stream.once("finish",e):null!=e&&this.push(e),this.stream._duplexState=(134217728|this.stream._duplexState)&535822335}autoBatch(e,t){let r=[],n=this.stream;for(r.push(e);(270794767&n._duplexState)==2359296;)r.push(n._writableState.shift());if((15&n._duplexState)!=0)return t(null);n._writev(r,t)}update(){let e=this.stream;e._duplexState|=524288;do{for(;(270794767&e._duplexState)==2097152;){let t=this.shift();e._duplexState|=67371008,e._write(t,this.afterWrite)}(1310720&e._duplexState)==0&&this.updateNonPrimary()}while(!0===this.continueUpdate());e._duplexState&=536346623}updateNonPrimary(){let e=this.stream;if((144965647&e._duplexState)==134217728){e._duplexState=(262144|e._duplexState)&402653183,e._final(m.bind(this));return}if((14&e._duplexState)==4){(33587200&e._duplexState)==0&&(e._duplexState|=262160,e._destroy(g.bind(this)));return}(33587215&e._duplexState)==1&&(e._duplexState=(262160|e._duplexState)&536870910,e._open(k.bind(this)))}continueUpdate(){return(33554432&this.stream._duplexState)!=0&&(this.stream._duplexState&=503316479,!0)}updateCallback(){(35127311&this.stream._duplexState)==1048576?this.update():this.updateNextTick()}updateNextTick(){(33554432&this.stream._duplexState)==0&&(this.stream._duplexState|=33554432,(524288&this.stream._duplexState)==0&&a(this.afterUpdateNextTick))}}class d{constructor(e,{highWaterMark:t=16384,map:r=null,mapReadable:n,byteLength:s,byteLengthReadable:i}={}){this.stream=e,this.queue=new o,this.highWaterMark=0===t?1:t,this.buffered=0,this.readAhead=t>0,this.error=null,this.pipeline=null,this.byteLength=i||s||j,this.map=n||r,this.pipeTo=null,this.afterRead=y.bind(this),this.afterUpdateNextTick=b.bind(this)}get ended(){return(16384&this.stream._duplexState)!=0}pipe(e,t){if(null!==this.pipeTo)throw Error("Can only pipe to one destination");if("function"!=typeof t&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new p(this.stream,e,t),t&&this.stream.on("error",F),R(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",F),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{let t=this.pipeline.done.bind(this.pipeline,e),r=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",t),e.on("close",r),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",f.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){let t=this.stream;return null===e?(this.highWaterMark=0,t._duplexState=(1024|t._duplexState)&536805311,!1):(null!==this.map&&null===(e=this.map(e))?t._duplexState&=536805375:(this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=(128|t._duplexState)&536805375),this.buffered<this.highWaterMark)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=536862591),e}unshift(e){let t=[null!==this.map?this.map(e):e];for(;this.buffered>0;)t.push(this.shift());for(let e=0;e<t.length-1;e++){let r=t[e];this.buffered+=this.byteLength(r),this.queue.push(r)}this.push(t[t.length-1])}read(){let e=this.stream;if((16527&e._duplexState)==128){let t=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=536870143),(2048&e._duplexState)!=0&&e.emit("data",t),t}return!1===this.readAhead&&(e._duplexState|=131072,this.updateNextTick()),null}drain(){let e=this.stream;for(;(16527&e._duplexState)==128&&(768&e._duplexState)!=0;){let t=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=536870143),(2048&e._duplexState)!=0&&e.emit("data",t)}}update(){let e=this.stream;e._duplexState|=32;do{for(this.drain();this.buffered<this.highWaterMark&&(214047&e._duplexState)==131072;)e._duplexState|=65552,e._read(this.afterRead),this.drain();(12431&e._duplexState)==4224&&(e._duplexState|=8192,e.emit("readable")),(80&e._duplexState)==0&&this.updateNonPrimary()}while(!0===this.continueUpdate());e._duplexState&=536870879}updateNonPrimary(){let e=this.stream;if((1167&e._duplexState)==1024&&(e._duplexState=(16384|e._duplexState)&536869887,e.emit("end"),(8405006&e._duplexState)==8404992&&(e._duplexState|=4),null!==this.pipeTo&&this.pipeTo.end()),(14&e._duplexState)==4){(33587200&e._duplexState)==0&&(e._duplexState|=262160,e._destroy(g.bind(this)));return}(33587215&e._duplexState)==1&&(e._duplexState=(262160|e._duplexState)&536870910,e._open(k.bind(this)))}continueUpdate(){return(32768&this.stream._duplexState)!=0&&(this.stream._duplexState&=536838143,!0)}updateCallback(){(32879&this.stream._duplexState)==64?this.update():this.updateNextTick()}updateNextTick(){(32768&this.stream._duplexState)==0&&(this.stream._duplexState|=32768,(32&this.stream._duplexState)==0&&a(this.afterUpdateNextTick))}}class h{constructor(e){this.data=null,this.afterTransform=w.bind(e),this.afterFinal=null}}class p{constructor(e,t,r){this.from=e,this.to=t,this.afterPipe=r,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(e,t){if(t&&(this.error=t),e===this.to&&(this.to=null,null!==this.from)){(16384&this.from._duplexState)!=0&&this.pipeToFinished||this.from.destroy(this.error||Error("Writable stream closed prematurely"));return}if(e===this.from&&(this.from=null,null!==this.to)){(16384&e._duplexState)==0&&this.to.destroy(this.error||Error("Readable stream closed before ending"));return}null!==this.afterPipe&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null}}function f(){this.stream._duplexState|=512,this.updateCallback()}function m(e){let t=this.stream;e&&t.destroy(e),(14&t._duplexState)==0&&(t._duplexState|=8388608,t.emit("finish")),(8405006&t._duplexState)==8404992&&(t._duplexState|=4),t._duplexState&=469499903,(524288&t._duplexState)==0?this.update():this.updateNextTick()}function g(e){let t=this.stream;e||this.error===s||(e=this.error),e&&t.emit("error",e),t._duplexState|=8,t.emit("close");let r=t._readableState,n=t._writableState;if(null!==r&&null!==r.pipeline&&r.pipeline.done(t,e),null!==n){for(;null!==n.drains&&n.drains.length>0;)n.drains.shift().resolve(!1);null!==n.pipeline&&n.pipeline.done(t,e)}}function _(e){let t=this.stream;e&&t.destroy(e),t._duplexState&=469499903,null!==this.drains&&function(e){for(let t=0;t<e.length;t++)0==--e[t].writes&&(e.shift().resolve(!0),t--)}(this.drains),(6553615&t._duplexState)==4194304&&(t._duplexState&=532676607,(16777216&t._duplexState)==16777216&&t.emit("drain")),this.updateCallback()}function y(e){e&&this.stream.destroy(e),this.stream._duplexState&=536870895,!1===this.readAhead&&(256&this.stream._duplexState)==0&&(this.stream._duplexState&=536739839),this.updateCallback()}function b(){(32&this.stream._duplexState)==0&&(this.stream._duplexState&=536838143,this.update())}function v(){(524288&this.stream._duplexState)==0&&(this.stream._duplexState&=503316479,this.update())}function k(e){let t=this.stream;e&&t.destroy(e),(4&t._duplexState)==0&&((17423&t._duplexState)==0&&(t._duplexState|=64),(142606351&t._duplexState)==0&&(t._duplexState|=1048576),t.emit("open")),t._duplexState&=536608751,null!==t._writableState&&t._writableState.updateCallback(),null!==t._readableState&&t._readableState.updateCallback()}function w(e,t){null!=t&&this.push(t),this._writableState.afterWrite(e)}function x(e){null!==this._readableState&&("data"===e&&(this._duplexState|=133376,this._readableState.updateNextTick()),"readable"===e&&(this._duplexState|=4096,this._readableState.updateNextTick())),null!==this._writableState&&"drain"===e&&(this._duplexState|=16777216,this._writableState.updateNextTick())}class S extends n{constructor(e){super(),this._duplexState=0,this._readableState=null,this._writableState=null,e&&(e.open&&(this._open=e.open),e.destroy&&(this._destroy=e.destroy),e.predestroy&&(this._predestroy=e.predestroy),e.signal&&e.signal.addEventListener("abort",M.bind(this))),this.on("newListener",x)}_open(e){e(null)}_destroy(e){e(null)}_predestroy(){}get readable(){return null!==this._readableState||void 0}get writable(){return null!==this._writableState||void 0}get destroyed(){return(8&this._duplexState)!=0}get destroying(){return(14&this._duplexState)!=0}destroy(e){(14&this._duplexState)==0&&(e||(e=s),this._duplexState=(4|this._duplexState)&535822271,null!==this._readableState&&(this._readableState.highWaterMark=0,this._readableState.error=e),null!==this._writableState&&(this._writableState.highWaterMark=0,this._writableState.error=e),this._duplexState|=2,this._predestroy(),this._duplexState&=536870909,null!==this._readableState&&this._readableState.updateNextTick(),null!==this._writableState&&this._writableState.updateNextTick())}}class T extends S{constructor(e){super(e),this._duplexState|=8519681,this._readableState=new d(this,e),e&&(!1===this._readableState.readAhead&&(this._duplexState&=536739839),e.read&&(this._read=e.read),e.eagerOpen&&this._readableState.updateNextTick(),e.encoding&&this.setEncoding(e.encoding))}setEncoding(e){let t=new u(e),r=this._readableState.map||I;return this._readableState.map=function(e){let n=t.push(e);return""===n?null:r(n)},this}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTick(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTick(),this._readableState.unshift(e)}resume(){return this._duplexState|=131328,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=!1===this._readableState.readAhead?536739583:536870655,this}static _fromAsyncIterator(e,t){let r;let n=new T({...t,read(t){e.next().then(s).then(t.bind(null,null)).catch(t)},predestroy(){r=e.return()},destroy(e){if(!r)return e(null);r.then(e.bind(null,null)).catch(e)}});return n;function s(e){e.done?n.push(null):n.push(e.value)}}static from(e,t){var r;if(R(r=e)&&r.readable)return e;if(e[l])return this._fromAsyncIterator(e[l](),t);Array.isArray(e)||(e=void 0===e?[]:[e]);let n=0;return new T({...t,read(t){this.push(n===e.length?null:e[n++]),t(null)}})}static isBackpressured(e){return(17422&e._duplexState)!=0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(256&e._duplexState)==0}[l](){let e=this,t=null,r=null,n=null;return this.on("error",e=>{t=e}),this.on("readable",function(){null!==r&&i(e.read())}),this.on("close",function(){null!==r&&i(null)}),{[l](){return this},next:()=>new Promise(function(t,s){r=t,n=s;let a=e.read();null!==a?i(a):(8&e._duplexState)!=0&&i(null)}),return:()=>a(null),throw:e=>a(e)};function i(i){null!==n&&(t?n(t):null===i&&(16384&e._duplexState)==0?n(s):r({value:i,done:null===i}),n=r=null)}function a(t){return e.destroy(t),new Promise((r,n)=>{if(8&e._duplexState)return r({value:void 0,done:!0});e.once("close",function(){t?n(t):r({value:void 0,done:!0})})})}}}class C extends S{constructor(e){super(e),this._duplexState|=16385,this._writableState=new c(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}cork(){this._duplexState|=268435456}uncork(){this._duplexState&=268435455,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(146800654&e._duplexState)!=0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,r=(e._writev!==C.prototype._writev&&e._writev!==O.prototype._writev?Math.min(1,t.queue.length):t.queue.length)+(67108864&e._duplexState?1:0);return 0===r?Promise.resolve(!0):(null===t.drains&&(t.drains=[]),new Promise(e=>{t.drains.push({writes:r,resolve:e})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class O extends T{constructor(e){super(e),this._duplexState=1|131072&this._duplexState,this._writableState=new c(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}cork(){this._duplexState|=268435456}uncork(){this._duplexState&=268435455,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class E extends O{constructor(e){super(e),this._transformState=new h(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(null!==this._transformState.data){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),null!==this._transformState.data&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(A.bind(this))}}class N extends E{}function A(e,t){let r=this._transformState.afterFinal;if(e)return r(e);null!=t&&this.push(t),this.push(null),r(null)}function L(e,...t){let r=Array.isArray(e)?[...e,...t]:[e,...t],n=r.length&&"function"==typeof r[r.length-1]?r.pop():null;if(r.length<2)throw Error("Pipeline requires at least 2 streams");let s=r[0],a=null,o=null;for(let e=1;e<r.length;e++)a=r[e],R(s)?s.pipe(a,u):(function(e,t,r,n){e.on("error",n),e.on("close",function(){if(t&&e._readableState&&!e._readableState.ended||r&&e._writableState&&!e._writableState.ended)return n(i)})}(s,!0,e>1,u),s.pipe(a)),s=a;if(n){let e=!1,t=R(a)||!!(a._writableState&&a._writableState.autoDestroy);a.on("error",e=>{null===o&&(o=e)}),a.on("finish",()=>{e=!0,t||n(o)}),t&&a.on("close",()=>n(o||(e?null:i)))}return a;function u(e){if(e&&!o)for(let t of(o=e,r))t.destroy(e)}}function I(e){return e}function P(e){return!!e._readableState||!!e._writableState}function R(e){return"number"==typeof e._duplexState&&P(e)}function j(e){return"object"==typeof e&&null!==e&&"number"==typeof e.byteLength?e.byteLength:1024}function F(){}function M(){this.destroy(Error("Stream aborted."))}e.exports={pipeline:L,pipelinePromise:function(...e){return new Promise((t,r)=>L(...e,e=>{if(e)return r(e);t()}))},isStream:P,isStreamx:R,isEnded:function(e){return!!e._readableState&&e._readableState.ended},isFinished:function(e){return!!e._writableState&&e._writableState.ended},getStreamError:function(e,t={}){let r=e._readableState&&e._readableState.error||e._writableState&&e._writableState.error;return t.all||r!==s?r:null},Stream:S,Writable:C,Readable:T,Duplex:O,Transform:E,PassThrough:N}},67057:(e,t,r)=>{"use strict";let n;let s=r(22037),i=r(76224),a=r(72616),{env:o}=process;function u(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(0===n)return 0;if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2;if(e&&!t&&void 0===n)return 0;let r=n||0;if("dumb"===o.TERM)return r;if("win32"===process.platform){let e=s.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in o)||"codeship"===o.CI_NAME?1:r;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){let e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:r}a("no-color")||a("no-colors")||a("color=false")||a("color=never")?n=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(n=1),"FORCE_COLOR"in o&&(n="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return u(l(e,e&&e.isTTY))},stdout:u(l(!0,i.isatty(1))),stderr:u(l(!0,i.isatty(2)))}},40549:(e,t,r)=>{let n=r(93637),s=r(98597),i=r(57147),a=r(71017),o="win32"===(global.Bare?.platform||process.platform);function u(){return process.umask?process.umask():0}function l(){}function c(e){return e}function d(e){return o?e.replace(/\\/g,"/").replace(/[:?<>|]/g,"_"):e}function h(e,t){return function(r){r.name=r.name.split("/").slice(t).join("/");let n=r.linkname;return n&&("link"===r.type||a.isAbsolute(n))&&(r.linkname=n.split("/").slice(t).join("/")),e(r)}}t.pack=function(e,t){e||(e="."),t||(t={});let r=t.fs||i,o=t.ignore||t.filter||l,p=t.mapStream||c,f=function(e,t,r,n,s,i){s||(s=["."]);let o=s.slice(0);return function(u){if(!o.length)return u(null);let l=o.shift(),c=a.join(r,l);t.call(e,c,function(t,d){return t?u(-1===s.indexOf(l)&&"ENOENT"===t.code?null:t):d.isDirectory()?void e.readdir(c,function(e,t){if(e)return u(e);i&&t.sort();for(let e=0;e<t.length;e++)n(a.join(r,l,t[e]))||o.push(a.join(l,t[e]));u(null,l,d)}):u(null,l,d)})}}(r,t.dereference?r.stat:r.lstat,e,o,t.entries,t.sort),m=!1!==t.strict,g="number"==typeof t.umask?~t.umask:~u(),_=t.pack||n.pack(),y=t.finish||l,b=t.map||l,v="number"==typeof t.dmode?t.dmode:0,k="number"==typeof t.fmode?t.fmode:0;function w(n,i,o){if(_.destroyed)return;if(n)return _.destroy(n);if(!i)return!1!==t.finalize&&_.finalize(),y(_);if(o.isSocket())return x();let u={name:d(i),mode:(o.mode|(o.isDirectory()?v:k))&g,mtime:o.mtime,size:o.size,type:"file",uid:o.uid,gid:o.gid};if(o.isDirectory())return u.size=0,u.type="directory",u=b(u)||u,_.entry(u,x);if(o.isSymbolicLink()){var l;return u.size=0,u.type="symlink",l=u=b(u)||u,void r.readlink(a.join(e,i),function(e,t){if(e)return _.destroy(e);l.linkname=d(t),_.entry(l,x)})}if(u=b(u)||u,!o.isFile())return m?_.destroy(Error("unsupported type for "+i)):x();let c=_.entry(u,x),h=p(r.createReadStream(a.join(e,i),{start:0,end:u.size>0?u.size-1:u.size}),u);h.on("error",function(e){c.destroy(e)}),s(h,c)}function x(e){if(e)return _.destroy(e);f(w)}return t.strip&&(b=h(b,t.strip)),t.readable&&(v|=parseInt(555,8),k|=parseInt(444,8)),t.writable&&(v|=parseInt(333,8),k|=parseInt(222,8)),x(),_},t.extract=function(e,t){e||(e="."),t||(t={});let r=t.fs||i,p=t.ignore||t.filter||l,f=t.mapStream||c,m=!1!==t.chown&&!o&&0===(process.getuid?process.getuid():-1),g=t.extract||n.extract(),_=[],y=new Date,b="number"==typeof t.umask?~t.umask:~u(),v=!1!==t.strict,k=t.map||l,w="number"==typeof t.dmode?t.dmode:0,x="number"==typeof t.fmode?t.fmode:0;return t.strip&&(k=h(k,t.strip)),t.readable&&(w|=parseInt(555,8),x|=parseInt(444,8)),t.writable&&(w|=parseInt(333,8),x|=parseInt(222,8)),g.on("entry",function(n,i,u){(n=k(n)||n).name=d(n.name);let l=a.join(e,a.join("/",n.name));if(p(l,n))return i.resume(),u();if("directory"===n.type)return _.push([l,n.mtime]),C(l,{fs:r,own:m,uid:n.uid,gid:n.gid,mode:n.mode},h);let c=a.dirname(l);function h(e){var s,i;if(e)return u(e);s=n,i=function(e){return e?u(e):o?u():void T(l,n,u)},!1===t.utimes?i():"directory"===s.type?r.utimes(l,y,s.mtime,i):"symlink"===s.type?S(l,i):r.utimes(l,y,s.mtime,function(e){if(e)return i(e);S(l,i)})}function g(){let e=r.createWriteStream(l),t=f(i,n);e.on("error",function(e){t.destroy(e)}),s(t,e,function(t){if(t)return u(t);e.on("close",h)})}(function e(t,r,n,s){if(r===n)return s(null,!0);t.lstat(r,function(i,o){return i&&"ENOENT"===i.code?e(t,a.join(r,".."),n,s):i?s(i):void s(null,o.isDirectory())})})(r,c,a.join(e,"."),function(s,d){return s?u(s):d?void C(c,{fs:r,own:m,uid:n.uid,gid:n.gid,mode:493},function(s){if(s)return u(s);switch(n.type){case"file":return g();case"link":return function(){if(o)return u();r.unlink(l,function(){let s=a.join(e,a.join("/",n.linkname));r.link(s,l,function(e){if(e&&"EPERM"===e.code&&t.hardlinkAsFilesFallback)return i=r.createReadStream(s),g();h(e)})})}();case"symlink":return function(){if(o)return u();r.unlink(l,function(){r.symlink(n.linkname,l,h)})}()}if(v)return u(Error("unsupported type for "+l+" ("+n.type+")"));i.resume(),u()}):u(Error(c+" is not a valid path"))})}),t.finish&&g.on("finish",t.finish),g;function S(e,t){let n;for(;(n=_.length?_[_.length-1]:null)&&e.slice(0,n[0].length)!==n[0];)_.pop();if(!n)return t();r.utimes(n[0],y,n[1],t)}function T(e,t,n){let s="symlink"===t.type,i=s?r.lchmod:r.chmod,a=s?r.lchown:r.chown;if(!i)return n();let o=(t.mode|("directory"===t.type?w:x))&b;function u(t){return t?n(t):i?void i.call(r,e,o,n):n()}a&&m?a.call(r,e,t.uid,t.gid,u):u(null)}function C(e,t,n){r.stat(e,function(s){return s?"ENOENT"!==s.code?n(s):void r.mkdir(e,{mode:t.mode,recursive:!0},function(r,s){if(r)return n(r);T(e,t,n)}):n(null)})}}},91194:(e,t,r)=>{let n={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{e.exports=r(57147).constants||n}catch{e.exports=n}},60017:(e,t,r)=>{let{Writable:n,Readable:s,getStreamError:i}=r(43047),a=r(13531),o=r(52888),u=r(28271),l=o.alloc(0);class c{constructor(){this.buffered=0,this.shifted=0,this.queue=new a,this._offset=0}push(e){this.buffered+=e.byteLength,this.queue.push(e)}shiftFirst(e){return 0===this._buffered?null:this._next(e)}shift(e){if(e>this.buffered)return null;if(0===e)return l;let t=this._next(e);if(e===t.byteLength)return t;let r=[t];for(;(e-=t.byteLength)>0;)t=this._next(e),r.push(t);return o.concat(r)}_next(e){let t=this.queue.peek(),r=t.byteLength-this._offset;if(e>=r){let e=this._offset?t.subarray(this._offset,t.byteLength):t;return this.queue.shift(),this._offset=0,this.buffered-=r,this.shifted+=r,e}return this.buffered-=e,this.shifted+=e,t.subarray(this._offset,this._offset+=e)}}class d extends s{constructor(e,t,r){super(),this.header=t,this.offset=r,this._parent=e}_read(e){0===this.header.size&&this.push(null),this._parent._stream===this&&this._parent._update(),e(null)}_predestroy(){this._parent.destroy(i(this))}_detach(){this._parent._stream===this&&(this._parent._stream=null,this._parent._missing=f(this.header.size),this._parent._update())}_destroy(e){this._detach(),e(null)}}class h extends n{constructor(e){super(e),e||(e={}),this._buffer=new c,this._offset=0,this._header=null,this._stream=null,this._missing=0,this._longHeader=!1,this._callback=p,this._locked=!1,this._finished=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null,this._filenameEncoding=e.filenameEncoding||"utf-8",this._allowUnknownFormat=!!e.allowUnknownFormat,this._unlockBound=this._unlock.bind(this)}_unlock(e){if(this._locked=!1,e){this.destroy(e),this._continueWrite(e);return}this._update()}_consumeHeader(){if(this._locked)return!1;this._offset=this._buffer.shifted;try{this._header=u.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(e){return this._continueWrite(e),!1}if(!this._header)return!0;switch(this._header.type){case"gnu-long-path":case"gnu-long-link-path":case"pax-global-header":case"pax-header":return this._longHeader=!0,this._missing=this._header.size,!0}return(this._locked=!0,this._applyLongHeaders(),0===this._header.size||"directory"===this._header.type)?this.emit("entry",this._header,this._createStream(),this._unlockBound):(this._stream=this._createStream(),this._missing=this._header.size,this.emit("entry",this._header,this._stream,this._unlockBound)),!0}_applyLongHeaders(){this._gnuLongPath&&(this._header.name=this._gnuLongPath,this._gnuLongPath=null),this._gnuLongLinkPath&&(this._header.linkname=this._gnuLongLinkPath,this._gnuLongLinkPath=null),this._pax&&(this._pax.path&&(this._header.name=this._pax.path),this._pax.linkpath&&(this._header.linkname=this._pax.linkpath),this._pax.size&&(this._header.size=parseInt(this._pax.size,10)),this._header.pax=this._pax,this._pax=null)}_decodeLongHeader(e){switch(this._header.type){case"gnu-long-path":this._gnuLongPath=u.decodeLongPath(e,this._filenameEncoding);break;case"gnu-long-link-path":this._gnuLongLinkPath=u.decodeLongPath(e,this._filenameEncoding);break;case"pax-global-header":this._paxGlobal=u.decodePax(e);break;case"pax-header":this._pax=null===this._paxGlobal?u.decodePax(e):Object.assign({},this._paxGlobal,u.decodePax(e))}}_consumeLongHeader(){this._longHeader=!1,this._missing=f(this._header.size);let e=this._buffer.shift(this._header.size);try{this._decodeLongHeader(e)}catch(e){return this._continueWrite(e),!1}return!0}_consumeStream(){let e=this._buffer.shiftFirst(this._missing);if(null===e)return!1;this._missing-=e.byteLength;let t=this._stream.push(e);return 0===this._missing?(this._stream.push(null),t&&this._stream._detach(),t&&!1===this._locked):t}_createStream(){return new d(this,this._header,this._offset)}_update(){for(;this._buffer.buffered>0&&!this.destroying;){if(this._missing>0){if(null!==this._stream){if(!1===this._consumeStream())return;continue}if(!0===this._longHeader){if(this._missing>this._buffer.buffered)break;if(!1===this._consumeLongHeader())return!1;continue}let e=this._buffer.shiftFirst(this._missing);null!==e&&(this._missing-=e.byteLength);continue}if(this._buffer.buffered<512)break;if(null!==this._stream||!1===this._consumeHeader())return}this._continueWrite(null)}_continueWrite(e){let t=this._callback;this._callback=p,t(e)}_write(e,t){this._callback=t,this._buffer.push(e),this._update()}_final(e){this._finished=0===this._missing&&0===this._buffer.buffered,e(this._finished?null:Error("Unexpected end of data"))}_predestroy(){this._continueWrite(null)}_destroy(e){this._stream&&this._stream.destroy(i(this)),e(null)}[Symbol.asyncIterator](){let e=null,t=null,r=null,n=null,s=null,i=this;return this.on("entry",function(e,i,a){s=a,i.on("error",p),t?(t({value:i,done:!1}),t=r=null):n=i}),this.on("error",t=>{e=t}),this.on("close",function(){a(e),t&&(e?r(e):t({value:void 0,done:!0}),t=r=null)}),{[Symbol.asyncIterator](){return this},next:()=>new Promise(o),return:()=>u(null),throw:e=>u(e)};function a(e){if(!s)return;let t=s;s=null,t(e)}function o(s,o){if(e)return o(e);if(n){s({value:n,done:!1}),n=null;return}t=s,r=o,a(null),i._finished&&t&&(t({value:void 0,done:!0}),t=r=null)}function u(e){return i.destroy(e),a(e),new Promise((t,r)=>{if(i.destroyed)return t({value:void 0,done:!0});i.once("close",function(){e?r(e):t({value:void 0,done:!0})})})}}}function p(){}function f(e){return(e&=511)&&512-e}e.exports=function(e){return new h(e)}},28271:(e,t,r)=>{let n=r(52888),s=n.from([117,115,116,97,114,0]),i=n.from([48,48]),a=n.from([117,115,116,97,114,32]),o=n.from([32,0]);function u(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n}function l(e){let t=256;for(let r=0;r<148;r++)t+=e[r];for(let r=156;r<512;r++)t+=e[r];return t}function c(e,t){return(e=e.toString(8)).length>t?"7777777777777777777".slice(0,t)+" ":"0000000000000000000".slice(0,t-e.length)+e+" "}function d(e,t,r){if(128&(e=e.subarray(t,t+r))[t=0])return function(e){let t,r;if(128===e[0])t=!0;else{if(255!==e[0])return null;t=!1}let n=[];for(r=e.length-1;r>0;r--){let s=e[r];t?n.push(s):n.push(255-s)}let s=0,i=n.length;for(r=0;r<i;r++)s+=n[r]*Math.pow(256,r);return t?s:-1*s}(e);{for(var s,i,a;t<e.length&&32===e[t];)t++;let r=(s=u(e,32,t,e.length),i=e.length,a=e.length,"number"!=typeof s?a:(s=~~s)>=i?i:s>=0||(s+=i)>=0?s:0);for(;t<r&&0===e[t];)t++;return r===t?0:parseInt(n.toString(e.subarray(t,r)),8)}}function h(e,t,r,s){return n.toString(e.subarray(t,u(e,0,t,t+r)),s)}function p(e){let t=n.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e}t.decodeLongPath=function(e,t){return h(e,0,e.length,t)},t.encodePax=function(e){let t="";e.name&&(t+=p(" path="+e.name+"\n")),e.linkname&&(t+=p(" linkpath="+e.linkname+"\n"));let r=e.pax;if(r)for(let e in r)t+=p(" "+e+"="+r[e]+"\n");return n.from(t)},t.decodePax=function(e){let t={};for(;e.length;){let r=0;for(;r<e.length&&32!==e[r];)r++;let s=parseInt(n.toString(e.subarray(0,r)),10);if(!s)break;let i=n.toString(e.subarray(r+1,s-1)),a=i.indexOf("=");if(-1===a)break;t[i.slice(0,a)]=i.slice(a+1),e=e.subarray(s)}return t},t.encode=function(e){var t;let r=n.alloc(512),a=e.name,o="";if(5===e.typeflag&&"/"!==a[a.length-1]&&(a+="/"),n.byteLength(a)!==a.length)return null;for(;n.byteLength(a)>100;){let e=a.indexOf("/");if(-1===e)return null;o+=o?"/"+a.slice(0,e):a.slice(0,e),a=a.slice(e+1)}return n.byteLength(a)>100||n.byteLength(o)>155||e.linkname&&n.byteLength(e.linkname)>100?null:(n.write(r,a),n.write(r,c(4095&e.mode,6),100),n.write(r,c(e.uid,6),108),n.write(r,c(e.gid,6),116),(t=e.size).toString(8).length>11?function(e,t,r){t[124]=128;for(let n=11;n>0;n--)t[r+n]=255&e,e=Math.floor(e/256)}(t,r,124):n.write(r,c(t,11),124),n.write(r,c(e.mtime.getTime()/1e3|0,11),136),r[156]=48+function(e){switch(e){case"file":break;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}(e.type),e.linkname&&n.write(r,e.linkname,157),n.copy(s,r,257),n.copy(i,r,263),e.uname&&n.write(r,e.uname,265),e.gname&&n.write(r,e.gname,297),n.write(r,c(e.devmajor||0,6),329),n.write(r,c(e.devminor||0,6),337),o&&n.write(r,o,345),n.write(r,c(l(r),6),148),r)},t.decode=function(e,t,r){let i=0===e[156]?0:e[156]-48,u=h(e,0,100,t),c=d(e,100,8),p=d(e,108,8),f=d(e,116,8),m=d(e,124,12),g=d(e,136,12),_=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}(i),y=0===e[157]?null:h(e,157,100,t),b=h(e,265,32),v=h(e,297,32),k=d(e,329,8),w=d(e,337,8),x=l(e);if(256===x)return null;if(x!==d(e,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(n.equals(s,e.subarray(257,263)))e[345]&&(u=h(e,345,155,t)+"/"+u);else if(n.equals(a,e.subarray(257,263))&&n.equals(o,e.subarray(263,265)));else if(!r)throw Error("Invalid tar header: unknown format.");return 0===i&&u&&"/"===u[u.length-1]&&(i=5),{name:u,mode:c,uid:p,gid:f,size:m,mtime:new Date(1e3*g),type:_,linkname:y,uname:b,gname:v,devmajor:k,devminor:w,pax:null}}},93637:(e,t,r)=>{t.extract=r(60017),t.pack=r(57169)},57169:(e,t,r)=>{let{Readable:n,Writable:s,getStreamError:i}=r(43047),a=r(52888),o=r(91194),u=r(28271),l=a.alloc(1024);class c extends s{constructor(e,t,r){super({mapWritable:f,eagerOpen:!0}),this.written=0,this.header=t,this._callback=r,this._linkname=null,this._isLinkname="symlink"===t.type&&!t.linkname,this._isVoid="file"!==t.type&&"contiguous-file"!==t.type,this._finished=!1,this._pack=e,this._openCallback=null,null===this._pack._stream?this._pack._stream=this:this._pack._pending.push(this)}_open(e){this._openCallback=e,this._pack._stream===this&&this._continueOpen()}_continuePack(e){if(null===this._callback)return;let t=this._callback;this._callback=null,t(e)}_continueOpen(){null===this._pack._stream&&(this._pack._stream=this);let e=this._openCallback;if(this._openCallback=null,null!==e){if(this._pack.destroying)return e(Error("pack stream destroyed"));if(this._pack._finalized)return e(Error("pack stream is already finalized"));this._pack._stream=this,this._isLinkname||this._pack._encode(this.header),this._isVoid&&(this._finish(),this._continuePack(null)),e(null)}}_write(e,t){return this._isLinkname?(this._linkname=this._linkname?a.concat([this._linkname,e]):e,t(null)):this._isVoid?e.byteLength>0?t(Error("No body allowed for this entry")):t():(this.written+=e.byteLength,this._pack.push(e))?t():void(this._pack._drain=t)}_finish(){this._finished||(this._finished=!0,this._isLinkname&&(this.header.linkname=this._linkname?a.toString(this._linkname,"utf-8"):"",this._pack._encode(this.header)),p(this._pack,this.header.size),this._pack._done(this))}_final(e){if(this.written!==this.header.size)return e(Error("Size mismatch"));this._finish(),e(null)}_getError(){return i(this)||Error("tar entry destroyed")}_predestroy(){this._pack.destroy(this._getError())}_destroy(e){this._pack._done(this),this._continuePack(this._finished?null:this._getError()),e()}}class d extends n{constructor(e){super(e),this._drain=h,this._finalized=!1,this._finalizing=!1,this._pending=[],this._stream=null}entry(e,t,r){if(this._finalized||this.destroying)throw Error("already finalized or destroyed");"function"==typeof t&&(r=t,t=null),r||(r=h),e.size&&"symlink"!==e.type||(e.size=0),e.type||(e.type=function(e){switch(e&o.S_IFMT){case o.S_IFBLK:return"block-device";case o.S_IFCHR:return"character-device";case o.S_IFDIR:return"directory";case o.S_IFIFO:return"fifo";case o.S_IFLNK:return"symlink"}return"file"}(e.mode)),e.mode||(e.mode="directory"===e.type?493:420),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),"string"==typeof t&&(t=a.from(t));let n=new c(this,e,r);return a.isBuffer(t)?(e.size=t.byteLength,n.write(t),n.end()):n._isVoid,n}finalize(){if(this._stream||this._pending.length>0){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(l),this.push(null))}_done(e){e===this._stream&&(this._stream=null,this._finalizing&&this.finalize(),this._pending.length&&this._pending.shift()._continueOpen())}_encode(e){if(!e.pax){let t=u.encode(e);if(t){this.push(t);return}}this._encodePax(e)}_encodePax(e){let t=u.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.byteLength,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(u.encode(r)),this.push(t),p(this,t.byteLength),r.size=e.size,r.type=e.type,this.push(u.encode(r))}_doDrain(){let e=this._drain;this._drain=h,e()}_predestroy(){let e=i(this);for(this._stream&&this._stream.destroy(e);this._pending.length;){let t=this._pending.shift();t.destroy(e),t._continueOpen()}this._doDrain()}_read(e){this._doDrain(),e()}}function h(){}function p(e,t){(t&=511)&&e.push(l.subarray(0,512-t))}function f(e){return a.isBuffer(e)?e:a.from(e)}e.exports=function(e){return new d(e)}},82281:(e,t,r)=>{let n=r(45511),s=r(33568);e.exports=class{constructor(e="utf8"){switch(this.encoding=function(e){switch(e=e.toLowerCase()){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:throw Error("Unknown encoding: "+e)}}(e),this.encoding){case"utf8":this.decoder=new s;break;case"utf16le":case"base64":throw Error("Unsupported encoding: "+this.encoding);default:this.decoder=new n(this.encoding)}}push(e){return"string"==typeof e?e:this.decoder.decode(e)}write(e){return this.push(e)}end(e){let t="";return e&&(t=this.push(e)),t+=this.decoder.flush()}}},45511:(e,t,r)=>{let n=r(52888);e.exports=class{constructor(e){this.encoding=e}decode(e){return n.toString(e,this.encoding)}flush(){return""}}},33568:(e,t,r)=>{let n=r(52888);e.exports=class{constructor(){this.codePoint=0,this.bytesSeen=0,this.bytesNeeded=0,this.lowerBoundary=128,this.upperBoundary=191}decode(e){if(0===this.bytesNeeded){let t=!0;for(let r=Math.max(0,e.byteLength-4),n=e.byteLength;r<n&&t;r++)t=e[r]<=127;if(t)return n.toString(e,"utf8")}let t="";for(let r=0,n=e.byteLength;r<n;r++){let n=e[r];if(0===this.bytesNeeded){n<=127?t+=String.fromCharCode(n):n>=194&&n<=223?(this.bytesNeeded=1,this.codePoint=31&n):n>=224&&n<=239?(224===n?this.lowerBoundary=160:237===n&&(this.upperBoundary=159),this.bytesNeeded=2,this.codePoint=15&n):n>=240&&n<=244?(240===n&&(this.lowerBoundary=144),244===n&&(this.upperBoundary=143),this.bytesNeeded=3,this.codePoint=7&n):t+="�";continue}if(n<this.lowerBoundary||n>this.upperBoundary){this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191,t+="�";continue}this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|63&n,this.bytesSeen++,this.bytesSeen===this.bytesNeeded&&(t+=String.fromCodePoint(this.codePoint),this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0)}return t}flush(){let e=this.bytesNeeded>0?"�":"";return this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191,e}}},94643:e=>{e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),s=e[e.length-1];return"function"==typeof n&&n!==s&&Object.keys(s).forEach(function(e){n[e]=s[e]}),n}}},14564:(e,t,r)=>{"use strict";let n,s;r.d(t,{ZP:()=>sz});var i,a,o,u,l,c,d,h,p,f,m,g,_,y,b,v,k,w,x,S,T,C,O,E,N,A,L,I,P,R,j,F,M,Z,$,D,B,z,U,q,W,V,G,K,H,X,Y,J,Q,ee,et,er,en,es,ei,ea,eo,eu,el,ec,ed,eh,ep,ef,em,eg,e_,ey,eb,ev,ek,ew,ex,eS,eT,eC,eO,eE,eN,eA,eL,eI,eP,eR,ej,eF,eM,eZ,e$,eD,eB,ez,eU,eq,eW,eV,eG,eK,eH,eX,eY,eJ,eQ=r(39300),e0=r(19092),e1=r(32081),e3=r(68275),e2=r(15673),e6=Object.defineProperty,e8=Object.defineProperties,e4=Object.getOwnPropertyDescriptor,e5=Object.getOwnPropertyDescriptors,e9=Object.getOwnPropertyNames,e7=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable,tr=(e,t,r)=>t in e?e6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tn=(e,t)=>{for(var r in t||(t={}))te.call(t,r)&&tr(e,r,t[r]);if(e7)for(var r of e7(t))tt.call(t,r)&&tr(e,r,t[r]);return e},ts=(e,t)=>e8(e,e5(t)),ti=(e,t)=>function(){return e&&(t=(0,e[e9(e)[0]])(e=0)),t},ta=(e,t)=>{for(var r in t)e6(e,r,{get:t[r],enumerable:!0})},to=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of e9(t))te.call(e,s)||s===r||e6(e,s,{get:()=>t[s],enumerable:!(n=e4(t,s))||n.enumerable});return e},tu=e=>to(e6({},"__esModule",{value:!0}),e),tl=(e,t,r)=>new Promise((n,s)=>{var i=e=>{try{o(r.next(e))}catch(e){s(e)}},a=e=>{try{o(r.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,a);o((r=r.apply(e,t)).next())});function tc(e){return e instanceof String&&i.has(e)}function td(e){return i.get(e)||[]}var th=ti({"src/lib/args/pathspec.ts"(){i=new WeakMap}}),tp=ti({"src/lib/errors/git-error.ts"(){a=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),tf=ti({"src/lib/errors/git-response-error.ts"(){tp(),o=class extends a{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),tm=ti({"src/lib/errors/task-configuration-error.ts"(){tp(),u=class extends a{constructor(e){super(void 0,e)}}}});function tg(e){return"function"==typeof e?e:c}function t_(e){return"function"==typeof e&&e!==c}function ty(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function tb(e,t=0){return tk(e)&&e.length>t?e[t]:void 0}function tv(e,t=0){if(tk(e)&&e.length>t)return e[e.length-1-t]}function tk(e){return!!(e&&"number"==typeof e.length)}function tw(e="",t=!0,r="\n"){return e.split(r).reduce((e,r)=>{let n=t?r.trim():r;return n&&e.push(n),e},[])}function tx(e,t){return tw(e,!0).map(e=>t(e))}function tS(e){return(0,eQ.exists)(e,eQ.FOLDER)}function tT(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function tC(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function tO(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function tE(e){return Array.isArray(e)?e:[e]}function tN(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function tA(e){return tE(e).map(String)}function tL(e,t=0){if(null==e)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function tI(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function tP(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function tR(e,t){return Object.assign({},...t.map(t=>t in e?{[t]:e[t]}:{}))}function tj(e=0){return new Promise(t=>setTimeout(t,e))}function tF(e){if(!1!==e)return e}var tM=ti({"src/lib/utils/util.ts"(){l="\0",c=()=>{},d=Object.prototype.toString.call.bind(Object.prototype.toString)}});function tZ(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function t$(e,t){let r=tc(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function tD(e){return!!e&&"[object Object]"===d(e)}function tB(e){return"function"==typeof e}var tz=ti({"src/lib/utils/argument-filters.ts"(){tM(),th(),h=e=>Array.isArray(e),p=e=>"string"==typeof e,f=e=>Array.isArray(e)&&e.every(p),m=e=>p(e)||Array.isArray(e)&&e.every(p),g=e=>!(null==e||"number|boolean|function".includes(typeof e))&&(Array.isArray(e)||"string"==typeof e||"number"==typeof e.length)}}),tU=ti({"src/lib/utils/exit-codes.ts"(){var e;(e=_||{})[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",_=e}}),tq=ti({"src/lib/utils/git-output-streams.ts"(){y=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new y(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),tW=ti({"src/lib/utils/line-parser.ts"(){b=class{constructor(e,t){this.matches=[],this.parse=(e,t)=>(this.resetMatches(),!!this._regExp.every((t,r)=>this.addMatch(t,r,e(r)))&&!1!==this.useMatches(t,this.prepareMatches())),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},v=class extends b{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function tV(...e){let t=process.cwd(),r=Object.assign(tn({baseDir:t},k),...e.filter(e=>"object"==typeof e&&e));return r.baseDir=r.baseDir||t,r.trimmed=!0===r.trimmed,r}var tG=ti({"src/lib/utils/simple-git-options.ts"(){k={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function tK(e,t=[]){return tD(e)?Object.keys(e).reduce((t,r)=>{let n=e[r];return tc(n)?t.push(n):t$(n,["boolean"])?t.push(r+"="+n):t.push(r),t},t):t}function tH(e,t=0,r=!1){let n=[];for(let r=0,s=t<0?e.length:t;r<s;r++)"string|number".includes(typeof e[r])&&n.push(String(e[r]));return tK(tX(e),n),r||n.push(...function(e){let t="function"==typeof tv(e);return tZ(tv(e,t?1:0),h,[])}(e)),n}function tX(e){let t=tB(tv(e));return tZ(tv(e,t?1:0),tD)}function tY(e,t=!0){let r=tg(tv(e));return t||t_(r)?r:void 0}var tJ=ti({"src/lib/utils/task-options.ts"(){tz(),tM(),th()}});function tQ(e,t){return e(t.stdOut,t.stdErr)}function t0(e,t,r,n=!0){return tE(r).forEach(r=>{for(let s=tw(r,n),i=0,a=s.length;i<a;i++){let r=(e=0)=>{if(!(i+e>=a))return s[i+e]};t.some(({parse:t})=>t(r,e))}}),e}var t1=ti({"src/lib/utils/task-parser.ts"(){tM()}}),t3={};ta(t3,{ExitCodes:()=>_,GitOutputStreams:()=>y,LineParser:()=>b,NOOP:()=>c,NULL:()=>l,RemoteLineParser:()=>v,append:()=>tT,appendTaskOptions:()=>tK,asArray:()=>tE,asCamelCase:()=>tN,asFunction:()=>tg,asNumber:()=>tL,asStringArray:()=>tA,bufferToString:()=>tP,callTaskParser:()=>tQ,createInstanceConfig:()=>tV,delay:()=>tj,filterArray:()=>h,filterFunction:()=>tB,filterHasLength:()=>g,filterPlainObject:()=>tD,filterPrimitives:()=>t$,filterString:()=>p,filterStringArray:()=>f,filterStringOrStringArray:()=>m,filterType:()=>tZ,first:()=>tb,folderExists:()=>tS,forEachLineWithContent:()=>tx,getTrailingOptions:()=>tH,including:()=>tC,isUserFunction:()=>t_,last:()=>tv,objectToString:()=>d,orVoid:()=>tF,parseStringResponse:()=>t0,pick:()=>tR,prefixedArray:()=>tI,remove:()=>tO,splitOn:()=>ty,toLinesWithContent:()=>tw,trailingFunctionArgument:()=>tY,trailingOptionsArgument:()=>tX});var t2=ti({"src/lib/utils/index.ts"(){tz(),tU(),tq(),tW(),tG(),tJ(),t1(),tM()}}),t6={};function t8(e){switch(e){case"bare":return t5();case"root":return t4()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:x,parser:S}}function t4(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:x,parser:e=>/^\.(git)?$/.test(e.trim())}}function t5(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:x,parser:S}}ta(t6,{CheckRepoActions:()=>w,checkIsBareRepoTask:()=>t5,checkIsRepoRootTask:()=>t4,checkIsRepoTask:()=>t8});var t9=ti({"src/lib/tasks/check-is-repo.ts"(){var e;t2(),(e=w||{}).BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",w=e,x=({exitCode:e},t,r,n)=>{if(128===e&&/(Not a git repository|Kein Git-Repository)/i.test(String(t)))return r(Buffer.from("false"));n(t)},S=e=>"true"===e.trim()}}),t7=ti({"src/lib/responses/CleanSummary.ts"(){t2(),T=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},C=/^[a-z]+\s*/i,O=/^[a-z]+\s+[a-z]+\s*/i,E=/\/$/}}),re={};function rt(e){return{commands:N,format:"empty",parser:e}}function rr(e){return{commands:N,format:"empty",parser(){throw"string"==typeof e?new u(e):e}}}function rn(e,t=!1){return{commands:e,format:"utf-8",parser:e=>t?String(e).trim():e}}function rs(e){return{commands:e,format:"buffer",parser:e=>e}}function ri(e){return"buffer"===e.format}function ra(e){return"empty"===e.format||!e.commands.length}ta(re,{EMPTY_COMMANDS:()=>N,adhocExecTask:()=>rt,configurationErrorTask:()=>rr,isBufferTask:()=>ri,isEmptyTask:()=>ra,straightThroughBufferTask:()=>rs,straightThroughStringTask:()=>rn});var ro=ti({"src/lib/tasks/task.ts"(){tm(),N=[]}}),ru={};function rl(e,t){let r,n,s;let{cleanMode:i,options:a,valid:o}=(n=[],s={cleanMode:!1,options:!0},e.replace(/[^a-z]i/g,"").split("").forEach(e=>{var t;"f"===e||"n"===e?(r=e,s.cleanMode=!0):s.options=s.options&&(t=n[n.length]=`-${e}`,/^-[a-z]$/i.test(t)&&R.has(t.charAt(1)))}),{cleanMode:r,options:n,valid:s});return i?o.options?(a.push(...t),a.some(rh))?rr(A):rc(i,a):rr(I+JSON.stringify(e)):rr(L)}function rc(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser:t=>(function(e,t){let r=new T(e),n=e?O:C;return tw(t).forEach(e=>{let t=e.replace(n,"");r.paths.push(t),(E.test(t)?r.folders:r.files).push(t)}),r})("n"===e,t)}}function rd(e){return Array.isArray(e)&&e.every(e=>R.has(e))}function rh(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:"--interactive"===e}ta(ru,{CONFIG_ERROR_INTERACTIVE_MODE:()=>A,CONFIG_ERROR_MODE_REQUIRED:()=>L,CONFIG_ERROR_UNKNOWN_OPTION:()=>I,CleanOptions:()=>P,cleanTask:()=>rc,cleanWithOptionsTask:()=>rl,isCleanOptionsArray:()=>rd});var rp=ti({"src/lib/tasks/clean.ts"(){var e;t7(),t2(),ro(),A="Git clean interactive mode is not supported",L='Git clean mode parameter ("n" or "f") is required',I="Git clean unknown option found in: ",(e=P||{}).DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",R=new Set(["i",...tA(Object.values(P=e))])}});function*rf(e,t=null){let r=e.split("\0");for(let e=0,n=r.length-1;e<n;){let n=r[e++].replace(/^(file):/,""),s=r[e++],i=t;if(s.includes("\n")){let e=ty(s,"\n");i=e[0],s=e[1]}yield{file:n,key:i,value:s}}}var rm=ti({"src/lib/responses/ConfigList.ts"(){t2(),j=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=tv(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function rg(e,t){return"string"==typeof e&&F.hasOwnProperty(e)?e:t}var r_=ti({"src/lib/tasks/config.ts"(){var e;rm(),t2(),(e=F||{}).system="system",e.global="global",e.local="local",e.worktree="worktree",F=e}}),ry=ti({"src/lib/tasks/diff-name-status.ts"(){var e;(e=M||{}).ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",Z=new Set(Object.values(M=e))}}),rb=ti({"src/lib/tasks/grep.ts"(){t2(),ro(),$=["-h"],D=Symbol("grepQuery"),z=class{constructor(){this[B]=[]}*[(B=D,Symbol.iterator)](){for(let e of this[D])yield e}and(...e){return e.length&&this[D].push("--and","(",...tI(e,"-e"),")"),this}param(...e){return this[D].push(...tI(e,"-e")),this}}}}),rv={};function rk(e,t){let r=["reset"];return rx(e)&&r.push(`--${e}`),r.push(...t),rn(r)}function rw(e){if(rx(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function rx(e){return q.includes(e)}ta(rv,{ResetMode:()=>U,getResetMode:()=>rw,resetTask:()=>rk});var rS=ti({"src/lib/tasks/reset.ts"(){var e;ro(),(e=U||{}).MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",q=Array.from(Object.values(U=e))}});function rT(e,t,r){return t&&String(t).replace(/\s*/,"")?(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}:r?(t,...n)=>{e(t,...n),r(t,...n)}:e}function rC(e,t,r,n=e0("simple-git")){let s=e&&`[${e}]`||"",i=[],a="string"==typeof t?n.extend(t):t,o=function(e,t,{namespace:r}){if("string"==typeof e)return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}(tZ(t,p),a,n);return function t(r){let i=r&&`[${r}]`||"",o=a&&rT(a,i)||c,l=rT(n,`${s} ${i}`,o);return Object.assign(a?o:l,{label:e,sibling:u,info:l,step:t})}(r);function u(t,r){return tT(i,rC(e,o.replace(/^[^:]+/,t),r,n))}}var rO=ti({"src/lib/git-logger.ts"(){t2(),e0.formatters.L=e=>String(g(e)?e.length:"-"),e0.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):d(e)}}),rE=ti({"src/lib/runners/tasks-pending-queue.ts"(){tp(),rO(),(V=W=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=W.getName(e.commands[0]);return{task:e,logger:rC(this.logLabel,t),name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(0!==this._queue.size)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new a(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++W.counter}`}}).counter=0}});function rN(e,t){return{method:tb(e.commands)||"",commands:t}}function rA(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var rL=ti({"src/lib/runners/git-executor-chain.ts"(){tp(),ro(),t2(),rE(),G=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new V}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return tl(this,null,function*(){let t=yield this._scheduler.next();try{let{logger:t}=this._queue.attempt(e);return yield ra(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t)}catch(t){throw this.onFatalException(e,t)}finally{this._queue.complete(e),t()}})}onFatalException(e,t){let r=t instanceof a?Object.assign(t,{task:e}):new a(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return tl(this,null,function*(){let r=this._plugins.exec("spawn.binary","",rN(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],rN(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),i=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return(t("passing response to task's parser as a %s",e.format),ri(e))?tQ(e.parser,i):tQ(e.parser,i.asStrings())})}attemptEmptyTask(e,t){return tl(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:i,stdOut:a,stdErr:o}=r;return new Promise((u,l)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:c}=this._plugins.exec("task.error",{error:i},tn(tn({},rN(e,t)),r));return c&&e.onError?(n.info("exitCode=%s handling with custom error handler"),e.onError(r,c,e=>{n.info("custom error handler treated as success"),n("custom error returned a %s",d(e)),u(new y(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(o)))},l)):c?(n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,o.length,i),l(c)):void(n.info("retrieving task output complete"),u(new y(Buffer.concat(a),Buffer.concat(o))))})}gitResponse(e,t,r,n,s){return tl(this,null,function*(){let i=s.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},rN(e,e.commands));return new Promise(o=>{let u=[],l=[];s.info("%s %o",t,r),s("%O",a);let c=this._beforeSpawn(e,r);if(c)return o({stdOut:u,stdErr:l,exitCode:9901,rejection:c});this._plugins.exec("spawn.before",void 0,ts(tn({},rN(e,r)),{kill(e){c=e||c}}));let d=(0,e1.spawn)(t,r,a);d.stdout.on("data",rA(u,"stdOut",s,i.step("stdOut"))),d.stderr.on("data",rA(l,"stdErr",s,i.step("stdErr"))),d.on("error",e=>{s("[ERROR] child process exception %o",e),l.push(Buffer.from(String(e.stack),"ascii"))}),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,d.stdout,d.stderr,[...r])),this._plugins.exec("spawn.after",void 0,ts(tn({},rN(e,r)),{spawned:d,close(e,t){o({stdOut:u,stdErr:l,exitCode:e,rejection:c||t})},kill(e){d.killed||(c=e,d.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,ts(tn({},rN(e,t)),{kill(e){r=e||r}})),r}}}}),rI={};ta(rI,{GitExecutor:()=>K});var rP=ti({"src/lib/runners/git-executor.ts"(){rL(),K=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new G(this,this._scheduler,this._plugins)}chain(){return new G(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}}),rR=ti({"src/lib/task-callback.ts"(){tf(),t2()}});function rj(e,t){return rt(r=>{if(!tS(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var rF=ti({"src/lib/tasks/change-working-directory.ts"(){t2(),ro()}});function rM(e){let t=["checkout",...e];return"-b"===t[1]&&t.includes("-B")&&(t[1]=tO(t,"-B")),rn(t)}var rZ=ti({"src/lib/tasks/checkout.ts"(){t2(),ro()}}),r$=ti({"src/lib/tasks/count-objects.ts"(){t2(),H=new b(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=tN(t);e.hasOwnProperty(n)&&(e[n]=tL(r))})}});function rD(e){return t0({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},X,e)}var rB=ti({"src/lib/parsers/parse-commit.ts"(){t2(),X=[new b(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new b(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();n&&n.includes("@")&&(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new b(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new b(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;"-"===n?e.summary.deletions=s:"+"===n&&(e.summary.insertions=s)})]}}),rz=ti({"src/lib/tasks/commit.ts"(){rB(),t2(),ro()}}),rU=ti({"src/lib/tasks/first-commit.ts"(){t2(),ro()}}),rq=ti({"src/lib/tasks/hash-object.ts"(){ro()}}),rW=ti({"src/lib/responses/InitSummary.ts"(){Y=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},J=/^Init.+ repository in (.+)$/,Q=/^Rein.+ in (.+)$/}}),rV=ti({"src/lib/tasks/init.ts"(){rW(),ee="--bare"}});function rG(e){for(let t=0;t<e.length;t++){let r=et.exec(e[t]);if(r)return`--${r[1]}`}return""}function rK(e){return et.test(e)}var rH=ti({"src/lib/args/log-format.ts"(){et=/^--(stat|numstat|name-only|name-status)(=|$)/}}),rX=ti({"src/lib/responses/DiffSummary.ts"(){er=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function rY(e=""){let t=ea[e];return e=>t0(new er,t,e,!1)}var rJ=ti({"src/lib/parsers/parse-diff-summary.ts"(){rH(),rX(),ry(),t2(),en=[new b(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:tL(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new b(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:tL(r),after:tL(n),binary:!0})}),new b(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=tL(t),e.insertions=tL(null==n?void 0:n[1]),e.deletions=tL(null==s?void 0:s[1])})],es=[new b(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=tL(t),i=tL(r);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new b(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],ei=[new b(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ea={"":en,"--stat":en,"--numstat":es,"--name-status":[new b(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,i])=>{e.changed++,e.files.push({file:null!=i?i:n,changes:0,status:tF(Z.has(t)&&t),insertions:0,deletions:0,binary:!1})})],"--name-only":ei}}});function rQ(e=el,t=ec,r=""){let n=rY(r);return function(r){let s=tw(r,!0,eo).map(function(r){var s;let i=r.trim().split(eu),a=(s=i[0].trim().split(e),t.reduce((e,t,r)=>(e[t]=s[r]||"",e),Object.create({diff:null})));return i.length>1&&i[1].trim()&&(a.diff=n(i[1])),a});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var r0=ti({"src/lib/parsers/parse-list-log-summary.ts"(){t2(),rJ(),rH(),eo="\xf2\xf2\xf2\xf2\xf2\xf2 ",eu=" \xf2\xf2",el=" \xf2 ",ec=["hash","date","message","refs","author_name","author_email"]}}),r1={};function r3(e){let t=rG(e),r=["diff"];return""===t&&(t="--stat",r.push("--stat=4096")),r.push(...e),r2(r)||{commands:r,format:"utf-8",parser:rY(t)}}function r2(e){let t=e.filter(rK);return t.length>1?rr(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`):t.length&&e.includes("-z")?rr(`Summary flag ${t} parsing is not compatible with null termination option '-z'`):void 0}ta(r1,{diffSummaryTask:()=>r3,validateLogFormatConfig:()=>r2});var r6=ti({"src/lib/tasks/diff.ts"(){rH(),rJ(),ro()}});function r8(e={},t=[]){let r=tZ(e.splitter,p,el),[n,s]=function(e,t){let r=[],n=[];return Object.keys(e).forEach(t=>{r.push(t),n.push(String(e[t]))}),[r,n.join(t)]}(!t$(e.format)&&e.format?e.format:{hash:"%H",date:!1===e.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:!1!==e.mailMap?"%aN":"%an",author_email:!1!==e.mailMap?"%aE":"%ae"},r),a=[],o=[`--pretty=format:${eo}${s}${eu}`,...t],u=e.n||e["max-count"]||e.maxCount;if(u&&o.push(`--max-count=${u}`),e.from||e.to){let t=!1!==e.symmetric?"...":"..";a.push(`${e.from||""}${t}${e.to||""}`)}return p(e.file)&&o.push("--follow",function(...e){let t=new String(e);return i.set(t,e),t}(e.file)),tK(Object.keys(e).reduce((t,r)=>(r in ed||(t[r]=e[r]),t),{}),o),{fields:n,splitter:r,commands:[...o,...a]}}var r4=ti({"src/lib/tasks/log.ts"(){var e;rH(),th(),r0(),t2(),ro(),r6(),(e=ed||{})[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",ed=e}}),r5=ti({"src/lib/responses/MergeSummary.ts"(){eh=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},ep=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),r9=ti({"src/lib/responses/PullSummary.ts"(){ef=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},em=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function r7(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function ne(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:tL(t&&t[1]||"0"),delta:tL(r&&r[1]||"0")}}var nt=ti({"src/lib/parsers/parse-remote-objects.ts"(){t2(),eg=[new v(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase();Object.assign(r7(e.remoteMessages),{[n]:tL(r)})}),new v(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase();Object.assign(r7(e.remoteMessages),{[n]:tL(r)})}),new v(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=r7(e.remoteMessages);s.total=ne(t),s.reused=ne(r),s.packReused=tL(n)})]}});function nr(e,t){return t0({remoteMessages:new ey},e_,t)}var nn=ti({"src/lib/parsers/parse-remote-messages.ts"(){t2(),nt(),e_=[new v(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...eg,new v([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new v([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:tL(t),summary:r,url:n}})],ey=class{constructor(){this.all=[]}}}}),ns=ti({"src/lib/parsers/parse-pull.ts"(){r9(),t2(),nn(),eb=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,ev=/^(create|delete) mode \d+ (.+)/,ek=[new b(/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new b(eb,(e,[t,,r,,n])=>(void 0!==r||void 0!==n)&&(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0)),new b(ev,(e,[t,r])=>{tT(e.files,r),tT("create"===t?e.created:e.deleted,r)})],ew=[new b(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new b(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new b(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],ex=(e,t)=>t0(new ef,ek,[e,t]),eS=(e,t)=>Object.assign(new ef,ex(e,t),nr(e,t))}}),ni=ti({"src/lib/parsers/parse-merge.ts"(){r5(),t2(),ns(),eT=[new b(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new b(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new eh(t,r))}),new b(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new eh(t,r,{deleteRef:n}))}),new b(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new eh(t,null))}),new b(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],eC=(e,t)=>Object.assign(eO(e,t),eS(e,t)),eO=e=>t0(new ep,eT,e)}});function na(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(e,t){let r=eC(e,t);if(r.failed)throw new o(r);return r}}:rr("Git.merge requires at least one option")}var no=ti({"src/lib/tasks/merge.ts"(){tf(),ni(),ro()}}),nu=ti({"src/lib/parsers/parse-push.ts"(){t2(),nn(),eE=[new b(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new b(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=ts(tn({},e.ref||{}),{local:t})}),new b(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(function(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}(t,r,n))}),new b(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=ts(tn({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new b(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],eN=(e,t)=>{let r=eA(e,t),n=nr(e,t);return tn(tn({},r),n)},eA=(e,t)=>t0({pushed:[]},eE,[e,t])}}),nl={};function nc(e={},t){return tT(t,"--tags"),nd(e,t)}function nd(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),tO(r,"-v"),tT(r,"--verbose"),tT(r,"--porcelain"),{commands:r,format:"utf-8",parser:eN}}ta(nl,{pushTagsTask:()=>nc,pushTask:()=>nd});var nh=ti({"src/lib/tasks/push.ts"(){nu(),t2()}}),np=ti({"src/lib/tasks/show.ts"(){t2(),ro()}}),nf=ti({"src/lib/responses/FileStatusSummary.ts"(){eL=/^(.+) -> (.+)$/,eI=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,"R"===t+r){let t=eL.exec(e)||[null,e,e];this.from=t[1]||"",this.path=t[2]||""}}}}});function nm(e){let[t,r]=e.split(l);return{from:r||t,to:t}}function ng(e,t,r){return[`${e}${t}`,r]}function n_(e,...t){return t.map(t=>ng(e,t,(e,t)=>tT(e.conflicted,t)))}var ny=ti({"src/lib/responses/StatusSummary.ts"(){t2(),nf(),eP=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},eR=new Map([ng(" ","A",(e,t)=>tT(e.created,t)),ng(" ","D",(e,t)=>tT(e.deleted,t)),ng(" ","M",(e,t)=>tT(e.modified,t)),ng("A"," ",(e,t)=>tT(e.created,t)&&tT(e.staged,t)),ng("A","M",(e,t)=>tT(e.created,t)&&tT(e.staged,t)&&tT(e.modified,t)),ng("D"," ",(e,t)=>tT(e.deleted,t)&&tT(e.staged,t)),ng("M"," ",(e,t)=>tT(e.modified,t)&&tT(e.staged,t)),ng("M","M",(e,t)=>tT(e.modified,t)&&tT(e.staged,t)),ng("R"," ",(e,t)=>{tT(e.renamed,nm(t))}),ng("R","M",(e,t)=>{let r=nm(t);tT(e.renamed,r),tT(e.modified,r.to)}),ng("!","!",(e,t)=>{tT(e.ignored=e.ignored||[],t)}),ng("?","?",(e,t)=>tT(e.not_added,t)),...n_("A","A","U"),...n_("D","D","U"),...n_("U","A","D","U"),["##",(e,t)=>{let r;r=/ahead (\d+)/.exec(t),e.ahead=r&&+r[1]||0,r=/behind (\d+)/.exec(t),e.behind=r&&+r[1]||0,r=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=r&&r[1],r=/\.{3}(\S*)/.exec(t),e.tracking=r&&r[1],r=/\son\s([\S]+)$/.exec(t),e.current=r&&r[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),ej=function(e){let t=e.split(l),r=new eP;for(let e=0,n=t.length;e<n;){let n=t[e++].trim();n&&("R"===n.charAt(0)&&(n+=l+(t[e++]||"")),function(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(t,r,n){let s=`${t}${r}`,i=eR.get(s);i&&i(e,n),"##"!==s&&"!!"!==s&&e.files.push(new eI(n.replace(/\0.+$/,""),t,r))}}(r,n))}return r}}}),nb=ti({"src/lib/tasks/status.ts"(){ny(),eF=["--null","-z"]}});function nv(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function nk(e){return e===eM?nv(0,0,0,"",!1):t0(nv(0,0,0,e),eZ,e)}var nw=ti({"src/lib/tasks/version.ts"(){t2(),eM="installed=false",eZ=[new b(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,nv(tL(t),tL(r),tL(n),s))}),new b(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,nv(tL(t),tL(r),n,s))})]}}),nx={};ta(nx,{SimpleGitApi:()=>e$});var nS=ti({"src/lib/simple-git-api.ts"(){rR(),rF(),rZ(),r$(),rz(),r_(),rU(),rb(),rq(),rV(),r4(),no(),nh(),np(),nb(),ro(),nw(),t2(),Object.assign((e$=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&function(e,t,r=c){t.then(e=>{r(null,e)},t=>{let n;(null==t?void 0:t.task)===e&&r(t instanceof o?(n=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),n=c},Object.create(t,Object.getOwnPropertyNames(t.git).reduce(function(e,r){return r in t||(e[r]={enumerable:!1,configurable:!1,get:()=>(n(r),t.git[r])}),e},{}))):t,void 0)})}(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(rn(["add",...tE(e)]),tY(arguments))}cwd(e){let t=tY(arguments);return"string"==typeof e?this._runTask(rj(e,this._executor),t):"string"==typeof(null==e?void 0:e.path)?this._runTask(rj(e.path,e.root&&this._executor||void 0),t):this._runTask(rr("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(function(e,t){let r=["hash-object",e];return t&&r.push("-w"),rn(r,!0)}(e,!0===t),tY(arguments))}init(e){return this._runTask(function(e=!1,t,r){let n=["init",...r];return e&&!n.includes(ee)&&n.splice(1,0,ee),{commands:n,format:"utf-8",parser:e=>(function(e,t,r){let n;let s=String(r).trim();if(n=J.exec(s))return new Y(e,t,!1,n[1]);if(n=Q.exec(s))return new Y(e,t,!0,n[1]);let i="",a=s.split(" ");for(;a.length;)if("in"===a.shift()){i=a.join(" ");break}return new Y(e,t,/^re/i.test(s),i)})(n.includes("--bare"),t,e)}}(!0===e,this._executor.cwd,tH(arguments)),tY(arguments))}merge(){return this._runTask(na(tH(arguments)),tY(arguments))}mergeFromTo(e,t){return p(e)&&p(t)?this._runTask(na([e,t,...tH(arguments)]),tY(arguments,!1)):this._runTask(rr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=nd({remote:tZ(arguments[0],p),branch:tZ(arguments[1],p)},tH(arguments));return this._runTask(e,tY(arguments))}stash(){return this._runTask(rn(["stash",...tH(arguments)]),tY(arguments))}status(){var e;return this._runTask((e=tH(arguments),{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(e=>!eF.includes(e))],parser:e=>ej(e)}),tY(arguments))}}).prototype,{checkout(){return this._runTask(rM(tH(arguments,1)),tY(arguments))},checkoutBranch(e,t){return this._runTask(rM(["-b",e,t,...tH(arguments)]),tY(arguments))},checkoutLocalBranch(e){return this._runTask(rM(["-b",e,...tH(arguments)]),tY(arguments))}},{commit(e,...t){var r,n,s;let i=tY(arguments),a=!m(e)&&rr("git.commit: requires the commit message to be supplied as a string/string[]")||(r=tE(e),n=tE(tZ(t[0],m,[])),s=[...tZ(t[1],h,[]),...tH(arguments,0,!0)],{commands:["-c","core.abbrev=40","commit",...tI(r,"-m"),...n,...s],format:"utf-8",parser:rD});return this._runTask(a,i)}},{addConfig(e,t,...r){return this._runTask(function(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser:e=>e}}(e,t,!0===r[0],rg(r[1],"local")),tY(arguments))},getConfig(e,t){return this._runTask(function(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser:t=>(function(e,t){let r=null,n=[],s=new Map;for(let i of rf(e,t))i.key===t&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}})(t,e)}}(e,rg(t,void 0)),tY(arguments))},listConfig(...e){return this._runTask(function(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser:e=>(function(e){let t=new j;for(let r of rf(e))t.addValue(r.file,String(r.key),r.value);return t})(e)}}(rg(e[0],void 0)),tY(arguments))}},{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:e=>t0({count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0},[H],e)})}},{firstCommit(){return this._runTask(rn(["rev-list","--max-parents=0","HEAD"],!0),tY(arguments))}},{grep(e){let t=tY(arguments),r=tH(arguments);for(let e of $)if(r.includes(e))return this._runTask(rr(`git.grep: use of "${e}" is not supported.`),t);"string"==typeof e&&(e=(function(...e){return new z().param(...e)})().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser:e=>(function(e){let t=new Set,r={};return tx(e,e=>{let[n,s,i]=e.split(l);t.add(n),(r[n]=r[n]||[]).push({line:tL(s),path:n,preview:i})}),{paths:t,results:r}})(e)},t)}},{log(...e){let t=tY(arguments),r=r8(tX(arguments),tZ(arguments[0],h)),n=function(e,t){return p(e)&&p(t)&&rr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...e)||r2(r.commands)||function(e,t,r){let n=rQ(e,t,rG(r));return{commands:["log",...r],format:"utf-8",parser:n}}(r.splitter,r.fields,r.commands);return this._runTask(n,t)}},{showBuffer(){let e=["show",...tH(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(rs(e),tY(arguments))},show(){let e=["show",...tH(arguments,1)];return this._runTask(rn(e),tY(arguments))}},{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:nk,onError(e,t,r,n){if(-2===e.exitCode)return r(Buffer.from(eM));n(t)}})}})}}),nT={};ta(nT,{Scheduler:()=>eB});var nC=ti({"src/lib/runners/scheduler.ts"(){let e;t2(),rO(),e=0,eD=()=>{e++;let{promise:t,done:r}=(0,e3.dD)();return{promise:t,done:r,id:e}},eB=class{constructor(e=2){this.concurrency=e,this.logger=rC("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=tT(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),tO(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=tT(this.pending,eD());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),nO={};function nE(e,t){return rn(["apply",...t,...e])}ta(nO,{applyPatchTask:()=>nE});var nN=ti({"src/lib/tasks/apply-patch.ts"(){ro()}}),nA=ti({"src/lib/responses/BranchDeleteSummary.ts"(){ez=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function nL(e,t){return 1===t&&eU.test(e)}var nI=ti({"src/lib/parsers/parse-branch-delete.ts"(){nA(),t2(),eU=/^error[^']+'([^']+)'/m,eq=[new b(/(\S+)\s+\(\S+\s([^)]+)\)/,(e,[t,r])=>{let n={branch:t,hash:r,success:!0};e.all.push(n),e.branches[t]=n}),new b(eU,(e,[t])=>{let r={branch:t,hash:null,success:!1};e.errors.push(r),e.all.push(r),e.branches[t]=r})],eW=(e,t)=>t0(new ez,eq,[e,t])}}),nP=ti({"src/lib/responses/BranchSummary.ts"(){eV=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){"*"===e&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:"*"===e,linkedWorkTree:"+"===e,name:r,commit:n,label:s}}}}});function nR(e){return e?e.charAt(0):""}function nj(e){return t0(new eV,eG,e)}var nF=ti({"src/lib/parsers/parse-branch.ts"(){nP(),t2(),eG=[new b(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(nR(t),!0,r,n,s)}),new b(RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(nR(t),!1,r,n,s)})]}}),nM={};function nZ(e){let t=["-d","-D","--delete"];return e.some(e=>t.includes(e))}function n$(e){let t=nZ(e),r=["branch",...e];return 1===r.length&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser:(e,r)=>t?eW(e,r).all[0]:nj(e)}}function nD(){return{format:"utf-8",commands:["branch","-v"],parser:nj}}function nB(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser:(e,t)=>eW(e,t),onError({exitCode:e,stdOut:t},r,n,s){if(!nL(String(r),e))return s(r);n(t)}}}function nz(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser:(t,r)=>eW(t,r).branches[e],onError({exitCode:e,stdErr:t,stdOut:n},s,i,a){if(!nL(String(s),e))return a(s);throw new o(r.parser(tP(n),tP(t)),String(s))}};return r}ta(nM,{branchLocalTask:()=>nD,branchTask:()=>n$,containsDeleteBranchCommand:()=>nZ,deleteBranchTask:()=>nz,deleteBranchesTask:()=>nB});var nU=ti({"src/lib/tasks/branch.ts"(){tf(),nI(),nF(),t2()}}),nq=ti({"src/lib/responses/CheckIgnore.ts"(){eK=e=>e.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),nW={};function nV(e){return{commands:["check-ignore",...e],format:"utf-8",parser:eK}}ta(nW,{checkIgnoreTask:()=>nV});var nG=ti({"src/lib/tasks/check-ignore.ts"(){nq()}}),nK={};function nH(e){return/^--upload-pack(=|$)/.test(e)}function nX(e,t,r){let n=["clone",...r];return(p(e)&&n.push(e),p(t)&&n.push(t),n.find(nH))?rr("git.fetch: potential exploit argument blocked."):rn(n)}function nY(e,t,r){return tT(r,"--mirror"),nX(e,t,r)}ta(nK,{cloneMirrorTask:()=>nY,cloneTask:()=>nX});var nJ=ti({"src/lib/tasks/clone.ts"(){ro(),t2()}});function nQ(e,t){return t0({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},eH,[e,t])}var n0=ti({"src/lib/parsers/parse-fetch.ts"(){t2(),eH=[new b(/From (.+)$/,(e,[t])=>{e.remote=t}),new b(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new b(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new b(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new b(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),n1={};function n3(e){return/^--upload-pack(=|$)/.test(e)}function n2(e,t,r){let n=["fetch",...r];return(e&&t&&n.push(e,t),n.find(n3))?rr("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:nQ}}ta(n1,{fetchTask:()=>n2});var n6=ti({"src/lib/tasks/fetch.ts"(){n0(),ro()}});function n8(e){return t0({moves:[]},eX,e)}var n4=ti({"src/lib/parsers/parse-move.ts"(){t2(),eX=[new b(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),n5={};function n9(e,t){return{commands:["mv","-v",...tE(e),t],format:"utf-8",parser:n8}}ta(n5,{moveTask:()=>n9});var n7=ti({"src/lib/tasks/move.ts"(){n4(),t2()}}),se={};function st(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser:(e,t)=>eS(e,t),onError(e,t,r,n){let s=function(e,t){let r=t0(new em,ew,[e,t]);return r.message&&r}(tP(e.stdOut),tP(e.stdErr));if(s)return n(new o(s));n(t)}}}ta(se,{pullTask:()=>st});var sr=ti({"src/lib/tasks/pull.ts"(){tf(),ns(),t2()}});function sn(e){let t={};return si(e,([e])=>t[e]={name:e}),Object.values(t)}function ss(e){let t={};return si(e,([e,r,n])=>{t.hasOwnProperty(e)||(t[e]={name:e,refs:{fetch:"",push:""}}),n&&r&&(t[e].refs[n.replace(/[^a-z]/g,"")]=r)}),Object.values(t)}function si(e,t){tx(e,e=>t(e.split(/\s+/)))}var sa=ti({"src/lib/responses/GetRemoteSummary.ts"(){t2()}}),so={};function su(e,t,r){return rn(["remote","add",...r,e,t])}function sl(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?ss:sn}}function sc(e){let t=[...e];return"ls-remote"!==t[0]&&t.unshift("ls-remote"),rn(t)}function sd(e){let t=[...e];return"remote"!==t[0]&&t.unshift("remote"),rn(t)}function sh(e){return rn(["remote","remove",e])}ta(so,{addRemoteTask:()=>su,getRemotesTask:()=>sl,listRemotesTask:()=>sc,remoteTask:()=>sd,removeRemoteTask:()=>sh});var sp=ti({"src/lib/tasks/remote.ts"(){sa(),ro()}}),sf={};function sm(e={},t){let r=r8(e),n=["stash","list",...r.commands,...t],s=rQ(r.splitter,r.fields,rG(n));return r2(n)||{commands:n,format:"utf-8",parser:s}}ta(sf,{stashListTask:()=>sm});var sg=ti({"src/lib/tasks/stash-list.ts"(){rH(),r0(),r6(),r4()}}),s_={};function sy(e,t){return sv(["add",e,t])}function sb(e){return sv(["init",...e])}function sv(e){let t=[...e];return"submodule"!==t[0]&&t.unshift("submodule"),rn(t)}function sk(e){return sv(["update",...e])}ta(s_,{addSubModuleTask:()=>sy,initSubModuleTask:()=>sb,subModuleTask:()=>sv,updateSubModuleTask:()=>sk});var sw=ti({"src/lib/tasks/sub-module.ts"(){ro()}});function sx(e,t){return e===t?0:e>t?1:-1}function sS(e){return e.trim()}function sT(e){return"string"==typeof e&&parseInt(e.replace(/^\D+/g,""),10)||0}var sC=ti({"src/lib/responses/TagList.ts"(){eY=class{constructor(e,t){this.all=e,this.latest=t}},eJ=function(e,t=!1){let r=e.split("\n").map(sS).filter(Boolean);t||r.sort(function(e,t){let r=e.split("."),n=t.split(".");if(1===r.length||1===n.length)return function(e,t){let r=isNaN(e);return r!==isNaN(t)?r?1:-1:r?sx(e,t):0}(sT(r[0]),sT(n[0]));for(let e=0,t=Math.max(r.length,n.length);e<t;e++){let t=sx(sT(r[e]),sT(n[e]));if(t)return t}return 0});let n=t?r[0]:[...r].reverse().find(e=>e.indexOf(".")>=0);return new eY(r,n)}}}),sO={};function sE(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:"utf-8",commands:["tag","-l",...e],parser:e=>eJ(e,t)}}function sN(e){return{format:"utf-8",commands:["tag",e],parser:()=>({name:e})}}function sA(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser:()=>({name:e})}}ta(sO,{addAnnotatedTagTask:()=>sA,addTagTask:()=>sN,tagListTask:()=>sE});var sL=ti({"src/lib/tasks/tag.ts"(){sC()}}),sI=(n={"src/git.js"(e,t){var{GitExecutor:r}=(rP(),tu(rI)),{SimpleGitApi:n}=(nS(),tu(nx)),{Scheduler:s}=(nC(),tu(nT)),{configurationErrorTask:i}=(ro(),tu(re)),{asArray:a,filterArray:o,filterPrimitives:u,filterString:l,filterStringOrStringArray:c,filterType:d,getTrailingOptions:h,trailingFunctionArgument:p,trailingOptionsArgument:f}=(t2(),tu(t3)),{applyPatchTask:m}=(nN(),tu(nO)),{branchTask:g,branchLocalTask:_,deleteBranchesTask:y,deleteBranchTask:b}=(nU(),tu(nM)),{checkIgnoreTask:v}=(nG(),tu(nW)),{checkIsRepoTask:k}=(t9(),tu(t6)),{cloneTask:w,cloneMirrorTask:x}=(nJ(),tu(nK)),{cleanWithOptionsTask:S,isCleanOptionsArray:T}=(rp(),tu(ru)),{diffSummaryTask:C}=(r6(),tu(r1)),{fetchTask:O}=(n6(),tu(n1)),{moveTask:E}=(n7(),tu(n5)),{pullTask:N}=(sr(),tu(se)),{pushTagsTask:A}=(nh(),tu(nl)),{addRemoteTask:L,getRemotesTask:I,listRemotesTask:P,remoteTask:R,removeRemoteTask:j}=(sp(),tu(so)),{getResetMode:F,resetTask:M}=(rS(),tu(rv)),{stashListTask:Z}=(sg(),tu(sf)),{addSubModuleTask:$,initSubModuleTask:D,subModuleTask:B,updateSubModuleTask:z}=(sw(),tu(s_)),{addAnnotatedTagTask:U,addTagTask:q,tagListTask:W}=(sL(),tu(sO)),{straightThroughBufferTask:V,straightThroughStringTask:G}=(ro(),tu(re));function K(e,t){this._plugins=t,this._executor=new r(e.baseDir,new s(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}function H(e,t,r,n){return"string"!=typeof r?i(`git.${e}() requires a string 'repoPath'`):t(r,d(n,l),h(arguments))}(K.prototype=Object.create(n.prototype)).constructor=K,K.prototype.customBinary=function(e){return this._plugins.reconfigure("binary",e),this},K.prototype.env=function(e,t){return 1==arguments.length&&"object"==typeof e?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},K.prototype.stashList=function(e){return this._runTask(Z(f(arguments)||{},o(e)&&e||[]),p(arguments))},K.prototype.clone=function(){return this._runTask(H("clone",w,...arguments),p(arguments))},K.prototype.mirror=function(){return this._runTask(H("mirror",x,...arguments),p(arguments))},K.prototype.mv=function(e,t){return this._runTask(E(e,t),p(arguments))},K.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(r,n){t.checkout(n.latest,e)})})},K.prototype.pull=function(e,t,r,n){return this._runTask(N(d(e,l),d(t,l),h(arguments)),p(arguments))},K.prototype.fetch=function(e,t){return this._runTask(O(d(e,l),d(t,l),h(arguments)),p(arguments))},K.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},K.prototype.tags=function(e,t){return this._runTask(W(h(arguments)),p(arguments))},K.prototype.rebase=function(){return this._runTask(G(["rebase",...h(arguments)]),p(arguments))},K.prototype.reset=function(e){return this._runTask(M(F(e),h(arguments)),p(arguments))},K.prototype.revert=function(e){let t=p(arguments);return"string"!=typeof e?this._runTask(i("Commit must be a string"),t):this._runTask(G(["revert",...h(arguments,0,!0),e]),t)},K.prototype.addTag=function(e){let t="string"==typeof e?q(e):i("Git.addTag requires a tag name");return this._runTask(t,p(arguments))},K.prototype.addAnnotatedTag=function(e,t){return this._runTask(U(e,t),p(arguments))},K.prototype.deleteLocalBranch=function(e,t,r){return this._runTask(b(e,"boolean"==typeof t&&t),p(arguments))},K.prototype.deleteLocalBranches=function(e,t,r){return this._runTask(y(e,"boolean"==typeof t&&t),p(arguments))},K.prototype.branch=function(e,t){return this._runTask(g(h(arguments)),p(arguments))},K.prototype.branchLocal=function(e){return this._runTask(_(),p(arguments))},K.prototype.raw=function(e){let t=!Array.isArray(e),r=[].slice.call(t?arguments:e,0);for(let e=0;e<r.length&&t;e++)if(!u(r[e])){r.splice(e,r.length-e);break}r.push(...h(arguments,0,!0));var n=p(arguments);return r.length?this._runTask(G(r,this._trimmed),n):this._runTask(i("Raw: must supply one or more command to execute"),n)},K.prototype.submoduleAdd=function(e,t,r){return this._runTask($(e,t),p(arguments))},K.prototype.submoduleUpdate=function(e,t){return this._runTask(z(h(arguments,!0)),p(arguments))},K.prototype.submoduleInit=function(e,t){return this._runTask(D(h(arguments,!0)),p(arguments))},K.prototype.subModule=function(e,t){return this._runTask(B(h(arguments)),p(arguments))},K.prototype.listRemote=function(){return this._runTask(P(h(arguments)),p(arguments))},K.prototype.addRemote=function(e,t,r){return this._runTask(L(e,t,h(arguments)),p(arguments))},K.prototype.removeRemote=function(e,t){return this._runTask(j(e),p(arguments))},K.prototype.getRemotes=function(e,t){return this._runTask(I(!0===e),p(arguments))},K.prototype.remote=function(e,t){return this._runTask(R(h(arguments)),p(arguments))},K.prototype.tag=function(e,t){let r=h(arguments);return"tag"!==r[0]&&r.unshift("tag"),this._runTask(G(r),p(arguments))},K.prototype.updateServerInfo=function(e){return this._runTask(G(["update-server-info"]),p(arguments))},K.prototype.pushTags=function(e,t){let r=A({remote:d(e,l)},h(arguments));return this._runTask(r,p(arguments))},K.prototype.rm=function(e){return this._runTask(G(["rm","-f",...a(e)]),p(arguments))},K.prototype.rmKeepLocal=function(e){return this._runTask(G(["rm","--cached",...a(e)]),p(arguments))},K.prototype.catFile=function(e,t){return this._catFile("utf-8",arguments)},K.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},K.prototype._catFile=function(e,t){var r=p(t),n=["cat-file"],s=t[0];if("string"==typeof s)return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),r);Array.isArray(s)&&n.push.apply(n,s);let a="buffer"===e?V(n):G(n);return this._runTask(a,r)},K.prototype.diff=function(e,t){let r=l(e)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):G(["diff",...h(arguments)]);return this._runTask(r,p(arguments))},K.prototype.diffSummary=function(){return this._runTask(C(h(arguments,1)),p(arguments))},K.prototype.applyPatch=function(e){let t=c(e)?m(a(e),h([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(t,p(arguments))},K.prototype.revparse=function(){let e=["rev-parse",...h(arguments,!0)];return this._runTask(G(e,!0),p(arguments))},K.prototype.clean=function(e,t,r){let n=T(e),s=n&&e.join("")||d(e,l)||"",i=h([].slice.call(arguments,n?1:0));return this._runTask(S(s,i),p(arguments))},K.prototype.exec=function(e){return this._runTask({commands:[],format:"utf-8",parser(){"function"==typeof e&&e()}})},K.prototype.clearQueue=function(){return this},K.prototype.checkIgnore=function(e,t){return this._runTask(v(a(d(e,c,[]))),p(arguments))},K.prototype.checkIsRepo=function(e,t){return this._runTask(k(d(e,l)),p(arguments))},t.exports=K}},function(){return s||(0,n[e9(n)[0]])((s={exports:{}}).exports,s),s.exports});th(),tp();var sP=class extends a{constructor(e,t){super(void 0,t),this.config=e}};tp(),tp();var sR=class extends a{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};tf(),tm(),t9(),rp(),r_(),ry(),rb(),rS(),t2(),t2();var sj=(0,e3.gX)().promise;t2();var sF="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function sM(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function sZ(e,t){if(e.length<1||e.length>2)throw new sR(void 0,"binary","Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings");if(e.some(sM)){if(t)console.warn(sF);else throw new sR(void 0,"binary",sF)}let[r,n]=e;return{binary:r,prefix:n}}function s$(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new a(void 0,n.toString("utf-8"))}:{error:n}}}}tp(),t2();var sD=class{constructor(){this.plugins=new Set,this.events=new e2.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=tT(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return tE(e).forEach(e=>e&&this.plugins.add(tT(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let t of this.plugins)t.type===e&&(n=t.action(n,s));return n}};t2(),t2(),th(),t2();var sB=sI();tf();var sz=function(e,t){var r;let n=new sD,s=tV(e&&("string"==typeof e?{baseDir:e}:e)||{},t);if(!tS(s.baseDir))throw new sP(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(function(e){let t=tI(e,"-c");return{type:"spawn.args",action:e=>[...t,...e]}}(s.config)),n.add(function({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action:(r,n)=>(r.forEach((s,i)=>{let a=i<r.length?r[i+1]:"";e||function(e,t){if("string"==typeof e&&"-c"===e.trim().toLowerCase()&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new sR(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}(s,a),t||function(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new sR(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===t&&/^\s*-u\b/.test(e))throw new sR(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===t&&/^\s*--exec\b/.test(e))throw new sR(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}(s,n.method)}),r)}}(s.unsafe)),n.add({type:"spawn.args",action(e){let t;let r=[];function n(e){(t=t||[]).push(...e)}for(let t=0;t<e.length;t++){let s=e[t];if(tc(s)){n(td(s));continue}if("--"===s){n(e.slice(t+1).flatMap(e=>tc(e)&&td(e)||e));break}r.push(s)}return t?[...r,"--",...t.map(String)]:r}}),n.add(function({onClose:e=!0,onExit:t=50}={}){function r(e,t,r){!1!==e&&(!0===e?t.promise:t.promise.then(()=>tj(e))).then(r.done)}return{type:"spawn.after",action(n,s){return tl(this,arguments,function*(n,{spawned:s,close:i}){var a,o;let u=function(){let n=-1,s={close:(0,e3.gX)(),closeTimeout:(0,e3.gX)(),exit:(0,e3.gX)(),exitTimeout:(0,e3.gX)()},i=Promise.race([!1===e?sj:s.closeTimeout.promise,!1===t?sj:s.exitTimeout.promise]);return r(e,s.close,s.closeTimeout),r(t,s.exit,s.exitTimeout),{close(e){n=e,s.close.done()},exit(e){n=e,s.exit.done()},get exitCode(){return n},result:i}}(),l=!0,c=()=>void(l=!1);null==(a=s.stdout)||a.on("data",c),null==(o=s.stderr)||o.on("data",c),s.on("error",c),s.on("close",e=>u.close(e)),s.on("exit",e=>u.exit(e));try{yield u.result,l&&(yield tj(50)),i(u.exitCode)}catch(e){i(u.exitCode,e)}})}}}(s.completion)),s.abort&&n.add(function(e){if(e)return[{type:"spawn.before",action(t,r){e.aborted&&r.kill(new sR(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(t,r){function n(){r.kill(new sR(void 0,"abort","Abort signal received"))}e.addEventListener("abort",n),r.spawned.on("close",()=>e.removeEventListener("abort",n))}}]}(s.abort)),s.progress&&n.add(function(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action:(e,n)=>r.includes(n.method)?tC(e,t):e},{type:"spawn.after",action(r,n){var s;n.commands.includes(t)&&(null==(s=n.spawned.stderr)||s.on("data",t=>{let r=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));r&&e({method:n.method,stage:String(r[1].toLowerCase().split(" ",1))||"unknown",progress:tL(r[2]),processed:tL(r[3]),total:tL(r[4])})}))}}]}(s.progress)),s.timeout&&n.add(function({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var i,a;let o;function u(){o&&clearTimeout(o),o=setTimeout(c,e)}function l(){var e,t;null==(e=s.spawned.stdout)||e.off("data",u),null==(t=s.spawned.stderr)||t.off("data",u),s.spawned.off("exit",l),s.spawned.off("close",l),o&&clearTimeout(o)}function c(){l(),s.kill(new sR(void 0,"timeout","block timeout reached"))}r&&(null==(i=s.spawned.stdout)||i.on("data",u)),t&&(null==(a=s.spawned.stderr)||a.on("data",u)),s.spawned.on("exit",l),s.spawned.on("close",l),u()}}}(s.timeout)),s.spawnOptions&&n.add(function(e){let t=tR(e,["uid","gid"]);return{type:"spawn.options",action:e=>tn(tn({},t),e)}}(s.spawnOptions)),n.add(s$(function(e=!1,t=function(e){return!!(e.exitCode&&e.stdErr.length)},r=function(e){return Buffer.concat([...e.stdOut,...e.stdErr])}){return(n,s)=>(e||!n)&&t(s)?r(s):n}(!0))),s.errors&&n.add(s$(s.errors)),function(e,t=["git"],r=!1){let n=sZ(tE(t),r);e.on("binary",e=>{n=sZ(tE(e),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",e=>n.prefix?[n.prefix,...e]:e)}(n,s.binary,null==(r=s.unsafe)?void 0:r.allowUnsafeCustomBinary),new sB(s,n)}},7410:(e,t,r)=>{"use strict";let n;r.d(t,{ZP:()=>ts,z:()=>ts}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(let e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e9||(e9={})),(e7||(e7={})).mergeShapes=(e,t)=>({...e,...t});let s=e9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(e))return s.array;if(null===e)return s.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return s.promise;if("undefined"!=typeof Map&&e instanceof Map)return s.map;if("undefined"!=typeof Set&&e instanceof Set)return s.set;if("undefined"!=typeof Date&&e instanceof Date)return s.date;return s.object;default:return s.unknown}},a=e9.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class o extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,n=0;for(;n<s.path.length;){let r=s.path[n];n===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof o))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e9.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}o.create=e=>new o(e);let u=(e,t)=>{let r;switch(e.code){case a.invalid_type:r=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,e9.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:r=`Unrecognized key(s) in object: ${e9.joinValues(e.keys,", ")}`;break;case a.invalid_union:r="Invalid input";break;case a.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${e9.joinValues(e.options)}`;break;case a.invalid_enum_value:r=`Invalid enum value. Expected ${e9.joinValues(e.options)}, received '${e.received}'`;break;case a.invalid_arguments:r="Invalid function arguments";break;case a.invalid_return_type:r="Invalid function return type";break;case a.invalid_date:r="Invalid date";break;case a.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:e9.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.custom:r="Invalid input";break;case a.invalid_intersection_types:r="Intersection results could not be merged";break;case a.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case a.not_finite:r="Number must be finite";break;default:r=t.defaultError,e9.assertNever(e)}return{message:r}},l=u;function c(){return l}let d=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],a={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";for(let e of n.filter(e=>!!e).slice().reverse())o=e(a,{data:t,defaultError:o}).message;return{...s,path:i,message:o}};function h(e,t){let r=c(),n=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===u?void 0:u].filter(e=>!!e)});e.common.issues.push(n)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return f;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return p.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:s}=n;if("aborted"===t.status||"aborted"===s.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==s.value||n.alwaysSet)&&(r[t.value]=s.value)}return{status:e.value,value:r}}}let f=Object.freeze({status:"aborted"}),m=e=>({status:"dirty",value:e}),g=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,y=e=>"dirty"===e.status,b=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function k(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function w(e,t,r,n,s){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!s)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(te||(te={}));class x{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let S=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new o(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var i,a;let{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:s.defaultError}:void 0===s.data?{message:null!==(i=null!=o?o:n)&&void 0!==i?i:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(a=null!=o?o:r)&&void 0!==a?a:s.defaultError}},description:s}}class C{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(v(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},s=this._parseSync({data:e,path:n.path,parent:n});return S(n,s)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:r.path,parent:r});return S(r,await (v(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let s=e(t),i=()=>n.addIssue({code:a.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new eg({schema:this,typeName:tn.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return e_.create(this,this._def)}nullable(){return ey.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Q.create(this,this._def)}promise(){return em.create(this,this._def)}or(e){return et.create([this,e],this._def)}and(e){return es.create(this,e,this._def)}transform(e){return new eg({...T(this._def),schema:this,typeName:tn.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eb({...T(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:tn.ZodDefault})}brand(){return new ex({typeName:tn.ZodBranded,type:this,...T(this._def)})}catch(e){return new ev({...T(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:tn.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eS.create(this,e)}readonly(){return eT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let O=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/,A=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,P=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,j=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Z=RegExp(`^${M}$`);function $(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function D(e){let t=`${M}T${$(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class B extends C{_parse(e){var t,r;let i;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.string,received:t.parsedType}),f}let o=new p;for(let s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(h(i=this._getOrReturnCtx(e,i),{code:a.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),o.dirty());else if("max"===s.kind)e.data.length>s.value&&(h(i=this._getOrReturnCtx(e,i),{code:a.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),o.dirty());else if("length"===s.kind){let t=e.data.length>s.value,r=e.data.length<s.value;(t||r)&&(i=this._getOrReturnCtx(e,i),t?h(i,{code:a.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&h(i,{code:a.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),o.dirty())}else if("email"===s.kind)P.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"email",code:a.invalid_string,message:s.message}),o.dirty());else if("emoji"===s.kind)n||(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"emoji",code:a.invalid_string,message:s.message}),o.dirty());else if("uuid"===s.kind)A.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"uuid",code:a.invalid_string,message:s.message}),o.dirty());else if("nanoid"===s.kind)L.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"nanoid",code:a.invalid_string,message:s.message}),o.dirty());else if("cuid"===s.kind)O.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"cuid",code:a.invalid_string,message:s.message}),o.dirty());else if("cuid2"===s.kind)E.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"cuid2",code:a.invalid_string,message:s.message}),o.dirty());else if("ulid"===s.kind)N.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"ulid",code:a.invalid_string,message:s.message}),o.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(t){h(i=this._getOrReturnCtx(e,i),{validation:"url",code:a.invalid_string,message:s.message}),o.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"regex",code:a.invalid_string,message:s.message}),o.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),o.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:{startsWith:s.value},message:s.message}),o.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:{endsWith:s.value},message:s.message}),o.dirty()):"datetime"===s.kind?D(s).test(e.data)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:"datetime",message:s.message}),o.dirty()):"date"===s.kind?Z.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:"date",message:s.message}),o.dirty()):"time"===s.kind?RegExp(`^${$(s)}$`).test(e.data)||(h(i=this._getOrReturnCtx(e,i),{code:a.invalid_string,validation:"time",message:s.message}),o.dirty()):"duration"===s.kind?I.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"duration",code:a.invalid_string,message:s.message}),o.dirty()):"ip"===s.kind?(t=e.data,("v4"===(r=s.version)||!r)&&R.test(t)||("v6"===r||!r)&&j.test(t)||(h(i=this._getOrReturnCtx(e,i),{validation:"ip",code:a.invalid_string,message:s.message}),o.dirty())):"base64"===s.kind?F.test(e.data)||(h(i=this._getOrReturnCtx(e,i),{validation:"base64",code:a.invalid_string,message:s.message}),o.dirty()):e9.assertNever(s);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:a.invalid_string,...te.errToObj(r)})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...te.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...te.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...te.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...te.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...te.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...te.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...te.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...te.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...te.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...te.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...te.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...te.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...te.errToObj(t)})}nonempty(e){return this.min(1,te.errToObj(e))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}B.create=e=>{var t;return new B({checks:[],typeName:tn.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class z extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.number,received:t.parsedType}),f}let r=new p;for(let n of this._def.checks)"int"===n.kind?e9.isInteger(e.data)||(h(t=this._getOrReturnCtx(e,t),{code:a.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}(e.data,n.value)&&(h(t=this._getOrReturnCtx(e,t),{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(h(t=this._getOrReturnCtx(e,t),{code:a.not_finite,message:n.message}),r.dirty()):e9.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,te.toString(t))}setLimit(e,t,r,n){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:te.toString(n)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&e9.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}z.create=e=>new z({checks:[],typeName:tn.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class U extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.bigint,received:t.parsedType}),f}let r=new p;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(h(t=this._getOrReturnCtx(e,t),{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):e9.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,te.toString(t))}setLimit(e,t,r,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:te.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}U.create=e=>{var t;return new U({checks:[],typeName:tn.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class q extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==s.boolean){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.boolean,received:t.parsedType}),f}return g(e.data)}}q.create=e=>new q({typeName:tn.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class W extends C{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:a.invalid_date}),f;let r=new p;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(h(t=this._getOrReturnCtx(e,t),{code:a.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):e9.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:te.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:te.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}W.create=e=>new W({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:tn.ZodDate,...T(e)});class V extends C{_parse(e){if(this._getType(e)!==s.symbol){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.symbol,received:t.parsedType}),f}return g(e.data)}}V.create=e=>new V({typeName:tn.ZodSymbol,...T(e)});class G extends C{_parse(e){if(this._getType(e)!==s.undefined){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.undefined,received:t.parsedType}),f}return g(e.data)}}G.create=e=>new G({typeName:tn.ZodUndefined,...T(e)});class K extends C{_parse(e){if(this._getType(e)!==s.null){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.null,received:t.parsedType}),f}return g(e.data)}}K.create=e=>new K({typeName:tn.ZodNull,...T(e)});class H extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return g(e.data)}}H.create=e=>new H({typeName:tn.ZodAny,...T(e)});class X extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return g(e.data)}}X.create=e=>new X({typeName:tn.ZodUnknown,...T(e)});class Y extends C{_parse(e){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.never,received:t.parsedType}),f}}Y.create=e=>new Y({typeName:tn.ZodNever,...T(e)});class J extends C{_parse(e){if(this._getType(e)!==s.undefined){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.void,received:t.parsedType}),f}return g(e.data)}}J.create=e=>new J({typeName:tn.ZodVoid,...T(e)});class Q extends C{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return h(t,{code:a.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(h(t,{code:e?a.too_big:a.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(h(t,{code:a.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(h(t,{code:a.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new x(t,e,t.path,r)))).then(e=>p.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new x(t,e,t.path,r)));return p.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new Q({...this._def,minLength:{value:e,message:te.toString(t)}})}max(e,t){return new Q({...this._def,maxLength:{value:e,message:te.toString(t)}})}length(e,t){return new Q({...this._def,exactLength:{value:e,message:te.toString(t)}})}nonempty(e){return this.min(1,e)}}Q.create=(e,t)=>new Q({type:e,minLength:null,maxLength:null,exactLength:null,typeName:tn.ZodArray,...T(t)});class ee extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=e9.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.object,received:t.parsedType}),f}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||o.push(e);let u=[];for(let e of i){let t=n[e],s=r.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new x(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Y){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)u.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&(h(r,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let n=r.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new x(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of u){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>p.mergeObjectSync(t,e)):p.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return te.errToObj,new ee({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,s,i,a;let o=null!==(i=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=te.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:tn.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){let t={};return e9.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new ee({...this._def,shape:()=>t})}omit(e){let t={};return e9.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new ee({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof ee){let r={};for(let n in t.shape){let s=t.shape[n];r[n]=e_.create(e(s))}return new ee({...t._def,shape:()=>r})}return t instanceof Q?new Q({...t._def,type:e(t.element)}):t instanceof e_?e_.create(e(t.unwrap())):t instanceof ey?ey.create(e(t.unwrap())):t instanceof ei?ei.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return e9.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new ee({...this._def,shape:()=>t})}required(e){let t={};return e9.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof e_;)e=e._def.innerType;t[r]=e}}),new ee({...this._def,shape:()=>t})}keyof(){return eh(e9.objectKeys(this.shape))}}ee.create=(e,t)=>new ee({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:tn.ZodObject,...T(t)}),ee.strictCreate=(e,t)=>new ee({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:tn.ZodObject,...T(t)}),ee.lazycreate=(e,t)=>new ee({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:tn.ZodObject,...T(t)});class et extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new o(e.ctx.common.issues));return h(t,{code:a.invalid_union,unionErrors:r}),f});{let e;let n=[];for(let s of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let s=n.map(e=>new o(e));return h(t,{code:a.invalid_union,unionErrors:s}),f}}get options(){return this._def.options}}et.create=(e,t)=>new et({options:e,typeName:tn.ZodUnion,...T(t)});let er=e=>{if(e instanceof ec)return er(e.schema);if(e instanceof eg)return er(e.innerType());if(e instanceof ed)return[e.value];if(e instanceof ep)return e.options;if(e instanceof ef)return e9.objectValues(e.enum);if(e instanceof eb)return er(e._def.innerType);if(e instanceof G)return[void 0];else if(e instanceof K)return[null];else if(e instanceof e_)return[void 0,...er(e.unwrap())];else if(e instanceof ey)return[null,...er(e.unwrap())];else if(e instanceof ex)return er(e.unwrap());else if(e instanceof eT)return er(e.unwrap());else if(e instanceof ev)return er(e._def.innerType);else return[]};class en extends C{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:a.invalid_type,expected:s.object,received:t.parsedType}),f;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=er(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of t){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,r)}}return new en({typeName:tn.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(r)})}}class es extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(_(e)||_(n))return f;let o=function e(t,r){let n=i(t),a=i(r);if(t===r)return{valid:!0,data:t};if(n===s.object&&a===s.object){let n=e9.objectKeys(r),s=e9.objectKeys(t).filter(e=>-1!==n.indexOf(e)),i={...t,...r};for(let n of s){let s=e(t[n],r[n]);if(!s.valid)return{valid:!1};i[n]=s.data}return{valid:!0,data:i}}if(n===s.array&&a===s.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===s.date&&a===s.date&&+t==+r?{valid:!0,data:t}:{valid:!1}}(e.value,n.value);return o.valid?((y(e)||y(n))&&t.dirty(),{status:t.value,value:o.data}):(h(r,{code:a.invalid_intersection_types}),f)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}es.create=(e,t,r)=>new es({left:e,right:t,typeName:tn.ZodIntersection,...T(r)});class ei extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return h(r,{code:a.invalid_type,expected:s.array,received:r.parsedType}),f;if(r.data.length<this._def.items.length)return h(r,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&r.data.length>this._def.items.length&&(h(r,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new x(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>p.mergeArray(t,e)):p.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ei({...this._def,rest:e})}}ei.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ei({items:e,typeName:tn.ZodTuple,rest:null,...T(t)})};class ea extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return h(r,{code:a.invalid_type,expected:s.object,received:r.parsedType}),f;let n=[],i=this._def.keyType,o=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new x(r,e,r.path,e)),value:o._parse(new x(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?p.mergeObjectAsync(t,n):p.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ea(t instanceof C?{keyType:e,valueType:t,typeName:tn.ZodRecord,...T(r)}:{keyType:B.create(),valueType:e,typeName:tn.ZodRecord,...T(t)})}}class eo extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return h(r,{code:a.invalid_type,expected:s.map,received:r.parsedType}),f;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([e,t],s)=>({key:n._parse(new x(r,e,r.path,[s,"key"])),value:i._parse(new x(r,t,r.path,[s,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of o){let n=await r.key,s=await r.value;if("aborted"===n.status||"aborted"===s.status)return f;("dirty"===n.status||"dirty"===s.status)&&t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of o){let n=r.key,s=r.value;if("aborted"===n.status||"aborted"===s.status)return f;("dirty"===n.status||"dirty"===s.status)&&t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}eo.create=(e,t,r)=>new eo({valueType:t,keyType:e,typeName:tn.ZodMap,...T(r)});class eu extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return h(r,{code:a.invalid_type,expected:s.set,received:r.parsedType}),f;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(h(r,{code:a.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(h(r,{code:a.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let r=new Set;for(let n of e){if("aborted"===n.status)return f;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let u=[...r.data.values()].map((e,t)=>i._parse(new x(r,e,r.path,t)));return r.common.async?Promise.all(u).then(e=>o(e)):o(u)}min(e,t){return new eu({...this._def,minSize:{value:e,message:te.toString(t)}})}max(e,t){return new eu({...this._def,maxSize:{value:e,message:te.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eu.create=(e,t)=>new eu({valueType:e,minSize:null,maxSize:null,typeName:tn.ZodSet,...T(t)});class el extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:a.invalid_type,expected:s.function,received:t.parsedType}),f;function r(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),u].filter(e=>!!e),issueData:{code:a.invalid_arguments,argumentsError:r}})}function n(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),u].filter(e=>!!e),issueData:{code:a.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof em){let e=this;return g(async function(...t){let s=new o([]),a=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),u=await Reflect.apply(l,this,a);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw s.addIssue(n(u,e)),s})})}{let e=this;return g(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new o([r(t,s.error)]);let a=Reflect.apply(l,this,s.data),u=e._def.returns.safeParse(a,i);if(!u.success)throw new o([n(a,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new el({...this._def,args:ei.create(e).rest(X.create())})}returns(e){return new el({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new el({args:e||ei.create([]).rest(X.create()),returns:t||X.create(),typeName:tn.ZodFunction,...T(r)})}}class ec extends C{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ec.create=(e,t)=>new ec({getter:e,typeName:tn.ZodLazy,...T(t)});class ed extends C{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function eh(e,t){return new ep({values:e,typeName:tn.ZodEnum,...T(t)})}ed.create=(e,t)=>new ed({value:e,typeName:tn.ZodLiteral,...T(t)});class ep extends C{constructor(){super(...arguments),tt.set(this,void 0)}_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{expected:e9.joinValues(r),received:t.parsedType,code:a.invalid_type}),f}if(k(this,tt,"f")||w(this,tt,new Set(this._def.values),"f"),!k(this,tt,"f").has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{received:t.data,code:a.invalid_enum_value,options:r}),f}return g(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ep.create(e,{...this._def,...t})}exclude(e,t=this._def){return ep.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}tt=new WeakMap,ep.create=eh;class ef extends C{constructor(){super(...arguments),tr.set(this,void 0)}_parse(e){let t=e9.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.string&&r.parsedType!==s.number){let e=e9.objectValues(t);return h(r,{expected:e9.joinValues(e),received:r.parsedType,code:a.invalid_type}),f}if(k(this,tr,"f")||w(this,tr,new Set(e9.getValidEnumValues(this._def.values)),"f"),!k(this,tr,"f").has(e.data)){let e=e9.objectValues(t);return h(r,{received:r.data,code:a.invalid_enum_value,options:e}),f}return g(e.data)}get enum(){return this._def.values}}tr=new WeakMap,ef.create=(e,t)=>new ef({values:e,typeName:tn.ZodNativeEnum,...T(t)});class em extends C{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==s.promise&&!1===t.common.async?(h(t,{code:a.invalid_type,expected:s.promise,received:t.parsedType}),f):g((t.parsedType===s.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}em.create=(e,t)=>new em({type:e,typeName:tn.ZodPromise,...T(t)});class eg extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===tn.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{h(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){let e=n.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return f;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?f:"dirty"===n.status||"dirty"===t.value?m(n.value):n});{if("aborted"===t.value)return f;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?f:"dirty"===n.status||"dirty"===t.value?m(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?f:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?f:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>b(e)?Promise.resolve(n.transform(e.value,s)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!b(e))return e;let i=n.transform(e.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}}e9.assertNever(n)}}eg.create=(e,t,r)=>new eg({schema:e,typeName:tn.ZodEffects,effect:t,...T(r)}),eg.createWithPreprocess=(e,t,r)=>new eg({schema:t,effect:{type:"preprocess",transform:e},typeName:tn.ZodEffects,...T(r)});class e_ extends C{_parse(e){return this._getType(e)===s.undefined?g(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}e_.create=(e,t)=>new e_({innerType:e,typeName:tn.ZodOptional,...T(t)});class ey extends C{_parse(e){return this._getType(e)===s.null?g(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:tn.ZodNullable,...T(t)});class eb extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:tn.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class ev extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return v(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new o(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new o(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ev.create=(e,t)=>new ev({innerType:e,typeName:tn.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class ek extends C{_parse(e){if(this._getType(e)!==s.nan){let t=this._getOrReturnCtx(e);return h(t,{code:a.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}ek.create=e=>new ek({typeName:tn.ZodNaN,...T(e)});let ew=Symbol("zod_brand");class ex extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eS extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eS({in:e,out:t,typeName:tn.ZodPipeline})}}class eT extends C{_parse(e){let t=this._def.innerType._parse(e),r=e=>(b(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function eC(e,t={},r){return e?H.create().superRefine((n,s)=>{var i,a;if(!e(n)){let e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(a=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===a||a;s.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}}):H.create()}eT.create=(e,t)=>new eT({innerType:e,typeName:tn.ZodReadonly,...T(t)});let eO={object:ee.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(tn||(tn={}));let eE=B.create,eN=z.create,eA=ek.create,eL=U.create,eI=q.create,eP=W.create,eR=V.create,ej=G.create,eF=K.create,eM=H.create,eZ=X.create,e$=Y.create,eD=J.create,eB=Q.create,ez=ee.create,eU=ee.strictCreate,eq=et.create,eW=en.create,eV=es.create,eG=ei.create,eK=ea.create,eH=eo.create,eX=eu.create,eY=el.create,eJ=ec.create,eQ=ed.create,e0=ep.create,e1=ef.create,e3=em.create,e2=eg.create,e6=e_.create,e8=ey.create,e4=eg.createWithPreprocess,e5=eS.create;var e9,e7,te,tt,tr,tn,ts=Object.freeze({__proto__:null,defaultErrorMap:u,setErrorMap:function(e){l=e},getErrorMap:c,makeIssue:d,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:p,INVALID:f,DIRTY:m,OK:g,isAborted:_,isDirty:y,isValid:b,isAsync:v,get util(){return e9},get objectUtil(){return e7},ZodParsedType:s,getParsedType:i,ZodType:C,datetimeRegex:D,ZodString:B,ZodNumber:z,ZodBigInt:U,ZodBoolean:q,ZodDate:W,ZodSymbol:V,ZodUndefined:G,ZodNull:K,ZodAny:H,ZodUnknown:X,ZodNever:Y,ZodVoid:J,ZodArray:Q,ZodObject:ee,ZodUnion:et,ZodDiscriminatedUnion:en,ZodIntersection:es,ZodTuple:ei,ZodRecord:ea,ZodMap:eo,ZodSet:eu,ZodFunction:el,ZodLazy:ec,ZodLiteral:ed,ZodEnum:ep,ZodNativeEnum:ef,ZodPromise:em,ZodEffects:eg,ZodTransformer:eg,ZodOptional:e_,ZodNullable:ey,ZodDefault:eb,ZodCatch:ev,ZodNaN:ek,BRAND:ew,ZodBranded:ex,ZodPipeline:eS,ZodReadonly:eT,custom:eC,Schema:C,ZodSchema:C,late:eO,get ZodFirstPartyTypeKind(){return tn},coerce:{string:e=>B.create({...e,coerce:!0}),number:e=>z.create({...e,coerce:!0}),boolean:e=>q.create({...e,coerce:!0}),bigint:e=>U.create({...e,coerce:!0}),date:e=>W.create({...e,coerce:!0})},any:eM,array:eB,bigint:eL,boolean:eI,date:eP,discriminatedUnion:eW,effect:e2,enum:e0,function:eY,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>eC(t=>t instanceof e,t),intersection:eV,lazy:eJ,literal:eQ,map:eH,nan:eA,nativeEnum:e1,never:e$,null:eF,nullable:e8,number:eN,object:ez,oboolean:()=>eI().optional(),onumber:()=>eN().optional(),optional:e6,ostring:()=>eE().optional(),pipeline:e5,preprocess:e4,promise:e3,record:eK,set:eX,strictObject:eU,string:eE,symbol:eR,transformer:e2,tuple:eG,undefined:ej,union:eq,unknown:eZ,void:eD,NEVER:f,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:o})}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=600,exports.ids=[600],exports.modules={41600:(e,t,r)=>{r.d(t,{migrate:()=>n});var o=r(6005),i=r(87561),s=r(49411);function n(e,t){let r=function(e){let t;if(!(t="string"==typeof e?JSON.parse(i.readFileSync(s.resolve(".",e),"utf8")).out:e.migrationsFolder))throw Error("no migration folder defined");let r=[],n=`${t}/meta/_journal.json`;if(!i.existsSync(n))throw Error("Can't find meta/_journal.json file");for(let e of JSON.parse(i.readFileSync(`${t}/meta/_journal.json`).toString()).entries){let s=`${t}/${e.tag}.sql`;try{let s=i.readFileSync(`${t}/${e.tag}.sql`).toString(),n=s.split("--> statement-breakpoint").map(e=>e);r.push({sql:n,bps:e.breakpoints,folderMillis:e.when,hash:o.createHash("sha256").update(s).digest("hex")})}catch{throw Error(`No file ${s} found in ${t} folder`)}}return r}(t);e.dialect.migrate(r,e.session,t)}}};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=714,exports.ids=[714],exports.modules={3714:(e,t,i)=>{let s,r;i.d(t,{drizzle:()=>tx});let n=Symbol.for("drizzle:entityKind");function l(e,t){if(!e||"object"!=typeof e)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let i=e.constructor;if(i)for(;i;){if(n in i&&i[n]===t[n])return!0;i=Object.getPrototypeOf(i)}return!1}Symbol.for("drizzle:hasOwnEntityKind");class a{static [n]="ConsoleLogWriter";write(e){console.log(e)}}class o{static [n]="DefaultLogger";writer;constructor(e){this.writer=e?.writer??new a}logQuery(e,t){let i=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),s=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${e}${s}`)}}class u{static [n]="NoopLogger";logQuery(){}}let c=Symbol.for("drizzle:Name"),h=Symbol.for("drizzle:Schema"),d=Symbol.for("drizzle:Columns"),f=Symbol.for("drizzle:ExtraConfigColumns"),m=Symbol.for("drizzle:OriginalName"),p=Symbol.for("drizzle:BaseName"),g=Symbol.for("drizzle:IsAlias"),y=Symbol.for("drizzle:ExtraConfigBuilder"),b=Symbol.for("drizzle:IsDrizzleTable");class w{static [n]="Table";static Symbol={Name:c,Schema:h,OriginalName:m,Columns:d,ExtraConfigColumns:f,BaseName:p,IsAlias:g,ExtraConfigBuilder:y};[c];[m];[h];[d];[f];[p];[g]=!1;[b]=!0;[y]=void 0;constructor(e,t,i){this[c]=this[m]=e,this[h]=t,this[p]=i}}function S(e){return`${e[h]??"public"}.${e[c]}`}class ${constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static [n]="Column";name;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return void 0!==this.config.generated&&"byDefault"!==this.config.generated.type}}let v=Symbol.for("drizzle:PgInlineForeignKeys");class N extends w{static [n]="PgTable";static Symbol=Object.assign({},w.Symbol,{InlineForeignKeys:v});[v]=[];[w.Symbol.ExtraConfigBuilder]=void 0}class q{static [n]="PgPrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new Q(e,this.columns,this.name)}}class Q{constructor(e,t,i){this.table=e,this.columns=t,this.name=i}static [n]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[N.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}class T{static [n]="ColumnBuilder";config;constructor(e,t,i){this.config={name:e,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:i,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}}class x{static [n]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){this.reference=()=>{let{name:t,columns:i,foreignColumns:s}=e();return{name:t,columns:i,foreignTable:s[0].table,foreignColumns:s}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=void 0===e?"no action":e,this}onDelete(e){return this._onDelete=void 0===e?"no action":e,this}build(e){return new C(e,this)}}class C{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static [n]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:i}=this.reference(),s=t.map(e=>e.name),r=i.map(e=>e.name),n=[this.table[N.Symbol.Name],...s,i[0].table[N.Symbol.Name],...r];return e??`${n.join("_")}_fk`}}function L(e,...t){return e(...t)}function O(e,t){return`${e[N.Symbol.Name]}_${t.join("_")}_unique`}class _{constructor(e,t){this.name=t,this.columns=e}static [n]=null;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new j(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class A{static [n]=null;name;constructor(e){this.name=e}on(...e){return new _(e,this.name)}}class j{constructor(e,t,i,s){this.table=e,this.columns=t,this.name=s??O(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=i}static [n]=null;columns;name;nullsNotDistinct=!1;getName(){return this.name}}function F(e,t,i){for(let s=t;s<e.length;s++){let r=e[s];if("\\"===r){s++;continue}if('"'===r)return[e.slice(t,s).replace(/\\/g,""),s+1];if(!i&&(","===r||"}"===r))return[e.slice(t,s).replace(/\\/g,""),s]}return[e.slice(t).replace(/\\/g,""),e.length]}class P extends T{foreignKeyConfigs=[];static [n]="PgColumnBuilder";array(e){return new R(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:i,actions:s})=>L((i,s)=>{let r=new x(()=>({columns:[e],foreignColumns:[i()]}));return s.onUpdate&&r.onUpdate(s.onUpdate),s.onDelete&&r.onDelete(s.onDelete),r.build(t)},i,s))}buildExtraConfigColumn(e){return new B(e,this.config)}}class E extends ${constructor(e,t){t.uniqueName||(t.uniqueName=O(e,[t.name])),super(e,t),this.table=e}static [n]="PgColumn"}class B extends E{static [n]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}}class D{static [n]=null;constructor(e,t,i){this.name=e,this.type=t,this.indexConfig=i}name;type;indexConfig}class R extends P{static [n]="PgArrayBuilder";constructor(e,t,i){super(e,"array","PgArray"),this.config.baseBuilder=t,this.config.size=i}build(e){let t=this.config.baseBuilder.build(e);return new z(e,this.config,t)}}class z extends E{constructor(e,t,i,s){super(e,t),this.baseColumn=i,this.range=s,this.size=t.size}size;static [n]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${"number"==typeof this.size?this.size:""}]`}mapFromDriverValue(e){return"string"==typeof e&&(e=function(e){let[t]=function e(t,i=0){let s=[],r=i,n=!1;for(;r<t.length;){let l=t[r];if(","===l){(n||r===i)&&s.push(""),n=!0,r++;continue}if(n=!1,"\\"===l){r+=2;continue}if('"'===l){let[e,i]=F(t,r+1,!0);s.push(e),r=i;continue}if("}"===l)return[s,r+1];if("{"===l){let[i,n]=e(t,r+1);s.push(i),r=n;continue}let[a,o]=F(t,r,!1);s.push(a),r=o}return[s,r]}(e,1);return t}(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,t=!1){let i=e.map(e=>null===e?null:l(this.baseColumn,z)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return t?i:function e(t){return`{${t.map(t=>Array.isArray(t)?e(t):"string"==typeof t?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}(i)}}let I=Symbol.for("drizzle:isPgEnum");class M extends P{static [n]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn"),this.config.enum=t}build(e){return new K(e,this.config)}}class K extends E{static [n]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}}class k{static [n]="Subquery";constructor(e,t,i,s=!1){this._={brand:"Subquery",sql:e,selectedFields:t,alias:i,isWith:s}}}class U extends k{static [n]="WithSubquery"}let V={startActiveSpan:(e,t)=>s?(r||(r=s.trace.getTracer("drizzle-orm","0.33.0")),L((i,s)=>s.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:i.SpanStatusCode.ERROR,message:t instanceof Error?t.message:"Unknown error"}),t}finally{e.end()}}),s,r)):t()},W=Symbol.for("drizzle:ViewBaseConfig");class J{static [n]=null}function Y(e){return null!=e&&"function"==typeof e.getSQL}class G{static [n]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new H([this])}}class H{constructor(e){this.queryChunks=e}static [n]="SQL";decoder=Z;shouldInlineParams=!1;append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return V.startActiveSpan("drizzle.buildSQL",t=>{let i=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(e,t){let i=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{escapeName:s,escapeParam:r,prepareTyping:n,inlineParams:a,paramStartIndex:o}=i;return function(e){let t={sql:"",params:[]};for(let i of e)t.sql+=i.sql,t.params.push(...i.params),i.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}(e.map(e=>{if(l(e,G))return{sql:e.value.join(""),params:[]};if(l(e,X))return{sql:s(e.value),params:[]};if(void 0===e)return{sql:"",params:[]};if(Array.isArray(e)){let t=[new G("(")];for(let[i,s]of e.entries())t.push(s),i<e.length-1&&t.push(new G(", "));return t.push(new G(")")),this.buildQueryFromSourceParams(t,i)}if(l(e,H))return this.buildQueryFromSourceParams(e.queryChunks,{...i,inlineParams:a||e.shouldInlineParams});if(l(e,w)){let t=e[w.Symbol.Schema],i=e[w.Symbol.Name];return{sql:void 0===t?s(i):s(t)+"."+s(i),params:[]}}if(l(e,$))return"indexes"===t.invokeSource?{sql:s(e.name),params:[]}:{sql:s(e.table[w.Symbol.Name])+"."+s(e.name),params:[]};if(l(e,en)){let t=e[W].schema,i=e[W].name;return{sql:void 0===t?s(i):s(t)+"."+s(i),params:[]}}if(l(e,et)){if(l(e.value,es))return{sql:r(o.value++,e),params:[e],typings:["none"]};let t=null===e.value?null:e.encoder.mapToDriverValue(e.value);if(l(t,H))return this.buildQueryFromSourceParams([t],i);if(a)return{sql:this.mapInlineParam(t,i),params:[]};let s=["none"];return n&&(s=[n(e.encoder)]),{sql:r(o.value++,t),params:[t],typings:s}}return l(e,es)?{sql:r(o.value++,e),params:[e],typings:["none"]}:l(e,H.Aliased)&&void 0!==e.fieldAlias?{sql:s(e.fieldAlias),params:[]}:l(e,k)?e._.isWith?{sql:s(e._.alias),params:[]}:this.buildQueryFromSourceParams([new G("("),e._.sql,new G(") "),new X(e._.alias)],i):e&&"function"==typeof e&&I in e&&!0===e[I]?e.schema?{sql:s(e.schema)+"."+s(e.enumName),params:[]}:{sql:s(e.enumName),params:[]}:Y(e)?e.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([e.getSQL()],i):this.buildQueryFromSourceParams([new G("("),e.getSQL(),new G(")")],i):a?{sql:this.mapInlineParam(e,i),params:[]}:{sql:r(o.value++,e),params:[e],typings:["none"]}}))}mapInlineParam(e,{escapeString:t}){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return e.toString();if("string"==typeof e)return t(e);if("object"==typeof e){let i=e.toString();return"[object Object]"===i?t(JSON.stringify(e)):t(i)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return void 0===e?this:new H.Aliased(this,e)}mapWith(e){return this.decoder="function"==typeof e?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class X{constructor(e){this.value=e}static [n]="Name";brand;getSQL(){return new H([this])}}let Z={mapFromDriverValue:e=>e},ee={mapToDriverValue:e=>e};({...Z,...ee});class et{constructor(e,t=ee){this.value=e,this.encoder=t}static [n]="Param";brand;getSQL(){return new H([this])}}function ei(e,...t){let i=[];for(let[s,r]of((t.length>0||e.length>0&&""!==e[0])&&i.push(new G(e[0])),t.entries()))i.push(r,new G(e[s+1]));return new H(i)}(e=>{e.empty=function(){return new H([])},e.fromList=function(e){return new H(e)},e.raw=function(e){return new H([new G(e)])},e.join=function(e,t){let i=[];for(let[s,r]of e.entries())s>0&&void 0!==t&&i.push(t),i.push(r);return new H(i)},e.identifier=function(e){return new X(e)},e.placeholder=function(e){return new es(e)},e.param=function(e,t){return new et(e,t)}})(ei||(ei={})),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static [n]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(H||(H={}));class es{constructor(e){this.name=e}static [n]="Placeholder";getSQL(){return new H([this])}}function er(e,t){return e.map(e=>{if(l(e,es)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(l(e,et)&&l(e.value,es)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}class en{static [n]="View";[W];constructor({name:e,schema:t,selectedFields:i,query:s}){this[W]={name:e,originalName:e,schema:t,selectedFields:i,query:s,isExisting:!s,isAlias:!1}}getSQL(){return new H([this])}}function el(e,t){return"object"!=typeof t||null===t||!("mapToDriverValue"in t)||"function"!=typeof t.mapToDriverValue||Y(e)||l(e,et)||l(e,es)||l(e,$)||l(e,w)||l(e,en)?e:new et(e,t)}$.prototype.getSQL=function(){return new H([this])},w.prototype.getSQL=function(){return new H([this])},k.prototype.getSQL=function(){return new H([this])};let ea=(e,t)=>ei`${e} = ${el(t,e)}`,eo=(e,t)=>ei`${e} <> ${el(t,e)}`;function eu(...e){let t=e.filter(e=>void 0!==e);return 0===t.length?void 0:new H(1===t.length?t:[new G("("),ei.join(t,new G(" and ")),new G(")")])}function ec(...e){let t=e.filter(e=>void 0!==e);return 0===t.length?void 0:new H(1===t.length?t:[new G("("),ei.join(t,new G(" or ")),new G(")")])}function eh(e){return ei`not ${e}`}let ed=(e,t)=>ei`${e} > ${el(t,e)}`,ef=(e,t)=>ei`${e} >= ${el(t,e)}`,em=(e,t)=>ei`${e} < ${el(t,e)}`,ep=(e,t)=>ei`${e} <= ${el(t,e)}`;function eg(e,t){return Array.isArray(t)?0===t.length?ei`false`:ei`${e} in ${t.map(t=>el(t,e))}`:ei`${e} in ${el(t,e)}`}function ey(e,t){return Array.isArray(t)?0===t.length?ei`true`:ei`${e} not in ${t.map(t=>el(t,e))}`:ei`${e} not in ${el(t,e)}`}function eb(e){return ei`${e} is null`}function ew(e){return ei`${e} is not null`}function eS(e){return ei`exists ${e}`}function e$(e){return ei`not exists ${e}`}function ev(e,t,i){return ei`${e} between ${el(t,e)} and ${el(i,e)}`}function eN(e,t,i){return ei`${e} not between ${el(t,e)} and ${el(i,e)}`}function eq(e,t){return ei`${e} like ${t}`}function eQ(e,t){return ei`${e} not like ${t}`}function eT(e,t){return ei`${e} ilike ${t}`}function ex(e,t){return ei`${e} not ilike ${t}`}function eC(e){return ei`${e} asc`}function eL(e){return ei`${e} desc`}class eO{constructor(e,t,i){this.sourceTable=e,this.referencedTable=t,this.relationName=i,this.referencedTableName=t[w.Symbol.Name]}static [n]="Relation";referencedTableName;fieldName}class e_{constructor(e,t){this.table=e,this.config=t}static [n]="Relations"}class eA extends eO{constructor(e,t,i,s){super(e,t,i?.relationName),this.config=i,this.isNullable=s}static [n]="One";withFieldName(e){let t=new eA(this.sourceTable,this.referencedTable,this.config,this.isNullable);return t.fieldName=e,t}}class ej extends eO{constructor(e,t,i){super(e,t,i?.relationName),this.config=i}static [n]="Many";withFieldName(e){let t=new ej(this.sourceTable,this.referencedTable,this.config);return t.fieldName=e,t}}function eF(e){return{one:function(t,i){return new eA(e,t,i,i?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)},many:function(t,i){return new ej(e,t,i)}}}class eP{constructor(e){this.table=e}static [n]="ColumnAliasProxyHandler";get(e,t){return"table"===t?this.table:e[t]}}class eE{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static [n]="TableAliasProxyHandler";get(e,t){if(t===w.Symbol.IsAlias)return!0;if(t===w.Symbol.Name||this.replaceOriginalName&&t===w.Symbol.OriginalName)return this.alias;if(t===W)return{...e[W],name:this.alias,isAlias:!0};if(t===w.Symbol.Columns){let t=e[w.Symbol.Columns];if(!t)return t;let i={};return Object.keys(t).map(s=>{i[s]=new Proxy(t[s],new eP(new Proxy(e,this)))}),i}let i=e[t];return l(i,$)?new Proxy(i,new eP(new Proxy(e,this))):i}}class eB{constructor(e){this.alias=e}static [n]=null;get(e,t){return"sourceTable"===t?eD(e.sourceTable,this.alias):e[t]}}function eD(e,t){return new Proxy(e,new eE(t,!1))}function eR(e,t){return new Proxy(e,new eP(new Proxy(e.table,new eE(t,!1))))}function ez(e,t){return new H.Aliased(eI(e.sql,t),e.fieldAlias)}function eI(e,t){return ei.join(e.queryChunks.map(e=>l(e,$)?eR(e,t):l(e,H)?eI(e,t):l(e,H.Aliased)?ez(e,t):e))}class eM{static [n]="SelectionProxyHandler";config;constructor(e){this.config={...e}}get(e,t){if("_"===t)return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(t===W)return{...e[W],selectedFields:new Proxy(e[W].selectedFields,this)};if("symbol"==typeof t)return e[t];let i=(l(e,k)?e._.selectedFields:l(e,en)?e[W].selectedFields:e)[t];if(l(i,H.Aliased)){if("sql"===this.config.sqlAliasedBehavior&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(l(i,H)){if("sql"===this.config.sqlBehavior)return i;throw Error(`You tried to reference "${t}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return l(i,$)?this.config.alias?new Proxy(i,new eP(new Proxy(i.table,new eE(this.config.alias,this.config.replaceOriginalName??!1)))):i:"object"!=typeof i||null===i?i:new Proxy(i,new eM(this.config))}}class eK extends Error{static [n]="DrizzleError";constructor({message:e,cause:t}){super(e),this.name="DrizzleError",this.cause=t}}class ek extends eK{static [n]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}let eU=Symbol.for("drizzle:SQLiteInlineForeignKeys");class eV extends w{static [n]="SQLiteTable";static Symbol=Object.assign({},w.Symbol,{InlineForeignKeys:eU});[w.Symbol.Columns];[eU]=[];[w.Symbol.ExtraConfigBuilder]=void 0}function eW(e,t){return`${e[eV.Symbol.Name]}_${t.join("_")}_unique`}class eJ{constructor(e,t){this.name=t,this.columns=e}static [n]=null;columns;build(e){return new eG(e,this.columns,this.name)}}class eY{static [n]=null;name;constructor(e){this.name=e}on(...e){return new eJ(e,this.name)}}class eG{constructor(e,t,i){this.table=e,this.columns=t,this.name=i??eW(this.table,this.columns.map(e=>e.name))}static [n]=null;columns;name;getName(){return this.name}}class eH extends null{static [n]=null;foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:i,actions:s})=>((i,s)=>{let r=new ForeignKeyBuilder(()=>({columns:[e],foreignColumns:[i()]}));return s.onUpdate&&r.onUpdate(s.onUpdate),s.onDelete&&r.onDelete(s.onDelete),r.build(t)})(i,s))}}class eX extends ${constructor(e,t){t.uniqueName||(t.uniqueName=eW(e,[t.name])),super(e,t),this.table=e}static [n]="SQLiteColumn"}function eZ(e,t,i){let s={},r=e.reduce((e,{path:r,field:n},a)=>{let o;o=l(n,$)?n:l(n,H)?n.decoder:n.sql.decoder;let u=e;for(let[e,h]of r.entries())if(e<r.length-1)h in u||(u[h]={}),u=u[h];else{let e=t[a],d=u[h]=null===e?null:o.mapFromDriverValue(e);if(i&&l(n,$)&&2===r.length){let e=r[0];e in s?"string"==typeof s[e]&&s[e]!==n.table[c]&&(s[e]=!1):s[e]=null===d&&n.table[c]}}return e},{});if(i&&Object.keys(s).length>0)for(let[e,t]of Object.entries(s))"string"!=typeof t||i[t]||(r[e]=null);return r}function e0(e,t){return Object.entries(e).reduce((e,[i,s])=>{if("string"!=typeof i)return e;let r=t?[...t,i]:[i];return l(s,$)||l(s,H)||l(s,H.Aliased)?e.push({path:r,field:s}):l(s,w)?e.push(...e0(s[w.Symbol.Columns],r)):e.push(...e0(s,r)),e},[])}function e1(e,t){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(let[e,t]of i.entries())if(t!==s[e])return!1;return!0}function e2(e,t){let i=Object.entries(t).filter(([,e])=>void 0!==e).map(([t,i])=>l(i,H)?[t,i]:[t,new et(i,e[w.Symbol.Columns][t])]);if(0===i.length)throw Error("No values to set");return Object.fromEntries(i)}function e3(e){return l(e,k)?e._.alias:l(e,en)?e[W].name:l(e,H)?void 0:e[w.Symbol.IsAlias]?e[w.Symbol.Name]:e[w.Symbol.BaseName]}class e4 extends en{static [n]="SQLiteViewBase"}class e7{static [n]="SQLiteDialect";escapeName(e){return`"${e}"`}escapeParam(e){return"?"}escapeString(e){return`'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let t=[ei`with `];for(let[i,s]of e.entries())t.push(ei`${ei.identifier(s._.alias)} as (${s._.sql})`),i<e.length-1&&t.push(ei`, `);return t.push(ei` `),ei.join(t)}buildDeleteQuery({table:e,where:t,returning:i,withList:s}){let r=this.buildWithCTE(s),n=i?ei` returning ${this.buildSelection(i,{isSingleTable:!0})}`:void 0,l=t?ei` where ${t}`:void 0;return ei`${r}delete from ${e}${l}${n}`}buildUpdateSet(e,t){let i=e[w.Symbol.Columns],s=Object.keys(i).filter(e=>void 0!==t[e]||i[e]?.onUpdateFn!==void 0),r=s.length;return ei.join(s.flatMap((e,s)=>{let n=i[e],l=t[e]??ei.param(n.onUpdateFn(),n),a=ei`${ei.identifier(n.name)} = ${l}`;return s<r-1?[a,ei.raw(", ")]:[a]}))}buildUpdateQuery({table:e,set:t,where:i,returning:s,withList:r}){let n=this.buildWithCTE(r),l=this.buildUpdateSet(e,t),a=s?ei` returning ${this.buildSelection(s,{isSingleTable:!0})}`:void 0,o=i?ei` where ${i}`:void 0;return ei`${n}update ${e} set ${l}${o}${a}`}buildSelection(e,{isSingleTable:t=!1}={}){let i=e.length,s=e.flatMap(({field:e},s)=>{let r=[];if(l(e,H.Aliased)&&e.isSelectionField)r.push(ei.identifier(e.fieldAlias));else if(l(e,H.Aliased)||l(e,H)){let i=l(e,H.Aliased)?e.sql:e;t?r.push(new H(i.queryChunks.map(e=>l(e,$)?ei.identifier(e.name):e))):r.push(i),l(e,H.Aliased)&&r.push(ei` as ${ei.identifier(e.fieldAlias)}`)}else if(l(e,$)){let i=e.table[w.Symbol.Name],s=e.name;t?r.push(ei.identifier(s)):r.push(ei`${ei.identifier(i)}.${ei.identifier(s)}`)}return s<i-1&&r.push(ei`, `),r});return ei.join(s)}buildSelectQuery({withList:e,fields:t,fieldsFlat:i,where:s,having:r,table:n,joins:a,orderBy:o,groupBy:u,limit:h,offset:d,distinct:f,setOperators:m}){let p=i??e0(t);for(let e of p){let t;if(l(e.field,$)&&e.field.table[c]!==(l(n,k)?n._.alias:l(n,e4)?n[W].name:l(n,H)?void 0:n[c])&&(t=e.field.table,!a?.some(({alias:e})=>e===(t[w.Symbol.IsAlias]?t[c]:t[w.Symbol.BaseName])))){let t=e.field.table[c];throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let g=!a||0===a.length,y=this.buildWithCTE(e),b=f?ei` distinct`:void 0,S=this.buildSelection(p,{isSingleTable:g}),v=l(n,w)&&n[w.Symbol.OriginalName]!==n[w.Symbol.Name]?ei`${ei.identifier(n[w.Symbol.OriginalName])} ${ei.identifier(n[w.Symbol.Name])}`:n,N=[];if(a)for(let[e,t]of a.entries()){0===e&&N.push(ei` `);let i=t.table;if(l(i,eV)){let e=i[eV.Symbol.Name],s=i[eV.Symbol.Schema],r=i[eV.Symbol.OriginalName],n=e===r?void 0:t.alias;N.push(ei`${ei.raw(t.joinType)} join ${s?ei`${ei.identifier(s)}.`:void 0}${ei.identifier(r)}${n&&ei` ${ei.identifier(n)}`} on ${t.on}`)}else N.push(ei`${ei.raw(t.joinType)} join ${i} on ${t.on}`);e<a.length-1&&N.push(ei` `)}let q=ei.join(N),Q=s?ei` where ${s}`:void 0,T=r?ei` having ${r}`:void 0,x=[];if(o)for(let[e,t]of o.entries())x.push(t),e<o.length-1&&x.push(ei`, `);let C=[];if(u)for(let[e,t]of u.entries())C.push(t),e<u.length-1&&C.push(ei`, `);let L=C.length>0?ei` group by ${ei.join(C)}`:void 0,O=x.length>0?ei` order by ${ei.join(x)}`:void 0,_="object"==typeof h||"number"==typeof h&&h>=0?ei` limit ${h}`:void 0,A=d?ei` offset ${d}`:void 0,j=ei`${y}select${b} ${S} from ${v}${q}${Q}${L}${T}${O}${_}${A}`;return m.length>0?this.buildSetOperations(j,m):j}buildSetOperations(e,t){let[i,...s]=t;if(!i)throw Error("Cannot pass undefined values to any set operator");return 0===s.length?this.buildSetOperationQuery({leftSelect:e,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:i}),s)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:i,rightSelect:s,limit:r,orderBy:n,offset:a}}){let o;let u=ei`${e.getSQL()} `,c=ei`${s.getSQL()}`;if(n&&n.length>0){let e=[];for(let t of n)if(l(t,eX))e.push(ei.identifier(t.name));else if(l(t,H)){for(let e=0;e<t.queryChunks.length;e++){let i=t.queryChunks[e];l(i,eX)&&(t.queryChunks[e]=ei.identifier(i.name))}e.push(ei`${t}`)}else e.push(ei`${t}`);o=ei` order by ${ei.join(e,ei`, `)}`}let h="object"==typeof r||"number"==typeof r&&r>=0?ei` limit ${r}`:void 0,d=ei.raw(`${t} ${i?"all ":""}`),f=a?ei` offset ${a}`:void 0;return ei`${u}${d}${c}${o}${h}${f}`}buildInsertQuery({table:e,values:t,onConflict:i,returning:s,withList:r}){let n=[],a=Object.entries(e[w.Symbol.Columns]).filter(([e,t])=>!t.shouldDisableInsert()),o=a.map(([,e])=>ei.identifier(e.name));for(let[e,i]of t.entries()){let s=[];for(let[e,t]of a){let r=i[e];if(void 0===r||l(r,et)&&void 0===r.value){let e;if(null!==t.default&&void 0!==t.default)e=l(t.default,H)?t.default:ei.param(t.default,t);else if(void 0!==t.defaultFn){let i=t.defaultFn();e=l(i,H)?i:ei.param(i,t)}else if(t.default||void 0===t.onUpdateFn)e=ei`null`;else{let i=t.onUpdateFn();e=l(i,H)?i:ei.param(i,t)}s.push(e)}else s.push(r)}n.push(s),e<t.length-1&&n.push(ei`, `)}let u=this.buildWithCTE(r),c=ei.join(n),h=s?ei` returning ${this.buildSelection(s,{isSingleTable:!0})}`:void 0,d=i?ei` on conflict ${i}`:void 0;return ei`${u}insert into ${e} ${o} values ${c}${d}${h}`}sqlToQuery(e,t){return e.toQuery({escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:i,table:s,tableConfig:r,queryConfig:n,tableAlias:a,nestedQueryRelation:o,joinOn:u}){let c,h=[],d,f,m=[],p,g=[];if(!0===n)h=Object.entries(r.columns).map(([e,t])=>({dbKey:t.name,tsKey:e,field:eR(t,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let s=Object.fromEntries(Object.entries(r.columns).map(([e,t])=>[e,eR(t,a)]));if(n.where){let e="function"==typeof n.where?n.where(s,{and:eu,between:ev,eq:ea,exists:eS,gt:ed,gte:ef,ilike:eT,inArray:eg,isNull:eb,isNotNull:ew,like:eq,lt:em,lte:ep,ne:eo,not:eh,notBetween:eN,notExists:e$,notLike:eQ,notIlike:ex,notInArray:ey,or:ec,sql:ei}):n.where;p=e&&eI(e,a)}let o=[],u=[];if(n.columns){let e=!1;for(let[t,i]of Object.entries(n.columns))void 0!==i&&t in r.columns&&(e||!0!==i||(e=!0),u.push(t));u.length>0&&(u=e?u.filter(e=>n.columns?.[e]===!0):Object.keys(r.columns).filter(e=>!u.includes(e)))}else u=Object.keys(r.columns);for(let e of u){let t=r.columns[e];o.push({tsKey:e,value:t})}let c=[];if(n.with&&(c=Object.entries(n.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:r.relations[e]}))),n.extras)for(let[e,t]of Object.entries("function"==typeof n.extras?n.extras(s,{sql:ei}):n.extras))o.push({tsKey:e,value:ez(t,a)});for(let{tsKey:e,value:t}of o)h.push({dbKey:l(t,H.Aliased)?t.fieldAlias:r.columns[e].name,tsKey:e,field:l(t,$)?eR(t,a):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let g="function"==typeof n.orderBy?n.orderBy(s,{sql:ei,asc:eC,desc:eL}):n.orderBy??[];for(let{tsKey:s,queryConfig:r,relation:o}of(Array.isArray(g)||(g=[g]),m=g.map(e=>l(e,$)?eR(e,a):eI(e,a)),d=n.limit,f=n.offset,c)){let n=function(e,t,i){if(l(i,eA)&&i.config)return{fields:i.config.fields,references:i.config.references};let s=t[S(i.referencedTable)];if(!s)throw Error(`Table "${i.referencedTable[w.Symbol.Name]}" not found in schema`);let r=e[s];if(!r)throw Error(`Table "${s}" not found in schema`);let n=i.sourceTable,a=t[S(n)];if(!a)throw Error(`Table "${n[w.Symbol.Name]}" not found in schema`);let o=[];for(let e of Object.values(r.relations))(i.relationName&&i!==e&&e.relationName===i.relationName||!i.relationName&&e.referencedTable===i.sourceTable)&&o.push(e);if(o.length>1)throw i.relationName?Error(`There are multiple relations with name "${i.relationName}" in table "${s}"`):Error(`There are multiple relations between "${s}" and "${i.sourceTable[w.Symbol.Name]}". Please specify relation name`);if(o[0]&&l(o[0],eA)&&o[0].config)return{fields:o[0].config.references,references:o[0].config.fields};throw Error(`There is not enough information to infer relation "${a}.${i.fieldName}"`)}(t,i,o),u=i[S(o.referencedTable)],c=`${a}_${s}`,d=eu(...n.fields.map((e,t)=>ea(eR(n.references[t],c),eR(e,a)))),f=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:i,table:e[u],tableConfig:t[u],queryConfig:l(o,eA)?!0===r?{limit:1}:{...r,limit:1}:r,tableAlias:c,joinOn:d,nestedQueryRelation:o}),m=ei`(${f.sql})`.as(s);h.push({dbKey:s,tsKey:s,field:m,relationTableTsKey:u,isJson:!0,selection:f.selection})}}if(0===h.length)throw new eK({message:`No fields selected for table "${r.tsName}" ("${a}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});if(p=eu(u,p),o){let e=ei`json_array(${ei.join(h.map(({field:e})=>l(e,eX)?ei.identifier(e.name):l(e,H.Aliased)?e.sql:e),ei`, `)})`;l(o,ej)&&(e=ei`coalesce(json_group_array(${e}), json_array())`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:r.tsName,selection:h}];void 0!==d||void 0!==f||m.length>0?(c=this.buildSelectQuery({table:eD(s,a),fields:{},fieldsFlat:[{path:[],field:ei.raw("*")}],where:p,limit:d,offset:f,orderBy:m,setOperators:[]}),p=void 0,d=void 0,f=void 0,m=void 0):c=eD(s,a),c=this.buildSelectQuery({table:l(c,eV)?c:new k(c,{},a),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:l(e,$)?eR(e,a):e})),joins:g,where:p,limit:d,offset:f,orderBy:m,setOperators:[]})}else c=this.buildSelectQuery({table:eD(s,a),fields:{},fieldsFlat:h.map(({field:e})=>({path:[],field:l(e,$)?eR(e,a):e})),joins:g,where:p,limit:d,offset:f,orderBy:m,setOperators:[]});return{tableTsKey:r.tsName,sql:c,selection:h}}}class e5 extends e7{static [n]="SQLiteSyncDialect";migrate(e,t,i){let s=void 0===i?"__drizzle_migrations":"string"==typeof i?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",r=ei`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS ${ei.identifier(s)} (
|
|
3
|
-
id SERIAL PRIMARY KEY,
|
|
4
|
-
hash text NOT NULL,
|
|
5
|
-
created_at numeric
|
|
6
|
-
)
|
|
7
|
-
`;t.run(r);let n=t.values(ei`SELECT id, hash, created_at FROM ${ei.identifier(s)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(ei`BEGIN`);try{for(let i of e)if(!n||Number(n[2])<i.folderMillis){for(let e of i.sql)t.run(ei.raw(e));t.run(ei`INSERT INTO ${ei.identifier(s)} ("hash", "created_at") VALUES(${i.hash}, ${i.folderMillis})`)}t.run(ei`COMMIT`)}catch(e){throw t.run(ei`ROLLBACK`),e}}}class e6 extends null{static [n]=null;async migrate(e,t,i){let s=void 0===i?"__drizzle_migrations":"string"==typeof i?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",r=sql`
|
|
8
|
-
CREATE TABLE IF NOT EXISTS ${sql.identifier(s)} (
|
|
9
|
-
id SERIAL PRIMARY KEY,
|
|
10
|
-
hash text NOT NULL,
|
|
11
|
-
created_at numeric
|
|
12
|
-
)
|
|
13
|
-
`;await t.run(r);let n=(await t.values(sql`SELECT id, hash, created_at FROM ${sql.identifier(s)} ORDER BY created_at DESC LIMIT 1`))[0]??void 0;await t.transaction(async t=>{for(let i of e)if(!n||Number(n[2])<i.folderMillis){for(let e of i.sql)await t.run(sql.raw(e));await t.run(sql`INSERT INTO ${sql.identifier(s)} ("hash", "created_at") VALUES(${i.hash}, ${i.folderMillis})`)}})}}class e8{static [n]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class e9{static [n]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}class te{static [n]="SQLiteSelectBuilder";fields;session;dialect;withList;distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,this.withList=e.withList,this.distinct=e.distinct}from(e){let t;let i=!!this.fields;return t=this.fields?this.fields:l(e,k)?Object.fromEntries(Object.keys(e._.selectedFields).map(t=>[t,e[t]])):l(e,e4)?e[W].selectedFields:l(e,H)?{}:e[w.Symbol.Columns],new ti({table:e,fields:t,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class tt extends e8{static [n]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:e,fields:t,isPartialSelect:i,session:s,dialect:r,withList:n,distinct:l}){super(),this.config={withList:n,table:e,fields:{...t},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=r,this._={selectedFields:t},this.tableName=e3(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{}}createJoin(e){return(t,i)=>{let s=this.tableName,r=e3(t);if("string"==typeof r&&this.config.joins?.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof s&&(this.config.fields={[s]:this.config.fields}),"string"==typeof r&&!l(t,H))){let e=l(t,k)?t._.selectedFields:l(t,en)?t[W].selectedFields:t[w.Symbol.Columns];this.config.fields[r]=e}if("function"==typeof i&&(i=i(new Proxy(this.config.fields,new eM({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:t,joinType:e,alias:r}),"string"==typeof r)switch(e){case"left":this.joinsNotNullableMap[r]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case"inner":this.joinsNotNullableMap[r]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(e,t){return i=>{let s="function"==typeof i?i(tr()):i;if(!e1(this.getSelectedFields(),s.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:s}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eM({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new eM({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eM({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new eM({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){return new Proxy(new k(this.getSQL(),this.config.fields,e),new eM({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new eM({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class ti extends tt{static [n]="SQLiteSelect";_prepare(e=!0){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let t=e0(this.config.fields),i=this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),t,"all",!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.all()}}function ts(e,t){return(i,s,...r)=>{let n=[s,...r].map(i=>({type:e,isAll:t,rightSelect:i}));for(let e of n)if(!e1(i.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return i.addSetOperators(n)}}!function(e,t){for(let i of t)for(let t of Object.getOwnPropertyNames(i.prototype))"constructor"!==t&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(i.prototype,t)||Object.create(null))}(ti,[e9]);let tr=()=>({union:tn,unionAll:tl,intersect:ta,except:to}),tn=ts("union",!1),tl=ts("union",!0),ta=ts("intersect",!1),to=ts("except",!1);class tu{static [n]="SQLiteQueryBuilder";dialect;$with(e){let t=this;return{as:i=>("function"==typeof i&&(i=i(t)),new Proxy(new U(i.getSQL(),i.getSelectedFields(),e,!0),new eM({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(i){return new te({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(i){return new te({fields:i??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}}}select(e){return new te({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new te({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new e5),this.dialect}}class tc{constructor(e,t,i,s){this.table=e,this.session=t,this.dialect=i,this.withList=s}static [n]="SQLiteUpdateBuilder";set(e){return new th(this.table,e2(this.table,e),this.session,this.dialect,this.withList)}}class th extends e9{constructor(e,t,i,s,r){super(),this.session=i,this.dialect=s,this.config={set:t,table:e,withList:r}}static [n]="SQLiteUpdate";config;where(e){return this.config.where=e,this}returning(e=this.config.table[eV.Symbol.Columns]){return this.config.returning=e0(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0)}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class td{constructor(e,t,i,s){this.table=e,this.session=t,this.dialect=i,this.withList=s}static [n]="SQLiteInsertBuilder";values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},i=this.table[w.Symbol.Columns];for(let s of Object.keys(e)){let r=e[s];t[s]=l(r,H)?r:new et(r,i[s])}return t});return new tf(this.table,t,this.session,this.dialect,this.withList)}}class tf extends e9{constructor(e,t,i,s,r){super(),this.session=i,this.dialect=s,this.config={table:e,values:t,withList:r}}static [n]="SQLiteInsert";config;returning(e=this.config.table[eV.Symbol.Columns]){return this.config.returning=e0(e),this}onConflictDoNothing(e={}){if(void 0===e.target)this.config.onConflict=ei`do nothing`;else{let t=Array.isArray(e.target)?ei`${e.target}`:ei`${[e.target]}`,i=e.where?ei` where ${e.where}`:ei``;this.config.onConflict=ei`${t} do nothing${i}`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let t=e.where?ei` where ${e.where}`:void 0,i=e.targetWhere?ei` where ${e.targetWhere}`:void 0,s=e.setWhere?ei` where ${e.setWhere}`:void 0,r=Array.isArray(e.target)?ei`${e.target}`:ei`${[e.target]}`,n=this.dialect.buildUpdateSet(this.config.table,e2(this.config.table,e.set));return this.config.onConflict=ei`${r}${i} do update set ${n}${t}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0)}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class tm extends e9{constructor(e,t,i,s){super(),this.table=e,this.session=t,this.dialect=i,this.config={table:e,withList:s}}static [n]="SQLiteDelete";config;where(e){return this.config.where=e,this}returning(e=this.table[eV.Symbol.Columns]){return this.config.returning=e0(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0)}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}class tp{constructor(e,t,i,s,r,n,l,a){this.mode=e,this.fullSchema=t,this.schema=i,this.tableNamesMap=s,this.table=r,this.tableConfig=n,this.dialect=l,this.session=a}static [n]="SQLiteAsyncRelationalQueryBuilder";findMany(e){return"sync"===this.mode?new ty(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many"):new tg(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return"sync"===this.mode?new ty(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first"):new tg(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}}class tg extends e9{constructor(e,t,i,s,r,n,l,a,o){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=i,this.table=s,this.tableConfig=r,this.dialect=n,this.session=l,this.config=a,this.mode=o}static [n]="SQLiteAsyncRelationalQuery";mode;getSQL(){return this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(e=!1){let{query:t,builtQuery:i}=this._toSQL();return this.session[e?"prepareOneTimeQuery":"prepareQuery"](i,void 0,"first"===this.mode?"get":"all",!0,(e,i)=>{let s=e.map(e=>(function e(t,i,s,r,n=e=>e){let a={};for(let[o,u]of r.entries())if(u.isJson){let r=i.relations[u.tsKey],c=s[o],h="string"==typeof c?JSON.parse(c):c;a[u.tsKey]=l(r,eA)?h&&e(t,t[u.relationTableTsKey],h,u.selection,n):h.map(i=>e(t,t[u.relationTableTsKey],i,u.selection,n))}else{let e;let t=n(s[o]),i=u.field;e=l(i,$)?i:l(i,H)?i.decoder:i.sql.decoder,a[u.tsKey]=null===t?null:e.mapFromDriverValue(t)}return a})(this.schema,this.tableConfig,e,t.selection,i));return"first"===this.mode?s[0]:s})}prepare(){return this._prepare(!1)}_toSQL(){let e=this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}executeRaw(){return"first"===this.mode?this._prepare(!1).get():this._prepare(!1).all()}async execute(){return this.executeRaw()}}class ty extends tg{static [n]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}}class tb extends e9{constructor(e,t,i,s,r){super(),this.execute=e,this.getSQL=t,this.dialect=s,this.mapBatchResult=r,this.config={action:i}}static [n]="SQLiteRaw";config;getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}}class tw{constructor(e,t,i,s){this.resultKind=e,this.dialect=t,this.session=i,this._=s?{schema:s.schema,fullSchema:s.fullSchema,tableNamesMap:s.tableNamesMap}:{schema:void 0,fullSchema:{},tableNamesMap:{}},this.query={};let r=this.query;if(this._.schema)for(let[n,l]of Object.entries(this._.schema))r[n]=new tp(e,s.fullSchema,this._.schema,this._.tableNamesMap,s.fullSchema[n],l,t,i)}static [n]="BaseSQLiteDatabase";query;$with(e){return{as:t=>("function"==typeof t&&(t=t(new tu)),new Proxy(new U(t.getSQL(),t.getSelectedFields(),e,!0),new eM({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(i){return new te({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e})},selectDistinct:function(i){return new te({fields:i??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})},update:function(i){return new tc(i,t.session,t.dialect,e)},insert:function(i){return new td(i,t.session,t.dialect,e)},delete:function(i){return new tm(i,t.session,t.dialect,e)}}}select(e){return new te({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new te({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new tc(e,this.session,this.dialect)}insert(e){return new td(e,this.session,this.dialect)}delete(e){return new tm(e,this.session,this.dialect)}run(e){let t=e.getSQL();return"async"===this.resultKind?new tb(async()=>this.session.run(t),()=>t,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session)):this.session.run(t)}all(e){let t=e.getSQL();return"async"===this.resultKind?new tb(async()=>this.session.all(t),()=>t,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session)):this.session.all(t)}get(e){let t=e.getSQL();return"async"===this.resultKind?new tb(async()=>this.session.get(t),()=>t,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session)):this.session.get(t)}values(e){let t=e.getSQL();return"async"===this.resultKind?new tb(async()=>this.session.values(t),()=>t,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session)):this.session.values(t)}transaction(e,t){return this.session.transaction(e,t)}}class tS extends e9{constructor(e){super(),this.resultCb=e}static [n]="ExecuteResultSync";async execute(){return this.resultCb()}sync(){return this.resultCb()}}class t${constructor(e,t,i){this.mode=e,this.executeMethod=t,this.query=i}static [n]="PreparedQuery";joinsNotNullableMap;getQuery(){return this.query}mapRunResult(e,t){return e}mapAllResult(e,t){throw Error("Not implemented")}mapGetResult(e,t){throw Error("Not implemented")}execute(e){return"async"===this.mode?this[this.executeMethod](e):new tS(()=>this[this.executeMethod](e))}mapResult(e,t){switch(this.executeMethod){case"run":return this.mapRunResult(e,t);case"all":return this.mapAllResult(e,t);case"get":return this.mapGetResult(e,t)}}}class tv{constructor(e){this.dialect=e}static [n]="SQLiteSession";prepareOneTimeQuery(e,t,i,s){return this.prepareQuery(e,t,i,s)}run(e){let t=this.dialect.sqlToQuery(e);try{return this.prepareOneTimeQuery(t,void 0,"run",!1).run()}catch(e){throw new eK({cause:e,message:`Failed to run the query '${t.sql}'`})}}extractRawRunValueFromBatchResult(e){return e}all(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(e){throw Error("Not implemented")}get(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(e){throw Error("Not implemented")}values(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).values()}extractRawValuesValueFromBatchResult(e){throw Error("Not implemented")}}class tN extends tw{constructor(e,t,i,s,r=0){super(e,t,i,s),this.schema=s,this.nestedIndex=r}static [n]="SQLiteTransaction";rollback(){throw new ek}}class tq extends tv{constructor(e,t,i,s={}){super(t),this.client=e,this.schema=i,this.logger=s.logger??new u}static [n]="BetterSQLiteSession";logger;prepareQuery(e,t,i,s,r){return new tT(this.client.prepare(e.sql),e,this.logger,t,i,s,r)}transaction(e,t={}){let i=new tQ("sync",this.dialect,this,this.schema);return this.client.transaction(e)[t.behavior??"deferred"](i)}}class tQ extends tN{static [n]="BetterSQLiteTransaction";transaction(e){let t=`sp${this.nestedIndex}`,i=new tQ("sync",this.dialect,this.session,this.schema,this.nestedIndex+1);this.session.run(ei.raw(`savepoint ${t}`));try{let s=e(i);return this.session.run(ei.raw(`release savepoint ${t}`)),s}catch(e){throw this.session.run(ei.raw(`rollback to savepoint ${t}`)),e}}}class tT extends t${constructor(e,t,i,s,r,n,l){super("sync",r,t),this.stmt=e,this.logger=i,this.fields=s,this._isResponseInArrayMode=n,this.customResultMapper=l}static [n]="BetterSQLitePreparedQuery";run(e){let t=er(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.run(...t)}all(e){let{fields:t,joinsNotNullableMap:i,query:s,logger:r,stmt:n,customResultMapper:l}=this;if(!t&&!l){let t=er(s.params,e??{});return r.logQuery(s.sql,t),n.all(...t)}let a=this.values(e);return l?l(a):a.map(e=>eZ(t,e,i))}get(e){let t=er(this.query.params,e??{});this.logger.logQuery(this.query.sql,t);let{fields:i,stmt:s,joinsNotNullableMap:r,customResultMapper:n}=this;if(!i&&!n)return s.get(...t);let l=s.raw().get(...t);return l?n?n([l]):eZ(i,l,r):void 0}values(e){let t=er(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.raw().all(...t)}isResponseInArrayMode(){return this._isResponseInArrayMode}}function tx(e,t={}){let i,s;let r=new e5;if(!0===t.logger?i=new o:!1!==t.logger&&(i=t.logger),t.schema){let e=function(e,t){1===Object.keys(e).length&&"default"in e&&!l(e.default,w)&&(e=e.default);let i={},s={},r={};for(let[n,a]of Object.entries(e))if(l(a,w)){let e=S(a),t=s[e];for(let s of(i[e]=n,r[n]={tsName:n,dbName:a[w.Symbol.Name],schema:a[w.Symbol.Schema],columns:a[w.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]},Object.values(a[w.Symbol.Columns])))s.primary&&r[n].primaryKey.push(s);let o=a[w.Symbol.ExtraConfigBuilder]?.(a[w.Symbol.ExtraConfigColumns]);if(o)for(let e of Object.values(o))l(e,q)&&r[n].primaryKey.push(...e.columns)}else if(l(a,e_)){let e;let n=S(a.table),l=i[n];for(let[i,o]of Object.entries(a.config(t(a.table))))if(l){let t=r[l];t.relations[i]=o,e&&t.primaryKey.push(...e)}else n in s||(s[n]={relations:{},primaryKey:e}),s[n].relations[i]=o}return{tables:r,tableNamesMap:i}}(t.schema,eF);s={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let n=new tq(e,r,s,{logger:i});return new tw("sync",r,n,s)}}};
|