@stacksjs/buddy 0.70.12 → 0.70.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{chunk-225rwa7q.js → chunk-0bm9jzfk.js} +1 -1
  2. package/dist/{chunk-6bsjhkd1.js → chunk-0evg5jp6.js} +1 -1
  3. package/dist/chunk-1dyb4ha1.js +1 -0
  4. package/dist/chunk-1gv7jvh2.js +3 -0
  5. package/dist/{chunk-xhnxfews.js → chunk-6tfy93kv.js} +1 -1
  6. package/dist/{chunk-swrx1kwt.js → chunk-755h2sey.js} +1 -1
  7. package/dist/{chunk-jaw9rsy5.js → chunk-76q55r9x.js} +1 -1
  8. package/dist/{chunk-c57y9ssg.js → chunk-8j6ps4r9.js} +1 -1
  9. package/dist/chunk-bvk6vr3a.js +2 -0
  10. package/dist/chunk-c0xy5mxd.js +2 -0
  11. package/dist/{chunk-w410kf33.js → chunk-d2kb25t6.js} +1 -1
  12. package/dist/chunk-d9j9qatb.js +2 -0
  13. package/dist/{chunk-02xryjt7.js → chunk-ebq1d2xm.js} +1 -1
  14. package/dist/chunk-ewg2wcyt.js +10 -0
  15. package/dist/{chunk-1xg8yqzr.js → chunk-fk4k9w9k.js} +2 -2
  16. package/dist/{chunk-0pctvmzj.js → chunk-g1f16je5.js} +1 -1
  17. package/dist/{chunk-y9we573f.js → chunk-jgcb2h70.js} +1 -1
  18. package/dist/{chunk-59wz96e5.js → chunk-jvcbf2ew.js} +1 -1
  19. package/dist/chunk-n4svhbxp.js +5 -0
  20. package/dist/{chunk-tnexd1vh.js → chunk-n549129b.js} +1 -1
  21. package/dist/{chunk-18tc3app.js → chunk-ndpvrw19.js} +1 -1
  22. package/dist/chunk-p9ga59ne.js +1 -0
  23. package/dist/{chunk-mq9sjfzt.js → chunk-pq12d9s0.js} +1 -1
  24. package/dist/{chunk-5ac533gv.js → chunk-pzqkq1eg.js} +1 -1
  25. package/dist/{chunk-enzd7k3d.js → chunk-rcdezkfx.js} +1 -1
  26. package/dist/{chunk-yvw4pjx6.js → chunk-tjxy77dn.js} +6 -6
  27. package/dist/{chunk-tb4wat6y.js → chunk-v649k10a.js} +1 -1
  28. package/dist/{chunk-1hyckzds.js → chunk-wjpycfhj.js} +1 -1
  29. package/dist/{chunk-97y685k1.js → chunk-xd0ntg7m.js} +1 -1
  30. package/dist/{chunk-yen4jxhm.js → chunk-xggr9n1s.js} +2 -2
  31. package/dist/{chunk-yjmev4jy.js → chunk-y0kfnrfm.js} +2 -2
  32. package/dist/cli.js +1 -1
  33. package/dist/index.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-2kgzc9hn.js +0 -2
  36. package/dist/chunk-51z2y1an.js +0 -10
  37. package/dist/chunk-7pzg81vs.js +0 -5
  38. package/dist/chunk-f6ns0rrk.js +0 -2
  39. package/dist/chunk-rjjeq0tb.js +0 -3
  40. package/dist/chunk-x50q43zy.js +0 -2
  41. package/dist/chunk-y21redjp.js +0 -2
  42. package/dist/chunk-y6xd7gz4.js +0 -1
@@ -1,4 +1,4 @@
1
- import{Ca as TO}from"./chunk-6bsjhkd1.js";import{Da as ky,Ea as hy}from"./chunk-cqrmkpzz.js";import{$a as BL,Ab as LL,Bb as WL,Cb as ZL,Db as TL,Eb as IL,Fb as JL,Gb as $L,Hb as EL,Ib as PL,Jb as CL,ab as wL,bb as DL,cb as kL,db as hL,eb as oR,fb as tR,gb as eR,hb as GL,ib as vL,jb as UL,kb as zL,lb as rR,mb as dR,nb as KL,ob as HL,pb as bL,qb as ML,rb as B7,sb as w7,tb as gL,ub as VL,vb as QL,wb as yL,xb as FL,yb as mL,zb as RL}from"./chunk-2kgzc9hn.js";import{Kb as h5,Lb as YL}from"./chunk-18tc3app.js";import{$b as xo,Mb as jL,Nb as OL,Ob as Qg,Qb as xL,Rb as D7,Tb as fq,Ub as Rg,Vb as kk,Wb as go,Xb as P0,Yb as MZ,Zb as yo,ac as cL,bc as L0,cc as DE,dc as qL,ec as AL,fc as _L,gc as fL,hc as mo,jc as XL,kc as b0,lc as D9,mc as v4,nc as SL,oc as NL}from"./chunk-7pzg81vs.js";import{pc as Wb0,rc as _k,uc as GZ}from"./chunk-59wz96e5.js";import{Gc as Ho}from"./chunk-y6xd7gz4.js";import{Pc as Vo,Qc as Qo,Rc as Fo}from"./chunk-1hyckzds.js";import{Tc as Uo}from"./chunk-yen4jxhm.js";import{Uc as L4,Vc as y51,Wc as S1,Xc as Kq,Yc as b51,Zc as U8}from"./chunk-0pctvmzj.js";var DF=S1((we)=>{var y2=we,Be=/`/g,Nc1=/\./g,Xv=/[\0\b\t\n\r\x1a\"\'\\]/g,Rc1={"\x00":"\\0","\b":"\\b","\t":"\\t","\n":"\\n","\r":"\\r","\x1A":"\\Z",'"':"\\\"","'":"\\'","\\":"\\\\"};y2.escapeId=function G(Y,X){if(Array.isArray(Y)){var W="";for(var Z=0;Z<Y.length;Z++)W+=(Z===0?"":", ")+y2.escapeId(Y[Z],X);return W}else if(X)return"`"+String(Y).replace(Be,"``")+"`";else return"`"+String(Y).replace(Be,"``").replace(Nc1,"`.`")+"`"};y2.escape=function G(Y,X,W){if(Y===void 0||Y===null)return"NULL";switch(typeof Y){case"boolean":return Y?"true":"false";case"number":return Y+"";case"object":if(Object.prototype.toString.call(Y)==="[object Date]")return y2.dateToString(Y,W||"local");else if(Array.isArray(Y))return y2.arrayToList(Y,W);else if(Buffer.isBuffer(Y))return y2.bufferToString(Y);else if(typeof Y.toSqlString==="function")return String(Y.toSqlString());else if(X)return Hj(Y.toString());else return y2.objectToValues(Y,W);default:return Hj(Y)}};y2.arrayToList=function G(Y,X){var W="";for(var Z=0;Z<Y.length;Z++){var U=Y[Z];if(Array.isArray(U))W+=(Z===0?"":", ")+"("+y2.arrayToList(U,X)+")";else W+=(Z===0?"":", ")+y2.escape(U,!0,X)}return W};y2.format=function G(Y,X,W,Z){if(X==null)return Y;if(!Array.isArray(X))X=[X];var U=0,K=/\?+/g,J="",H=0,$;while(H<X.length&&($=K.exec(Y))){var Q=$[0].length;if(Q>2)continue;var F=Q===2?y2.escapeId(X[H]):y2.escape(X[H],W,Z);J+=Y.slice(U,$.index)+F,U=K.lastIndex,H++}if(U===0)return Y;if(U<Y.length)return J+Y.slice(U);return J};y2.dateToString=function G(Y,X){var W=new Date(Y);if(isNaN(W.getTime()))return"NULL";var Z,U,K,J,H,$,Q;if(X==="local")Z=W.getFullYear(),U=W.getMonth()+1,K=W.getDate(),J=W.getHours(),H=W.getMinutes(),$=W.getSeconds(),Q=W.getMilliseconds();else{var F=Lc1(X);if(F!==!1&&F!==0)W.setTime(W.getTime()+F*60000);Z=W.getUTCFullYear(),U=W.getUTCMonth()+1,K=W.getUTCDate(),J=W.getUTCHours(),H=W.getUTCMinutes(),$=W.getUTCSeconds(),Q=W.getUTCMilliseconds()}var z=P$(Z,4)+"-"+P$(U,2)+"-"+P$(K,2)+" "+P$(J,2)+":"+P$(H,2)+":"+P$($,2)+"."+P$(Q,3);return Hj(z)};y2.bufferToString=function G(Y){return"X"+Hj(Y.toString("hex"))};y2.objectToValues=function G(Y,X){var W="";for(var Z in Y){var U=Y[Z];if(typeof U==="function")continue;W+=(W.length===0?"":", ")+y2.escapeId(Z)+" = "+y2.escape(U,!0,X)}return W};y2.raw=function G(Y){if(typeof Y!=="string")throw new TypeError("argument sql must be a string");return{toSqlString:function X(){return Y}}};function Hj(G){var Y=Xv.lastIndex=0,X="",W;while(W=Xv.exec(G))X+=G.slice(Y,W.index)+Rc1[W[0]],Y=Xv.lastIndex;if(Y===0)return"'"+G+"'";if(Y<G.length)return"'"+X+G.slice(Y)+"'";return"'"+X+"'"}function P$(G,Y){G=G.toString();while(G.length<Y)G="0"+G;return G}function Lc1(G){if(G==="Z")return 0;var Y=G.match(/([\+\-\s])(\d\d):?(\d\d)?/);if(Y)return(Y[1]==="-"?-1:1)*(parseInt(Y[2],10)+(Y[3]?parseInt(Y[3],10):0)/60)*60;return!1}});var mX=S1((Tc1)=>{Tc1.LONG_PASSWORD=1;Tc1.FOUND_ROWS=2;Tc1.LONG_FLAG=4;Tc1.CONNECT_WITH_DB=8;Tc1.NO_SCHEMA=16;Tc1.COMPRESS=32;Tc1.ODBC=64;Tc1.LOCAL_FILES=128;Tc1.IGNORE_SPACE=256;Tc1.PROTOCOL_41=512;Tc1.INTERACTIVE=1024;Tc1.SSL=2048;Tc1.IGNORE_SIGPIPE=4096;Tc1.TRANSACTIONS=8192;Tc1.RESERVED=16384;Tc1.SECURE_CONNECTION=32768;Tc1.MULTI_STATEMENTS=65536;Tc1.MULTI_RESULTS=131072;Tc1.PS_MULTI_RESULTS=262144;Tc1.PLUGIN_AUTH=524288;Tc1.CONNECT_ATTRS=1048576;Tc1.PLUGIN_AUTH_LENENC_CLIENT_DATA=2097152;Tc1.CAN_HANDLE_EXPIRED_PASSWORDS=4194304;Tc1.SESSION_TRACK=8388608;Tc1.DEPRECATE_EOF=16777216;Tc1.SSL_VERIFY_SERVER_CERT=1073741824;Tc1.REMEMBER_OPTIONS=2147483648;Tc1.MULTI_FACTOR_AUTHENTICATION=268435456});var RZ=S1((sc1)=>{sc1.BIG5_CHINESE_CI=1;sc1.LATIN2_CZECH_CS=2;sc1.DEC8_SWEDISH_CI=3;sc1.CP850_GENERAL_CI=4;sc1.LATIN1_GERMAN1_CI=5;sc1.HP8_ENGLISH_CI=6;sc1.KOI8R_GENERAL_CI=7;sc1.LATIN1_SWEDISH_CI=8;sc1.LATIN2_GENERAL_CI=9;sc1.SWE7_SWEDISH_CI=10;sc1.ASCII_GENERAL_CI=11;sc1.UJIS_JAPANESE_CI=12;sc1.SJIS_JAPANESE_CI=13;sc1.CP1251_BULGARIAN_CI=14;sc1.LATIN1_DANISH_CI=15;sc1.HEBREW_GENERAL_CI=16;sc1.TIS620_THAI_CI=18;sc1.EUCKR_KOREAN_CI=19;sc1.LATIN7_ESTONIAN_CS=20;sc1.LATIN2_HUNGARIAN_CI=21;sc1.KOI8U_GENERAL_CI=22;sc1.CP1251_UKRAINIAN_CI=23;sc1.GB2312_CHINESE_CI=24;sc1.GREEK_GENERAL_CI=25;sc1.CP1250_GENERAL_CI=26;sc1.LATIN2_CROATIAN_CI=27;sc1.GBK_CHINESE_CI=28;sc1.CP1257_LITHUANIAN_CI=29;sc1.LATIN5_TURKISH_CI=30;sc1.LATIN1_GERMAN2_CI=31;sc1.ARMSCII8_GENERAL_CI=32;sc1.UTF8_GENERAL_CI=33;sc1.CP1250_CZECH_CS=34;sc1.UCS2_GENERAL_CI=35;sc1.CP866_GENERAL_CI=36;sc1.KEYBCS2_GENERAL_CI=37;sc1.MACCE_GENERAL_CI=38;sc1.MACROMAN_GENERAL_CI=39;sc1.CP852_GENERAL_CI=40;sc1.LATIN7_GENERAL_CI=41;sc1.LATIN7_GENERAL_CS=42;sc1.MACCE_BIN=43;sc1.CP1250_CROATIAN_CI=44;sc1.UTF8MB4_GENERAL_CI=45;sc1.UTF8MB4_BIN=46;sc1.LATIN1_BIN=47;sc1.LATIN1_GENERAL_CI=48;sc1.LATIN1_GENERAL_CS=49;sc1.CP1251_BIN=50;sc1.CP1251_GENERAL_CI=51;sc1.CP1251_GENERAL_CS=52;sc1.MACROMAN_BIN=53;sc1.UTF16_GENERAL_CI=54;sc1.UTF16_BIN=55;sc1.UTF16LE_GENERAL_CI=56;sc1.CP1256_GENERAL_CI=57;sc1.CP1257_BIN=58;sc1.CP1257_GENERAL_CI=59;sc1.UTF32_GENERAL_CI=60;sc1.UTF32_BIN=61;sc1.UTF16LE_BIN=62;sc1.BINARY=63;sc1.ARMSCII8_BIN=64;sc1.ASCII_BIN=65;sc1.CP1250_BIN=66;sc1.CP1256_BIN=67;sc1.CP866_BIN=68;sc1.DEC8_BIN=69;sc1.GREEK_BIN=70;sc1.HEBREW_BIN=71;sc1.HP8_BIN=72;sc1.KEYBCS2_BIN=73;sc1.KOI8R_BIN=74;sc1.KOI8U_BIN=75;sc1.UTF8_TOLOWER_CI=76;sc1.LATIN2_BIN=77;sc1.LATIN5_BIN=78;sc1.LATIN7_BIN=79;sc1.CP850_BIN=80;sc1.CP852_BIN=81;sc1.SWE7_BIN=82;sc1.UTF8_BIN=83;sc1.BIG5_BIN=84;sc1.EUCKR_BIN=85;sc1.GB2312_BIN=86;sc1.GBK_BIN=87;sc1.SJIS_BIN=88;sc1.TIS620_BIN=89;sc1.UCS2_BIN=90;sc1.UJIS_BIN=91;sc1.GEOSTD8_GENERAL_CI=92;sc1.GEOSTD8_BIN=93;sc1.LATIN1_SPANISH_CI=94;sc1.CP932_JAPANESE_CI=95;sc1.CP932_BIN=96;sc1.EUCJPMS_JAPANESE_CI=97;sc1.EUCJPMS_BIN=98;sc1.CP1250_POLISH_CI=99;sc1.UTF16_UNICODE_CI=101;sc1.UTF16_ICELANDIC_CI=102;sc1.UTF16_LATVIAN_CI=103;sc1.UTF16_ROMANIAN_CI=104;sc1.UTF16_SLOVENIAN_CI=105;sc1.UTF16_POLISH_CI=106;sc1.UTF16_ESTONIAN_CI=107;sc1.UTF16_SPANISH_CI=108;sc1.UTF16_SWEDISH_CI=109;sc1.UTF16_TURKISH_CI=110;sc1.UTF16_CZECH_CI=111;sc1.UTF16_DANISH_CI=112;sc1.UTF16_LITHUANIAN_CI=113;sc1.UTF16_SLOVAK_CI=114;sc1.UTF16_SPANISH2_CI=115;sc1.UTF16_ROMAN_CI=116;sc1.UTF16_PERSIAN_CI=117;sc1.UTF16_ESPERANTO_CI=118;sc1.UTF16_HUNGARIAN_CI=119;sc1.UTF16_SINHALA_CI=120;sc1.UTF16_GERMAN2_CI=121;sc1.UTF16_CROATIAN_CI=122;sc1.UTF16_UNICODE_520_CI=123;sc1.UTF16_VIETNAMESE_CI=124;sc1.UCS2_UNICODE_CI=128;sc1.UCS2_ICELANDIC_CI=129;sc1.UCS2_LATVIAN_CI=130;sc1.UCS2_ROMANIAN_CI=131;sc1.UCS2_SLOVENIAN_CI=132;sc1.UCS2_POLISH_CI=133;sc1.UCS2_ESTONIAN_CI=134;sc1.UCS2_SPANISH_CI=135;sc1.UCS2_SWEDISH_CI=136;sc1.UCS2_TURKISH_CI=137;sc1.UCS2_CZECH_CI=138;sc1.UCS2_DANISH_CI=139;sc1.UCS2_LITHUANIAN_CI=140;sc1.UCS2_SLOVAK_CI=141;sc1.UCS2_SPANISH2_CI=142;sc1.UCS2_ROMAN_CI=143;sc1.UCS2_PERSIAN_CI=144;sc1.UCS2_ESPERANTO_CI=145;sc1.UCS2_HUNGARIAN_CI=146;sc1.UCS2_SINHALA_CI=147;sc1.UCS2_GERMAN2_CI=148;sc1.UCS2_CROATIAN_CI=149;sc1.UCS2_UNICODE_520_CI=150;sc1.UCS2_VIETNAMESE_CI=151;sc1.UCS2_GENERAL_MYSQL500_CI=159;sc1.UTF32_UNICODE_CI=160;sc1.UTF32_ICELANDIC_CI=161;sc1.UTF32_LATVIAN_CI=162;sc1.UTF32_ROMANIAN_CI=163;sc1.UTF32_SLOVENIAN_CI=164;sc1.UTF32_POLISH_CI=165;sc1.UTF32_ESTONIAN_CI=166;sc1.UTF32_SPANISH_CI=167;sc1.UTF32_SWEDISH_CI=168;sc1.UTF32_TURKISH_CI=169;sc1.UTF32_CZECH_CI=170;sc1.UTF32_DANISH_CI=171;sc1.UTF32_LITHUANIAN_CI=172;sc1.UTF32_SLOVAK_CI=173;sc1.UTF32_SPANISH2_CI=174;sc1.UTF32_ROMAN_CI=175;sc1.UTF32_PERSIAN_CI=176;sc1.UTF32_ESPERANTO_CI=177;sc1.UTF32_HUNGARIAN_CI=178;sc1.UTF32_SINHALA_CI=179;sc1.UTF32_GERMAN2_CI=180;sc1.UTF32_CROATIAN_CI=181;sc1.UTF32_UNICODE_520_CI=182;sc1.UTF32_VIETNAMESE_CI=183;sc1.UTF8_UNICODE_CI=192;sc1.UTF8_ICELANDIC_CI=193;sc1.UTF8_LATVIAN_CI=194;sc1.UTF8_ROMANIAN_CI=195;sc1.UTF8_SLOVENIAN_CI=196;sc1.UTF8_POLISH_CI=197;sc1.UTF8_ESTONIAN_CI=198;sc1.UTF8_SPANISH_CI=199;sc1.UTF8_SWEDISH_CI=200;sc1.UTF8_TURKISH_CI=201;sc1.UTF8_CZECH_CI=202;sc1.UTF8_DANISH_CI=203;sc1.UTF8_LITHUANIAN_CI=204;sc1.UTF8_SLOVAK_CI=205;sc1.UTF8_SPANISH2_CI=206;sc1.UTF8_ROMAN_CI=207;sc1.UTF8_PERSIAN_CI=208;sc1.UTF8_ESPERANTO_CI=209;sc1.UTF8_HUNGARIAN_CI=210;sc1.UTF8_SINHALA_CI=211;sc1.UTF8_GERMAN2_CI=212;sc1.UTF8_CROATIAN_CI=213;sc1.UTF8_UNICODE_520_CI=214;sc1.UTF8_VIETNAMESE_CI=215;sc1.UTF8_GENERAL_MYSQL500_CI=223;sc1.UTF8MB4_UNICODE_CI=224;sc1.UTF8MB4_ICELANDIC_CI=225;sc1.UTF8MB4_LATVIAN_CI=226;sc1.UTF8MB4_ROMANIAN_CI=227;sc1.UTF8MB4_SLOVENIAN_CI=228;sc1.UTF8MB4_POLISH_CI=229;sc1.UTF8MB4_ESTONIAN_CI=230;sc1.UTF8MB4_SPANISH_CI=231;sc1.UTF8MB4_SWEDISH_CI=232;sc1.UTF8MB4_TURKISH_CI=233;sc1.UTF8MB4_CZECH_CI=234;sc1.UTF8MB4_DANISH_CI=235;sc1.UTF8MB4_LITHUANIAN_CI=236;sc1.UTF8MB4_SLOVAK_CI=237;sc1.UTF8MB4_SPANISH2_CI=238;sc1.UTF8MB4_ROMAN_CI=239;sc1.UTF8MB4_PERSIAN_CI=240;sc1.UTF8MB4_ESPERANTO_CI=241;sc1.UTF8MB4_HUNGARIAN_CI=242;sc1.UTF8MB4_SINHALA_CI=243;sc1.UTF8MB4_GERMAN2_CI=244;sc1.UTF8MB4_CROATIAN_CI=245;sc1.UTF8MB4_UNICODE_520_CI=246;sc1.UTF8MB4_VIETNAMESE_CI=247;sc1.GB18030_CHINESE_CI=248;sc1.GB18030_BIN=249;sc1.GB18030_UNICODE_520_CI=250;sc1.UTF8_GENERAL50_CI=253;sc1.UTF8MB4_0900_AI_CI=255;sc1.UTF8MB4_DE_PB_0900_AI_CI=256;sc1.UTF8MB4_IS_0900_AI_CI=257;sc1.UTF8MB4_LV_0900_AI_CI=258;sc1.UTF8MB4_RO_0900_AI_CI=259;sc1.UTF8MB4_SL_0900_AI_CI=260;sc1.UTF8MB4_PL_0900_AI_CI=261;sc1.UTF8MB4_ET_0900_AI_CI=262;sc1.UTF8MB4_ES_0900_AI_CI=263;sc1.UTF8MB4_SV_0900_AI_CI=264;sc1.UTF8MB4_TR_0900_AI_CI=265;sc1.UTF8MB4_CS_0900_AI_CI=266;sc1.UTF8MB4_DA_0900_AI_CI=267;sc1.UTF8MB4_LT_0900_AI_CI=268;sc1.UTF8MB4_SK_0900_AI_CI=269;sc1.UTF8MB4_ES_TRAD_0900_AI_CI=270;sc1.UTF8MB4_LA_0900_AI_CI=271;sc1.UTF8MB4_EO_0900_AI_CI=273;sc1.UTF8MB4_HU_0900_AI_CI=274;sc1.UTF8MB4_HR_0900_AI_CI=275;sc1.UTF8MB4_VI_0900_AI_CI=277;sc1.UTF8MB4_0900_AS_CS=278;sc1.UTF8MB4_DE_PB_0900_AS_CS=279;sc1.UTF8MB4_IS_0900_AS_CS=280;sc1.UTF8MB4_LV_0900_AS_CS=281;sc1.UTF8MB4_RO_0900_AS_CS=282;sc1.UTF8MB4_SL_0900_AS_CS=283;sc1.UTF8MB4_PL_0900_AS_CS=284;sc1.UTF8MB4_ET_0900_AS_CS=285;sc1.UTF8MB4_ES_0900_AS_CS=286;sc1.UTF8MB4_SV_0900_AS_CS=287;sc1.UTF8MB4_TR_0900_AS_CS=288;sc1.UTF8MB4_CS_0900_AS_CS=289;sc1.UTF8MB4_DA_0900_AS_CS=290;sc1.UTF8MB4_LT_0900_AS_CS=291;sc1.UTF8MB4_SK_0900_AS_CS=292;sc1.UTF8MB4_ES_TRAD_0900_AS_CS=293;sc1.UTF8MB4_LA_0900_AS_CS=294;sc1.UTF8MB4_EO_0900_AS_CS=296;sc1.UTF8MB4_HU_0900_AS_CS=297;sc1.UTF8MB4_HR_0900_AS_CS=298;sc1.UTF8MB4_VI_0900_AS_CS=300;sc1.UTF8MB4_JA_0900_AS_CS=303;sc1.UTF8MB4_JA_0900_AS_CS_KS=304;sc1.UTF8MB4_0900_AS_CI=305;sc1.UTF8MB4_RU_0900_AI_CI=306;sc1.UTF8MB4_RU_0900_AS_CS=307;sc1.UTF8MB4_ZH_0900_AS_CS=308;sc1.UTF8MB4_0900_BIN=309;sc1.BIG5=sc1.BIG5_CHINESE_CI;sc1.DEC8=sc1.DEC8_SWEDISH_CI;sc1.CP850=sc1.CP850_GENERAL_CI;sc1.HP8=sc1.HP8_ENGLISH_CI;sc1.KOI8R=sc1.KOI8R_GENERAL_CI;sc1.LATIN1=sc1.LATIN1_SWEDISH_CI;sc1.LATIN2=sc1.LATIN2_GENERAL_CI;sc1.SWE7=sc1.SWE7_SWEDISH_CI;sc1.ASCII=sc1.ASCII_GENERAL_CI;sc1.UJIS=sc1.UJIS_JAPANESE_CI;sc1.SJIS=sc1.SJIS_JAPANESE_CI;sc1.HEBREW=sc1.HEBREW_GENERAL_CI;sc1.TIS620=sc1.TIS620_THAI_CI;sc1.EUCKR=sc1.EUCKR_KOREAN_CI;sc1.KOI8U=sc1.KOI8U_GENERAL_CI;sc1.GB2312=sc1.GB2312_CHINESE_CI;sc1.GREEK=sc1.GREEK_GENERAL_CI;sc1.CP1250=sc1.CP1250_GENERAL_CI;sc1.GBK=sc1.GBK_CHINESE_CI;sc1.LATIN5=sc1.LATIN5_TURKISH_CI;sc1.ARMSCII8=sc1.ARMSCII8_GENERAL_CI;sc1.UTF8=sc1.UTF8_GENERAL_CI;sc1.UCS2=sc1.UCS2_GENERAL_CI;sc1.CP866=sc1.CP866_GENERAL_CI;sc1.KEYBCS2=sc1.KEYBCS2_GENERAL_CI;sc1.MACCE=sc1.MACCE_GENERAL_CI;sc1.MACROMAN=sc1.MACROMAN_GENERAL_CI;sc1.CP852=sc1.CP852_GENERAL_CI;sc1.LATIN7=sc1.LATIN7_GENERAL_CI;sc1.UTF8MB4=sc1.UTF8MB4_GENERAL_CI;sc1.CP1251=sc1.CP1251_GENERAL_CI;sc1.UTF16=sc1.UTF16_GENERAL_CI;sc1.UTF16LE=sc1.UTF16LE_GENERAL_CI;sc1.CP1256=sc1.CP1256_GENERAL_CI;sc1.CP1257=sc1.CP1257_GENERAL_CI;sc1.UTF32=sc1.UTF32_GENERAL_CI;sc1.CP932=sc1.CP932_JAPANESE_CI;sc1.EUCJPMS=sc1.EUCJPMS_JAPANESE_CI;sc1.GB18030=sc1.GB18030_CHINESE_CI;sc1.GEOSTD8=sc1.GEOSTD8_GENERAL_CI});var N11=S1(($_4,ea1)=>{ea1.exports={name:"mysql2",version:"3.14.0",description:"fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",main:"index.js",typings:"typings/mysql/index",type:"commonjs",scripts:{lint:"eslint . && prettier --check .","lint:fix":"eslint . --fix && prettier --write .",test:"poku -d -r=verbose --sequential test/esm test/unit test/integration","test:bun":"bun poku -d --sequential test/esm test/unit test/integration","test:deno":'deno run --allow-read --allow-env --allow-run npm:poku -d --sequential --denoAllow="read,env,net,sys" test/esm test/unit test/integration',"test:tsc-build":'cd "test/tsc-build" && npx tsc -p "tsconfig.json"',"coverage-test":"c8 npm run test",benchmark:"node ./benchmarks/benchmark.js","wait-port":"wait-on"},repository:{type:"git",url:"git+https://github.com/sidorares/node-mysql2.git"},homepage:"https://sidorares.github.io/node-mysql2/docs",keywords:["mysql","client","server"],files:["lib","typings/mysql","index.js","index.d.ts","promise.js","promise.d.ts"],exports:{".":"./index.js","./package.json":"./package.json","./promise":"./promise.js","./promise.js":"./promise.js"},engines:{node:">= 8.0"},author:"Andrey Sidorov <andrey.sidorov@gmail.com>",license:"MIT",dependencies:{"aws-ssl-profiles":"^1.1.1",denque:"^2.1.0","generate-function":"^2.3.1","iconv-lite":"^0.6.3",long:"^5.2.1","lru.min":"^1.0.0","named-placeholders":"^1.1.3","seq-queue":"^0.0.5",sqlstring:"^2.3.2"},devDependencies:{"@eslint/eslintrc":"^3.3.0","@eslint/js":"^9.21.0","@eslint/markdown":"^6.2.2","@types/node":"^22.0.0","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","assert-diff":"^3.0.2",benchmark:"^2.1.4",c8:"^10.1.1","error-stack-parser":"^2.0.3","eslint-config-prettier":"^10.0.2","eslint-plugin-async-await":"^0.0.0","eslint-plugin-markdown":"^5.1.0","eslint-plugin-prettier":"^5.2.3",globals:"^16.0.0",poku:"^3.0.0",portfinder:"^1.0.28",prettier:"^3.0.0",typescript:"^5.0.2"}}});var T11=S1((R11)=>{Object.defineProperty(R11,"__esModule",{value:!0});R11.defaults=void 0;R11.defaults=[`-----BEGIN CERTIFICATE-----
1
+ import{Ca as TO}from"./chunk-0evg5jp6.js";import{Da as ky,Ea as hy}from"./chunk-cqrmkpzz.js";import{$a as BL,Ab as LL,Bb as WL,Cb as ZL,Db as TL,Eb as IL,Fb as JL,Gb as $L,Hb as EL,Ib as PL,Jb as CL,ab as wL,bb as DL,cb as kL,db as hL,eb as oR,fb as tR,gb as eR,hb as GL,ib as vL,jb as UL,kb as zL,lb as rR,mb as dR,nb as KL,ob as HL,pb as bL,qb as ML,rb as B7,sb as w7,tb as gL,ub as VL,vb as QL,wb as yL,xb as FL,yb as mL,zb as RL}from"./chunk-d9j9qatb.js";import{Kb as h5,Lb as YL}from"./chunk-ndpvrw19.js";import{$b as xo,Mb as jL,Nb as OL,Ob as Qg,Qb as xL,Rb as D7,Tb as fq,Ub as Rg,Vb as kk,Wb as go,Xb as P0,Yb as MZ,Zb as yo,ac as cL,bc as L0,cc as DE,dc as qL,ec as AL,fc as _L,gc as fL,hc as mo,jc as XL,kc as b0,lc as D9,mc as v4,nc as SL,oc as NL}from"./chunk-n4svhbxp.js";import{pc as Wb0,rc as _k,uc as GZ}from"./chunk-jvcbf2ew.js";import{Hc as Ho}from"./chunk-1dyb4ha1.js";import{Tc as Vo,Uc as Qo,Vc as Fo}from"./chunk-wjpycfhj.js";import{Xc as Uo}from"./chunk-xggr9n1s.js";import{$c as Kq,Yc as L4,Zc as y51,_c as S1,ad as b51,bd as U8}from"./chunk-g1f16je5.js";var DF=S1((we)=>{var y2=we,Be=/`/g,Nc1=/\./g,Xv=/[\0\b\t\n\r\x1a\"\'\\]/g,Rc1={"\x00":"\\0","\b":"\\b","\t":"\\t","\n":"\\n","\r":"\\r","\x1A":"\\Z",'"':"\\\"","'":"\\'","\\":"\\\\"};y2.escapeId=function G(Y,X){if(Array.isArray(Y)){var W="";for(var Z=0;Z<Y.length;Z++)W+=(Z===0?"":", ")+y2.escapeId(Y[Z],X);return W}else if(X)return"`"+String(Y).replace(Be,"``")+"`";else return"`"+String(Y).replace(Be,"``").replace(Nc1,"`.`")+"`"};y2.escape=function G(Y,X,W){if(Y===void 0||Y===null)return"NULL";switch(typeof Y){case"boolean":return Y?"true":"false";case"number":return Y+"";case"object":if(Object.prototype.toString.call(Y)==="[object Date]")return y2.dateToString(Y,W||"local");else if(Array.isArray(Y))return y2.arrayToList(Y,W);else if(Buffer.isBuffer(Y))return y2.bufferToString(Y);else if(typeof Y.toSqlString==="function")return String(Y.toSqlString());else if(X)return Hj(Y.toString());else return y2.objectToValues(Y,W);default:return Hj(Y)}};y2.arrayToList=function G(Y,X){var W="";for(var Z=0;Z<Y.length;Z++){var U=Y[Z];if(Array.isArray(U))W+=(Z===0?"":", ")+"("+y2.arrayToList(U,X)+")";else W+=(Z===0?"":", ")+y2.escape(U,!0,X)}return W};y2.format=function G(Y,X,W,Z){if(X==null)return Y;if(!Array.isArray(X))X=[X];var U=0,K=/\?+/g,J="",H=0,$;while(H<X.length&&($=K.exec(Y))){var Q=$[0].length;if(Q>2)continue;var F=Q===2?y2.escapeId(X[H]):y2.escape(X[H],W,Z);J+=Y.slice(U,$.index)+F,U=K.lastIndex,H++}if(U===0)return Y;if(U<Y.length)return J+Y.slice(U);return J};y2.dateToString=function G(Y,X){var W=new Date(Y);if(isNaN(W.getTime()))return"NULL";var Z,U,K,J,H,$,Q;if(X==="local")Z=W.getFullYear(),U=W.getMonth()+1,K=W.getDate(),J=W.getHours(),H=W.getMinutes(),$=W.getSeconds(),Q=W.getMilliseconds();else{var F=Lc1(X);if(F!==!1&&F!==0)W.setTime(W.getTime()+F*60000);Z=W.getUTCFullYear(),U=W.getUTCMonth()+1,K=W.getUTCDate(),J=W.getUTCHours(),H=W.getUTCMinutes(),$=W.getUTCSeconds(),Q=W.getUTCMilliseconds()}var z=P$(Z,4)+"-"+P$(U,2)+"-"+P$(K,2)+" "+P$(J,2)+":"+P$(H,2)+":"+P$($,2)+"."+P$(Q,3);return Hj(z)};y2.bufferToString=function G(Y){return"X"+Hj(Y.toString("hex"))};y2.objectToValues=function G(Y,X){var W="";for(var Z in Y){var U=Y[Z];if(typeof U==="function")continue;W+=(W.length===0?"":", ")+y2.escapeId(Z)+" = "+y2.escape(U,!0,X)}return W};y2.raw=function G(Y){if(typeof Y!=="string")throw new TypeError("argument sql must be a string");return{toSqlString:function X(){return Y}}};function Hj(G){var Y=Xv.lastIndex=0,X="",W;while(W=Xv.exec(G))X+=G.slice(Y,W.index)+Rc1[W[0]],Y=Xv.lastIndex;if(Y===0)return"'"+G+"'";if(Y<G.length)return"'"+X+G.slice(Y)+"'";return"'"+X+"'"}function P$(G,Y){G=G.toString();while(G.length<Y)G="0"+G;return G}function Lc1(G){if(G==="Z")return 0;var Y=G.match(/([\+\-\s])(\d\d):?(\d\d)?/);if(Y)return(Y[1]==="-"?-1:1)*(parseInt(Y[2],10)+(Y[3]?parseInt(Y[3],10):0)/60)*60;return!1}});var mX=S1((Tc1)=>{Tc1.LONG_PASSWORD=1;Tc1.FOUND_ROWS=2;Tc1.LONG_FLAG=4;Tc1.CONNECT_WITH_DB=8;Tc1.NO_SCHEMA=16;Tc1.COMPRESS=32;Tc1.ODBC=64;Tc1.LOCAL_FILES=128;Tc1.IGNORE_SPACE=256;Tc1.PROTOCOL_41=512;Tc1.INTERACTIVE=1024;Tc1.SSL=2048;Tc1.IGNORE_SIGPIPE=4096;Tc1.TRANSACTIONS=8192;Tc1.RESERVED=16384;Tc1.SECURE_CONNECTION=32768;Tc1.MULTI_STATEMENTS=65536;Tc1.MULTI_RESULTS=131072;Tc1.PS_MULTI_RESULTS=262144;Tc1.PLUGIN_AUTH=524288;Tc1.CONNECT_ATTRS=1048576;Tc1.PLUGIN_AUTH_LENENC_CLIENT_DATA=2097152;Tc1.CAN_HANDLE_EXPIRED_PASSWORDS=4194304;Tc1.SESSION_TRACK=8388608;Tc1.DEPRECATE_EOF=16777216;Tc1.SSL_VERIFY_SERVER_CERT=1073741824;Tc1.REMEMBER_OPTIONS=2147483648;Tc1.MULTI_FACTOR_AUTHENTICATION=268435456});var RZ=S1((sc1)=>{sc1.BIG5_CHINESE_CI=1;sc1.LATIN2_CZECH_CS=2;sc1.DEC8_SWEDISH_CI=3;sc1.CP850_GENERAL_CI=4;sc1.LATIN1_GERMAN1_CI=5;sc1.HP8_ENGLISH_CI=6;sc1.KOI8R_GENERAL_CI=7;sc1.LATIN1_SWEDISH_CI=8;sc1.LATIN2_GENERAL_CI=9;sc1.SWE7_SWEDISH_CI=10;sc1.ASCII_GENERAL_CI=11;sc1.UJIS_JAPANESE_CI=12;sc1.SJIS_JAPANESE_CI=13;sc1.CP1251_BULGARIAN_CI=14;sc1.LATIN1_DANISH_CI=15;sc1.HEBREW_GENERAL_CI=16;sc1.TIS620_THAI_CI=18;sc1.EUCKR_KOREAN_CI=19;sc1.LATIN7_ESTONIAN_CS=20;sc1.LATIN2_HUNGARIAN_CI=21;sc1.KOI8U_GENERAL_CI=22;sc1.CP1251_UKRAINIAN_CI=23;sc1.GB2312_CHINESE_CI=24;sc1.GREEK_GENERAL_CI=25;sc1.CP1250_GENERAL_CI=26;sc1.LATIN2_CROATIAN_CI=27;sc1.GBK_CHINESE_CI=28;sc1.CP1257_LITHUANIAN_CI=29;sc1.LATIN5_TURKISH_CI=30;sc1.LATIN1_GERMAN2_CI=31;sc1.ARMSCII8_GENERAL_CI=32;sc1.UTF8_GENERAL_CI=33;sc1.CP1250_CZECH_CS=34;sc1.UCS2_GENERAL_CI=35;sc1.CP866_GENERAL_CI=36;sc1.KEYBCS2_GENERAL_CI=37;sc1.MACCE_GENERAL_CI=38;sc1.MACROMAN_GENERAL_CI=39;sc1.CP852_GENERAL_CI=40;sc1.LATIN7_GENERAL_CI=41;sc1.LATIN7_GENERAL_CS=42;sc1.MACCE_BIN=43;sc1.CP1250_CROATIAN_CI=44;sc1.UTF8MB4_GENERAL_CI=45;sc1.UTF8MB4_BIN=46;sc1.LATIN1_BIN=47;sc1.LATIN1_GENERAL_CI=48;sc1.LATIN1_GENERAL_CS=49;sc1.CP1251_BIN=50;sc1.CP1251_GENERAL_CI=51;sc1.CP1251_GENERAL_CS=52;sc1.MACROMAN_BIN=53;sc1.UTF16_GENERAL_CI=54;sc1.UTF16_BIN=55;sc1.UTF16LE_GENERAL_CI=56;sc1.CP1256_GENERAL_CI=57;sc1.CP1257_BIN=58;sc1.CP1257_GENERAL_CI=59;sc1.UTF32_GENERAL_CI=60;sc1.UTF32_BIN=61;sc1.UTF16LE_BIN=62;sc1.BINARY=63;sc1.ARMSCII8_BIN=64;sc1.ASCII_BIN=65;sc1.CP1250_BIN=66;sc1.CP1256_BIN=67;sc1.CP866_BIN=68;sc1.DEC8_BIN=69;sc1.GREEK_BIN=70;sc1.HEBREW_BIN=71;sc1.HP8_BIN=72;sc1.KEYBCS2_BIN=73;sc1.KOI8R_BIN=74;sc1.KOI8U_BIN=75;sc1.UTF8_TOLOWER_CI=76;sc1.LATIN2_BIN=77;sc1.LATIN5_BIN=78;sc1.LATIN7_BIN=79;sc1.CP850_BIN=80;sc1.CP852_BIN=81;sc1.SWE7_BIN=82;sc1.UTF8_BIN=83;sc1.BIG5_BIN=84;sc1.EUCKR_BIN=85;sc1.GB2312_BIN=86;sc1.GBK_BIN=87;sc1.SJIS_BIN=88;sc1.TIS620_BIN=89;sc1.UCS2_BIN=90;sc1.UJIS_BIN=91;sc1.GEOSTD8_GENERAL_CI=92;sc1.GEOSTD8_BIN=93;sc1.LATIN1_SPANISH_CI=94;sc1.CP932_JAPANESE_CI=95;sc1.CP932_BIN=96;sc1.EUCJPMS_JAPANESE_CI=97;sc1.EUCJPMS_BIN=98;sc1.CP1250_POLISH_CI=99;sc1.UTF16_UNICODE_CI=101;sc1.UTF16_ICELANDIC_CI=102;sc1.UTF16_LATVIAN_CI=103;sc1.UTF16_ROMANIAN_CI=104;sc1.UTF16_SLOVENIAN_CI=105;sc1.UTF16_POLISH_CI=106;sc1.UTF16_ESTONIAN_CI=107;sc1.UTF16_SPANISH_CI=108;sc1.UTF16_SWEDISH_CI=109;sc1.UTF16_TURKISH_CI=110;sc1.UTF16_CZECH_CI=111;sc1.UTF16_DANISH_CI=112;sc1.UTF16_LITHUANIAN_CI=113;sc1.UTF16_SLOVAK_CI=114;sc1.UTF16_SPANISH2_CI=115;sc1.UTF16_ROMAN_CI=116;sc1.UTF16_PERSIAN_CI=117;sc1.UTF16_ESPERANTO_CI=118;sc1.UTF16_HUNGARIAN_CI=119;sc1.UTF16_SINHALA_CI=120;sc1.UTF16_GERMAN2_CI=121;sc1.UTF16_CROATIAN_CI=122;sc1.UTF16_UNICODE_520_CI=123;sc1.UTF16_VIETNAMESE_CI=124;sc1.UCS2_UNICODE_CI=128;sc1.UCS2_ICELANDIC_CI=129;sc1.UCS2_LATVIAN_CI=130;sc1.UCS2_ROMANIAN_CI=131;sc1.UCS2_SLOVENIAN_CI=132;sc1.UCS2_POLISH_CI=133;sc1.UCS2_ESTONIAN_CI=134;sc1.UCS2_SPANISH_CI=135;sc1.UCS2_SWEDISH_CI=136;sc1.UCS2_TURKISH_CI=137;sc1.UCS2_CZECH_CI=138;sc1.UCS2_DANISH_CI=139;sc1.UCS2_LITHUANIAN_CI=140;sc1.UCS2_SLOVAK_CI=141;sc1.UCS2_SPANISH2_CI=142;sc1.UCS2_ROMAN_CI=143;sc1.UCS2_PERSIAN_CI=144;sc1.UCS2_ESPERANTO_CI=145;sc1.UCS2_HUNGARIAN_CI=146;sc1.UCS2_SINHALA_CI=147;sc1.UCS2_GERMAN2_CI=148;sc1.UCS2_CROATIAN_CI=149;sc1.UCS2_UNICODE_520_CI=150;sc1.UCS2_VIETNAMESE_CI=151;sc1.UCS2_GENERAL_MYSQL500_CI=159;sc1.UTF32_UNICODE_CI=160;sc1.UTF32_ICELANDIC_CI=161;sc1.UTF32_LATVIAN_CI=162;sc1.UTF32_ROMANIAN_CI=163;sc1.UTF32_SLOVENIAN_CI=164;sc1.UTF32_POLISH_CI=165;sc1.UTF32_ESTONIAN_CI=166;sc1.UTF32_SPANISH_CI=167;sc1.UTF32_SWEDISH_CI=168;sc1.UTF32_TURKISH_CI=169;sc1.UTF32_CZECH_CI=170;sc1.UTF32_DANISH_CI=171;sc1.UTF32_LITHUANIAN_CI=172;sc1.UTF32_SLOVAK_CI=173;sc1.UTF32_SPANISH2_CI=174;sc1.UTF32_ROMAN_CI=175;sc1.UTF32_PERSIAN_CI=176;sc1.UTF32_ESPERANTO_CI=177;sc1.UTF32_HUNGARIAN_CI=178;sc1.UTF32_SINHALA_CI=179;sc1.UTF32_GERMAN2_CI=180;sc1.UTF32_CROATIAN_CI=181;sc1.UTF32_UNICODE_520_CI=182;sc1.UTF32_VIETNAMESE_CI=183;sc1.UTF8_UNICODE_CI=192;sc1.UTF8_ICELANDIC_CI=193;sc1.UTF8_LATVIAN_CI=194;sc1.UTF8_ROMANIAN_CI=195;sc1.UTF8_SLOVENIAN_CI=196;sc1.UTF8_POLISH_CI=197;sc1.UTF8_ESTONIAN_CI=198;sc1.UTF8_SPANISH_CI=199;sc1.UTF8_SWEDISH_CI=200;sc1.UTF8_TURKISH_CI=201;sc1.UTF8_CZECH_CI=202;sc1.UTF8_DANISH_CI=203;sc1.UTF8_LITHUANIAN_CI=204;sc1.UTF8_SLOVAK_CI=205;sc1.UTF8_SPANISH2_CI=206;sc1.UTF8_ROMAN_CI=207;sc1.UTF8_PERSIAN_CI=208;sc1.UTF8_ESPERANTO_CI=209;sc1.UTF8_HUNGARIAN_CI=210;sc1.UTF8_SINHALA_CI=211;sc1.UTF8_GERMAN2_CI=212;sc1.UTF8_CROATIAN_CI=213;sc1.UTF8_UNICODE_520_CI=214;sc1.UTF8_VIETNAMESE_CI=215;sc1.UTF8_GENERAL_MYSQL500_CI=223;sc1.UTF8MB4_UNICODE_CI=224;sc1.UTF8MB4_ICELANDIC_CI=225;sc1.UTF8MB4_LATVIAN_CI=226;sc1.UTF8MB4_ROMANIAN_CI=227;sc1.UTF8MB4_SLOVENIAN_CI=228;sc1.UTF8MB4_POLISH_CI=229;sc1.UTF8MB4_ESTONIAN_CI=230;sc1.UTF8MB4_SPANISH_CI=231;sc1.UTF8MB4_SWEDISH_CI=232;sc1.UTF8MB4_TURKISH_CI=233;sc1.UTF8MB4_CZECH_CI=234;sc1.UTF8MB4_DANISH_CI=235;sc1.UTF8MB4_LITHUANIAN_CI=236;sc1.UTF8MB4_SLOVAK_CI=237;sc1.UTF8MB4_SPANISH2_CI=238;sc1.UTF8MB4_ROMAN_CI=239;sc1.UTF8MB4_PERSIAN_CI=240;sc1.UTF8MB4_ESPERANTO_CI=241;sc1.UTF8MB4_HUNGARIAN_CI=242;sc1.UTF8MB4_SINHALA_CI=243;sc1.UTF8MB4_GERMAN2_CI=244;sc1.UTF8MB4_CROATIAN_CI=245;sc1.UTF8MB4_UNICODE_520_CI=246;sc1.UTF8MB4_VIETNAMESE_CI=247;sc1.GB18030_CHINESE_CI=248;sc1.GB18030_BIN=249;sc1.GB18030_UNICODE_520_CI=250;sc1.UTF8_GENERAL50_CI=253;sc1.UTF8MB4_0900_AI_CI=255;sc1.UTF8MB4_DE_PB_0900_AI_CI=256;sc1.UTF8MB4_IS_0900_AI_CI=257;sc1.UTF8MB4_LV_0900_AI_CI=258;sc1.UTF8MB4_RO_0900_AI_CI=259;sc1.UTF8MB4_SL_0900_AI_CI=260;sc1.UTF8MB4_PL_0900_AI_CI=261;sc1.UTF8MB4_ET_0900_AI_CI=262;sc1.UTF8MB4_ES_0900_AI_CI=263;sc1.UTF8MB4_SV_0900_AI_CI=264;sc1.UTF8MB4_TR_0900_AI_CI=265;sc1.UTF8MB4_CS_0900_AI_CI=266;sc1.UTF8MB4_DA_0900_AI_CI=267;sc1.UTF8MB4_LT_0900_AI_CI=268;sc1.UTF8MB4_SK_0900_AI_CI=269;sc1.UTF8MB4_ES_TRAD_0900_AI_CI=270;sc1.UTF8MB4_LA_0900_AI_CI=271;sc1.UTF8MB4_EO_0900_AI_CI=273;sc1.UTF8MB4_HU_0900_AI_CI=274;sc1.UTF8MB4_HR_0900_AI_CI=275;sc1.UTF8MB4_VI_0900_AI_CI=277;sc1.UTF8MB4_0900_AS_CS=278;sc1.UTF8MB4_DE_PB_0900_AS_CS=279;sc1.UTF8MB4_IS_0900_AS_CS=280;sc1.UTF8MB4_LV_0900_AS_CS=281;sc1.UTF8MB4_RO_0900_AS_CS=282;sc1.UTF8MB4_SL_0900_AS_CS=283;sc1.UTF8MB4_PL_0900_AS_CS=284;sc1.UTF8MB4_ET_0900_AS_CS=285;sc1.UTF8MB4_ES_0900_AS_CS=286;sc1.UTF8MB4_SV_0900_AS_CS=287;sc1.UTF8MB4_TR_0900_AS_CS=288;sc1.UTF8MB4_CS_0900_AS_CS=289;sc1.UTF8MB4_DA_0900_AS_CS=290;sc1.UTF8MB4_LT_0900_AS_CS=291;sc1.UTF8MB4_SK_0900_AS_CS=292;sc1.UTF8MB4_ES_TRAD_0900_AS_CS=293;sc1.UTF8MB4_LA_0900_AS_CS=294;sc1.UTF8MB4_EO_0900_AS_CS=296;sc1.UTF8MB4_HU_0900_AS_CS=297;sc1.UTF8MB4_HR_0900_AS_CS=298;sc1.UTF8MB4_VI_0900_AS_CS=300;sc1.UTF8MB4_JA_0900_AS_CS=303;sc1.UTF8MB4_JA_0900_AS_CS_KS=304;sc1.UTF8MB4_0900_AS_CI=305;sc1.UTF8MB4_RU_0900_AI_CI=306;sc1.UTF8MB4_RU_0900_AS_CS=307;sc1.UTF8MB4_ZH_0900_AS_CS=308;sc1.UTF8MB4_0900_BIN=309;sc1.BIG5=sc1.BIG5_CHINESE_CI;sc1.DEC8=sc1.DEC8_SWEDISH_CI;sc1.CP850=sc1.CP850_GENERAL_CI;sc1.HP8=sc1.HP8_ENGLISH_CI;sc1.KOI8R=sc1.KOI8R_GENERAL_CI;sc1.LATIN1=sc1.LATIN1_SWEDISH_CI;sc1.LATIN2=sc1.LATIN2_GENERAL_CI;sc1.SWE7=sc1.SWE7_SWEDISH_CI;sc1.ASCII=sc1.ASCII_GENERAL_CI;sc1.UJIS=sc1.UJIS_JAPANESE_CI;sc1.SJIS=sc1.SJIS_JAPANESE_CI;sc1.HEBREW=sc1.HEBREW_GENERAL_CI;sc1.TIS620=sc1.TIS620_THAI_CI;sc1.EUCKR=sc1.EUCKR_KOREAN_CI;sc1.KOI8U=sc1.KOI8U_GENERAL_CI;sc1.GB2312=sc1.GB2312_CHINESE_CI;sc1.GREEK=sc1.GREEK_GENERAL_CI;sc1.CP1250=sc1.CP1250_GENERAL_CI;sc1.GBK=sc1.GBK_CHINESE_CI;sc1.LATIN5=sc1.LATIN5_TURKISH_CI;sc1.ARMSCII8=sc1.ARMSCII8_GENERAL_CI;sc1.UTF8=sc1.UTF8_GENERAL_CI;sc1.UCS2=sc1.UCS2_GENERAL_CI;sc1.CP866=sc1.CP866_GENERAL_CI;sc1.KEYBCS2=sc1.KEYBCS2_GENERAL_CI;sc1.MACCE=sc1.MACCE_GENERAL_CI;sc1.MACROMAN=sc1.MACROMAN_GENERAL_CI;sc1.CP852=sc1.CP852_GENERAL_CI;sc1.LATIN7=sc1.LATIN7_GENERAL_CI;sc1.UTF8MB4=sc1.UTF8MB4_GENERAL_CI;sc1.CP1251=sc1.CP1251_GENERAL_CI;sc1.UTF16=sc1.UTF16_GENERAL_CI;sc1.UTF16LE=sc1.UTF16LE_GENERAL_CI;sc1.CP1256=sc1.CP1256_GENERAL_CI;sc1.CP1257=sc1.CP1257_GENERAL_CI;sc1.UTF32=sc1.UTF32_GENERAL_CI;sc1.CP932=sc1.CP932_JAPANESE_CI;sc1.EUCJPMS=sc1.EUCJPMS_JAPANESE_CI;sc1.GB18030=sc1.GB18030_CHINESE_CI;sc1.GEOSTD8=sc1.GEOSTD8_GENERAL_CI});var N11=S1(($_4,ea1)=>{ea1.exports={name:"mysql2",version:"3.14.0",description:"fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",main:"index.js",typings:"typings/mysql/index",type:"commonjs",scripts:{lint:"eslint . && prettier --check .","lint:fix":"eslint . --fix && prettier --write .",test:"poku -d -r=verbose --sequential test/esm test/unit test/integration","test:bun":"bun poku -d --sequential test/esm test/unit test/integration","test:deno":'deno run --allow-read --allow-env --allow-run npm:poku -d --sequential --denoAllow="read,env,net,sys" test/esm test/unit test/integration',"test:tsc-build":'cd "test/tsc-build" && npx tsc -p "tsconfig.json"',"coverage-test":"c8 npm run test",benchmark:"node ./benchmarks/benchmark.js","wait-port":"wait-on"},repository:{type:"git",url:"git+https://github.com/sidorares/node-mysql2.git"},homepage:"https://sidorares.github.io/node-mysql2/docs",keywords:["mysql","client","server"],files:["lib","typings/mysql","index.js","index.d.ts","promise.js","promise.d.ts"],exports:{".":"./index.js","./package.json":"./package.json","./promise":"./promise.js","./promise.js":"./promise.js"},engines:{node:">= 8.0"},author:"Andrey Sidorov <andrey.sidorov@gmail.com>",license:"MIT",dependencies:{"aws-ssl-profiles":"^1.1.1",denque:"^2.1.0","generate-function":"^2.3.1","iconv-lite":"^0.6.3",long:"^5.2.1","lru.min":"^1.0.0","named-placeholders":"^1.1.3","seq-queue":"^0.0.5",sqlstring:"^2.3.2"},devDependencies:{"@eslint/eslintrc":"^3.3.0","@eslint/js":"^9.21.0","@eslint/markdown":"^6.2.2","@types/node":"^22.0.0","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","assert-diff":"^3.0.2",benchmark:"^2.1.4",c8:"^10.1.1","error-stack-parser":"^2.0.3","eslint-config-prettier":"^10.0.2","eslint-plugin-async-await":"^0.0.0","eslint-plugin-markdown":"^5.1.0","eslint-plugin-prettier":"^5.2.3",globals:"^16.0.0",poku:"^3.0.0",portfinder:"^1.0.28",prettier:"^3.0.0",typescript:"^5.0.2"}}});var T11=S1((R11)=>{Object.defineProperty(R11,"__esModule",{value:!0});R11.defaults=void 0;R11.defaults=[`-----BEGIN CERTIFICATE-----
2
2
  MIIEEjCCAvqgAwIBAgIJAM2ZN/+nPi27MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD
3
3
  VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi
4
4
  MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h
@@ -3207,7 +3207,7 @@ ${Y}`,W}}}});var eP1=S1((oP1)=>{Object.defineProperty(oP1,"__esModule",{value:!0
3207
3207
  })(${ZC1(this.node)})
3208
3208
  `;return this.replaceWith($)[0].get("arguments.0")}function G54(G){let Y=G.params.findIndex((X)=>D24(X)||k24(X));return Y===-1?G.params.length:Y}});var AC1=S1((qC1)=>{Object.defineProperty(qC1,"__esModule",{value:!0});qC1._guessExecutionStatusRelativeTo=P54;qC1._resolve=FC1;qC1.canHaveVariableDeclarationOrExpression=L54;qC1.canSwapBetweenExpressionAndStatement=T54;qC1.getSource=O54;qC1.isCompletionRecord=I54;qC1.isConstantExpression=D54;qC1.isInStrictMode=k54;qC1.isNodeType=R54;qC1.isStatementOrBlock=E54;qC1.isStatic=N54;qC1.matchesPattern=S54;qC1.referencesImport=j54;qC1.resolve=w54;qC1.willIMaybeExecuteBefore=_54;var U54=a4(),{STATEMENT_OR_BLOCK_KEYS:z54,VISITOR_KEYS:K54,isBlockStatement:QC1,isExpression:H54,isIdentifier:V54,isLiteral:Q54,isStringLiteral:F54,isType:q54,matchesPattern:A54}=U54;function S54(G,Y){return A54(this.node,G,Y)}qC1.has=function G(Y){var X;let W=(X=this.node)==null?void 0:X[Y];if(W&&Array.isArray(W))return!!W.length;else return!!W};function N54(){return this.scope.isStatic(this.node)}qC1.is=qC1.has,qC1.isnt=function G(Y){return!this.has(Y)},qC1.equals=function G(Y,X){return this.node[Y]===X};function R54(G){return q54(this.type,G)}function L54(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function T54(G){if(this.key!=="body"||!this.parentPath.isArrowFunctionExpression())return!1;if(this.isExpression())return QC1(G);else if(this.isBlockStatement())return H54(G);return!1}function I54(G){let Y=this,X=!0;do{let{type:W,container:Z}=Y;if(!X&&(Y.isFunction()||W==="StaticBlock"))return!!G;if(X=!1,Array.isArray(Z)&&Y.key!==Z.length-1)return!1}while((Y=Y.parentPath)&&!Y.isProgram()&&!Y.isDoExpression());return!0}function E54(){if(this.parentPath.isLabeledStatement()||QC1(this.container))return!1;else return z54.includes(this.key)}function j54(G,Y){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===Y||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?F54(this.node.property,{value:Y}):this.node.property.name===Y)){let U=this.get("object");return U.isReferencedIdentifier()&&U.referencesImport(G,"*")}return!1}let X=this.scope.getBinding(this.node.name);if(!X||X.kind!=="module")return!1;let W=X.path,Z=W.parentPath;if(!Z.isImportDeclaration())return!1;if(Z.node.source.value===G){if(!Y)return!0}else return!1;if(W.isImportDefaultSpecifier()&&Y==="default")return!0;if(W.isImportNamespaceSpecifier()&&Y==="*")return!0;if(W.isImportSpecifier()&&V54(W.node.imported,{name:Y}))return!0;return!1}function O54(){let G=this.node;if(G.end){let Y=this.hub.getCode();if(Y)return Y.slice(G.start,G.end)}return""}function _54(G){return this._guessExecutionStatusRelativeTo(G)!=="after"}function KC1(G){return G.isProgram()?G:(G.parentPath.scope.getFunctionParent()||G.parentPath.scope.getProgramParent()).path}function f54(G,Y){switch(G){case"LogicalExpression":return Y==="right";case"ConditionalExpression":case"IfStatement":return Y==="consequent"||Y==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return Y==="body";case"ForStatement":return Y==="body"||Y==="update";case"SwitchStatement":return Y==="cases";case"TryStatement":return Y==="handler";case"AssignmentPattern":return Y==="right";case"OptionalMemberExpression":return Y==="property";case"OptionalCallExpression":return Y==="arguments";default:return!1}}function HC1(G,Y){for(let X=0;X<Y;X++){let W=G[X];if(f54(W.parent.type,W.parentKey))return!0}return!1}var VC1=Symbol();function P54(G){return ra(this,G,new Map)}function ra(G,Y,X){let W={this:KC1(G),target:KC1(Y)};if(W.target.node!==W.this.node)return B54(G,W.target,X);let Z={target:Y.getAncestry(),this:G.getAncestry()};if(Z.target.includes(G))return"after";if(Z.this.includes(Y))return"before";let U,K={target:0,this:0};while(!U&&K.this<Z.this.length){let Q=Z.this[K.this];if(K.target=Z.target.indexOf(Q),K.target>=0)U=Q;else K.this++}if(!U)throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");if(HC1(Z.this,K.this-1)||HC1(Z.target,K.target-1))return"unknown";let J={this:Z.this[K.this-1],target:Z.target[K.target-1]};if(J.target.listKey&&J.this.listKey&&J.target.container===J.this.container)return J.target.key>J.this.key?"before":"after";let H=K54[U.type],$={this:H.indexOf(J.this.parentKey),target:H.indexOf(J.target.parentKey)};return $.target>$.this?"before":"after"}function C54(G,Y,X){if(!Y.isFunctionDeclaration()){if(ra(G,Y,X)==="before")return"before";return"unknown"}else if(Y.parentPath.isExportDeclaration())return"unknown";let W=Y.scope.getBinding(Y.node.id.name);if(!W.references)return"before";let Z=W.referencePaths,U;for(let K of Z){if(!!K.find(($)=>$.node===Y.node))continue;if(K.key!=="callee"||!K.parentPath.isCallExpression())return"unknown";let H=ra(G,K,X);if(U&&U!==H)return"unknown";else U=H}return U}function B54(G,Y,X){let W=X.get(G.node),Z;if(!W)X.set(G.node,W=new Map);else if(Z=W.get(Y.node)){if(Z===VC1)return"unknown";return Z}W.set(Y.node,VC1);let U=C54(G,Y,X);return W.set(Y.node,U),U}function w54(G,Y){return FC1.call(this,G,Y)||this}function FC1(G,Y){var X;if((X=Y)!=null&&X.includes(this))return;if(Y=Y||[],Y.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(G,Y)}else if(this.isReferencedIdentifier()){let W=this.scope.getBinding(this.node.name);if(!W)return;if(!W.constant)return;if(W.kind==="module")return;if(W.path!==this){let Z=W.path.resolve(G,Y);if(this.find((U)=>U.node===Z.node))return;return Z}}else if(this.isTypeCastExpression())return this.get("expression").resolve(G,Y);else if(G&&this.isMemberExpression()){let W=this.toComputedKey();if(!Q54(W))return;let Z=W.value,U=this.get("object").resolve(G,Y);if(U.isObjectExpression()){let K=U.get("properties");for(let J of K){if(!J.isProperty())continue;let H=J.get("key"),$=J.isnt("computed")&&H.isIdentifier({name:Z});if($=$||H.isLiteral({value:Z}),$)return J.get("value").resolve(G,Y)}}else if(U.isArrayExpression()&&!isNaN(+Z)){let J=U.get("elements")[Z];if(J)return J.resolve(G,Y)}}}function D54(){if(this.isIdentifier()){let G=this.scope.getBinding(this.node.name);if(!G)return!1;return G.constant}if(this.isLiteral()){if(this.isRegExpLiteral())return!1;if(this.isTemplateLiteral())return this.get("expressions").every((G)=>G.isConstantExpression());return!0}if(this.isUnaryExpression()){if(this.node.operator!=="void")return!1;return this.get("argument").isConstantExpression()}if(this.isBinaryExpression()){let{operator:G}=this.node;return G!=="in"&&G!=="instanceof"&&this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}if(this.isMemberExpression())return!this.node.computed&&this.get("object").isIdentifier({name:"Symbol"})&&!this.scope.hasBinding("Symbol",{noGlobals:!0});if(this.isCallExpression())return this.node.arguments.length===1&&this.get("callee").matchesPattern("Symbol.for")&&!this.scope.hasBinding("Symbol",{noGlobals:!0})&&this.get("arguments")[0].isStringLiteral();return!1}function k54(){return!!(this.isProgram()?this:this.parentPath).find((X)=>{if(X.isProgram({sourceType:"module"}))return!0;if(X.isClass())return!0;if(X.isArrowFunctionExpression()&&!X.get("body").isBlockStatement())return!1;let W;if(X.isFunction())W=X.node.body;else if(X.isProgram())W=X.node;else return!1;for(let Z of W.directives)if(Z.value.value==="use strict")return!0})}});var IC1=S1((TC1)=>{Object.defineProperty(TC1,"__esModule",{value:!0});TC1._getKey=RC1;TC1._getPattern=LC1;TC1.get=V74;TC1.getAllNextSiblings=K74;TC1.getAllPrevSiblings=H74;TC1.getAssignmentIdentifiers=Q74;TC1.getBindingIdentifierPaths=A74;TC1.getBindingIdentifiers=F74;TC1.getCompletionRecords=J74;TC1.getNextSibling=z74;TC1.getOpposite=X74;TC1.getOuterBindingIdentifierPaths=S74;TC1.getOuterBindingIdentifiers=q74;TC1.getPrevSibling=U74;TC1.getSibling=$74;var sa=yJ(),s54=a4(),{getAssignmentIdentifiers:n54,getBindingIdentifiers:NC1,getOuterBindingIdentifiers:o54,numericLiteral:t54,unaryExpression:e54}=s54,na=0,aN=1;function G74(G){return{type:na,path:G}}function Y74(G){return{type:aN,path:G}}function X74(){if(this.key==="left")return this.getSibling("right");else if(this.key==="right")return this.getSibling("left");return null}function YQ(G,Y,X){if(G)Y.push(...XQ(G,X));return Y}function W74(G,Y,X){let W=[];for(let Z=0;Z<G.length;Z++){let U=G[Z],K=XQ(U,X),J=[],H=[];for(let $ of K){if($.type===na)J.push($);if($.type===aN)H.push($)}if(J.length)W=J;Y.push(...H)}return Y.push(...W),Y}function Z74(G){G.forEach((Y)=>{Y.type=aN})}function da(G,Y){G.forEach((X)=>{if(X.path.isBreakStatement({label:null}))if(Y)X.path.replaceWith(e54("void",t54(0)));else X.path.remove()})}function SC1(G,Y){let X=[];if(Y.canHaveBreak){let W=[];for(let Z=0;Z<G.length;Z++){let U=G[Z],K=Object.assign({},Y,{inCaseClause:!1});if(U.isBlockStatement()&&(Y.inCaseClause||Y.shouldPopulateBreak))K.shouldPopulateBreak=!0;else K.shouldPopulateBreak=!1;let J=XQ(U,K);if(J.length>0&&J.every((H)=>H.type===aN)){if(W.length>0&&J.every((H)=>H.path.isBreakStatement({label:null}))){if(Z74(W),X.push(...W),W.some((H)=>H.path.isDeclaration()))X.push(...J),da(J,!0);da(J,!1)}else if(X.push(...J),!Y.shouldPopulateBreak)da(J,!0);break}if(Z===G.length-1)X.push(...J);else{W=[];for(let H=0;H<J.length;H++){let $=J[H];if($.type===aN)X.push($);if($.type===na)W.push($)}}}}else if(G.length)for(let W=G.length-1;W>=0;W--){let Z=XQ(G[W],Y);if(Z.length>1||Z.length===1&&!Z[0].path.isVariableDeclaration()){X.push(...Z);break}}return X}function XQ(G,Y){let X=[];if(G.isIfStatement())X=YQ(G.get("consequent"),X,Y),X=YQ(G.get("alternate"),X,Y);else if(G.isDoExpression()||G.isFor()||G.isWhile()||G.isLabeledStatement())return YQ(G.get("body"),X,Y);else if(G.isProgram()||G.isBlockStatement())return SC1(G.get("body"),Y);else if(G.isFunction())return XQ(G.get("body"),Y);else if(G.isTryStatement())X=YQ(G.get("block"),X,Y),X=YQ(G.get("handler"),X,Y);else if(G.isCatchClause())return YQ(G.get("body"),X,Y);else if(G.isSwitchStatement())return W74(G.get("cases"),X,Y);else if(G.isSwitchCase())return SC1(G.get("consequent"),{canHaveBreak:!0,shouldPopulateBreak:!1,inCaseClause:!0});else if(G.isBreakStatement())X.push(Y74(G));else X.push(G74(G));return X}function J74(){return XQ(this,{canHaveBreak:!1,shouldPopulateBreak:!1,inCaseClause:!1}).map((Y)=>Y.path)}function $74(G){return sa.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:G}).setContext(this.context)}function U74(){return this.getSibling(this.key-1)}function z74(){return this.getSibling(this.key+1)}function K74(){let G=this.key,Y=this.getSibling(++G),X=[];while(Y.node)X.push(Y),Y=this.getSibling(++G);return X}function H74(){let G=this.key,Y=this.getSibling(--G),X=[];while(Y.node)X.push(Y),Y=this.getSibling(--G);return X}function V74(G,Y=!0){if(Y===!0)Y=this.context;let X=G.split(".");if(X.length===1)return RC1.call(this,G,Y);else return LC1.call(this,X,Y)}function RC1(G,Y){let X=this.node,W=X[G];if(Array.isArray(W))return W.map((Z,U)=>{return sa.default.get({listKey:G,parentPath:this,parent:X,container:W,key:U}).setContext(Y)});else return sa.default.get({parentPath:this,parent:X,container:X,key:G}).setContext(Y)}function LC1(G,Y){let X=this;for(let W of G)if(W===".")X=X.parentPath;else if(Array.isArray(X))X=X[W];else X=X.get(W,Y);return X}function Q74(){return n54(this.node)}function F74(G){return NC1(this.node,G)}function q74(G){return o54(this.node,G)}function A74(G=!1,Y=!1){let W=[this],Z=Object.create(null);while(W.length){let U=W.shift();if(!U)continue;if(!U.node)continue;let K=NC1.keys[U.node.type];if(U.isIdentifier()){if(G)(Z[U.node.name]=Z[U.node.name]||[]).push(U);else Z[U.node.name]=U;continue}if(U.isExportDeclaration()){let J=U.get("declaration");if(J.isDeclaration())W.push(J);continue}if(Y){if(U.isFunctionDeclaration()){W.push(U.get("id"));continue}if(U.isFunctionExpression())continue}if(K)for(let J=0;J<K.length;J++){let H=K[J],$=U.get(H);if(Array.isArray($))W.push(...$);else if($.node)W.push($)}}return Z}function S74(G=!1){return this.getBindingIdentifierPaths(G,!0)}});var OC1=S1((jC1)=>{Object.defineProperty(jC1,"__esModule",{value:!0});jC1.addComment=M74;jC1.addComments=g74;jC1.shareCommentsWithSiblings=b74;var k74=a4(),{addComment:h74,addComments:v74}=k74;function b74(){if(typeof this.key==="string")return;let G=this.node;if(!G)return;let{trailingComments:Y,leadingComments:X}=G;if(!Y&&!X)return;let W=this.getSibling(this.key-1),Z=this.getSibling(this.key+1),U=Boolean(W.node),K=Boolean(Z.node);if(U){if(X)W.addComments("trailing",EC1(X,W.node.trailingComments));if(Y&&!K)W.addComments("trailing",Y)}if(K){if(Y)Z.addComments("leading",EC1(Y,Z.node.leadingComments));if(X&&!U)Z.addComments("leading",X)}}function EC1(G,Y){if(!(Y!=null&&Y.length))return G;let X=new Set(Y);return G.filter((W)=>{return!X.has(W)})}function M74(G,Y,X){h74(this.node,G,Y,X)}function g74(G,Y){v74(this.node,G,Y)}});var yJ=S1((BC1)=>{Object.defineProperty(BC1,"__esModule",{value:!0});BC1.default=BC1.SHOULD_STOP=BC1.SHOULD_SKIP=BC1.REMOVED=void 0;var c74=Ua(),u74=Yy(),l74=mN(),p74=Aa(),PC1=a4(),$w=PC1,i74=sU(),a74=yi(),qX=Vf1(),WQ=vf1(),ZQ=fa(),_C1=wP1(),Xz=zC1(),R2=AC1(),CC1=VX(),$2=CC1,JQ=eB(),AX=Gw(),R7=IC1(),oa=OC1(),r74=Ka(),{validate:d74}=PC1,fC1=u74("babel"),q36=BC1.REMOVED=1,A36=BC1.SHOULD_STOP=2,S36=BC1.SHOULD_SKIP=4,DW=BC1.default=class G{constructor(Y,X){this.contexts=[],this.state=null,this.opts=null,this._traverseFlags=0,this.skipKeys=null,this.parentPath=null,this.container=null,this.listKey=null,this.key=null,this.node=null,this.type=null,this.parent=X,this.hub=Y,this.data=null,this.context=null,this.scope=null}get removed(){return(this._traverseFlags&1)>0}set removed(Y){if(Y)this._traverseFlags|=1;else this._traverseFlags&=-2}get shouldStop(){return(this._traverseFlags&2)>0}set shouldStop(Y){if(Y)this._traverseFlags|=2;else this._traverseFlags&=-3}get shouldSkip(){return(this._traverseFlags&4)>0}set shouldSkip(Y){if(Y)this._traverseFlags|=4;else this._traverseFlags&=-5}static get({hub:Y,parentPath:X,parent:W,container:Z,listKey:U,key:K}){if(!Y&&X)Y=X.hub;if(!W)throw new Error("To get a node path the parent needs to exist");let J=Z[K],H=i74.getOrCreateCachedPaths(Y,W),$=H.get(J);if(!$){if($=new G(Y,W),J)H.set(J,$)}return CC1.setup.call($,X,Z,U,K),$}getScope(Y){return this.isScope()?new p74.default(this):Y}setData(Y,X){if(this.data==null)this.data=Object.create(null);return this.data[Y]=X}getData(Y,X){if(this.data==null)this.data=Object.create(null);let W=this.data[Y];if(W===void 0&&X!==void 0)W=this.data[Y]=X;return W}hasNode(){return this.node!=null}buildCodeFrameError(Y,X=SyntaxError){return this.hub.buildError(this.node,Y,X)}traverse(Y,X){l74.default(this.node,Y,this.scope,X,this)}set(Y,X){d74(this.node,Y,X),this.node[Y]=X}getPathLocation(){let Y=[],X=this;do{let W=X.key;if(X.inList)W=`${X.listKey}[${W}]`;Y.unshift(W)}while(X=X.parentPath);return Y.join(".")}debug(Y){if(!fC1.enabled)return;fC1(`${this.getPathLocation()} ${this.type}: ${Y}`)}toString(){return a74.default(this.node).code}get inList(){return!!this.listKey}set inList(Y){if(!Y)this.listKey=null}get parentKey(){return this.listKey||this.key}},s74={findParent:qX.findParent,find:qX.find,getFunctionParent:qX.getFunctionParent,getStatementParent:qX.getStatementParent,getEarliestCommonAncestorFrom:qX.getEarliestCommonAncestorFrom,getDeepestCommonAncestorFrom:qX.getDeepestCommonAncestorFrom,getAncestry:qX.getAncestry,isAncestor:qX.isAncestor,isDescendant:qX.isDescendant,inType:qX.inType,getTypeAnnotation:WQ.getTypeAnnotation,isBaseType:WQ.isBaseType,couldBeBaseType:WQ.couldBeBaseType,baseTypeStrictlyMatches:WQ.baseTypeStrictlyMatches,isGenericType:WQ.isGenericType,replaceWithMultiple:ZQ.replaceWithMultiple,replaceWithSourceString:ZQ.replaceWithSourceString,replaceWith:ZQ.replaceWith,replaceExpressionWithStatements:ZQ.replaceExpressionWithStatements,replaceInline:ZQ.replaceInline,evaluateTruthy:_C1.evaluateTruthy,evaluate:_C1.evaluate,toComputedKey:Xz.toComputedKey,ensureBlock:Xz.ensureBlock,unwrapFunctionEnvironment:Xz.unwrapFunctionEnvironment,arrowFunctionToExpression:Xz.arrowFunctionToExpression,splitExportDeclaration:Xz.splitExportDeclaration,ensureFunctionName:Xz.ensureFunctionName,matchesPattern:R2.matchesPattern,isStatic:R2.isStatic,isNodeType:R2.isNodeType,canHaveVariableDeclarationOrExpression:R2.canHaveVariableDeclarationOrExpression,canSwapBetweenExpressionAndStatement:R2.canSwapBetweenExpressionAndStatement,isCompletionRecord:R2.isCompletionRecord,isStatementOrBlock:R2.isStatementOrBlock,referencesImport:R2.referencesImport,getSource:R2.getSource,willIMaybeExecuteBefore:R2.willIMaybeExecuteBefore,_guessExecutionStatusRelativeTo:R2._guessExecutionStatusRelativeTo,resolve:R2.resolve,isConstantExpression:R2.isConstantExpression,isInStrictMode:R2.isInStrictMode,isDenylisted:$2.isDenylisted,visit:$2.visit,skip:$2.skip,skipKey:$2.skipKey,stop:$2.stop,setContext:$2.setContext,requeue:$2.requeue,requeueComputedKeyAndDecorators:$2.requeueComputedKeyAndDecorators,remove:JQ.remove,insertBefore:AX.insertBefore,insertAfter:AX.insertAfter,unshiftContainer:AX.unshiftContainer,pushContainer:AX.pushContainer,getOpposite:R7.getOpposite,getCompletionRecords:R7.getCompletionRecords,getSibling:R7.getSibling,getPrevSibling:R7.getPrevSibling,getNextSibling:R7.getNextSibling,getAllNextSiblings:R7.getAllNextSiblings,getAllPrevSiblings:R7.getAllPrevSiblings,get:R7.get,getAssignmentIdentifiers:R7.getAssignmentIdentifiers,getBindingIdentifiers:R7.getBindingIdentifiers,getOuterBindingIdentifiers:R7.getOuterBindingIdentifiers,getBindingIdentifierPaths:R7.getBindingIdentifierPaths,getOuterBindingIdentifierPaths:R7.getOuterBindingIdentifierPaths,shareCommentsWithSiblings:oa.shareCommentsWithSiblings,addComment:oa.addComment,addComments:oa.addComments};Object.assign(DW.prototype,s74);DW.prototype.arrowFunctionToShadowed=Xz[String("arrowFunctionToShadowed")],Object.assign(DW.prototype,{has:R2[String("has")],is:R2[String("is")],isnt:R2[String("isnt")],equals:R2[String("equals")],hoist:AX[String("hoist")],updateSiblingKeys:AX.updateSiblingKeys,call:$2.call,isBlacklisted:$2[String("isBlacklisted")],setScope:$2.setScope,resync:$2.resync,popContext:$2.popContext,pushContext:$2.pushContext,setup:$2.setup,setKey:$2.setKey});DW.prototype._guessExecutionStatusRelativeToDifferentFunctions=R2._guessExecutionStatusRelativeTo,DW.prototype._guessExecutionStatusRelativeToDifferentFunctions=R2._guessExecutionStatusRelativeTo,Object.assign(DW.prototype,{_getTypeAnnotation:WQ._getTypeAnnotation,_replaceWith:ZQ._replaceWith,_resolve:R2._resolve,_call:$2._call,_resyncParent:$2._resyncParent,_resyncKey:$2._resyncKey,_resyncList:$2._resyncList,_resyncRemoved:$2._resyncRemoved,_getQueueContexts:$2._getQueueContexts,_removeFromScope:JQ._removeFromScope,_callRemovalHooks:JQ._callRemovalHooks,_remove:JQ._remove,_markRemoved:JQ._markRemoved,_assertUnremoved:JQ._assertUnremoved,_containerInsert:AX._containerInsert,_containerInsertBefore:AX._containerInsertBefore,_containerInsertAfter:AX._containerInsertAfter,_verifyNodeList:AX._verifyNodeList,_getKey:R7._getKey,_getPattern:R7._getPattern});for(let G of $w.TYPES){let Y=`is${G}`,X=$w[Y];DW.prototype[Y]=function(W){return X(this.node,W)},DW.prototype[`assert${G}`]=function(W){if(!X(this.node,W))throw new TypeError(`Expected node path of type ${G}`)}}Object.assign(DW.prototype,r74);for(let G of Object.keys(c74)){if(G[0]==="_")continue;if(!$w.TYPES.includes(G))$w.TYPES.push(G)}});var vC1=S1((kC1)=>{Object.defineProperty(kC1,"__esModule",{value:!0});kC1.default=void 0;var e74=yJ(),G34=a4(),ta=VX(),{VISITOR_KEYS:Y34}=G34;class DC1{constructor(G,Y,X,W){this.queue=null,this.priorityQueue=null,this.parentPath=W,this.scope=G,this.state=X,this.opts=Y}shouldVisit(G){let Y=this.opts;if(Y.enter||Y.exit)return!0;if(Y[G.type])return!0;let X=Y34[G.type];if(!(X!=null&&X.length))return!1;for(let W of X)if(G[W])return!0;return!1}create(G,Y,X,W){return e74.default.get({parentPath:this.parentPath,parent:G,container:Y,key:X,listKey:W})}maybeQueue(G,Y){if(this.queue)if(Y)this.queue.push(G);else this.priorityQueue.push(G)}visitMultiple(G,Y,X){if(G.length===0)return!1;let W=[];for(let Z=0;Z<G.length;Z++){let U=G[Z];if(U&&this.shouldVisit(U))W.push(this.create(Y,G,Z,X))}return this.visitQueue(W)}visitSingle(G,Y){if(this.shouldVisit(G[Y]))return this.visitQueue([this.create(G,G,Y)]);else return!1}visitQueue(G){this.queue=G,this.priorityQueue=[];let Y=new WeakSet,X=!1,W=0;for(;W<G.length;){let Z=G[W];if(W++,ta.resync.call(Z),Z.contexts.length===0||Z.contexts[Z.contexts.length-1]!==this)ta.pushContext.call(Z,this);if(Z.key===null)continue;let{node:U}=Z;if(Y.has(U))continue;if(U)Y.add(U);if(Z.visit()){X=!0;break}if(this.priorityQueue.length){if(X=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=G,X)break}}for(let Z=0;Z<W;Z++)ta.popContext.call(G[Z]);return this.queue=null,X}visit(G,Y){let X=G[Y];if(!X)return!1;if(Array.isArray(X))return this.visitMultiple(X,G,Y);else return this.visitSingle(G,Y)}}kC1.default=DC1});var iB=S1((bC1)=>{Object.defineProperty(bC1,"__esModule",{value:!0});bC1.traverseNode=J34;var X34=vC1(),W34=a4(),{VISITOR_KEYS:Z34}=W34;function J34(G,Y,X,W,Z,U,K){let J=Z34[G.type];if(!J)return!1;let H=new X34.default(X,Y,W,Z);if(K){if(U!=null&&U[Z.parentKey])return!1;return H.visitQueue([Z])}for(let $ of J){if(U!=null&&U[$])continue;if(H.visit(G,$))return!0}return!1}});var VX=S1((lC1)=>{Object.defineProperty(lC1,"__esModule",{value:!0});lC1._call=Gr;lC1._getQueueContexts=E34;lC1._resyncKey=cC1;lC1._resyncList=uC1;lC1._resyncParent=mC1;lC1._resyncRemoved=S34;lC1.call=ea;lC1.isDenylisted=yC1;lC1.popContext=N34;lC1.pushContext=R34;lC1.requeue=T34;lC1.requeueComputedKeyAndDecorators=I34;lC1.resync=A34;lC1.setContext=q34;lC1.setKey=Uw;lC1.setScope=xC1;lC1.setup=L34;lC1.skip=V34;lC1.skipKey=Q34;lC1.stop=F34;lC1.visit=H34;var U34=iB(),MC1=yJ(),z34=eB(),K34=a4();function ea(G){let Y=this.opts;if(this.debug(G),this.node){if(Gr.call(this,Y[G]))return!0}if(this.node){var X;return Gr.call(this,(X=Y[this.node.type])==null?void 0:X[G])}return!1}function Gr(G){if(!G)return!1;for(let Y of G){if(!Y)continue;let X=this.node;if(!X)return!0;let W=Y.call(this.state,this,this.state);if(W&&typeof W==="object"&&typeof W.then==="function")throw new Error("You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.");if(W)throw new Error(`Unexpected return value from visitor method ${Y}`);if(this.node!==X)return!0;if(this._traverseFlags>0)return!0}return!1}function yC1(){var G;let Y=(G=this.opts.denylist)!=null?G:this.opts.blacklist;return Y==null?void 0:Y.includes(this.node.type)}lC1.isBlacklisted=yC1;function gC1(G,Y){if(G.context!==Y)G.context=Y,G.state=Y.state,G.opts=Y.opts}function H34(){var G,Y;if(!this.node)return!1;if(this.isDenylisted())return!1;if((G=(Y=this.opts).shouldSkip)!=null&&G.call(Y,this))return!1;let X=this.context;if(this.shouldSkip||ea.call(this,"enter"))return this.debug("Skip..."),this.shouldStop;return gC1(this,X),this.debug("Recursing into..."),this.shouldStop=U34.traverseNode(this.node,this.opts,this.scope,this.state,this,this.skipKeys),gC1(this,X),ea.call(this,"exit"),this.shouldStop}function V34(){this.shouldSkip=!0}function Q34(G){if(this.skipKeys==null)this.skipKeys={};this.skipKeys[G]=!0}function F34(){this._traverseFlags|=MC1.SHOULD_SKIP|MC1.SHOULD_STOP}function xC1(){var G,Y;if((G=this.opts)!=null&&G.noScope)return;let X=this.parentPath;if((this.key==="key"||this.listKey==="decorators")&&X.isMethod()||this.key==="discriminant"&&X.isSwitchStatement())X=X.parentPath;let W;while(X&&!W){var Z;if((Z=X.opts)!=null&&Z.noScope)return;W=X.scope,X=X.parentPath}this.scope=this.getScope(W),(Y=this.scope)==null||Y.init()}function q34(G){if(this.skipKeys!=null)this.skipKeys={};if(this._traverseFlags=0,G)this.context=G,this.state=G.state,this.opts=G.opts;return xC1.call(this),this}function A34(){if(this.removed)return;mC1.call(this),uC1.call(this),cC1.call(this)}function mC1(){if(this.parentPath)this.parent=this.parentPath.node}function cC1(){if(!this.container)return;if(this.node===this.container[this.key])return;if(Array.isArray(this.container)){for(let G=0;G<this.container.length;G++)if(this.container[G]===this.node){Uw.call(this,G);return}}else for(let G of Object.keys(this.container))if(this.container[G]===this.node){Uw.call(this,G);return}this.key=null}function uC1(){if(!this.parent||!this.inList)return;let G=this.parent[this.listKey];if(this.container===G)return;this.container=G||null}function S34(){if(this.key==null||!this.container||this.container[this.key]!==this.node)z34._markRemoved.call(this)}function N34(){if(this.contexts.pop(),this.contexts.length>0)this.setContext(this.contexts[this.contexts.length-1]);else this.setContext(void 0)}function R34(G){this.contexts.push(G),this.setContext(G)}function L34(G,Y,X,W){this.listKey=X,this.container=Y,this.parentPath=G||this.parentPath,Uw.call(this,W)}function Uw(G){var Y;this.key=G,this.node=this.container[this.key],this.type=(Y=this.node)==null?void 0:Y.type}function T34(G=this){if(G.removed)return;let Y=this.contexts;for(let X of Y)X.maybeQueue(G)}function I34(){let{context:G,node:Y}=this;if(!K34.isPrivate(Y)&&Y.computed)G.maybeQueue(this.get("key"));if(Y.decorators)for(let X of this.get("decorators"))G.maybeQueue(X)}function E34(){let G=this,Y=this.contexts;while(!Y.length){if(G=G.parentPath,!G)break;Y=G.contexts}return Y}});var rC1=S1((iC1)=>{Object.defineProperty(iC1,"__esModule",{value:!0});iC1.default=void 0;class pC1{getCode(){}getScope(){}addHelper(){throw new Error("Helpers are not supported by the default hub.")}buildError(G,Y,X=TypeError){return new X(Y)}}iC1.default=pC1});var mN=S1((dN)=>{Object.defineProperty(dN,"__esModule",{value:!0});Object.defineProperty(dN,"Hub",{enumerable:!0,get:function(){return d34.default}});Object.defineProperty(dN,"NodePath",{enumerable:!0,get:function(){return a34.default}});Object.defineProperty(dN,"Scope",{enumerable:!0,get:function(){return r34.default}});dN.visitors=dN.default=void 0;VX();var rN=xN();dN.visitors=rN;var p34=a4(),i34=sU(),dC1=iB(),a34=yJ(),r34=Aa(),d34=rC1(),{VISITOR_KEYS:s34,removeProperties:n34,traverseFast:sC1}=p34;function FG(G,Y={},X,W,Z,U){if(!G)return;if(!Y.noScope&&!X){if(G.type!=="Program"&&G.type!=="File")throw new Error(`You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a ${G.type} node without passing scope and parentPath.`)}if(!Z&&U)throw new Error("visitSelf can only be used when providing a NodePath.");if(!s34[G.type])return;rN.explode(Y),dC1.traverseNode(G,Y,X,W,Z,null,U)}var j36=dN.default=FG;FG.visitors=rN;FG.verify=rN.verify;FG.explode=rN.explode;FG.cheap=function(G,Y){sC1(G,Y);return};FG.node=function(G,Y,X,W,Z,U){dC1.traverseNode(G,Y,X,W,Z,U)};FG.clearNode=function(G,Y){n34(G,Y)};FG.removeProperties=function(G,Y){return sC1(G,FG.clearNode,Y),G};function o34(G,Y){if(G.node.type===Y.type)Y.has=!0,G.stop()}FG.hasType=function(G,Y,X){if(X!=null&&X.includes(G.type))return!1;if(G.type===Y)return!0;let W={has:!1,type:Y};return FG(G,{noScope:!0,denylist:X,enter:o34},null,W),W.has};FG.cache=i34});import J$ from"node:process";import{runAction as v2}from"@stacksjs/actions";import{intro as Tk,log as X3,outro as aR,prompts as bb1}from"@stacksjs/cli";import{Action as b2}from"@stacksjs/enums";import{ExitCode as Ik}from"@stacksjs/types";function jX4(G){let Y={build:"Build any of your libraries (packages) for production use",components:"Build your component library",vueComponents:"Build your Vue component library",webComponents:"Build your framework agnostic web component library",elements:"An alias to the -w flag",buddy:"Build the Buddy binary",functions:"Build your function library",desktop:"Build the Desktop Application",pages:"Build your frontend",docs:"Build your documentation",framework:"Build Stacks framework",cli:"Automagically build the CLI",server:"Build the Stacks cloud server (Docker image)",select:"What are you trying to build?",project:"Target a specific project",verbose:"Enable verbose output"};G.command("build [type]",Y.build).option("-c, --components",Y.components).option("-v, --vue-components",Y.vueComponents).option("-w, --web-components",Y.webComponents).option("-e, --elements",Y.elements).option("-f, --functions",Y.functions).option("-p, --views",Y.pages).option("--pages",Y.pages).option("-d, --docs",Y.docs).option("-b, --buddy",Y.buddy,{default:!1}).option("-s, --stacks",Y.framework,{default:!1}).option("--project [project]",Y.project,{default:!1}).option("--server",Y.server,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X,W)=>{switch(X3.debug("Running `buddy build` ...",W),X){case"components":W.components=!0;break;case"vue":W.vueComponents=!0;break;case"web-components":W.webComponents=!0;break;case"functions":W.functions=!0;break;case"views":W.views=!0;break;case"docs":W.docs=!0;break;case"buddy":W.buddy=!0;break;case"cli":W.buddy=!0;break;case"stacks":W.stacks=!0;break;case"server":W.server=!0;break;default:break}if(console.log("server",X,W),Mb1(W)){console.log("has no");let Z=await bb1({type:"multiselect",name:"build",message:Y.select,choices:[{title:"Components",value:"components"},{title:"Web Components",value:"web-components"},{title:"Functions",value:"functions"},{title:"Views",value:"views"},{title:"Documentation",value:"docs"}]});if(console.log("answers",Z),Z!==null)J$.exit(Ik.InvalidArgument)}else console.log("has op");if(W.docs)await v2(b2.BuildDocs);if(W.components)await v2(b2.BuildComponentLibs);if(W.vueComponents)await v2(b2.BuildVueComponentLib);if(W.webComponents)await v2(b2.BuildWebComponentLib);if(W.functions)await v2(b2.BuildFunctionLib);if(W.views)await v2(b2.BuildViews);if(W.stacks)await v2(b2.BuildStacks);if(W.buddy)await v2(b2.BuildCli);if(W.server)await v2(b2.BuildServer);J$.exit(Ik.Success)}),G.command("build:components","Automagically build component libraries for production use & npm/CDN distribution").alias("prod:components").option("-c, --components",Y.components,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:components` ...",X),await v2(b2.BuildComponentLibs,X)}),G.command("build:cli",Y.cli).alias("prod:cli").option("-b, --buddy",Y.buddy,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:cli` ...",X),await v2(b2.BuildCli,X)}),G.command("build:server",Y.server).alias("prod:server").alias("build:docker").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:server` ...",X),await v2(b2.BuildServer,X)}),G.command("build:functions","Automagically build function library for npm/CDN distribution").option("-f, --functions",Y.functions,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy `build:functions` ...",X),await v2(b2.BuildFunctionLib,X)}),G.command("build:vue-components","Automagically build Vue component library for npm/CDN distribution").alias("build:vue").alias("prod:vue-components").alias("prod:vue").option("-v, --vue-components",Y.vueComponents,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).alias("build:vue").action(async(X)=>{X3.debug("Running `buddy build:vue-components` ...",X),await v2(b2.BuildVueComponentLib,X)}),G.command("build:web-components","Automagically build Web Component library for npm/CDN distribution").alias("build:wc").alias("prod:web-components").alias("prod:wc").option("-w, --web-components",Y.webComponents,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:web-components` ...",X),await v2(b2.BuildWebComponentLib,X)}),G.command("build:docs","Automagically build your documentation site.").alias("prod:docs").alias("build:documentation").alias("prod:documentation").option("-d, --docs",Y.docs,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:docs` ...",X),await v2(b2.BuildDocs,X)}),G.command("build:core","Automagically build the Stacks core.").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:core` ...",X);let W=await Tk("buddy build:core"),Z=await v2(b2.BuildCore,X);if(Z.isErr())X3.error("Failed to build the Stacks core.",Z.error),J$.exit();await aR("Core packages built successfully",{startTime:W,useSeconds:!0})}),G.command("build:desktop",Y.desktop).alias("prod:desktop").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:desktop` ...",X);let W=await Tk("buddy build:desktop"),Z=await v2(b2.BuildDesktop,X);if(Z.isErr())await aR("While running the build:desktop command, there was an issue",{startTime:W,useSeconds:!0},Z.error),J$.exit();console.log(""),await aR("Exited",{startTime:W,useSeconds:!0}),J$.exit(Ik.Success)}),G.command("build:stacks","Build the Stacks framework.").option("-s, --stacks",Y.framework,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{X3.debug("Running `buddy build:stacks` ...",X);let W=await Tk("buddy build:stacks"),Z=await v2(b2.BuildStacks,X);if(Z.isErr())X3.error("Failed to build Stacks.",Z.error),J$.exit();await aR("Stacks built successfully",{startTime:W,useSeconds:!0})}),G.on("build:*",()=>{console.error(`Invalid command: %s
3209
3209
  See --help for a list of available commands.`,G.args.join(" ")),J$.exit(1)})}function Mb1(G){return!G.components&&!G.vueComponents&&!G.webComponents&&!G.elements&&!G.functions&&!G.views&&!G.docs&&!G.stacks&&!G.buddy}import sn from"node:process";import{runAction as gb1}from"@stacksjs/actions";import{intro as yb1,log as xb1,outro as nn}from"@stacksjs/cli";import{Action as mb1}from"@stacksjs/enums";function BX4(G){let Y={changelog:"Create a CHANGELOG.md file",quiet:"Minimal output",dryRun:"Do not write the file, just output the changes",project:"Target a specific project",verbose:"Enable verbose output"};G.command("changelog",Y.changelog).option("-q, --quiet",Y.quiet,{default:!1}).option("-d, --dry-run",Y.dryRun,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{xb1.debug("Running `buddy changelog` ...",X);let W=await yb1("buddy changelog"),Z=await gb1(mb1.Changelog,X);if(Z.isErr())await nn("While running the changelog command, there was an issue",{...X,startTime:W,useSeconds:!0},Z.error),sn.exit();await nn("Generated CHANGELOG.md",{...X,startTime:W,useSeconds:!0,type:"success"})}),G.on("changelog:*",()=>{console.log("Invalid command: %s",G.args.join(" ")),console.log("See --help for a list of available commands."),sn.exit(1)})}import Ek from"node:process";import{runAction as cb1}from"@stacksjs/actions";import{intro as ub1,log as lb1,outro as on}from"@stacksjs/cli";import{Action as pb1}from"@stacksjs/enums";import{ExitCode as tn}from"@stacksjs/types";function MX4(G){let Y={clean:"Removes all node_modules & lock files",project:"Target a specific project",verbose:"Enable verbose output"};G.command("clean",Y.clean).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{lb1.debug("Running `buddy clean` ...",X);let W=await ub1("buddy clean"),Z=await cb1(pb1.Clean,X);if(Z.isErr())await on("While running the clean command, there was an issue",{startTime:W,useSeconds:!0},Z.error),Ek.exit(tn.FatalError);await on("Cleaned up",{startTime:W,useSeconds:!0,message:"Cleaned up"}),Ek.exit(tn.Success)}),G.on("clean:*",()=>{console.error(`Invalid command: %s
3210
- See --help for a list of available commands.`,G.args.join(" ")),Ek.exit(1)})}import J6 from"node:process";var iz=L4(_k(),1);var en=L4(GZ(),1);var Go=async(G,Y,X)=>{return{operation:rR(Y).operation,region:await dR(G.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function ib1(G){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cloudfront",region:G.region},propertiesExtractor:(Y,X)=>({signingProperties:{config:Y,context:X}})}}var Yo=(G)=>{let Y=[];switch(G.operation){default:Y.push(ib1(G))}return Y},Xo=(G)=>{let Y=en.resolveAwsSdkSigV4Config(G);return Object.assign(Y,{})};var Wo=(G)=>{return Object.assign(G,{useDualstackEndpoint:G.useDualstackEndpoint??!1,useFipsEndpoint:G.useFipsEndpoint??!1,defaultSigningName:"cloudfront"})},Zo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var Jo={name:"@aws-sdk/client-cloudfront",description:"AWS SDK for JavaScript Cloudfront Client for Node.js, Browser and React Native",version:"3.775.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cloudfront","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cloudfront"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.775.0","@aws-sdk/credential-provider-node":"3.775.0","@aws-sdk/middleware-host-header":"3.775.0","@aws-sdk/middleware-logger":"3.775.0","@aws-sdk/middleware-recursion-detection":"3.775.0","@aws-sdk/middleware-user-agent":"3.775.0","@aws-sdk/region-config-resolver":"3.775.0","@aws-sdk/types":"3.775.0","@aws-sdk/util-endpoints":"3.775.0","@aws-sdk/util-user-agent-browser":"3.775.0","@aws-sdk/util-user-agent-node":"3.775.0","@aws-sdk/xml-builder":"3.775.0","@smithy/config-resolver":"^4.1.0","@smithy/core":"^3.2.0","@smithy/fetch-http-handler":"^5.0.2","@smithy/hash-node":"^4.0.2","@smithy/invalid-dependency":"^4.0.2","@smithy/middleware-content-length":"^4.0.2","@smithy/middleware-endpoint":"^4.1.0","@smithy/middleware-retry":"^4.1.0","@smithy/middleware-serde":"^4.0.3","@smithy/middleware-stack":"^4.0.2","@smithy/node-config-provider":"^4.0.2","@smithy/node-http-handler":"^4.0.4","@smithy/protocol-http":"^5.1.0","@smithy/smithy-client":"^4.2.0","@smithy/types":"^4.2.0","@smithy/url-parser":"^4.0.2","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.8","@smithy/util-defaults-mode-node":"^4.0.8","@smithy/util-endpoints":"^3.0.2","@smithy/util-middleware":"^4.0.2","@smithy/util-retry":"^4.0.2","@smithy/util-stream":"^4.2.0","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.3",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.2.2"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudfront",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cloudfront"}};var wo=L4(GZ(),1);var YZ=L4(Uo(),1);var sR=L4(Uo(),1),$o="AWS_EC2_METADATA_DISABLED",zo=async(G)=>{let{ENV_CMDS_FULL_URI:Y,ENV_CMDS_RELATIVE_URI:X,fromContainerMetadata:W,fromInstanceMetadata:Z}=await import("./chunk-97y685k1.js");if(process.env[X]||process.env[Y]){G.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:U}=await import("./chunk-mq9sjfzt.js");return sR.chain(U(G),W(G))}if(process.env[$o]&&process.env[$o]!=="false")return async()=>{throw new sR.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:G.logger})};return G.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),Z(G)};var Ko=!1,nR=(G={})=>YZ.memoize(YZ.chain(async()=>{if(G.profile??process.env[Ho]){if(process.env[Vo]&&process.env[Qo]){if(!Ko)(G.logger?.warn&&G.logger?.constructor?.name!=="NoOpLogger"?G.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
3210
+ See --help for a list of available commands.`,G.args.join(" ")),Ek.exit(1)})}import J6 from"node:process";var iz=L4(_k(),1);var en=L4(GZ(),1);var Go=async(G,Y,X)=>{return{operation:rR(Y).operation,region:await dR(G.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function ib1(G){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cloudfront",region:G.region},propertiesExtractor:(Y,X)=>({signingProperties:{config:Y,context:X}})}}var Yo=(G)=>{let Y=[];switch(G.operation){default:Y.push(ib1(G))}return Y},Xo=(G)=>{let Y=en.resolveAwsSdkSigV4Config(G);return Object.assign(Y,{})};var Wo=(G)=>{return Object.assign(G,{useDualstackEndpoint:G.useDualstackEndpoint??!1,useFipsEndpoint:G.useFipsEndpoint??!1,defaultSigningName:"cloudfront"})},Zo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var Jo={name:"@aws-sdk/client-cloudfront",description:"AWS SDK for JavaScript Cloudfront Client for Node.js, Browser and React Native",version:"3.775.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cloudfront","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cloudfront"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.775.0","@aws-sdk/credential-provider-node":"3.775.0","@aws-sdk/middleware-host-header":"3.775.0","@aws-sdk/middleware-logger":"3.775.0","@aws-sdk/middleware-recursion-detection":"3.775.0","@aws-sdk/middleware-user-agent":"3.775.0","@aws-sdk/region-config-resolver":"3.775.0","@aws-sdk/types":"3.775.0","@aws-sdk/util-endpoints":"3.775.0","@aws-sdk/util-user-agent-browser":"3.775.0","@aws-sdk/util-user-agent-node":"3.775.0","@aws-sdk/xml-builder":"3.775.0","@smithy/config-resolver":"^4.1.0","@smithy/core":"^3.2.0","@smithy/fetch-http-handler":"^5.0.2","@smithy/hash-node":"^4.0.2","@smithy/invalid-dependency":"^4.0.2","@smithy/middleware-content-length":"^4.0.2","@smithy/middleware-endpoint":"^4.1.0","@smithy/middleware-retry":"^4.1.0","@smithy/middleware-serde":"^4.0.3","@smithy/middleware-stack":"^4.0.2","@smithy/node-config-provider":"^4.0.2","@smithy/node-http-handler":"^4.0.4","@smithy/protocol-http":"^5.1.0","@smithy/smithy-client":"^4.2.0","@smithy/types":"^4.2.0","@smithy/url-parser":"^4.0.2","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.8","@smithy/util-defaults-mode-node":"^4.0.8","@smithy/util-endpoints":"^3.0.2","@smithy/util-middleware":"^4.0.2","@smithy/util-retry":"^4.0.2","@smithy/util-stream":"^4.2.0","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.3",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.2.2"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudfront",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cloudfront"}};var wo=L4(GZ(),1);var YZ=L4(Uo(),1);var sR=L4(Uo(),1),$o="AWS_EC2_METADATA_DISABLED",zo=async(G)=>{let{ENV_CMDS_FULL_URI:Y,ENV_CMDS_RELATIVE_URI:X,fromContainerMetadata:W,fromInstanceMetadata:Z}=await import("./chunk-xd0ntg7m.js");if(process.env[X]||process.env[Y]){G.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:U}=await import("./chunk-pq12d9s0.js");return sR.chain(U(G),W(G))}if(process.env[$o]&&process.env[$o]!=="false")return async()=>{throw new sR.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:G.logger})};return G.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),Z(G)};var Ko=!1,nR=(G={})=>YZ.memoize(YZ.chain(async()=>{if(G.profile??process.env[Ho]){if(process.env[Vo]&&process.env[Qo]){if(!Ko)(G.logger?.warn&&G.logger?.constructor?.name!=="NoOpLogger"?G.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
3211
3211
  Multiple credential sources detected:
3212
3212
  Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
3213
3213
  This SDK will proceed with the AWS_PROFILE value.
@@ -3215,7 +3215,7 @@ See --help for a list of available commands.`,G.args.join(" ")),Ek.exit(1)})}imp
3215
3215
  However, a future version may change this behavior to prefer the ENV static credentials.
3216
3216
  Please ensure that your environment only sets either the AWS_PROFILE or the
3217
3217
  AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
3218
- `),Ko=!0}throw new YZ.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:G.logger,tryNextLink:!0})}return G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),Fo(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:Y,ssoAccountId:X,ssoRegion:W,ssoRoleName:Z,ssoSession:U}=G;if(!Y&&!X&&!W&&!Z&&!U)throw new YZ.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:G.logger});let{fromSSO:K}=await import("./chunk-c57y9ssg.js");return K(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:Y}=await import("./chunk-02xryjt7.js");return Y(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:Y}=await import("./chunk-5ac533gv.js");return Y(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:Y}=await import("./chunk-225rwa7q.js");return Y(G)()},async()=>{return G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await zo(G))()},async()=>{throw new YZ.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:G.logger})}),db1,rb1),rb1=(G)=>G?.expiration!==void 0,db1=(G)=>G?.expiration!==void 0&&G.expiration.getTime()-Date.now()<300000;var Co=L4(GZ(),1);var qo={["required"]:!1,type:"String"},Ao={["required"]:!0,default:!1,type:"Boolean"},So={["ref"]:"Endpoint"},Ok={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},_o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},W3={},No={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"name"]},"aws"]},sb1={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"name"]},Ro={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},jk={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Lo={authSchemes:[{name:"sigv4",signingName:"cloudfront",signingRegion:"us-east-1"}]},To={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Io={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},Eo=[Ok],jo=[_o],Oo=[{["ref"]:"Region"}],nb1={version:"1.0",parameters:{Region:qo,UseDualStack:Ao,UseFIPS:Ao,Endpoint:qo},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[So]}],rules:[{conditions:Eo,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:jo,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:So,properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Oo}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Oo,assign:"PartitionResult"}],rules:[{conditions:[No,Ro,jk],endpoint:{url:"https://cloudfront.amazonaws.com",properties:Lo,headers:W3},type:"endpoint"},{conditions:[No,Ok,jk],endpoint:{url:"https://cloudfront-fips.amazonaws.com",properties:Lo,headers:W3},type:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[sb1,"aws-cn"]},Ro,jk],endpoint:{url:"https://cloudfront.cn-northwest-1.amazonaws.com.cn",properties:{authSchemes:[{name:"sigv4",signingName:"cloudfront",signingRegion:"cn-northwest-1"}]},headers:W3},type:"endpoint"},{conditions:[Ok,_o],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,To]},Io],rules:[{endpoint:{url:"https://cloudfront-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Eo,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[To,!0]}],rules:[{endpoint:{url:"https://cloudfront-fips.{Region}.{PartitionResult#dnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:jo,rules:[{conditions:[Io],rules:[{endpoint:{url:"https://cloudfront.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://cloudfront.{Region}.{PartitionResult#dnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},fo=nb1;var ob1=new oR({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Po=(G,Y={})=>{return ob1.get(G,()=>eR(fo,{endpointParams:G,logger:Y.logger}))};tR.aws=GL;var Bo=(G)=>{return{apiVersion:"2020-05-31",base64Decoder:G?.base64Decoder??JL,base64Encoder:G?.base64Encoder??$L,disableHostPrefix:G?.disableHostPrefix??!1,endpointProvider:G?.endpointProvider??Po,extensions:G?.extensions??[],httpAuthSchemeProvider:G?.httpAuthSchemeProvider??Yo,httpAuthSchemes:G?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(Y)=>Y.getIdentityProvider("aws.auth#sigv4"),signer:new Co.AwsSdkSigV4Signer}],logger:G?.logger??new XL,serviceId:G?.serviceId??"CloudFront",urlParser:G?.urlParser??YL,utf8Decoder:G?.utf8Decoder??WL,utf8Encoder:G?.utf8Encoder??ZL}};var Do=(G)=>{AL(process.version);let Y=EL(G),X=()=>Y().then(qL),W=Bo(G);wo.emitWarningIfUnsupportedVersion(process.version);let Z={profile:G?.profile};return{...W,...G,runtime:"node",defaultsMode:Y,bodyLengthChecker:G?.bodyLengthChecker??IL,credentialDefaultProvider:G?.credentialDefaultProvider??nR,defaultUserAgentProvider:G?.defaultUserAgentProvider??RL({serviceId:W.serviceId,clientVersion:Jo.version}),maxAttempts:G?.maxAttempts??h5(QL,G),region:G?.region??h5(KL,{...HL,...Z}),requestHandler:SL.create(G?.requestHandler??X),retryMode:G?.retryMode??h5({...FL,default:async()=>(await X()).retryMode||VL},G),sha256:G?.sha256??TL.bind(null,"sha256"),streamCollector:G?.streamCollector??NL,useDualstackEndpoint:G?.useDualstackEndpoint??h5(UL,Z),useFipsEndpoint:G?.useFipsEndpoint??h5(zL,Z),userAgentAppId:G?.userAgentAppId??h5(LL,Z)}};var ko=(G)=>{let{httpAuthSchemes:Y,httpAuthSchemeProvider:X,credentials:W}=G;return{setHttpAuthScheme(Z){let U=Y.findIndex((K)=>K.schemeId===Z.schemeId);if(U===-1)Y.push(Z);else Y.splice(U,1,Z)},httpAuthSchemes(){return Y},setHttpAuthSchemeProvider(Z){X=Z},httpAuthSchemeProvider(){return X},setCredentials(Z){W=Z},credentials(){return W}}},ho=(G)=>{return{httpAuthSchemes:G.httpAuthSchemes(),httpAuthSchemeProvider:G.httpAuthSchemeProvider(),credentials:G.credentials()}};var vo=(G,Y)=>{let X=Object.assign(PL(G),_L(G),jL(G),ko(G));return Y.forEach((W)=>W.configure(X)),Object.assign(G,CL(X),fL(X),OL(X),ho(X))};class fk extends xL{config;constructor(...[G]){let Y=Do(G||{});super(Y);this.initConfig=Y;let X=Wo(Y),W=hL(X),Z=yL(W),U=bL(Z),K=BL(U),J=gL(K),H=Xo(J),$=vo(H,G?.extensions||[]);this.config=$,this.middlewareStack.use(vL(this.config)),this.middlewareStack.use(mL(this.config)),this.middlewareStack.use(ML(this.config)),this.middlewareStack.use(wL(this.config)),this.middlewareStack.use(DL(this.config)),this.middlewareStack.use(kL(this.config)),this.middlewareStack.use(iz.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Go,identityProviderConfigProvider:async(Q)=>new iz.DefaultIdentityProviderConfig({"aws.auth#sigv4":Q.credentials})})),this.middlewareStack.use(iz.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}var sz=L4(GZ(),1);function bo(G){return G.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Mo(G){return G.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}class Pk{value;constructor(G){this.value=G}toString(){return Mo(""+this.value)}}class TY{name;children;attributes={};static of(G,Y,X){let W=new TY(G);if(Y!==void 0)W.addChildNode(new Pk(Y));if(X!==void 0)W.withName(X);return W}constructor(G,Y=[]){this.name=G,this.children=Y}withName(G){return this.name=G,this}addAttribute(G,Y){return this.attributes[G]=Y,this}addChildNode(G){return this.children.push(G),this}removeAttribute(G){return delete this.attributes[G],this}n(G){return this.name=G,this}c(G){return this.children.push(G),this}a(G,Y){if(Y!=null)this.attributes[G]=Y;return this}cc(G,Y,X=Y){if(G[Y]!=null){let W=TY.of(Y,G[Y]).withName(X);this.c(W)}}l(G,Y,X,W){if(G[Y]!=null)W().map((U)=>{U.withName(X),this.c(U)})}lc(G,Y,X,W){if(G[Y]!=null){let Z=W(),U=new TY(X);Z.map((K)=>{U.c(K)}),this.c(U)}}toString(){let G=Boolean(this.children.length),Y=`<${this.name}`,X=this.attributes;for(let W of Object.keys(X)){let Z=X[W];if(Z!=null)Y+=` ${W}="${bo(""+Z)}"`}return Y+=!G?"/>":`>${this.children.map((W)=>W.toString()).join("")}</${this.name}>`}}var co=L4(_k(),1);class k0 extends cL{constructor(G){super(G);Object.setPrototypeOf(this,k0.prototype)}}class uL extends k0{name="AccessDenied";$fault="client";Message;constructor(G){super({name:"AccessDenied",$fault:"client",...G});Object.setPrototypeOf(this,uL.prototype),this.Message=G.Message}}class lL extends k0{name="IllegalUpdate";$fault="client";Message;constructor(G){super({name:"IllegalUpdate",$fault:"client",...G});Object.setPrototypeOf(this,lL.prototype),this.Message=G.Message}}class pL extends k0{name="InvalidArgument";$fault="client";Message;constructor(G){super({name:"InvalidArgument",$fault:"client",...G});Object.setPrototypeOf(this,pL.prototype),this.Message=G.Message}}class iL extends k0{name="NoSuchDistribution";$fault="client";Message;constructor(G){super({name:"NoSuchDistribution",$fault:"client",...G});Object.setPrototypeOf(this,iL.prototype),this.Message=G.Message}}class aL extends k0{name="TooManyDistributionCNAMEs";$fault="client";Message;constructor(G){super({name:"TooManyDistributionCNAMEs",$fault:"client",...G});Object.setPrototypeOf(this,aL.prototype),this.Message=G.Message}}class rL extends k0{name="BatchTooLarge";$fault="client";Message;constructor(G){super({name:"BatchTooLarge",$fault:"client",...G});Object.setPrototypeOf(this,rL.prototype),this.Message=G.Message}}class dL extends k0{name="CachePolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"CachePolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,dL.prototype),this.Message=G.Message}}class sL extends k0{name="CachePolicyInUse";$fault="client";Message;constructor(G){super({name:"CachePolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,sL.prototype),this.Message=G.Message}}class nL extends k0{name="CannotChangeImmutablePublicKeyFields";$fault="client";Message;constructor(G){super({name:"CannotChangeImmutablePublicKeyFields",$fault:"client",...G});Object.setPrototypeOf(this,nL.prototype),this.Message=G.Message}}class oL extends k0{name="CannotDeleteEntityWhileInUse";$fault="client";Message;constructor(G){super({name:"CannotDeleteEntityWhileInUse",$fault:"client",...G});Object.setPrototypeOf(this,oL.prototype),this.Message=G.Message}}class tL extends k0{name="CannotUpdateEntityWhileInUse";$fault="client";Message;constructor(G){super({name:"CannotUpdateEntityWhileInUse",$fault:"client",...G});Object.setPrototypeOf(this,tL.prototype),this.Message=G.Message}}class eL extends k0{name="CNAMEAlreadyExists";$fault="client";Message;constructor(G){super({name:"CNAMEAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,eL.prototype),this.Message=G.Message}}class GT extends k0{name="DistributionAlreadyExists";$fault="client";Message;constructor(G){super({name:"DistributionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,GT.prototype),this.Message=G.Message}}class YT extends k0{name="IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior";$fault="client";Message;constructor(G){super({name:"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior",$fault:"client",...G});Object.setPrototypeOf(this,YT.prototype),this.Message=G.Message}}class XT extends k0{name="InconsistentQuantities";$fault="client";Message;constructor(G){super({name:"InconsistentQuantities",$fault:"client",...G});Object.setPrototypeOf(this,XT.prototype),this.Message=G.Message}}class WT extends k0{name="InvalidDefaultRootObject";$fault="client";Message;constructor(G){super({name:"InvalidDefaultRootObject",$fault:"client",...G});Object.setPrototypeOf(this,WT.prototype),this.Message=G.Message}}class ZT extends k0{name="InvalidErrorCode";$fault="client";Message;constructor(G){super({name:"InvalidErrorCode",$fault:"client",...G});Object.setPrototypeOf(this,ZT.prototype),this.Message=G.Message}}class JT extends k0{name="InvalidForwardCookies";$fault="client";Message;constructor(G){super({name:"InvalidForwardCookies",$fault:"client",...G});Object.setPrototypeOf(this,JT.prototype),this.Message=G.Message}}class $T extends k0{name="InvalidFunctionAssociation";$fault="client";Message;constructor(G){super({name:"InvalidFunctionAssociation",$fault:"client",...G});Object.setPrototypeOf(this,$T.prototype),this.Message=G.Message}}class UT extends k0{name="InvalidGeoRestrictionParameter";$fault="client";Message;constructor(G){super({name:"InvalidGeoRestrictionParameter",$fault:"client",...G});Object.setPrototypeOf(this,UT.prototype),this.Message=G.Message}}class zT extends k0{name="InvalidHeadersForS3Origin";$fault="client";Message;constructor(G){super({name:"InvalidHeadersForS3Origin",$fault:"client",...G});Object.setPrototypeOf(this,zT.prototype),this.Message=G.Message}}class KT extends k0{name="InvalidIfMatchVersion";$fault="client";Message;constructor(G){super({name:"InvalidIfMatchVersion",$fault:"client",...G});Object.setPrototypeOf(this,KT.prototype),this.Message=G.Message}}class HT extends k0{name="InvalidLambdaFunctionAssociation";$fault="client";Message;constructor(G){super({name:"InvalidLambdaFunctionAssociation",$fault:"client",...G});Object.setPrototypeOf(this,HT.prototype),this.Message=G.Message}}class VT extends k0{name="InvalidLocationCode";$fault="client";Message;constructor(G){super({name:"InvalidLocationCode",$fault:"client",...G});Object.setPrototypeOf(this,VT.prototype),this.Message=G.Message}}class QT extends k0{name="InvalidMinimumProtocolVersion";$fault="client";Message;constructor(G){super({name:"InvalidMinimumProtocolVersion",$fault:"client",...G});Object.setPrototypeOf(this,QT.prototype),this.Message=G.Message}}class FT extends k0{name="InvalidOrigin";$fault="client";Message;constructor(G){super({name:"InvalidOrigin",$fault:"client",...G});Object.setPrototypeOf(this,FT.prototype),this.Message=G.Message}}class qT extends k0{name="InvalidOriginAccessControl";$fault="client";Message;constructor(G){super({name:"InvalidOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,qT.prototype),this.Message=G.Message}}class AT extends k0{name="InvalidOriginAccessIdentity";$fault="client";Message;constructor(G){super({name:"InvalidOriginAccessIdentity",$fault:"client",...G});Object.setPrototypeOf(this,AT.prototype),this.Message=G.Message}}class ST extends k0{name="InvalidOriginKeepaliveTimeout";$fault="client";Message;constructor(G){super({name:"InvalidOriginKeepaliveTimeout",$fault:"client",...G});Object.setPrototypeOf(this,ST.prototype),this.Message=G.Message}}class NT extends k0{name="InvalidOriginReadTimeout";$fault="client";Message;constructor(G){super({name:"InvalidOriginReadTimeout",$fault:"client",...G});Object.setPrototypeOf(this,NT.prototype),this.Message=G.Message}}class RT extends k0{name="InvalidProtocolSettings";$fault="client";Message;constructor(G){super({name:"InvalidProtocolSettings",$fault:"client",...G});Object.setPrototypeOf(this,RT.prototype),this.Message=G.Message}}class LT extends k0{name="InvalidQueryStringParameters";$fault="client";Message;constructor(G){super({name:"InvalidQueryStringParameters",$fault:"client",...G});Object.setPrototypeOf(this,LT.prototype),this.Message=G.Message}}class TT extends k0{name="InvalidRelativePath";$fault="client";Message;constructor(G){super({name:"InvalidRelativePath",$fault:"client",...G});Object.setPrototypeOf(this,TT.prototype),this.Message=G.Message}}class IT extends k0{name="InvalidRequiredProtocol";$fault="client";Message;constructor(G){super({name:"InvalidRequiredProtocol",$fault:"client",...G});Object.setPrototypeOf(this,IT.prototype),this.Message=G.Message}}class ET extends k0{name="InvalidResponseCode";$fault="client";Message;constructor(G){super({name:"InvalidResponseCode",$fault:"client",...G});Object.setPrototypeOf(this,ET.prototype),this.Message=G.Message}}class jT extends k0{name="InvalidTTLOrder";$fault="client";Message;constructor(G){super({name:"InvalidTTLOrder",$fault:"client",...G});Object.setPrototypeOf(this,jT.prototype),this.Message=G.Message}}class OT extends k0{name="InvalidViewerCertificate";$fault="client";Message;constructor(G){super({name:"InvalidViewerCertificate",$fault:"client",...G});Object.setPrototypeOf(this,OT.prototype),this.Message=G.Message}}class _T extends k0{name="InvalidWebACLId";$fault="client";Message;constructor(G){super({name:"InvalidWebACLId",$fault:"client",...G});Object.setPrototypeOf(this,_T.prototype),this.Message=G.Message}}class fT extends k0{name="MissingBody";$fault="client";Message;constructor(G){super({name:"MissingBody",$fault:"client",...G});Object.setPrototypeOf(this,fT.prototype),this.Message=G.Message}}class PT extends k0{name="NoSuchCachePolicy";$fault="client";Message;constructor(G){super({name:"NoSuchCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,PT.prototype),this.Message=G.Message}}class CT extends k0{name="NoSuchFieldLevelEncryptionConfig";$fault="client";Message;constructor(G){super({name:"NoSuchFieldLevelEncryptionConfig",$fault:"client",...G});Object.setPrototypeOf(this,CT.prototype),this.Message=G.Message}}class BT extends k0{name="NoSuchOrigin";$fault="client";Message;constructor(G){super({name:"NoSuchOrigin",$fault:"client",...G});Object.setPrototypeOf(this,BT.prototype),this.Message=G.Message}}class wT extends k0{name="NoSuchOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,wT.prototype),this.Message=G.Message}}class DT extends k0{name="NoSuchRealtimeLogConfig";$fault="client";Message;constructor(G){super({name:"NoSuchRealtimeLogConfig",$fault:"client",...G});Object.setPrototypeOf(this,DT.prototype),this.Message=G.Message}}class kT extends k0{name="NoSuchResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,kT.prototype),this.Message=G.Message}}class hT extends k0{name="PreconditionFailed";$fault="client";Message;constructor(G){super({name:"PreconditionFailed",$fault:"client",...G});Object.setPrototypeOf(this,hT.prototype),this.Message=G.Message}}class vT extends k0{name="RealtimeLogConfigOwnerMismatch";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigOwnerMismatch",$fault:"client",...G});Object.setPrototypeOf(this,vT.prototype),this.Message=G.Message}}class bT extends k0{name="TooManyCacheBehaviors";$fault="client";Message;constructor(G){super({name:"TooManyCacheBehaviors",$fault:"client",...G});Object.setPrototypeOf(this,bT.prototype),this.Message=G.Message}}class MT extends k0{name="TooManyCertificates";$fault="client";Message;constructor(G){super({name:"TooManyCertificates",$fault:"client",...G});Object.setPrototypeOf(this,MT.prototype),this.Message=G.Message}}class gT extends k0{name="TooManyCookieNamesInWhiteList";$fault="client";Message;constructor(G){super({name:"TooManyCookieNamesInWhiteList",$fault:"client",...G});Object.setPrototypeOf(this,gT.prototype),this.Message=G.Message}}class yT extends k0{name="TooManyDistributions";$fault="client";Message;constructor(G){super({name:"TooManyDistributions",$fault:"client",...G});Object.setPrototypeOf(this,yT.prototype),this.Message=G.Message}}class xT extends k0{name="TooManyDistributionsAssociatedToCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,xT.prototype),this.Message=G.Message}}class mT extends k0{name="TooManyDistributionsAssociatedToFieldLevelEncryptionConfig";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig",$fault:"client",...G});Object.setPrototypeOf(this,mT.prototype),this.Message=G.Message}}class cT extends k0{name="TooManyDistributionsAssociatedToKeyGroup";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToKeyGroup",$fault:"client",...G});Object.setPrototypeOf(this,cT.prototype),this.Message=G.Message}}class uT extends k0{name="TooManyDistributionsAssociatedToOriginAccessControl";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,uT.prototype),this.Message=G.Message}}class lT extends k0{name="TooManyDistributionsAssociatedToOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,lT.prototype),this.Message=G.Message}}class pT extends k0{name="TooManyDistributionsAssociatedToResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,pT.prototype),this.Message=G.Message}}class iT extends k0{name="TooManyDistributionsWithFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,iT.prototype),this.Message=G.Message}}class aT extends k0{name="TooManyDistributionsWithLambdaAssociations";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithLambdaAssociations",$fault:"client",...G});Object.setPrototypeOf(this,aT.prototype),this.Message=G.Message}}class rT extends k0{name="TooManyDistributionsWithSingleFunctionARN";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithSingleFunctionARN",$fault:"client",...G});Object.setPrototypeOf(this,rT.prototype),this.Message=G.Message}}class dT extends k0{name="TooManyFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,dT.prototype),this.Message=G.Message}}class sT extends k0{name="TooManyHeadersInForwardedValues";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInForwardedValues",$fault:"client",...G});Object.setPrototypeOf(this,sT.prototype),this.Message=G.Message}}class nT extends k0{name="TooManyKeyGroupsAssociatedToDistribution";$fault="client";Message;constructor(G){super({name:"TooManyKeyGroupsAssociatedToDistribution",$fault:"client",...G});Object.setPrototypeOf(this,nT.prototype),this.Message=G.Message}}class oT extends k0{name="TooManyLambdaFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyLambdaFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,oT.prototype),this.Message=G.Message}}class tT extends k0{name="TooManyOriginCustomHeaders";$fault="client";Message;constructor(G){super({name:"TooManyOriginCustomHeaders",$fault:"client",...G});Object.setPrototypeOf(this,tT.prototype),this.Message=G.Message}}class eT extends k0{name="TooManyOriginGroupsPerDistribution";$fault="client";Message;constructor(G){super({name:"TooManyOriginGroupsPerDistribution",$fault:"client",...G});Object.setPrototypeOf(this,eT.prototype),this.Message=G.Message}}class GI extends k0{name="TooManyOrigins";$fault="client";Message;constructor(G){super({name:"TooManyOrigins",$fault:"client",...G});Object.setPrototypeOf(this,GI.prototype),this.Message=G.Message}}class YI extends k0{name="TooManyQueryStringParameters";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringParameters",$fault:"client",...G});Object.setPrototypeOf(this,YI.prototype),this.Message=G.Message}}class XI extends k0{name="TooManyTrustedSigners";$fault="client";Message;constructor(G){super({name:"TooManyTrustedSigners",$fault:"client",...G});Object.setPrototypeOf(this,XI.prototype),this.Message=G.Message}}class WI extends k0{name="TrustedKeyGroupDoesNotExist";$fault="client";Message;constructor(G){super({name:"TrustedKeyGroupDoesNotExist",$fault:"client",...G});Object.setPrototypeOf(this,WI.prototype),this.Message=G.Message}}class ZI extends k0{name="TrustedSignerDoesNotExist";$fault="client";Message;constructor(G){super({name:"TrustedSignerDoesNotExist",$fault:"client",...G});Object.setPrototypeOf(this,ZI.prototype),this.Message=G.Message}}class JI extends k0{name="EntityAlreadyExists";$fault="client";Message;constructor(G){super({name:"EntityAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,JI.prototype),this.Message=G.Message}}class $I extends k0{name="EntityLimitExceeded";$fault="client";Message;constructor(G){super({name:"EntityLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,$I.prototype),this.Message=G.Message}}class UI extends k0{name="InvalidTagging";$fault="client";Message;constructor(G){super({name:"InvalidTagging",$fault:"client",...G});Object.setPrototypeOf(this,UI.prototype),this.Message=G.Message}}class zI extends k0{name="UnsupportedOperation";$fault="client";Message;constructor(G){super({name:"UnsupportedOperation",$fault:"client",...G});Object.setPrototypeOf(this,zI.prototype),this.Message=G.Message}}class KI extends k0{name="TooManyCachePolicies";$fault="client";Message;constructor(G){super({name:"TooManyCachePolicies",$fault:"client",...G});Object.setPrototypeOf(this,KI.prototype),this.Message=G.Message}}class HI extends k0{name="TooManyCookiesInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyCookiesInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,HI.prototype),this.Message=G.Message}}class VI extends k0{name="TooManyHeadersInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,VI.prototype),this.Message=G.Message}}class QI extends k0{name="TooManyQueryStringsInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringsInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,QI.prototype),this.Message=G.Message}}class FI extends k0{name="CloudFrontOriginAccessIdentityAlreadyExists";$fault="client";Message;constructor(G){super({name:"CloudFrontOriginAccessIdentityAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,FI.prototype),this.Message=G.Message}}class qI extends k0{name="TooManyCloudFrontOriginAccessIdentities";$fault="client";Message;constructor(G){super({name:"TooManyCloudFrontOriginAccessIdentities",$fault:"client",...G});Object.setPrototypeOf(this,qI.prototype),this.Message=G.Message}}class AI extends k0{name="ContinuousDeploymentPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"ContinuousDeploymentPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,AI.prototype),this.Message=G.Message}}class SI extends k0{name="StagingDistributionInUse";$fault="client";Message;constructor(G){super({name:"StagingDistributionInUse",$fault:"client",...G});Object.setPrototypeOf(this,SI.prototype),this.Message=G.Message}}class NI extends k0{name="TooManyContinuousDeploymentPolicies";$fault="client";Message;constructor(G){super({name:"TooManyContinuousDeploymentPolicies",$fault:"client",...G});Object.setPrototypeOf(this,NI.prototype),this.Message=G.Message}}class RI extends k0{name="ContinuousDeploymentPolicyInUse";$fault="client";Message;constructor(G){super({name:"ContinuousDeploymentPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,RI.prototype),this.Message=G.Message}}class LI extends k0{name="EntityNotFound";$fault="client";Message;constructor(G){super({name:"EntityNotFound",$fault:"client",...G});Object.setPrototypeOf(this,LI.prototype),this.Message=G.Message}}class TI extends k0{name="IllegalOriginAccessConfiguration";$fault="client";Message;constructor(G){super({name:"IllegalOriginAccessConfiguration",$fault:"client",...G});Object.setPrototypeOf(this,TI.prototype),this.Message=G.Message}}class II extends k0{name="InvalidDomainNameForOriginAccessControl";$fault="client";Message;constructor(G){super({name:"InvalidDomainNameForOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,II.prototype),this.Message=G.Message}}class EI extends k0{name="NoSuchContinuousDeploymentPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchContinuousDeploymentPolicy",$fault:"client",...G});Object.setPrototypeOf(this,EI.prototype),this.Message=G.Message}}class jI extends k0{name="FieldLevelEncryptionConfigAlreadyExists";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionConfigAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,jI.prototype),this.Message=G.Message}}class OI extends k0{name="NoSuchFieldLevelEncryptionProfile";$fault="client";Message;constructor(G){super({name:"NoSuchFieldLevelEncryptionProfile",$fault:"client",...G});Object.setPrototypeOf(this,OI.prototype),this.Message=G.Message}}class _I extends k0{name="QueryArgProfileEmpty";$fault="client";Message;constructor(G){super({name:"QueryArgProfileEmpty",$fault:"client",...G});Object.setPrototypeOf(this,_I.prototype),this.Message=G.Message}}class fI extends k0{name="TooManyFieldLevelEncryptionConfigs";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionConfigs",$fault:"client",...G});Object.setPrototypeOf(this,fI.prototype),this.Message=G.Message}}class PI extends k0{name="TooManyFieldLevelEncryptionContentTypeProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionContentTypeProfiles",$fault:"client",...G});Object.setPrototypeOf(this,PI.prototype),this.Message=G.Message}}class CI extends k0{name="TooManyFieldLevelEncryptionQueryArgProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionQueryArgProfiles",$fault:"client",...G});Object.setPrototypeOf(this,CI.prototype),this.Message=G.Message}}class BI extends k0{name="FieldLevelEncryptionProfileAlreadyExists";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,BI.prototype),this.Message=G.Message}}class wI extends k0{name="FieldLevelEncryptionProfileSizeExceeded";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileSizeExceeded",$fault:"client",...G});Object.setPrototypeOf(this,wI.prototype),this.Message=G.Message}}class DI extends k0{name="NoSuchPublicKey";$fault="client";Message;constructor(G){super({name:"NoSuchPublicKey",$fault:"client",...G});Object.setPrototypeOf(this,DI.prototype),this.Message=G.Message}}class kI extends k0{name="TooManyFieldLevelEncryptionEncryptionEntities";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionEncryptionEntities",$fault:"client",...G});Object.setPrototypeOf(this,kI.prototype),this.Message=G.Message}}class hI extends k0{name="TooManyFieldLevelEncryptionFieldPatterns";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionFieldPatterns",$fault:"client",...G});Object.setPrototypeOf(this,hI.prototype),this.Message=G.Message}}class vI extends k0{name="TooManyFieldLevelEncryptionProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionProfiles",$fault:"client",...G});Object.setPrototypeOf(this,vI.prototype),this.Message=G.Message}}class bI extends k0{name="FunctionAlreadyExists";$fault="client";Message;constructor(G){super({name:"FunctionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,bI.prototype),this.Message=G.Message}}class MI extends k0{name="FunctionSizeLimitExceeded";$fault="client";Message;constructor(G){super({name:"FunctionSizeLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,MI.prototype),this.Message=G.Message}}class gI extends k0{name="TooManyFunctions";$fault="client";Message;constructor(G){super({name:"TooManyFunctions",$fault:"client",...G});Object.setPrototypeOf(this,gI.prototype),this.Message=G.Message}}class yI extends k0{name="TooManyInvalidationsInProgress";$fault="client";Message;constructor(G){super({name:"TooManyInvalidationsInProgress",$fault:"client",...G});Object.setPrototypeOf(this,yI.prototype),this.Message=G.Message}}class xI extends k0{name="KeyGroupAlreadyExists";$fault="client";Message;constructor(G){super({name:"KeyGroupAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,xI.prototype),this.Message=G.Message}}class mI extends k0{name="TooManyKeyGroups";$fault="client";Message;constructor(G){super({name:"TooManyKeyGroups",$fault:"client",...G});Object.setPrototypeOf(this,mI.prototype),this.Message=G.Message}}class cI extends k0{name="TooManyPublicKeysInKeyGroup";$fault="client";Message;constructor(G){super({name:"TooManyPublicKeysInKeyGroup",$fault:"client",...G});Object.setPrototypeOf(this,cI.prototype),this.Message=G.Message}}class uI extends k0{name="EntitySizeLimitExceeded";$fault="client";Message;constructor(G){super({name:"EntitySizeLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,uI.prototype),this.Message=G.Message}}class lI extends k0{name="MonitoringSubscriptionAlreadyExists";$fault="client";Message;constructor(G){super({name:"MonitoringSubscriptionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,lI.prototype),this.Message=G.Message}}class pI extends k0{name="OriginAccessControlAlreadyExists";$fault="client";Message;constructor(G){super({name:"OriginAccessControlAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,pI.prototype),this.Message=G.Message}}class iI extends k0{name="TooManyOriginAccessControls";$fault="client";Message;constructor(G){super({name:"TooManyOriginAccessControls",$fault:"client",...G});Object.setPrototypeOf(this,iI.prototype),this.Message=G.Message}}class aI extends k0{name="OriginRequestPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"OriginRequestPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,aI.prototype),this.Message=G.Message}}class rI extends k0{name="TooManyCookiesInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyCookiesInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,rI.prototype),this.Message=G.Message}}class dI extends k0{name="TooManyHeadersInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,dI.prototype),this.Message=G.Message}}class sI extends k0{name="TooManyOriginRequestPolicies";$fault="client";Message;constructor(G){super({name:"TooManyOriginRequestPolicies",$fault:"client",...G});Object.setPrototypeOf(this,sI.prototype),this.Message=G.Message}}class nI extends k0{name="TooManyQueryStringsInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringsInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,nI.prototype),this.Message=G.Message}}class oI extends k0{name="PublicKeyAlreadyExists";$fault="client";Message;constructor(G){super({name:"PublicKeyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,oI.prototype),this.Message=G.Message}}class tI extends k0{name="TooManyPublicKeys";$fault="client";Message;constructor(G){super({name:"TooManyPublicKeys",$fault:"client",...G});Object.setPrototypeOf(this,tI.prototype),this.Message=G.Message}}class eI extends k0{name="RealtimeLogConfigAlreadyExists";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,eI.prototype),this.Message=G.Message}}class GE extends k0{name="TooManyRealtimeLogConfigs";$fault="client";Message;constructor(G){super({name:"TooManyRealtimeLogConfigs",$fault:"client",...G});Object.setPrototypeOf(this,GE.prototype),this.Message=G.Message}}class YE extends k0{name="ResponseHeadersPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"ResponseHeadersPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,YE.prototype),this.Message=G.Message}}class XE extends k0{name="TooLongCSPInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooLongCSPInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,XE.prototype),this.Message=G.Message}}class WE extends k0{name="TooManyCustomHeadersInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyCustomHeadersInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,WE.prototype),this.Message=G.Message}}class ZE extends k0{name="TooManyRemoveHeadersInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyRemoveHeadersInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,ZE.prototype),this.Message=G.Message}}class JE extends k0{name="TooManyResponseHeadersPolicies";$fault="client";Message;constructor(G){super({name:"TooManyResponseHeadersPolicies",$fault:"client",...G});Object.setPrototypeOf(this,JE.prototype),this.Message=G.Message}}class $E extends k0{name="StreamingDistributionAlreadyExists";$fault="client";Message;constructor(G){super({name:"StreamingDistributionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,$E.prototype),this.Message=G.Message}}class UE extends k0{name="TooManyStreamingDistributionCNAMEs";$fault="client";Message;constructor(G){super({name:"TooManyStreamingDistributionCNAMEs",$fault:"client",...G});Object.setPrototypeOf(this,UE.prototype),this.Message=G.Message}}class zE extends k0{name="TooManyStreamingDistributions";$fault="client";Message;constructor(G){super({name:"TooManyStreamingDistributions",$fault:"client",...G});Object.setPrototypeOf(this,zE.prototype),this.Message=G.Message}}class KE extends k0{name="IllegalDelete";$fault="client";Message;constructor(G){super({name:"IllegalDelete",$fault:"client",...G});Object.setPrototypeOf(this,KE.prototype),this.Message=G.Message}}class HE extends k0{name="CloudFrontOriginAccessIdentityInUse";$fault="client";Message;constructor(G){super({name:"CloudFrontOriginAccessIdentityInUse",$fault:"client",...G});Object.setPrototypeOf(this,HE.prototype),this.Message=G.Message}}class VE extends k0{name="NoSuchCloudFrontOriginAccessIdentity";$fault="client";Message;constructor(G){super({name:"NoSuchCloudFrontOriginAccessIdentity",$fault:"client",...G});Object.setPrototypeOf(this,VE.prototype),this.Message=G.Message}}class QE extends k0{name="DistributionNotDisabled";$fault="client";Message;constructor(G){super({name:"DistributionNotDisabled",$fault:"client",...G});Object.setPrototypeOf(this,QE.prototype),this.Message=G.Message}}class FE extends k0{name="FieldLevelEncryptionConfigInUse";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionConfigInUse",$fault:"client",...G});Object.setPrototypeOf(this,FE.prototype),this.Message=G.Message}}class qE extends k0{name="FieldLevelEncryptionProfileInUse";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileInUse",$fault:"client",...G});Object.setPrototypeOf(this,qE.prototype),this.Message=G.Message}}class AE extends k0{name="FunctionInUse";$fault="client";Message;constructor(G){super({name:"FunctionInUse",$fault:"client",...G});Object.setPrototypeOf(this,AE.prototype),this.Message=G.Message}}class SE extends k0{name="NoSuchFunctionExists";$fault="client";Message;constructor(G){super({name:"NoSuchFunctionExists",$fault:"client",...G});Object.setPrototypeOf(this,SE.prototype),this.Message=G.Message}}class NE extends k0{name="NoSuchResource";$fault="client";Message;constructor(G){super({name:"NoSuchResource",$fault:"client",...G});Object.setPrototypeOf(this,NE.prototype),this.Message=G.Message}}class RE extends k0{name="ResourceInUse";$fault="client";Message;constructor(G){super({name:"ResourceInUse",$fault:"client",...G});Object.setPrototypeOf(this,RE.prototype),this.Message=G.Message}}class LE extends k0{name="NoSuchMonitoringSubscription";$fault="client";Message;constructor(G){super({name:"NoSuchMonitoringSubscription",$fault:"client",...G});Object.setPrototypeOf(this,LE.prototype),this.Message=G.Message}}class TE extends k0{name="NoSuchOriginAccessControl";$fault="client";Message;constructor(G){super({name:"NoSuchOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,TE.prototype),this.Message=G.Message}}class IE extends k0{name="OriginAccessControlInUse";$fault="client";Message;constructor(G){super({name:"OriginAccessControlInUse",$fault:"client",...G});Object.setPrototypeOf(this,IE.prototype),this.Message=G.Message}}class EE extends k0{name="OriginRequestPolicyInUse";$fault="client";Message;constructor(G){super({name:"OriginRequestPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,EE.prototype),this.Message=G.Message}}class jE extends k0{name="PublicKeyInUse";$fault="client";Message;constructor(G){super({name:"PublicKeyInUse",$fault:"client",...G});Object.setPrototypeOf(this,jE.prototype),this.Message=G.Message}}class OE extends k0{name="RealtimeLogConfigInUse";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigInUse",$fault:"client",...G});Object.setPrototypeOf(this,OE.prototype),this.Message=G.Message}}class _E extends k0{name="ResponseHeadersPolicyInUse";$fault="client";Message;constructor(G){super({name:"ResponseHeadersPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,_E.prototype),this.Message=G.Message}}class fE extends k0{name="NoSuchStreamingDistribution";$fault="client";Message;constructor(G){super({name:"NoSuchStreamingDistribution",$fault:"client",...G});Object.setPrototypeOf(this,fE.prototype),this.Message=G.Message}}class PE extends k0{name="StreamingDistributionNotDisabled";$fault="client";Message;constructor(G){super({name:"StreamingDistributionNotDisabled",$fault:"client",...G});Object.setPrototypeOf(this,PE.prototype),this.Message=G.Message}}class CE extends k0{name="NoSuchInvalidation";$fault="client";Message;constructor(G){super({name:"NoSuchInvalidation",$fault:"client",...G});Object.setPrototypeOf(this,CE.prototype),this.Message=G.Message}}class BE extends k0{name="TestFunctionFailed";$fault="server";Message;constructor(G){super({name:"TestFunctionFailed",$fault:"server",...G});Object.setPrototypeOf(this,BE.prototype),this.Message=G.Message}}var uo=async(G,Y)=>{let X=co.requestBuilder(G,Y),W={"content-type":"application/xml"};X.bp("/2020-05-31/distribution/{DistributionId}/invalidation"),X.p("DistributionId",()=>G.DistributionId,"{DistributionId}",!1);let Z,U;if(G.InvalidationBatch!==void 0)U=py1(G.InvalidationBatch,Y),Z=Gx1,U.a("xmlns","http://cloudfront.amazonaws.com/doc/2020-05-31/"),Z+=U.toString();return X.m("POST").h(W).b(Z),X.build()};var lo=async(G,Y)=>{if(G.statusCode!==201&&G.statusCode>=300)return GM1(G,Y);let X=b0({$metadata:g0(G),[oy1]:[,G.headers[ey1]]}),W=go(await sz.parseXmlBody(G.body,Y));return X.Invalidation=ry1(W,Y),X};var GM1=async(G,Y)=>{let X={...G,body:await sz.parseXmlErrorBody(G.body,Y)},W=sz.loadRestXmlErrorCode(G,X.body);switch(W){case"AccessDenied":case"com.amazonaws.cloudfront#AccessDenied":throw await XM1(X,Y);case"IllegalUpdate":case"com.amazonaws.cloudfront#IllegalUpdate":throw await DM1(X,Y);case"InvalidArgument":case"com.amazonaws.cloudfront#InvalidArgument":throw await hM1(X,Y);case"NoSuchDistribution":case"com.amazonaws.cloudfront#NoSuchDistribution":throw await Vg1(X,Y);case"TooManyDistributionCNAMEs":case"com.amazonaws.cloudfront#TooManyDistributionCNAMEs":throw await eg1(X,Y);case"CNAMEAlreadyExists":case"com.amazonaws.cloudfront#CNAMEAlreadyExists":throw await VM1(X,Y);case"DistributionAlreadyExists":case"com.amazonaws.cloudfront#DistributionAlreadyExists":throw await qM1(X,Y);case"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior":case"com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior":throw await BM1(X,Y);case"InconsistentQuantities":case"com.amazonaws.cloudfront#InconsistentQuantities":throw await kM1(X,Y);case"InvalidDefaultRootObject":case"com.amazonaws.cloudfront#InvalidDefaultRootObject":throw await vM1(X,Y);case"InvalidErrorCode":case"com.amazonaws.cloudfront#InvalidErrorCode":throw await MM1(X,Y);case"InvalidForwardCookies":case"com.amazonaws.cloudfront#InvalidForwardCookies":throw await gM1(X,Y);case"InvalidFunctionAssociation":case"com.amazonaws.cloudfront#InvalidFunctionAssociation":throw await yM1(X,Y);case"InvalidGeoRestrictionParameter":case"com.amazonaws.cloudfront#InvalidGeoRestrictionParameter":throw await xM1(X,Y);case"InvalidHeadersForS3Origin":case"com.amazonaws.cloudfront#InvalidHeadersForS3Origin":throw await mM1(X,Y);case"InvalidIfMatchVersion":case"com.amazonaws.cloudfront#InvalidIfMatchVersion":throw await cM1(X,Y);case"InvalidLambdaFunctionAssociation":case"com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation":throw await uM1(X,Y);case"InvalidLocationCode":case"com.amazonaws.cloudfront#InvalidLocationCode":throw await lM1(X,Y);case"InvalidMinimumProtocolVersion":case"com.amazonaws.cloudfront#InvalidMinimumProtocolVersion":throw await pM1(X,Y);case"InvalidOrigin":case"com.amazonaws.cloudfront#InvalidOrigin":throw await iM1(X,Y);case"InvalidOriginAccessControl":case"com.amazonaws.cloudfront#InvalidOriginAccessControl":throw await aM1(X,Y);case"InvalidOriginAccessIdentity":case"com.amazonaws.cloudfront#InvalidOriginAccessIdentity":throw await rM1(X,Y);case"InvalidOriginKeepaliveTimeout":case"com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout":throw await dM1(X,Y);case"InvalidOriginReadTimeout":case"com.amazonaws.cloudfront#InvalidOriginReadTimeout":throw await sM1(X,Y);case"InvalidProtocolSettings":case"com.amazonaws.cloudfront#InvalidProtocolSettings":throw await nM1(X,Y);case"InvalidQueryStringParameters":case"com.amazonaws.cloudfront#InvalidQueryStringParameters":throw await oM1(X,Y);case"InvalidRelativePath":case"com.amazonaws.cloudfront#InvalidRelativePath":throw await tM1(X,Y);case"InvalidRequiredProtocol":case"com.amazonaws.cloudfront#InvalidRequiredProtocol":throw await eM1(X,Y);case"InvalidResponseCode":case"com.amazonaws.cloudfront#InvalidResponseCode":throw await Gg1(X,Y);case"InvalidTTLOrder":case"com.amazonaws.cloudfront#InvalidTTLOrder":throw await Xg1(X,Y);case"InvalidViewerCertificate":case"com.amazonaws.cloudfront#InvalidViewerCertificate":throw await Wg1(X,Y);case"InvalidWebACLId":case"com.amazonaws.cloudfront#InvalidWebACLId":throw await Zg1(X,Y);case"MissingBody":case"com.amazonaws.cloudfront#MissingBody":throw await $g1(X,Y);case"NoSuchCachePolicy":case"com.amazonaws.cloudfront#NoSuchCachePolicy":throw await zg1(X,Y);case"NoSuchFieldLevelEncryptionConfig":case"com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig":throw await Qg1(X,Y);case"NoSuchOrigin":case"com.amazonaws.cloudfront#NoSuchOrigin":throw await Ng1(X,Y);case"NoSuchOriginRequestPolicy":case"com.amazonaws.cloudfront#NoSuchOriginRequestPolicy":throw await Lg1(X,Y);case"NoSuchRealtimeLogConfig":case"com.amazonaws.cloudfront#NoSuchRealtimeLogConfig":throw await Ig1(X,Y);case"NoSuchResponseHeadersPolicy":case"com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy":throw await jg1(X,Y);case"PreconditionFailed":case"com.amazonaws.cloudfront#PreconditionFailed":throw await Bg1(X,Y);case"RealtimeLogConfigOwnerMismatch":case"com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch":throw await bg1(X,Y);case"TooManyCacheBehaviors":case"com.amazonaws.cloudfront#TooManyCacheBehaviors":throw await pg1(X,Y);case"TooManyCertificates":case"com.amazonaws.cloudfront#TooManyCertificates":throw await ag1(X,Y);case"TooManyCookieNamesInWhiteList":case"com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList":throw await sg1(X,Y);case"TooManyDistributions":case"com.amazonaws.cloudfront#TooManyDistributions":throw await Gy1(X,Y);case"TooManyDistributionsAssociatedToCachePolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy":throw await Yy1(X,Y);case"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig":throw await Xy1(X,Y);case"TooManyDistributionsAssociatedToKeyGroup":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup":throw await Wy1(X,Y);case"TooManyDistributionsAssociatedToOriginAccessControl":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl":throw await Zy1(X,Y);case"TooManyDistributionsAssociatedToOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy":throw await Jy1(X,Y);case"TooManyDistributionsAssociatedToResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy":throw await $y1(X,Y);case"TooManyDistributionsWithFunctionAssociations":case"com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations":throw await Uy1(X,Y);case"TooManyDistributionsWithLambdaAssociations":case"com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations":throw await zy1(X,Y);case"TooManyDistributionsWithSingleFunctionARN":case"com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN":throw await Ky1(X,Y);case"TooManyFunctionAssociations":case"com.amazonaws.cloudfront#TooManyFunctionAssociations":throw await Sy1(X,Y);case"TooManyHeadersInForwardedValues":case"com.amazonaws.cloudfront#TooManyHeadersInForwardedValues":throw await Ly1(X,Y);case"TooManyKeyGroupsAssociatedToDistribution":case"com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution":throw await jy1(X,Y);case"TooManyLambdaFunctionAssociations":case"com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations":throw await Oy1(X,Y);case"TooManyOriginCustomHeaders":case"com.amazonaws.cloudfront#TooManyOriginCustomHeaders":throw await fy1(X,Y);case"TooManyOriginGroupsPerDistribution":case"com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution":throw await Py1(X,Y);case"TooManyOrigins":case"com.amazonaws.cloudfront#TooManyOrigins":throw await By1(X,Y);case"TooManyQueryStringParameters":case"com.amazonaws.cloudfront#TooManyQueryStringParameters":throw await ky1(X,Y);case"TooManyTrustedSigners":case"com.amazonaws.cloudfront#TooManyTrustedSigners":throw await my1(X,Y);case"TrustedKeyGroupDoesNotExist":case"com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist":throw await cy1(X,Y);case"TrustedSignerDoesNotExist":case"com.amazonaws.cloudfront#TrustedSignerDoesNotExist":throw await uy1(X,Y);case"EntityAlreadyExists":case"com.amazonaws.cloudfront#EntityAlreadyExists":throw await SM1(X,Y);case"EntityLimitExceeded":case"com.amazonaws.cloudfront#EntityLimitExceeded":throw await NM1(X,Y);case"InvalidTagging":case"com.amazonaws.cloudfront#InvalidTagging":throw await Yg1(X,Y);case"UnsupportedOperation":case"com.amazonaws.cloudfront#UnsupportedOperation":throw await ly1(X,Y);case"CachePolicyAlreadyExists":case"com.amazonaws.cloudfront#CachePolicyAlreadyExists":throw await ZM1(X,Y);case"TooManyCachePolicies":case"com.amazonaws.cloudfront#TooManyCachePolicies":throw await ig1(X,Y);case"TooManyCookiesInCachePolicy":case"com.amazonaws.cloudfront#TooManyCookiesInCachePolicy":throw await ng1(X,Y);case"TooManyHeadersInCachePolicy":case"com.amazonaws.cloudfront#TooManyHeadersInCachePolicy":throw await Ry1(X,Y);case"TooManyQueryStringsInCachePolicy":case"com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy":throw await hy1(X,Y);case"CloudFrontOriginAccessIdentityAlreadyExists":case"com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityAlreadyExists":throw await KM1(X,Y);case"TooManyCloudFrontOriginAccessIdentities":case"com.amazonaws.cloudfront#TooManyCloudFrontOriginAccessIdentities":throw await rg1(X,Y);case"ContinuousDeploymentPolicyAlreadyExists":case"com.amazonaws.cloudfront#ContinuousDeploymentPolicyAlreadyExists":throw await QM1(X,Y);case"StagingDistributionInUse":case"com.amazonaws.cloudfront#StagingDistributionInUse":throw await xg1(X,Y);case"TooManyContinuousDeploymentPolicies":case"com.amazonaws.cloudfront#TooManyContinuousDeploymentPolicies":throw await dg1(X,Y);case"ContinuousDeploymentPolicyInUse":case"com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse":throw await FM1(X,Y);case"EntityNotFound":case"com.amazonaws.cloudfront#EntityNotFound":throw await RM1(X,Y);case"IllegalOriginAccessConfiguration":case"com.amazonaws.cloudfront#IllegalOriginAccessConfiguration":throw await wM1(X,Y);case"InvalidDomainNameForOriginAccessControl":case"com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl":throw await bM1(X,Y);case"NoSuchContinuousDeploymentPolicy":case"com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy":throw await Hg1(X,Y);case"FieldLevelEncryptionConfigAlreadyExists":case"com.amazonaws.cloudfront#FieldLevelEncryptionConfigAlreadyExists":throw await TM1(X,Y);case"NoSuchFieldLevelEncryptionProfile":case"com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile":throw await Fg1(X,Y);case"QueryArgProfileEmpty":case"com.amazonaws.cloudfront#QueryArgProfileEmpty":throw await kg1(X,Y);case"TooManyFieldLevelEncryptionConfigs":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionConfigs":throw await Hy1(X,Y);case"TooManyFieldLevelEncryptionContentTypeProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles":throw await Vy1(X,Y);case"TooManyFieldLevelEncryptionQueryArgProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles":throw await Ay1(X,Y);case"FieldLevelEncryptionProfileAlreadyExists":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists":throw await EM1(X,Y);case"FieldLevelEncryptionProfileSizeExceeded":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded":throw await OM1(X,Y);case"NoSuchPublicKey":case"com.amazonaws.cloudfront#NoSuchPublicKey":throw await Tg1(X,Y);case"TooManyFieldLevelEncryptionEncryptionEntities":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities":throw await Qy1(X,Y);case"TooManyFieldLevelEncryptionFieldPatterns":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns":throw await Fy1(X,Y);case"TooManyFieldLevelEncryptionProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionProfiles":throw await qy1(X,Y);case"FunctionAlreadyExists":case"com.amazonaws.cloudfront#FunctionAlreadyExists":throw await _M1(X,Y);case"FunctionSizeLimitExceeded":case"com.amazonaws.cloudfront#FunctionSizeLimitExceeded":throw await PM1(X,Y);case"TooManyFunctions":case"com.amazonaws.cloudfront#TooManyFunctions":throw await Ny1(X,Y);case"BatchTooLarge":case"com.amazonaws.cloudfront#BatchTooLarge":throw await WM1(X,Y);case"TooManyInvalidationsInProgress":case"com.amazonaws.cloudfront#TooManyInvalidationsInProgress":throw await Iy1(X,Y);case"KeyGroupAlreadyExists":case"com.amazonaws.cloudfront#KeyGroupAlreadyExists":throw await Jg1(X,Y);case"TooManyKeyGroups":case"com.amazonaws.cloudfront#TooManyKeyGroups":throw await Ey1(X,Y);case"TooManyPublicKeysInKeyGroup":case"com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup":throw await Dy1(X,Y);case"EntitySizeLimitExceeded":case"com.amazonaws.cloudfront#EntitySizeLimitExceeded":throw await LM1(X,Y);case"MonitoringSubscriptionAlreadyExists":case"com.amazonaws.cloudfront#MonitoringSubscriptionAlreadyExists":throw await Ug1(X,Y);case"OriginAccessControlAlreadyExists":case"com.amazonaws.cloudfront#OriginAccessControlAlreadyExists":throw await _g1(X,Y);case"TooManyOriginAccessControls":case"com.amazonaws.cloudfront#TooManyOriginAccessControls":throw await _y1(X,Y);case"OriginRequestPolicyAlreadyExists":case"com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists":throw await Pg1(X,Y);case"TooManyCookiesInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy":throw await og1(X,Y);case"TooManyHeadersInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy":throw await Ty1(X,Y);case"TooManyOriginRequestPolicies":case"com.amazonaws.cloudfront#TooManyOriginRequestPolicies":throw await Cy1(X,Y);case"TooManyQueryStringsInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy":throw await vy1(X,Y);case"PublicKeyAlreadyExists":case"com.amazonaws.cloudfront#PublicKeyAlreadyExists":throw await wg1(X,Y);case"TooManyPublicKeys":case"com.amazonaws.cloudfront#TooManyPublicKeys":throw await wy1(X,Y);case"RealtimeLogConfigAlreadyExists":case"com.amazonaws.cloudfront#RealtimeLogConfigAlreadyExists":throw await hg1(X,Y);case"TooManyRealtimeLogConfigs":case"com.amazonaws.cloudfront#TooManyRealtimeLogConfigs":throw await by1(X,Y);case"ResponseHeadersPolicyAlreadyExists":case"com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists":throw await gg1(X,Y);case"TooLongCSPInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooLongCSPInResponseHeadersPolicy":throw await lg1(X,Y);case"TooManyCustomHeadersInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyCustomHeadersInResponseHeadersPolicy":throw await tg1(X,Y);case"TooManyRemoveHeadersInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyRemoveHeadersInResponseHeadersPolicy":throw await My1(X,Y);case"TooManyResponseHeadersPolicies":case"com.amazonaws.cloudfront#TooManyResponseHeadersPolicies":throw await gy1(X,Y);case"StreamingDistributionAlreadyExists":case"com.amazonaws.cloudfront#StreamingDistributionAlreadyExists":throw await mg1(X,Y);case"TooManyStreamingDistributionCNAMEs":case"com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs":throw await yy1(X,Y);case"TooManyStreamingDistributions":case"com.amazonaws.cloudfront#TooManyStreamingDistributions":throw await xy1(X,Y);case"CannotDeleteEntityWhileInUse":case"com.amazonaws.cloudfront#CannotDeleteEntityWhileInUse":throw await UM1(X,Y);case"IllegalDelete":case"com.amazonaws.cloudfront#IllegalDelete":throw await CM1(X,Y);case"CachePolicyInUse":case"com.amazonaws.cloudfront#CachePolicyInUse":throw await JM1(X,Y);case"CloudFrontOriginAccessIdentityInUse":case"com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityInUse":throw await HM1(X,Y);case"NoSuchCloudFrontOriginAccessIdentity":case"com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity":throw await Kg1(X,Y);case"DistributionNotDisabled":case"com.amazonaws.cloudfront#DistributionNotDisabled":throw await AM1(X,Y);case"FieldLevelEncryptionConfigInUse":case"com.amazonaws.cloudfront#FieldLevelEncryptionConfigInUse":throw await IM1(X,Y);case"FieldLevelEncryptionProfileInUse":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileInUse":throw await jM1(X,Y);case"FunctionInUse":case"com.amazonaws.cloudfront#FunctionInUse":throw await fM1(X,Y);case"NoSuchFunctionExists":case"com.amazonaws.cloudfront#NoSuchFunctionExists":throw await qg1(X,Y);case"NoSuchResource":case"com.amazonaws.cloudfront#NoSuchResource":throw await Eg1(X,Y);case"ResourceInUse":case"com.amazonaws.cloudfront#ResourceInUse":throw await Mg1(X,Y);case"NoSuchMonitoringSubscription":case"com.amazonaws.cloudfront#NoSuchMonitoringSubscription":throw await Sg1(X,Y);case"NoSuchOriginAccessControl":case"com.amazonaws.cloudfront#NoSuchOriginAccessControl":throw await Rg1(X,Y);case"OriginAccessControlInUse":case"com.amazonaws.cloudfront#OriginAccessControlInUse":throw await fg1(X,Y);case"OriginRequestPolicyInUse":case"com.amazonaws.cloudfront#OriginRequestPolicyInUse":throw await Cg1(X,Y);case"PublicKeyInUse":case"com.amazonaws.cloudfront#PublicKeyInUse":throw await Dg1(X,Y);case"RealtimeLogConfigInUse":case"com.amazonaws.cloudfront#RealtimeLogConfigInUse":throw await vg1(X,Y);case"ResponseHeadersPolicyInUse":case"com.amazonaws.cloudfront#ResponseHeadersPolicyInUse":throw await yg1(X,Y);case"NoSuchStreamingDistribution":case"com.amazonaws.cloudfront#NoSuchStreamingDistribution":throw await Og1(X,Y);case"StreamingDistributionNotDisabled":case"com.amazonaws.cloudfront#StreamingDistributionNotDisabled":throw await cg1(X,Y);case"NoSuchInvalidation":case"com.amazonaws.cloudfront#NoSuchInvalidation":throw await Ag1(X,Y);case"TestFunctionFailed":case"com.amazonaws.cloudfront#TestFunctionFailed":throw await ug1(X,Y);case"CannotChangeImmutablePublicKeyFields":case"com.amazonaws.cloudfront#CannotChangeImmutablePublicKeyFields":throw await $M1(X,Y);case"CannotUpdateEntityWhileInUse":case"com.amazonaws.cloudfront#CannotUpdateEntityWhileInUse":throw await zM1(X,Y);default:let Z=X.body;return YM1({output:G,parsedBody:Z.Error,errorCode:W})}},YM1=DE(k0),XM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},WM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ZM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},JM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$M1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},UM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},KM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},HM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},VM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},QM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},FM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},AM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},SM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},NM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $I({$metadata:g0(G),...X});return L0(Z,G.body.Error)},RM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},LM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},TM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},IM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},EM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},OM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new wI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_M1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new bI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},PM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new MI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},CM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},BM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},DM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},kM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},bM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new II({$metadata:g0(G),...X});return L0(Z,G.body.Error)},MM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $T({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},mM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},uM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},lM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},pM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},iM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},aM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},rM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},dM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ST({$metadata:g0(G),...X});return L0(Z,G.body.Error)},sM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},nM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},oM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},tM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},eM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new IT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Gg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ET({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Yg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Xg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Wg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Zg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _T({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Jg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new xI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$g1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ug1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Kg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Hg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new EI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Vg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Qg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Fg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new SE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ag1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Sg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ng1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Rg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Lg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new wT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Tg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new DI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ig1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new DT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Eg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new kT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Og1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_g1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new IE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Pg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Cg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new EE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Bg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new hT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Dg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},kg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _I({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},bg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new vT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Mg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _E({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new SI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},mg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $E({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ug1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},lg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},pg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new bT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ig1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ag1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new MT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},rg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},dg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},sg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new gT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ng1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},og1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},tg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},eg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Gy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new yT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Yy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new xT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Xy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new mT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Wy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new cT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Zy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Jy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$y1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Uy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ky1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Hy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Vy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Qy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new kI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Fy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new hI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new vI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ay1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Sy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ny1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new gI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ry1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ly1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ty1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Iy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new yI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ey1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new mI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Oy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_y1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Py1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Cy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},By1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Dy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new cI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ky1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},by1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},My1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},my1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},uy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ly1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zI({$metadata:g0(G),...X});return L0(Z,G.body.Error)};var py1=(G,Y)=>{let X=new TY(wE);if(G[$$]!=null)X.c(ay1(G[$$],Y).n($$));if(G[rz]!=null)X.c(TY.of(po,G[rz]).n(rz));return X};var iy1=(G,Y)=>{return G.filter((X)=>X!=null).map((X)=>{return TY.of(po,X).n(Dk)})},ay1=(G,Y)=>{let X=new TY($$);if(G[dz]!=null)X.c(TY.of(ty1,String(G[dz])).n(dz));return X.lc(G,"Items","Items",()=>iy1(G[az],Y)),X};var ry1=(G,Y)=>{let X={};if(G[Bk]!=null)X[Bk]=P0(G[Bk]);if(G[wk]!=null)X[wk]=P0(G[wk]);if(G[Ck]!=null)X[Ck]=kk(xo(G[Ck]));if(G[wE]!=null)X[wE]=dy1(G[wE],Y);return X},dy1=(G,Y)=>{let X={};if(G[$$]!=null)X[$$]=ny1(G[$$],Y);if(G[rz]!=null)X[rz]=P0(G[rz]);return X};var sy1=(G,Y)=>{return(G||[]).filter((X)=>X!=null).map((X)=>{return P0(X)})},ny1=(G,Y)=>{let X={};if(G[dz]!=null)X[dz]=yo(G[dz]);if(G.Items==="")X[az]=[];else if(G[az]!=null&&G[az][Dk]!=null)X[az]=sy1(mo(G[az][Dk]),Y);return X};var g0=(G)=>({httpStatusCode:G.statusCode,requestId:G.headers["x-amzn-requestid"]??G.headers["x-amzn-request-id"]??G.headers["x-amz-request-id"],extendedRequestId:G.headers["x-amz-id-2"],cfId:G.headers["x-amz-cf-id"]});var rz="CallerReference";var Ck="CreateTime";var az="Items";var wE="InvalidationBatch";var Bk="Id";var oy1="Location";var R1="Message";var $$="Paths";var Dk="Path";var dz="Quantity";var wk="Status";var ty1="integer";var ey1="location";var po="string",Gx1='<?xml version="1.0" encoding="UTF-8"?>';class hk extends D7.classBuilder().ep(Zo).m(function(G,Y,X,W){return[B7(X,this.serialize,this.deserialize),w7(X,G.getEndpointParameterInstructions())]}).s("Cloudfront2020_05_31","CreateInvalidation",{}).n("CloudFrontClient","CreateInvalidationCommand").f(void 0,void 0).ser(uo).de(lo).build(){}import{intro as nz,italic as JF,log as d6,outro as C6,prompts as $F,runCommand as U$,underline as io}from"@stacksjs/cli";import{addJumpBox as Yx1,deleteCdkRemnants as Xx1,deleteIamUsers as Wx1,deleteJumpBox as vk,deleteLogGroups as Zx1,deleteParameterStore as Jx1,deleteStacksBuckets as $x1,deleteStacksFunctions as Ux1,deleteSubnets as zx1,deleteVpcs as Kx1,getCloudFrontDistributionId as Hx1,getJumpBoxInstanceId as Vx1}from"@stacksjs/cloud";import{path as z$}from"@stacksjs/path";import{ExitCode as K6}from"@stacksjs/types";import{loop as Qx1}from"@stacksjs/utils";function BZ4(G){let Y={cloud:"Interact with the Stacks Cloud",ssh:"SSH into the Stacks Cloud",add:"Add a resource to the Stacks Cloud",remove:"Remove the Stacks Cloud. In case it fails, try again",optimizeCost:"Remove certain resources that may be re-applied at a later time",cleanUp:"Remove all resources that were retained during the cloud deletion",invalidateCache:"Invalidate the CloudFront cache",diff:"Show the diff of the current, undeployed cloud changes ",paths:"The paths to invalidate",project:"Target a specific project",verbose:"Enable verbose output"};G.command("cloud",Y.cloud).option("--ssh",Y.ssh,{default:!1}).option("--connect",Y.ssh,{default:!1}).option("--invalidate-cache",Y.invalidateCache,{default:!1}).option("--paths [paths]",Y.paths).option("--diff",Y.diff,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud` ...",X);let W=performance.now();if(X.ssh||X.connect){let Z=await Vx1(),U=await U$(`aws ssm start-session --target ${Z}`,{...X,cwd:z$.projectPath(),stdin:"pipe"});if(U.isErr())await C6("While running the cloud command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}if(X.invalidateCache){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to invalidate the CDN (CloudFront) cache?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);d6.info("Invalidating the CloudFront cache...");let U=new fk,J={DistributionId:await Hx1(),InvalidationBatch:{CallerReference:`${Date.now()}`,Paths:{Quantity:1,Items:["/*"]}}},H=new hk(J);U.send(H).then(($)=>console.log($),($)=>console.log($,$.stack)),await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}if(X.diff){let Z=await U$("bunx --bun cdk diff",{cwd:z$.frameworkCloudPath(),stdin:"pipe"});if(Z.isErr())await C6("While running the cloud diff command, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await C6("Showing diff of the current, undeployed cloud changes",{startTime:W,useSeconds:!0}),console.log(Z.value),J6.exit(K6.Success)}d6.info("Not implemented yet. Read more about `buddy cloud` here: https://stacksjs.org/docs/cloud"),J6.exit(K6.Success)}),G.command("cloud:add",Y.add).option("--jump-box","Remove the jump-box",{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:add` ...",X);let W=await nz("buddy cloud:add");if(X.jumpBox){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to add a jump-box to your cloud?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);d6.info("The jump-box is getting added to your cloud resources..."),d6.info("This takes a few moments, please be patient."),await new Promise((K)=>setTimeout(K,2000));let U=await Yx1();if(U.isErr())await C6("While running the cloud:add command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);d6.info(JF("View the jump-box in the AWS console:")),d6.info(io("https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#Instances:instanceState=running")),d6.info(JF("Once it finished initializing, you may SSH into it:")),d6.info(io("buddy cloud --ssh")),await C6("Your jump-box was added.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}d6.info("This functionality is not yet implemented."),J6.exit(K6.Success)}),G.command("cloud:remove",Y.remove).alias("cloud:destroy").alias("cloud:rm").alias("undeploy").option("--jump-box","Remove the jump-box",{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:remove` ...",X);let W=await nz("buddy cloud:remove");if(X.jumpBox){let{confirm:U}=await $F({name:"confirm",type:"confirm",message:"Would you like to remove your jump-box for now?"});if(!U)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);let K=await vk();if(K.isErr())await C6("While removing your jump-box, there was an issue",{startTime:W,useSeconds:!0},K.error),J6.exit(K6.FatalError);await C6("Your jump-box was removed.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}console.log(` ${JF("\u2139\uFE0F Removing your cloud resources takes a while to complete.")}`),console.log(` ${JF("Please note, your backups will not yet be deleted. Though,")}`),console.log(` ${JF("Backups are scheduled to delete themselves in 30 days.")}`),await new Promise((U)=>setTimeout(U,2000));let Z=await U$("bunx --bun cdk destroy",{...X,cwd:z$.frameworkCloudPath(),stdin:"inherit"});if(Z.isErr())await C6('While running the cloud:remove ("undeploy") command, there was an issue',{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await U$("buddy cloud:cleanup",{...X,cwd:z$.projectPath(),stdin:"inherit"});try{d6.info("Finalizing the removal of your cloud resources."),d6.info("This will take a few moments..."),await Qx1(7,async()=>{await U$("buddy cloud:cleanup",{...X,cwd:z$.projectPath(),stdout:"ignore"})}),await C6("Your cloud has been removed",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}catch(U){await C6("While cleaning up the cloud, there was an issue",{startTime:W,useSeconds:!0},U),J6.exit(K6.FatalError)}}),G.command("cloud:optimize-cost",Y.optimizeCost).option("--jump-box","Remove the jump-box",{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:optimize-cost` ...",X);let W=await nz("buddy cloud:optimize-cost");if(X.jumpBox){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to remove your jump-box to optimize your costs?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);await vk(),await C6("Your jump-box was removed & cost optimizations are applied.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}await C6("No cost optimization was applied",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}),G.command("cloud:cleanup",Y.cleanUp).alias("cloud:clean-up").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:cleanup` ...",X);let W=await nz("buddy cloud:cleanup");d6.info("Cleaning up your cloud resources will take a while to complete. Please be patient."),await new Promise((V)=>setTimeout(V,2000)),d6.info("Removing any jump-boxes...");let Z=await vk();if(Z.isErr()){if(Z.error!=="Jump-box not found")await C6("While removing your jump-box, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError)}d6.info("Removing any retained S3 buckets...");let U=await $x1();if(U.isErr())await C6("While deleting the retained S3 buckets, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);d6.info("Removing any retained Lambda functions...");let K=await Ux1();if(K.isErr()){if(K.error!=="No stacks functions found")await C6("While deleting the Origin Request Lambda function, there was an issue",{startTime:W,useSeconds:!0},K.error);J6.exit(K6.FatalError)}d6.info(K.value),d6.info("Removing any remaining Stacks logs...");let J=await Zx1();if(J.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},J.error),J6.exit(K6.FatalError);d6.info("Removing any stored parameters...");let H=await Jx1();if(H.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},H.error),J6.exit(K6.FatalError);let $=await Kx1();if($.isErr())await C6("While deleting the VPCs, there was an issue",{startTime:W,useSeconds:!0},$.error),J6.exit(K6.FatalError);let Q=await zx1();if(Q.isErr())await C6("While deleting the Subnets, there was an issue",{startTime:W,useSeconds:!0},Q.error),J6.exit(K6.FatalError);d6.info("Removing any CDK remnants...");let F=await Xx1();if(F.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},F.error),J6.exit(K6.FatalError);d6.info("Removing any IAM users...");let z=await Wx1();if(z.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},z.error),J6.exit(K6.FatalError);await C6("AWS resources have been removed",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}),G.command("cloud:invalidate-cache",Y.invalidateCache).option("--paths [paths]",Y.paths,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:invalidate-cache` ...",X);let W=await nz("buddy cloud:invalidate-cache"),{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to invalidate the CloudFront cache?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);if(d6.info("Invalidating the CloudFront cache..."),X.paths){let U=await U$(`aws cloudfront create-invalidation --distribution-id E1U4Z2E9NJW9J --paths ${X.paths}`,{...X,cwd:z$.projectPath(),stdin:"pipe"});if(U.isErr())await C6("While running the cloud command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}d6.info("Not implemented yet. Read more about `buddy cloud` here: https://stacksjs.org/docs/cloud"),J6.exit(K6.Success)}),G.command("cloud:diff",Y.diff).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:diff` ...",X);let W=await nz("buddy cloud:diff"),Z=await U$("bunx --bun cdk diff",{cwd:z$.frameworkCloudPath(),stdin:"pipe"});if(Z.isErr())await C6("While running the cloud diff command, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await C6("Showing diff of the current, undeployed cloud changes",{startTime:W,useSeconds:!0}),console.log(Z.value),J6.exit(K6.Success)}),G.on("cloud:*",()=>{console.error(`Invalid command: %s
3218
+ `),Ko=!0}throw new YZ.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:G.logger,tryNextLink:!0})}return G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),Fo(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:Y,ssoAccountId:X,ssoRegion:W,ssoRoleName:Z,ssoSession:U}=G;if(!Y&&!X&&!W&&!Z&&!U)throw new YZ.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:G.logger});let{fromSSO:K}=await import("./chunk-8j6ps4r9.js");return K(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:Y}=await import("./chunk-ebq1d2xm.js");return Y(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:Y}=await import("./chunk-pzqkq1eg.js");return Y(G)()},async()=>{G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:Y}=await import("./chunk-0bm9jzfk.js");return Y(G)()},async()=>{return G.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await zo(G))()},async()=>{throw new YZ.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:G.logger})}),db1,rb1),rb1=(G)=>G?.expiration!==void 0,db1=(G)=>G?.expiration!==void 0&&G.expiration.getTime()-Date.now()<300000;var Co=L4(GZ(),1);var qo={["required"]:!1,type:"String"},Ao={["required"]:!0,default:!1,type:"Boolean"},So={["ref"]:"Endpoint"},Ok={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},_o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},W3={},No={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"name"]},"aws"]},sb1={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"name"]},Ro={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},jk={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Lo={authSchemes:[{name:"sigv4",signingName:"cloudfront",signingRegion:"us-east-1"}]},To={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Io={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},Eo=[Ok],jo=[_o],Oo=[{["ref"]:"Region"}],nb1={version:"1.0",parameters:{Region:qo,UseDualStack:Ao,UseFIPS:Ao,Endpoint:qo},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[So]}],rules:[{conditions:Eo,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:jo,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:So,properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Oo}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Oo,assign:"PartitionResult"}],rules:[{conditions:[No,Ro,jk],endpoint:{url:"https://cloudfront.amazonaws.com",properties:Lo,headers:W3},type:"endpoint"},{conditions:[No,Ok,jk],endpoint:{url:"https://cloudfront-fips.amazonaws.com",properties:Lo,headers:W3},type:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[sb1,"aws-cn"]},Ro,jk],endpoint:{url:"https://cloudfront.cn-northwest-1.amazonaws.com.cn",properties:{authSchemes:[{name:"sigv4",signingName:"cloudfront",signingRegion:"cn-northwest-1"}]},headers:W3},type:"endpoint"},{conditions:[Ok,_o],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,To]},Io],rules:[{endpoint:{url:"https://cloudfront-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Eo,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[To,!0]}],rules:[{endpoint:{url:"https://cloudfront-fips.{Region}.{PartitionResult#dnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:jo,rules:[{conditions:[Io],rules:[{endpoint:{url:"https://cloudfront.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://cloudfront.{Region}.{PartitionResult#dnsSuffix}",properties:W3,headers:W3},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},fo=nb1;var ob1=new oR({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Po=(G,Y={})=>{return ob1.get(G,()=>eR(fo,{endpointParams:G,logger:Y.logger}))};tR.aws=GL;var Bo=(G)=>{return{apiVersion:"2020-05-31",base64Decoder:G?.base64Decoder??JL,base64Encoder:G?.base64Encoder??$L,disableHostPrefix:G?.disableHostPrefix??!1,endpointProvider:G?.endpointProvider??Po,extensions:G?.extensions??[],httpAuthSchemeProvider:G?.httpAuthSchemeProvider??Yo,httpAuthSchemes:G?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(Y)=>Y.getIdentityProvider("aws.auth#sigv4"),signer:new Co.AwsSdkSigV4Signer}],logger:G?.logger??new XL,serviceId:G?.serviceId??"CloudFront",urlParser:G?.urlParser??YL,utf8Decoder:G?.utf8Decoder??WL,utf8Encoder:G?.utf8Encoder??ZL}};var Do=(G)=>{AL(process.version);let Y=EL(G),X=()=>Y().then(qL),W=Bo(G);wo.emitWarningIfUnsupportedVersion(process.version);let Z={profile:G?.profile};return{...W,...G,runtime:"node",defaultsMode:Y,bodyLengthChecker:G?.bodyLengthChecker??IL,credentialDefaultProvider:G?.credentialDefaultProvider??nR,defaultUserAgentProvider:G?.defaultUserAgentProvider??RL({serviceId:W.serviceId,clientVersion:Jo.version}),maxAttempts:G?.maxAttempts??h5(QL,G),region:G?.region??h5(KL,{...HL,...Z}),requestHandler:SL.create(G?.requestHandler??X),retryMode:G?.retryMode??h5({...FL,default:async()=>(await X()).retryMode||VL},G),sha256:G?.sha256??TL.bind(null,"sha256"),streamCollector:G?.streamCollector??NL,useDualstackEndpoint:G?.useDualstackEndpoint??h5(UL,Z),useFipsEndpoint:G?.useFipsEndpoint??h5(zL,Z),userAgentAppId:G?.userAgentAppId??h5(LL,Z)}};var ko=(G)=>{let{httpAuthSchemes:Y,httpAuthSchemeProvider:X,credentials:W}=G;return{setHttpAuthScheme(Z){let U=Y.findIndex((K)=>K.schemeId===Z.schemeId);if(U===-1)Y.push(Z);else Y.splice(U,1,Z)},httpAuthSchemes(){return Y},setHttpAuthSchemeProvider(Z){X=Z},httpAuthSchemeProvider(){return X},setCredentials(Z){W=Z},credentials(){return W}}},ho=(G)=>{return{httpAuthSchemes:G.httpAuthSchemes(),httpAuthSchemeProvider:G.httpAuthSchemeProvider(),credentials:G.credentials()}};var vo=(G,Y)=>{let X=Object.assign(PL(G),_L(G),jL(G),ko(G));return Y.forEach((W)=>W.configure(X)),Object.assign(G,CL(X),fL(X),OL(X),ho(X))};class fk extends xL{config;constructor(...[G]){let Y=Do(G||{});super(Y);this.initConfig=Y;let X=Wo(Y),W=hL(X),Z=yL(W),U=bL(Z),K=BL(U),J=gL(K),H=Xo(J),$=vo(H,G?.extensions||[]);this.config=$,this.middlewareStack.use(vL(this.config)),this.middlewareStack.use(mL(this.config)),this.middlewareStack.use(ML(this.config)),this.middlewareStack.use(wL(this.config)),this.middlewareStack.use(DL(this.config)),this.middlewareStack.use(kL(this.config)),this.middlewareStack.use(iz.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Go,identityProviderConfigProvider:async(Q)=>new iz.DefaultIdentityProviderConfig({"aws.auth#sigv4":Q.credentials})})),this.middlewareStack.use(iz.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}var sz=L4(GZ(),1);function bo(G){return G.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Mo(G){return G.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}class Pk{value;constructor(G){this.value=G}toString(){return Mo(""+this.value)}}class TY{name;children;attributes={};static of(G,Y,X){let W=new TY(G);if(Y!==void 0)W.addChildNode(new Pk(Y));if(X!==void 0)W.withName(X);return W}constructor(G,Y=[]){this.name=G,this.children=Y}withName(G){return this.name=G,this}addAttribute(G,Y){return this.attributes[G]=Y,this}addChildNode(G){return this.children.push(G),this}removeAttribute(G){return delete this.attributes[G],this}n(G){return this.name=G,this}c(G){return this.children.push(G),this}a(G,Y){if(Y!=null)this.attributes[G]=Y;return this}cc(G,Y,X=Y){if(G[Y]!=null){let W=TY.of(Y,G[Y]).withName(X);this.c(W)}}l(G,Y,X,W){if(G[Y]!=null)W().map((U)=>{U.withName(X),this.c(U)})}lc(G,Y,X,W){if(G[Y]!=null){let Z=W(),U=new TY(X);Z.map((K)=>{U.c(K)}),this.c(U)}}toString(){let G=Boolean(this.children.length),Y=`<${this.name}`,X=this.attributes;for(let W of Object.keys(X)){let Z=X[W];if(Z!=null)Y+=` ${W}="${bo(""+Z)}"`}return Y+=!G?"/>":`>${this.children.map((W)=>W.toString()).join("")}</${this.name}>`}}var co=L4(_k(),1);class k0 extends cL{constructor(G){super(G);Object.setPrototypeOf(this,k0.prototype)}}class uL extends k0{name="AccessDenied";$fault="client";Message;constructor(G){super({name:"AccessDenied",$fault:"client",...G});Object.setPrototypeOf(this,uL.prototype),this.Message=G.Message}}class lL extends k0{name="IllegalUpdate";$fault="client";Message;constructor(G){super({name:"IllegalUpdate",$fault:"client",...G});Object.setPrototypeOf(this,lL.prototype),this.Message=G.Message}}class pL extends k0{name="InvalidArgument";$fault="client";Message;constructor(G){super({name:"InvalidArgument",$fault:"client",...G});Object.setPrototypeOf(this,pL.prototype),this.Message=G.Message}}class iL extends k0{name="NoSuchDistribution";$fault="client";Message;constructor(G){super({name:"NoSuchDistribution",$fault:"client",...G});Object.setPrototypeOf(this,iL.prototype),this.Message=G.Message}}class aL extends k0{name="TooManyDistributionCNAMEs";$fault="client";Message;constructor(G){super({name:"TooManyDistributionCNAMEs",$fault:"client",...G});Object.setPrototypeOf(this,aL.prototype),this.Message=G.Message}}class rL extends k0{name="BatchTooLarge";$fault="client";Message;constructor(G){super({name:"BatchTooLarge",$fault:"client",...G});Object.setPrototypeOf(this,rL.prototype),this.Message=G.Message}}class dL extends k0{name="CachePolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"CachePolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,dL.prototype),this.Message=G.Message}}class sL extends k0{name="CachePolicyInUse";$fault="client";Message;constructor(G){super({name:"CachePolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,sL.prototype),this.Message=G.Message}}class nL extends k0{name="CannotChangeImmutablePublicKeyFields";$fault="client";Message;constructor(G){super({name:"CannotChangeImmutablePublicKeyFields",$fault:"client",...G});Object.setPrototypeOf(this,nL.prototype),this.Message=G.Message}}class oL extends k0{name="CannotDeleteEntityWhileInUse";$fault="client";Message;constructor(G){super({name:"CannotDeleteEntityWhileInUse",$fault:"client",...G});Object.setPrototypeOf(this,oL.prototype),this.Message=G.Message}}class tL extends k0{name="CannotUpdateEntityWhileInUse";$fault="client";Message;constructor(G){super({name:"CannotUpdateEntityWhileInUse",$fault:"client",...G});Object.setPrototypeOf(this,tL.prototype),this.Message=G.Message}}class eL extends k0{name="CNAMEAlreadyExists";$fault="client";Message;constructor(G){super({name:"CNAMEAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,eL.prototype),this.Message=G.Message}}class GT extends k0{name="DistributionAlreadyExists";$fault="client";Message;constructor(G){super({name:"DistributionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,GT.prototype),this.Message=G.Message}}class YT extends k0{name="IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior";$fault="client";Message;constructor(G){super({name:"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior",$fault:"client",...G});Object.setPrototypeOf(this,YT.prototype),this.Message=G.Message}}class XT extends k0{name="InconsistentQuantities";$fault="client";Message;constructor(G){super({name:"InconsistentQuantities",$fault:"client",...G});Object.setPrototypeOf(this,XT.prototype),this.Message=G.Message}}class WT extends k0{name="InvalidDefaultRootObject";$fault="client";Message;constructor(G){super({name:"InvalidDefaultRootObject",$fault:"client",...G});Object.setPrototypeOf(this,WT.prototype),this.Message=G.Message}}class ZT extends k0{name="InvalidErrorCode";$fault="client";Message;constructor(G){super({name:"InvalidErrorCode",$fault:"client",...G});Object.setPrototypeOf(this,ZT.prototype),this.Message=G.Message}}class JT extends k0{name="InvalidForwardCookies";$fault="client";Message;constructor(G){super({name:"InvalidForwardCookies",$fault:"client",...G});Object.setPrototypeOf(this,JT.prototype),this.Message=G.Message}}class $T extends k0{name="InvalidFunctionAssociation";$fault="client";Message;constructor(G){super({name:"InvalidFunctionAssociation",$fault:"client",...G});Object.setPrototypeOf(this,$T.prototype),this.Message=G.Message}}class UT extends k0{name="InvalidGeoRestrictionParameter";$fault="client";Message;constructor(G){super({name:"InvalidGeoRestrictionParameter",$fault:"client",...G});Object.setPrototypeOf(this,UT.prototype),this.Message=G.Message}}class zT extends k0{name="InvalidHeadersForS3Origin";$fault="client";Message;constructor(G){super({name:"InvalidHeadersForS3Origin",$fault:"client",...G});Object.setPrototypeOf(this,zT.prototype),this.Message=G.Message}}class KT extends k0{name="InvalidIfMatchVersion";$fault="client";Message;constructor(G){super({name:"InvalidIfMatchVersion",$fault:"client",...G});Object.setPrototypeOf(this,KT.prototype),this.Message=G.Message}}class HT extends k0{name="InvalidLambdaFunctionAssociation";$fault="client";Message;constructor(G){super({name:"InvalidLambdaFunctionAssociation",$fault:"client",...G});Object.setPrototypeOf(this,HT.prototype),this.Message=G.Message}}class VT extends k0{name="InvalidLocationCode";$fault="client";Message;constructor(G){super({name:"InvalidLocationCode",$fault:"client",...G});Object.setPrototypeOf(this,VT.prototype),this.Message=G.Message}}class QT extends k0{name="InvalidMinimumProtocolVersion";$fault="client";Message;constructor(G){super({name:"InvalidMinimumProtocolVersion",$fault:"client",...G});Object.setPrototypeOf(this,QT.prototype),this.Message=G.Message}}class FT extends k0{name="InvalidOrigin";$fault="client";Message;constructor(G){super({name:"InvalidOrigin",$fault:"client",...G});Object.setPrototypeOf(this,FT.prototype),this.Message=G.Message}}class qT extends k0{name="InvalidOriginAccessControl";$fault="client";Message;constructor(G){super({name:"InvalidOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,qT.prototype),this.Message=G.Message}}class AT extends k0{name="InvalidOriginAccessIdentity";$fault="client";Message;constructor(G){super({name:"InvalidOriginAccessIdentity",$fault:"client",...G});Object.setPrototypeOf(this,AT.prototype),this.Message=G.Message}}class ST extends k0{name="InvalidOriginKeepaliveTimeout";$fault="client";Message;constructor(G){super({name:"InvalidOriginKeepaliveTimeout",$fault:"client",...G});Object.setPrototypeOf(this,ST.prototype),this.Message=G.Message}}class NT extends k0{name="InvalidOriginReadTimeout";$fault="client";Message;constructor(G){super({name:"InvalidOriginReadTimeout",$fault:"client",...G});Object.setPrototypeOf(this,NT.prototype),this.Message=G.Message}}class RT extends k0{name="InvalidProtocolSettings";$fault="client";Message;constructor(G){super({name:"InvalidProtocolSettings",$fault:"client",...G});Object.setPrototypeOf(this,RT.prototype),this.Message=G.Message}}class LT extends k0{name="InvalidQueryStringParameters";$fault="client";Message;constructor(G){super({name:"InvalidQueryStringParameters",$fault:"client",...G});Object.setPrototypeOf(this,LT.prototype),this.Message=G.Message}}class TT extends k0{name="InvalidRelativePath";$fault="client";Message;constructor(G){super({name:"InvalidRelativePath",$fault:"client",...G});Object.setPrototypeOf(this,TT.prototype),this.Message=G.Message}}class IT extends k0{name="InvalidRequiredProtocol";$fault="client";Message;constructor(G){super({name:"InvalidRequiredProtocol",$fault:"client",...G});Object.setPrototypeOf(this,IT.prototype),this.Message=G.Message}}class ET extends k0{name="InvalidResponseCode";$fault="client";Message;constructor(G){super({name:"InvalidResponseCode",$fault:"client",...G});Object.setPrototypeOf(this,ET.prototype),this.Message=G.Message}}class jT extends k0{name="InvalidTTLOrder";$fault="client";Message;constructor(G){super({name:"InvalidTTLOrder",$fault:"client",...G});Object.setPrototypeOf(this,jT.prototype),this.Message=G.Message}}class OT extends k0{name="InvalidViewerCertificate";$fault="client";Message;constructor(G){super({name:"InvalidViewerCertificate",$fault:"client",...G});Object.setPrototypeOf(this,OT.prototype),this.Message=G.Message}}class _T extends k0{name="InvalidWebACLId";$fault="client";Message;constructor(G){super({name:"InvalidWebACLId",$fault:"client",...G});Object.setPrototypeOf(this,_T.prototype),this.Message=G.Message}}class fT extends k0{name="MissingBody";$fault="client";Message;constructor(G){super({name:"MissingBody",$fault:"client",...G});Object.setPrototypeOf(this,fT.prototype),this.Message=G.Message}}class PT extends k0{name="NoSuchCachePolicy";$fault="client";Message;constructor(G){super({name:"NoSuchCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,PT.prototype),this.Message=G.Message}}class CT extends k0{name="NoSuchFieldLevelEncryptionConfig";$fault="client";Message;constructor(G){super({name:"NoSuchFieldLevelEncryptionConfig",$fault:"client",...G});Object.setPrototypeOf(this,CT.prototype),this.Message=G.Message}}class BT extends k0{name="NoSuchOrigin";$fault="client";Message;constructor(G){super({name:"NoSuchOrigin",$fault:"client",...G});Object.setPrototypeOf(this,BT.prototype),this.Message=G.Message}}class wT extends k0{name="NoSuchOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,wT.prototype),this.Message=G.Message}}class DT extends k0{name="NoSuchRealtimeLogConfig";$fault="client";Message;constructor(G){super({name:"NoSuchRealtimeLogConfig",$fault:"client",...G});Object.setPrototypeOf(this,DT.prototype),this.Message=G.Message}}class kT extends k0{name="NoSuchResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,kT.prototype),this.Message=G.Message}}class hT extends k0{name="PreconditionFailed";$fault="client";Message;constructor(G){super({name:"PreconditionFailed",$fault:"client",...G});Object.setPrototypeOf(this,hT.prototype),this.Message=G.Message}}class vT extends k0{name="RealtimeLogConfigOwnerMismatch";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigOwnerMismatch",$fault:"client",...G});Object.setPrototypeOf(this,vT.prototype),this.Message=G.Message}}class bT extends k0{name="TooManyCacheBehaviors";$fault="client";Message;constructor(G){super({name:"TooManyCacheBehaviors",$fault:"client",...G});Object.setPrototypeOf(this,bT.prototype),this.Message=G.Message}}class MT extends k0{name="TooManyCertificates";$fault="client";Message;constructor(G){super({name:"TooManyCertificates",$fault:"client",...G});Object.setPrototypeOf(this,MT.prototype),this.Message=G.Message}}class gT extends k0{name="TooManyCookieNamesInWhiteList";$fault="client";Message;constructor(G){super({name:"TooManyCookieNamesInWhiteList",$fault:"client",...G});Object.setPrototypeOf(this,gT.prototype),this.Message=G.Message}}class yT extends k0{name="TooManyDistributions";$fault="client";Message;constructor(G){super({name:"TooManyDistributions",$fault:"client",...G});Object.setPrototypeOf(this,yT.prototype),this.Message=G.Message}}class xT extends k0{name="TooManyDistributionsAssociatedToCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,xT.prototype),this.Message=G.Message}}class mT extends k0{name="TooManyDistributionsAssociatedToFieldLevelEncryptionConfig";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig",$fault:"client",...G});Object.setPrototypeOf(this,mT.prototype),this.Message=G.Message}}class cT extends k0{name="TooManyDistributionsAssociatedToKeyGroup";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToKeyGroup",$fault:"client",...G});Object.setPrototypeOf(this,cT.prototype),this.Message=G.Message}}class uT extends k0{name="TooManyDistributionsAssociatedToOriginAccessControl";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,uT.prototype),this.Message=G.Message}}class lT extends k0{name="TooManyDistributionsAssociatedToOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,lT.prototype),this.Message=G.Message}}class pT extends k0{name="TooManyDistributionsAssociatedToResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsAssociatedToResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,pT.prototype),this.Message=G.Message}}class iT extends k0{name="TooManyDistributionsWithFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,iT.prototype),this.Message=G.Message}}class aT extends k0{name="TooManyDistributionsWithLambdaAssociations";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithLambdaAssociations",$fault:"client",...G});Object.setPrototypeOf(this,aT.prototype),this.Message=G.Message}}class rT extends k0{name="TooManyDistributionsWithSingleFunctionARN";$fault="client";Message;constructor(G){super({name:"TooManyDistributionsWithSingleFunctionARN",$fault:"client",...G});Object.setPrototypeOf(this,rT.prototype),this.Message=G.Message}}class dT extends k0{name="TooManyFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,dT.prototype),this.Message=G.Message}}class sT extends k0{name="TooManyHeadersInForwardedValues";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInForwardedValues",$fault:"client",...G});Object.setPrototypeOf(this,sT.prototype),this.Message=G.Message}}class nT extends k0{name="TooManyKeyGroupsAssociatedToDistribution";$fault="client";Message;constructor(G){super({name:"TooManyKeyGroupsAssociatedToDistribution",$fault:"client",...G});Object.setPrototypeOf(this,nT.prototype),this.Message=G.Message}}class oT extends k0{name="TooManyLambdaFunctionAssociations";$fault="client";Message;constructor(G){super({name:"TooManyLambdaFunctionAssociations",$fault:"client",...G});Object.setPrototypeOf(this,oT.prototype),this.Message=G.Message}}class tT extends k0{name="TooManyOriginCustomHeaders";$fault="client";Message;constructor(G){super({name:"TooManyOriginCustomHeaders",$fault:"client",...G});Object.setPrototypeOf(this,tT.prototype),this.Message=G.Message}}class eT extends k0{name="TooManyOriginGroupsPerDistribution";$fault="client";Message;constructor(G){super({name:"TooManyOriginGroupsPerDistribution",$fault:"client",...G});Object.setPrototypeOf(this,eT.prototype),this.Message=G.Message}}class GI extends k0{name="TooManyOrigins";$fault="client";Message;constructor(G){super({name:"TooManyOrigins",$fault:"client",...G});Object.setPrototypeOf(this,GI.prototype),this.Message=G.Message}}class YI extends k0{name="TooManyQueryStringParameters";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringParameters",$fault:"client",...G});Object.setPrototypeOf(this,YI.prototype),this.Message=G.Message}}class XI extends k0{name="TooManyTrustedSigners";$fault="client";Message;constructor(G){super({name:"TooManyTrustedSigners",$fault:"client",...G});Object.setPrototypeOf(this,XI.prototype),this.Message=G.Message}}class WI extends k0{name="TrustedKeyGroupDoesNotExist";$fault="client";Message;constructor(G){super({name:"TrustedKeyGroupDoesNotExist",$fault:"client",...G});Object.setPrototypeOf(this,WI.prototype),this.Message=G.Message}}class ZI extends k0{name="TrustedSignerDoesNotExist";$fault="client";Message;constructor(G){super({name:"TrustedSignerDoesNotExist",$fault:"client",...G});Object.setPrototypeOf(this,ZI.prototype),this.Message=G.Message}}class JI extends k0{name="EntityAlreadyExists";$fault="client";Message;constructor(G){super({name:"EntityAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,JI.prototype),this.Message=G.Message}}class $I extends k0{name="EntityLimitExceeded";$fault="client";Message;constructor(G){super({name:"EntityLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,$I.prototype),this.Message=G.Message}}class UI extends k0{name="InvalidTagging";$fault="client";Message;constructor(G){super({name:"InvalidTagging",$fault:"client",...G});Object.setPrototypeOf(this,UI.prototype),this.Message=G.Message}}class zI extends k0{name="UnsupportedOperation";$fault="client";Message;constructor(G){super({name:"UnsupportedOperation",$fault:"client",...G});Object.setPrototypeOf(this,zI.prototype),this.Message=G.Message}}class KI extends k0{name="TooManyCachePolicies";$fault="client";Message;constructor(G){super({name:"TooManyCachePolicies",$fault:"client",...G});Object.setPrototypeOf(this,KI.prototype),this.Message=G.Message}}class HI extends k0{name="TooManyCookiesInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyCookiesInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,HI.prototype),this.Message=G.Message}}class VI extends k0{name="TooManyHeadersInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,VI.prototype),this.Message=G.Message}}class QI extends k0{name="TooManyQueryStringsInCachePolicy";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringsInCachePolicy",$fault:"client",...G});Object.setPrototypeOf(this,QI.prototype),this.Message=G.Message}}class FI extends k0{name="CloudFrontOriginAccessIdentityAlreadyExists";$fault="client";Message;constructor(G){super({name:"CloudFrontOriginAccessIdentityAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,FI.prototype),this.Message=G.Message}}class qI extends k0{name="TooManyCloudFrontOriginAccessIdentities";$fault="client";Message;constructor(G){super({name:"TooManyCloudFrontOriginAccessIdentities",$fault:"client",...G});Object.setPrototypeOf(this,qI.prototype),this.Message=G.Message}}class AI extends k0{name="ContinuousDeploymentPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"ContinuousDeploymentPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,AI.prototype),this.Message=G.Message}}class SI extends k0{name="StagingDistributionInUse";$fault="client";Message;constructor(G){super({name:"StagingDistributionInUse",$fault:"client",...G});Object.setPrototypeOf(this,SI.prototype),this.Message=G.Message}}class NI extends k0{name="TooManyContinuousDeploymentPolicies";$fault="client";Message;constructor(G){super({name:"TooManyContinuousDeploymentPolicies",$fault:"client",...G});Object.setPrototypeOf(this,NI.prototype),this.Message=G.Message}}class RI extends k0{name="ContinuousDeploymentPolicyInUse";$fault="client";Message;constructor(G){super({name:"ContinuousDeploymentPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,RI.prototype),this.Message=G.Message}}class LI extends k0{name="EntityNotFound";$fault="client";Message;constructor(G){super({name:"EntityNotFound",$fault:"client",...G});Object.setPrototypeOf(this,LI.prototype),this.Message=G.Message}}class TI extends k0{name="IllegalOriginAccessConfiguration";$fault="client";Message;constructor(G){super({name:"IllegalOriginAccessConfiguration",$fault:"client",...G});Object.setPrototypeOf(this,TI.prototype),this.Message=G.Message}}class II extends k0{name="InvalidDomainNameForOriginAccessControl";$fault="client";Message;constructor(G){super({name:"InvalidDomainNameForOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,II.prototype),this.Message=G.Message}}class EI extends k0{name="NoSuchContinuousDeploymentPolicy";$fault="client";Message;constructor(G){super({name:"NoSuchContinuousDeploymentPolicy",$fault:"client",...G});Object.setPrototypeOf(this,EI.prototype),this.Message=G.Message}}class jI extends k0{name="FieldLevelEncryptionConfigAlreadyExists";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionConfigAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,jI.prototype),this.Message=G.Message}}class OI extends k0{name="NoSuchFieldLevelEncryptionProfile";$fault="client";Message;constructor(G){super({name:"NoSuchFieldLevelEncryptionProfile",$fault:"client",...G});Object.setPrototypeOf(this,OI.prototype),this.Message=G.Message}}class _I extends k0{name="QueryArgProfileEmpty";$fault="client";Message;constructor(G){super({name:"QueryArgProfileEmpty",$fault:"client",...G});Object.setPrototypeOf(this,_I.prototype),this.Message=G.Message}}class fI extends k0{name="TooManyFieldLevelEncryptionConfigs";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionConfigs",$fault:"client",...G});Object.setPrototypeOf(this,fI.prototype),this.Message=G.Message}}class PI extends k0{name="TooManyFieldLevelEncryptionContentTypeProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionContentTypeProfiles",$fault:"client",...G});Object.setPrototypeOf(this,PI.prototype),this.Message=G.Message}}class CI extends k0{name="TooManyFieldLevelEncryptionQueryArgProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionQueryArgProfiles",$fault:"client",...G});Object.setPrototypeOf(this,CI.prototype),this.Message=G.Message}}class BI extends k0{name="FieldLevelEncryptionProfileAlreadyExists";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,BI.prototype),this.Message=G.Message}}class wI extends k0{name="FieldLevelEncryptionProfileSizeExceeded";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileSizeExceeded",$fault:"client",...G});Object.setPrototypeOf(this,wI.prototype),this.Message=G.Message}}class DI extends k0{name="NoSuchPublicKey";$fault="client";Message;constructor(G){super({name:"NoSuchPublicKey",$fault:"client",...G});Object.setPrototypeOf(this,DI.prototype),this.Message=G.Message}}class kI extends k0{name="TooManyFieldLevelEncryptionEncryptionEntities";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionEncryptionEntities",$fault:"client",...G});Object.setPrototypeOf(this,kI.prototype),this.Message=G.Message}}class hI extends k0{name="TooManyFieldLevelEncryptionFieldPatterns";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionFieldPatterns",$fault:"client",...G});Object.setPrototypeOf(this,hI.prototype),this.Message=G.Message}}class vI extends k0{name="TooManyFieldLevelEncryptionProfiles";$fault="client";Message;constructor(G){super({name:"TooManyFieldLevelEncryptionProfiles",$fault:"client",...G});Object.setPrototypeOf(this,vI.prototype),this.Message=G.Message}}class bI extends k0{name="FunctionAlreadyExists";$fault="client";Message;constructor(G){super({name:"FunctionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,bI.prototype),this.Message=G.Message}}class MI extends k0{name="FunctionSizeLimitExceeded";$fault="client";Message;constructor(G){super({name:"FunctionSizeLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,MI.prototype),this.Message=G.Message}}class gI extends k0{name="TooManyFunctions";$fault="client";Message;constructor(G){super({name:"TooManyFunctions",$fault:"client",...G});Object.setPrototypeOf(this,gI.prototype),this.Message=G.Message}}class yI extends k0{name="TooManyInvalidationsInProgress";$fault="client";Message;constructor(G){super({name:"TooManyInvalidationsInProgress",$fault:"client",...G});Object.setPrototypeOf(this,yI.prototype),this.Message=G.Message}}class xI extends k0{name="KeyGroupAlreadyExists";$fault="client";Message;constructor(G){super({name:"KeyGroupAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,xI.prototype),this.Message=G.Message}}class mI extends k0{name="TooManyKeyGroups";$fault="client";Message;constructor(G){super({name:"TooManyKeyGroups",$fault:"client",...G});Object.setPrototypeOf(this,mI.prototype),this.Message=G.Message}}class cI extends k0{name="TooManyPublicKeysInKeyGroup";$fault="client";Message;constructor(G){super({name:"TooManyPublicKeysInKeyGroup",$fault:"client",...G});Object.setPrototypeOf(this,cI.prototype),this.Message=G.Message}}class uI extends k0{name="EntitySizeLimitExceeded";$fault="client";Message;constructor(G){super({name:"EntitySizeLimitExceeded",$fault:"client",...G});Object.setPrototypeOf(this,uI.prototype),this.Message=G.Message}}class lI extends k0{name="MonitoringSubscriptionAlreadyExists";$fault="client";Message;constructor(G){super({name:"MonitoringSubscriptionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,lI.prototype),this.Message=G.Message}}class pI extends k0{name="OriginAccessControlAlreadyExists";$fault="client";Message;constructor(G){super({name:"OriginAccessControlAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,pI.prototype),this.Message=G.Message}}class iI extends k0{name="TooManyOriginAccessControls";$fault="client";Message;constructor(G){super({name:"TooManyOriginAccessControls",$fault:"client",...G});Object.setPrototypeOf(this,iI.prototype),this.Message=G.Message}}class aI extends k0{name="OriginRequestPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"OriginRequestPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,aI.prototype),this.Message=G.Message}}class rI extends k0{name="TooManyCookiesInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyCookiesInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,rI.prototype),this.Message=G.Message}}class dI extends k0{name="TooManyHeadersInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyHeadersInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,dI.prototype),this.Message=G.Message}}class sI extends k0{name="TooManyOriginRequestPolicies";$fault="client";Message;constructor(G){super({name:"TooManyOriginRequestPolicies",$fault:"client",...G});Object.setPrototypeOf(this,sI.prototype),this.Message=G.Message}}class nI extends k0{name="TooManyQueryStringsInOriginRequestPolicy";$fault="client";Message;constructor(G){super({name:"TooManyQueryStringsInOriginRequestPolicy",$fault:"client",...G});Object.setPrototypeOf(this,nI.prototype),this.Message=G.Message}}class oI extends k0{name="PublicKeyAlreadyExists";$fault="client";Message;constructor(G){super({name:"PublicKeyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,oI.prototype),this.Message=G.Message}}class tI extends k0{name="TooManyPublicKeys";$fault="client";Message;constructor(G){super({name:"TooManyPublicKeys",$fault:"client",...G});Object.setPrototypeOf(this,tI.prototype),this.Message=G.Message}}class eI extends k0{name="RealtimeLogConfigAlreadyExists";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,eI.prototype),this.Message=G.Message}}class GE extends k0{name="TooManyRealtimeLogConfigs";$fault="client";Message;constructor(G){super({name:"TooManyRealtimeLogConfigs",$fault:"client",...G});Object.setPrototypeOf(this,GE.prototype),this.Message=G.Message}}class YE extends k0{name="ResponseHeadersPolicyAlreadyExists";$fault="client";Message;constructor(G){super({name:"ResponseHeadersPolicyAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,YE.prototype),this.Message=G.Message}}class XE extends k0{name="TooLongCSPInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooLongCSPInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,XE.prototype),this.Message=G.Message}}class WE extends k0{name="TooManyCustomHeadersInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyCustomHeadersInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,WE.prototype),this.Message=G.Message}}class ZE extends k0{name="TooManyRemoveHeadersInResponseHeadersPolicy";$fault="client";Message;constructor(G){super({name:"TooManyRemoveHeadersInResponseHeadersPolicy",$fault:"client",...G});Object.setPrototypeOf(this,ZE.prototype),this.Message=G.Message}}class JE extends k0{name="TooManyResponseHeadersPolicies";$fault="client";Message;constructor(G){super({name:"TooManyResponseHeadersPolicies",$fault:"client",...G});Object.setPrototypeOf(this,JE.prototype),this.Message=G.Message}}class $E extends k0{name="StreamingDistributionAlreadyExists";$fault="client";Message;constructor(G){super({name:"StreamingDistributionAlreadyExists",$fault:"client",...G});Object.setPrototypeOf(this,$E.prototype),this.Message=G.Message}}class UE extends k0{name="TooManyStreamingDistributionCNAMEs";$fault="client";Message;constructor(G){super({name:"TooManyStreamingDistributionCNAMEs",$fault:"client",...G});Object.setPrototypeOf(this,UE.prototype),this.Message=G.Message}}class zE extends k0{name="TooManyStreamingDistributions";$fault="client";Message;constructor(G){super({name:"TooManyStreamingDistributions",$fault:"client",...G});Object.setPrototypeOf(this,zE.prototype),this.Message=G.Message}}class KE extends k0{name="IllegalDelete";$fault="client";Message;constructor(G){super({name:"IllegalDelete",$fault:"client",...G});Object.setPrototypeOf(this,KE.prototype),this.Message=G.Message}}class HE extends k0{name="CloudFrontOriginAccessIdentityInUse";$fault="client";Message;constructor(G){super({name:"CloudFrontOriginAccessIdentityInUse",$fault:"client",...G});Object.setPrototypeOf(this,HE.prototype),this.Message=G.Message}}class VE extends k0{name="NoSuchCloudFrontOriginAccessIdentity";$fault="client";Message;constructor(G){super({name:"NoSuchCloudFrontOriginAccessIdentity",$fault:"client",...G});Object.setPrototypeOf(this,VE.prototype),this.Message=G.Message}}class QE extends k0{name="DistributionNotDisabled";$fault="client";Message;constructor(G){super({name:"DistributionNotDisabled",$fault:"client",...G});Object.setPrototypeOf(this,QE.prototype),this.Message=G.Message}}class FE extends k0{name="FieldLevelEncryptionConfigInUse";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionConfigInUse",$fault:"client",...G});Object.setPrototypeOf(this,FE.prototype),this.Message=G.Message}}class qE extends k0{name="FieldLevelEncryptionProfileInUse";$fault="client";Message;constructor(G){super({name:"FieldLevelEncryptionProfileInUse",$fault:"client",...G});Object.setPrototypeOf(this,qE.prototype),this.Message=G.Message}}class AE extends k0{name="FunctionInUse";$fault="client";Message;constructor(G){super({name:"FunctionInUse",$fault:"client",...G});Object.setPrototypeOf(this,AE.prototype),this.Message=G.Message}}class SE extends k0{name="NoSuchFunctionExists";$fault="client";Message;constructor(G){super({name:"NoSuchFunctionExists",$fault:"client",...G});Object.setPrototypeOf(this,SE.prototype),this.Message=G.Message}}class NE extends k0{name="NoSuchResource";$fault="client";Message;constructor(G){super({name:"NoSuchResource",$fault:"client",...G});Object.setPrototypeOf(this,NE.prototype),this.Message=G.Message}}class RE extends k0{name="ResourceInUse";$fault="client";Message;constructor(G){super({name:"ResourceInUse",$fault:"client",...G});Object.setPrototypeOf(this,RE.prototype),this.Message=G.Message}}class LE extends k0{name="NoSuchMonitoringSubscription";$fault="client";Message;constructor(G){super({name:"NoSuchMonitoringSubscription",$fault:"client",...G});Object.setPrototypeOf(this,LE.prototype),this.Message=G.Message}}class TE extends k0{name="NoSuchOriginAccessControl";$fault="client";Message;constructor(G){super({name:"NoSuchOriginAccessControl",$fault:"client",...G});Object.setPrototypeOf(this,TE.prototype),this.Message=G.Message}}class IE extends k0{name="OriginAccessControlInUse";$fault="client";Message;constructor(G){super({name:"OriginAccessControlInUse",$fault:"client",...G});Object.setPrototypeOf(this,IE.prototype),this.Message=G.Message}}class EE extends k0{name="OriginRequestPolicyInUse";$fault="client";Message;constructor(G){super({name:"OriginRequestPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,EE.prototype),this.Message=G.Message}}class jE extends k0{name="PublicKeyInUse";$fault="client";Message;constructor(G){super({name:"PublicKeyInUse",$fault:"client",...G});Object.setPrototypeOf(this,jE.prototype),this.Message=G.Message}}class OE extends k0{name="RealtimeLogConfigInUse";$fault="client";Message;constructor(G){super({name:"RealtimeLogConfigInUse",$fault:"client",...G});Object.setPrototypeOf(this,OE.prototype),this.Message=G.Message}}class _E extends k0{name="ResponseHeadersPolicyInUse";$fault="client";Message;constructor(G){super({name:"ResponseHeadersPolicyInUse",$fault:"client",...G});Object.setPrototypeOf(this,_E.prototype),this.Message=G.Message}}class fE extends k0{name="NoSuchStreamingDistribution";$fault="client";Message;constructor(G){super({name:"NoSuchStreamingDistribution",$fault:"client",...G});Object.setPrototypeOf(this,fE.prototype),this.Message=G.Message}}class PE extends k0{name="StreamingDistributionNotDisabled";$fault="client";Message;constructor(G){super({name:"StreamingDistributionNotDisabled",$fault:"client",...G});Object.setPrototypeOf(this,PE.prototype),this.Message=G.Message}}class CE extends k0{name="NoSuchInvalidation";$fault="client";Message;constructor(G){super({name:"NoSuchInvalidation",$fault:"client",...G});Object.setPrototypeOf(this,CE.prototype),this.Message=G.Message}}class BE extends k0{name="TestFunctionFailed";$fault="server";Message;constructor(G){super({name:"TestFunctionFailed",$fault:"server",...G});Object.setPrototypeOf(this,BE.prototype),this.Message=G.Message}}var uo=async(G,Y)=>{let X=co.requestBuilder(G,Y),W={"content-type":"application/xml"};X.bp("/2020-05-31/distribution/{DistributionId}/invalidation"),X.p("DistributionId",()=>G.DistributionId,"{DistributionId}",!1);let Z,U;if(G.InvalidationBatch!==void 0)U=py1(G.InvalidationBatch,Y),Z=Gx1,U.a("xmlns","http://cloudfront.amazonaws.com/doc/2020-05-31/"),Z+=U.toString();return X.m("POST").h(W).b(Z),X.build()};var lo=async(G,Y)=>{if(G.statusCode!==201&&G.statusCode>=300)return GM1(G,Y);let X=b0({$metadata:g0(G),[oy1]:[,G.headers[ey1]]}),W=go(await sz.parseXmlBody(G.body,Y));return X.Invalidation=ry1(W,Y),X};var GM1=async(G,Y)=>{let X={...G,body:await sz.parseXmlErrorBody(G.body,Y)},W=sz.loadRestXmlErrorCode(G,X.body);switch(W){case"AccessDenied":case"com.amazonaws.cloudfront#AccessDenied":throw await XM1(X,Y);case"IllegalUpdate":case"com.amazonaws.cloudfront#IllegalUpdate":throw await DM1(X,Y);case"InvalidArgument":case"com.amazonaws.cloudfront#InvalidArgument":throw await hM1(X,Y);case"NoSuchDistribution":case"com.amazonaws.cloudfront#NoSuchDistribution":throw await Vg1(X,Y);case"TooManyDistributionCNAMEs":case"com.amazonaws.cloudfront#TooManyDistributionCNAMEs":throw await eg1(X,Y);case"CNAMEAlreadyExists":case"com.amazonaws.cloudfront#CNAMEAlreadyExists":throw await VM1(X,Y);case"DistributionAlreadyExists":case"com.amazonaws.cloudfront#DistributionAlreadyExists":throw await qM1(X,Y);case"IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior":case"com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior":throw await BM1(X,Y);case"InconsistentQuantities":case"com.amazonaws.cloudfront#InconsistentQuantities":throw await kM1(X,Y);case"InvalidDefaultRootObject":case"com.amazonaws.cloudfront#InvalidDefaultRootObject":throw await vM1(X,Y);case"InvalidErrorCode":case"com.amazonaws.cloudfront#InvalidErrorCode":throw await MM1(X,Y);case"InvalidForwardCookies":case"com.amazonaws.cloudfront#InvalidForwardCookies":throw await gM1(X,Y);case"InvalidFunctionAssociation":case"com.amazonaws.cloudfront#InvalidFunctionAssociation":throw await yM1(X,Y);case"InvalidGeoRestrictionParameter":case"com.amazonaws.cloudfront#InvalidGeoRestrictionParameter":throw await xM1(X,Y);case"InvalidHeadersForS3Origin":case"com.amazonaws.cloudfront#InvalidHeadersForS3Origin":throw await mM1(X,Y);case"InvalidIfMatchVersion":case"com.amazonaws.cloudfront#InvalidIfMatchVersion":throw await cM1(X,Y);case"InvalidLambdaFunctionAssociation":case"com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation":throw await uM1(X,Y);case"InvalidLocationCode":case"com.amazonaws.cloudfront#InvalidLocationCode":throw await lM1(X,Y);case"InvalidMinimumProtocolVersion":case"com.amazonaws.cloudfront#InvalidMinimumProtocolVersion":throw await pM1(X,Y);case"InvalidOrigin":case"com.amazonaws.cloudfront#InvalidOrigin":throw await iM1(X,Y);case"InvalidOriginAccessControl":case"com.amazonaws.cloudfront#InvalidOriginAccessControl":throw await aM1(X,Y);case"InvalidOriginAccessIdentity":case"com.amazonaws.cloudfront#InvalidOriginAccessIdentity":throw await rM1(X,Y);case"InvalidOriginKeepaliveTimeout":case"com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout":throw await dM1(X,Y);case"InvalidOriginReadTimeout":case"com.amazonaws.cloudfront#InvalidOriginReadTimeout":throw await sM1(X,Y);case"InvalidProtocolSettings":case"com.amazonaws.cloudfront#InvalidProtocolSettings":throw await nM1(X,Y);case"InvalidQueryStringParameters":case"com.amazonaws.cloudfront#InvalidQueryStringParameters":throw await oM1(X,Y);case"InvalidRelativePath":case"com.amazonaws.cloudfront#InvalidRelativePath":throw await tM1(X,Y);case"InvalidRequiredProtocol":case"com.amazonaws.cloudfront#InvalidRequiredProtocol":throw await eM1(X,Y);case"InvalidResponseCode":case"com.amazonaws.cloudfront#InvalidResponseCode":throw await Gg1(X,Y);case"InvalidTTLOrder":case"com.amazonaws.cloudfront#InvalidTTLOrder":throw await Xg1(X,Y);case"InvalidViewerCertificate":case"com.amazonaws.cloudfront#InvalidViewerCertificate":throw await Wg1(X,Y);case"InvalidWebACLId":case"com.amazonaws.cloudfront#InvalidWebACLId":throw await Zg1(X,Y);case"MissingBody":case"com.amazonaws.cloudfront#MissingBody":throw await $g1(X,Y);case"NoSuchCachePolicy":case"com.amazonaws.cloudfront#NoSuchCachePolicy":throw await zg1(X,Y);case"NoSuchFieldLevelEncryptionConfig":case"com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig":throw await Qg1(X,Y);case"NoSuchOrigin":case"com.amazonaws.cloudfront#NoSuchOrigin":throw await Ng1(X,Y);case"NoSuchOriginRequestPolicy":case"com.amazonaws.cloudfront#NoSuchOriginRequestPolicy":throw await Lg1(X,Y);case"NoSuchRealtimeLogConfig":case"com.amazonaws.cloudfront#NoSuchRealtimeLogConfig":throw await Ig1(X,Y);case"NoSuchResponseHeadersPolicy":case"com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy":throw await jg1(X,Y);case"PreconditionFailed":case"com.amazonaws.cloudfront#PreconditionFailed":throw await Bg1(X,Y);case"RealtimeLogConfigOwnerMismatch":case"com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch":throw await bg1(X,Y);case"TooManyCacheBehaviors":case"com.amazonaws.cloudfront#TooManyCacheBehaviors":throw await pg1(X,Y);case"TooManyCertificates":case"com.amazonaws.cloudfront#TooManyCertificates":throw await ag1(X,Y);case"TooManyCookieNamesInWhiteList":case"com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList":throw await sg1(X,Y);case"TooManyDistributions":case"com.amazonaws.cloudfront#TooManyDistributions":throw await Gy1(X,Y);case"TooManyDistributionsAssociatedToCachePolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy":throw await Yy1(X,Y);case"TooManyDistributionsAssociatedToFieldLevelEncryptionConfig":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig":throw await Xy1(X,Y);case"TooManyDistributionsAssociatedToKeyGroup":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup":throw await Wy1(X,Y);case"TooManyDistributionsAssociatedToOriginAccessControl":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl":throw await Zy1(X,Y);case"TooManyDistributionsAssociatedToOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy":throw await Jy1(X,Y);case"TooManyDistributionsAssociatedToResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy":throw await $y1(X,Y);case"TooManyDistributionsWithFunctionAssociations":case"com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations":throw await Uy1(X,Y);case"TooManyDistributionsWithLambdaAssociations":case"com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations":throw await zy1(X,Y);case"TooManyDistributionsWithSingleFunctionARN":case"com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN":throw await Ky1(X,Y);case"TooManyFunctionAssociations":case"com.amazonaws.cloudfront#TooManyFunctionAssociations":throw await Sy1(X,Y);case"TooManyHeadersInForwardedValues":case"com.amazonaws.cloudfront#TooManyHeadersInForwardedValues":throw await Ly1(X,Y);case"TooManyKeyGroupsAssociatedToDistribution":case"com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution":throw await jy1(X,Y);case"TooManyLambdaFunctionAssociations":case"com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations":throw await Oy1(X,Y);case"TooManyOriginCustomHeaders":case"com.amazonaws.cloudfront#TooManyOriginCustomHeaders":throw await fy1(X,Y);case"TooManyOriginGroupsPerDistribution":case"com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution":throw await Py1(X,Y);case"TooManyOrigins":case"com.amazonaws.cloudfront#TooManyOrigins":throw await By1(X,Y);case"TooManyQueryStringParameters":case"com.amazonaws.cloudfront#TooManyQueryStringParameters":throw await ky1(X,Y);case"TooManyTrustedSigners":case"com.amazonaws.cloudfront#TooManyTrustedSigners":throw await my1(X,Y);case"TrustedKeyGroupDoesNotExist":case"com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist":throw await cy1(X,Y);case"TrustedSignerDoesNotExist":case"com.amazonaws.cloudfront#TrustedSignerDoesNotExist":throw await uy1(X,Y);case"EntityAlreadyExists":case"com.amazonaws.cloudfront#EntityAlreadyExists":throw await SM1(X,Y);case"EntityLimitExceeded":case"com.amazonaws.cloudfront#EntityLimitExceeded":throw await NM1(X,Y);case"InvalidTagging":case"com.amazonaws.cloudfront#InvalidTagging":throw await Yg1(X,Y);case"UnsupportedOperation":case"com.amazonaws.cloudfront#UnsupportedOperation":throw await ly1(X,Y);case"CachePolicyAlreadyExists":case"com.amazonaws.cloudfront#CachePolicyAlreadyExists":throw await ZM1(X,Y);case"TooManyCachePolicies":case"com.amazonaws.cloudfront#TooManyCachePolicies":throw await ig1(X,Y);case"TooManyCookiesInCachePolicy":case"com.amazonaws.cloudfront#TooManyCookiesInCachePolicy":throw await ng1(X,Y);case"TooManyHeadersInCachePolicy":case"com.amazonaws.cloudfront#TooManyHeadersInCachePolicy":throw await Ry1(X,Y);case"TooManyQueryStringsInCachePolicy":case"com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy":throw await hy1(X,Y);case"CloudFrontOriginAccessIdentityAlreadyExists":case"com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityAlreadyExists":throw await KM1(X,Y);case"TooManyCloudFrontOriginAccessIdentities":case"com.amazonaws.cloudfront#TooManyCloudFrontOriginAccessIdentities":throw await rg1(X,Y);case"ContinuousDeploymentPolicyAlreadyExists":case"com.amazonaws.cloudfront#ContinuousDeploymentPolicyAlreadyExists":throw await QM1(X,Y);case"StagingDistributionInUse":case"com.amazonaws.cloudfront#StagingDistributionInUse":throw await xg1(X,Y);case"TooManyContinuousDeploymentPolicies":case"com.amazonaws.cloudfront#TooManyContinuousDeploymentPolicies":throw await dg1(X,Y);case"ContinuousDeploymentPolicyInUse":case"com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse":throw await FM1(X,Y);case"EntityNotFound":case"com.amazonaws.cloudfront#EntityNotFound":throw await RM1(X,Y);case"IllegalOriginAccessConfiguration":case"com.amazonaws.cloudfront#IllegalOriginAccessConfiguration":throw await wM1(X,Y);case"InvalidDomainNameForOriginAccessControl":case"com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl":throw await bM1(X,Y);case"NoSuchContinuousDeploymentPolicy":case"com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy":throw await Hg1(X,Y);case"FieldLevelEncryptionConfigAlreadyExists":case"com.amazonaws.cloudfront#FieldLevelEncryptionConfigAlreadyExists":throw await TM1(X,Y);case"NoSuchFieldLevelEncryptionProfile":case"com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile":throw await Fg1(X,Y);case"QueryArgProfileEmpty":case"com.amazonaws.cloudfront#QueryArgProfileEmpty":throw await kg1(X,Y);case"TooManyFieldLevelEncryptionConfigs":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionConfigs":throw await Hy1(X,Y);case"TooManyFieldLevelEncryptionContentTypeProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles":throw await Vy1(X,Y);case"TooManyFieldLevelEncryptionQueryArgProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles":throw await Ay1(X,Y);case"FieldLevelEncryptionProfileAlreadyExists":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists":throw await EM1(X,Y);case"FieldLevelEncryptionProfileSizeExceeded":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded":throw await OM1(X,Y);case"NoSuchPublicKey":case"com.amazonaws.cloudfront#NoSuchPublicKey":throw await Tg1(X,Y);case"TooManyFieldLevelEncryptionEncryptionEntities":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities":throw await Qy1(X,Y);case"TooManyFieldLevelEncryptionFieldPatterns":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns":throw await Fy1(X,Y);case"TooManyFieldLevelEncryptionProfiles":case"com.amazonaws.cloudfront#TooManyFieldLevelEncryptionProfiles":throw await qy1(X,Y);case"FunctionAlreadyExists":case"com.amazonaws.cloudfront#FunctionAlreadyExists":throw await _M1(X,Y);case"FunctionSizeLimitExceeded":case"com.amazonaws.cloudfront#FunctionSizeLimitExceeded":throw await PM1(X,Y);case"TooManyFunctions":case"com.amazonaws.cloudfront#TooManyFunctions":throw await Ny1(X,Y);case"BatchTooLarge":case"com.amazonaws.cloudfront#BatchTooLarge":throw await WM1(X,Y);case"TooManyInvalidationsInProgress":case"com.amazonaws.cloudfront#TooManyInvalidationsInProgress":throw await Iy1(X,Y);case"KeyGroupAlreadyExists":case"com.amazonaws.cloudfront#KeyGroupAlreadyExists":throw await Jg1(X,Y);case"TooManyKeyGroups":case"com.amazonaws.cloudfront#TooManyKeyGroups":throw await Ey1(X,Y);case"TooManyPublicKeysInKeyGroup":case"com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup":throw await Dy1(X,Y);case"EntitySizeLimitExceeded":case"com.amazonaws.cloudfront#EntitySizeLimitExceeded":throw await LM1(X,Y);case"MonitoringSubscriptionAlreadyExists":case"com.amazonaws.cloudfront#MonitoringSubscriptionAlreadyExists":throw await Ug1(X,Y);case"OriginAccessControlAlreadyExists":case"com.amazonaws.cloudfront#OriginAccessControlAlreadyExists":throw await _g1(X,Y);case"TooManyOriginAccessControls":case"com.amazonaws.cloudfront#TooManyOriginAccessControls":throw await _y1(X,Y);case"OriginRequestPolicyAlreadyExists":case"com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists":throw await Pg1(X,Y);case"TooManyCookiesInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy":throw await og1(X,Y);case"TooManyHeadersInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy":throw await Ty1(X,Y);case"TooManyOriginRequestPolicies":case"com.amazonaws.cloudfront#TooManyOriginRequestPolicies":throw await Cy1(X,Y);case"TooManyQueryStringsInOriginRequestPolicy":case"com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy":throw await vy1(X,Y);case"PublicKeyAlreadyExists":case"com.amazonaws.cloudfront#PublicKeyAlreadyExists":throw await wg1(X,Y);case"TooManyPublicKeys":case"com.amazonaws.cloudfront#TooManyPublicKeys":throw await wy1(X,Y);case"RealtimeLogConfigAlreadyExists":case"com.amazonaws.cloudfront#RealtimeLogConfigAlreadyExists":throw await hg1(X,Y);case"TooManyRealtimeLogConfigs":case"com.amazonaws.cloudfront#TooManyRealtimeLogConfigs":throw await by1(X,Y);case"ResponseHeadersPolicyAlreadyExists":case"com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists":throw await gg1(X,Y);case"TooLongCSPInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooLongCSPInResponseHeadersPolicy":throw await lg1(X,Y);case"TooManyCustomHeadersInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyCustomHeadersInResponseHeadersPolicy":throw await tg1(X,Y);case"TooManyRemoveHeadersInResponseHeadersPolicy":case"com.amazonaws.cloudfront#TooManyRemoveHeadersInResponseHeadersPolicy":throw await My1(X,Y);case"TooManyResponseHeadersPolicies":case"com.amazonaws.cloudfront#TooManyResponseHeadersPolicies":throw await gy1(X,Y);case"StreamingDistributionAlreadyExists":case"com.amazonaws.cloudfront#StreamingDistributionAlreadyExists":throw await mg1(X,Y);case"TooManyStreamingDistributionCNAMEs":case"com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs":throw await yy1(X,Y);case"TooManyStreamingDistributions":case"com.amazonaws.cloudfront#TooManyStreamingDistributions":throw await xy1(X,Y);case"CannotDeleteEntityWhileInUse":case"com.amazonaws.cloudfront#CannotDeleteEntityWhileInUse":throw await UM1(X,Y);case"IllegalDelete":case"com.amazonaws.cloudfront#IllegalDelete":throw await CM1(X,Y);case"CachePolicyInUse":case"com.amazonaws.cloudfront#CachePolicyInUse":throw await JM1(X,Y);case"CloudFrontOriginAccessIdentityInUse":case"com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityInUse":throw await HM1(X,Y);case"NoSuchCloudFrontOriginAccessIdentity":case"com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity":throw await Kg1(X,Y);case"DistributionNotDisabled":case"com.amazonaws.cloudfront#DistributionNotDisabled":throw await AM1(X,Y);case"FieldLevelEncryptionConfigInUse":case"com.amazonaws.cloudfront#FieldLevelEncryptionConfigInUse":throw await IM1(X,Y);case"FieldLevelEncryptionProfileInUse":case"com.amazonaws.cloudfront#FieldLevelEncryptionProfileInUse":throw await jM1(X,Y);case"FunctionInUse":case"com.amazonaws.cloudfront#FunctionInUse":throw await fM1(X,Y);case"NoSuchFunctionExists":case"com.amazonaws.cloudfront#NoSuchFunctionExists":throw await qg1(X,Y);case"NoSuchResource":case"com.amazonaws.cloudfront#NoSuchResource":throw await Eg1(X,Y);case"ResourceInUse":case"com.amazonaws.cloudfront#ResourceInUse":throw await Mg1(X,Y);case"NoSuchMonitoringSubscription":case"com.amazonaws.cloudfront#NoSuchMonitoringSubscription":throw await Sg1(X,Y);case"NoSuchOriginAccessControl":case"com.amazonaws.cloudfront#NoSuchOriginAccessControl":throw await Rg1(X,Y);case"OriginAccessControlInUse":case"com.amazonaws.cloudfront#OriginAccessControlInUse":throw await fg1(X,Y);case"OriginRequestPolicyInUse":case"com.amazonaws.cloudfront#OriginRequestPolicyInUse":throw await Cg1(X,Y);case"PublicKeyInUse":case"com.amazonaws.cloudfront#PublicKeyInUse":throw await Dg1(X,Y);case"RealtimeLogConfigInUse":case"com.amazonaws.cloudfront#RealtimeLogConfigInUse":throw await vg1(X,Y);case"ResponseHeadersPolicyInUse":case"com.amazonaws.cloudfront#ResponseHeadersPolicyInUse":throw await yg1(X,Y);case"NoSuchStreamingDistribution":case"com.amazonaws.cloudfront#NoSuchStreamingDistribution":throw await Og1(X,Y);case"StreamingDistributionNotDisabled":case"com.amazonaws.cloudfront#StreamingDistributionNotDisabled":throw await cg1(X,Y);case"NoSuchInvalidation":case"com.amazonaws.cloudfront#NoSuchInvalidation":throw await Ag1(X,Y);case"TestFunctionFailed":case"com.amazonaws.cloudfront#TestFunctionFailed":throw await ug1(X,Y);case"CannotChangeImmutablePublicKeyFields":case"com.amazonaws.cloudfront#CannotChangeImmutablePublicKeyFields":throw await $M1(X,Y);case"CannotUpdateEntityWhileInUse":case"com.amazonaws.cloudfront#CannotUpdateEntityWhileInUse":throw await zM1(X,Y);default:let Z=X.body;return YM1({output:G,parsedBody:Z.Error,errorCode:W})}},YM1=DE(k0),XM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},WM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ZM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},JM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$M1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},UM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},KM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},HM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},VM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},QM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},FM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},AM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},SM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},NM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $I({$metadata:g0(G),...X});return L0(Z,G.body.Error)},RM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},LM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},TM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},IM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},EM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},OM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new wI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_M1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new bI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},PM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new MI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},CM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},BM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},DM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},kM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},bM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new II({$metadata:g0(G),...X});return L0(Z,G.body.Error)},MM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $T({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},mM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},uM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},lM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},pM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},iM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new FT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},aM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},rM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new AT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},dM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ST({$metadata:g0(G),...X});return L0(Z,G.body.Error)},sM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},nM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},oM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},tM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},eM1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new IT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Gg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ET({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Yg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Xg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Wg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Zg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _T({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Jg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new xI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$g1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ug1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Kg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Hg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new EI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Vg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Qg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Fg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new SE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ag1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Sg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new LE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ng1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Rg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new TE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Lg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new wT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Tg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new DI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ig1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new DT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Eg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new kT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Og1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_g1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new IE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Pg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Cg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new EE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Bg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new hT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Dg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new jE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},kg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _I({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new OE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},bg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new vT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Mg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new RE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new _E({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new SI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},mg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new $E({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ug1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new BE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},lg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},pg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new bT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ig1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new KI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ag1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new MT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},rg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new qI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},dg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new NI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},sg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new gT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ng1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new HI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},og1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},tg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},eg1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aL({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Gy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new yT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Yy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new xT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Xy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new mT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Wy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new cT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Zy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new uT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Jy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new lT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},$y1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new pT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Uy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},zy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new aT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ky1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new rT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Hy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new fI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Vy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new PI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Qy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new kI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Fy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new hI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},qy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new vI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ay1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new CI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Sy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ny1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new gI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ry1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new VI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ly1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ty1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new dI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Iy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new yI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Ey1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new mI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},jy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Oy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new oT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},_y1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new iI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},fy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Py1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new eT({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Cy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new sI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},By1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},wy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new tI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},Dy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new cI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ky1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new YI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},hy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new QI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},vy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new nI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},by1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new GE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},My1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},gy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new JE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},yy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new UE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},xy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zE({$metadata:g0(G),...X});return L0(Z,G.body.Error)},my1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new XI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},cy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new WI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},uy1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new ZI({$metadata:g0(G),...X});return L0(Z,G.body.Error)},ly1=async(G,Y)=>{let X=b0({}),W=G.body.Error;if(W[R1]!=null)X[R1]=P0(W[R1]);let Z=new zI({$metadata:g0(G),...X});return L0(Z,G.body.Error)};var py1=(G,Y)=>{let X=new TY(wE);if(G[$$]!=null)X.c(ay1(G[$$],Y).n($$));if(G[rz]!=null)X.c(TY.of(po,G[rz]).n(rz));return X};var iy1=(G,Y)=>{return G.filter((X)=>X!=null).map((X)=>{return TY.of(po,X).n(Dk)})},ay1=(G,Y)=>{let X=new TY($$);if(G[dz]!=null)X.c(TY.of(ty1,String(G[dz])).n(dz));return X.lc(G,"Items","Items",()=>iy1(G[az],Y)),X};var ry1=(G,Y)=>{let X={};if(G[Bk]!=null)X[Bk]=P0(G[Bk]);if(G[wk]!=null)X[wk]=P0(G[wk]);if(G[Ck]!=null)X[Ck]=kk(xo(G[Ck]));if(G[wE]!=null)X[wE]=dy1(G[wE],Y);return X},dy1=(G,Y)=>{let X={};if(G[$$]!=null)X[$$]=ny1(G[$$],Y);if(G[rz]!=null)X[rz]=P0(G[rz]);return X};var sy1=(G,Y)=>{return(G||[]).filter((X)=>X!=null).map((X)=>{return P0(X)})},ny1=(G,Y)=>{let X={};if(G[dz]!=null)X[dz]=yo(G[dz]);if(G.Items==="")X[az]=[];else if(G[az]!=null&&G[az][Dk]!=null)X[az]=sy1(mo(G[az][Dk]),Y);return X};var g0=(G)=>({httpStatusCode:G.statusCode,requestId:G.headers["x-amzn-requestid"]??G.headers["x-amzn-request-id"]??G.headers["x-amz-request-id"],extendedRequestId:G.headers["x-amz-id-2"],cfId:G.headers["x-amz-cf-id"]});var rz="CallerReference";var Ck="CreateTime";var az="Items";var wE="InvalidationBatch";var Bk="Id";var oy1="Location";var R1="Message";var $$="Paths";var Dk="Path";var dz="Quantity";var wk="Status";var ty1="integer";var ey1="location";var po="string",Gx1='<?xml version="1.0" encoding="UTF-8"?>';class hk extends D7.classBuilder().ep(Zo).m(function(G,Y,X,W){return[B7(X,this.serialize,this.deserialize),w7(X,G.getEndpointParameterInstructions())]}).s("Cloudfront2020_05_31","CreateInvalidation",{}).n("CloudFrontClient","CreateInvalidationCommand").f(void 0,void 0).ser(uo).de(lo).build(){}import{intro as nz,italic as JF,log as d6,outro as C6,prompts as $F,runCommand as U$,underline as io}from"@stacksjs/cli";import{addJumpBox as Yx1,deleteCdkRemnants as Xx1,deleteIamUsers as Wx1,deleteJumpBox as vk,deleteLogGroups as Zx1,deleteParameterStore as Jx1,deleteStacksBuckets as $x1,deleteStacksFunctions as Ux1,deleteSubnets as zx1,deleteVpcs as Kx1,getCloudFrontDistributionId as Hx1,getJumpBoxInstanceId as Vx1}from"@stacksjs/cloud";import{path as z$}from"@stacksjs/path";import{ExitCode as K6}from"@stacksjs/types";import{loop as Qx1}from"@stacksjs/utils";function BZ4(G){let Y={cloud:"Interact with the Stacks Cloud",ssh:"SSH into the Stacks Cloud",add:"Add a resource to the Stacks Cloud",remove:"Remove the Stacks Cloud. In case it fails, try again",optimizeCost:"Remove certain resources that may be re-applied at a later time",cleanUp:"Remove all resources that were retained during the cloud deletion",invalidateCache:"Invalidate the CloudFront cache",diff:"Show the diff of the current, undeployed cloud changes ",paths:"The paths to invalidate",project:"Target a specific project",verbose:"Enable verbose output"};G.command("cloud",Y.cloud).option("--ssh",Y.ssh,{default:!1}).option("--connect",Y.ssh,{default:!1}).option("--invalidate-cache",Y.invalidateCache,{default:!1}).option("--paths [paths]",Y.paths).option("--diff",Y.diff,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud` ...",X);let W=performance.now();if(X.ssh||X.connect){let Z=await Vx1(),U=await U$(`aws ssm start-session --target ${Z}`,{...X,cwd:z$.projectPath(),stdin:"pipe"});if(U.isErr())await C6("While running the cloud command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}if(X.invalidateCache){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to invalidate the CDN (CloudFront) cache?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);d6.info("Invalidating the CloudFront cache...");let U=new fk,J={DistributionId:await Hx1(),InvalidationBatch:{CallerReference:`${Date.now()}`,Paths:{Quantity:1,Items:["/*"]}}},H=new hk(J);U.send(H).then(($)=>console.log($),($)=>console.log($,$.stack)),await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}if(X.diff){let Z=await U$("bunx --bun cdk diff",{cwd:z$.frameworkCloudPath(),stdin:"pipe"});if(Z.isErr())await C6("While running the cloud diff command, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await C6("Showing diff of the current, undeployed cloud changes",{startTime:W,useSeconds:!0}),console.log(Z.value),J6.exit(K6.Success)}d6.info("Not implemented yet. Read more about `buddy cloud` here: https://stacksjs.org/docs/cloud"),J6.exit(K6.Success)}),G.command("cloud:add",Y.add).option("--jump-box","Remove the jump-box",{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:add` ...",X);let W=await nz("buddy cloud:add");if(X.jumpBox){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to add a jump-box to your cloud?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);d6.info("The jump-box is getting added to your cloud resources..."),d6.info("This takes a few moments, please be patient."),await new Promise((K)=>setTimeout(K,2000));let U=await Yx1();if(U.isErr())await C6("While running the cloud:add command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);d6.info(JF("View the jump-box in the AWS console:")),d6.info(io("https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#Instances:instanceState=running")),d6.info(JF("Once it finished initializing, you may SSH into it:")),d6.info(io("buddy cloud --ssh")),await C6("Your jump-box was added.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}d6.info("This functionality is not yet implemented."),J6.exit(K6.Success)}),G.command("cloud:remove",Y.remove).alias("cloud:destroy").alias("cloud:rm").alias("undeploy").option("--jump-box","Remove the jump-box",{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:remove` ...",X);let W=await nz("buddy cloud:remove");if(X.jumpBox){let{confirm:U}=await $F({name:"confirm",type:"confirm",message:"Would you like to remove your jump-box for now?"});if(!U)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);let K=await vk();if(K.isErr())await C6("While removing your jump-box, there was an issue",{startTime:W,useSeconds:!0},K.error),J6.exit(K6.FatalError);await C6("Your jump-box was removed.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}console.log(` ${JF("\u2139\uFE0F Removing your cloud resources takes a while to complete.")}`),console.log(` ${JF("Please note, your backups will not yet be deleted. Though,")}`),console.log(` ${JF("Backups are scheduled to delete themselves in 30 days.")}`),await new Promise((U)=>setTimeout(U,2000));let Z=await U$("bunx --bun cdk destroy",{...X,cwd:z$.frameworkCloudPath(),stdin:"inherit"});if(Z.isErr())await C6('While running the cloud:remove ("undeploy") command, there was an issue',{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await U$("buddy cloud:cleanup",{...X,cwd:z$.projectPath(),stdin:"inherit"});try{d6.info("Finalizing the removal of your cloud resources."),d6.info("This will take a few moments..."),await Qx1(7,async()=>{await U$("buddy cloud:cleanup",{...X,cwd:z$.projectPath(),stdout:"ignore"})}),await C6("Your cloud has been removed",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}catch(U){await C6("While cleaning up the cloud, there was an issue",{startTime:W,useSeconds:!0},U),J6.exit(K6.FatalError)}}),G.command("cloud:optimize-cost",Y.optimizeCost).option("--jump-box","Remove the jump-box",{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:optimize-cost` ...",X);let W=await nz("buddy cloud:optimize-cost");if(X.jumpBox){let{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to remove your jump-box to optimize your costs?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);await vk(),await C6("Your jump-box was removed & cost optimizations are applied.",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}await C6("No cost optimization was applied",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}),G.command("cloud:cleanup",Y.cleanUp).alias("cloud:clean-up").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:cleanup` ...",X);let W=await nz("buddy cloud:cleanup");d6.info("Cleaning up your cloud resources will take a while to complete. Please be patient."),await new Promise((V)=>setTimeout(V,2000)),d6.info("Removing any jump-boxes...");let Z=await vk();if(Z.isErr()){if(Z.error!=="Jump-box not found")await C6("While removing your jump-box, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError)}d6.info("Removing any retained S3 buckets...");let U=await $x1();if(U.isErr())await C6("While deleting the retained S3 buckets, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);d6.info("Removing any retained Lambda functions...");let K=await Ux1();if(K.isErr()){if(K.error!=="No stacks functions found")await C6("While deleting the Origin Request Lambda function, there was an issue",{startTime:W,useSeconds:!0},K.error);J6.exit(K6.FatalError)}d6.info(K.value),d6.info("Removing any remaining Stacks logs...");let J=await Zx1();if(J.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},J.error),J6.exit(K6.FatalError);d6.info("Removing any stored parameters...");let H=await Jx1();if(H.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},H.error),J6.exit(K6.FatalError);let $=await Kx1();if($.isErr())await C6("While deleting the VPCs, there was an issue",{startTime:W,useSeconds:!0},$.error),J6.exit(K6.FatalError);let Q=await zx1();if(Q.isErr())await C6("While deleting the Subnets, there was an issue",{startTime:W,useSeconds:!0},Q.error),J6.exit(K6.FatalError);d6.info("Removing any CDK remnants...");let F=await Xx1();if(F.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},F.error),J6.exit(K6.FatalError);d6.info("Removing any IAM users...");let z=await Wx1();if(z.isErr())await C6("While deleting the Stacks log groups, there was an issue",{startTime:W,useSeconds:!0},z.error),J6.exit(K6.FatalError);await C6("AWS resources have been removed",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}),G.command("cloud:invalidate-cache",Y.invalidateCache).option("--paths [paths]",Y.paths,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:invalidate-cache` ...",X);let W=await nz("buddy cloud:invalidate-cache"),{confirm:Z}=await $F({name:"confirm",type:"confirm",message:"Would you like to invalidate the CloudFront cache?"});if(!Z)await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success);if(d6.info("Invalidating the CloudFront cache..."),X.paths){let U=await U$(`aws cloudfront create-invalidation --distribution-id E1U4Z2E9NJW9J --paths ${X.paths}`,{...X,cwd:z$.projectPath(),stdin:"pipe"});if(U.isErr())await C6("While running the cloud command, there was an issue",{startTime:W,useSeconds:!0},U.error),J6.exit(K6.FatalError);await C6("Exited",{startTime:W,useSeconds:!0}),J6.exit(K6.Success)}d6.info("Not implemented yet. Read more about `buddy cloud` here: https://stacksjs.org/docs/cloud"),J6.exit(K6.Success)}),G.command("cloud:diff",Y.diff).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{d6.debug("Running `buddy cloud:diff` ...",X);let W=await nz("buddy cloud:diff"),Z=await U$("bunx --bun cdk diff",{cwd:z$.frameworkCloudPath(),stdin:"pipe"});if(Z.isErr())await C6("While running the cloud diff command, there was an issue",{startTime:W,useSeconds:!0},Z.error),J6.exit(K6.FatalError);await C6("Showing diff of the current, undeployed cloud changes",{startTime:W,useSeconds:!0}),console.log(Z.value),J6.exit(K6.Success)}),G.on("cloud:*",()=>{console.error(`Invalid command: %s
3219
3219
  See --help for a list of available commands.`,G.args.join(" ")),J6.exit(1)})}import Fx1 from"node:process";import{runCommit as qx1}from"@stacksjs/actions";import{log as Ax1}from"@stacksjs/logging";function vZ4(G){let Y={commit:"Commit your stashed changes",project:"Target a specific project",verbose:"Enable verbose output"};G.command("commit",Y.commit).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{Ax1.debug("Running `buddy commit` ...",X),await qx1(X)}),G.on("commit:*",()=>{console.error(`Invalid command: %s
3220
3220
  See --help for a list of available commands.`,G.args.join(" ")),Fx1.exit(1)})}import BX from"node:process";import{log as bk,outro as ao,runCommand as Sx1}from"@stacksjs/cli";import{path as Nx1}from"@stacksjs/path";import{ExitCode as UF}from"@stacksjs/types";function mZ4(G){let Y={configure:"Configure options",aws:"Configure the AWS connection",project:"Target a specific project",profile:"The AWS profile to use",verbose:"Enable verbose output"};G.command("configure",Y.configure).option("--aws",Y.aws,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{if(bk.debug("Running `buddy configure` ...",X),X?.aws)await ro(X),BX.exit(UF.Success);bk.info("Not implemented yet. Please use the --aws flag to configure AWS."),BX.exit(UF.Success)}),G.command("configure:aws",Y.aws).option("-p, --project [project]",Y.project,{default:!1}).option("--profile",Y.profile,{default:BX.env.AWS_PROFILE}).option("--verbose",Y.verbose,{default:!1}).option("--access-key-id","The AWS access key").option("--secret-access-key","The AWS secret access key").option("--region","The AWS region").option("--output","The AWS output format").option("--quiet","Suppress output").action(async(X)=>{bk.debug("Running `buddy configure:aws` ...",X),await ro(X),BX.exit(UF.Success)}),G.on("configure:*",()=>{console.error(`Invalid command: %s
3221
3221
  See --help for a list of available commands.`,G.args.join(" ")),BX.exit(UF.FatalError)})}async function ro(G){let Y=performance.now(),X=G?.accessKeyId??BX.env.AWS_ACCESS_KEY_ID,W=G?.secretAccessKey??BX.env.AWS_SECRET_ACCESS_KEY,Z="us-east-1",U=G?.output??"json",K=BX.env.AWS_PROFILE??G?.profile,J=K?`aws configure --profile ${K}`:"aws configure",H=`${X}
@@ -3226,7 +3226,7 @@ ${U}
3226
3226
  See --help for a list of available commands.`,G.args.join(" ")),wX.exit(1)})}function Px1(G){if(_x1(G))d2.error(`Path ${G} already exists`),wX.exit(oz.FatalError)}function Cx1(){if(!fx1())d2.info("It appears you are disconnected from the internet."),d2.info("The Stacks setup requires a brief internet connection for setup."),d2.info("For instance, it installs your dependencies from."),wX.exit(oz.FatalError)}async function Bx1(G,Y,X){d2.info("Setting up your stack.");let W=await zF(`bunx --bun giget stacks ${G}`,X);return d2.success(`Successfully scaffolded your project at ${Tx1(Y)}`),W}async function wx1(G,Y){d2.info("Ensuring your environment is ready..."),await zF("pkgx --update ",{...Y,cwd:G}),d2.success("Environment is ready")}async function Dx1(G,Y){d2.info("Installing & setting up Stacks");let X=await zF("bun install",{...Y,cwd:G});if(X?.isErr())d2.error(X.error),wX.exit();if(X=await zF("cp .env.example .env",{...Y,cwd:G}),X?.isErr())d2.error(X.error),wX.exit(oz.FatalError);if(await Rx1(jx1.KeyGenerate,{...Y,cwd:G}),X=await zF("git init",{...Y,cwd:G}),X.isErr())d2.error(X.error),wX.exit(oz.FatalError);d2.success("Installed & set-up \uD83D\uDE80")}var{$:so}=globalThis.Bun;import DX from"node:process";import{runAction as kx1}from"@stacksjs/actions";import{intro as hx1,italic as KF,log as j6,outro as kE,prompts as vx1,runCommand as no}from"@stacksjs/cli";import{app as bx1}from"@stacksjs/config";import{addDomain as Mx1,hasUserDomainBeenAddedToCloud as gx1}from"@stacksjs/dns";import{Action as yx1}from"@stacksjs/enums";import{path as xx1}from"@stacksjs/path";import{ExitCode as XZ}from"@stacksjs/types";function UJ4(G){let Y={deploy:"Deploy your project",project:"Target a specific project",production:"Deploy to production",development:"Deploy to development",staging:"Deploy to staging",yes:"Confirm all prompts by default",domain:"Specify a domain to deploy to",verbose:"Enable verbose output"};G.command("deploy [env]",Y.deploy).option("--domain",Y.domain,{default:void 0}).option("-p, --project [project]",Y.project,{default:!1}).option("--prod",Y.production,{default:!0}).option("--dev",Y.development,{default:!1}).option("--yes",Y.yes,{default:!1}).option("--staging",Y.staging,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X,W)=>{j6.debug("Running `buddy deploy` ...",W);let Z=await hx1("buddy deploy"),U=W.domain||bx1.url;if((W.prod||X==="production"||X==="prod")&&!W.yes)await mx1();if(!U)j6.info("No domain found in your .env or ./config/app.ts"),j6.info("Please ensure your domain is properly configured."),j6.info("For more info, check out the docs or join our Discord."),DX.exit(XZ.FatalError);j6.info(`Deploying to ${KF(U)}`),await ux1(),await lx1(),W.domain=await cx1(U,W,Z);let K=await kx1(yx1.Deploy,W);if(K.isErr())await kE("While running the `buddy deploy`, there was an issue",{startTime:Z,useSeconds:!0},K.error),DX.exit(XZ.FatalError);await kE("Project deployed.",{startTime:Z,useSeconds:!0})}),G.on("deploy:*",()=>{j6.error(`Invalid command: %s
3227
3227
  See --help for a list of available commands.`,G.args.join(" ")),DX.exit(1)})}async function mx1(){let{confirmed:G}=await vx1({type:"confirm",name:"confirmed",message:"Are you sure you want to deploy to production?"});if(!G)j6.info("Aborting deployment..."),DX.exit(XZ.InvalidArgument)}async function cx1(G,Y,X){if(j6.debug("Configuring domain...",G),!G)j6.info("We could not identify a domain to deploy to."),j6.warn("Please set your .env or ./config/app.ts properly."),j6.info("Alternatively, specify a domain to deploy via the `--domain` flag."),console.log(""),j6.info(" \u27A1\uFE0F Example: `buddy deploy --domain example.com`"),console.log(""),DX.exit(XZ.FatalError);if(G.includes("localhost"))j6.info("You are deploying to a local environment."),j6.warn("Please set your .env or ./config/app.ts properly. The domain we are deploying cannot be a `localhost` domain."),j6.info("Alternatively, specify a domain to deploy via the `--domain` flag."),console.log(""),j6.info(" \u27A1\uFE0F Example: `buddy deploy --domain example.com`"),console.log(""),DX.exit(XZ.FatalError);if(await gx1(G))return j6.info("Domain is properly configured"),j6.info("Your cloud is deploying..."),j6.info(`${KF("This may take a while...")}`),G;console.log(""),j6.info(` \uD83D\uDC4B It appears to be your first ${KF(G)} deployment.`),console.log(""),j6.info(KF("Let\u2019s ensure it is all connected properly.")),j6.info(KF("One moment...")),console.log("");let W=await Mx1({...Y,deploy:!0,startTime:X});if(W.isErr())await kE("While running the `buddy deploy`, there was an issue",{startTime:X,useSeconds:!0},W.error),DX.exit(XZ.FatalError);await kE("Added your domain.",{startTime:X,useSeconds:!0}),DX.exit(XZ.Success)}async function ux1(){if(j6.info("Ensuring AWS is configured..."),(await no("buddy configure:aws",{silent:!0})).isErr())j6.error("AWS is not configured properly.",{shouldExit:!1}),j6.error("Please run `buddy configure:aws` to set up your AWS credentials.");j6.success("AWS is configured")}async function lx1(){try{return j6.info("Ensuring AWS is bootstrapped..."),await no("aws cloudformation describe-stacks --stack-name stacks-toolkit",{silent:!0}),j6.success("AWS is bootstrapped"),!0}catch(G){j6.debug(`Not yet bootstrapped. Failed with code ${G.exitCode}`),j6.debug(G.stdout.toString()),j6.debug(G.stderr.toString()),j6.info("AWS is not bootstrapped yet"),j6.info("Bootstrapping. This may take a few moments...");try{so.cwd(xx1.frameworkCloudPath());let Y=await so`bun run bootstrap`;return console.log(Y),!0}catch(Y){j6.error("Failed to bootstrap AWS"),console.error(Y),DX.exit(XZ.FatalError)}}}import IY from"node:process";import{runAction as xk,runApiDevServer as hE,runComponentsDevServer as Mk,runDashboardDevServer as gk,runDesktopDevServer as px1,runDocsDevServer as yk,runFrontendDevServer as oo,runSystemTrayDevServer as to}from"@stacksjs/actions";import{intro as vE,log as kG,outro as K$,prompts as ix1,runCommand as ax1}from"@stacksjs/cli";import{Action as mk}from"@stacksjs/enums";import{libsPath as rx1}from"@stacksjs/path";import{ExitCode as tz}from"@stacksjs/types";function AJ4(G){let Y={dev:"Start development server",frontend:"Start the frontend development server",components:"Start the Components development server",desktop:"Start the Desktop App development server",dashboard:"Start the Dashboard development server",api:"Start the local API development server",email:"Start the Email development server",docs:"Start the Documentation development server",systemTray:"Start the System Tray development server",interactive:"Get asked which development server to start",select:"Which development server are you trying to start?",withLocalhost:"Include the localhost URL in the output",project:"Target a specific project",verbose:"Enable verbose output"};G.command("dev [server]",Y.dev).option("-f, --frontend",Y.frontend).option("-a, --api",Y.api).option("-e, --email",Y.email).option("-c, --components",Y.components).option("-d, --dashboard",Y.dashboard).option("-t, --desktop",Y.desktop).option("-d, --docs",Y.docs).option("-t, --system-tray",Y.systemTray).option("-i, --interactive",Y.interactive,{default:!1}).option("-l, --with-localhost",Y.withLocalhost,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X,W)=>{kG.debug("Running `buddy dev [server]` ...",W);let Z=await vE("buddy dev");switch(X){case"frontend":await oo(W);break;case"api":await hE(W);break;case"components":await Mk(W);break;case"dashboard":await gk(W);break;case"desktop":await px1(W);break;case"system-tray":await to(W);break;case"docs":await yk(W);break;default:}if(sx1(W)){let K=(await ix1({type:"select",name:"value",message:Y.select,choices:[{value:"all",title:"All"},{value:"frontend",title:"Frontend"},{value:"api",title:"Backend"},{value:"dashboard",title:"Dashboard"},{value:"desktop",title:"Desktop"},{value:"email",title:"Email"},{value:"components",title:"Components"},{value:"docs",title:"Documentation"}]})).value;if(K==="components")await Mk(W);else if(K==="api")await hE(W);else if(K==="dashboard")await gk(W);else if(K==="docs")await yk(W);else kG.error("Invalid option during interactive mode"),IY.exit(tz.InvalidArgument)}else{if(W.components)await Mk(W);if(W.docs)await yk(W);else if(W.api)await hE(W)}await dx1(W),K$("Exited",{startTime:Z,useSeconds:!0}),IY.exit(tz.Success)}),G.command("dev:components",Y.components).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:components` ...",X);let W=await vE("buddy dev:components"),Z=await ax1("bun run dev",{cwd:rx1("components/vue")});if(X.verbose)kG.info("buddy dev:components result",Z);if(Z.isErr())await K$("While running the dev:components command, there was an issue",{startTime:W,useSeconds:!0},Z.error),IY.exit();console.log(""),await K$("Exited",{startTime:W,useSeconds:!0}),IY.exit(tz.Success)}),G.command("dev:docs",Y.docs).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:docs` ...",X);let W=await vE("buddy dev:docs"),Z=await xk(mk.DevDocs,X);if(Z.isErr())await K$("While running the dev:docs command, there was an issue",{startTime:W,useSeconds:!0},Z.error),IY.exit();console.log(""),await K$("Exited",{startTime:W,useSeconds:!0}),IY.exit(tz.Success)}),G.command("dev:desktop",Y.desktop).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:desktop` ...",X);let W=await vE("buddy dev:desktop"),Z=await xk(mk.DevDesktop,X);if(Z.isErr())await K$("While running the dev:desktop command, there was an issue",{startTime:W,useSeconds:!0},Z.error),IY.exit();console.log(""),await K$("Exited",{startTime:W,useSeconds:!0}),IY.exit(tz.Success)}),G.command("dev:api",Y.api).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:api` ...",X),await hE(X)}),G.command("dev:frontend",Y.frontend).alias("dev:pages").alias("dev:views").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:frontend` ...",X),await oo(X)}),G.command("dev:dashboard",Y.dashboard).alias("dev:admin").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:dashboard` ...",X),await gk(X)}),G.command("dev:system-tray",Y.systemTray).alias("dev:tray").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{kG.debug("Running `buddy dev:system-tray` ...",X),await to(X)}),G.on("dev:*",()=>{console.error(`Invalid command: %s
3228
3228
  See --help for a list of available commands.`,G.args.join(" ")),IY.exit(1)})}async function dx1(G){let Y=await xk(mk.Dev,G);if(Y.isErr())kG.error("While running the dev command, there was an issue",Y.error),IY.exit(tz.InvalidArgument)}function sx1(G){return G.interactive}import eo from"node:process";import{log as nx1,runCommand as ox1}from"@stacksjs/cli";import{config as tx1}from"@stacksjs/config";import{ExitCode as ex1}from"@stacksjs/types";function IJ4(G){let Y={dns:"Lists the DNS records for a domain",query:"Host name or IP address to query",type:"Type of the DNS record being queried (A, MX, NS\u2026)",nameserver:"Address of the nameserver to send packets to",class:"Network class of the DNS record being queried (IN, CH, HS)",udp:"Use the DNS protocol over UDP",tcp:"Use the DNS protocol over TCP",tls:"Use the DNS-over-TLS protocol",https:"Use the DNS-over-HTTPS protocol",short:"Short mode: display nothing but the first result",json:"Display the output as JSON",pretty:"Display the output as JSON in a pretty format",project:"Target a specific project",verbose:"Enable verbose output"};G.command("dns [domain]",Y.dns).option("-q, --query <query>",Y.query).option("-t, --type <type>",Y.type,{default:"ANY"}).option("-n, --nameserver <nameserver>",Y.nameserver).option("--class <class>",Y.nameserver).option("-U, --udp",Y.udp).option("-T, --tcp",Y.tcp).option("-S, --tls",Y.tls).option("-H, --https",Y.https).option("-1, --short",Y.short,{default:!1}).option("-J, --json",Y.json,{default:!1}).option("-p, --pretty",Y.pretty,{default:!0}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X,W)=>{nx1.debug("Running `buddy dns [domain]` ...",W),W.pretty=void 0,W.p=void 0;let Z=Object.entries(W).filter(([U,K])=>U!=="--"&&U.length>1&&K!==!1).map(([U,K])=>`--${U} ${K}`).join(" ");await ox1(`dog ${X||tx1.app.url} ${Z}`),eo.exit(ex1.Success)}),G.on("dns:*",()=>{console.error(`Invalid command: %s
3229
- See --help for a list of available commands.`,G.args.join(" ")),eo.exit(1)})}import kX from"node:process";import{runAction as Gt}from"@stacksjs/actions";import{bgCyan as Gm1,bold as Ym1,intro as ck,italic as H$,log as bE,outro as WZ,prompts as Yt}from"@stacksjs/cli";import{config as Xt}from"@stacksjs/config";import{addDomain as Xm1}from"@stacksjs/dns";import{Action as Wt}from"@stacksjs/enums";import{ExitCode as ZZ}from"@stacksjs/types";function wJ4(G){let Y={purchase:"Purchase a domain",add:"Add a domain to your cloud",remove:"Remove a domain from your cloud",skip:"Skip the confirmation prompt",project:"Target a specific project",verbose:"Enable verbose output"},X=Xt.dns.contactInfo;G.command("domains:purchase <domain>",Y.purchase).option("--years <years>","Number of years to purchase the domain for",{default:1}).option("--privacy","Enable privacy protection",{default:!0}).option("--auto-renew","Enable auto-renew",{default:!0}).option("--first-name <firstName>","Registrant first name",{default:X?.firstName}).option("--last-name <lastName>","Registrant last name",{default:X?.lastName}).option("--organization <organization>","Registrant organization name",{default:X?.organizationName}).option("--address-line1 <address>","Registrant address line 1",{default:X?.addressLine1}).option("--address-line2 <address>","Registrant address line 2",{default:X?.addressLine2}).option("--city <city>","Registrant city",{default:X?.city}).option("--state <state>","Registrant state",{default:X?.state}).option("--country <country>","Registrant country code",{default:X?.countryCode}).option("--zip <zip>","Registrant zip",{default:X?.zip}).option("--phone <phone>","Registrant phone",{default:X?.phoneNumber}).option("--email <email>","Registrant email",{default:X?.email}).option("--admin-first-name <firstName>","Admin first name",{default:X?.admin?.firstName||X?.firstName}).option("--admin-last-name <lastName>","Admin last name",{default:X?.admin?.lastName||X?.lastName}).option("--admin-organization <organization>","Admin organization",{default:X?.admin?.organizationName||X?.organizationName}).option("--admin-address-line1 <address>","Admin address line 1",{default:X?.admin?.addressLine1||X?.addressLine1}).option("--admin-address-line2 <address>","Admin address line 2",{default:X?.admin?.addressLine2||X?.addressLine2}).option("--admin-city <city>","Admin city",{default:X?.admin?.city||X?.city}).option("--admin-state <state>","Admin state",{default:X?.admin?.state||X?.state}).option("--admin-country <country>","Admin country code",{default:X?.admin?.countryCode||X?.countryCode}).option("--admin-zip <zip>","Admin zip",{default:X?.admin?.zip||X?.zip}).option("--admin-phone <phone>","Admin phone number",{default:X?.admin?.phoneNumber||X?.phoneNumber}).option("--admin-email <email>","Admin email",{default:X?.admin?.email||X?.email}).option("--tech-first-name <firstName>","Tech first name",{default:X?.tech?.firstName||X?.firstName}).option("--tech-last-name <lastName>","Tech last name",{default:X?.tech?.lastName||X?.lastName}).option("--tech-organization <organization>","Tech organization name",{default:X?.tech?.organizationName||X?.organizationName}).option("--tech-address-line1 <address>","Tech address line 1",{default:X?.tech?.addressLine1||X?.addressLine1}).option("--tech-address-line2 <address>","Tech address line 2",{default:X?.tech?.addressLine2||X?.addressLine2}).option("--tech-city <city>","Tech city",{default:X?.tech?.city||X?.city}).option("--tech-state <state>","Tech state",{default:X?.tech?.state||X?.state}).option("--tech-country <country>","Tech country",{default:X?.tech?.countryCode||X?.countryCode}).option("--tech-zip <zip>","Tech zip",{default:X?.tech?.zip||X?.zip}).option("--tech-phone <phone>","Tech phone",{default:X?.tech?.phoneNumber||X?.phoneNumber}).option("--tech-email <email>","Tech email",{default:X?.tech?.email||X?.email}).option("--privacy-admin","Enable privacy protection for admin",{default:X?.privacyAdmin||X?.privacy||!0}).option("--privacy-tech","Enable privacy protection for tech",{default:X?.privacyTech||X?.privacy||!0}).option("--privacy-registrant","Enable privacy protection for registrant",{default:X?.privacyRegistrant||X?.privacy||!0}).option("--contact-type <type>","Contact type",{default:"person"}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(W,Z)=>{bE.debug("Running `buddy domains:purchase <domain>` ...",Z),Z.domain=W;let U=await ck("buddy domains:purchase"),K=await Gt(Wt.DomainsPurchase,Z);if(K.isErr())await WZ("While running the domains:purchase command, there was an issue",{startTime:U,useSeconds:!0},K.error),kX.exit(ZZ.FatalError);let{confirm:J}=await Yt({name:"confirm",type:"confirm",message:`Would you like to set ${W} as your APP_URL?`});if(!J)await WZ(`Alrighty! ${H$(W)} was added to your account.`,{startTime:U,useSeconds:!0,type:"success"}),bE.info(`Please note, you may need to validate your email address. Check your ${H$(Z.registrantEmail)} inbox.`),kX.exit(ZZ.Success);let{writeEnv:H}=await import("./chunk-enzd7k3d.js");H("APP_URL",W);let $=`Great! ${H$(W)} was added to your account.`;$+=`
3229
+ See --help for a list of available commands.`,G.args.join(" ")),eo.exit(1)})}import kX from"node:process";import{runAction as Gt}from"@stacksjs/actions";import{bgCyan as Gm1,bold as Ym1,intro as ck,italic as H$,log as bE,outro as WZ,prompts as Yt}from"@stacksjs/cli";import{config as Xt}from"@stacksjs/config";import{addDomain as Xm1}from"@stacksjs/dns";import{Action as Wt}from"@stacksjs/enums";import{ExitCode as ZZ}from"@stacksjs/types";function wJ4(G){let Y={purchase:"Purchase a domain",add:"Add a domain to your cloud",remove:"Remove a domain from your cloud",skip:"Skip the confirmation prompt",project:"Target a specific project",verbose:"Enable verbose output"},X=Xt.dns.contactInfo;G.command("domains:purchase <domain>",Y.purchase).option("--years <years>","Number of years to purchase the domain for",{default:1}).option("--privacy","Enable privacy protection",{default:!0}).option("--auto-renew","Enable auto-renew",{default:!0}).option("--first-name <firstName>","Registrant first name",{default:X?.firstName}).option("--last-name <lastName>","Registrant last name",{default:X?.lastName}).option("--organization <organization>","Registrant organization name",{default:X?.organizationName}).option("--address-line1 <address>","Registrant address line 1",{default:X?.addressLine1}).option("--address-line2 <address>","Registrant address line 2",{default:X?.addressLine2}).option("--city <city>","Registrant city",{default:X?.city}).option("--state <state>","Registrant state",{default:X?.state}).option("--country <country>","Registrant country code",{default:X?.countryCode}).option("--zip <zip>","Registrant zip",{default:X?.zip}).option("--phone <phone>","Registrant phone",{default:X?.phoneNumber}).option("--email <email>","Registrant email",{default:X?.email}).option("--admin-first-name <firstName>","Admin first name",{default:X?.admin?.firstName||X?.firstName}).option("--admin-last-name <lastName>","Admin last name",{default:X?.admin?.lastName||X?.lastName}).option("--admin-organization <organization>","Admin organization",{default:X?.admin?.organizationName||X?.organizationName}).option("--admin-address-line1 <address>","Admin address line 1",{default:X?.admin?.addressLine1||X?.addressLine1}).option("--admin-address-line2 <address>","Admin address line 2",{default:X?.admin?.addressLine2||X?.addressLine2}).option("--admin-city <city>","Admin city",{default:X?.admin?.city||X?.city}).option("--admin-state <state>","Admin state",{default:X?.admin?.state||X?.state}).option("--admin-country <country>","Admin country code",{default:X?.admin?.countryCode||X?.countryCode}).option("--admin-zip <zip>","Admin zip",{default:X?.admin?.zip||X?.zip}).option("--admin-phone <phone>","Admin phone number",{default:X?.admin?.phoneNumber||X?.phoneNumber}).option("--admin-email <email>","Admin email",{default:X?.admin?.email||X?.email}).option("--tech-first-name <firstName>","Tech first name",{default:X?.tech?.firstName||X?.firstName}).option("--tech-last-name <lastName>","Tech last name",{default:X?.tech?.lastName||X?.lastName}).option("--tech-organization <organization>","Tech organization name",{default:X?.tech?.organizationName||X?.organizationName}).option("--tech-address-line1 <address>","Tech address line 1",{default:X?.tech?.addressLine1||X?.addressLine1}).option("--tech-address-line2 <address>","Tech address line 2",{default:X?.tech?.addressLine2||X?.addressLine2}).option("--tech-city <city>","Tech city",{default:X?.tech?.city||X?.city}).option("--tech-state <state>","Tech state",{default:X?.tech?.state||X?.state}).option("--tech-country <country>","Tech country",{default:X?.tech?.countryCode||X?.countryCode}).option("--tech-zip <zip>","Tech zip",{default:X?.tech?.zip||X?.zip}).option("--tech-phone <phone>","Tech phone",{default:X?.tech?.phoneNumber||X?.phoneNumber}).option("--tech-email <email>","Tech email",{default:X?.tech?.email||X?.email}).option("--privacy-admin","Enable privacy protection for admin",{default:X?.privacyAdmin||X?.privacy||!0}).option("--privacy-tech","Enable privacy protection for tech",{default:X?.privacyTech||X?.privacy||!0}).option("--privacy-registrant","Enable privacy protection for registrant",{default:X?.privacyRegistrant||X?.privacy||!0}).option("--contact-type <type>","Contact type",{default:"person"}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(W,Z)=>{bE.debug("Running `buddy domains:purchase <domain>` ...",Z),Z.domain=W;let U=await ck("buddy domains:purchase"),K=await Gt(Wt.DomainsPurchase,Z);if(K.isErr())await WZ("While running the domains:purchase command, there was an issue",{startTime:U,useSeconds:!0},K.error),kX.exit(ZZ.FatalError);let{confirm:J}=await Yt({name:"confirm",type:"confirm",message:`Would you like to set ${W} as your APP_URL?`});if(!J)await WZ(`Alrighty! ${H$(W)} was added to your account.`,{startTime:U,useSeconds:!0,type:"success"}),bE.info(`Please note, you may need to validate your email address. Check your ${H$(Z.registrantEmail)} inbox.`),kX.exit(ZZ.Success);let{writeEnv:H}=await import("./chunk-rcdezkfx.js");H("APP_URL",W);let $=`Great! ${H$(W)} was added to your account.`;$+=`
3230
3230
 
3231
3231
  And your APP_URL has been set to ${H$(W)}.
3232
3232
 
@@ -3768,7 +3768,7 @@ ${g1.toString(16)}\r
3768
3768
  `,this.newLine=`
3769
3769
  `;else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function W(H,$,Q){let F=this.j2x(H,Q+1);if(H[this.options.textNodeName]!==void 0&&Object.keys(H).length===1)return this.buildTextValNode(H[this.options.textNodeName],$,F.attrStr,Q);else return this.buildObjectNode(F.val,$,F.attrStr,Q)}function Z(H){return this.options.indentBy.repeat(H)}function U(H){if(H.startsWith(this.options.attributeNamePrefix))return H.substr(this.attrPrefixLen);else return!1}var K=uo0(),J={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(H,$){return $},attributeValueProcessor:function(H,$){return $},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};X.prototype.build=function(H){if(this.options.preserveOrder)return K(H,this.options);else{if(Array.isArray(H)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)H={[this.options.arrayNodeName]:H};return this.j2x(H,0).val}},X.prototype.j2x=function(H,$){let Q="",F="";for(let z in H)if(typeof H[z]==="undefined");else if(H[z]===null)if(z[0]==="?")F+=this.indentate($)+"<"+z+"?"+this.tagEndChar;else F+=this.indentate($)+"<"+z+"/"+this.tagEndChar;else if(H[z]instanceof Date)F+=this.buildTextValNode(H[z],z,"",$);else if(typeof H[z]!=="object"){let V=this.isAttribute(z);if(V)Q+=this.buildAttrPairStr(V,""+H[z]);else if(z===this.options.textNodeName){let q=this.options.tagValueProcessor(z,""+H[z]);F+=this.replaceEntitiesValue(q)}else F+=this.buildTextValNode(H[z],z,"",$)}else if(Array.isArray(H[z])){let V=H[z].length,q="";for(let S=0;S<V;S++){let N=H[z][S];if(typeof N==="undefined");else if(N===null)if(z[0]==="?")F+=this.indentate($)+"<"+z+"?"+this.tagEndChar;else F+=this.indentate($)+"<"+z+"/"+this.tagEndChar;else if(typeof N==="object")if(this.options.oneListGroup)q+=this.j2x(N,$+1).val;else q+=this.processTextOrObjNode(N,z,$);else q+=this.buildTextValNode(N,z,"",$)}if(this.options.oneListGroup)q=this.buildObjectNode(q,z,"",$);F+=q}else if(this.options.attributesGroupName&&z===this.options.attributesGroupName){let V=Object.keys(H[z]),q=V.length;for(let S=0;S<q;S++)Q+=this.buildAttrPairStr(V[S],""+H[z][V[S]])}else F+=this.processTextOrObjNode(H[z],z,$);return{attrStr:Q,val:F}},X.prototype.buildAttrPairStr=function(H,$){if($=this.options.attributeValueProcessor(H,""+$),$=this.replaceEntitiesValue($),this.options.suppressBooleanAttributes&&$==="true")return" "+H;else return" "+H+'="'+$+'"'},X.prototype.buildObjectNode=function(H,$,Q,F){if(H==="")if($[0]==="?")return this.indentate(F)+"<"+$+Q+"?"+this.tagEndChar;else return this.indentate(F)+"<"+$+Q+this.closeTag($)+this.tagEndChar;else{let z="</"+$+this.tagEndChar,V="";if($[0]==="?")V="?",z="";if(Q&&H.indexOf("<")===-1)return this.indentate(F)+"<"+$+Q+V+">"+H+z;else if(this.options.commentPropName!==!1&&$===this.options.commentPropName&&V.length===0)return this.indentate(F)+`<!--${H}-->`+this.newLine;else return this.indentate(F)+"<"+$+Q+V+this.tagEndChar+H+this.indentate(F)+z}},X.prototype.closeTag=function(H){let $="";if(this.options.unpairedTags.indexOf(H)!==-1){if(!this.options.suppressUnpairedNode)$="/"}else if(this.options.suppressEmptyNode)$="/";else $=`></${H}`;return $},X.prototype.buildTextValNode=function(H,$,Q,F){if(this.options.cdataPropName!==!1&&$===this.options.cdataPropName)return this.indentate(F)+`<![CDATA[${H}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&$===this.options.commentPropName)return this.indentate(F)+`<!--${H}-->`+this.newLine;else if($[0]==="?")return this.indentate(F)+"<"+$+Q+"?"+this.tagEndChar;else{let z=this.options.tagValueProcessor($,H);if(z=this.replaceEntitiesValue(z),z==="")return this.indentate(F)+"<"+$+Q+this.closeTag($)+this.tagEndChar;else return this.indentate(F)+"<"+$+Q+">"+z+"</"+$+this.tagEndChar}},X.prototype.replaceEntitiesValue=function(H){if(H&&H.length>0&&this.options.processEntities)for(let $=0;$<this.options.entities.length;$++){let Q=this.options.entities[$];H=H.replace(Q.regex,Q.val)}return H},Y.exports=X}),po0=B8((G,Y)=>{var X=lV1(),W=co0(),Z=lo0();Y.exports={XMLParser:W,XMLValidator:X,XMLBuilder:Z}}),io0,ao0=O0(()=>{K9(),io0=oY(po0(),1)}),ro0=O0(()=>{Bo0(),vo0(),ao0()}),do0=O0(()=>{qo0(),Co0(),ro0()});ZS();var so0=oY(ez1(),1);function Wt0(G,Y){if(G==="__proto__"||G==="constructor"&&Y&&typeof Y==="object"&&"prototype"in Y){Zt0(G);return}return Y}function Zt0(G){console.warn(`[destr] Dropping "${G}" key to prevent prototype pollution.`)}function Jt0(G,Y={}){if(typeof G!=="string")return G;let X=G.trim();if(G[0]==='"'&&G.endsWith('"')&&!G.includes("\\"))return X.slice(1,-1);if(X.length<=9){let W=X.toLowerCase();if(W==="true")return!0;if(W==="false")return!1;if(W==="undefined")return;if(W==="null")return null;if(W==="nan")return Number.NaN;if(W==="infinity")return Number.POSITIVE_INFINITY;if(W==="-infinity")return Number.NEGATIVE_INFINITY}if(!zt0.test(G)){if(Y.strict)throw new SyntaxError("[destr] Invalid JSON");return G}try{if($t0.test(G)||Ut0.test(G)){if(Y.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(G,Wt0)}return JSON.parse(G)}catch(W){if(Y.strict)throw W;return G}}var $t0=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ut0=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,zt0=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;MP();function pV1(G){return G&&G.constructor&&typeof G.constructor.isBuffer==="function"&&G.constructor.isBuffer(G)}function iV1(G){return G}function Kt0(G,Y){Y=Y||{};let X=Y.delimiter||".",W=Y.maxDepth,Z=Y.transformKey||iV1,U={};function K(J,H,$){$=$||1,Object.keys(J).forEach(function(Q){let F=J[Q],z=Y.safe&&Array.isArray(F),V=Object.prototype.toString.call(F),q=pV1(F),S=V==="[object Object]"||V==="[object Array]",N=H?H+X+Z(Q):Z(Q);if(!z&&!q&&S&&Object.keys(F).length&&(!Y.maxDepth||$<W))return K(F,N,$+1);U[N]=F})}return K(G),U}function aV1(G,Y){Y=Y||{};let X=Y.delimiter||".",W=Y.overwrite||!1,Z=Y.transformKey||iV1,U={};if(pV1(G)||Object.prototype.toString.call(G)!=="[object Object]")return G;function J(Q){let F=Number(Q);return isNaN(F)||Q.indexOf(".")!==-1||Y.object?Q:F}function H(Q,F,z){return Object.keys(z).reduce(function(V,q){return V[Q+X+q]=z[q],V},F)}function $(Q){let F=Object.prototype.toString.call(Q),z=F==="[object Array]",V=F==="[object Object]";if(!Q)return!0;else if(z)return!Q.length;else if(V)return!Object.keys(Q).length}return G=Object.keys(G).reduce(function(Q,F){let z=Object.prototype.toString.call(G[F]);if(!(z==="[object Object]"||z==="[object Array]")||$(G[F]))return Q[F]=G[F],Q;else return H(F,Q,Kt0(G[F],Y))},{}),Object.keys(G).forEach(function(Q){let F=Q.split(X).map(Z),z=J(F.shift()),V=J(F[0]),q=U;while(V!==void 0){if(z==="__proto__")return;let S=Object.prototype.toString.call(q[z]),N=S==="[object Object]"||S==="[object Array]";if(!W&&!N&&typeof q[z]!=="undefined")return;if(W&&!N||!W&&q[z]==null)q[z]=typeof V==="number"&&!Y.object?[]:{};if(q=q[z],F.length>0)z=J(F.shift()),V=J(F[0])}q[z]=aV1(G[Q],Y)}),U}function rV1(G){if(typeof G==="string")G={name:G};return{...At0,...G}}function Ht0(G,Y={}){let X={},W=G.split(qt0);for(let Z of W){let U=Z.match(Ft0);if(!U)continue;let K=U[1];if(!K||K==="__proto__"||K==="constructor")continue;let J=Jt0((U[2]||"").trim());if(K.endsWith("[]")){let H=K.slice(0,Math.max(0,K.length-2));X[H]=(X[H]||[]).concat(J);continue}X[K]=J}return Y.flat?X:aV1(X,{overwrite:!0})}function Vt0(G,Y){if(!Gt0(G))return{};return Ht0(Yt0(G,"utf8"),Y)}function hm(G){return G=rV1(G),Vt0(Xt0(G.dir,G.name),G)}function Qt0(G){return G=rV1(G),G.dir="/home/runner/.config",hm(G)}var Ft0=/^\s*([^\s=]+)\s*=\s*(.*)?\s*$/,qt0=/\n|\r|\r\n/,At0={name:".conf",dir:process.cwd(),flat:!1};MP();function St0(G,Y){if(Y)Y={...mU1,...Y};else Y=mU1;let X=dV1(Y);return X.dispatch(G),X.toString()}function dV1(G){let Y="",X=new Map,W=(Z)=>{Y+=Z};return{toString(){return Y},getContext(){return X},dispatch(Z){if(G.replacer)Z=G.replacer(Z);return this[Z===null?"null":typeof Z](Z)},object(Z){if(Z&&typeof Z.toJSON==="function")return this.object(Z.toJSON());let U=Object.prototype.toString.call(Z),K="",J=U.length;if(J<10)K="unknown:["+U+"]";else K=U.slice(8,J-1);K=K.toLowerCase();let H=null;if((H=X.get(Z))===void 0)X.set(Z,X.size);else return this.dispatch("[CIRCULAR:"+H+"]");if(typeof Buffer!=="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(Z))return W("buffer:"),W(Z.toString("utf8"));if(K!=="object"&&K!=="function"&&K!=="asyncfunction"){if(this[K])this[K](Z);else if(!G.ignoreUnknown)this.unkown(Z,K)}else{let $=Object.keys(Z);if(G.unorderedObjects)$=$.sort();let Q=[];if(G.respectType!==!1&&!xU1(Z))Q=Lt0;if(G.excludeKeys)$=$.filter((z)=>{return!G.excludeKeys(z)}),Q=Q.filter((z)=>{return!G.excludeKeys(z)});W("object:"+($.length+Q.length)+":");let F=(z)=>{if(this.dispatch(z),W(":"),!G.excludeValues)this.dispatch(Z[z]);W(",")};for(let z of $)F(z);for(let z of Q)F(z)}},array(Z,U){if(U=U===void 0?G.unorderedArrays!==!1:U,W("array:"+Z.length+":"),!U||Z.length<=1){for(let H of Z)this.dispatch(H);return}let K=new Map,J=Z.map((H)=>{let $=dV1(G);$.dispatch(H);for(let[Q,F]of $.getContext())K.set(Q,F);return $.toString()});return X=K,J.sort(),this.array(J,!1)},date(Z){return W("date:"+Z.toJSON())},symbol(Z){return W("symbol:"+Z.toString())},unkown(Z,U){if(W(U),!Z)return;if(W(":"),Z&&typeof Z.entries==="function")return this.array(Array.from(Z.entries()),!0)},error(Z){return W("error:"+Z.toString())},boolean(Z){return W("bool:"+Z)},string(Z){W("string:"+Z.length+":"),W(Z)},function(Z){if(W("fn:"),xU1(Z))this.dispatch("[native]");else this.dispatch(Z.toString());if(G.respectFunctionNames!==!1)this.dispatch("function-name:"+String(Z.name));if(G.respectFunctionProperties)this.object(Z)},number(Z){return W("number:"+Z)},xml(Z){return W("xml:"+Z.toString())},null(){return W("Null")},undefined(){return W("Undefined")},regexp(Z){return W("regex:"+Z.toString())},uint8array(Z){return W("uint8array:"),this.dispatch(Array.prototype.slice.call(Z))},uint8clampedarray(Z){return W("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(Z))},int8array(Z){return W("int8array:"),this.dispatch(Array.prototype.slice.call(Z))},uint16array(Z){return W("uint16array:"),this.dispatch(Array.prototype.slice.call(Z))},int16array(Z){return W("int16array:"),this.dispatch(Array.prototype.slice.call(Z))},uint32array(Z){return W("uint32array:"),this.dispatch(Array.prototype.slice.call(Z))},int32array(Z){return W("int32array:"),this.dispatch(Array.prototype.slice.call(Z))},float32array(Z){return W("float32array:"),this.dispatch(Array.prototype.slice.call(Z))},float64array(Z){return W("float64array:"),this.dispatch(Array.prototype.slice.call(Z))},arraybuffer(Z){return W("arraybuffer:"),this.dispatch(new Uint8Array(Z))},url(Z){return W("url:"+Z.toString())},map(Z){W("map:");let U=[...Z];return this.array(U,G.unorderedSets!==!1)},set(Z){W("set:");let U=[...Z];return this.array(U,G.unorderedSets!==!1)},file(Z){return W("file:"),this.dispatch([Z.name,Z.size,Z.type,Z.lastModfied])},blob(){if(G.ignoreUnknown)return W("[blob]");throw new Error(`Hashing Blob objects is currently not supported
3770
3770
  Use "options.replacer" or "options.ignoreUnknown"
3771
- `)},domwindow(){return W("domwindow")},bigint(Z){return W("bigint:"+Z.toString())},process(){return W("process")},timer(){return W("timer")},pipe(){return W("pipe")},tcp(){return W("tcp")},udp(){return W("udp")},tty(){return W("tty")},statwatcher(){return W("statwatcher")},securecontext(){return W("securecontext")},connection(){return W("connection")},zlib(){return W("zlib")},context(){return W("context")},nodescript(){return W("nodescript")},httpparser(){return W("httpparser")},dataview(){return W("dataview")},signal(){return W("signal")},fsevent(){return W("fsevent")},tlswrap(){return W("tlswrap")}}}function xU1(G){if(typeof G!=="function")return!1;return Function.prototype.toString.call(G).slice(-Tt0)===sV1}function Nt0(G){return new tV1().finalize(G).toString(Et0)}function Rt0(G,Y={}){let X=typeof G==="string"?G:St0(G,Y);return Nt0(X).slice(0,10)}var mU1=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0}),Lt0=Object.freeze(["prototype","__proto__","constructor"]),sV1="[native code] }",Tt0=sV1.length;class HJ{constructor(G,Y){G=this.words=G||[],this.sigBytes=Y===void 0?G.length*4:Y}toString(G){return(G||It0).stringify(this)}concat(G){if(this.clamp(),this.sigBytes%4)for(let Y=0;Y<G.sigBytes;Y++){let X=G.words[Y>>>2]>>>24-Y%4*8&255;this.words[this.sigBytes+Y>>>2]|=X<<24-(this.sigBytes+Y)%4*8}else for(let Y=0;Y<G.sigBytes;Y+=4)this.words[this.sigBytes+Y>>>2]=G.words[Y>>>2];return this.sigBytes+=G.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new HJ([...this.words])}}var It0={stringify(G){let Y=[];for(let X=0;X<G.sigBytes;X++){let W=G.words[X>>>2]>>>24-X%4*8&255;Y.push((W>>>4).toString(16),(W&15).toString(16))}return Y.join("")}},Et0={stringify(G){let X=[];for(let W=0;W<G.sigBytes;W+=3){let Z=G.words[W>>>2]>>>24-W%4*8&255,U=G.words[W+1>>>2]>>>24-(W+1)%4*8&255,K=G.words[W+2>>>2]>>>24-(W+2)%4*8&255,J=Z<<16|U<<8|K;for(let H=0;H<4&&W*8+H*6<G.sigBytes*8;H++)X.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(J>>>6*(3-H)&63))}return X.join("")}},jt0={parse(G){let Y=G.length,X=[];for(let W=0;W<Y;W++)X[W>>>2]|=(G.charCodeAt(W)&255)<<24-W%4*8;return new HJ(X,Y)}},Ot0={parse(G){return jt0.parse(unescape(encodeURIComponent(G)))}};class nV1{constructor(){this._data=new HJ,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=16}reset(){this._data=new HJ,this._nDataBytes=0}_append(G){if(typeof G==="string")G=Ot0.parse(G);this._data.concat(G),this._nDataBytes+=G.sigBytes}_doProcessBlock(G,Y){}_process(G){let Y,X=this._data.sigBytes/(this.blockSize*4);if(G)X=Math.ceil(X);else X=Math.max((X|0)-this._minBufferSize,0);let W=X*this.blockSize,Z=Math.min(W*4,this._data.sigBytes);if(W){for(let U=0;U<W;U+=this.blockSize)this._doProcessBlock(this._data.words,U);Y=this._data.words.splice(0,W),this._data.sigBytes-=Z}return new HJ(Y,Z)}}class oV1 extends nV1{update(G){return this._append(G),this._process(),this}finalize(G){if(G)this._append(G)}}var cU1=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],_t0=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],GU=[];class tV1 extends oV1{constructor(){super(...arguments);this._hash=new HJ([...cU1])}reset(){super.reset(),this._hash=new HJ([...cU1])}_doProcessBlock(G,Y){let X=this._hash.words,W=X[0],Z=X[1],U=X[2],K=X[3],J=X[4],H=X[5],$=X[6],Q=X[7];for(let F=0;F<64;F++){if(F<16)GU[F]=G[Y+F]|0;else{let j=GU[F-15],_=(j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3,E=GU[F-2],B=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;GU[F]=_+GU[F-7]+B+GU[F-16]}let z=J&H^~J&$,V=W&Z^W&U^Z&U,q=(W<<30|W>>>2)^(W<<19|W>>>13)^(W<<10|W>>>22),S=(J<<26|J>>>6)^(J<<21|J>>>11)^(J<<7|J>>>25),N=Q+S+z+_t0[F]+GU[F],R=q+V;Q=$,$=H,H=J,J=K+N|0,K=U,U=Z,Z=W,W=N+R|0}X[0]=X[0]+W|0,X[1]=X[1]+Z|0,X[2]=X[2]+U|0,X[3]=X[3]+K|0,X[4]=X[4]+J|0,X[5]=X[5]+H|0,X[6]=X[6]+$|0,X[7]=X[7]+Q|0}finalize(G){super.finalize(G);let Y=this._nDataBytes*8,X=this._data.sigBytes*8;return this._data.words[X>>>5]|=128<<24-X%32,this._data.words[(X+64>>>9<<4)+14]=Math.floor(Y/4294967296),this._data.words[(X+64>>>9<<4)+15]=Y,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}el0();var ft0=oY(yK1(),1);async function Pt0(G){let Y=G.env??process.env,X=await Ct0({cwd:G.cwd,fileName:G.fileName??".env",env:Y,interpolate:G.interpolate??!0});for(let W in X)if(!W.startsWith("_")&&Y[W]===void 0)Y[W]=X[W];return X}async function Ct0(G){let Y=Object.create(null),X=y9(G.cwd,G.fileName);if(XP(X)){let W=ft0.parse(await no0.readFile(X,"utf8"));Object.assign(Y,W)}if(!G.env?._applied)Object.assign(Y,G.env),Y._applied=!0;if(G.interpolate)Bt0(Y);return Y}function Bt0(G,Y={},X=(W)=>W){function W(U){return Y[U]===void 0?G[U]:Y[U]}function Z(U,K=[]){if(typeof U!=="string")return U;let J=U.match(/(.?\${?(?:[\w:]+)?}?)/g)||[];return X(J.reduce((H,$)=>{let Q=/(.?)\${?([\w:]+)?}?/g.exec($)||[],F=Q[1],z,V;if(F==="\\")V=Q[0]||"",z=V.replace(String.raw`\$`,"$");else{let q=Q[2];if(V=(Q[0]||"").slice(F.length),K.includes(q))return console.warn(`Please avoid recursive environment variables ( loop: ${K.join(" > ")} > ${q} )`),"";z=W(q),z=Z(z,[...K,q])}return z===void 0?H:H.replace(V,z)},U))}for(let U in G)G[U]=Z(W(U))}async function wt0(G){if(G.cwd=y9(process.cwd(),G.cwd||"."),G.name=G.name||"config",G.envName=G.envName??"development",G.configFile=G.configFile??(G.name==="config"?"config":`${G.name}.config`),G.rcFile=G.rcFile??`.${G.name}rc`,G.extend!==!1)G.extend={extendKey:"extends",...G.extend};let Y=G.merger||lA;G.jiti=G.jiti||so0.default(void 0,{interopDefault:!0,requireCache:!1,esmResolve:!0,extensions:[...Dt0],...G.jitiOptions});let X={config:{},cwd:G.cwd,configFile:y9(G.cwd,G.configFile),layers:[]},W={overrides:G.overrides,main:void 0,rc:void 0,packageJson:void 0,defaultConfig:G.defaultConfig};if(G.dotenv)await Pt0({cwd:G.cwd,...G.dotenv===!0?{}:G.dotenv});let Z=await GQ1(".",G);if(Z.configFile)W.main=Z.config,X.configFile=Z.configFile;if(G.rcFile){let J=[];if(J.push(hm({name:G.rcFile,dir:G.cwd})),G.globalRc){let H=await tl0(G.cwd).catch(()=>{});if(H)J.push(hm({name:G.rcFile,dir:H}));J.push(Qt0({name:G.rcFile,dir:G.cwd}))}W.rc=Y({},...J)}if(G.packageJson){let J=(Array.isArray(G.packageJson)?G.packageJson:[typeof G.packageJson==="string"?G.packageJson:G.name]).filter((Q)=>Q&&typeof Q==="string"),H=await sl0(G.cwd).catch(()=>{}),$=J.map((Q)=>H?.[Q]);W.packageJson=Y({},...$)}let U={};for(let J in W){let H=W[J];U[J]=await(typeof H==="function"?H({configs:U}):H)}if(X.config=Y(U.overrides,U.main,U.rc,U.packageJson,U.defaultConfig),G.extend)await eV1(X.config,G),X.layers=X.config._layers,delete X.config._layers,X.config=Y(X.config,...X.layers.map((J)=>J.config));let K=[U.overrides&&{config:U.overrides,configFile:void 0,cwd:void 0},{config:U.main,configFile:G.configFile,cwd:G.cwd},U.rc&&{config:U.rc,configFile:G.rcFile},U.packageJson&&{config:U.packageJson,configFile:"package.json"}].filter((J)=>J&&J.config);if(X.layers=[...K,...X.layers],G.defaults)X.config=Y(X.config,G.defaults);if(G.omit$Keys){for(let J in X.config)if(J.startsWith("$"))delete X.config[J]}return X}async function eV1(G,Y){if(G._layers=G._layers||[],!Y.extend)return;let X=Y.extend.extendKey;if(typeof X==="string")X=[X];let W=[];for(let Z of X)W.push(...(Array.isArray(G[Z])?G[Z]:[G[Z]]).filter(Boolean)),delete G[Z];for(let Z of W){let U=Z,K={};if(Z.source)K=Z.options||{},Z=Z.source;if(Array.isArray(Z))K=Z[1]||{},Z=Z[0];if(typeof Z!=="string"){console.warn(`Cannot extend config from \`${JSON.stringify(U)}\` in ${Y.cwd}`);continue}let J=await GQ1(Z,Y,K);if(!J.config){console.warn(`Cannot extend config from \`${Z}\` in ${Y.cwd}`);continue}if(await eV1(J.config,{...Y,cwd:J.cwd}),G._layers.push(J),J.config._layers)G._layers.push(...J.config._layers),delete J.config._layers}}async function GQ1(G,Y,X={}){if(Y.resolve){let Q=await Y.resolve(G,Y);if(Q)return Q}let W=Y.merger||lA;if(kt0.some((Q)=>G.startsWith(Q))){let{downloadTemplate:Q}=await Promise.resolve().then(()=>(Hr0(),iH1)),F=G.replace(/\W+/g,"_").split("_").splice(0,3).join("_")+"_"+Rt0(G),z,V=y9(Y.cwd,"node_modules"),q=uA(Y.cwd);if(Um(q)===".c12")z=cA(q,F);else if(XP(V))z=cA(V,".c12",F);else z=process.env.XDG_CACHE_HOME?y9(process.env.XDG_CACHE_HOME,"c12",F):y9(eo0(),".cache/c12",F);if(XP(z)&&!X.install)await oo0(z,{recursive:!0});G=(await Q(G,{dir:z,install:X.install,force:X.install,auth:X.auth,...Y.giget,...X.giget})).dir}let Z=(Q)=>{try{return Y.jiti.resolve(Q,{paths:[Y.cwd]})}catch{}};if(ht0.test(G))G=Z(G)||G;let U=S$1(G),K=!U||U===Um(G),J=y9(Y.cwd,K?G:uA(G));if(K)G=Y.configFile;let H={config:void 0,configFile:void 0,cwd:J,source:G,sourceOptions:X};if(H.configFile=Z(y9(J,G))||Z(y9(J,".config",G.replace(/\.config$/,"")))||Z(y9(J,".config",G))||G,!XP(H.configFile))return H;let $=S$1(H.configFile)||"";if($ in lU1){let Q=await lU1[$](),F=await to0(H.configFile,"utf8");H.config=Q(F)}else H.config=Y.jiti(H.configFile);if(H.config instanceof Function)H.config=await H.config();if(Y.envName){let Q={...H.config["$"+Y.envName],...H.config.$env?.[Y.envName]};if(Object.keys(Q).length>0)H.config=W(Q,H.config)}if(H.meta=lA(H.sourceOptions.meta,H.config.$meta),delete H.config.$meta,H.sourceOptions.overrides)H.config=W(H.sourceOptions.overrides,H.config);return H.configFile=uU1(H.configFile),H.source=uU1(H.source),H}var uU1=(G)=>G?.replace(/\\/g,"/"),lU1={".yaml":()=>import("./chunk-w410kf33.js").then((G)=>G.parseYAML),".yml":()=>import("./chunk-w410kf33.js").then((G)=>G.parseYAML),".jsonc":()=>import("./chunk-tnexd1vh.js").then((G)=>G.parseJSONC),".json5":()=>import("./chunk-tb4wat6y.js").then((G)=>G.parseJSON5),".toml":()=>import("./chunk-y9we573f.js").then((G)=>G.parseTOML)},Dt0=[".js",".ts",".mjs",".cjs",".mts",".cts",".json",".jsonc",".json5",".yaml",".yml",".toml"],kt0=["gh:","github:","gitlab:","bitbucket:","https://","http://"],ht0=/^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/,nu4=oY(ez1(),1);MP();var ou4=oY(yK1(),1);async function vt0(){let{config:G}=await wt0({name:"dynamodb",defaultConfig:{port:8000,dbPath:"",detached:!1,additionalArgs:["-sharedDb"],javaOpts:"",installPath:"dynamodb-local",downloadUrl:"https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz"}});return G}var tu4=await vt0(),bt0=oY(Sr0(),1),pU1=typeof process==="object"&&process?process:{stdout:null,stderr:null},yt0=(G)=>!!G&&typeof G==="object"&&(G instanceof gc||G instanceof YQ1||xt0(G)||mt0(G)),xt0=(G)=>!!G&&typeof G==="object"&&G instanceof bc&&typeof G.pipe==="function"&&G.pipe!==YQ1.Writable.prototype.pipe,mt0=(G)=>!!G&&typeof G==="object"&&G instanceof bc&&typeof G.write==="function"&&typeof G.end==="function",JW=Symbol("EOF"),$W=Symbol("maybeEmitEnd"),dZ=Symbol("emittedEnd"),Uf=Symbol("emittingEnd"),dq=Symbol("emittedError"),zf=Symbol("closed"),iU1=Symbol("read"),Kf=Symbol("flush"),aU1=Symbol("flushChunk"),sG=Symbol("encoding"),PH=Symbol("decoder"),Z5=Symbol("flowing"),sq=Symbol("paused"),mH=Symbol("resume"),J5=Symbol("buffer"),z7=Symbol("pipes"),$5=Symbol("bufferLength"),zx=Symbol("bufferPush"),Hf=Symbol("bufferShift"),u5=Symbol("objectMode"),F2=Symbol("destroyed"),Kx=Symbol("error"),Hx=Symbol("emitData"),rU1=Symbol("emitEnd"),Vx=Symbol("emitEnd2"),lY=Symbol("async"),Qx=Symbol("abort"),Vf=Symbol("aborted"),nq=Symbol("signal"),YU=Symbol("dataListeners"),j3=Symbol("discarded"),oq=(G)=>Promise.resolve().then(G),ct0=(G)=>G(),ut0=(G)=>G==="end"||G==="finish"||G==="prefinish",lt0=(G)=>G instanceof ArrayBuffer||!!G&&typeof G==="object"&&G.constructor&&G.constructor.name==="ArrayBuffer"&&G.byteLength>=0,pt0=(G)=>!Buffer.isBuffer(G)&&ArrayBuffer.isView(G);class Mc{src;dest;opts;ondrain;constructor(G,Y,X){this.src=G,this.dest=Y,this.opts=X,this.ondrain=()=>G[mH](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(G){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class XQ1 extends Mc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(G,Y,X){super(G,Y,X);this.proxyErrors=(W)=>Y.emit("error",W),G.on("error",this.proxyErrors)}}var it0=(G)=>!!G.objectMode,at0=(G)=>!G.objectMode&&!!G.encoding&&G.encoding!=="buffer";class gc extends bc{[Z5]=!1;[sq]=!1;[z7]=[];[J5]=[];[u5];[sG];[lY];[PH];[JW]=!1;[dZ]=!1;[Uf]=!1;[zf]=!1;[dq]=null;[$5]=0;[F2]=!1;[nq];[Vf]=!1;[YU]=0;[j3]=!1;writable=!0;readable=!0;constructor(...G){let Y=G[0]||{};super();if(Y.objectMode&&typeof Y.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(it0(Y))this[u5]=!0,this[sG]=null;else if(at0(Y))this[sG]=Y.encoding,this[u5]=!1;else this[u5]=!1,this[sG]=null;if(this[lY]=!!Y.async,this[PH]=this[sG]?new gt0(this[sG]):null,Y&&Y.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[J5]});if(Y&&Y.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[z7]});let{signal:X}=Y;if(X)if(this[nq]=X,X.aborted)this[Qx]();else X.addEventListener("abort",()=>this[Qx]())}get bufferLength(){return this[$5]}get encoding(){return this[sG]}set encoding(G){throw new Error("Encoding must be set at instantiation time")}setEncoding(G){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[u5]}set objectMode(G){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[lY]}set["async"](G){this[lY]=this[lY]||!!G}[Qx](){this[Vf]=!0,this.emit("abort",this[nq]?.reason),this.destroy(this[nq]?.reason)}get aborted(){return this[Vf]}set aborted(G){}write(G,Y,X){if(this[Vf])return!1;if(this[JW])throw new Error("write after end");if(this[F2])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof Y==="function")X=Y,Y="utf8";if(!Y)Y="utf8";let W=this[lY]?oq:ct0;if(!this[u5]&&!Buffer.isBuffer(G)){if(pt0(G))G=Buffer.from(G.buffer,G.byteOffset,G.byteLength);else if(lt0(G))G=Buffer.from(G);else if(typeof G!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[u5]){if(this[Z5]&&this[$5]!==0)this[Kf](!0);if(this[Z5])this.emit("data",G);else this[zx](G);if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}if(!G.length){if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}if(typeof G==="string"&&!(Y===this[sG]&&!this[PH]?.lastNeed))G=Buffer.from(G,Y);if(Buffer.isBuffer(G)&&this[sG])G=this[PH].write(G);if(this[Z5]&&this[$5]!==0)this[Kf](!0);if(this[Z5])this.emit("data",G);else this[zx](G);if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}read(G){if(this[F2])return null;if(this[j3]=!1,this[$5]===0||G===0||G&&G>this[$5])return this[$W](),null;if(this[u5])G=null;if(this[J5].length>1&&!this[u5])this[J5]=[this[sG]?this[J5].join(""):Buffer.concat(this[J5],this[$5])];let Y=this[iU1](G||null,this[J5][0]);return this[$W](),Y}[iU1](G,Y){if(this[u5])this[Hf]();else{let X=Y;if(G===X.length||G===null)this[Hf]();else if(typeof X==="string")this[J5][0]=X.slice(G),Y=X.slice(0,G),this[$5]-=G;else this[J5][0]=X.subarray(G),Y=X.subarray(0,G),this[$5]-=G}if(this.emit("data",Y),!this[J5].length&&!this[JW])this.emit("drain");return Y}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y="utf8";if(G!==void 0)this.write(G,Y);if(X)this.once("end",X);if(this[JW]=!0,this.writable=!1,this[Z5]||!this[sq])this[$W]();return this}[mH](){if(this[F2])return;if(!this[YU]&&!this[z7].length)this[j3]=!0;if(this[sq]=!1,this[Z5]=!0,this.emit("resume"),this[J5].length)this[Kf]();else if(this[JW])this[$W]();else this.emit("drain")}resume(){return this[mH]()}pause(){this[Z5]=!1,this[sq]=!0,this[j3]=!1}get destroyed(){return this[F2]}get flowing(){return this[Z5]}get paused(){return this[sq]}[zx](G){if(this[u5])this[$5]+=1;else this[$5]+=G.length;this[J5].push(G)}[Hf](){if(this[u5])this[$5]-=1;else this[$5]-=this[J5][0].length;return this[J5].shift()}[Kf](G=!1){do;while(this[aU1](this[Hf]())&&this[J5].length);if(!G&&!this[J5].length&&!this[JW])this.emit("drain")}[aU1](G){return this.emit("data",G),this[Z5]}pipe(G,Y){if(this[F2])return G;this[j3]=!1;let X=this[dZ];if(Y=Y||{},G===pU1.stdout||G===pU1.stderr)Y.end=!1;else Y.end=Y.end!==!1;if(Y.proxyErrors=!!Y.proxyErrors,X){if(Y.end)G.end()}else if(this[z7].push(!Y.proxyErrors?new Mc(this,G,Y):new XQ1(this,G,Y)),this[lY])oq(()=>this[mH]());else this[mH]();return G}unpipe(G){let Y=this[z7].find((X)=>X.dest===G);if(Y){if(this[z7].length===1){if(this[Z5]&&this[YU]===0)this[Z5]=!1;this[z7]=[]}else this[z7].splice(this[z7].indexOf(Y),1);Y.unpipe()}}addListener(G,Y){return this.on(G,Y)}on(G,Y){let X=super.on(G,Y);if(G==="data"){if(this[j3]=!1,this[YU]++,!this[z7].length&&!this[Z5])this[mH]()}else if(G==="readable"&&this[$5]!==0)super.emit("readable");else if(ut0(G)&&this[dZ])super.emit(G),this.removeAllListeners(G);else if(G==="error"&&this[dq]){let W=Y;if(this[lY])oq(()=>W.call(this,this[dq]));else W.call(this,this[dq])}return X}removeListener(G,Y){return this.off(G,Y)}off(G,Y){let X=super.off(G,Y);if(G==="data"){if(this[YU]=this.listeners("data").length,this[YU]===0&&!this[j3]&&!this[z7].length)this[Z5]=!1}return X}removeAllListeners(G){let Y=super.removeAllListeners(G);if(G==="data"||G===void 0){if(this[YU]=0,!this[j3]&&!this[z7].length)this[Z5]=!1}return Y}get emittedEnd(){return this[dZ]}[$W](){if(!this[Uf]&&!this[dZ]&&!this[F2]&&this[J5].length===0&&this[JW]){if(this[Uf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[zf])this.emit("close");this[Uf]=!1}}emit(G,...Y){let X=Y[0];if(G!=="error"&&G!=="close"&&G!==F2&&this[F2])return!1;else if(G==="data")return!this[u5]&&!X?!1:this[lY]?(oq(()=>this[Hx](X)),!0):this[Hx](X);else if(G==="end")return this[rU1]();else if(G==="close"){if(this[zf]=!0,!this[dZ]&&!this[F2])return!1;let Z=super.emit("close");return this.removeAllListeners("close"),Z}else if(G==="error"){this[dq]=X,super.emit(Kx,X);let Z=!this[nq]||this.listeners("error").length?super.emit("error",X):!1;return this[$W](),Z}else if(G==="resume"){let Z=super.emit("resume");return this[$W](),Z}else if(G==="finish"||G==="prefinish"){let Z=super.emit(G);return this.removeAllListeners(G),Z}let W=super.emit(G,...Y);return this[$W](),W}[Hx](G){for(let X of this[z7])if(X.dest.write(G)===!1)this.pause();let Y=this[j3]?!1:super.emit("data",G);return this[$W](),Y}[rU1](){if(this[dZ])return!1;return this[dZ]=!0,this.readable=!1,this[lY]?(oq(()=>this[Vx]()),!0):this[Vx]()}[Vx](){if(this[PH]){let Y=this[PH].end();if(Y){for(let X of this[z7])X.dest.write(Y);if(!this[j3])super.emit("data",Y)}}for(let Y of this[z7])Y.end();let G=super.emit("end");return this.removeAllListeners("end"),G}async collect(){let G=Object.assign([],{dataLength:0});if(!this[u5])G.dataLength=0;let Y=this.promise();return this.on("data",(X)=>{if(G.push(X),!this[u5])G.dataLength+=X.length}),await Y,G}async concat(){if(this[u5])throw new Error("cannot concat in objectMode");let G=await this.collect();return this[sG]?G.join(""):Buffer.concat(G,G.dataLength)}async promise(){return new Promise((G,Y)=>{this.on(F2,()=>Y(new Error("stream destroyed"))),this.on("error",(X)=>Y(X)),this.on("end",()=>G())})}[Symbol.asyncIterator](){this[j3]=!1;let G=!1,Y=async()=>{return this.pause(),G=!0,{value:void 0,done:!0}};return{next:()=>{if(G)return Y();let W=this.read();if(W!==null)return Promise.resolve({done:!1,value:W});if(this[JW])return Y();let Z,U,K=(Q)=>{this.off("data",J),this.off("end",H),this.off(F2,$),Y(),U(Q)},J=(Q)=>{this.off("error",K),this.off("end",H),this.off(F2,$),this.pause(),Z({value:Q,done:!!this[JW]})},H=()=>{this.off("error",K),this.off("data",J),this.off(F2,$),Y(),Z({done:!0,value:void 0})},$=()=>K(new Error("stream destroyed"));return new Promise((Q,F)=>{U=F,Z=Q,this.once(F2,$),this.once("error",K),this.once("end",H),this.once("data",J)})},throw:Y,return:Y,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[j3]=!1;let G=!1,Y=()=>{return this.pause(),this.off(Kx,Y),this.off(F2,Y),this.off("end",Y),G=!0,{done:!0,value:void 0}},X=()=>{if(G)return Y();let W=this.read();return W===null?Y():{done:!1,value:W}};return this.once("end",Y),this.once(Kx,Y),this.once(F2,Y),{next:X,throw:Y,return:Y,[Symbol.iterator](){return this}}}destroy(G){if(this[F2]){if(G)this.emit("error",G);else this.emit(F2);return this}this[F2]=!0,this[j3]=!0,this[J5].length=0,this[$5]=0;let Y=this;if(typeof Y.close==="function"&&!this[zf])Y.close();if(G)this.emit("error",G);else this.emit(F2);return this}static get isStream(){return yt0}}var rt0=u7.writev,VJ=Symbol("_autoClose"),YY=Symbol("_close"),tq=Symbol("_ended"),p6=Symbol("_fd"),Fx=Symbol("_finished"),SW=Symbol("_flags"),qx=Symbol("_flush"),vm=Symbol("_handleChunk"),bm=Symbol("_makeBuf"),kA=Symbol("_mode"),Qf=Symbol("_needDrain"),tH=Symbol("_onerror"),ZV=Symbol("_onopen"),Ax=Symbol("_onread"),cH=Symbol("_onwrite"),QJ=Symbol("_open"),GY=Symbol("_path"),GJ=Symbol("_pos"),pY=Symbol("_queue"),uH=Symbol("_read"),Sx=Symbol("_readSize"),AW=Symbol("_reading"),eq=Symbol("_remain"),Nx=Symbol("_size"),WP=Symbol("_write"),XU=Symbol("_writing"),ZP=Symbol("_defaultFlag"),SU=Symbol("_errored");class sP extends gc{[SU]=!1;[p6];[GY];[Sx];[AW]=!1;[Nx];[eq];[VJ];constructor(G,Y){Y=Y||{};super(Y);if(this.readable=!0,this.writable=!1,typeof G!=="string")throw new TypeError("path must be a string");if(this[SU]=!1,this[p6]=typeof Y.fd==="number"?Y.fd:void 0,this[GY]=G,this[Sx]=Y.readSize||16777216,this[AW]=!1,this[Nx]=typeof Y.size==="number"?Y.size:1/0,this[eq]=this[Nx],this[VJ]=typeof Y.autoClose==="boolean"?Y.autoClose:!0,typeof this[p6]==="number")this[uH]();else this[QJ]()}get fd(){return this[p6]}get path(){return this[GY]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[QJ](){u7.open(this[GY],"r",(G,Y)=>this[ZV](G,Y))}[ZV](G,Y){if(G)this[tH](G);else this[p6]=Y,this.emit("open",Y),this[uH]()}[bm](){return Buffer.allocUnsafe(Math.min(this[Sx],this[eq]))}[uH](){if(!this[AW]){this[AW]=!0;let G=this[bm]();if(G.length===0)return process.nextTick(()=>this[Ax](null,0,G));u7.read(this[p6],G,0,G.length,null,(Y,X,W)=>this[Ax](Y,X,W))}}[Ax](G,Y,X){if(this[AW]=!1,G)this[tH](G);else if(this[vm](Y,X))this[uH]()}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.close(G,(Y)=>Y?this.emit("error",Y):this.emit("close"))}}[tH](G){this[AW]=!0,this[YY](),this.emit("error",G)}[vm](G,Y){let X=!1;if(this[eq]-=G,G>0)X=super.write(G<Y.length?Y.subarray(0,G):Y);if(G===0||this[eq]<=0)X=!1,this[YY](),super.end();return X}emit(G,...Y){switch(G){case"prefinish":case"finish":return!1;case"drain":if(typeof this[p6]==="number")this[uH]();return!1;case"error":if(this[SU])return!1;return this[SU]=!0,super.emit(G,...Y);default:return super.emit(G,...Y)}}}class WQ1 extends sP{[QJ](){let G=!0;try{this[ZV](null,u7.openSync(this[GY],"r")),G=!1}finally{if(G)this[YY]()}}[uH](){let G=!0;try{if(!this[AW]){this[AW]=!0;do{let Y=this[bm](),X=Y.length===0?0:u7.readSync(this[p6],Y,0,Y.length,null);if(!this[vm](X,Y))break}while(!0);this[AW]=!1}G=!1}finally{if(G)this[YY]()}}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.closeSync(G),this.emit("close")}}}class AS extends Mt0{readable=!1;writable=!0;[SU]=!1;[XU]=!1;[tq]=!1;[pY]=[];[Qf]=!1;[GY];[kA];[VJ];[p6];[ZP];[SW];[Fx]=!1;[GJ];constructor(G,Y){Y=Y||{};super(Y);this[GY]=G,this[p6]=typeof Y.fd==="number"?Y.fd:void 0,this[kA]=Y.mode===void 0?438:Y.mode,this[GJ]=typeof Y.start==="number"?Y.start:void 0,this[VJ]=typeof Y.autoClose==="boolean"?Y.autoClose:!0;let X=this[GJ]!==void 0?"r+":"w";if(this[ZP]=Y.flags===void 0,this[SW]=Y.flags===void 0?X:Y.flags,this[p6]===void 0)this[QJ]()}emit(G,...Y){if(G==="error"){if(this[SU])return!1;this[SU]=!0}return super.emit(G,...Y)}get fd(){return this[p6]}get path(){return this[GY]}[tH](G){this[YY](),this[XU]=!0,this.emit("error",G)}[QJ](){u7.open(this[GY],this[SW],this[kA],(G,Y)=>this[ZV](G,Y))}[ZV](G,Y){if(this[ZP]&&this[SW]==="r+"&&G&&G.code==="ENOENT")this[SW]="w",this[QJ]();else if(G)this[tH](G);else if(this[p6]=Y,this.emit("open",Y),!this[XU])this[qx]()}end(G,Y){if(G)this.write(G,Y);if(this[tq]=!0,!this[XU]&&!this[pY].length&&typeof this[p6]==="number")this[cH](null,0);return this}write(G,Y){if(typeof G==="string")G=Buffer.from(G,Y);if(this[tq])return this.emit("error",new Error("write() after end()")),!1;if(this[p6]===void 0||this[XU]||this[pY].length)return this[pY].push(G),this[Qf]=!0,!1;return this[XU]=!0,this[WP](G),!0}[WP](G){u7.write(this[p6],G,0,G.length,this[GJ],(Y,X)=>this[cH](Y,X))}[cH](G,Y){if(G)this[tH](G);else{if(this[GJ]!==void 0&&typeof Y==="number")this[GJ]+=Y;if(this[pY].length)this[qx]();else if(this[XU]=!1,this[tq]&&!this[Fx])this[Fx]=!0,this[YY](),this.emit("finish");else if(this[Qf])this[Qf]=!1,this.emit("drain")}}[qx](){if(this[pY].length===0){if(this[tq])this[cH](null,0)}else if(this[pY].length===1)this[WP](this[pY].pop());else{let G=this[pY];this[pY]=[],rt0(this[p6],G,this[GJ],(Y,X)=>this[cH](Y,X))}}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.close(G,(Y)=>Y?this.emit("error",Y):this.emit("close"))}}}class yc extends AS{[QJ](){let G;if(this[ZP]&&this[SW]==="r+")try{G=u7.openSync(this[GY],this[SW],this[kA])}catch(Y){if(Y?.code==="ENOENT")return this[SW]="w",this[QJ]();else throw Y}else G=u7.openSync(this[GY],this[SW],this[kA]);this[ZV](null,G)}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.closeSync(G),this.emit("close")}}[WP](G){let Y=!0;try{this[cH](null,u7.writeSync(this[p6],G,0,G.length,this[GJ])),Y=!1}finally{if(Y)try{this[YY]()}catch{}}}}var nt0=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),ot0=(G)=>!!G.sync&&!!G.file,tt0=(G)=>!G.sync&&!!G.file,et0=(G)=>!!G.sync&&!G.file,Ge0=(G)=>!G.sync&&!G.file,Ye0=(G)=>!!G.file,Xe0=(G)=>{let Y=nt0.get(G);if(Y)return Y;return G},xc=(G={})=>{if(!G)return{};let Y={};for(let[X,W]of Object.entries(G)){let Z=Xe0(X);Y[Z]=W}if(Y.chmod===void 0&&Y.noChmod===!1)Y.chmod=!0;return delete Y.noChmod,Y},SS=(G,Y,X,W,Z)=>{return Object.assign((U=[],K,J)=>{if(Array.isArray(U))K=U,U={};if(typeof K==="function")J=K,K=void 0;if(!K)K=[];else K=Array.from(K);let H=xc(U);if(Z?.(H,K),ot0(H)){if(typeof J==="function")throw new TypeError("callback not supported for sync tar functions");return G(H,K)}else if(tt0(H)){let $=Y(H,K),Q=J?J:void 0;return Q?$.then(()=>Q(),Q):$}else if(et0(H)){if(typeof J==="function")throw new TypeError("callback not supported for sync tar functions");return X(H,K)}else if(Ge0(H)){if(typeof J==="function")throw new TypeError("callback only supported with file option");return W(H,K)}else throw new Error("impossible options??")},{syncFile:G,asyncFile:Y,syncNoFile:X,asyncNoFile:W,validate:Z})},dU1=typeof process==="object"&&process?process:{stdout:null,stderr:null},Je0=(G)=>!!G&&typeof G==="object"&&(G instanceof uc||G instanceof JQ1||$e0(G)||Ue0(G)),$e0=(G)=>!!G&&typeof G==="object"&&G instanceof mc&&typeof G.pipe==="function"&&G.pipe!==JQ1.Writable.prototype.pipe,Ue0=(G)=>!!G&&typeof G==="object"&&G instanceof mc&&typeof G.write==="function"&&typeof G.end==="function",UW=Symbol("EOF"),zW=Symbol("maybeEmitEnd"),sZ=Symbol("emittedEnd"),Ff=Symbol("emittingEnd"),GA=Symbol("emittedError"),qf=Symbol("closed"),sU1=Symbol("read"),Af=Symbol("flush"),nU1=Symbol("flushChunk"),nG=Symbol("encoding"),CH=Symbol("decoder"),U5=Symbol("flowing"),YA=Symbol("paused"),pH=Symbol("resume"),z5=Symbol("buffer"),K7=Symbol("pipes"),K5=Symbol("bufferLength"),Rx=Symbol("bufferPush"),Sf=Symbol("bufferShift"),l5=Symbol("objectMode"),q2=Symbol("destroyed"),Lx=Symbol("error"),Tx=Symbol("emitData"),oU1=Symbol("emitEnd"),Ix=Symbol("emitEnd2"),iY=Symbol("async"),Ex=Symbol("abort"),Nf=Symbol("aborted"),XA=Symbol("signal"),WU=Symbol("dataListeners"),O3=Symbol("discarded"),WA=(G)=>Promise.resolve().then(G),ze0=(G)=>G(),Ke0=(G)=>G==="end"||G==="finish"||G==="prefinish",He0=(G)=>G instanceof ArrayBuffer||!!G&&typeof G==="object"&&G.constructor&&G.constructor.name==="ArrayBuffer"&&G.byteLength>=0,Ve0=(G)=>!Buffer.isBuffer(G)&&ArrayBuffer.isView(G);class cc{src;dest;opts;ondrain;constructor(G,Y,X){this.src=G,this.dest=Y,this.opts=X,this.ondrain=()=>G[pH](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(G){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class $Q1 extends cc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(G,Y,X){super(G,Y,X);this.proxyErrors=(W)=>Y.emit("error",W),G.on("error",this.proxyErrors)}}var Qe0=(G)=>!!G.objectMode,Fe0=(G)=>!G.objectMode&&!!G.encoding&&G.encoding!=="buffer";class uc extends mc{[U5]=!1;[YA]=!1;[K7]=[];[z5]=[];[l5];[nG];[iY];[CH];[UW]=!1;[sZ]=!1;[Ff]=!1;[qf]=!1;[GA]=null;[K5]=0;[q2]=!1;[XA];[Nf]=!1;[WU]=0;[O3]=!1;writable=!0;readable=!0;constructor(...G){let Y=G[0]||{};super();if(Y.objectMode&&typeof Y.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Qe0(Y))this[l5]=!0,this[nG]=null;else if(Fe0(Y))this[nG]=Y.encoding,this[l5]=!1;else this[l5]=!1,this[nG]=null;if(this[iY]=!!Y.async,this[CH]=this[nG]?new Ze0(this[nG]):null,Y&&Y.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[z5]});if(Y&&Y.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[K7]});let{signal:X}=Y;if(X)if(this[XA]=X,X.aborted)this[Ex]();else X.addEventListener("abort",()=>this[Ex]())}get bufferLength(){return this[K5]}get encoding(){return this[nG]}set encoding(G){throw new Error("Encoding must be set at instantiation time")}setEncoding(G){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[l5]}set objectMode(G){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[iY]}set["async"](G){this[iY]=this[iY]||!!G}[Ex](){this[Nf]=!0,this.emit("abort",this[XA]?.reason),this.destroy(this[XA]?.reason)}get aborted(){return this[Nf]}set aborted(G){}write(G,Y,X){if(this[Nf])return!1;if(this[UW])throw new Error("write after end");if(this[q2])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof Y==="function")X=Y,Y="utf8";if(!Y)Y="utf8";let W=this[iY]?WA:ze0;if(!this[l5]&&!Buffer.isBuffer(G)){if(Ve0(G))G=Buffer.from(G.buffer,G.byteOffset,G.byteLength);else if(He0(G))G=Buffer.from(G);else if(typeof G!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[l5]){if(this[U5]&&this[K5]!==0)this[Af](!0);if(this[U5])this.emit("data",G);else this[Rx](G);if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}if(!G.length){if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}if(typeof G==="string"&&!(Y===this[nG]&&!this[CH]?.lastNeed))G=Buffer.from(G,Y);if(Buffer.isBuffer(G)&&this[nG])G=this[CH].write(G);if(this[U5]&&this[K5]!==0)this[Af](!0);if(this[U5])this.emit("data",G);else this[Rx](G);if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}read(G){if(this[q2])return null;if(this[O3]=!1,this[K5]===0||G===0||G&&G>this[K5])return this[zW](),null;if(this[l5])G=null;if(this[z5].length>1&&!this[l5])this[z5]=[this[nG]?this[z5].join(""):Buffer.concat(this[z5],this[K5])];let Y=this[sU1](G||null,this[z5][0]);return this[zW](),Y}[sU1](G,Y){if(this[l5])this[Sf]();else{let X=Y;if(G===X.length||G===null)this[Sf]();else if(typeof X==="string")this[z5][0]=X.slice(G),Y=X.slice(0,G),this[K5]-=G;else this[z5][0]=X.subarray(G),Y=X.subarray(0,G),this[K5]-=G}if(this.emit("data",Y),!this[z5].length&&!this[UW])this.emit("drain");return Y}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y="utf8";if(G!==void 0)this.write(G,Y);if(X)this.once("end",X);if(this[UW]=!0,this.writable=!1,this[U5]||!this[YA])this[zW]();return this}[pH](){if(this[q2])return;if(!this[WU]&&!this[K7].length)this[O3]=!0;if(this[YA]=!1,this[U5]=!0,this.emit("resume"),this[z5].length)this[Af]();else if(this[UW])this[zW]();else this.emit("drain")}resume(){return this[pH]()}pause(){this[U5]=!1,this[YA]=!0,this[O3]=!1}get destroyed(){return this[q2]}get flowing(){return this[U5]}get paused(){return this[YA]}[Rx](G){if(this[l5])this[K5]+=1;else this[K5]+=G.length;this[z5].push(G)}[Sf](){if(this[l5])this[K5]-=1;else this[K5]-=this[z5][0].length;return this[z5].shift()}[Af](G=!1){do;while(this[nU1](this[Sf]())&&this[z5].length);if(!G&&!this[z5].length&&!this[UW])this.emit("drain")}[nU1](G){return this.emit("data",G),this[U5]}pipe(G,Y){if(this[q2])return G;this[O3]=!1;let X=this[sZ];if(Y=Y||{},G===dU1.stdout||G===dU1.stderr)Y.end=!1;else Y.end=Y.end!==!1;if(Y.proxyErrors=!!Y.proxyErrors,X){if(Y.end)G.end()}else if(this[K7].push(!Y.proxyErrors?new cc(this,G,Y):new $Q1(this,G,Y)),this[iY])WA(()=>this[pH]());else this[pH]();return G}unpipe(G){let Y=this[K7].find((X)=>X.dest===G);if(Y){if(this[K7].length===1){if(this[U5]&&this[WU]===0)this[U5]=!1;this[K7]=[]}else this[K7].splice(this[K7].indexOf(Y),1);Y.unpipe()}}addListener(G,Y){return this.on(G,Y)}on(G,Y){let X=super.on(G,Y);if(G==="data"){if(this[O3]=!1,this[WU]++,!this[K7].length&&!this[U5])this[pH]()}else if(G==="readable"&&this[K5]!==0)super.emit("readable");else if(Ke0(G)&&this[sZ])super.emit(G),this.removeAllListeners(G);else if(G==="error"&&this[GA]){let W=Y;if(this[iY])WA(()=>W.call(this,this[GA]));else W.call(this,this[GA])}return X}removeListener(G,Y){return this.off(G,Y)}off(G,Y){let X=super.off(G,Y);if(G==="data"){if(this[WU]=this.listeners("data").length,this[WU]===0&&!this[O3]&&!this[K7].length)this[U5]=!1}return X}removeAllListeners(G){let Y=super.removeAllListeners(G);if(G==="data"||G===void 0){if(this[WU]=0,!this[O3]&&!this[K7].length)this[U5]=!1}return Y}get emittedEnd(){return this[sZ]}[zW](){if(!this[Ff]&&!this[sZ]&&!this[q2]&&this[z5].length===0&&this[UW]){if(this[Ff]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[qf])this.emit("close");this[Ff]=!1}}emit(G,...Y){let X=Y[0];if(G!=="error"&&G!=="close"&&G!==q2&&this[q2])return!1;else if(G==="data")return!this[l5]&&!X?!1:this[iY]?(WA(()=>this[Tx](X)),!0):this[Tx](X);else if(G==="end")return this[oU1]();else if(G==="close"){if(this[qf]=!0,!this[sZ]&&!this[q2])return!1;let Z=super.emit("close");return this.removeAllListeners("close"),Z}else if(G==="error"){this[GA]=X,super.emit(Lx,X);let Z=!this[XA]||this.listeners("error").length?super.emit("error",X):!1;return this[zW](),Z}else if(G==="resume"){let Z=super.emit("resume");return this[zW](),Z}else if(G==="finish"||G==="prefinish"){let Z=super.emit(G);return this.removeAllListeners(G),Z}let W=super.emit(G,...Y);return this[zW](),W}[Tx](G){for(let X of this[K7])if(X.dest.write(G)===!1)this.pause();let Y=this[O3]?!1:super.emit("data",G);return this[zW](),Y}[oU1](){if(this[sZ])return!1;return this[sZ]=!0,this.readable=!1,this[iY]?(WA(()=>this[Ix]()),!0):this[Ix]()}[Ix](){if(this[CH]){let Y=this[CH].end();if(Y){for(let X of this[K7])X.dest.write(Y);if(!this[O3])super.emit("data",Y)}}for(let Y of this[K7])Y.end();let G=super.emit("end");return this.removeAllListeners("end"),G}async collect(){let G=Object.assign([],{dataLength:0});if(!this[l5])G.dataLength=0;let Y=this.promise();return this.on("data",(X)=>{if(G.push(X),!this[l5])G.dataLength+=X.length}),await Y,G}async concat(){if(this[l5])throw new Error("cannot concat in objectMode");let G=await this.collect();return this[nG]?G.join(""):Buffer.concat(G,G.dataLength)}async promise(){return new Promise((G,Y)=>{this.on(q2,()=>Y(new Error("stream destroyed"))),this.on("error",(X)=>Y(X)),this.on("end",()=>G())})}[Symbol.asyncIterator](){this[O3]=!1;let G=!1,Y=async()=>{return this.pause(),G=!0,{value:void 0,done:!0}};return{next:()=>{if(G)return Y();let W=this.read();if(W!==null)return Promise.resolve({done:!1,value:W});if(this[UW])return Y();let Z,U,K=(Q)=>{this.off("data",J),this.off("end",H),this.off(q2,$),Y(),U(Q)},J=(Q)=>{this.off("error",K),this.off("end",H),this.off(q2,$),this.pause(),Z({value:Q,done:!!this[UW]})},H=()=>{this.off("error",K),this.off("data",J),this.off(q2,$),Y(),Z({done:!0,value:void 0})},$=()=>K(new Error("stream destroyed"));return new Promise((Q,F)=>{U=F,Z=Q,this.once(q2,$),this.once("error",K),this.once("end",H),this.once("data",J)})},throw:Y,return:Y,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[O3]=!1;let G=!1,Y=()=>{return this.pause(),this.off(Lx,Y),this.off(q2,Y),this.off("end",Y),G=!0,{done:!0,value:void 0}},X=()=>{if(G)return Y();let W=this.read();return W===null?Y():{done:!1,value:W}};return this.once("end",Y),this.once(Lx,Y),this.once(q2,Y),{next:X,throw:Y,return:Y,[Symbol.iterator](){return this}}}destroy(G){if(this[q2]){if(G)this.emit("error",G);else this.emit(q2);return this}this[q2]=!0,this[O3]=!0,this[z5].length=0,this[K5]=0;let Y=this;if(typeof Y.close==="function"&&!this[qf])Y.close();if(G)this.emit("error",G);else this.emit(q2);return this}static get isStream(){return Je0}}var Se0=Ae0.constants||{ZLIB_VERNUM:4736},NU=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Se0)),tU1=YJ.concat,RU=Symbol("_superWrite");class PA extends Error{code;errno;constructor(G){super("zlib: "+G.message);if(this.code=G.code,this.errno=G.errno,!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+G.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}var jx=Symbol("flushFlag");class lc extends uc{#G=!1;#Y=!1;#X;#W;#Z;#J;#$;get sawError(){return this.#G}get handle(){return this.#J}get flushFlag(){return this.#X}constructor(G,Y){if(!G||typeof G!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(G);this.#X=G.flush??0,this.#W=G.finishFlush??0,this.#Z=G.fullFlushFlag??0;try{this.#J=new qe0[Y](G)}catch(X){throw new PA(X)}this.#$=(X)=>{if(this.#G)return;this.#G=!0,this.close(),this.emit("error",X)},this.#J?.on("error",(X)=>this.#$(new PA(X))),this.once("end",()=>this.close)}close(){if(this.#J)this.#J.close(),this.#J=void 0,this.emit("close")}reset(){if(!this.#G)return Mm(this.#J,"zlib binding closed"),this.#J.reset?.()}flush(G){if(this.ended)return;if(typeof G!=="number")G=this.#Z;this.write(Object.assign(YJ.alloc(0),{[jx]:G}))}end(G,Y,X){if(typeof G==="function")X=G,Y=void 0,G=void 0;if(typeof Y==="function")X=Y,Y=void 0;if(G)if(Y)this.write(G,Y);else this.write(G);return this.flush(this.#W),this.#Y=!0,super.end(X)}get ended(){return this.#Y}[RU](G){return super.write(G)}write(G,Y,X){if(typeof Y==="function")X=Y,Y="utf8";if(typeof G==="string")G=YJ.from(G,Y);if(this.#G)return;Mm(this.#J,"zlib binding closed");let W=this.#J._handle,Z=W.close;W.close=()=>{};let U=this.#J.close;this.#J.close=()=>{},YJ.concat=(H)=>H;let K=void 0;try{let H=typeof G[jx]==="number"?G[jx]:this.#X;K=this.#J._processChunk(G,H),YJ.concat=tU1}catch(H){YJ.concat=tU1,this.#$(new PA(H))}finally{if(this.#J)this.#J._handle=W,W.close=Z,this.#J.close=U,this.#J.removeAllListeners("error")}if(this.#J)this.#J.on("error",(H)=>this.#$(new PA(H)));let J;if(K)if(Array.isArray(K)&&K.length>0){let H=K[0];J=this[RU](YJ.from(H));for(let $=1;$<K.length;$++)J=this[RU](K[$])}else J=this[RU](YJ.from(K));if(X)X();return J}}class pc extends lc{#G;#Y;constructor(G,Y){G=G||{},G.flush=G.flush||NU.Z_NO_FLUSH,G.finishFlush=G.finishFlush||NU.Z_FINISH,G.fullFlushFlag=NU.Z_FULL_FLUSH;super(G,Y);this.#G=G.level,this.#Y=G.strategy}params(G,Y){if(this.sawError)return;if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#G!==G||this.#Y!==Y){this.flush(NU.Z_SYNC_FLUSH),Mm(this.handle,"zlib binding closed");let X=this.handle.flush;this.handle.flush=(W,Z)=>{if(typeof W==="function")Z=W,W=this.flushFlag;this.flush(W),Z?.()};try{this.handle.params(G,Y)}finally{this.handle.flush=X}if(this.handle)this.#G=G,this.#Y=Y}}}class UQ1 extends pc{#G;constructor(G){super(G,"Gzip");this.#G=G&&!!G.portable}[RU](G){if(!this.#G)return super[RU](G);return this.#G=!1,G[9]=255,super[RU](G)}}class zQ1 extends pc{constructor(G){super(G,"Unzip")}}class ic extends lc{constructor(G,Y){G=G||{},G.flush=G.flush||NU.BROTLI_OPERATION_PROCESS,G.finishFlush=G.finishFlush||NU.BROTLI_OPERATION_FINISH,G.fullFlushFlag=NU.BROTLI_OPERATION_FLUSH;super(G,Y)}}class KQ1 extends ic{constructor(G){super(G,"BrotliCompress")}}class HQ1 extends ic{constructor(G){super(G,"BrotliDecompress")}}function Ne0(G,Y,X){let W=Y,Z=Y?Y.next:G.head,U=new nP(X,W,Z,G);if(U.next===void 0)G.tail=U;if(U.prev===void 0)G.head=U;return G.length++,U}function Re0(G,Y){if(G.tail=new nP(Y,G.tail,void 0,G),!G.head)G.head=G.tail;G.length++}function Le0(G,Y){if(G.head=new nP(Y,void 0,G.head,G),!G.tail)G.tail=G.head;G.length++}class JJ{tail;head;length=0;static create(G=[]){return new JJ(G)}constructor(G=[]){for(let Y of G)this.push(Y)}*[Symbol.iterator](){for(let G=this.head;G;G=G.next)yield G.value}removeNode(G){if(G.list!==this)throw new Error("removing node which does not belong to this list");let{next:Y,prev:X}=G;if(Y)Y.prev=X;if(X)X.next=Y;if(G===this.head)this.head=Y;if(G===this.tail)this.tail=X;return this.length--,G.next=void 0,G.prev=void 0,G.list=void 0,Y}unshiftNode(G){if(G===this.head)return;if(G.list)G.list.removeNode(G);let Y=this.head;if(G.list=this,G.next=Y,Y)Y.prev=G;if(this.head=G,!this.tail)this.tail=G;this.length++}pushNode(G){if(G===this.tail)return;if(G.list)G.list.removeNode(G);let Y=this.tail;if(G.list=this,G.prev=Y,Y)Y.next=G;if(this.tail=G,!this.head)this.head=G;this.length++}push(...G){for(let Y=0,X=G.length;Y<X;Y++)Re0(this,G[Y]);return this.length}unshift(...G){for(var Y=0,X=G.length;Y<X;Y++)Le0(this,G[Y]);return this.length}pop(){if(!this.tail)return;let G=this.tail.value,Y=this.tail;if(this.tail=this.tail.prev,this.tail)this.tail.next=void 0;else this.head=void 0;return Y.list=void 0,this.length--,G}shift(){if(!this.head)return;let G=this.head.value,Y=this.head;if(this.head=this.head.next,this.head)this.head.prev=void 0;else this.tail=void 0;return Y.list=void 0,this.length--,G}forEach(G,Y){Y=Y||this;for(let X=this.head,W=0;X;W++)G.call(Y,X.value,W,this),X=X.next}forEachReverse(G,Y){Y=Y||this;for(let X=this.tail,W=this.length-1;X;W--)G.call(Y,X.value,W,this),X=X.prev}get(G){let Y=0,X=this.head;for(;!!X&&Y<G;Y++)X=X.next;if(Y===G&&!!X)return X.value}getReverse(G){let Y=0,X=this.tail;for(;!!X&&Y<G;Y++)X=X.prev;if(Y===G&&!!X)return X.value}map(G,Y){Y=Y||this;let X=new JJ;for(let W=this.head;W;)X.push(G.call(Y,W.value,this)),W=W.next;return X}mapReverse(G,Y){Y=Y||this;var X=new JJ;for(let W=this.tail;W;)X.push(G.call(Y,W.value,this)),W=W.prev;return X}reduce(G,Y){let X,W=this.head;if(arguments.length>1)X=Y;else if(this.head)W=this.head.next,X=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var Z=0;W;Z++)X=G(X,W.value,Z),W=W.next;return X}reduceReverse(G,Y){let X,W=this.tail;if(arguments.length>1)X=Y;else if(this.tail)W=this.tail.prev,X=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let Z=this.length-1;W;Z--)X=G(X,W.value,Z),W=W.prev;return X}toArray(){let G=new Array(this.length);for(let Y=0,X=this.head;X;Y++)G[Y]=X.value,X=X.next;return G}toArrayReverse(){let G=new Array(this.length);for(let Y=0,X=this.tail;X;Y++)G[Y]=X.value,X=X.prev;return G}slice(G=0,Y=this.length){if(Y<0)Y+=this.length;if(G<0)G+=this.length;let X=new JJ;if(Y<G||Y<0)return X;if(G<0)G=0;if(Y>this.length)Y=this.length;let W=this.head,Z=0;for(Z=0;!!W&&Z<G;Z++)W=W.next;for(;!!W&&Z<Y;Z++,W=W.next)X.push(W.value);return X}sliceReverse(G=0,Y=this.length){if(Y<0)Y+=this.length;if(G<0)G+=this.length;let X=new JJ;if(Y<G||Y<0)return X;if(G<0)G=0;if(Y>this.length)Y=this.length;let W=this.length,Z=this.tail;for(;!!Z&&W>Y;W--)Z=Z.prev;for(;!!Z&&W>G;W--,Z=Z.prev)X.push(Z.value);return X}splice(G,Y=0,...X){if(G>this.length)G=this.length-1;if(G<0)G=this.length+G;let W=this.head;for(let U=0;!!W&&U<G;U++)W=W.next;let Z=[];for(let U=0;!!W&&U<Y;U++)Z.push(W.value),W=this.removeNode(W);if(!W)W=this.tail;else if(W!==this.tail)W=W.prev;for(let U of X)W=Ne0(this,W,U);return Z}reverse(){let G=this.head,Y=this.tail;for(let X=G;X;X=X.prev){let W=X.prev;X.prev=X.next,X.next=W}return this.head=Y,this.tail=G,this}}class nP{list;next;prev;value;constructor(G,Y,X,W){if(this.list=W,this.value=G,Y)Y.next=this,this.prev=Y;else this.prev=void 0;if(X)X.prev=this,this.next=X;else this.next=void 0}}var Te0=(G,Y)=>{if(!Number.isSafeInteger(G))throw Error("cannot encode number outside of javascript safe integer range");else if(G<0)Ee0(G,Y);else Ie0(G,Y);return Y},Ie0=(G,Y)=>{Y[0]=128;for(var X=Y.length;X>1;X--)Y[X-1]=G&255,G=Math.floor(G/256)},Ee0=(G,Y)=>{Y[0]=255;var X=!1;G=G*-1;for(var W=Y.length;W>1;W--){var Z=G&255;if(G=Math.floor(G/256),X)Y[W-1]=VQ1(Z);else if(Z===0)Y[W-1]=0;else X=!0,Y[W-1]=QQ1(Z)}},je0=(G)=>{let Y=G[0],X=Y===128?_e0(G.subarray(1,G.length)):Y===255?Oe0(G):null;if(X===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(X))throw Error("parsed number outside of javascript safe integer range");return X},Oe0=(G)=>{var Y=G.length,X=0,W=!1;for(var Z=Y-1;Z>-1;Z--){var U=Number(G[Z]),K;if(W)K=VQ1(U);else if(U===0)K=U;else W=!0,K=QQ1(U);if(K!==0)X-=K*Math.pow(256,Y-Z-1)}return X},_e0=(G)=>{var Y=G.length,X=0;for(var W=Y-1;W>-1;W--){var Z=Number(G[W]);if(Z!==0)X+=Z*Math.pow(256,Y-W-1)}return X},VQ1=(G)=>(255^G)&255,QQ1=(G)=>(255^G)+1&255,Ox=(G)=>ac.has(G),ac=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),fe0=new Map(Array.from(ac).map((G)=>[G[1],G[0]]));class qJ{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#G="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(G,Y=0,X,W){if(Buffer.isBuffer(G))this.decode(G,Y||0,X,W);else if(G)this.#Y(G)}decode(G,Y,X,W){if(!Y)Y=0;if(!G||!(G.length>=Y+512))throw new Error("need 512 bytes for header");if(this.path=ZU(G,Y,100),this.mode=XJ(G,Y+100,8),this.uid=XJ(G,Y+108,8),this.gid=XJ(G,Y+116,8),this.size=XJ(G,Y+124,12),this.mtime=_x(G,Y+136,12),this.cksum=XJ(G,Y+148,12),W)this.#Y(W,!0);if(X)this.#Y(X);let Z=ZU(G,Y+156,1);if(Ox(Z))this.#G=Z||"0";if(this.#G==="0"&&this.path.slice(-1)==="/")this.#G="5";if(this.#G==="5")this.size=0;if(this.linkpath=ZU(G,Y+157,100),G.subarray(Y+257,Y+265).toString()==="ustar\x0000")if(this.uname=ZU(G,Y+265,32),this.gname=ZU(G,Y+297,32),this.devmaj=XJ(G,Y+329,8)??0,this.devmin=XJ(G,Y+337,8)??0,G[Y+475]!==0){let K=ZU(G,Y+345,155);this.path=K+"/"+this.path}else{let K=ZU(G,Y+345,130);if(K)this.path=K+"/"+this.path;this.atime=_x(G,Y+476,12),this.ctime=_x(G,Y+488,12)}let U=256;for(let K=Y;K<Y+148;K++)U+=G[K];for(let K=Y+156;K<Y+512;K++)U+=G[K];if(this.cksumValid=U===this.cksum,this.cksum===void 0&&U===256)this.nullBlock=!0}#Y(G,Y=!1){Object.assign(this,Object.fromEntries(Object.entries(G).filter(([X,W])=>{return!(W===null||W===void 0||X==="path"&&Y||X==="linkpath"&&Y||X==="global")})))}encode(G,Y=0){if(!G)G=this.block=Buffer.alloc(512);if(this.#G==="Unsupported")this.#G="0";if(!(G.length>=Y+512))throw new Error("need 512 bytes for header");let X=this.ctime||this.atime?130:155,W=Pe0(this.path||"",X),Z=W[0],U=W[1];if(this.needPax=!!W[2],this.needPax=JU(G,Y,100,Z)||this.needPax,this.needPax=WJ(G,Y+100,8,this.mode)||this.needPax,this.needPax=WJ(G,Y+108,8,this.uid)||this.needPax,this.needPax=WJ(G,Y+116,8,this.gid)||this.needPax,this.needPax=WJ(G,Y+124,12,this.size)||this.needPax,this.needPax=fx(G,Y+136,12,this.mtime)||this.needPax,G[Y+156]=this.#G.charCodeAt(0),this.needPax=JU(G,Y+157,100,this.linkpath)||this.needPax,G.write("ustar\x0000",Y+257,8),this.needPax=JU(G,Y+265,32,this.uname)||this.needPax,this.needPax=JU(G,Y+297,32,this.gname)||this.needPax,this.needPax=WJ(G,Y+329,8,this.devmaj)||this.needPax,this.needPax=WJ(G,Y+337,8,this.devmin)||this.needPax,this.needPax=JU(G,Y+345,X,U)||this.needPax,G[Y+475]!==0)this.needPax=JU(G,Y+345,155,U)||this.needPax;else this.needPax=JU(G,Y+345,130,U)||this.needPax,this.needPax=fx(G,Y+476,12,this.atime)||this.needPax,this.needPax=fx(G,Y+488,12,this.ctime)||this.needPax;let K=256;for(let J=Y;J<Y+148;J++)K+=G[J];for(let J=Y+156;J<Y+512;J++)K+=G[J];return this.cksum=K,WJ(G,Y+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#G==="Unsupported"?this.#G:ac.get(this.#G)}get typeKey(){return this.#G}set type(G){let Y=String(fe0.get(G));if(Ox(Y)||Y==="Unsupported")this.#G=Y;else if(Ox(G))this.#G=G;else throw new TypeError("invalid entry type: "+G)}}var Pe0=(G,Y)=>{let W=G,Z="",U=void 0,K=BH.parse(G).root||".";if(Buffer.byteLength(W)<100)U=[W,Z,!1];else{Z=BH.dirname(W),W=BH.basename(W);do if(Buffer.byteLength(W)<=100&&Buffer.byteLength(Z)<=Y)U=[W,Z,!1];else if(Buffer.byteLength(W)>100&&Buffer.byteLength(Z)<=Y)U=[W.slice(0,99),Z,!0];else W=BH.join(BH.basename(Z),W),Z=BH.dirname(Z);while(Z!==K&&U===void 0);if(!U)U=[G.slice(0,99),"",!0]}return U},ZU=(G,Y,X)=>G.subarray(Y,Y+X).toString("utf8").replace(/\0.*/,""),_x=(G,Y,X)=>Ce0(XJ(G,Y,X)),Ce0=(G)=>G===void 0?void 0:new Date(G*1000),XJ=(G,Y,X)=>Number(G[Y])&128?je0(G.subarray(Y,Y+X)):we0(G,Y,X),Be0=(G)=>isNaN(G)?void 0:G,we0=(G,Y,X)=>Be0(parseInt(G.subarray(Y,Y+X).toString("utf8").replace(/\0.*$/,"").trim(),8)),De0={12:8589934591,8:2097151},WJ=(G,Y,X,W)=>W===void 0?!1:W>De0[X]||W<0?(Te0(W,G.subarray(Y,Y+X)),!0):(ke0(G,Y,X,W),!1),ke0=(G,Y,X,W)=>G.write(he0(W,X),Y,X,"ascii"),he0=(G,Y)=>ve0(Math.floor(G).toString(8),Y),ve0=(G,Y)=>(G.length===Y-1?G:new Array(Y-G.length-1).join("0")+G+" ")+"\x00",fx=(G,Y,X,W)=>W===void 0?!1:WJ(G,Y,X,W.getTime()/1000),be0=new Array(156).join("\x00"),JU=(G,Y,X,W)=>W===void 0?!1:(G.write(W+be0,Y,X,"utf8"),W.length!==Buffer.byteLength(W)||W.length>X);class JV{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(G,Y=!1){this.atime=G.atime,this.charset=G.charset,this.comment=G.comment,this.ctime=G.ctime,this.dev=G.dev,this.gid=G.gid,this.global=Y,this.gname=G.gname,this.ino=G.ino,this.linkpath=G.linkpath,this.mtime=G.mtime,this.nlink=G.nlink,this.path=G.path,this.size=G.size,this.uid=G.uid,this.uname=G.uname}encode(){let G=this.encodeBody();if(G==="")return Buffer.allocUnsafe(0);let Y=Buffer.byteLength(G),X=512*Math.ceil(1+Y/512),W=Buffer.allocUnsafe(X);for(let Z=0;Z<512;Z++)W[Z]=0;new qJ({path:("PaxHeader/"+Me0(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:Y,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(W),W.write(G,512,Y,"utf8");for(let Z=Y+512;Z<W.length;Z++)W[Z]=0;return W}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(G){if(this[G]===void 0)return"";let Y=this[G],X=Y instanceof Date?Y.getTime()/1000:Y,W=" "+(G==="dev"||G==="ino"||G==="nlink"?"SCHILY.":"")+G+"="+X+`
3771
+ `)},domwindow(){return W("domwindow")},bigint(Z){return W("bigint:"+Z.toString())},process(){return W("process")},timer(){return W("timer")},pipe(){return W("pipe")},tcp(){return W("tcp")},udp(){return W("udp")},tty(){return W("tty")},statwatcher(){return W("statwatcher")},securecontext(){return W("securecontext")},connection(){return W("connection")},zlib(){return W("zlib")},context(){return W("context")},nodescript(){return W("nodescript")},httpparser(){return W("httpparser")},dataview(){return W("dataview")},signal(){return W("signal")},fsevent(){return W("fsevent")},tlswrap(){return W("tlswrap")}}}function xU1(G){if(typeof G!=="function")return!1;return Function.prototype.toString.call(G).slice(-Tt0)===sV1}function Nt0(G){return new tV1().finalize(G).toString(Et0)}function Rt0(G,Y={}){let X=typeof G==="string"?G:St0(G,Y);return Nt0(X).slice(0,10)}var mU1=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0}),Lt0=Object.freeze(["prototype","__proto__","constructor"]),sV1="[native code] }",Tt0=sV1.length;class HJ{constructor(G,Y){G=this.words=G||[],this.sigBytes=Y===void 0?G.length*4:Y}toString(G){return(G||It0).stringify(this)}concat(G){if(this.clamp(),this.sigBytes%4)for(let Y=0;Y<G.sigBytes;Y++){let X=G.words[Y>>>2]>>>24-Y%4*8&255;this.words[this.sigBytes+Y>>>2]|=X<<24-(this.sigBytes+Y)%4*8}else for(let Y=0;Y<G.sigBytes;Y+=4)this.words[this.sigBytes+Y>>>2]=G.words[Y>>>2];return this.sigBytes+=G.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new HJ([...this.words])}}var It0={stringify(G){let Y=[];for(let X=0;X<G.sigBytes;X++){let W=G.words[X>>>2]>>>24-X%4*8&255;Y.push((W>>>4).toString(16),(W&15).toString(16))}return Y.join("")}},Et0={stringify(G){let X=[];for(let W=0;W<G.sigBytes;W+=3){let Z=G.words[W>>>2]>>>24-W%4*8&255,U=G.words[W+1>>>2]>>>24-(W+1)%4*8&255,K=G.words[W+2>>>2]>>>24-(W+2)%4*8&255,J=Z<<16|U<<8|K;for(let H=0;H<4&&W*8+H*6<G.sigBytes*8;H++)X.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(J>>>6*(3-H)&63))}return X.join("")}},jt0={parse(G){let Y=G.length,X=[];for(let W=0;W<Y;W++)X[W>>>2]|=(G.charCodeAt(W)&255)<<24-W%4*8;return new HJ(X,Y)}},Ot0={parse(G){return jt0.parse(unescape(encodeURIComponent(G)))}};class nV1{constructor(){this._data=new HJ,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=16}reset(){this._data=new HJ,this._nDataBytes=0}_append(G){if(typeof G==="string")G=Ot0.parse(G);this._data.concat(G),this._nDataBytes+=G.sigBytes}_doProcessBlock(G,Y){}_process(G){let Y,X=this._data.sigBytes/(this.blockSize*4);if(G)X=Math.ceil(X);else X=Math.max((X|0)-this._minBufferSize,0);let W=X*this.blockSize,Z=Math.min(W*4,this._data.sigBytes);if(W){for(let U=0;U<W;U+=this.blockSize)this._doProcessBlock(this._data.words,U);Y=this._data.words.splice(0,W),this._data.sigBytes-=Z}return new HJ(Y,Z)}}class oV1 extends nV1{update(G){return this._append(G),this._process(),this}finalize(G){if(G)this._append(G)}}var cU1=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],_t0=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],GU=[];class tV1 extends oV1{constructor(){super(...arguments);this._hash=new HJ([...cU1])}reset(){super.reset(),this._hash=new HJ([...cU1])}_doProcessBlock(G,Y){let X=this._hash.words,W=X[0],Z=X[1],U=X[2],K=X[3],J=X[4],H=X[5],$=X[6],Q=X[7];for(let F=0;F<64;F++){if(F<16)GU[F]=G[Y+F]|0;else{let j=GU[F-15],_=(j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3,E=GU[F-2],B=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;GU[F]=_+GU[F-7]+B+GU[F-16]}let z=J&H^~J&$,V=W&Z^W&U^Z&U,q=(W<<30|W>>>2)^(W<<19|W>>>13)^(W<<10|W>>>22),S=(J<<26|J>>>6)^(J<<21|J>>>11)^(J<<7|J>>>25),N=Q+S+z+_t0[F]+GU[F],R=q+V;Q=$,$=H,H=J,J=K+N|0,K=U,U=Z,Z=W,W=N+R|0}X[0]=X[0]+W|0,X[1]=X[1]+Z|0,X[2]=X[2]+U|0,X[3]=X[3]+K|0,X[4]=X[4]+J|0,X[5]=X[5]+H|0,X[6]=X[6]+$|0,X[7]=X[7]+Q|0}finalize(G){super.finalize(G);let Y=this._nDataBytes*8,X=this._data.sigBytes*8;return this._data.words[X>>>5]|=128<<24-X%32,this._data.words[(X+64>>>9<<4)+14]=Math.floor(Y/4294967296),this._data.words[(X+64>>>9<<4)+15]=Y,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}el0();var ft0=oY(yK1(),1);async function Pt0(G){let Y=G.env??process.env,X=await Ct0({cwd:G.cwd,fileName:G.fileName??".env",env:Y,interpolate:G.interpolate??!0});for(let W in X)if(!W.startsWith("_")&&Y[W]===void 0)Y[W]=X[W];return X}async function Ct0(G){let Y=Object.create(null),X=y9(G.cwd,G.fileName);if(XP(X)){let W=ft0.parse(await no0.readFile(X,"utf8"));Object.assign(Y,W)}if(!G.env?._applied)Object.assign(Y,G.env),Y._applied=!0;if(G.interpolate)Bt0(Y);return Y}function Bt0(G,Y={},X=(W)=>W){function W(U){return Y[U]===void 0?G[U]:Y[U]}function Z(U,K=[]){if(typeof U!=="string")return U;let J=U.match(/(.?\${?(?:[\w:]+)?}?)/g)||[];return X(J.reduce((H,$)=>{let Q=/(.?)\${?([\w:]+)?}?/g.exec($)||[],F=Q[1],z,V;if(F==="\\")V=Q[0]||"",z=V.replace(String.raw`\$`,"$");else{let q=Q[2];if(V=(Q[0]||"").slice(F.length),K.includes(q))return console.warn(`Please avoid recursive environment variables ( loop: ${K.join(" > ")} > ${q} )`),"";z=W(q),z=Z(z,[...K,q])}return z===void 0?H:H.replace(V,z)},U))}for(let U in G)G[U]=Z(W(U))}async function wt0(G){if(G.cwd=y9(process.cwd(),G.cwd||"."),G.name=G.name||"config",G.envName=G.envName??"development",G.configFile=G.configFile??(G.name==="config"?"config":`${G.name}.config`),G.rcFile=G.rcFile??`.${G.name}rc`,G.extend!==!1)G.extend={extendKey:"extends",...G.extend};let Y=G.merger||lA;G.jiti=G.jiti||so0.default(void 0,{interopDefault:!0,requireCache:!1,esmResolve:!0,extensions:[...Dt0],...G.jitiOptions});let X={config:{},cwd:G.cwd,configFile:y9(G.cwd,G.configFile),layers:[]},W={overrides:G.overrides,main:void 0,rc:void 0,packageJson:void 0,defaultConfig:G.defaultConfig};if(G.dotenv)await Pt0({cwd:G.cwd,...G.dotenv===!0?{}:G.dotenv});let Z=await GQ1(".",G);if(Z.configFile)W.main=Z.config,X.configFile=Z.configFile;if(G.rcFile){let J=[];if(J.push(hm({name:G.rcFile,dir:G.cwd})),G.globalRc){let H=await tl0(G.cwd).catch(()=>{});if(H)J.push(hm({name:G.rcFile,dir:H}));J.push(Qt0({name:G.rcFile,dir:G.cwd}))}W.rc=Y({},...J)}if(G.packageJson){let J=(Array.isArray(G.packageJson)?G.packageJson:[typeof G.packageJson==="string"?G.packageJson:G.name]).filter((Q)=>Q&&typeof Q==="string"),H=await sl0(G.cwd).catch(()=>{}),$=J.map((Q)=>H?.[Q]);W.packageJson=Y({},...$)}let U={};for(let J in W){let H=W[J];U[J]=await(typeof H==="function"?H({configs:U}):H)}if(X.config=Y(U.overrides,U.main,U.rc,U.packageJson,U.defaultConfig),G.extend)await eV1(X.config,G),X.layers=X.config._layers,delete X.config._layers,X.config=Y(X.config,...X.layers.map((J)=>J.config));let K=[U.overrides&&{config:U.overrides,configFile:void 0,cwd:void 0},{config:U.main,configFile:G.configFile,cwd:G.cwd},U.rc&&{config:U.rc,configFile:G.rcFile},U.packageJson&&{config:U.packageJson,configFile:"package.json"}].filter((J)=>J&&J.config);if(X.layers=[...K,...X.layers],G.defaults)X.config=Y(X.config,G.defaults);if(G.omit$Keys){for(let J in X.config)if(J.startsWith("$"))delete X.config[J]}return X}async function eV1(G,Y){if(G._layers=G._layers||[],!Y.extend)return;let X=Y.extend.extendKey;if(typeof X==="string")X=[X];let W=[];for(let Z of X)W.push(...(Array.isArray(G[Z])?G[Z]:[G[Z]]).filter(Boolean)),delete G[Z];for(let Z of W){let U=Z,K={};if(Z.source)K=Z.options||{},Z=Z.source;if(Array.isArray(Z))K=Z[1]||{},Z=Z[0];if(typeof Z!=="string"){console.warn(`Cannot extend config from \`${JSON.stringify(U)}\` in ${Y.cwd}`);continue}let J=await GQ1(Z,Y,K);if(!J.config){console.warn(`Cannot extend config from \`${Z}\` in ${Y.cwd}`);continue}if(await eV1(J.config,{...Y,cwd:J.cwd}),G._layers.push(J),J.config._layers)G._layers.push(...J.config._layers),delete J.config._layers}}async function GQ1(G,Y,X={}){if(Y.resolve){let Q=await Y.resolve(G,Y);if(Q)return Q}let W=Y.merger||lA;if(kt0.some((Q)=>G.startsWith(Q))){let{downloadTemplate:Q}=await Promise.resolve().then(()=>(Hr0(),iH1)),F=G.replace(/\W+/g,"_").split("_").splice(0,3).join("_")+"_"+Rt0(G),z,V=y9(Y.cwd,"node_modules"),q=uA(Y.cwd);if(Um(q)===".c12")z=cA(q,F);else if(XP(V))z=cA(V,".c12",F);else z=process.env.XDG_CACHE_HOME?y9(process.env.XDG_CACHE_HOME,"c12",F):y9(eo0(),".cache/c12",F);if(XP(z)&&!X.install)await oo0(z,{recursive:!0});G=(await Q(G,{dir:z,install:X.install,force:X.install,auth:X.auth,...Y.giget,...X.giget})).dir}let Z=(Q)=>{try{return Y.jiti.resolve(Q,{paths:[Y.cwd]})}catch{}};if(ht0.test(G))G=Z(G)||G;let U=S$1(G),K=!U||U===Um(G),J=y9(Y.cwd,K?G:uA(G));if(K)G=Y.configFile;let H={config:void 0,configFile:void 0,cwd:J,source:G,sourceOptions:X};if(H.configFile=Z(y9(J,G))||Z(y9(J,".config",G.replace(/\.config$/,"")))||Z(y9(J,".config",G))||G,!XP(H.configFile))return H;let $=S$1(H.configFile)||"";if($ in lU1){let Q=await lU1[$](),F=await to0(H.configFile,"utf8");H.config=Q(F)}else H.config=Y.jiti(H.configFile);if(H.config instanceof Function)H.config=await H.config();if(Y.envName){let Q={...H.config["$"+Y.envName],...H.config.$env?.[Y.envName]};if(Object.keys(Q).length>0)H.config=W(Q,H.config)}if(H.meta=lA(H.sourceOptions.meta,H.config.$meta),delete H.config.$meta,H.sourceOptions.overrides)H.config=W(H.sourceOptions.overrides,H.config);return H.configFile=uU1(H.configFile),H.source=uU1(H.source),H}var uU1=(G)=>G?.replace(/\\/g,"/"),lU1={".yaml":()=>import("./chunk-d2kb25t6.js").then((G)=>G.parseYAML),".yml":()=>import("./chunk-d2kb25t6.js").then((G)=>G.parseYAML),".jsonc":()=>import("./chunk-n549129b.js").then((G)=>G.parseJSONC),".json5":()=>import("./chunk-v649k10a.js").then((G)=>G.parseJSON5),".toml":()=>import("./chunk-jgcb2h70.js").then((G)=>G.parseTOML)},Dt0=[".js",".ts",".mjs",".cjs",".mts",".cts",".json",".jsonc",".json5",".yaml",".yml",".toml"],kt0=["gh:","github:","gitlab:","bitbucket:","https://","http://"],ht0=/^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/,nu4=oY(ez1(),1);MP();var ou4=oY(yK1(),1);async function vt0(){let{config:G}=await wt0({name:"dynamodb",defaultConfig:{port:8000,dbPath:"",detached:!1,additionalArgs:["-sharedDb"],javaOpts:"",installPath:"dynamodb-local",downloadUrl:"https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz"}});return G}var tu4=await vt0(),bt0=oY(Sr0(),1),pU1=typeof process==="object"&&process?process:{stdout:null,stderr:null},yt0=(G)=>!!G&&typeof G==="object"&&(G instanceof gc||G instanceof YQ1||xt0(G)||mt0(G)),xt0=(G)=>!!G&&typeof G==="object"&&G instanceof bc&&typeof G.pipe==="function"&&G.pipe!==YQ1.Writable.prototype.pipe,mt0=(G)=>!!G&&typeof G==="object"&&G instanceof bc&&typeof G.write==="function"&&typeof G.end==="function",JW=Symbol("EOF"),$W=Symbol("maybeEmitEnd"),dZ=Symbol("emittedEnd"),Uf=Symbol("emittingEnd"),dq=Symbol("emittedError"),zf=Symbol("closed"),iU1=Symbol("read"),Kf=Symbol("flush"),aU1=Symbol("flushChunk"),sG=Symbol("encoding"),PH=Symbol("decoder"),Z5=Symbol("flowing"),sq=Symbol("paused"),mH=Symbol("resume"),J5=Symbol("buffer"),z7=Symbol("pipes"),$5=Symbol("bufferLength"),zx=Symbol("bufferPush"),Hf=Symbol("bufferShift"),u5=Symbol("objectMode"),F2=Symbol("destroyed"),Kx=Symbol("error"),Hx=Symbol("emitData"),rU1=Symbol("emitEnd"),Vx=Symbol("emitEnd2"),lY=Symbol("async"),Qx=Symbol("abort"),Vf=Symbol("aborted"),nq=Symbol("signal"),YU=Symbol("dataListeners"),j3=Symbol("discarded"),oq=(G)=>Promise.resolve().then(G),ct0=(G)=>G(),ut0=(G)=>G==="end"||G==="finish"||G==="prefinish",lt0=(G)=>G instanceof ArrayBuffer||!!G&&typeof G==="object"&&G.constructor&&G.constructor.name==="ArrayBuffer"&&G.byteLength>=0,pt0=(G)=>!Buffer.isBuffer(G)&&ArrayBuffer.isView(G);class Mc{src;dest;opts;ondrain;constructor(G,Y,X){this.src=G,this.dest=Y,this.opts=X,this.ondrain=()=>G[mH](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(G){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class XQ1 extends Mc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(G,Y,X){super(G,Y,X);this.proxyErrors=(W)=>Y.emit("error",W),G.on("error",this.proxyErrors)}}var it0=(G)=>!!G.objectMode,at0=(G)=>!G.objectMode&&!!G.encoding&&G.encoding!=="buffer";class gc extends bc{[Z5]=!1;[sq]=!1;[z7]=[];[J5]=[];[u5];[sG];[lY];[PH];[JW]=!1;[dZ]=!1;[Uf]=!1;[zf]=!1;[dq]=null;[$5]=0;[F2]=!1;[nq];[Vf]=!1;[YU]=0;[j3]=!1;writable=!0;readable=!0;constructor(...G){let Y=G[0]||{};super();if(Y.objectMode&&typeof Y.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(it0(Y))this[u5]=!0,this[sG]=null;else if(at0(Y))this[sG]=Y.encoding,this[u5]=!1;else this[u5]=!1,this[sG]=null;if(this[lY]=!!Y.async,this[PH]=this[sG]?new gt0(this[sG]):null,Y&&Y.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[J5]});if(Y&&Y.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[z7]});let{signal:X}=Y;if(X)if(this[nq]=X,X.aborted)this[Qx]();else X.addEventListener("abort",()=>this[Qx]())}get bufferLength(){return this[$5]}get encoding(){return this[sG]}set encoding(G){throw new Error("Encoding must be set at instantiation time")}setEncoding(G){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[u5]}set objectMode(G){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[lY]}set["async"](G){this[lY]=this[lY]||!!G}[Qx](){this[Vf]=!0,this.emit("abort",this[nq]?.reason),this.destroy(this[nq]?.reason)}get aborted(){return this[Vf]}set aborted(G){}write(G,Y,X){if(this[Vf])return!1;if(this[JW])throw new Error("write after end");if(this[F2])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof Y==="function")X=Y,Y="utf8";if(!Y)Y="utf8";let W=this[lY]?oq:ct0;if(!this[u5]&&!Buffer.isBuffer(G)){if(pt0(G))G=Buffer.from(G.buffer,G.byteOffset,G.byteLength);else if(lt0(G))G=Buffer.from(G);else if(typeof G!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[u5]){if(this[Z5]&&this[$5]!==0)this[Kf](!0);if(this[Z5])this.emit("data",G);else this[zx](G);if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}if(!G.length){if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}if(typeof G==="string"&&!(Y===this[sG]&&!this[PH]?.lastNeed))G=Buffer.from(G,Y);if(Buffer.isBuffer(G)&&this[sG])G=this[PH].write(G);if(this[Z5]&&this[$5]!==0)this[Kf](!0);if(this[Z5])this.emit("data",G);else this[zx](G);if(this[$5]!==0)this.emit("readable");if(X)W(X);return this[Z5]}read(G){if(this[F2])return null;if(this[j3]=!1,this[$5]===0||G===0||G&&G>this[$5])return this[$W](),null;if(this[u5])G=null;if(this[J5].length>1&&!this[u5])this[J5]=[this[sG]?this[J5].join(""):Buffer.concat(this[J5],this[$5])];let Y=this[iU1](G||null,this[J5][0]);return this[$W](),Y}[iU1](G,Y){if(this[u5])this[Hf]();else{let X=Y;if(G===X.length||G===null)this[Hf]();else if(typeof X==="string")this[J5][0]=X.slice(G),Y=X.slice(0,G),this[$5]-=G;else this[J5][0]=X.subarray(G),Y=X.subarray(0,G),this[$5]-=G}if(this.emit("data",Y),!this[J5].length&&!this[JW])this.emit("drain");return Y}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y="utf8";if(G!==void 0)this.write(G,Y);if(X)this.once("end",X);if(this[JW]=!0,this.writable=!1,this[Z5]||!this[sq])this[$W]();return this}[mH](){if(this[F2])return;if(!this[YU]&&!this[z7].length)this[j3]=!0;if(this[sq]=!1,this[Z5]=!0,this.emit("resume"),this[J5].length)this[Kf]();else if(this[JW])this[$W]();else this.emit("drain")}resume(){return this[mH]()}pause(){this[Z5]=!1,this[sq]=!0,this[j3]=!1}get destroyed(){return this[F2]}get flowing(){return this[Z5]}get paused(){return this[sq]}[zx](G){if(this[u5])this[$5]+=1;else this[$5]+=G.length;this[J5].push(G)}[Hf](){if(this[u5])this[$5]-=1;else this[$5]-=this[J5][0].length;return this[J5].shift()}[Kf](G=!1){do;while(this[aU1](this[Hf]())&&this[J5].length);if(!G&&!this[J5].length&&!this[JW])this.emit("drain")}[aU1](G){return this.emit("data",G),this[Z5]}pipe(G,Y){if(this[F2])return G;this[j3]=!1;let X=this[dZ];if(Y=Y||{},G===pU1.stdout||G===pU1.stderr)Y.end=!1;else Y.end=Y.end!==!1;if(Y.proxyErrors=!!Y.proxyErrors,X){if(Y.end)G.end()}else if(this[z7].push(!Y.proxyErrors?new Mc(this,G,Y):new XQ1(this,G,Y)),this[lY])oq(()=>this[mH]());else this[mH]();return G}unpipe(G){let Y=this[z7].find((X)=>X.dest===G);if(Y){if(this[z7].length===1){if(this[Z5]&&this[YU]===0)this[Z5]=!1;this[z7]=[]}else this[z7].splice(this[z7].indexOf(Y),1);Y.unpipe()}}addListener(G,Y){return this.on(G,Y)}on(G,Y){let X=super.on(G,Y);if(G==="data"){if(this[j3]=!1,this[YU]++,!this[z7].length&&!this[Z5])this[mH]()}else if(G==="readable"&&this[$5]!==0)super.emit("readable");else if(ut0(G)&&this[dZ])super.emit(G),this.removeAllListeners(G);else if(G==="error"&&this[dq]){let W=Y;if(this[lY])oq(()=>W.call(this,this[dq]));else W.call(this,this[dq])}return X}removeListener(G,Y){return this.off(G,Y)}off(G,Y){let X=super.off(G,Y);if(G==="data"){if(this[YU]=this.listeners("data").length,this[YU]===0&&!this[j3]&&!this[z7].length)this[Z5]=!1}return X}removeAllListeners(G){let Y=super.removeAllListeners(G);if(G==="data"||G===void 0){if(this[YU]=0,!this[j3]&&!this[z7].length)this[Z5]=!1}return Y}get emittedEnd(){return this[dZ]}[$W](){if(!this[Uf]&&!this[dZ]&&!this[F2]&&this[J5].length===0&&this[JW]){if(this[Uf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[zf])this.emit("close");this[Uf]=!1}}emit(G,...Y){let X=Y[0];if(G!=="error"&&G!=="close"&&G!==F2&&this[F2])return!1;else if(G==="data")return!this[u5]&&!X?!1:this[lY]?(oq(()=>this[Hx](X)),!0):this[Hx](X);else if(G==="end")return this[rU1]();else if(G==="close"){if(this[zf]=!0,!this[dZ]&&!this[F2])return!1;let Z=super.emit("close");return this.removeAllListeners("close"),Z}else if(G==="error"){this[dq]=X,super.emit(Kx,X);let Z=!this[nq]||this.listeners("error").length?super.emit("error",X):!1;return this[$W](),Z}else if(G==="resume"){let Z=super.emit("resume");return this[$W](),Z}else if(G==="finish"||G==="prefinish"){let Z=super.emit(G);return this.removeAllListeners(G),Z}let W=super.emit(G,...Y);return this[$W](),W}[Hx](G){for(let X of this[z7])if(X.dest.write(G)===!1)this.pause();let Y=this[j3]?!1:super.emit("data",G);return this[$W](),Y}[rU1](){if(this[dZ])return!1;return this[dZ]=!0,this.readable=!1,this[lY]?(oq(()=>this[Vx]()),!0):this[Vx]()}[Vx](){if(this[PH]){let Y=this[PH].end();if(Y){for(let X of this[z7])X.dest.write(Y);if(!this[j3])super.emit("data",Y)}}for(let Y of this[z7])Y.end();let G=super.emit("end");return this.removeAllListeners("end"),G}async collect(){let G=Object.assign([],{dataLength:0});if(!this[u5])G.dataLength=0;let Y=this.promise();return this.on("data",(X)=>{if(G.push(X),!this[u5])G.dataLength+=X.length}),await Y,G}async concat(){if(this[u5])throw new Error("cannot concat in objectMode");let G=await this.collect();return this[sG]?G.join(""):Buffer.concat(G,G.dataLength)}async promise(){return new Promise((G,Y)=>{this.on(F2,()=>Y(new Error("stream destroyed"))),this.on("error",(X)=>Y(X)),this.on("end",()=>G())})}[Symbol.asyncIterator](){this[j3]=!1;let G=!1,Y=async()=>{return this.pause(),G=!0,{value:void 0,done:!0}};return{next:()=>{if(G)return Y();let W=this.read();if(W!==null)return Promise.resolve({done:!1,value:W});if(this[JW])return Y();let Z,U,K=(Q)=>{this.off("data",J),this.off("end",H),this.off(F2,$),Y(),U(Q)},J=(Q)=>{this.off("error",K),this.off("end",H),this.off(F2,$),this.pause(),Z({value:Q,done:!!this[JW]})},H=()=>{this.off("error",K),this.off("data",J),this.off(F2,$),Y(),Z({done:!0,value:void 0})},$=()=>K(new Error("stream destroyed"));return new Promise((Q,F)=>{U=F,Z=Q,this.once(F2,$),this.once("error",K),this.once("end",H),this.once("data",J)})},throw:Y,return:Y,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[j3]=!1;let G=!1,Y=()=>{return this.pause(),this.off(Kx,Y),this.off(F2,Y),this.off("end",Y),G=!0,{done:!0,value:void 0}},X=()=>{if(G)return Y();let W=this.read();return W===null?Y():{done:!1,value:W}};return this.once("end",Y),this.once(Kx,Y),this.once(F2,Y),{next:X,throw:Y,return:Y,[Symbol.iterator](){return this}}}destroy(G){if(this[F2]){if(G)this.emit("error",G);else this.emit(F2);return this}this[F2]=!0,this[j3]=!0,this[J5].length=0,this[$5]=0;let Y=this;if(typeof Y.close==="function"&&!this[zf])Y.close();if(G)this.emit("error",G);else this.emit(F2);return this}static get isStream(){return yt0}}var rt0=u7.writev,VJ=Symbol("_autoClose"),YY=Symbol("_close"),tq=Symbol("_ended"),p6=Symbol("_fd"),Fx=Symbol("_finished"),SW=Symbol("_flags"),qx=Symbol("_flush"),vm=Symbol("_handleChunk"),bm=Symbol("_makeBuf"),kA=Symbol("_mode"),Qf=Symbol("_needDrain"),tH=Symbol("_onerror"),ZV=Symbol("_onopen"),Ax=Symbol("_onread"),cH=Symbol("_onwrite"),QJ=Symbol("_open"),GY=Symbol("_path"),GJ=Symbol("_pos"),pY=Symbol("_queue"),uH=Symbol("_read"),Sx=Symbol("_readSize"),AW=Symbol("_reading"),eq=Symbol("_remain"),Nx=Symbol("_size"),WP=Symbol("_write"),XU=Symbol("_writing"),ZP=Symbol("_defaultFlag"),SU=Symbol("_errored");class sP extends gc{[SU]=!1;[p6];[GY];[Sx];[AW]=!1;[Nx];[eq];[VJ];constructor(G,Y){Y=Y||{};super(Y);if(this.readable=!0,this.writable=!1,typeof G!=="string")throw new TypeError("path must be a string");if(this[SU]=!1,this[p6]=typeof Y.fd==="number"?Y.fd:void 0,this[GY]=G,this[Sx]=Y.readSize||16777216,this[AW]=!1,this[Nx]=typeof Y.size==="number"?Y.size:1/0,this[eq]=this[Nx],this[VJ]=typeof Y.autoClose==="boolean"?Y.autoClose:!0,typeof this[p6]==="number")this[uH]();else this[QJ]()}get fd(){return this[p6]}get path(){return this[GY]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[QJ](){u7.open(this[GY],"r",(G,Y)=>this[ZV](G,Y))}[ZV](G,Y){if(G)this[tH](G);else this[p6]=Y,this.emit("open",Y),this[uH]()}[bm](){return Buffer.allocUnsafe(Math.min(this[Sx],this[eq]))}[uH](){if(!this[AW]){this[AW]=!0;let G=this[bm]();if(G.length===0)return process.nextTick(()=>this[Ax](null,0,G));u7.read(this[p6],G,0,G.length,null,(Y,X,W)=>this[Ax](Y,X,W))}}[Ax](G,Y,X){if(this[AW]=!1,G)this[tH](G);else if(this[vm](Y,X))this[uH]()}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.close(G,(Y)=>Y?this.emit("error",Y):this.emit("close"))}}[tH](G){this[AW]=!0,this[YY](),this.emit("error",G)}[vm](G,Y){let X=!1;if(this[eq]-=G,G>0)X=super.write(G<Y.length?Y.subarray(0,G):Y);if(G===0||this[eq]<=0)X=!1,this[YY](),super.end();return X}emit(G,...Y){switch(G){case"prefinish":case"finish":return!1;case"drain":if(typeof this[p6]==="number")this[uH]();return!1;case"error":if(this[SU])return!1;return this[SU]=!0,super.emit(G,...Y);default:return super.emit(G,...Y)}}}class WQ1 extends sP{[QJ](){let G=!0;try{this[ZV](null,u7.openSync(this[GY],"r")),G=!1}finally{if(G)this[YY]()}}[uH](){let G=!0;try{if(!this[AW]){this[AW]=!0;do{let Y=this[bm](),X=Y.length===0?0:u7.readSync(this[p6],Y,0,Y.length,null);if(!this[vm](X,Y))break}while(!0);this[AW]=!1}G=!1}finally{if(G)this[YY]()}}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.closeSync(G),this.emit("close")}}}class AS extends Mt0{readable=!1;writable=!0;[SU]=!1;[XU]=!1;[tq]=!1;[pY]=[];[Qf]=!1;[GY];[kA];[VJ];[p6];[ZP];[SW];[Fx]=!1;[GJ];constructor(G,Y){Y=Y||{};super(Y);this[GY]=G,this[p6]=typeof Y.fd==="number"?Y.fd:void 0,this[kA]=Y.mode===void 0?438:Y.mode,this[GJ]=typeof Y.start==="number"?Y.start:void 0,this[VJ]=typeof Y.autoClose==="boolean"?Y.autoClose:!0;let X=this[GJ]!==void 0?"r+":"w";if(this[ZP]=Y.flags===void 0,this[SW]=Y.flags===void 0?X:Y.flags,this[p6]===void 0)this[QJ]()}emit(G,...Y){if(G==="error"){if(this[SU])return!1;this[SU]=!0}return super.emit(G,...Y)}get fd(){return this[p6]}get path(){return this[GY]}[tH](G){this[YY](),this[XU]=!0,this.emit("error",G)}[QJ](){u7.open(this[GY],this[SW],this[kA],(G,Y)=>this[ZV](G,Y))}[ZV](G,Y){if(this[ZP]&&this[SW]==="r+"&&G&&G.code==="ENOENT")this[SW]="w",this[QJ]();else if(G)this[tH](G);else if(this[p6]=Y,this.emit("open",Y),!this[XU])this[qx]()}end(G,Y){if(G)this.write(G,Y);if(this[tq]=!0,!this[XU]&&!this[pY].length&&typeof this[p6]==="number")this[cH](null,0);return this}write(G,Y){if(typeof G==="string")G=Buffer.from(G,Y);if(this[tq])return this.emit("error",new Error("write() after end()")),!1;if(this[p6]===void 0||this[XU]||this[pY].length)return this[pY].push(G),this[Qf]=!0,!1;return this[XU]=!0,this[WP](G),!0}[WP](G){u7.write(this[p6],G,0,G.length,this[GJ],(Y,X)=>this[cH](Y,X))}[cH](G,Y){if(G)this[tH](G);else{if(this[GJ]!==void 0&&typeof Y==="number")this[GJ]+=Y;if(this[pY].length)this[qx]();else if(this[XU]=!1,this[tq]&&!this[Fx])this[Fx]=!0,this[YY](),this.emit("finish");else if(this[Qf])this[Qf]=!1,this.emit("drain")}}[qx](){if(this[pY].length===0){if(this[tq])this[cH](null,0)}else if(this[pY].length===1)this[WP](this[pY].pop());else{let G=this[pY];this[pY]=[],rt0(this[p6],G,this[GJ],(Y,X)=>this[cH](Y,X))}}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.close(G,(Y)=>Y?this.emit("error",Y):this.emit("close"))}}}class yc extends AS{[QJ](){let G;if(this[ZP]&&this[SW]==="r+")try{G=u7.openSync(this[GY],this[SW],this[kA])}catch(Y){if(Y?.code==="ENOENT")return this[SW]="w",this[QJ]();else throw Y}else G=u7.openSync(this[GY],this[SW],this[kA]);this[ZV](null,G)}[YY](){if(this[VJ]&&typeof this[p6]==="number"){let G=this[p6];this[p6]=void 0,u7.closeSync(G),this.emit("close")}}[WP](G){let Y=!0;try{this[cH](null,u7.writeSync(this[p6],G,0,G.length,this[GJ])),Y=!1}finally{if(Y)try{this[YY]()}catch{}}}}var nt0=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),ot0=(G)=>!!G.sync&&!!G.file,tt0=(G)=>!G.sync&&!!G.file,et0=(G)=>!!G.sync&&!G.file,Ge0=(G)=>!G.sync&&!G.file,Ye0=(G)=>!!G.file,Xe0=(G)=>{let Y=nt0.get(G);if(Y)return Y;return G},xc=(G={})=>{if(!G)return{};let Y={};for(let[X,W]of Object.entries(G)){let Z=Xe0(X);Y[Z]=W}if(Y.chmod===void 0&&Y.noChmod===!1)Y.chmod=!0;return delete Y.noChmod,Y},SS=(G,Y,X,W,Z)=>{return Object.assign((U=[],K,J)=>{if(Array.isArray(U))K=U,U={};if(typeof K==="function")J=K,K=void 0;if(!K)K=[];else K=Array.from(K);let H=xc(U);if(Z?.(H,K),ot0(H)){if(typeof J==="function")throw new TypeError("callback not supported for sync tar functions");return G(H,K)}else if(tt0(H)){let $=Y(H,K),Q=J?J:void 0;return Q?$.then(()=>Q(),Q):$}else if(et0(H)){if(typeof J==="function")throw new TypeError("callback not supported for sync tar functions");return X(H,K)}else if(Ge0(H)){if(typeof J==="function")throw new TypeError("callback only supported with file option");return W(H,K)}else throw new Error("impossible options??")},{syncFile:G,asyncFile:Y,syncNoFile:X,asyncNoFile:W,validate:Z})},dU1=typeof process==="object"&&process?process:{stdout:null,stderr:null},Je0=(G)=>!!G&&typeof G==="object"&&(G instanceof uc||G instanceof JQ1||$e0(G)||Ue0(G)),$e0=(G)=>!!G&&typeof G==="object"&&G instanceof mc&&typeof G.pipe==="function"&&G.pipe!==JQ1.Writable.prototype.pipe,Ue0=(G)=>!!G&&typeof G==="object"&&G instanceof mc&&typeof G.write==="function"&&typeof G.end==="function",UW=Symbol("EOF"),zW=Symbol("maybeEmitEnd"),sZ=Symbol("emittedEnd"),Ff=Symbol("emittingEnd"),GA=Symbol("emittedError"),qf=Symbol("closed"),sU1=Symbol("read"),Af=Symbol("flush"),nU1=Symbol("flushChunk"),nG=Symbol("encoding"),CH=Symbol("decoder"),U5=Symbol("flowing"),YA=Symbol("paused"),pH=Symbol("resume"),z5=Symbol("buffer"),K7=Symbol("pipes"),K5=Symbol("bufferLength"),Rx=Symbol("bufferPush"),Sf=Symbol("bufferShift"),l5=Symbol("objectMode"),q2=Symbol("destroyed"),Lx=Symbol("error"),Tx=Symbol("emitData"),oU1=Symbol("emitEnd"),Ix=Symbol("emitEnd2"),iY=Symbol("async"),Ex=Symbol("abort"),Nf=Symbol("aborted"),XA=Symbol("signal"),WU=Symbol("dataListeners"),O3=Symbol("discarded"),WA=(G)=>Promise.resolve().then(G),ze0=(G)=>G(),Ke0=(G)=>G==="end"||G==="finish"||G==="prefinish",He0=(G)=>G instanceof ArrayBuffer||!!G&&typeof G==="object"&&G.constructor&&G.constructor.name==="ArrayBuffer"&&G.byteLength>=0,Ve0=(G)=>!Buffer.isBuffer(G)&&ArrayBuffer.isView(G);class cc{src;dest;opts;ondrain;constructor(G,Y,X){this.src=G,this.dest=Y,this.opts=X,this.ondrain=()=>G[pH](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(G){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class $Q1 extends cc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(G,Y,X){super(G,Y,X);this.proxyErrors=(W)=>Y.emit("error",W),G.on("error",this.proxyErrors)}}var Qe0=(G)=>!!G.objectMode,Fe0=(G)=>!G.objectMode&&!!G.encoding&&G.encoding!=="buffer";class uc extends mc{[U5]=!1;[YA]=!1;[K7]=[];[z5]=[];[l5];[nG];[iY];[CH];[UW]=!1;[sZ]=!1;[Ff]=!1;[qf]=!1;[GA]=null;[K5]=0;[q2]=!1;[XA];[Nf]=!1;[WU]=0;[O3]=!1;writable=!0;readable=!0;constructor(...G){let Y=G[0]||{};super();if(Y.objectMode&&typeof Y.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Qe0(Y))this[l5]=!0,this[nG]=null;else if(Fe0(Y))this[nG]=Y.encoding,this[l5]=!1;else this[l5]=!1,this[nG]=null;if(this[iY]=!!Y.async,this[CH]=this[nG]?new Ze0(this[nG]):null,Y&&Y.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[z5]});if(Y&&Y.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[K7]});let{signal:X}=Y;if(X)if(this[XA]=X,X.aborted)this[Ex]();else X.addEventListener("abort",()=>this[Ex]())}get bufferLength(){return this[K5]}get encoding(){return this[nG]}set encoding(G){throw new Error("Encoding must be set at instantiation time")}setEncoding(G){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[l5]}set objectMode(G){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[iY]}set["async"](G){this[iY]=this[iY]||!!G}[Ex](){this[Nf]=!0,this.emit("abort",this[XA]?.reason),this.destroy(this[XA]?.reason)}get aborted(){return this[Nf]}set aborted(G){}write(G,Y,X){if(this[Nf])return!1;if(this[UW])throw new Error("write after end");if(this[q2])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof Y==="function")X=Y,Y="utf8";if(!Y)Y="utf8";let W=this[iY]?WA:ze0;if(!this[l5]&&!Buffer.isBuffer(G)){if(Ve0(G))G=Buffer.from(G.buffer,G.byteOffset,G.byteLength);else if(He0(G))G=Buffer.from(G);else if(typeof G!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[l5]){if(this[U5]&&this[K5]!==0)this[Af](!0);if(this[U5])this.emit("data",G);else this[Rx](G);if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}if(!G.length){if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}if(typeof G==="string"&&!(Y===this[nG]&&!this[CH]?.lastNeed))G=Buffer.from(G,Y);if(Buffer.isBuffer(G)&&this[nG])G=this[CH].write(G);if(this[U5]&&this[K5]!==0)this[Af](!0);if(this[U5])this.emit("data",G);else this[Rx](G);if(this[K5]!==0)this.emit("readable");if(X)W(X);return this[U5]}read(G){if(this[q2])return null;if(this[O3]=!1,this[K5]===0||G===0||G&&G>this[K5])return this[zW](),null;if(this[l5])G=null;if(this[z5].length>1&&!this[l5])this[z5]=[this[nG]?this[z5].join(""):Buffer.concat(this[z5],this[K5])];let Y=this[sU1](G||null,this[z5][0]);return this[zW](),Y}[sU1](G,Y){if(this[l5])this[Sf]();else{let X=Y;if(G===X.length||G===null)this[Sf]();else if(typeof X==="string")this[z5][0]=X.slice(G),Y=X.slice(0,G),this[K5]-=G;else this[z5][0]=X.subarray(G),Y=X.subarray(0,G),this[K5]-=G}if(this.emit("data",Y),!this[z5].length&&!this[UW])this.emit("drain");return Y}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y="utf8";if(G!==void 0)this.write(G,Y);if(X)this.once("end",X);if(this[UW]=!0,this.writable=!1,this[U5]||!this[YA])this[zW]();return this}[pH](){if(this[q2])return;if(!this[WU]&&!this[K7].length)this[O3]=!0;if(this[YA]=!1,this[U5]=!0,this.emit("resume"),this[z5].length)this[Af]();else if(this[UW])this[zW]();else this.emit("drain")}resume(){return this[pH]()}pause(){this[U5]=!1,this[YA]=!0,this[O3]=!1}get destroyed(){return this[q2]}get flowing(){return this[U5]}get paused(){return this[YA]}[Rx](G){if(this[l5])this[K5]+=1;else this[K5]+=G.length;this[z5].push(G)}[Sf](){if(this[l5])this[K5]-=1;else this[K5]-=this[z5][0].length;return this[z5].shift()}[Af](G=!1){do;while(this[nU1](this[Sf]())&&this[z5].length);if(!G&&!this[z5].length&&!this[UW])this.emit("drain")}[nU1](G){return this.emit("data",G),this[U5]}pipe(G,Y){if(this[q2])return G;this[O3]=!1;let X=this[sZ];if(Y=Y||{},G===dU1.stdout||G===dU1.stderr)Y.end=!1;else Y.end=Y.end!==!1;if(Y.proxyErrors=!!Y.proxyErrors,X){if(Y.end)G.end()}else if(this[K7].push(!Y.proxyErrors?new cc(this,G,Y):new $Q1(this,G,Y)),this[iY])WA(()=>this[pH]());else this[pH]();return G}unpipe(G){let Y=this[K7].find((X)=>X.dest===G);if(Y){if(this[K7].length===1){if(this[U5]&&this[WU]===0)this[U5]=!1;this[K7]=[]}else this[K7].splice(this[K7].indexOf(Y),1);Y.unpipe()}}addListener(G,Y){return this.on(G,Y)}on(G,Y){let X=super.on(G,Y);if(G==="data"){if(this[O3]=!1,this[WU]++,!this[K7].length&&!this[U5])this[pH]()}else if(G==="readable"&&this[K5]!==0)super.emit("readable");else if(Ke0(G)&&this[sZ])super.emit(G),this.removeAllListeners(G);else if(G==="error"&&this[GA]){let W=Y;if(this[iY])WA(()=>W.call(this,this[GA]));else W.call(this,this[GA])}return X}removeListener(G,Y){return this.off(G,Y)}off(G,Y){let X=super.off(G,Y);if(G==="data"){if(this[WU]=this.listeners("data").length,this[WU]===0&&!this[O3]&&!this[K7].length)this[U5]=!1}return X}removeAllListeners(G){let Y=super.removeAllListeners(G);if(G==="data"||G===void 0){if(this[WU]=0,!this[O3]&&!this[K7].length)this[U5]=!1}return Y}get emittedEnd(){return this[sZ]}[zW](){if(!this[Ff]&&!this[sZ]&&!this[q2]&&this[z5].length===0&&this[UW]){if(this[Ff]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[qf])this.emit("close");this[Ff]=!1}}emit(G,...Y){let X=Y[0];if(G!=="error"&&G!=="close"&&G!==q2&&this[q2])return!1;else if(G==="data")return!this[l5]&&!X?!1:this[iY]?(WA(()=>this[Tx](X)),!0):this[Tx](X);else if(G==="end")return this[oU1]();else if(G==="close"){if(this[qf]=!0,!this[sZ]&&!this[q2])return!1;let Z=super.emit("close");return this.removeAllListeners("close"),Z}else if(G==="error"){this[GA]=X,super.emit(Lx,X);let Z=!this[XA]||this.listeners("error").length?super.emit("error",X):!1;return this[zW](),Z}else if(G==="resume"){let Z=super.emit("resume");return this[zW](),Z}else if(G==="finish"||G==="prefinish"){let Z=super.emit(G);return this.removeAllListeners(G),Z}let W=super.emit(G,...Y);return this[zW](),W}[Tx](G){for(let X of this[K7])if(X.dest.write(G)===!1)this.pause();let Y=this[O3]?!1:super.emit("data",G);return this[zW](),Y}[oU1](){if(this[sZ])return!1;return this[sZ]=!0,this.readable=!1,this[iY]?(WA(()=>this[Ix]()),!0):this[Ix]()}[Ix](){if(this[CH]){let Y=this[CH].end();if(Y){for(let X of this[K7])X.dest.write(Y);if(!this[O3])super.emit("data",Y)}}for(let Y of this[K7])Y.end();let G=super.emit("end");return this.removeAllListeners("end"),G}async collect(){let G=Object.assign([],{dataLength:0});if(!this[l5])G.dataLength=0;let Y=this.promise();return this.on("data",(X)=>{if(G.push(X),!this[l5])G.dataLength+=X.length}),await Y,G}async concat(){if(this[l5])throw new Error("cannot concat in objectMode");let G=await this.collect();return this[nG]?G.join(""):Buffer.concat(G,G.dataLength)}async promise(){return new Promise((G,Y)=>{this.on(q2,()=>Y(new Error("stream destroyed"))),this.on("error",(X)=>Y(X)),this.on("end",()=>G())})}[Symbol.asyncIterator](){this[O3]=!1;let G=!1,Y=async()=>{return this.pause(),G=!0,{value:void 0,done:!0}};return{next:()=>{if(G)return Y();let W=this.read();if(W!==null)return Promise.resolve({done:!1,value:W});if(this[UW])return Y();let Z,U,K=(Q)=>{this.off("data",J),this.off("end",H),this.off(q2,$),Y(),U(Q)},J=(Q)=>{this.off("error",K),this.off("end",H),this.off(q2,$),this.pause(),Z({value:Q,done:!!this[UW]})},H=()=>{this.off("error",K),this.off("data",J),this.off(q2,$),Y(),Z({done:!0,value:void 0})},$=()=>K(new Error("stream destroyed"));return new Promise((Q,F)=>{U=F,Z=Q,this.once(q2,$),this.once("error",K),this.once("end",H),this.once("data",J)})},throw:Y,return:Y,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[O3]=!1;let G=!1,Y=()=>{return this.pause(),this.off(Lx,Y),this.off(q2,Y),this.off("end",Y),G=!0,{done:!0,value:void 0}},X=()=>{if(G)return Y();let W=this.read();return W===null?Y():{done:!1,value:W}};return this.once("end",Y),this.once(Lx,Y),this.once(q2,Y),{next:X,throw:Y,return:Y,[Symbol.iterator](){return this}}}destroy(G){if(this[q2]){if(G)this.emit("error",G);else this.emit(q2);return this}this[q2]=!0,this[O3]=!0,this[z5].length=0,this[K5]=0;let Y=this;if(typeof Y.close==="function"&&!this[qf])Y.close();if(G)this.emit("error",G);else this.emit(q2);return this}static get isStream(){return Je0}}var Se0=Ae0.constants||{ZLIB_VERNUM:4736},NU=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Se0)),tU1=YJ.concat,RU=Symbol("_superWrite");class PA extends Error{code;errno;constructor(G){super("zlib: "+G.message);if(this.code=G.code,this.errno=G.errno,!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+G.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}var jx=Symbol("flushFlag");class lc extends uc{#G=!1;#Y=!1;#X;#W;#Z;#J;#$;get sawError(){return this.#G}get handle(){return this.#J}get flushFlag(){return this.#X}constructor(G,Y){if(!G||typeof G!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(G);this.#X=G.flush??0,this.#W=G.finishFlush??0,this.#Z=G.fullFlushFlag??0;try{this.#J=new qe0[Y](G)}catch(X){throw new PA(X)}this.#$=(X)=>{if(this.#G)return;this.#G=!0,this.close(),this.emit("error",X)},this.#J?.on("error",(X)=>this.#$(new PA(X))),this.once("end",()=>this.close)}close(){if(this.#J)this.#J.close(),this.#J=void 0,this.emit("close")}reset(){if(!this.#G)return Mm(this.#J,"zlib binding closed"),this.#J.reset?.()}flush(G){if(this.ended)return;if(typeof G!=="number")G=this.#Z;this.write(Object.assign(YJ.alloc(0),{[jx]:G}))}end(G,Y,X){if(typeof G==="function")X=G,Y=void 0,G=void 0;if(typeof Y==="function")X=Y,Y=void 0;if(G)if(Y)this.write(G,Y);else this.write(G);return this.flush(this.#W),this.#Y=!0,super.end(X)}get ended(){return this.#Y}[RU](G){return super.write(G)}write(G,Y,X){if(typeof Y==="function")X=Y,Y="utf8";if(typeof G==="string")G=YJ.from(G,Y);if(this.#G)return;Mm(this.#J,"zlib binding closed");let W=this.#J._handle,Z=W.close;W.close=()=>{};let U=this.#J.close;this.#J.close=()=>{},YJ.concat=(H)=>H;let K=void 0;try{let H=typeof G[jx]==="number"?G[jx]:this.#X;K=this.#J._processChunk(G,H),YJ.concat=tU1}catch(H){YJ.concat=tU1,this.#$(new PA(H))}finally{if(this.#J)this.#J._handle=W,W.close=Z,this.#J.close=U,this.#J.removeAllListeners("error")}if(this.#J)this.#J.on("error",(H)=>this.#$(new PA(H)));let J;if(K)if(Array.isArray(K)&&K.length>0){let H=K[0];J=this[RU](YJ.from(H));for(let $=1;$<K.length;$++)J=this[RU](K[$])}else J=this[RU](YJ.from(K));if(X)X();return J}}class pc extends lc{#G;#Y;constructor(G,Y){G=G||{},G.flush=G.flush||NU.Z_NO_FLUSH,G.finishFlush=G.finishFlush||NU.Z_FINISH,G.fullFlushFlag=NU.Z_FULL_FLUSH;super(G,Y);this.#G=G.level,this.#Y=G.strategy}params(G,Y){if(this.sawError)return;if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#G!==G||this.#Y!==Y){this.flush(NU.Z_SYNC_FLUSH),Mm(this.handle,"zlib binding closed");let X=this.handle.flush;this.handle.flush=(W,Z)=>{if(typeof W==="function")Z=W,W=this.flushFlag;this.flush(W),Z?.()};try{this.handle.params(G,Y)}finally{this.handle.flush=X}if(this.handle)this.#G=G,this.#Y=Y}}}class UQ1 extends pc{#G;constructor(G){super(G,"Gzip");this.#G=G&&!!G.portable}[RU](G){if(!this.#G)return super[RU](G);return this.#G=!1,G[9]=255,super[RU](G)}}class zQ1 extends pc{constructor(G){super(G,"Unzip")}}class ic extends lc{constructor(G,Y){G=G||{},G.flush=G.flush||NU.BROTLI_OPERATION_PROCESS,G.finishFlush=G.finishFlush||NU.BROTLI_OPERATION_FINISH,G.fullFlushFlag=NU.BROTLI_OPERATION_FLUSH;super(G,Y)}}class KQ1 extends ic{constructor(G){super(G,"BrotliCompress")}}class HQ1 extends ic{constructor(G){super(G,"BrotliDecompress")}}function Ne0(G,Y,X){let W=Y,Z=Y?Y.next:G.head,U=new nP(X,W,Z,G);if(U.next===void 0)G.tail=U;if(U.prev===void 0)G.head=U;return G.length++,U}function Re0(G,Y){if(G.tail=new nP(Y,G.tail,void 0,G),!G.head)G.head=G.tail;G.length++}function Le0(G,Y){if(G.head=new nP(Y,void 0,G.head,G),!G.tail)G.tail=G.head;G.length++}class JJ{tail;head;length=0;static create(G=[]){return new JJ(G)}constructor(G=[]){for(let Y of G)this.push(Y)}*[Symbol.iterator](){for(let G=this.head;G;G=G.next)yield G.value}removeNode(G){if(G.list!==this)throw new Error("removing node which does not belong to this list");let{next:Y,prev:X}=G;if(Y)Y.prev=X;if(X)X.next=Y;if(G===this.head)this.head=Y;if(G===this.tail)this.tail=X;return this.length--,G.next=void 0,G.prev=void 0,G.list=void 0,Y}unshiftNode(G){if(G===this.head)return;if(G.list)G.list.removeNode(G);let Y=this.head;if(G.list=this,G.next=Y,Y)Y.prev=G;if(this.head=G,!this.tail)this.tail=G;this.length++}pushNode(G){if(G===this.tail)return;if(G.list)G.list.removeNode(G);let Y=this.tail;if(G.list=this,G.prev=Y,Y)Y.next=G;if(this.tail=G,!this.head)this.head=G;this.length++}push(...G){for(let Y=0,X=G.length;Y<X;Y++)Re0(this,G[Y]);return this.length}unshift(...G){for(var Y=0,X=G.length;Y<X;Y++)Le0(this,G[Y]);return this.length}pop(){if(!this.tail)return;let G=this.tail.value,Y=this.tail;if(this.tail=this.tail.prev,this.tail)this.tail.next=void 0;else this.head=void 0;return Y.list=void 0,this.length--,G}shift(){if(!this.head)return;let G=this.head.value,Y=this.head;if(this.head=this.head.next,this.head)this.head.prev=void 0;else this.tail=void 0;return Y.list=void 0,this.length--,G}forEach(G,Y){Y=Y||this;for(let X=this.head,W=0;X;W++)G.call(Y,X.value,W,this),X=X.next}forEachReverse(G,Y){Y=Y||this;for(let X=this.tail,W=this.length-1;X;W--)G.call(Y,X.value,W,this),X=X.prev}get(G){let Y=0,X=this.head;for(;!!X&&Y<G;Y++)X=X.next;if(Y===G&&!!X)return X.value}getReverse(G){let Y=0,X=this.tail;for(;!!X&&Y<G;Y++)X=X.prev;if(Y===G&&!!X)return X.value}map(G,Y){Y=Y||this;let X=new JJ;for(let W=this.head;W;)X.push(G.call(Y,W.value,this)),W=W.next;return X}mapReverse(G,Y){Y=Y||this;var X=new JJ;for(let W=this.tail;W;)X.push(G.call(Y,W.value,this)),W=W.prev;return X}reduce(G,Y){let X,W=this.head;if(arguments.length>1)X=Y;else if(this.head)W=this.head.next,X=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var Z=0;W;Z++)X=G(X,W.value,Z),W=W.next;return X}reduceReverse(G,Y){let X,W=this.tail;if(arguments.length>1)X=Y;else if(this.tail)W=this.tail.prev,X=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let Z=this.length-1;W;Z--)X=G(X,W.value,Z),W=W.prev;return X}toArray(){let G=new Array(this.length);for(let Y=0,X=this.head;X;Y++)G[Y]=X.value,X=X.next;return G}toArrayReverse(){let G=new Array(this.length);for(let Y=0,X=this.tail;X;Y++)G[Y]=X.value,X=X.prev;return G}slice(G=0,Y=this.length){if(Y<0)Y+=this.length;if(G<0)G+=this.length;let X=new JJ;if(Y<G||Y<0)return X;if(G<0)G=0;if(Y>this.length)Y=this.length;let W=this.head,Z=0;for(Z=0;!!W&&Z<G;Z++)W=W.next;for(;!!W&&Z<Y;Z++,W=W.next)X.push(W.value);return X}sliceReverse(G=0,Y=this.length){if(Y<0)Y+=this.length;if(G<0)G+=this.length;let X=new JJ;if(Y<G||Y<0)return X;if(G<0)G=0;if(Y>this.length)Y=this.length;let W=this.length,Z=this.tail;for(;!!Z&&W>Y;W--)Z=Z.prev;for(;!!Z&&W>G;W--,Z=Z.prev)X.push(Z.value);return X}splice(G,Y=0,...X){if(G>this.length)G=this.length-1;if(G<0)G=this.length+G;let W=this.head;for(let U=0;!!W&&U<G;U++)W=W.next;let Z=[];for(let U=0;!!W&&U<Y;U++)Z.push(W.value),W=this.removeNode(W);if(!W)W=this.tail;else if(W!==this.tail)W=W.prev;for(let U of X)W=Ne0(this,W,U);return Z}reverse(){let G=this.head,Y=this.tail;for(let X=G;X;X=X.prev){let W=X.prev;X.prev=X.next,X.next=W}return this.head=Y,this.tail=G,this}}class nP{list;next;prev;value;constructor(G,Y,X,W){if(this.list=W,this.value=G,Y)Y.next=this,this.prev=Y;else this.prev=void 0;if(X)X.prev=this,this.next=X;else this.next=void 0}}var Te0=(G,Y)=>{if(!Number.isSafeInteger(G))throw Error("cannot encode number outside of javascript safe integer range");else if(G<0)Ee0(G,Y);else Ie0(G,Y);return Y},Ie0=(G,Y)=>{Y[0]=128;for(var X=Y.length;X>1;X--)Y[X-1]=G&255,G=Math.floor(G/256)},Ee0=(G,Y)=>{Y[0]=255;var X=!1;G=G*-1;for(var W=Y.length;W>1;W--){var Z=G&255;if(G=Math.floor(G/256),X)Y[W-1]=VQ1(Z);else if(Z===0)Y[W-1]=0;else X=!0,Y[W-1]=QQ1(Z)}},je0=(G)=>{let Y=G[0],X=Y===128?_e0(G.subarray(1,G.length)):Y===255?Oe0(G):null;if(X===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(X))throw Error("parsed number outside of javascript safe integer range");return X},Oe0=(G)=>{var Y=G.length,X=0,W=!1;for(var Z=Y-1;Z>-1;Z--){var U=Number(G[Z]),K;if(W)K=VQ1(U);else if(U===0)K=U;else W=!0,K=QQ1(U);if(K!==0)X-=K*Math.pow(256,Y-Z-1)}return X},_e0=(G)=>{var Y=G.length,X=0;for(var W=Y-1;W>-1;W--){var Z=Number(G[W]);if(Z!==0)X+=Z*Math.pow(256,Y-W-1)}return X},VQ1=(G)=>(255^G)&255,QQ1=(G)=>(255^G)+1&255,Ox=(G)=>ac.has(G),ac=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),fe0=new Map(Array.from(ac).map((G)=>[G[1],G[0]]));class qJ{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#G="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(G,Y=0,X,W){if(Buffer.isBuffer(G))this.decode(G,Y||0,X,W);else if(G)this.#Y(G)}decode(G,Y,X,W){if(!Y)Y=0;if(!G||!(G.length>=Y+512))throw new Error("need 512 bytes for header");if(this.path=ZU(G,Y,100),this.mode=XJ(G,Y+100,8),this.uid=XJ(G,Y+108,8),this.gid=XJ(G,Y+116,8),this.size=XJ(G,Y+124,12),this.mtime=_x(G,Y+136,12),this.cksum=XJ(G,Y+148,12),W)this.#Y(W,!0);if(X)this.#Y(X);let Z=ZU(G,Y+156,1);if(Ox(Z))this.#G=Z||"0";if(this.#G==="0"&&this.path.slice(-1)==="/")this.#G="5";if(this.#G==="5")this.size=0;if(this.linkpath=ZU(G,Y+157,100),G.subarray(Y+257,Y+265).toString()==="ustar\x0000")if(this.uname=ZU(G,Y+265,32),this.gname=ZU(G,Y+297,32),this.devmaj=XJ(G,Y+329,8)??0,this.devmin=XJ(G,Y+337,8)??0,G[Y+475]!==0){let K=ZU(G,Y+345,155);this.path=K+"/"+this.path}else{let K=ZU(G,Y+345,130);if(K)this.path=K+"/"+this.path;this.atime=_x(G,Y+476,12),this.ctime=_x(G,Y+488,12)}let U=256;for(let K=Y;K<Y+148;K++)U+=G[K];for(let K=Y+156;K<Y+512;K++)U+=G[K];if(this.cksumValid=U===this.cksum,this.cksum===void 0&&U===256)this.nullBlock=!0}#Y(G,Y=!1){Object.assign(this,Object.fromEntries(Object.entries(G).filter(([X,W])=>{return!(W===null||W===void 0||X==="path"&&Y||X==="linkpath"&&Y||X==="global")})))}encode(G,Y=0){if(!G)G=this.block=Buffer.alloc(512);if(this.#G==="Unsupported")this.#G="0";if(!(G.length>=Y+512))throw new Error("need 512 bytes for header");let X=this.ctime||this.atime?130:155,W=Pe0(this.path||"",X),Z=W[0],U=W[1];if(this.needPax=!!W[2],this.needPax=JU(G,Y,100,Z)||this.needPax,this.needPax=WJ(G,Y+100,8,this.mode)||this.needPax,this.needPax=WJ(G,Y+108,8,this.uid)||this.needPax,this.needPax=WJ(G,Y+116,8,this.gid)||this.needPax,this.needPax=WJ(G,Y+124,12,this.size)||this.needPax,this.needPax=fx(G,Y+136,12,this.mtime)||this.needPax,G[Y+156]=this.#G.charCodeAt(0),this.needPax=JU(G,Y+157,100,this.linkpath)||this.needPax,G.write("ustar\x0000",Y+257,8),this.needPax=JU(G,Y+265,32,this.uname)||this.needPax,this.needPax=JU(G,Y+297,32,this.gname)||this.needPax,this.needPax=WJ(G,Y+329,8,this.devmaj)||this.needPax,this.needPax=WJ(G,Y+337,8,this.devmin)||this.needPax,this.needPax=JU(G,Y+345,X,U)||this.needPax,G[Y+475]!==0)this.needPax=JU(G,Y+345,155,U)||this.needPax;else this.needPax=JU(G,Y+345,130,U)||this.needPax,this.needPax=fx(G,Y+476,12,this.atime)||this.needPax,this.needPax=fx(G,Y+488,12,this.ctime)||this.needPax;let K=256;for(let J=Y;J<Y+148;J++)K+=G[J];for(let J=Y+156;J<Y+512;J++)K+=G[J];return this.cksum=K,WJ(G,Y+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#G==="Unsupported"?this.#G:ac.get(this.#G)}get typeKey(){return this.#G}set type(G){let Y=String(fe0.get(G));if(Ox(Y)||Y==="Unsupported")this.#G=Y;else if(Ox(G))this.#G=G;else throw new TypeError("invalid entry type: "+G)}}var Pe0=(G,Y)=>{let W=G,Z="",U=void 0,K=BH.parse(G).root||".";if(Buffer.byteLength(W)<100)U=[W,Z,!1];else{Z=BH.dirname(W),W=BH.basename(W);do if(Buffer.byteLength(W)<=100&&Buffer.byteLength(Z)<=Y)U=[W,Z,!1];else if(Buffer.byteLength(W)>100&&Buffer.byteLength(Z)<=Y)U=[W.slice(0,99),Z,!0];else W=BH.join(BH.basename(Z),W),Z=BH.dirname(Z);while(Z!==K&&U===void 0);if(!U)U=[G.slice(0,99),"",!0]}return U},ZU=(G,Y,X)=>G.subarray(Y,Y+X).toString("utf8").replace(/\0.*/,""),_x=(G,Y,X)=>Ce0(XJ(G,Y,X)),Ce0=(G)=>G===void 0?void 0:new Date(G*1000),XJ=(G,Y,X)=>Number(G[Y])&128?je0(G.subarray(Y,Y+X)):we0(G,Y,X),Be0=(G)=>isNaN(G)?void 0:G,we0=(G,Y,X)=>Be0(parseInt(G.subarray(Y,Y+X).toString("utf8").replace(/\0.*$/,"").trim(),8)),De0={12:8589934591,8:2097151},WJ=(G,Y,X,W)=>W===void 0?!1:W>De0[X]||W<0?(Te0(W,G.subarray(Y,Y+X)),!0):(ke0(G,Y,X,W),!1),ke0=(G,Y,X,W)=>G.write(he0(W,X),Y,X,"ascii"),he0=(G,Y)=>ve0(Math.floor(G).toString(8),Y),ve0=(G,Y)=>(G.length===Y-1?G:new Array(Y-G.length-1).join("0")+G+" ")+"\x00",fx=(G,Y,X,W)=>W===void 0?!1:WJ(G,Y,X,W.getTime()/1000),be0=new Array(156).join("\x00"),JU=(G,Y,X,W)=>W===void 0?!1:(G.write(W+be0,Y,X,"utf8"),W.length!==Buffer.byteLength(W)||W.length>X);class JV{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(G,Y=!1){this.atime=G.atime,this.charset=G.charset,this.comment=G.comment,this.ctime=G.ctime,this.dev=G.dev,this.gid=G.gid,this.global=Y,this.gname=G.gname,this.ino=G.ino,this.linkpath=G.linkpath,this.mtime=G.mtime,this.nlink=G.nlink,this.path=G.path,this.size=G.size,this.uid=G.uid,this.uname=G.uname}encode(){let G=this.encodeBody();if(G==="")return Buffer.allocUnsafe(0);let Y=Buffer.byteLength(G),X=512*Math.ceil(1+Y/512),W=Buffer.allocUnsafe(X);for(let Z=0;Z<512;Z++)W[Z]=0;new qJ({path:("PaxHeader/"+Me0(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:Y,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(W),W.write(G,512,Y,"utf8");for(let Z=Y+512;Z<W.length;Z++)W[Z]=0;return W}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(G){if(this[G]===void 0)return"";let Y=this[G],X=Y instanceof Date?Y.getTime()/1000:Y,W=" "+(G==="dev"||G==="ino"||G==="nlink"?"SCHILY.":"")+G+"="+X+`
3772
3772
  `,Z=Buffer.byteLength(W),U=Math.floor(Math.log(Z)/Math.log(10))+1;if(Z+U>=Math.pow(10,U))U+=1;return U+Z+W}static parse(G,Y,X=!1){return new JV(ge0(ye0(G),Y),X)}}var ge0=(G,Y)=>Y?Object.assign({},Y,G):G,ye0=(G)=>G.replace(/\n$/,"").split(`
3773
3773
  `).reduce(xe0,Object.create(null)),xe0=(G,Y)=>{let X=parseInt(Y,10);if(X!==Buffer.byteLength(Y)+1)return G;Y=Y.slice((X+" ").length);let W=Y.split("="),Z=W.shift();if(!Z)return G;let U=Z.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),K=W.join("=");return G[U]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(U)?new Date(Number(K)*1000):/^[0-9]+$/.test(K)?+K:K,G},eU1=typeof process==="object"&&process?process:{stdout:null,stderr:null},ce0=(G)=>!!G&&typeof G==="object"&&(G instanceof qV||G instanceof FQ1||ue0(G)||le0(G)),ue0=(G)=>!!G&&typeof G==="object"&&G instanceof rc&&typeof G.pipe==="function"&&G.pipe!==FQ1.Writable.prototype.pipe,le0=(G)=>!!G&&typeof G==="object"&&G instanceof rc&&typeof G.write==="function"&&typeof G.end==="function",KW=Symbol("EOF"),HW=Symbol("maybeEmitEnd"),nZ=Symbol("emittedEnd"),Rf=Symbol("emittingEnd"),ZA=Symbol("emittedError"),Lf=Symbol("closed"),Gz1=Symbol("read"),Tf=Symbol("flush"),Yz1=Symbol("flushChunk"),oG=Symbol("encoding"),wH=Symbol("decoder"),H5=Symbol("flowing"),JA=Symbol("paused"),iH=Symbol("resume"),V5=Symbol("buffer"),H7=Symbol("pipes"),Q5=Symbol("bufferLength"),Px=Symbol("bufferPush"),If=Symbol("bufferShift"),p5=Symbol("objectMode"),A2=Symbol("destroyed"),Cx=Symbol("error"),Bx=Symbol("emitData"),Xz1=Symbol("emitEnd"),wx=Symbol("emitEnd2"),aY=Symbol("async"),Dx=Symbol("abort"),Ef=Symbol("aborted"),$A=Symbol("signal"),$U=Symbol("dataListeners"),_3=Symbol("discarded"),UA=(G)=>Promise.resolve().then(G),pe0=(G)=>G(),ie0=(G)=>G==="end"||G==="finish"||G==="prefinish",ae0=(G)=>G instanceof ArrayBuffer||!!G&&typeof G==="object"&&G.constructor&&G.constructor.name==="ArrayBuffer"&&G.byteLength>=0,re0=(G)=>!Buffer.isBuffer(G)&&ArrayBuffer.isView(G);class dc{src;dest;opts;ondrain;constructor(G,Y,X){this.src=G,this.dest=Y,this.opts=X,this.ondrain=()=>G[iH](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(G){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class qQ1 extends dc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(G,Y,X){super(G,Y,X);this.proxyErrors=(W)=>Y.emit("error",W),G.on("error",this.proxyErrors)}}var de0=(G)=>!!G.objectMode,se0=(G)=>!G.objectMode&&!!G.encoding&&G.encoding!=="buffer";class qV extends rc{[H5]=!1;[JA]=!1;[H7]=[];[V5]=[];[p5];[oG];[aY];[wH];[KW]=!1;[nZ]=!1;[Rf]=!1;[Lf]=!1;[ZA]=null;[Q5]=0;[A2]=!1;[$A];[Ef]=!1;[$U]=0;[_3]=!1;writable=!0;readable=!0;constructor(...G){let Y=G[0]||{};super();if(Y.objectMode&&typeof Y.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(de0(Y))this[p5]=!0,this[oG]=null;else if(se0(Y))this[oG]=Y.encoding,this[p5]=!1;else this[p5]=!1,this[oG]=null;if(this[aY]=!!Y.async,this[wH]=this[oG]?new me0(this[oG]):null,Y&&Y.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[V5]});if(Y&&Y.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[H7]});let{signal:X}=Y;if(X)if(this[$A]=X,X.aborted)this[Dx]();else X.addEventListener("abort",()=>this[Dx]())}get bufferLength(){return this[Q5]}get encoding(){return this[oG]}set encoding(G){throw new Error("Encoding must be set at instantiation time")}setEncoding(G){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[p5]}set objectMode(G){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[aY]}set["async"](G){this[aY]=this[aY]||!!G}[Dx](){this[Ef]=!0,this.emit("abort",this[$A]?.reason),this.destroy(this[$A]?.reason)}get aborted(){return this[Ef]}set aborted(G){}write(G,Y,X){if(this[Ef])return!1;if(this[KW])throw new Error("write after end");if(this[A2])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof Y==="function")X=Y,Y="utf8";if(!Y)Y="utf8";let W=this[aY]?UA:pe0;if(!this[p5]&&!Buffer.isBuffer(G)){if(re0(G))G=Buffer.from(G.buffer,G.byteOffset,G.byteLength);else if(ae0(G))G=Buffer.from(G);else if(typeof G!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[p5]){if(this[H5]&&this[Q5]!==0)this[Tf](!0);if(this[H5])this.emit("data",G);else this[Px](G);if(this[Q5]!==0)this.emit("readable");if(X)W(X);return this[H5]}if(!G.length){if(this[Q5]!==0)this.emit("readable");if(X)W(X);return this[H5]}if(typeof G==="string"&&!(Y===this[oG]&&!this[wH]?.lastNeed))G=Buffer.from(G,Y);if(Buffer.isBuffer(G)&&this[oG])G=this[wH].write(G);if(this[H5]&&this[Q5]!==0)this[Tf](!0);if(this[H5])this.emit("data",G);else this[Px](G);if(this[Q5]!==0)this.emit("readable");if(X)W(X);return this[H5]}read(G){if(this[A2])return null;if(this[_3]=!1,this[Q5]===0||G===0||G&&G>this[Q5])return this[HW](),null;if(this[p5])G=null;if(this[V5].length>1&&!this[p5])this[V5]=[this[oG]?this[V5].join(""):Buffer.concat(this[V5],this[Q5])];let Y=this[Gz1](G||null,this[V5][0]);return this[HW](),Y}[Gz1](G,Y){if(this[p5])this[If]();else{let X=Y;if(G===X.length||G===null)this[If]();else if(typeof X==="string")this[V5][0]=X.slice(G),Y=X.slice(0,G),this[Q5]-=G;else this[V5][0]=X.subarray(G),Y=X.subarray(0,G),this[Q5]-=G}if(this.emit("data",Y),!this[V5].length&&!this[KW])this.emit("drain");return Y}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y="utf8";if(G!==void 0)this.write(G,Y);if(X)this.once("end",X);if(this[KW]=!0,this.writable=!1,this[H5]||!this[JA])this[HW]();return this}[iH](){if(this[A2])return;if(!this[$U]&&!this[H7].length)this[_3]=!0;if(this[JA]=!1,this[H5]=!0,this.emit("resume"),this[V5].length)this[Tf]();else if(this[KW])this[HW]();else this.emit("drain")}resume(){return this[iH]()}pause(){this[H5]=!1,this[JA]=!0,this[_3]=!1}get destroyed(){return this[A2]}get flowing(){return this[H5]}get paused(){return this[JA]}[Px](G){if(this[p5])this[Q5]+=1;else this[Q5]+=G.length;this[V5].push(G)}[If](){if(this[p5])this[Q5]-=1;else this[Q5]-=this[V5][0].length;return this[V5].shift()}[Tf](G=!1){do;while(this[Yz1](this[If]())&&this[V5].length);if(!G&&!this[V5].length&&!this[KW])this.emit("drain")}[Yz1](G){return this.emit("data",G),this[H5]}pipe(G,Y){if(this[A2])return G;this[_3]=!1;let X=this[nZ];if(Y=Y||{},G===eU1.stdout||G===eU1.stderr)Y.end=!1;else Y.end=Y.end!==!1;if(Y.proxyErrors=!!Y.proxyErrors,X){if(Y.end)G.end()}else if(this[H7].push(!Y.proxyErrors?new dc(this,G,Y):new qQ1(this,G,Y)),this[aY])UA(()=>this[iH]());else this[iH]();return G}unpipe(G){let Y=this[H7].find((X)=>X.dest===G);if(Y){if(this[H7].length===1){if(this[H5]&&this[$U]===0)this[H5]=!1;this[H7]=[]}else this[H7].splice(this[H7].indexOf(Y),1);Y.unpipe()}}addListener(G,Y){return this.on(G,Y)}on(G,Y){let X=super.on(G,Y);if(G==="data"){if(this[_3]=!1,this[$U]++,!this[H7].length&&!this[H5])this[iH]()}else if(G==="readable"&&this[Q5]!==0)super.emit("readable");else if(ie0(G)&&this[nZ])super.emit(G),this.removeAllListeners(G);else if(G==="error"&&this[ZA]){let W=Y;if(this[aY])UA(()=>W.call(this,this[ZA]));else W.call(this,this[ZA])}return X}removeListener(G,Y){return this.off(G,Y)}off(G,Y){let X=super.off(G,Y);if(G==="data"){if(this[$U]=this.listeners("data").length,this[$U]===0&&!this[_3]&&!this[H7].length)this[H5]=!1}return X}removeAllListeners(G){let Y=super.removeAllListeners(G);if(G==="data"||G===void 0){if(this[$U]=0,!this[_3]&&!this[H7].length)this[H5]=!1}return Y}get emittedEnd(){return this[nZ]}[HW](){if(!this[Rf]&&!this[nZ]&&!this[A2]&&this[V5].length===0&&this[KW]){if(this[Rf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Lf])this.emit("close");this[Rf]=!1}}emit(G,...Y){let X=Y[0];if(G!=="error"&&G!=="close"&&G!==A2&&this[A2])return!1;else if(G==="data")return!this[p5]&&!X?!1:this[aY]?(UA(()=>this[Bx](X)),!0):this[Bx](X);else if(G==="end")return this[Xz1]();else if(G==="close"){if(this[Lf]=!0,!this[nZ]&&!this[A2])return!1;let Z=super.emit("close");return this.removeAllListeners("close"),Z}else if(G==="error"){this[ZA]=X,super.emit(Cx,X);let Z=!this[$A]||this.listeners("error").length?super.emit("error",X):!1;return this[HW](),Z}else if(G==="resume"){let Z=super.emit("resume");return this[HW](),Z}else if(G==="finish"||G==="prefinish"){let Z=super.emit(G);return this.removeAllListeners(G),Z}let W=super.emit(G,...Y);return this[HW](),W}[Bx](G){for(let X of this[H7])if(X.dest.write(G)===!1)this.pause();let Y=this[_3]?!1:super.emit("data",G);return this[HW](),Y}[Xz1](){if(this[nZ])return!1;return this[nZ]=!0,this.readable=!1,this[aY]?(UA(()=>this[wx]()),!0):this[wx]()}[wx](){if(this[wH]){let Y=this[wH].end();if(Y){for(let X of this[H7])X.dest.write(Y);if(!this[_3])super.emit("data",Y)}}for(let Y of this[H7])Y.end();let G=super.emit("end");return this.removeAllListeners("end"),G}async collect(){let G=Object.assign([],{dataLength:0});if(!this[p5])G.dataLength=0;let Y=this.promise();return this.on("data",(X)=>{if(G.push(X),!this[p5])G.dataLength+=X.length}),await Y,G}async concat(){if(this[p5])throw new Error("cannot concat in objectMode");let G=await this.collect();return this[oG]?G.join(""):Buffer.concat(G,G.dataLength)}async promise(){return new Promise((G,Y)=>{this.on(A2,()=>Y(new Error("stream destroyed"))),this.on("error",(X)=>Y(X)),this.on("end",()=>G())})}[Symbol.asyncIterator](){this[_3]=!1;let G=!1,Y=async()=>{return this.pause(),G=!0,{value:void 0,done:!0}};return{next:()=>{if(G)return Y();let W=this.read();if(W!==null)return Promise.resolve({done:!1,value:W});if(this[KW])return Y();let Z,U,K=(Q)=>{this.off("data",J),this.off("end",H),this.off(A2,$),Y(),U(Q)},J=(Q)=>{this.off("error",K),this.off("end",H),this.off(A2,$),this.pause(),Z({value:Q,done:!!this[KW]})},H=()=>{this.off("error",K),this.off("data",J),this.off(A2,$),Y(),Z({done:!0,value:void 0})},$=()=>K(new Error("stream destroyed"));return new Promise((Q,F)=>{U=F,Z=Q,this.once(A2,$),this.once("error",K),this.once("end",H),this.once("data",J)})},throw:Y,return:Y,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[_3]=!1;let G=!1,Y=()=>{return this.pause(),this.off(Cx,Y),this.off(A2,Y),this.off("end",Y),G=!0,{done:!0,value:void 0}},X=()=>{if(G)return Y();let W=this.read();return W===null?Y():{done:!1,value:W}};return this.once("end",Y),this.once(Cx,Y),this.once(A2,Y),{next:X,throw:Y,return:Y,[Symbol.iterator](){return this}}}destroy(G){if(this[A2]){if(G)this.emit("error",G);else this.emit(A2);return this}this[A2]=!0,this[_3]=!0,this[V5].length=0,this[Q5]=0;let Y=this;if(typeof Y.close==="function"&&!this[Lf])Y.close();if(G)this.emit("error",G);else this.emit(A2);return this}static get isStream(){return ce0}}var ne0=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,i4=ne0!=="win32"?(G)=>G:(G)=>G&&G.replace(/\\/g,"/");class sc extends qV{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(G,Y,X){super({});switch(this.pause(),this.extended=Y,this.globalExtended=X,this.header=G,this.remain=G.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=G.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!G.path)throw new Error("no path provided for tar.ReadEntry");if(this.path=i4(G.path),this.mode=G.mode,this.mode)this.mode=this.mode&4095;if(this.uid=G.uid,this.gid=G.gid,this.uname=G.uname,this.gname=G.gname,this.size=this.remain,this.mtime=G.mtime,this.atime=G.atime,this.ctime=G.ctime,this.linkpath=G.linkpath?i4(G.linkpath):void 0,this.uname=G.uname,this.gname=G.gname,Y)this.#G(Y);if(X)this.#G(X,!0)}write(G){let Y=G.length;if(Y>this.blockRemain)throw new Error("writing more to entry than is appropriate");let X=this.remain,W=this.blockRemain;if(this.remain=Math.max(0,X-Y),this.blockRemain=Math.max(0,W-Y),this.ignore)return!0;if(X>=Y)return super.write(G);return super.write(G.subarray(0,X))}#G(G,Y=!1){if(G.path)G.path=i4(G.path);if(G.linkpath)G.linkpath=i4(G.linkpath);Object.assign(this,Object.fromEntries(Object.entries(G).filter(([X,W])=>{return!(W===null||W===void 0||X==="path"&&Y)})))}}var oP=(G,Y,X,W={})=>{if(G.file)W.file=G.file;if(G.cwd)W.cwd=G.cwd;if(W.code=X instanceof Error&&X.code||Y,W.tarCode=Y,!G.strict&&W.recoverable!==!1){if(X instanceof Error)W=Object.assign(X,W),X=X.message;G.emit("warn",Y,X,W)}else if(X instanceof Error)G.emit("error",Object.assign(X,W));else G.emit("error",Object.assign(new Error(`${Y}: ${X}`),W))},oe0=1048576,kx=Buffer.from([31,139]),WG=Symbol("state"),UU=Symbol("writeEntry"),VW=Symbol("readEntry"),hx=Symbol("nextEntry"),Wz1=Symbol("processEntry"),rY=Symbol("extendedHeader"),zA=Symbol("globalExtendedHeader"),oZ=Symbol("meta"),Zz1=Symbol("emitMeta"),R9=Symbol("buffer"),QW=Symbol("queue"),tZ=Symbol("ended"),vx=Symbol("emittedEnd"),zU=Symbol("emit"),c2=Symbol("unzip"),jf=Symbol("consumeChunk"),Of=Symbol("consumeChunkSub"),bx=Symbol("consumeBody"),Jz1=Symbol("consumeMeta"),$z1=Symbol("consumeHeader"),KA=Symbol("consuming"),Mx=Symbol("bufferConcat"),_f=Symbol("maybeEnd"),DH=Symbol("writing"),eZ=Symbol("aborted"),ff=Symbol("onDone"),KU=Symbol("sawValidEntry"),Pf=Symbol("sawNullBlock"),Cf=Symbol("sawEOF"),Uz1=Symbol("closeStream"),te0=()=>!0;class $V extends We0{file;strict;maxMetaEntrySize;filter;brotli;writable=!0;readable=!1;[QW]=new JJ;[R9];[VW];[UU];[WG]="begin";[oZ]="";[rY];[zA];[tZ]=!1;[c2];[eZ]=!1;[KU];[Pf]=!1;[Cf]=!1;[DH]=!1;[KA]=!1;[vx]=!1;constructor(G={}){super();if(this.file=G.file||"",this.on(ff,()=>{if(this[WG]==="begin"||this[KU]===!1)this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),G.ondone)this.on(ff,G.ondone);else this.on(ff,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")});this.strict=!!G.strict,this.maxMetaEntrySize=G.maxMetaEntrySize||oe0,this.filter=typeof G.filter==="function"?G.filter:te0;let Y=G.file&&(G.file.endsWith(".tar.br")||G.file.endsWith(".tbr"));if(this.brotli=!G.gzip&&G.brotli!==void 0?G.brotli:Y?void 0:!1,this.on("end",()=>this[Uz1]()),typeof G.onwarn==="function")this.on("warn",G.onwarn);if(typeof G.onReadEntry==="function")this.on("entry",G.onReadEntry)}warn(G,Y,X={}){oP(this,G,Y,X)}[$z1](G,Y){if(this[KU]===void 0)this[KU]=!1;let X;try{X=new qJ(G,Y,this[rY],this[zA])}catch(W){return this.warn("TAR_ENTRY_INVALID",W)}if(X.nullBlock)if(this[Pf]){if(this[Cf]=!0,this[WG]==="begin")this[WG]="header";this[zU]("eof")}else this[Pf]=!0,this[zU]("nullBlock");else if(this[Pf]=!1,!X.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:X});else if(!X.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:X});else{let W=X.type;if(/^(Symbolic)?Link$/.test(W)&&!X.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:X});else if(!/^(Symbolic)?Link$/.test(W)&&!/^(Global)?ExtendedHeader$/.test(W)&&X.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:X});else{let Z=this[UU]=new sc(X,this[rY],this[zA]);if(!this[KU])if(Z.remain){let U=()=>{if(!Z.invalid)this[KU]=!0};Z.on("end",U)}else this[KU]=!0;if(Z.meta){if(Z.size>this.maxMetaEntrySize)Z.ignore=!0,this[zU]("ignoredEntry",Z),this[WG]="ignore",Z.resume();else if(Z.size>0)this[oZ]="",Z.on("data",(U)=>this[oZ]+=U),this[WG]="meta"}else if(this[rY]=void 0,Z.ignore=Z.ignore||!this.filter(Z.path,Z),Z.ignore)this[zU]("ignoredEntry",Z),this[WG]=Z.remain?"ignore":"header",Z.resume();else{if(Z.remain)this[WG]="body";else this[WG]="header",Z.end();if(!this[VW])this[QW].push(Z),this[hx]();else this[QW].push(Z)}}}}[Uz1](){queueMicrotask(()=>this.emit("close"))}[Wz1](G){let Y=!0;if(!G)this[VW]=void 0,Y=!1;else if(Array.isArray(G)){let[X,...W]=G;this.emit(X,...W)}else if(this[VW]=G,this.emit("entry",G),!G.emittedEnd)G.on("end",()=>this[hx]()),Y=!1;return Y}[hx](){do;while(this[Wz1](this[QW].shift()));if(!this[QW].length){let G=this[VW];if(!G||G.flowing||G.size===G.remain){if(!this[DH])this.emit("drain")}else G.once("drain",()=>this.emit("drain"))}}[bx](G,Y){let X=this[UU];if(!X)throw new Error("attempt to consume body without entry??");let W=X.blockRemain??0,Z=W>=G.length&&Y===0?G:G.subarray(Y,Y+W);if(X.write(Z),!X.blockRemain)this[WG]="header",this[UU]=void 0,X.end();return Z.length}[Jz1](G,Y){let X=this[UU],W=this[bx](G,Y);if(!this[UU]&&X)this[Zz1](X);return W}[zU](G,Y,X){if(!this[QW].length&&!this[VW])this.emit(G,Y,X);else this[QW].push([G,Y,X])}[Zz1](G){switch(this[zU]("meta",this[oZ]),G.type){case"ExtendedHeader":case"OldExtendedHeader":this[rY]=JV.parse(this[oZ],this[rY],!1);break;case"GlobalExtendedHeader":this[zA]=JV.parse(this[oZ],this[zA],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let Y=this[rY]??Object.create(null);this[rY]=Y,Y.path=this[oZ].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let Y=this[rY]||Object.create(null);this[rY]=Y,Y.linkpath=this[oZ].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+G.type)}}abort(G){this[eZ]=!0,this.emit("abort",G),this.warn("TAR_ABORT",G,{recoverable:!1})}write(G,Y,X){if(typeof Y==="function")X=Y,Y=void 0;if(typeof G==="string")G=Buffer.from(G,typeof Y==="string"?Y:"utf8");if(this[eZ])return X?.(),!1;if((this[c2]===void 0||this.brotli===void 0&&this[c2]===!1)&&G){if(this[R9])G=Buffer.concat([this[R9],G]),this[R9]=void 0;if(G.length<kx.length)return this[R9]=G,X?.(),!0;for(let K=0;this[c2]===void 0&&K<kx.length;K++)if(G[K]!==kx[K])this[c2]=!1;let U=this.brotli===void 0;if(this[c2]===!1&&U)if(G.length<512)if(this[tZ])this.brotli=!0;else return this[R9]=G,X?.(),!0;else try{new qJ(G.subarray(0,512)),this.brotli=!1}catch(K){this.brotli=!0}if(this[c2]===void 0||this[c2]===!1&&this.brotli){let K=this[tZ];this[tZ]=!1,this[c2]=this[c2]===void 0?new zQ1({}):new HQ1({}),this[c2].on("data",(H)=>this[jf](H)),this[c2].on("error",(H)=>this.abort(H)),this[c2].on("end",()=>{this[tZ]=!0,this[jf]()}),this[DH]=!0;let J=!!this[c2][K?"end":"write"](G);return this[DH]=!1,X?.(),J}}if(this[DH]=!0,this[c2])this[c2].write(G);else this[jf](G);this[DH]=!1;let Z=this[QW].length?!1:this[VW]?this[VW].flowing:!0;if(!Z&&!this[QW].length)this[VW]?.once("drain",()=>this.emit("drain"));return X?.(),Z}[Mx](G){if(G&&!this[eZ])this[R9]=this[R9]?Buffer.concat([this[R9],G]):G}[_f](){if(this[tZ]&&!this[vx]&&!this[eZ]&&!this[KA]){this[vx]=!0;let G=this[UU];if(G&&G.blockRemain){let Y=this[R9]?this[R9].length:0;if(this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${G.blockRemain} more bytes, only ${Y} available)`,{entry:G}),this[R9])G.write(this[R9]);G.end()}this[zU](ff)}}[jf](G){if(this[KA]&&G)this[Mx](G);else if(!G&&!this[R9])this[_f]();else if(G){if(this[KA]=!0,this[R9]){this[Mx](G);let Y=this[R9];this[R9]=void 0,this[Of](Y)}else this[Of](G);while(this[R9]&&this[R9]?.length>=512&&!this[eZ]&&!this[Cf]){let Y=this[R9];this[R9]=void 0,this[Of](Y)}this[KA]=!1}if(!this[R9]||this[tZ])this[_f]()}[Of](G){let Y=0,X=G.length;while(Y+512<=X&&!this[eZ]&&!this[Cf])switch(this[WG]){case"begin":case"header":this[$z1](G,Y),Y+=512;break;case"ignore":case"body":Y+=this[bx](G,Y);break;case"meta":Y+=this[Jz1](G,Y);break;default:throw new Error("invalid state: "+this[WG])}if(Y<X)if(this[R9])this[R9]=Buffer.concat([G.subarray(Y),this[R9]]);else this[R9]=G.subarray(Y)}end(G,Y,X){if(typeof G==="function")X=G,Y=void 0,G=void 0;if(typeof Y==="function")X=Y,Y=void 0;if(typeof G==="string")G=Buffer.from(G,Y);if(X)this.once("finish",X);if(!this[eZ])if(this[c2]){if(G)this[c2].write(G);this[c2].end()}else{if(this[tZ]=!0,this.brotli===void 0)G=G||Buffer.alloc(0);if(G)this.write(G);this[_f]()}return this}}var eH=(G)=>{let Y=G.length-1,X=-1;while(Y>-1&&G.charAt(Y)==="/")X=Y,Y--;return X===-1?G:G.slice(0,X)},ee0=(G)=>{let Y=G.onReadEntry;G.onReadEntry=Y?(X)=>{Y(X),X.resume()}:(X)=>X.resume()},AQ1=(G,Y)=>{let X=new Map(Y.map((U)=>[eH(U),!0])),W=G.filter,Z=(U,K="")=>{let J=K||st0(U).root||".",H;if(U===J)H=!1;else{let $=X.get(U);if($!==void 0)H=$;else H=Z(dt0(U),J)}return X.set(U,H),H};G.filter=W?(U,K)=>W(U,K)&&Z(eH(U)):(U)=>Z(eH(U))},G18=(G)=>{let Y=new $V(G),X=G.file,W;try{let Z=lH.statSync(X),U=G.maxReadSize||16777216;if(Z.size<U)Y.end(lH.readFileSync(X));else{let K=0,J=Buffer.allocUnsafe(U);W=lH.openSync(X,"r");while(K<Z.size){let H=lH.readSync(W,J,0,U,K);K+=H,Y.write(J.subarray(0,H))}Y.end()}}finally{if(typeof W==="number")try{lH.closeSync(W)}catch(Z){}}},Y18=(G,Y)=>{let X=new $V(G),W=G.maxReadSize||16777216,Z=G.file;return new Promise((K,J)=>{X.on("error",J),X.on("end",K),lH.stat(Z,(H,$)=>{if(H)J(H);else{let Q=new sP(Z,{readSize:W,size:$.size});Q.on("error",J),Q.pipe(X)}})})},FJ=SS(G18,Y18,(G)=>new $V(G),(G)=>new $V(G),(G,Y)=>{if(Y?.length)AQ1(G,Y);if(!G.noResume)ee0(G)}),SQ1=(G,Y,X)=>{if(G&=4095,X)G=(G|384)&-19;if(Y){if(G&256)G|=64;if(G&32)G|=8;if(G&4)G|=1}return G},{isAbsolute:W18,parse:Kz1}=X18,nc=(G)=>{let Y="",X=Kz1(G);while(W18(G)||X.root){let W=G.charAt(0)==="/"&&G.slice(0,4)!=="//?/"?"/":X.root;G=G.slice(W.length),Y+=W,X=Kz1(G)}return[Y,G]},tP=["|","<",">","?",":"],oc=tP.map((G)=>String.fromCharCode(61440+G.charCodeAt(0))),Z18=new Map(tP.map((G,Y)=>[G,oc[Y]])),J18=new Map(oc.map((G,Y)=>[G,tP[Y]])),Hz1=(G)=>tP.reduce((Y,X)=>Y.split(X).join(Z18.get(X)),G),$18=(G)=>oc.reduce((Y,X)=>Y.split(X).join(J18.get(X)),G),NQ1=(G,Y)=>{if(!Y)return i4(G);return G=i4(G).replace(/^\.(\/|$)/,""),eH(Y)+"/"+G},U18=16777216,Vz1=Symbol("process"),Qz1=Symbol("file"),Fz1=Symbol("directory"),gm=Symbol("symlink"),qz1=Symbol("hardlink"),HA=Symbol("header"),JP=Symbol("read"),ym=Symbol("lstat"),$P=Symbol("onlstat"),xm=Symbol("onread"),mm=Symbol("onreadlink"),cm=Symbol("openfile"),um=Symbol("onopenfile"),ZJ=Symbol("close"),IP=Symbol("mode"),lm=Symbol("awaitDrain"),gx=Symbol("ondrain"),sY=Symbol("prefix");class tc extends qV{path;portable;myuid=process.getuid&&process.getuid()||0;myuser="runner";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#G=!1;constructor(G,Y={}){let X=xc(Y);super();if(this.path=i4(G),this.portable=!!X.portable,this.maxReadSize=X.maxReadSize||U18,this.linkCache=X.linkCache||new Map,this.statCache=X.statCache||new Map,this.preservePaths=!!X.preservePaths,this.cwd=i4(X.cwd||process.cwd()),this.strict=!!X.strict,this.noPax=!!X.noPax,this.noMtime=!!X.noMtime,this.mtime=X.mtime,this.prefix=X.prefix?i4(X.prefix):void 0,this.onWriteEntry=X.onWriteEntry,typeof X.onwarn==="function")this.on("warn",X.onwarn);let W=!1;if(!this.preservePaths){let[U,K]=nc(this.path);if(U&&typeof K==="string")this.path=K,W=U}if(this.win32=!!X.win32||process.platform==="win32",this.win32)this.path=$18(this.path.replace(/\\/g,"/")),G=G.replace(/\\/g,"/");if(this.absolute=i4(X.absolute||zz1.resolve(this.cwd,G)),this.path==="")this.path="./";if(W)this.warn("TAR_ENTRY_INFO",`stripping ${W} from absolute path`,{entry:this,path:W+this.path});let Z=this.statCache.get(this.absolute);if(Z)this[$P](Z);else this[ym]()}warn(G,Y,X={}){return oP(this,G,Y,X)}emit(G,...Y){if(G==="error")this.#G=!0;return super.emit(G,...Y)}[ym](){dY.lstat(this.absolute,(G,Y)=>{if(G)return this.emit("error",G);this[$P](Y)})}[$P](G){if(this.statCache.set(this.absolute,G),this.stat=G,!G.isFile())G.size=0;this.type=z18(G),this.emit("stat",G),this[Vz1]()}[Vz1](){switch(this.type){case"File":return this[Qz1]();case"Directory":return this[Fz1]();case"SymbolicLink":return this[gm]();default:return this.end()}}[IP](G){return SQ1(G,this.type==="Directory",this.portable)}[sY](G){return NQ1(G,this.prefix)}[HA](){if(!this.stat)throw new Error("cannot write header before stat");if(this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.onWriteEntry?.(this),this.header=new qJ({path:this[sY](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[sY](this.linkpath):this.linkpath,mode:this[IP](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax)super.write(new JV({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[sY](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[sY](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let G=this.header?.block;if(!G)throw new Error("failed to encode header");super.write(G)}[Fz1](){if(!this.stat)throw new Error("cannot create directory entry without stat");if(this.path.slice(-1)!=="/")this.path+="/";this.stat.size=0,this[HA](),this.end()}[gm](){dY.readlink(this.absolute,(G,Y)=>{if(G)return this.emit("error",G);this[mm](Y)})}[mm](G){this.linkpath=i4(G),this[HA](),this.end()}[qz1](G){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=i4(zz1.relative(this.cwd,G)),this.stat.size=0,this[HA](),this.end()}[Qz1](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let G=`${this.stat.dev}:${this.stat.ino}`,Y=this.linkCache.get(G);if(Y?.indexOf(this.cwd)===0)return this[qz1](Y);this.linkCache.set(G,this.absolute)}if(this[HA](),this.stat.size===0)return this.end();this[cm]()}[cm](){dY.open(this.absolute,"r",(G,Y)=>{if(G)return this.emit("error",G);this[um](Y)})}[um](G){if(this.fd=G,this.#G)return this[ZJ]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let Y=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(Y),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[JP]()}[JP](){let{fd:G,buf:Y,offset:X,length:W,pos:Z}=this;if(G===void 0||Y===void 0)throw new Error("cannot read file without first opening");dY.read(G,Y,X,W,Z,(U,K)=>{if(U)return this[ZJ](()=>this.emit("error",U));this[xm](K)})}[ZJ](G=()=>{}){if(this.fd!==void 0)dY.close(this.fd,G)}[xm](G){if(G<=0&&this.remain>0){let W=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ZJ](()=>this.emit("error",W))}if(G>this.remain){let W=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ZJ](()=>this.emit("error",W))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(G===this.remain)for(let W=G;W<this.length&&G<this.blockRemain;W++)this.buf[W+this.offset]=0,G++,this.remain++;let Y=this.offset===0&&G===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+G);if(!this.write(Y))this[lm](()=>this[gx]());else this[gx]()}[lm](G){this.once("drain",G)}write(G,Y,X){if(typeof Y==="function")X=Y,Y=void 0;if(typeof G==="string")G=Buffer.from(G,typeof Y==="string"?Y:"utf8");if(this.blockRemain<G.length){let W=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",W)}return this.remain-=G.length,this.blockRemain-=G.length,this.pos+=G.length,this.offset+=G.length,super.write(G,null,X)}[gx](){if(!this.remain){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return this[ZJ]((G)=>G?this.emit("error",G):this.end())}if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");if(this.offset>=this.length)this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0;this.length=this.buf.length-this.offset,this[JP]()}}class RQ1 extends tc{sync=!0;[ym](){this[$P](dY.lstatSync(this.absolute))}[gm](){this[mm](dY.readlinkSync(this.absolute))}[cm](){this[um](dY.openSync(this.absolute,"r"))}[JP](){let G=!0;try{let{fd:Y,buf:X,offset:W,length:Z,pos:U}=this;if(Y===void 0||X===void 0)throw new Error("fd and buf must be set in READ method");let K=dY.readSync(Y,X,W,Z,U);this[xm](K),G=!1}finally{if(G)try{this[ZJ](()=>{})}catch(Y){}}}[lm](G){G()}[ZJ](G=()=>{}){if(this.fd!==void 0)dY.closeSync(this.fd);G()}}class LQ1 extends qV{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(G,Y,X={}){return oP(this,G,Y,X)}constructor(G,Y={}){let X=xc(Y);super();this.preservePaths=!!X.preservePaths,this.portable=!!X.portable,this.strict=!!X.strict,this.noPax=!!X.noPax,this.noMtime=!!X.noMtime,this.onWriteEntry=X.onWriteEntry,this.readEntry=G;let{type:W}=G;if(W==="Unsupported")throw new Error("writing entry that should be ignored");if(this.type=W,this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.prefix=X.prefix,this.path=i4(G.path),this.mode=G.mode!==void 0?this[IP](G.mode):void 0,this.uid=this.portable?void 0:G.uid,this.gid=this.portable?void 0:G.gid,this.uname=this.portable?void 0:G.uname,this.gname=this.portable?void 0:G.gname,this.size=G.size,this.mtime=this.noMtime?void 0:X.mtime||G.mtime,this.atime=this.portable?void 0:G.atime,this.ctime=this.portable?void 0:G.ctime,this.linkpath=G.linkpath!==void 0?i4(G.linkpath):void 0,typeof X.onwarn==="function")this.on("warn",X.onwarn);let Z=!1;if(!this.preservePaths){let[K,J]=nc(this.path);if(K&&typeof J==="string")this.path=J,Z=K}if(this.remain=G.size,this.blockRemain=G.startBlockSize,this.onWriteEntry?.(this),this.header=new qJ({path:this[sY](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[sY](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),Z)this.warn("TAR_ENTRY_INFO",`stripping ${Z} from absolute path`,{entry:this,path:Z+this.path});if(this.header.encode()&&!this.noPax)super.write(new JV({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[sY](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[sY](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let U=this.header?.block;if(!U)throw new Error("failed to encode header");super.write(U),G.pipe(this)}[sY](G){return NQ1(G,this.prefix)}[IP](G){return SQ1(G,this.type==="Directory",this.portable)}write(G,Y,X){if(typeof Y==="function")X=Y,Y=void 0;if(typeof G==="string")G=Buffer.from(G,typeof Y==="string"?Y:"utf8");let W=G.length;if(W>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=W,super.write(G,X)}end(G,Y,X){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));if(typeof G==="function")X=G,Y=void 0,G=void 0;if(typeof Y==="function")X=Y,Y=void 0;if(typeof G==="string")G=Buffer.from(G,Y??"utf8");if(X)this.once("finish",X);return G?super.end(G,X):super.end(X),this}}var z18=(G)=>G.isFile()?"File":G.isDirectory()?"Directory":G.isSymbolicLink()?"SymbolicLink":"Unsupported";class pm{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(G,Y){this.path=G||"./",this.absolute=Y}}var Sz1=Buffer.alloc(1024),UP=Symbol("onStat"),VA=Symbol("ended"),tG=Symbol("queue"),kH=Symbol("current"),HU=Symbol("process"),QA=Symbol("processing"),Nz1=Symbol("processJob"),eG=Symbol("jobs"),yx=Symbol("jobDone"),zP=Symbol("addFSEntry"),Rz1=Symbol("addTarEntry"),im=Symbol("stat"),am=Symbol("readdir"),KP=Symbol("onreaddir"),HP=Symbol("pipe"),Lz1=Symbol("entry"),xx=Symbol("entryOpt"),VP=Symbol("writeEntryClass"),TQ1=Symbol("write"),mx=Symbol("ondrain");class NS extends qV{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[VP];onWriteEntry;[tG];[eG]=0;[QA]=!1;[VA]=!1;constructor(G={}){super();if(this.opt=G,this.file=G.file||"",this.cwd=G.cwd||process.cwd(),this.maxReadSize=G.maxReadSize,this.preservePaths=!!G.preservePaths,this.strict=!!G.strict,this.noPax=!!G.noPax,this.prefix=i4(G.prefix||""),this.linkCache=G.linkCache||new Map,this.statCache=G.statCache||new Map,this.readdirCache=G.readdirCache||new Map,this.onWriteEntry=G.onWriteEntry,this[VP]=tc,typeof G.onwarn==="function")this.on("warn",G.onwarn);if(this.portable=!!G.portable,G.gzip||G.brotli){if(G.gzip&&G.brotli)throw new TypeError("gzip and brotli are mutually exclusive");if(G.gzip){if(typeof G.gzip!=="object")G.gzip={};if(this.portable)G.gzip.portable=!0;this.zip=new UQ1(G.gzip)}if(G.brotli){if(typeof G.brotli!=="object")G.brotli={};this.zip=new KQ1(G.brotli)}if(!this.zip)throw new Error("impossible");let Y=this.zip;Y.on("data",(X)=>super.write(X)),Y.on("end",()=>super.end()),Y.on("drain",()=>this[mx]()),this.on("resume",()=>Y.resume())}else this.on("drain",this[mx]);if(this.noDirRecurse=!!G.noDirRecurse,this.follow=!!G.follow,this.noMtime=!!G.noMtime,G.mtime)this.mtime=G.mtime;this.filter=typeof G.filter==="function"?G.filter:()=>!0,this[tG]=new JJ,this[eG]=0,this.jobs=Number(G.jobs)||4,this[QA]=!1,this[VA]=!1}[TQ1](G){return super.write(G)}add(G){return this.write(G),this}end(G,Y,X){if(typeof G==="function")X=G,G=void 0;if(typeof Y==="function")X=Y,Y=void 0;if(G)this.add(G);if(this[VA]=!0,this[HU](),X)X();return this}write(G){if(this[VA])throw new Error("write after end");if(G instanceof sc)this[Rz1](G);else this[zP](G);return this.flowing}[Rz1](G){let Y=i4(Az1.resolve(this.cwd,G.path));if(!this.filter(G.path,G))G.resume();else{let X=new pm(G.path,Y);X.entry=new LQ1(G,this[xx](X)),X.entry.on("end",()=>this[yx](X)),this[eG]+=1,this[tG].push(X)}this[HU]()}[zP](G){let Y=i4(Az1.resolve(this.cwd,G));this[tG].push(new pm(G,Y)),this[HU]()}[im](G){G.pending=!0,this[eG]+=1;let Y=this.follow?"stat":"lstat";TP[Y](G.absolute,(X,W)=>{if(G.pending=!1,this[eG]-=1,X)this.emit("error",X);else this[UP](G,W)})}[UP](G,Y){if(this.statCache.set(G.absolute,Y),G.stat=Y,!this.filter(G.path,Y))G.ignore=!0;this[HU]()}[am](G){G.pending=!0,this[eG]+=1,TP.readdir(G.absolute,(Y,X)=>{if(G.pending=!1,this[eG]-=1,Y)return this.emit("error",Y);this[KP](G,X)})}[KP](G,Y){this.readdirCache.set(G.absolute,Y),G.readdir=Y,this[HU]()}[HU](){if(this[QA])return;this[QA]=!0;for(let G=this[tG].head;!!G&&this[eG]<this.jobs;G=G.next)if(this[Nz1](G.value),G.value.ignore){let Y=G.next;this[tG].removeNode(G),G.next=Y}if(this[QA]=!1,this[VA]&&!this[tG].length&&this[eG]===0)if(this.zip)this.zip.end(Sz1);else super.write(Sz1),super.end()}get[kH](){return this[tG]&&this[tG].head&&this[tG].head.value}[yx](G){this[tG].shift(),this[eG]-=1,this[HU]()}[Nz1](G){if(G.pending)return;if(G.entry){if(G===this[kH]&&!G.piped)this[HP](G);return}if(!G.stat){let Y=this.statCache.get(G.absolute);if(Y)this[UP](G,Y);else this[im](G)}if(!G.stat)return;if(G.ignore)return;if(!this.noDirRecurse&&G.stat.isDirectory()&&!G.readdir){let Y=this.readdirCache.get(G.absolute);if(Y)this[KP](G,Y);else this[am](G);if(!G.readdir)return}if(G.entry=this[Lz1](G),!G.entry){G.ignore=!0;return}if(G===this[kH]&&!G.piped)this[HP](G)}[xx](G){return{onwarn:(Y,X,W)=>this.warn(Y,X,W),noPax:this.noPax,cwd:this.cwd,absolute:G.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Lz1](G){this[eG]+=1;try{return new this[VP](G.path,this[xx](G)).on("end",()=>this[yx](G)).on("error",(X)=>this.emit("error",X))}catch(Y){this.emit("error",Y)}}[mx](){if(this[kH]&&this[kH].entry)this[kH].entry.resume()}[HP](G){if(G.piped=!0,G.readdir)G.readdir.forEach((W)=>{let Z=G.path,U=Z==="./"?"":Z.replace(/\/*$/,"/");this[zP](U+W)});let Y=G.entry,X=this.zip;if(!Y)throw new Error("cannot pipe without source");if(X)Y.on("data",(W)=>{if(!X.write(W))Y.pause()});else Y.on("data",(W)=>{if(!super.write(W))Y.pause()})}pause(){if(this.zip)this.zip.pause();return super.pause()}warn(G,Y,X={}){oP(this,G,Y,X)}}class eP extends NS{sync=!0;constructor(G){super(G);this[VP]=RQ1}pause(){}resume(){}[im](G){let Y=this.follow?"statSync":"lstatSync";this[UP](G,TP[Y](G.absolute))}[am](G){this[KP](G,TP.readdirSync(G.absolute))}[HP](G){let Y=G.entry,X=this.zip;if(G.readdir)G.readdir.forEach((W)=>{let Z=G.path,U=Z==="./"?"":Z.replace(/\/*$/,"/");this[zP](U+W)});if(!Y)throw new Error("Cannot pipe without source");if(X)Y.on("data",(W)=>{X.write(W)});else Y.on("data",(W)=>{super[TQ1](W)})}}var K18=(G,Y)=>{let X=new eP(G),W=new yc(G.file,{mode:G.mode||438});X.pipe(W),IQ1(X,Y)},H18=(G,Y)=>{let X=new NS(G),W=new AS(G.file,{mode:G.mode||438});X.pipe(W);let Z=new Promise((U,K)=>{W.on("error",K),W.on("close",U),X.on("error",K)});return EQ1(X,Y),Z},IQ1=(G,Y)=>{Y.forEach((X)=>{if(X.charAt(0)==="@")FJ({file:ZQ1.resolve(G.cwd,X.slice(1)),sync:!0,noResume:!0,onReadEntry:(W)=>G.add(W)});else G.add(X)}),G.end()},EQ1=async(G,Y)=>{for(let X=0;X<Y.length;X++){let W=String(Y[X]);if(W.charAt(0)==="@")await FJ({file:ZQ1.resolve(String(G.cwd),W.slice(1)),noResume:!0,onReadEntry:(Z)=>{G.add(Z)}});else G.add(W)}G.end()},V18=(G,Y)=>{let X=new eP(G);return IQ1(X,Y),X},Q18=(G,Y)=>{let X=new NS(G);return EQ1(X,Y),X},_l4=SS(K18,H18,V18,Q18,(G,Y)=>{if(!Y?.length)throw new TypeError("no paths specified to add to archive")}),q18=process.env.__FAKE_PLATFORM__||process.platform,A18=q18==="win32",{O_CREAT:S18,O_TRUNC:N18,O_WRONLY:R18}=_Q1.constants,fQ1=Number(process.env.__FAKE_FS_O_FILENAME__)||_Q1.constants.UV_FS_O_FILEMAP||0,L18=A18&&!!fQ1,T18=524288,I18=fQ1|N18|S18|R18,PQ1=!L18?()=>"w":(G)=>G<T18?I18:"w",rm=(G,Y,X)=>{try{return GC.lchownSync(G,Y,X)}catch(W){if(W?.code!=="ENOENT")throw W}},EP=(G,Y,X,W)=>{GC.lchown(G,Y,X,(Z)=>{W(Z&&Z?.code!=="ENOENT"?Z:null)})},E18=(G,Y,X,W,Z)=>{if(Y.isDirectory())CQ1(hA.resolve(G,Y.name),X,W,(U)=>{if(U)return Z(U);let K=hA.resolve(G,Y.name);EP(K,X,W,Z)});else{let U=hA.resolve(G,Y.name);EP(U,X,W,Z)}},CQ1=(G,Y,X,W)=>{GC.readdir(G,{withFileTypes:!0},(Z,U)=>{if(Z){if(Z.code==="ENOENT")return W();else if(Z.code!=="ENOTDIR"&&Z.code!=="ENOTSUP")return W(Z)}if(Z||!U.length)return EP(G,Y,X,W);let K=U.length,J=null,H=($)=>{if(J)return;if($)return W(J=$);if(--K===0)return EP(G,Y,X,W)};for(let $ of U)E18(G,$,Y,X,H)})},j18=(G,Y,X,W)=>{if(Y.isDirectory())BQ1(hA.resolve(G,Y.name),X,W);rm(hA.resolve(G,Y.name),X,W)},BQ1=(G,Y,X)=>{let W;try{W=GC.readdirSync(G,{withFileTypes:!0})}catch(Z){let U=Z;if(U?.code==="ENOENT")return;else if(U?.code==="ENOTDIR"||U?.code==="ENOTSUP")return rm(G,Y,X);else throw U}for(let Z of W)j18(G,Z,Y,X);return rm(G,Y,X)},NJ=(G)=>{if(!G)G={mode:511};else if(typeof G==="object")G={mode:511,...G};else if(typeof G==="number")G={mode:G};else if(typeof G==="string")G={mode:parseInt(G,8)};else throw new TypeError("invalid options argument");let Y=G,X=G.fs||{};return G.mkdir=G.mkdir||X.mkdir||O18,G.mkdirAsync=G.mkdirAsync?G.mkdirAsync:async(W,Z)=>{return new Promise((U,K)=>Y.mkdir(W,Z,(J,H)=>J?K(J):U(H)))},G.stat=G.stat||X.stat||f18,G.statAsync=G.statAsync?G.statAsync:async(W)=>new Promise((Z,U)=>Y.stat(W,(K,J)=>K?U(K):Z(J))),G.statSync=G.statSync||X.statSync||P18,G.mkdirSync=G.mkdirSync||X.mkdirSync||_18,Y},IU=(G,Y,X)=>{let W=wQ1(G),Z={...NJ(Y),recursive:!1};if(W===G)try{return Z.mkdirSync(G,Z)}catch(U){let K=U;if(K&&K.code!=="EISDIR")throw U;return}try{return Z.mkdirSync(G,Z),X||G}catch(U){let K=U;if(K&&K.code==="ENOENT")return IU(G,Z,IU(W,Z,X));if(K&&K.code!=="EEXIST"&&K&&K.code!=="EROFS")throw U;try{if(!Z.statSync(G).isDirectory())throw U}catch(J){throw U}}},GV=Object.assign(async(G,Y,X)=>{let W=NJ(Y);W.recursive=!1;let Z=wQ1(G);if(Z===G)return W.mkdirAsync(G,W).catch((U)=>{let K=U;if(K&&K.code!=="EISDIR")throw U});return W.mkdirAsync(G,W).then(()=>X||G,async(U)=>{let K=U;if(K&&K.code==="ENOENT")return GV(Z,W).then((J)=>GV(G,W,J));if(K&&K.code!=="EEXIST"&&K.code!=="EROFS")throw U;return W.statAsync(G).then((J)=>{if(J.isDirectory())return X;else throw U},()=>{throw U})})},{sync:IU}),hQ1=async(G,Y,X)=>{if(X===Y)return;return G.statAsync(Y).then((W)=>W.isDirectory()?X:void 0,(W)=>{let Z=W;return Z&&Z.code==="ENOENT"?hQ1(G,kQ1(Y),Y):void 0})},vQ1=(G,Y,X)=>{if(X===Y)return;try{return G.statSync(Y).isDirectory()?X:void 0}catch(W){let Z=W;return Z&&Z.code==="ENOENT"?vQ1(G,kQ1(Y),Y):void 0}},jP=(G,Y)=>{let X=NJ(Y);if(X.recursive=!0,DQ1(G)===G)return X.mkdirSync(G,X);let Z=vQ1(X,G);try{return X.mkdirSync(G,X),Z}catch(U){let K=U;if(K&&K.code==="ENOENT")return IU(G,X);else throw U}},cx=Object.assign(async(G,Y)=>{let X={...NJ(Y),recursive:!0};if(DQ1(G)===G)return await X.mkdirAsync(G,X);return hQ1(X,G).then((Z)=>X.mkdirAsync(G,X).then((U)=>Z||U).catch((U)=>{let K=U;if(K&&K.code==="ENOENT")return GV(G,X);else throw U}))},{sync:jP}),w18=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,bQ1=(G)=>{if(/\0/.test(G))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:G,code:"ERR_INVALID_ARG_VALUE"});if(G=B18(G),w18==="win32"){let Y=/[*|"<>?:]/,{root:X}=C18(G);if(Y.test(G.substring(X.length)))throw Object.assign(new Error("Illegal characters in path."),{path:G,code:"EINVAL"})}return G},h18=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,ux=h18.replace(/^v/,"").split("."),MQ1=+ux[0]>10||+ux[0]===10&&+ux[1]>=12,ec=!MQ1?()=>!1:(G)=>NJ(G).mkdirSync===k18,Tz1=Object.assign(!MQ1?()=>!1:(G)=>NJ(G).mkdir===D18,{sync:ec}),dm=(G,Y)=>{G=bQ1(G);let X=NJ(Y);return ec(X)?jP(G,X):IU(G,X)},v18=Object.assign(async(G,Y)=>{G=bQ1(G);let X=NJ(Y);return Tz1(X)?cx(G,X):GV(G,X)},{mkdirpSync:dm,mkdirpNative:cx,mkdirpNativeSync:jP,mkdirpManual:GV,mkdirpManualSync:IU,sync:dm,native:cx,nativeSync:jP,manual:GV,manualSync:IU,useNative:Tz1,useNativeSync:ec});class Gu extends Error{path;code;syscall="chdir";constructor(G,Y){super(`${Y}: Cannot cd into '${G}'`);this.path=G,this.code=Y}get name(){return"CwdError"}}class Yu extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(G,Y){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link");this.symlink=G,this.path=Y}get name(){return"SymlinkError"}}var _P=(G,Y)=>G.get(i4(Y)),CA=(G,Y,X)=>G.set(i4(Y),X),b18=(G,Y)=>{JG.stat(G,(X,W)=>{if(X||!W.isDirectory())X=new Gu(G,X?.code||"ENOTDIR");Y(X)})},M18=(G,Y,X)=>{G=i4(G);let W=Y.umask??18,Z=Y.mode|448,U=(Z&W)!==0,K=Y.uid,J=Y.gid,H=typeof K==="number"&&typeof J==="number"&&(K!==Y.processUid||J!==Y.processGid),$=Y.preserve,Q=Y.unlink,F=Y.cache,z=i4(Y.cwd),V=(N,R)=>{if(N)X(N);else if(CA(F,G,!0),R&&H)CQ1(R,K,J,(j)=>V(j));else if(U)JG.chmod(G,Z,X);else X()};if(F&&_P(F,G)===!0)return V();if(G===z)return b18(G,V);if($)return v18(G,{mode:Z}).then((N)=>V(null,N??void 0),V);let S=i4(OP.relative(z,G)).split("/");fP(z,S,Z,F,Q,z,void 0,V)},fP=(G,Y,X,W,Z,U,K,J)=>{if(!Y.length)return J(null,K);let H=Y.shift(),$=i4(OP.resolve(G+"/"+H));if(_P(W,$))return fP($,Y,X,W,Z,U,K,J);JG.mkdir($,X,gQ1($,Y,X,W,Z,U,K,J))},gQ1=(G,Y,X,W,Z,U,K,J)=>(H)=>{if(H)JG.lstat(G,($,Q)=>{if($)$.path=$.path&&i4($.path),J($);else if(Q.isDirectory())fP(G,Y,X,W,Z,U,K,J);else if(Z)JG.unlink(G,(F)=>{if(F)return J(F);JG.mkdir(G,X,gQ1(G,Y,X,W,Z,U,K,J))});else if(Q.isSymbolicLink())return J(new Yu(G,G+"/"+Y.join("/")));else J(H)});else K=K||G,fP(G,Y,X,W,Z,U,K,J)},g18=(G)=>{let Y=!1,X=void 0;try{Y=JG.statSync(G).isDirectory()}catch(W){X=W?.code}finally{if(!Y)throw new Gu(G,X??"ENOTDIR")}},y18=(G,Y)=>{G=i4(G);let X=Y.umask??18,W=Y.mode|448,Z=(W&X)!==0,U=Y.uid,K=Y.gid,J=typeof U==="number"&&typeof K==="number"&&(U!==Y.processUid||K!==Y.processGid),H=Y.preserve,$=Y.unlink,Q=Y.cache,F=i4(Y.cwd),z=(N)=>{if(CA(Q,G,!0),N&&J)BQ1(N,U,K);if(Z)JG.chmodSync(G,W)};if(Q&&_P(Q,G)===!0)return z();if(G===F)return g18(F),z();if(H)return z(dm(G,W)??void 0);let q=i4(OP.relative(F,G)).split("/"),S=void 0;for(let N=q.shift(),R=F;N&&(R+="/"+N);N=q.shift()){if(R=i4(OP.resolve(R)),_P(Q,R))continue;try{JG.mkdirSync(R,W),S=S||R,CA(Q,R,!0)}catch(j){let _=JG.lstatSync(R);if(_.isDirectory()){CA(Q,R,!0);continue}else if($){JG.unlinkSync(R),JG.mkdirSync(R,W),S=S||R,CA(Q,R,!0);continue}else if(_.isSymbolicLink())return new Yu(R,R+"/"+q.join("/"))}}return z(S)},lx=Object.create(null),{hasOwnProperty:x18}=Object.prototype,yQ1=(G)=>{if(!x18.call(lx,G))lx[G]=G.normalize("NFD");return lx[G]},m18=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,c18=m18==="win32",u18=(G)=>{return G.split("/").slice(0,-1).reduce((X,W)=>{let Z=X[X.length-1];if(Z!==void 0)W=xQ1(Z,W);return X.push(W||"/"),X},[])};class mQ1{#G=new Map;#Y=new Map;#X=new Set;reserve(G,Y){G=c18?["win32 parallelization disabled"]:G.map((W)=>{return eH(xQ1(yQ1(W))).toLowerCase()});let X=new Set(G.map((W)=>u18(W)).reduce((W,Z)=>W.concat(Z)));this.#Y.set(Y,{dirs:X,paths:G});for(let W of G){let Z=this.#G.get(W);if(!Z)this.#G.set(W,[Y]);else Z.push(Y)}for(let W of X){let Z=this.#G.get(W);if(!Z)this.#G.set(W,[new Set([Y])]);else{let U=Z[Z.length-1];if(U instanceof Set)U.add(Y);else Z.push(new Set([Y]))}}return this.#Z(Y)}#W(G){let Y=this.#Y.get(G);if(!Y)throw new Error("function does not have any path reservations");return{paths:Y.paths.map((X)=>this.#G.get(X)),dirs:[...Y.dirs].map((X)=>this.#G.get(X))}}check(G){let{paths:Y,dirs:X}=this.#W(G);return Y.every((W)=>W&&W[0]===G)&&X.every((W)=>W&&W[0]instanceof Set&&W[0].has(G))}#Z(G){if(this.#X.has(G)||!this.check(G))return!1;return this.#X.add(G),G(()=>this.#J(G)),!0}#J(G){if(!this.#X.has(G))return!1;let Y=this.#Y.get(G);if(!Y)throw new Error("invalid reservation");let{paths:X,dirs:W}=Y,Z=new Set;for(let U of X){let K=this.#G.get(U);if(!K||K?.[0]!==G)continue;let J=K[1];if(!J){this.#G.delete(U);continue}if(K.shift(),typeof J==="function")Z.add(J);else for(let H of J)Z.add(H)}for(let U of W){let K=this.#G.get(U),J=K?.[0];if(!K||!(J instanceof Set))continue;if(J.size===1&&K.length===1){this.#G.delete(U);continue}else if(J.size===1){K.shift();let H=K[0];if(typeof H==="function")Z.add(H)}else J.delete(G)}return this.#X.delete(G),Z.forEach((U)=>this.#Z(U)),!0}}var Iz1=Symbol("onEntry"),sm=Symbol("checkFs"),Ez1=Symbol("checkFs2"),QP=Symbol("pruneCache"),nm=Symbol("isReusable"),ZG=Symbol("makeFs"),om=Symbol("file"),tm=Symbol("directory"),FP=Symbol("link"),jz1=Symbol("symlink"),Oz1=Symbol("hardlink"),_z1=Symbol("unsupported"),fz1=Symbol("checkPath"),zJ=Symbol("mkdir"),i5=Symbol("onError"),Bf=Symbol("pending"),Pz1=Symbol("pend"),hH=Symbol("unpend"),px=Symbol("ended"),ix=Symbol("maybeClose"),em=Symbol("skip"),vA=Symbol("doChown"),bA=Symbol("uid"),MA=Symbol("gid"),gA=Symbol("checkedCwd"),l18=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,yA=l18==="win32",p18=1024,i18=(G,Y)=>{if(!yA)return h6.unlink(G,Y);let X=G+".DELETE."+OQ1(16).toString("hex");h6.rename(G,X,(W)=>{if(W)return Y(W);h6.unlink(X,Y)})},a18=(G)=>{if(!yA)return h6.unlinkSync(G);let Y=G+".DELETE."+OQ1(16).toString("hex");h6.renameSync(G,Y),h6.unlinkSync(Y)},Cz1=(G,Y,X)=>G!==void 0&&G===G>>>0?G:Y!==void 0&&Y===Y>>>0?Y:X,Bz1=(G)=>eH(i4(yQ1(G))).toLowerCase(),r18=(G,Y)=>{Y=Bz1(Y);for(let X of G.keys()){let W=Bz1(X);if(W===Y||W.indexOf(Y+"/")===0)G.delete(X)}},d18=(G)=>{for(let Y of G.keys())G.delete(Y)};class YC extends $V{[px]=!1;[gA]=!1;[Bf]=0;reservations=new mQ1;transform;writable=!0;readable=!1;dirCache;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(G={}){G.ondone=()=>{this[px]=!0,this[ix]()};super(G);if(this.transform=G.transform,this.dirCache=G.dirCache||new Map,this.chmod=!!G.chmod,typeof G.uid==="number"||typeof G.gid==="number"){if(typeof G.uid!=="number"||typeof G.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(G.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=G.uid,this.gid=G.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;if(G.preserveOwner===void 0&&typeof G.uid!=="number")this.preserveOwner=!!(process.getuid&&process.getuid()===0);else this.preserveOwner=!!G.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof G.maxDepth==="number"?G.maxDepth:p18,this.forceChown=G.forceChown===!0,this.win32=!!G.win32||yA,this.newer=!!G.newer,this.keep=!!G.keep,this.noMtime=!!G.noMtime,this.preservePaths=!!G.preservePaths,this.unlink=!!G.unlink,this.cwd=i4(qW.resolve(G.cwd||process.cwd())),this.strip=Number(G.strip)||0,this.processUmask=!this.chmod?0:typeof G.processUmask==="number"?G.processUmask:process.umask(),this.umask=typeof G.umask==="number"?G.umask:this.processUmask,this.dmode=G.dmode||511&~this.umask,this.fmode=G.fmode||438&~this.umask,this.on("entry",(Y)=>this[Iz1](Y))}warn(G,Y,X={}){if(G==="TAR_BAD_ARCHIVE"||G==="TAR_ABORT")X.recoverable=!1;return super.warn(G,Y,X)}[ix](){if(this[px]&&this[Bf]===0)this.emit("prefinish"),this.emit("finish"),this.emit("end")}[fz1](G){let Y=i4(G.path),X=Y.split("/");if(this.strip){if(X.length<this.strip)return!1;if(G.type==="Link"){let W=i4(String(G.linkpath)).split("/");if(W.length>=this.strip)G.linkpath=W.slice(this.strip).join("/");else return!1}X.splice(0,this.strip),G.path=X.join("/")}if(isFinite(this.maxDepth)&&X.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:G,path:Y,depth:X.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(X.includes("..")||yA&&/^[a-z]:\.\.$/i.test(X[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:G,path:Y}),!1;let[W,Z]=nc(Y);if(W)G.path=String(Z),this.warn("TAR_ENTRY_INFO",`stripping ${W} from absolute path`,{entry:G,path:Y})}if(qW.isAbsolute(G.path))G.absolute=i4(qW.resolve(G.path));else G.absolute=i4(qW.resolve(this.cwd,G.path));if(!this.preservePaths&&typeof G.absolute==="string"&&G.absolute.indexOf(this.cwd+"/")!==0&&G.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:G,path:i4(G.path),resolvedPath:G.absolute,cwd:this.cwd}),!1;if(G.absolute===this.cwd&&G.type!=="Directory"&&G.type!=="GNUDumpDir")return!1;if(this.win32){let{root:W}=qW.win32.parse(String(G.absolute));G.absolute=W+Hz1(String(G.absolute).slice(W.length));let{root:Z}=qW.win32.parse(G.path);G.path=Z+Hz1(G.path.slice(Z.length))}return!0}[Iz1](G){if(!this[fz1](G))return G.resume();switch(F18.equal(typeof G.absolute,"string"),G.type){case"Directory":case"GNUDumpDir":if(G.mode)G.mode=G.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[sm](G);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[_z1](G)}}[i5](G,Y){if(G.name==="CwdError")this.emit("error",G);else this.warn("TAR_ENTRY_ERROR",G,{entry:Y}),this[hH](),Y.resume()}[zJ](G,Y,X){M18(i4(G),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:Y},X)}[vA](G){return this.forceChown||this.preserveOwner&&(typeof G.uid==="number"&&G.uid!==this.processUid||typeof G.gid==="number"&&G.gid!==this.processGid)||typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid}[bA](G){return Cz1(this.uid,G.uid,this.processUid)}[MA](G){return Cz1(this.gid,G.gid,this.processGid)}[om](G,Y){let X=typeof G.mode==="number"?G.mode&4095:this.fmode,W=new AS(String(G.absolute),{flags:PQ1(G.size),mode:X,autoClose:!1});W.on("error",(J)=>{if(W.fd)h6.close(W.fd,()=>{});W.write=()=>!0,this[i5](J,G),Y()});let Z=1,U=(J)=>{if(J){if(W.fd)h6.close(W.fd,()=>{});this[i5](J,G),Y();return}if(--Z===0){if(W.fd!==void 0)h6.close(W.fd,(H)=>{if(H)this[i5](H,G);else this[hH]();Y()})}};W.on("finish",()=>{let J=String(G.absolute),H=W.fd;if(typeof H==="number"&&G.mtime&&!this.noMtime){Z++;let $=G.atime||new Date,Q=G.mtime;h6.futimes(H,$,Q,(F)=>F?h6.utimes(J,$,Q,(z)=>U(z&&F)):U())}if(typeof H==="number"&&this[vA](G)){Z++;let $=this[bA](G),Q=this[MA](G);if(typeof $==="number"&&typeof Q==="number")h6.fchown(H,$,Q,(F)=>F?h6.chown(J,$,Q,(z)=>U(z&&F)):U())}U()});let K=this.transform?this.transform(G)||G:G;if(K!==G)K.on("error",(J)=>{this[i5](J,G),Y()}),G.pipe(K);K.pipe(W)}[tm](G,Y){let X=typeof G.mode==="number"?G.mode&4095:this.dmode;this[zJ](String(G.absolute),X,(W)=>{if(W){this[i5](W,G),Y();return}let Z=1,U=()=>{if(--Z===0)Y(),this[hH](),G.resume()};if(G.mtime&&!this.noMtime)Z++,h6.utimes(String(G.absolute),G.atime||new Date,G.mtime,U);if(this[vA](G))Z++,h6.chown(String(G.absolute),Number(this[bA](G)),Number(this[MA](G)),U);U()})}[_z1](G){G.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${G.type}`,{entry:G}),G.resume()}[jz1](G,Y){this[FP](G,String(G.linkpath),"symlink",Y)}[Oz1](G,Y){let X=i4(qW.resolve(this.cwd,String(G.linkpath)));this[FP](G,X,"link",Y)}[Pz1](){this[Bf]++}[hH](){this[Bf]--,this[ix]()}[em](G){this[hH](),G.resume()}[nm](G,Y){return G.type==="File"&&!this.unlink&&Y.isFile()&&Y.nlink<=1&&!yA}[sm](G){this[Pz1]();let Y=[G.path];if(G.linkpath)Y.push(G.linkpath);this.reservations.reserve(Y,(X)=>this[Ez1](G,X))}[QP](G){if(G.type==="SymbolicLink")d18(this.dirCache);else if(G.type!=="Directory")r18(this.dirCache,String(G.absolute))}[Ez1](G,Y){this[QP](G);let X=(K)=>{this[QP](G),Y(K)},W=()=>{this[zJ](this.cwd,this.dmode,(K)=>{if(K){this[i5](K,G),X();return}this[gA]=!0,Z()})},Z=()=>{if(G.absolute!==this.cwd){let K=i4(qW.dirname(String(G.absolute)));if(K!==this.cwd)return this[zJ](K,this.dmode,(J)=>{if(J){this[i5](J,G),X();return}U()})}U()},U=()=>{h6.lstat(String(G.absolute),(K,J)=>{if(J&&(this.keep||this.newer&&J.mtime>(G.mtime??J.mtime))){this[em](G),X();return}if(K||this[nm](G,J))return this[ZG](null,G,X);if(J.isDirectory()){if(G.type==="Directory"){let H=this.chmod&&G.mode&&(J.mode&4095)!==G.mode,$=(Q)=>this[ZG](Q??null,G,X);if(!H)return $();return h6.chmod(String(G.absolute),Number(G.mode),$)}if(G.absolute!==this.cwd)return h6.rmdir(String(G.absolute),(H)=>this[ZG](H??null,G,X))}if(G.absolute===this.cwd)return this[ZG](null,G,X);i18(String(G.absolute),(H)=>this[ZG](H??null,G,X))})};if(this[gA])Z();else W()}[ZG](G,Y,X){if(G){this[i5](G,Y),X();return}switch(Y.type){case"File":case"OldFile":case"ContiguousFile":return this[om](Y,X);case"Link":return this[Oz1](Y,X);case"SymbolicLink":return this[jz1](Y,X);case"Directory":case"GNUDumpDir":return this[tm](Y,X)}}[FP](G,Y,X,W){h6[X](Y,String(G.absolute),(Z)=>{if(Z)this[i5](Z,G);else this[hH](),G.resume();W()})}}var wf=(G)=>{try{return[null,G()]}catch(Y){return[Y,null]}};class Xu extends YC{sync=!0;[ZG](G,Y){return super[ZG](G,Y,()=>{})}[sm](G){if(this[QP](G),!this[gA]){let Z=this[zJ](this.cwd,this.dmode);if(Z)return this[i5](Z,G);this[gA]=!0}if(G.absolute!==this.cwd){let Z=i4(qW.dirname(String(G.absolute)));if(Z!==this.cwd){let U=this[zJ](Z,this.dmode);if(U)return this[i5](U,G)}}let[Y,X]=wf(()=>h6.lstatSync(String(G.absolute)));if(X&&(this.keep||this.newer&&X.mtime>(G.mtime??X.mtime)))return this[em](G);if(Y||this[nm](G,X))return this[ZG](null,G);if(X.isDirectory()){if(G.type==="Directory"){let U=this.chmod&&G.mode&&(X.mode&4095)!==G.mode,[K]=U?wf(()=>{h6.chmodSync(String(G.absolute),Number(G.mode))}):[];return this[ZG](K,G)}let[Z]=wf(()=>h6.rmdirSync(String(G.absolute)));this[ZG](Z,G)}let[W]=G.absolute===this.cwd?[]:wf(()=>a18(String(G.absolute)));this[ZG](W,G)}[om](G,Y){let X=typeof G.mode==="number"?G.mode&4095:this.fmode,W=(K)=>{let J;try{h6.closeSync(Z)}catch(H){J=H}if(K||J)this[i5](K||J,G);Y()},Z;try{Z=h6.openSync(String(G.absolute),PQ1(G.size),X)}catch(K){return W(K)}let U=this.transform?this.transform(G)||G:G;if(U!==G)U.on("error",(K)=>this[i5](K,G)),G.pipe(U);U.on("data",(K)=>{try{h6.writeSync(Z,K,0,K.length)}catch(J){W(J)}}),U.on("end",()=>{let K=null;if(G.mtime&&!this.noMtime){let J=G.atime||new Date,H=G.mtime;try{h6.futimesSync(Z,J,H)}catch($){try{h6.utimesSync(String(G.absolute),J,H)}catch(Q){K=$}}}if(this[vA](G)){let J=this[bA](G),H=this[MA](G);try{h6.fchownSync(Z,Number(J),Number(H))}catch($){try{h6.chownSync(String(G.absolute),Number(J),Number(H))}catch(Q){K=K||$}}}W(K)})}[tm](G,Y){let X=typeof G.mode==="number"?G.mode&4095:this.dmode,W=this[zJ](String(G.absolute),X);if(W){this[i5](W,G),Y();return}if(G.mtime&&!this.noMtime)try{h6.utimesSync(String(G.absolute),G.atime||new Date,G.mtime)}catch(Z){}if(this[vA](G))try{h6.chownSync(String(G.absolute),Number(this[bA](G)),Number(this[MA](G)))}catch(Z){}Y(),G.resume()}[zJ](G,Y){try{return y18(i4(G),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:Y})}catch(X){return X}}[FP](G,Y,X,W){let Z=`${X}Sync`;try{h6[Z](Y,String(G.absolute)),W(),G.resume()}catch(U){return this[i5](U,G)}}}var s18=(G)=>{let Y=new Xu(G),X=G.file,W=jQ1.statSync(X),Z=G.maxReadSize||16777216;new WQ1(X,{readSize:Z,size:W.size}).pipe(Y)},n18=(G,Y)=>{let X=new YC(G),W=G.maxReadSize||16777216,Z=G.file;return new Promise((K,J)=>{X.on("error",J),X.on("close",K),jQ1.stat(Z,(H,$)=>{if(H)J(H);else{let Q=new sP(Z,{readSize:W,size:$.size});Q.on("error",J),Q.pipe(X)}})})},ll4=SS(s18,n18,(G)=>new Xu(G),(G)=>new YC(G),(G,Y)=>{if(Y?.length)AQ1(G,Y)}),o18=(G,Y)=>{let X=new eP(G),W=!0,Z,U;try{try{Z=P3.openSync(G.file,"r+")}catch(H){if(H?.code==="ENOENT")Z=P3.openSync(G.file,"w+");else throw H}let K=P3.fstatSync(Z),J=Buffer.alloc(512);G:for(U=0;U<K.size;U+=512){for(let Q=0,F=0;Q<512;Q+=F){if(F=P3.readSync(Z,J,Q,J.length-Q,U+Q),U===0&&J[0]===31&&J[1]===139)throw new Error("cannot append to compressed archives");if(!F)break G}let H=new qJ(J);if(!H.cksumValid)break;let $=512*Math.ceil((H.size||0)/512);if(U+$+512>K.size)break;if(U+=$,G.mtimeCache&&H.mtime)G.mtimeCache.set(String(H.path),H.mtime)}W=!1,t18(G,X,U,Z,Y)}finally{if(W)try{P3.closeSync(Z)}catch(K){}}},t18=(G,Y,X,W,Z)=>{let U=new yc(G.file,{fd:W,start:X});Y.pipe(U),G08(Y,Z)},e18=(G,Y)=>{Y=Array.from(Y);let X=new NS(G),W=(U,K,J)=>{let H=(V,q)=>{if(V)P3.close(U,(S)=>J(V));else J(null,q)},$=0;if(K===0)return H(null,0);let Q=0,F=Buffer.alloc(512),z=(V,q)=>{if(V||typeof q==="undefined")return H(V);if(Q+=q,Q<512&&q)return P3.read(U,F,Q,F.length-Q,$+Q,z);if($===0&&F[0]===31&&F[1]===139)return H(new Error("cannot append to compressed archives"));if(Q<512)return H(null,$);let S=new qJ(F);if(!S.cksumValid)return H(null,$);let N=512*Math.ceil((S.size??0)/512);if($+N+512>K)return H(null,$);if($+=N+512,$>=K)return H(null,$);if(G.mtimeCache&&S.mtime)G.mtimeCache.set(String(S.path),S.mtime);Q=0,P3.read(U,F,0,512,$,z)};P3.read(U,F,0,512,$,z)};return new Promise((U,K)=>{X.on("error",K);let J="r+",H=($,Q)=>{if($&&$.code==="ENOENT"&&J==="r+")return J="w+",P3.open(G.file,J,H);if($||!Q)return K($);P3.fstat(Q,(F,z)=>{if(F)return P3.close(Q,()=>K(F));W(Q,z.size,(V,q)=>{if(V)return K(V);let S=new AS(G.file,{fd:Q,start:q});X.pipe(S),S.on("error",K),S.on("close",U),Y08(X,Y)})})};P3.open(G.file,J,H)})},G08=(G,Y)=>{Y.forEach((X)=>{if(X.charAt(0)==="@")FJ({file:cQ1.resolve(G.cwd,X.slice(1)),sync:!0,noResume:!0,onReadEntry:(W)=>G.add(W)});else G.add(X)}),G.end()},Y08=async(G,Y)=>{for(let X=0;X<Y.length;X++){let W=String(Y[X]);if(W.charAt(0)==="@")await FJ({file:cQ1.resolve(String(G.cwd),W.slice(1)),noResume:!0,onReadEntry:(Z)=>G.add(Z)});else G.add(W)}G.end()},FA=SS(o18,e18,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(G,Y)=>{if(!Ye0(G))throw new TypeError("file is required");if(G.gzip||G.brotli||G.file.endsWith(".br")||G.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!Y?.length)throw new TypeError("no paths specified to add/replace")}),al4=SS(FA.syncFile,FA.asyncFile,FA.syncNoFile,FA.asyncNoFile,(G,Y=[])=>{FA.validate?.(G,Y),X08(G)}),X08=(G)=>{let Y=G.filter;if(!G.mtimeCache)G.mtimeCache=new Map;G.filter=Y?(X,W)=>Y(X,W)&&!((G.mtimeCache?.get(X)??W.mtime??0)>(W.mtime??0)):(X,W)=>!((G.mtimeCache?.get(X)??W.mtime??0)>(W.mtime??0))};var rl4=bt0.default("dynamodb-local");var KJ=(G,Y,X)=>G?Y:X,U6=(G,Y)=>({...G,...Y}),uQ1=Symbol("$type"),X8=Symbol("$state"),dl4=Symbol("$elements"),sl4=Symbol("$attributes"),nl4=Symbol("$keys");class P8 extends Error{constructor(G,{message:Y,path:X,payload:W}){super(Y);this.code=G,this.path=X,this.payload=W}}P8.match=(G,Y="")=>G instanceof P8&&G.code.startsWith(Y);var rA=(G)=>typeof G==="boolean",GX=(G)=>typeof G==="string",ax=new Set(["never","atLeastOnce","always"]),W08=(G,Y)=>{let X=G.required;if(!ax.has(X))throw new P8("schema.attribute.invalidProperty",{message:`Invalid option value type${Y!==void 0?` at path '${Y}'`:""}. Property: 'required'. Expected: ${[...ax].join(", ")}. Received: ${String(X)}.`,path:Y,payload:{propertyName:"required",expected:[...ax].join(", "),received:X}});let W=G.hidden;if(!rA(W))throw new P8("schema.attribute.invalidProperty",{message:`Invalid option value type${Y!==void 0?` at path '${Y}'`:""}. Property: 'hidden'. Expected: boolean. Received: ${String(W)}.`,path:Y,payload:{propertyName:"hidden",received:X}});let Z=G.key;if(!rA(Z))throw new P8("schema.attribute.invalidProperty",{message:`Invalid option value type${Y!==void 0?` at path '${Y}'`:""}. Property: 'key'. Expected: boolean. Received: ${String(W)}.`,path:Y,payload:{propertyName:"key",received:W}});let U=G.savedAs;if(U!==void 0&&!GX(U))throw new P8("schema.attribute.invalidProperty",{message:`Invalid option value type${Y!==void 0?` at path '${Y}'`:""}. Property: 'savedAs'. Expected: string. Received: ${String(U)}.`,path:Y,payload:{propertyName:"savedAs",received:U}})};class Wu{constructor({path:G,...Y}){this.type="any",this.path=G,this.required=Y.required,this.hidden=Y.hidden,this.key=Y.key,this.savedAs=Y.savedAs,this.defaults=Y.defaults,this.links=Y.links,this.validators=Y.validators,this.castAs=Y.castAs}}var C3=(G)=>Array.isArray(G),lQ1=(G,Y,X)=>({...G,[Y]:X}),Gc=(G)=>typeof G==="function",Z08=(G)=>Gc(G),J08=(G)=>!Z08(G),$08=(G)=>typeof G==="bigint",U08=(G)=>G instanceof Uint8Array,z08=(G)=>G===null,Zu=(G)=>typeof G==="number"&&!isNaN(G),UV=(G,Y)=>{switch(G.type){case"null":return z08(Y);case"boolean":return rA(Y);case"number":return Zu(Y)||Boolean(G.big&&$08(Y));case"string":return GX(Y);case"binary":return U08(Y)}},pQ1=(G,Y)=>{W08(G,Y);let{type:X,enum:W}=G;W===null||W===void 0||W.forEach((Z)=>{if(!UV(G,Z))throw new P8("schema.primitiveAttribute.invalidEnumValueType",{message:`Invalid enum value type${Y!==void 0?` at path '${Y}'`:""}. Expected: ${X}. Received: ${String(Z)}.`,path:Y,payload:{expectedType:X,enumValue:Z}})});for(let Z of Object.values(G.defaults))if(Z!==void 0&&J08(Z)){if(!UV(G,Z))throw new P8("schema.primitiveAttribute.invalidDefaultValueType",{message:`Invalid default value type${Y!==void 0?` at path '${Y}'`:""}: Expected: ${X}. Received: ${String(Z)}.`,path:Y,payload:{expectedType:X,defaultValue:Z}});if(W!==void 0&&!W.some((U)=>U===Z))throw new P8("schema.primitiveAttribute.invalidDefaultValueRange",{message:`Invalid default value${Y!==void 0?` at path '${Y}'`:""}: Expected one of: ${W.join(", ")}. Received: ${String(Z)}.`,path:Y,payload:{enumValues:W,defaultValue:Z}})}};class iQ1{constructor({path:G,...Y}){this.type="binary",this.path=G,this.required=Y.required,this.hidden=Y.hidden,this.key=Y.key,this.savedAs=Y.savedAs,this.enum=Y.enum,this.transform=Y.transform,this.defaults=Y.defaults,this.links=Y.links,this.validators=Y.validators}}var K08=(G,Y)=>{return pQ1({type:"number",...G},Y),new RS({path:Y,...G})};class G2{constructor(G){this[uQ1]="number",this[X8]=G}required(G="atLeastOnce"){return new G2(U6(this[X8],{required:G}))}optional(){return this.required("never")}hidden(G=!0){return new G2(U6(this[X8],{hidden:G}))}key(G=!0){return new G2(U6(this[X8],{key:G,required:"always"}))}savedAs(G){return new G2(U6(this[X8],{savedAs:G}))}enum(...G){return new G2(lQ1(this[X8],"enum",G))}const(G){return new G2(U6(this[X8],{enum:[G],defaults:KJ(this[X8].key,{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update},{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update})}))}transform(G){return new G2(U6(this[X8],{transform:G}))}big(G=!0){return new G2(U6(this[X8],{big:G}))}keyDefault(G){return new G2(U6(this[X8],{defaults:{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update}}))}putDefault(G){return new G2(U6(this[X8],{defaults:{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update}}))}updateDefault(G){return new G2(U6(this[X8],{defaults:{key:this[X8].defaults.key,put:this[X8].defaults.put,update:G}}))}default(G){return new G2(U6(this[X8],{defaults:KJ(this[X8].key,{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update},{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update})}))}keyLink(G){return new G2(U6(this[X8],{links:{key:G,put:this[X8].links.put,update:this[X8].links.update}}))}putLink(G){return new G2(U6(this[X8],{links:{key:this[X8].links.key,put:G,update:this[X8].links.update}}))}updateLink(G){return new G2(U6(this[X8],{links:{key:this[X8].links.key,put:this[X8].links.put,update:G}}))}link(G){return new G2(U6(this[X8],{links:KJ(this[X8].key,{key:G,put:this[X8].links.put,update:this[X8].links.update},{key:this[X8].links.key,put:G,update:this[X8].links.update})}))}keyValidate(G){return new G2(U6(this[X8],{validators:{key:G,put:this[X8].validators.put,update:this[X8].validators.update}}))}putValidate(G){return new G2(U6(this[X8],{validators:{key:this[X8].validators.key,put:G,update:this[X8].validators.update}}))}updateValidate(G){return new G2(U6(this[X8],{validators:{key:this[X8].validators.key,put:this[X8].validators.put,update:G}}))}validate(G){return new G2(U6(this[X8],{validators:KJ(this[X8].key,{key:G,put:this[X8].validators.put,update:this[X8].validators.update},{key:this[X8].validators.key,put:G,update:this[X8].validators.update})}))}freeze(G){return K08(this[X8],G)}}class RS{constructor({path:G,...Y}){this.type="number",this.path=G,this.required=Y.required,this.hidden=Y.hidden,this.key=Y.key,this.savedAs=Y.savedAs,this.enum=Y.enum,this.transform=Y.transform,this.big=Y.big,this.defaults=Y.defaults,this.links=Y.links,this.validators=Y.validators}}var rx={required:"atLeastOnce",hidden:!1,key:!1,savedAs:void 0,transform:void 0,big:!1,defaults:{key:void 0,put:void 0,update:void 0},links:{key:void 0,put:void 0,update:void 0},validators:{key:void 0,put:void 0,update:void 0}},qA=(G)=>{let Y={...rx,...G,enum:void 0,defaults:{...rx.defaults,...G===null||G===void 0?void 0:G.defaults},links:{...rx.links,...G===null||G===void 0?void 0:G.links}};return new G2(Y)},H08=(G,Y)=>{return pQ1({type:"string",...G},Y),new dA({path:Y,...G})};class S2{constructor(G){this[uQ1]="string",this[X8]=G}required(G="atLeastOnce"){return new S2(U6(this[X8],{required:G}))}optional(){return this.required("never")}hidden(G=!0){return new S2(U6(this[X8],{hidden:G}))}key(G=!0){return new S2(U6(this[X8],{key:G,required:"always"}))}savedAs(G){return new S2(U6(this[X8],{savedAs:G}))}enum(...G){return new S2(lQ1(this[X8],"enum",G))}const(G){return new S2(U6(this[X8],{enum:[G],defaults:KJ(this[X8].key,{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update},{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update})}))}transform(G){return new S2(U6(this[X8],{transform:G}))}keyDefault(G){return new S2(U6(this[X8],{defaults:{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update}}))}putDefault(G){return new S2(U6(this[X8],{defaults:{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update}}))}updateDefault(G){return new S2(U6(this[X8],{defaults:{key:this[X8].defaults.key,put:this[X8].defaults.put,update:G}}))}default(G){return new S2(U6(this[X8],{defaults:KJ(this[X8].key,{key:G,put:this[X8].defaults.put,update:this[X8].defaults.update},{key:this[X8].defaults.key,put:G,update:this[X8].defaults.update})}))}keyLink(G){return new S2(U6(this[X8],{links:{key:G,put:this[X8].links.put,update:this[X8].links.update}}))}putLink(G){return new S2(U6(this[X8],{links:{key:this[X8].links.key,put:G,update:this[X8].links.update}}))}updateLink(G){return new S2(U6(this[X8],{links:{key:this[X8].links.key,put:this[X8].links.put,update:G}}))}link(G){return new S2(U6(this[X8],{links:KJ(this[X8].key,{key:G,put:this[X8].links.put,update:this[X8].links.update},{key:this[X8].links.key,put:G,update:this[X8].links.update})}))}keyValidate(G){return new S2(U6(this[X8],{validators:{key:G,put:this[X8].validators.put,update:this[X8].validators.update}}))}putValidate(G){return new S2(U6(this[X8],{validators:{key:this[X8].validators.key,put:G,update:this[X8].validators.update}}))}updateValidate(G){return new S2(U6(this[X8],{validators:{key:this[X8].validators.key,put:this[X8].validators.put,update:G}}))}validate(G){return new S2(U6(this[X8],{validators:KJ(this[X8].key,{key:G,put:this[X8].validators.put,update:this[X8].validators.update},{key:this[X8].validators.key,put:G,update:this[X8].validators.update})}))}freeze(G){return H08(this[X8],G)}}class dA{constructor({path:G,...Y}){this.type="string",this.path=G,this.required=Y.required,this.hidden=Y.hidden,this.key=Y.key,this.savedAs=Y.savedAs,this.enum=Y.enum,this.transform=Y.transform,this.defaults=Y.defaults,this.links=Y.links,this.validators=Y.validators}}var dx={required:"atLeastOnce",hidden:!1,key:!1,savedAs:void 0,transform:void 0,defaults:{key:void 0,put:void 0,update:void 0},links:{key:void 0,put:void 0,update:void 0},validators:{key:void 0,put:void 0,update:void 0}},aQ1=(G)=>{let Y={...dx,...G,enum:void 0,defaults:{...dx.defaults,...G===null||G===void 0?void 0:G.defaults},links:{...dx.links,...G===null||G===void 0?void 0:G.links}};return new S2(Y)};class Ju{constructor(G){var Y;this.type="schema",this.attributes=G;let X=new Set,W=new Set,Z={always:new Set,atLeastOnce:new Set,never:new Set};for(let U in G){if(X.has(U))throw new P8("schema.duplicateAttributeNames",{message:`Invalid schema: More than two attributes are named '${U}'`,payload:{name:U}});let K=G[U],J=(Y=K.savedAs)!==null&&Y!==void 0?Y:U;if(X.has(J))throw new P8("schema.duplicateSavedAsAttributes",{message:`Invalid schema: More than two attributes are saved as '${J}'`,payload:{savedAs:J}});if(X.add(J),K.key)W.add(U);Z[K.required].add(U)}this.savedAttributeNames=X,this.keyAttributeNames=W,this.requiredAttributeNames=Z}and(G){let Y=typeof G==="function"?G(this):G,X={...this.attributes};for(let[W,Z]of Object.entries(Y)){if(W in X)throw new P8("schema.duplicateAttributeNames",{message:`Invalid schema: More than two attributes are named '${W}'`,payload:{name:W}});X[W]=Z.freeze(W)}return new Ju(X)}build(G){return new G(this)}}class AV{constructor(G){this.schema=G}}var a5=(G)=>{if(typeof G!=="object"||G===null)return G;if(G instanceof Date)return new Date(G.getTime());if(G instanceof Array)return G.map(a5);if(G instanceof Object)return Object.fromEntries([...Object.entries(G).map(([Y,X])=>[Y,a5(X)]),...Object.getOwnPropertySymbols(G).map((Y)=>[Y,a5(G[Y])])]);throw new Error("Unable to clone object")},V08=(G,Y)=>({isExtension:!1,basicInput:Y}),Q08=(G,Y)=>{switch(Y){case"put":return G.required!=="never";case"key":case"update":return G.required==="always"}},fU=(G,Y,X={})=>{let{mode:W="put"}=X,Z=G.validators[G.key?"key":W];if(Z!==void 0){let U=Z(Y,G);if(U!==!0){let{path:K}=G;throw new P8("parsing.customValidationFailed",{message:`Custom validation${K!==void 0?` for attribute '${K}'`:""} failed${GX(U)?` with message: ${U}`:""}.`,path:K,payload:{received:Y,validationResult:U}})}}};function*F08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=void 0;if(W){let H=a5(Y);yield H,U=H,yield U}let K=U!==null&&U!==void 0?U:a5(Y);if(K!==void 0)fU(G,K,X);if(Z)yield K;else return K;return K}function*q08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=void 0,K=void 0,J=void 0,H=void 0;for(let F of G.elements)try{if(U=AJ(F,Y,X),W)K=U.next().value,J=U.next().value;H=U.next().value;break}catch(z){U=void 0,K=void 0,J=void 0,H=void 0;continue}if(W){let F=K!==null&&K!==void 0?K:a5(Y);yield F,yield J!==null&&J!==void 0?J:F}let $=H;if(U===void 0||$===void 0){let{path:F}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${F!==void 0?`'${F}' `:""}does not match any of the possible sub-types.`,path:F,payload:{received:Y}})}if($!==void 0)fU(G,$,X);if(Z)yield $;else return $;return U.next().value}function*A08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=[],K=C3(Y);if(K)for(let $ of Y)U.push(AJ(G.elements,$,{...X,defined:!1}));if(W)if(K){let Q=yield U.map((z)=>z.next().value);yield U.map((z)=>z.next(Q).value)}else{let $=a5(Y);yield $,yield $}if(!K){let{path:$,type:Q}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${$!==void 0?`'${$}' `:""}should be a ${Q}.`,path:$,payload:{received:Y,expected:Q}})}let J=U.map(($)=>$.next().value);if(J!==void 0)fU(G,J,X);if(Z)yield J;else return J;return U.map(($)=>$.next().value)}var $u=(G)=>G instanceof Set,X2=(G)=>typeof G==="object"&&G!==null&&!C3(G)&&!$u(G);function*S08(G,Y,X={}){let{mode:W="put",fill:Z=!0,transform:U=!0}=X,K={},J=[],H=X2(Y);if(H){let F=new Set(Object.keys(Y));Object.entries(G.attributes).filter(([,z])=>W!=="key"||z.key).forEach(([z,V])=>{K[z]=AJ(V,Y[z],{...X,defined:!1}),F.delete(z)}),J=[...F.values()].map((z)=>[z,a5(Y[z])])}if(Z)if(H){let z=yield Object.fromEntries([...Object.entries(K).map(([q,S])=>[q,S.next().value]).filter(([,q])=>q!==void 0),...J]);yield Object.fromEntries([...Object.entries(K).map(([q,S])=>[q,S.next(z).value]).filter(([,q])=>q!==void 0),...J])}else{let F=a5(Y);yield F,yield F}if(!H){let{path:F,type:z}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${F!==void 0?`'${F}' `:""}should be a ${z}.`,path:F,payload:{received:Y,expected:z}})}let $=Object.fromEntries(Object.entries(K).map(([F,z])=>[F,z.next().value]).filter(([,F])=>F!==void 0));if($!==void 0)fU(G,$,X);if(U)yield $;else return $;return Object.fromEntries(Object.entries(K).map(([F,z])=>{var V;return[(V=G.attributes[F].savedAs)!==null&&V!==void 0?V:F,z.next().value]}).filter(([,F])=>F!==void 0))}function*N08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=Y;if(W){let H=a5(Y);yield H,yield H}if(!UV(G,U)){let{path:H,type:$}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${H!==void 0?`'${H}' `:""}should be a ${$}.`,path:H,payload:{received:U,expected:$}})}if(G.enum!==void 0&&!G.enum.includes(U)){let{path:H}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${H!==void 0?`'${H}' `:""}should be one of: ${G.enum.map(String).join(", ")}.`,path:H,payload:{received:U,expected:G.enum}})}let K=U;if(fU(G,K,X),Z)yield K;else return K;return G.transform!==void 0?G.transform.parse(K):K}function*R08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=[],K=[],J=X2(Y);if(J)for(let[Q,F]of Object.entries(Y)){if(F===void 0){K.push([Q,void 0]);continue}U.push([AJ(G.keys,Q,X),AJ(G.elements,F,{...X,defined:!1})])}if(W)if(J){let F=yield Object.fromEntries([...U.map(([V,q])=>[V.next().value,q.next().value]).filter(([,V])=>V!==void 0),...K]);yield Object.fromEntries([...U.map(([V,q])=>[V.next().value,q.next(F).value]).filter(([,V])=>V!==void 0),...K])}else{let Q=a5(Y);yield Q,yield Q}if(!J){let{path:Q,type:F}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${Q!==void 0?`'${Q}' `:""}should be a ${F}.`,path:Q,payload:{received:Y,expected:F}})}let H=Object.fromEntries(U.map(([Q,F])=>[Q.next().value,F.next().value]).filter(([,Q])=>Q!==void 0));if(H!==void 0)fU(G,H,X);if(Z)yield H;else return H;return Object.fromEntries(U.map(([Q,F])=>[Q.next().value,F.next().value]).filter(([,Q])=>Q!==void 0))}function*L08(G,Y,X={}){let{fill:W=!0,transform:Z=!0}=X,U=[],K=$u(Y);if(K)for(let $ of Y.values())U.push(AJ(G.elements,$,{...X,defined:!1}));if(W)if(K)yield new Set(U.map((F)=>F.next().value)),yield new Set(U.map((F)=>F.next().value));else{let $=a5(Y);yield $,yield $}if(!K){let{path:$,type:Q}=G;throw new P8("parsing.invalidAttributeInput",{message:`Attribute ${$!==void 0?`'${$}' `:""}should be a ${Q}.`,path:$,payload:{received:Y,expected:Q}})}let J=new Set(U.map(($)=>$.next().value));if(J!==void 0)fU(G,J,X);if(Z)yield J;else return J;return new Set(U.map(($)=>$.next().value))}function*AJ(G,Y,X={}){let{mode:W="put",fill:Z=!0,transform:U=!0,defined:K=!1,parseExtension:J=V08}=X,H=Y,$=Z;if($&&H===void 0){let q=void 0,S=G.defaults[G.key?"key":W];q=Gc(S)?S():a5(S);let N=yield q,R=q;if(R===void 0&&N!==void 0){let j=G.links[G.key?"key":W];R=Gc(j)?j(N):R}yield R,H=R,$=!1}let Q={...X,fill:$},{isExtension:F,extensionParser:z,basicInput:V}=J(G,H,{transform:U});if(F){if($){let q=H;yield q,yield q}return yield*z()}if(V===void 0){let{path:q}=G;if(Q08(G,W)||K)throw new P8("parsing.attributeRequired",{message:`Attribute ${q!==void 0?`'${q}' `:""}is required.`,path:q});let S=V;if(U)yield S;else return S;return S}switch(G.type){case"any":return yield*F08(G,V,Q);case"null":case"boolean":case"number":case"string":case"binary":return yield*N08(G,V,Q);case"set":return yield*L08(G,V,Q);case"list":return yield*A08(G,V,Q);case"map":return yield*S08(G,V,Q);case"record":return yield*R08(G,V,Q);case"anyOf":return yield*q08(G,V,Q)}}function*T08(G,Y,X={}){let{mode:W="put",fill:Z=!0,transform:U=!0}=X,K={},J=[],H=X2(Y);if(H){let F=new Set(Object.keys(Y));Object.entries(G.attributes).filter(([,z])=>W!=="key"||z.key).forEach(([z,V])=>{K[z]=AJ(V,Y[z],{...X,defined:!1}),F.delete(z)}),J=[...F.values()].map((z)=>[z,a5(Y[z])])}if(Z)if(H){let F=Object.fromEntries([...Object.entries(K).map(([V,q])=>[V,q.next().value]).filter(([,V])=>V!==void 0),...J]);yield F,yield Object.fromEntries([...Object.entries(K).map(([V,q])=>[V,q.next(F).value]).filter(([,V])=>V!==void 0),...J])}else{let F=a5(Y);yield F,yield F}if(!H)throw new P8("parsing.invalidItem",{message:"Items should be objects",payload:{received:Y,expected:"object"}});let $=Object.fromEntries(Object.entries(K).map(([F,z])=>[F,z.next().value]).filter(([,F])=>F!==void 0));if(U)yield $;else return $;return Object.fromEntries(Object.entries(K).map(([F,z])=>{var V;return[(V=G.attributes[F].savedAs)!==null&&V!==void 0?V:F,z.next().value]}).filter(([,F])=>F!==void 0))}class Y9 extends AV{constructor(G){super(G)}start(G,Y={}){if(this.schema.type==="schema")return T08(this.schema,G,Y);else return AJ(this.schema,G,Y)}parse(G,Y={}){let X=this.start(G,Y),W=!1,Z;do{let U=X.next();W=Boolean(U.done),Z=U.value}while(!W);return Z}reparse(G,Y={}){return this.parse(G,Y)}validate(G,Y={}){try{this.parse(G,{...Y,fill:!1,transform:!1})}catch(X){if(X instanceof P8&&P8.match(X,"parsing."))return!1;throw X}return!0}}var I08=(G,Y)=>a5(Y),E08=(G,Y,X={})=>{let W=void 0;for(let Z of G.elements)try{W=PU(Z,Y,X);break}catch(U){continue}if(W===void 0){let{path:Z}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting. Attribute does not match any of the possible sub-types${Z!==void 0?`: '${Z}'`:""}.`,path:Z,payload:{received:Y}})}return W},XC=(G,Y)=>{if(Y===void 0)return{isProjected:!0};let X=[];for(let W of Y){let Z=W.match(G);if(Z!==null){let U=Z[0];X.push(W.slice(U.length))}}if(X.length===0)return{isProjected:!1};if(X.some((W)=>W===""))return{isProjected:!0};return{isProjected:!0,childrenAttributes:X}},j08=(G,Y,{attributes:X,...W}={})=>{if(!C3(Y)){let{path:K,type:J}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${K!==void 0?`: '${K}'`:""}. Should be a ${J}.`,path:K,payload:{received:Y,expected:J}})}let{childrenAttributes:Z}=XC(/\[\d+\]/,X),U=[];for(let K of Y){let J=PU(G.elements,K,{attributes:Z,...W});if(J!==void 0)U.push(J)}return U},O08=(G,Y,{attributes:X,...W}={})=>{if(!X2(Y)){let{path:U,type:K}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${U!==void 0?`: '${U}'`:""}. Should be a ${K}.`,path:U,payload:{received:Y,expected:K}})}let Z={};return Object.entries(G.attributes).forEach(([U,K])=>{var J;if(K.hidden)return;let{isProjected:H,childrenAttributes:$}=XC(new RegExp("^\\."+U),X);if(!H)return;let Q=(J=K.savedAs)!==null&&J!==void 0?J:U,F=PU(K,Y[Q],{attributes:$,...W});if(F!==void 0)Z[U]=F}),Z},rQ1=(G,Y)=>{if(!UV(G,Y)){let{path:U,type:K}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${U!==void 0?`: '${U}'`:""}. Should be a ${K}.`,path:U,payload:{received:Y,expected:K}})}let X=Y,W=G.transform,Z=W!==void 0?W.format(X):X;if(G.enum!==void 0&&!G.enum.includes(Z)){let{path:U}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${U!==void 0?`: '${U}'`:""}. Should be one of: ${G.enum.map(String).join(", ")}.`,path:U,payload:{received:Z,expected:G.enum}})}return Z},_08=(G,Y,{attributes:X,...W}={})=>{if(!X2(Y)){let{path:U,type:K}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${U!==void 0?`: '${U}'`:""}. Should be a ${K}.`,path:U,payload:{received:Y,expected:K}})}let Z={};return Object.entries(Y).forEach(([U,K])=>{let J=rQ1(G.keys,U),{childrenAttributes:H}=XC(new RegExp("^\\."+J),X),$=PU(G.elements,K,{attributes:H,...W});if($!==void 0)Z[J]=$}),Z},f08=(G,Y,X={})=>{if(!$u(Y)){let{path:Z,type:U}=G;throw new P8("formatter.invalidAttribute",{message:`Invalid attribute detected while formatting${Z!==void 0?`: '${Z}'`:""}. Should be a ${U}.`,path:Z,payload:{received:Y,expected:U}})}let W=new Set;for(let Z of Y){let U=PU(G.elements,Z,{...X,attributes:void 0});if(U!==void 0)W.add(U)}return W},P08=new Set(["always","atLeastOnce"]),C08=(G)=>P08.has(G.required),PU=(G,Y,X={})=>{if(Y===void 0)if(C08(G)&&X.partial!==!0){let{path:W}=G;throw new P8("formatter.missingAttribute",{message:`Missing required attribute for formatting${W!==void 0?`: '${W}'`:""}.`,path:W,payload:{}})}else return;switch(G.type){case"any":return I08(G,Y);case"null":case"boolean":case"number":case"string":case"binary":return rQ1(G,Y);case"set":return f08(G,Y,X);case"list":return j08(G,Y,X);case"map":return O08(G,Y,X);case"record":return _08(G,Y,X);case"anyOf":return E08(G,Y,X)}},B08=(G,Y,{attributes:X,partial:W=!1}={})=>{if(!X2(Y))throw new P8("formatter.invalidItem",{message:"Invalid item detected while formatting. Should be an object.",payload:{received:Y,expected:"Object"}});let Z={};return Object.entries(G.attributes).forEach(([U,K])=>{var J;if(K.hidden)return;let{isProjected:H,childrenAttributes:$}=XC(new RegExp("^"+U),X);if(!H)return;let Q=(J=K.savedAs)!==null&&J!==void 0?J:U,F=PU(K,Y[Q],{attributes:$,partial:W});if(F!==void 0)Z[U]=F}),Z};class dQ1 extends AV{constructor(G){super(G)}format(G,Y={}){if(this.schema.type==="schema")return B08(this.schema,G,Y);else return PU(this.schema,G,Y)}}var w08=new Wu({type:"any",required:"never",hidden:!1,key:!1,savedAs:void 0,defaults:{key:void 0,put:void 0,update:void 0},links:{key:void 0,put:void 0,update:void 0},validators:{key:void 0,put:void 0,update:void 0},castAs:void 0}),D08=new RS({required:"never",hidden:!1,key:!1,savedAs:void 0,enum:void 0,transform:void 0,big:!1,defaults:{key:void 0,put:void 0,update:void 0},links:{key:void 0,put:void 0,update:void 0},validators:{key:void 0,put:void 0,update:void 0}}),AA=(G)=>new P8("actions.invalidExpressionAttributePath",{message:`Unable to match expression attribute path with schema: ${G}`,payload:{attributePath:G}}),wz1=(G)=>/\[\d+\]/g.test(G),Uu=(G,Y,X={})=>{var W;let{size:Z=!1}=X,U=G.expressionAttributePrefix,K=G.schema,J="",H=[...Y.matchAll(/\[(\d+)\]|[\w#-]+(?=(\.|$|\[))/g)];while(H.length>0){let $=H.shift(),Q=$[0];switch(K.type){case"any":{let F=wz1(Q);if(F)J+=Q;else{let z=G.expressionAttributeNames.push(Q);J+=`.#${U}${z}`}K=new Wu({...w08,path:[K.path,Q].filter(Boolean).join(F?"":".")});break}case"binary":case"boolean":case"number":case"string":case"set":throw AA(Y);case"record":{let F=K.keys,z=new Y9(F).start(Q,{fill:!1,transform:!0});z.next();let V=z.next().value,q=G.expressionAttributeNames.push(V);J+=`.#${U}${q}`,K=K.elements;break}case"schema":case"map":{let F=K.attributes[Q];if(!F)throw AA(Y);let z=G.expressionAttributeNames.push((W=F.savedAs)!==null&&W!==void 0?W:Q);J+=K.type==="schema"?`#${U}${z}`:`.#${U}${z}`,K=F;break}case"list":{if(!wz1(Q))throw AA(Y);J+=Q,K=K.elements;break}case"anyOf":{let F=void 0,z=Y.slice($.index);for(let V of K.elements)try{K=V;let q=G.clone(V);q.resetExpression(),K=q.appendAttributePath(z,X),F=q}catch{}if(F===void 0)throw AA(Y);G.expressionAttributeNames=F.expressionAttributeNames,J+=F.expression,H=[];break}}}if(K.type==="schema")throw AA(Y);return G.appendToExpression(Z?`size(${J})`:J),Z?new RS({...D08,path:K.path}):K};class zu extends AV{constructor(G,Y=""){super(G);this.expressionAttributePrefix=`p${Y}_`,this.expressionAttributeNames=[],this.expression="",this.id=Y}setId(G){return this.id=G,this.expressionAttributePrefix=`p${G}_`,this}resetExpression(G=""){return this.expression=G,this}appendAttributePath(G,Y={}){return Uu(this,G,Y)}appendToExpression(G){return this.expression+=G,this}parse(G){let[Y,...X]=G;if(Y===void 0)return this;this.appendAttributePath(Y);for(let W of X)this.appendToExpression(", "),this.appendAttributePath(W);return this}toCommandOptions(){let G={};this.expressionAttributeNames.forEach((X,W)=>{G[`#${this.expressionAttributePrefix}${W+1}`]=X});let Y=this.expression;return{ExpressionAttributeNames:G,ProjectionExpression:Y}}clone(G){let Y=new zu(G!==null&&G!==void 0?G:this.schema,this.id);return Y.expressionAttributeNames=[...this.expressionAttributeNames],Y.expression=this.expression,Y}}var k08=(G,Y,X,W={})=>{let{transform:Z=!1}=W,U=new Y9(Y).parse(X,{fill:!1,transform:Z}),K=G.expressionAttributeValues.push(U);G.appendToExpression(`:${G.expressionAttributePrefix}${K}`)},h08=(G)=>X2(G)&&("attr"in G)&&GX(G.attr),v08=(G,Y,X,W={})=>{if(h08(X))G.appendAttributePath(X.attr,W);else G.appendAttributeValue(Y,X,W)},b08=(G)=>("between"in G),M08=(G,Y)=>{var X;let W=(X=Y.size)!==null&&X!==void 0?X:Y.attr,[Z,U]=Y.between,{transform:K=!0}=Y;G.resetExpression();let J=G.appendAttributePath(W,{size:!!Y.size});G.appendToExpression(" BETWEEN "),G.appendAttributeValueOrPath(J,Z,{transform:K}),G.appendToExpression(" AND "),G.appendAttributeValueOrPath(J,U,{transform:K})},g08=new Set(["ne","eq","gt","gte","lt","lte"]),sQ1=(G)=>g08.has(G),y08=(G)=>Object.keys(G).some(sQ1),x08={eq:"=",ne:"<>",gt:">",gte:">=",lt:"<",lte:"<="},m08=(G,Y)=>{var X;let W=Object.keys(Y).find(sQ1),Z=(X=Y.size)!==null&&X!==void 0?X:Y.attr,U=Y[W],{transform:K=!0}=Y;G.resetExpression();let J=G.appendAttributePath(Z,{size:!!Y.size});G.appendToExpression(` ${x08[W]} `),G.appendAttributeValueOrPath(J,U,{transform:K})},c08=(G)=>("in"in G),u08=(G,Y)=>{var X;let W=(X=Y.size)!==null&&X!==void 0?X:Y.attr,{transform:Z=!0,in:U}=Y;G.resetExpression();let K=G.appendAttributePath(W,{size:!!Y.size});G.appendToExpression(" IN ("),U.forEach((J,H)=>{if(H>0)G.appendToExpression(", ");G.appendAttributeValueOrPath(K,J,{transform:Z})}),G.appendToExpression(")")},l08=new Set(["and","or"]),nQ1=(G)=>l08.has(G),p08=(G)=>Object.keys(G).some(nQ1),i08={or:"OR",and:"AND"},a08=(G,Y)=>{let X=Object.keys(Y).find(nQ1),W=Y[X],Z=[];G.resetExpression();for(let U of W)G.parse(U),Z.push(G.expression);G.resetExpression(`(${Z.join(`) ${i08[X]} (`)})`)},r08=(G)=>("not"in G),d08=(G,Y)=>{let{not:X}=Y;G.resetExpression(),G.parse(X),G.resetExpression(`NOT (${G.expression})`)},s08=(G)=>("exists"in G),n08=(G,Y)=>{var X;let W=(X=Y.size)!==null&&X!==void 0?X:Y.attr;G.resetExpression(`${Y.exists===!0?"attribute_exists":"attribute_not_exists"}(`),G.appendAttributePath(W,{size:!!Y.size}),G.appendToExpression(")")},o08=new Set(["contains","beginsWith","type"]),oQ1=(G)=>o08.has(G),t08=(G)=>Object.keys(G).some(oQ1),e08={contains:"contains",beginsWith:"begins_with",type:"attribute_type"},G88=aQ1().freeze(),Y88=aQ1().enum("S","SS","N","NS","B","BS","BOOL","NULL","L","M").freeze(),X88=(G,Y)=>{var X;let W=Object.keys(Y).find(oQ1),Z=(X=Y.size)!==null&&X!==void 0?X:Y.attr,U=Y[W],{transform:K=!0}=Y;G.resetExpression(`${e08[W]}(`);let J=G.appendAttributePath(Z,{size:!!Y.size});G.appendToExpression(", ");let H;switch(W){case"type":H=new dA({...Y88,path:Z});break;case"contains":switch(J.type){case"set":case"list":H=J.elements;break;case"string":H=new dA({...G88,path:Z});break;default:H=J}break;default:H=J}W==="type"?G.appendAttributeValue(H,U):G.appendAttributeValueOrPath(H,U,{transform:K}),G.appendToExpression(")")},W88=(G,Y)=>{if(y08(Y))return m08(G,Y);if(s08(Y))return n08(G,Y);if(b08(Y))return M08(G,Y);if(r08(Y))return d08(G,Y);if(p08(Y))return a08(G,Y);if(t08(Y))return X88(G,Y);if(c08(Y))return u08(G,Y);throw new P8("actions.invalidCondition",{message:"Invalid condition: Unable to detect valid condition type."})},Z88=(G)=>{let Y={};G.expressionAttributeNames.forEach((Z,U)=>{Y[`#${G.expressionAttributePrefix}${U+1}`]=Z});let X={};G.expressionAttributeValues.forEach((Z,U)=>{X[`:${G.expressionAttributePrefix}${U+1}`]=Z});let W=G.expression;return{ExpressionAttributeNames:Y,ExpressionAttributeValues:X,ConditionExpression:W}};class WC extends AV{constructor(G,Y=""){super(G);this.id=Y,this.expressionAttributePrefix=`c${Y}_`,this.expressionAttributeNames=[],this.expressionAttributeValues=[],this.expression=""}setId(G){return this.id=G,this.expressionAttributePrefix=`c${G}_`,this}resetExpression(G=""){return this.expression=G,this}appendAttributePath(G,Y={}){return Uu(this,G,Y)}appendAttributeValue(G,Y,X={}){return k08(this,G,Y,X),this}appendAttributeValueOrPath(G,Y,X={}){return v08(this,G,Y,X),this}appendToExpression(G){return this.expression+=G,this}parse(G){return W88(this,G),this}toCommandOptions(){return Z88(this)}clone(G){let Y=new WC(G!==null&&G!==void 0?G:this.schema,this.id);return Y.expressionAttributeNames=[...this.expressionAttributeNames],Y.expressionAttributeValues=[...this.expressionAttributeValues],Y.expression=this.expression,Y}}var J88=(G)=>({anyOf:G.elements.map((Y)=>EU(Y))}),$88=(G)=>({type:"array",items:EU(G.elements)}),U88=(G)=>{let Y=Object.entries(G.attributes).filter(([,W])=>!W.hidden),X=Y.map(([W])=>W);return{type:"object",properties:Object.fromEntries(Y.map(([W,Z])=>[W,EU(Z)])),...X.length>0?{required:X}:{}}},z88=(G)=>{if(G.type==="binary")return{type:"string"};return{type:G.type}},K88=(G)=>({type:"object",propertyNames:EU(G.keys),additionalProperties:EU(G.elements)}),H88=(G)=>({type:"array",items:EU(G.elements),uniqueItems:!0}),EU=(G)=>{switch(G.type){case"any":return{};case"null":case"boolean":case"number":case"string":case"binary":return z88(G);case"set":return H88(G);case"list":return $88(G);case"map":return U88(G);case"record":return K88(G);case"anyOf":return J88(G)}},V88=(G)=>{let Y=Object.entries(G.attributes).filter(([,W])=>!W.hidden),X=Y.filter(([,{required:W}])=>W==="atLeastOnce"||W==="always").map(([W])=>W);return{type:"object",properties:Object.fromEntries(Y.map(([W,Z])=>[W,EU(Z)])),...X.length>0?{required:X}:{}}};class tQ1 extends AV{formattedItemSchema(){return V88(this.schema)}}tQ1.actionName="jsonSchemer";var $G=Symbol("$entities"),Q88=Symbol("$interceptor"),PP=Symbol("$sentArgs");class SV{constructor(G,Y=[]){this.table=G,this[$G]=Y}}class Ku extends SV{constructor(G){super(G)}parse(G){let Y=this.table,{partitionKey:X,sortKey:W}=Y,Z={},U=G[X.name];if(!UV({...X,big:!0},U))throw new P8("actions.parsePrimaryKey.invalidKeyPart",{message:`Invalid partition key: ${X.name}`,path:X.name,payload:{expected:X.type,received:U,keyPart:"partitionKey"}});if(Z[X.name]=U,W===void 0)return Z;let K=G[W.name];if(!UV({...W,big:!0},K))throw new P8("actions.parsePrimaryKey.invalidKeyPart",{message:`Invalid sort key: ${W.name}`,path:W.name,payload:{expected:W.type,received:K,keyPart:"sortKey"}});return Z[W.name]=K,Z}}Ku.actionName="parsePrimaryKey";var NV={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};do0();LW();K9();K9();class V6 extends vV1{constructor(G){super(G);Object.setPrototypeOf(this,V6.prototype)}}class Hu extends V6{constructor(G){super({name:"BackupInUseException",$fault:"client",...G});this.name="BackupInUseException",this.$fault="client",Object.setPrototypeOf(this,Hu.prototype)}}class Vu extends V6{constructor(G){super({name:"BackupNotFoundException",$fault:"client",...G});this.name="BackupNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Vu.prototype)}}class Qu extends V6{constructor(G){super({name:"InternalServerError",$fault:"server",...G});this.name="InternalServerError",this.$fault="server",Object.setPrototypeOf(this,Qu.prototype)}}class Fu extends V6{constructor(G){super({name:"RequestLimitExceeded",$fault:"client",...G});this.name="RequestLimitExceeded",this.$fault="client",Object.setPrototypeOf(this,Fu.prototype)}}class qu extends V6{constructor(G){super({name:"InvalidEndpointException",$fault:"client",...G});this.name="InvalidEndpointException",this.$fault="client",Object.setPrototypeOf(this,qu.prototype),this.Message=G.Message}}class Au extends V6{constructor(G){super({name:"ProvisionedThroughputExceededException",$fault:"client",...G});this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,Au.prototype)}}class Su extends V6{constructor(G){super({name:"ResourceNotFoundException",$fault:"client",...G});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Su.prototype)}}class Nu extends V6{constructor(G){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...G});this.name="ItemCollectionSizeLimitExceededException",this.$fault="client",Object.setPrototypeOf(this,Nu.prototype)}}class Ru extends V6{constructor(G){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...G});this.name="ContinuousBackupsUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Ru.prototype)}}class Lu extends V6{constructor(G){super({name:"LimitExceededException",$fault:"client",...G});this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,Lu.prototype)}}class Tu extends V6{constructor(G){super({name:"TableInUseException",$fault:"client",...G});this.name="TableInUseException",this.$fault="client",Object.setPrototypeOf(this,Tu.prototype)}}class Iu extends V6{constructor(G){super({name:"TableNotFoundException",$fault:"client",...G});this.name="TableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Iu.prototype)}}class Eu extends V6{constructor(G){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...G});this.name="GlobalTableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Eu.prototype)}}class ju extends V6{constructor(G){super({name:"ResourceInUseException",$fault:"client",...G});this.name="ResourceInUseException",this.$fault="client",Object.setPrototypeOf(this,ju.prototype)}}class Ou extends V6{constructor(G){super({name:"TransactionConflictException",$fault:"client",...G});this.name="TransactionConflictException",this.$fault="client",Object.setPrototypeOf(this,Ou.prototype)}}class _u extends V6{constructor(G){super({name:"PolicyNotFoundException",$fault:"client",...G});this.name="PolicyNotFoundException",this.$fault="client",Object.setPrototypeOf(this,_u.prototype)}}class fu extends V6{constructor(G){super({name:"ExportNotFoundException",$fault:"client",...G});this.name="ExportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,fu.prototype)}}class Pu extends V6{constructor(G){super({name:"GlobalTableNotFoundException",$fault:"client",...G});this.name="GlobalTableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Pu.prototype)}}class Cu extends V6{constructor(G){super({name:"ImportNotFoundException",$fault:"client",...G});this.name="ImportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Cu.prototype)}}class Bu extends V6{constructor(G){super({name:"DuplicateItemException",$fault:"client",...G});this.name="DuplicateItemException",this.$fault="client",Object.setPrototypeOf(this,Bu.prototype)}}class wu extends V6{constructor(G){super({name:"IdempotentParameterMismatchException",$fault:"client",...G});this.name="IdempotentParameterMismatchException",this.$fault="client",Object.setPrototypeOf(this,wu.prototype),this.Message=G.Message}}class Du extends V6{constructor(G){super({name:"TransactionInProgressException",$fault:"client",...G});this.name="TransactionInProgressException",this.$fault="client",Object.setPrototypeOf(this,Du.prototype),this.Message=G.Message}}class ku extends V6{constructor(G){super({name:"ExportConflictException",$fault:"client",...G});this.name="ExportConflictException",this.$fault="client",Object.setPrototypeOf(this,ku.prototype)}}class hu extends V6{constructor(G){super({name:"InvalidExportTimeException",$fault:"client",...G});this.name="InvalidExportTimeException",this.$fault="client",Object.setPrototypeOf(this,hu.prototype)}}class vu extends V6{constructor(G){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...G});this.name="PointInTimeRecoveryUnavailableException",this.$fault="client",Object.setPrototypeOf(this,vu.prototype)}}class bu extends V6{constructor(G){super({name:"ImportConflictException",$fault:"client",...G});this.name="ImportConflictException",this.$fault="client",Object.setPrototypeOf(this,bu.prototype)}}class Mu extends V6{constructor(G){super({name:"TableAlreadyExistsException",$fault:"client",...G});this.name="TableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Mu.prototype)}}class gu extends V6{constructor(G){super({name:"InvalidRestoreTimeException",$fault:"client",...G});this.name="InvalidRestoreTimeException",this.$fault="client",Object.setPrototypeOf(this,gu.prototype)}}class yu extends V6{constructor(G){super({name:"ReplicaAlreadyExistsException",$fault:"client",...G});this.name="ReplicaAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,yu.prototype)}}class xu extends V6{constructor(G){super({name:"ReplicaNotFoundException",$fault:"client",...G});this.name="ReplicaNotFoundException",this.$fault="client",Object.setPrototypeOf(this,xu.prototype)}}class mu extends V6{constructor(G){super({name:"IndexNotFoundException",$fault:"client",...G});this.name="IndexNotFoundException",this.$fault="client",Object.setPrototypeOf(this,mu.prototype)}}var Yc;(function(G){G.visit=(Y,X)=>{if(Y.S!==void 0)return X.S(Y.S);if(Y.N!==void 0)return X.N(Y.N);if(Y.B!==void 0)return X.B(Y.B);if(Y.SS!==void 0)return X.SS(Y.SS);if(Y.NS!==void 0)return X.NS(Y.NS);if(Y.BS!==void 0)return X.BS(Y.BS);if(Y.M!==void 0)return X.M(Y.M);if(Y.L!==void 0)return X.L(Y.L);if(Y.NULL!==void 0)return X.NULL(Y.NULL);if(Y.BOOL!==void 0)return X.BOOL(Y.BOOL);return X._(Y.$unknown[0],Y.$unknown[1])}})(Yc||(Yc={}));class cu extends V6{constructor(G){super({name:"ConditionalCheckFailedException",$fault:"client",...G});this.name="ConditionalCheckFailedException",this.$fault="client",Object.setPrototypeOf(this,cu.prototype),this.Item=G.Item}}class uu extends V6{constructor(G){super({name:"TransactionCanceledException",$fault:"client",...G});this.name="TransactionCanceledException",this.$fault="client",Object.setPrototypeOf(this,uu.prototype),this.Message=G.Message,this.CancellationReasons=G.CancellationReasons}}function RV(G){return{"content-type":"application/x-amz-json-1.0","x-amz-target":`DynamoDB_20120810.${G}`}}var F88=async(G,Y)=>{let X=RV("DeleteItem"),W;return W=JSON.stringify(U48(G,Y)),IV(Y,X,"/",void 0,W)},q88=async(G,Y)=>{let X=RV("GetItem"),W;return W=JSON.stringify(K48(G,Y)),IV(Y,X,"/",void 0,W)},A88=async(G,Y)=>{let X=RV("PutItem"),W;return W=JSON.stringify(F48(G,Y)),IV(Y,X,"/",void 0,W)},S88=async(G,Y)=>{let X=RV("Query"),W;return W=JSON.stringify(A48(G,Y)),IV(Y,X,"/",void 0,W)},N88=async(G,Y)=>{let X=RV("Scan"),W;return W=JSON.stringify(S48(G,Y)),IV(Y,X,"/",void 0,W)},R88=async(G,Y)=>{let X=RV("UpdateItem"),W;return W=JSON.stringify(N48(G,Y)),IV(Y,X,"/",void 0,W)},L88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=E48(X,Y),{$metadata:t4(G),...W}},T88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=j48(X,Y),{$metadata:t4(G),...W}},I88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=C48(X,Y),{$metadata:t4(G),...W}},E88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=B48(X,Y),{$metadata:t4(G),...W}},j88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=w48(X,Y),{$metadata:t4(G),...W}},O88=async(G,Y)=>{if(G.statusCode>=300)return LV(G,Y);let X=await _U(G.body,Y),W={};return W=k48(X,Y),{$metadata:t4(G),...W}},LV=async(G,Y)=>{let X={...G,body:await ko0(G.body,Y)},W=ho0(G,X.body);switch(W){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await y88(X,Y);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await s88(X,Y);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await x88(X,Y);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await a88(X,Y);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await o88(X,Y);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await u88(X,Y);case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await _88(X,Y);case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await C88(X,Y);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await l88(X,Y);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await e88(X,Y);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await G48(X,Y);case"GlobalTableAlreadyExistsException":case"com.amazonaws.dynamodb#GlobalTableAlreadyExistsException":throw await k88(X,Y);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await n88(X,Y);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await f88(X,Y);case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await P88(X,Y);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await X48(X,Y);case"PolicyNotFoundException":case"com.amazonaws.dynamodb#PolicyNotFoundException":throw await i88(X,Y);case"ExportNotFoundException":case"com.amazonaws.dynamodb#ExportNotFoundException":throw await D88(X,Y);case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await h88(X,Y);case"ImportNotFoundException":case"com.amazonaws.dynamodb#ImportNotFoundException":throw await M88(X,Y);case"DuplicateItemException":case"com.amazonaws.dynamodb#DuplicateItemException":throw await B88(X,Y);case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await v88(X,Y);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await Y48(X,Y);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await W48(X,Y);case"ExportConflictException":case"com.amazonaws.dynamodb#ExportConflictException":throw await w88(X,Y);case"InvalidExportTimeException":case"com.amazonaws.dynamodb#InvalidExportTimeException":throw await m88(X,Y);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await p88(X,Y);case"ImportConflictException":case"com.amazonaws.dynamodb#ImportConflictException":throw await b88(X,Y);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await t88(X,Y);case"InvalidRestoreTimeException":case"com.amazonaws.dynamodb#InvalidRestoreTimeException":throw await c88(X,Y);case"ReplicaAlreadyExistsException":case"com.amazonaws.dynamodb#ReplicaAlreadyExistsException":throw await r88(X,Y);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await d88(X,Y);case"IndexNotFoundException":case"com.amazonaws.dynamodb#IndexNotFoundException":throw await g88(X,Y);default:let Z=X.body;return h48({output:G,parsedBody:Z,errorCode:W})}},_88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Hu({$metadata:t4(G),...W});return _6(Z,X)},f88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Vu({$metadata:t4(G),...W});return _6(Z,X)},P88=async(G,Y)=>{let X=G.body,W=I48(X,Y),Z=new cu({$metadata:t4(G),...W});return _6(Z,X)},C88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Ru({$metadata:t4(G),...W});return _6(Z,X)},B88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Bu({$metadata:t4(G),...W});return _6(Z,X)},w88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new ku({$metadata:t4(G),...W});return _6(Z,X)},D88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new fu({$metadata:t4(G),...W});return _6(Z,X)},k88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Eu({$metadata:t4(G),...W});return _6(Z,X)},h88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Pu({$metadata:t4(G),...W});return _6(Z,X)},v88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new wu({$metadata:t4(G),...W});return _6(Z,X)},b88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new bu({$metadata:t4(G),...W});return _6(Z,X)},M88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Cu({$metadata:t4(G),...W});return _6(Z,X)},g88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new mu({$metadata:t4(G),...W});return _6(Z,X)},y88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Qu({$metadata:t4(G),...W});return _6(Z,X)},x88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new qu({$metadata:t4(G),...W});return _6(Z,X)},m88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new hu({$metadata:t4(G),...W});return _6(Z,X)},c88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new gu({$metadata:t4(G),...W});return _6(Z,X)},u88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Nu({$metadata:t4(G),...W});return _6(Z,X)},l88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Lu({$metadata:t4(G),...W});return _6(Z,X)},p88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new vu({$metadata:t4(G),...W});return _6(Z,X)},i88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new _u({$metadata:t4(G),...W});return _6(Z,X)},a88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Au({$metadata:t4(G),...W});return _6(Z,X)},r88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new yu({$metadata:t4(G),...W});return _6(Z,X)},d88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new xu({$metadata:t4(G),...W});return _6(Z,X)},s88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Fu({$metadata:t4(G),...W});return _6(Z,X)},n88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new ju({$metadata:t4(G),...W});return _6(Z,X)},o88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Su({$metadata:t4(G),...W});return _6(Z,X)},t88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Mu({$metadata:t4(G),...W});return _6(Z,X)},e88=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Tu({$metadata:t4(G),...W});return _6(Z,X)},G48=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Iu({$metadata:t4(G),...W});return _6(Z,X)},Y48=async(G,Y)=>{let X=G.body,W=D48(X,Y),Z=new uu({$metadata:t4(G),...W});return _6(Z,X)},X48=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Ou({$metadata:t4(G),...W});return _6(Z,X)},W48=async(G,Y)=>{let X=G.body,W=D4(X),Z=new Du({$metadata:t4(G),...W});return _6(Z,X)},Z48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=J48(Z,Y),X},{})},RJ=(G,Y)=>{return Yc.visit(G,{B:(X)=>({B:Y.base64Encoder(X)}),BOOL:(X)=>({BOOL:X}),BS:(X)=>({BS:$48(X,Y)}),L:(X)=>({L:V48(X,Y)}),M:(X)=>({M:Q48(X,Y)}),N:(X)=>({N:X}),NS:(X)=>({NS:D4(X)}),NULL:(X)=>({NULL:X}),S:(X)=>({S:X}),SS:(X)=>({SS:D4(X)}),_:(X,W)=>({name:W})})},eQ1=(G,Y)=>{return G.filter((X)=>X!=null).map((X)=>{return RJ(X,Y)})},J48=(G,Y)=>{return N2(G,{Action:[],Value:(X)=>RJ(X,Y)})},$48=(G,Y)=>{return G.filter((X)=>X!=null).map((X)=>{return Y.base64Encoder(X)})},GF1=(G,Y)=>{return N2(G,{AttributeValueList:(X)=>eQ1(X,Y),ComparisonOperator:[]})},U48=(G,Y)=>{return N2(G,{ConditionExpression:[],ConditionalOperator:[],Expected:(X)=>lu(X,Y),ExpressionAttributeNames:D4,ExpressionAttributeValues:(X)=>LS(X,Y),Key:(X)=>TS(X,Y),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],ReturnValuesOnConditionCheckFailure:[],TableName:[]})},lu=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=z48(Z,Y),X},{})},z48=(G,Y)=>{return N2(G,{AttributeValueList:(X)=>eQ1(X,Y),ComparisonOperator:[],Exists:[],Value:(X)=>RJ(X,Y)})},LS=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=RJ(Z,Y),X},{})},YF1=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=GF1(Z,Y),X},{})},K48=(G,Y)=>{return N2(G,{AttributesToGet:D4,ConsistentRead:[],ExpressionAttributeNames:D4,Key:(X)=>TS(X,Y),ProjectionExpression:[],ReturnConsumedCapacity:[],TableName:[]})},TS=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=RJ(Z,Y),X},{})},H48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=GF1(Z,Y),X},{})},V48=(G,Y)=>{return G.filter((X)=>X!=null).map((X)=>{return RJ(X,Y)})},Q48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=RJ(Z,Y),X},{})},F48=(G,Y)=>{return N2(G,{ConditionExpression:[],ConditionalOperator:[],Expected:(X)=>lu(X,Y),ExpressionAttributeNames:D4,ExpressionAttributeValues:(X)=>LS(X,Y),Item:(X)=>q48(X,Y),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],ReturnValuesOnConditionCheckFailure:[],TableName:[]})},q48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=RJ(Z,Y),X},{})},A48=(G,Y)=>{return N2(G,{AttributesToGet:D4,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:(X)=>TS(X,Y),ExpressionAttributeNames:D4,ExpressionAttributeValues:(X)=>LS(X,Y),FilterExpression:[],IndexName:[],KeyConditionExpression:[],KeyConditions:(X)=>H48(X,Y),Limit:[],ProjectionExpression:[],QueryFilter:(X)=>YF1(X,Y),ReturnConsumedCapacity:[],ScanIndexForward:[],Select:[],TableName:[]})},S48=(G,Y)=>{return N2(G,{AttributesToGet:D4,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:(X)=>TS(X,Y),ExpressionAttributeNames:D4,ExpressionAttributeValues:(X)=>LS(X,Y),FilterExpression:[],IndexName:[],Limit:[],ProjectionExpression:[],ReturnConsumedCapacity:[],ScanFilter:(X)=>YF1(X,Y),Segment:[],Select:[],TableName:[],TotalSegments:[]})},N48=(G,Y)=>{return N2(G,{AttributeUpdates:(X)=>Z48(X,Y),ConditionExpression:[],ConditionalOperator:[],Expected:(X)=>lu(X,Y),ExpressionAttributeNames:D4,ExpressionAttributeValues:(X)=>LS(X,Y),Key:(X)=>TS(X,Y),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],ReturnValuesOnConditionCheckFailure:[],TableName:[],UpdateExpression:[]})},CU=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=IS(qS(Z),Y),X},{})},IS=(G,Y)=>{if(G.B!=null)return{B:Y.base64Decoder(G.B)};if($f(G.BOOL)!==void 0)return{BOOL:$f(G.BOOL)};if(G.BS!=null)return{BS:R48(G.BS,Y)};if(G.L!=null)return{L:f48(G.L,Y)};if(G.M!=null)return{M:P48(G.M,Y)};if(NW(G.N)!==void 0)return{N:NW(G.N)};if(G.NS!=null)return{NS:D4(G.NS)};if($f(G.NULL)!==void 0)return{NULL:$f(G.NULL)};if(NW(G.S)!==void 0)return{S:NW(G.S)};if(G.SS!=null)return{SS:D4(G.SS)};return{$unknown:Object.entries(G)[0]}},R48=(G,Y)=>{return(G||[]).filter((W)=>W!=null).map((W)=>{return Y.base64Decoder(W)})},L48=(G,Y)=>{return N2(G,{Code:NW,Item:(X)=>CU(X,Y),Message:NW})},T48=(G,Y)=>{return(G||[]).filter((W)=>W!=null).map((W)=>{return L48(W,Y)})},XF1=(G,Y)=>{return N2(G,{CapacityUnits:TU,ReadCapacityUnits:TU,WriteCapacityUnits:TU})},I48=(G,Y)=>{return N2(G,{Item:(X)=>CU(X,Y),message:NW})},TV=(G,Y)=>{return N2(G,{CapacityUnits:TU,GlobalSecondaryIndexes:(X)=>Dz1(X,Y),LocalSecondaryIndexes:(X)=>Dz1(X,Y),ReadCapacityUnits:TU,Table:(X)=>XF1(X,Y),TableName:NW,WriteCapacityUnits:TU})},E48=(G,Y)=>{return N2(G,{Attributes:(X)=>CU(X,Y),ConsumedCapacity:(X)=>TV(X,Y),ItemCollectionMetrics:(X)=>pu(X,Y)})},j48=(G,Y)=>{return N2(G,{ConsumedCapacity:(X)=>TV(X,Y),Item:(X)=>CU(X,Y)})},O48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=IS(qS(Z),Y),X},{})},pu=(G,Y)=>{return N2(G,{ItemCollectionKey:(X)=>O48(X,Y),SizeEstimateRangeGB:(X)=>_48(X,Y)})},_48=(G,Y)=>{return(G||[]).filter((W)=>W!=null).map((W)=>{return TU(W)})},WF1=(G,Y)=>{return(G||[]).filter((W)=>W!=null).map((W)=>{return CU(W,Y)})},ZF1=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=IS(qS(Z),Y),X},{})},f48=(G,Y)=>{return(G||[]).filter((W)=>W!=null).map((W)=>{return IS(qS(W),Y)})},P48=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=IS(qS(Z),Y),X},{})},C48=(G,Y)=>{return N2(G,{Attributes:(X)=>CU(X,Y),ConsumedCapacity:(X)=>TV(X,Y),ItemCollectionMetrics:(X)=>pu(X,Y)})},B48=(G,Y)=>{return N2(G,{ConsumedCapacity:(X)=>TV(X,Y),Count:RP,Items:(X)=>WF1(X,Y),LastEvaluatedKey:(X)=>ZF1(X,Y),ScannedCount:RP})},w48=(G,Y)=>{return N2(G,{ConsumedCapacity:(X)=>TV(X,Y),Count:RP,Items:(X)=>WF1(X,Y),LastEvaluatedKey:(X)=>ZF1(X,Y),ScannedCount:RP})},Dz1=(G,Y)=>{return Object.entries(G).reduce((X,[W,Z])=>{if(Z===null)return X;return X[W]=XF1(Z,Y),X},{})},D48=(G,Y)=>{return N2(G,{CancellationReasons:(X)=>T48(X,Y),Message:NW})},k48=(G,Y)=>{return N2(G,{Attributes:(X)=>CU(X,Y),ConsumedCapacity:(X)=>TV(X,Y),ItemCollectionMetrics:(X)=>pu(X,Y)})},t4=(G)=>({httpStatusCode:G.statusCode,requestId:G.headers["x-amzn-requestid"]??G.headers["x-amzn-request-id"]??G.headers["x-amz-request-id"],extendedRequestId:G.headers["x-amz-id-2"],cfId:G.headers["x-amz-cf-id"]}),h48=mn0(V6),IV=async(G,Y,X,W,Z)=>{let{hostname:U,protocol:K="https",port:J,path:H}=await G.endpoint(),$={protocol:K,hostname:U,port:J,method:"POST",path:H.endsWith("/")?H.slice(0,-1)+X:H+X,headers:Y};if(W!==void 0)$.hostname=W;if(Z!==void 0)$.body=Z;return new fc($)};jU();SJ();K9();class JF1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","DeleteItem",{}).n("DynamoDBClient","DeleteItemCommand").f(void 0,void 0).ser(F88).de(L88).build(){}jU();SJ();K9();class $F1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","GetItem",{}).n("DynamoDBClient","GetItemCommand").f(void 0,void 0).ser(q88).de(T88).build(){}jU();SJ();K9();class UF1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","PutItem",{}).n("DynamoDBClient","PutItemCommand").f(void 0,void 0).ser(A88).de(I88).build(){}jU();SJ();K9();class zF1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","Query",{}).n("DynamoDBClient","QueryCommand").f(void 0,void 0).ser(S88).de(E88).build(){}jU();SJ();K9();class KF1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","Scan",{}).n("DynamoDBClient","ScanCommand").f(void 0,void 0).ser(N88).de(j88).build(){}jU();SJ();K9();class HF1 extends TW.classBuilder().ep({...NV}).m(function(G,Y,X,W){return[HV(X,this.serialize,this.deserialize),VV(X,G.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","UpdateItem",{}).n("DynamoDBClient","UpdateItemCommand").f(void 0,void 0).ser(R88).de(O88).build(){}K9();K9();class ES{constructor(G){if(typeof G==="object"&&"N"in G)this.value=String(G.N);else this.value=String(G);let Y=typeof G.valueOf()==="number"?G.valueOf():0;if(Y>Number.MAX_SAFE_INTEGER||Y<Number.MIN_SAFE_INTEGER||Math.abs(Y)===1/0||Number.isNaN(Y))throw new Error(`NumberValue should not be initialized with an imprecise number=${Y}. Use a string instead.`)}static from(G){return new ES(G)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let G=this.toString();return BigInt(G)}toString(){return String(this.value)}valueOf(){return this.toString()}}var ZC=(G,Y)=>{if(G===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");else if(G===null&&typeof G==="object")return qP();else if(Array.isArray(G))return v48(G,Y);else if(G?.constructor?.name==="Set")return b48(G,Y);else if(G?.constructor?.name==="Map")return M48(G,Y);else if(G?.constructor?.name==="Object"||!G.constructor&&typeof G==="object")return kz1(G,Y);else if(AF1(G)){if(G.length===0&&Y?.convertEmptyValues)return qP();return VF1(G)}else if(typeof G==="boolean"||G?.constructor?.name==="Boolean")return{BOOL:G.valueOf()};else if(typeof G==="number"||G?.constructor?.name==="Number")return qF1(G);else if(G instanceof ES)return G.toAttributeValue();else if(typeof G==="bigint")return FF1(G);else if(typeof G==="string"||G?.constructor?.name==="String"){if(G.length===0&&Y?.convertEmptyValues)return qP();return QF1(G)}else if(Y?.convertClassInstanceToMap&&typeof G==="object")return kz1(G,Y);throw new Error(`Unsupported type passed: ${G}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},v48=(G,Y)=>({L:G.filter((X)=>typeof X!=="function"&&(!Y?.removeUndefinedValues||Y?.removeUndefinedValues&&X!==void 0)).map((X)=>ZC(X,Y))}),b48=(G,Y)=>{let X=Y?.removeUndefinedValues?new Set([...G].filter((Z)=>Z!==void 0)):G;if(!Y?.removeUndefinedValues&&X.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(X.size===0){if(Y?.convertEmptyValues)return qP();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let W=X.values().next().value;if(W instanceof ES)return{NS:Array.from(X).map((Z)=>Z.toString())};else if(typeof W==="number")return{NS:Array.from(X).map(qF1).map((Z)=>Z.N)};else if(typeof W==="bigint")return{NS:Array.from(X).map(FF1).map((Z)=>Z.N)};else if(typeof W==="string")return{SS:Array.from(X).map(QF1).map((Z)=>Z.S)};else if(AF1(W))return{BS:Array.from(X).map(VF1).map((Z)=>Z.B)};else throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},M48=(G,Y)=>({M:((X)=>{let W={};for(let[Z,U]of X)if(typeof U!=="function"&&(U!==void 0||!Y?.removeUndefinedValues))W[Z]=ZC(U,Y);return W})(G)}),kz1=(G,Y)=>({M:((X)=>{let W={};for(let Z in X){let U=X[Z];if(typeof U!=="function"&&(U!==void 0||!Y?.removeUndefinedValues))W[Z]=ZC(U,Y)}return W})(G)}),qP=()=>({NULL:!0}),VF1=(G)=>({B:G}),QF1=(G)=>({S:G.toString()}),FF1=(G)=>({N:G.toString()}),hz1=(G)=>{throw new Error(`${G} ${typeof BigInt==="function"?"Use BigInt.":"Pass string value instead."} `)},qF1=(G)=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map((Y)=>Y.toString()).includes(G.toString()))throw new Error(`Special numeric value ${G.toString()} is not allowed`);else if(G>Number.MAX_SAFE_INTEGER)hz1(`Number ${G.toString()} is greater than Number.MAX_SAFE_INTEGER.`);else if(G<Number.MIN_SAFE_INTEGER)hz1(`Number ${G.toString()} is lesser than Number.MIN_SAFE_INTEGER.`);return{N:G.toString()}},AF1=(G)=>{let Y=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];if(G?.constructor)return Y.includes(G.constructor.name);return!1},CP=(G,Y)=>{for(let[X,W]of Object.entries(G))if(W!==void 0)switch(X){case"NULL":return null;case"BOOL":return Boolean(W);case"N":return vz1(W,Y);case"B":return Mz1(W);case"S":return bz1(W);case"L":return g48(W,Y);case"M":return y48(W,Y);case"NS":return new Set(W.map((Z)=>vz1(Z,Y)));case"BS":return new Set(W.map(Mz1));case"SS":return new Set(W.map(bz1));default:throw new Error(`Unsupported type passed: ${X}`)}throw new Error(`No value defined: ${JSON.stringify(G)}`)},vz1=(G,Y)=>{if(Y?.wrapNumbers)return ES.from(G);let X=Number(G),W=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((X>Number.MAX_SAFE_INTEGER||X<Number.MIN_SAFE_INTEGER)&&!W.includes(X))if(typeof BigInt==="function")try{return BigInt(G)}catch(U){throw new Error(`${G} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${G} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return X},bz1=(G)=>G,Mz1=(G)=>G,g48=(G,Y)=>G.map((X)=>CP(X,Y)),y48=(G,Y)=>Object.entries(G).reduce((X,[W,Z])=>(X[W]=CP(Z,Y),X),{});function x48(G,Y){let X=ZC(G,Y),[W,Z]=Object.entries(X)[0];switch(W){case"M":case"L":return Y?.convertTopLevelContainer?X:Z;case"SS":case"NS":case"BS":case"S":case"N":case"B":case"NULL":case"BOOL":case"$unknown":default:return X}}var m48=(G,Y)=>{if(Y?.convertWithoutMapWrapper)return CP(G,Y);return CP({M:G},Y)},sA=null,Y2={},zV=[],gz1="*",BP=(G,Y,X)=>{if(G!==void 0)if(X==null)return Y(G);else{let W=Object.keys(X),Z=W.length===1&&W[0]===gz1,U=W.length>=1&&!Z,K=W.length===0;if(U)return iu(G,Y,X);else if(K)return c48(G,Y,sA);else if(Z)return Object.entries(G??{}).reduce((J,[H,$])=>{if(typeof $!=="function")J[H]=BP($,Y,X[gz1]);return J},Array.isArray(G)?[]:{})}return},iu=(G,Y,X)=>{let W;if(Array.isArray(G))W=[...G].filter((Z)=>typeof Z!=="function");else{W={};for(let[Z,U]of Object.entries(G))if(typeof U!=="function")W[Z]=U}for(let[Z,U]of Object.entries(X)){if(typeof G[Z]==="function")continue;let K=BP(G[Z],Y,U);if(K!==void 0&&typeof K!=="function")W[Z]=K}return W},c48=(G,Y,X)=>{if(Array.isArray(G))return G.filter((W)=>typeof W!=="function").map((W)=>BP(W,Y,X));return Object.entries(G).reduce((W,[Z,U])=>{if(typeof U==="function")return W;let K=BP(U,Y,X);if(K!==void 0&&typeof K!=="function")W[Z]=K;return W},{})},u48=(G,Y,X)=>{return iu(G,(Z)=>x48(Z,X),Y)},l48=(G,Y,X)=>{return iu(G,(Z)=>m48(Z,X),Y)};class tY extends TW{addMarshallingMiddleware(G){let{marshallOptions:Y={},unmarshallOptions:X={}}=G.translateConfig||{};Y.convertTopLevelContainer=Y.convertTopLevelContainer??!0,X.convertWithoutMapWrapper=X.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((W,Z)=>async(U)=>{U.input=u48(this.input,this.inputKeyNodes,Y),Z.dynamoDbDocumentClientOptions=Z.dynamoDbDocumentClientOptions||tY.defaultLogFilterOverrides;let K=U.input;return Z.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>{return Z.inputFilterSensitiveLog?.(K)},W(U)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((W,Z)=>async(U)=>{let K=await W(U),J=K.output;return Z.dynamoDbDocumentClientOptions=Z.dynamoDbDocumentClientOptions||tY.defaultLogFilterOverrides,Z.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>{return Z.outputFilterSensitiveLog?.(J)},K.output=l48(K.output,this.outputKeyNodes,X),K},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}}tY.defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...G){},overrideOutputFilterSensitiveLog(...G){}};K9();K9();K9();class SF1 extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={Key:Y2,Expected:{"*":{Value:sA,AttributeValueList:zV}},ExpressionAttributeValues:Y2},this.outputKeyNodes={Attributes:Y2,ItemCollectionMetrics:{ItemCollectionKey:Y2}},this.clientCommand=new JF1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();K9();K9();class NF1 extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={Key:Y2},this.outputKeyNodes={Item:Y2},this.clientCommand=new $F1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();class RF1 extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={Item:Y2,Expected:{"*":{Value:sA,AttributeValueList:zV}},ExpressionAttributeValues:Y2},this.outputKeyNodes={Attributes:Y2,ItemCollectionMetrics:{ItemCollectionKey:Y2}},this.clientCommand=new UF1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();class LF1 extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={KeyConditions:{"*":{AttributeValueList:zV}},QueryFilter:{"*":{AttributeValueList:zV}},ExclusiveStartKey:Y2,ExpressionAttributeValues:Y2},this.outputKeyNodes={Items:{"*":Y2},LastEvaluatedKey:Y2},this.clientCommand=new zF1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();class TF1 extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={ScanFilter:{"*":{AttributeValueList:zV}},ExclusiveStartKey:Y2,ExpressionAttributeValues:Y2},this.outputKeyNodes={Items:{"*":Y2},LastEvaluatedKey:Y2},this.clientCommand=new KF1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();K9();K9();class au extends tY{constructor(G){super();this.input=G,this.inputKeyNodes={Key:Y2,AttributeUpdates:{"*":{Value:sA}},Expected:{"*":{Value:sA,AttributeValueList:zV}},ExpressionAttributeValues:Y2},this.outputKeyNodes={Attributes:Y2,ItemCollectionMetrics:{ItemCollectionKey:Y2}},this.clientCommand=new HF1(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(G,Y,X){this.addMarshallingMiddleware(Y);let W=G.concat(this.middlewareStack),Z=this.clientCommand.resolveMiddleware(W,Y,X);return async()=>Z(this.clientCommand)}}K9();var p48=Symbol("$interceptor"),eY=Symbol("$sentArgs"),ol4=Symbol("$IS_EXTENSION"),VU=Symbol("$GET");var jS=(G)=>X2(G)&&(VU in G);class V7{constructor(G){this.entity=G}}var yz1=Symbol("$formatter");class LJ extends V7{constructor(G){super(G);this[yz1]=new dQ1(G.schema)}format(G,Y={}){try{return this[yz1].format(G,Y)}catch(X){if(!P8.match(X,"formatter."))throw X;let W=G[this.entity.table.partitionKey.name],Z=this.entity.table.sortKey&&G[this.entity.table.sortKey.name];if(W===void 0&&Z===void 0)throw X;let U=W&&[W&&`Partition key: ${String(W)}`,Z&&`Sort key: ${String(Z)}`].filter(Boolean).join(" / ");throw X.message+=` ${U}`,X.payload.partitionKey=W,X.payload.sortKey=Z,X}}}var IF1=()=>{return(G,Y,X)=>{let W=X.value;X.value=async function(...Z){let U=this,K=U.table[Q88];if(K!==void 0){let J=await K(U);if(J!==void 0)return J}return W.apply(this,Z)}}},SA=Symbol("$query"),NA=Symbol("$options"),Df=Symbol("$conditionParser");class WY extends V7{constructor(G,Y=""){super(G);this.parse=(X)=>{return this[Df].parse(X),this},this[Df]=new WC(G.schema,Y)}setId(G){return this[Df].setId(G),this}toCommandOptions(){return this[Df].toCommandOptions()}}var kf=Symbol("$pathParser");class EV extends V7{constructor(G,Y=""){super(G);this.parse=(X)=>{return this[kf].parse(X),this},this[kf]=new zu(G.schema,Y)}setId(G){return this[kf].setId(G),this}toCommandOptions(){return this[kf].toCommandOptions()}}var xz1=new Set(["NONE","TOTAL","INDEXES"]),BU=(G)=>{if(!xz1.has(G))throw new P8("options.invalidCapacityOption",{message:`Invalid capacity option: '${String(G)}'. 'capacity' must be one of: ${[...xz1].join(", ")}.`,payload:{capacity:G}});return G},JC=(G,Y)=>{if(!rA(G))throw new P8("options.invalidConsistentOption",{message:`Invalid consistent option: '${String(G)}'. 'consistent' must be boolean.`,payload:{consistent:G}});if(G&&Y!==void 0)throw new P8("options.invalidConsistentOption",{message:`Invalid consistent option: '${String(G)}'. Queries on secondary indexes cannot be consistent.`,payload:{consistent:G}});return G},EF1=(G,Y)=>{if(!GX(Y))throw new P8("options.invalidIndexOption",{message:`Invalid index option: '${String(Y)}'. 'index' must be a string.`,payload:{index:Y}});if(G.indexes[Y]===void 0)throw new P8("options.invalidIndexOption",{message:`Invalid index option: '${String(Y)}'. Index is not defined on Table, please provide an 'indexes' option to its constructor.`,payload:{index:Y}});return Y},nA=(G)=>Zu(G)&&Number.isInteger(G),jF1=(G)=>{if(!nA(G)||G<=0)throw new P8("options.invalidLimitOption",{message:`Invalid limit option: '${String(G)}'. 'limit' must be an integer > 0.`,payload:{limit:G}});return G},OF1=(G)=>{if(G===1/0)return G;if(!nA(G)||G<=0)throw new P8("options.invalidMaxPagesOption",{message:`Invalid limit option: '${String(G)}'. 'limit' must be Infinity or an integer > 0.`,payload:{maxPages:G}});return G},l7=(G)=>{let[Y]=Object.keys(G);if(Y!==void 0)throw new P8("options.unknownOption",{message:`Unknown option: ${Y}.`,payload:{option:Y}})},mz1=new Set(["ALL_ATTRIBUTES","ALL_PROJECTED_ATTRIBUTES","COUNT","SPECIFIC_ATTRIBUTES"]),_F1=(G,{index:Y,attributes:X}={})=>{if(!mz1.has(G))throw new P8("options.invalidSelectOption",{message:`Invalid select option: '${String(G)}'. 'select' must be one of: ${[...mz1].join(", ")}.`,payload:{select:G}});if(G==="ALL_PROJECTED_ATTRIBUTES"&&Y===void 0)throw new P8("options.invalidSelectOption",{message:`Invalid select option: '${String(G)}'. Please provide an 'index' option.`,payload:{select:G}});if(X!==void 0&&G!=="SPECIFIC_ATTRIBUTES")throw new P8("options.invalidSelectOption",{message:`Invalid select option: '${String(G)}'. Select must be 'SPECIFIC_ATTRIBUTES' if a filter expression has been provided.`,payload:{select:G}});return G},p7=(G)=>{if(!GX(G))throw new P8("options.invalidTableNameOption",{message:`Invalid tableName option: '${String(G)}'. 'tableName' must be a string.`,payload:{tableName:G}});return G},s9=(G)=>Object.keys(G).length===0,i48=(G,...Y)=>{let X=new Set(Y);return Object.fromEntries(Object.entries(G).filter(([W])=>X.has(W)))},a48=new Set(["eq","gt","gte","lt","lte","between","beginsWith"]),sx={required:"never",key:!1,hidden:!1,savedAs:void 0,enum:void 0,transform:void 0,big:!1,defaults:{key:void 0,put:void 0,update:void 0},links:{key:void 0,put:void 0,update:void 0},validators:{key:void 0,put:void 0,update:void 0}},cz1=(G)=>{switch(G.type){case"number":return new RS({...sx,path:G.name});case"string":return new dA({...sx,path:G.name});case"binary":return new iQ1({...sx,path:G.name})}},r48=(G,Y)=>{let{index:X,partition:W,range:Z}=Y,U;if(X!==void 0){let q=G.indexes[X];if(q===void 0){let S=Object.keys(G.indexes),N=S.length>0;throw new P8("queryCommand.invalidIndex",{message:`Unknown index: ${X}. ${N?` Expected one of: ${S.join(", ")}.`:""}`,payload:{received:X,...N?{expected:Object.keys(G.indexes)}:{}}})}U=q}else U=G;let{partitionKey:K=G.partitionKey,sortKey:J}=U;if(W===void 0)throw new P8("queryCommand.invalidPartition",{message:`Missing query partition. Expected: ${K.type}.`,path:K.name,payload:{partition:W}});let H=new Ju({});H.attributes[K.name]=cz1(K);let $={attr:K.name,eq:W};if(J!==void 0&&Z!==void 0){H.attributes[J.name]=cz1(J);let q={attr:J.name,...i48(Z,...a48)};$={and:[$,q]}}let Q=new WC(H,"0");Q.parse($);let{ConditionExpression:F,ExpressionAttributeNames:z,ExpressionAttributeValues:V}=Q.toCommandOptions();return{KeyConditionExpression:F,ExpressionAttributeNames:z,ExpressionAttributeValues:V}},d48=(G,Y=[],X,W={})=>{let{index:Z}=X,{capacity:U,consistent:K,exclusiveStartKey:J,limit:H,maxPages:$,reverse:Q,select:F,filters:z,attributes:V,tableName:q,...S}=W;l7(S);let N=z!==null&&z!==void 0?z:{},R=V;if(q!==void 0)p7(q);let j={TableName:q!==null&&q!==void 0?q:G.getName()};if(U!==void 0)j.ReturnConsumedCapacity=BU(U);if(K!==void 0)j.ConsistentRead=JC(K,Z);if(J!==void 0)j.ExclusiveStartKey=J;if(Z!==void 0)j.IndexName=EF1(G,Z);if(H!==void 0)j.Limit=jF1(H);if($!==void 0)OF1($);if(Q!==void 0){if(!rA(Q))throw new P8("queryCommand.invalidReverseOption",{message:'Invalid "reverse" options: Must be a boolean',payload:{reverse:Q}});j.ScanIndexForward=!Q}if(F!==void 0)j.Select=_F1(F,{index:Z,attributes:R});let _={},E={},{KeyConditionExpression:B,ExpressionAttributeNames:w,ExpressionAttributeValues:D}=r48(G,X);if(j.KeyConditionExpression=B,Object.assign(_,w),Object.assign(E,D),Y.length>0){let P=[],C=void 0;if(Y.forEach((h,k)=>{let M={attr:h.entityAttributeName,eq:h.name},y=N[h.name],{ExpressionAttributeNames:g,ExpressionAttributeValues:a,ConditionExpression:e}=h.build(WY).setId((k+1).toString()).parse(y!==void 0?{and:[M,y]}:M).toCommandOptions();if(Object.assign(_,g),Object.assign(E,a),P.push(e),R!==void 0){let{entityAttributeName:G1}=h,{ExpressionAttributeNames:U1,ProjectionExpression:n}=h.build(EV).parse(R.includes(G1)?R:[G1,...R]).toCommandOptions();Object.assign(_,U1),C=n}}),P.length>0)j.FilterExpression=P.length===1?P[0]:`(${P.filter(Boolean).join(") OR (")})`;if(C!==void 0)j.ProjectionExpression=C}if(!s9(_))j.ExpressionAttributeNames=_;if(!s9(E))j.ExpressionAttributeValues=E;return j},s48=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class YV extends SV{constructor(G,Y=[],X,W={}){super(G,Y);this.params=()=>{return d48(this.table,...this[PP]())},this[SA]=X,this[NA]=W}entities(...G){return new YV(this.table,G,this[SA],this[NA])}query(G){return new YV(this.table,this[$G],G,this[NA])}options(G){return new YV(this.table,this[$G],this[SA],G)}[PP](){if(!this[SA])throw new P8("actions.incompleteAction",{message:'QueryCommand incomplete: Missing "query" property'});return[this[$G],this[SA],this[NA]]}async send(){let G=this.params(),Y={};this[$G].forEach((F)=>{Y[F.name]=F.build(LJ)});let X=[],W=void 0,Z=0,U=0,K=void 0,J=void 0,{attributes:H,maxPages:$=1}=this[NA],Q=0;do{Q+=1;let F={...G,...W!==void 0?{ExclusiveStartKey:W}:{}},{Items:z=[],LastEvaluatedKey:V,Count:q,ScannedCount:S,ConsumedCapacity:N,$metadata:R}=await this.table.getDocumentClient().send(new LF1(F));for(let j of z){let _=j[this.table.entityAttributeSavedAs];if(!GX(_))continue;let E=Y[_];if(E===void 0){if(this[$G].length===0)X.push(j);continue}X.push(E.format(j,{attributes:H}))}if(W=V,Z!==void 0)Z=q!==void 0?Z+q:void 0;if(U!==void 0)U=S!==void 0?U+S:void 0;K=N,J=R}while(Q<$&&W!==void 0);return{Items:X,...W!==void 0?{LastEvaluatedKey:W}:{},...Z!==void 0?{Count:Z}:{},...U!==void 0?{ScannedCount:U}:{},...Q===1?{...K!==void 0?{ConsumedCapacity:K}:{},...J!==void 0?{$metadata:J}:{}}:{}}}}YV.actionName="query";s48([IF1()],YV.prototype,"send",null);var hf=Symbol("$options"),n48=(G,Y=[],X={})=>{let{capacity:W,consistent:Z,exclusiveStartKey:U,index:K,limit:J,maxPages:H,select:$,totalSegments:Q,segment:F,filters:z,attributes:V,tableName:q,...S}=X,N=z!==null&&z!==void 0?z:{},R=V;if(q!==void 0)p7(q);let j={TableName:q!==null&&q!==void 0?q:G.getName()};if(W!==void 0)j.ReturnConsumedCapacity=BU(W);if(Z!==void 0)j.ConsistentRead=JC(Z,K);if(U!==void 0)j.ExclusiveStartKey=U;if(K!==void 0)j.IndexName=EF1(G,K);if(J!==void 0)j.Limit=jF1(J);if(H!==void 0)OF1(H);if($!==void 0)j.Select=_F1($,{index:K,attributes:R});if(F!==void 0){if(Q===void 0)throw new P8("scanCommand.invalidSegmentOption",{message:"If a segment option has been provided, totalSegments must also be defined",payload:{}});if(!nA(Q)||Q<1)throw new P8("scanCommand.invalidSegmentOption",{message:`Invalid totalSegments option: '${String(Q)}'. 'totalSegments' must be a strictly positive integer.`,payload:{totalSegments:Q}});if(!nA(F)||F<0||F>=Q)throw new P8("scanCommand.invalidSegmentOption",{message:`Invalid segment option: '${String(F)}'. 'segment' must be a positive integer strictly lower than 'totalSegments'.`,payload:{segment:F,totalSegments:Q}});j.TotalSegments=Q,j.Segment=F}if(Y.length>0){let _={},E={},B=[],w=void 0;if(Y.forEach((D,P)=>{let C={attr:D.entityAttributeName,eq:D.name},h=N[D.name],{ExpressionAttributeNames:k,ExpressionAttributeValues:M,ConditionExpression:y}=D.build(WY).setId(P.toString()).parse(h!==void 0?{and:[C,h]}:C).toCommandOptions();if(Object.assign(_,k),Object.assign(E,M),B.push(y),w===void 0&&R!==void 0){let{entityAttributeName:g}=D,{ExpressionAttributeNames:a,ProjectionExpression:e}=D.build(EV).parse(R.includes(g)?R:[g,...R]).toCommandOptions();Object.assign(_,a),w=e}}),!s9(_))j.ExpressionAttributeNames=_;if(!s9(E))j.ExpressionAttributeValues=E;if(B.length>0)j.FilterExpression=B.length===1?B[0]:`(${B.filter(Boolean).join(") OR (")})`;if(w!==void 0)j.ProjectionExpression=w}return l7(S),j},o48=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class oA extends SV{constructor(G,Y=[],X={}){super(G,Y);this[hf]=X}entities(...G){return new oA(this.table,G,this[hf])}options(G){return new oA(this.table,this[$G],G)}[PP](){return[this[$G],this[hf]]}params(){return n48(this.table,...this[PP]())}async send(){let G=this.params(),Y={};this[$G].forEach((F)=>{Y[F.name]=F.build(LJ)});let X=[],W=void 0,Z=0,U=0,K=void 0,J=void 0,{attributes:H,maxPages:$=1}=this[hf],Q=0;do{Q+=1;let F={...G,...W!==void 0?{ExclusiveStartKey:W}:{}},{Items:z=[],LastEvaluatedKey:V,Count:q,ScannedCount:S,ConsumedCapacity:N,$metadata:R}=await this.table.getDocumentClient().send(new TF1(F));for(let j of z){let _=j[this.table.entityAttributeSavedAs];if(!GX(_))continue;let E=Y[_];if(E===void 0){if(this[$G].length===0)X.push(j);continue}X.push(E.format(j,{attributes:H}))}if(W=V,Z!==void 0)Z=q!==void 0?Z+q:void 0;if(U!==void 0)U=S!==void 0?U+S:void 0;K=N,J=R}while(Q<$&&W!==void 0);return{Items:X,...W!==void 0?{LastEvaluatedKey:W}:{},...Z!==void 0?{Count:Z}:{},...U!==void 0?{ScannedCount:U}:{},...Q===1?{...K!==void 0?{ConsumedCapacity:K}:{},...J!==void 0?{$metadata:J}:{}}:{}}}}oA.actionName="scan";o48([IF1()],oA.prototype,"send",null);var vH=Symbol("$requests"),nx=Symbol("$options");class wP extends SV{constructor(G,Y=[],X,W={}){super(G,Y);this[vH]=X,this[nx]=W}requests(...G){let Y=[],X=new Set;for(let W of G){if(X.has(W.entity.name))continue;Y.push(W.entity),X.add(W.entity.name)}return new wP(this.table,Y,G,this[nx])}options(G){return new wP(this.table,this[$G],this[vH],G)}params(){var G;if(this[vH]===void 0||this[vH].length===0)throw new P8("actions.incompleteAction",{message:"BatchGetCommand incomplete: No BatchGetRequest supplied"});let X=this[vH][0].entity,{consistent:W,attributes:Z,tableName:U,...K}=(G=this[nx])!==null&&G!==void 0?G:{};if(l7(K),U)p7(U);let J=Z,H=void 0,$={};if(J!==void 0){let{entityAttributeName:F}=X,{ExpressionAttributeNames:z,ProjectionExpression:V}=X.build(EV).parse(J.includes(F)?J:[F,...J]).toCommandOptions();Object.assign($,z),H=V;let{partitionKey:q,sortKey:S}=this.table,N=new Set(Object.values($));if(!N.has(q.name))H+=", #_pk",$["#_pk"]=q.name;if(S!==void 0&&!N.has(S.name))H+=", #_sk",$["#_sk"]=S.name}let Q=[];for(let F of this[vH]){let z=F.params();Q.push(z)}return{[U!==null&&U!==void 0?U:this.table.getName()]:{Keys:Q,...W!==void 0?{ConsistentRead:JC(W)}:{},...H!==void 0?{ProjectionExpression:H}:{},...!s9($)?{ExpressionAttributeNames:$}:{}}}}}wP.actionName="batchGet";var RA=Symbol("$requests"),uz1=Symbol("$options");class DP extends SV{constructor(G,Y=[],X,W={}){super(G,Y);this[RA]=X,this[uz1]=W}requests(...G){let Y=[],X=new Set;for(let W of G){if(X.has(W.entity.name))continue;Y.push(W.entity),X.add(W.entity.name)}return new DP(this.table,Y,G)}options(G){return new DP(this.table,this[$G],this[RA],G)}params(){var G;if(this[RA]===void 0||this[RA].length===0)throw new P8("actions.incompleteAction",{message:"BatchWriteCommand incomplete: No BatchWriteRequest supplied"});let{tableName:Y,...X}=(G=this[uz1])!==null&&G!==void 0?G:{};if(l7(X),Y)p7(Y);return{[Y!==null&&Y!==void 0?Y:this.table.getName()]:this[RA].map((W)=>W.params())}}}DP.actionName="batchWrite";var lz1=new Set(["NONE","SIZE"]),$C=(G)=>{if(!lz1.has(G))throw new P8("options.invalidMetricsOption",{message:`Invalid metrics option: '${String(G)}'. 'metrics' must be one of: ${[...lz1].join(", ")}.`,payload:{metrics:G}});return G},tl4=Symbol("$actionName"),el4=Symbol("$sentActions"),Gp4=Symbol("$spy"),Yp4=Symbol("$mocks"),OS=()=>{return(G,Y,X)=>{let W=X.value;X.value=async function(...Z){let U=this,K=U.entity[p48];if(K!==void 0){let J=await K(U);if(J!==void 0)return J}return W.apply(this,Z)}}},vf=Symbol("$key"),bf=Symbol("$options"),pz1=Symbol("$parser");class i7 extends V7{constructor(G){super(G);this[pz1]=new Y9(G.schema)}parse(G,{mode:Y,parseExtension:X}={}){let W=this[pz1].start(G,{mode:Y,parseExtension:X});W.next(),W.next();let Z=W.next().value,U=W.next().value,K=this.entity.computeKey?this.entity.computeKey(Z):U,J=new Ku(this.entity.table).parse(K);return{parsedItem:Z,item:{...U,...J},key:J}}reparse(G,Y={}){return this.parse(G,Y)}}var t48=(G,Y)=>{let X={},{capacity:W,consistent:Z,attributes:U,tableName:K,...J}=Y;if(l7(J),W!==void 0)X.ReturnConsumedCapacity=BU(W);if(Z!==void 0)X.ConsistentRead=JC(Z);if(U!==void 0){let{ExpressionAttributeNames:H,ProjectionExpression:$}=G.build(EV).parse(U).toCommandOptions();if(!s9(H))X.ExpressionAttributeNames=H;X.ProjectionExpression=$}if(K!==void 0)p7(K);return X},e48=(G,Y,X={})=>{var W;let{key:Z}=G.build(i7).parse(Y,{mode:"key"}),U=t48(G,X);return{TableName:(W=X.tableName)!==null&&W!==void 0?W:G.table.getName(),Key:Z,...U}},G68=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class tA extends V7{constructor(G,Y,X={}){super(G);this[vf]=Y,this[bf]=X}key(G){return new tA(this.entity,G,this[bf])}options(G){return new tA(this.entity,this[vf],G)}[eY](){if(!this[vf])throw new P8("actions.incompleteAction",{message:'GetItemCommand incomplete: Missing "key" property'});return[this[vf],this[bf]]}params(){return e48(this.entity,...this[eY]())}async send(){let G=this.params(),Y=await this.entity.table.getDocumentClient().send(new NF1(G)),{Item:X,...W}=Y;if(X===void 0)return W;let{attributes:Z}=this[bf];return{Item:new LJ(this.entity).format(X,{attributes:Z}),...W}}}tA.actionName="get";G68([OS()],tA.prototype,"send",null);var Mf=Symbol("$item"),ox=Symbol("$options"),UC=(G,Y)=>{if(!G.has(Y))throw new P8("options.invalidReturnValuesOption",{message:`Invalid returnValues option: '${String(Y)}'. 'returnValues' must be one of: ${[...G].join(", ")}.`,payload:{returnValues:Y}});return Y},Y68=new Set(["NONE","ALL_OLD"]),X68=(G,Y)=>{let X={},{capacity:W,metrics:Z,returnValues:U,condition:K,tableName:J,...H}=Y;if(l7(H),W!==void 0)X.ReturnConsumedCapacity=BU(W);if(Z!==void 0)X.ReturnItemCollectionMetrics=$C(Z);if(U!==void 0)X.ReturnValues=UC(Y68,U);if(K!==void 0){let{ExpressionAttributeNames:$,ExpressionAttributeValues:Q,ConditionExpression:F}=G.build(WY).parse(K).toCommandOptions();if(!s9($))X.ExpressionAttributeNames=$;if(!s9(Q))X.ExpressionAttributeValues=Q;X.ConditionExpression=F}if(J!==void 0)p7(J);return X},W68=(G,Y,X={})=>{var W;let{parsedItem:Z,item:U}=G.build(i7).parse(Y),K=X68(G,X);return{TableName:(W=X.tableName)!==null&&W!==void 0?W:G.table.getName(),Item:U,ToolboxItem:Z,...K}},Z68=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class eA extends V7{constructor(G,Y,X={}){super(G);this[Mf]=Y,this[ox]=X}item(G){return new eA(this.entity,G,this[ox])}options(G){return new eA(this.entity,this[Mf],G)}[eY](){if(!this[Mf])throw new P8("actions.incompleteAction",{message:'PutItemCommand incomplete: Missing "item" property'});return[this[Mf],this[ox]]}params(){let[G,Y]=this[eY]();return W68(this.entity,G,Y)}async send(){let{ToolboxItem:G,...Y}=this.params(),X=await this.entity.table.getDocumentClient().send(new RF1(Y)),{Attributes:W,...Z}=X;if(W===void 0)return{ToolboxItem:G,...Z};let U=new LJ(this.entity).format(W);return{ToolboxItem:G,Attributes:U,...Z}}}eA.actionName="put";Z68([OS()],eA.prototype,"send",null);var gf=Symbol("$key"),tx=Symbol("$options"),J68=new Set(["NONE","ALL_OLD"]),$68=(G,Y)=>{let X={},{capacity:W,metrics:Z,returnValues:U,condition:K,tableName:J,...H}=Y;if(l7(H),W!==void 0)X.ReturnConsumedCapacity=BU(W);if(Z!==void 0)X.ReturnItemCollectionMetrics=$C(Z);if(U!==void 0)X.ReturnValues=UC(J68,U);if(K!==void 0){let{ExpressionAttributeNames:$,ExpressionAttributeValues:Q,ConditionExpression:F}=G.build(WY).parse(K).toCommandOptions();if(!s9($))X.ExpressionAttributeNames=$;if(!s9(Q))X.ExpressionAttributeValues=Q;X.ConditionExpression=F}if(J!==void 0)p7(J);return X},U68=(G,Y,X={})=>{var W;let{key:Z}=G.build(i7).parse(Y,{mode:"key"}),U=$68(G,X);return{TableName:(W=X.tableName)!==null&&W!==void 0?W:G.table.getName(),Key:Z,...U}},z68=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class GS extends V7{constructor(G,Y,X={}){super(G);this[gf]=Y,this[tx]=X}key(G){return new GS(this.entity,G,this[tx])}options(G){return new GS(this.entity,this[gf],G)}[eY](){if(!this[gf])throw new P8("actions.incompleteAction",{message:'DeleteItemCommand incomplete: Missing "key" property'});return[this[gf],this[tx]]}params(){return U68(this.entity,...this[eY]())}async send(){let G=this.params(),Y=await this.entity.table.getDocumentClient().send(new SF1(G)),{Attributes:X,...W}=Y;if(X===void 0)return W;return{Attributes:new LJ(this.entity).format(X),...W}}}GS.actionName="delete";z68([OS()],GS.prototype,"send",null);var yf=Symbol("$item"),xf=Symbol("$options"),ru=(G,...Y)=>{let X=new Set(Y);return Object.fromEntries(Object.entries(G).filter(([W])=>!X.has(W)))},nY=Symbol("$ADD"),du=(G)=>X2(G)&&(nY in G),m7=Symbol("$APPEND"),su=(G)=>X2(G)&&(m7 in G),dH=Symbol("$DELETE"),fF1=(G)=>X2(G)&&(dH in G),c7=Symbol("$PREPEND"),nu=(G)=>X2(G)&&(c7 in G),K68=Symbol("$REMOVE"),_S=(G)=>X2(G)&&(K68 in G),w2=Symbol("$SET"),zC=(G)=>X2(G)&&(w2 in G),QU=Symbol("$SUBTRACT"),PF1=(G)=>X2(G)&&(QU in G),FU=Symbol("$SUM"),CF1=(G)=>X2(G)&&(FU in G);class sH{constructor(G,Y,X=""){this.resetExpression=(W="")=>{this.expression=W},this.appendAttributePath=(W,Z={})=>Uu(this,W,Z),this.appendAttributeValue=(W,Z)=>{let U=this.expressionAttributeValues.push(Z);this.appendToExpression(`:${this.expressionAttributePrefix}${U}`)},this.beginNewInstruction=()=>{if(this.expression!=="")this.appendToExpression(", ")},this.appendValidAttributePath=(W)=>{W.forEach((Z,U)=>{if(GX(Z)){let K=this.expressionAttributeNames.findIndex((J)=>J===Z);if(K!==-1)K+=1;else K=this.expressionAttributeNames.push(Z);if(U>0)this.appendToExpression(".");this.appendToExpression(`#${this.expressionAttributePrefix}${K}`)}if(Zu(Z))this.appendToExpression(`[${Z}]`)})},this.appendValidAttributeValue=(W)=>{if(jS(W)){let[U,K]=W[VU];if(K===void 0){this.appendAttributePath(U);return}if(K!==void 0){this.appendToExpression("if_not_exists("),this.appendAttributePath(U),this.appendToExpression(", "),this.appendValidAttributeValue(K),this.appendToExpression(")");return}}let Z=this.expressionAttributeValues.push(W);this.appendToExpression(`:${this.expressionAttributePrefix}${Z}`)},this.appendToExpression=(W)=>{this.expression+=W},this.toCommandOptions=()=>{let W={};this.expressionAttributeNames.forEach((K,J)=>{W[`#${this.expressionAttributePrefix}${J+1}`]=K});let Z={};this.expressionAttributeValues.forEach((K,J)=>{Z[`:${this.expressionAttributePrefix}${J+1}`]=K});let U=this.expression;return{ExpressionAttributeNames:W,ExpressionAttributeValues:Z,UpdateExpression:U}},this.clone=(W)=>{let Z=new sH(W!==null&&W!==void 0?W:this.schema,this.verbPrefix,this.id);return Z.expressionAttributeNames=[...this.expressionAttributeNames],Z.expressionAttributeValues=[...this.expressionAttributeValues],Z.expression=this.expression,Z},this.schema=G,this.verbPrefix=Y,this.expressionAttributePrefix=`${Y}${X}_`,this.expressionAttributeNames=[],this.expressionAttributeValues=[],this.expression="",this.id=X}}class BF1{constructor(G){this.parseUpdate=(Y,X=[])=>{if(Y===void 0)return;if(zC(Y)){this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = "),this.set.appendValidAttributeValue(Y[w2]);return}if(jS(Y)){this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = "),this.set.appendValidAttributeValue(Y);return}if(_S(Y)){this.remove.beginNewInstruction(),this.remove.appendValidAttributePath(X);return}if(CF1(Y)){let[W,Z]=Y[FU];this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = "),this.set.appendValidAttributeValue(W),this.set.appendToExpression(" + "),this.set.appendValidAttributeValue(Z);return}if(PF1(Y)){let[W,Z]=Y[QU];this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = "),this.set.appendValidAttributeValue(W),this.set.appendToExpression(" - "),this.set.appendValidAttributeValue(Z);return}if(du(Y)){this.add.beginNewInstruction(),this.add.appendValidAttributePath(X),this.add.appendToExpression(" "),this.add.appendValidAttributeValue(Y[nY]);return}if(fF1(Y)){this.delete.beginNewInstruction(),this.delete.appendValidAttributePath(X),this.delete.appendToExpression(" "),this.delete.appendValidAttributeValue(Y[dH]);return}if(su(Y)){this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = list_append(if_not_exists("),this.set.appendValidAttributePath(X),this.set.appendToExpression(", "),this.set.appendValidAttributeValue([]),this.set.appendToExpression("), "),this.set.appendValidAttributeValue(Y[m7]),this.set.appendToExpression(")");return}if(nu(Y)){this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = list_append("),this.set.appendValidAttributeValue(Y[c7]),this.set.appendToExpression(", if_not_exists("),this.set.appendValidAttributePath(X),this.set.appendToExpression(", "),this.set.appendValidAttributeValue([]),this.set.appendToExpression("))");return}if(X2(Y)){for(let[W,Z]of Object.entries(Y))this.parseUpdate(Z,[...X,W]);return}if(C3(Y)){Y.forEach((W,Z)=>{if(W===void 0)return;this.parseUpdate(W,[...X,Z])});return}this.set.beginNewInstruction(),this.set.appendValidAttributePath(X),this.set.appendToExpression(" = "),this.set.appendValidAttributeValue(Y)},this.toCommandOptions=()=>{let Y="",X={},W={};for(let[Z,U]of[["SET",this.set],["REMOVE",this.remove],["ADD",this.add],["DELETE",this.delete]]){let K=U.toCommandOptions();if(K.UpdateExpression==="")continue;if(Y!=="")Y+=" ";Y+=Z,Y+=" ",Y+=K.UpdateExpression,Object.assign(X,K.ExpressionAttributeNames),Object.assign(W,K.ExpressionAttributeValues)}return{UpdateExpression:Y,ExpressionAttributeNames:X,ExpressionAttributeValues:W}},this.schema=G,this.set=new sH(G,"s"),this.remove=new sH(G,"r"),this.add=new sH(G,"a"),this.delete=new sH(G,"d")}}var H68=(G,Y)=>{let X=new BF1(G);return X.parseUpdate(Y),X.toCommandOptions()},ou=(G,Y)=>H68(G.schema,Y),UG=(G,Y,{transform:X=!0}={})=>{if(jS(Y)&&Y[VU]!==void 0)return{isExtension:!0,*extensionParser(){let W=Y[VU];if(!C3(W)){let{path:$}=G;throw new P8("parsing.invalidAttributeInput",{message:`References ${$!==void 0?`for attribute '${$}' `:""}should be a tuple of one or two elements`,path:$,payload:{received:Y[VU]}})}let[Z,U]=W;if(!GX(Z)){let{path:$}=G;throw new P8("parsing.invalidAttributeInput",{message:`First elements of references ${$!==void 0?`for attribute '${$}' `:""}should be strings`,path:$,payload:{received:W[0]}})}let K=U!==void 0?new Y9(G).start(U,{fill:!1,transform:X,parseExtension:UG}):void 0,J={[VU]:[Z,...K!==void 0?[K.next().value]:[]]};if(X)yield J;else return J;return{[VU]:[Z,...K!==void 0?[K.next().value]:[]]}}};return{isExtension:!1,basicInput:Y}};function*V68(G,Y,{transform:X=!0}){if(_S(Y)){let W=Y;if(X)yield W;else return W;return W}if(Y===void 0){if(X)yield void 0;else return;return void 0}return yield*new Y9(G.elements).start(Y,{mode:"update",fill:!1,transform:X,parseExtension:KC})}var Q68=(G,Y,X)=>{let{transform:W=!0}=X;if(zC(Y)&&Y[w2]!==void 0)return{isExtension:!0,*extensionParser(){let Z=new Y9(G).start(Y[w2],{fill:!1,transform:W}),U={[w2]:Z.next().value};if(W)yield U;else return U;return{[w2]:Z.next().value}}};if(X2(Y)||C3(Y)){if(su(Y)&&Y[m7]!==void 0){let Z=Y[m7];if(C3(Z))return{isExtension:!0,*extensionParser(){let U=Z.map((H)=>new Y9(G.elements).start(H,{fill:!1,transform:W})),K={[m7]:U.map((H)=>H.next().value)};if(W)yield K;else return K;return{[m7]:U.map((H)=>H.next().value)}}};return{isExtension:!0,*extensionParser(){let U=new Y9(G).start(Z,{fill:!1,transform:W,parseExtension:UG}),K={[m7]:U.next().value};if(W)yield K;else return K;return{[m7]:U.next().value}}}}if(nu(Y)&&Y[c7]!==void 0){let Z=Y[c7];if(C3(Z))return{isExtension:!0,*extensionParser(){let U=Z.map((H)=>new Y9(G.elements).start(H,{fill:!1,transform:W})),K={[c7]:U.map((H)=>H.next().value)};if(W)yield K;else return K;return{[c7]:U.map((H)=>H.next().value)}}};return{isExtension:!0,*extensionParser(){let U=new Y9(G).start(Z,{fill:!1,transform:W,parseExtension:UG}),K={[c7]:U.next().value};if(W)yield K;else return K;return{[c7]:U.next().value}}}}return{isExtension:!0,*extensionParser(){let Z=0,U=Object.fromEntries(Object.entries(Y).map(([H,$])=>[H,V68(G,$,X)]));for(let H of Object.keys(U)){let $=parseFloat(H);if(!nA($)){let{path:Q}=G;throw new P8("parsing.invalidAttributeInput",{message:`Index of array attribute ${Q!==void 0?`'${Q}' `:""}is not a valid integer`,path:Q,payload:{received:H}})}Z=Math.max(Z,$)}let K=Object.fromEntries(Object.entries(U).map(([H,$])=>[H,$.next().value]).filter(([,H])=>H!==void 0));if(W)yield K;else return K;return[...Array(Z+1).keys()].map((H)=>{let $=U[H];return $===void 0?void 0:$.next().value})}}}return{isExtension:!1,basicInput:Y}},F68=(G,Y,{transform:X=!0}={})=>{if(zC(Y)&&Y[w2]!==void 0)return{isExtension:!0,*extensionParser(){let W=new Y9(G).start(Y[w2],{fill:!1,transform:X}),Z={[w2]:W.next().value};if(X)yield Z;else return Z;return{[w2]:W.next().value}}};return{isExtension:!1,basicInput:Y}},wF1=(G,Y,{transform:X=!0}={})=>{if(CF1(Y)&&Y[FU]!==void 0)return{isExtension:!0,*extensionParser(){let W=Y[FU];if(!C3(W)||W.length!==2){let{path:$}=G;throw new P8("parsing.invalidAttributeInput",{message:`Sum for number attribute ${$!==void 0?`'${$}' `:""}should be a tuple of length 2`,path:$,payload:{received:Y[FU]}})}let[Z,U]=W,K=[new Y9(qA().freeze(`${G.path}[$SUM][0]`)).start(Z,{fill:!1,transform:X,parseExtension:UG}),new Y9(qA().freeze(`${G.path}[$SUM][1]`)).start(U,{fill:!1,transform:X,parseExtension:UG})],J={[FU]:K.map(($)=>$.next().value)};if(X)yield J;else return J;return{[FU]:K.map(($)=>$.next().value)}}};if(PF1(Y)&&Y[QU]!==void 0)return{isExtension:!0,*extensionParser(){let W=Y[QU];if(!C3(W)||W.length!==2){let{path:$}=G;throw new P8("parsing.invalidAttributeInput",{message:`Subtraction for number attribute ${$!==void 0?`'${$}' `:""}should be a tuple of length 2`,path:$,payload:{received:Y[QU]}})}let[Z,U]=W,K=[new Y9(qA().freeze(`${G.path}[$SUBTRACT][0]`)).start(Z,{fill:!1,transform:X,parseExtension:UG}),new Y9(qA().freeze(`${G.path}[$SUBTRACT][1]`)).start(U,{fill:!1,transform:X,parseExtension:UG})],J={[QU]:K.map(($)=>$.next().value)};if(X)yield J;else return J;return{[QU]:K.map(($)=>$.next().value)}}};if(du(Y)&&Y[nY]!==void 0){let W=new Y9(qA().freeze(`${G.path}[$ADD]`)).start(Y[nY],{fill:!1,transform:X,parseExtension:UG});return{isExtension:!0,*extensionParser(){let Z={[nY]:W.next().value};if(X)yield Z;else return Z;return{[nY]:W.next().value}}}}return{isExtension:!1,basicInput:Y}};function*q68(G,Y,{transform:X=!0}={}){if(_S(Y)){let W=Y;if(X)yield W;else return W;return W}return yield*new Y9(G.elements).start(Y,{mode:"update",fill:!1,transform:X,parseExtension:KC})}var A68=(G,Y,X={})=>{let{transform:W=!0}=X;if(zC(Y)&&Y[w2]!==void 0)return{isExtension:!0,*extensionParser(){let Z=new Y9(G).start(Y[w2],{fill:!1,transform:W}),U={[w2]:Z.next().value};if(W)yield U;else return U;return{[w2]:Z.next().value}}};if(X2(Y))return{isExtension:!0,*extensionParser(){let Z=Object.entries(Y).filter(([,J])=>J!==void 0).map(([J,H])=>[new Y9(G.keys).start(J,{fill:!1,transform:W}),q68(G,H,X)]),U=Object.fromEntries(Z.map(([J,H])=>[J.next().value,H.next().value]).filter(([,J])=>J!==void 0));if(W)yield U;else return U;return Object.fromEntries(Z.map(([J,H])=>[J.next().value,H.next().value]).filter(([,J])=>J!==void 0))}};return{isExtension:!1,basicInput:Y}},DF1=(G,Y,{transform:X=!0}={})=>{if(du(Y)&&Y[nY]!==void 0)return{isExtension:!0,*extensionParser(){let W=new Y9(G).start(Y[nY],{fill:!1,transform:X}),Z={[nY]:W.next().value};if(X)yield Z;else return Z;return{[nY]:W.next().value}}};if(fF1(Y)&&Y[dH]!==void 0)return{isExtension:!0,*extensionParser(){let W=new Y9(G).start(Y[dH],{fill:!1,transform:X}),Z={[dH]:W.next().value};if(X)yield Z;else return Z;return{[dH]:W.next().value}}};return{isExtension:!1,basicInput:Y}},KC=(G,Y,X={})=>{let{transform:W=!0}=X;if(_S(Y))return{isExtension:!0,*extensionParser(){let{path:Z,required:U}=G;if(U!=="never")throw new P8("parsing.attributeRequired",{message:`Attribute ${Z!==void 0?`'${Z}' `:""}is required and cannot be removed`,path:Z});let K=Y;if(W)yield K;else return K;return Y}};if(jS(Y))return UG(G,Y,X);switch(G.type){case"number":return wF1(G,Y,X);case"set":return DF1(G,Y,X);case"list":return Q68(G,Y,X);case"map":return F68(G,Y,X);case"record":return A68(G,Y,X);default:return{isExtension:!1,basicInput:Y}}},S68=new Set(["NONE","ALL_OLD","UPDATED_OLD","ALL_NEW","UPDATED_NEW"]),N68=(G,Y)=>{let X={},{capacity:W,metrics:Z,returnValues:U,condition:K,tableName:J,...H}=Y;if(l7(H),W!==void 0)X.ReturnConsumedCapacity=BU(W);if(Z!==void 0)X.ReturnItemCollectionMetrics=$C(Z);if(U!==void 0)X.ReturnValues=UC(S68,U);if(K!==void 0){let{ExpressionAttributeNames:$,ExpressionAttributeValues:Q,ConditionExpression:F}=G.build(WY).parse(K).toCommandOptions();X.ExpressionAttributeNames=$,X.ExpressionAttributeValues=Q,X.ConditionExpression=F}if(J!==void 0)p7(J);return X},R68=(G,Y,X={})=>{var W;let{parsedItem:Z,item:U,key:K}=G.build(i7).parse(Y,{mode:"update",parseExtension:KC}),{ExpressionAttributeNames:J,ExpressionAttributeValues:H,...$}=ou(G,ru(U,...Object.keys(K))),{ExpressionAttributeNames:Q,ExpressionAttributeValues:F,...z}=N68(G,X),V={...Q,...J},q={...F,...H};return{TableName:(W=X.tableName)!==null&&W!==void 0?W:G.table.getName(),ToolboxItem:Z,Key:K,...$,...z,...!s9(V)?{ExpressionAttributeNames:V}:{},...!s9(q)?{ExpressionAttributeValues:q}:{}}},L68=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class YS extends V7{constructor(G,Y,X={}){super(G);this[yf]=Y,this[xf]=X}item(G){return new YS(this.entity,G,this[xf])}options(G){return new YS(this.entity,this[yf],G)}[eY](){if(!this[yf])throw new P8("actions.incompleteAction",{message:'UpdateItemCommand incomplete: Missing "item" property'});return[this[yf],this[xf]]}params(){let[G,Y]=this[eY]();return R68(this.entity,G,Y)}async send(){let{ToolboxItem:G,...Y}=this.params(),X=await this.entity.table.getDocumentClient().send(new au(Y)),{Attributes:W,...Z}=X;if(W===void 0)return{ToolboxItem:G,...Z};let{returnValues:U}=this[xf],K=new LJ(this.entity).format(W,{partial:U==="UPDATED_NEW"||U==="UPDATED_OLD"});return{ToolboxItem:G,Attributes:K,...Z}}}YS.actionName="update";L68([OS()],YS.prototype,"send",null);var mf=Symbol("$item"),cf=Symbol("$options"),T68=(G,Y,X)=>{let{transform:W=!0}=X;if(X2(Y)){if(su(Y)&&Y[m7]!==void 0){let Z=Y[m7];if(C3(Z))return{isExtension:!0,*extensionParser(){let U=Z.map((H)=>new Y9(G.elements).start(H,{fill:!1,transform:W})),K={[m7]:U.map((H)=>H.next().value)};if(W)yield K;else return K;return{[m7]:U.map((H)=>H.next().value)}}};return{isExtension:!0,*extensionParser(){let U=new Y9(G).start(Z,{fill:!1,transform:W,parseExtension:UG}),K={[m7]:U.next().value};if(W)yield K;else return K;return{[m7]:U.next().value}}}}if(nu(Y)&&Y[c7]!==void 0){let Z=Y[c7];if(C3(Z))return{isExtension:!0,*extensionParser(){let U=Z.map((H)=>new Y9(G.elements).start(H,{fill:!1,transform:W})),K={[c7]:U.map((H)=>H.next().value)};if(W)yield K;else return K;return{[c7]:U.map((H)=>H.next().value)}}};return{isExtension:!0,*extensionParser(){let U=new Y9(G).start(Z,{fill:!1,transform:W,parseExtension:UG}),K={[c7]:U.next().value};if(W)yield K;else return K;return{[c7]:U.next().value}}}}}if(C3(Y))return{isExtension:!0,*extensionParser(){let Z=new Y9(G).start(Y,{fill:!1,transform:W}),U={[w2]:Z.next().value};if(W)yield U;else return U;return{[w2]:Z.next().value}}};return{isExtension:!1,basicInput:Y}},I68=(G,Y,{transform:X=!0}={})=>{if(X2(Y))return{isExtension:!0,*extensionParser(){let W=new Y9(G).start(Y,{fill:!1,transform:X}),Z={[w2]:W.next().value};if(X)yield Z;else return Z;return{[w2]:W.next().value}}};return{isExtension:!1,basicInput:Y}},E68=(G,Y,X={})=>{let{transform:W=!0}=X;if(X2(Y))return{isExtension:!0,*extensionParser(){let Z=new Y9(G).start(Y,{fill:!1,transform:W}),U={[w2]:Z.next().value};if(W)yield U;else return U;return{[w2]:Z.next().value}}};return{isExtension:!1,basicInput:Y}},j68=(G,Y,X={})=>{let{transform:W=!0}=X;if(_S(Y))return{isExtension:!0,*extensionParser(){let{path:Z,required:U}=G;if(U!=="never")throw new P8("parsing.attributeRequired",{message:`Attribute ${Z!==void 0?`'${Z}' `:""}is required and cannot be removed`,path:Z});let K=Y;if(W)yield K;else return K;return Y}};if(jS(Y))return UG(G,Y,X);switch(G.type){case"number":return wF1(G,Y,X);case"set":return DF1(G,Y,X);case"list":return T68(G,Y,X);case"map":return I68(G,Y,X);case"record":return E68(G,Y,X);default:return{isExtension:!1,basicInput:Y}}},O68=new Set(["NONE","ALL_OLD","UPDATED_OLD","ALL_NEW","UPDATED_NEW"]),_68=(G,Y)=>{let X={},{capacity:W,metrics:Z,returnValues:U,condition:K,tableName:J,...H}=Y;if(l7(H),W!==void 0)X.ReturnConsumedCapacity=BU(W);if(Z!==void 0)X.ReturnItemCollectionMetrics=$C(Z);if(U!==void 0)X.ReturnValues=UC(O68,U);if(K!==void 0){let{ExpressionAttributeNames:$,ExpressionAttributeValues:Q,ConditionExpression:F}=G.build(WY).parse(K).toCommandOptions();X.ExpressionAttributeNames=$,X.ExpressionAttributeValues=Q,X.ConditionExpression=F}if(J!==void 0)p7(J);return X},f68=(G,Y,X={})=>{var W;let{parsedItem:Z,item:U,key:K}=G.build(i7).parse(Y,{mode:"update",parseExtension:j68}),{ExpressionAttributeNames:J,ExpressionAttributeValues:H,...$}=ou(G,ru(U,...Object.keys(K))),{ExpressionAttributeNames:Q,ExpressionAttributeValues:F,...z}=_68(G,X),V={...Q,...J},q={...F,...H};return{TableName:(W=X.tableName)!==null&&W!==void 0?W:G.table.getName(),ToolboxItem:Z,Key:K,...$,...z,...!s9(V)?{ExpressionAttributeNames:V}:{},...!s9(q)?{ExpressionAttributeValues:q}:{}}},P68=function(G,Y,X,W){var Z=arguments.length,U=Z<3?Y:W===null?W=Object.getOwnPropertyDescriptor(Y,X):W,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(G,Y,X,W);else for(var J=G.length-1;J>=0;J--)if(K=G[J])U=(Z<3?K(U):Z>3?K(Y,X,U):K(Y,X))||U;return Z>3&&U&&Object.defineProperty(Y,X,U),U};class XS extends V7{constructor(G,Y,X={}){super(G);this[mf]=Y,this[cf]=X}item(G){return new XS(this.entity,G,this[cf])}options(G){return new XS(this.entity,this[mf],G)}[eY](){if(!this[mf])throw new P8("actions.incompleteAction",{message:'UpdateAttributesCommand incomplete: Missing "item" property'});return[this[mf],this[cf]]}params(){let[G,Y]=this[eY]();return f68(this.entity,G,Y)}async send(){let{ToolboxItem:G,...Y}=this.params(),X=await this.entity.table.getDocumentClient().send(new au(Y)),{Attributes:W,...Z}=X;if(W===void 0)return{ToolboxItem:G,...Z};let{returnValues:U}=this[cf],K=new LJ(this.entity).format(W,{partial:U==="UPDATED_NEW"||U==="UPDATED_OLD"});return{ToolboxItem:G,Attributes:K,...Z}}}XS.actionName="update";P68([OS()],XS.prototype,"send",null);var ex=Symbol("$key");class tu extends V7{constructor(G,Y){super(G);this[ex]=Y}key(G){return new tu(this.entity,G)}params(){if(!this[ex])throw new P8("actions.incompleteAction",{message:'BatchGetRequest incomplete: Missing "key" property'});let{key:G}=this.entity.build(i7).parse(this[ex],{mode:"key"});return G}}tu.actionName="batchGet";var Gm=Symbol("$key");class eu extends V7{constructor(G,Y){super(G);this[Gm]=Y}key(G){return new eu(this.entity,G)}params(){if(!this[Gm])throw new P8("actions.incompleteAction",{message:'DeleteItemCommand incomplete: Missing "key" property'});let{key:G}=this.entity.build(i7).parse(this[Gm],{mode:"key"});return{DeleteRequest:{Key:G}}}}eu.actionName="batchDelete";var Ym=Symbol("$item");class Gl extends V7{constructor(G,Y){super(G);this[Ym]=Y}item(G){return new Gl(this.entity,G)}params(){if(!this[Ym])throw new P8("actions.incompleteAction",{message:'BatchPutRequest incomplete: Missing "item" property'});let{item:G}=this.entity.build(i7).parse(this[Ym]);return{PutRequest:{Item:G}}}}Gl.actionName="batchPut";var uf=Symbol("$key"),Xm=Symbol("$options"),C68=(G,Y)=>{let X={},{attributes:W,tableName:Z,...U}=Y;if(l7(U),W!==void 0){let{ExpressionAttributeNames:K,ProjectionExpression:J}=G.build(EV).parse(W).toCommandOptions();if(!s9(K))X.ExpressionAttributeNames=K;X.ProjectionExpression=J}if(Z!==void 0)p7(Z);return X};class kP extends V7{constructor(G,Y,X={}){super(G);this[uf]=Y,this[Xm]=X}key(G){return new kP(this.entity,G,this[Xm])}options(G){return new kP(this.entity,this[uf],G)}params(){var G;if(!this[uf])throw new P8("actions.incompleteAction",{message:'GetTransaction incomplete: Missing "key" property'});let Y=this[Xm],{key:X}=this.entity.build(i7).parse(this[uf],{mode:"key"}),W=C68(this.entity,Y);return{Get:{TableName:(G=Y.tableName)!==null&&G!==void 0?G:this.entity.table.getName(),Key:X,...W}}}}kP.actionName="transactGet";class fS extends V7{}var lf=Symbol("$item"),Wm=Symbol("$options"),B68=(G,Y)=>{let X={},{condition:W,tableName:Z,...U}=Y;if(l7(U),W!==void 0){let{ExpressionAttributeNames:K,ExpressionAttributeValues:J,ConditionExpression:H}=G.build(WY).parse(W).toCommandOptions();if(!s9(K))X.ExpressionAttributeNames=K;if(!s9(J))X.ExpressionAttributeValues=J;X.ConditionExpression=H}if(Z!==void 0)p7(Z);return X};class hP extends fS{constructor(G,Y,X={}){super(G);this[lf]=Y,this[Wm]=X}item(G){return new hP(this.entity,G,this[Wm])}options(G){return new hP(this.entity,this[lf],G)}params(){var G;if(!this[lf])throw new P8("actions.incompleteAction",{message:'PutTransaction incomplete: Missing "item" property'});let Y=this[Wm],{parsedItem:X,item:W}=this.entity.build(i7).parse(this[lf]),Z=B68(this.entity,Y);return{ToolboxItem:X,Put:{TableName:(G=Y===null||Y===void 0?void 0:Y.tableName)!==null&&G!==void 0?G:this.entity.table.getName(),Item:W,...Z}}}}hP.actionName="transactPut";var pf=Symbol("$item"),Zm=Symbol("$options"),w68=(G,Y)=>{let X={},{condition:W,tableName:Z,...U}=Y;if(l7(U),W!==void 0){let{ExpressionAttributeNames:K,ExpressionAttributeValues:J,ConditionExpression:H}=G.build(WY).parse(W).toCommandOptions();X.ExpressionAttributeNames=K,X.ExpressionAttributeValues=J,X.ConditionExpression=H}if(Z!==void 0)p7(Z);return X};class vP extends fS{constructor(G,Y,X={}){super(G);this[pf]=Y,this[Zm]=X}item(G){return new vP(this.entity,G,this[Zm])}options(G){return new vP(this.entity,this[pf],G)}params(){var G;if(!this[pf])throw new P8("actions.incompleteAction",{message:'UpdateTransaction incomplete: Missing "item" property'});let{parsedItem:Y,item:X,key:W}=this.entity.build(i7).parse(this[pf],{mode:"update",parseExtension:KC}),{ExpressionAttributeNames:Z,ExpressionAttributeValues:U,UpdateExpression:K}=ou(this.entity,ru(X,...Object.keys(W))),J=this[Zm],{ExpressionAttributeNames:H,ExpressionAttributeValues:$,...Q}=w68(this.entity,J),F={...H,...Z},z={...$,...U};return{ToolboxItem:Y,Update:{TableName:(G=J.tableName)!==null&&G!==void 0?G:this.entity.table.getName(),Key:W,UpdateExpression:K,...Q,...!s9(F)?{ExpressionAttributeNames:F}:{},...!s9(z)?{ExpressionAttributeValues:z}:{}}}}}vP.actionName="transactUpdate";var af=Symbol("$key"),Jm=Symbol("$options"),D68=(G,Y)=>{let X={},{condition:W,tableName:Z,...U}=Y;if(l7(U),W!==void 0){let{ExpressionAttributeNames:K,ExpressionAttributeValues:J,ConditionExpression:H}=G.build(WY).parse(W).toCommandOptions();if(!s9(K))X.ExpressionAttributeNames=K;if(!s9(J))X.ExpressionAttributeValues=J;X.ConditionExpression=H}if(Z!==void 0)p7(Z);return X};class bP extends fS{constructor(G,Y,X={}){super(G);this[af]=Y,this[Jm]=X}key(G){return new bP(this.entity,G,this[Jm])}options(G){return new bP(this.entity,this[af],G)}params(){var G;if(!this[af])throw new P8("actions.incompleteAction",{message:'DeleteTransaction incomplete: Missing "key" property'});let Y=this[Jm],{key:X}=this.entity.build(i7).parse(this[af],{mode:"key"}),W=D68(this.entity,Y);return{Delete:{TableName:(G=Y.tableName)!==null&&G!==void 0?G:this.entity.table.getName(),Key:X,...W}}}}bP.actionName="transactDelete";var LA=Symbol("$key"),TA=Symbol("$condition"),rf=Symbol("$options"),k68=(G,Y,X={})=>{let{tableName:W,...Z}=X;l7(Z);let{ExpressionAttributeNames:U,ExpressionAttributeValues:K,ConditionExpression:J}=G.build(WY).parse(Y).toCommandOptions(),H={ConditionExpression:J};if(!s9(U))H.ExpressionAttributeNames=U;if(!s9(K))H.ExpressionAttributeValues=K;if(W!==void 0)p7(W);return H};class xA extends fS{constructor(G,Y,X,W={}){super(G);this[LA]=Y,this[TA]=X,this[rf]=W}key(G){return new xA(this.entity,G,this[TA],this[rf])}condition(G){return new xA(this.entity,this[LA],G,this[rf])}options(G){return new xA(this.entity,this[LA],this[TA],G)}params(){var G;if(!this[LA])throw new P8("actions.incompleteAction",{message:'ConditionCheck incomplete: Missing "key" property'});if(!this[TA])throw new P8("actions.incompleteAction",{message:'ConditionCheck incomplete: Missing "condition" property'});let Y=this[rf],{key:X}=this.entity.build(i7).parse(this[LA],{mode:"key"}),W=k68(this.entity,this[TA],Y);return{ConditionCheck:{TableName:(G=Y.tableName)!==null&&G!==void 0?G:this.entity.table.getName(),Key:X,...W}}}}xA.actionName="conditionCheck";var Xp4=Symbol("$actionName"),Wp4=Symbol("$sentActions"),Zp4=Symbol("$spy"),Jp4=Symbol("$mocks"),$p4=Symbol("$transformerId");var Yl=(()=>{async function G(X){try{let W=await C4.price.list({lookup_keys:[X]});if(!W.data.length)return;let Z=W.data[0];return q$1.set(`price_${X}`,JSON.stringify(Z)),Z}catch(W){console.error("Error retrieving price from Stripe:",W);return}}async function Y(X,W){let Z=await G(X);if(Z)return Z;return await C4.price.create({...W,lookup_key:X})}return{retrieveByLookupKey:G,createOrGet:Y}})();import{saas as Ti4}from"@stacksjs/config";import{ok as Ei4}from"@stacksjs/error-handling";import{log as Oi4}from"@stacksjs/logging";var v68=(()=>{async function G(z,V,q,S){let N=await Yl.retrieveByLookupKey(q);if(!N)throw new Error("Price does not exist in Stripe");let R=[{price:N.id,quantity:1}],E={...{customer:await Sq.createOrGetStripeUser(z,{}).then((w)=>{if(!w||!w.id)throw new Error("Customer does not exist in Stripe");return w.id}),payment_behavior:"allow_incomplete",expand:["latest_invoice.payment_intent"],items:R},...S},B=await C4.subscription.create(E);return await $(z,V,q,B),B}async function Y(z,V,q){let S=await Yl.retrieveByLookupKey(q),N=await z?.activeSubscription();if(!S)throw new Error("New price does not exist in Stripe");if(!N)throw new Error("No active subscription for user!");let R=N.subscription?.provider_id||"",j=await C4.subscription.retrieve(R);if(!j)throw new Error("Subscription does not exist in Stripe");let _=j.items.data[0]?.id;if(!_)throw new Error("No subscription items found in the subscription");await C4.subscriptionItems.update(_,{price:S.id,quantity:1});let E=await C4.subscription.retrieve(R);return await Q(N.subscription?.id,V,E),E}async function X(z,V){if(!await C4.subscription.retrieve(z))throw new Error("Subscription does not exist or does not belong to the user");let S=await C4.subscription.cancel(z,V);return await Z(z),S}async function W(z,V){if(!z.hasStripeId())throw new Error("Customer does not exist in Stripe");return await C4.subscription.retrieve(V)}async function Z(z){await s6.updateTable("subscriptions").set({provider_status:"canceled"}).where("provider_id","=",z).executeTakeFirst()}async function U(z){return z.provider_status==="active"}async function K(z){return z.provider_status==="trialing"}async function J(z,V){let q=await s6.selectFrom("subscriptions").where("type","=",V).selectAll().executeTakeFirst();if(!q)return!1;return q.provider_status==="incomplete"}async function H(z,V){let q=await s6.selectFrom("subscriptions").where("user_id","=",z.id).where("type","=",V).selectAll().executeTakeFirst();if(!q)return!1;let S=await U(q),N=await K(q);return S||N}async function $(z,V,q,S){let N=F({user_id:z.id,type:V,unit_price:Number(S.items.data[0].price.unit_amount),provider_id:S.id,provider_status:S.status,provider_price_id:S.items.data[0].price.id,quantity:S.items.data[0].quantity,trial_ends_at:S.trial_end!=null?String(S.trial_end):void 0,ends_at:S.current_period_end!=null?String(S.current_period_end):void 0,provider_type:"stripe",last_used_at:S.current_period_end!=null?String(S.current_period_end):void 0}),R=await s6.insertInto("subscriptions").values(N).executeTakeFirst();return await s6.selectFrom("subscriptions").where("id","=",Number(R.insertId)).selectAll().executeTakeFirst()}async function Q(z,V,q){let S=await s6.selectFrom("subscriptions").where("id","=",z).selectAll().executeTakeFirst();return await s6?.updateTable("subscriptions").set({type:V,provider_price_id:q.items.data[0].price.id,unit_price:Number(q.items.data[0].price.unit_amount)}).where("id","=",z).executeTakeFirst(),S}function F(z){return Object.fromEntries(Object.entries(z).filter(([V,q])=>q!=null))}return{create:G,update:Y,isValid:H,isIncomplete:J,cancel:X,retrieve:W}})();var b68=(()=>{async function G(X,W){let Z=await s6.selectFrom("payment_products").where("id","=",W).selectAll().executeTakeFirst(),U={name:Z?.name,description:"",amount:Z?.unit_price,brand:"visa",type:"one-time",provider_id:"312321312",user_id:X.id},K=await s6.insertInto("payment_transactions").values(U).executeTakeFirst();return await s6.selectFrom("payment_transactions").where("id","=",Number(K.insertId)).selectAll().executeTakeFirst()}async function Y(X){return await s6.selectFrom("payment_transactions").where("user_id","=",X.id).selectAll().execute()}return{store:G,list:Y}})();var C4={};Kq(C4,{tax:()=>O78,subscriptionItems:()=>S78,subscription:()=>A78,setupIntents:()=>B78,refund:()=>L78,promotionCodes:()=>C78,promotion:()=>_78,product:()=>R78,price:()=>N78,paymentMethod:()=>T78,paymentIntent:()=>V78,invoices:()=>w78,events:()=>f78,dispute:()=>j78,customer:()=>F78,coupons:()=>P78,checkout:()=>E78,charge:()=>q78,balanceTransactions:()=>I78,balance:()=>Q78});import K78 from"node:process";class Q7{getClientName(){throw new Error("getClientName not implemented.")}makeRequest(G,Y,X,W,Z,U,K,J){throw new Error("makeRequest not implemented.")}static makeTimeoutError(){let G=new TypeError(Q7.TIMEOUT_ERROR_CODE);return G.code=Q7.TIMEOUT_ERROR_CODE,G}}Q7.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"];Q7.TIMEOUT_ERROR_CODE="ETIMEDOUT";class PS{constructor(G,Y){this._statusCode=G,this._headers=Y}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw new Error("getRawResponse not implemented.")}toStream(G){throw new Error("toStream not implemented.")}toJSON(){throw new Error("toJSON not implemented.")}}class CS extends Q7{constructor(G){super();if(!G){if(!globalThis.fetch)throw new Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");G=globalThis.fetch}if(globalThis.AbortController)this._fetchFn=CS.makeFetchWithAbortTimeout(G);else this._fetchFn=CS.makeFetchWithRaceTimeout(G)}static makeFetchWithRaceTimeout(G){return(Y,X,W)=>{let Z,U=new Promise((J,H)=>{Z=setTimeout(()=>{Z=null,H(Q7.makeTimeoutError())},W)}),K=G(Y,X);return Promise.race([K,U]).finally(()=>{if(Z)clearTimeout(Z)})}}static makeFetchWithAbortTimeout(G){return async(Y,X,W)=>{let Z=new AbortController,U=setTimeout(()=>{U=null,Z.abort(Q7.makeTimeoutError())},W);try{return await G(Y,Object.assign(Object.assign({},X),{signal:Z.signal}))}catch(K){if(K.name==="AbortError")throw Q7.makeTimeoutError();else throw K}finally{if(U)clearTimeout(U)}}}getClientName(){return"fetch"}async makeRequest(G,Y,X,W,Z,U,K,J){let $=new URL(X,`${K==="http"?"http":"https"}://${G}`);$.port=Y;let Q=W=="POST"||W=="PUT"||W=="PATCH",F=U||(Q?"":void 0),z=await this._fetchFn($.toString(),{method:W,headers:Z,body:F},J);return new Xl(z)}}class Xl extends PS{constructor(G){super(G.status,Xl._transformHeadersToObject(G.headers));this._res=G}getRawResponse(){return this._res}toStream(G){return G(),this._res.body}toJSON(){return this._res.json()}static _transformHeadersToObject(G){let Y={};for(let X of G){if(!Array.isArray(X)||X.length!=2)throw new Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");Y[X[0]]=X[1]}return Y}}class BS{computeHMACSignature(G,Y){throw new Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(G,Y){throw new Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(G){throw new Error("computeSHA256 not implemented.")}}class wS extends Error{}class Zl extends BS{constructor(G){super();this.subtleCrypto=G||crypto.subtle}computeHMACSignature(G,Y){throw new wS("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(G,Y){let X=new TextEncoder,W=await this.subtleCrypto.importKey("raw",X.encode(Y),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Z=await this.subtleCrypto.sign("hmac",W,X.encode(G)),U=new Uint8Array(Z),K=new Array(U.length);for(let J=0;J<U.length;J++)K[J]=Wl[U[J]];return K.join("")}async computeSHA256Async(G){return new Uint8Array(await this.subtleCrypto.digest("SHA-256",G))}}var Wl=new Array(256);for(let G=0;G<Wl.length;G++)Wl[G]=G.toString(16).padStart(2,"0");class Jl{constructor(){this._fetchFn=null,this._agent=null}getUname(){throw new Error("getUname not implemented.")}uuid4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(G)=>{let Y=Math.random()*16|0;return(G==="x"?Y:Y&3|8).toString(16)})}secureCompare(G,Y){if(G.length!==Y.length)return!1;let X=G.length,W=0;for(let Z=0;Z<X;++Z)W|=G.charCodeAt(Z)^Y.charCodeAt(Z);return W===0}createEmitter(){throw new Error("createEmitter not implemented.")}tryBufferData(G){throw new Error("tryBufferData not implemented.")}createNodeHttpClient(G){throw new Error("createNodeHttpClient not implemented.")}createFetchHttpClient(G){return new CS(G)}createDefaultHttpClient(){throw new Error("createDefaultHttpClient not implemented.")}createNodeCryptoProvider(){throw new Error("createNodeCryptoProvider not implemented.")}createSubtleCryptoProvider(G){return new Zl(G)}createDefaultCryptoProvider(){throw new Error("createDefaultCryptoProvider not implemented.")}}class kF1 extends Event{constructor(G,Y){super(G);this.data=Y}}class $l{constructor(){this.eventTarget=new EventTarget,this.listenerMapping=new Map}on(G,Y){let X=(W)=>{Y(W.data)};return this.listenerMapping.set(Y,X),this.eventTarget.addEventListener(G,X)}removeListener(G,Y){let X=this.listenerMapping.get(Y);return this.listenerMapping.delete(Y),this.eventTarget.removeEventListener(G,X)}once(G,Y){let X=(W)=>{Y(W.data)};return this.listenerMapping.set(Y,X),this.eventTarget.addEventListener(G,X,{once:!0})}emit(G,Y){return this.eventTarget.dispatchEvent(new kF1(G,Y))}}class Ul extends Jl{getUname(){return Promise.resolve(null)}createEmitter(){return new $l}tryBufferData(G){if(G.file.data instanceof ReadableStream)throw new Error("Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.");return Promise.resolve(G)}createNodeHttpClient(){throw new Error("Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.")}createDefaultHttpClient(){return super.createFetchHttpClient()}createNodeCryptoProvider(){throw new Error("Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.")}createDefaultCryptoProvider(){return this.createSubtleCryptoProvider()}}var FC={};Kq(FC,{generateV2Error:()=>zl,generateV1Error:()=>DS,TemporarySessionExpiredError:()=>Fl,StripeUnknownError:()=>Ql,StripeSignatureVerificationError:()=>YX,StripeRateLimitError:()=>vS,StripePermissionError:()=>VC,StripeInvalidRequestError:()=>HC,StripeInvalidGrantError:()=>Vl,StripeIdempotencyError:()=>Hl,StripeError:()=>l2,StripeConnectionError:()=>QC,StripeCardError:()=>Kl,StripeAuthenticationError:()=>hS,StripeAPIError:()=>kS});var DS=(G)=>{switch(G.type){case"card_error":return new Kl(G);case"invalid_request_error":return new HC(G);case"api_error":return new kS(G);case"authentication_error":return new hS(G);case"rate_limit_error":return new vS(G);case"idempotency_error":return new Hl(G);case"invalid_grant":return new Vl(G);default:return new Ql(G)}},zl=(G)=>{switch(G.type){case"temporary_session_expired":return new Fl(G)}switch(G.code){case"invalid_fields":return new HC(G)}return DS(G)};class l2 extends Error{constructor(G={},Y=null){super(G.message);this.type=Y||this.constructor.name,this.raw=G,this.rawType=G.type,this.code=G.code,this.doc_url=G.doc_url,this.param=G.param,this.detail=G.detail,this.headers=G.headers,this.requestId=G.requestId,this.statusCode=G.statusCode,this.message=G.message,this.userMessage=G.user_message,this.charge=G.charge,this.decline_code=G.decline_code,this.payment_intent=G.payment_intent,this.payment_method=G.payment_method,this.payment_method_type=G.payment_method_type,this.setup_intent=G.setup_intent,this.source=G.source}}l2.generate=DS;class Kl extends l2{constructor(G={}){super(G,"StripeCardError")}}class HC extends l2{constructor(G={}){super(G,"StripeInvalidRequestError")}}class kS extends l2{constructor(G={}){super(G,"StripeAPIError")}}class hS extends l2{constructor(G={}){super(G,"StripeAuthenticationError")}}class VC extends l2{constructor(G={}){super(G,"StripePermissionError")}}class vS extends l2{constructor(G={}){super(G,"StripeRateLimitError")}}class QC extends l2{constructor(G={}){super(G,"StripeConnectionError")}}class YX extends l2{constructor(G,Y,X={}){super(X,"StripeSignatureVerificationError");this.header=G,this.payload=Y}}class Hl extends l2{constructor(G={}){super(G,"StripeIdempotencyError")}}class Vl extends l2{constructor(G={}){super(G,"StripeInvalidGrantError")}}class Ql extends l2{constructor(G={}){super(G,"StripeUnknownError")}}class Fl extends l2{constructor(G={}){super(G,"TemporarySessionExpiredError")}}var pA1=L4(lA1(),1),pl=["apiKey","idempotencyKey","stripeAccount","apiVersion","maxNetworkRetries","timeout","host","authenticator","stripeContext","additionalHeaders"];function iA1(G){return G&&typeof G==="object"&&pl.some((Y)=>Object.prototype.hasOwnProperty.call(G,Y))}function EJ(G,Y){return pA1.stringify(G,{serializeDate:(X)=>Math.floor(X.getTime()/1000).toString(),arrayFormat:Y=="v2"?"repeat":"indices"}).replace(/%5B/g,"[").replace(/%5D/g,"]")}var BC=(()=>{let G={"\n":"\\n",'"':"\\\"","\u2028":"\\u2028","\u2029":"\\u2029"};return(Y)=>{let X=Y.replace(/["\n\r\u2028\u2029]/g,(W)=>G[W]);return(W)=>{return X.replace(/\{([\s\S]+?)\}/g,(Z,U)=>encodeURIComponent(W[U]||""))}}})();function aA1(G){let Y=G.match(/\{\w+\}/g);if(!Y)return[];return Y.map((X)=>X.replace(/[{}]/g,""))}function BV(G){if(!Array.isArray(G)||!G[0]||typeof G[0]!=="object")return{};if(!iA1(G[0]))return G.shift();let Y=Object.keys(G[0]),X=Y.filter((W)=>pl.includes(W));if(X.length>0&&X.length!==Y.length)rS(`Options found in arguments (${X.join(", ")}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`);return{}}function wC(G){let Y={host:null,headers:{},settings:{}};if(G.length>0){let X=G[G.length-1];if(typeof X==="string")Y.authenticator=CC(G.pop());else if(iA1(X)){let W=Object.assign({},G.pop()),Z=Object.keys(W).filter((U)=>!pl.includes(U));if(Z.length)rS(`Invalid options found (${Z.join(", ")}); ignoring.`);if(W.apiKey)Y.authenticator=CC(W.apiKey);if(W.idempotencyKey)Y.headers["Idempotency-Key"]=W.idempotencyKey;if(W.stripeAccount)Y.headers["Stripe-Account"]=W.stripeAccount;if(W.stripeContext){if(Y.headers["Stripe-Account"])throw new Error("Can't specify both stripeAccount and stripeContext.");Y.headers["Stripe-Context"]=W.stripeContext}if(W.apiVersion)Y.headers["Stripe-Version"]=W.apiVersion;if(Number.isInteger(W.maxNetworkRetries))Y.settings.maxNetworkRetries=W.maxNetworkRetries;if(Number.isInteger(W.timeout))Y.settings.timeout=W.timeout;if(W.host)Y.host=W.host;if(W.authenticator){if(W.apiKey)throw new Error("Can't specify both apiKey and authenticator.");if(typeof W.authenticator!=="function")throw new Error("The authenticator must be a function receiving a request as the first parameter.");Y.authenticator=W.authenticator}if(W.additionalHeaders)Y.headers=W.additionalHeaders}}return Y}function rA1(G){let Y=this,X=Object.prototype.hasOwnProperty.call(G,"constructor")?G.constructor:function(...W){Y.apply(this,W)};return Object.assign(X,Y),X.prototype=Object.create(Y.prototype),Object.assign(X.prototype,G),X}function DC(G){if(typeof G!=="object")throw new Error("Argument must be an object");return Object.keys(G).reduce((Y,X)=>{if(G[X]!=null)Y[X]=G[X];return Y},{})}function dA1(G){if(!(G&&typeof G==="object"))return G;return Object.keys(G).reduce((Y,X)=>{return Y[U58(X)]=G[X],Y},{})}function U58(G){return G.split("-").map((Y)=>Y.charAt(0).toUpperCase()+Y.substr(1).toLowerCase()).join("-")}function aS(G,Y){if(Y)return G.then((X)=>{setTimeout(()=>{Y(null,X)},0)},(X)=>{setTimeout(()=>{Y(X,null)},0)});return G}function sA1(G){if(G==="OAuth")return"oauth";else return G[0].toLowerCase()+G.substring(1)}function rS(G){if(typeof process.emitWarning!=="function")return console.warn(`Stripe: ${G}`);return process.emitWarning(G,"Stripe")}function z58(G){let Y=typeof G;return(Y==="function"||Y==="object")&&!!G}function nA1(G){let Y={},X=(W,Z)=>{Object.entries(W).forEach(([U,K])=>{let J=Z?`${Z}[${U}]`:U;if(z58(K))if(!(K instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(K,"data"))return X(K,J);else Y[J]=K;else Y[J]=String(K)})};return X(G,null),Y}function kC(G,Y,X){if(!Number.isInteger(Y))if(X!==void 0)return X;else throw new Error(`${G} must be an integer`);return Y}function oA1(){return typeof process==="undefined"?{}:{lang_version:process.version,platform:process.platform}}function CC(G){let Y=(X)=>{return X.headers.Authorization="Bearer "+G,Promise.resolve()};return Y._apiKey=G,Y}function K58(G,Y){if(this[G]instanceof Date)return Math.floor(this[G].getTime()/1000).toString();return Y}function tA1(G){return JSON.stringify(G,K58)}function wV(G){if(!G)return"v1";return G.startsWith("/v2")?"v2":"v1"}var H58=60;class DV{constructor(G,Y){this._stripe=G,this._maxBufferedRequestMetric=Y}_addHeadersDirectlyToObject(G,Y){G.requestId=Y["request-id"],G.stripeAccount=G.stripeAccount||Y["stripe-account"],G.apiVersion=G.apiVersion||Y["stripe-version"],G.idempotencyKey=G.idempotencyKey||Y["idempotency-key"]}_makeResponseEvent(G,Y,X){let W=Date.now(),Z=W-G.request_start_time;return DC({api_version:X["stripe-version"],account:X["stripe-account"],idempotency_key:X["idempotency-key"],method:G.method,path:G.path,status:Y,request_id:this._getRequestId(X),elapsed:Z,request_start_time:G.request_start_time,request_end_time:W})}_getRequestId(G){return G["request-id"]}_streamingResponseHandler(G,Y,X){return(W)=>{let Z=W.getHeaders(),U=()=>{let J=this._makeResponseEvent(G,W.getStatusCode(),Z);this._stripe._emitter.emit("response",J),this._recordRequestMetrics(this._getRequestId(Z),J.elapsed,Y)},K=W.toStream(U);return this._addHeadersDirectlyToObject(K,Z),X(null,K)}}_jsonResponseHandler(G,Y,X,W){return(Z)=>{let U=Z.getHeaders(),K=this._getRequestId(U),J=Z.getStatusCode(),H=this._makeResponseEvent(G,J,U);this._stripe._emitter.emit("response",H),Z.toJSON().then(($)=>{if($.error){let Q;if(typeof $.error==="string")$.error={type:$.error,message:$.error_description};if($.error.headers=U,$.error.statusCode=J,$.error.requestId=K,J===401)Q=new hS($.error);else if(J===403)Q=new VC($.error);else if(J===429)Q=new vS($.error);else if(Y==="v2")Q=zl($.error);else Q=DS($.error);throw Q}return $},($)=>{throw new kS({message:"Invalid JSON received from the Stripe API",exception:$,requestId:U["request-id"]})}).then(($)=>{this._recordRequestMetrics(K,H.elapsed,X);let Q=Z.getRawResponse();this._addHeadersDirectlyToObject(Q,U),Object.defineProperty($,"lastResponse",{enumerable:!1,writable:!1,value:Q}),W(null,$)},($)=>W($,null))}}static _generateConnectionErrorMessage(G){return`An error occurred with our connection to Stripe.${G>0?` Request was retried ${G} times.`:""}`}static _shouldRetry(G,Y,X,W){if(W&&Y===0&&Q7.CONNECTION_CLOSED_ERROR_CODES.includes(W.code))return!0;if(Y>=X)return!1;if(!G)return!0;if(G.getHeaders()["stripe-should-retry"]==="false")return!1;if(G.getHeaders()["stripe-should-retry"]==="true")return!0;if(G.getStatusCode()===409)return!0;if(G.getStatusCode()>=500)return!0;return!1}_getSleepTimeInMS(G,Y=null){let X=this._stripe.getInitialNetworkRetryDelay(),W=this._stripe.getMaxNetworkRetryDelay(),Z=Math.min(X*Math.pow(2,G-1),W);if(Z*=0.5*(1+Math.random()),Z=Math.max(X,Z),Number.isInteger(Y)&&Y<=H58)Z=Math.max(Z,Y);return Z*1000}_getMaxNetworkRetries(G={}){return G.maxNetworkRetries!==void 0&&Number.isInteger(G.maxNetworkRetries)?G.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(G,Y,X){let W=this._getMaxNetworkRetries(Y),Z=()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;if(X==="v2"){if(G==="POST"||G==="DELETE")return Z()}else if(X==="v1"){if(G==="POST"&&W>0)return Z()}return null}_makeHeaders({contentType:G,contentLength:Y,apiVersion:X,clientUserAgent:W,method:Z,userSuppliedHeaders:U,userSuppliedSettings:K,stripeAccount:J,stripeContext:H,apiMode:$}){let Q={Accept:"application/json","Content-Type":G,"User-Agent":this._getUserAgentString($),"X-Stripe-Client-User-Agent":W,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":X,"Stripe-Account":J,"Stripe-Context":H,"Idempotency-Key":this._defaultIdempotencyKey(Z,K,$)},F=Z=="POST"||Z=="PUT"||Z=="PATCH";if(F||Y){if(!F)rS(`${Z} method had non-zero contentLength but no payload is expected for this verb`);Q["Content-Length"]=Y}return Object.assign(DC(Q),dA1(U))}_getUserAgentString(G){let Y=this._stripe.getConstant("PACKAGE_VERSION"),X=this._stripe._appInfo?this._stripe.getAppInfoAsString():"";return`Stripe/${G} NodeBindings/${Y} ${X}`.trim()}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0){let G=this._stripe._prevRequestMetrics.shift();return JSON.stringify({last_request_metrics:G})}}_recordRequestMetrics(G,Y,X){if(this._stripe.getTelemetryEnabled()&&G)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)rS("Request metrics buffer is full, dropping telemetry message.");else{let W={request_id:G,request_duration_ms:Y};if(X&&X.length>0)W.usage=X;this._stripe._prevRequestMetrics.push(W)}}_rawRequest(G,Y,X,W){return new Promise((U,K)=>{let J;try{let z=G.toUpperCase();if(z!=="POST"&&X&&Object.keys(X).length!==0)throw new Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let V=[].slice.call([X,W]),q=BV(V),S=Object.assign({},q),N=wC(V),R=N.headers,j=N.authenticator;J={requestMethod:z,requestPath:Y,bodyData:S,queryData:{},authenticator:j,headers:R,host:null,streaming:!1,settings:{},usage:["raw_request"]}}catch(z){K(z);return}function H(z,V){if(z)K(z);else U(V)}let{headers:$,settings:Q}=J,F=J.authenticator;this._request(J.requestMethod,J.host,Y,J.bodyData,F,{headers:$,settings:Q,streaming:J.streaming},J.usage,H)})}_request(G,Y,X,W,Z,U,K=[],J,H=null){var $;let Q;Z=($=Z!==null&&Z!==void 0?Z:this._stripe._authenticator)!==null&&$!==void 0?$:null;let F=wV(X),z=(S,N,R,j,_)=>{return setTimeout(S,this._getSleepTimeInMS(j,_),N,R,j+1)},V=(S,N,R)=>{let j=U.settings&&U.settings.timeout&&Number.isInteger(U.settings.timeout)&&U.settings.timeout>=0?U.settings.timeout:this._stripe.getApiField("timeout"),_={host:Y||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:X,method:G,headers:Object.assign({},N),body:Q,protocol:this._stripe.getApiField("protocol")};Z(_).then(()=>{let E=this._stripe.getApiField("httpClient").makeRequest(_.host,_.port,_.path,_.method,_.headers,_.body,_.protocol,j),B=Date.now(),w=DC({api_version:S,account:N["Stripe-Account"],idempotency_key:N["Idempotency-Key"],method:G,path:X,request_start_time:B}),D=R||0,P=this._getMaxNetworkRetries(U.settings||{});this._stripe._emitter.emit("request",w),E.then((C)=>{if(DV._shouldRetry(C,D,P))return z(V,S,N,D,C.getHeaders()["retry-after"]);else if(U.streaming&&C.getStatusCode()<400)return this._streamingResponseHandler(w,K,J)(C);else return this._jsonResponseHandler(w,F,K,J)(C)}).catch((C)=>{if(DV._shouldRetry(null,D,P,C))return z(V,S,N,D,null);else{let h=C.code&&C.code===Q7.TIMEOUT_ERROR_CODE;return J(new QC({message:h?`Request aborted due to timeout being reached (${j}ms)`:DV._generateConnectionErrorMessage(D),detail:C}))}})}).catch((E)=>{throw new l2({message:"Unable to authenticate the request",exception:E})})},q=(S,N)=>{if(S)return J(S);Q=N,this._stripe.getClientUserAgent((R)=>{let j=this._stripe.getApiField("version"),_=this._makeHeaders({contentType:F=="v2"?"application/json":"application/x-www-form-urlencoded",contentLength:Q.length,apiVersion:j,clientUserAgent:R,method:G,userSuppliedHeaders:U.headers,userSuppliedSettings:U.settings,stripeAccount:F=="v2"?null:this._stripe.getApiField("stripeAccount"),stripeContext:F=="v2"?this._stripe.getApiField("stripeContext"):null,apiMode:F});V(j,_,0)})};if(H)H(G,W,U.headers,q);else{let S;if(F=="v2")S=W?tA1(W):"";else S=EJ(W||{},F);q(null,S)}}}class al{constructor(G,Y,X,W){this.index=0,this.pagePromise=G,this.promiseCache={currentPromise:null},this.requestArgs=Y,this.spec=X,this.stripeResource=W}async iterate(G){if(!(G&&G.data&&typeof G.data.length==="number"))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let Y=WS1(this.requestArgs);if(this.index<G.data.length){let X=Y?G.data.length-1-this.index:this.index,W=G.data[X];return this.index+=1,{value:W,done:!1}}else if(G.has_more){this.index=0,this.pagePromise=this.getNextPage(G);let X=await this.pagePromise;return this.iterate(X)}return{done:!0,value:void 0}}getNextPage(G){throw new Error("Unimplemented")}async _next(){return this.iterate(await this.pagePromise)}next(){if(this.promiseCache.currentPromise)return this.promiseCache.currentPromise;let G=(async()=>{let Y=await this._next();return this.promiseCache.currentPromise=null,Y})();return this.promiseCache.currentPromise=G,G}}class eA1 extends al{getNextPage(G){let Y=WS1(this.requestArgs),X=q58(G,Y);return this.stripeResource._makeRequest(this.requestArgs,this.spec,{[Y?"ending_before":"starting_after"]:X})}}class GS1 extends al{getNextPage(G){if(!G.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");return this.stripeResource._makeRequest(this.requestArgs,this.spec,{page:G.next_page})}}class YS1{constructor(G,Y,X,W){this.currentPageIterator=(async()=>{return(await G).data[Symbol.iterator]()})(),this.nextPageUrl=(async()=>{return(await G).next_page_url||null})(),this.requestArgs=Y,this.spec=X,this.stripeResource=W}async turnPage(){let G=await this.nextPageUrl;if(!G)return null;this.spec.fullPath=G;let Y=await this.stripeResource._makeRequest([],this.spec,{});return this.nextPageUrl=Promise.resolve(Y.next_page_url),this.currentPageIterator=Promise.resolve(Y.data[Symbol.iterator]()),this.currentPageIterator}async next(){{let X=(await this.currentPageIterator).next();if(!X.done)return{done:!1,value:X.value}}let G=await this.turnPage();if(!G)return{done:!0,value:void 0};let Y=G.next();if(!Y.done)return{done:!1,value:Y.value};return{done:!0,value:void 0}}}var XS1=(G,Y,X,W)=>{let Z=wV(X.fullPath||X.path);if(Z!=="v2"&&X.methodType==="search")return il(new GS1(W,Y,X,G));if(Z!=="v2"&&X.methodType==="list")return il(new eA1(W,Y,X,G));if(Z==="v2"&&X.methodType==="list")return il(new YS1(W,Y,X,G));return null},il=(G)=>{let Y=A58((...Z)=>G.next(...Z)),X=S58(Y),W={autoPagingEach:Y,autoPagingToArray:X,next:()=>G.next(),return:()=>{return{}},[V58()]:()=>{return W}};return W};function V58(){if(typeof Symbol!=="undefined"&&Symbol.asyncIterator)return Symbol.asyncIterator;return"@@asyncIterator"}function Q58(G){if(G.length<2)return null;let Y=G[1];if(typeof Y!=="function")throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof Y}`);return Y}function F58(G){if(G.length===0)return;let Y=G[0];if(typeof Y!=="function")throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof Y}`);if(Y.length===2)return Y;if(Y.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${Y}`);return function X(W,Z){let U=Y(W);Z(U)}}function q58(G,Y){let X=Y?0:G.data.length-1,W=G.data[X],Z=W&&W.id;if(!Z)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return Z}function A58(G){return function Y(){let X=[].slice.call(arguments),W=F58(X),Z=Q58(X);if(X.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${X}`);let U=N58(G,W);return aS(U,Z)}}function S58(G){return function Y(X,W){let Z=X&&X.limit;if(!Z)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(Z>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");let U=new Promise((K,J)=>{let H=[];G(($)=>{if(H.push($),H.length>=Z)return!1}).then(()=>{K(H)}).catch(J)});return aS(U,W)}}function N58(G,Y){return new Promise((X,W)=>{function Z(U){if(U.done){X();return}let K=U.value;return new Promise((J)=>{Y(K,J)}).then((J)=>{if(J===!1)return Z({done:!0,value:void 0});else return G().then(Z)})}G().then(Z).catch(W)})}function WS1(G){let Y=[].slice.call(G);return!!BV(Y).ending_before}function ZS1(G){if(G.path!==void 0&&G.fullPath!==void 0)throw new Error(`Method spec specified both a 'path' (${G.path}) and a 'fullPath' (${G.fullPath}).`);return function(...Y){let X=typeof Y[Y.length-1]=="function"&&Y.pop();G.urlParams=aA1(G.fullPath||this.createResourcePathWithSymbols(G.path||""));let W=aS(this._makeRequest(Y,G,{}),X);return Object.assign(W,XS1(this,Y,G,W)),W}}_1.extend=rA1;_1.method=ZS1;_1.MAX_BUFFERED_REQUEST_METRICS=100;function _1(G,Y){if(this._stripe=G,Y)throw new Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=BC(this.basePath||G.getApiField("basePath")),this.resourcePath=this.path,this.path=BC(this.path),this.initialize(...arguments)}_1.prototype={_stripe:null,path:"",resourcePath:"",basePath:null,initialize(){},requestDataProcessor:null,validateRequest:null,createFullPath(G,Y){let X=[this.basePath(Y),this.path(Y)];if(typeof G==="function"){let W=G(Y);if(W)X.push(W)}else X.push(G);return this._joinUrlParts(X)},createResourcePathWithSymbols(G){if(G)return`/${this._joinUrlParts([this.resourcePath,G])}`;else return`/${this.resourcePath}`},_joinUrlParts(G){return G.join("/").replace(/\/{2,}/g,"/")},_getRequestOpts(G,Y,X){var W;let Z=(Y.method||"GET").toUpperCase(),U=Y.usage||[],K=Y.urlParams||[],J=Y.encode||((D)=>D),H=!!Y.fullPath,$=BC(H?Y.fullPath:Y.path||""),Q=H?Y.fullPath:this.createResourcePathWithSymbols(Y.path),F=[].slice.call(G),z=K.reduce((D,P)=>{let C=F.shift();if(typeof C!=="string")throw new Error(`Stripe: Argument "${P}" must be a string, but got: ${C} (on API request to \`${Z} ${Q}\`)`);return D[P]=C,D},{}),V=BV(F),q=J(Object.assign({},V,X)),S=wC(F),N=S.host||Y.host,R=!!Y.streaming;if(F.filter((D)=>D!=null).length)throw new Error(`Stripe: Unknown arguments (${F}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${Z} \`${Q}\`)`);let j=H?$(z):this.createFullPath($,z),_=Object.assign(S.headers,Y.headers);if(Y.validator)Y.validator(q,{headers:_});let E=Y.method==="GET"||Y.method==="DELETE";return{requestMethod:Z,requestPath:j,bodyData:E?null:q,queryData:E?q:{},authenticator:(W=S.authenticator)!==null&&W!==void 0?W:null,headers:_,host:N!==null&&N!==void 0?N:null,streaming:R,settings:S.settings,usage:U}},_makeRequest(G,Y,X){return new Promise((W,Z)=>{var U;let K;try{K=this._getRequestOpts(G,Y,X)}catch(z){Z(z);return}function J(z,V){if(z)Z(z);else W(Y.transformResponseData?Y.transformResponseData(V):V)}let H=Object.keys(K.queryData).length===0,$=[K.requestPath,H?"":"?",EJ(K.queryData,wV(K.requestPath))].join(""),{headers:Q,settings:F}=K;this._stripe._requestSender._request(K.requestMethod,K.host,$,K.bodyData,K.authenticator,{headers:Q,settings:F,streaming:K.streaming},K.usage,J,(U=this.requestDataProcessor)===null||U===void 0?void 0:U.bind(this))})}};function rl(G){let Y={DEFAULT_TOLERANCE:300,signature:null,constructEvent(Q,F,z,V,q,S){try{this.signature.verifyHeader(Q,F,z,V||Y.DEFAULT_TOLERANCE,q,S)}catch(R){if(R instanceof wS)R.message+="\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`";throw R}return Q instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Q)):JSON.parse(Q)},async constructEventAsync(Q,F,z,V,q,S){return await this.signature.verifyHeaderAsync(Q,F,z,V||Y.DEFAULT_TOLERANCE,q,S),Q instanceof Uint8Array?JSON.parse(new TextDecoder("utf8").decode(Q)):JSON.parse(Q)},generateTestHeaderString:function(Q){let F=$(Q),z=F.signature||F.cryptoProvider.computeHMACSignature(F.payloadString,F.secret);return F.generateHeaderString(z)},generateTestHeaderStringAsync:async function(Q){let F=$(Q),z=F.signature||await F.cryptoProvider.computeHMACSignatureAsync(F.payloadString,F.secret);return F.generateHeaderString(z)}},X={EXPECTED_SCHEME:"v1",verifyHeader(Q,F,z,V,q,S){let{decodedHeader:N,decodedPayload:R,details:j,suspectPayloadType:_}=Z(Q,F,this.EXPECTED_SCHEME),E=/\s/.test(z);q=q||H();let B=q.computeHMACSignature(W(R,j),z);return U(R,N,j,B,V,_,E,S),!0},async verifyHeaderAsync(Q,F,z,V,q,S){let{decodedHeader:N,decodedPayload:R,details:j,suspectPayloadType:_}=Z(Q,F,this.EXPECTED_SCHEME),E=/\s/.test(z);q=q||H();let B=await q.computeHMACSignatureAsync(W(R,j),z);return U(R,N,j,B,V,_,E,S)}};function W(Q,F){return`${F.timestamp}.${Q}`}function Z(Q,F,z){if(!Q)throw new YX(F,Q,{message:"No webhook payload was provided."});let V=typeof Q!="string"&&!(Q instanceof Uint8Array),q=new TextDecoder("utf8"),S=Q instanceof Uint8Array?q.decode(Q):Q;if(Array.isArray(F))throw new Error("Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.");if(F==null||F=="")throw new YX(F,Q,{message:"No stripe-signature header value was provided."});let N=F instanceof Uint8Array?q.decode(F):F,R=K(N,z);if(!R||R.timestamp===-1)throw new YX(N,S,{message:"Unable to extract timestamp and signatures from header"});if(!R.signatures.length)throw new YX(N,S,{message:"No signatures found with expected scheme"});return{decodedPayload:S,decodedHeader:N,details:R,suspectPayloadType:V}}function U(Q,F,z,V,q,S,N,R){let j=!!z.signatures.filter(G.secureCompare.bind(G,V)).length,_=`
3774
3774
  Learn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature`,E=N?`
@@ -5386,7 +5386,7 @@ export interface Database {
5386
5386
  `,Y+="}";let U=Bun.file(E4.frameworkPath("orm/src/types.ts")).writer();U.write(Y),await U.end()}function Xr(G){let Y=G.fieldArray?.entity==="enum"?"string | string[]":G.fieldArray?.entity;return Y==="date"?"Date | string":Y}async function $B1(G){try{Z6.info("Cleanup of older Models..."),await qG4(G),Z6.success("Deleted Models"),Z6.info("Deleting old Model Name types..."),await AG4(),Z6.success("Deleted Model Name types"),Z6.info("Deleting old attribute types..."),await SG4(),Z6.success("Deleted old attribute types"),Z6.info("Deleting old model events..."),await NG4(),Z6.success("Deleted old model events"),Z6.info("Deleting old orm imports..."),await RG4(),Z6.success("Deleted old orm imports"),Z6.info("Deleting old Model Requests..."),await LG4(G),Z6.success("Deleted Model Requests"),Z6.info("Deleting old Model Routes..."),await TG4(),Z6.success("Deleted Model Routes");try{Z6.info("Writing Model Names..."),await UG4(),Z6.success("Wrote Model Names")}catch(X){Z6.error(X),$Q("Error while writing Model Names",X)}try{Z6.info("Writing Table Names..."),await zG4(),Z6.success("Wrote Table Names")}catch(X){$Q("Error while writing Table Names",X)}try{Z6.info("Writing Model Requests..."),await VG4(),Z6.success("Wrote Model Requests")}catch(X){$Q("Error while writing Model Requests",X)}try{Z6.info("Writing Model Attributes..."),await KG4(),Z6.success("Wrote Model Attributes")}catch(X){$Q("Error while writing Model Attributes",X)}try{Z6.info("Writing Model Events..."),await HG4(),Z6.success("Wrote Model Events")}catch(X){$Q("Error while writing Model Events",X)}Z6.info("Generating API Routes...");let Y=S3([E4.userModelsPath("**/*.ts"),E4.storagePath("framework/defaults/models/**/*.ts")],{absolute:!0});await FG4(Y),Z6.success("Generated API Routes"),await EG4(Y);for(let X of Y){if(G&&G!==X)continue;Z6.info(`Processing Model: ${UQ(X)}`);let W=(await import(X)).default,Z=C2(W,X),U=n2(W,X),K=Bun.file(E4.frameworkPath(`orm/src/models/${U}.ts`)),J=await Jr(W,X),H=await YB1(Z,U,W,J),$=K.writer();Z6.info(`Writing API Endpoints for: ${UQ(U)}`),$.write(H),Z6.success(`Wrote API endpoints for: ${UQ(U)}`),await $.end()}Z6.info("Generating Query Builder types..."),await IG4(),Z6.success("Generated Query Builder types"),await jG4()}catch(Y){$Q("Error while generating model files",Y)}}async function EG4(G){let Y="";for(let Z of G){let U=(await import(Z)).default,K=n2(U,Z);Y+=`export { default as ${K}, type ${K}JsonResponse, type New${K}, type ${K}Update } from './models/${K}'
5387
5387
 
5388
5388
  `}let W=Bun.file(E4.frameworkPath("orm/src/index.ts")).writer();W.write(Y),await W.end()}async function jG4(){Z6.info("Linting code style...");let G=Bun.spawn(["bunx","--bun","eslint",".","--fix"],{stdio:["ignore","pipe","pipe"],cwd:E4.projectPath()}),Y=G.stdout.getReader();while(!0){let{done:Z}=await Y.read();if(Z)break}let X=G.stderr.getReader();while(!0){let{done:Z}=await X.read();if(Z)break}if(await G.exited!==0)Z6.debug("There was an error fixing your code style but we are ignoring it because we fixed the auto-generated code already. Run `bunx eslint . --fix` to fix the rest of the code.");else Z6.debug("Code style fixed successfully.")}function sX(G){let Y=E4.join(E4.storagePath("framework/defaults/models"),"/");return S3(`${Y}**/${G}`,{absolute:!0})[0]??""}function nX(G){let Y=E4.join(E4.userModelsPath("/"),"/");return S3(`${Y}**/${G}`,{absolute:!0})[0]??""}import{ports as UG6}from"@stacksjs/config";var{plugin:BG4}=globalThis.Bun;import{path as Kw}from"@stacksjs/path";import $r from"node:path";function OG4(G,Y={}){let{globalsPropValue:X=!0}=Y,W={},Z=G.match(/declare\s+global\s*\{([^}]*)\}/);if(!Z||!Z[1])return JSON.stringify({globals:{}},null,2);let U=Z[1],K=U.match(/const\s+(\w+):/g);if(K)K.forEach(($)=>{let Q=$.replace(/const\s+|:/g,"").trim();W[Q]=X});let J=U.match(/type\s+(\w+)\s*=/g);if(J)J.forEach(($)=>{let Q=$.replace(/type\s+|=/g,"").trim();W[Q]=X});let H={globals:W};return JSON.stringify(H,null,2)}var{Glob:_G4}=globalThis.Bun;function fG4(G){return G.endsWith("ts")?"ts":G.endsWith("js")?"js":G.endsWith("tsx")?"tsx":"jsx"}var PG4=`// Generated by bun-plugin-auto-imports
5389
- `;async function CG4(G){let Y=new Set,X=new _G4("**/*.{ts,tsx,js,jsx}");for await(let W of X.scan({cwd:G,absolute:!0,onlyFiles:!0,followSymlinks:!1})){if(W.includes("node_modules")||W.endsWith(".d.ts"))continue;let Z=await Bun.file(W).text(),U=[...Z.matchAll(/export\s+(?:const|let|var|function|class|type|interface)\s+([a-zA-Z_$][\w$]*)/g),...Z.matchAll(/export\s+\{([^}]+)\}/g),...Z.matchAll(/export\s+default\s+(?:(?:function|class)\s*)?([a-zA-Z_$][\w$]*)/g)];for(let K of U)if(K[1])K[1].split(",").map((H)=>H.trim().replace(/\s+as\s+(?:\S.*)?$/,"").replace(/^.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])as\s+/,"")).forEach((H)=>Y.add(H))}return Array.from(Y)}function UB1(G){return{name:"bun-plugin-auto-imports",async setup(Y){let{createUnimport:X}=await import("./chunk-yjmev4jy.js"),W={};if(G.dirs)for(let Q of G.dirs){let F=typeof Q==="string"?Q:("path"in Q)?Q.path:Q;W[F]=await CG4(F)}let Z=Object.entries(W).flatMap(([Q,F])=>F.map((z)=>({from:Q,name:z,as:z}))),U=$r.resolve(G.dts??"./auto-imports.d.ts"),K=$r.dirname(U),J=X({...G,imports:[...G.imports||[],...Z.map((Q)=>({...Q,from:`./${$r.relative(K,Q.from).replace(/\\/g,"/")}`}))],dts:void 0}),{injectImports:H}=J,$=await J.generateTypeDeclarations();if(await Bun.write(G.dts??"./auto-imports.d.ts",PG4+$),G.eslint?.enabled===!0){let Q={enabled:!0,filepath:G.eslint.filepath??"./.eslint-auto-import.json",globalsPropValue:G.eslint.globalsPropValue},F=OG4($,Q);await Bun.write(Q.filepath??"./.eslint-auto-import.json",F)}Y.onLoad({filter:/.*/},async(Q)=>{let F=await Bun.file(Q.path).text();return{contents:(await H(F)).code,loader:fG4(Q.path)}})}}}function zB1(){let G={dts:Kw.storagePath("framework/types/server-auto-imports.d.ts"),dirs:[Kw.storagePath("framework/orm/src/models"),Kw.storagePath("framework/requests")],eslint:{enabled:!0,filepath:Kw.storagePath("framework/server-auto-imports.json")}};BG4(UB1(G))}import{ExitCode as VB1}from"@stacksjs/types";function _G6(G){let Y={command:"Automagically build any of your libraries/packages for production use. Select any of the following packages",types:"Generate your TypeScript types",entries:"Generate your function & Component Library Entry Points",webTypes:"Generate web-types.json for IDEs",customData:"Generate VS Code custom data (custom-elements.json) for IDEs",ideHelpers:"Generate IDE helpers",componentMeta:"Generate component meta information",coreSymlink:"Generate symlink of the core framework to the project root",pkgx:"Generate the pkgx configuration file",modelFiles:"Generate the model files",openApi:"Generate the OpenAPI specification",select:"What are you trying to generate?",project:"Target a specific project",verbose:"Enable verbose output"};G.command("generate",Y.command).option("-t, --types",Y.types).option("-e, --entries",Y.entries).option("-w, --web-types",Y.webTypes).option("-c, --custom-data",Y.customData).option("-i, --ide-helpers",Y.ideHelpers).option("-c, --component-meta",Y.componentMeta).option("-p, --pkgx",Y.pkgx).option("-m, --model-files",Y.modelFiles).option("-o, --openapi",Y.openApi).option("-p, --project [project]",Y.project,{default:!1}).option("--core-symlink",Y.coreSymlink).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate` ...",X),await xG4(X),Ur.exit(VB1.Success)}),G.command("generate:types",Y.types).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).alias("types:generate").action(async(X)=>{qG.debug("Running `buddy generate:types` ...",X),await MG4(X)}),G.command("generate:entries",Y.entries).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:entries` ...",X),await hG4(X)}),G.command("generate:web-types",Y.webTypes).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:web-types` ...",X),await yG4(X)}),G.command("generate:vscode-custom-data",Y.customData).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:vscode-custom-data` ...",X),await gG4(X)}),G.command("generate:ide-helpers",Y.ideHelpers).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:ide-helpers` ...",X),await kG4(X)}),G.command("generate:component-meta",Y.componentMeta).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:component-meta` ...",X),await wG4()}),G.command("generate:pkgx-config",Y.pkgx).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action((X)=>{qG.debug("Running `buddy generate:pkgx-config` ...",X),bG4()}),G.command("generate:model-files",Y.modelFiles).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async()=>{let X=await KB1("buddy generate:model-files");try{await $B1(),await zB1(),HB1("Generated Model files",{startTime:X,useSeconds:!0})}catch(W){qG.error("There was an error generating your model files",W),Ur.exit(VB1.FatalError)}}),G.command("generate:openapi-spec",Y.openApi).alias("generate:openapi").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:openapi-spec` ...",X);let W=await KB1("buddy generate:openapi-spec");await vG4(),HB1("Generated OpenAPI specification",{startTime:W,useSeconds:!0})}),G.command("generate:migrations","Generate Migrations").action((X)=>{qG.debug("Running `buddy generate:migrations` ...",X)}),G.command("generate:core-symlink","Generate core symlink. A shortcut for core developers.").action(async(X)=>{qG.debug("Running `buddy core-symlink` ...",X),await DG4()}),G.on("generate:*",()=>{console.error(`Invalid command: %s
5389
+ `;async function CG4(G){let Y=new Set,X=new _G4("**/*.{ts,tsx,js,jsx}");for await(let W of X.scan({cwd:G,absolute:!0,onlyFiles:!0,followSymlinks:!1})){if(W.includes("node_modules")||W.endsWith(".d.ts"))continue;let Z=await Bun.file(W).text(),U=[...Z.matchAll(/export\s+(?:const|let|var|function|class|type|interface)\s+([a-zA-Z_$][\w$]*)/g),...Z.matchAll(/export\s+\{([^}]+)\}/g),...Z.matchAll(/export\s+default\s+(?:(?:function|class)\s*)?([a-zA-Z_$][\w$]*)/g)];for(let K of U)if(K[1])K[1].split(",").map((H)=>H.trim().replace(/\s+as\s+(?:\S.*)?$/,"").replace(/^.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])as\s+/,"")).forEach((H)=>Y.add(H))}return Array.from(Y)}function UB1(G){return{name:"bun-plugin-auto-imports",async setup(Y){let{createUnimport:X}=await import("./chunk-y0kfnrfm.js"),W={};if(G.dirs)for(let Q of G.dirs){let F=typeof Q==="string"?Q:("path"in Q)?Q.path:Q;W[F]=await CG4(F)}let Z=Object.entries(W).flatMap(([Q,F])=>F.map((z)=>({from:Q,name:z,as:z}))),U=$r.resolve(G.dts??"./auto-imports.d.ts"),K=$r.dirname(U),J=X({...G,imports:[...G.imports||[],...Z.map((Q)=>({...Q,from:`./${$r.relative(K,Q.from).replace(/\\/g,"/")}`}))],dts:void 0}),{injectImports:H}=J,$=await J.generateTypeDeclarations();if(await Bun.write(G.dts??"./auto-imports.d.ts",PG4+$),G.eslint?.enabled===!0){let Q={enabled:!0,filepath:G.eslint.filepath??"./.eslint-auto-import.json",globalsPropValue:G.eslint.globalsPropValue},F=OG4($,Q);await Bun.write(Q.filepath??"./.eslint-auto-import.json",F)}Y.onLoad({filter:/.*/},async(Q)=>{let F=await Bun.file(Q.path).text();return{contents:(await H(F)).code,loader:fG4(Q.path)}})}}}function zB1(){let G={dts:Kw.storagePath("framework/types/server-auto-imports.d.ts"),dirs:[Kw.storagePath("framework/orm/src/models"),Kw.storagePath("framework/requests")],eslint:{enabled:!0,filepath:Kw.storagePath("framework/server-auto-imports.json")}};BG4(UB1(G))}import{ExitCode as VB1}from"@stacksjs/types";function _G6(G){let Y={command:"Automagically build any of your libraries/packages for production use. Select any of the following packages",types:"Generate your TypeScript types",entries:"Generate your function & Component Library Entry Points",webTypes:"Generate web-types.json for IDEs",customData:"Generate VS Code custom data (custom-elements.json) for IDEs",ideHelpers:"Generate IDE helpers",componentMeta:"Generate component meta information",coreSymlink:"Generate symlink of the core framework to the project root",pkgx:"Generate the pkgx configuration file",modelFiles:"Generate the model files",openApi:"Generate the OpenAPI specification",select:"What are you trying to generate?",project:"Target a specific project",verbose:"Enable verbose output"};G.command("generate",Y.command).option("-t, --types",Y.types).option("-e, --entries",Y.entries).option("-w, --web-types",Y.webTypes).option("-c, --custom-data",Y.customData).option("-i, --ide-helpers",Y.ideHelpers).option("-c, --component-meta",Y.componentMeta).option("-p, --pkgx",Y.pkgx).option("-m, --model-files",Y.modelFiles).option("-o, --openapi",Y.openApi).option("-p, --project [project]",Y.project,{default:!1}).option("--core-symlink",Y.coreSymlink).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate` ...",X),await xG4(X),Ur.exit(VB1.Success)}),G.command("generate:types",Y.types).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).alias("types:generate").action(async(X)=>{qG.debug("Running `buddy generate:types` ...",X),await MG4(X)}),G.command("generate:entries",Y.entries).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:entries` ...",X),await hG4(X)}),G.command("generate:web-types",Y.webTypes).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:web-types` ...",X),await yG4(X)}),G.command("generate:vscode-custom-data",Y.customData).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:vscode-custom-data` ...",X),await gG4(X)}),G.command("generate:ide-helpers",Y.ideHelpers).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:ide-helpers` ...",X),await kG4(X)}),G.command("generate:component-meta",Y.componentMeta).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:component-meta` ...",X),await wG4()}),G.command("generate:pkgx-config",Y.pkgx).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action((X)=>{qG.debug("Running `buddy generate:pkgx-config` ...",X),bG4()}),G.command("generate:model-files",Y.modelFiles).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async()=>{let X=await KB1("buddy generate:model-files");try{await $B1(),await zB1(),HB1("Generated Model files",{startTime:X,useSeconds:!0})}catch(W){qG.error("There was an error generating your model files",W),Ur.exit(VB1.FatalError)}}),G.command("generate:openapi-spec",Y.openApi).alias("generate:openapi").option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qG.debug("Running `buddy generate:openapi-spec` ...",X);let W=await KB1("buddy generate:openapi-spec");await vG4(),HB1("Generated OpenAPI specification",{startTime:W,useSeconds:!0})}),G.command("generate:migrations","Generate Migrations").action((X)=>{qG.debug("Running `buddy generate:migrations` ...",X)}),G.command("generate:core-symlink","Generate core symlink. A shortcut for core developers.").action(async(X)=>{qG.debug("Running `buddy core-symlink` ...",X),await DG4()}),G.on("generate:*",()=>{console.error(`Invalid command: %s
5390
5390
  See --help for a list of available commands.`,G.args.join(" ")),Ur.exit(1)})}import mG4 from"node:process";import{log as QB1,runCommandSync as cG4}from"@stacksjs/cli";import{config as uG4}from"@stacksjs/config";import{ExitCode as lG4}from"@stacksjs/types";function DG6(G){let Y={http:"Send an HTTP request to a domain",project:"Target a specific project",verbose:"Enable verbose output"};G.command("http [domain]",Y.http).option("-p, --project [project]",Y.project,{default:!1}).action(async(X,W)=>{QB1.debug("Running `buddy http [domain]` ...",W);let Z=Object.entries(W).filter(([K,J])=>K!=="--"&&K.length>1&&J!==!1).map(([K,J])=>`--${K} ${J}`).join(" "),U=`http GET ${X||uG4.app.url} ${Z}`;QB1.info(`Running command: ${U}`),await cG4(U),mG4.exit(lG4.Success)})}import pG4 from"node:process";import{log as iG4,runCommand as aG4}from"@stacksjs/cli";import{path as rG4}from"@stacksjs/path";function MG6(G){let Y={install:"Install your dependencies",project:"Target a specific project",verbose:"Enable verbose output"};G.command("install",Y.install).option("-p, --project [project]",Y.project,{default:!1}).option("-v, --verbose",Y.verbose,{default:!1}).action(async(X)=>{iG4.debug("Running `buddy install` ...",X),await aG4("bun install",{...X,cwd:rG4.projectPath()})}),G.on("install:*",()=>{console.error(`Invalid command: %s
5391
5391
  See --help for a list of available commands.`,G.args.join(" ")),pG4.exit(1)})}import FB1 from"node:process";import{runAction as dG4}from"@stacksjs/actions";import{intro as sG4,log as qB1,outro as nG4}from"@stacksjs/cli";import{Action as oG4}from"@stacksjs/enums";function uG6(G){let Y={command:"Generate & set the application key.",project:"Target a specific project",verbose:"Enable verbose output"};G.command("key:generate",Y.command).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{qB1.debug("Running `buddy key:generate` ...",X),await sG4("buddy key:generate");let W=await dG4(oG4.KeyGenerate,X);if(W.isErr())qB1.error("Failed to set random application key.",W.error),FB1.exit();await nG4("Random application key set.")}),G.on("key:*",()=>{console.error(`Invalid command: %s
5392
5392
  See --help for a list of available commands.`,G.args.join(" ")),FB1.exit(1)})}import AB1 from"node:process";import{runAction as SB1}from"@stacksjs/actions";import{intro as tG4,log as sN,outro as eG4,runCommand as GY4}from"@stacksjs/cli";import{Action as NB1}from"@stacksjs/enums";import{path as zr}from"@stacksjs/path";function sG6(G){let Y={lint:"Automagically lints your project codebase",lintFix:"Automagically fixes all lint errors",project:"Target a specific project",verbose:"Enable verbose output"};G.command("lint",Y.lint).option("-f, --fix",Y.lintFix,{default:!1}).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{sN.debug("Running `buddy lint` ...",X);let W=await tG4("buddy lint");if(X.fix)await SB1(NB1.LintFix,{cwd:zr.projectPath(),...X});else await GY4("bunx --bun eslint . --config ./config/lint.ts",{cwd:zr.projectPath()});await eG4("Linted your project",{startTime:W,useSeconds:!0})}),G.command("lint:fix",Y.lintFix).option("-p, --project [project]",Y.project,{default:!1}).option("--verbose",Y.verbose,{default:!1}).action(async(X)=>{sN.debug("Running `buddy lint:fix` ...",X),sN.info("Fixing lint errors...");let W=await SB1(NB1.LintFix,{cwd:zr.projectPath(),...X});if(W.isErr())sN.error("There was an error lint fixing your code.",W.error),AB1.exit();sN.success("Fixed lint errors")}),G.on("lint:*",()=>{console.error(`Invalid command: %s