sst 2.0.0-rc.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/bootstrap.d.ts +2 -4
  2. package/bootstrap.js +208 -61
  3. package/bus.d.ts +3 -3
  4. package/bus.js +1 -1
  5. package/cache.js +1 -1
  6. package/cdk/cloudformation-deployments-wrapper.d.ts +3 -0
  7. package/cdk/cloudformation-deployments-wrapper.js +117 -0
  8. package/cdk/cloudformation-deployments.d.ts +19 -4
  9. package/cdk/deploy-stack.d.ts +17 -2
  10. package/cdk/deploy-stack.js +6 -1
  11. package/cli/colors.d.ts +28 -0
  12. package/cli/colors.js +27 -0
  13. package/cli/commands/bind.d.ts +4 -0
  14. package/cli/commands/bind.js +10 -7
  15. package/cli/commands/bootstrap.d.ts +13 -0
  16. package/cli/commands/bootstrap.js +11 -0
  17. package/cli/commands/build.d.ts +6 -2
  18. package/cli/commands/build.js +13 -8
  19. package/cli/commands/console.d.ts +5 -1
  20. package/cli/commands/console.js +8 -6
  21. package/cli/commands/deploy.d.ts +4 -2
  22. package/cli/commands/deploy.js +69 -29
  23. package/cli/commands/dev.d.ts +5 -1
  24. package/cli/commands/dev.js +157 -79
  25. package/cli/commands/diff.d.ts +15 -0
  26. package/cli/commands/diff.js +61 -0
  27. package/cli/commands/env.d.ts +5 -1
  28. package/cli/commands/env.js +14 -15
  29. package/cli/commands/plugins/kysely.js +13 -5
  30. package/cli/commands/plugins/pothos.js +9 -4
  31. package/cli/commands/remove.d.ts +4 -0
  32. package/cli/commands/remove.js +26 -18
  33. package/cli/commands/secrets/get.d.ts +7 -3
  34. package/cli/commands/secrets/get.js +11 -24
  35. package/cli/commands/secrets/list.d.ts +6 -2
  36. package/cli/commands/secrets/list.js +15 -7
  37. package/cli/commands/secrets/remove.d.ts +8 -4
  38. package/cli/commands/secrets/remove.js +18 -16
  39. package/cli/commands/secrets/secrets.js +3 -3
  40. package/cli/commands/secrets/set.d.ts +8 -6
  41. package/cli/commands/secrets/set.js +16 -33
  42. package/cli/commands/telemetry.d.ts +15 -0
  43. package/cli/commands/telemetry.js +17 -0
  44. package/cli/commands/transform.d.ts +15 -0
  45. package/cli/commands/transform.js +55 -0
  46. package/cli/commands/update.d.ts +6 -2
  47. package/cli/commands/update.js +41 -33
  48. package/cli/commands/version.d.ts +13 -0
  49. package/cli/commands/version.js +7 -0
  50. package/cli/local/router.d.ts +6 -6
  51. package/cli/local/router.js +3 -3
  52. package/cli/local/server.d.ts +5 -3
  53. package/cli/local/server.js +21 -14
  54. package/cli/program.d.ts +5 -1
  55. package/cli/program.js +29 -5
  56. package/cli/spinner.js +2 -0
  57. package/cli/sst.js +35 -23
  58. package/cli/telemetry/environment.d.ts +1 -1
  59. package/cli/telemetry/environment.js +1 -1
  60. package/cli/terminal.d.ts +1 -0
  61. package/cli/terminal.js +8 -0
  62. package/cli/ui/deploy.d.ts +3 -2
  63. package/cli/ui/deploy.js +106 -106
  64. package/cli/ui/functions.d.ts +2 -0
  65. package/cli/ui/functions.js +132 -0
  66. package/cli/ui/header.d.ts +5 -0
  67. package/cli/ui/header.js +16 -0
  68. package/cli/ui/stack.d.ts +1 -0
  69. package/cli/ui/stack.js +6 -0
  70. package/config.d.ts +1 -1
  71. package/config.js +8 -8
  72. package/constructs/Api.d.ts +3 -71
  73. package/constructs/Api.js +3 -42
  74. package/constructs/ApiGatewayV1Api.d.ts +3 -3
  75. package/constructs/ApiGatewayV1Api.js +4 -3
  76. package/constructs/App.d.ts +2 -22
  77. package/constructs/App.js +12 -25
  78. package/constructs/AppSyncApi.d.ts +4 -5
  79. package/constructs/AppSyncApi.js +8 -5
  80. package/constructs/AstroSite.d.ts +2 -3
  81. package/constructs/AstroSite.js +43 -53
  82. package/constructs/Auth.js +27 -16
  83. package/constructs/BaseSite.d.ts +10 -10
  84. package/constructs/BaseSite.js +2 -2
  85. package/constructs/Cognito.js +28 -28
  86. package/constructs/EdgeFunction.d.ts +6 -4
  87. package/constructs/EdgeFunction.js +56 -59
  88. package/constructs/EventBus.js +1 -1
  89. package/constructs/Function.d.ts +4 -44
  90. package/constructs/Function.js +14 -50
  91. package/constructs/FunctionalStack.d.ts +2 -2
  92. package/constructs/Job.d.ts +23 -63
  93. package/constructs/Job.js +11 -32
  94. package/constructs/Metadata.d.ts +18 -20
  95. package/constructs/NextjsSite.d.ts +21 -5
  96. package/constructs/NextjsSite.js +67 -101
  97. package/constructs/Queue.js +10 -10
  98. package/constructs/RDS.d.ts +1 -1
  99. package/constructs/RDS.js +1 -1
  100. package/constructs/RemixSite.d.ts +0 -2
  101. package/constructs/RemixSite.js +20 -20
  102. package/constructs/Script.js +1 -1
  103. package/constructs/Secret.js +5 -3
  104. package/constructs/SolidStartSite.d.ts +2 -3
  105. package/constructs/SolidStartSite.js +42 -52
  106. package/constructs/SsrFunction.d.ts +22 -0
  107. package/constructs/SsrFunction.js +113 -0
  108. package/constructs/SsrSite.d.ts +104 -104
  109. package/constructs/SsrSite.js +196 -217
  110. package/constructs/Stack.d.ts +1 -20
  111. package/constructs/Stack.js +3 -65
  112. package/constructs/StaticSite.d.ts +33 -53
  113. package/constructs/StaticSite.js +92 -118
  114. package/constructs/Table.d.ts +1 -1
  115. package/constructs/Table.js +4 -4
  116. package/constructs/Topic.js +1 -1
  117. package/constructs/cdk/certificate-base.d.ts +18 -0
  118. package/constructs/cdk/certificate-base.js +26 -0
  119. package/constructs/cdk/dns-validated-certificate.d.ts +77 -0
  120. package/constructs/cdk/dns-validated-certificate.js +125 -0
  121. package/constructs/cdk/website-redirect.d.ts +53 -0
  122. package/constructs/cdk/website-redirect.js +77 -0
  123. package/constructs/deferred_task.d.ts +1 -1
  124. package/constructs/deprecated/NextjsSite.js +8 -6
  125. package/constructs/index.d.ts +0 -6
  126. package/constructs/index.js +0 -6
  127. package/constructs/util/apiGatewayV1AccessLog.d.ts +1 -1
  128. package/constructs/util/apiGatewayV2AccessLog.js +4 -4
  129. package/constructs/util/apiGatewayV2Domain.js +9 -2
  130. package/constructs/util/appSyncApiDomain.d.ts +1 -1
  131. package/constructs/util/appSyncApiDomain.js +9 -15
  132. package/constructs/util/duration.d.ts +1 -1
  133. package/constructs/util/functionBinding.js +1 -1
  134. package/constructs/util/permission.d.ts +3 -3
  135. package/constructs/util/permission.js +16 -18
  136. package/constructs/util/size.d.ts +1 -1
  137. package/constructs/util/warning.js +2 -2
  138. package/context/context.d.ts +2 -2
  139. package/context/context.js +4 -4
  140. package/context/handler.d.ts +1 -1
  141. package/credentials.d.ts +1 -1
  142. package/credentials.js +42 -6
  143. package/index.d.ts +1 -0
  144. package/index.js +1 -0
  145. package/iot.js +6 -2
  146. package/logger.js +3 -1
  147. package/node/api/index.d.ts +2 -3
  148. package/node/api/index.js +8 -2
  149. package/node/auth/adapter/adapter.d.ts +1 -1
  150. package/node/auth/adapter/facebook.js +1 -1
  151. package/node/auth/adapter/github.js +4 -4
  152. package/node/auth/adapter/google.d.ts +1 -1
  153. package/node/auth/adapter/google.js +2 -2
  154. package/node/auth/adapter/twitch.js +1 -1
  155. package/node/auth/session.d.ts +1 -1
  156. package/node/config/index.d.ts +2 -2
  157. package/node/config/index.js +3 -8
  158. package/node/job/index.d.ts +2 -2
  159. package/node/site/index.js +3 -5
  160. package/package.json +26 -21
  161. package/pothos.js +1 -0
  162. package/project.d.ts +47 -0
  163. package/{app.js → project.js} +60 -53
  164. package/runtime/handlers/dotnet.d.ts +1 -1
  165. package/runtime/handlers/dotnet.js +4 -4
  166. package/runtime/handlers/go.d.ts +1 -1
  167. package/runtime/handlers/go.js +3 -3
  168. package/runtime/handlers/java.d.ts +1 -1
  169. package/runtime/handlers/java.js +4 -4
  170. package/runtime/handlers/node.d.ts +1 -1
  171. package/runtime/handlers/node.js +60 -39
  172. package/runtime/handlers/python.d.ts +1 -1
  173. package/runtime/handlers/python.js +3 -3
  174. package/runtime/handlers.js +15 -12
  175. package/runtime/iot.js +3 -0
  176. package/runtime/runtime.d.ts +4 -0
  177. package/runtime/server.d.ts +3 -3
  178. package/runtime/server.js +11 -5
  179. package/runtime/workers.d.ts +4 -2
  180. package/runtime/workers.js +13 -3
  181. package/site-env.js +2 -1
  182. package/sst.mjs +6357 -20848
  183. package/stacks/app-metadata.d.ts +7 -0
  184. package/stacks/app-metadata.js +78 -0
  185. package/stacks/assembly.d.ts +1 -0
  186. package/stacks/assembly.js +4 -0
  187. package/stacks/build.d.ts +1 -1
  188. package/stacks/build.js +41 -48
  189. package/stacks/deploy.d.ts +1 -0
  190. package/stacks/deploy.js +128 -7
  191. package/stacks/diff.d.ts +8 -0
  192. package/stacks/diff.js +62 -0
  193. package/stacks/index.d.ts +3 -0
  194. package/stacks/index.js +3 -0
  195. package/stacks/metadata.d.ts +2 -0
  196. package/stacks/metadata.js +14 -12
  197. package/stacks/monitor.d.ts +8 -3
  198. package/stacks/monitor.js +38 -4
  199. package/stacks/remove.js +0 -4
  200. package/stacks/synth.d.ts +1 -0
  201. package/stacks/synth.js +27 -13
  202. package/support/base-site-archiver.mjs +1 -1
  203. package/support/bootstrap-metadata-function/index.mjs +68740 -0
  204. package/support/bridge/bridge.mjs +28 -28
  205. package/support/certificate-requestor/index.js +549 -0
  206. package/support/custom-resources/index.mjs +3824 -26567
  207. package/support/dotnet6-bootstrap/release/dotnet-bootstrap.deps.json +1 -1
  208. package/support/dotnet6-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +1 -1
  209. package/support/edge-function/edge-lambda.mjs +2 -2
  210. package/support/job-invoker/index.mjs +26 -0
  211. package/support/nodejs-runtime/index.mjs +75 -72
  212. package/support/rds-migrator/index.mjs +22 -23
  213. package/support/remix-site-function/edge-server.js +1 -1
  214. package/support/script-function/index.mjs +30485 -0
  215. package/support/{edge-function-code-replacer → sls-nextjs-site-function-code-replacer}/lambda-code-updater.py +0 -0
  216. package/support/ssr-site-function-archiver.mjs +96 -0
  217. package/watcher.js +1 -1
  218. package/app.d.ts +0 -36
  219. package/constructs/DebugApp.d.ts +0 -49
  220. package/constructs/DebugApp.js +0 -63
  221. package/constructs/DebugStack.d.ts +0 -34
  222. package/constructs/DebugStack.js +0 -132
  223. package/constructs/GraphQLApi.d.ts +0 -98
  224. package/constructs/GraphQLApi.js +0 -80
  225. package/constructs/ReactStaticSite.d.ts +0 -20
  226. package/constructs/ReactStaticSite.js +0 -54
  227. package/constructs/Script/cfn-response.d.ts +0 -19
  228. package/constructs/Script/cfn-response.js +0 -77
  229. package/constructs/Script/index.d.ts +0 -1
  230. package/constructs/Script/index.js +0 -78
  231. package/constructs/Script/outbound.d.ts +0 -10
  232. package/constructs/Script/outbound.js +0 -42
  233. package/constructs/Script/util.d.ts +0 -2
  234. package/constructs/Script/util.js +0 -11
  235. package/constructs/ViteStaticSite.d.ts +0 -32
  236. package/constructs/ViteStaticSite.js +0 -66
  237. package/support/astro-site-html-stub/index.html +0 -99
  238. package/support/base-site-archiver.cjs +0 -116
  239. package/support/nextjs-site-html-stub/index.html +0 -99
  240. package/support/remix-site-html-stub/index.html +0 -99
  241. package/support/solid-start-site-html-stub/index.html +0 -99
  242. package/support/static-site-stub/index.html +0 -90
@@ -1,31 +1,30 @@
1
- import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);
2
- var Jf=Object.create;var _o=Object.defineProperty;var Qf=Object.getOwnPropertyDescriptor;var Yf=Object.getOwnPropertyNames;var $f=Object.getPrototypeOf,Zf=Object.prototype.hasOwnProperty;var s=(t,e)=>_o(t,"name",{value:e,configurable:!0}),te=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ep=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yf(e))!Zf.call(t,n)&&n!==r&&_o(t,n,{get:()=>e[n],enumerable:!(i=Qf(e,n))||i.enumerable});return t};var tp=(t,e,r)=>(r=t!=null?Jf($f(t)):{},ep(e||!t||!t.__esModule?_o(r,"default",{value:t,enumerable:!0}):r,t));var qs=P((mP,Hu)=>{var Qo=Se();function zu(){}s(zu,"JsonBuilder");zu.prototype.build=function(t,e){return JSON.stringify(_s(t,e))};function _s(t,e){if(!(!e||t===void 0||t===null))switch(e.type){case"structure":return kp(t,e);case"map":return Fp(t,e);case"list":return Lp(t,e);default:return Mp(t,e)}}s(_s,"translate");function kp(t,e){if(e.isDocument)return t;var r={};return Qo.each(t,function(i,n){var o=e.members[i];if(o){if(o.location!=="body")return;var a=o.isLocationName?o.name:i,u=_s(n,o);u!==void 0&&(r[a]=u)}}),r}s(kp,"translateStructure");function Lp(t,e){var r=[];return Qo.arrayEach(t,function(i){var n=_s(i,e.member);n!==void 0&&r.push(n)}),r}s(Lp,"translateList");function Fp(t,e){var r={};return Qo.each(t,function(i,n){var o=_s(n,e.value);o!==void 0&&(r[i]=o)}),r}s(Fp,"translateMap");function Mp(t,e){return e.toWireFormat(t)}s(Mp,"translateScalar");Hu.exports=zu});var Ls=P((vP,Ku)=>{var Yo=Se();function ju(){}s(ju,"JsonParser");ju.prototype.parse=function(t,e){return ks(JSON.parse(t),e)};function ks(t,e){if(!(!e||t===void 0))switch(e.type){case"structure":return Wp(t,e);case"map":return Vp(t,e);case"list":return Bp(t,e);default:return Up(t,e)}}s(ks,"translate");function Wp(t,e){if(t!=null){if(e.isDocument)return t;var r={},i=e.members;return Yo.each(i,function(n,o){var a=o.isLocationName?o.name:n;if(Object.prototype.hasOwnProperty.call(t,a)){var u=t[a],l=ks(u,o);l!==void 0&&(r[n]=l)}}),r}}s(Wp,"translateStructure");function Bp(t,e){if(t!=null){var r=[];return Yo.arrayEach(t,function(i){var n=ks(i,e.member);n===void 0?r.push(null):r.push(n)}),r}}s(Bp,"translateList");function Vp(t,e){if(t!=null){var r={};return Yo.each(t,function(i,n){var o=ks(n,e.value);o===void 0?r[i]=null:r[i]=o}),r}}s(Vp,"translateMap");function Up(t,e){return e.toType(t)}s(Up,"translateScalar");Ku.exports=ju});var Fs=P((NP,Xu)=>{var On=Se(),zp=V();function Hp(t){var e=t.service.config.hostPrefixEnabled;if(!e)return t;var r=t.service.api.operations[t.operation];if(jp(t))return t;if(r.endpoint&&r.endpoint.hostPrefix){var i=r.endpoint.hostPrefix,n=Kp(i,t.params,r.input);Xp(t.httpRequest.endpoint,n),Gp(t.httpRequest.endpoint.hostname)}return t}s(Hp,"populateHostPrefix");function jp(t){var e=t.service.api,r=e.operations[t.operation],i=e.endpointOperation&&e.endpointOperation===On.string.lowerFirst(r.name);return r.endpointDiscoveryRequired!=="NULL"||i===!0}s(jp,"hasEndpointDiscover");function Kp(t,e,r){return On.each(r.members,function(i,n){if(n.hostLabel===!0){if(typeof e[i]!="string"||e[i]==="")throw On.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+i+"\\}","g");t=t.replace(o,e[i])}}),t}s(Kp,"expandHostPrefix");function Xp(t,e){t.host&&(t.host=e+t.host),t.hostname&&(t.hostname=e+t.hostname)}s(Xp,"prependEndpointPrefix");function Gp(t){var e=t.split("."),r=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;On.arrayEach(e,function(i){if(!i.length||i.length<1||i.length>63)throw On.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!r.test(i))throw zp.util.error(new Error,{code:"ValidationError",message:i+" is not hostname compatible."})})}s(Gp,"validateHostname");Xu.exports={populateHostPrefix:Hp}});var Ms=P((xP,Gu)=>{var Jp=Se(),Qp=qs(),Yp=Ls(),$p=Fs().populateHostPrefix;function Zp(t){var e=t.httpRequest,r=t.service.api,i=r.targetPrefix+"."+r.operations[t.operation].name,n=r.jsonVersion||"1.0",o=r.operations[t.operation].input,a=new Qp;n===1&&(n="1.0"),e.body=a.build(t.params||{},o),e.headers["Content-Type"]="application/x-amz-json-"+n,e.headers["X-Amz-Target"]=i,$p(t)}s(Zp,"buildRequest");function em(t){var e={},r=t.httpResponse;if(e.code=r.headers["x-amzn-errortype"]||"UnknownError",typeof e.code=="string"&&(e.code=e.code.split(":")[0]),r.body.length>0)try{var i=JSON.parse(r.body.toString()),n=i.__type||i.code||i.Code;n&&(e.code=n.split("#").pop()),e.code==="RequestEntityTooLarge"?e.message="Request body must be less than 1 MB":e.message=i.message||i.Message||null}catch{e.statusCode=r.statusCode,e.message=r.statusMessage}else e.statusCode=r.statusCode,e.message=r.statusCode.toString();t.error=Jp.error(new Error,e)}s(em,"extractError");function tm(t){var e=t.httpResponse.body.toString()||"{}";if(t.request.service.config.convertResponseTypes===!1)t.data=JSON.parse(e);else{var r=t.request.service.api.operations[t.request.operation],i=r.output||{},n=new Yp;t.data=n.parse(e,i)}}s(tm,"extractData");Gu.exports={buildRequest:Zp,extractError:em,extractData:tm}});var Zu=P((CP,$u)=>{var $o=Se();function Ju(){}s(Ju,"QueryParamSerializer");Ju.prototype.serialize=function(t,e,r){Yu("",t,e,r)};function Qu(t){return t.isQueryName||t.api.protocol!=="ec2"?t.name:t.name[0].toUpperCase()+t.name.substr(1)}s(Qu,"ucfirst");function Yu(t,e,r,i){$o.each(r.members,function(n,o){var a=e[n];if(a!=null){var u=Qu(o);u=t?t+"."+u:u,Ws(u,a,o,i)}})}s(Yu,"serializeStructure");function rm(t,e,r,i){var n=1;$o.each(e,function(o,a){var u=r.flattened?".":".entry.",l=u+n+++".",f=l+(r.key.name||"key"),y=l+(r.value.name||"value");Ws(t+f,o,r.key,i),Ws(t+y,a,r.value,i)})}s(rm,"serializeMap");function im(t,e,r,i){var n=r.member||{};if(e.length===0){i.call(this,t,null);return}$o.arrayEach(e,function(o,a){var u="."+(a+1);if(r.api.protocol==="ec2")u=u+"";else if(r.flattened){if(n.name){var l=t.split(".");l.pop(),l.push(Qu(n)),t=l.join(".")}}else u="."+(n.name?n.name:"member")+u;Ws(t+u,o,n,i)})}s(im,"serializeList");function Ws(t,e,r,i){e!=null&&(r.type==="structure"?Yu(t,e,r,i):r.type==="list"?im(t,e,r,i):r.type==="map"?rm(t,e,r,i):i(t,r.toWireFormat(e).toString()))}s(Ws,"serializeMember");$u.exports=Ju});var Zo=P((TP,ec)=>{var nm=Se().memoizedProperty;function sm(t,e,r,i){nm(this,i(t),function(){return r(t,e)})}s(sm,"memoize");function om(t,e,r,i,n){i=i||String;var o=this;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(sm.call(o,a,t[a],r,i),n&&n(a,t[a]))}s(om,"Collection");ec.exports=om});var Dn=P((AP,uc)=>{var am=Zo(),fr=Se();function H(t,e,r){r!=null&&fr.property.apply(this,arguments)}s(H,"property");function ri(t,e){t.constructor.prototype[e]||fr.memoizedProperty.apply(this,arguments)}s(ri,"memoizedProperty");function fe(t,e,r){e=e||{},H(this,"shape",t.shape),H(this,"api",e.api,!1),H(this,"type",t.type),H(this,"enum",t.enum),H(this,"min",t.min),H(this,"max",t.max),H(this,"pattern",t.pattern),H(this,"location",t.location||this.location||"body"),H(this,"name",this.name||t.xmlName||t.queryName||t.locationName||r),H(this,"isStreaming",t.streaming||this.isStreaming||!1),H(this,"requiresLength",t.requiresLength,!1),H(this,"isComposite",t.isComposite||!1),H(this,"isShape",!0,!1),H(this,"isQueryName",Boolean(t.queryName),!1),H(this,"isLocationName",Boolean(t.locationName),!1),H(this,"isIdempotent",t.idempotencyToken===!0),H(this,"isJsonValue",t.jsonvalue===!0),H(this,"isSensitive",t.sensitive===!0||t.prototype&&t.prototype.sensitive===!0),H(this,"isEventStream",Boolean(t.eventstream),!1),H(this,"isEvent",Boolean(t.event),!1),H(this,"isEventPayload",Boolean(t.eventpayload),!1),H(this,"isEventHeader",Boolean(t.eventheader),!1),H(this,"isTimestampFormatSet",Boolean(t.timestampFormat)||t.prototype&&t.prototype.isTimestampFormatSet===!0,!1),H(this,"endpointDiscoveryId",Boolean(t.endpointdiscoveryid),!1),H(this,"hostLabel",Boolean(t.hostLabel),!1),e.documentation&&(H(this,"documentation",t.documentation),H(this,"documentationUrl",t.documentationUrl)),t.xmlAttribute&&H(this,"isXmlAttribute",t.xmlAttribute||!1),H(this,"defaultValue",null),this.toWireFormat=function(i){return i??""},this.toType=function(i){return i}}s(fe,"Shape");fe.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"};fe.types={structure:tc,list:rc,map:ic,boolean:ac,timestamp:um,float:cm,integer:lm,string:nc,base64:oc,binary:sc};fe.resolve=s(function(e,r){if(e.shape){var i=r.api.shapes[e.shape];if(!i)throw new Error("Cannot find shape reference: "+e.shape);return i}else return null},"resolve");fe.create=s(function(e,r,i){if(e.isShape)return e;var n=fe.resolve(e,r);if(n){var o=Object.keys(e);r.documentation||(o=o.filter(function(l){return!l.match(/documentation/)}));var a=s(function(){n.constructor.call(this,e,r,i)},"InlineShape");return a.prototype=n,new a}else{e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var u=e.type;if(fe.normalizedTypes[e.type]&&(e.type=fe.normalizedTypes[e.type]),fe.types[e.type])return new fe.types[e.type](e,r,i);throw new Error("Unrecognized shape type: "+u)}},"create");function ea(t){fe.apply(this,arguments),H(this,"isComposite",!0),t.flattened&&H(this,"flattened",t.flattened||!1)}s(ea,"CompositeShape");function tc(t,e){var r=this,i=null,n=!this.isShape;ea.apply(this,arguments),n&&(H(this,"defaultValue",function(){return{}}),H(this,"members",{}),H(this,"memberNames",[]),H(this,"required",[]),H(this,"isRequired",function(){return!1}),H(this,"isDocument",Boolean(t.document))),t.members&&(H(this,"members",new am(t.members,e,function(o,a){return fe.create(a,e,o)})),ri(this,"memberNames",function(){return t.xmlOrder||Object.keys(t.members)}),t.event&&(ri(this,"eventPayloadMemberName",function(){for(var o=r.members,a=r.memberNames,u=0,l=a.length;u<l;u++)if(o[a[u]].isEventPayload)return a[u]}),ri(this,"eventHeaderMemberNames",function(){for(var o=r.members,a=r.memberNames,u=[],l=0,f=a.length;l<f;l++)o[a[l]].isEventHeader&&u.push(a[l]);return u}))),t.required&&(H(this,"required",t.required),H(this,"isRequired",function(o){if(!i){i={};for(var a=0;a<t.required.length;a++)i[t.required[a]]=!0}return i[o]},!1,!0)),H(this,"resultWrapper",t.resultWrapper||null),t.payload&&H(this,"payload",t.payload),typeof t.xmlNamespace=="string"?H(this,"xmlNamespaceUri",t.xmlNamespace):typeof t.xmlNamespace=="object"&&(H(this,"xmlNamespacePrefix",t.xmlNamespace.prefix),H(this,"xmlNamespaceUri",t.xmlNamespace.uri))}s(tc,"StructureShape");function rc(t,e){var r=this,i=!this.isShape;if(ea.apply(this,arguments),i&&H(this,"defaultValue",function(){return[]}),t.member&&ri(this,"member",function(){return fe.create(t.member,e)}),this.flattened){var n=this.name;ri(this,"name",function(){return r.member.name||n})}}s(rc,"ListShape");function ic(t,e){var r=!this.isShape;ea.apply(this,arguments),r&&(H(this,"defaultValue",function(){return{}}),H(this,"key",fe.create({type:"string"},e)),H(this,"value",fe.create({type:"string"},e))),t.key&&ri(this,"key",function(){return fe.create(t.key,e)}),t.value&&ri(this,"value",function(){return fe.create(t.value,e)})}s(ic,"MapShape");function um(t){var e=this;if(fe.apply(this,arguments),t.timestampFormat)H(this,"timestampFormat",t.timestampFormat);else if(e.isTimestampFormatSet&&this.timestampFormat)H(this,"timestampFormat",this.timestampFormat);else if(this.location==="header")H(this,"timestampFormat","rfc822");else if(this.location==="querystring")H(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":H(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":H(this,"timestampFormat","iso8601");break}this.toType=function(r){return r==null?null:typeof r.toUTCString=="function"?r:typeof r=="string"||typeof r=="number"?fr.date.parseTimestamp(r):null},this.toWireFormat=function(r){return fr.date.format(r,e.timestampFormat)}}s(um,"TimestampShape");function nc(){fe.apply(this,arguments);var t=["rest-xml","query","ec2"];this.toType=function(e){return e=this.api&&t.indexOf(this.api.protocol)>-1?e||"":e,this.isJsonValue?JSON.parse(e):e&&typeof e.toString=="function"?e.toString():e},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}s(nc,"StringShape");function cm(){fe.apply(this,arguments),this.toType=function(t){return t==null?null:parseFloat(t)},this.toWireFormat=this.toType}s(cm,"FloatShape");function lm(){fe.apply(this,arguments),this.toType=function(t){return t==null?null:parseInt(t,10)},this.toWireFormat=this.toType}s(lm,"IntegerShape");function sc(){fe.apply(this,arguments),this.toType=function(t){var e=fr.base64.decode(t);if(this.isSensitive&&fr.isNode()&&typeof fr.Buffer.alloc=="function"){var r=fr.Buffer.alloc(e.length,e);e.fill(0),e=r}return e},this.toWireFormat=fr.base64.encode}s(sc,"BinaryShape");function oc(){sc.apply(this,arguments)}s(oc,"Base64Shape");function ac(){fe.apply(this,arguments),this.toType=function(t){return typeof t=="boolean"?t:t==null?null:t==="true"}}s(ac,"BooleanShape");fe.shapes={StructureShape:tc,ListShape:rc,MapShape:ic,StringShape:nc,BooleanShape:ac,Base64Shape:oc};uc.exports=fe});var ta=P((RP,dc)=>{var lc=V(),Pn=Se(),dm=Zu(),cc=Dn(),hm=Fs().populateHostPrefix;function fm(t){var e=t.service.api.operations[t.operation],r=t.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:t.service.api.apiVersion,Action:e.name};var i=new dm;i.serialize(t.params,e.input,function(n,o){r.params[n]=o}),r.body=Pn.queryParamsToString(r.params),hm(t)}s(fm,"buildRequest");function pm(t){var e,r=t.httpResponse.body.toString();if(r.match("<UnknownOperationException"))e={Code:"UnknownOperation",Message:"Unknown operation "+t.request.operation};else try{e=new lc.XML.Parser().parse(r)}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.requestId&&!t.requestId&&(t.requestId=e.requestId),e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=Pn.error(new Error,{code:e.Code,message:e.Message}):t.error=Pn.error(new Error,{code:t.httpResponse.statusCode,message:null})}s(pm,"extractError");function mm(t){var e=t.request,r=e.service.api.operations[e.operation],i=r.output||{},n=i;if(n.resultWrapper){var o=cc.create({type:"structure"});o.members[n.resultWrapper]=i,o.memberNames=[n.resultWrapper],Pn.property(i,"name",i.resultWrapper),i=o}var a=new lc.XML.Parser;if(i&&i.members&&!i.members._XAMZRequestId){var u=cc.create({type:"string"},{api:{protocol:"query"}},"requestId");i.members._XAMZRequestId=u}var l=a.parse(t.httpResponse.body.toString(),i);t.requestId=l._XAMZRequestId||l.requestId,l._XAMZRequestId&&delete l._XAMZRequestId,n.resultWrapper&&l[n.resultWrapper]&&(Pn.update(l,l[n.resultWrapper]),delete l[n.resultWrapper]),t.data=l}s(mm,"extractData");dc.exports={buildRequest:fm,extractError:pm,extractData:mm}});var _n=P((DP,fc)=>{var ze=Se(),ym=Fs().populateHostPrefix;function vm(t){t.httpRequest.method=t.service.api.operations[t.operation].httpMethod}s(vm,"populateMethod");function hc(t,e,r,i){var n=[t,e].join("/");n=n.replace(/\/+/g,"/");var o={},a=!1;if(ze.each(r.members,function(l,f){var y=i[l];if(y!=null)if(f.location==="uri"){var v=new RegExp("\\{"+f.name+"(\\+)?\\}");n=n.replace(v,function(S,I){var x=I?ze.uriEscapePath:ze.uriEscape;return x(String(y))})}else f.location==="querystring"&&(a=!0,f.type==="list"?o[f.name]=y.map(function(S){return ze.uriEscape(f.member.toWireFormat(S).toString())}):f.type==="map"?ze.each(y,function(S,I){Array.isArray(I)?o[S]=I.map(function(x){return ze.uriEscape(String(x))}):o[S]=ze.uriEscape(String(I))}):o[f.name]=ze.uriEscape(f.toWireFormat(y).toString()))}),a){n+=n.indexOf("?")>=0?"&":"?";var u=[];ze.arrayEach(Object.keys(o).sort(),function(l){Array.isArray(o[l])||(o[l]=[o[l]]);for(var f=0;f<o[l].length;f++)u.push(ze.uriEscape(String(l))+"="+o[l][f])}),n+=u.join("&")}return n}s(hc,"generateURI");function gm(t){var e=t.service.api.operations[t.operation],r=e.input,i=hc(t.httpRequest.endpoint.path,e.httpPath,r,t.params);t.httpRequest.path=i}s(gm,"populateURI");function Nm(t){var e=t.service.api.operations[t.operation];ze.each(e.input.members,function(r,i){var n=t.params[r];n!=null&&(i.location==="headers"&&i.type==="map"?ze.each(n,function(o,a){t.httpRequest.headers[i.name+o]=a}):i.location==="header"&&(n=i.toWireFormat(n).toString(),i.isJsonValue&&(n=ze.base64.encode(n)),t.httpRequest.headers[i.name]=n))})}s(Nm,"populateHeaders");function wm(t){vm(t),gm(t),Nm(t),ym(t)}s(wm,"buildRequest");function xm(){}s(xm,"extractError");function Em(t){var e=t.request,r={},i=t.httpResponse,n=e.service.api.operations[e.operation],o=n.output,a={};ze.each(i.headers,function(u,l){a[u.toLowerCase()]=l}),ze.each(o.members,function(u,l){var f=(l.name||u).toLowerCase();if(l.location==="headers"&&l.type==="map"){r[u]={};var y=l.isLocationName?l.name:"",v=new RegExp("^"+y+"(.+)","i");ze.each(i.headers,function(I,x){var w=I.match(v);w!==null&&(r[u][w[1]]=x)})}else if(l.location==="header"){if(a[f]!==void 0){var S=l.isJsonValue?ze.base64.decode(a[f]):a[f];r[u]=l.toType(S)}}else l.location==="statusCode"&&(r[u]=parseInt(i.statusCode,10))}),t.data=r}s(Em,"extractData");fc.exports={buildRequest:wm,extractError:xm,extractData:Em,generateURI:hc}});var na=P((_P,gc)=>{var ia=Se(),mc=_n(),yc=Ms(),Cm=qs(),pc=Ls(),vc=["GET","HEAD","DELETE"];function Sm(t){var e=ia.getRequestPayloadShape(t);e===void 0&&vc.indexOf(t.httpRequest.method)>=0&&delete t.httpRequest.headers["Content-Length"]}s(Sm,"unsetContentLength");function Tm(t){var e=new Cm,r=t.service.api.operations[t.operation].input;if(r.payload){var i={},n=r.members[r.payload];i=t.params[r.payload],n.type==="structure"?(t.httpRequest.body=e.build(i||{},n),ra(t)):i!==void 0&&(t.httpRequest.body=i,(n.type==="binary"||n.isStreaming)&&ra(t,!0))}else t.httpRequest.body=e.build(t.params,r),ra(t)}s(Tm,"populateBody");function ra(t,e){if(!t.httpRequest.headers["Content-Type"]){var r=e?"binary/octet-stream":"application/json";t.httpRequest.headers["Content-Type"]=r}}s(ra,"applyContentTypeHeader");function bm(t){mc.buildRequest(t),vc.indexOf(t.httpRequest.method)<0&&Tm(t)}s(bm,"buildRequest");function Am(t){yc.extractError(t)}s(Am,"extractError");function Im(t){mc.extractData(t);var e=t.request,r=e.service.api.operations[e.operation],i=e.service.api.operations[e.operation].output||{},n,o=r.hasEventOutput;if(i.payload){var a=i.members[i.payload],u=t.httpResponse.body;if(a.isEventStream)n=new pc,t.data[payload]=ia.createEventStream(AWS.HttpClient.streamsApiVersion===2?t.httpResponse.stream:u,n,a);else if(a.type==="structure"||a.type==="list"){var n=new pc;t.data[i.payload]=n.parse(u,a)}else a.type==="binary"||a.isStreaming?t.data[i.payload]=u:t.data[i.payload]=a.toType(u)}else{var l=t.data;yc.extractData(t),t.data=ia.merge(l,t.data)}}s(Im,"extractData");gc.exports={buildRequest:bm,extractError:Am,extractData:Im,unsetContentLength:Sm}});var oa=P((kP,Nc)=>{var qi=V(),qn=Se(),sa=_n();function Rm(t){var e=t.service.api.operations[t.operation].input,r=new qi.XML.Builder,i=t.params,n=e.payload;if(n){var o=e.members[n];if(i=i[n],i===void 0)return;if(o.type==="structure"){var a=o.name;t.httpRequest.body=r.toXML(i,o,a,!0)}else t.httpRequest.body=i}else t.httpRequest.body=r.toXML(i,e,e.name||e.shape||qn.string.upperFirst(t.operation)+"Request")}s(Rm,"populateBody");function Om(t){sa.buildRequest(t),["GET","HEAD"].indexOf(t.httpRequest.method)<0&&Rm(t)}s(Om,"buildRequest");function Dm(t){sa.extractError(t);var e;try{e=new qi.XML.Parser().parse(t.httpResponse.body.toString())}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=qn.error(new Error,{code:e.Code,message:e.Message}):t.error=qn.error(new Error,{code:t.httpResponse.statusCode,message:null})}s(Dm,"extractError");function Pm(t){sa.extractData(t);var e,r=t.request,i=t.httpResponse.body,n=r.service.api.operations[r.operation],o=n.output,a=n.hasEventOutput,u=o.payload;if(u){var l=o.members[u];l.isEventStream?(e=new qi.XML.Parser,t.data[u]=qn.createEventStream(qi.HttpClient.streamsApiVersion===2?t.httpResponse.stream:t.httpResponse.body,e,l)):l.type==="structure"?(e=new qi.XML.Parser,t.data[u]=e.parse(i.toString(),l)):l.type==="binary"||l.isStreaming?t.data[u]=i:t.data[u]=l.toType(i)}else if(i.length>0){e=new qi.XML.Parser;var f=e.parse(i.toString(),o);qn.update(t.data,f)}}s(Pm,"extractData");Nc.exports={buildRequest:Om,extractError:Dm,extractData:Pm}});var xc=P((FP,wc)=>{function _m(t){return t.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}s(_m,"escapeAttribute");wc.exports={escapeAttribute:_m}});var Cc=P((WP,Ec)=>{var qm=xc().escapeAttribute;function kn(t,e){e===void 0&&(e=[]),this.name=t,this.children=e,this.attributes={}}s(kn,"XmlNode");kn.prototype.addAttribute=function(t,e){return this.attributes[t]=e,this};kn.prototype.addChildNode=function(t){return this.children.push(t),this};kn.prototype.removeAttribute=function(t){return delete this.attributes[t],this};kn.prototype.toString=function(){for(var t=Boolean(this.children.length),e="<"+this.name,r=this.attributes,i=0,n=Object.keys(r);i<n.length;i++){var o=n[i],a=r[o];typeof a<"u"&&a!==null&&(e+=" "+o+'="'+qm(""+a)+'"')}return e+=t?">"+this.children.map(function(u){return u.toString()}).join("")+"</"+this.name+">":"/>"};Ec.exports={XmlNode:kn}});var Tc=P((VP,Sc)=>{function km(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}s(km,"escapeElement");Sc.exports={escapeElement:km}});var Ic=P((zP,Ac)=>{var Lm=Tc().escapeElement;function bc(t){this.value=t}s(bc,"XmlText");bc.prototype.toString=function(){return Lm(""+this.value)};Ac.exports={XmlText:bc}});var Pc=P((jP,Dc)=>{var Bs=Se(),ii=Cc().XmlNode,Fm=Ic().XmlText;function Rc(){}s(Rc,"XmlBuilder");Rc.prototype.toXML=function(t,e,r,i){var n=new ii(r);return Oc(n,e,!0),ni(n,t,e),n.children.length>0||i?n.toString():""};function ni(t,e,r){switch(r.type){case"structure":return Mm(t,e,r);case"map":return Wm(t,e,r);case"list":return Bm(t,e,r);default:return Vm(t,e,r)}}s(ni,"serialize");function Mm(t,e,r){Bs.arrayEach(r.memberNames,function(i){var n=r.members[i];if(n.location==="body"){var o=e[i],a=n.name;if(o!=null)if(n.isXmlAttribute)t.addAttribute(a,o);else if(n.flattened)ni(t,o,n);else{var u=new ii(a);t.addChildNode(u),Oc(u,n),ni(u,o,n)}}})}s(Mm,"serializeStructure");function Wm(t,e,r){var i=r.key.name||"key",n=r.value.name||"value";Bs.each(e,function(o,a){var u=new ii(r.flattened?r.name:"entry");t.addChildNode(u);var l=new ii(i),f=new ii(n);u.addChildNode(l),u.addChildNode(f),ni(l,o,r.key),ni(f,a,r.value)})}s(Wm,"serializeMap");function Bm(t,e,r){r.flattened?Bs.arrayEach(e,function(i){var n=r.member.name||r.name,o=new ii(n);t.addChildNode(o),ni(o,i,r.member)}):Bs.arrayEach(e,function(i){var n=r.member.name||"member",o=new ii(n);t.addChildNode(o),ni(o,i,r.member)})}s(Bm,"serializeList");function Vm(t,e,r){t.addChildNode(new Fm(r.toWireFormat(e)))}s(Vm,"serializeScalar");function Oc(t,e,r){var i,n="xmlns";e.xmlNamespaceUri?(i=e.xmlNamespaceUri,e.xmlNamespacePrefix&&(n+=":"+e.xmlNamespacePrefix)):r&&e.api.xmlNamespaceUri&&(i=e.api.xmlNamespaceUri),i&&t.addAttribute(n,i)}s(Oc,"applyNamespaces");Dc.exports=Rc});var aa=P((XP,qc)=>{var Ln=Dn(),_c=Se(),Gt=_c.property,ki=_c.memoizedProperty;function Um(t,e,r){var i=this;r=r||{},Gt(this,"name",e.name||t),Gt(this,"api",r.api,!1),e.http=e.http||{},Gt(this,"endpoint",e.endpoint),Gt(this,"httpMethod",e.http.method||"POST"),Gt(this,"httpPath",e.http.requestUri||"/"),Gt(this,"authtype",e.authtype||""),Gt(this,"endpointDiscoveryRequired",e.endpointdiscovery?e.endpointdiscovery.required?"REQUIRED":"OPTIONAL":"NULL");var n=e.httpChecksumRequired||e.httpChecksum&&e.httpChecksum.requestChecksumRequired;Gt(this,"httpChecksumRequired",n,!1),ki(this,"input",function(){return e.input?Ln.create(e.input,r):new Ln.create({type:"structure"},r)}),ki(this,"output",function(){return e.output?Ln.create(e.output,r):new Ln.create({type:"structure"},r)}),ki(this,"errors",function(){var o=[];if(!e.errors)return null;for(var a=0;a<e.errors.length;a++)o.push(Ln.create(e.errors[a],r));return o}),ki(this,"paginator",function(){return r.api.paginators[t]}),r.documentation&&(Gt(this,"documentation",e.documentation),Gt(this,"documentationUrl",e.documentationUrl)),ki(this,"idempotentMembers",function(){var o=[],a=i.input,u=a.members;if(!a.members)return o;for(var l in u)u.hasOwnProperty(l)&&u[l].isIdempotent===!0&&o.push(l);return o}),ki(this,"hasEventOutput",function(){var o=i.output;return zm(o)})}s(Um,"Operation");function zm(t){var e=t.members,r=t.payload;if(!t.members)return!1;if(r){var i=e[r];return i.isEventStream}for(var n in e)if(!e.hasOwnProperty(n)&&e[n].isEventStream===!0)return!0;return!1}s(zm,"hasEventStream");qc.exports=Um});var ua=P((JP,kc)=>{var Fn=Se().property;function Hm(t,e){Fn(this,"inputToken",e.input_token),Fn(this,"limitKey",e.limit_key),Fn(this,"moreResults",e.more_results),Fn(this,"outputToken",e.output_token),Fn(this,"resultKey",e.result_key)}s(Hm,"Paginator");kc.exports=Hm});var ca=P((YP,Fc)=>{var Lc=Se(),Vs=Lc.property;function jm(t,e,r){r=r||{},Vs(this,"name",t),Vs(this,"api",r.api,!1),e.operation&&Vs(this,"operation",Lc.string.lowerFirst(e.operation));var i=this,n=["type","description","delay","maxAttempts","acceptors"];n.forEach(function(o){var a=e[o];a&&Vs(i,o,a)})}s(jm,"ResourceWaiter");Fc.exports=jm});var la=P((ZP,Km)=>{Km.exports={acm:{name:"ACM",cors:!0},apigateway:{name:"APIGateway",cors:!0},applicationautoscaling:{prefix:"application-autoscaling",name:"ApplicationAutoScaling",cors:!0},appstream:{name:"AppStream"},autoscaling:{name:"AutoScaling",cors:!0},batch:{name:"Batch"},budgets:{name:"Budgets"},clouddirectory:{name:"CloudDirectory",versions:["2016-05-10*"]},cloudformation:{name:"CloudFormation",cors:!0},cloudfront:{name:"CloudFront",versions:["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*","2019-03-26*"],cors:!0},cloudhsm:{name:"CloudHSM",cors:!0},cloudsearch:{name:"CloudSearch"},cloudsearchdomain:{name:"CloudSearchDomain"},cloudtrail:{name:"CloudTrail",cors:!0},cloudwatch:{prefix:"monitoring",name:"CloudWatch",cors:!0},cloudwatchevents:{prefix:"events",name:"CloudWatchEvents",versions:["2014-02-03*"],cors:!0},cloudwatchlogs:{prefix:"logs",name:"CloudWatchLogs",cors:!0},codebuild:{name:"CodeBuild",cors:!0},codecommit:{name:"CodeCommit",cors:!0},codedeploy:{name:"CodeDeploy",cors:!0},codepipeline:{name:"CodePipeline",cors:!0},cognitoidentity:{prefix:"cognito-identity",name:"CognitoIdentity",cors:!0},cognitoidentityserviceprovider:{prefix:"cognito-idp",name:"CognitoIdentityServiceProvider",cors:!0},cognitosync:{prefix:"cognito-sync",name:"CognitoSync",cors:!0},configservice:{prefix:"config",name:"ConfigService",cors:!0},cur:{name:"CUR",cors:!0},datapipeline:{name:"DataPipeline"},devicefarm:{name:"DeviceFarm",cors:!0},directconnect:{name:"DirectConnect",cors:!0},directoryservice:{prefix:"ds",name:"DirectoryService"},discovery:{name:"Discovery"},dms:{name:"DMS"},dynamodb:{name:"DynamoDB",cors:!0},dynamodbstreams:{prefix:"streams.dynamodb",name:"DynamoDBStreams",cors:!0},ec2:{name:"EC2",versions:["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],cors:!0},ecr:{name:"ECR",cors:!0},ecs:{name:"ECS",cors:!0},efs:{prefix:"elasticfilesystem",name:"EFS",cors:!0},elasticache:{name:"ElastiCache",versions:["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],cors:!0},elasticbeanstalk:{name:"ElasticBeanstalk",cors:!0},elb:{prefix:"elasticloadbalancing",name:"ELB",cors:!0},elbv2:{prefix:"elasticloadbalancingv2",name:"ELBv2",cors:!0},emr:{prefix:"elasticmapreduce",name:"EMR",cors:!0},es:{name:"ES"},elastictranscoder:{name:"ElasticTranscoder",cors:!0},firehose:{name:"Firehose",cors:!0},gamelift:{name:"GameLift",cors:!0},glacier:{name:"Glacier"},health:{name:"Health"},iam:{name:"IAM",cors:!0},importexport:{name:"ImportExport"},inspector:{name:"Inspector",versions:["2015-08-18*"],cors:!0},iot:{name:"Iot",cors:!0},iotdata:{prefix:"iot-data",name:"IotData",cors:!0},kinesis:{name:"Kinesis",cors:!0},kinesisanalytics:{name:"KinesisAnalytics"},kms:{name:"KMS",cors:!0},lambda:{name:"Lambda",cors:!0},lexruntime:{prefix:"runtime.lex",name:"LexRuntime",cors:!0},lightsail:{name:"Lightsail"},machinelearning:{name:"MachineLearning",cors:!0},marketplacecommerceanalytics:{name:"MarketplaceCommerceAnalytics",cors:!0},marketplacemetering:{prefix:"meteringmarketplace",name:"MarketplaceMetering"},mturk:{prefix:"mturk-requester",name:"MTurk",cors:!0},mobileanalytics:{name:"MobileAnalytics",cors:!0},opsworks:{name:"OpsWorks",cors:!0},opsworkscm:{name:"OpsWorksCM"},organizations:{name:"Organizations"},pinpoint:{name:"Pinpoint"},polly:{name:"Polly",cors:!0},rds:{name:"RDS",versions:["2014-09-01*"],cors:!0},redshift:{name:"Redshift",cors:!0},rekognition:{name:"Rekognition",cors:!0},resourcegroupstaggingapi:{name:"ResourceGroupsTaggingAPI"},route53:{name:"Route53",cors:!0},route53domains:{name:"Route53Domains",cors:!0},s3:{name:"S3",dualstackAvailable:!0,cors:!0},s3control:{name:"S3Control",dualstackAvailable:!0,xmlNoDefaultLists:!0},servicecatalog:{name:"ServiceCatalog",cors:!0},ses:{prefix:"email",name:"SES",cors:!0},shield:{name:"Shield"},simpledb:{prefix:"sdb",name:"SimpleDB"},sms:{name:"SMS"},snowball:{name:"Snowball"},sns:{name:"SNS",cors:!0},sqs:{name:"SQS",cors:!0},ssm:{name:"SSM",cors:!0},storagegateway:{name:"StorageGateway",cors:!0},stepfunctions:{prefix:"states",name:"StepFunctions"},sts:{name:"STS",cors:!0},support:{name:"Support"},swf:{name:"SWF"},xray:{name:"XRay",cors:!0},waf:{name:"WAF",cors:!0},wafregional:{prefix:"waf-regional",name:"WAFRegional"},workdocs:{name:"WorkDocs",cors:!0},workspaces:{name:"WorkSpaces"},codestar:{name:"CodeStar"},lexmodelbuildingservice:{prefix:"lex-models",name:"LexModelBuildingService",cors:!0},marketplaceentitlementservice:{prefix:"entitlement.marketplace",name:"MarketplaceEntitlementService"},athena:{name:"Athena",cors:!0},greengrass:{name:"Greengrass"},dax:{name:"DAX"},migrationhub:{prefix:"AWSMigrationHub",name:"MigrationHub"},cloudhsmv2:{name:"CloudHSMV2",cors:!0},glue:{name:"Glue"},mobile:{name:"Mobile"},pricing:{name:"Pricing",cors:!0},costexplorer:{prefix:"ce",name:"CostExplorer",cors:!0},mediaconvert:{name:"MediaConvert"},medialive:{name:"MediaLive"},mediapackage:{name:"MediaPackage"},mediastore:{name:"MediaStore"},mediastoredata:{prefix:"mediastore-data",name:"MediaStoreData",cors:!0},appsync:{name:"AppSync"},guardduty:{name:"GuardDuty"},mq:{name:"MQ"},comprehend:{name:"Comprehend",cors:!0},iotjobsdataplane:{prefix:"iot-jobs-data",name:"IoTJobsDataPlane"},kinesisvideoarchivedmedia:{prefix:"kinesis-video-archived-media",name:"KinesisVideoArchivedMedia",cors:!0},kinesisvideomedia:{prefix:"kinesis-video-media",name:"KinesisVideoMedia",cors:!0},kinesisvideo:{name:"KinesisVideo",cors:!0},sagemakerruntime:{prefix:"runtime.sagemaker",name:"SageMakerRuntime"},sagemaker:{name:"SageMaker"},translate:{name:"Translate",cors:!0},resourcegroups:{prefix:"resource-groups",name:"ResourceGroups",cors:!0},alexaforbusiness:{name:"AlexaForBusiness"},cloud9:{name:"Cloud9"},serverlessapplicationrepository:{prefix:"serverlessrepo",name:"ServerlessApplicationRepository"},servicediscovery:{name:"ServiceDiscovery"},workmail:{name:"WorkMail"},autoscalingplans:{prefix:"autoscaling-plans",name:"AutoScalingPlans"},transcribeservice:{prefix:"transcribe",name:"TranscribeService"},connect:{name:"Connect",cors:!0},acmpca:{prefix:"acm-pca",name:"ACMPCA"},fms:{name:"FMS"},secretsmanager:{name:"SecretsManager",cors:!0},iotanalytics:{name:"IoTAnalytics",cors:!0},iot1clickdevicesservice:{prefix:"iot1click-devices",name:"IoT1ClickDevicesService"},iot1clickprojects:{prefix:"iot1click-projects",name:"IoT1ClickProjects"},pi:{name:"PI"},neptune:{name:"Neptune"},mediatailor:{name:"MediaTailor"},eks:{name:"EKS"},macie:{name:"Macie"},dlm:{name:"DLM"},signer:{name:"Signer"},chime:{name:"Chime"},pinpointemail:{prefix:"pinpoint-email",name:"PinpointEmail"},ram:{name:"RAM"},route53resolver:{name:"Route53Resolver"},pinpointsmsvoice:{prefix:"sms-voice",name:"PinpointSMSVoice"},quicksight:{name:"QuickSight"},rdsdataservice:{prefix:"rds-data",name:"RDSDataService"},amplify:{name:"Amplify"},datasync:{name:"DataSync"},robomaker:{name:"RoboMaker"},transfer:{name:"Transfer"},globalaccelerator:{name:"GlobalAccelerator"},comprehendmedical:{name:"ComprehendMedical",cors:!0},kinesisanalyticsv2:{name:"KinesisAnalyticsV2"},mediaconnect:{name:"MediaConnect"},fsx:{name:"FSx"},securityhub:{name:"SecurityHub"},appmesh:{name:"AppMesh",versions:["2018-10-01*"]},licensemanager:{prefix:"license-manager",name:"LicenseManager"},kafka:{name:"Kafka"},apigatewaymanagementapi:{name:"ApiGatewayManagementApi"},apigatewayv2:{name:"ApiGatewayV2"},docdb:{name:"DocDB"},backup:{name:"Backup"},worklink:{name:"WorkLink"},textract:{name:"Textract"},managedblockchain:{name:"ManagedBlockchain"},mediapackagevod:{prefix:"mediapackage-vod",name:"MediaPackageVod"},groundstation:{name:"GroundStation"},iotthingsgraph:{name:"IoTThingsGraph"},iotevents:{name:"IoTEvents"},ioteventsdata:{prefix:"iotevents-data",name:"IoTEventsData"},personalize:{name:"Personalize",cors:!0},personalizeevents:{prefix:"personalize-events",name:"PersonalizeEvents",cors:!0},personalizeruntime:{prefix:"personalize-runtime",name:"PersonalizeRuntime",cors:!0},applicationinsights:{prefix:"application-insights",name:"ApplicationInsights"},servicequotas:{prefix:"service-quotas",name:"ServiceQuotas"},ec2instanceconnect:{prefix:"ec2-instance-connect",name:"EC2InstanceConnect"},eventbridge:{name:"EventBridge"},lakeformation:{name:"LakeFormation"},forecastservice:{prefix:"forecast",name:"ForecastService",cors:!0},forecastqueryservice:{prefix:"forecastquery",name:"ForecastQueryService",cors:!0},qldb:{name:"QLDB"},qldbsession:{prefix:"qldb-session",name:"QLDBSession"},workmailmessageflow:{name:"WorkMailMessageFlow"},codestarnotifications:{prefix:"codestar-notifications",name:"CodeStarNotifications"},savingsplans:{name:"SavingsPlans"},sso:{name:"SSO"},ssooidc:{prefix:"sso-oidc",name:"SSOOIDC"},marketplacecatalog:{prefix:"marketplace-catalog",name:"MarketplaceCatalog",cors:!0},dataexchange:{name:"DataExchange"},sesv2:{name:"SESV2"},migrationhubconfig:{prefix:"migrationhub-config",name:"MigrationHubConfig"},connectparticipant:{name:"ConnectParticipant"},appconfig:{name:"AppConfig"},iotsecuretunneling:{name:"IoTSecureTunneling"},wafv2:{name:"WAFV2"},elasticinference:{prefix:"elastic-inference",name:"ElasticInference"},imagebuilder:{name:"Imagebuilder"},schemas:{name:"Schemas"},accessanalyzer:{name:"AccessAnalyzer"},codegurureviewer:{prefix:"codeguru-reviewer",name:"CodeGuruReviewer"},codeguruprofiler:{name:"CodeGuruProfiler"},computeoptimizer:{prefix:"compute-optimizer",name:"ComputeOptimizer"},frauddetector:{name:"FraudDetector"},kendra:{name:"Kendra"},networkmanager:{name:"NetworkManager"},outposts:{name:"Outposts"},augmentedairuntime:{prefix:"sagemaker-a2i-runtime",name:"AugmentedAIRuntime"},ebs:{name:"EBS"},kinesisvideosignalingchannels:{prefix:"kinesis-video-signaling",name:"KinesisVideoSignalingChannels",cors:!0},detective:{name:"Detective"},codestarconnections:{prefix:"codestar-connections",name:"CodeStarconnections"},synthetics:{name:"Synthetics"},iotsitewise:{name:"IoTSiteWise"},macie2:{name:"Macie2"},codeartifact:{name:"CodeArtifact"},honeycode:{name:"Honeycode"},ivs:{name:"IVS"},braket:{name:"Braket"},identitystore:{name:"IdentityStore"},appflow:{name:"Appflow"},redshiftdata:{prefix:"redshift-data",name:"RedshiftData"},ssoadmin:{prefix:"sso-admin",name:"SSOAdmin"},timestreamquery:{prefix:"timestream-query",name:"TimestreamQuery"},timestreamwrite:{prefix:"timestream-write",name:"TimestreamWrite"},s3outposts:{name:"S3Outposts"},databrew:{name:"DataBrew"},servicecatalogappregistry:{prefix:"servicecatalog-appregistry",name:"ServiceCatalogAppRegistry"},networkfirewall:{prefix:"network-firewall",name:"NetworkFirewall"},mwaa:{name:"MWAA"},amplifybackend:{name:"AmplifyBackend"},appintegrations:{name:"AppIntegrations"},connectcontactlens:{prefix:"connect-contact-lens",name:"ConnectContactLens"},devopsguru:{prefix:"devops-guru",name:"DevOpsGuru"},ecrpublic:{prefix:"ecr-public",name:"ECRPUBLIC"},lookoutvision:{name:"LookoutVision"},sagemakerfeaturestoreruntime:{prefix:"sagemaker-featurestore-runtime",name:"SageMakerFeatureStoreRuntime"},customerprofiles:{prefix:"customer-profiles",name:"CustomerProfiles"},auditmanager:{name:"AuditManager"},emrcontainers:{prefix:"emr-containers",name:"EMRcontainers"},healthlake:{name:"HealthLake"},sagemakeredge:{prefix:"sagemaker-edge",name:"SagemakerEdge"},amp:{name:"Amp"},greengrassv2:{name:"GreengrassV2"},iotdeviceadvisor:{name:"IotDeviceAdvisor"},iotfleethub:{name:"IoTFleetHub"},iotwireless:{name:"IoTWireless"},location:{name:"Location",cors:!0},wellarchitected:{name:"WellArchitected"},lexmodelsv2:{prefix:"models.lex.v2",name:"LexModelsV2"},lexruntimev2:{prefix:"runtime.lex.v2",name:"LexRuntimeV2",cors:!0},fis:{name:"Fis"},lookoutmetrics:{name:"LookoutMetrics"},mgn:{name:"Mgn"},lookoutequipment:{name:"LookoutEquipment"},nimble:{name:"Nimble"},finspace:{name:"Finspace"},finspacedata:{prefix:"finspace-data",name:"Finspacedata"},ssmcontacts:{prefix:"ssm-contacts",name:"SSMContacts"},ssmincidents:{prefix:"ssm-incidents",name:"SSMIncidents"},applicationcostprofiler:{name:"ApplicationCostProfiler"},apprunner:{name:"AppRunner"},proton:{name:"Proton"},route53recoverycluster:{prefix:"route53-recovery-cluster",name:"Route53RecoveryCluster"},route53recoverycontrolconfig:{prefix:"route53-recovery-control-config",name:"Route53RecoveryControlConfig"},route53recoveryreadiness:{prefix:"route53-recovery-readiness",name:"Route53RecoveryReadiness"},chimesdkidentity:{prefix:"chime-sdk-identity",name:"ChimeSDKIdentity"},chimesdkmessaging:{prefix:"chime-sdk-messaging",name:"ChimeSDKMessaging"},snowdevicemanagement:{prefix:"snow-device-management",name:"SnowDeviceManagement"},memorydb:{name:"MemoryDB"},opensearch:{name:"OpenSearch"},kafkaconnect:{name:"KafkaConnect"},voiceid:{prefix:"voice-id",name:"VoiceID"},wisdom:{name:"Wisdom"},account:{name:"Account"},cloudcontrol:{name:"CloudControl"},grafana:{name:"Grafana"},panorama:{name:"Panorama"},chimesdkmeetings:{prefix:"chime-sdk-meetings",name:"ChimeSDKMeetings"},resiliencehub:{name:"Resiliencehub"},migrationhubstrategy:{name:"MigrationHubStrategy"},appconfigdata:{name:"AppConfigData"},drs:{name:"Drs"},migrationhubrefactorspaces:{prefix:"migration-hub-refactor-spaces",name:"MigrationHubRefactorSpaces"},evidently:{name:"Evidently"},inspector2:{name:"Inspector2"},rbin:{name:"Rbin"},rum:{name:"RUM"},backupgateway:{prefix:"backup-gateway",name:"BackupGateway"},iottwinmaker:{name:"IoTTwinMaker"},workspacesweb:{prefix:"workspaces-web",name:"WorkSpacesWeb"},amplifyuibuilder:{name:"AmplifyUIBuilder"},keyspaces:{name:"Keyspaces"},billingconductor:{name:"Billingconductor"},gamesparks:{name:"GameSparks"},pinpointsmsvoicev2:{prefix:"pinpoint-sms-voice-v2",name:"PinpointSMSVoiceV2"},ivschat:{name:"Ivschat"},chimesdkmediapipelines:{prefix:"chime-sdk-media-pipelines",name:"ChimeSDKMediaPipelines"},emrserverless:{prefix:"emr-serverless",name:"EMRServerless"},m2:{name:"M2"},connectcampaigns:{name:"ConnectCampaigns"},redshiftserverless:{prefix:"redshift-serverless",name:"RedshiftServerless"},rolesanywhere:{name:"RolesAnywhere"},licensemanagerusersubscriptions:{prefix:"license-manager-user-subscriptions",name:"LicenseManagerUserSubscriptions"},backupstorage:{name:"BackupStorage"},privatenetworks:{name:"PrivateNetworks"},supportapp:{prefix:"support-app",name:"SupportApp"},controltower:{name:"ControlTower"},iotfleetwise:{name:"IoTFleetWise"},migrationhuborchestrator:{name:"MigrationHubOrchestrator"},connectcases:{name:"ConnectCases"},resourceexplorer2:{prefix:"resource-explorer-2",name:"ResourceExplorer2"},scheduler:{name:"Scheduler"}}});var da=P((e_,Wc)=>{var Us=Zo(),Xm=aa(),Gm=Dn(),Jm=ua(),Qm=ca(),Mc=la(),Mn=Se(),pe=Mn.property,Ym=Mn.memoizedProperty;function $m(t,e){var r=this;t=t||{},e=e||{},e.api=this,t.metadata=t.metadata||{};var i=e.serviceIdentifier;delete e.serviceIdentifier,pe(this,"isApi",!0,!1),pe(this,"apiVersion",t.metadata.apiVersion),pe(this,"endpointPrefix",t.metadata.endpointPrefix),pe(this,"signingName",t.metadata.signingName),pe(this,"globalEndpoint",t.metadata.globalEndpoint),pe(this,"signatureVersion",t.metadata.signatureVersion),pe(this,"jsonVersion",t.metadata.jsonVersion),pe(this,"targetPrefix",t.metadata.targetPrefix),pe(this,"protocol",t.metadata.protocol),pe(this,"timestampFormat",t.metadata.timestampFormat),pe(this,"xmlNamespaceUri",t.metadata.xmlNamespace),pe(this,"abbreviation",t.metadata.serviceAbbreviation),pe(this,"fullName",t.metadata.serviceFullName),pe(this,"serviceId",t.metadata.serviceId),i&&Mc[i]&&pe(this,"xmlNoDefaultLists",Mc[i].xmlNoDefaultLists,!1),Ym(this,"className",function(){var o=t.metadata.serviceAbbreviation||t.metadata.serviceFullName;return o?(o=o.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g,""),o==="ElasticLoadBalancing"&&(o="ELB"),o):null});function n(o,a){a.endpointoperation===!0&&pe(r,"endpointOperation",Mn.string.lowerFirst(o)),a.endpointdiscovery&&!r.hasRequiredEndpointDiscovery&&pe(r,"hasRequiredEndpointDiscovery",a.endpointdiscovery.required===!0)}s(n,"addEndpointOperation"),pe(this,"operations",new Us(t.operations,e,function(o,a){return new Xm(o,a,e)},Mn.string.lowerFirst,n)),pe(this,"shapes",new Us(t.shapes,e,function(o,a){return Gm.create(a,e)})),pe(this,"paginators",new Us(t.paginators,e,function(o,a){return new Jm(o,a,e)})),pe(this,"waiters",new Us(t.waiters,e,function(o,a){return new Qm(o,a,e)},Mn.string.lowerFirst)),e.documentation&&(pe(this,"documentation",t.documentation),pe(this,"documentationUrl",t.documentationUrl)),pe(this,"awsQueryCompatible",t.metadata.awsQueryCompatible)}s($m,"Api");Wc.exports=$m});var Vc=P((r_,Bc)=>{function zs(t,e){if(!zs.services.hasOwnProperty(t))throw new Error("InvalidService: Failed to load api for "+t);return zs.services[t][e]}s(zs,"apiLoader");zs.services={};Bc.exports=zs});var Uc=P(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});var Zm=function(){function t(e,r){this.key=e,this.value=r}return s(t,"LinkedListNode"),t}(),ey=function(){function t(e){if(this.nodeMap={},this.size=0,typeof e!="number"||e<1)throw new Error("Cache size can only be positive number");this.sizeLimit=e}return s(t,"LRUCache"),Object.defineProperty(t.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),t.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},t.prototype.removeFromTail=function(){if(this.tailNode){var e=this.tailNode,r=e.prev;return r&&(r.next=void 0),e.prev=void 0,this.tailNode=r,this.size--,e}},t.prototype.detachFromList=function(e){this.headerNode===e&&(this.headerNode=e.next),this.tailNode===e&&(this.tailNode=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.next=void 0,e.prev=void 0,this.size--},t.prototype.get=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];return this.detachFromList(r),this.prependToList(r),r.value}},t.prototype.remove=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];this.detachFromList(r),delete this.nodeMap[e]}},t.prototype.put=function(e,r){if(this.nodeMap[e])this.remove(e);else if(this.size===this.sizeLimit){var i=this.removeFromTail(),n=i.key;delete this.nodeMap[n]}var o=new Zm(e,r);this.nodeMap[e]=o,this.prependToList(o)},t.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),r=0;r<e.length;r++){var i=e[r],n=this.nodeMap[i];this.detachFromList(n),delete this.nodeMap[i]}},t}();ha.LRUCache=ey});var zc=P(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var ty=Uc(),ry=1e3,iy=function(){function t(e){e===void 0&&(e=ry),this.maxSize=e,this.cache=new ty.LRUCache(e)}return s(t,"EndpointCache"),Object.defineProperty(t.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),t.prototype.put=function(e,r){var i=typeof e!="string"?t.getKeyString(e):e,n=this.populateValue(r);this.cache.put(i,n)},t.prototype.get=function(e){var r=typeof e!="string"?t.getKeyString(e):e,i=Date.now(),n=this.cache.get(r);if(n){for(var o=n.length-1;o>=0;o--){var a=n[o];a.Expire<i&&n.splice(o,1)}if(n.length===0){this.cache.remove(r);return}}return n},t.getKeyString=function(e){for(var r=[],i=Object.keys(e).sort(),n=0;n<i.length;n++){var o=i[n];e[o]!==void 0&&r.push(e[o])}return r.join(" ")},t.prototype.populateValue=function(e){var r=Date.now();return e.map(function(i){return{Address:i.Address||"",Expire:r+(i.CachePeriodInMinutes||1)*60*1e3}})},t.prototype.empty=function(){this.cache.empty()},t.prototype.remove=function(e){var r=typeof e!="string"?t.getKeyString(e):e;this.cache.remove(r)},t}();fa.EndpointCache=iy});var pa=P((u_,Hc)=>{var pr=V();pr.SequentialExecutor=pr.util.inherit({constructor:s(function(){this._events={}},"SequentialExecutor"),listeners:s(function(e){return this._events[e]?this._events[e].slice(0):[]},"listeners"),on:s(function(e,r,i){return this._events[e]?i?this._events[e].unshift(r):this._events[e].push(r):this._events[e]=[r],this},"on"),onAsync:s(function(e,r,i){return r._isAsync=!0,this.on(e,r,i)},"onAsync"),removeListener:s(function(e,r){var i=this._events[e];if(i){for(var n=i.length,o=-1,a=0;a<n;++a)i[a]===r&&(o=a);o>-1&&i.splice(o,1)}return this},"removeListener"),removeAllListeners:s(function(e){return e?delete this._events[e]:this._events={},this},"removeAllListeners"),emit:s(function(e,r,i){i||(i=s(function(){},"doneCallback"));var n=this.listeners(e),o=n.length;return this.callListeners(n,r,i),o>0},"emit"),callListeners:s(function(e,r,i,n){var o=this,a=n||null;function u(f){if(f&&(a=pr.util.error(a||new Error,f),o._haltHandlersOnError))return i.call(o,a);o.callListeners(e,r,i,a)}for(s(u,"callNextListener");e.length>0;){var l=e.shift();if(l._isAsync){l.apply(o,r.concat([u]));return}else{try{l.apply(o,r)}catch(f){a=pr.util.error(a||new Error,f)}if(a&&o._haltHandlersOnError){i.call(o,a);return}}}i.call(o,a)},"callListeners"),addListeners:s(function(e){var r=this;return e._events&&(e=e._events),pr.util.each(e,function(i,n){typeof n=="function"&&(n=[n]),pr.util.arrayEach(n,function(o){r.on(i,o)})}),r},"addListeners"),addNamedListener:s(function(e,r,i,n){return this[e]=i,this.addListener(r,i,n),this},"addNamedListener"),addNamedAsyncListener:s(function(e,r,i,n){return i._isAsync=!0,this.addNamedListener(e,r,i,n)},"addNamedAsyncListener"),addNamedListeners:s(function(e){var r=this;return e(function(){r.addNamedListener.apply(r,arguments)},function(){r.addNamedAsyncListener.apply(r,arguments)}),this},"addNamedListeners")});pr.SequentialExecutor.prototype.addListener=pr.SequentialExecutor.prototype.on;Hc.exports=pr.SequentialExecutor});var jc=P((l_,ny)=>{ny.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":"usIso","us-isob-*/*":"usIsob","*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:!0},"*/route53":"globalSSL","cn-*/route53":{endpoint:"{service}.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","us-iso-*/route53":{endpoint:"{service}.c2s.ic.gov",globalEndpoint:!0,signingRegion:"us-iso-east-1"},"us-isob-*/route53":{endpoint:"{service}.sc2s.sgov.gov",globalEndpoint:!0,signingRegion:"us-isob-east-1"},"*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{endpoint:"{service}.cn-north-1.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-north-1"},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"},"*/resource-explorer-2":"dualstackByDefault"},fipsRules:{"*/*":"fipsStandard","us-gov-*/*":"fipsStandard","us-iso-*/*":{endpoint:"{service}-fips.{region}.c2s.ic.gov"},"us-iso-*/dms":"usIso","us-isob-*/*":{endpoint:"{service}-fips.{region}.sc2s.sgov.gov"},"us-isob-*/dms":"usIsob","cn-*/*":{endpoint:"{service}-fips.{region}.amazonaws.com.cn"},"*/api.ecr":"fips.api.ecr","*/api.sagemaker":"fips.api.sagemaker","*/batch":"fipsDotPrefix","*/eks":"fipsDotPrefix","*/models.lex":"fips.models.lex","*/runtime.lex":"fips.runtime.lex","*/runtime.sagemaker":{endpoint:"runtime-fips.sagemaker.{region}.amazonaws.com"},"*/iam":"fipsWithoutRegion","*/route53":"fipsWithoutRegion","*/transcribe":"fipsDotPrefix","*/waf":"fipsWithoutRegion","us-gov-*/transcribe":"fipsDotPrefix","us-gov-*/api.ecr":"fips.api.ecr","us-gov-*/api.sagemaker":"fips.api.sagemaker","us-gov-*/models.lex":"fips.models.lex","us-gov-*/runtime.lex":"fips.runtime.lex","us-gov-*/acm-pca":"fipsWithServiceOnly","us-gov-*/batch":"fipsWithServiceOnly","us-gov-*/config":"fipsWithServiceOnly","us-gov-*/eks":"fipsWithServiceOnly","us-gov-*/elasticmapreduce":"fipsWithServiceOnly","us-gov-*/identitystore":"fipsWithServiceOnly","us-gov-*/dynamodb":"fipsWithServiceOnly","us-gov-*/elasticloadbalancing":"fipsWithServiceOnly","us-gov-*/guardduty":"fipsWithServiceOnly","us-gov-*/monitoring":"fipsWithServiceOnly","us-gov-*/resource-groups":"fipsWithServiceOnly","us-gov-*/runtime.sagemaker":"fipsWithServiceOnly","us-gov-*/servicecatalog-appregistry":"fipsWithServiceOnly","us-gov-*/servicequotas":"fipsWithServiceOnly","us-gov-*/ssm":"fipsWithServiceOnly","us-gov-*/sts":"fipsWithServiceOnly","us-gov-*/support":"fipsWithServiceOnly","us-gov-west-1/states":"fipsWithServiceOnly","us-iso-east-1/elasticfilesystem":{endpoint:"elasticfilesystem-fips.{region}.c2s.ic.gov"},"us-gov-west-1/organizations":"fipsWithServiceOnly","us-gov-west-1/route53":{endpoint:"route53.us-gov.amazonaws.com"}},dualstackRules:{"*/*":{endpoint:"{service}.{region}.api.aws"},"cn-*/*":{endpoint:"{service}.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackLegacy","cn-*/s3":"dualstackLegacyCn","*/s3-control":"dualstackLegacy","cn-*/s3-control":"dualstackLegacyCn","ap-south-1/ec2":"dualstackLegacyEc2","eu-west-1/ec2":"dualstackLegacyEc2","sa-east-1/ec2":"dualstackLegacyEc2","us-east-1/ec2":"dualstackLegacyEc2","us-east-2/ec2":"dualstackLegacyEc2","us-west-2/ec2":"dualstackLegacyEc2"},dualstackFipsRules:{"*/*":{endpoint:"{service}-fips.{region}.api.aws"},"cn-*/*":{endpoint:"{service}-fips.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackFipsLegacy","cn-*/s3":"dualstackFipsLegacyCn","*/s3-control":"dualstackFipsLegacy","cn-*/s3-control":"dualstackFipsLegacyCn"},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:!0,signingRegion:"us-east-1"},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com",globalEndpoint:!0,signingRegion:"us-gov-west-1"},s3signature:{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"s3"},usIso:{endpoint:"{service}.{region}.c2s.ic.gov"},usIsob:{endpoint:"{service}.{region}.sc2s.sgov.gov"},fipsStandard:{endpoint:"{service}-fips.{region}.amazonaws.com"},fipsDotPrefix:{endpoint:"fips.{service}.{region}.amazonaws.com"},fipsWithoutRegion:{endpoint:"{service}-fips.amazonaws.com"},"fips.api.ecr":{endpoint:"ecr-fips.{region}.amazonaws.com"},"fips.api.sagemaker":{endpoint:"api-fips.sagemaker.{region}.amazonaws.com"},"fips.models.lex":{endpoint:"models-fips.lex.{region}.amazonaws.com"},"fips.runtime.lex":{endpoint:"runtime-fips.lex.{region}.amazonaws.com"},fipsWithServiceOnly:{endpoint:"{service}.{region}.amazonaws.com"},dualstackLegacy:{endpoint:"{service}.dualstack.{region}.amazonaws.com"},dualstackLegacyCn:{endpoint:"{service}.dualstack.{region}.amazonaws.com.cn"},dualstackFipsLegacy:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com"},dualstackFipsLegacyCn:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com.cn"},dualstackLegacyEc2:{endpoint:"api.ec2.{region}.aws"},dualstackByDefault:{endpoint:"{service}.{region}.api.aws"}}}});var Xc=P((d_,Kc)=>{var sy=Se(),Wn=jc();function oy(t){if(!t)return null;var e=t.split("-");return e.length<3?null:e.slice(0,e.length-2).join("-")+"-*"}s(oy,"generateRegionPrefix");function ay(t){var e=t.config.region,r=oy(e),i=t.api.endpointPrefix;return[[e,i],[r,i],[e,"*"],[r,"*"],["*",i],["*","*"]].map(function(n){return n[0]&&n[1]?n.join("/"):null})}s(ay,"derivedKeys");function uy(t,e){sy.each(e,function(r,i){r!=="globalEndpoint"&&(t.config[r]===void 0||t.config[r]===null)&&(t.config[r]=i)})}s(uy,"applyConfig");function cy(t){for(var e=ay(t),r=t.config.useFipsEndpoint,i=t.config.useDualstackEndpoint,n=0;n<e.length;n++){var o=e[n];if(o){var a=r?i?Wn.dualstackFipsRules:Wn.fipsRules:i?Wn.dualstackRules:Wn.rules;if(Object.prototype.hasOwnProperty.call(a,o)){var u=a[o];typeof u=="string"&&(u=Wn.patterns[u]),t.isGlobalEndpoint=!!u.globalEndpoint,u.signingRegion&&(t.signingRegion=u.signingRegion),u.signatureVersion||(u.signatureVersion="v4"),uy(t,u);return}}}}s(cy,"configureEndpoint");function ly(t){for(var e={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},r="amazonaws.com",i=Object.keys(e),n=0;n<i.length;n++){var o=RegExp(i[n]),a=e[i[n]];if(o.test(t))return a}return r}s(ly,"getEndpointSuffix");Kc.exports={configureEndpoint:cy,getEndpointSuffix:ly}});var ma=P((f_,Gc)=>{function dy(t){return typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))}s(dy,"isFipsRegion");function hy(t){return typeof t=="string"&&["aws-global","aws-us-gov-global"].includes(t)}s(hy,"isGlobalRegion");function fy(t){return["fips-aws-global","aws-fips","aws-global"].includes(t)?"us-east-1":["fips-aws-us-gov-global","aws-us-gov-global"].includes(t)?"us-gov-west-1":t.replace(/fips-(dkr-|prod-)?|-fips/,"")}s(fy,"getRealRegion");Gc.exports={isFipsRegion:dy,isGlobalRegion:hy,getRealRegion:fy}});var Qc=P((m_,Jc)=>{var B=V(),py=da(),my=Xc(),ya=B.util.inherit,yy=0,Hs=ma();B.Service=ya({constructor:s(function(e){if(!this.loadServiceClass)throw B.util.error(new Error,"Service must be constructed with `new' operator");if(e){if(e.region){var r=e.region;Hs.isFipsRegion(r)&&(e.region=Hs.getRealRegion(r),e.useFipsEndpoint=!0),Hs.isGlobalRegion(r)&&(e.region=Hs.getRealRegion(r))}typeof e.useDualstack=="boolean"&&typeof e.useDualstackEndpoint!="boolean"&&(e.useDualstackEndpoint=e.useDualstack)}var i=this.loadServiceClass(e||{});if(i){var n=B.util.copy(e),o=new i(e);return Object.defineProperty(o,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),o._clientId=++yy,o}this.initialize(e)},"Service"),initialize:s(function(e){var r=B.config[this.serviceIdentifier];if(this.config=new B.Config(B.config),r&&this.config.update(r,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||my.configureEndpoint(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),B.SequentialExecutor.call(this),B.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||B.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",s(function(o){process.nextTick(function(){i.eventHandler(o)})},"PUBLISH_API_CALL")),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",s(function(o){process.nextTick(function(){i.eventHandler(o)})},"PUBLISH_API_ATTEMPT"))}},"initialize"),validateService:s(function(){},"validateService"),loadServiceClass:s(function(e){var r=e;if(B.util.isEmpty(this.api)){if(r.apiConfig)return B.Service.defineServiceApi(this.constructor,r.apiConfig);if(this.constructor.services){r=new B.Config(B.config),r.update(e,!0);var i=r.apiVersions[this.constructor.serviceIdentifier];return i=i||r.apiVersion,this.getLatestServiceClass(i)}else return null}else return null},"loadServiceClass"),getLatestServiceClass:s(function(e){return e=this.getLatestServiceVersion(e),this.constructor.services[e]===null&&B.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},"getLatestServiceClass"),getLatestServiceVersion:s(function(e){if(!this.constructor.services||this.constructor.services.length===0)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?B.util.isType(e,Date)&&(e=B.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var r=Object.keys(this.constructor.services).sort(),i=null,n=r.length-1;n>=0;n--)if(r[n][r[n].length-1]!=="*"&&(i=r[n]),r[n].substr(0,10)<=e)return i;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},"getLatestServiceVersion"),api:{},defaultRetryCount:3,customizeRequests:s(function(e){if(!e)this.customRequestHandler=null;else if(typeof e=="function")this.customRequestHandler=e;else throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests")},"customizeRequests"),makeRequest:s(function(e,r,i){if(typeof r=="function"&&(i=r,r=null),r=r||{},this.config.params){var n=this.api.operations[e];n&&(r=B.util.copy(r),B.util.each(this.config.params,function(a,u){n.input.members[a]&&(r[a]===void 0||r[a]===null)&&(r[a]=u)}))}var o=new B.Request(this,e,r);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),i&&o.send(i),o},"makeRequest"),makeUnauthenticatedRequest:s(function(e,r,i){typeof r=="function"&&(i=r,r={});var n=this.makeRequest(e,r).toUnauthenticated();return i?n.send(i):n},"makeUnauthenticatedRequest"),waitFor:s(function(e,r,i){var n=new B.ResourceWaiter(this,e);return n.wait(r,i)},"waitFor"),addAllRequestListeners:s(function(e){for(var r=[B.events,B.EventListeners.Core,this.serviceInterface(),B.EventListeners.CorePost],i=0;i<r.length;i++)r[i]&&e.addListeners(r[i]);this.config.paramValidation||e.removeListener("validate",B.EventListeners.Core.VALIDATE_PARAMETERS),this.config.logger&&e.addListeners(B.EventListeners.Logger),this.setupRequestListeners(e),typeof this.constructor.prototype.customRequestHandler=="function"&&this.constructor.prototype.customRequestHandler(e),Object.prototype.hasOwnProperty.call(this,"customRequestHandler")&&typeof this.customRequestHandler=="function"&&this.customRequestHandler(e)},"addAllRequestListeners"),apiCallEvent:s(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCall",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Region:e.httpRequest.region,MaxRetriesExceeded:0,UserAgent:e.httpRequest.getUserAgent()},n=e.response;if(n.httpResponse.statusCode&&(i.FinalHttpStatusCode=n.httpResponse.statusCode),n.error){var o=n.error,a=n.httpResponse.statusCode;a>299?(o.code&&(i.FinalAwsException=o.code),o.message&&(i.FinalAwsExceptionMessage=o.message)):((o.code||o.name)&&(i.FinalSdkException=o.code||o.name),o.message&&(i.FinalSdkExceptionMessage=o.message))}return i},"apiCallEvent"),apiAttemptEvent:s(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCallAttempt",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},n=e.response;return n.httpResponse.statusCode&&(i.HttpStatusCode=n.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(i.AccessKey=e.service.config.credentials.accessKeyId),n.httpResponse.headers&&(e.httpRequest.headers["x-amz-security-token"]&&(i.SessionToken=e.httpRequest.headers["x-amz-security-token"]),n.httpResponse.headers["x-amzn-requestid"]&&(i.XAmznRequestId=n.httpResponse.headers["x-amzn-requestid"]),n.httpResponse.headers["x-amz-request-id"]&&(i.XAmzRequestId=n.httpResponse.headers["x-amz-request-id"]),n.httpResponse.headers["x-amz-id-2"]&&(i.XAmzId2=n.httpResponse.headers["x-amz-id-2"])),i},"apiAttemptEvent"),attemptFailEvent:s(function(e){var r=this.apiAttemptEvent(e),i=e.response,n=i.error;return i.httpResponse.statusCode>299?(n.code&&(r.AwsException=n.code),n.message&&(r.AwsExceptionMessage=n.message)):((n.code||n.name)&&(r.SdkException=n.code||n.name),n.message&&(r.SdkExceptionMessage=n.message)),r},"attemptFailEvent"),attachMonitoringEmitter:s(function(e){var r,i,n,o,a=0,u,l,f=this,y=!0;e.on("validate",function(){o=B.util.realClock.now(),l=Date.now()},y),e.on("sign",function(){i=B.util.realClock.now(),r=Date.now(),u=e.httpRequest.region,a++},y),e.on("validateResponse",function(){n=Math.round(B.util.realClock.now()-i)}),e.addNamedListener("API_CALL_ATTEMPT","success",s(function(){var S=f.apiAttemptEvent(e);S.Timestamp=r,S.AttemptLatency=n>=0?n:0,S.Region=u,f.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT")),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",s(function(){var S=f.attemptFailEvent(e);S.Timestamp=r,n=n||Math.round(B.util.realClock.now()-i),S.AttemptLatency=n>=0?n:0,S.Region=u,f.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT_RETRY")),e.addNamedListener("API_CALL","complete",s(function(){var S=f.apiCallEvent(e);if(S.AttemptCount=a,!(S.AttemptCount<=0)){S.Timestamp=l;var I=Math.round(B.util.realClock.now()-o);S.Latency=I>=0?I:0;var x=e.response;x.error&&x.error.retryable&&typeof x.retryCount=="number"&&typeof x.maxRetries=="number"&&x.retryCount>=x.maxRetries&&(S.MaxRetriesExceeded=1),f.emit("apiCall",[S])}},"API_CALL"))},"attachMonitoringEmitter"),setupRequestListeners:s(function(e){},"setupRequestListeners"),getSigningName:s(function(){return this.api.signingName||this.api.endpointPrefix},"getSigningName"),getSignerClass:s(function(e){var r,i=null,n="";if(e){var o=e.service.api.operations||{};i=o[e.operation]||null,n=i?i.authtype:""}return this.config.signatureVersion?r=this.config.signatureVersion:n==="v4"||n==="v4-unsigned-body"?r="v4":n==="bearer"?r="bearer":r=this.api.signatureVersion,B.Signers.RequestSigner.getVersion(r)},"getSignerClass"),serviceInterface:s(function(){switch(this.api.protocol){case"ec2":return B.EventListeners.Query;case"query":return B.EventListeners.Query;case"json":return B.EventListeners.Json;case"rest-json":return B.EventListeners.RestJson;case"rest-xml":return B.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},"serviceInterface"),successfulResponse:s(function(e){return e.httpResponse.statusCode<300},"successfulResponse"),numRetries:s(function(){return this.config.maxRetries!==void 0?this.config.maxRetries:this.defaultRetryCount},"numRetries"),retryDelays:s(function(e,r){return B.util.calculateRetryDelay(e,this.config.retryDelayOptions,r)},"retryDelays"),retryableError:s(function(e){return!!(this.timeoutError(e)||this.networkingError(e)||this.expiredCredentialsError(e)||this.throttledError(e)||e.statusCode>=500)},"retryableError"),networkingError:s(function(e){return e.code==="NetworkingError"},"networkingError"),timeoutError:s(function(e){return e.code==="TimeoutError"},"timeoutError"),expiredCredentialsError:s(function(e){return e.code==="ExpiredTokenException"},"expiredCredentialsError"),clockSkewError:s(function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},"clockSkewError"),getSkewCorrectedDate:s(function(){return new Date(Date.now()+this.config.systemClockOffset)},"getSkewCorrectedDate"),applyClockOffset:s(function(e){e&&(this.config.systemClockOffset=e-Date.now())},"applyClockOffset"),isClockSkewed:s(function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e5},"isClockSkewed"),throttledError:s(function(e){if(e.statusCode===429)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":case"EC2ThrottledException":return!0;default:return!1}},"throttledError"),endpointFromTemplate:s(function(e){if(typeof e!="string")return e;var r=e;return r=r.replace(/\{service\}/g,this.api.endpointPrefix),r=r.replace(/\{region\}/g,this.config.region),r=r.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http"),r},"endpointFromTemplate"),setEndpoint:s(function(e){this.endpoint=new B.Endpoint(e,this.config)},"setEndpoint"),paginationConfig:s(function(e,r){var i=this.api.operations[e].paginator;if(!i){if(r){var n=new Error;throw B.util.error(n,"No pagination configuration for "+e)}return null}return i},"paginationConfig")});B.util.update(B.Service,{defineMethods:s(function(e){B.util.each(e.prototype.api.operations,s(function(i){if(!e.prototype[i]){var n=e.prototype.api.operations[i];n.authtype==="none"?e.prototype[i]=function(o,a){return this.makeUnauthenticatedRequest(i,o,a)}:e.prototype[i]=function(o,a){return this.makeRequest(i,o,a)}}},"iterator"))},"defineMethods"),defineService:s(function(e,r,i){B.Service._serviceMap[e]=!0,Array.isArray(r)||(i=r,r=[]);var n=ya(B.Service,i||{});if(typeof e=="string"){B.Service.addVersions(n,r);var o=n.serviceIdentifier||e;n.serviceIdentifier=o}else n.prototype.api=e,B.Service.defineMethods(n);if(B.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&B.util.clientSideMonitoring){var a=B.util.clientSideMonitoring.Publisher,u=B.util.clientSideMonitoring.configProvider,l=u();this.prototype.publisher=new a(l),l.enabled&&(B.Service._clientSideMonitoring=!0)}return B.SequentialExecutor.call(n.prototype),B.Service.addDefaultMonitoringListeners(n.prototype),n},"defineService"),addVersions:s(function(e,r){Array.isArray(r)||(r=[r]),e.services=e.services||{};for(var i=0;i<r.length;i++)e.services[r[i]]===void 0&&(e.services[r[i]]=null);e.apiVersions=Object.keys(e.services).sort()},"addVersions"),defineServiceApi:s(function(e,r,i){var n=ya(e,{serviceIdentifier:e.serviceIdentifier});function o(a){a.isApi?n.prototype.api=a:n.prototype.api=new py(a,{serviceIdentifier:e.serviceIdentifier})}if(s(o,"setApi"),typeof r=="string"){if(i)o(i);else try{o(B.apiLoader(e.serviceIdentifier,r))}catch(a){throw B.util.error(a,{message:"Could not find API configuration "+e.serviceIdentifier+"-"+r})}Object.prototype.hasOwnProperty.call(e.services,r)||(e.apiVersions=e.apiVersions.concat(r).sort()),e.services[r]=n}else o(r);return B.Service.defineMethods(n),n},"defineServiceApi"),hasService:function(t){return Object.prototype.hasOwnProperty.call(B.Service._serviceMap,t)},addDefaultMonitoringListeners:s(function(e){e.addNamedListener("MONITOR_EVENTS_BUBBLE","apiCallAttempt",s(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCallAttempt",[i])},"EVENTS_BUBBLE")),e.addNamedListener("CALL_EVENTS_BUBBLE","apiCall",s(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCall",[i])},"CALL_EVENTS_BUBBLE"))},"addDefaultMonitoringListeners"),_serviceMap:{}});B.util.mixin(B.Service,B.SequentialExecutor);Jc.exports=B.Service});var va=P(()=>{var Ct=V();Ct.Credentials=Ct.util.inherit({constructor:s(function(){if(Ct.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1&&typeof arguments[0]=="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},"Credentials"),expiryWindow:15,needsRefresh:s(function(){var e=Ct.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},"needsRefresh"),get:s(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:s(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:s(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(s(function(o){Ct.util.arrayEach(i.refreshCallbacks,function(a){r?a(o):Ct.util.defer(function(){a(o)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:s(function(e){e()},"load")});Ct.Credentials.addPromisesToClass=s(function(e){this.prototype.getPromise=Ct.util.promisifyMethod("get",e),this.prototype.refreshPromise=Ct.util.promisifyMethod("refresh",e)},"addPromisesToClass");Ct.Credentials.deletePromisesFromClass=s(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Ct.util.addPromises(Ct.Credentials)});var ga=P(()=>{var Ft=V();Ft.CredentialProviderChain=Ft.util.inherit(Ft.Credentials,{constructor:s(function(e){e?this.providers=e:this.providers=Ft.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"CredentialProviderChain"),resolve:s(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Ft.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var f=n[i++];typeof f=="function"?l=f.call():l=f,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var o=a;s(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Ft.CredentialProviderChain.defaultProviders=[];Ft.CredentialProviderChain.addPromisesToClass=s(function(e){this.prototype.resolvePromise=Ft.util.promisifyMethod("resolve",e)},"addPromisesToClass");Ft.CredentialProviderChain.deletePromisesFromClass=s(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Ft.util.addPromises(Ft.CredentialProviderChain)});var Yc=P(()=>{var me=V();va();ga();var js;me.Config=me.util.inherit({constructor:s(function(e){e===void 0&&(e={}),e=this.extractCredentials(e),me.util.each.call(this,this.keys,function(r,i){this.set(r,e[r],i)})},"Config"),getCredentials:s(function(e){var r=this;function i(u){e(u,u?null:r.credentials)}s(i,"finish");function n(u,l){return new me.util.error(l||new Error,{code:"CredentialsError",message:u,name:"CredentialsError"})}s(n,"credError");function o(){r.credentials.get(function(u){if(u){var l="Could not load credentials from "+r.credentials.constructor.name;u=n(l,u)}i(u)})}s(o,"getAsyncCredentials");function a(){var u=null;(!r.credentials.accessKeyId||!r.credentials.secretAccessKey)&&(u=n("Missing credentials")),i(u)}s(a,"getStaticCredentials"),r.credentials?typeof r.credentials.get=="function"?o():a():r.credentialProvider?r.credentialProvider.resolve(function(u,l){u&&(u=n("Could not load credentials from any providers",u)),r.credentials=l,i(u)}):i(n("No credentials to load"))},"getCredentials"),getToken:s(function(e){var r=this;function i(u){e(u,u?null:r.token)}s(i,"finish");function n(u,l){return new me.util.error(l||new Error,{code:"TokenError",message:u,name:"TokenError"})}s(n,"tokenError");function o(){r.token.get(function(u){if(u){var l="Could not load token from "+r.token.constructor.name;u=n(l,u)}i(u)})}s(o,"getAsyncToken");function a(){var u=null;r.token.token||(u=n("Missing token")),i(u)}s(a,"getStaticToken"),r.token?typeof r.token.get=="function"?o():a():r.tokenProvider?r.tokenProvider.resolve(function(u,l){u&&(u=n("Could not load token from any providers",u)),r.token=l,i(u)}):i(n("No token to load"))},"getToken"),update:s(function(e,r){r=r||!1,e=this.extractCredentials(e),me.util.each.call(this,e,function(i,n){(r||Object.prototype.hasOwnProperty.call(this.keys,i)||me.Service.hasService(i))&&this.set(i,n)})},"update"),loadFromPath:s(function(e){this.clear();var r=JSON.parse(me.util.readFileSync(e)),i=new me.FileSystemCredentials(e),n=new me.CredentialProviderChain;return n.providers.unshift(i),n.resolve(function(o,a){if(o)throw o;r.credentials=a}),this.constructor(r),this},"loadFromPath"),clear:s(function(){me.util.each.call(this,this.keys,function(e){delete this[e]}),this.set("credentials",void 0),this.set("credentialProvider",void 0)},"clear"),set:s(function(e,r,i){r===void 0?(i===void 0&&(i=this.keys[e]),typeof i=="function"?this[e]=i.call(this):this[e]=i):e==="httpOptions"&&this[e]?this[e]=me.util.merge(this[e],r):this[e]=r},"set"),keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,s3UsEast1RegionalEndpoint:"legacy",s3UseArnRegion:void 0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:void 0,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:"legacy",useFipsEndpoint:!1,useDualstackEndpoint:!1,token:null},extractCredentials:s(function(e){return e.accessKeyId&&e.secretAccessKey&&(e=me.util.copy(e),e.credentials=new me.Credentials(e)),e},"extractCredentials"),setPromisesDependency:s(function(e){js=e,e===null&&typeof Promise=="function"&&(js=Promise);var r=[me.Request,me.Credentials,me.CredentialProviderChain];me.S3&&(r.push(me.S3),me.S3.ManagedUpload&&r.push(me.S3.ManagedUpload)),me.util.addPromises(r,js)},"setPromisesDependency"),getPromisesDependency:s(function(){return js},"getPromisesDependency")});me.config=new me.Config});var Xs=P(()=>{var He=V(),Ks=He.util.inherit;He.Endpoint=Ks({constructor:s(function(e,r){if(He.util.hideProperties(this,["slashes","auth","hash","search","query"]),typeof e>"u"||e===null)throw new Error("Invalid endpoint: "+e);if(typeof e!="string")return He.util.copy(e);if(!e.match(/^http/)){var i=r&&r.sslEnabled!==void 0?r.sslEnabled:He.config.sslEnabled;e=(i?"https":"http")+"://"+e}He.util.update(this,He.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port=this.protocol==="https:"?443:80},"Endpoint")});He.HttpRequest=Ks({constructor:s(function(e,r){e=new He.Endpoint(e),this.method="POST",this.path=e.path||"/",this.headers={},this.body="",this.endpoint=e,this.region=r,this._userAgent="",this.setUserAgent()},"HttpRequest"),setUserAgent:s(function(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=He.util.userAgent()},"setUserAgent"),getUserAgentHeaderName:s(function(){var e=He.util.isBrowser()?"X-Amz-":"";return e+"User-Agent"},"getUserAgentHeaderName"),appendToUserAgent:s(function(e){typeof e=="string"&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},"appendToUserAgent"),getUserAgent:s(function(){return this._userAgent},"getUserAgent"),pathname:s(function(){return this.path.split("?",1)[0]},"pathname"),search:s(function(){var e=this.path.split("?",2)[1];return e?(e=He.util.queryStringParse(e),He.util.queryParamsToString(e)):""},"search"),updateEndpoint:s(function(e){var r=new He.Endpoint(e);this.endpoint=r,this.path=r.path||"/",this.headers.Host&&(this.headers.Host=r.host)},"updateEndpoint")});He.HttpResponse=Ks({constructor:s(function(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},"HttpResponse"),createUnbufferedStream:s(function(){return this.streaming=!0,this.stream},"createUnbufferedStream")});He.HttpClient=Ks({});He.HttpClient.getInstance=s(function(){return this.singleton===void 0&&(this.singleton=new this),this.singleton},"getInstance")});var sl=P((R_,nl)=>{var ke=V(),vt=Se(),$c=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function Gs(t){var e=t.service,r=e.api||{},i=r.operations,n={};return e.config.region&&(n.region=e.config.region),r.serviceId&&(n.serviceId=r.serviceId),e.config.credentials.accessKeyId&&(n.accessKeyId=e.config.credentials.accessKeyId),n}s(Gs,"getCacheKey");function el(t,e,r){!r||e===void 0||e===null||r.type==="structure"&&r.required&&r.required.length>0&&vt.arrayEach(r.required,function(i){var n=r.members[i];if(n.endpointDiscoveryId===!0){var o=n.isLocationName?n.name:i;t[o]=String(e[i])}else el(t,e[i],n)})}s(el,"marshallCustomIdentifiersHelper");function Js(t,e){var r={};return el(r,t.params,e),r}s(Js,"marshallCustomIdentifiers");function tl(t){var e=t.service,r=e.api,i=r.operations?r.operations[t.operation]:void 0,n=i?i.input:void 0,o=Js(t,n),a=Gs(t);Object.keys(o).length>0&&(a=vt.update(a,o),i&&(a.operation=i.name));var u=ke.endpointCache.get(a);if(!(u&&u.length===1&&u[0].Address===""))if(u&&u.length>0)t.httpRequest.updateEndpoint(u[0].Address);else{var l=e.makeRequest(r.endpointOperation,{Operation:i.name,Identifiers:o});il(l),l.removeListener("validate",ke.EventListeners.Core.VALIDATE_PARAMETERS),l.removeListener("retry",ke.EventListeners.Core.RETRY_CHECK),ke.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}]),l.send(function(f,y){y&&y.Endpoints?ke.endpointCache.put(a,y.Endpoints):f&&ke.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}])})}}s(tl,"optionalDiscoverEndpoint");var mr={};function rl(t,e){var r=t.service,i=r.api,n=i.operations?i.operations[t.operation]:void 0,o=n?n.input:void 0,a=Js(t,o),u=Gs(t);Object.keys(a).length>0&&(u=vt.update(u,a),n&&(u.operation=n.name));var l=ke.EndpointCache.getKeyString(u),f=ke.endpointCache.get(l);if(f&&f.length===1&&f[0].Address===""){mr[l]||(mr[l]=[]),mr[l].push({request:t,callback:e});return}else if(f&&f.length>0)t.httpRequest.updateEndpoint(f[0].Address),e();else{var y=r.makeRequest(i.endpointOperation,{Operation:n.name,Identifiers:a});y.removeListener("validate",ke.EventListeners.Core.VALIDATE_PARAMETERS),il(y),ke.endpointCache.put(l,[{Address:"",CachePeriodInMinutes:60}]),y.send(function(v,S){if(v){if(t.response.error=vt.error(v,{retryable:!1}),ke.endpointCache.remove(u),mr[l]){var I=mr[l];vt.arrayEach(I,function(x){x.request.response.error=vt.error(v,{retryable:!1}),x.callback()}),delete mr[l]}}else if(S&&(ke.endpointCache.put(l,S.Endpoints),t.httpRequest.updateEndpoint(S.Endpoints[0].Address),mr[l])){var I=mr[l];vt.arrayEach(I,function(w){w.request.httpRequest.updateEndpoint(S.Endpoints[0].Address),w.callback()}),delete mr[l]}e()})}}s(rl,"requiredDiscoverEndpoint");function il(t){var e=t.service.api,r=e.apiVersion;r&&!t.httpRequest.headers["x-amz-api-version"]&&(t.httpRequest.headers["x-amz-api-version"]=r)}s(il,"addApiVersionHeader");function Na(t){var e=t.error,r=t.httpResponse;if(e&&(e.code==="InvalidEndpointException"||r.statusCode===421)){var i=t.request,n=i.service.api.operations||{},o=n[i.operation]?n[i.operation].input:void 0,a=Js(i,o),u=Gs(i);Object.keys(a).length>0&&(u=vt.update(u,a),n[i.operation]&&(u.operation=n[i.operation].name)),ke.endpointCache.remove(u)}}s(Na,"invalidateCachedEndpoints");function vy(t){if(t._originalConfig&&t._originalConfig.endpoint&&t._originalConfig.endpointDiscoveryEnabled===!0)throw vt.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var e=ke.config[t.serviceIdentifier]||{};return Boolean(ke.config.endpoint||e.endpoint||t._originalConfig&&t._originalConfig.endpoint)}s(vy,"hasCustomEndpoint");function Zc(t){return["false","0"].indexOf(t)>=0}s(Zc,"isFalsy");function gy(t){var e=t.service||{};if(e.config.endpointDiscoveryEnabled!==void 0)return e.config.endpointDiscoveryEnabled;if(!vt.isBrowser()){for(var r=0;r<$c.length;r++){var i=$c[r];if(Object.prototype.hasOwnProperty.call(process.env,i)){if(process.env[i]===""||process.env[i]===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"environmental variable "+i+" cannot be set to nothing"});return!Zc(process.env[i])}}var n={};try{n=ke.util.iniLoader?ke.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[ke.util.sharedConfigFileEnv]}):{}}catch{}var o=n[process.env.AWS_PROFILE||ke.util.defaultProfile]||{};if(Object.prototype.hasOwnProperty.call(o,"endpoint_discovery_enabled")){if(o.endpoint_discovery_enabled===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"config file entry 'endpoint_discovery_enabled' cannot be set to nothing"});return!Zc(o.endpoint_discovery_enabled)}}}s(gy,"resolveEndpointDiscoveryConfig");function Ny(t,e){var r=t.service||{};if(vy(r)||t.isPresigned())return e();var i=r.api.operations||{},n=i[t.operation],o=n?n.endpointDiscoveryRequired:"NULL",a=gy(t),u=r.api.hasRequiredEndpointDiscovery;switch((a||u)&&t.httpRequest.appendToUserAgent("endpoint-discovery"),o){case"OPTIONAL":(a||u)&&(tl(t),t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Na)),e();break;case"REQUIRED":if(a===!1){t.response.error=vt.error(new Error,{code:"ConfigurationException",message:"Endpoint Discovery is disabled but "+r.api.className+"."+t.operation+"() requires it. Please check your configurations."}),e();break}t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Na),rl(t,e);break;case"NULL":default:e();break}}s(Ny,"discoverEndpoint");nl.exports={discoverEndpoint:Ny,requiredDiscoverEndpoint:rl,optionalDiscoverEndpoint:tl,marshallCustomIdentifiers:Js,getCacheKey:Gs,invalidateCachedEndpoint:Na}});var ol=P(()=>{var ie=V(),Lr=pa(),wy=sl().discoverEndpoint;ie.EventListeners={Core:{}};function xy(t){if(!t.service.api.operations)return"";var e=t.service.api.operations[t.operation];return e?e.authtype:""}s(xy,"getOperationAuthtype");ie.EventListeners={Core:new Lr().addNamedListeners(function(t,e){e("VALIDATE_CREDENTIALS","validate",s(function(n,o){if(!n.service.api.signatureVersion&&!n.service.config.signatureVersion)return o();n.service.config.getCredentials(function(a){a&&(n.response.error=ie.util.error(a,{code:"CredentialsError",message:"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1"})),o()})},"VALIDATE_CREDENTIALS")),t("VALIDATE_REGION","validate",s(function(n){if(!n.service.isGlobalEndpoint){var o=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);n.service.config.region?o.test(n.service.config.region)||(n.response.error=ie.util.error(new Error,{code:"ConfigError",message:"Invalid region in config"})):n.response.error=ie.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}},"VALIDATE_REGION")),t("BUILD_IDEMPOTENCY_TOKENS","validate",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation];if(o){var a=o.idempotentMembers;if(a.length){for(var u=ie.util.copy(n.params),l=0,f=a.length;l<f;l++)u[a[l]]||(u[a[l]]=ie.util.uuid.v4());n.params=u}}}},"BUILD_IDEMPOTENCY_TOKENS")),t("VALIDATE_PARAMETERS","validate",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation].input,a=n.service.config.paramValidation;new ie.ParamValidator(a).validate(o,n.params)}},"VALIDATE_PARAMETERS")),t("COMPUTE_CHECKSUM","afterBuild",s(function(n){if(n.service.api.operations){var o=n.service.api.operations[n.operation];if(o){var a=n.httpRequest.body,u=a&&(ie.util.Buffer.isBuffer(a)||typeof a=="string"),l=n.httpRequest.headers;if(o.httpChecksumRequired&&n.service.config.computeChecksums&&u&&!l["Content-MD5"]){var f=ie.util.crypto.md5(a,"base64");l["Content-MD5"]=f}}}},"COMPUTE_CHECKSUM")),e("COMPUTE_SHA256","afterBuild",s(function(n,o){if(n.haltHandlersOnError(),!!n.service.api.operations){var a=n.service.api.operations[n.operation],u=a?a.authtype:"";if(!n.service.api.signatureVersion&&!u&&!n.service.config.signatureVersion)return o();if(n.service.getSignerClass(n)===ie.Signers.V4){var l=n.httpRequest.body||"";if(u.indexOf("unsigned-body")>=0)return n.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",o();ie.util.computeSha256(l,function(f,y){f?o(f):(n.httpRequest.headers["X-Amz-Content-Sha256"]=y,o())})}else o()}},"COMPUTE_SHA256")),t("SET_CONTENT_LENGTH","afterBuild",s(function(n){var o=xy(n),a=ie.util.getRequestPayloadShape(n);if(n.httpRequest.headers["Content-Length"]===void 0)try{var u=ie.util.string.byteLength(n.httpRequest.body);n.httpRequest.headers["Content-Length"]=u}catch(l){if(a&&a.isStreaming){if(a.requiresLength)throw l;if(o.indexOf("unsigned-body")>=0){n.httpRequest.headers["Transfer-Encoding"]="chunked";return}else throw l}throw l}},"SET_CONTENT_LENGTH")),t("SET_HTTP_HOST","afterBuild",s(function(n){n.httpRequest.headers.Host=n.httpRequest.endpoint.host},"SET_HTTP_HOST")),t("SET_TRACE_ID","afterBuild",s(function(n){var o="X-Amzn-Trace-Id";if(ie.util.isNode()&&!Object.hasOwnProperty.call(n.httpRequest.headers,o)){var a="AWS_LAMBDA_FUNCTION_NAME",u="_X_AMZN_TRACE_ID",l=process.env[a],f=process.env[u];typeof l=="string"&&l.length>0&&typeof f=="string"&&f.length>0&&(n.httpRequest.headers[o]=f)}},"SET_TRACE_ID")),t("RESTART","restart",s(function(){var n=this.response.error;!n||!n.retryable||(this.httpRequest=new ie.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount<this.service.config.maxRetries?this.response.retryCount++:this.response.error=null)},"RESTART"));var r=!0;e("DISCOVER_ENDPOINT","sign",wy,r),e("SIGN","sign",s(function(n,o){var a=n.service,u=n.service.api.operations||{},l=u[n.operation],f=l?l.authtype:"";if(!a.api.signatureVersion&&!f&&!a.config.signatureVersion)return o();f==="bearer"||a.config.signatureVersion==="bearer"?a.config.getToken(function(y,v){if(y)return n.response.error=y,o();try{var S=a.getSignerClass(n),I=new S(n.httpRequest);I.addAuthorization(v)}catch(x){n.response.error=x}o()}):a.config.getCredentials(function(y,v){if(y)return n.response.error=y,o();try{var S=a.getSkewCorrectedDate(),I=a.getSignerClass(n),x=new I(n.httpRequest,a.getSigningName(n),{signatureCache:a.config.signatureCache,operation:l,signatureVersion:a.api.signatureVersion});x.setServiceClientId(a._clientId),delete n.httpRequest.headers.Authorization,delete n.httpRequest.headers.Date,delete n.httpRequest.headers["X-Amz-Date"],x.addAuthorization(v,S),n.signedAt=S}catch(w){n.response.error=w}o()})},"SIGN")),t("VALIDATE_RESPONSE","validateResponse",s(function(n){this.service.successfulResponse(n,this)?(n.data={},n.error=null):(n.data=null,n.error=ie.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))},"VALIDATE_RESPONSE")),t("ERROR","error",s(function(n,o){var a=o.request.service.api.awsQueryCompatible;if(a){var u=o.httpResponse.headers,l=u?u["x-amzn-query-error"]:void 0;l&&l.includes(";")&&(o.error.code=l.split(";")[0])}},"ERROR"),!0),e("SEND","send",s(function(n,o){n.httpResponse._abortCallback=o,n.error=null,n.data=null;function a(v){n.httpResponse.stream=v;var S=n.request.httpRequest.stream,I=n.request.service,x=I.api,w=n.request.operation,D=x.operations[w]||{};v.on("headers",s(function(p,C,O){if(n.request.emit("httpHeaders",[p,C,n,O]),!n.httpResponse.streaming)if(ie.HttpClient.streamsApiVersion===2){if(D.hasEventOutput&&I.successfulResponse(n)){n.request.emit("httpDone"),o();return}v.on("readable",s(function(){var T=v.read();T!==null&&n.request.emit("httpData",[T,n])},"onReadable"))}else v.on("data",s(function(T){n.request.emit("httpData",[T,n])},"onData"))},"onHeaders")),v.on("end",s(function(){if(!S||!S.didCallback){if(ie.HttpClient.streamsApiVersion===2&&D.hasEventOutput&&I.successfulResponse(n))return;n.request.emit("httpDone"),o()}},"onEnd"))}s(a,"callback");function u(v){v.on("sendProgress",s(function(I){n.request.emit("httpUploadProgress",[I,n])},"onSendProgress")),v.on("receiveProgress",s(function(I){n.request.emit("httpDownloadProgress",[I,n])},"onReceiveProgress"))}s(u,"progress");function l(v){if(v.code!=="RequestAbortedError"){var S=v.code==="TimeoutError"?v.code:"NetworkingError";v=ie.util.error(v,{code:S,region:n.request.httpRequest.region,hostname:n.request.httpRequest.endpoint.hostname,retryable:!0})}n.error=v,n.request.emit("httpError",[n.error,n],function(){o()})}s(l,"error");function f(){var v=ie.HttpClient.getInstance(),S=n.request.service.config.httpOptions||{};try{var I=v.handleRequest(n.request.httpRequest,S,a,l);u(I)}catch(x){l(x)}}s(f,"executeSend");var y=(n.request.service.getSkewCorrectedDate()-this.signedAt)/1e3;y>=60*10?this.emit("sign",[this],function(v){v?o(v):f()}):f()},"SEND")),t("HTTP_HEADERS","httpHeaders",s(function(n,o,a,u){a.httpResponse.statusCode=n,a.httpResponse.statusMessage=u,a.httpResponse.headers=o,a.httpResponse.body=ie.util.buffer.toBuffer(""),a.httpResponse.buffers=[],a.httpResponse.numBytes=0;var l=o.date||o.Date,f=a.request.service;if(l){var y=Date.parse(l);f.config.correctClockSkew&&f.isClockSkewed(y)&&f.applyClockOffset(y)}},"HTTP_HEADERS")),t("HTTP_DATA","httpData",s(function(n,o){if(n){if(ie.util.isNode()){o.httpResponse.numBytes+=n.length;var a=o.httpResponse.headers["content-length"],u={loaded:o.httpResponse.numBytes,total:a};o.request.emit("httpDownloadProgress",[u,o])}o.httpResponse.buffers.push(ie.util.buffer.toBuffer(n))}},"HTTP_DATA")),t("HTTP_DONE","httpDone",s(function(n){if(n.httpResponse.buffers&&n.httpResponse.buffers.length>0){var o=ie.util.buffer.concat(n.httpResponse.buffers);n.httpResponse.body=o}delete n.httpResponse.numBytes,delete n.httpResponse.buffers},"HTTP_DONE")),t("FINALIZE_ERROR","retry",s(function(n){n.httpResponse.statusCode&&(n.error.statusCode=n.httpResponse.statusCode,n.error.retryable===void 0&&(n.error.retryable=this.service.retryableError(n.error,this)))},"FINALIZE_ERROR")),t("INVALIDATE_CREDENTIALS","retry",s(function(n){if(n.error)switch(n.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":n.error.retryable=!0,n.request.service.config.credentials.expired=!0}},"INVALIDATE_CREDENTIALS")),t("EXPIRED_SIGNATURE","retry",s(function(n){var o=n.error;o&&typeof o.code=="string"&&typeof o.message=="string"&&o.code.match(/Signature/)&&o.message.match(/expired/)&&(n.error.retryable=!0)},"EXPIRED_SIGNATURE")),t("CLOCK_SKEWED","retry",s(function(n){n.error&&this.service.clockSkewError(n.error)&&this.service.config.correctClockSkew&&(n.error.retryable=!0)},"CLOCK_SKEWED")),t("REDIRECT","retry",s(function(n){n.error&&n.error.statusCode>=300&&n.error.statusCode<400&&n.httpResponse.headers.location&&(this.httpRequest.endpoint=new ie.Endpoint(n.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,n.error.redirect=!0,n.error.retryable=!0)},"REDIRECT")),t("RETRY_CHECK","retry",s(function(n){n.error&&(n.error.redirect&&n.redirectCount<n.maxRedirects?n.error.retryDelay=0:n.retryCount<n.maxRetries&&(n.error.retryDelay=this.service.retryDelays(n.retryCount,n.error)||0))},"RETRY_CHECK")),e("RESET_RETRY_STATE","afterRetry",s(function(n,o){var a,u=!1;n.error&&(a=n.error.retryDelay||0,n.error.retryable&&n.retryCount<n.maxRetries?(n.retryCount++,u=!0):n.error.redirect&&n.redirectCount<n.maxRedirects&&(n.redirectCount++,u=!0)),u&&a>=0?(n.error=null,setTimeout(o,a)):o()},"RESET_RETRY_STATE"))}),CorePost:new Lr().addNamedListeners(function(t){t("EXTRACT_REQUEST_ID","extractData",ie.util.extractRequestId),t("EXTRACT_REQUEST_ID","extractError",ie.util.extractRequestId),t("ENOTFOUND_ERROR","httpError",s(function(r){function i(o){return o.errno==="ENOTFOUND"||typeof o.errno=="number"&&typeof ie.util.getSystemErrorName=="function"&&["EAI_NONAME","EAI_NODATA"].indexOf(ie.util.getSystemErrorName(o.errno)>=0)}if(s(i,"isDNSError"),r.code==="NetworkingError"&&i(r)){var n="Inaccessible host: `"+r.hostname+"' at port `"+r.port+"'. This service may not be available in the `"+r.region+"' region.";this.response.error=ie.util.error(new Error(n),{code:"UnknownEndpoint",region:r.region,hostname:r.hostname,retryable:!0,originalError:r})}},"ENOTFOUND_ERROR"))}),Logger:new Lr().addNamedListeners(function(t){t("LOG_REQUEST","complete",s(function(r){var i=r.request,n=i.service.config.logger;if(!n)return;function o(l,f){if(!f)return f;if(l.isSensitive)return"***SensitiveInformation***";switch(l.type){case"structure":var y={};return ie.util.each(f,function(I,x){Object.prototype.hasOwnProperty.call(l.members,I)?y[I]=o(l.members[I],x):y[I]=x}),y;case"list":var v=[];return ie.util.arrayEach(f,function(I,x){v.push(o(l.member,I))}),v;case"map":var S={};return ie.util.each(f,function(I,x){S[I]=o(l.value,x)}),S;default:return f}}s(o,"filterSensitiveLog");function a(){var l=r.request.service.getSkewCorrectedDate().getTime(),f=(l-i.startTime.getTime())/1e3,y=!!n.isTTY,v=r.httpResponse.statusCode,S=i.params;if(i.service.api.operations&&i.service.api.operations[i.operation]&&i.service.api.operations[i.operation].input){var I=i.service.api.operations[i.operation].input;S=o(I,i.params)}var x=te("util").inspect(S,!0,null),w="";return y&&(w+="\x1B[33m"),w+="[AWS "+i.service.serviceIdentifier+" "+v,w+=" "+f.toString()+"s "+r.retryCount+" retries]",y&&(w+="\x1B[0;1m"),w+=" "+ie.util.string.lowerFirst(i.operation),w+="("+x+")",y&&(w+="\x1B[0m"),w}s(a,"buildMessage");var u=a();typeof n.log=="function"?n.log(u):typeof n.write=="function"&&n.write(u+`
3
- `)},"LOG_REQUEST"))}),Json:new Lr().addNamedListeners(function(t){var e=Ms();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Rest:new Lr().addNamedListeners(function(t){var e=_n();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),RestJson:new Lr().addNamedListeners(function(t){var e=na();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError),t("UNSET_CONTENT_LENGTH","afterBuild",e.unsetContentLength)}),RestXml:new Lr().addNamedListeners(function(t){var e=oa();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Query:new Lr().addNamedListeners(function(t){var e=ta();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)})}});var ul=P((q_,al)=>{function wa(t,e){this.currentState=e||null,this.states=t||{}}s(wa,"AcceptorStateMachine");wa.prototype.runTo=s(function(e,r,i,n){typeof e=="function"&&(n=i,i=r,r=e,e=null);var o=this,a=o.states[o.currentState];a.fn.call(i||o,n,function(u){if(u)if(a.fail)o.currentState=a.fail;else return r?r.call(i,u):null;else if(a.accept)o.currentState=a.accept;else return r?r.call(i):null;if(o.currentState===e)return r?r.call(i,u):null;o.runTo(e,r,i,u)})},"runTo");wa.prototype.addState=s(function(e,r,i,n){return typeof r=="function"?(n=r,r=null,i=null):typeof i=="function"&&(n=i,i=null),this.currentState||(this.currentState=e),this.states[e]={accept:r,fail:i,fn:n},this},"addState");al.exports=wa});var Ys=P(Qs=>{(function(t){"use strict";function e(h){return h!==null?Object.prototype.toString.call(h)==="[object Array]":!1}s(e,"isArray");function r(h){return h!==null?Object.prototype.toString.call(h)==="[object Object]":!1}s(r,"isObject");function i(h,N){if(h===N)return!0;var b=Object.prototype.toString.call(h);if(b!==Object.prototype.toString.call(N))return!1;if(e(h)===!0){if(h.length!==N.length)return!1;for(var q=0;q<h.length;q++)if(i(h[q],N[q])===!1)return!1;return!0}if(r(h)===!0){var L={};for(var W in h)if(hasOwnProperty.call(h,W)){if(i(h[W],N[W])===!1)return!1;L[W]=!0}for(var Q in N)if(hasOwnProperty.call(N,Q)&&L[Q]!==!0)return!1;return!0}return!1}s(i,"strictDeepEqual");function n(h){if(h===""||h===!1||h===null)return!0;if(e(h)&&h.length===0)return!0;if(r(h)){for(var N in h)if(h.hasOwnProperty(N))return!1;return!0}else return!1}s(n,"isFalse");function o(h){for(var N=Object.keys(h),b=[],q=0;q<N.length;q++)b.push(h[N[q]]);return b}s(o,"objValues");function a(h,N){var b={};for(var q in h)b[q]=h[q];for(var L in N)b[L]=N[L];return b}s(a,"merge");var u;typeof String.prototype.trimLeft=="function"?u=s(function(h){return h.trimLeft()},"trimLeft"):u=s(function(h){return h.match(/^\s*(.*)/)[1]},"trimLeft");var l=0,f=1,y=2,v=3,S=4,I=5,x=6,w=7,D=8,E=9,p={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},C="EOF",O="UnquotedIdentifier",_="QuotedIdentifier",T="Rbracket",A="Rparen",g="Comma",j="Colon",X="Rbrace",M="Number",ne="Current",We="Expref",Fe="Pipe",At="Or",Z="And",wr="EQ",xr="GT",Er="LT",Nt="GTE",Cr="LTE",pi="NE",It="Flatten",Ut="Star",Vr="Filter",m="Dot",d="Not",k="Lbrace",R="Lbracket",ee="Lparen",ye="Literal",we={".":m,"*":Ut,",":g,":":j,"{":k,"}":X,"]":T,"(":ee,")":A,"@":ne},Ge={"<":!0,">":!0,"=":!0,"!":!0},wt={" ":!0," ":!0,"\n":!0};function Sr(h){return h>="a"&&h<="z"||h>="A"&&h<="Z"||h==="_"}s(Sr,"isAlpha");function Te(h){return h>="0"&&h<="9"||h==="-"}s(Te,"isNum");function Rt(h){return h>="a"&&h<="z"||h>="A"&&h<="Z"||h>="0"&&h<="9"||h==="_"}s(Rt,"isAlphaNum");function Bi(){}s(Bi,"Lexer"),Bi.prototype={tokenize:function(h){var N=[];this._current=0;for(var b,q,L;this._current<h.length;)if(Sr(h[this._current]))b=this._current,q=this._consumeUnquotedIdentifier(h),N.push({type:O,value:q,start:b});else if(we[h[this._current]]!==void 0)N.push({type:we[h[this._current]],value:h[this._current],start:this._current}),this._current++;else if(Te(h[this._current]))L=this._consumeNumber(h),N.push(L);else if(h[this._current]==="[")L=this._consumeLBracket(h),N.push(L);else if(h[this._current]==='"')b=this._current,q=this._consumeQuotedIdentifier(h),N.push({type:_,value:q,start:b});else if(h[this._current]==="'")b=this._current,q=this._consumeRawStringLiteral(h),N.push({type:ye,value:q,start:b});else if(h[this._current]==="`"){b=this._current;var W=this._consumeLiteral(h);N.push({type:ye,value:W,start:b})}else if(Ge[h[this._current]]!==void 0)N.push(this._consumeOperator(h));else if(wt[h[this._current]]!==void 0)this._current++;else if(h[this._current]==="&")b=this._current,this._current++,h[this._current]==="&"?(this._current++,N.push({type:Z,value:"&&",start:b})):N.push({type:We,value:"&",start:b});else if(h[this._current]==="|")b=this._current,this._current++,h[this._current]==="|"?(this._current++,N.push({type:At,value:"||",start:b})):N.push({type:Fe,value:"|",start:b});else{var Q=new Error("Unknown character:"+h[this._current]);throw Q.name="LexerError",Q}return N},_consumeUnquotedIdentifier:function(h){var N=this._current;for(this._current++;this._current<h.length&&Rt(h[this._current]);)this._current++;return h.slice(N,this._current)},_consumeQuotedIdentifier:function(h){var N=this._current;this._current++;for(var b=h.length;h[this._current]!=='"'&&this._current<b;){var q=this._current;h[q]==="\\"&&(h[q+1]==="\\"||h[q+1]==='"')?q+=2:q++,this._current=q}return this._current++,JSON.parse(h.slice(N,this._current))},_consumeRawStringLiteral:function(h){var N=this._current;this._current++;for(var b=h.length;h[this._current]!=="'"&&this._current<b;){var q=this._current;h[q]==="\\"&&(h[q+1]==="\\"||h[q+1]==="'")?q+=2:q++,this._current=q}this._current++;var L=h.slice(N+1,this._current-1);return L.replace("\\'","'")},_consumeNumber:function(h){var N=this._current;this._current++;for(var b=h.length;Te(h[this._current])&&this._current<b;)this._current++;var q=parseInt(h.slice(N,this._current));return{type:M,value:q,start:N}},_consumeLBracket:function(h){var N=this._current;return this._current++,h[this._current]==="?"?(this._current++,{type:Vr,value:"[?",start:N}):h[this._current]==="]"?(this._current++,{type:It,value:"[]",start:N}):{type:R,value:"[",start:N}},_consumeOperator:function(h){var N=this._current,b=h[N];if(this._current++,b==="!")return h[this._current]==="="?(this._current++,{type:pi,value:"!=",start:N}):{type:d,value:"!",start:N};if(b==="<")return h[this._current]==="="?(this._current++,{type:Cr,value:"<=",start:N}):{type:Er,value:"<",start:N};if(b===">")return h[this._current]==="="?(this._current++,{type:Nt,value:">=",start:N}):{type:xr,value:">",start:N};if(b==="="&&h[this._current]==="=")return this._current++,{type:wr,value:"==",start:N}},_consumeLiteral:function(h){this._current++;for(var N=this._current,b=h.length,q;h[this._current]!=="`"&&this._current<b;){var L=this._current;h[L]==="\\"&&(h[L+1]==="\\"||h[L+1]==="`")?L+=2:L++,this._current=L}var W=u(h.slice(N,this._current));return W=W.replace("\\`","`"),this._looksLikeJSON(W)?q=JSON.parse(W):q=JSON.parse('"'+W+'"'),this._current++,q},_looksLikeJSON:function(h){var N='[{"',b=["true","false","null"],q="-0123456789";if(h==="")return!1;if(N.indexOf(h[0])>=0)return!0;if(b.indexOf(h)>=0)return!0;if(q.indexOf(h[0])>=0)try{return JSON.parse(h),!0}catch{return!1}else return!1}};var J={};J[C]=0,J[O]=0,J[_]=0,J[T]=0,J[A]=0,J[g]=0,J[X]=0,J[M]=0,J[ne]=0,J[We]=0,J[Fe]=1,J[At]=2,J[Z]=3,J[wr]=5,J[xr]=5,J[Er]=5,J[Nt]=5,J[Cr]=5,J[pi]=5,J[It]=9,J[Ut]=20,J[Vr]=21,J[m]=40,J[d]=45,J[k]=50,J[R]=55,J[ee]=60;function Ur(){}s(Ur,"Parser"),Ur.prototype={parse:function(h){this._loadTokens(h),this.index=0;var N=this.expression(0);if(this._lookahead(0)!==C){var b=this._lookaheadToken(0),q=new Error("Unexpected token type: "+b.type+", value: "+b.value);throw q.name="ParserError",q}return N},_loadTokens:function(h){var N=new Bi,b=N.tokenize(h);b.push({type:C,value:"",start:h.length}),this.tokens=b},expression:function(h){var N=this._lookaheadToken(0);this._advance();for(var b=this.nud(N),q=this._lookahead(0);h<J[q];)this._advance(),b=this.led(q,b),q=this._lookahead(0);return b},_lookahead:function(h){return this.tokens[this.index+h].type},_lookaheadToken:function(h){return this.tokens[this.index+h]},_advance:function(){this.index++},nud:function(h){var N,b,q;switch(h.type){case ye:return{type:"Literal",value:h.value};case O:return{type:"Field",name:h.value};case _:var L={type:"Field",name:h.value};if(this._lookahead(0)===ee)throw new Error("Quoted identifier not allowed for function names.");return L;case d:return b=this.expression(J.Not),{type:"NotExpression",children:[b]};case Ut:return N={type:"Identity"},b=null,this._lookahead(0)===T?b={type:"Identity"}:b=this._parseProjectionRHS(J.Star),{type:"ValueProjection",children:[N,b]};case Vr:return this.led(h.type,{type:"Identity"});case k:return this._parseMultiselectHash();case It:return N={type:It,children:[{type:"Identity"}]},b=this._parseProjectionRHS(J.Flatten),{type:"Projection",children:[N,b]};case R:return this._lookahead(0)===M||this._lookahead(0)===j?(b=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},b)):this._lookahead(0)===Ut&&this._lookahead(1)===T?(this._advance(),this._advance(),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[{type:"Identity"},b]}):this._parseMultiselectList();case ne:return{type:ne};case We:return q=this.expression(J.Expref),{type:"ExpressionReference",children:[q]};case ee:for(var W=[];this._lookahead(0)!==A;)this._lookahead(0)===ne?(q={type:ne},this._advance()):q=this.expression(0),W.push(q);return this._match(A),W[0];default:this._errorToken(h)}},led:function(h,N){var b;switch(h){case m:var q=J.Dot;return this._lookahead(0)!==Ut?(b=this._parseDotRHS(q),{type:"Subexpression",children:[N,b]}):(this._advance(),b=this._parseProjectionRHS(q),{type:"ValueProjection",children:[N,b]});case Fe:return b=this.expression(J.Pipe),{type:Fe,children:[N,b]};case At:return b=this.expression(J.Or),{type:"OrExpression",children:[N,b]};case Z:return b=this.expression(J.And),{type:"AndExpression",children:[N,b]};case ee:for(var L=N.name,W=[],Q,se;this._lookahead(0)!==A;)this._lookahead(0)===ne?(Q={type:ne},this._advance()):Q=this.expression(0),this._lookahead(0)===g&&this._match(g),W.push(Q);return this._match(A),se={type:"Function",name:L,children:W},se;case Vr:var Qe=this.expression(0);return this._match(T),this._lookahead(0)===It?b={type:"Identity"}:b=this._parseProjectionRHS(J.Filter),{type:"FilterProjection",children:[N,b,Qe]};case It:var Zt={type:It,children:[N]},De=this._parseProjectionRHS(J.Flatten);return{type:"Projection",children:[Zt,De]};case wr:case pi:case xr:case Nt:case Er:case Cr:return this._parseComparator(N,h);case R:var G=this._lookaheadToken(0);return G.type===M||G.type===j?(b=this._parseIndexExpression(),this._projectIfSlice(N,b)):(this._match(Ut),this._match(T),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[N,b]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(h){if(this._lookahead(0)===h)this._advance();else{var N=this._lookaheadToken(0),b=new Error("Expected "+h+", got: "+N.type);throw b.name="ParserError",b}},_errorToken:function(h){var N=new Error("Invalid token ("+h.type+'): "'+h.value+'"');throw N.name="ParserError",N},_parseIndexExpression:function(){if(this._lookahead(0)===j||this._lookahead(1)===j)return this._parseSliceExpression();var h={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(T),h},_projectIfSlice:function(h,N){var b={type:"IndexExpression",children:[h,N]};return N.type==="Slice"?{type:"Projection",children:[b,this._parseProjectionRHS(J.Star)]}:b},_parseSliceExpression:function(){for(var h=[null,null,null],N=0,b=this._lookahead(0);b!==T&&N<3;){if(b===j)N++,this._advance();else if(b===M)h[N]=this._lookaheadToken(0).value,this._advance();else{var q=this._lookahead(0),L=new Error("Syntax error, unexpected token: "+q.value+"("+q.type+")");throw L.name="Parsererror",L}b=this._lookahead(0)}return this._match(T),{type:"Slice",children:h}},_parseComparator:function(h,N){var b=this.expression(J[N]);return{type:"Comparator",name:N,children:[h,b]}},_parseDotRHS:function(h){var N=this._lookahead(0),b=[O,_,Ut];if(b.indexOf(N)>=0)return this.expression(h);if(N===R)return this._match(R),this._parseMultiselectList();if(N===k)return this._match(k),this._parseMultiselectHash()},_parseProjectionRHS:function(h){var N;if(J[this._lookahead(0)]<10)N={type:"Identity"};else if(this._lookahead(0)===R)N=this.expression(h);else if(this._lookahead(0)===Vr)N=this.expression(h);else if(this._lookahead(0)===m)this._match(m),N=this._parseDotRHS(h);else{var b=this._lookaheadToken(0),q=new Error("Sytanx error, unexpected token: "+b.value+"("+b.type+")");throw q.name="ParserError",q}return N},_parseMultiselectList:function(){for(var h=[];this._lookahead(0)!==T;){var N=this.expression(0);if(h.push(N),this._lookahead(0)===g&&(this._match(g),this._lookahead(0)===T))throw new Error("Unexpected token Rbracket")}return this._match(T),{type:"MultiSelectList",children:h}},_parseMultiselectHash:function(){for(var h=[],N=[O,_],b,q,L,W;;){if(b=this._lookaheadToken(0),N.indexOf(b.type)<0)throw new Error("Expecting an identifier token, got: "+b.type);if(q=b.value,this._advance(),this._match(j),L=this.expression(0),W={type:"KeyValuePair",name:q,value:L},h.push(W),this._lookahead(0)===g)this._match(g);else if(this._lookahead(0)===X){this._match(X);break}}return{type:"MultiSelectHash",children:h}}};function Vi(h){this.runtime=h}s(Vi,"TreeInterpreter"),Vi.prototype={search:function(h,N){return this.visit(h,N)},visit:function(h,N){var b,q,L,W,Q,se,Qe,Zt,De,G;switch(h.type){case"Field":return N!==null&&r(N)?(se=N[h.name],se===void 0?null:se):null;case"Subexpression":for(L=this.visit(h.children[0],N),G=1;G<h.children.length;G++)if(L=this.visit(h.children[1],L),L===null)return null;return L;case"IndexExpression":return Qe=this.visit(h.children[0],N),Zt=this.visit(h.children[1],Qe),Zt;case"Index":if(!e(N))return null;var er=h.value;return er<0&&(er=N.length+er),L=N[er],L===void 0&&(L=null),L;case"Slice":if(!e(N))return null;var Gf=h.children.slice(0),Ao=this.computeSliceParams(N.length,Gf),Ga=Ao[0],Ja=Ao[1],Io=Ao[2];if(L=[],Io>0)for(G=Ga;G<Ja;G+=Io)L.push(N[G]);else for(G=Ga;G>Ja;G+=Io)L.push(N[G]);return L;case"Projection":var Ot=this.visit(h.children[0],N);if(!e(Ot))return null;for(De=[],G=0;G<Ot.length;G++)q=this.visit(h.children[1],Ot[G]),q!==null&&De.push(q);return De;case"ValueProjection":if(Ot=this.visit(h.children[0],N),!r(Ot))return null;De=[];var Qa=o(Ot);for(G=0;G<Qa.length;G++)q=this.visit(h.children[1],Qa[G]),q!==null&&De.push(q);return De;case"FilterProjection":if(Ot=this.visit(h.children[0],N),!e(Ot))return null;var Ro=[],Ya=[];for(G=0;G<Ot.length;G++)b=this.visit(h.children[2],Ot[G]),n(b)||Ro.push(Ot[G]);for(var Oo=0;Oo<Ro.length;Oo++)q=this.visit(h.children[1],Ro[Oo]),q!==null&&Ya.push(q);return Ya;case"Comparator":switch(W=this.visit(h.children[0],N),Q=this.visit(h.children[1],N),h.name){case wr:L=i(W,Q);break;case pi:L=!i(W,Q);break;case xr:L=W>Q;break;case Nt:L=W>=Q;break;case Er:L=W<Q;break;case Cr:L=W<=Q;break;default:throw new Error("Unknown comparator: "+h.name)}return L;case It:var Do=this.visit(h.children[0],N);if(!e(Do))return null;var cs=[];for(G=0;G<Do.length;G++)q=Do[G],e(q)?cs.push.apply(cs,q):cs.push(q);return cs;case"Identity":return N;case"MultiSelectList":if(N===null)return null;for(De=[],G=0;G<h.children.length;G++)De.push(this.visit(h.children[G],N));return De;case"MultiSelectHash":if(N===null)return null;De={};var Po;for(G=0;G<h.children.length;G++)Po=h.children[G],De[Po.name]=this.visit(Po.value,N);return De;case"OrExpression":return b=this.visit(h.children[0],N),n(b)&&(b=this.visit(h.children[1],N)),b;case"AndExpression":return W=this.visit(h.children[0],N),n(W)===!0?W:this.visit(h.children[1],N);case"NotExpression":return W=this.visit(h.children[0],N),n(W);case"Literal":return h.value;case Fe:return Qe=this.visit(h.children[0],N),this.visit(h.children[1],Qe);case ne:return N;case"Function":var $a=[];for(G=0;G<h.children.length;G++)$a.push(this.visit(h.children[G],N));return this.runtime.callFunction(h.name,$a);case"ExpressionReference":var Za=h.children[0];return Za.jmespathType=We,Za;default:throw new Error("Unknown node type: "+h.type)}},computeSliceParams:function(h,N){var b=N[0],q=N[1],L=N[2],W=[null,null,null];if(L===null)L=1;else if(L===0){var Q=new Error("Invalid slice, step cannot be 0");throw Q.name="RuntimeError",Q}var se=L<0;return b===null?b=se?h-1:0:b=this.capSliceRange(h,b,L),q===null?q=se?-1:h:q=this.capSliceRange(h,q,L),W[0]=b,W[1]=q,W[2]=L,W},capSliceRange:function(h,N,b){return N<0?(N+=h,N<0&&(N=b<0?-1:0)):N>=h&&(N=b<0?h-1:h),N}};function Xa(h){this._interpreter=h,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[D]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[y,v]},{types:[f]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[y]},{types:[y]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[y,v,S]}]},map:{_func:this._functionMap,_signature:[{types:[x]},{types:[v]}]},max:{_func:this._functionMax,_signature:[{types:[D,E]}]},merge:{_func:this._functionMerge,_signature:[{types:[S],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[v]},{types:[x]}]},sum:{_func:this._functionSum,_signature:[{types:[D]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[y]},{types:[y]}]},min:{_func:this._functionMin,_signature:[{types:[D,E]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[v]},{types:[x]}]},type:{_func:this._functionType,_signature:[{types:[f]}]},keys:{_func:this._functionKeys,_signature:[{types:[S]}]},values:{_func:this._functionValues,_signature:[{types:[S]}]},sort:{_func:this._functionSort,_signature:[{types:[E,D]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[v]},{types:[x]}]},join:{_func:this._functionJoin,_signature:[{types:[y]},{types:[E]}]},reverse:{_func:this._functionReverse,_signature:[{types:[y,v]}]},to_array:{_func:this._functionToArray,_signature:[{types:[f]}]},to_string:{_func:this._functionToString,_signature:[{types:[f]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[f]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[f],variadic:!0}]}}}s(Xa,"Runtime"),Xa.prototype={callFunction:function(h,N){var b=this.functionTable[h];if(b===void 0)throw new Error("Unknown function: "+h+"()");return this._validateArgs(h,N,b._signature),b._func.call(this,N)},_validateArgs:function(h,N,b){var q;if(b[b.length-1].variadic){if(N.length<b.length)throw q=b.length===1?" argument":" arguments",new Error("ArgumentError: "+h+"() takes at least"+b.length+q+" but received "+N.length)}else if(N.length!==b.length)throw q=b.length===1?" argument":" arguments",new Error("ArgumentError: "+h+"() takes "+b.length+q+" but received "+N.length);for(var L,W,Q,se=0;se<b.length;se++){Q=!1,L=b[se].types,W=this._getTypeName(N[se]);for(var Qe=0;Qe<L.length;Qe++)if(this._typeMatches(W,L[Qe],N[se])){Q=!0;break}if(!Q){var Zt=L.map(function(De){return p[De]}).join(",");throw new Error("TypeError: "+h+"() expected argument "+(se+1)+" to be type "+Zt+" but received type "+p[W]+" instead.")}}},_typeMatches:function(h,N,b){if(N===f)return!0;if(N===E||N===D||N===v){if(N===v)return h===v;if(h===v){var q;N===D?q=l:N===E&&(q=y);for(var L=0;L<b.length;L++)if(!this._typeMatches(this._getTypeName(b[L]),q,b[L]))return!1;return!0}}else return h===N},_getTypeName:function(h){switch(Object.prototype.toString.call(h)){case"[object String]":return y;case"[object Number]":return l;case"[object Array]":return v;case"[object Boolean]":return I;case"[object Null]":return w;case"[object Object]":return h.jmespathType===We?x:S}},_functionStartsWith:function(h){return h[0].lastIndexOf(h[1])===0},_functionEndsWith:function(h){var N=h[0],b=h[1];return N.indexOf(b,N.length-b.length)!==-1},_functionReverse:function(h){var N=this._getTypeName(h[0]);if(N===y){for(var b=h[0],q="",L=b.length-1;L>=0;L--)q+=b[L];return q}else{var W=h[0].slice(0);return W.reverse(),W}},_functionAbs:function(h){return Math.abs(h[0])},_functionCeil:function(h){return Math.ceil(h[0])},_functionAvg:function(h){for(var N=0,b=h[0],q=0;q<b.length;q++)N+=b[q];return N/b.length},_functionContains:function(h){return h[0].indexOf(h[1])>=0},_functionFloor:function(h){return Math.floor(h[0])},_functionLength:function(h){return r(h[0])?Object.keys(h[0]).length:h[0].length},_functionMap:function(h){for(var N=[],b=this._interpreter,q=h[0],L=h[1],W=0;W<L.length;W++)N.push(b.visit(q,L[W]));return N},_functionMerge:function(h){for(var N={},b=0;b<h.length;b++){var q=h[b];for(var L in q)N[L]=q[L]}return N},_functionMax:function(h){if(h[0].length>0){var N=this._getTypeName(h[0][0]);if(N===l)return Math.max.apply(Math,h[0]);for(var b=h[0],q=b[0],L=1;L<b.length;L++)q.localeCompare(b[L])<0&&(q=b[L]);return q}else return null},_functionMin:function(h){if(h[0].length>0){var N=this._getTypeName(h[0][0]);if(N===l)return Math.min.apply(Math,h[0]);for(var b=h[0],q=b[0],L=1;L<b.length;L++)b[L].localeCompare(q)<0&&(q=b[L]);return q}else return null},_functionSum:function(h){for(var N=0,b=h[0],q=0;q<b.length;q++)N+=b[q];return N},_functionType:function(h){switch(this._getTypeName(h[0])){case l:return"number";case y:return"string";case v:return"array";case S:return"object";case I:return"boolean";case x:return"expref";case w:return"null"}},_functionKeys:function(h){return Object.keys(h[0])},_functionValues:function(h){for(var N=h[0],b=Object.keys(N),q=[],L=0;L<b.length;L++)q.push(N[b[L]]);return q},_functionJoin:function(h){var N=h[0],b=h[1];return b.join(N)},_functionToArray:function(h){return this._getTypeName(h[0])===v?h[0]:[h[0]]},_functionToString:function(h){return this._getTypeName(h[0])===y?h[0]:JSON.stringify(h[0])},_functionToNumber:function(h){var N=this._getTypeName(h[0]),b;return N===l?h[0]:N===y&&(b=+h[0],!isNaN(b))?b:null},_functionNotNull:function(h){for(var N=0;N<h.length;N++)if(this._getTypeName(h[N])!==w)return h[N];return null},_functionSort:function(h){var N=h[0].slice(0);return N.sort(),N},_functionSortBy:function(h){var N=h[0].slice(0);if(N.length===0)return N;var b=this._interpreter,q=h[1],L=this._getTypeName(b.visit(q,N[0]));if([l,y].indexOf(L)<0)throw new Error("TypeError");for(var W=this,Q=[],se=0;se<N.length;se++)Q.push([se,N[se]]);Q.sort(function(Zt,De){var G=b.visit(q,Zt[1]),er=b.visit(q,De[1]);if(W._getTypeName(G)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(G));if(W._getTypeName(er)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(er));return G>er?1:G<er?-1:Zt[0]-De[0]});for(var Qe=0;Qe<Q.length;Qe++)N[Qe]=Q[Qe][1];return N},_functionMaxBy:function(h){for(var N=h[1],b=h[0],q=this.createKeyFunction(N,[l,y]),L=-1/0,W,Q,se=0;se<b.length;se++)Q=q(b[se]),Q>L&&(L=Q,W=b[se]);return W},_functionMinBy:function(h){for(var N=h[1],b=h[0],q=this.createKeyFunction(N,[l,y]),L=1/0,W,Q,se=0;se<b.length;se++)Q=q(b[se]),Q<L&&(L=Q,W=b[se]);return W},createKeyFunction:function(h,N){var b=this,q=this._interpreter,L=s(function(W){var Q=q.visit(h,W);if(N.indexOf(b._getTypeName(Q))<0){var se="TypeError: expected one of "+N+", received "+b._getTypeName(Q);throw new Error(se)}return Q},"keyFunc");return L}};function jf(h){var N=new Ur,b=N.parse(h);return b}s(jf,"compile");function Kf(h){var N=new Bi;return N.tokenize(h)}s(Kf,"tokenize");function Xf(h,N){var b=new Ur,q=new Xa,L=new Vi(q);q._interpreter=L;var W=b.parse(N);return L.search(W,h)}s(Xf,"search"),t.tokenize=Kf,t.compile=jf,t.search=Xf,t.strictDeepEqual=i})(typeof Qs>"u"?Qs.jmespath={}:Qs)});var ll=P(()=>{var ae=V(),cl=ul(),Ey=ae.util.inherit,$s=ae.util.domain,Cy=Ys(),Sy={success:1,error:1,complete:1};function Ty(t){return Object.prototype.hasOwnProperty.call(Sy,t._asm.currentState)}s(Ty,"isTerminalState");var xa=new cl;xa.setupStates=function(){var t=s(function(e,r){var i=this;i._haltHandlersOnError=!1,i.emit(i._asm.currentState,function(n){if(n)if(Ty(i))if($s&&i.domain instanceof $s.Domain)n.domainEmitter=i,n.domain=i.domain,n.domainThrown=!1,i.domain.emit("error",n);else throw n;else i.response.error=n,r(n);else r(i.response.error)})},"transition");this.addState("validate","build","error",t),this.addState("build","afterBuild","restart",t),this.addState("afterBuild","sign","restart",t),this.addState("sign","send","retry",t),this.addState("retry","afterRetry","afterRetry",t),this.addState("afterRetry","sign","error",t),this.addState("send","validateResponse","retry",t),this.addState("validateResponse","extractData","extractError",t),this.addState("extractError","extractData","retry",t),this.addState("extractData","success","retry",t),this.addState("restart","build","error",t),this.addState("success","complete","complete",t),this.addState("error","complete","complete",t),this.addState("complete",null,null,t)};xa.setupStates();ae.Request=Ey({constructor:s(function(e,r,i){var n=e.endpoint,o=e.config.region,a=e.config.customUserAgent;e.signingRegion?o=e.signingRegion:e.isGlobalEndpoint&&(o="us-east-1"),this.domain=$s&&$s.active,this.service=e,this.operation=r,this.params=i||{},this.httpRequest=new ae.HttpRequest(n,o),this.httpRequest.appendToUserAgent(a),this.startTime=e.getSkewCorrectedDate(),this.response=new ae.Response(this),this._asm=new cl(xa.states,"validate"),this._haltHandlersOnError=!1,ae.SequentialExecutor.call(this),this.emit=this.emitEvent},"Request"),send:s(function(e){return e&&(this.httpRequest.appendToUserAgent("callback"),this.on("complete",function(r){e.call(r,r.error,r.data)})),this.runTo(),this.response},"send"),build:s(function(e){return this.runTo("send",e)},"build"),runTo:s(function(e,r){return this._asm.runTo(e,r,this),this},"runTo"),abort:s(function(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",s(function(r){r.error=ae.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1})},"addAbortedError")),this.httpRequest.stream&&!this.httpRequest.stream.didCallback&&(this.httpRequest.stream.abort(),this.httpRequest._abortCallback?this.httpRequest._abortCallback():this.removeAllListeners("send")),this},"abort"),eachPage:s(function(e){e=ae.util.fn.makeAsync(e,3);function r(i){e.call(i,i.error,i.data,function(n){n!==!1&&(i.hasNextPage()?i.nextPage().on("complete",r).send():e.call(i,null,null,ae.util.fn.noop))})}s(r,"wrappedCallback"),this.on("complete",r).send()},"eachPage"),eachItem:s(function(e){var r=this;function i(n,o){if(n)return e(n,null);if(o===null)return e(null,null);var a=r.service.paginationConfig(r.operation),u=a.resultKey;Array.isArray(u)&&(u=u[0]);var l=Cy.search(o,u),f=!0;return ae.util.arrayEach(l,function(y){if(f=e(null,y),f===!1)return ae.util.abort}),f}s(i,"wrappedCallback"),this.eachPage(i)},"eachItem"),isPageable:s(function(){return!!this.service.paginationConfig(this.operation)},"isPageable"),createReadStream:s(function(){var e=ae.util.stream,r=this,i=null;return ae.HttpClient.streamsApiVersion===2?(i=new e.PassThrough,process.nextTick(function(){r.send()})):(i=new e.Stream,i.readable=!0,i.sent=!1,i.on("newListener",function(n){!i.sent&&n==="data"&&(i.sent=!0,process.nextTick(function(){r.send()}))})),this.on("error",function(n){i.emit("error",n)}),this.on("httpHeaders",s(function(o,a,u){if(o<300){r.removeListener("httpData",ae.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",ae.EventListeners.Core.HTTP_ERROR),r.on("httpError",s(function(w){u.error=w,u.error.retryable=!1},"streamHttpError"));var l=!1,f;if(r.httpRequest.method!=="HEAD"&&(f=parseInt(a["content-length"],10)),f!==void 0&&!isNaN(f)&&f>=0){l=!0;var y=0}var v=s(function(){l&&y!==f?i.emit("error",ae.util.error(new Error("Stream content length mismatch. Received "+y+" of "+f+" bytes."),{code:"StreamContentLengthMismatch"})):ae.HttpClient.streamsApiVersion===2?i.end():i.emit("end")},"checkContentLengthAndEmit"),S=u.httpResponse.createUnbufferedStream();if(ae.HttpClient.streamsApiVersion===2)if(l){var I=new e.PassThrough;I._write=function(x){return x&&x.length&&(y+=x.length),e.PassThrough.prototype._write.apply(this,arguments)},I.on("end",v),i.on("error",function(x){l=!1,S.unpipe(I),I.emit("end"),I.end()}),S.pipe(I).pipe(i,{end:!1})}else S.pipe(i);else l&&S.on("data",function(x){x&&x.length&&(y+=x.length)}),S.on("data",function(x){i.emit("data",x)}),S.on("end",v);S.on("error",function(x){l=!1,i.emit("error",x)})}},"streamHeaders")),i},"createReadStream"),emitEvent:s(function(e,r,i){typeof r=="function"&&(i=r,r=null),i||(i=s(function(){},"done")),r||(r=this.eventParameters(e,this.response));var n=ae.SequentialExecutor.prototype.emit;n.call(this,e,r,function(o){o&&(this.response.error=o),i.call(this,o)})},"emit"),eventParameters:s(function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},"eventParameters"),presign:s(function(e,r){return!r&&typeof e=="function"&&(r=e,e=null),new ae.Signers.Presign().sign(this.toGet(),e,r)},"presign"),isPresigned:s(function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},"isPresigned"),toUnauthenticated:s(function(){return this._unAuthenticated=!0,this.removeListener("validate",ae.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",ae.EventListeners.Core.SIGN),this},"toUnauthenticated"),toGet:s(function(){return(this.service.api.protocol==="query"||this.service.api.protocol==="ec2")&&(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},"toGet"),buildAsGet:s(function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},"buildAsGet"),haltHandlersOnError:s(function(){this._haltHandlersOnError=!0},"haltHandlersOnError")});ae.Request.addPromisesToClass=s(function(e){this.prototype.promise=s(function(){var i=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(n,o){i.on("complete",function(a){a.error?o(a.error):n(Object.defineProperty(a.data||{},"$response",{value:a}))}),i.runTo()})},"promise")},"addPromisesToClass");ae.Request.deletePromisesFromClass=s(function(){delete this.prototype.promise},"deletePromisesFromClass");ae.util.addPromises(ae.Request);ae.util.mixin(ae.Request,ae.SequentialExecutor)});var hl=P(()=>{var Bn=V(),by=Bn.util.inherit,dl=Ys();Bn.Response=by({constructor:s(function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new Bn.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},"Response"),nextPage:s(function(e){var r,i=this.request.service,n=this.request.operation;try{r=i.paginationConfig(n,!0)}catch(l){this.error=l}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var o=Bn.util.copy(this.request.params);if(this.nextPageTokens){var a=r.inputToken;typeof a=="string"&&(a=[a]);for(var u=0;u<a.length;u++)o[a[u]]=this.nextPageTokens[u];return i.makeRequest(this.request.operation,o,e)}else return e?e(null,null):null},"nextPage"),hasNextPage:s(function(){if(this.cacheNextPageTokens(),this.nextPageTokens)return!0;if(this.nextPageTokens!==void 0)return!1},"hasNextPage"),cacheNextPageTokens:s(function(){if(Object.prototype.hasOwnProperty.call(this,"nextPageTokens"))return this.nextPageTokens;this.nextPageTokens=void 0;var e=this.request.service.paginationConfig(this.request.operation);if(!e)return this.nextPageTokens;if(this.nextPageTokens=null,e.moreResults&&!dl.search(this.data,e.moreResults))return this.nextPageTokens;var r=e.outputToken;return typeof r=="string"&&(r=[r]),Bn.util.arrayEach.call(this,r,function(i){var n=dl.search(this.data,i);n&&(this.nextPageTokens=this.nextPageTokens||[],this.nextPageTokens.push(n))}),this.nextPageTokens},"cacheNextPageTokens")})});var pl=P(()=>{var si=V(),Ay=si.util.inherit,Li=Ys();function fl(t){var e=t.request._waiter,r=e.config.acceptors,i=!1,n="retry";r.forEach(function(o){if(!i){var a=e.matchers[o.matcher];a&&a(t,o.expected,o.argument)&&(i=!0,n=o.state)}}),!i&&t.error&&(n="failure"),n==="success"?e.setSuccess(t):e.setError(t,n==="retry")}s(fl,"CHECK_ACCEPTORS");si.ResourceWaiter=Ay({constructor:s(function(e,r){this.service=e,this.state=r,this.loadWaiterConfig(this.state)},"constructor"),service:null,state:null,config:null,matchers:{path:function(t,e,r){try{var i=Li.search(t.data,r)}catch{return!1}return Li.strictDeepEqual(i,e)},pathAll:function(t,e,r){try{var i=Li.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);var n=i.length;if(!n)return!1;for(var o=0;o<n;o++)if(!Li.strictDeepEqual(i[o],e))return!1;return!0},pathAny:function(t,e,r){try{var i=Li.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);for(var n=i.length,o=0;o<n;o++)if(Li.strictDeepEqual(i[o],e))return!0;return!1},status:function(t,e){var r=t.httpResponse.statusCode;return typeof r=="number"&&r===e},error:function(t,e){return typeof e=="string"&&t.error?e===t.error.code:e===!!t.error}},listeners:new si.SequentialExecutor().addNamedListeners(function(t){t("RETRY_CHECK","retry",function(e){var r=e.request._waiter;e.error&&e.error.code==="ResourceNotReady"&&(e.error.retryDelay=(r.config.delay||0)*1e3)}),t("CHECK_OUTPUT","extractData",fl),t("CHECK_ERROR","extractError",fl)}),wait:s(function(e,r){typeof e=="function"&&(r=e,e=void 0),e&&e.$waiter&&(e=si.util.copy(e),typeof e.$waiter.delay=="number"&&(this.config.delay=e.$waiter.delay),typeof e.$waiter.maxAttempts=="number"&&(this.config.maxAttempts=e.$waiter.maxAttempts),delete e.$waiter);var i=this.service.makeRequest(this.config.operation,e);return i._waiter=this,i.response.maxRetries=this.config.maxAttempts,i.addListeners(this.listeners),r&&i.send(r),i},"wait"),setSuccess:s(function(e){e.error=null,e.data=e.data||{},e.request.removeAllListeners("extractData")},"setSuccess"),setError:s(function(e,r){e.data=null,e.error=si.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:r})},"setError"),loadWaiterConfig:s(function(e){if(!this.service.api.waiters[e])throw new si.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."});this.config=si.util.copy(this.service.api.waiters[e])},"loadWaiterConfig")})});var yl=P((X_,ml)=>{var yr=V(),Iy=yr.util.inherit;yr.Signers.V2=Iy(yr.Signers.RequestSigner,{addAuthorization:s(function(e,r){r||(r=yr.util.date.getDate());var i=this.request;i.params.Timestamp=yr.util.date.iso8601(r),i.params.SignatureVersion="2",i.params.SignatureMethod="HmacSHA256",i.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(i.params.SecurityToken=e.sessionToken),delete i.params.Signature,i.params.Signature=this.signature(e),i.body=yr.util.queryParamsToString(i.params),i.headers["Content-Length"]=i.body.length},"addAuthorization"),signature:s(function(e){return yr.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:s(function(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(yr.util.queryParamsToString(this.request.params)),e.join(`
4
- `)},"stringToSign")});ml.exports=yr.Signers.V2});var Ea=P((J_,vl)=>{var Jt=V(),Ry=Jt.util.inherit;Jt.Signers.V3=Ry(Jt.Signers.RequestSigner,{addAuthorization:s(function(e,r){var i=Jt.util.date.rfc822(r);this.request.headers["X-Amz-Date"]=i,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken),this.request.headers["X-Amzn-Authorization"]=this.authorization(e,i)},"addAuthorization"),authorization:s(function(e){return"AWS3 AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,SignedHeaders="+this.signedHeaders()+",Signature="+this.signature(e)},"authorization"),signedHeaders:s(function(){var e=[];return Jt.util.arrayEach(this.headersToSign(),s(function(i){e.push(i.toLowerCase())},"iterator")),e.sort().join(";")},"signedHeaders"),canonicalHeaders:s(function(){var e=this.request.headers,r=[];return Jt.util.arrayEach(this.headersToSign(),s(function(n){r.push(n.toLowerCase().trim()+":"+String(e[n]).trim())},"iterator")),r.sort().join(`
1
+ var rp=Object.create;var qs=Object.defineProperty;var ip=Object.getOwnPropertyDescriptor;var np=Object.getOwnPropertyNames;var op=Object.getPrototypeOf,sp=Object.prototype.hasOwnProperty;var o=(t,e)=>qs(t,"name",{value:e,configurable:!0}),te=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ap=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of np(e))!sp.call(t,n)&&n!==r&&qs(t,n,{get:()=>e[n],enumerable:!(i=ip(e,n))||i.enumerable});return t};var up=(t,e,r)=>(r=t!=null?rp(op(t)):{},ap(e||!t||!t.__esModule?qs(r,"default",{value:t,enumerable:!0}):r,t));var Lo=P((T_,Qu)=>{var ea=Oe();function Yu(){}o(Yu,"JsonBuilder");Yu.prototype.build=function(t,e){return JSON.stringify(ko(t,e))};function ko(t,e){if(!(!e||t===void 0||t===null))switch(e.type){case"structure":return Hp(t,e);case"map":return Kp(t,e);case"list":return jp(t,e);default:return Xp(t,e)}}o(ko,"translate");function Hp(t,e){if(e.isDocument)return t;var r={};return ea.each(t,function(i,n){var s=e.members[i];if(s){if(s.location!=="body")return;var a=s.isLocationName?s.name:i,u=ko(n,s);u!==void 0&&(r[a]=u)}}),r}o(Hp,"translateStructure");function jp(t,e){var r=[];return ea.arrayEach(t,function(i){var n=ko(i,e.member);n!==void 0&&r.push(n)}),r}o(jp,"translateList");function Kp(t,e){var r={};return ea.each(t,function(i,n){var s=ko(n,e.value);s!==void 0&&(r[i]=s)}),r}o(Kp,"translateMap");function Xp(t,e){return e.toWireFormat(t)}o(Xp,"translateScalar");Qu.exports=Yu});var Fo=P((A_,Zu)=>{var ta=Oe();function $u(){}o($u,"JsonParser");$u.prototype.parse=function(t,e){return Mo(JSON.parse(t),e)};function Mo(t,e){if(!(!e||t===void 0))switch(e.type){case"structure":return Gp(t,e);case"map":return Yp(t,e);case"list":return Jp(t,e);default:return Qp(t,e)}}o(Mo,"translate");function Gp(t,e){if(t!=null){if(e.isDocument)return t;var r={},i=e.members;return ta.each(i,function(n,s){var a=s.isLocationName?s.name:n;if(Object.prototype.hasOwnProperty.call(t,a)){var u=t[a],l=Mo(u,s);l!==void 0&&(r[n]=l)}}),r}}o(Gp,"translateStructure");function Jp(t,e){if(t!=null){var r=[];return ta.arrayEach(t,function(i){var n=Mo(i,e.member);n===void 0?r.push(null):r.push(n)}),r}}o(Jp,"translateList");function Yp(t,e){if(t!=null){var r={};return ta.each(t,function(i,n){var s=Mo(n,e.value);s===void 0?r[i]=null:r[i]=s}),r}}o(Yp,"translateMap");function Qp(t,e){return e.toType(t)}o(Qp,"translateScalar");Zu.exports=$u});var Wo=P((O_,ec)=>{var Pn=Oe(),$p=V();function Zp(t){var e=t.service.config.hostPrefixEnabled;if(!e)return t;var r=t.service.api.operations[t.operation];if(em(t))return t;if(r.endpoint&&r.endpoint.hostPrefix){var i=r.endpoint.hostPrefix,n=tm(i,t.params,r.input);rm(t.httpRequest.endpoint,n),im(t.httpRequest.endpoint.hostname)}return t}o(Zp,"populateHostPrefix");function em(t){var e=t.service.api,r=e.operations[t.operation],i=e.endpointOperation&&e.endpointOperation===Pn.string.lowerFirst(r.name);return r.endpointDiscoveryRequired!=="NULL"||i===!0}o(em,"hasEndpointDiscover");function tm(t,e,r){return Pn.each(r.members,function(i,n){if(n.hostLabel===!0){if(typeof e[i]!="string"||e[i]==="")throw Pn.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var s=new RegExp("\\{"+i+"\\}","g");t=t.replace(s,e[i])}}),t}o(tm,"expandHostPrefix");function rm(t,e){t.host&&(t.host=e+t.host),t.hostname&&(t.hostname=e+t.hostname)}o(rm,"prependEndpointPrefix");function im(t){var e=t.split("."),r=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;Pn.arrayEach(e,function(i){if(!i.length||i.length<1||i.length>63)throw Pn.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!r.test(i))throw $p.util.error(new Error,{code:"ValidationError",message:i+" is not hostname compatible."})})}o(im,"validateHostname");ec.exports={populateHostPrefix:Zp}});var Bo=P((D_,tc)=>{var nm=Oe(),om=Lo(),sm=Fo(),am=Wo().populateHostPrefix;function um(t){var e=t.httpRequest,r=t.service.api,i=r.targetPrefix+"."+r.operations[t.operation].name,n=r.jsonVersion||"1.0",s=r.operations[t.operation].input,a=new om;n===1&&(n="1.0"),e.body=a.build(t.params||{},s),e.headers["Content-Type"]="application/x-amz-json-"+n,e.headers["X-Amz-Target"]=i,am(t)}o(um,"buildRequest");function cm(t){var e={},r=t.httpResponse;if(e.code=r.headers["x-amzn-errortype"]||"UnknownError",typeof e.code=="string"&&(e.code=e.code.split(":")[0]),r.body.length>0)try{var i=JSON.parse(r.body.toString()),n=i.__type||i.code||i.Code;n&&(e.code=n.split("#").pop()),e.code==="RequestEntityTooLarge"?e.message="Request body must be less than 1 MB":e.message=i.message||i.Message||null}catch{e.statusCode=r.statusCode,e.message=r.statusMessage}else e.statusCode=r.statusCode,e.message=r.statusCode.toString();t.error=nm.error(new Error,e)}o(cm,"extractError");function lm(t){var e=t.httpResponse.body.toString()||"{}";if(t.request.service.config.convertResponseTypes===!1)t.data=JSON.parse(e);else{var r=t.request.service.api.operations[t.request.operation],i=r.output||{},n=new sm;t.data=n.parse(e,i)}}o(lm,"extractData");tc.exports={buildRequest:um,extractError:cm,extractData:lm}});var sc=P((__,oc)=>{var ra=Oe();function rc(){}o(rc,"QueryParamSerializer");rc.prototype.serialize=function(t,e,r){nc("",t,e,r)};function ic(t){return t.isQueryName||t.api.protocol!=="ec2"?t.name:t.name[0].toUpperCase()+t.name.substr(1)}o(ic,"ucfirst");function nc(t,e,r,i){ra.each(r.members,function(n,s){var a=e[n];if(a!=null){var u=ic(s);u=t?t+"."+u:u,Uo(u,a,s,i)}})}o(nc,"serializeStructure");function fm(t,e,r,i){var n=1;ra.each(e,function(s,a){var u=r.flattened?".":".entry.",l=u+n+++".",h=l+(r.key.name||"key"),y=l+(r.value.name||"value");Uo(t+h,s,r.key,i),Uo(t+y,a,r.value,i)})}o(fm,"serializeMap");function dm(t,e,r,i){var n=r.member||{};if(e.length===0){i.call(this,t,null);return}ra.arrayEach(e,function(s,a){var u="."+(a+1);if(r.api.protocol==="ec2")u=u+"";else if(r.flattened){if(n.name){var l=t.split(".");l.pop(),l.push(ic(n)),t=l.join(".")}}else u="."+(n.name?n.name:"member")+u;Uo(t+u,s,n,i)})}o(dm,"serializeList");function Uo(t,e,r,i){e!=null&&(r.type==="structure"?nc(t,e,r,i):r.type==="list"?dm(t,e,r,i):r.type==="map"?fm(t,e,r,i):i(t,r.toWireFormat(e).toString()))}o(Uo,"serializeMember");oc.exports=rc});var ia=P((k_,ac)=>{var hm=Oe().memoizedProperty;function pm(t,e,r,i){hm(this,i(t),function(){return r(t,e)})}o(pm,"memoize");function mm(t,e,r,i,n){i=i||String;var s=this;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(pm.call(s,a,t[a],r,i),n&&n(a,t[a]))}o(mm,"Collection");ac.exports=mm});var _n=P((M_,mc)=>{var ym=ia(),pr=Oe();function j(t,e,r){r!=null&&pr.property.apply(this,arguments)}o(j,"property");function ui(t,e){t.constructor.prototype[e]||pr.memoizedProperty.apply(this,arguments)}o(ui,"memoizedProperty");function ve(t,e,r){e=e||{},j(this,"shape",t.shape),j(this,"api",e.api,!1),j(this,"type",t.type),j(this,"enum",t.enum),j(this,"min",t.min),j(this,"max",t.max),j(this,"pattern",t.pattern),j(this,"location",t.location||this.location||"body"),j(this,"name",this.name||t.xmlName||t.queryName||t.locationName||r),j(this,"isStreaming",t.streaming||this.isStreaming||!1),j(this,"requiresLength",t.requiresLength,!1),j(this,"isComposite",t.isComposite||!1),j(this,"isShape",!0,!1),j(this,"isQueryName",Boolean(t.queryName),!1),j(this,"isLocationName",Boolean(t.locationName),!1),j(this,"isIdempotent",t.idempotencyToken===!0),j(this,"isJsonValue",t.jsonvalue===!0),j(this,"isSensitive",t.sensitive===!0||t.prototype&&t.prototype.sensitive===!0),j(this,"isEventStream",Boolean(t.eventstream),!1),j(this,"isEvent",Boolean(t.event),!1),j(this,"isEventPayload",Boolean(t.eventpayload),!1),j(this,"isEventHeader",Boolean(t.eventheader),!1),j(this,"isTimestampFormatSet",Boolean(t.timestampFormat)||t.prototype&&t.prototype.isTimestampFormatSet===!0,!1),j(this,"endpointDiscoveryId",Boolean(t.endpointdiscoveryid),!1),j(this,"hostLabel",Boolean(t.hostLabel),!1),e.documentation&&(j(this,"documentation",t.documentation),j(this,"documentationUrl",t.documentationUrl)),t.xmlAttribute&&j(this,"isXmlAttribute",t.xmlAttribute||!1),j(this,"defaultValue",null),this.toWireFormat=function(i){return i??""},this.toType=function(i){return i}}o(ve,"Shape");ve.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"};ve.types={structure:uc,list:cc,map:lc,boolean:pc,timestamp:vm,float:gm,integer:Nm,string:fc,base64:hc,binary:dc};ve.resolve=o(function(e,r){if(e.shape){var i=r.api.shapes[e.shape];if(!i)throw new Error("Cannot find shape reference: "+e.shape);return i}else return null},"resolve");ve.create=o(function(e,r,i){if(e.isShape)return e;var n=ve.resolve(e,r);if(n){var s=Object.keys(e);r.documentation||(s=s.filter(function(l){return!l.match(/documentation/)}));var a=o(function(){n.constructor.call(this,e,r,i)},"InlineShape");return a.prototype=n,new a}else{e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var u=e.type;if(ve.normalizedTypes[e.type]&&(e.type=ve.normalizedTypes[e.type]),ve.types[e.type])return new ve.types[e.type](e,r,i);throw new Error("Unrecognized shape type: "+u)}},"create");function na(t){ve.apply(this,arguments),j(this,"isComposite",!0),t.flattened&&j(this,"flattened",t.flattened||!1)}o(na,"CompositeShape");function uc(t,e){var r=this,i=null,n=!this.isShape;na.apply(this,arguments),n&&(j(this,"defaultValue",function(){return{}}),j(this,"members",{}),j(this,"memberNames",[]),j(this,"required",[]),j(this,"isRequired",function(){return!1}),j(this,"isDocument",Boolean(t.document))),t.members&&(j(this,"members",new ym(t.members,e,function(s,a){return ve.create(a,e,s)})),ui(this,"memberNames",function(){return t.xmlOrder||Object.keys(t.members)}),t.event&&(ui(this,"eventPayloadMemberName",function(){for(var s=r.members,a=r.memberNames,u=0,l=a.length;u<l;u++)if(s[a[u]].isEventPayload)return a[u]}),ui(this,"eventHeaderMemberNames",function(){for(var s=r.members,a=r.memberNames,u=[],l=0,h=a.length;l<h;l++)s[a[l]].isEventHeader&&u.push(a[l]);return u}))),t.required&&(j(this,"required",t.required),j(this,"isRequired",function(s){if(!i){i={};for(var a=0;a<t.required.length;a++)i[t.required[a]]=!0}return i[s]},!1,!0)),j(this,"resultWrapper",t.resultWrapper||null),t.payload&&j(this,"payload",t.payload),typeof t.xmlNamespace=="string"?j(this,"xmlNamespaceUri",t.xmlNamespace):typeof t.xmlNamespace=="object"&&(j(this,"xmlNamespacePrefix",t.xmlNamespace.prefix),j(this,"xmlNamespaceUri",t.xmlNamespace.uri))}o(uc,"StructureShape");function cc(t,e){var r=this,i=!this.isShape;if(na.apply(this,arguments),i&&j(this,"defaultValue",function(){return[]}),t.member&&ui(this,"member",function(){return ve.create(t.member,e)}),this.flattened){var n=this.name;ui(this,"name",function(){return r.member.name||n})}}o(cc,"ListShape");function lc(t,e){var r=!this.isShape;na.apply(this,arguments),r&&(j(this,"defaultValue",function(){return{}}),j(this,"key",ve.create({type:"string"},e)),j(this,"value",ve.create({type:"string"},e))),t.key&&ui(this,"key",function(){return ve.create(t.key,e)}),t.value&&ui(this,"value",function(){return ve.create(t.value,e)})}o(lc,"MapShape");function vm(t){var e=this;if(ve.apply(this,arguments),t.timestampFormat)j(this,"timestampFormat",t.timestampFormat);else if(e.isTimestampFormatSet&&this.timestampFormat)j(this,"timestampFormat",this.timestampFormat);else if(this.location==="header")j(this,"timestampFormat","rfc822");else if(this.location==="querystring")j(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":j(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":j(this,"timestampFormat","iso8601");break}this.toType=function(r){return r==null?null:typeof r.toUTCString=="function"?r:typeof r=="string"||typeof r=="number"?pr.date.parseTimestamp(r):null},this.toWireFormat=function(r){return pr.date.format(r,e.timestampFormat)}}o(vm,"TimestampShape");function fc(){ve.apply(this,arguments);var t=["rest-xml","query","ec2"];this.toType=function(e){return e=this.api&&t.indexOf(this.api.protocol)>-1?e||"":e,this.isJsonValue?JSON.parse(e):e&&typeof e.toString=="function"?e.toString():e},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}o(fc,"StringShape");function gm(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseFloat(t)},this.toWireFormat=this.toType}o(gm,"FloatShape");function Nm(){ve.apply(this,arguments),this.toType=function(t){return t==null?null:parseInt(t,10)},this.toWireFormat=this.toType}o(Nm,"IntegerShape");function dc(){ve.apply(this,arguments),this.toType=function(t){var e=pr.base64.decode(t);if(this.isSensitive&&pr.isNode()&&typeof pr.Buffer.alloc=="function"){var r=pr.Buffer.alloc(e.length,e);e.fill(0),e=r}return e},this.toWireFormat=pr.base64.encode}o(dc,"BinaryShape");function hc(){dc.apply(this,arguments)}o(hc,"Base64Shape");function pc(){ve.apply(this,arguments),this.toType=function(t){return typeof t=="boolean"?t:t==null?null:t==="true"}}o(pc,"BooleanShape");ve.shapes={StructureShape:uc,ListShape:cc,MapShape:lc,StringShape:fc,BooleanShape:pc,Base64Shape:hc};mc.exports=ve});var oa=P((W_,gc)=>{var vc=V(),qn=Oe(),wm=sc(),yc=_n(),Em=Wo().populateHostPrefix;function xm(t){var e=t.service.api.operations[t.operation],r=t.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:t.service.api.apiVersion,Action:e.name};var i=new wm;i.serialize(t.params,e.input,function(n,s){r.params[n]=s}),r.body=qn.queryParamsToString(r.params),Em(t)}o(xm,"buildRequest");function Cm(t){var e,r=t.httpResponse.body.toString();if(r.match("<UnknownOperationException"))e={Code:"UnknownOperation",Message:"Unknown operation "+t.request.operation};else try{e=new vc.XML.Parser().parse(r)}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.requestId&&!t.requestId&&(t.requestId=e.requestId),e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=qn.error(new Error,{code:e.Code,message:e.Message}):t.error=qn.error(new Error,{code:t.httpResponse.statusCode,message:null})}o(Cm,"extractError");function Sm(t){var e=t.request,r=e.service.api.operations[e.operation],i=r.output||{},n=i;if(n.resultWrapper){var s=yc.create({type:"structure"});s.members[n.resultWrapper]=i,s.memberNames=[n.resultWrapper],qn.property(i,"name",i.resultWrapper),i=s}var a=new vc.XML.Parser;if(i&&i.members&&!i.members._XAMZRequestId){var u=yc.create({type:"string"},{api:{protocol:"query"}},"requestId");i.members._XAMZRequestId=u}var l=a.parse(t.httpResponse.body.toString(),i);t.requestId=l._XAMZRequestId||l.requestId,l._XAMZRequestId&&delete l._XAMZRequestId,n.resultWrapper&&l[n.resultWrapper]&&(qn.update(l,l[n.resultWrapper]),delete l[n.resultWrapper]),t.data=l}o(Sm,"extractData");gc.exports={buildRequest:xm,extractError:Cm,extractData:Sm}});var kn=P((U_,wc)=>{var He=Oe(),Tm=Wo().populateHostPrefix;function bm(t){t.httpRequest.method=t.service.api.operations[t.operation].httpMethod}o(bm,"populateMethod");function Nc(t,e,r,i){var n=[t,e].join("/");n=n.replace(/\/+/g,"/");var s={},a=!1;if(He.each(r.members,function(l,h){var y=i[l];if(y!=null)if(h.location==="uri"){var v=new RegExp("\\{"+h.name+"(\\+)?\\}");n=n.replace(v,function(S,I){var E=I?He.uriEscapePath:He.uriEscape;return E(String(y))})}else h.location==="querystring"&&(a=!0,h.type==="list"?s[h.name]=y.map(function(S){return He.uriEscape(h.member.toWireFormat(S).toString())}):h.type==="map"?He.each(y,function(S,I){Array.isArray(I)?s[S]=I.map(function(E){return He.uriEscape(String(E))}):s[S]=He.uriEscape(String(I))}):s[h.name]=He.uriEscape(h.toWireFormat(y).toString()))}),a){n+=n.indexOf("?")>=0?"&":"?";var u=[];He.arrayEach(Object.keys(s).sort(),function(l){Array.isArray(s[l])||(s[l]=[s[l]]);for(var h=0;h<s[l].length;h++)u.push(He.uriEscape(String(l))+"="+s[l][h])}),n+=u.join("&")}return n}o(Nc,"generateURI");function Am(t){var e=t.service.api.operations[t.operation],r=e.input,i=Nc(t.httpRequest.endpoint.path,e.httpPath,r,t.params);t.httpRequest.path=i}o(Am,"populateURI");function Im(t){var e=t.service.api.operations[t.operation];He.each(e.input.members,function(r,i){var n=t.params[r];n!=null&&(i.location==="headers"&&i.type==="map"?He.each(n,function(s,a){t.httpRequest.headers[i.name+s]=a}):i.location==="header"&&(n=i.toWireFormat(n).toString(),i.isJsonValue&&(n=He.base64.encode(n)),t.httpRequest.headers[i.name]=n))})}o(Im,"populateHeaders");function Om(t){bm(t),Am(t),Im(t),Tm(t)}o(Om,"buildRequest");function Rm(){}o(Rm,"extractError");function Dm(t){var e=t.request,r={},i=t.httpResponse,n=e.service.api.operations[e.operation],s=n.output,a={};He.each(i.headers,function(u,l){a[u.toLowerCase()]=l}),He.each(s.members,function(u,l){var h=(l.name||u).toLowerCase();if(l.location==="headers"&&l.type==="map"){r[u]={};var y=l.isLocationName?l.name:"",v=new RegExp("^"+y+"(.+)","i");He.each(i.headers,function(I,E){var w=I.match(v);w!==null&&(r[u][w[1]]=E)})}else if(l.location==="header"){if(a[h]!==void 0){var S=l.isJsonValue?He.base64.decode(a[h]):a[h];r[u]=l.toType(S)}}else l.location==="statusCode"&&(r[u]=parseInt(i.statusCode,10))}),t.data=r}o(Dm,"extractData");wc.exports={buildRequest:Om,extractError:Rm,extractData:Dm,generateURI:Nc}});var ua=P((z_,Tc)=>{var aa=Oe(),xc=kn(),Cc=Bo(),Pm=Lo(),Ec=Fo(),Sc=["GET","HEAD","DELETE"];function _m(t){var e=aa.getRequestPayloadShape(t);e===void 0&&Sc.indexOf(t.httpRequest.method)>=0&&delete t.httpRequest.headers["Content-Length"]}o(_m,"unsetContentLength");function qm(t){var e=new Pm,r=t.service.api.operations[t.operation].input;if(r.payload){var i={},n=r.members[r.payload];i=t.params[r.payload],n.type==="structure"?(t.httpRequest.body=e.build(i||{},n),sa(t)):i!==void 0&&(t.httpRequest.body=i,(n.type==="binary"||n.isStreaming)&&sa(t,!0))}else t.httpRequest.body=e.build(t.params,r),sa(t)}o(qm,"populateBody");function sa(t,e){if(!t.httpRequest.headers["Content-Type"]){var r=e?"binary/octet-stream":"application/json";t.httpRequest.headers["Content-Type"]=r}}o(sa,"applyContentTypeHeader");function km(t){xc.buildRequest(t),Sc.indexOf(t.httpRequest.method)<0&&qm(t)}o(km,"buildRequest");function Lm(t){Cc.extractError(t)}o(Lm,"extractError");function Mm(t){xc.extractData(t);var e=t.request,r=e.service.api.operations[e.operation],i=e.service.api.operations[e.operation].output||{},n,s=r.hasEventOutput;if(i.payload){var a=i.members[i.payload],u=t.httpResponse.body;if(a.isEventStream)n=new Ec,t.data[payload]=aa.createEventStream(AWS.HttpClient.streamsApiVersion===2?t.httpResponse.stream:u,n,a);else if(a.type==="structure"||a.type==="list"){var n=new Ec;t.data[i.payload]=n.parse(u,a)}else a.type==="binary"||a.isStreaming?t.data[i.payload]=u:t.data[i.payload]=a.toType(u)}else{var l=t.data;Cc.extractData(t),t.data=aa.merge(l,t.data)}}o(Mm,"extractData");Tc.exports={buildRequest:km,extractError:Lm,extractData:Mm,unsetContentLength:_m}});var la=P((j_,bc)=>{var Ui=V(),Ln=Oe(),ca=kn();function Fm(t){var e=t.service.api.operations[t.operation].input,r=new Ui.XML.Builder,i=t.params,n=e.payload;if(n){var s=e.members[n];if(i=i[n],i===void 0)return;if(s.type==="structure"){var a=s.name;t.httpRequest.body=r.toXML(i,s,a,!0)}else t.httpRequest.body=i}else t.httpRequest.body=r.toXML(i,e,e.name||e.shape||Ln.string.upperFirst(t.operation)+"Request")}o(Fm,"populateBody");function Wm(t){ca.buildRequest(t),["GET","HEAD"].indexOf(t.httpRequest.method)<0&&Fm(t)}o(Wm,"buildRequest");function Bm(t){ca.extractError(t);var e;try{e=new Ui.XML.Parser().parse(t.httpResponse.body.toString())}catch{e={Code:t.httpResponse.statusCode,Message:t.httpResponse.statusMessage}}e.Errors&&(e=e.Errors),e.Error&&(e=e.Error),e.Code?t.error=Ln.error(new Error,{code:e.Code,message:e.Message}):t.error=Ln.error(new Error,{code:t.httpResponse.statusCode,message:null})}o(Bm,"extractError");function Um(t){ca.extractData(t);var e,r=t.request,i=t.httpResponse.body,n=r.service.api.operations[r.operation],s=n.output,a=n.hasEventOutput,u=s.payload;if(u){var l=s.members[u];l.isEventStream?(e=new Ui.XML.Parser,t.data[u]=Ln.createEventStream(Ui.HttpClient.streamsApiVersion===2?t.httpResponse.stream:t.httpResponse.body,e,l)):l.type==="structure"?(e=new Ui.XML.Parser,t.data[u]=e.parse(i.toString(),l)):l.type==="binary"||l.isStreaming?t.data[u]=i:t.data[u]=l.toType(i)}else if(i.length>0){e=new Ui.XML.Parser;var h=e.parse(i.toString(),s);Ln.update(t.data,h)}}o(Um,"extractData");bc.exports={buildRequest:Wm,extractError:Bm,extractData:Um}});var Ic=P((X_,Ac)=>{function Vm(t){return t.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}o(Vm,"escapeAttribute");Ac.exports={escapeAttribute:Vm}});var Rc=P((J_,Oc)=>{var zm=Ic().escapeAttribute;function Mn(t,e){e===void 0&&(e=[]),this.name=t,this.children=e,this.attributes={}}o(Mn,"XmlNode");Mn.prototype.addAttribute=function(t,e){return this.attributes[t]=e,this};Mn.prototype.addChildNode=function(t){return this.children.push(t),this};Mn.prototype.removeAttribute=function(t){return delete this.attributes[t],this};Mn.prototype.toString=function(){for(var t=Boolean(this.children.length),e="<"+this.name,r=this.attributes,i=0,n=Object.keys(r);i<n.length;i++){var s=n[i],a=r[s];typeof a<"u"&&a!==null&&(e+=" "+s+'="'+zm(""+a)+'"')}return e+=t?">"+this.children.map(function(u){return u.toString()}).join("")+"</"+this.name+">":"/>"};Oc.exports={XmlNode:Mn}});var Pc=P((Q_,Dc)=>{function Hm(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}o(Hm,"escapeElement");Dc.exports={escapeElement:Hm}});var kc=P((Z_,qc)=>{var jm=Pc().escapeElement;function _c(t){this.value=t}o(_c,"XmlText");_c.prototype.toString=function(){return jm(""+this.value)};qc.exports={XmlText:_c}});var Wc=P((tq,Fc)=>{var Vo=Oe(),ci=Rc().XmlNode,Km=kc().XmlText;function Lc(){}o(Lc,"XmlBuilder");Lc.prototype.toXML=function(t,e,r,i){var n=new ci(r);return Mc(n,e,!0),li(n,t,e),n.children.length>0||i?n.toString():""};function li(t,e,r){switch(r.type){case"structure":return Xm(t,e,r);case"map":return Gm(t,e,r);case"list":return Jm(t,e,r);default:return Ym(t,e,r)}}o(li,"serialize");function Xm(t,e,r){Vo.arrayEach(r.memberNames,function(i){var n=r.members[i];if(n.location==="body"){var s=e[i],a=n.name;if(s!=null)if(n.isXmlAttribute)t.addAttribute(a,s);else if(n.flattened)li(t,s,n);else{var u=new ci(a);t.addChildNode(u),Mc(u,n),li(u,s,n)}}})}o(Xm,"serializeStructure");function Gm(t,e,r){var i=r.key.name||"key",n=r.value.name||"value";Vo.each(e,function(s,a){var u=new ci(r.flattened?r.name:"entry");t.addChildNode(u);var l=new ci(i),h=new ci(n);u.addChildNode(l),u.addChildNode(h),li(l,s,r.key),li(h,a,r.value)})}o(Gm,"serializeMap");function Jm(t,e,r){r.flattened?Vo.arrayEach(e,function(i){var n=r.member.name||r.name,s=new ci(n);t.addChildNode(s),li(s,i,r.member)}):Vo.arrayEach(e,function(i){var n=r.member.name||"member",s=new ci(n);t.addChildNode(s),li(s,i,r.member)})}o(Jm,"serializeList");function Ym(t,e,r){t.addChildNode(new Km(r.toWireFormat(e)))}o(Ym,"serializeScalar");function Mc(t,e,r){var i,n="xmlns";e.xmlNamespaceUri?(i=e.xmlNamespaceUri,e.xmlNamespacePrefix&&(n+=":"+e.xmlNamespacePrefix)):r&&e.api.xmlNamespaceUri&&(i=e.api.xmlNamespaceUri),i&&t.addAttribute(n,i)}o(Mc,"applyNamespaces");Fc.exports=Lc});var fa=P((iq,Uc)=>{var Fn=_n(),Bc=Oe(),Xt=Bc.property,Vi=Bc.memoizedProperty;function Qm(t,e,r){var i=this;r=r||{},Xt(this,"name",e.name||t),Xt(this,"api",r.api,!1),e.http=e.http||{},Xt(this,"endpoint",e.endpoint),Xt(this,"httpMethod",e.http.method||"POST"),Xt(this,"httpPath",e.http.requestUri||"/"),Xt(this,"authtype",e.authtype||""),Xt(this,"endpointDiscoveryRequired",e.endpointdiscovery?e.endpointdiscovery.required?"REQUIRED":"OPTIONAL":"NULL");var n=e.httpChecksumRequired||e.httpChecksum&&e.httpChecksum.requestChecksumRequired;Xt(this,"httpChecksumRequired",n,!1),Vi(this,"input",function(){return e.input?Fn.create(e.input,r):new Fn.create({type:"structure"},r)}),Vi(this,"output",function(){return e.output?Fn.create(e.output,r):new Fn.create({type:"structure"},r)}),Vi(this,"errors",function(){var s=[];if(!e.errors)return null;for(var a=0;a<e.errors.length;a++)s.push(Fn.create(e.errors[a],r));return s}),Vi(this,"paginator",function(){return r.api.paginators[t]}),r.documentation&&(Xt(this,"documentation",e.documentation),Xt(this,"documentationUrl",e.documentationUrl)),Vi(this,"idempotentMembers",function(){var s=[],a=i.input,u=a.members;if(!a.members)return s;for(var l in u)u.hasOwnProperty(l)&&u[l].isIdempotent===!0&&s.push(l);return s}),Vi(this,"hasEventOutput",function(){var s=i.output;return $m(s)})}o(Qm,"Operation");function $m(t){var e=t.members,r=t.payload;if(!t.members)return!1;if(r){var i=e[r];return i.isEventStream}for(var n in e)if(!e.hasOwnProperty(n)&&e[n].isEventStream===!0)return!0;return!1}o($m,"hasEventStream");Uc.exports=Qm});var da=P((oq,Vc)=>{var Wn=Oe().property;function Zm(t,e){Wn(this,"inputToken",e.input_token),Wn(this,"limitKey",e.limit_key),Wn(this,"moreResults",e.more_results),Wn(this,"outputToken",e.output_token),Wn(this,"resultKey",e.result_key)}o(Zm,"Paginator");Vc.exports=Zm});var ha=P((aq,Hc)=>{var zc=Oe(),zo=zc.property;function ey(t,e,r){r=r||{},zo(this,"name",t),zo(this,"api",r.api,!1),e.operation&&zo(this,"operation",zc.string.lowerFirst(e.operation));var i=this,n=["type","description","delay","maxAttempts","acceptors"];n.forEach(function(s){var a=e[s];a&&zo(i,s,a)})}o(ey,"ResourceWaiter");Hc.exports=ey});var pa=P((cq,ty)=>{ty.exports={acm:{name:"ACM",cors:!0},apigateway:{name:"APIGateway",cors:!0},applicationautoscaling:{prefix:"application-autoscaling",name:"ApplicationAutoScaling",cors:!0},appstream:{name:"AppStream"},autoscaling:{name:"AutoScaling",cors:!0},batch:{name:"Batch"},budgets:{name:"Budgets"},clouddirectory:{name:"CloudDirectory",versions:["2016-05-10*"]},cloudformation:{name:"CloudFormation",cors:!0},cloudfront:{name:"CloudFront",versions:["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*","2019-03-26*"],cors:!0},cloudhsm:{name:"CloudHSM",cors:!0},cloudsearch:{name:"CloudSearch"},cloudsearchdomain:{name:"CloudSearchDomain"},cloudtrail:{name:"CloudTrail",cors:!0},cloudwatch:{prefix:"monitoring",name:"CloudWatch",cors:!0},cloudwatchevents:{prefix:"events",name:"CloudWatchEvents",versions:["2014-02-03*"],cors:!0},cloudwatchlogs:{prefix:"logs",name:"CloudWatchLogs",cors:!0},codebuild:{name:"CodeBuild",cors:!0},codecommit:{name:"CodeCommit",cors:!0},codedeploy:{name:"CodeDeploy",cors:!0},codepipeline:{name:"CodePipeline",cors:!0},cognitoidentity:{prefix:"cognito-identity",name:"CognitoIdentity",cors:!0},cognitoidentityserviceprovider:{prefix:"cognito-idp",name:"CognitoIdentityServiceProvider",cors:!0},cognitosync:{prefix:"cognito-sync",name:"CognitoSync",cors:!0},configservice:{prefix:"config",name:"ConfigService",cors:!0},cur:{name:"CUR",cors:!0},datapipeline:{name:"DataPipeline"},devicefarm:{name:"DeviceFarm",cors:!0},directconnect:{name:"DirectConnect",cors:!0},directoryservice:{prefix:"ds",name:"DirectoryService"},discovery:{name:"Discovery"},dms:{name:"DMS"},dynamodb:{name:"DynamoDB",cors:!0},dynamodbstreams:{prefix:"streams.dynamodb",name:"DynamoDBStreams",cors:!0},ec2:{name:"EC2",versions:["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],cors:!0},ecr:{name:"ECR",cors:!0},ecs:{name:"ECS",cors:!0},efs:{prefix:"elasticfilesystem",name:"EFS",cors:!0},elasticache:{name:"ElastiCache",versions:["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],cors:!0},elasticbeanstalk:{name:"ElasticBeanstalk",cors:!0},elb:{prefix:"elasticloadbalancing",name:"ELB",cors:!0},elbv2:{prefix:"elasticloadbalancingv2",name:"ELBv2",cors:!0},emr:{prefix:"elasticmapreduce",name:"EMR",cors:!0},es:{name:"ES"},elastictranscoder:{name:"ElasticTranscoder",cors:!0},firehose:{name:"Firehose",cors:!0},gamelift:{name:"GameLift",cors:!0},glacier:{name:"Glacier"},health:{name:"Health"},iam:{name:"IAM",cors:!0},importexport:{name:"ImportExport"},inspector:{name:"Inspector",versions:["2015-08-18*"],cors:!0},iot:{name:"Iot",cors:!0},iotdata:{prefix:"iot-data",name:"IotData",cors:!0},kinesis:{name:"Kinesis",cors:!0},kinesisanalytics:{name:"KinesisAnalytics"},kms:{name:"KMS",cors:!0},lambda:{name:"Lambda",cors:!0},lexruntime:{prefix:"runtime.lex",name:"LexRuntime",cors:!0},lightsail:{name:"Lightsail"},machinelearning:{name:"MachineLearning",cors:!0},marketplacecommerceanalytics:{name:"MarketplaceCommerceAnalytics",cors:!0},marketplacemetering:{prefix:"meteringmarketplace",name:"MarketplaceMetering"},mturk:{prefix:"mturk-requester",name:"MTurk",cors:!0},mobileanalytics:{name:"MobileAnalytics",cors:!0},opsworks:{name:"OpsWorks",cors:!0},opsworkscm:{name:"OpsWorksCM"},organizations:{name:"Organizations"},pinpoint:{name:"Pinpoint"},polly:{name:"Polly",cors:!0},rds:{name:"RDS",versions:["2014-09-01*"],cors:!0},redshift:{name:"Redshift",cors:!0},rekognition:{name:"Rekognition",cors:!0},resourcegroupstaggingapi:{name:"ResourceGroupsTaggingAPI"},route53:{name:"Route53",cors:!0},route53domains:{name:"Route53Domains",cors:!0},s3:{name:"S3",dualstackAvailable:!0,cors:!0},s3control:{name:"S3Control",dualstackAvailable:!0,xmlNoDefaultLists:!0},servicecatalog:{name:"ServiceCatalog",cors:!0},ses:{prefix:"email",name:"SES",cors:!0},shield:{name:"Shield"},simpledb:{prefix:"sdb",name:"SimpleDB"},sms:{name:"SMS"},snowball:{name:"Snowball"},sns:{name:"SNS",cors:!0},sqs:{name:"SQS",cors:!0},ssm:{name:"SSM",cors:!0},storagegateway:{name:"StorageGateway",cors:!0},stepfunctions:{prefix:"states",name:"StepFunctions"},sts:{name:"STS",cors:!0},support:{name:"Support"},swf:{name:"SWF"},xray:{name:"XRay",cors:!0},waf:{name:"WAF",cors:!0},wafregional:{prefix:"waf-regional",name:"WAFRegional"},workdocs:{name:"WorkDocs",cors:!0},workspaces:{name:"WorkSpaces"},codestar:{name:"CodeStar"},lexmodelbuildingservice:{prefix:"lex-models",name:"LexModelBuildingService",cors:!0},marketplaceentitlementservice:{prefix:"entitlement.marketplace",name:"MarketplaceEntitlementService"},athena:{name:"Athena",cors:!0},greengrass:{name:"Greengrass"},dax:{name:"DAX"},migrationhub:{prefix:"AWSMigrationHub",name:"MigrationHub"},cloudhsmv2:{name:"CloudHSMV2",cors:!0},glue:{name:"Glue"},mobile:{name:"Mobile"},pricing:{name:"Pricing",cors:!0},costexplorer:{prefix:"ce",name:"CostExplorer",cors:!0},mediaconvert:{name:"MediaConvert"},medialive:{name:"MediaLive"},mediapackage:{name:"MediaPackage"},mediastore:{name:"MediaStore"},mediastoredata:{prefix:"mediastore-data",name:"MediaStoreData",cors:!0},appsync:{name:"AppSync"},guardduty:{name:"GuardDuty"},mq:{name:"MQ"},comprehend:{name:"Comprehend",cors:!0},iotjobsdataplane:{prefix:"iot-jobs-data",name:"IoTJobsDataPlane"},kinesisvideoarchivedmedia:{prefix:"kinesis-video-archived-media",name:"KinesisVideoArchivedMedia",cors:!0},kinesisvideomedia:{prefix:"kinesis-video-media",name:"KinesisVideoMedia",cors:!0},kinesisvideo:{name:"KinesisVideo",cors:!0},sagemakerruntime:{prefix:"runtime.sagemaker",name:"SageMakerRuntime"},sagemaker:{name:"SageMaker"},translate:{name:"Translate",cors:!0},resourcegroups:{prefix:"resource-groups",name:"ResourceGroups",cors:!0},alexaforbusiness:{name:"AlexaForBusiness"},cloud9:{name:"Cloud9"},serverlessapplicationrepository:{prefix:"serverlessrepo",name:"ServerlessApplicationRepository"},servicediscovery:{name:"ServiceDiscovery"},workmail:{name:"WorkMail"},autoscalingplans:{prefix:"autoscaling-plans",name:"AutoScalingPlans"},transcribeservice:{prefix:"transcribe",name:"TranscribeService"},connect:{name:"Connect",cors:!0},acmpca:{prefix:"acm-pca",name:"ACMPCA"},fms:{name:"FMS"},secretsmanager:{name:"SecretsManager",cors:!0},iotanalytics:{name:"IoTAnalytics",cors:!0},iot1clickdevicesservice:{prefix:"iot1click-devices",name:"IoT1ClickDevicesService"},iot1clickprojects:{prefix:"iot1click-projects",name:"IoT1ClickProjects"},pi:{name:"PI"},neptune:{name:"Neptune"},mediatailor:{name:"MediaTailor"},eks:{name:"EKS"},macie:{name:"Macie"},dlm:{name:"DLM"},signer:{name:"Signer"},chime:{name:"Chime"},pinpointemail:{prefix:"pinpoint-email",name:"PinpointEmail"},ram:{name:"RAM"},route53resolver:{name:"Route53Resolver"},pinpointsmsvoice:{prefix:"sms-voice",name:"PinpointSMSVoice"},quicksight:{name:"QuickSight"},rdsdataservice:{prefix:"rds-data",name:"RDSDataService"},amplify:{name:"Amplify"},datasync:{name:"DataSync"},robomaker:{name:"RoboMaker"},transfer:{name:"Transfer"},globalaccelerator:{name:"GlobalAccelerator"},comprehendmedical:{name:"ComprehendMedical",cors:!0},kinesisanalyticsv2:{name:"KinesisAnalyticsV2"},mediaconnect:{name:"MediaConnect"},fsx:{name:"FSx"},securityhub:{name:"SecurityHub"},appmesh:{name:"AppMesh",versions:["2018-10-01*"]},licensemanager:{prefix:"license-manager",name:"LicenseManager"},kafka:{name:"Kafka"},apigatewaymanagementapi:{name:"ApiGatewayManagementApi"},apigatewayv2:{name:"ApiGatewayV2"},docdb:{name:"DocDB"},backup:{name:"Backup"},worklink:{name:"WorkLink"},textract:{name:"Textract"},managedblockchain:{name:"ManagedBlockchain"},mediapackagevod:{prefix:"mediapackage-vod",name:"MediaPackageVod"},groundstation:{name:"GroundStation"},iotthingsgraph:{name:"IoTThingsGraph"},iotevents:{name:"IoTEvents"},ioteventsdata:{prefix:"iotevents-data",name:"IoTEventsData"},personalize:{name:"Personalize",cors:!0},personalizeevents:{prefix:"personalize-events",name:"PersonalizeEvents",cors:!0},personalizeruntime:{prefix:"personalize-runtime",name:"PersonalizeRuntime",cors:!0},applicationinsights:{prefix:"application-insights",name:"ApplicationInsights"},servicequotas:{prefix:"service-quotas",name:"ServiceQuotas"},ec2instanceconnect:{prefix:"ec2-instance-connect",name:"EC2InstanceConnect"},eventbridge:{name:"EventBridge"},lakeformation:{name:"LakeFormation"},forecastservice:{prefix:"forecast",name:"ForecastService",cors:!0},forecastqueryservice:{prefix:"forecastquery",name:"ForecastQueryService",cors:!0},qldb:{name:"QLDB"},qldbsession:{prefix:"qldb-session",name:"QLDBSession"},workmailmessageflow:{name:"WorkMailMessageFlow"},codestarnotifications:{prefix:"codestar-notifications",name:"CodeStarNotifications"},savingsplans:{name:"SavingsPlans"},sso:{name:"SSO"},ssooidc:{prefix:"sso-oidc",name:"SSOOIDC"},marketplacecatalog:{prefix:"marketplace-catalog",name:"MarketplaceCatalog",cors:!0},dataexchange:{name:"DataExchange"},sesv2:{name:"SESV2"},migrationhubconfig:{prefix:"migrationhub-config",name:"MigrationHubConfig"},connectparticipant:{name:"ConnectParticipant"},appconfig:{name:"AppConfig"},iotsecuretunneling:{name:"IoTSecureTunneling"},wafv2:{name:"WAFV2"},elasticinference:{prefix:"elastic-inference",name:"ElasticInference"},imagebuilder:{name:"Imagebuilder"},schemas:{name:"Schemas"},accessanalyzer:{name:"AccessAnalyzer"},codegurureviewer:{prefix:"codeguru-reviewer",name:"CodeGuruReviewer"},codeguruprofiler:{name:"CodeGuruProfiler"},computeoptimizer:{prefix:"compute-optimizer",name:"ComputeOptimizer"},frauddetector:{name:"FraudDetector"},kendra:{name:"Kendra"},networkmanager:{name:"NetworkManager"},outposts:{name:"Outposts"},augmentedairuntime:{prefix:"sagemaker-a2i-runtime",name:"AugmentedAIRuntime"},ebs:{name:"EBS"},kinesisvideosignalingchannels:{prefix:"kinesis-video-signaling",name:"KinesisVideoSignalingChannels",cors:!0},detective:{name:"Detective"},codestarconnections:{prefix:"codestar-connections",name:"CodeStarconnections"},synthetics:{name:"Synthetics"},iotsitewise:{name:"IoTSiteWise"},macie2:{name:"Macie2"},codeartifact:{name:"CodeArtifact"},honeycode:{name:"Honeycode"},ivs:{name:"IVS"},braket:{name:"Braket"},identitystore:{name:"IdentityStore"},appflow:{name:"Appflow"},redshiftdata:{prefix:"redshift-data",name:"RedshiftData"},ssoadmin:{prefix:"sso-admin",name:"SSOAdmin"},timestreamquery:{prefix:"timestream-query",name:"TimestreamQuery"},timestreamwrite:{prefix:"timestream-write",name:"TimestreamWrite"},s3outposts:{name:"S3Outposts"},databrew:{name:"DataBrew"},servicecatalogappregistry:{prefix:"servicecatalog-appregistry",name:"ServiceCatalogAppRegistry"},networkfirewall:{prefix:"network-firewall",name:"NetworkFirewall"},mwaa:{name:"MWAA"},amplifybackend:{name:"AmplifyBackend"},appintegrations:{name:"AppIntegrations"},connectcontactlens:{prefix:"connect-contact-lens",name:"ConnectContactLens"},devopsguru:{prefix:"devops-guru",name:"DevOpsGuru"},ecrpublic:{prefix:"ecr-public",name:"ECRPUBLIC"},lookoutvision:{name:"LookoutVision"},sagemakerfeaturestoreruntime:{prefix:"sagemaker-featurestore-runtime",name:"SageMakerFeatureStoreRuntime"},customerprofiles:{prefix:"customer-profiles",name:"CustomerProfiles"},auditmanager:{name:"AuditManager"},emrcontainers:{prefix:"emr-containers",name:"EMRcontainers"},healthlake:{name:"HealthLake"},sagemakeredge:{prefix:"sagemaker-edge",name:"SagemakerEdge"},amp:{name:"Amp"},greengrassv2:{name:"GreengrassV2"},iotdeviceadvisor:{name:"IotDeviceAdvisor"},iotfleethub:{name:"IoTFleetHub"},iotwireless:{name:"IoTWireless"},location:{name:"Location",cors:!0},wellarchitected:{name:"WellArchitected"},lexmodelsv2:{prefix:"models.lex.v2",name:"LexModelsV2"},lexruntimev2:{prefix:"runtime.lex.v2",name:"LexRuntimeV2",cors:!0},fis:{name:"Fis"},lookoutmetrics:{name:"LookoutMetrics"},mgn:{name:"Mgn"},lookoutequipment:{name:"LookoutEquipment"},nimble:{name:"Nimble"},finspace:{name:"Finspace"},finspacedata:{prefix:"finspace-data",name:"Finspacedata"},ssmcontacts:{prefix:"ssm-contacts",name:"SSMContacts"},ssmincidents:{prefix:"ssm-incidents",name:"SSMIncidents"},applicationcostprofiler:{name:"ApplicationCostProfiler"},apprunner:{name:"AppRunner"},proton:{name:"Proton"},route53recoverycluster:{prefix:"route53-recovery-cluster",name:"Route53RecoveryCluster"},route53recoverycontrolconfig:{prefix:"route53-recovery-control-config",name:"Route53RecoveryControlConfig"},route53recoveryreadiness:{prefix:"route53-recovery-readiness",name:"Route53RecoveryReadiness"},chimesdkidentity:{prefix:"chime-sdk-identity",name:"ChimeSDKIdentity"},chimesdkmessaging:{prefix:"chime-sdk-messaging",name:"ChimeSDKMessaging"},snowdevicemanagement:{prefix:"snow-device-management",name:"SnowDeviceManagement"},memorydb:{name:"MemoryDB"},opensearch:{name:"OpenSearch"},kafkaconnect:{name:"KafkaConnect"},voiceid:{prefix:"voice-id",name:"VoiceID"},wisdom:{name:"Wisdom"},account:{name:"Account"},cloudcontrol:{name:"CloudControl"},grafana:{name:"Grafana"},panorama:{name:"Panorama"},chimesdkmeetings:{prefix:"chime-sdk-meetings",name:"ChimeSDKMeetings"},resiliencehub:{name:"Resiliencehub"},migrationhubstrategy:{name:"MigrationHubStrategy"},appconfigdata:{name:"AppConfigData"},drs:{name:"Drs"},migrationhubrefactorspaces:{prefix:"migration-hub-refactor-spaces",name:"MigrationHubRefactorSpaces"},evidently:{name:"Evidently"},inspector2:{name:"Inspector2"},rbin:{name:"Rbin"},rum:{name:"RUM"},backupgateway:{prefix:"backup-gateway",name:"BackupGateway"},iottwinmaker:{name:"IoTTwinMaker"},workspacesweb:{prefix:"workspaces-web",name:"WorkSpacesWeb"},amplifyuibuilder:{name:"AmplifyUIBuilder"},keyspaces:{name:"Keyspaces"},billingconductor:{name:"Billingconductor"},gamesparks:{name:"GameSparks"},pinpointsmsvoicev2:{prefix:"pinpoint-sms-voice-v2",name:"PinpointSMSVoiceV2"},ivschat:{name:"Ivschat"},chimesdkmediapipelines:{prefix:"chime-sdk-media-pipelines",name:"ChimeSDKMediaPipelines"},emrserverless:{prefix:"emr-serverless",name:"EMRServerless"},m2:{name:"M2"},connectcampaigns:{name:"ConnectCampaigns"},redshiftserverless:{prefix:"redshift-serverless",name:"RedshiftServerless"},rolesanywhere:{name:"RolesAnywhere"},licensemanagerusersubscriptions:{prefix:"license-manager-user-subscriptions",name:"LicenseManagerUserSubscriptions"},backupstorage:{name:"BackupStorage"},privatenetworks:{name:"PrivateNetworks"},supportapp:{prefix:"support-app",name:"SupportApp"},controltower:{name:"ControlTower"},iotfleetwise:{name:"IoTFleetWise"},migrationhuborchestrator:{name:"MigrationHubOrchestrator"},connectcases:{name:"ConnectCases"},resourceexplorer2:{prefix:"resource-explorer-2",name:"ResourceExplorer2"},scheduler:{name:"Scheduler"}}});var ma=P((lq,Kc)=>{var Ho=ia(),ry=fa(),iy=_n(),ny=da(),oy=ha(),jc=pa(),Bn=Oe(),ge=Bn.property,sy=Bn.memoizedProperty;function ay(t,e){var r=this;t=t||{},e=e||{},e.api=this,t.metadata=t.metadata||{};var i=e.serviceIdentifier;delete e.serviceIdentifier,ge(this,"isApi",!0,!1),ge(this,"apiVersion",t.metadata.apiVersion),ge(this,"endpointPrefix",t.metadata.endpointPrefix),ge(this,"signingName",t.metadata.signingName),ge(this,"globalEndpoint",t.metadata.globalEndpoint),ge(this,"signatureVersion",t.metadata.signatureVersion),ge(this,"jsonVersion",t.metadata.jsonVersion),ge(this,"targetPrefix",t.metadata.targetPrefix),ge(this,"protocol",t.metadata.protocol),ge(this,"timestampFormat",t.metadata.timestampFormat),ge(this,"xmlNamespaceUri",t.metadata.xmlNamespace),ge(this,"abbreviation",t.metadata.serviceAbbreviation),ge(this,"fullName",t.metadata.serviceFullName),ge(this,"serviceId",t.metadata.serviceId),i&&jc[i]&&ge(this,"xmlNoDefaultLists",jc[i].xmlNoDefaultLists,!1),sy(this,"className",function(){var s=t.metadata.serviceAbbreviation||t.metadata.serviceFullName;return s?(s=s.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g,""),s==="ElasticLoadBalancing"&&(s="ELB"),s):null});function n(s,a){a.endpointoperation===!0&&ge(r,"endpointOperation",Bn.string.lowerFirst(s)),a.endpointdiscovery&&!r.hasRequiredEndpointDiscovery&&ge(r,"hasRequiredEndpointDiscovery",a.endpointdiscovery.required===!0)}o(n,"addEndpointOperation"),ge(this,"operations",new Ho(t.operations,e,function(s,a){return new ry(s,a,e)},Bn.string.lowerFirst,n)),ge(this,"shapes",new Ho(t.shapes,e,function(s,a){return iy.create(a,e)})),ge(this,"paginators",new Ho(t.paginators,e,function(s,a){return new ny(s,a,e)})),ge(this,"waiters",new Ho(t.waiters,e,function(s,a){return new oy(s,a,e)},Bn.string.lowerFirst)),e.documentation&&(ge(this,"documentation",t.documentation),ge(this,"documentationUrl",t.documentationUrl)),ge(this,"awsQueryCompatible",t.metadata.awsQueryCompatible)}o(ay,"Api");Kc.exports=ay});var Gc=P((dq,Xc)=>{function jo(t,e){if(!jo.services.hasOwnProperty(t))throw new Error("InvalidService: Failed to load api for "+t);return jo.services[t][e]}o(jo,"apiLoader");jo.services={};Xc.exports=jo});var Jc=P(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var uy=function(){function t(e,r){this.key=e,this.value=r}return o(t,"LinkedListNode"),t}(),cy=function(){function t(e){if(this.nodeMap={},this.size=0,typeof e!="number"||e<1)throw new Error("Cache size can only be positive number");this.sizeLimit=e}return o(t,"LRUCache"),Object.defineProperty(t.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),t.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},t.prototype.removeFromTail=function(){if(this.tailNode){var e=this.tailNode,r=e.prev;return r&&(r.next=void 0),e.prev=void 0,this.tailNode=r,this.size--,e}},t.prototype.detachFromList=function(e){this.headerNode===e&&(this.headerNode=e.next),this.tailNode===e&&(this.tailNode=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.next=void 0,e.prev=void 0,this.size--},t.prototype.get=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];return this.detachFromList(r),this.prependToList(r),r.value}},t.prototype.remove=function(e){if(this.nodeMap[e]){var r=this.nodeMap[e];this.detachFromList(r),delete this.nodeMap[e]}},t.prototype.put=function(e,r){if(this.nodeMap[e])this.remove(e);else if(this.size===this.sizeLimit){var i=this.removeFromTail(),n=i.key;delete this.nodeMap[n]}var s=new uy(e,r);this.nodeMap[e]=s,this.prependToList(s)},t.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),r=0;r<e.length;r++){var i=e[r],n=this.nodeMap[i];this.detachFromList(n),delete this.nodeMap[i]}},t}();ya.LRUCache=cy});var Yc=P(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var ly=Jc(),fy=1e3,dy=function(){function t(e){e===void 0&&(e=fy),this.maxSize=e,this.cache=new ly.LRUCache(e)}return o(t,"EndpointCache"),Object.defineProperty(t.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),t.prototype.put=function(e,r){var i=typeof e!="string"?t.getKeyString(e):e,n=this.populateValue(r);this.cache.put(i,n)},t.prototype.get=function(e){var r=typeof e!="string"?t.getKeyString(e):e,i=Date.now(),n=this.cache.get(r);if(n){for(var s=n.length-1;s>=0;s--){var a=n[s];a.Expire<i&&n.splice(s,1)}if(n.length===0){this.cache.remove(r);return}}return n},t.getKeyString=function(e){for(var r=[],i=Object.keys(e).sort(),n=0;n<i.length;n++){var s=i[n];e[s]!==void 0&&r.push(e[s])}return r.join(" ")},t.prototype.populateValue=function(e){var r=Date.now();return e.map(function(i){return{Address:i.Address||"",Expire:r+(i.CachePeriodInMinutes||1)*60*1e3}})},t.prototype.empty=function(){this.cache.empty()},t.prototype.remove=function(e){var r=typeof e!="string"?t.getKeyString(e):e;this.cache.remove(r)},t}();va.EndpointCache=dy});var ga=P((gq,Qc)=>{var mr=V();mr.SequentialExecutor=mr.util.inherit({constructor:o(function(){this._events={}},"SequentialExecutor"),listeners:o(function(e){return this._events[e]?this._events[e].slice(0):[]},"listeners"),on:o(function(e,r,i){return this._events[e]?i?this._events[e].unshift(r):this._events[e].push(r):this._events[e]=[r],this},"on"),onAsync:o(function(e,r,i){return r._isAsync=!0,this.on(e,r,i)},"onAsync"),removeListener:o(function(e,r){var i=this._events[e];if(i){for(var n=i.length,s=-1,a=0;a<n;++a)i[a]===r&&(s=a);s>-1&&i.splice(s,1)}return this},"removeListener"),removeAllListeners:o(function(e){return e?delete this._events[e]:this._events={},this},"removeAllListeners"),emit:o(function(e,r,i){i||(i=o(function(){},"doneCallback"));var n=this.listeners(e),s=n.length;return this.callListeners(n,r,i),s>0},"emit"),callListeners:o(function(e,r,i,n){var s=this,a=n||null;function u(h){if(h&&(a=mr.util.error(a||new Error,h),s._haltHandlersOnError))return i.call(s,a);s.callListeners(e,r,i,a)}for(o(u,"callNextListener");e.length>0;){var l=e.shift();if(l._isAsync){l.apply(s,r.concat([u]));return}else{try{l.apply(s,r)}catch(h){a=mr.util.error(a||new Error,h)}if(a&&s._haltHandlersOnError){i.call(s,a);return}}}i.call(s,a)},"callListeners"),addListeners:o(function(e){var r=this;return e._events&&(e=e._events),mr.util.each(e,function(i,n){typeof n=="function"&&(n=[n]),mr.util.arrayEach(n,function(s){r.on(i,s)})}),r},"addListeners"),addNamedListener:o(function(e,r,i,n){return this[e]=i,this.addListener(r,i,n),this},"addNamedListener"),addNamedAsyncListener:o(function(e,r,i,n){return i._isAsync=!0,this.addNamedListener(e,r,i,n)},"addNamedAsyncListener"),addNamedListeners:o(function(e){var r=this;return e(function(){r.addNamedListener.apply(r,arguments)},function(){r.addNamedAsyncListener.apply(r,arguments)}),this},"addNamedListeners")});mr.SequentialExecutor.prototype.addListener=mr.SequentialExecutor.prototype.on;Qc.exports=mr.SequentialExecutor});var $c=P((wq,hy)=>{hy.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":"usIso","us-isob-*/*":"usIsob","*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:!0},"*/route53":"globalSSL","cn-*/route53":{endpoint:"{service}.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","us-iso-*/route53":{endpoint:"{service}.c2s.ic.gov",globalEndpoint:!0,signingRegion:"us-iso-east-1"},"us-isob-*/route53":{endpoint:"{service}.sc2s.sgov.gov",globalEndpoint:!0,signingRegion:"us-isob-east-1"},"*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{endpoint:"{service}.cn-north-1.amazonaws.com.cn",globalEndpoint:!0,signingRegion:"cn-north-1"},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"},"*/resource-explorer-2":"dualstackByDefault"},fipsRules:{"*/*":"fipsStandard","us-gov-*/*":"fipsStandard","us-iso-*/*":{endpoint:"{service}-fips.{region}.c2s.ic.gov"},"us-iso-*/dms":"usIso","us-isob-*/*":{endpoint:"{service}-fips.{region}.sc2s.sgov.gov"},"us-isob-*/dms":"usIsob","cn-*/*":{endpoint:"{service}-fips.{region}.amazonaws.com.cn"},"*/api.ecr":"fips.api.ecr","*/api.sagemaker":"fips.api.sagemaker","*/batch":"fipsDotPrefix","*/eks":"fipsDotPrefix","*/models.lex":"fips.models.lex","*/runtime.lex":"fips.runtime.lex","*/runtime.sagemaker":{endpoint:"runtime-fips.sagemaker.{region}.amazonaws.com"},"*/iam":"fipsWithoutRegion","*/route53":"fipsWithoutRegion","*/transcribe":"fipsDotPrefix","*/waf":"fipsWithoutRegion","us-gov-*/transcribe":"fipsDotPrefix","us-gov-*/api.ecr":"fips.api.ecr","us-gov-*/api.sagemaker":"fips.api.sagemaker","us-gov-*/models.lex":"fips.models.lex","us-gov-*/runtime.lex":"fips.runtime.lex","us-gov-*/acm-pca":"fipsWithServiceOnly","us-gov-*/batch":"fipsWithServiceOnly","us-gov-*/config":"fipsWithServiceOnly","us-gov-*/eks":"fipsWithServiceOnly","us-gov-*/elasticmapreduce":"fipsWithServiceOnly","us-gov-*/identitystore":"fipsWithServiceOnly","us-gov-*/dynamodb":"fipsWithServiceOnly","us-gov-*/elasticloadbalancing":"fipsWithServiceOnly","us-gov-*/guardduty":"fipsWithServiceOnly","us-gov-*/monitoring":"fipsWithServiceOnly","us-gov-*/resource-groups":"fipsWithServiceOnly","us-gov-*/runtime.sagemaker":"fipsWithServiceOnly","us-gov-*/servicecatalog-appregistry":"fipsWithServiceOnly","us-gov-*/servicequotas":"fipsWithServiceOnly","us-gov-*/ssm":"fipsWithServiceOnly","us-gov-*/sts":"fipsWithServiceOnly","us-gov-*/support":"fipsWithServiceOnly","us-gov-west-1/states":"fipsWithServiceOnly","us-iso-east-1/elasticfilesystem":{endpoint:"elasticfilesystem-fips.{region}.c2s.ic.gov"},"us-gov-west-1/organizations":"fipsWithServiceOnly","us-gov-west-1/route53":{endpoint:"route53.us-gov.amazonaws.com"}},dualstackRules:{"*/*":{endpoint:"{service}.{region}.api.aws"},"cn-*/*":{endpoint:"{service}.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackLegacy","cn-*/s3":"dualstackLegacyCn","*/s3-control":"dualstackLegacy","cn-*/s3-control":"dualstackLegacyCn","ap-south-1/ec2":"dualstackLegacyEc2","eu-west-1/ec2":"dualstackLegacyEc2","sa-east-1/ec2":"dualstackLegacyEc2","us-east-1/ec2":"dualstackLegacyEc2","us-east-2/ec2":"dualstackLegacyEc2","us-west-2/ec2":"dualstackLegacyEc2"},dualstackFipsRules:{"*/*":{endpoint:"{service}-fips.{region}.api.aws"},"cn-*/*":{endpoint:"{service}-fips.{region}.api.amazonwebservices.com.cn"},"*/s3":"dualstackFipsLegacy","cn-*/s3":"dualstackFipsLegacyCn","*/s3-control":"dualstackFipsLegacy","cn-*/s3-control":"dualstackFipsLegacyCn"},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:!0,signingRegion:"us-east-1"},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com",globalEndpoint:!0,signingRegion:"us-gov-west-1"},s3signature:{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"s3"},usIso:{endpoint:"{service}.{region}.c2s.ic.gov"},usIsob:{endpoint:"{service}.{region}.sc2s.sgov.gov"},fipsStandard:{endpoint:"{service}-fips.{region}.amazonaws.com"},fipsDotPrefix:{endpoint:"fips.{service}.{region}.amazonaws.com"},fipsWithoutRegion:{endpoint:"{service}-fips.amazonaws.com"},"fips.api.ecr":{endpoint:"ecr-fips.{region}.amazonaws.com"},"fips.api.sagemaker":{endpoint:"api-fips.sagemaker.{region}.amazonaws.com"},"fips.models.lex":{endpoint:"models-fips.lex.{region}.amazonaws.com"},"fips.runtime.lex":{endpoint:"runtime-fips.lex.{region}.amazonaws.com"},fipsWithServiceOnly:{endpoint:"{service}.{region}.amazonaws.com"},dualstackLegacy:{endpoint:"{service}.dualstack.{region}.amazonaws.com"},dualstackLegacyCn:{endpoint:"{service}.dualstack.{region}.amazonaws.com.cn"},dualstackFipsLegacy:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com"},dualstackFipsLegacyCn:{endpoint:"{service}-fips.dualstack.{region}.amazonaws.com.cn"},dualstackLegacyEc2:{endpoint:"api.ec2.{region}.aws"},dualstackByDefault:{endpoint:"{service}.{region}.api.aws"}}}});var el=P((Eq,Zc)=>{var py=Oe(),Un=$c();function my(t){if(!t)return null;var e=t.split("-");return e.length<3?null:e.slice(0,e.length-2).join("-")+"-*"}o(my,"generateRegionPrefix");function yy(t){var e=t.config.region,r=my(e),i=t.api.endpointPrefix;return[[e,i],[r,i],[e,"*"],[r,"*"],["*",i],["*","*"]].map(function(n){return n[0]&&n[1]?n.join("/"):null})}o(yy,"derivedKeys");function vy(t,e){py.each(e,function(r,i){r!=="globalEndpoint"&&(t.config[r]===void 0||t.config[r]===null)&&(t.config[r]=i)})}o(vy,"applyConfig");function gy(t){for(var e=yy(t),r=t.config.useFipsEndpoint,i=t.config.useDualstackEndpoint,n=0;n<e.length;n++){var s=e[n];if(s){var a=r?i?Un.dualstackFipsRules:Un.fipsRules:i?Un.dualstackRules:Un.rules;if(Object.prototype.hasOwnProperty.call(a,s)){var u=a[s];typeof u=="string"&&(u=Un.patterns[u]),t.isGlobalEndpoint=!!u.globalEndpoint,u.signingRegion&&(t.signingRegion=u.signingRegion),u.signatureVersion||(u.signatureVersion="v4"),vy(t,u);return}}}}o(gy,"configureEndpoint");function Ny(t){for(var e={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},r="amazonaws.com",i=Object.keys(e),n=0;n<i.length;n++){var s=RegExp(i[n]),a=e[i[n]];if(s.test(t))return a}return r}o(Ny,"getEndpointSuffix");Zc.exports={configureEndpoint:gy,getEndpointSuffix:Ny}});var Na=P((Cq,tl)=>{function wy(t){return typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))}o(wy,"isFipsRegion");function Ey(t){return typeof t=="string"&&["aws-global","aws-us-gov-global"].includes(t)}o(Ey,"isGlobalRegion");function xy(t){return["fips-aws-global","aws-fips","aws-global"].includes(t)?"us-east-1":["fips-aws-us-gov-global","aws-us-gov-global"].includes(t)?"us-gov-west-1":t.replace(/fips-(dkr-|prod-)?|-fips/,"")}o(xy,"getRealRegion");tl.exports={isFipsRegion:wy,isGlobalRegion:Ey,getRealRegion:xy}});var il=P((Tq,rl)=>{var U=V(),Cy=ma(),Sy=el(),wa=U.util.inherit,Ty=0,Ko=Na();U.Service=wa({constructor:o(function(e){if(!this.loadServiceClass)throw U.util.error(new Error,"Service must be constructed with `new' operator");if(e){if(e.region){var r=e.region;Ko.isFipsRegion(r)&&(e.region=Ko.getRealRegion(r),e.useFipsEndpoint=!0),Ko.isGlobalRegion(r)&&(e.region=Ko.getRealRegion(r))}typeof e.useDualstack=="boolean"&&typeof e.useDualstackEndpoint!="boolean"&&(e.useDualstackEndpoint=e.useDualstack)}var i=this.loadServiceClass(e||{});if(i){var n=U.util.copy(e),s=new i(e);return Object.defineProperty(s,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),s._clientId=++Ty,s}this.initialize(e)},"Service"),initialize:o(function(e){var r=U.config[this.serviceIdentifier];if(this.config=new U.Config(U.config),r&&this.config.update(r,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||Sy.configureEndpoint(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),U.SequentialExecutor.call(this),U.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||U.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",o(function(s){process.nextTick(function(){i.eventHandler(s)})},"PUBLISH_API_CALL")),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",o(function(s){process.nextTick(function(){i.eventHandler(s)})},"PUBLISH_API_ATTEMPT"))}},"initialize"),validateService:o(function(){},"validateService"),loadServiceClass:o(function(e){var r=e;if(U.util.isEmpty(this.api)){if(r.apiConfig)return U.Service.defineServiceApi(this.constructor,r.apiConfig);if(this.constructor.services){r=new U.Config(U.config),r.update(e,!0);var i=r.apiVersions[this.constructor.serviceIdentifier];return i=i||r.apiVersion,this.getLatestServiceClass(i)}else return null}else return null},"loadServiceClass"),getLatestServiceClass:o(function(e){return e=this.getLatestServiceVersion(e),this.constructor.services[e]===null&&U.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},"getLatestServiceClass"),getLatestServiceVersion:o(function(e){if(!this.constructor.services||this.constructor.services.length===0)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?U.util.isType(e,Date)&&(e=U.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var r=Object.keys(this.constructor.services).sort(),i=null,n=r.length-1;n>=0;n--)if(r[n][r[n].length-1]!=="*"&&(i=r[n]),r[n].substr(0,10)<=e)return i;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},"getLatestServiceVersion"),api:{},defaultRetryCount:3,customizeRequests:o(function(e){if(!e)this.customRequestHandler=null;else if(typeof e=="function")this.customRequestHandler=e;else throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests")},"customizeRequests"),makeRequest:o(function(e,r,i){if(typeof r=="function"&&(i=r,r=null),r=r||{},this.config.params){var n=this.api.operations[e];n&&(r=U.util.copy(r),U.util.each(this.config.params,function(a,u){n.input.members[a]&&(r[a]===void 0||r[a]===null)&&(r[a]=u)}))}var s=new U.Request(this,e,r);return this.addAllRequestListeners(s),this.attachMonitoringEmitter(s),i&&s.send(i),s},"makeRequest"),makeUnauthenticatedRequest:o(function(e,r,i){typeof r=="function"&&(i=r,r={});var n=this.makeRequest(e,r).toUnauthenticated();return i?n.send(i):n},"makeUnauthenticatedRequest"),waitFor:o(function(e,r,i){var n=new U.ResourceWaiter(this,e);return n.wait(r,i)},"waitFor"),addAllRequestListeners:o(function(e){for(var r=[U.events,U.EventListeners.Core,this.serviceInterface(),U.EventListeners.CorePost],i=0;i<r.length;i++)r[i]&&e.addListeners(r[i]);this.config.paramValidation||e.removeListener("validate",U.EventListeners.Core.VALIDATE_PARAMETERS),this.config.logger&&e.addListeners(U.EventListeners.Logger),this.setupRequestListeners(e),typeof this.constructor.prototype.customRequestHandler=="function"&&this.constructor.prototype.customRequestHandler(e),Object.prototype.hasOwnProperty.call(this,"customRequestHandler")&&typeof this.customRequestHandler=="function"&&this.customRequestHandler(e)},"addAllRequestListeners"),apiCallEvent:o(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCall",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Region:e.httpRequest.region,MaxRetriesExceeded:0,UserAgent:e.httpRequest.getUserAgent()},n=e.response;if(n.httpResponse.statusCode&&(i.FinalHttpStatusCode=n.httpResponse.statusCode),n.error){var s=n.error,a=n.httpResponse.statusCode;a>299?(s.code&&(i.FinalAwsException=s.code),s.message&&(i.FinalAwsExceptionMessage=s.message)):((s.code||s.name)&&(i.FinalSdkException=s.code||s.name),s.message&&(i.FinalSdkExceptionMessage=s.message))}return i},"apiCallEvent"),apiAttemptEvent:o(function(e){var r=e.service.api.operations[e.operation],i={Type:"ApiCallAttempt",Api:r?r.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},n=e.response;return n.httpResponse.statusCode&&(i.HttpStatusCode=n.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(i.AccessKey=e.service.config.credentials.accessKeyId),n.httpResponse.headers&&(e.httpRequest.headers["x-amz-security-token"]&&(i.SessionToken=e.httpRequest.headers["x-amz-security-token"]),n.httpResponse.headers["x-amzn-requestid"]&&(i.XAmznRequestId=n.httpResponse.headers["x-amzn-requestid"]),n.httpResponse.headers["x-amz-request-id"]&&(i.XAmzRequestId=n.httpResponse.headers["x-amz-request-id"]),n.httpResponse.headers["x-amz-id-2"]&&(i.XAmzId2=n.httpResponse.headers["x-amz-id-2"])),i},"apiAttemptEvent"),attemptFailEvent:o(function(e){var r=this.apiAttemptEvent(e),i=e.response,n=i.error;return i.httpResponse.statusCode>299?(n.code&&(r.AwsException=n.code),n.message&&(r.AwsExceptionMessage=n.message)):((n.code||n.name)&&(r.SdkException=n.code||n.name),n.message&&(r.SdkExceptionMessage=n.message)),r},"attemptFailEvent"),attachMonitoringEmitter:o(function(e){var r,i,n,s,a=0,u,l,h=this,y=!0;e.on("validate",function(){s=U.util.realClock.now(),l=Date.now()},y),e.on("sign",function(){i=U.util.realClock.now(),r=Date.now(),u=e.httpRequest.region,a++},y),e.on("validateResponse",function(){n=Math.round(U.util.realClock.now()-i)}),e.addNamedListener("API_CALL_ATTEMPT","success",o(function(){var S=h.apiAttemptEvent(e);S.Timestamp=r,S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT")),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",o(function(){var S=h.attemptFailEvent(e);S.Timestamp=r,n=n||Math.round(U.util.realClock.now()-i),S.AttemptLatency=n>=0?n:0,S.Region=u,h.emit("apiCallAttempt",[S])},"API_CALL_ATTEMPT_RETRY")),e.addNamedListener("API_CALL","complete",o(function(){var S=h.apiCallEvent(e);if(S.AttemptCount=a,!(S.AttemptCount<=0)){S.Timestamp=l;var I=Math.round(U.util.realClock.now()-s);S.Latency=I>=0?I:0;var E=e.response;E.error&&E.error.retryable&&typeof E.retryCount=="number"&&typeof E.maxRetries=="number"&&E.retryCount>=E.maxRetries&&(S.MaxRetriesExceeded=1),h.emit("apiCall",[S])}},"API_CALL"))},"attachMonitoringEmitter"),setupRequestListeners:o(function(e){},"setupRequestListeners"),getSigningName:o(function(){return this.api.signingName||this.api.endpointPrefix},"getSigningName"),getSignerClass:o(function(e){var r,i=null,n="";if(e){var s=e.service.api.operations||{};i=s[e.operation]||null,n=i?i.authtype:""}return this.config.signatureVersion?r=this.config.signatureVersion:n==="v4"||n==="v4-unsigned-body"?r="v4":n==="bearer"?r="bearer":r=this.api.signatureVersion,U.Signers.RequestSigner.getVersion(r)},"getSignerClass"),serviceInterface:o(function(){switch(this.api.protocol){case"ec2":return U.EventListeners.Query;case"query":return U.EventListeners.Query;case"json":return U.EventListeners.Json;case"rest-json":return U.EventListeners.RestJson;case"rest-xml":return U.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},"serviceInterface"),successfulResponse:o(function(e){return e.httpResponse.statusCode<300},"successfulResponse"),numRetries:o(function(){return this.config.maxRetries!==void 0?this.config.maxRetries:this.defaultRetryCount},"numRetries"),retryDelays:o(function(e,r){return U.util.calculateRetryDelay(e,this.config.retryDelayOptions,r)},"retryDelays"),retryableError:o(function(e){return!!(this.timeoutError(e)||this.networkingError(e)||this.expiredCredentialsError(e)||this.throttledError(e)||e.statusCode>=500)},"retryableError"),networkingError:o(function(e){return e.code==="NetworkingError"},"networkingError"),timeoutError:o(function(e){return e.code==="TimeoutError"},"timeoutError"),expiredCredentialsError:o(function(e){return e.code==="ExpiredTokenException"},"expiredCredentialsError"),clockSkewError:o(function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},"clockSkewError"),getSkewCorrectedDate:o(function(){return new Date(Date.now()+this.config.systemClockOffset)},"getSkewCorrectedDate"),applyClockOffset:o(function(e){e&&(this.config.systemClockOffset=e-Date.now())},"applyClockOffset"),isClockSkewed:o(function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e5},"isClockSkewed"),throttledError:o(function(e){if(e.statusCode===429)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":case"EC2ThrottledException":return!0;default:return!1}},"throttledError"),endpointFromTemplate:o(function(e){if(typeof e!="string")return e;var r=e;return r=r.replace(/\{service\}/g,this.api.endpointPrefix),r=r.replace(/\{region\}/g,this.config.region),r=r.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http"),r},"endpointFromTemplate"),setEndpoint:o(function(e){this.endpoint=new U.Endpoint(e,this.config)},"setEndpoint"),paginationConfig:o(function(e,r){var i=this.api.operations[e].paginator;if(!i){if(r){var n=new Error;throw U.util.error(n,"No pagination configuration for "+e)}return null}return i},"paginationConfig")});U.util.update(U.Service,{defineMethods:o(function(e){U.util.each(e.prototype.api.operations,o(function(i){if(!e.prototype[i]){var n=e.prototype.api.operations[i];n.authtype==="none"?e.prototype[i]=function(s,a){return this.makeUnauthenticatedRequest(i,s,a)}:e.prototype[i]=function(s,a){return this.makeRequest(i,s,a)}}},"iterator"))},"defineMethods"),defineService:o(function(e,r,i){U.Service._serviceMap[e]=!0,Array.isArray(r)||(i=r,r=[]);var n=wa(U.Service,i||{});if(typeof e=="string"){U.Service.addVersions(n,r);var s=n.serviceIdentifier||e;n.serviceIdentifier=s}else n.prototype.api=e,U.Service.defineMethods(n);if(U.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&U.util.clientSideMonitoring){var a=U.util.clientSideMonitoring.Publisher,u=U.util.clientSideMonitoring.configProvider,l=u();this.prototype.publisher=new a(l),l.enabled&&(U.Service._clientSideMonitoring=!0)}return U.SequentialExecutor.call(n.prototype),U.Service.addDefaultMonitoringListeners(n.prototype),n},"defineService"),addVersions:o(function(e,r){Array.isArray(r)||(r=[r]),e.services=e.services||{};for(var i=0;i<r.length;i++)e.services[r[i]]===void 0&&(e.services[r[i]]=null);e.apiVersions=Object.keys(e.services).sort()},"addVersions"),defineServiceApi:o(function(e,r,i){var n=wa(e,{serviceIdentifier:e.serviceIdentifier});function s(a){a.isApi?n.prototype.api=a:n.prototype.api=new Cy(a,{serviceIdentifier:e.serviceIdentifier})}if(o(s,"setApi"),typeof r=="string"){if(i)s(i);else try{s(U.apiLoader(e.serviceIdentifier,r))}catch(a){throw U.util.error(a,{message:"Could not find API configuration "+e.serviceIdentifier+"-"+r})}Object.prototype.hasOwnProperty.call(e.services,r)||(e.apiVersions=e.apiVersions.concat(r).sort()),e.services[r]=n}else s(r);return U.Service.defineMethods(n),n},"defineServiceApi"),hasService:function(t){return Object.prototype.hasOwnProperty.call(U.Service._serviceMap,t)},addDefaultMonitoringListeners:o(function(e){e.addNamedListener("MONITOR_EVENTS_BUBBLE","apiCallAttempt",o(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCallAttempt",[i])},"EVENTS_BUBBLE")),e.addNamedListener("CALL_EVENTS_BUBBLE","apiCall",o(function(i){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCall",[i])},"CALL_EVENTS_BUBBLE"))},"addDefaultMonitoringListeners"),_serviceMap:{}});U.util.mixin(U.Service,U.SequentialExecutor);rl.exports=U.Service});var Ea=P(()=>{var xt=V();xt.Credentials=xt.util.inherit({constructor:o(function(){if(xt.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1&&typeof arguments[0]=="object"){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},"Credentials"),expiryWindow:15,needsRefresh:o(function(){var e=xt.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},"needsRefresh"),get:o(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:o(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:o(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(o(function(s){xt.util.arrayEach(i.refreshCallbacks,function(a){r?a(s):xt.util.defer(function(){a(s)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:o(function(e){e()},"load")});xt.Credentials.addPromisesToClass=o(function(e){this.prototype.getPromise=xt.util.promisifyMethod("get",e),this.prototype.refreshPromise=xt.util.promisifyMethod("refresh",e)},"addPromisesToClass");xt.Credentials.deletePromisesFromClass=o(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");xt.util.addPromises(xt.Credentials)});var xa=P(()=>{var Lt=V();Lt.CredentialProviderChain=Lt.util.inherit(Lt.Credentials,{constructor:o(function(e){e?this.providers=e:this.providers=Lt.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"CredentialProviderChain"),resolve:o(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Lt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var s=a;o(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Lt.CredentialProviderChain.defaultProviders=[];Lt.CredentialProviderChain.addPromisesToClass=o(function(e){this.prototype.resolvePromise=Lt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Lt.CredentialProviderChain.deletePromisesFromClass=o(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Lt.util.addPromises(Lt.CredentialProviderChain)});var nl=P(()=>{var Ne=V();Ea();xa();var Xo;Ne.Config=Ne.util.inherit({constructor:o(function(e){e===void 0&&(e={}),e=this.extractCredentials(e),Ne.util.each.call(this,this.keys,function(r,i){this.set(r,e[r],i)})},"Config"),getCredentials:o(function(e){var r=this;function i(u){e(u,u?null:r.credentials)}o(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"CredentialsError",message:u,name:"CredentialsError"})}o(n,"credError");function s(){r.credentials.get(function(u){if(u){var l="Could not load credentials from "+r.credentials.constructor.name;u=n(l,u)}i(u)})}o(s,"getAsyncCredentials");function a(){var u=null;(!r.credentials.accessKeyId||!r.credentials.secretAccessKey)&&(u=n("Missing credentials")),i(u)}o(a,"getStaticCredentials"),r.credentials?typeof r.credentials.get=="function"?s():a():r.credentialProvider?r.credentialProvider.resolve(function(u,l){u&&(u=n("Could not load credentials from any providers",u)),r.credentials=l,i(u)}):i(n("No credentials to load"))},"getCredentials"),getToken:o(function(e){var r=this;function i(u){e(u,u?null:r.token)}o(i,"finish");function n(u,l){return new Ne.util.error(l||new Error,{code:"TokenError",message:u,name:"TokenError"})}o(n,"tokenError");function s(){r.token.get(function(u){if(u){var l="Could not load token from "+r.token.constructor.name;u=n(l,u)}i(u)})}o(s,"getAsyncToken");function a(){var u=null;r.token.token||(u=n("Missing token")),i(u)}o(a,"getStaticToken"),r.token?typeof r.token.get=="function"?s():a():r.tokenProvider?r.tokenProvider.resolve(function(u,l){u&&(u=n("Could not load token from any providers",u)),r.token=l,i(u)}):i(n("No token to load"))},"getToken"),update:o(function(e,r){r=r||!1,e=this.extractCredentials(e),Ne.util.each.call(this,e,function(i,n){(r||Object.prototype.hasOwnProperty.call(this.keys,i)||Ne.Service.hasService(i))&&this.set(i,n)})},"update"),loadFromPath:o(function(e){this.clear();var r=JSON.parse(Ne.util.readFileSync(e)),i=new Ne.FileSystemCredentials(e),n=new Ne.CredentialProviderChain;return n.providers.unshift(i),n.resolve(function(s,a){if(s)throw s;r.credentials=a}),this.constructor(r),this},"loadFromPath"),clear:o(function(){Ne.util.each.call(this,this.keys,function(e){delete this[e]}),this.set("credentials",void 0),this.set("credentialProvider",void 0)},"clear"),set:o(function(e,r,i){r===void 0?(i===void 0&&(i=this.keys[e]),typeof i=="function"?this[e]=i.call(this):this[e]=i):e==="httpOptions"&&this[e]?this[e]=Ne.util.merge(this[e],r):this[e]=r},"set"),keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,s3UsEast1RegionalEndpoint:"legacy",s3UseArnRegion:void 0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:void 0,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:"legacy",useFipsEndpoint:!1,useDualstackEndpoint:!1,token:null},extractCredentials:o(function(e){return e.accessKeyId&&e.secretAccessKey&&(e=Ne.util.copy(e),e.credentials=new Ne.Credentials(e)),e},"extractCredentials"),setPromisesDependency:o(function(e){Xo=e,e===null&&typeof Promise=="function"&&(Xo=Promise);var r=[Ne.Request,Ne.Credentials,Ne.CredentialProviderChain];Ne.S3&&(r.push(Ne.S3),Ne.S3.ManagedUpload&&r.push(Ne.S3.ManagedUpload)),Ne.util.addPromises(r,Xo)},"setPromisesDependency"),getPromisesDependency:o(function(){return Xo},"getPromisesDependency")});Ne.config=new Ne.Config});var Jo=P(()=>{var je=V(),Go=je.util.inherit;je.Endpoint=Go({constructor:o(function(e,r){if(je.util.hideProperties(this,["slashes","auth","hash","search","query"]),typeof e>"u"||e===null)throw new Error("Invalid endpoint: "+e);if(typeof e!="string")return je.util.copy(e);if(!e.match(/^http/)){var i=r&&r.sslEnabled!==void 0?r.sslEnabled:je.config.sslEnabled;e=(i?"https":"http")+"://"+e}je.util.update(this,je.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port=this.protocol==="https:"?443:80},"Endpoint")});je.HttpRequest=Go({constructor:o(function(e,r){e=new je.Endpoint(e),this.method="POST",this.path=e.path||"/",this.headers={},this.body="",this.endpoint=e,this.region=r,this._userAgent="",this.setUserAgent()},"HttpRequest"),setUserAgent:o(function(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=je.util.userAgent()},"setUserAgent"),getUserAgentHeaderName:o(function(){var e=je.util.isBrowser()?"X-Amz-":"";return e+"User-Agent"},"getUserAgentHeaderName"),appendToUserAgent:o(function(e){typeof e=="string"&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},"appendToUserAgent"),getUserAgent:o(function(){return this._userAgent},"getUserAgent"),pathname:o(function(){return this.path.split("?",1)[0]},"pathname"),search:o(function(){var e=this.path.split("?",2)[1];return e?(e=je.util.queryStringParse(e),je.util.queryParamsToString(e)):""},"search"),updateEndpoint:o(function(e){var r=new je.Endpoint(e);this.endpoint=r,this.path=r.path||"/",this.headers.Host&&(this.headers.Host=r.host)},"updateEndpoint")});je.HttpResponse=Go({constructor:o(function(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},"HttpResponse"),createUnbufferedStream:o(function(){return this.streaming=!0,this.stream},"createUnbufferedStream")});je.HttpClient=Go({});je.HttpClient.getInstance=o(function(){return this.singleton===void 0&&(this.singleton=new this),this.singleton},"getInstance")});var dl=P((Wq,fl)=>{var ke=V(),vt=Oe(),ol=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function Yo(t){var e=t.service,r=e.api||{},i=r.operations,n={};return e.config.region&&(n.region=e.config.region),r.serviceId&&(n.serviceId=r.serviceId),e.config.credentials.accessKeyId&&(n.accessKeyId=e.config.credentials.accessKeyId),n}o(Yo,"getCacheKey");function al(t,e,r){!r||e===void 0||e===null||r.type==="structure"&&r.required&&r.required.length>0&&vt.arrayEach(r.required,function(i){var n=r.members[i];if(n.endpointDiscoveryId===!0){var s=n.isLocationName?n.name:i;t[s]=String(e[i])}else al(t,e[i],n)})}o(al,"marshallCustomIdentifiersHelper");function Qo(t,e){var r={};return al(r,t.params,e),r}o(Qo,"marshallCustomIdentifiers");function ul(t){var e=t.service,r=e.api,i=r.operations?r.operations[t.operation]:void 0,n=i?i.input:void 0,s=Qo(t,n),a=Yo(t);Object.keys(s).length>0&&(a=vt.update(a,s),i&&(a.operation=i.name));var u=ke.endpointCache.get(a);if(!(u&&u.length===1&&u[0].Address===""))if(u&&u.length>0)t.httpRequest.updateEndpoint(u[0].Address);else{var l=e.makeRequest(r.endpointOperation,{Operation:i.name,Identifiers:s});ll(l),l.removeListener("validate",ke.EventListeners.Core.VALIDATE_PARAMETERS),l.removeListener("retry",ke.EventListeners.Core.RETRY_CHECK),ke.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}]),l.send(function(h,y){y&&y.Endpoints?ke.endpointCache.put(a,y.Endpoints):h&&ke.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}])})}}o(ul,"optionalDiscoverEndpoint");var yr={};function cl(t,e){var r=t.service,i=r.api,n=i.operations?i.operations[t.operation]:void 0,s=n?n.input:void 0,a=Qo(t,s),u=Yo(t);Object.keys(a).length>0&&(u=vt.update(u,a),n&&(u.operation=n.name));var l=ke.EndpointCache.getKeyString(u),h=ke.endpointCache.get(l);if(h&&h.length===1&&h[0].Address===""){yr[l]||(yr[l]=[]),yr[l].push({request:t,callback:e});return}else if(h&&h.length>0)t.httpRequest.updateEndpoint(h[0].Address),e();else{var y=r.makeRequest(i.endpointOperation,{Operation:n.name,Identifiers:a});y.removeListener("validate",ke.EventListeners.Core.VALIDATE_PARAMETERS),ll(y),ke.endpointCache.put(l,[{Address:"",CachePeriodInMinutes:60}]),y.send(function(v,S){if(v){if(t.response.error=vt.error(v,{retryable:!1}),ke.endpointCache.remove(u),yr[l]){var I=yr[l];vt.arrayEach(I,function(E){E.request.response.error=vt.error(v,{retryable:!1}),E.callback()}),delete yr[l]}}else if(S&&(ke.endpointCache.put(l,S.Endpoints),t.httpRequest.updateEndpoint(S.Endpoints[0].Address),yr[l])){var I=yr[l];vt.arrayEach(I,function(w){w.request.httpRequest.updateEndpoint(S.Endpoints[0].Address),w.callback()}),delete yr[l]}e()})}}o(cl,"requiredDiscoverEndpoint");function ll(t){var e=t.service.api,r=e.apiVersion;r&&!t.httpRequest.headers["x-amz-api-version"]&&(t.httpRequest.headers["x-amz-api-version"]=r)}o(ll,"addApiVersionHeader");function Ca(t){var e=t.error,r=t.httpResponse;if(e&&(e.code==="InvalidEndpointException"||r.statusCode===421)){var i=t.request,n=i.service.api.operations||{},s=n[i.operation]?n[i.operation].input:void 0,a=Qo(i,s),u=Yo(i);Object.keys(a).length>0&&(u=vt.update(u,a),n[i.operation]&&(u.operation=n[i.operation].name)),ke.endpointCache.remove(u)}}o(Ca,"invalidateCachedEndpoints");function by(t){if(t._originalConfig&&t._originalConfig.endpoint&&t._originalConfig.endpointDiscoveryEnabled===!0)throw vt.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var e=ke.config[t.serviceIdentifier]||{};return Boolean(ke.config.endpoint||e.endpoint||t._originalConfig&&t._originalConfig.endpoint)}o(by,"hasCustomEndpoint");function sl(t){return["false","0"].indexOf(t)>=0}o(sl,"isFalsy");function Ay(t){var e=t.service||{};if(e.config.endpointDiscoveryEnabled!==void 0)return e.config.endpointDiscoveryEnabled;if(!vt.isBrowser()){for(var r=0;r<ol.length;r++){var i=ol[r];if(Object.prototype.hasOwnProperty.call(process.env,i)){if(process.env[i]===""||process.env[i]===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"environmental variable "+i+" cannot be set to nothing"});return!sl(process.env[i])}}var n={};try{n=ke.util.iniLoader?ke.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[ke.util.sharedConfigFileEnv]}):{}}catch{}var s=n[process.env.AWS_PROFILE||ke.util.defaultProfile]||{};if(Object.prototype.hasOwnProperty.call(s,"endpoint_discovery_enabled")){if(s.endpoint_discovery_enabled===void 0)throw vt.error(new Error,{code:"ConfigurationException",message:"config file entry 'endpoint_discovery_enabled' cannot be set to nothing"});return!sl(s.endpoint_discovery_enabled)}}}o(Ay,"resolveEndpointDiscoveryConfig");function Iy(t,e){var r=t.service||{};if(by(r)||t.isPresigned())return e();var i=r.api.operations||{},n=i[t.operation],s=n?n.endpointDiscoveryRequired:"NULL",a=Ay(t),u=r.api.hasRequiredEndpointDiscovery;switch((a||u)&&t.httpRequest.appendToUserAgent("endpoint-discovery"),s){case"OPTIONAL":(a||u)&&(ul(t),t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ca)),e();break;case"REQUIRED":if(a===!1){t.response.error=vt.error(new Error,{code:"ConfigurationException",message:"Endpoint Discovery is disabled but "+r.api.className+"."+t.operation+"() requires it. Please check your configurations."}),e();break}t.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",Ca),cl(t,e);break;case"NULL":default:e();break}}o(Iy,"discoverEndpoint");fl.exports={discoverEndpoint:Iy,requiredDiscoverEndpoint:cl,optionalDiscoverEndpoint:ul,marshallCustomIdentifiers:Qo,getCacheKey:Yo,invalidateCachedEndpoint:Ca}});var hl=P(()=>{var ie=V(),Ur=ga(),Oy=dl().discoverEndpoint;ie.EventListeners={Core:{}};function Ry(t){if(!t.service.api.operations)return"";var e=t.service.api.operations[t.operation];return e?e.authtype:""}o(Ry,"getOperationAuthtype");ie.EventListeners={Core:new Ur().addNamedListeners(function(t,e){e("VALIDATE_CREDENTIALS","validate",o(function(n,s){if(!n.service.api.signatureVersion&&!n.service.config.signatureVersion)return s();n.service.config.getCredentials(function(a){a&&(n.response.error=ie.util.error(a,{code:"CredentialsError",message:"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1"})),s()})},"VALIDATE_CREDENTIALS")),t("VALIDATE_REGION","validate",o(function(n){if(!n.service.isGlobalEndpoint){var s=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);n.service.config.region?s.test(n.service.config.region)||(n.response.error=ie.util.error(new Error,{code:"ConfigError",message:"Invalid region in config"})):n.response.error=ie.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}},"VALIDATE_REGION")),t("BUILD_IDEMPOTENCY_TOKENS","validate",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation];if(s){var a=s.idempotentMembers;if(a.length){for(var u=ie.util.copy(n.params),l=0,h=a.length;l<h;l++)u[a[l]]||(u[a[l]]=ie.util.uuid.v4());n.params=u}}}},"BUILD_IDEMPOTENCY_TOKENS")),t("VALIDATE_PARAMETERS","validate",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation].input,a=n.service.config.paramValidation;new ie.ParamValidator(a).validate(s,n.params)}},"VALIDATE_PARAMETERS")),t("COMPUTE_CHECKSUM","afterBuild",o(function(n){if(n.service.api.operations){var s=n.service.api.operations[n.operation];if(s){var a=n.httpRequest.body,u=a&&(ie.util.Buffer.isBuffer(a)||typeof a=="string"),l=n.httpRequest.headers;if(s.httpChecksumRequired&&n.service.config.computeChecksums&&u&&!l["Content-MD5"]){var h=ie.util.crypto.md5(a,"base64");l["Content-MD5"]=h}}}},"COMPUTE_CHECKSUM")),e("COMPUTE_SHA256","afterBuild",o(function(n,s){if(n.haltHandlersOnError(),!!n.service.api.operations){var a=n.service.api.operations[n.operation],u=a?a.authtype:"";if(!n.service.api.signatureVersion&&!u&&!n.service.config.signatureVersion)return s();if(n.service.getSignerClass(n)===ie.Signers.V4){var l=n.httpRequest.body||"";if(u.indexOf("unsigned-body")>=0)return n.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",s();ie.util.computeSha256(l,function(h,y){h?s(h):(n.httpRequest.headers["X-Amz-Content-Sha256"]=y,s())})}else s()}},"COMPUTE_SHA256")),t("SET_CONTENT_LENGTH","afterBuild",o(function(n){var s=Ry(n),a=ie.util.getRequestPayloadShape(n);if(n.httpRequest.headers["Content-Length"]===void 0)try{var u=ie.util.string.byteLength(n.httpRequest.body);n.httpRequest.headers["Content-Length"]=u}catch(l){if(a&&a.isStreaming){if(a.requiresLength)throw l;if(s.indexOf("unsigned-body")>=0){n.httpRequest.headers["Transfer-Encoding"]="chunked";return}else throw l}throw l}},"SET_CONTENT_LENGTH")),t("SET_HTTP_HOST","afterBuild",o(function(n){n.httpRequest.headers.Host=n.httpRequest.endpoint.host},"SET_HTTP_HOST")),t("SET_TRACE_ID","afterBuild",o(function(n){var s="X-Amzn-Trace-Id";if(ie.util.isNode()&&!Object.hasOwnProperty.call(n.httpRequest.headers,s)){var a="AWS_LAMBDA_FUNCTION_NAME",u="_X_AMZN_TRACE_ID",l=process.env[a],h=process.env[u];typeof l=="string"&&l.length>0&&typeof h=="string"&&h.length>0&&(n.httpRequest.headers[s]=h)}},"SET_TRACE_ID")),t("RESTART","restart",o(function(){var n=this.response.error;!n||!n.retryable||(this.httpRequest=new ie.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount<this.service.config.maxRetries?this.response.retryCount++:this.response.error=null)},"RESTART"));var r=!0;e("DISCOVER_ENDPOINT","sign",Oy,r),e("SIGN","sign",o(function(n,s){var a=n.service,u=n.service.api.operations||{},l=u[n.operation],h=l?l.authtype:"";if(!a.api.signatureVersion&&!h&&!a.config.signatureVersion)return s();h==="bearer"||a.config.signatureVersion==="bearer"?a.config.getToken(function(y,v){if(y)return n.response.error=y,s();try{var S=a.getSignerClass(n),I=new S(n.httpRequest);I.addAuthorization(v)}catch(E){n.response.error=E}s()}):a.config.getCredentials(function(y,v){if(y)return n.response.error=y,s();try{var S=a.getSkewCorrectedDate(),I=a.getSignerClass(n),E=new I(n.httpRequest,a.getSigningName(n),{signatureCache:a.config.signatureCache,operation:l,signatureVersion:a.api.signatureVersion});E.setServiceClientId(a._clientId),delete n.httpRequest.headers.Authorization,delete n.httpRequest.headers.Date,delete n.httpRequest.headers["X-Amz-Date"],E.addAuthorization(v,S),n.signedAt=S}catch(w){n.response.error=w}s()})},"SIGN")),t("VALIDATE_RESPONSE","validateResponse",o(function(n){this.service.successfulResponse(n,this)?(n.data={},n.error=null):(n.data=null,n.error=ie.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))},"VALIDATE_RESPONSE")),t("ERROR","error",o(function(n,s){var a=s.request.service.api.awsQueryCompatible;if(a){var u=s.httpResponse.headers,l=u?u["x-amzn-query-error"]:void 0;l&&l.includes(";")&&(s.error.code=l.split(";")[0])}},"ERROR"),!0),e("SEND","send",o(function(n,s){n.httpResponse._abortCallback=s,n.error=null,n.data=null;function a(v){n.httpResponse.stream=v;var S=n.request.httpRequest.stream,I=n.request.service,E=I.api,w=n.request.operation,D=E.operations[w]||{};v.on("headers",o(function(p,C,R){if(n.request.emit("httpHeaders",[p,C,n,R]),!n.httpResponse.streaming)if(ie.HttpClient.streamsApiVersion===2){if(D.hasEventOutput&&I.successfulResponse(n)){n.request.emit("httpDone"),s();return}v.on("readable",o(function(){var T=v.read();T!==null&&n.request.emit("httpData",[T,n])},"onReadable"))}else v.on("data",o(function(T){n.request.emit("httpData",[T,n])},"onData"))},"onHeaders")),v.on("end",o(function(){if(!S||!S.didCallback){if(ie.HttpClient.streamsApiVersion===2&&D.hasEventOutput&&I.successfulResponse(n))return;n.request.emit("httpDone"),s()}},"onEnd"))}o(a,"callback");function u(v){v.on("sendProgress",o(function(I){n.request.emit("httpUploadProgress",[I,n])},"onSendProgress")),v.on("receiveProgress",o(function(I){n.request.emit("httpDownloadProgress",[I,n])},"onReceiveProgress"))}o(u,"progress");function l(v){if(v.code!=="RequestAbortedError"){var S=v.code==="TimeoutError"?v.code:"NetworkingError";v=ie.util.error(v,{code:S,region:n.request.httpRequest.region,hostname:n.request.httpRequest.endpoint.hostname,retryable:!0})}n.error=v,n.request.emit("httpError",[n.error,n],function(){s()})}o(l,"error");function h(){var v=ie.HttpClient.getInstance(),S=n.request.service.config.httpOptions||{};try{var I=v.handleRequest(n.request.httpRequest,S,a,l);u(I)}catch(E){l(E)}}o(h,"executeSend");var y=(n.request.service.getSkewCorrectedDate()-this.signedAt)/1e3;y>=60*10?this.emit("sign",[this],function(v){v?s(v):h()}):h()},"SEND")),t("HTTP_HEADERS","httpHeaders",o(function(n,s,a,u){a.httpResponse.statusCode=n,a.httpResponse.statusMessage=u,a.httpResponse.headers=s,a.httpResponse.body=ie.util.buffer.toBuffer(""),a.httpResponse.buffers=[],a.httpResponse.numBytes=0;var l=s.date||s.Date,h=a.request.service;if(l){var y=Date.parse(l);h.config.correctClockSkew&&h.isClockSkewed(y)&&h.applyClockOffset(y)}},"HTTP_HEADERS")),t("HTTP_DATA","httpData",o(function(n,s){if(n){if(ie.util.isNode()){s.httpResponse.numBytes+=n.length;var a=s.httpResponse.headers["content-length"],u={loaded:s.httpResponse.numBytes,total:a};s.request.emit("httpDownloadProgress",[u,s])}s.httpResponse.buffers.push(ie.util.buffer.toBuffer(n))}},"HTTP_DATA")),t("HTTP_DONE","httpDone",o(function(n){if(n.httpResponse.buffers&&n.httpResponse.buffers.length>0){var s=ie.util.buffer.concat(n.httpResponse.buffers);n.httpResponse.body=s}delete n.httpResponse.numBytes,delete n.httpResponse.buffers},"HTTP_DONE")),t("FINALIZE_ERROR","retry",o(function(n){n.httpResponse.statusCode&&(n.error.statusCode=n.httpResponse.statusCode,n.error.retryable===void 0&&(n.error.retryable=this.service.retryableError(n.error,this)))},"FINALIZE_ERROR")),t("INVALIDATE_CREDENTIALS","retry",o(function(n){if(n.error)switch(n.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":n.error.retryable=!0,n.request.service.config.credentials.expired=!0}},"INVALIDATE_CREDENTIALS")),t("EXPIRED_SIGNATURE","retry",o(function(n){var s=n.error;s&&typeof s.code=="string"&&typeof s.message=="string"&&s.code.match(/Signature/)&&s.message.match(/expired/)&&(n.error.retryable=!0)},"EXPIRED_SIGNATURE")),t("CLOCK_SKEWED","retry",o(function(n){n.error&&this.service.clockSkewError(n.error)&&this.service.config.correctClockSkew&&(n.error.retryable=!0)},"CLOCK_SKEWED")),t("REDIRECT","retry",o(function(n){n.error&&n.error.statusCode>=300&&n.error.statusCode<400&&n.httpResponse.headers.location&&(this.httpRequest.endpoint=new ie.Endpoint(n.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,n.error.redirect=!0,n.error.retryable=!0)},"REDIRECT")),t("RETRY_CHECK","retry",o(function(n){n.error&&(n.error.redirect&&n.redirectCount<n.maxRedirects?n.error.retryDelay=0:n.retryCount<n.maxRetries&&(n.error.retryDelay=this.service.retryDelays(n.retryCount,n.error)||0))},"RETRY_CHECK")),e("RESET_RETRY_STATE","afterRetry",o(function(n,s){var a,u=!1;n.error&&(a=n.error.retryDelay||0,n.error.retryable&&n.retryCount<n.maxRetries?(n.retryCount++,u=!0):n.error.redirect&&n.redirectCount<n.maxRedirects&&(n.redirectCount++,u=!0)),u&&a>=0?(n.error=null,setTimeout(s,a)):s()},"RESET_RETRY_STATE"))}),CorePost:new Ur().addNamedListeners(function(t){t("EXTRACT_REQUEST_ID","extractData",ie.util.extractRequestId),t("EXTRACT_REQUEST_ID","extractError",ie.util.extractRequestId),t("ENOTFOUND_ERROR","httpError",o(function(r){function i(s){return s.errno==="ENOTFOUND"||typeof s.errno=="number"&&typeof ie.util.getSystemErrorName=="function"&&["EAI_NONAME","EAI_NODATA"].indexOf(ie.util.getSystemErrorName(s.errno)>=0)}if(o(i,"isDNSError"),r.code==="NetworkingError"&&i(r)){var n="Inaccessible host: `"+r.hostname+"' at port `"+r.port+"'. This service may not be available in the `"+r.region+"' region.";this.response.error=ie.util.error(new Error(n),{code:"UnknownEndpoint",region:r.region,hostname:r.hostname,retryable:!0,originalError:r})}},"ENOTFOUND_ERROR"))}),Logger:new Ur().addNamedListeners(function(t){t("LOG_REQUEST","complete",o(function(r){var i=r.request,n=i.service.config.logger;if(!n)return;function s(l,h){if(!h)return h;if(l.isSensitive)return"***SensitiveInformation***";switch(l.type){case"structure":var y={};return ie.util.each(h,function(I,E){Object.prototype.hasOwnProperty.call(l.members,I)?y[I]=s(l.members[I],E):y[I]=E}),y;case"list":var v=[];return ie.util.arrayEach(h,function(I,E){v.push(s(l.member,I))}),v;case"map":var S={};return ie.util.each(h,function(I,E){S[I]=s(l.value,E)}),S;default:return h}}o(s,"filterSensitiveLog");function a(){var l=r.request.service.getSkewCorrectedDate().getTime(),h=(l-i.startTime.getTime())/1e3,y=!!n.isTTY,v=r.httpResponse.statusCode,S=i.params;if(i.service.api.operations&&i.service.api.operations[i.operation]&&i.service.api.operations[i.operation].input){var I=i.service.api.operations[i.operation].input;S=s(I,i.params)}var E=te("util").inspect(S,!0,null),w="";return y&&(w+="\x1B[33m"),w+="[AWS "+i.service.serviceIdentifier+" "+v,w+=" "+h.toString()+"s "+r.retryCount+" retries]",y&&(w+="\x1B[0;1m"),w+=" "+ie.util.string.lowerFirst(i.operation),w+="("+E+")",y&&(w+="\x1B[0m"),w}o(a,"buildMessage");var u=a();typeof n.log=="function"?n.log(u):typeof n.write=="function"&&n.write(u+`
2
+ `)},"LOG_REQUEST"))}),Json:new Ur().addNamedListeners(function(t){var e=Bo();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Rest:new Ur().addNamedListeners(function(t){var e=kn();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),RestJson:new Ur().addNamedListeners(function(t){var e=ua();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError),t("UNSET_CONTENT_LENGTH","afterBuild",e.unsetContentLength)}),RestXml:new Ur().addNamedListeners(function(t){var e=la();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)}),Query:new Ur().addNamedListeners(function(t){var e=oa();t("BUILD","build",e.buildRequest),t("EXTRACT_DATA","extractData",e.extractData),t("EXTRACT_ERROR","extractError",e.extractError)})}});var ml=P((Hq,pl)=>{function Sa(t,e){this.currentState=e||null,this.states=t||{}}o(Sa,"AcceptorStateMachine");Sa.prototype.runTo=o(function(e,r,i,n){typeof e=="function"&&(n=i,i=r,r=e,e=null);var s=this,a=s.states[s.currentState];a.fn.call(i||s,n,function(u){if(u)if(a.fail)s.currentState=a.fail;else return r?r.call(i,u):null;else if(a.accept)s.currentState=a.accept;else return r?r.call(i):null;if(s.currentState===e)return r?r.call(i,u):null;s.runTo(e,r,i,u)})},"runTo");Sa.prototype.addState=o(function(e,r,i,n){return typeof r=="function"?(n=r,r=null,i=null):typeof i=="function"&&(n=i,i=null),this.currentState||(this.currentState=e),this.states[e]={accept:r,fail:i,fn:n},this},"addState");pl.exports=Sa});var Zo=P($o=>{(function(t){"use strict";function e(d){return d!==null?Object.prototype.toString.call(d)==="[object Array]":!1}o(e,"isArray");function r(d){return d!==null?Object.prototype.toString.call(d)==="[object Object]":!1}o(r,"isObject");function i(d,N){if(d===N)return!0;var b=Object.prototype.toString.call(d);if(b!==Object.prototype.toString.call(N))return!1;if(e(d)===!0){if(d.length!==N.length)return!1;for(var q=0;q<d.length;q++)if(i(d[q],N[q])===!1)return!1;return!0}if(r(d)===!0){var L={};for(var W in d)if(hasOwnProperty.call(d,W)){if(i(d[W],N[W])===!1)return!1;L[W]=!0}for(var Q in N)if(hasOwnProperty.call(N,Q)&&L[Q]!==!0)return!1;return!0}return!1}o(i,"strictDeepEqual");function n(d){if(d===""||d===!1||d===null)return!0;if(e(d)&&d.length===0)return!0;if(r(d)){for(var N in d)if(d.hasOwnProperty(N))return!1;return!0}else return!1}o(n,"isFalse");function s(d){for(var N=Object.keys(d),b=[],q=0;q<N.length;q++)b.push(d[N[q]]);return b}o(s,"objValues");function a(d,N){var b={};for(var q in d)b[q]=d[q];for(var L in N)b[L]=N[L];return b}o(a,"merge");var u;typeof String.prototype.trimLeft=="function"?u=o(function(d){return d.trimLeft()},"trimLeft"):u=o(function(d){return d.match(/^\s*(.*)/)[1]},"trimLeft");var l=0,h=1,y=2,v=3,S=4,I=5,E=6,w=7,D=8,x=9,p={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},C="EOF",R="UnquotedIdentifier",_="QuotedIdentifier",T="Rbracket",A="Rparen",g="Comma",K="Colon",X="Rbrace",F="Number",oe="Current",We="Expref",Me="Pipe",bt="Or",Z="And",Er="EQ",xr="GT",Cr="LT",Nt="GTE",Sr="LTE",wi="NE",At="Flatten",Ut="Star",Kr="Filter",m="Dot",f="Not",k="Lbrace",O="Lbracket",ee="Lparen",we="Literal",Te={".":m,"*":Ut,",":g,":":K,"{":k,"}":X,"]":T,"(":ee,")":A,"@":oe},Je={"<":!0,">":!0,"=":!0,"!":!0},wt={" ":!0," ":!0,"\n":!0};function Tr(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d==="_"}o(Tr,"isAlpha");function Re(d){return d>="0"&&d<="9"||d==="-"}o(Re,"isNum");function It(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d>="0"&&d<="9"||d==="_"}o(It,"isAlphaNum");function Xi(){}o(Xi,"Lexer"),Xi.prototype={tokenize:function(d){var N=[];this._current=0;for(var b,q,L;this._current<d.length;)if(Tr(d[this._current]))b=this._current,q=this._consumeUnquotedIdentifier(d),N.push({type:R,value:q,start:b});else if(Te[d[this._current]]!==void 0)N.push({type:Te[d[this._current]],value:d[this._current],start:this._current}),this._current++;else if(Re(d[this._current]))L=this._consumeNumber(d),N.push(L);else if(d[this._current]==="[")L=this._consumeLBracket(d),N.push(L);else if(d[this._current]==='"')b=this._current,q=this._consumeQuotedIdentifier(d),N.push({type:_,value:q,start:b});else if(d[this._current]==="'")b=this._current,q=this._consumeRawStringLiteral(d),N.push({type:we,value:q,start:b});else if(d[this._current]==="`"){b=this._current;var W=this._consumeLiteral(d);N.push({type:we,value:W,start:b})}else if(Je[d[this._current]]!==void 0)N.push(this._consumeOperator(d));else if(wt[d[this._current]]!==void 0)this._current++;else if(d[this._current]==="&")b=this._current,this._current++,d[this._current]==="&"?(this._current++,N.push({type:Z,value:"&&",start:b})):N.push({type:We,value:"&",start:b});else if(d[this._current]==="|")b=this._current,this._current++,d[this._current]==="|"?(this._current++,N.push({type:bt,value:"||",start:b})):N.push({type:Me,value:"|",start:b});else{var Q=new Error("Unknown character:"+d[this._current]);throw Q.name="LexerError",Q}return N},_consumeUnquotedIdentifier:function(d){var N=this._current;for(this._current++;this._current<d.length&&It(d[this._current]);)this._current++;return d.slice(N,this._current)},_consumeQuotedIdentifier:function(d){var N=this._current;this._current++;for(var b=d.length;d[this._current]!=='"'&&this._current<b;){var q=this._current;d[q]==="\\"&&(d[q+1]==="\\"||d[q+1]==='"')?q+=2:q++,this._current=q}return this._current++,JSON.parse(d.slice(N,this._current))},_consumeRawStringLiteral:function(d){var N=this._current;this._current++;for(var b=d.length;d[this._current]!=="'"&&this._current<b;){var q=this._current;d[q]==="\\"&&(d[q+1]==="\\"||d[q+1]==="'")?q+=2:q++,this._current=q}this._current++;var L=d.slice(N+1,this._current-1);return L.replace("\\'","'")},_consumeNumber:function(d){var N=this._current;this._current++;for(var b=d.length;Re(d[this._current])&&this._current<b;)this._current++;var q=parseInt(d.slice(N,this._current));return{type:F,value:q,start:N}},_consumeLBracket:function(d){var N=this._current;return this._current++,d[this._current]==="?"?(this._current++,{type:Kr,value:"[?",start:N}):d[this._current]==="]"?(this._current++,{type:At,value:"[]",start:N}):{type:O,value:"[",start:N}},_consumeOperator:function(d){var N=this._current,b=d[N];if(this._current++,b==="!")return d[this._current]==="="?(this._current++,{type:wi,value:"!=",start:N}):{type:f,value:"!",start:N};if(b==="<")return d[this._current]==="="?(this._current++,{type:Sr,value:"<=",start:N}):{type:Cr,value:"<",start:N};if(b===">")return d[this._current]==="="?(this._current++,{type:Nt,value:">=",start:N}):{type:xr,value:">",start:N};if(b==="="&&d[this._current]==="=")return this._current++,{type:Er,value:"==",start:N}},_consumeLiteral:function(d){this._current++;for(var N=this._current,b=d.length,q;d[this._current]!=="`"&&this._current<b;){var L=this._current;d[L]==="\\"&&(d[L+1]==="\\"||d[L+1]==="`")?L+=2:L++,this._current=L}var W=u(d.slice(N,this._current));return W=W.replace("\\`","`"),this._looksLikeJSON(W)?q=JSON.parse(W):q=JSON.parse('"'+W+'"'),this._current++,q},_looksLikeJSON:function(d){var N='[{"',b=["true","false","null"],q="-0123456789";if(d==="")return!1;if(N.indexOf(d[0])>=0)return!0;if(b.indexOf(d)>=0)return!0;if(q.indexOf(d[0])>=0)try{return JSON.parse(d),!0}catch{return!1}else return!1}};var J={};J[C]=0,J[R]=0,J[_]=0,J[T]=0,J[A]=0,J[g]=0,J[X]=0,J[F]=0,J[oe]=0,J[We]=0,J[Me]=1,J[bt]=2,J[Z]=3,J[Er]=5,J[xr]=5,J[Cr]=5,J[Nt]=5,J[Sr]=5,J[wi]=5,J[At]=9,J[Ut]=20,J[Kr]=21,J[m]=40,J[f]=45,J[k]=50,J[O]=55,J[ee]=60;function Xr(){}o(Xr,"Parser"),Xr.prototype={parse:function(d){this._loadTokens(d),this.index=0;var N=this.expression(0);if(this._lookahead(0)!==C){var b=this._lookaheadToken(0),q=new Error("Unexpected token type: "+b.type+", value: "+b.value);throw q.name="ParserError",q}return N},_loadTokens:function(d){var N=new Xi,b=N.tokenize(d);b.push({type:C,value:"",start:d.length}),this.tokens=b},expression:function(d){var N=this._lookaheadToken(0);this._advance();for(var b=this.nud(N),q=this._lookahead(0);d<J[q];)this._advance(),b=this.led(q,b),q=this._lookahead(0);return b},_lookahead:function(d){return this.tokens[this.index+d].type},_lookaheadToken:function(d){return this.tokens[this.index+d]},_advance:function(){this.index++},nud:function(d){var N,b,q;switch(d.type){case we:return{type:"Literal",value:d.value};case R:return{type:"Field",name:d.value};case _:var L={type:"Field",name:d.value};if(this._lookahead(0)===ee)throw new Error("Quoted identifier not allowed for function names.");return L;case f:return b=this.expression(J.Not),{type:"NotExpression",children:[b]};case Ut:return N={type:"Identity"},b=null,this._lookahead(0)===T?b={type:"Identity"}:b=this._parseProjectionRHS(J.Star),{type:"ValueProjection",children:[N,b]};case Kr:return this.led(d.type,{type:"Identity"});case k:return this._parseMultiselectHash();case At:return N={type:At,children:[{type:"Identity"}]},b=this._parseProjectionRHS(J.Flatten),{type:"Projection",children:[N,b]};case O:return this._lookahead(0)===F||this._lookahead(0)===K?(b=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},b)):this._lookahead(0)===Ut&&this._lookahead(1)===T?(this._advance(),this._advance(),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[{type:"Identity"},b]}):this._parseMultiselectList();case oe:return{type:oe};case We:return q=this.expression(J.Expref),{type:"ExpressionReference",children:[q]};case ee:for(var W=[];this._lookahead(0)!==A;)this._lookahead(0)===oe?(q={type:oe},this._advance()):q=this.expression(0),W.push(q);return this._match(A),W[0];default:this._errorToken(d)}},led:function(d,N){var b;switch(d){case m:var q=J.Dot;return this._lookahead(0)!==Ut?(b=this._parseDotRHS(q),{type:"Subexpression",children:[N,b]}):(this._advance(),b=this._parseProjectionRHS(q),{type:"ValueProjection",children:[N,b]});case Me:return b=this.expression(J.Pipe),{type:Me,children:[N,b]};case bt:return b=this.expression(J.Or),{type:"OrExpression",children:[N,b]};case Z:return b=this.expression(J.And),{type:"AndExpression",children:[N,b]};case ee:for(var L=N.name,W=[],Q,se;this._lookahead(0)!==A;)this._lookahead(0)===oe?(Q={type:oe},this._advance()):Q=this.expression(0),this._lookahead(0)===g&&this._match(g),W.push(Q);return this._match(A),se={type:"Function",name:L,children:W},se;case Kr:var $e=this.expression(0);return this._match(T),this._lookahead(0)===At?b={type:"Identity"}:b=this._parseProjectionRHS(J.Filter),{type:"FilterProjection",children:[N,b,$e]};case At:var $t={type:At,children:[N]},_e=this._parseProjectionRHS(J.Flatten);return{type:"Projection",children:[$t,_e]};case Er:case wi:case xr:case Nt:case Cr:case Sr:return this._parseComparator(N,d);case O:var G=this._lookaheadToken(0);return G.type===F||G.type===K?(b=this._parseIndexExpression(),this._projectIfSlice(N,b)):(this._match(Ut),this._match(T),b=this._parseProjectionRHS(J.Star),{type:"Projection",children:[N,b]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(d){if(this._lookahead(0)===d)this._advance();else{var N=this._lookaheadToken(0),b=new Error("Expected "+d+", got: "+N.type);throw b.name="ParserError",b}},_errorToken:function(d){var N=new Error("Invalid token ("+d.type+'): "'+d.value+'"');throw N.name="ParserError",N},_parseIndexExpression:function(){if(this._lookahead(0)===K||this._lookahead(1)===K)return this._parseSliceExpression();var d={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(T),d},_projectIfSlice:function(d,N){var b={type:"IndexExpression",children:[d,N]};return N.type==="Slice"?{type:"Projection",children:[b,this._parseProjectionRHS(J.Star)]}:b},_parseSliceExpression:function(){for(var d=[null,null,null],N=0,b=this._lookahead(0);b!==T&&N<3;){if(b===K)N++,this._advance();else if(b===F)d[N]=this._lookaheadToken(0).value,this._advance();else{var q=this._lookahead(0),L=new Error("Syntax error, unexpected token: "+q.value+"("+q.type+")");throw L.name="Parsererror",L}b=this._lookahead(0)}return this._match(T),{type:"Slice",children:d}},_parseComparator:function(d,N){var b=this.expression(J[N]);return{type:"Comparator",name:N,children:[d,b]}},_parseDotRHS:function(d){var N=this._lookahead(0),b=[R,_,Ut];if(b.indexOf(N)>=0)return this.expression(d);if(N===O)return this._match(O),this._parseMultiselectList();if(N===k)return this._match(k),this._parseMultiselectHash()},_parseProjectionRHS:function(d){var N;if(J[this._lookahead(0)]<10)N={type:"Identity"};else if(this._lookahead(0)===O)N=this.expression(d);else if(this._lookahead(0)===Kr)N=this.expression(d);else if(this._lookahead(0)===m)this._match(m),N=this._parseDotRHS(d);else{var b=this._lookaheadToken(0),q=new Error("Sytanx error, unexpected token: "+b.value+"("+b.type+")");throw q.name="ParserError",q}return N},_parseMultiselectList:function(){for(var d=[];this._lookahead(0)!==T;){var N=this.expression(0);if(d.push(N),this._lookahead(0)===g&&(this._match(g),this._lookahead(0)===T))throw new Error("Unexpected token Rbracket")}return this._match(T),{type:"MultiSelectList",children:d}},_parseMultiselectHash:function(){for(var d=[],N=[R,_],b,q,L,W;;){if(b=this._lookaheadToken(0),N.indexOf(b.type)<0)throw new Error("Expecting an identifier token, got: "+b.type);if(q=b.value,this._advance(),this._match(K),L=this.expression(0),W={type:"KeyValuePair",name:q,value:L},d.push(W),this._lookahead(0)===g)this._match(g);else if(this._lookahead(0)===X){this._match(X);break}}return{type:"MultiSelectHash",children:d}}};function Gi(d){this.runtime=d}o(Gi,"TreeInterpreter"),Gi.prototype={search:function(d,N){return this.visit(d,N)},visit:function(d,N){var b,q,L,W,Q,se,$e,$t,_e,G;switch(d.type){case"Field":return N!==null&&r(N)?(se=N[d.name],se===void 0?null:se):null;case"Subexpression":for(L=this.visit(d.children[0],N),G=1;G<d.children.length;G++)if(L=this.visit(d.children[1],L),L===null)return null;return L;case"IndexExpression":return $e=this.visit(d.children[0],N),$t=this.visit(d.children[1],$e),$t;case"Index":if(!e(N))return null;var Zt=d.value;return Zt<0&&(Zt=N.length+Zt),L=N[Zt],L===void 0&&(L=null),L;case"Slice":if(!e(N))return null;var tp=d.children.slice(0),Is=this.computeSliceParams(N.length,tp),$a=Is[0],Za=Is[1],Os=Is[2];if(L=[],Os>0)for(G=$a;G<Za;G+=Os)L.push(N[G]);else for(G=$a;G>Za;G+=Os)L.push(N[G]);return L;case"Projection":var Ot=this.visit(d.children[0],N);if(!e(Ot))return null;for(_e=[],G=0;G<Ot.length;G++)q=this.visit(d.children[1],Ot[G]),q!==null&&_e.push(q);return _e;case"ValueProjection":if(Ot=this.visit(d.children[0],N),!r(Ot))return null;_e=[];var eu=s(Ot);for(G=0;G<eu.length;G++)q=this.visit(d.children[1],eu[G]),q!==null&&_e.push(q);return _e;case"FilterProjection":if(Ot=this.visit(d.children[0],N),!e(Ot))return null;var Rs=[],tu=[];for(G=0;G<Ot.length;G++)b=this.visit(d.children[2],Ot[G]),n(b)||Rs.push(Ot[G]);for(var Ds=0;Ds<Rs.length;Ds++)q=this.visit(d.children[1],Rs[Ds]),q!==null&&tu.push(q);return tu;case"Comparator":switch(W=this.visit(d.children[0],N),Q=this.visit(d.children[1],N),d.name){case Er:L=i(W,Q);break;case wi:L=!i(W,Q);break;case xr:L=W>Q;break;case Nt:L=W>=Q;break;case Cr:L=W<Q;break;case Sr:L=W<=Q;break;default:throw new Error("Unknown comparator: "+d.name)}return L;case At:var Ps=this.visit(d.children[0],N);if(!e(Ps))return null;var fo=[];for(G=0;G<Ps.length;G++)q=Ps[G],e(q)?fo.push.apply(fo,q):fo.push(q);return fo;case"Identity":return N;case"MultiSelectList":if(N===null)return null;for(_e=[],G=0;G<d.children.length;G++)_e.push(this.visit(d.children[G],N));return _e;case"MultiSelectHash":if(N===null)return null;_e={};var _s;for(G=0;G<d.children.length;G++)_s=d.children[G],_e[_s.name]=this.visit(_s.value,N);return _e;case"OrExpression":return b=this.visit(d.children[0],N),n(b)&&(b=this.visit(d.children[1],N)),b;case"AndExpression":return W=this.visit(d.children[0],N),n(W)===!0?W:this.visit(d.children[1],N);case"NotExpression":return W=this.visit(d.children[0],N),n(W);case"Literal":return d.value;case Me:return $e=this.visit(d.children[0],N),this.visit(d.children[1],$e);case oe:return N;case"Function":var ru=[];for(G=0;G<d.children.length;G++)ru.push(this.visit(d.children[G],N));return this.runtime.callFunction(d.name,ru);case"ExpressionReference":var iu=d.children[0];return iu.jmespathType=We,iu;default:throw new Error("Unknown node type: "+d.type)}},computeSliceParams:function(d,N){var b=N[0],q=N[1],L=N[2],W=[null,null,null];if(L===null)L=1;else if(L===0){var Q=new Error("Invalid slice, step cannot be 0");throw Q.name="RuntimeError",Q}var se=L<0;return b===null?b=se?d-1:0:b=this.capSliceRange(d,b,L),q===null?q=se?-1:d:q=this.capSliceRange(d,q,L),W[0]=b,W[1]=q,W[2]=L,W},capSliceRange:function(d,N,b){return N<0?(N+=d,N<0&&(N=b<0?-1:0)):N>=d&&(N=b<0?d-1:d),N}};function Qa(d){this._interpreter=d,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[D]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[y,v]},{types:[h]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[y]},{types:[y]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[y,v,S]}]},map:{_func:this._functionMap,_signature:[{types:[E]},{types:[v]}]},max:{_func:this._functionMax,_signature:[{types:[D,x]}]},merge:{_func:this._functionMerge,_signature:[{types:[S],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[v]},{types:[E]}]},sum:{_func:this._functionSum,_signature:[{types:[D]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[y]},{types:[y]}]},min:{_func:this._functionMin,_signature:[{types:[D,x]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[v]},{types:[E]}]},type:{_func:this._functionType,_signature:[{types:[h]}]},keys:{_func:this._functionKeys,_signature:[{types:[S]}]},values:{_func:this._functionValues,_signature:[{types:[S]}]},sort:{_func:this._functionSort,_signature:[{types:[x,D]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[v]},{types:[E]}]},join:{_func:this._functionJoin,_signature:[{types:[y]},{types:[x]}]},reverse:{_func:this._functionReverse,_signature:[{types:[y,v]}]},to_array:{_func:this._functionToArray,_signature:[{types:[h]}]},to_string:{_func:this._functionToString,_signature:[{types:[h]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[h]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[h],variadic:!0}]}}}o(Qa,"Runtime"),Qa.prototype={callFunction:function(d,N){var b=this.functionTable[d];if(b===void 0)throw new Error("Unknown function: "+d+"()");return this._validateArgs(d,N,b._signature),b._func.call(this,N)},_validateArgs:function(d,N,b){var q;if(b[b.length-1].variadic){if(N.length<b.length)throw q=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes at least"+b.length+q+" but received "+N.length)}else if(N.length!==b.length)throw q=b.length===1?" argument":" arguments",new Error("ArgumentError: "+d+"() takes "+b.length+q+" but received "+N.length);for(var L,W,Q,se=0;se<b.length;se++){Q=!1,L=b[se].types,W=this._getTypeName(N[se]);for(var $e=0;$e<L.length;$e++)if(this._typeMatches(W,L[$e],N[se])){Q=!0;break}if(!Q){var $t=L.map(function(_e){return p[_e]}).join(",");throw new Error("TypeError: "+d+"() expected argument "+(se+1)+" to be type "+$t+" but received type "+p[W]+" instead.")}}},_typeMatches:function(d,N,b){if(N===h)return!0;if(N===x||N===D||N===v){if(N===v)return d===v;if(d===v){var q;N===D?q=l:N===x&&(q=y);for(var L=0;L<b.length;L++)if(!this._typeMatches(this._getTypeName(b[L]),q,b[L]))return!1;return!0}}else return d===N},_getTypeName:function(d){switch(Object.prototype.toString.call(d)){case"[object String]":return y;case"[object Number]":return l;case"[object Array]":return v;case"[object Boolean]":return I;case"[object Null]":return w;case"[object Object]":return d.jmespathType===We?E:S}},_functionStartsWith:function(d){return d[0].lastIndexOf(d[1])===0},_functionEndsWith:function(d){var N=d[0],b=d[1];return N.indexOf(b,N.length-b.length)!==-1},_functionReverse:function(d){var N=this._getTypeName(d[0]);if(N===y){for(var b=d[0],q="",L=b.length-1;L>=0;L--)q+=b[L];return q}else{var W=d[0].slice(0);return W.reverse(),W}},_functionAbs:function(d){return Math.abs(d[0])},_functionCeil:function(d){return Math.ceil(d[0])},_functionAvg:function(d){for(var N=0,b=d[0],q=0;q<b.length;q++)N+=b[q];return N/b.length},_functionContains:function(d){return d[0].indexOf(d[1])>=0},_functionFloor:function(d){return Math.floor(d[0])},_functionLength:function(d){return r(d[0])?Object.keys(d[0]).length:d[0].length},_functionMap:function(d){for(var N=[],b=this._interpreter,q=d[0],L=d[1],W=0;W<L.length;W++)N.push(b.visit(q,L[W]));return N},_functionMerge:function(d){for(var N={},b=0;b<d.length;b++){var q=d[b];for(var L in q)N[L]=q[L]}return N},_functionMax:function(d){if(d[0].length>0){var N=this._getTypeName(d[0][0]);if(N===l)return Math.max.apply(Math,d[0]);for(var b=d[0],q=b[0],L=1;L<b.length;L++)q.localeCompare(b[L])<0&&(q=b[L]);return q}else return null},_functionMin:function(d){if(d[0].length>0){var N=this._getTypeName(d[0][0]);if(N===l)return Math.min.apply(Math,d[0]);for(var b=d[0],q=b[0],L=1;L<b.length;L++)b[L].localeCompare(q)<0&&(q=b[L]);return q}else return null},_functionSum:function(d){for(var N=0,b=d[0],q=0;q<b.length;q++)N+=b[q];return N},_functionType:function(d){switch(this._getTypeName(d[0])){case l:return"number";case y:return"string";case v:return"array";case S:return"object";case I:return"boolean";case E:return"expref";case w:return"null"}},_functionKeys:function(d){return Object.keys(d[0])},_functionValues:function(d){for(var N=d[0],b=Object.keys(N),q=[],L=0;L<b.length;L++)q.push(N[b[L]]);return q},_functionJoin:function(d){var N=d[0],b=d[1];return b.join(N)},_functionToArray:function(d){return this._getTypeName(d[0])===v?d[0]:[d[0]]},_functionToString:function(d){return this._getTypeName(d[0])===y?d[0]:JSON.stringify(d[0])},_functionToNumber:function(d){var N=this._getTypeName(d[0]),b;return N===l?d[0]:N===y&&(b=+d[0],!isNaN(b))?b:null},_functionNotNull:function(d){for(var N=0;N<d.length;N++)if(this._getTypeName(d[N])!==w)return d[N];return null},_functionSort:function(d){var N=d[0].slice(0);return N.sort(),N},_functionSortBy:function(d){var N=d[0].slice(0);if(N.length===0)return N;var b=this._interpreter,q=d[1],L=this._getTypeName(b.visit(q,N[0]));if([l,y].indexOf(L)<0)throw new Error("TypeError");for(var W=this,Q=[],se=0;se<N.length;se++)Q.push([se,N[se]]);Q.sort(function($t,_e){var G=b.visit(q,$t[1]),Zt=b.visit(q,_e[1]);if(W._getTypeName(G)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(G));if(W._getTypeName(Zt)!==L)throw new Error("TypeError: expected "+L+", received "+W._getTypeName(Zt));return G>Zt?1:G<Zt?-1:$t[0]-_e[0]});for(var $e=0;$e<Q.length;$e++)N[$e]=Q[$e][1];return N},_functionMaxBy:function(d){for(var N=d[1],b=d[0],q=this.createKeyFunction(N,[l,y]),L=-1/0,W,Q,se=0;se<b.length;se++)Q=q(b[se]),Q>L&&(L=Q,W=b[se]);return W},_functionMinBy:function(d){for(var N=d[1],b=d[0],q=this.createKeyFunction(N,[l,y]),L=1/0,W,Q,se=0;se<b.length;se++)Q=q(b[se]),Q<L&&(L=Q,W=b[se]);return W},createKeyFunction:function(d,N){var b=this,q=this._interpreter,L=o(function(W){var Q=q.visit(d,W);if(N.indexOf(b._getTypeName(Q))<0){var se="TypeError: expected one of "+N+", received "+b._getTypeName(Q);throw new Error(se)}return Q},"keyFunc");return L}};function $h(d){var N=new Xr,b=N.parse(d);return b}o($h,"compile");function Zh(d){var N=new Xi;return N.tokenize(d)}o(Zh,"tokenize");function ep(d,N){var b=new Xr,q=new Qa,L=new Gi(q);q._interpreter=L;var W=b.parse(N);return L.search(W,d)}o(ep,"search"),t.tokenize=Zh,t.compile=$h,t.search=ep,t.strictDeepEqual=i})(typeof $o>"u"?$o.jmespath={}:$o)});var vl=P(()=>{var ce=V(),yl=ml(),Dy=ce.util.inherit,es=ce.util.domain,Py=Zo(),_y={success:1,error:1,complete:1};function qy(t){return Object.prototype.hasOwnProperty.call(_y,t._asm.currentState)}o(qy,"isTerminalState");var Ta=new yl;Ta.setupStates=function(){var t=o(function(e,r){var i=this;i._haltHandlersOnError=!1,i.emit(i._asm.currentState,function(n){if(n)if(qy(i))if(es&&i.domain instanceof es.Domain)n.domainEmitter=i,n.domain=i.domain,n.domainThrown=!1,i.domain.emit("error",n);else throw n;else i.response.error=n,r(n);else r(i.response.error)})},"transition");this.addState("validate","build","error",t),this.addState("build","afterBuild","restart",t),this.addState("afterBuild","sign","restart",t),this.addState("sign","send","retry",t),this.addState("retry","afterRetry","afterRetry",t),this.addState("afterRetry","sign","error",t),this.addState("send","validateResponse","retry",t),this.addState("validateResponse","extractData","extractError",t),this.addState("extractError","extractData","retry",t),this.addState("extractData","success","retry",t),this.addState("restart","build","error",t),this.addState("success","complete","complete",t),this.addState("error","complete","complete",t),this.addState("complete",null,null,t)};Ta.setupStates();ce.Request=Dy({constructor:o(function(e,r,i){var n=e.endpoint,s=e.config.region,a=e.config.customUserAgent;e.signingRegion?s=e.signingRegion:e.isGlobalEndpoint&&(s="us-east-1"),this.domain=es&&es.active,this.service=e,this.operation=r,this.params=i||{},this.httpRequest=new ce.HttpRequest(n,s),this.httpRequest.appendToUserAgent(a),this.startTime=e.getSkewCorrectedDate(),this.response=new ce.Response(this),this._asm=new yl(Ta.states,"validate"),this._haltHandlersOnError=!1,ce.SequentialExecutor.call(this),this.emit=this.emitEvent},"Request"),send:o(function(e){return e&&(this.httpRequest.appendToUserAgent("callback"),this.on("complete",function(r){e.call(r,r.error,r.data)})),this.runTo(),this.response},"send"),build:o(function(e){return this.runTo("send",e)},"build"),runTo:o(function(e,r){return this._asm.runTo(e,r,this),this},"runTo"),abort:o(function(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",o(function(r){r.error=ce.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1})},"addAbortedError")),this.httpRequest.stream&&!this.httpRequest.stream.didCallback&&(this.httpRequest.stream.abort(),this.httpRequest._abortCallback?this.httpRequest._abortCallback():this.removeAllListeners("send")),this},"abort"),eachPage:o(function(e){e=ce.util.fn.makeAsync(e,3);function r(i){e.call(i,i.error,i.data,function(n){n!==!1&&(i.hasNextPage()?i.nextPage().on("complete",r).send():e.call(i,null,null,ce.util.fn.noop))})}o(r,"wrappedCallback"),this.on("complete",r).send()},"eachPage"),eachItem:o(function(e){var r=this;function i(n,s){if(n)return e(n,null);if(s===null)return e(null,null);var a=r.service.paginationConfig(r.operation),u=a.resultKey;Array.isArray(u)&&(u=u[0]);var l=Py.search(s,u),h=!0;return ce.util.arrayEach(l,function(y){if(h=e(null,y),h===!1)return ce.util.abort}),h}o(i,"wrappedCallback"),this.eachPage(i)},"eachItem"),isPageable:o(function(){return!!this.service.paginationConfig(this.operation)},"isPageable"),createReadStream:o(function(){var e=ce.util.stream,r=this,i=null;return ce.HttpClient.streamsApiVersion===2?(i=new e.PassThrough,process.nextTick(function(){r.send()})):(i=new e.Stream,i.readable=!0,i.sent=!1,i.on("newListener",function(n){!i.sent&&n==="data"&&(i.sent=!0,process.nextTick(function(){r.send()}))})),this.on("error",function(n){i.emit("error",n)}),this.on("httpHeaders",o(function(s,a,u){if(s<300){r.removeListener("httpData",ce.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",ce.EventListeners.Core.HTTP_ERROR),r.on("httpError",o(function(w){u.error=w,u.error.retryable=!1},"streamHttpError"));var l=!1,h;if(r.httpRequest.method!=="HEAD"&&(h=parseInt(a["content-length"],10)),h!==void 0&&!isNaN(h)&&h>=0){l=!0;var y=0}var v=o(function(){l&&y!==h?i.emit("error",ce.util.error(new Error("Stream content length mismatch. Received "+y+" of "+h+" bytes."),{code:"StreamContentLengthMismatch"})):ce.HttpClient.streamsApiVersion===2?i.end():i.emit("end")},"checkContentLengthAndEmit"),S=u.httpResponse.createUnbufferedStream();if(ce.HttpClient.streamsApiVersion===2)if(l){var I=new e.PassThrough;I._write=function(E){return E&&E.length&&(y+=E.length),e.PassThrough.prototype._write.apply(this,arguments)},I.on("end",v),i.on("error",function(E){l=!1,S.unpipe(I),I.emit("end"),I.end()}),S.pipe(I).pipe(i,{end:!1})}else S.pipe(i);else l&&S.on("data",function(E){E&&E.length&&(y+=E.length)}),S.on("data",function(E){i.emit("data",E)}),S.on("end",v);S.on("error",function(E){l=!1,i.emit("error",E)})}},"streamHeaders")),i},"createReadStream"),emitEvent:o(function(e,r,i){typeof r=="function"&&(i=r,r=null),i||(i=o(function(){},"done")),r||(r=this.eventParameters(e,this.response));var n=ce.SequentialExecutor.prototype.emit;n.call(this,e,r,function(s){s&&(this.response.error=s),i.call(this,s)})},"emit"),eventParameters:o(function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},"eventParameters"),presign:o(function(e,r){return!r&&typeof e=="function"&&(r=e,e=null),new ce.Signers.Presign().sign(this.toGet(),e,r)},"presign"),isPresigned:o(function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},"isPresigned"),toUnauthenticated:o(function(){return this._unAuthenticated=!0,this.removeListener("validate",ce.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",ce.EventListeners.Core.SIGN),this},"toUnauthenticated"),toGet:o(function(){return(this.service.api.protocol==="query"||this.service.api.protocol==="ec2")&&(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},"toGet"),buildAsGet:o(function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},"buildAsGet"),haltHandlersOnError:o(function(){this._haltHandlersOnError=!0},"haltHandlersOnError")});ce.Request.addPromisesToClass=o(function(e){this.prototype.promise=o(function(){var i=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(n,s){i.on("complete",function(a){a.error?s(a.error):n(Object.defineProperty(a.data||{},"$response",{value:a}))}),i.runTo()})},"promise")},"addPromisesToClass");ce.Request.deletePromisesFromClass=o(function(){delete this.prototype.promise},"deletePromisesFromClass");ce.util.addPromises(ce.Request);ce.util.mixin(ce.Request,ce.SequentialExecutor)});var Nl=P(()=>{var Vn=V(),ky=Vn.util.inherit,gl=Zo();Vn.Response=ky({constructor:o(function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new Vn.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},"Response"),nextPage:o(function(e){var r,i=this.request.service,n=this.request.operation;try{r=i.paginationConfig(n,!0)}catch(l){this.error=l}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var s=Vn.util.copy(this.request.params);if(this.nextPageTokens){var a=r.inputToken;typeof a=="string"&&(a=[a]);for(var u=0;u<a.length;u++)s[a[u]]=this.nextPageTokens[u];return i.makeRequest(this.request.operation,s,e)}else return e?e(null,null):null},"nextPage"),hasNextPage:o(function(){if(this.cacheNextPageTokens(),this.nextPageTokens)return!0;if(this.nextPageTokens!==void 0)return!1},"hasNextPage"),cacheNextPageTokens:o(function(){if(Object.prototype.hasOwnProperty.call(this,"nextPageTokens"))return this.nextPageTokens;this.nextPageTokens=void 0;var e=this.request.service.paginationConfig(this.request.operation);if(!e)return this.nextPageTokens;if(this.nextPageTokens=null,e.moreResults&&!gl.search(this.data,e.moreResults))return this.nextPageTokens;var r=e.outputToken;return typeof r=="string"&&(r=[r]),Vn.util.arrayEach.call(this,r,function(i){var n=gl.search(this.data,i);n&&(this.nextPageTokens=this.nextPageTokens||[],this.nextPageTokens.push(n))}),this.nextPageTokens},"cacheNextPageTokens")})});var El=P(()=>{var fi=V(),Ly=fi.util.inherit,zi=Zo();function wl(t){var e=t.request._waiter,r=e.config.acceptors,i=!1,n="retry";r.forEach(function(s){if(!i){var a=e.matchers[s.matcher];a&&a(t,s.expected,s.argument)&&(i=!0,n=s.state)}}),!i&&t.error&&(n="failure"),n==="success"?e.setSuccess(t):e.setError(t,n==="retry")}o(wl,"CHECK_ACCEPTORS");fi.ResourceWaiter=Ly({constructor:o(function(e,r){this.service=e,this.state=r,this.loadWaiterConfig(this.state)},"constructor"),service:null,state:null,config:null,matchers:{path:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}return zi.strictDeepEqual(i,e)},pathAll:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);var n=i.length;if(!n)return!1;for(var s=0;s<n;s++)if(!zi.strictDeepEqual(i[s],e))return!1;return!0},pathAny:function(t,e,r){try{var i=zi.search(t.data,r)}catch{return!1}Array.isArray(i)||(i=[i]);for(var n=i.length,s=0;s<n;s++)if(zi.strictDeepEqual(i[s],e))return!0;return!1},status:function(t,e){var r=t.httpResponse.statusCode;return typeof r=="number"&&r===e},error:function(t,e){return typeof e=="string"&&t.error?e===t.error.code:e===!!t.error}},listeners:new fi.SequentialExecutor().addNamedListeners(function(t){t("RETRY_CHECK","retry",function(e){var r=e.request._waiter;e.error&&e.error.code==="ResourceNotReady"&&(e.error.retryDelay=(r.config.delay||0)*1e3)}),t("CHECK_OUTPUT","extractData",wl),t("CHECK_ERROR","extractError",wl)}),wait:o(function(e,r){typeof e=="function"&&(r=e,e=void 0),e&&e.$waiter&&(e=fi.util.copy(e),typeof e.$waiter.delay=="number"&&(this.config.delay=e.$waiter.delay),typeof e.$waiter.maxAttempts=="number"&&(this.config.maxAttempts=e.$waiter.maxAttempts),delete e.$waiter);var i=this.service.makeRequest(this.config.operation,e);return i._waiter=this,i.response.maxRetries=this.config.maxAttempts,i.addListeners(this.listeners),r&&i.send(r),i},"wait"),setSuccess:o(function(e){e.error=null,e.data=e.data||{},e.request.removeAllListeners("extractData")},"setSuccess"),setError:o(function(e,r){e.data=null,e.error=fi.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:r})},"setError"),loadWaiterConfig:o(function(e){if(!this.service.api.waiters[e])throw new fi.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."});this.config=fi.util.copy(this.service.api.waiters[e])},"loadWaiterConfig")})});var Cl=P((ik,xl)=>{var vr=V(),My=vr.util.inherit;vr.Signers.V2=My(vr.Signers.RequestSigner,{addAuthorization:o(function(e,r){r||(r=vr.util.date.getDate());var i=this.request;i.params.Timestamp=vr.util.date.iso8601(r),i.params.SignatureVersion="2",i.params.SignatureMethod="HmacSHA256",i.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(i.params.SecurityToken=e.sessionToken),delete i.params.Signature,i.params.Signature=this.signature(e),i.body=vr.util.queryParamsToString(i.params),i.headers["Content-Length"]=i.body.length},"addAuthorization"),signature:o(function(e){return vr.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:o(function(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(vr.util.queryParamsToString(this.request.params)),e.join(`
3
+ `)},"stringToSign")});xl.exports=vr.Signers.V2});var ba=P((ok,Sl)=>{var Gt=V(),Fy=Gt.util.inherit;Gt.Signers.V3=Fy(Gt.Signers.RequestSigner,{addAuthorization:o(function(e,r){var i=Gt.util.date.rfc822(r);this.request.headers["X-Amz-Date"]=i,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken),this.request.headers["X-Amzn-Authorization"]=this.authorization(e,i)},"addAuthorization"),authorization:o(function(e){return"AWS3 AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,SignedHeaders="+this.signedHeaders()+",Signature="+this.signature(e)},"authorization"),signedHeaders:o(function(){var e=[];return Gt.util.arrayEach(this.headersToSign(),o(function(i){e.push(i.toLowerCase())},"iterator")),e.sort().join(";")},"signedHeaders"),canonicalHeaders:o(function(){var e=this.request.headers,r=[];return Gt.util.arrayEach(this.headersToSign(),o(function(n){r.push(n.toLowerCase().trim()+":"+String(e[n]).trim())},"iterator")),r.sort().join(`
5
4
  `)+`
6
- `},"canonicalHeaders"),headersToSign:s(function(){var e=[];return Jt.util.each(this.request.headers,s(function(i){(i==="Host"||i==="Content-Encoding"||i.match(/^X-Amz/i))&&e.push(i)},"iterator")),e},"headersToSign"),signature:s(function(e){return Jt.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:s(function(){var e=[];return e.push(this.request.method),e.push("/"),e.push(""),e.push(this.canonicalHeaders()),e.push(this.request.body),Jt.util.crypto.sha256(e.join(`
7
- `))},"stringToSign")});vl.exports=Jt.Signers.V3});var Nl=P((Y_,gl)=>{var Zs=V(),Oy=Zs.util.inherit;Ea();Zs.Signers.V3Https=Oy(Zs.Signers.V3,{authorization:s(function(e){return"AWS3-HTTPS AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,Signature="+this.signature(e)},"authorization"),stringToSign:s(function(){return this.request.headers["X-Amz-Date"]},"stringToSign")});gl.exports=Zs.Signers.V3Https});var El=P((Z_,xl)=>{var Vn=V(),Un={},eo=[],Dy=50,wl="aws4_request";xl.exports={createScope:s(function(e,r,i){return[e.substr(0,8),r,i,wl].join("/")},"createScope"),getSigningKey:s(function(e,r,i,n,o){var a=Vn.util.crypto.hmac(e.secretAccessKey,e.accessKeyId,"base64"),u=[a,r,i,n].join("_");if(o=o!==!1,o&&u in Un)return Un[u];var l=Vn.util.crypto.hmac("AWS4"+e.secretAccessKey,r,"buffer"),f=Vn.util.crypto.hmac(l,i,"buffer"),y=Vn.util.crypto.hmac(f,n,"buffer"),v=Vn.util.crypto.hmac(y,wl,"buffer");return o&&(Un[u]=v,eo.push(u),eo.length>Dy&&delete Un[eo.shift()]),v},"getSigningKey"),emptyCache:s(function(){Un={},eo=[]},"emptyCache")}});var Tl=P((tq,Sl)=>{var tt=V(),Cl=El(),Py=tt.util.inherit,to="presigned-expires";tt.Signers.V4=Py(tt.Signers.RequestSigner,{constructor:s(function(e,r,i){tt.Signers.RequestSigner.call(this,e),this.serviceName=r,i=i||{},this.signatureCache=typeof i.signatureCache=="boolean"?i.signatureCache:!0,this.operation=i.operation,this.signatureVersion=i.signatureVersion},"V4"),algorithm:"AWS4-HMAC-SHA256",addAuthorization:s(function(e,r){var i=tt.util.date.iso8601(r).replace(/[:\-]|\.\d{3}/g,"");this.isPresigned()?this.updateForPresigned(e,i):this.addHeaders(e,i),this.request.headers.Authorization=this.authorization(e,i)},"addAuthorization"),addHeaders:s(function(e,r){this.request.headers["X-Amz-Date"]=r,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken)},"addHeaders"),updateForPresigned:s(function(e,r){var i=this.credentialString(r),n={"X-Amz-Date":r,"X-Amz-Algorithm":this.algorithm,"X-Amz-Credential":e.accessKeyId+"/"+i,"X-Amz-Expires":this.request.headers[to],"X-Amz-SignedHeaders":this.signedHeaders()};e.sessionToken&&(n["X-Amz-Security-Token"]=e.sessionToken),this.request.headers["Content-Type"]&&(n["Content-Type"]=this.request.headers["Content-Type"]),this.request.headers["Content-MD5"]&&(n["Content-MD5"]=this.request.headers["Content-MD5"]),this.request.headers["Cache-Control"]&&(n["Cache-Control"]=this.request.headers["Cache-Control"]),tt.util.each.call(this,this.request.headers,function(a,u){if(a!==to&&this.isSignableHeader(a)){var l=a.toLowerCase();l.indexOf("x-amz-meta-")===0?n[l]=u:l.indexOf("x-amz-")===0&&(n[a]=u)}});var o=this.request.path.indexOf("?")>=0?"&":"?";this.request.path+=o+tt.util.queryParamsToString(n)},"updateForPresigned"),authorization:s(function(e,r){var i=[],n=this.credentialString(r);return i.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n),i.push("SignedHeaders="+this.signedHeaders()),i.push("Signature="+this.signature(e,r)),i.join(", ")},"authorization"),signature:s(function(e,r){var i=Cl.getSigningKey(e,r.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return tt.util.crypto.hmac(i,this.stringToSign(r),"hex")},"signature"),stringToSign:s(function(e){var r=[];return r.push("AWS4-HMAC-SHA256"),r.push(e),r.push(this.credentialString(e)),r.push(this.hexEncodedHash(this.canonicalString())),r.join(`
8
- `)},"stringToSign"),canonicalString:s(function(){var e=[],r=this.request.pathname();return this.serviceName!=="s3"&&this.signatureVersion!=="s3v4"&&(r=tt.util.uriEscapePath(r)),e.push(this.request.method),e.push(r),e.push(this.request.search()),e.push(this.canonicalHeaders()+`
5
+ `},"canonicalHeaders"),headersToSign:o(function(){var e=[];return Gt.util.each(this.request.headers,o(function(i){(i==="Host"||i==="Content-Encoding"||i.match(/^X-Amz/i))&&e.push(i)},"iterator")),e},"headersToSign"),signature:o(function(e){return Gt.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},"signature"),stringToSign:o(function(){var e=[];return e.push(this.request.method),e.push("/"),e.push(""),e.push(this.canonicalHeaders()),e.push(this.request.body),Gt.util.crypto.sha256(e.join(`
6
+ `))},"stringToSign")});Sl.exports=Gt.Signers.V3});var bl=P((ak,Tl)=>{var ts=V(),Wy=ts.util.inherit;ba();ts.Signers.V3Https=Wy(ts.Signers.V3,{authorization:o(function(e){return"AWS3-HTTPS AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,Signature="+this.signature(e)},"authorization"),stringToSign:o(function(){return this.request.headers["X-Amz-Date"]},"stringToSign")});Tl.exports=ts.Signers.V3Https});var Ol=P((ck,Il)=>{var zn=V(),Hn={},rs=[],By=50,Al="aws4_request";Il.exports={createScope:o(function(e,r,i){return[e.substr(0,8),r,i,Al].join("/")},"createScope"),getSigningKey:o(function(e,r,i,n,s){var a=zn.util.crypto.hmac(e.secretAccessKey,e.accessKeyId,"base64"),u=[a,r,i,n].join("_");if(s=s!==!1,s&&u in Hn)return Hn[u];var l=zn.util.crypto.hmac("AWS4"+e.secretAccessKey,r,"buffer"),h=zn.util.crypto.hmac(l,i,"buffer"),y=zn.util.crypto.hmac(h,n,"buffer"),v=zn.util.crypto.hmac(y,Al,"buffer");return s&&(Hn[u]=v,rs.push(u),rs.length>By&&delete Hn[rs.shift()]),v},"getSigningKey"),emptyCache:o(function(){Hn={},rs=[]},"emptyCache")}});var Pl=P((fk,Dl)=>{var nt=V(),Rl=Ol(),Uy=nt.util.inherit,is="presigned-expires";nt.Signers.V4=Uy(nt.Signers.RequestSigner,{constructor:o(function(e,r,i){nt.Signers.RequestSigner.call(this,e),this.serviceName=r,i=i||{},this.signatureCache=typeof i.signatureCache=="boolean"?i.signatureCache:!0,this.operation=i.operation,this.signatureVersion=i.signatureVersion},"V4"),algorithm:"AWS4-HMAC-SHA256",addAuthorization:o(function(e,r){var i=nt.util.date.iso8601(r).replace(/[:\-]|\.\d{3}/g,"");this.isPresigned()?this.updateForPresigned(e,i):this.addHeaders(e,i),this.request.headers.Authorization=this.authorization(e,i)},"addAuthorization"),addHeaders:o(function(e,r){this.request.headers["X-Amz-Date"]=r,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken)},"addHeaders"),updateForPresigned:o(function(e,r){var i=this.credentialString(r),n={"X-Amz-Date":r,"X-Amz-Algorithm":this.algorithm,"X-Amz-Credential":e.accessKeyId+"/"+i,"X-Amz-Expires":this.request.headers[is],"X-Amz-SignedHeaders":this.signedHeaders()};e.sessionToken&&(n["X-Amz-Security-Token"]=e.sessionToken),this.request.headers["Content-Type"]&&(n["Content-Type"]=this.request.headers["Content-Type"]),this.request.headers["Content-MD5"]&&(n["Content-MD5"]=this.request.headers["Content-MD5"]),this.request.headers["Cache-Control"]&&(n["Cache-Control"]=this.request.headers["Cache-Control"]),nt.util.each.call(this,this.request.headers,function(a,u){if(a!==is&&this.isSignableHeader(a)){var l=a.toLowerCase();l.indexOf("x-amz-meta-")===0?n[l]=u:l.indexOf("x-amz-")===0&&(n[a]=u)}});var s=this.request.path.indexOf("?")>=0?"&":"?";this.request.path+=s+nt.util.queryParamsToString(n)},"updateForPresigned"),authorization:o(function(e,r){var i=[],n=this.credentialString(r);return i.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n),i.push("SignedHeaders="+this.signedHeaders()),i.push("Signature="+this.signature(e,r)),i.join(", ")},"authorization"),signature:o(function(e,r){var i=Rl.getSigningKey(e,r.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return nt.util.crypto.hmac(i,this.stringToSign(r),"hex")},"signature"),stringToSign:o(function(e){var r=[];return r.push("AWS4-HMAC-SHA256"),r.push(e),r.push(this.credentialString(e)),r.push(this.hexEncodedHash(this.canonicalString())),r.join(`
7
+ `)},"stringToSign"),canonicalString:o(function(){var e=[],r=this.request.pathname();return this.serviceName!=="s3"&&this.signatureVersion!=="s3v4"&&(r=nt.util.uriEscapePath(r)),e.push(this.request.method),e.push(r),e.push(this.request.search()),e.push(this.canonicalHeaders()+`
9
8
  `),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join(`
10
- `)},"canonicalString"),canonicalHeaders:s(function(){var e=[];tt.util.each.call(this,this.request.headers,function(i,n){e.push([i,n])}),e.sort(function(i,n){return i[0].toLowerCase()<n[0].toLowerCase()?-1:1});var r=[];return tt.util.arrayEach.call(this,e,function(i){var n=i[0].toLowerCase();if(this.isSignableHeader(n)){var o=i[1];if(typeof o>"u"||o===null||typeof o.toString!="function")throw tt.util.error(new Error("Header "+n+" contains invalid value"),{code:"InvalidHeader"});r.push(n+":"+this.canonicalHeaderValues(o.toString()))}}),r.join(`
11
- `)},"canonicalHeaders"),canonicalHeaderValues:s(function(e){return e.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")},"canonicalHeaderValues"),signedHeaders:s(function(){var e=[];return tt.util.each.call(this,this.request.headers,function(r){r=r.toLowerCase(),this.isSignableHeader(r)&&e.push(r)}),e.sort().join(";")},"signedHeaders"),credentialString:s(function(e){return Cl.createScope(e.substr(0,8),this.request.region,this.serviceName)},"credentialString"),hexEncodedHash:s(function(e){return tt.util.crypto.sha256(e,"hex")},"hash"),hexEncodedBodyHash:s(function(){var e=this.request;return this.isPresigned()&&["s3","s3-object-lambda"].indexOf(this.serviceName)>-1&&!e.body?"UNSIGNED-PAYLOAD":e.headers["X-Amz-Content-Sha256"]?e.headers["X-Amz-Content-Sha256"]:this.hexEncodedHash(this.request.body||"")},"hexEncodedBodyHash"),unsignableHeaders:["authorization","content-type","content-length","user-agent",to,"expect","x-amzn-trace-id"],isSignableHeader:s(function(e){return e.toLowerCase().indexOf("x-amz-")===0?!0:this.unsignableHeaders.indexOf(e)<0},"isSignableHeader"),isPresigned:s(function(){return!!this.request.headers[to]},"isPresigned")});Sl.exports=tt.Signers.V4});var Al=P((iq,bl)=>{var Qt=V(),_y=Qt.util.inherit;Qt.Signers.S3=_y(Qt.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,analytics:1,cors:1,lifecycle:1,delete:1,inventory:1,location:1,logging:1,metrics:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:s(function(e,r){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=Qt.util.date.rfc822(r)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var i=this.sign(e.secretAccessKey,this.stringToSign()),n="AWS "+e.accessKeyId+":"+i;this.request.headers.Authorization=n},"addAuthorization"),stringToSign:s(function(){var e=this.request,r=[];r.push(e.method),r.push(e.headers["Content-MD5"]||""),r.push(e.headers["Content-Type"]||""),r.push(e.headers["presigned-expires"]||"");var i=this.canonicalizedAmzHeaders();return i&&r.push(i),r.push(this.canonicalizedResource()),r.join(`
12
- `)},"stringToSign"),canonicalizedAmzHeaders:s(function(){var e=[];Qt.util.each(this.request.headers,function(i){i.match(/^x-amz-/i)&&e.push(i)}),e.sort(function(i,n){return i.toLowerCase()<n.toLowerCase()?-1:1});var r=[];return Qt.util.arrayEach.call(this,e,function(i){r.push(i.toLowerCase()+":"+String(this.request.headers[i]))}),r.join(`
13
- `)},"canonicalizedAmzHeaders"),canonicalizedResource:s(function(){var e=this.request,r=e.path.split("?"),i=r[0],n=r[1],o="";if(e.virtualHostedBucket&&(o+="/"+e.virtualHostedBucket),o+=i,n){var a=[];Qt.util.arrayEach.call(this,n.split("&"),function(u){var l=u.split("=")[0],f=u.split("=")[1];if(this.subResources[l]||this.responseHeaders[l]){var y={name:l};f!==void 0&&(this.subResources[l]?y.value=f:y.value=decodeURIComponent(f)),a.push(y)}}),a.sort(function(u,l){return u.name<l.name?-1:1}),a.length&&(n=[],Qt.util.arrayEach(a,function(u){u.value===void 0?n.push(u.name):n.push(u.name+"="+u.value)}),o+="?"+n.join("&"))}return o},"canonicalizedResource"),sign:s(function(e,r){return Qt.util.crypto.hmac(e,r,"base64","sha1")},"sign")});bl.exports=Qt.Signers.S3});var Rl=P((sq,Il)=>{var je=V(),qy=je.util.inherit,Fi="presigned-expires";function ky(t){var e=t.httpRequest.headers[Fi],r=t.service.getSignerClass(t);if(delete t.httpRequest.headers["User-Agent"],delete t.httpRequest.headers["X-Amz-User-Agent"],r===je.Signers.V4){if(e>604800){var i="Presigning does not support expiry time greater than a week with SigV4 signing.";throw je.util.error(new Error,{code:"InvalidExpiryTime",message:i,retryable:!1})}t.httpRequest.headers[Fi]=e}else if(r===je.Signers.S3){var n=t.service?t.service.getSkewCorrectedDate():je.util.date.getDate();t.httpRequest.headers[Fi]=parseInt(je.util.date.unixTimestamp(n)+e,10).toString()}else throw je.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1})}s(ky,"signedUrlBuilder");function Ly(t){var e=t.httpRequest.endpoint,r=je.util.urlParse(t.httpRequest.path),i={};r.search&&(i=je.util.queryStringParse(r.search.substr(1)));var n=t.httpRequest.headers.Authorization.split(" ");if(n[0]==="AWS")n=n[1].split(":"),i.Signature=n.pop(),i.AWSAccessKeyId=n.join(":"),je.util.each(t.httpRequest.headers,function(u,l){u===Fi&&(u="Expires"),u.indexOf("x-amz-meta-")===0&&(delete i[u],u=u.toLowerCase()),i[u]=l}),delete t.httpRequest.headers[Fi],delete i.Authorization,delete i.Host;else if(n[0]==="AWS4-HMAC-SHA256"){n.shift();var o=n.join(" "),a=o.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}e.pathname=r.pathname,e.search=je.util.queryParamsToString(i)}s(Ly,"signedUrlSigner");je.Signers.Presign=qy({sign:s(function(e,r,i){if(e.httpRequest.headers[Fi]=r||3600,e.on("build",ky),e.on("sign",Ly),e.removeListener("afterBuild",je.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",je.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),i)e.build(function(){this.response.error?i(this.response.error):i(null,je.util.urlFormat(e.httpRequest.endpoint))});else{if(e.build(),e.response.error)throw e.response.error;return je.util.urlFormat(e.httpRequest.endpoint)}},"sign")});Il.exports=je.Signers.Presign});var Ol=P(()=>{var ro=V();ro.Signers.Bearer=ro.util.inherit(ro.Signers.RequestSigner,{constructor:s(function(e){ro.Signers.RequestSigner.call(this,e)},"Bearer"),addAuthorization:s(function(e){this.request.httpRequest.headers.Authorization="Bearer "+e.token},"addAuthorization")})});var Dl=P(()=>{var Yt=V(),Fy=Yt.util.inherit;Yt.Signers.RequestSigner=Fy({constructor:s(function(e){this.request=e},"RequestSigner"),setServiceClientId:s(function(e){this.serviceClientId=e},"setServiceClientId"),getServiceClientId:s(function(){return this.serviceClientId},"getServiceClientId")});Yt.Signers.RequestSigner.getVersion=s(function(e){switch(e){case"v2":return Yt.Signers.V2;case"v3":return Yt.Signers.V3;case"s3v4":return Yt.Signers.V4;case"v4":return Yt.Signers.V4;case"s3":return Yt.Signers.S3;case"v3https":return Yt.Signers.V3Https;case"bearer":return Yt.Signers.Bearer}throw new Error("Unknown signing version "+e)},"getVersion");yl();Ea();Nl();Tl();Al();Rl();Ol()});var Pl=P(()=>{var Mt=V();Mt.ParamValidator=Mt.util.inherit({constructor:s(function(e){(e===!0||e===void 0)&&(e={min:!0}),this.validation=e},"ParamValidator"),validate:s(function(e,r,i){if(this.errors=[],this.validateMember(e,r||{},i||"params"),this.errors.length>1){var n=this.errors.join(`
9
+ `)},"canonicalString"),canonicalHeaders:o(function(){var e=[];nt.util.each.call(this,this.request.headers,function(i,n){e.push([i,n])}),e.sort(function(i,n){return i[0].toLowerCase()<n[0].toLowerCase()?-1:1});var r=[];return nt.util.arrayEach.call(this,e,function(i){var n=i[0].toLowerCase();if(this.isSignableHeader(n)){var s=i[1];if(typeof s>"u"||s===null||typeof s.toString!="function")throw nt.util.error(new Error("Header "+n+" contains invalid value"),{code:"InvalidHeader"});r.push(n+":"+this.canonicalHeaderValues(s.toString()))}}),r.join(`
10
+ `)},"canonicalHeaders"),canonicalHeaderValues:o(function(e){return e.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")},"canonicalHeaderValues"),signedHeaders:o(function(){var e=[];return nt.util.each.call(this,this.request.headers,function(r){r=r.toLowerCase(),this.isSignableHeader(r)&&e.push(r)}),e.sort().join(";")},"signedHeaders"),credentialString:o(function(e){return Rl.createScope(e.substr(0,8),this.request.region,this.serviceName)},"credentialString"),hexEncodedHash:o(function(e){return nt.util.crypto.sha256(e,"hex")},"hash"),hexEncodedBodyHash:o(function(){var e=this.request;return this.isPresigned()&&["s3","s3-object-lambda"].indexOf(this.serviceName)>-1&&!e.body?"UNSIGNED-PAYLOAD":e.headers["X-Amz-Content-Sha256"]?e.headers["X-Amz-Content-Sha256"]:this.hexEncodedHash(this.request.body||"")},"hexEncodedBodyHash"),unsignableHeaders:["authorization","content-type","content-length","user-agent",is,"expect","x-amzn-trace-id"],isSignableHeader:o(function(e){return e.toLowerCase().indexOf("x-amz-")===0?!0:this.unsignableHeaders.indexOf(e)<0},"isSignableHeader"),isPresigned:o(function(){return!!this.request.headers[is]},"isPresigned")});Dl.exports=nt.Signers.V4});var ql=P((hk,_l)=>{var Jt=V(),Vy=Jt.util.inherit;Jt.Signers.S3=Vy(Jt.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,analytics:1,cors:1,lifecycle:1,delete:1,inventory:1,location:1,logging:1,metrics:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:o(function(e,r){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=Jt.util.date.rfc822(r)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var i=this.sign(e.secretAccessKey,this.stringToSign()),n="AWS "+e.accessKeyId+":"+i;this.request.headers.Authorization=n},"addAuthorization"),stringToSign:o(function(){var e=this.request,r=[];r.push(e.method),r.push(e.headers["Content-MD5"]||""),r.push(e.headers["Content-Type"]||""),r.push(e.headers["presigned-expires"]||"");var i=this.canonicalizedAmzHeaders();return i&&r.push(i),r.push(this.canonicalizedResource()),r.join(`
11
+ `)},"stringToSign"),canonicalizedAmzHeaders:o(function(){var e=[];Jt.util.each(this.request.headers,function(i){i.match(/^x-amz-/i)&&e.push(i)}),e.sort(function(i,n){return i.toLowerCase()<n.toLowerCase()?-1:1});var r=[];return Jt.util.arrayEach.call(this,e,function(i){r.push(i.toLowerCase()+":"+String(this.request.headers[i]))}),r.join(`
12
+ `)},"canonicalizedAmzHeaders"),canonicalizedResource:o(function(){var e=this.request,r=e.path.split("?"),i=r[0],n=r[1],s="";if(e.virtualHostedBucket&&(s+="/"+e.virtualHostedBucket),s+=i,n){var a=[];Jt.util.arrayEach.call(this,n.split("&"),function(u){var l=u.split("=")[0],h=u.split("=")[1];if(this.subResources[l]||this.responseHeaders[l]){var y={name:l};h!==void 0&&(this.subResources[l]?y.value=h:y.value=decodeURIComponent(h)),a.push(y)}}),a.sort(function(u,l){return u.name<l.name?-1:1}),a.length&&(n=[],Jt.util.arrayEach(a,function(u){u.value===void 0?n.push(u.name):n.push(u.name+"="+u.value)}),s+="?"+n.join("&"))}return s},"canonicalizedResource"),sign:o(function(e,r){return Jt.util.crypto.hmac(e,r,"base64","sha1")},"sign")});_l.exports=Jt.Signers.S3});var Ll=P((mk,kl)=>{var Ke=V(),zy=Ke.util.inherit,Hi="presigned-expires";function Hy(t){var e=t.httpRequest.headers[Hi],r=t.service.getSignerClass(t);if(delete t.httpRequest.headers["User-Agent"],delete t.httpRequest.headers["X-Amz-User-Agent"],r===Ke.Signers.V4){if(e>604800){var i="Presigning does not support expiry time greater than a week with SigV4 signing.";throw Ke.util.error(new Error,{code:"InvalidExpiryTime",message:i,retryable:!1})}t.httpRequest.headers[Hi]=e}else if(r===Ke.Signers.S3){var n=t.service?t.service.getSkewCorrectedDate():Ke.util.date.getDate();t.httpRequest.headers[Hi]=parseInt(Ke.util.date.unixTimestamp(n)+e,10).toString()}else throw Ke.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1})}o(Hy,"signedUrlBuilder");function jy(t){var e=t.httpRequest.endpoint,r=Ke.util.urlParse(t.httpRequest.path),i={};r.search&&(i=Ke.util.queryStringParse(r.search.substr(1)));var n=t.httpRequest.headers.Authorization.split(" ");if(n[0]==="AWS")n=n[1].split(":"),i.Signature=n.pop(),i.AWSAccessKeyId=n.join(":"),Ke.util.each(t.httpRequest.headers,function(u,l){u===Hi&&(u="Expires"),u.indexOf("x-amz-meta-")===0&&(delete i[u],u=u.toLowerCase()),i[u]=l}),delete t.httpRequest.headers[Hi],delete i.Authorization,delete i.Host;else if(n[0]==="AWS4-HMAC-SHA256"){n.shift();var s=n.join(" "),a=s.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}e.pathname=r.pathname,e.search=Ke.util.queryParamsToString(i)}o(jy,"signedUrlSigner");Ke.Signers.Presign=zy({sign:o(function(e,r,i){if(e.httpRequest.headers[Hi]=r||3600,e.on("build",Hy),e.on("sign",jy),e.removeListener("afterBuild",Ke.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",Ke.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),i)e.build(function(){this.response.error?i(this.response.error):i(null,Ke.util.urlFormat(e.httpRequest.endpoint))});else{if(e.build(),e.response.error)throw e.response.error;return Ke.util.urlFormat(e.httpRequest.endpoint)}},"sign")});kl.exports=Ke.Signers.Presign});var Ml=P(()=>{var ns=V();ns.Signers.Bearer=ns.util.inherit(ns.Signers.RequestSigner,{constructor:o(function(e){ns.Signers.RequestSigner.call(this,e)},"Bearer"),addAuthorization:o(function(e){this.request.httpRequest.headers.Authorization="Bearer "+e.token},"addAuthorization")})});var Fl=P(()=>{var Yt=V(),Ky=Yt.util.inherit;Yt.Signers.RequestSigner=Ky({constructor:o(function(e){this.request=e},"RequestSigner"),setServiceClientId:o(function(e){this.serviceClientId=e},"setServiceClientId"),getServiceClientId:o(function(){return this.serviceClientId},"getServiceClientId")});Yt.Signers.RequestSigner.getVersion=o(function(e){switch(e){case"v2":return Yt.Signers.V2;case"v3":return Yt.Signers.V3;case"s3v4":return Yt.Signers.V4;case"v4":return Yt.Signers.V4;case"s3":return Yt.Signers.S3;case"v3https":return Yt.Signers.V3Https;case"bearer":return Yt.Signers.Bearer}throw new Error("Unknown signing version "+e)},"getVersion");Cl();ba();bl();Pl();ql();Ll();Ml()});var Wl=P(()=>{var Mt=V();Mt.ParamValidator=Mt.util.inherit({constructor:o(function(e){(e===!0||e===void 0)&&(e={min:!0}),this.validation=e},"ParamValidator"),validate:o(function(e,r,i){if(this.errors=[],this.validateMember(e,r||{},i||"params"),this.errors.length>1){var n=this.errors.join(`
14
13
  * `);throw n="There were "+this.errors.length+` validation errors:
15
- * `+n,Mt.util.error(new Error(n),{code:"MultipleValidationErrors",errors:this.errors})}else{if(this.errors.length===1)throw this.errors[0];return!0}},"validate"),fail:s(function(e,r){this.errors.push(Mt.util.error(new Error(r),{code:e}))},"fail"),validateStructure:s(function(e,r,i){if(e.isDocument)return!0;this.validateType(r,i,["object"],"structure");for(var n,o=0;e.required&&o<e.required.length;o++){n=e.required[o];var a=r[n];a==null&&this.fail("MissingRequiredParameter","Missing required key '"+n+"' in "+i)}for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var u=r[n],l=e.members[n];if(l!==void 0){var f=[i,n].join(".");this.validateMember(l,u,f)}else u!=null&&this.fail("UnexpectedParameter","Unexpected key '"+n+"' found in "+i)}return!0},"validateStructure"),validateMember:s(function(e,r,i){switch(e.type){case"structure":return this.validateStructure(e,r,i);case"list":return this.validateList(e,r,i);case"map":return this.validateMap(e,r,i);default:return this.validateScalar(e,r,i)}},"validateMember"),validateList:s(function(e,r,i){if(this.validateType(r,i,[Array])){this.validateRange(e,r.length,i,"list member count");for(var n=0;n<r.length;n++)this.validateMember(e.member,r[n],i+"["+n+"]")}},"validateList"),validateMap:s(function(e,r,i){if(this.validateType(r,i,["object"],"map")){var n=0;for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this.validateMember(e.key,o,i+"[key='"+o+"']"),this.validateMember(e.value,r[o],i+"['"+o+"']"),n++);this.validateRange(e,n,i,"map member count")}},"validateMap"),validateScalar:s(function(e,r,i){switch(e.type){case null:case void 0:case"string":return this.validateString(e,r,i);case"base64":case"binary":return this.validatePayload(r,i);case"integer":case"float":return this.validateNumber(e,r,i);case"boolean":return this.validateType(r,i,["boolean"]);case"timestamp":return this.validateType(r,i,[Date,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,"number"],"Date object, ISO-8601 string, or a UNIX timestamp");default:return this.fail("UnkownType","Unhandled type "+e.type+" for "+i)}},"validateScalar"),validateString:s(function(e,r,i){var n=["string"];e.isJsonValue&&(n=n.concat(["number","object","boolean"])),r!==null&&this.validateType(r,i,n)&&(this.validateEnum(e,r,i),this.validateRange(e,r.length,i,"string length"),this.validatePattern(e,r,i),this.validateUri(e,r,i))},"validateString"),validateUri:s(function(e,r,i){e.location==="uri"&&r.length===0&&this.fail("UriParameterError",'Expected uri parameter to have length >= 1, but found "'+r+'" for '+i)},"validateUri"),validatePattern:s(function(e,r,i){this.validation.pattern&&e.pattern!==void 0&&(new RegExp(e.pattern).test(r)||this.fail("PatternMatchError",'Provided value "'+r+'" does not match regex pattern /'+e.pattern+"/ for "+i))},"validatePattern"),validateRange:s(function(e,r,i,n){this.validation.min&&e.min!==void 0&&r<e.min&&this.fail("MinRangeError","Expected "+n+" >= "+e.min+", but found "+r+" for "+i),this.validation.max&&e.max!==void 0&&r>e.max&&this.fail("MaxRangeError","Expected "+n+" <= "+e.max+", but found "+r+" for "+i)},"validateRange"),validateEnum:s(function(e,r,i){this.validation.enum&&e.enum!==void 0&&e.enum.indexOf(r)===-1&&this.fail("EnumError","Found string value of "+r+", but expected "+e.enum.join("|")+" for "+i)},"validateRange"),validateType:s(function(e,r,i,n){if(e==null)return!1;for(var o=!1,a=0;a<i.length;a++){if(typeof i[a]=="string"){if(typeof e===i[a])return!0}else if(i[a]instanceof RegExp){if((e||"").toString().match(i[a]))return!0}else{if(e instanceof i[a]||Mt.util.isType(e,i[a]))return!0;!n&&!o&&(i=i.slice()),i[a]=Mt.util.typeName(i[a])}o=!0}var u=n;u||(u=i.join(", ").replace(/,([^,]+)$/,", or$1"));var l=u.match(/^[aeiou]/i)?"n":"";return this.fail("InvalidParameterType","Expected "+r+" to be a"+l+" "+u),!1},"validateType"),validateNumber:s(function(e,r,i){if(r!=null){if(typeof r=="string"){var n=parseFloat(r);n.toString()===r&&(r=n)}this.validateType(r,i,["number"])&&this.validateRange(e,r,i,"numeric value")}},"validateNumber"),validatePayload:s(function(e,r){if(e!=null&&typeof e!="string"&&!(e&&typeof e.byteLength=="number")){if(Mt.util.isNode()){var i=Mt.util.stream.Stream;if(Mt.util.Buffer.isBuffer(e)||e instanceof i)return}else if(typeof Blob!==void 0&&e instanceof Blob)return;var n=["Buffer","Stream","File","Blob","ArrayBuffer","DataView"];if(e){for(var o=0;o<n.length;o++)if(Mt.util.isType(e,n[o])||Mt.util.typeName(e.constructor)===n[o])return}this.fail("InvalidParameterType","Expected "+r+" to be a string, Buffer, Stream, Blob, or typed array object")}},"validatePayload")})});var V=P((yq,_l)=>{var vr={util:Se()},My={};My.toString();_l.exports=vr;vr.util.update(vr,{VERSION:"2.1252.0",Signers:{},Protocol:{Json:Ms(),Query:ta(),Rest:_n(),RestJson:na(),RestXml:oa()},XML:{Builder:Pc(),Parser:null},JSON:{Builder:qs(),Parser:Ls()},Model:{Api:da(),Operation:aa(),Shape:Dn(),Paginator:ua(),ResourceWaiter:ca()},apiLoader:Vc(),EndpointCache:zc().EndpointCache});pa();Qc();Yc();Xs();ol();ll();hl();pl();Dl();Pl();vr.events=new vr.SequentialExecutor;vr.util.memoizedProperty(vr,"endpointCache",function(){return new vr.EndpointCache(vr.config.endpointCacheSize)},!0)});var Sa=P(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.default=Vy;var Wy=By(te("crypto"));function By(t){return t&&t.__esModule?t:{default:t}}s(By,"_interopRequireDefault");function Vy(){return Wy.default.randomBytes(16)}s(Vy,"rng")});var no=P(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.default=void 0;var ql=[];for(zn=0;zn<256;++zn)ql[zn]=(zn+256).toString(16).substr(1);var zn;function Uy(t,e){var r=e||0,i=ql;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}s(Uy,"bytesToUuid");var zy=Uy;io.default=zy});var Fl=P(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.default=void 0;var Hy=Ll(Sa()),jy=Ll(no());function Ll(t){return t&&t.__esModule?t:{default:t}}s(Ll,"_interopRequireDefault");var kl,Ta,ba=0,Aa=0;function Ky(t,e,r){var i=e&&r||0,n=e||[];t=t||{};var o=t.node||kl,a=t.clockseq!==void 0?t.clockseq:Ta;if(o==null||a==null){var u=t.random||(t.rng||Hy.default)();o==null&&(o=kl=[u[0]|1,u[1],u[2],u[3],u[4],u[5]]),a==null&&(a=Ta=(u[6]<<8|u[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),f=t.nsecs!==void 0?t.nsecs:Aa+1,y=l-ba+(f-Aa)/1e4;if(y<0&&t.clockseq===void 0&&(a=a+1&16383),(y<0||l>ba)&&t.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ba=l,Aa=f,Ta=a,l+=122192928e5;var v=((l&268435455)*1e4+f)%4294967296;n[i++]=v>>>24&255,n[i++]=v>>>16&255,n[i++]=v>>>8&255,n[i++]=v&255;var S=l/4294967296*1e4&268435455;n[i++]=S>>>8&255,n[i++]=S&255,n[i++]=S>>>24&15|16,n[i++]=S>>>16&255,n[i++]=a>>>8|128,n[i++]=a&255;for(var I=0;I<6;++I)n[i+I]=o[I];return e||(0,jy.default)(n)}s(Ky,"v1");var Xy=Ky;so.default=Xy});var Ia=P(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.default=$y;oi.URL=oi.DNS=void 0;var Gy=Jy(no());function Jy(t){return t&&t.__esModule?t:{default:t}}s(Jy,"_interopRequireDefault");function Qy(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(r){e.push(parseInt(r,16))}),e}s(Qy,"uuidToBytes");function Yy(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}s(Yy,"stringToBytes");var Ml="6ba7b810-9dad-11d1-80b4-00c04fd430c8";oi.DNS=Ml;var Wl="6ba7b811-9dad-11d1-80b4-00c04fd430c8";oi.URL=Wl;function $y(t,e,r){var i=s(function(n,o,a,u){var l=a&&u||0;if(typeof n=="string"&&(n=Yy(n)),typeof o=="string"&&(o=Qy(o)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||o.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var f=r(o.concat(n));if(f[6]=f[6]&15|e,f[8]=f[8]&63|128,a)for(var y=0;y<16;++y)a[l+y]=f[y];return a||(0,Gy.default)(f)},"generateUUID");try{i.name=t}catch{}return i.DNS=Ml,i.URL=Wl,i}s($y,"_default")});var Bl=P(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.default=void 0;var Zy=ev(te("crypto"));function ev(t){return t&&t.__esModule?t:{default:t}}s(ev,"_interopRequireDefault");function tv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),Zy.default.createHash("md5").update(t).digest()}s(tv,"md5");var rv=tv;oo.default=rv});var Ul=P(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.default=void 0;var iv=Vl(Ia()),nv=Vl(Bl());function Vl(t){return t&&t.__esModule?t:{default:t}}s(Vl,"_interopRequireDefault");var sv=(0,iv.default)("v3",48,nv.default),ov=sv;ao.default=ov});var Hl=P(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.default=void 0;var av=zl(Sa()),uv=zl(no());function zl(t){return t&&t.__esModule?t:{default:t}}s(zl,"_interopRequireDefault");function cv(t,e,r){var i=e&&r||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var n=t.random||(t.rng||av.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var o=0;o<16;++o)e[i+o]=n[o];return e||(0,uv.default)(n)}s(cv,"v4");var lv=cv;uo.default=lv});var jl=P(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.default=void 0;var dv=hv(te("crypto"));function hv(t){return t&&t.__esModule?t:{default:t}}s(hv,"_interopRequireDefault");function fv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),dv.default.createHash("sha1").update(t).digest()}s(fv,"sha1");var pv=fv;co.default=pv});var Xl=P(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.default=void 0;var mv=Kl(Ia()),yv=Kl(jl());function Kl(t){return t&&t.__esModule?t:{default:t}}s(Kl,"_interopRequireDefault");var vv=(0,mv.default)("v5",80,yv.default),gv=vv;lo.default=gv});var Gl=P(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Object.defineProperty(Mi,"v1",{enumerable:!0,get:function(){return Nv.default}});Object.defineProperty(Mi,"v3",{enumerable:!0,get:function(){return wv.default}});Object.defineProperty(Mi,"v4",{enumerable:!0,get:function(){return xv.default}});Object.defineProperty(Mi,"v5",{enumerable:!0,get:function(){return Ev.default}});var Nv=ho(Fl()),wv=ho(Ul()),xv=ho(Hl()),Ev=ho(Xl());function ho(t){return t&&t.__esModule?t:{default:t}}s(ho,"_interopRequireDefault")});var Se=P((Fq,Jl)=>{var St,F={environment:"nodejs",engine:s(function(){if(F.isBrowser()&&typeof navigator<"u")return navigator.userAgent;var e=process.platform+"/"+process.version;return process.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+process.env.AWS_EXECUTION_ENV),e},"engine"),userAgent:s(function(){var e=F.environment,r="aws-sdk-"+e+"/"+V().VERSION;return e==="nodejs"&&(r+=" "+F.engine()),r},"userAgent"),uriEscape:s(function(e){var r=encodeURIComponent(e);return r=r.replace(/[^A-Za-z0-9_.~\-%]+/g,escape),r=r.replace(/[*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()}),r},"uriEscape"),uriEscapePath:s(function(e){var r=[];return F.arrayEach(e.split("/"),function(i){r.push(F.uriEscape(i))}),r.join("/")},"uriEscapePath"),urlParse:s(function(e){return F.url.parse(e)},"urlParse"),urlFormat:s(function(e){return F.url.format(e)},"urlFormat"),queryStringParse:s(function(e){return F.querystring.parse(e)},"queryStringParse"),queryParamsToString:s(function(e){var r=[],i=F.uriEscape,n=Object.keys(e).sort();return F.arrayEach(n,function(o){var a=e[o],u=i(o),l=u+"=";if(Array.isArray(a)){var f=[];F.arrayEach(a,function(y){f.push(i(y))}),l=u+"="+f.sort().join("&"+u+"=")}else a!=null&&(l=u+"="+i(a));r.push(l)}),r.join("&")},"queryParamsToString"),readFileSync:s(function(e){return F.isBrowser()?null:te("fs").readFileSync(e,"utf-8")},"readFileSync"),base64:{encode:s(function(e){if(typeof e=="number")throw F.error(new Error("Cannot base64 encode number "+e));if(e===null||typeof e>"u")return e;var r=F.buffer.toBuffer(e);return r.toString("base64")},"encode64"),decode:s(function(e){if(typeof e=="number")throw F.error(new Error("Cannot base64 decode number "+e));return e===null||typeof e>"u"?e:F.buffer.toBuffer(e,"base64")},"decode64")},buffer:{toBuffer:function(t,e){return typeof F.Buffer.from=="function"&&F.Buffer.from!==Uint8Array.from?F.Buffer.from(t,e):new F.Buffer(t,e)},alloc:function(t,e,r){if(typeof t!="number")throw new Error("size passed to alloc must be a number.");if(typeof F.Buffer.alloc=="function")return F.Buffer.alloc(t,e,r);var i=new F.Buffer(t);return e!==void 0&&typeof i.fill=="function"&&i.fill(e,void 0,void 0,r),i},toStream:s(function(e){F.Buffer.isBuffer(e)||(e=F.buffer.toBuffer(e));var r=new F.stream.Readable,i=0;return r._read=function(n){if(i>=e.length)return r.push(null);var o=i+n;o>e.length&&(o=e.length),r.push(e.slice(i,o)),i=o},r},"toStream"),concat:function(t){var e=0,r=0,i=null,n;for(n=0;n<t.length;n++)e+=t[n].length;for(i=F.buffer.alloc(e),n=0;n<t.length;n++)t[n].copy(i,r),r+=t[n].length;return i}},string:{byteLength:s(function(e){if(e==null)return 0;if(typeof e=="string"&&(e=F.buffer.toBuffer(e)),typeof e.byteLength=="number")return e.byteLength;if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.path=="string")return te("fs").lstatSync(e.path).size;throw F.error(new Error("Cannot determine length of "+e),{object:e})},"byteLength"),upperFirst:s(function(e){return e[0].toUpperCase()+e.substr(1)},"upperFirst"),lowerFirst:s(function(e){return e[0].toLowerCase()+e.substr(1)},"lowerFirst")},ini:{parse:s(function(e){var r,i={};return F.arrayEach(e.split(/\r?\n/),function(n){n=n.split(/(^|\s)[;#]/)[0].trim();var o=n[0]==="["&&n[n.length-1]==="]";if(o){if(r=n.substring(1,n.length-1),r==="__proto__"||r.split(/\s/)[1]==="__proto__")throw F.error(new Error("Cannot load profile name '"+r+"' from shared ini file."))}else if(r){var a=n.indexOf("="),u=0,l=n.length-1,f=a!==-1&&a!==u&&a!==l;if(f){var y=n.substring(0,a).trim(),v=n.substring(a+1).trim();i[r]=i[r]||{},i[r][y]=v}}}),i},"string")},fn:{noop:function(){},callback:function(t){if(t)throw t},makeAsync:s(function(e,r){return r&&r<=e.length?e:function(){var i=Array.prototype.slice.call(arguments,0),n=i.pop(),o=e.apply(null,i);n(o)}},"makeAsync")},date:{getDate:s(function(){return St||(St=V()),St.config.systemClockOffset?new Date(new Date().getTime()+St.config.systemClockOffset):new Date},"getDate"),iso8601:s(function(e){return e===void 0&&(e=F.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},"iso8601"),rfc822:s(function(e){return e===void 0&&(e=F.date.getDate()),e.toUTCString()},"rfc822"),unixTimestamp:s(function(e){return e===void 0&&(e=F.date.getDate()),e.getTime()/1e3},"unixTimestamp"),from:s(function(e){return typeof e=="number"?new Date(e*1e3):new Date(e)},"format"),format:s(function(e,r){return r||(r="iso8601"),F.date[r](F.date.from(e))},"format"),parseTimestamp:s(function(e){if(typeof e=="number")return new Date(e*1e3);if(e.match(/^\d+$/))return new Date(e*1e3);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw F.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})},"parseTimestamp")},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:s(function(e){var r=F.crypto.crc32Table,i=-1;typeof e=="string"&&(e=F.buffer.toBuffer(e));for(var n=0;n<e.length;n++){var o=e.readUInt8(n);i=i>>>8^r[(i^o)&255]}return(i^-1)>>>0},"crc32"),hmac:s(function(e,r,i,n){return i||(i="binary"),i==="buffer"&&(i=void 0),n||(n="sha256"),typeof r=="string"&&(r=F.buffer.toBuffer(r)),F.crypto.lib.createHmac(n,e).update(r).digest(i)},"hmac"),md5:s(function(e,r,i){return F.crypto.hash("md5",e,r,i)},"md5"),sha256:s(function(e,r,i){return F.crypto.hash("sha256",e,r,i)},"sha256"),hash:function(t,e,r,i){var n=F.crypto.createHash(t);r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=F.buffer.toBuffer(e));var o=F.arraySliceFn(e),a=F.Buffer.isBuffer(e);if(F.isBrowser()&&typeof ArrayBuffer<"u"&&e&&e.buffer instanceof ArrayBuffer&&(a=!0),i&&typeof e=="object"&&typeof e.on=="function"&&!a)e.on("data",function(v){n.update(v)}),e.on("error",function(v){i(v)}),e.on("end",function(){i(null,n.digest(r))});else if(i&&o&&!a&&typeof FileReader<"u"){var u=0,l=1024*512,f=new FileReader;f.onerror=function(){i(new Error("Failed to read data."))},f.onload=function(){var v=new F.Buffer(new Uint8Array(f.result));n.update(v),u+=v.length,f._continueReading()},f._continueReading=function(){if(u>=e.size){i(null,n.digest(r));return}var v=u+l;v>e.size&&(v=e.size),f.readAsArrayBuffer(o.call(e,u,v))},f._continueReading()}else{F.isBrowser()&&typeof e=="object"&&!a&&(e=new F.Buffer(new Uint8Array(e)));var y=n.update(e).digest(r);return i&&i(null,y),y}},toHex:s(function(e){for(var r=[],i=0;i<e.length;i++)r.push(("0"+e.charCodeAt(i).toString(16)).substr(-2,2));return r.join("")},"toHex"),createHash:s(function(e){return F.crypto.lib.createHash(e)},"createHash")},abort:{},each:s(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,i,e[i]);if(n===F.abort)break}},"each"),arrayEach:s(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,e[i],parseInt(i,10));if(n===F.abort)break}},"arrayEach"),update:s(function(e,r){return F.each(r,s(function(n,o){e[n]=o},"iterator")),e},"update"),merge:s(function(e,r){return F.update(F.copy(e),r)},"merge"),copy:s(function(e){if(e==null)return e;var r={};for(var i in e)r[i]=e[i];return r},"copy"),isEmpty:s(function(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!1;return!0},"isEmpty"),arraySliceFn:s(function(e){var r=e.slice||e.webkitSlice||e.mozSlice;return typeof r=="function"?r:null},"arraySliceFn"),isType:s(function(e,r){return typeof r=="function"&&(r=F.typeName(r)),Object.prototype.toString.call(e)==="[object "+r+"]"},"isType"),typeName:s(function(e){if(Object.prototype.hasOwnProperty.call(e,"name"))return e.name;var r=e.toString(),i=r.match(/^\s*function (.+)\(/);return i?i[1]:r},"typeName"),error:s(function(e,r){var i=null;return typeof e.message=="string"&&e.message!==""&&(typeof r=="string"||r&&r.message)&&(i=F.copy(e),i.message=e.message),e.message=e.message||null,typeof r=="string"?e.message=r:typeof r=="object"&&r!==null&&(F.update(e,r),r.message&&(e.message=r.message),(r.code||r.name)&&(e.code=r.code||r.name),r.stack&&(e.stack=r.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=String(r&&r.name||e.name||e.code||"Error"),e.time=new Date,i&&(e.originalError=i),e},"error"),inherit:s(function(e,r){var i=null;if(r===void 0)r=e,e=Object,i={};else{var n=s(function(){},"ConstructorWrapper");n.prototype=e.prototype,i=new n}return r.constructor===Object&&(r.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),r.constructor.prototype=i,F.update(r.constructor.prototype,r),r.constructor.__super__=e,r.constructor},"inherit"),mixin:s(function(){for(var e=arguments[0],r=1;r<arguments.length;r++)for(var i in arguments[r].prototype){var n=arguments[r].prototype[i];i!=="constructor"&&(e.prototype[i]=n)}return e},"mixin"),hideProperties:s(function(e,r){typeof Object.defineProperty=="function"&&F.arrayEach(r,function(i){Object.defineProperty(e,i,{enumerable:!1,writable:!0,configurable:!0})})},"hideProperties"),property:s(function(e,r,i,n,o){var a={configurable:!0,enumerable:n!==void 0?n:!0};typeof i=="function"&&!o?a.get=i:(a.value=i,a.writable=!0),Object.defineProperty(e,r,a)},"property"),memoizedProperty:s(function(e,r,i,n){var o=null;F.property(e,r,function(){return o===null&&(o=i()),o},n)},"memoizedProperty"),hoistPayloadMember:s(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i],o=n.output;if(o.payload&&!n.hasEventOutput){var a=o.members[o.payload],u=e.data[o.payload];a.type==="structure"&&F.each(u,function(l,f){F.property(e.data,l,f,!1)})}},"hoistPayloadMember"),computeSha256:s(function(e,r){if(F.isNode()){var i=F.stream.Stream,n=te("fs");if(typeof i=="function"&&e instanceof i)if(typeof e.path=="string"){var o={};typeof e.start=="number"&&(o.start=e.start),typeof e.end=="number"&&(o.end=e.end),e=n.createReadStream(e.path,o)}else return r(new Error("Non-file stream objects are not supported with SigV4"))}F.crypto.sha256(e,"hex",function(a,u){a?r(a):r(null,u)})},"computeSha256"),isClockSkewed:s(function(e){if(e)return F.property(St.config,"isClockSkewed",Math.abs(new Date().getTime()-e)>=3e5,!1),St.config.isClockSkewed},"isClockSkewed"),applyClockOffset:s(function(e){e&&(St.config.systemClockOffset=e-new Date().getTime())},"applyClockOffset"),extractRequestId:s(function(e){var r=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!r&&e.data&&e.data.ResponseMetadata&&(r=e.data.ResponseMetadata.RequestId),r&&(e.requestId=r),e.error&&(e.error.requestId=r)},"extractRequestId"),addPromises:s(function(e,r){var i=!1;r===void 0&&St&&St.config&&(r=St.config.getPromisesDependency()),r===void 0&&typeof Promise<"u"&&(r=Promise),typeof r!="function"&&(i=!0),Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var o=e[n];i?o.deletePromisesFromClass&&o.deletePromisesFromClass():o.addPromisesToClass&&o.addPromisesToClass(r)}},"addPromises"),promisifyMethod:s(function(e,r){return s(function(){var n=this,o=Array.prototype.slice.call(arguments);return new r(function(a,u){o.push(function(l,f){l?u(l):a(f)}),n[e].apply(n,o)})},"promise")},"promisifyMethod"),isDualstackAvailable:s(function(e){if(!e)return!1;var r=la();return typeof e!="string"&&(e=e.serviceIdentifier),typeof e!="string"||!r.hasOwnProperty(e)?!1:!!r[e].dualstackAvailable},"isDualstackAvailable"),calculateRetryDelay:s(function(e,r,i){r||(r={});var n=r.customBackoff||null;if(typeof n=="function")return n(e,i);var o=typeof r.base=="number"?r.base:100,a=Math.random()*(Math.pow(2,e)*o);return a},"calculateRetryDelay"),handleRequestWithRetries:s(function(e,r,i){r||(r={});var n=St.HttpClient.getInstance(),o=r.httpOptions||{},a=0,u=s(function(f){var y=r.maxRetries||0;if(f&&f.code==="TimeoutError"&&(f.retryable=!0),f&&f.retryable&&a<y){var v=F.calculateRetryDelay(a,r.retryDelayOptions,f);if(v>=0){a++,setTimeout(l,v+(f.retryAfter||0));return}}i(f)},"errCallback"),l=s(function(){var f="";n.handleRequest(e,o,function(y){y.on("data",function(v){f+=v.toString()}),y.on("end",function(){var v=y.statusCode;if(v<300)i(null,f);else{var S=parseInt(y.headers["retry-after"],10)*1e3||0,I=F.error(new Error,{statusCode:v,retryable:v>=500||v===429});S&&I.retryable&&(I.retryAfter=S),u(I)}})},u)},"sendRequest");St.util.defer(l)},"handleRequestWithRetries"),uuid:{v4:s(function(){return Gl().v4()},"uuidV4")},convertPayloadToString:s(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i].output||{};n.payload&&e.data[n.payload]&&(e.data[n.payload]=e.data[n.payload].toString())},"convertPayloadToString"),defer:s(function(e){typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0)},"defer"),getRequestPayloadShape:s(function(e){var r=e.service.api.operations;if(r){var i=(r||{})[e.operation];if(!(!i||!i.input||!i.input.payload))return i.input.members[i.input.payload]}},"getRequestPayloadShape"),getProfilesFromSharedConfig:s(function(e,r){var i={},n={};if(process.env[F.configOptInEnv])var n=e.loadFrom({isConfig:!0,filename:process.env[F.sharedConfigFileEnv]});var o={};try{var o=e.loadFrom({filename:r||process.env[F.configOptInEnv]&&process.env[F.sharedCredentialsFileEnv]})}catch(f){if(!process.env[F.configOptInEnv])throw f}for(var a=0,u=Object.keys(n);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},n[u[a]]);for(var a=0,u=Object.keys(o);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},o[u[a]]);return i;function l(f,y){for(var v=0,S=Object.keys(y);v<S.length;v++)f[S[v]]=y[S[v]];return f}},"getProfilesFromSharedConfig"),ARN:{validate:s(function(e){return e&&e.indexOf("arn:")===0&&e.split(":").length>=6},"validateARN"),parse:s(function(e){var r=e.split(":");return{partition:r[1],service:r[2],region:r[3],accountId:r[4],resource:r.slice(5).join(":")}},"parseARN"),build:s(function(e){if(e.service===void 0||e.region===void 0||e.accountId===void 0||e.resource===void 0)throw F.error(new Error("Input ARN object is invalid"));return"arn:"+(e.partition||"aws")+":"+e.service+":"+e.region+":"+e.accountId+":"+e.resource},"buildARN")},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};Jl.exports=F});var Zl=P((Wq,$l)=>{var Cv=V().util,Ql=te("stream").Transform,Yl=Cv.buffer.alloc;function Hn(t){Ql.call(this,t),this.currentMessageTotalLength=0,this.currentMessagePendingLength=0,this.currentMessage=null,this.messageLengthBuffer=null}s(Hn,"EventMessageChunkerStream");Hn.prototype=Object.create(Ql.prototype);Hn.prototype._transform=function(t,e,r){for(var i=t.length,n=0;n<i;){if(!this.currentMessage){var o=i-n;this.messageLengthBuffer||(this.messageLengthBuffer=Yl(4));var a=Math.min(4-this.currentMessagePendingLength,o);if(t.copy(this.messageLengthBuffer,this.currentMessagePendingLength,n,n+a),this.currentMessagePendingLength+=a,n+=a,this.currentMessagePendingLength<4)break;this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)),this.messageLengthBuffer=null}var u=Math.min(this.currentMessageTotalLength-this.currentMessagePendingLength,i-n);t.copy(this.currentMessage,this.currentMessagePendingLength,n,n+u),this.currentMessagePendingLength+=u,n+=u,this.currentMessageTotalLength&&this.currentMessageTotalLength===this.currentMessagePendingLength&&(this.push(this.currentMessage),this.currentMessage=null,this.currentMessageTotalLength=0,this.currentMessagePendingLength=0)}r()};Hn.prototype._flush=function(t){this.currentMessageTotalLength?this.currentMessageTotalLength===this.currentMessagePendingLength?t(null,this.currentMessage):t(new Error("Truncated event message received.")):t()};Hn.prototype.allocateMessage=function(t){if(typeof t!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+t);this.currentMessageTotalLength=t,this.currentMessagePendingLength=4,this.currentMessage=Yl(t),this.currentMessage.writeUInt32BE(t,0)};$l.exports={EventMessageChunkerStream:Hn}});var id=P((Vq,rd)=>{var ed=V().util,Sv=ed.buffer.toBuffer;function jn(t){if(t.length!==8)throw new Error("Int64 buffers must be exactly 8 bytes");ed.Buffer.isBuffer(t)||(t=Sv(t)),this.bytes=t}s(jn,"Int64");jn.fromNumber=function(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var e=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)e[r]=i;return t<0&&td(e),new jn(e)};jn.prototype.valueOf=function(){var t=this.bytes.slice(0),e=t[0]&128;return e&&td(t),parseInt(t.toString("hex"),16)*(e?-1:1)};jn.prototype.toString=function(){return String(this.valueOf())};function td(t){for(var e=0;e<8;e++)t[e]^=255;for(var e=7;e>-1&&(t[e]++,t[e]===0);e--);}s(td,"negate");rd.exports={Int64:jn}});var od=P((zq,sd)=>{var fo=V().util,Tv=fo.buffer.toBuffer,nd=4,po=nd*2,Kn=4,bv=po+Kn*2;function Av(t){if(fo.Buffer.isBuffer(t)||(t=Tv(t)),t.length<bv)throw new Error("Provided message too short to accommodate event stream message overhead");if(t.length!==t.readUInt32BE(0))throw new Error("Reported message length does not match received message length");var e=t.readUInt32BE(po);if(e!==fo.crypto.crc32(t.slice(0,po)))throw new Error("The prelude checksum specified in the message ("+e+") does not match the calculated CRC32 checksum.");var r=t.readUInt32BE(t.length-Kn);if(r!==fo.crypto.crc32(t.slice(0,t.length-Kn)))throw new Error("The message checksum did not match the expected value of "+r);var i=po+Kn,n=i+t.readUInt32BE(nd);return{headers:t.slice(i,n),body:t.slice(n,t.length-Kn)}}s(Av,"splitMessage");sd.exports={splitMessage:Av}});var ld=P((jq,cd)=>{var ad=id().Int64,Iv=od().splitMessage,ud="boolean",Rv="byte",Ov="short",Dv="integer",Pv="long",_v="binary",qv="string",kv="timestamp",Lv="uuid";function Fv(t){for(var e={},r=0;r<t.length;){var i=t.readUInt8(r++),n=t.slice(r,r+i).toString();switch(r+=i,t.readUInt8(r++)){case 0:e[n]={type:ud,value:!0};break;case 1:e[n]={type:ud,value:!1};break;case 2:e[n]={type:Rv,value:t.readInt8(r++)};break;case 3:e[n]={type:Ov,value:t.readInt16BE(r)},r+=2;break;case 4:e[n]={type:Dv,value:t.readInt32BE(r)},r+=4;break;case 5:e[n]={type:Pv,value:new ad(t.slice(r,r+8))},r+=8;break;case 6:var o=t.readUInt16BE(r);r+=2,e[n]={type:_v,value:t.slice(r,r+o)},r+=o;break;case 7:var a=t.readUInt16BE(r);r+=2,e[n]={type:qv,value:t.slice(r,r+a).toString()},r+=a;break;case 8:e[n]={type:kv,value:new Date(new ad(t.slice(r,r+8)).valueOf())},r+=8;break;case 9:var u=t.slice(r,r+16).toString("hex");r+=16,e[n]={type:Lv,value:u.substr(0,8)+"-"+u.substr(8,4)+"-"+u.substr(12,4)+"-"+u.substr(16,4)+"-"+u.substr(20)};break;default:throw new Error("Unrecognized header type tag")}}return e}s(Fv,"parseHeaders");function Mv(t){var e=Iv(t);return{headers:Fv(e.headers),body:e.body}}s(Mv,"parseMessage");cd.exports={parseMessage:Mv}});var Ra=P((Xq,dd)=>{var Wv=ld().parseMessage;function Bv(t,e,r){var i=Wv(e),n=i.headers[":message-type"];if(n){if(n.value==="error")throw Vv(i);if(n.value!=="event")return}var o=i.headers[":event-type"],a=r.members[o.value];if(a){var u={},l=a.eventPayloadMemberName;if(l){var f=a.members[l];f.type==="binary"?u[l]=i.body:u[l]=t.parse(i.body.toString(),f)}for(var y=a.eventHeaderMemberNames,v=0;v<y.length;v++){var S=y[v];i.headers[S]&&(u[S]=a.members[S].toType(i.headers[S].value))}var I={};return I[o.value]=u,I}}s(Bv,"parseEvent");function Vv(t){var e=t.headers[":error-code"],r=t.headers[":error-message"],i=new Error(r.value||r);return i.code=i.name=e.value||e,i}s(Vv,"parseError");dd.exports={parseEvent:Bv}});var pd=P((Jq,fd)=>{var hd=te("stream").Transform,Uv=Ra().parseEvent;function Oa(t){t=t||{},t.readableObjectMode=!0,hd.call(this,t),this._readableState.objectMode=!0,this.parser=t.parser,this.eventStreamModel=t.eventStreamModel}s(Oa,"EventUnmarshallerStream");Oa.prototype=Object.create(hd.prototype);Oa.prototype._transform=function(t,e,r){try{var i=Uv(this.parser,t,this.eventStreamModel);return this.push(i),r()}catch(n){r(n)}};fd.exports={EventUnmarshallerStream:Oa}});var yd=P((Yq,md)=>{var zv=Zl().EventMessageChunkerStream,Hv=pd().EventUnmarshallerStream;function jv(t,e,r){var i=new Hv({parser:e,eventStreamModel:r}),n=new zv;return t.pipe(n).pipe(i),t.on("error",function(o){n.emit("error",o)}),n.on("error",function(o){i.emit("error",o)}),i}s(jv,"createEventStream");md.exports={createEventStream:jv}});var gd=P((Zq,vd)=>{function Kv(t){for(var e=[],r=0;r<t.length;){var i=t.readInt32BE(r),n=t.slice(r,i+r);r+=i,e.push(n)}return e}s(Kv,"eventMessageChunker");vd.exports={eventMessageChunker:Kv}});var wd=P((tk,Nd)=>{var Xv=gd().eventMessageChunker,Gv=Ra().parseEvent;function Jv(t,e,r){for(var i=Xv(t),n=[],o=0;o<i.length;o++)n.push(Gv(e,i[o],r));return n}s(Jv,"createEventStream");Nd.exports={createEventStream:Jv}});var Ed=P((ik,xd)=>{xd.exports={now:s(function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6},"now")}});var Sd=P((sk,Cd)=>{var Qv=V().util,Yv=te("dgram"),$v=Qv.buffer.toBuffer,Zv=1024*8;function ai(t){t=t||{},this.enabled=t.enabled||!1,this.port=t.port||31e3,this.clientId=t.clientId||"",this.address=t.host||"127.0.0.1",this.clientId.length>255&&(this.clientId=this.clientId.substr(0,255)),this.messagesInFlight=0}s(ai,"Publisher");ai.prototype.fieldsToTrim={UserAgent:256,SdkException:128,SdkExceptionMessage:512,AwsException:128,AwsExceptionMessage:512,FinalSdkException:128,FinalSdkExceptionMessage:512,FinalAwsException:128,FinalAwsExceptionMessage:512};ai.prototype.trimFields=function(t){for(var e=Object.keys(this.fieldsToTrim),r=0,i=e.length;r<i;r++){var n=e[r];if(t.hasOwnProperty(n)){var o=this.fieldsToTrim[n],a=t[n];a&&a.length>o&&(t[n]=a.substr(0,o))}}return t};ai.prototype.eventHandler=function(t){t.ClientId=this.clientId,this.trimFields(t);var e=$v(JSON.stringify(t));!this.enabled||e.length>Zv||this.publishDatagram(e)};ai.prototype.publishDatagram=function(t){var e=this,r=this.getClient();this.messagesInFlight++,this.client.send(t,0,t.length,this.port,this.address,function(i,n){--e.messagesInFlight<=0&&e.destroyClient()})};ai.prototype.getClient=function(){return this.client||(this.client=Yv.createSocket("udp4")),this.client};ai.prototype.destroyClient=function(){this.client&&(this.client.close(),this.client=void 0)};Cd.exports={Publisher:ai}});var Ad=P((ak,bd)=>{var Da=V();function eg(){var t={port:void 0,clientId:void 0,enabled:void 0,host:void 0};return tg(t)||rg(t),Td(t)}s(eg,"resolveMonitoringConfig");function tg(t){return t.port=t.port||process.env.AWS_CSM_PORT,t.enabled=t.enabled||process.env.AWS_CSM_ENABLED,t.clientId=t.clientId||process.env.AWS_CSM_CLIENT_ID,t.host=t.host||process.env.AWS_CSM_HOST,t.port&&t.enabled&&t.clientId&&t.host||["false","0"].indexOf(t.enabled)>=0}s(tg,"fromEnvironment");function rg(t){var e;try{var r=Da.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[Da.util.sharedConfigFileEnv]}),e=r[process.env.AWS_PROFILE||Da.util.defaultProfile]}catch{return!1}return e?(t.port=t.port||e.csm_port,t.enabled=t.enabled||e.csm_enabled,t.clientId=t.clientId||e.csm_client_id,t.host=t.host||e.csm_host,t.port&&t.enabled&&t.clientId&&t.host):t}s(rg,"fromConfigFile");function Td(t){var e=["false","0",void 0];return!t.enabled||e.indexOf(t.enabled.toLowerCase())>=0?t.enabled=!1:t.enabled=!0,t.port=t.port?parseInt(t.port,10):void 0,t}s(Td,"toJSType");bd.exports=eg});var Pa=P((ck,Od)=>{var Wi=V(),Id=te("os"),ig=te("path");function Rd(t){return Wi.util.ini.parse(Wi.util.readFileSync(t))}s(Rd,"parseFile");function ng(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)||Object.defineProperty(e,r.replace(/^profile\s/,""),{value:t[r],enumerable:!0})}),e}s(ng,"getProfiles");function sg(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)&&Object.defineProperty(e,r.replace(/^sso-session\s/,""),{value:t[r],enumerable:!0})}),e}s(sg,"getSsoSessions");Wi.IniLoader=Wi.util.inherit({constructor:s(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"IniLoader"),clearCachedFiles:s(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"clearCachedFiles"),loadFrom:s(function(e){e=e||{};var r=e.isConfig===!0,i=e.filename||this.getDefaultFilePath(r);if(!this.resolvedProfiles[i]){var n=Rd(i);r?Object.defineProperty(this.resolvedProfiles,i,{value:ng(n)}):Object.defineProperty(this.resolvedProfiles,i,{value:n})}return this.resolvedProfiles[i]},"loadFrom"),loadSsoSessionsFrom:s(function(e){e=e||{};var r=e.filename||this.getDefaultFilePath(!0);if(!this.resolvedSsoSessions[r]){var i=Rd(r);Object.defineProperty(this.resolvedSsoSessions,r,{value:sg(i)})}return this.resolvedSsoSessions[r]},"loadSsoSessionsFrom"),getDefaultFilePath:s(function(e){return ig.join(this.getHomeDir(),".aws",e?"config":"credentials")},"getDefaultFilePath"),getHomeDir:s(function(){var e=process.env,r=e.HOME||e.USERPROFILE||(e.HOMEPATH?(e.HOMEDRIVE||"C:/")+e.HOMEPATH:null);if(r)return r;if(typeof Id.homedir=="function")return Id.homedir();throw Wi.util.error(new Error("Cannot load credentials, HOME path not set"))},"getHomeDir")});var og=Wi.IniLoader;Od.exports={IniLoader:og}});var Pd=P((dk,Dd)=>{var ag=Pa().IniLoader;Dd.exports.iniLoader=new ag});var qd=P((hk,_d)=>{var Xn=V();function _a(t,e){if(typeof t=="string"){if(["legacy","regional"].indexOf(t.toLowerCase())>=0)return t.toLowerCase();throw Xn.util.error(new Error,e)}}s(_a,"validateRegionalEndpointsFlagValue");function ug(t,e){t=t||{};var r;if(t[e.clientConfig]&&(r=_a(t[e.clientConfig],{code:"InvalidConfiguration",message:'invalid "'+e.clientConfig+'" configuration. Expect "legacy" or "regional". Got "'+t[e.clientConfig]+'".'}),r)||!Xn.util.isNode())return r;if(Object.prototype.hasOwnProperty.call(process.env,e.env)){var i=process.env[e.env];if(r=_a(i,{code:"InvalidEnvironmentalVariable",message:"invalid "+e.env+' environmental variable. Expect "legacy" or "regional". Got "'+process.env[e.env]+'".'}),r)return r}var n={};try{var o=Xn.util.getProfilesFromSharedConfig(Xn.util.iniLoader);n=o[process.env.AWS_PROFILE||Xn.util.defaultProfile]}catch{}if(n&&Object.prototype.hasOwnProperty.call(n,e.sharedConfig)){var a=n[e.sharedConfig];if(r=_a(a,{code:"InvalidConfiguration",message:"invalid "+e.sharedConfig+' profile config. Expect "legacy" or "regional". Got "'+n[e.sharedConfig]+'".'}),r)return r}return r}s(ug,"resolveRegionalEndpointsFlag");_d.exports=ug});var kd=P(()=>{var mo=V(),cg=qd(),lg="AWS_STS_REGIONAL_ENDPOINTS",dg="sts_regional_endpoints";mo.util.update(mo.STS.prototype,{credentialsFrom:s(function(e,r){return e?(r||(r=new mo.TemporaryCredentials),r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretAccessKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration,r):null},"credentialsFrom"),assumeRoleWithWebIdentity:s(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,r)},"assumeRoleWithWebIdentity"),assumeRoleWithSAML:s(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,r)},"assumeRoleWithSAML"),setupRequestListeners:s(function(e){e.addListener("validate",this.optInRegionalEndpoint,!0)},"setupRequestListeners"),optInRegionalEndpoint:s(function(e){var r=e.service,i=r.config;if(i.stsRegionalEndpoints=cg(r._originalConfig,{env:lg,sharedConfig:dg,clientConfig:"stsRegionalEndpoints"}),i.stsRegionalEndpoints==="regional"&&r.isGlobalEndpoint){if(!i.region)throw mo.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var n=i.endpoint.indexOf(".amazonaws.com"),o=i.endpoint.substring(0,n)+"."+i.region+i.endpoint.substring(n);e.httpRequest.updateEndpoint(o),e.httpRequest.region=i.region}},"optInRegionalEndpoint")})});var Ld=P((vk,hg)=>{hg.exports={version:"2.0",metadata:{apiVersion:"2011-06-15",endpointPrefix:"sts",globalEndpoint:"sts.amazonaws.com",protocol:"query",serviceAbbreviation:"AWS STS",serviceFullName:"AWS Security Token Service",serviceId:"STS",signatureVersion:"v4",uid:"sts-2011-06-15",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/"},operations:{AssumeRole:{input:{type:"structure",required:["RoleArn","RoleSessionName"],members:{RoleArn:{},RoleSessionName:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"},Tags:{shape:"S8"},TransitiveTagKeys:{type:"list",member:{}},ExternalId:{},SerialNumber:{},TokenCode:{},SourceIdentity:{}}},output:{resultWrapper:"AssumeRoleResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},SourceIdentity:{}}}},AssumeRoleWithSAML:{input:{type:"structure",required:["RoleArn","PrincipalArn","SAMLAssertion"],members:{RoleArn:{},PrincipalArn:{},SAMLAssertion:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithSAMLResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Subject:{},SubjectType:{},Issuer:{},Audience:{},NameQualifier:{},SourceIdentity:{}}}},AssumeRoleWithWebIdentity:{input:{type:"structure",required:["RoleArn","RoleSessionName","WebIdentityToken"],members:{RoleArn:{},RoleSessionName:{},WebIdentityToken:{},ProviderId:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithWebIdentityResult",type:"structure",members:{Credentials:{shape:"Si"},SubjectFromWebIdentityToken:{},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Provider:{},Audience:{},SourceIdentity:{}}}},DecodeAuthorizationMessage:{input:{type:"structure",required:["EncodedMessage"],members:{EncodedMessage:{}}},output:{resultWrapper:"DecodeAuthorizationMessageResult",type:"structure",members:{DecodedMessage:{}}}},GetAccessKeyInfo:{input:{type:"structure",required:["AccessKeyId"],members:{AccessKeyId:{}}},output:{resultWrapper:"GetAccessKeyInfoResult",type:"structure",members:{Account:{}}}},GetCallerIdentity:{input:{type:"structure",members:{}},output:{resultWrapper:"GetCallerIdentityResult",type:"structure",members:{UserId:{},Account:{},Arn:{}}}},GetFederationToken:{input:{type:"structure",required:["Name"],members:{Name:{},Policy:{},PolicyArns:{shape:"S4"},DurationSeconds:{type:"integer"},Tags:{shape:"S8"}}},output:{resultWrapper:"GetFederationTokenResult",type:"structure",members:{Credentials:{shape:"Si"},FederatedUser:{type:"structure",required:["FederatedUserId","Arn"],members:{FederatedUserId:{},Arn:{}}},PackedPolicySize:{type:"integer"}}}},GetSessionToken:{input:{type:"structure",members:{DurationSeconds:{type:"integer"},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"GetSessionTokenResult",type:"structure",members:{Credentials:{shape:"Si"}}}}},shapes:{S4:{type:"list",member:{type:"structure",members:{arn:{}}}},S8:{type:"list",member:{type:"structure",required:["Key","Value"],members:{Key:{},Value:{}}}},Si:{type:"structure",required:["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],members:{AccessKeyId:{},SecretAccessKey:{},SessionToken:{},Expiration:{type:"timestamp"}}},Sn:{type:"structure",required:["AssumedRoleId","Arn"],members:{AssumedRoleId:{},Arn:{}}}}}});var Fd=P((gk,fg)=>{fg.exports={pagination:{}}});var Fr=P((Nk,Wd)=>{vo();var yo=V(),pg=yo.Service,Md=yo.apiLoader;Md.services.sts={};yo.STS=pg.defineService("sts",["2011-06-15"]);kd();Object.defineProperty(Md.services.sts,"2011-06-15",{get:s(function(){var e=Ld();return e.paginators=Fd().pagination,e},"get"),enumerable:!0,configurable:!0});Wd.exports=yo.STS});var Bd=P(()=>{var ui=V(),mg=Fr();ui.TemporaryCredentials=ui.util.inherit(ui.Credentials,{constructor:s(function(e,r){ui.Credentials.call(this),this.loadMasterCredentials(r),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},"TemporaryCredentials"),refresh:s(function(e){this.coalesceRefresh(e||ui.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.masterCredentials.get(function(){r.service.config.credentials=r.masterCredentials;var i=r.params.RoleArn?r.service.assumeRole:r.service.getSessionToken;i.call(r.service,function(n,o){n||r.service.credentialsFrom(o,r),e(n)})})},"load"),loadMasterCredentials:s(function(e){for(this.masterCredentials=e||ui.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;typeof this.masterCredentials.get!="function"&&(this.masterCredentials=new ui.Credentials(this.masterCredentials))},"loadMasterCredentials"),createClients:function(){this.service=this.service||new mg({params:this.params})}})});var Vd=P(()=>{var $t=V(),yg=Fr();$t.ChainableTemporaryCredentials=$t.util.inherit($t.Credentials,{constructor:s(function(e){$t.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var r=$t.util.copy(e.params)||{};if(r.RoleArn&&(r.RoleSessionName=r.RoleSessionName||"temporary-credentials"),r.SerialNumber){if(!e.tokenCodeFn||typeof e.tokenCodeFn!="function")throw new $t.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var i=$t.util.merge({params:r,credentials:e.masterCredentials||$t.config.credentials},e.stsConfig||{});this.service=new yg(i)},"ChainableTemporaryCredentials"),refresh:s(function(e){this.coalesceRefresh(e||$t.util.fn.callback)},"refresh"),load:s(function(e){var r=this,i=r.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode(function(n,o){var a={};if(n){e(n);return}o&&(a.TokenCode=o),r.service[i](a,function(u,l){u||r.service.credentialsFrom(l,r),e(u)})})},"load"),getTokenCode:s(function(e){var r=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,function(i,n){if(i){var o=i;i instanceof Error&&(o=i.message),e($t.util.error(new Error("Error fetching MFA token: "+o),{code:r.errorCode}));return}e(null,n)}):e(null)},"getTokenCode")})});var Ud=P(()=>{var ci=V(),vg=Fr();ci.WebIdentityCredentials=ci.util.inherit(ci.Credentials,{constructor:s(function(e,r){ci.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=ci.util.copy(r||{})},"WebIdentityCredentials"),refresh:s(function(e){this.coalesceRefresh(e||ci.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.service.assumeRoleWithWebIdentity(function(i,n){r.data=null,i||(r.data=n,r.service.credentialsFrom(n,r)),e(i)})},"load"),createClients:function(){if(!this.service){var t=ci.util.merge({},this._clientConfig);t.params=this.params,this.service=new vg(t)}}})});var zd=P((Ok,gg)=>{gg.exports={version:"2.0",metadata:{apiVersion:"2014-06-30",endpointPrefix:"cognito-identity",jsonVersion:"1.1",protocol:"json",serviceFullName:"Amazon Cognito Identity",serviceId:"Cognito Identity",signatureVersion:"v4",targetPrefix:"AWSCognitoIdentityService",uid:"cognito-identity-2014-06-30"},operations:{CreateIdentityPool:{input:{type:"structure",required:["IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},output:{shape:"Sk"}},DeleteIdentities:{input:{type:"structure",required:["IdentityIdsToDelete"],members:{IdentityIdsToDelete:{type:"list",member:{}}}},output:{type:"structure",members:{UnprocessedIdentityIds:{type:"list",member:{type:"structure",members:{IdentityId:{},ErrorCode:{}}}}}}},DeleteIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}}},DescribeIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{}}},output:{shape:"Sv"}},DescribeIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{shape:"Sk"}},GetCredentialsForIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"},CustomRoleArn:{}}},output:{type:"structure",members:{IdentityId:{},Credentials:{type:"structure",members:{AccessKeyId:{},SecretKey:{},SessionToken:{},Expiration:{type:"timestamp"}}}}},authtype:"none"},GetId:{input:{type:"structure",required:["IdentityPoolId"],members:{AccountId:{},IdentityPoolId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{}}},authtype:"none"},GetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{type:"structure",members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},GetOpenIdToken:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}},authtype:"none"},GetOpenIdTokenForDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId","Logins"],members:{IdentityPoolId:{},IdentityId:{},Logins:{shape:"S10"},PrincipalTags:{shape:"S1s"},TokenDuration:{type:"long"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},GetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},ListIdentities:{input:{type:"structure",required:["IdentityPoolId","MaxResults"],members:{IdentityPoolId:{},MaxResults:{type:"integer"},NextToken:{},HideDisabled:{type:"boolean"}}},output:{type:"structure",members:{IdentityPoolId:{},Identities:{type:"list",member:{shape:"Sv"}},NextToken:{}}}},ListIdentityPools:{input:{type:"structure",required:["MaxResults"],members:{MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityPools:{type:"list",member:{type:"structure",members:{IdentityPoolId:{},IdentityPoolName:{}}}},NextToken:{}}}},ListTagsForResource:{input:{type:"structure",required:["ResourceArn"],members:{ResourceArn:{}}},output:{type:"structure",members:{Tags:{shape:"Sh"}}}},LookupDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{},IdentityId:{},DeveloperUserIdentifier:{},MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityId:{},DeveloperUserIdentifierList:{type:"list",member:{}},NextToken:{}}}},MergeDeveloperIdentities:{input:{type:"structure",required:["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],members:{SourceUserIdentifier:{},DestinationUserIdentifier:{},DeveloperProviderName:{},IdentityPoolId:{}}},output:{type:"structure",members:{IdentityId:{}}}},SetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId","Roles"],members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},SetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},TagResource:{input:{type:"structure",required:["ResourceArn","Tags"],members:{ResourceArn:{},Tags:{shape:"Sh"}}},output:{type:"structure",members:{}}},UnlinkDeveloperIdentity:{input:{type:"structure",required:["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],members:{IdentityId:{},IdentityPoolId:{},DeveloperProviderName:{},DeveloperUserIdentifier:{}}}},UnlinkIdentity:{input:{type:"structure",required:["IdentityId","Logins","LoginsToRemove"],members:{IdentityId:{},Logins:{shape:"S10"},LoginsToRemove:{shape:"Sw"}}},authtype:"none"},UntagResource:{input:{type:"structure",required:["ResourceArn","TagKeys"],members:{ResourceArn:{},TagKeys:{type:"list",member:{}}}},output:{type:"structure",members:{}}},UpdateIdentityPool:{input:{shape:"Sk"},output:{shape:"Sk"}}},shapes:{S5:{type:"map",key:{},value:{}},S9:{type:"list",member:{}},Sb:{type:"list",member:{type:"structure",members:{ProviderName:{},ClientId:{},ServerSideTokenCheck:{type:"boolean"}}}},Sg:{type:"list",member:{}},Sh:{type:"map",key:{},value:{}},Sk:{type:"structure",required:["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolId:{},IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},Sv:{type:"structure",members:{IdentityId:{},Logins:{shape:"Sw"},CreationDate:{type:"timestamp"},LastModifiedDate:{type:"timestamp"}}},Sw:{type:"list",member:{}},S10:{type:"map",key:{},value:{}},S1c:{type:"map",key:{},value:{}},S1e:{type:"map",key:{},value:{type:"structure",required:["Type"],members:{Type:{},AmbiguousRoleResolution:{},RulesConfiguration:{type:"structure",required:["Rules"],members:{Rules:{type:"list",member:{type:"structure",required:["Claim","MatchType","Value","RoleARN"],members:{Claim:{},MatchType:{},Value:{},RoleARN:{}}}}}}}}},S1s:{type:"map",key:{},value:{}}}}});var Hd=P((Dk,Ng)=>{Ng.exports={pagination:{ListIdentityPools:{input_token:"NextToken",limit_key:"MaxResults",output_token:"NextToken",result_key:"IdentityPools"}}}});var Xd=P((Pk,Kd)=>{vo();var go=V(),wg=go.Service,jd=go.apiLoader;jd.services.cognitoidentity={};go.CognitoIdentity=wg.defineService("cognitoidentity",["2014-06-30"]);Object.defineProperty(jd.services.cognitoidentity,"2014-06-30",{get:s(function(){var e=zd();return e.paginators=Hd().pagination,e},"get"),enumerable:!0,configurable:!0});Kd.exports=go.CognitoIdentity});var Gd=P(()=>{var Wt=V(),xg=Xd(),Eg=Fr();Wt.CognitoIdentityCredentials=Wt.util.inherit(Wt.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:s(function(e,r){Wt.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=Wt.util.copy(r||{}),this.loadCachedId();var i=this;Object.defineProperty(this,"identityId",{get:function(){return i.loadCachedId(),i._identityId||i.params.IdentityId},set:function(n){i._identityId=n}})},"CognitoIdentityCredentials"),refresh:s(function(e){this.coalesceRefresh(e||Wt.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.data=null,r._identityId=null,r.getId(function(i){i?(r.clearIdOnNotAuthorized(i),e(i)):r.params.RoleArn?r.getCredentialsFromSTS(e):r.getCredentialsForIdentity(e)})},"load"),clearCachedId:s(function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,r=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+r],delete this.storage[this.localStorageKey.providers+e+r]},"clearCache"),clearIdOnNotAuthorized:s(function(e){var r=this;e.code=="NotAuthorizedException"&&r.clearCachedId()},"clearIdOnNotAuthorized"),getId:s(function(e){var r=this;if(typeof r.params.IdentityId=="string")return e(null,r.params.IdentityId);r.cognito.getId(function(i,n){!i&&n.IdentityId?(r.params.IdentityId=n.IdentityId,e(null,n.IdentityId)):e(i)})},"getId"),loadCredentials:s(function(e,r){!e||!r||(r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration)},"loadCredentials"),getCredentialsForIdentity:s(function(e){var r=this;r.cognito.getCredentialsForIdentity(function(i,n){i?r.clearIdOnNotAuthorized(i):(r.cacheId(n),r.data=n,r.loadCredentials(r.data,r)),e(i)})},"getCredentialsForIdentity"),getCredentialsFromSTS:s(function(e){var r=this;r.cognito.getOpenIdToken(function(i,n){i?(r.clearIdOnNotAuthorized(i),e(i)):(r.cacheId(n),r.params.WebIdentityToken=n.Token,r.webIdentityCredentials.refresh(function(o){o||(r.data=r.webIdentityCredentials.data,r.sts.credentialsFrom(r.data,r)),e(o)}))})},"getCredentialsFromSTS"),loadCachedId:s(function(){var e=this;if(Wt.util.isBrowser()&&!e.params.IdentityId){var r=e.getStorage("id");if(r&&e.params.Logins){var i=Object.keys(e.params.Logins),n=(e.getStorage("providers")||"").split(","),o=n.filter(function(a){return i.indexOf(a)!==-1});o.length!==0&&(e.params.IdentityId=r)}else r&&(e.params.IdentityId=r)}},"loadCachedId"),createClients:function(){var t=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new Wt.WebIdentityCredentials(this.params,t),!this.cognito){var e=Wt.util.merge({},t);e.params=this.params,this.cognito=new xg(e)}this.sts=this.sts||new Eg(t)},cacheId:s(function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,Wt.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},"cacheId"),getStorage:s(function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},"getStorage"),setStorage:s(function(e,r){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=r}catch{}},"setStorage"),storage:function(){try{var t=Wt.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage=="object"?window.localStorage:{};return t["aws.test-storage"]="foobar",delete t["aws.test-storage"],t}catch{return{}}}()})});var Jd=P(()=>{var Gn=V(),Cg=Fr();Gn.SAMLCredentials=Gn.util.inherit(Gn.Credentials,{constructor:s(function(e){Gn.Credentials.call(this),this.expired=!0,this.params=e},"SAMLCredentials"),refresh:s(function(e){this.coalesceRefresh(e||Gn.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.createClients(),r.service.assumeRoleWithSAML(function(i,n){i||r.service.credentialsFrom(n,r),e(i)})},"load"),createClients:function(){this.service=this.service||new Cg({params:this.params})}})});var qa=P(()=>{var ct=V(),Sg=te("child_process"),Qd=ct.util.iniLoader;ct.ProcessCredentials=ct.util.inherit(ct.Credentials,{constructor:s(function(e){ct.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||ct.util.defaultProfile,this.get(e.callback||ct.util.fn.noop)},"ProcessCredentials"),load:s(function(e){var r=this;try{var i=ct.util.getProfilesFromSharedConfig(Qd,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw ct.util.error(new Error("Profile "+this.profile+" not found"),{code:"ProcessCredentialsProviderFailure"});if(n.credential_process)this.loadViaCredentialProcess(n,function(o,a){o?e(o,null):(r.expired=!1,r.accessKeyId=a.AccessKeyId,r.secretAccessKey=a.SecretAccessKey,r.sessionToken=a.SessionToken,a.Expiration&&(r.expireTime=new Date(a.Expiration)),e(null))});else throw ct.util.error(new Error("Profile "+this.profile+" did not include credential process"),{code:"ProcessCredentialsProviderFailure"})}catch(o){e(o)}},"load"),loadViaCredentialProcess:s(function(e,r){Sg.exec(e.credential_process,{env:process.env},function(i,n,o){if(i)r(ct.util.error(new Error("credential_process returned error"),{code:"ProcessCredentialsProviderFailure"}),null);else try{var a=JSON.parse(n);if(a.Expiration){var u=ct.util.date.getDate(),l=new Date(a.Expiration);if(l<u)throw Error("credential_process returned expired credentials")}if(a.Version!==1)throw Error("credential_process does not return Version == 1");r(null,a)}catch(f){r(ct.util.error(new Error(f.message),{code:"ProcessCredentialsProviderFailure"}),null)}})},"loadViaCredentialProcess"),refresh:s(function(e){Qd.clearCachedFiles(),this.coalesceRefresh(e||ct.util.fn.callback)},"refresh")})});var No=P(ka=>{(function(){ka.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
16
- `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(ka)});var gr=P((Yd,li)=>{(function(){var t,e,r,i,n,o,a=[].slice,u={}.hasOwnProperty;t=s(function(){var l,f,y,v,S,I;if(I=arguments[0],S=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,y=S.length;l<y;l++)if(v=S[l],v!=null)for(f in v)u.call(v,f)&&(I[f]=v[f]);return I},"assign"),i=s(function(l){return!!l&&Object.prototype.toString.call(l)==="[object Function]"},"isFunction"),n=s(function(l){var f;return!!l&&((f=typeof l)=="function"||f==="object")},"isObject"),e=s(function(l){return i(Array.isArray)?Array.isArray(l):Object.prototype.toString.call(l)==="[object Array]"},"isArray"),r=s(function(l){var f;if(e(l))return!l.length;for(f in l)if(u.call(l,f))return!1;return!0},"isEmpty"),o=s(function(l){var f,y;return n(l)&&(y=Object.getPrototypeOf(l))&&(f=y.constructor)&&typeof f=="function"&&f instanceof f&&Function.prototype.toString.call(f)===Function.prototype.toString.call(Object)},"isPlainObject"),li.exports.assign=t,li.exports.isFunction=i,li.exports.isObject=n,li.exports.isArray=e,li.exports.isEmpty=r,li.exports.isPlainObject=o}).call(Yd)});var La=P(($d,Zd)=>{(function(){var t;Zd.exports=t=function(){function e(r,i,n){if(this.options=r.options,this.stringify=r.stringify,i==null)throw new Error("Missing attribute name of element "+r.name);if(n==null)throw new Error("Missing attribute value for attribute "+i+" of element "+r.name);this.name=this.stringify.attName(i),this.value=this.stringify.attValue(n)}return s(e,"XMLAttribute"),e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(r){return this.options.writer.set(r).attribute(this)},e}()}).call($d)});var Jn=P((eh,th)=>{(function(){var t,e,r,i,n,o,a=s(function(l,f){for(var y in f)u.call(f,y)&&(l[y]=f[y]);function v(){this.constructor=l}return s(v,"ctor"),v.prototype=f.prototype,l.prototype=new v,l.__super__=f.prototype,l},"extend"),u={}.hasOwnProperty;o=gr(),n=o.isObject,i=o.isFunction,r=lt(),t=La(),th.exports=e=function(l){a(f,l);function f(y,v,S){if(f.__super__.constructor.call(this,y),v==null)throw new Error("Missing element name");this.name=this.stringify.eleName(v),this.attributes={},S!=null&&this.attribute(S),y.isDocument&&(this.isRoot=!0,this.documentObject=y,y.rootObject=this)}return s(f,"XMLElement"),f.prototype.clone=function(){var y,v,S,I;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attributes={},I=this.attributes;for(v in I)u.call(I,v)&&(y=I[v],S.attributes[v]=y.clone());return S.children=[],this.children.forEach(function(x){var w;return w=x.clone(),w.parent=S,S.children.push(w)}),S},f.prototype.attribute=function(y,v){var S,I;if(y!=null&&(y=y.valueOf()),n(y))for(S in y)u.call(y,S)&&(I=y[S],this.attribute(S,I));else i(v)&&(v=v.apply()),(!this.options.skipNullAttributes||v!=null)&&(this.attributes[y]=new t(this,y,v));return this},f.prototype.removeAttribute=function(y){var v,S,I;if(y==null)throw new Error("Missing attribute name");if(y=y.valueOf(),Array.isArray(y))for(S=0,I=y.length;S<I;S++)v=y[S],delete this.attributes[v];else delete this.attributes[y];return this},f.prototype.toString=function(y){return this.options.writer.set(y).element(this)},f.prototype.att=function(y,v){return this.attribute(y,v)},f.prototype.a=function(y,v){return this.attribute(y,v)},f}(r)}).call(eh)});var Qn=P((rh,ih)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),ih.exports=t=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(u)}return s(o,"XMLCData"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).cdata(this)},o}(e)}).call(rh)});var Yn=P((nh,sh)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),sh.exports=t=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing comment text");this.text=this.stringify.comment(u)}return s(o,"XMLComment"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).comment(this)},o}(e)}).call(nh)});var $n=P((oh,ah)=>{(function(){var t,e,r,i=s(function(o,a){for(var u in a)n.call(a,u)&&(o[u]=a[u]);function l(){this.constructor=o}return s(l,"ctor"),l.prototype=a.prototype,o.prototype=new l,o.__super__=a.prototype,o},"extend"),n={}.hasOwnProperty;r=gr().isObject,e=lt(),ah.exports=t=function(o){i(a,o);function a(u,l,f,y){var v;a.__super__.constructor.call(this,u),r(l)&&(v=l,l=v.version,f=v.encoding,y=v.standalone),l||(l="1.0"),this.version=this.stringify.xmlVersion(l),f!=null&&(this.encoding=this.stringify.xmlEncoding(f)),y!=null&&(this.standalone=this.stringify.xmlStandalone(y))}return s(a,"XMLDeclaration"),a.prototype.toString=function(u){return this.options.writer.set(u).declaration(this)},a}(e)}).call(oh)});var Zn=P((uh,ch)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),ch.exports=t=function(n){r(o,n);function o(a,u,l,f,y,v){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");if(l==null)throw new Error("Missing DTD attribute name");if(!f)throw new Error("Missing DTD attribute type");if(!y)throw new Error("Missing DTD attribute default");if(y.indexOf("#")!==0&&(y="#"+y),!y.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(v&&!y.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(u),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(f),this.defaultValue=this.stringify.dtdAttDefault(v),this.defaultValueType=y}return s(o,"XMLDTDAttList"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdAttList(this)},o}(e)}).call(uh)});var es=P((lh,dh)=>{(function(){var t,e,r,i=s(function(o,a){for(var u in a)n.call(a,u)&&(o[u]=a[u]);function l(){this.constructor=o}return s(l,"ctor"),l.prototype=a.prototype,o.prototype=new l,o.__super__=a.prototype,o},"extend"),n={}.hasOwnProperty;r=gr().isObject,e=lt(),dh.exports=t=function(o){i(a,o);function a(u,l,f,y){if(a.__super__.constructor.call(this,u),f==null)throw new Error("Missing entity name");if(y==null)throw new Error("Missing entity value");if(this.pe=!!l,this.name=this.stringify.eleName(f),!r(y))this.value=this.stringify.dtdEntityValue(y);else{if(!y.pubID&&!y.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(y.pubID&&!y.sysID)throw new Error("System identifier is required for a public external entity");if(y.pubID!=null&&(this.pubID=this.stringify.dtdPubID(y.pubID)),y.sysID!=null&&(this.sysID=this.stringify.dtdSysID(y.sysID)),y.nData!=null&&(this.nData=this.stringify.dtdNData(y.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}}return s(a,"XMLDTDEntity"),a.prototype.toString=function(u){return this.options.writer.set(u).dtdEntity(this)},a}(e)}).call(lh)});var ts=P((hh,fh)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),fh.exports=t=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.eleName(u),this.value=this.stringify.dtdElementValue(l)}return s(o,"XMLDTDElement"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdElement(this)},o}(e)}).call(hh)});var rs=P((ph,mh)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),mh.exports=t=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing notation name");if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(u),l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return s(o,"XMLDTDNotation"),o.prototype.toString=function(a){return this.options.writer.set(a).dtdNotation(this)},o}(e)}).call(ph)});var is=P((yh,vh)=>{(function(){var t,e,r,i,n,o,a,u=s(function(f,y){for(var v in y)l.call(y,v)&&(f[v]=y[v]);function S(){this.constructor=f}return s(S,"ctor"),S.prototype=y.prototype,f.prototype=new S,f.__super__=y.prototype,f},"extend"),l={}.hasOwnProperty;a=gr().isObject,o=lt(),t=Zn(),r=es(),e=ts(),i=rs(),vh.exports=n=function(f){u(y,f);function y(v,S,I){var x,w;y.__super__.constructor.call(this,v),this.documentObject=v,a(S)&&(x=S,S=x.pubID,I=x.sysID),I==null&&(w=[S,I],I=w[0],S=w[1]),S!=null&&(this.pubID=this.stringify.dtdPubID(S)),I!=null&&(this.sysID=this.stringify.dtdSysID(I))}return s(y,"XMLDocType"),y.prototype.element=function(v,S){var I;return I=new e(this,v,S),this.children.push(I),this},y.prototype.attList=function(v,S,I,x,w){var D;return D=new t(this,v,S,I,x,w),this.children.push(D),this},y.prototype.entity=function(v,S){var I;return I=new r(this,!1,v,S),this.children.push(I),this},y.prototype.pEntity=function(v,S){var I;return I=new r(this,!0,v,S),this.children.push(I),this},y.prototype.notation=function(v,S){var I;return I=new i(this,v,S),this.children.push(I),this},y.prototype.toString=function(v){return this.options.writer.set(v).docType(this)},y.prototype.ele=function(v,S){return this.element(v,S)},y.prototype.att=function(v,S,I,x,w){return this.attList(v,S,I,x,w)},y.prototype.ent=function(v,S){return this.entity(v,S)},y.prototype.pent=function(v,S){return this.pEntity(v,S)},y.prototype.not=function(v,S){return this.notation(v,S)},y.prototype.up=function(){return this.root()||this.documentObject},y}(o)}).call(yh)});var ns=P((gh,Nh)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Nh.exports=e=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing raw text");this.value=this.stringify.raw(u)}return s(o,"XMLRaw"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).raw(this)},o}(t)}).call(gh)});var ss=P((wh,xh)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),xh.exports=e=function(n){r(o,n);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing element text");this.value=this.stringify.eleText(u)}return s(o,"XMLText"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).text(this)},o}(t)}).call(wh)});var os=P((Eh,Ch)=>{(function(){var t,e,r=s(function(n,o){for(var a in o)i.call(o,a)&&(n[a]=o[a]);function u(){this.constructor=n}return s(u,"ctor"),u.prototype=o.prototype,n.prototype=new u,n.__super__=o.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Ch.exports=e=function(n){r(o,n);function o(a,u,l){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(u),l&&(this.value=this.stringify.insValue(l))}return s(o,"XMLProcessingInstruction"),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.set(a).processingInstruction(this)},o}(t)}).call(Eh)});var lt=P((Sh,Th)=>{(function(){var t,e,r,i,n,o,a,u,l,f,y,v,S,I={}.hasOwnProperty;S=gr(),v=S.isObject,y=S.isFunction,f=S.isEmpty,n=null,t=null,e=null,r=null,i=null,u=null,l=null,a=null,Th.exports=o=function(){function x(w){this.parent=w,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],n||(n=Jn(),t=Qn(),e=Yn(),r=$n(),i=is(),u=ns(),l=ss(),a=os())}return s(x,"XMLNode"),x.prototype.element=function(w,D,E){var p,C,O,_,T,A,g,j,X,M;if(A=null,D==null&&(D={}),D=D.valueOf(),v(D)||(X=[D,E],E=X[0],D=X[1]),w!=null&&(w=w.valueOf()),Array.isArray(w))for(O=0,g=w.length;O<g;O++)C=w[O],A=this.element(C);else if(y(w))A=this.element(w.apply());else if(v(w)){for(T in w)if(I.call(w,T))if(M=w[T],y(M)&&(M=M.apply()),v(M)&&f(M)&&(M=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(T.substr(this.stringify.convertAttKey.length),M);else if(!this.options.separateArrayItems&&Array.isArray(M))for(_=0,j=M.length;_<j;_++)C=M[_],p={},p[T]=C,A=this.element(p);else v(M)?(A=this.element(T),A.element(M)):A=this.element(T,M)}else!this.options.ignoreDecorators&&this.stringify.convertTextKey&&w.indexOf(this.stringify.convertTextKey)===0?A=this.text(E):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&w.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(E):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&w.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(E):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&w.indexOf(this.stringify.convertRawKey)===0?A=this.raw(E):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&w.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(w.substr(this.stringify.convertPIKey.length),E):A=this.node(w,D,E);if(A==null)throw new Error("Could not create any elements with: "+w);return A},x.prototype.insertBefore=function(w,D,E){var p,C,O;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),O=this.parent.children.splice(C),p=this.parent.element(w,D,E),Array.prototype.push.apply(this.parent.children,O),p},x.prototype.insertAfter=function(w,D,E){var p,C,O;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),O=this.parent.children.splice(C+1),p=this.parent.element(w,D,E),Array.prototype.push.apply(this.parent.children,O),p},x.prototype.remove=function(){var w,D;if(this.isRoot)throw new Error("Cannot remove the root element");return w=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[w,w-w+1].concat(D=[])),this.parent},x.prototype.node=function(w,D,E){var p,C;return w!=null&&(w=w.valueOf()),D||(D={}),D=D.valueOf(),v(D)||(C=[D,E],E=C[0],D=C[1]),p=new n(this,w,D),E!=null&&p.text(E),this.children.push(p),p},x.prototype.text=function(w){var D;return D=new l(this,w),this.children.push(D),this},x.prototype.cdata=function(w){var D;return D=new t(this,w),this.children.push(D),this},x.prototype.comment=function(w){var D;return D=new e(this,w),this.children.push(D),this},x.prototype.commentBefore=function(w){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E),D=this.parent.comment(w),Array.prototype.push.apply(this.parent.children,p),this},x.prototype.commentAfter=function(w){var D,E,p;return E=this.parent.children.indexOf(this),p=this.parent.children.splice(E+1),D=this.parent.comment(w),Array.prototype.push.apply(this.parent.children,p),this},x.prototype.raw=function(w){var D;return D=new u(this,w),this.children.push(D),this},x.prototype.instruction=function(w,D){var E,p,C,O,_;if(w!=null&&(w=w.valueOf()),D!=null&&(D=D.valueOf()),Array.isArray(w))for(O=0,_=w.length;O<_;O++)E=w[O],this.instruction(E);else if(v(w))for(E in w)I.call(w,E)&&(p=w[E],this.instruction(E,p));else y(D)&&(D=D.apply()),C=new a(this,w,D),this.children.push(C);return this},x.prototype.instructionBefore=function(w,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p),E=this.parent.instruction(w,D),Array.prototype.push.apply(this.parent.children,C),this},x.prototype.instructionAfter=function(w,D){var E,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p+1),E=this.parent.instruction(w,D),Array.prototype.push.apply(this.parent.children,C),this},x.prototype.declaration=function(w,D,E){var p,C;return p=this.document(),C=new r(p,w,D,E),p.children[0]instanceof r?p.children[0]=C:p.children.unshift(C),p.root()||p},x.prototype.doctype=function(w,D){var E,p,C,O,_,T,A,g,j,X;for(p=this.document(),C=new i(p,w,D),j=p.children,O=_=0,A=j.length;_<A;O=++_)if(E=j[O],E instanceof i)return p.children[O]=C,C;for(X=p.children,O=T=0,g=X.length;T<g;O=++T)if(E=X[O],E.isRoot)return p.children.splice(O,0,C),C;return p.children.push(C),C},x.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},x.prototype.root=function(){var w;for(w=this;w;){if(w.isDocument)return w.rootObject;if(w.isRoot)return w;w=w.parent}},x.prototype.document=function(){var w;for(w=this;w;){if(w.isDocument)return w;w=w.parent}},x.prototype.end=function(w){return this.document().end(w)},x.prototype.prev=function(){var w;if(w=this.parent.children.indexOf(this),w<1)throw new Error("Already at the first node");return this.parent.children[w-1]},x.prototype.next=function(){var w;if(w=this.parent.children.indexOf(this),w===-1||w===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[w+1]},x.prototype.importDocument=function(w){var D;return D=w.root().clone(),D.parent=this,D.isRoot=!1,this.children.push(D),this},x.prototype.ele=function(w,D,E){return this.element(w,D,E)},x.prototype.nod=function(w,D,E){return this.node(w,D,E)},x.prototype.txt=function(w){return this.text(w)},x.prototype.dat=function(w){return this.cdata(w)},x.prototype.com=function(w){return this.comment(w)},x.prototype.ins=function(w,D){return this.instruction(w,D)},x.prototype.doc=function(){return this.document()},x.prototype.dec=function(w,D,E){return this.declaration(w,D,E)},x.prototype.dtd=function(w,D){return this.doctype(w,D)},x.prototype.e=function(w,D,E){return this.element(w,D,E)},x.prototype.n=function(w,D,E){return this.node(w,D,E)},x.prototype.t=function(w){return this.text(w)},x.prototype.d=function(w){return this.cdata(w)},x.prototype.c=function(w){return this.comment(w)},x.prototype.r=function(w){return this.raw(w)},x.prototype.i=function(w,D){return this.instruction(w,D)},x.prototype.u=function(){return this.up()},x.prototype.importXMLBuilder=function(w){return this.importDocument(w)},x}()}).call(Sh)});var Fa=P((bh,Ah)=>{(function(){var t,e=s(function(i,n){return function(){return i.apply(n,arguments)}},"bind"),r={}.hasOwnProperty;Ah.exports=t=function(){function i(n){this.assertLegalChar=e(this.assertLegalChar,this);var o,a,u;n||(n={}),this.noDoubleEncoding=n.noDoubleEncoding,a=n.stringify||{};for(o in a)r.call(a,o)&&(u=a[o],this[o]=u)}return s(i,"XMLStringifier"),i.prototype.eleName=function(n){return n=""+n||"",this.assertLegalChar(n)},i.prototype.eleText=function(n){return n=""+n||"",this.assertLegalChar(this.elEscape(n))},i.prototype.cdata=function(n){return n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n)},i.prototype.comment=function(n){if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},i.prototype.raw=function(n){return""+n||""},i.prototype.attName=function(n){return n=""+n||""},i.prototype.attValue=function(n){return n=""+n||"",this.attEscape(n)},i.prototype.insTarget=function(n){return""+n||""},i.prototype.insValue=function(n){if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return n},i.prototype.xmlVersion=function(n){if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},i.prototype.xmlEncoding=function(n){if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return n},i.prototype.xmlStandalone=function(n){return n?"yes":"no"},i.prototype.dtdPubID=function(n){return""+n||""},i.prototype.dtdSysID=function(n){return""+n||""},i.prototype.dtdElementValue=function(n){return""+n||""},i.prototype.dtdAttType=function(n){return""+n||""},i.prototype.dtdAttDefault=function(n){return n!=null?""+n||"":n},i.prototype.dtdEntityValue=function(n){return""+n||""},i.prototype.dtdNData=function(n){return""+n||""},i.prototype.convertAttKey="@",i.prototype.convertPIKey="?",i.prototype.convertTextKey="#text",i.prototype.convertCDataKey="#cdata",i.prototype.convertCommentKey="#comment",i.prototype.convertRawKey="#raw",i.prototype.assertLegalChar=function(n){var o;if(o=n.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),o)throw new Error("Invalid character in string: "+n+" at index "+o.index);return n},i.prototype.elEscape=function(n){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},i.prototype.attEscape=function(n){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},i}()}).call(bh)});var Ma=P((Ih,Rh)=>{(function(){var t,e={}.hasOwnProperty;Rh.exports=t=function(){function r(i){var n,o,a,u,l,f,y,v,S;i||(i={}),this.pretty=i.pretty||!1,this.allowEmpty=(o=i.allowEmpty)!=null?o:!1,this.pretty?(this.indent=(a=i.indent)!=null?a:" ",this.newline=(u=i.newline)!=null?u:`
17
- `,this.offset=(l=i.offset)!=null?l:0,this.dontprettytextnodes=(f=i.dontprettytextnodes)!=null?f:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(y=i.spacebeforeslash)!=null?y:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,v=i.writer||{};for(n in v)e.call(v,n)&&(S=v[n],this[n]=S)}return s(r,"XMLWriterBase"),r.prototype.set=function(i){var n,o,a;i||(i={}),"pretty"in i&&(this.pretty=i.pretty),"allowEmpty"in i&&(this.allowEmpty=i.allowEmpty),this.pretty?(this.indent="indent"in i?i.indent:" ",this.newline="newline"in i?i.newline:`
18
- `,this.offset="offset"in i?i.offset:0,this.dontprettytextnodes="dontprettytextnodes"in i?i.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in i?i.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=i.writer||{};for(n in o)e.call(o,n)&&(a=o[n],this[n]=a);return this},r.prototype.space=function(i){var n;return this.pretty?(n=(i||0)+this.offset+1,n>0?new Array(n).join(this.indent):""):""},r}()}).call(Ih)});var wo=P((Oh,Dh)=>{(function(){var t,e,r,i,n,o,a,u,l,f,y,v,S,I,x=s(function(D,E){for(var p in E)w.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return s(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),w={}.hasOwnProperty;a=$n(),u=is(),t=Qn(),e=Yn(),l=Jn(),y=ns(),S=ss(),f=os(),r=Zn(),i=ts(),n=es(),o=rs(),I=Ma(),Dh.exports=v=function(D){x(E,D);function E(p){E.__super__.constructor.call(this,p)}return s(E,"XMLStringWriter"),E.prototype.document=function(p){var C,O,_,T,A;for(this.textispresent=!1,T="",A=p.children,O=0,_=A.length;O<_;O++)C=A[O],T+=function(){switch(!1){case!(C instanceof a):return this.declaration(C);case!(C instanceof u):return this.docType(C);case!(C instanceof e):return this.comment(C);case!(C instanceof f):return this.processingInstruction(C);default:return this.element(C,0)}}.call(this);return this.pretty&&T.slice(-this.newline.length)===this.newline&&(T=T.slice(0,-this.newline.length)),T},E.prototype.attribute=function(p){return" "+p.name+'="'+p.value+'"'},E.prototype.cdata=function(p,C){return this.space(C)+"<![CDATA["+p.text+"]]>"+this.newline},E.prototype.comment=function(p,C){return this.space(C)+"<!-- "+p.text+" -->"+this.newline},E.prototype.declaration=function(p,C){var O;return O=this.space(C),O+='<?xml version="'+p.version+'"',p.encoding!=null&&(O+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(O+=' standalone="'+p.standalone+'"'),O+=this.spacebeforeslash+"?>",O+=this.newline,O},E.prototype.docType=function(p,C){var O,_,T,A,g;if(C||(C=0),A=this.space(C),A+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?A+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(A+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(A+=" [",A+=this.newline,g=p.children,_=0,T=g.length;_<T;_++)O=g[_],A+=function(){switch(!1){case!(O instanceof r):return this.dtdAttList(O,C+1);case!(O instanceof i):return this.dtdElement(O,C+1);case!(O instanceof n):return this.dtdEntity(O,C+1);case!(O instanceof o):return this.dtdNotation(O,C+1);case!(O instanceof t):return this.cdata(O,C+1);case!(O instanceof e):return this.comment(O,C+1);case!(O instanceof f):return this.processingInstruction(O,C+1);default:throw new Error("Unknown DTD node type: "+O.constructor.name)}}.call(this);A+="]"}return A+=this.spacebeforeslash+">",A+=this.newline,A},E.prototype.element=function(p,C){var O,_,T,A,g,j,X,M,ne,We,Fe,At,Z;C||(C=0),Z=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),At=this.space(C),M="",M+=At+"<"+p.name,ne=p.attributes;for(X in ne)w.call(ne,X)&&(O=ne[X],M+=this.attribute(O));if(p.children.length===0||p.children.every(function(wr){return wr.value===""}))this.allowEmpty?M+="></"+p.name+">"+this.newline:M+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)M+=">",M+=p.children[0].value,M+="</"+p.name+">"+this.newline;else{if(this.dontprettytextnodes){for(We=p.children,T=0,g=We.length;T<g;T++)if(_=We[T],_.value!=null){this.textispresent++,Z=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,At=this.space(C)),M+=">"+this.newline,Fe=p.children,A=0,j=Fe.length;A<j;A++)_=Fe[A],M+=function(){switch(!1){case!(_ instanceof t):return this.cdata(_,C+1);case!(_ instanceof e):return this.comment(_,C+1);case!(_ instanceof l):return this.element(_,C+1);case!(_ instanceof y):return this.raw(_,C+1);case!(_ instanceof S):return this.text(_,C+1);case!(_ instanceof f):return this.processingInstruction(_,C+1);default:throw new Error("Unknown XML node type: "+_.constructor.name)}}.call(this);Z&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),M+=At+"</"+p.name+">"+this.newline}return M},E.prototype.processingInstruction=function(p,C){var O;return O=this.space(C)+"<?"+p.target,p.value&&(O+=" "+p.value),O+=this.spacebeforeslash+"?>"+this.newline,O},E.prototype.raw=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.text=function(p,C){return this.space(C)+p.value+this.newline},E.prototype.dtdAttList=function(p,C){var O;return O=this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(O+=" "+p.defaultValueType),p.defaultValue&&(O+=' "'+p.defaultValue+'"'),O+=this.spacebeforeslash+">"+this.newline,O},E.prototype.dtdElement=function(p,C){return this.space(C)+"<!ELEMENT "+p.name+" "+p.value+this.spacebeforeslash+">"+this.newline},E.prototype.dtdEntity=function(p,C){var O;return O=this.space(C)+"<!ENTITY",p.pe&&(O+=" %"),O+=" "+p.name,p.value?O+=' "'+p.value+'"':(p.pubID&&p.sysID?O+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(O+=' SYSTEM "'+p.sysID+'"'),p.nData&&(O+=" NDATA "+p.nData)),O+=this.spacebeforeslash+">"+this.newline,O},E.prototype.dtdNotation=function(p,C){var O;return O=this.space(C)+"<!NOTATION "+p.name,p.pubID&&p.sysID?O+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?O+=' PUBLIC "'+p.pubID+'"':p.sysID&&(O+=' SYSTEM "'+p.sysID+'"'),O+=this.spacebeforeslash+">"+this.newline,O},E.prototype.openNode=function(p,C){var O,_,T,A;if(C||(C=0),p instanceof l){T=this.space(C)+"<"+p.name,A=p.attributes;for(_ in A)w.call(A,_)&&(O=A[_],T+=this.attribute(O));return T+=(p.children?">":"/>")+this.newline,T}else return T=this.space(C)+"<!DOCTYPE "+p.rootNodeName,p.pubID&&p.sysID?T+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(T+=' SYSTEM "'+p.sysID+'"'),T+=(p.children?" [":">")+this.newline,T},E.prototype.closeNode=function(p,C){switch(C||(C=0),!1){case!(p instanceof l):return this.space(C)+"</"+p.name+">"+this.newline;case!(p instanceof u):return this.space(C)+"]>"+this.newline}},E}(I)}).call(Oh)});var qh=P((Ph,_h)=>{(function(){var t,e,r,i,n,o=s(function(u,l){for(var f in l)a.call(l,f)&&(u[f]=l[f]);function y(){this.constructor=u}return s(y,"ctor"),y.prototype=l.prototype,u.prototype=new y,u.__super__=l.prototype,u},"extend"),a={}.hasOwnProperty;n=gr().isPlainObject,e=lt(),i=Fa(),r=wo(),_h.exports=t=function(u){o(l,u);function l(f){l.__super__.constructor.call(this,null),f||(f={}),f.writer||(f.writer=new r),this.options=f,this.stringify=new i(f),this.isDocument=!0}return s(l,"XMLDocument"),l.prototype.end=function(f){var y;return f?n(f)&&(y=f,f=this.options.writer.set(y)):f=this.options.writer,f.document(this)},l.prototype.toString=function(f){return this.options.writer.set(f).document(this)},l}(e)}).call(Ph)});var Fh=P((kh,Lh)=>{(function(){var t,e,r,i,n,o,a,u,l,f,y,v,S,I,x,w,D,E,p,C,O={}.hasOwnProperty;C=gr(),E=C.isObject,D=C.isFunction,p=C.isPlainObject,y=Jn(),e=Qn(),r=Yn(),S=ns(),w=ss(),v=os(),u=$n(),l=is(),i=Zn(),o=es(),n=ts(),a=rs(),t=La(),x=Fa(),I=wo(),Lh.exports=f=function(){function _(T,A,g){var j;T||(T={}),T.writer?p(T.writer)&&(j=T.writer,T.writer=new I(j)):T.writer=new I(T),this.options=T,this.writer=T.writer,this.stringify=new x(T),this.onDataCallback=A||function(){},this.onEndCallback=g||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return s(_,"XMLDocumentCB"),_.prototype.node=function(T,A,g){var j;if(T==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),T=T.valueOf(),A==null&&(A={}),A=A.valueOf(),E(A)||(j=[A,g],g=j[0],A=j[1]),this.currentNode=new y(this,T,A),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,g!=null&&this.text(g),this},_.prototype.element=function(T,A,g){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(T,A,g)},_.prototype.attribute=function(T,A){var g,j;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(T!=null&&(T=T.valueOf()),E(T))for(g in T)O.call(T,g)&&(j=T[g],this.attribute(g,j));else D(A)&&(A=A.apply()),(!this.options.skipNullAttributes||A!=null)&&(this.currentNode.attributes[T]=new t(this,T,A));return this},_.prototype.text=function(T){var A;return this.openCurrent(),A=new w(this,T),this.onData(this.writer.text(A,this.currentLevel+1)),this},_.prototype.cdata=function(T){var A;return this.openCurrent(),A=new e(this,T),this.onData(this.writer.cdata(A,this.currentLevel+1)),this},_.prototype.comment=function(T){var A;return this.openCurrent(),A=new r(this,T),this.onData(this.writer.comment(A,this.currentLevel+1)),this},_.prototype.raw=function(T){var A;return this.openCurrent(),A=new S(this,T),this.onData(this.writer.raw(A,this.currentLevel+1)),this},_.prototype.instruction=function(T,A){var g,j,X,M,ne;if(this.openCurrent(),T!=null&&(T=T.valueOf()),A!=null&&(A=A.valueOf()),Array.isArray(T))for(g=0,M=T.length;g<M;g++)j=T[g],this.instruction(j);else if(E(T))for(j in T)O.call(T,j)&&(X=T[j],this.instruction(j,X));else D(A)&&(A=A.apply()),ne=new v(this,T,A),this.onData(this.writer.processingInstruction(ne,this.currentLevel+1));return this},_.prototype.declaration=function(T,A,g){var j;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return j=new u(this,T,A,g),this.onData(this.writer.declaration(j,this.currentLevel+1)),this},_.prototype.doctype=function(T,A,g){if(this.openCurrent(),T==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new l(this,A,g),this.currentNode.rootNodeName=T,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},_.prototype.dtdElement=function(T,A){var g;return this.openCurrent(),g=new n(this,T,A),this.onData(this.writer.dtdElement(g,this.currentLevel+1)),this},_.prototype.attList=function(T,A,g,j,X){var M;return this.openCurrent(),M=new i(this,T,A,g,j,X),this.onData(this.writer.dtdAttList(M,this.currentLevel+1)),this},_.prototype.entity=function(T,A){var g;return this.openCurrent(),g=new o(this,!1,T,A),this.onData(this.writer.dtdEntity(g,this.currentLevel+1)),this},_.prototype.pEntity=function(T,A){var g;return this.openCurrent(),g=new o(this,!0,T,A),this.onData(this.writer.dtdEntity(g,this.currentLevel+1)),this},_.prototype.notation=function(T,A){var g;return this.openCurrent(),g=new a(this,T,A),this.onData(this.writer.dtdNotation(g,this.currentLevel+1)),this},_.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},_.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},_.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},_.prototype.openNode=function(T){if(!T.isOpen)return!this.root&&this.currentLevel===0&&T instanceof y&&(this.root=T),this.onData(this.writer.openNode(T,this.currentLevel)),T.isOpen=!0},_.prototype.closeNode=function(T){if(!T.isClosed)return this.onData(this.writer.closeNode(T,this.currentLevel)),T.isClosed=!0},_.prototype.onData=function(T){return this.documentStarted=!0,this.onDataCallback(T)},_.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},_.prototype.ele=function(){return this.element.apply(this,arguments)},_.prototype.nod=function(T,A,g){return this.node(T,A,g)},_.prototype.txt=function(T){return this.text(T)},_.prototype.dat=function(T){return this.cdata(T)},_.prototype.com=function(T){return this.comment(T)},_.prototype.ins=function(T,A){return this.instruction(T,A)},_.prototype.dec=function(T,A,g){return this.declaration(T,A,g)},_.prototype.dtd=function(T,A,g){return this.doctype(T,A,g)},_.prototype.e=function(T,A,g){return this.element(T,A,g)},_.prototype.n=function(T,A,g){return this.node(T,A,g)},_.prototype.t=function(T){return this.text(T)},_.prototype.d=function(T){return this.cdata(T)},_.prototype.c=function(T){return this.comment(T)},_.prototype.r=function(T){return this.raw(T)},_.prototype.i=function(T,A){return this.instruction(T,A)},_.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.ent=function(T,A){return this.entity(T,A)},_.prototype.pent=function(T,A){return this.pEntity(T,A)},_.prototype.not=function(T,A){return this.notation(T,A)},_}()}).call(kh)});var Bh=P((Mh,Wh)=>{(function(){var t,e,r,i,n,o,a,u,l,f,y,v,S,I,x=s(function(D,E){for(var p in E)w.call(E,p)&&(D[p]=E[p]);function C(){this.constructor=D}return s(C,"ctor"),C.prototype=E.prototype,D.prototype=new C,D.__super__=E.prototype,D},"extend"),w={}.hasOwnProperty;a=$n(),u=is(),t=Qn(),e=Yn(),l=Jn(),y=ns(),S=ss(),f=os(),r=Zn(),i=ts(),n=es(),o=rs(),I=Ma(),Wh.exports=v=function(D){x(E,D);function E(p,C){E.__super__.constructor.call(this,C),this.stream=p}return s(E,"XMLStreamWriter"),E.prototype.document=function(p){var C,O,_,T,A,g,j,X;for(g=p.children,O=0,T=g.length;O<T;O++)C=g[O],C.isLastRootNode=!1;for(p.children[p.children.length-1].isLastRootNode=!0,j=p.children,X=[],_=0,A=j.length;_<A;_++)switch(C=j[_],!1){case!(C instanceof a):X.push(this.declaration(C));break;case!(C instanceof u):X.push(this.docType(C));break;case!(C instanceof e):X.push(this.comment(C));break;case!(C instanceof f):X.push(this.processingInstruction(C));break;default:X.push(this.element(C))}return X},E.prototype.attribute=function(p){return this.stream.write(" "+p.name+'="'+p.value+'"')},E.prototype.cdata=function(p,C){return this.stream.write(this.space(C)+"<![CDATA["+p.text+"]]>"+this.endline(p))},E.prototype.comment=function(p,C){return this.stream.write(this.space(C)+"<!-- "+p.text+" -->"+this.endline(p))},E.prototype.declaration=function(p,C){return this.stream.write(this.space(C)),this.stream.write('<?xml version="'+p.version+'"'),p.encoding!=null&&this.stream.write(' encoding="'+p.encoding+'"'),p.standalone!=null&&this.stream.write(' standalone="'+p.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(p))},E.prototype.docType=function(p,C){var O,_,T,A;if(C||(C=0),this.stream.write(this.space(C)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p)),A=p.children,_=0,T=A.length;_<T;_++)switch(O=A[_],!1){case!(O instanceof r):this.dtdAttList(O,C+1);break;case!(O instanceof i):this.dtdElement(O,C+1);break;case!(O instanceof n):this.dtdEntity(O,C+1);break;case!(O instanceof o):this.dtdNotation(O,C+1);break;case!(O instanceof t):this.cdata(O,C+1);break;case!(O instanceof e):this.comment(O,C+1);break;case!(O instanceof f):this.processingInstruction(O,C+1);break;default:throw new Error("Unknown DTD node type: "+O.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(p))},E.prototype.element=function(p,C){var O,_,T,A,g,j,X,M;C||(C=0),M=this.space(C),this.stream.write(M+"<"+p.name),j=p.attributes;for(g in j)w.call(j,g)&&(O=j[g],this.attribute(O));if(p.children.length===0||p.children.every(function(ne){return ne.value===""}))this.allowEmpty?this.stream.write("></"+p.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)this.stream.write(">"),this.stream.write(p.children[0].value),this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.newline),X=p.children,T=0,A=X.length;T<A;T++)switch(_=X[T],!1){case!(_ instanceof t):this.cdata(_,C+1);break;case!(_ instanceof e):this.comment(_,C+1);break;case!(_ instanceof l):this.element(_,C+1);break;case!(_ instanceof y):this.raw(_,C+1);break;case!(_ instanceof S):this.text(_,C+1);break;case!(_ instanceof f):this.processingInstruction(_,C+1);break;default:throw new Error("Unknown XML node type: "+_.constructor.name)}this.stream.write(M+"</"+p.name+">")}return this.stream.write(this.endline(p))},E.prototype.processingInstruction=function(p,C){return this.stream.write(this.space(C)+"<?"+p.target),p.value&&this.stream.write(" "+p.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(p))},E.prototype.raw=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.text=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},E.prototype.dtdAttList=function(p,C){return this.stream.write(this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType),p.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+p.defaultValueType),p.defaultValue&&this.stream.write(' "'+p.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdElement=function(p,C){return this.stream.write(this.space(C)+"<!ELEMENT "+p.name+" "+p.value),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdEntity=function(p,C){return this.stream.write(this.space(C)+"<!ENTITY"),p.pe&&this.stream.write(" %"),this.stream.write(" "+p.name),p.value?this.stream.write(' "'+p.value+'"'):(p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.nData&&this.stream.write(" NDATA "+p.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.dtdNotation=function(p,C){return this.stream.write(this.space(C)+"<!NOTATION "+p.name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.pubID?this.stream.write(' PUBLIC "'+p.pubID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},E.prototype.endline=function(p){return p.isLastRootNode?"":this.newline},E}(I)}).call(Mh)});var Uh=P((Vh,as)=>{(function(){var t,e,r,i,n,o,a;a=gr(),n=a.assign,o=a.isFunction,t=qh(),e=Fh(),i=wo(),r=Bh(),as.exports.create=function(u,l,f,y){var v,S;if(u==null)throw new Error("Root element needs a name");return y=n({},l,f,y),v=new t(y),S=v.element(u),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.doctype(y)),S},as.exports.begin=function(u,l,f){var y;return o(u)&&(y=[u,l],l=y[0],f=y[1],u={}),l?new e(u,l,f):new t(u)},as.exports.stringWriter=function(u){return new i(u)},as.exports.streamWriter=function(u,l){return new r(u,l)}}).call(Vh)});var zh=P(Wa=>{(function(){"use strict";var t,e,r,i,n,o={}.hasOwnProperty;t=Uh(),e=No().defaults,i=s(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),n=s(function(a){return"<![CDATA["+r(a)+"]]>"},"wrapCDATA"),r=s(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),Wa.Builder=function(){function a(u){var l,f,y;this.options={},f=e["0.2"];for(l in f)o.call(f,l)&&(y=f[l],this.options[l]=y);for(l in u)o.call(u,l)&&(y=u[l],this.options[l]=y)}return s(a,"Builder"),a.prototype.buildObject=function(u){var l,f,y,v,S;return l=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(S=Object.keys(u)[0],u=u[S]):S=this.options.rootName,y=function(I){return function(x,w){var D,E,p,C,O,_;if(typeof w!="object")I.options.cdata&&i(w)?x.raw(n(w)):x.txt(w);else if(Array.isArray(w)){for(C in w)if(o.call(w,C)){E=w[C];for(O in E)p=E[O],x=y(x.ele(O),p).up()}}else for(O in w)if(o.call(w,O))if(E=w[O],O===l){if(typeof E=="object")for(D in E)_=E[D],x=x.att(D,_)}else if(O===f)I.options.cdata&&i(E)?x=x.raw(n(E)):x=x.txt(E);else if(Array.isArray(E))for(C in E)o.call(E,C)&&(p=E[C],typeof p=="string"?I.options.cdata&&i(p)?x=x.ele(O).raw(n(p)).up():x=x.ele(O,p).up():x=y(x.ele(O),p).up());else typeof E=="object"?x=y(x.ele(O),E).up():typeof E=="string"&&I.options.cdata&&i(E)?x=x.ele(O).raw(n(E)).up():(E==null&&(E=""),x=x.ele(O,E.toString()).up());return x}}(this),v=t.create(S,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(v,u).end(this.options.renderOpts)},a}()}).call(Wa)});var Hh=P(xo=>{(function(t){t.parser=function(m,d){return new r(m,d)},t.SAXParser=r,t.SAXStream=f,t.createStream=l,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(m,d){if(!(this instanceof r))return new r(m,d);var k=this;n(k),k.q=k.c="",k.bufferCheckPosition=t.MAX_BUFFER_LENGTH,k.opt=d||{},k.opt.lowercase=k.opt.lowercase||k.opt.lowercasetags,k.looseCase=k.opt.lowercase?"toLowerCase":"toUpperCase",k.tags=[],k.closed=k.closedRoot=k.sawRoot=!1,k.tag=k.error=null,k.strict=!!m,k.noscript=!!(m||k.opt.noscript),k.state=g.BEGIN,k.strictEntities=k.opt.strictEntities,k.ENTITIES=k.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),k.attribList=[],k.opt.xmlns&&(k.ns=Object.create(x)),k.trackPosition=k.opt.position!==!1,k.trackPosition&&(k.position=k.line=k.column=0),X(k,"onready")}s(r,"SAXParser"),Object.create||(Object.create=function(m){function d(){}s(d,"F"),d.prototype=m;var k=new d;return k}),Object.keys||(Object.keys=function(m){var d=[];for(var k in m)m.hasOwnProperty(k)&&d.push(k);return d});function i(m){for(var d=Math.max(t.MAX_BUFFER_LENGTH,10),k=0,R=0,ee=e.length;R<ee;R++){var ye=m[e[R]].length;if(ye>d)switch(e[R]){case"textNode":ne(m);break;case"cdata":M(m,"oncdata",m.cdata),m.cdata="";break;case"script":M(m,"onscript",m.script),m.script="";break;default:Fe(m,"Max buffer length exceeded: "+e[R])}k=Math.max(k,ye)}var we=t.MAX_BUFFER_LENGTH-k;m.bufferCheckPosition=we+m.position}s(i,"checkBufferLength");function n(m){for(var d=0,k=e.length;d<k;d++)m[e[d]]=""}s(n,"clearBuffers");function o(m){ne(m),m.cdata!==""&&(M(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(M(m,"onscript",m.script),m.script="")}s(o,"flushBuffers"),r.prototype={end:function(){At(this)},write:Vr,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){o(this)}};var a;try{a=te("stream").Stream}catch{a=s(function(){},"Stream")}var u=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function l(m,d){return new f(m,d)}s(l,"createStream");function f(m,d){if(!(this instanceof f))return new f(m,d);a.apply(this),this._parser=new r(m,d),this.writable=!0,this.readable=!0;var k=this;this._parser.onend=function(){k.emit("end")},this._parser.onerror=function(R){k.emit("error",R),k._parser.error=null},this._decoder=null,u.forEach(function(R){Object.defineProperty(k,"on"+R,{get:function(){return k._parser["on"+R]},set:function(ee){if(!ee)return k.removeAllListeners(R),k._parser["on"+R]=ee,ee;k.on(R,ee)},enumerable:!0,configurable:!1})})}s(f,"SAXStream"),f.prototype=Object.create(a.prototype,{constructor:{value:f}}),f.prototype.write=function(m){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)){if(!this._decoder){var d=te("string_decoder").StringDecoder;this._decoder=new d("utf8")}m=this._decoder.write(m)}return this._parser.write(m.toString()),this.emit("data",m),!0},f.prototype.end=function(m){return m&&m.length&&this.write(m),this._parser.end(),!0},f.prototype.on=function(m,d){var k=this;return!k._parser["on"+m]&&u.indexOf(m)!==-1&&(k._parser["on"+m]=function(){var R=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);R.splice(0,0,m),k.emit.apply(k,R)}),a.prototype.on.call(k,m,d)};var y="[CDATA[",v="DOCTYPE",S="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",x={xml:S,xmlns:I},w=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function C(m){return m===" "||m===`
19
- `||m==="\r"||m===" "}s(C,"isWhitespace");function O(m){return m==='"'||m==="'"}s(O,"isQuote");function _(m){return m===">"||C(m)}s(_,"isAttribEnd");function T(m,d){return m.test(d)}s(T,"isMatch");function A(m,d){return!T(m,d)}s(A,"notMatch");var g=0;t.STATE={BEGIN:g++,BEGIN_WHITESPACE:g++,TEXT:g++,TEXT_ENTITY:g++,OPEN_WAKA:g++,SGML_DECL:g++,SGML_DECL_QUOTED:g++,DOCTYPE:g++,DOCTYPE_QUOTED:g++,DOCTYPE_DTD:g++,DOCTYPE_DTD_QUOTED:g++,COMMENT_STARTING:g++,COMMENT:g++,COMMENT_ENDING:g++,COMMENT_ENDED:g++,CDATA:g++,CDATA_ENDING:g++,CDATA_ENDING_2:g++,PROC_INST:g++,PROC_INST_BODY:g++,PROC_INST_ENDING:g++,OPEN_TAG:g++,OPEN_TAG_SLASH:g++,ATTRIB:g++,ATTRIB_NAME:g++,ATTRIB_NAME_SAW_WHITE:g++,ATTRIB_VALUE:g++,ATTRIB_VALUE_QUOTED:g++,ATTRIB_VALUE_CLOSED:g++,ATTRIB_VALUE_UNQUOTED:g++,ATTRIB_VALUE_ENTITY_Q:g++,ATTRIB_VALUE_ENTITY_U:g++,CLOSE_TAG:g++,CLOSE_TAG_SAW_WHITE:g++,SCRIPT:g++,SCRIPT_ENDING:g++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(m){var d=t.ENTITIES[m],k=typeof d=="number"?String.fromCharCode(d):d;t.ENTITIES[m]=k});for(var j in t.STATE)t.STATE[t.STATE[j]]=j;g=t.STATE;function X(m,d,k){m[d]&&m[d](k)}s(X,"emit");function M(m,d,k){m.textNode&&ne(m),X(m,d,k)}s(M,"emitNode");function ne(m){m.textNode=We(m.opt,m.textNode),m.textNode&&X(m,"ontext",m.textNode),m.textNode=""}s(ne,"closeText");function We(m,d){return m.trim&&(d=d.trim()),m.normalize&&(d=d.replace(/\s+/g," ")),d}s(We,"textopts");function Fe(m,d){return ne(m),m.trackPosition&&(d+=`
14
+ * `+n,Mt.util.error(new Error(n),{code:"MultipleValidationErrors",errors:this.errors})}else{if(this.errors.length===1)throw this.errors[0];return!0}},"validate"),fail:o(function(e,r){this.errors.push(Mt.util.error(new Error(r),{code:e}))},"fail"),validateStructure:o(function(e,r,i){if(e.isDocument)return!0;this.validateType(r,i,["object"],"structure");for(var n,s=0;e.required&&s<e.required.length;s++){n=e.required[s];var a=r[n];a==null&&this.fail("MissingRequiredParameter","Missing required key '"+n+"' in "+i)}for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var u=r[n],l=e.members[n];if(l!==void 0){var h=[i,n].join(".");this.validateMember(l,u,h)}else u!=null&&this.fail("UnexpectedParameter","Unexpected key '"+n+"' found in "+i)}return!0},"validateStructure"),validateMember:o(function(e,r,i){switch(e.type){case"structure":return this.validateStructure(e,r,i);case"list":return this.validateList(e,r,i);case"map":return this.validateMap(e,r,i);default:return this.validateScalar(e,r,i)}},"validateMember"),validateList:o(function(e,r,i){if(this.validateType(r,i,[Array])){this.validateRange(e,r.length,i,"list member count");for(var n=0;n<r.length;n++)this.validateMember(e.member,r[n],i+"["+n+"]")}},"validateList"),validateMap:o(function(e,r,i){if(this.validateType(r,i,["object"],"map")){var n=0;for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(this.validateMember(e.key,s,i+"[key='"+s+"']"),this.validateMember(e.value,r[s],i+"['"+s+"']"),n++);this.validateRange(e,n,i,"map member count")}},"validateMap"),validateScalar:o(function(e,r,i){switch(e.type){case null:case void 0:case"string":return this.validateString(e,r,i);case"base64":case"binary":return this.validatePayload(r,i);case"integer":case"float":return this.validateNumber(e,r,i);case"boolean":return this.validateType(r,i,["boolean"]);case"timestamp":return this.validateType(r,i,[Date,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,"number"],"Date object, ISO-8601 string, or a UNIX timestamp");default:return this.fail("UnkownType","Unhandled type "+e.type+" for "+i)}},"validateScalar"),validateString:o(function(e,r,i){var n=["string"];e.isJsonValue&&(n=n.concat(["number","object","boolean"])),r!==null&&this.validateType(r,i,n)&&(this.validateEnum(e,r,i),this.validateRange(e,r.length,i,"string length"),this.validatePattern(e,r,i),this.validateUri(e,r,i))},"validateString"),validateUri:o(function(e,r,i){e.location==="uri"&&r.length===0&&this.fail("UriParameterError",'Expected uri parameter to have length >= 1, but found "'+r+'" for '+i)},"validateUri"),validatePattern:o(function(e,r,i){this.validation.pattern&&e.pattern!==void 0&&(new RegExp(e.pattern).test(r)||this.fail("PatternMatchError",'Provided value "'+r+'" does not match regex pattern /'+e.pattern+"/ for "+i))},"validatePattern"),validateRange:o(function(e,r,i,n){this.validation.min&&e.min!==void 0&&r<e.min&&this.fail("MinRangeError","Expected "+n+" >= "+e.min+", but found "+r+" for "+i),this.validation.max&&e.max!==void 0&&r>e.max&&this.fail("MaxRangeError","Expected "+n+" <= "+e.max+", but found "+r+" for "+i)},"validateRange"),validateEnum:o(function(e,r,i){this.validation.enum&&e.enum!==void 0&&e.enum.indexOf(r)===-1&&this.fail("EnumError","Found string value of "+r+", but expected "+e.enum.join("|")+" for "+i)},"validateRange"),validateType:o(function(e,r,i,n){if(e==null)return!1;for(var s=!1,a=0;a<i.length;a++){if(typeof i[a]=="string"){if(typeof e===i[a])return!0}else if(i[a]instanceof RegExp){if((e||"").toString().match(i[a]))return!0}else{if(e instanceof i[a]||Mt.util.isType(e,i[a]))return!0;!n&&!s&&(i=i.slice()),i[a]=Mt.util.typeName(i[a])}s=!0}var u=n;u||(u=i.join(", ").replace(/,([^,]+)$/,", or$1"));var l=u.match(/^[aeiou]/i)?"n":"";return this.fail("InvalidParameterType","Expected "+r+" to be a"+l+" "+u),!1},"validateType"),validateNumber:o(function(e,r,i){if(r!=null){if(typeof r=="string"){var n=parseFloat(r);n.toString()===r&&(r=n)}this.validateType(r,i,["number"])&&this.validateRange(e,r,i,"numeric value")}},"validateNumber"),validatePayload:o(function(e,r){if(e!=null&&typeof e!="string"&&!(e&&typeof e.byteLength=="number")){if(Mt.util.isNode()){var i=Mt.util.stream.Stream;if(Mt.util.Buffer.isBuffer(e)||e instanceof i)return}else if(typeof Blob!==void 0&&e instanceof Blob)return;var n=["Buffer","Stream","File","Blob","ArrayBuffer","DataView"];if(e){for(var s=0;s<n.length;s++)if(Mt.util.isType(e,n[s])||Mt.util.typeName(e.constructor)===n[s])return}this.fail("InvalidParameterType","Expected "+r+" to be a string, Buffer, Stream, Blob, or typed array object")}},"validatePayload")})});var V=P((bk,Bl)=>{var gr={util:Oe()},Xy={};Xy.toString();Bl.exports=gr;gr.util.update(gr,{VERSION:"2.1252.0",Signers:{},Protocol:{Json:Bo(),Query:oa(),Rest:kn(),RestJson:ua(),RestXml:la()},XML:{Builder:Wc(),Parser:null},JSON:{Builder:Lo(),Parser:Fo()},Model:{Api:ma(),Operation:fa(),Shape:_n(),Paginator:da(),ResourceWaiter:ha()},apiLoader:Gc(),EndpointCache:Yc().EndpointCache});ga();il();nl();Jo();hl();vl();Nl();El();Fl();Wl();gr.events=new gr.SequentialExecutor;gr.util.memoizedProperty(gr,"endpointCache",function(){return new gr.EndpointCache(gr.config.endpointCacheSize)},!0)});var Ia=P(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.default=Yy;var Gy=Jy(te("crypto"));function Jy(t){return t&&t.__esModule?t:{default:t}}o(Jy,"_interopRequireDefault");function Yy(){return Gy.default.randomBytes(16)}o(Yy,"rng")});var ss=P(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.default=void 0;var Ul=[];for(jn=0;jn<256;++jn)Ul[jn]=(jn+256).toString(16).substr(1);var jn;function Qy(t,e){var r=e||0,i=Ul;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}o(Qy,"bytesToUuid");var $y=Qy;os.default=$y});var Hl=P(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.default=void 0;var Zy=zl(Ia()),ev=zl(ss());function zl(t){return t&&t.__esModule?t:{default:t}}o(zl,"_interopRequireDefault");var Vl,Oa,Ra=0,Da=0;function tv(t,e,r){var i=e&&r||0,n=e||[];t=t||{};var s=t.node||Vl,a=t.clockseq!==void 0?t.clockseq:Oa;if(s==null||a==null){var u=t.random||(t.rng||Zy.default)();s==null&&(s=Vl=[u[0]|1,u[1],u[2],u[3],u[4],u[5]]),a==null&&(a=Oa=(u[6]<<8|u[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),h=t.nsecs!==void 0?t.nsecs:Da+1,y=l-Ra+(h-Da)/1e4;if(y<0&&t.clockseq===void 0&&(a=a+1&16383),(y<0||l>Ra)&&t.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ra=l,Da=h,Oa=a,l+=122192928e5;var v=((l&268435455)*1e4+h)%4294967296;n[i++]=v>>>24&255,n[i++]=v>>>16&255,n[i++]=v>>>8&255,n[i++]=v&255;var S=l/4294967296*1e4&268435455;n[i++]=S>>>8&255,n[i++]=S&255,n[i++]=S>>>24&15|16,n[i++]=S>>>16&255,n[i++]=a>>>8|128,n[i++]=a&255;for(var I=0;I<6;++I)n[i+I]=s[I];return e||(0,ev.default)(n)}o(tv,"v1");var rv=tv;as.default=rv});var Pa=P(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.default=av;di.URL=di.DNS=void 0;var iv=nv(ss());function nv(t){return t&&t.__esModule?t:{default:t}}o(nv,"_interopRequireDefault");function ov(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(r){e.push(parseInt(r,16))}),e}o(ov,"uuidToBytes");function sv(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}o(sv,"stringToBytes");var jl="6ba7b810-9dad-11d1-80b4-00c04fd430c8";di.DNS=jl;var Kl="6ba7b811-9dad-11d1-80b4-00c04fd430c8";di.URL=Kl;function av(t,e,r){var i=o(function(n,s,a,u){var l=a&&u||0;if(typeof n=="string"&&(n=sv(n)),typeof s=="string"&&(s=ov(s)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(s)||s.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var h=r(s.concat(n));if(h[6]=h[6]&15|e,h[8]=h[8]&63|128,a)for(var y=0;y<16;++y)a[l+y]=h[y];return a||(0,iv.default)(h)},"generateUUID");try{i.name=t}catch{}return i.DNS=jl,i.URL=Kl,i}o(av,"_default")});var Xl=P(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.default=void 0;var uv=cv(te("crypto"));function cv(t){return t&&t.__esModule?t:{default:t}}o(cv,"_interopRequireDefault");function lv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),uv.default.createHash("md5").update(t).digest()}o(lv,"md5");var fv=lv;us.default=fv});var Jl=P(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.default=void 0;var dv=Gl(Pa()),hv=Gl(Xl());function Gl(t){return t&&t.__esModule?t:{default:t}}o(Gl,"_interopRequireDefault");var pv=(0,dv.default)("v3",48,hv.default),mv=pv;cs.default=mv});var Ql=P(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.default=void 0;var yv=Yl(Ia()),vv=Yl(ss());function Yl(t){return t&&t.__esModule?t:{default:t}}o(Yl,"_interopRequireDefault");function gv(t,e,r){var i=e&&r||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var n=t.random||(t.rng||yv.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var s=0;s<16;++s)e[i+s]=n[s];return e||(0,vv.default)(n)}o(gv,"v4");var Nv=gv;ls.default=Nv});var $l=P(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.default=void 0;var wv=Ev(te("crypto"));function Ev(t){return t&&t.__esModule?t:{default:t}}o(Ev,"_interopRequireDefault");function xv(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),wv.default.createHash("sha1").update(t).digest()}o(xv,"sha1");var Cv=xv;fs.default=Cv});var ef=P(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.default=void 0;var Sv=Zl(Pa()),Tv=Zl($l());function Zl(t){return t&&t.__esModule?t:{default:t}}o(Zl,"_interopRequireDefault");var bv=(0,Sv.default)("v5",80,Tv.default),Av=bv;ds.default=Av});var tf=P(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});Object.defineProperty(ji,"v1",{enumerable:!0,get:function(){return Iv.default}});Object.defineProperty(ji,"v3",{enumerable:!0,get:function(){return Ov.default}});Object.defineProperty(ji,"v4",{enumerable:!0,get:function(){return Rv.default}});Object.defineProperty(ji,"v5",{enumerable:!0,get:function(){return Dv.default}});var Iv=hs(Hl()),Ov=hs(Jl()),Rv=hs(Ql()),Dv=hs(ef());function hs(t){return t&&t.__esModule?t:{default:t}}o(hs,"_interopRequireDefault")});var Oe=P((Xk,rf)=>{var Ct,M={environment:"nodejs",engine:o(function(){if(M.isBrowser()&&typeof navigator<"u")return navigator.userAgent;var e=process.platform+"/"+process.version;return process.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+process.env.AWS_EXECUTION_ENV),e},"engine"),userAgent:o(function(){var e=M.environment,r="aws-sdk-"+e+"/"+V().VERSION;return e==="nodejs"&&(r+=" "+M.engine()),r},"userAgent"),uriEscape:o(function(e){var r=encodeURIComponent(e);return r=r.replace(/[^A-Za-z0-9_.~\-%]+/g,escape),r=r.replace(/[*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()}),r},"uriEscape"),uriEscapePath:o(function(e){var r=[];return M.arrayEach(e.split("/"),function(i){r.push(M.uriEscape(i))}),r.join("/")},"uriEscapePath"),urlParse:o(function(e){return M.url.parse(e)},"urlParse"),urlFormat:o(function(e){return M.url.format(e)},"urlFormat"),queryStringParse:o(function(e){return M.querystring.parse(e)},"queryStringParse"),queryParamsToString:o(function(e){var r=[],i=M.uriEscape,n=Object.keys(e).sort();return M.arrayEach(n,function(s){var a=e[s],u=i(s),l=u+"=";if(Array.isArray(a)){var h=[];M.arrayEach(a,function(y){h.push(i(y))}),l=u+"="+h.sort().join("&"+u+"=")}else a!=null&&(l=u+"="+i(a));r.push(l)}),r.join("&")},"queryParamsToString"),readFileSync:o(function(e){return M.isBrowser()?null:te("fs").readFileSync(e,"utf-8")},"readFileSync"),base64:{encode:o(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 encode number "+e));if(e===null||typeof e>"u")return e;var r=M.buffer.toBuffer(e);return r.toString("base64")},"encode64"),decode:o(function(e){if(typeof e=="number")throw M.error(new Error("Cannot base64 decode number "+e));return e===null||typeof e>"u"?e:M.buffer.toBuffer(e,"base64")},"decode64")},buffer:{toBuffer:function(t,e){return typeof M.Buffer.from=="function"&&M.Buffer.from!==Uint8Array.from?M.Buffer.from(t,e):new M.Buffer(t,e)},alloc:function(t,e,r){if(typeof t!="number")throw new Error("size passed to alloc must be a number.");if(typeof M.Buffer.alloc=="function")return M.Buffer.alloc(t,e,r);var i=new M.Buffer(t);return e!==void 0&&typeof i.fill=="function"&&i.fill(e,void 0,void 0,r),i},toStream:o(function(e){M.Buffer.isBuffer(e)||(e=M.buffer.toBuffer(e));var r=new M.stream.Readable,i=0;return r._read=function(n){if(i>=e.length)return r.push(null);var s=i+n;s>e.length&&(s=e.length),r.push(e.slice(i,s)),i=s},r},"toStream"),concat:function(t){var e=0,r=0,i=null,n;for(n=0;n<t.length;n++)e+=t[n].length;for(i=M.buffer.alloc(e),n=0;n<t.length;n++)t[n].copy(i,r),r+=t[n].length;return i}},string:{byteLength:o(function(e){if(e==null)return 0;if(typeof e=="string"&&(e=M.buffer.toBuffer(e)),typeof e.byteLength=="number")return e.byteLength;if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.path=="string")return te("fs").lstatSync(e.path).size;throw M.error(new Error("Cannot determine length of "+e),{object:e})},"byteLength"),upperFirst:o(function(e){return e[0].toUpperCase()+e.substr(1)},"upperFirst"),lowerFirst:o(function(e){return e[0].toLowerCase()+e.substr(1)},"lowerFirst")},ini:{parse:o(function(e){var r,i={};return M.arrayEach(e.split(/\r?\n/),function(n){n=n.split(/(^|\s)[;#]/)[0].trim();var s=n[0]==="["&&n[n.length-1]==="]";if(s){if(r=n.substring(1,n.length-1),r==="__proto__"||r.split(/\s/)[1]==="__proto__")throw M.error(new Error("Cannot load profile name '"+r+"' from shared ini file."))}else if(r){var a=n.indexOf("="),u=0,l=n.length-1,h=a!==-1&&a!==u&&a!==l;if(h){var y=n.substring(0,a).trim(),v=n.substring(a+1).trim();i[r]=i[r]||{},i[r][y]=v}}}),i},"string")},fn:{noop:function(){},callback:function(t){if(t)throw t},makeAsync:o(function(e,r){return r&&r<=e.length?e:function(){var i=Array.prototype.slice.call(arguments,0),n=i.pop(),s=e.apply(null,i);n(s)}},"makeAsync")},date:{getDate:o(function(){return Ct||(Ct=V()),Ct.config.systemClockOffset?new Date(new Date().getTime()+Ct.config.systemClockOffset):new Date},"getDate"),iso8601:o(function(e){return e===void 0&&(e=M.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},"iso8601"),rfc822:o(function(e){return e===void 0&&(e=M.date.getDate()),e.toUTCString()},"rfc822"),unixTimestamp:o(function(e){return e===void 0&&(e=M.date.getDate()),e.getTime()/1e3},"unixTimestamp"),from:o(function(e){return typeof e=="number"?new Date(e*1e3):new Date(e)},"format"),format:o(function(e,r){return r||(r="iso8601"),M.date[r](M.date.from(e))},"format"),parseTimestamp:o(function(e){if(typeof e=="number")return new Date(e*1e3);if(e.match(/^\d+$/))return new Date(e*1e3);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw M.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})},"parseTimestamp")},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:o(function(e){var r=M.crypto.crc32Table,i=-1;typeof e=="string"&&(e=M.buffer.toBuffer(e));for(var n=0;n<e.length;n++){var s=e.readUInt8(n);i=i>>>8^r[(i^s)&255]}return(i^-1)>>>0},"crc32"),hmac:o(function(e,r,i,n){return i||(i="binary"),i==="buffer"&&(i=void 0),n||(n="sha256"),typeof r=="string"&&(r=M.buffer.toBuffer(r)),M.crypto.lib.createHmac(n,e).update(r).digest(i)},"hmac"),md5:o(function(e,r,i){return M.crypto.hash("md5",e,r,i)},"md5"),sha256:o(function(e,r,i){return M.crypto.hash("sha256",e,r,i)},"sha256"),hash:function(t,e,r,i){var n=M.crypto.createHash(t);r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=M.buffer.toBuffer(e));var s=M.arraySliceFn(e),a=M.Buffer.isBuffer(e);if(M.isBrowser()&&typeof ArrayBuffer<"u"&&e&&e.buffer instanceof ArrayBuffer&&(a=!0),i&&typeof e=="object"&&typeof e.on=="function"&&!a)e.on("data",function(v){n.update(v)}),e.on("error",function(v){i(v)}),e.on("end",function(){i(null,n.digest(r))});else if(i&&s&&!a&&typeof FileReader<"u"){var u=0,l=1024*512,h=new FileReader;h.onerror=function(){i(new Error("Failed to read data."))},h.onload=function(){var v=new M.Buffer(new Uint8Array(h.result));n.update(v),u+=v.length,h._continueReading()},h._continueReading=function(){if(u>=e.size){i(null,n.digest(r));return}var v=u+l;v>e.size&&(v=e.size),h.readAsArrayBuffer(s.call(e,u,v))},h._continueReading()}else{M.isBrowser()&&typeof e=="object"&&!a&&(e=new M.Buffer(new Uint8Array(e)));var y=n.update(e).digest(r);return i&&i(null,y),y}},toHex:o(function(e){for(var r=[],i=0;i<e.length;i++)r.push(("0"+e.charCodeAt(i).toString(16)).substr(-2,2));return r.join("")},"toHex"),createHash:o(function(e){return M.crypto.lib.createHash(e)},"createHash")},abort:{},each:o(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,i,e[i]);if(n===M.abort)break}},"each"),arrayEach:o(function(e,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r.call(this,e[i],parseInt(i,10));if(n===M.abort)break}},"arrayEach"),update:o(function(e,r){return M.each(r,o(function(n,s){e[n]=s},"iterator")),e},"update"),merge:o(function(e,r){return M.update(M.copy(e),r)},"merge"),copy:o(function(e){if(e==null)return e;var r={};for(var i in e)r[i]=e[i];return r},"copy"),isEmpty:o(function(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!1;return!0},"isEmpty"),arraySliceFn:o(function(e){var r=e.slice||e.webkitSlice||e.mozSlice;return typeof r=="function"?r:null},"arraySliceFn"),isType:o(function(e,r){return typeof r=="function"&&(r=M.typeName(r)),Object.prototype.toString.call(e)==="[object "+r+"]"},"isType"),typeName:o(function(e){if(Object.prototype.hasOwnProperty.call(e,"name"))return e.name;var r=e.toString(),i=r.match(/^\s*function (.+)\(/);return i?i[1]:r},"typeName"),error:o(function(e,r){var i=null;return typeof e.message=="string"&&e.message!==""&&(typeof r=="string"||r&&r.message)&&(i=M.copy(e),i.message=e.message),e.message=e.message||null,typeof r=="string"?e.message=r:typeof r=="object"&&r!==null&&(M.update(e,r),r.message&&(e.message=r.message),(r.code||r.name)&&(e.code=r.code||r.name),r.stack&&(e.stack=r.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=String(r&&r.name||e.name||e.code||"Error"),e.time=new Date,i&&(e.originalError=i),e},"error"),inherit:o(function(e,r){var i=null;if(r===void 0)r=e,e=Object,i={};else{var n=o(function(){},"ConstructorWrapper");n.prototype=e.prototype,i=new n}return r.constructor===Object&&(r.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),r.constructor.prototype=i,M.update(r.constructor.prototype,r),r.constructor.__super__=e,r.constructor},"inherit"),mixin:o(function(){for(var e=arguments[0],r=1;r<arguments.length;r++)for(var i in arguments[r].prototype){var n=arguments[r].prototype[i];i!=="constructor"&&(e.prototype[i]=n)}return e},"mixin"),hideProperties:o(function(e,r){typeof Object.defineProperty=="function"&&M.arrayEach(r,function(i){Object.defineProperty(e,i,{enumerable:!1,writable:!0,configurable:!0})})},"hideProperties"),property:o(function(e,r,i,n,s){var a={configurable:!0,enumerable:n!==void 0?n:!0};typeof i=="function"&&!s?a.get=i:(a.value=i,a.writable=!0),Object.defineProperty(e,r,a)},"property"),memoizedProperty:o(function(e,r,i,n){var s=null;M.property(e,r,function(){return s===null&&(s=i()),s},n)},"memoizedProperty"),hoistPayloadMember:o(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i],s=n.output;if(s.payload&&!n.hasEventOutput){var a=s.members[s.payload],u=e.data[s.payload];a.type==="structure"&&M.each(u,function(l,h){M.property(e.data,l,h,!1)})}},"hoistPayloadMember"),computeSha256:o(function(e,r){if(M.isNode()){var i=M.stream.Stream,n=te("fs");if(typeof i=="function"&&e instanceof i)if(typeof e.path=="string"){var s={};typeof e.start=="number"&&(s.start=e.start),typeof e.end=="number"&&(s.end=e.end),e=n.createReadStream(e.path,s)}else return r(new Error("Non-file stream objects are not supported with SigV4"))}M.crypto.sha256(e,"hex",function(a,u){a?r(a):r(null,u)})},"computeSha256"),isClockSkewed:o(function(e){if(e)return M.property(Ct.config,"isClockSkewed",Math.abs(new Date().getTime()-e)>=3e5,!1),Ct.config.isClockSkewed},"isClockSkewed"),applyClockOffset:o(function(e){e&&(Ct.config.systemClockOffset=e-new Date().getTime())},"applyClockOffset"),extractRequestId:o(function(e){var r=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!r&&e.data&&e.data.ResponseMetadata&&(r=e.data.ResponseMetadata.RequestId),r&&(e.requestId=r),e.error&&(e.error.requestId=r)},"extractRequestId"),addPromises:o(function(e,r){var i=!1;r===void 0&&Ct&&Ct.config&&(r=Ct.config.getPromisesDependency()),r===void 0&&typeof Promise<"u"&&(r=Promise),typeof r!="function"&&(i=!0),Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var s=e[n];i?s.deletePromisesFromClass&&s.deletePromisesFromClass():s.addPromisesToClass&&s.addPromisesToClass(r)}},"addPromises"),promisifyMethod:o(function(e,r){return o(function(){var n=this,s=Array.prototype.slice.call(arguments);return new r(function(a,u){s.push(function(l,h){l?u(l):a(h)}),n[e].apply(n,s)})},"promise")},"promisifyMethod"),isDualstackAvailable:o(function(e){if(!e)return!1;var r=pa();return typeof e!="string"&&(e=e.serviceIdentifier),typeof e!="string"||!r.hasOwnProperty(e)?!1:!!r[e].dualstackAvailable},"isDualstackAvailable"),calculateRetryDelay:o(function(e,r,i){r||(r={});var n=r.customBackoff||null;if(typeof n=="function")return n(e,i);var s=typeof r.base=="number"?r.base:100,a=Math.random()*(Math.pow(2,e)*s);return a},"calculateRetryDelay"),handleRequestWithRetries:o(function(e,r,i){r||(r={});var n=Ct.HttpClient.getInstance(),s=r.httpOptions||{},a=0,u=o(function(h){var y=r.maxRetries||0;if(h&&h.code==="TimeoutError"&&(h.retryable=!0),h&&h.retryable&&a<y){var v=M.calculateRetryDelay(a,r.retryDelayOptions,h);if(v>=0){a++,setTimeout(l,v+(h.retryAfter||0));return}}i(h)},"errCallback"),l=o(function(){var h="";n.handleRequest(e,s,function(y){y.on("data",function(v){h+=v.toString()}),y.on("end",function(){var v=y.statusCode;if(v<300)i(null,h);else{var S=parseInt(y.headers["retry-after"],10)*1e3||0,I=M.error(new Error,{statusCode:v,retryable:v>=500||v===429});S&&I.retryable&&(I.retryAfter=S),u(I)}})},u)},"sendRequest");Ct.util.defer(l)},"handleRequestWithRetries"),uuid:{v4:o(function(){return tf().v4()},"uuidV4")},convertPayloadToString:o(function(e){var r=e.request,i=r.operation,n=r.service.api.operations[i].output||{};n.payload&&e.data[n.payload]&&(e.data[n.payload]=e.data[n.payload].toString())},"convertPayloadToString"),defer:o(function(e){typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0)},"defer"),getRequestPayloadShape:o(function(e){var r=e.service.api.operations;if(r){var i=(r||{})[e.operation];if(!(!i||!i.input||!i.input.payload))return i.input.members[i.input.payload]}},"getRequestPayloadShape"),getProfilesFromSharedConfig:o(function(e,r){var i={},n={};if(process.env[M.configOptInEnv])var n=e.loadFrom({isConfig:!0,filename:process.env[M.sharedConfigFileEnv]});var s={};try{var s=e.loadFrom({filename:r||process.env[M.configOptInEnv]&&process.env[M.sharedCredentialsFileEnv]})}catch(h){if(!process.env[M.configOptInEnv])throw h}for(var a=0,u=Object.keys(n);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},n[u[a]]);for(var a=0,u=Object.keys(s);a<u.length;a++)i[u[a]]=l(i[u[a]]||{},s[u[a]]);return i;function l(h,y){for(var v=0,S=Object.keys(y);v<S.length;v++)h[S[v]]=y[S[v]];return h}},"getProfilesFromSharedConfig"),ARN:{validate:o(function(e){return e&&e.indexOf("arn:")===0&&e.split(":").length>=6},"validateARN"),parse:o(function(e){var r=e.split(":");return{partition:r[1],service:r[2],region:r[3],accountId:r[4],resource:r.slice(5).join(":")}},"parseARN"),build:o(function(e){if(e.service===void 0||e.region===void 0||e.accountId===void 0||e.resource===void 0)throw M.error(new Error("Input ARN object is invalid"));return"arn:"+(e.partition||"aws")+":"+e.service+":"+e.region+":"+e.accountId+":"+e.resource},"buildARN")},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};rf.exports=M});var af=P((Jk,sf)=>{var Pv=V().util,nf=te("stream").Transform,of=Pv.buffer.alloc;function Kn(t){nf.call(this,t),this.currentMessageTotalLength=0,this.currentMessagePendingLength=0,this.currentMessage=null,this.messageLengthBuffer=null}o(Kn,"EventMessageChunkerStream");Kn.prototype=Object.create(nf.prototype);Kn.prototype._transform=function(t,e,r){for(var i=t.length,n=0;n<i;){if(!this.currentMessage){var s=i-n;this.messageLengthBuffer||(this.messageLengthBuffer=of(4));var a=Math.min(4-this.currentMessagePendingLength,s);if(t.copy(this.messageLengthBuffer,this.currentMessagePendingLength,n,n+a),this.currentMessagePendingLength+=a,n+=a,this.currentMessagePendingLength<4)break;this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)),this.messageLengthBuffer=null}var u=Math.min(this.currentMessageTotalLength-this.currentMessagePendingLength,i-n);t.copy(this.currentMessage,this.currentMessagePendingLength,n,n+u),this.currentMessagePendingLength+=u,n+=u,this.currentMessageTotalLength&&this.currentMessageTotalLength===this.currentMessagePendingLength&&(this.push(this.currentMessage),this.currentMessage=null,this.currentMessageTotalLength=0,this.currentMessagePendingLength=0)}r()};Kn.prototype._flush=function(t){this.currentMessageTotalLength?this.currentMessageTotalLength===this.currentMessagePendingLength?t(null,this.currentMessage):t(new Error("Truncated event message received.")):t()};Kn.prototype.allocateMessage=function(t){if(typeof t!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+t);this.currentMessageTotalLength=t,this.currentMessagePendingLength=4,this.currentMessage=of(t),this.currentMessage.writeUInt32BE(t,0)};sf.exports={EventMessageChunkerStream:Kn}});var ff=P((Qk,lf)=>{var uf=V().util,_v=uf.buffer.toBuffer;function Xn(t){if(t.length!==8)throw new Error("Int64 buffers must be exactly 8 bytes");uf.Buffer.isBuffer(t)||(t=_v(t)),this.bytes=t}o(Xn,"Int64");Xn.fromNumber=function(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var e=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)e[r]=i;return t<0&&cf(e),new Xn(e)};Xn.prototype.valueOf=function(){var t=this.bytes.slice(0),e=t[0]&128;return e&&cf(t),parseInt(t.toString("hex"),16)*(e?-1:1)};Xn.prototype.toString=function(){return String(this.valueOf())};function cf(t){for(var e=0;e<8;e++)t[e]^=255;for(var e=7;e>-1&&(t[e]++,t[e]===0);e--);}o(cf,"negate");lf.exports={Int64:Xn}});var pf=P((Zk,hf)=>{var ps=V().util,qv=ps.buffer.toBuffer,df=4,ms=df*2,Gn=4,kv=ms+Gn*2;function Lv(t){if(ps.Buffer.isBuffer(t)||(t=qv(t)),t.length<kv)throw new Error("Provided message too short to accommodate event stream message overhead");if(t.length!==t.readUInt32BE(0))throw new Error("Reported message length does not match received message length");var e=t.readUInt32BE(ms);if(e!==ps.crypto.crc32(t.slice(0,ms)))throw new Error("The prelude checksum specified in the message ("+e+") does not match the calculated CRC32 checksum.");var r=t.readUInt32BE(t.length-Gn);if(r!==ps.crypto.crc32(t.slice(0,t.length-Gn)))throw new Error("The message checksum did not match the expected value of "+r);var i=ms+Gn,n=i+t.readUInt32BE(df);return{headers:t.slice(i,n),body:t.slice(n,t.length-Gn)}}o(Lv,"splitMessage");hf.exports={splitMessage:Lv}});var gf=P((tL,vf)=>{var mf=ff().Int64,Mv=pf().splitMessage,yf="boolean",Fv="byte",Wv="short",Bv="integer",Uv="long",Vv="binary",zv="string",Hv="timestamp",jv="uuid";function Kv(t){for(var e={},r=0;r<t.length;){var i=t.readUInt8(r++),n=t.slice(r,r+i).toString();switch(r+=i,t.readUInt8(r++)){case 0:e[n]={type:yf,value:!0};break;case 1:e[n]={type:yf,value:!1};break;case 2:e[n]={type:Fv,value:t.readInt8(r++)};break;case 3:e[n]={type:Wv,value:t.readInt16BE(r)},r+=2;break;case 4:e[n]={type:Bv,value:t.readInt32BE(r)},r+=4;break;case 5:e[n]={type:Uv,value:new mf(t.slice(r,r+8))},r+=8;break;case 6:var s=t.readUInt16BE(r);r+=2,e[n]={type:Vv,value:t.slice(r,r+s)},r+=s;break;case 7:var a=t.readUInt16BE(r);r+=2,e[n]={type:zv,value:t.slice(r,r+a).toString()},r+=a;break;case 8:e[n]={type:Hv,value:new Date(new mf(t.slice(r,r+8)).valueOf())},r+=8;break;case 9:var u=t.slice(r,r+16).toString("hex");r+=16,e[n]={type:jv,value:u.substr(0,8)+"-"+u.substr(8,4)+"-"+u.substr(12,4)+"-"+u.substr(16,4)+"-"+u.substr(20)};break;default:throw new Error("Unrecognized header type tag")}}return e}o(Kv,"parseHeaders");function Xv(t){var e=Mv(t);return{headers:Kv(e.headers),body:e.body}}o(Xv,"parseMessage");vf.exports={parseMessage:Xv}});var _a=P((iL,Nf)=>{var Gv=gf().parseMessage;function Jv(t,e,r){var i=Gv(e),n=i.headers[":message-type"];if(n){if(n.value==="error")throw Yv(i);if(n.value!=="event")return}var s=i.headers[":event-type"],a=r.members[s.value];if(a){var u={},l=a.eventPayloadMemberName;if(l){var h=a.members[l];h.type==="binary"?u[l]=i.body:u[l]=t.parse(i.body.toString(),h)}for(var y=a.eventHeaderMemberNames,v=0;v<y.length;v++){var S=y[v];i.headers[S]&&(u[S]=a.members[S].toType(i.headers[S].value))}var I={};return I[s.value]=u,I}}o(Jv,"parseEvent");function Yv(t){var e=t.headers[":error-code"],r=t.headers[":error-message"],i=new Error(r.value||r);return i.code=i.name=e.value||e,i}o(Yv,"parseError");Nf.exports={parseEvent:Jv}});var xf=P((oL,Ef)=>{var wf=te("stream").Transform,Qv=_a().parseEvent;function qa(t){t=t||{},t.readableObjectMode=!0,wf.call(this,t),this._readableState.objectMode=!0,this.parser=t.parser,this.eventStreamModel=t.eventStreamModel}o(qa,"EventUnmarshallerStream");qa.prototype=Object.create(wf.prototype);qa.prototype._transform=function(t,e,r){try{var i=Qv(this.parser,t,this.eventStreamModel);return this.push(i),r()}catch(n){r(n)}};Ef.exports={EventUnmarshallerStream:qa}});var Sf=P((aL,Cf)=>{var $v=af().EventMessageChunkerStream,Zv=xf().EventUnmarshallerStream;function eg(t,e,r){var i=new Zv({parser:e,eventStreamModel:r}),n=new $v;return t.pipe(n).pipe(i),t.on("error",function(s){n.emit("error",s)}),n.on("error",function(s){i.emit("error",s)}),i}o(eg,"createEventStream");Cf.exports={createEventStream:eg}});var bf=P((cL,Tf)=>{function tg(t){for(var e=[],r=0;r<t.length;){var i=t.readInt32BE(r),n=t.slice(r,i+r);r+=i,e.push(n)}return e}o(tg,"eventMessageChunker");Tf.exports={eventMessageChunker:tg}});var If=P((fL,Af)=>{var rg=bf().eventMessageChunker,ig=_a().parseEvent;function ng(t,e,r){for(var i=rg(t),n=[],s=0;s<i.length;s++)n.push(ig(e,i[s],r));return n}o(ng,"createEventStream");Af.exports={createEventStream:ng}});var Rf=P((hL,Of)=>{Of.exports={now:o(function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6},"now")}});var Pf=P((mL,Df)=>{var og=V().util,sg=te("dgram"),ag=og.buffer.toBuffer,ug=1024*8;function hi(t){t=t||{},this.enabled=t.enabled||!1,this.port=t.port||31e3,this.clientId=t.clientId||"",this.address=t.host||"127.0.0.1",this.clientId.length>255&&(this.clientId=this.clientId.substr(0,255)),this.messagesInFlight=0}o(hi,"Publisher");hi.prototype.fieldsToTrim={UserAgent:256,SdkException:128,SdkExceptionMessage:512,AwsException:128,AwsExceptionMessage:512,FinalSdkException:128,FinalSdkExceptionMessage:512,FinalAwsException:128,FinalAwsExceptionMessage:512};hi.prototype.trimFields=function(t){for(var e=Object.keys(this.fieldsToTrim),r=0,i=e.length;r<i;r++){var n=e[r];if(t.hasOwnProperty(n)){var s=this.fieldsToTrim[n],a=t[n];a&&a.length>s&&(t[n]=a.substr(0,s))}}return t};hi.prototype.eventHandler=function(t){t.ClientId=this.clientId,this.trimFields(t);var e=ag(JSON.stringify(t));!this.enabled||e.length>ug||this.publishDatagram(e)};hi.prototype.publishDatagram=function(t){var e=this,r=this.getClient();this.messagesInFlight++,this.client.send(t,0,t.length,this.port,this.address,function(i,n){--e.messagesInFlight<=0&&e.destroyClient()})};hi.prototype.getClient=function(){return this.client||(this.client=sg.createSocket("udp4")),this.client};hi.prototype.destroyClient=function(){this.client&&(this.client.close(),this.client=void 0)};Df.exports={Publisher:hi}});var kf=P((vL,qf)=>{var ka=V();function cg(){var t={port:void 0,clientId:void 0,enabled:void 0,host:void 0};return lg(t)||fg(t),_f(t)}o(cg,"resolveMonitoringConfig");function lg(t){return t.port=t.port||process.env.AWS_CSM_PORT,t.enabled=t.enabled||process.env.AWS_CSM_ENABLED,t.clientId=t.clientId||process.env.AWS_CSM_CLIENT_ID,t.host=t.host||process.env.AWS_CSM_HOST,t.port&&t.enabled&&t.clientId&&t.host||["false","0"].indexOf(t.enabled)>=0}o(lg,"fromEnvironment");function fg(t){var e;try{var r=ka.util.iniLoader.loadFrom({isConfig:!0,filename:process.env[ka.util.sharedConfigFileEnv]}),e=r[process.env.AWS_PROFILE||ka.util.defaultProfile]}catch{return!1}return e?(t.port=t.port||e.csm_port,t.enabled=t.enabled||e.csm_enabled,t.clientId=t.clientId||e.csm_client_id,t.host=t.host||e.csm_host,t.port&&t.enabled&&t.clientId&&t.host):t}o(fg,"fromConfigFile");function _f(t){var e=["false","0",void 0];return!t.enabled||e.indexOf(t.enabled.toLowerCase())>=0?t.enabled=!1:t.enabled=!0,t.port=t.port?parseInt(t.port,10):void 0,t}o(_f,"toJSType");qf.exports=cg});var La=P((NL,Ff)=>{var Ki=V(),Lf=te("os"),dg=te("path");function Mf(t){return Ki.util.ini.parse(Ki.util.readFileSync(t))}o(Mf,"parseFile");function hg(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)||Object.defineProperty(e,r.replace(/^profile\s/,""),{value:t[r],enumerable:!0})}),e}o(hg,"getProfiles");function pg(t){var e={};return Object.keys(t).forEach(function(r){/^sso-session\s/.test(r)&&Object.defineProperty(e,r.replace(/^sso-session\s/,""),{value:t[r],enumerable:!0})}),e}o(pg,"getSsoSessions");Ki.IniLoader=Ki.util.inherit({constructor:o(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"IniLoader"),clearCachedFiles:o(function(){this.resolvedProfiles={},this.resolvedSsoSessions={}},"clearCachedFiles"),loadFrom:o(function(e){e=e||{};var r=e.isConfig===!0,i=e.filename||this.getDefaultFilePath(r);if(!this.resolvedProfiles[i]){var n=Mf(i);r?Object.defineProperty(this.resolvedProfiles,i,{value:hg(n)}):Object.defineProperty(this.resolvedProfiles,i,{value:n})}return this.resolvedProfiles[i]},"loadFrom"),loadSsoSessionsFrom:o(function(e){e=e||{};var r=e.filename||this.getDefaultFilePath(!0);if(!this.resolvedSsoSessions[r]){var i=Mf(r);Object.defineProperty(this.resolvedSsoSessions,r,{value:pg(i)})}return this.resolvedSsoSessions[r]},"loadSsoSessionsFrom"),getDefaultFilePath:o(function(e){return dg.join(this.getHomeDir(),".aws",e?"config":"credentials")},"getDefaultFilePath"),getHomeDir:o(function(){var e=process.env,r=e.HOME||e.USERPROFILE||(e.HOMEPATH?(e.HOMEDRIVE||"C:/")+e.HOMEPATH:null);if(r)return r;if(typeof Lf.homedir=="function")return Lf.homedir();throw Ki.util.error(new Error("Cannot load credentials, HOME path not set"))},"getHomeDir")});var mg=Ki.IniLoader;Ff.exports={IniLoader:mg}});var Bf=P((EL,Wf)=>{var yg=La().IniLoader;Wf.exports.iniLoader=new yg});var Vf=P((xL,Uf)=>{var Jn=V();function Ma(t,e){if(typeof t=="string"){if(["legacy","regional"].indexOf(t.toLowerCase())>=0)return t.toLowerCase();throw Jn.util.error(new Error,e)}}o(Ma,"validateRegionalEndpointsFlagValue");function vg(t,e){t=t||{};var r;if(t[e.clientConfig]&&(r=Ma(t[e.clientConfig],{code:"InvalidConfiguration",message:'invalid "'+e.clientConfig+'" configuration. Expect "legacy" or "regional". Got "'+t[e.clientConfig]+'".'}),r)||!Jn.util.isNode())return r;if(Object.prototype.hasOwnProperty.call(process.env,e.env)){var i=process.env[e.env];if(r=Ma(i,{code:"InvalidEnvironmentalVariable",message:"invalid "+e.env+' environmental variable. Expect "legacy" or "regional". Got "'+process.env[e.env]+'".'}),r)return r}var n={};try{var s=Jn.util.getProfilesFromSharedConfig(Jn.util.iniLoader);n=s[process.env.AWS_PROFILE||Jn.util.defaultProfile]}catch{}if(n&&Object.prototype.hasOwnProperty.call(n,e.sharedConfig)){var a=n[e.sharedConfig];if(r=Ma(a,{code:"InvalidConfiguration",message:"invalid "+e.sharedConfig+' profile config. Expect "legacy" or "regional". Got "'+n[e.sharedConfig]+'".'}),r)return r}return r}o(vg,"resolveRegionalEndpointsFlag");Uf.exports=vg});var zf=P(()=>{var ys=V(),gg=Vf(),Ng="AWS_STS_REGIONAL_ENDPOINTS",wg="sts_regional_endpoints";ys.util.update(ys.STS.prototype,{credentialsFrom:o(function(e,r){return e?(r||(r=new ys.TemporaryCredentials),r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretAccessKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration,r):null},"credentialsFrom"),assumeRoleWithWebIdentity:o(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,r)},"assumeRoleWithWebIdentity"),assumeRoleWithSAML:o(function(e,r){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,r)},"assumeRoleWithSAML"),setupRequestListeners:o(function(e){e.addListener("validate",this.optInRegionalEndpoint,!0)},"setupRequestListeners"),optInRegionalEndpoint:o(function(e){var r=e.service,i=r.config;if(i.stsRegionalEndpoints=gg(r._originalConfig,{env:Ng,sharedConfig:wg,clientConfig:"stsRegionalEndpoints"}),i.stsRegionalEndpoints==="regional"&&r.isGlobalEndpoint){if(!i.region)throw ys.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var n=i.endpoint.indexOf(".amazonaws.com"),s=i.endpoint.substring(0,n)+"."+i.region+i.endpoint.substring(n);e.httpRequest.updateEndpoint(s),e.httpRequest.region=i.region}},"optInRegionalEndpoint")})});var Hf=P((AL,Eg)=>{Eg.exports={version:"2.0",metadata:{apiVersion:"2011-06-15",endpointPrefix:"sts",globalEndpoint:"sts.amazonaws.com",protocol:"query",serviceAbbreviation:"AWS STS",serviceFullName:"AWS Security Token Service",serviceId:"STS",signatureVersion:"v4",uid:"sts-2011-06-15",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/"},operations:{AssumeRole:{input:{type:"structure",required:["RoleArn","RoleSessionName"],members:{RoleArn:{},RoleSessionName:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"},Tags:{shape:"S8"},TransitiveTagKeys:{type:"list",member:{}},ExternalId:{},SerialNumber:{},TokenCode:{},SourceIdentity:{}}},output:{resultWrapper:"AssumeRoleResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},SourceIdentity:{}}}},AssumeRoleWithSAML:{input:{type:"structure",required:["RoleArn","PrincipalArn","SAMLAssertion"],members:{RoleArn:{},PrincipalArn:{},SAMLAssertion:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithSAMLResult",type:"structure",members:{Credentials:{shape:"Si"},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Subject:{},SubjectType:{},Issuer:{},Audience:{},NameQualifier:{},SourceIdentity:{}}}},AssumeRoleWithWebIdentity:{input:{type:"structure",required:["RoleArn","RoleSessionName","WebIdentityToken"],members:{RoleArn:{},RoleSessionName:{},WebIdentityToken:{},ProviderId:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithWebIdentityResult",type:"structure",members:{Credentials:{shape:"Si"},SubjectFromWebIdentityToken:{},AssumedRoleUser:{shape:"Sn"},PackedPolicySize:{type:"integer"},Provider:{},Audience:{},SourceIdentity:{}}}},DecodeAuthorizationMessage:{input:{type:"structure",required:["EncodedMessage"],members:{EncodedMessage:{}}},output:{resultWrapper:"DecodeAuthorizationMessageResult",type:"structure",members:{DecodedMessage:{}}}},GetAccessKeyInfo:{input:{type:"structure",required:["AccessKeyId"],members:{AccessKeyId:{}}},output:{resultWrapper:"GetAccessKeyInfoResult",type:"structure",members:{Account:{}}}},GetCallerIdentity:{input:{type:"structure",members:{}},output:{resultWrapper:"GetCallerIdentityResult",type:"structure",members:{UserId:{},Account:{},Arn:{}}}},GetFederationToken:{input:{type:"structure",required:["Name"],members:{Name:{},Policy:{},PolicyArns:{shape:"S4"},DurationSeconds:{type:"integer"},Tags:{shape:"S8"}}},output:{resultWrapper:"GetFederationTokenResult",type:"structure",members:{Credentials:{shape:"Si"},FederatedUser:{type:"structure",required:["FederatedUserId","Arn"],members:{FederatedUserId:{},Arn:{}}},PackedPolicySize:{type:"integer"}}}},GetSessionToken:{input:{type:"structure",members:{DurationSeconds:{type:"integer"},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"GetSessionTokenResult",type:"structure",members:{Credentials:{shape:"Si"}}}}},shapes:{S4:{type:"list",member:{type:"structure",members:{arn:{}}}},S8:{type:"list",member:{type:"structure",required:["Key","Value"],members:{Key:{},Value:{}}}},Si:{type:"structure",required:["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],members:{AccessKeyId:{},SecretAccessKey:{},SessionToken:{},Expiration:{type:"timestamp"}}},Sn:{type:"structure",required:["AssumedRoleId","Arn"],members:{AssumedRoleId:{},Arn:{}}}}}});var jf=P((IL,xg)=>{xg.exports={pagination:{}}});var Vr=P((OL,Xf)=>{gs();var vs=V(),Cg=vs.Service,Kf=vs.apiLoader;Kf.services.sts={};vs.STS=Cg.defineService("sts",["2011-06-15"]);zf();Object.defineProperty(Kf.services.sts,"2011-06-15",{get:o(function(){var e=Hf();return e.paginators=jf().pagination,e},"get"),enumerable:!0,configurable:!0});Xf.exports=vs.STS});var Gf=P(()=>{var pi=V(),Sg=Vr();pi.TemporaryCredentials=pi.util.inherit(pi.Credentials,{constructor:o(function(e,r){pi.Credentials.call(this),this.loadMasterCredentials(r),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},"TemporaryCredentials"),refresh:o(function(e){this.coalesceRefresh(e||pi.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.masterCredentials.get(function(){r.service.config.credentials=r.masterCredentials;var i=r.params.RoleArn?r.service.assumeRole:r.service.getSessionToken;i.call(r.service,function(n,s){n||r.service.credentialsFrom(s,r),e(n)})})},"load"),loadMasterCredentials:o(function(e){for(this.masterCredentials=e||pi.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;typeof this.masterCredentials.get!="function"&&(this.masterCredentials=new pi.Credentials(this.masterCredentials))},"loadMasterCredentials"),createClients:function(){this.service=this.service||new Sg({params:this.params})}})});var Jf=P(()=>{var Qt=V(),Tg=Vr();Qt.ChainableTemporaryCredentials=Qt.util.inherit(Qt.Credentials,{constructor:o(function(e){Qt.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var r=Qt.util.copy(e.params)||{};if(r.RoleArn&&(r.RoleSessionName=r.RoleSessionName||"temporary-credentials"),r.SerialNumber){if(!e.tokenCodeFn||typeof e.tokenCodeFn!="function")throw new Qt.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var i=Qt.util.merge({params:r,credentials:e.masterCredentials||Qt.config.credentials},e.stsConfig||{});this.service=new Tg(i)},"ChainableTemporaryCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Qt.util.fn.callback)},"refresh"),load:o(function(e){var r=this,i=r.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode(function(n,s){var a={};if(n){e(n);return}s&&(a.TokenCode=s),r.service[i](a,function(u,l){u||r.service.credentialsFrom(l,r),e(u)})})},"load"),getTokenCode:o(function(e){var r=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,function(i,n){if(i){var s=i;i instanceof Error&&(s=i.message),e(Qt.util.error(new Error("Error fetching MFA token: "+s),{code:r.errorCode}));return}e(null,n)}):e(null)},"getTokenCode")})});var Yf=P(()=>{var mi=V(),bg=Vr();mi.WebIdentityCredentials=mi.util.inherit(mi.Credentials,{constructor:o(function(e,r){mi.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=mi.util.copy(r||{})},"WebIdentityCredentials"),refresh:o(function(e){this.coalesceRefresh(e||mi.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.service.assumeRoleWithWebIdentity(function(i,n){r.data=null,i||(r.data=n,r.service.credentialsFrom(n,r)),e(i)})},"load"),createClients:function(){if(!this.service){var t=mi.util.merge({},this._clientConfig);t.params=this.params,this.service=new bg(t)}}})});var Qf=P((BL,Ag)=>{Ag.exports={version:"2.0",metadata:{apiVersion:"2014-06-30",endpointPrefix:"cognito-identity",jsonVersion:"1.1",protocol:"json",serviceFullName:"Amazon Cognito Identity",serviceId:"Cognito Identity",signatureVersion:"v4",targetPrefix:"AWSCognitoIdentityService",uid:"cognito-identity-2014-06-30"},operations:{CreateIdentityPool:{input:{type:"structure",required:["IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},output:{shape:"Sk"}},DeleteIdentities:{input:{type:"structure",required:["IdentityIdsToDelete"],members:{IdentityIdsToDelete:{type:"list",member:{}}}},output:{type:"structure",members:{UnprocessedIdentityIds:{type:"list",member:{type:"structure",members:{IdentityId:{},ErrorCode:{}}}}}}},DeleteIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}}},DescribeIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{}}},output:{shape:"Sv"}},DescribeIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{shape:"Sk"}},GetCredentialsForIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"},CustomRoleArn:{}}},output:{type:"structure",members:{IdentityId:{},Credentials:{type:"structure",members:{AccessKeyId:{},SecretKey:{},SessionToken:{},Expiration:{type:"timestamp"}}}}},authtype:"none"},GetId:{input:{type:"structure",required:["IdentityPoolId"],members:{AccountId:{},IdentityPoolId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{}}},authtype:"none"},GetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{type:"structure",members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},GetOpenIdToken:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}},authtype:"none"},GetOpenIdTokenForDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId","Logins"],members:{IdentityPoolId:{},IdentityId:{},Logins:{shape:"S10"},PrincipalTags:{shape:"S1s"},TokenDuration:{type:"long"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},GetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},ListIdentities:{input:{type:"structure",required:["IdentityPoolId","MaxResults"],members:{IdentityPoolId:{},MaxResults:{type:"integer"},NextToken:{},HideDisabled:{type:"boolean"}}},output:{type:"structure",members:{IdentityPoolId:{},Identities:{type:"list",member:{shape:"Sv"}},NextToken:{}}}},ListIdentityPools:{input:{type:"structure",required:["MaxResults"],members:{MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityPools:{type:"list",member:{type:"structure",members:{IdentityPoolId:{},IdentityPoolName:{}}}},NextToken:{}}}},ListTagsForResource:{input:{type:"structure",required:["ResourceArn"],members:{ResourceArn:{}}},output:{type:"structure",members:{Tags:{shape:"Sh"}}}},LookupDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{},IdentityId:{},DeveloperUserIdentifier:{},MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityId:{},DeveloperUserIdentifierList:{type:"list",member:{}},NextToken:{}}}},MergeDeveloperIdentities:{input:{type:"structure",required:["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],members:{SourceUserIdentifier:{},DestinationUserIdentifier:{},DeveloperProviderName:{},IdentityPoolId:{}}},output:{type:"structure",members:{IdentityId:{}}}},SetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId","Roles"],members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},SetPrincipalTagAttributeMap:{input:{type:"structure",required:["IdentityPoolId","IdentityProviderName"],members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}},output:{type:"structure",members:{IdentityPoolId:{},IdentityProviderName:{},UseDefaults:{type:"boolean"},PrincipalTags:{shape:"S1s"}}}},TagResource:{input:{type:"structure",required:["ResourceArn","Tags"],members:{ResourceArn:{},Tags:{shape:"Sh"}}},output:{type:"structure",members:{}}},UnlinkDeveloperIdentity:{input:{type:"structure",required:["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],members:{IdentityId:{},IdentityPoolId:{},DeveloperProviderName:{},DeveloperUserIdentifier:{}}}},UnlinkIdentity:{input:{type:"structure",required:["IdentityId","Logins","LoginsToRemove"],members:{IdentityId:{},Logins:{shape:"S10"},LoginsToRemove:{shape:"Sw"}}},authtype:"none"},UntagResource:{input:{type:"structure",required:["ResourceArn","TagKeys"],members:{ResourceArn:{},TagKeys:{type:"list",member:{}}}},output:{type:"structure",members:{}}},UpdateIdentityPool:{input:{shape:"Sk"},output:{shape:"Sk"}}},shapes:{S5:{type:"map",key:{},value:{}},S9:{type:"list",member:{}},Sb:{type:"list",member:{type:"structure",members:{ProviderName:{},ClientId:{},ServerSideTokenCheck:{type:"boolean"}}}},Sg:{type:"list",member:{}},Sh:{type:"map",key:{},value:{}},Sk:{type:"structure",required:["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolId:{},IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},Sv:{type:"structure",members:{IdentityId:{},Logins:{shape:"Sw"},CreationDate:{type:"timestamp"},LastModifiedDate:{type:"timestamp"}}},Sw:{type:"list",member:{}},S10:{type:"map",key:{},value:{}},S1c:{type:"map",key:{},value:{}},S1e:{type:"map",key:{},value:{type:"structure",required:["Type"],members:{Type:{},AmbiguousRoleResolution:{},RulesConfiguration:{type:"structure",required:["Rules"],members:{Rules:{type:"list",member:{type:"structure",required:["Claim","MatchType","Value","RoleARN"],members:{Claim:{},MatchType:{},Value:{},RoleARN:{}}}}}}}}},S1s:{type:"map",key:{},value:{}}}}});var $f=P((UL,Ig)=>{Ig.exports={pagination:{ListIdentityPools:{input_token:"NextToken",limit_key:"MaxResults",output_token:"NextToken",result_key:"IdentityPools"}}}});var td=P((VL,ed)=>{gs();var Ns=V(),Og=Ns.Service,Zf=Ns.apiLoader;Zf.services.cognitoidentity={};Ns.CognitoIdentity=Og.defineService("cognitoidentity",["2014-06-30"]);Object.defineProperty(Zf.services.cognitoidentity,"2014-06-30",{get:o(function(){var e=Qf();return e.paginators=$f().pagination,e},"get"),enumerable:!0,configurable:!0});ed.exports=Ns.CognitoIdentity});var rd=P(()=>{var Ft=V(),Rg=td(),Dg=Vr();Ft.CognitoIdentityCredentials=Ft.util.inherit(Ft.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:o(function(e,r){Ft.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=Ft.util.copy(r||{}),this.loadCachedId();var i=this;Object.defineProperty(this,"identityId",{get:function(){return i.loadCachedId(),i._identityId||i.params.IdentityId},set:function(n){i._identityId=n}})},"CognitoIdentityCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Ft.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.data=null,r._identityId=null,r.getId(function(i){i?(r.clearIdOnNotAuthorized(i),e(i)):r.params.RoleArn?r.getCredentialsFromSTS(e):r.getCredentialsForIdentity(e)})},"load"),clearCachedId:o(function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,r=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+r],delete this.storage[this.localStorageKey.providers+e+r]},"clearCache"),clearIdOnNotAuthorized:o(function(e){var r=this;e.code=="NotAuthorizedException"&&r.clearCachedId()},"clearIdOnNotAuthorized"),getId:o(function(e){var r=this;if(typeof r.params.IdentityId=="string")return e(null,r.params.IdentityId);r.cognito.getId(function(i,n){!i&&n.IdentityId?(r.params.IdentityId=n.IdentityId,e(null,n.IdentityId)):e(i)})},"getId"),loadCredentials:o(function(e,r){!e||!r||(r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration)},"loadCredentials"),getCredentialsForIdentity:o(function(e){var r=this;r.cognito.getCredentialsForIdentity(function(i,n){i?r.clearIdOnNotAuthorized(i):(r.cacheId(n),r.data=n,r.loadCredentials(r.data,r)),e(i)})},"getCredentialsForIdentity"),getCredentialsFromSTS:o(function(e){var r=this;r.cognito.getOpenIdToken(function(i,n){i?(r.clearIdOnNotAuthorized(i),e(i)):(r.cacheId(n),r.params.WebIdentityToken=n.Token,r.webIdentityCredentials.refresh(function(s){s||(r.data=r.webIdentityCredentials.data,r.sts.credentialsFrom(r.data,r)),e(s)}))})},"getCredentialsFromSTS"),loadCachedId:o(function(){var e=this;if(Ft.util.isBrowser()&&!e.params.IdentityId){var r=e.getStorage("id");if(r&&e.params.Logins){var i=Object.keys(e.params.Logins),n=(e.getStorage("providers")||"").split(","),s=n.filter(function(a){return i.indexOf(a)!==-1});s.length!==0&&(e.params.IdentityId=r)}else r&&(e.params.IdentityId=r)}},"loadCachedId"),createClients:function(){var t=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new Ft.WebIdentityCredentials(this.params,t),!this.cognito){var e=Ft.util.merge({},t);e.params=this.params,this.cognito=new Rg(e)}this.sts=this.sts||new Dg(t)},cacheId:o(function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,Ft.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},"cacheId"),getStorage:o(function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},"getStorage"),setStorage:o(function(e,r){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=r}catch{}},"setStorage"),storage:function(){try{var t=Ft.util.isBrowser()&&window.localStorage!==null&&typeof window.localStorage=="object"?window.localStorage:{};return t["aws.test-storage"]="foobar",delete t["aws.test-storage"],t}catch{return{}}}()})});var id=P(()=>{var Yn=V(),Pg=Vr();Yn.SAMLCredentials=Yn.util.inherit(Yn.Credentials,{constructor:o(function(e){Yn.Credentials.call(this),this.expired=!0,this.params=e},"SAMLCredentials"),refresh:o(function(e){this.coalesceRefresh(e||Yn.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.createClients(),r.service.assumeRoleWithSAML(function(i,n){i||r.service.credentialsFrom(n,r),e(i)})},"load"),createClients:function(){this.service=this.service||new Pg({params:this.params})}})});var Fa=P(()=>{var ct=V(),_g=te("child_process"),nd=ct.util.iniLoader;ct.ProcessCredentials=ct.util.inherit(ct.Credentials,{constructor:o(function(e){ct.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||ct.util.defaultProfile,this.get(e.callback||ct.util.fn.noop)},"ProcessCredentials"),load:o(function(e){var r=this;try{var i=ct.util.getProfilesFromSharedConfig(nd,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw ct.util.error(new Error("Profile "+this.profile+" not found"),{code:"ProcessCredentialsProviderFailure"});if(n.credential_process)this.loadViaCredentialProcess(n,function(s,a){s?e(s,null):(r.expired=!1,r.accessKeyId=a.AccessKeyId,r.secretAccessKey=a.SecretAccessKey,r.sessionToken=a.SessionToken,a.Expiration&&(r.expireTime=new Date(a.Expiration)),e(null))});else throw ct.util.error(new Error("Profile "+this.profile+" did not include credential process"),{code:"ProcessCredentialsProviderFailure"})}catch(s){e(s)}},"load"),loadViaCredentialProcess:o(function(e,r){_g.exec(e.credential_process,{env:process.env},function(i,n,s){if(i)r(ct.util.error(new Error("credential_process returned error"),{code:"ProcessCredentialsProviderFailure"}),null);else try{var a=JSON.parse(n);if(a.Expiration){var u=ct.util.date.getDate(),l=new Date(a.Expiration);if(l<u)throw Error("credential_process returned expired credentials")}if(a.Version!==1)throw Error("credential_process does not return Version == 1");r(null,a)}catch(h){r(ct.util.error(new Error(h.message),{code:"ProcessCredentialsProviderFailure"}),null)}})},"loadViaCredentialProcess"),refresh:o(function(e){nd.clearCachedFiles(),this.coalesceRefresh(e||ct.util.fn.callback)},"refresh")})});var ws=P(Wa=>{(function(){Wa.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
15
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(Wa)});var Nr=P((od,yi)=>{(function(){var t,e,r,i,n,s,a=[].slice,u={}.hasOwnProperty;t=o(function(){var l,h,y,v,S,I;if(I=arguments[0],S=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(l=0,y=S.length;l<y;l++)if(v=S[l],v!=null)for(h in v)u.call(v,h)&&(I[h]=v[h]);return I},"assign"),i=o(function(l){return!!l&&Object.prototype.toString.call(l)==="[object Function]"},"isFunction"),n=o(function(l){var h;return!!l&&((h=typeof l)=="function"||h==="object")},"isObject"),e=o(function(l){return i(Array.isArray)?Array.isArray(l):Object.prototype.toString.call(l)==="[object Array]"},"isArray"),r=o(function(l){var h;if(e(l))return!l.length;for(h in l)if(u.call(l,h))return!1;return!0},"isEmpty"),s=o(function(l){var h,y;return n(l)&&(y=Object.getPrototypeOf(l))&&(h=y.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),yi.exports.assign=t,yi.exports.isFunction=i,yi.exports.isObject=n,yi.exports.isArray=e,yi.exports.isEmpty=r,yi.exports.isPlainObject=s}).call(od)});var Ba=P((sd,ad)=>{(function(){var t;ad.exports=t=function(){function e(r,i,n){if(this.options=r.options,this.stringify=r.stringify,i==null)throw new Error("Missing attribute name of element "+r.name);if(n==null)throw new Error("Missing attribute value for attribute "+i+" of element "+r.name);this.name=this.stringify.attName(i),this.value=this.stringify.attValue(n)}return o(e,"XMLAttribute"),e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(r){return this.options.writer.set(r).attribute(this)},e}()}).call(sd)});var Qn=P((ud,cd)=>{(function(){var t,e,r,i,n,s,a=o(function(l,h){for(var y in h)u.call(h,y)&&(l[y]=h[y]);function v(){this.constructor=l}return o(v,"ctor"),v.prototype=h.prototype,l.prototype=new v,l.__super__=h.prototype,l},"extend"),u={}.hasOwnProperty;s=Nr(),n=s.isObject,i=s.isFunction,r=lt(),t=Ba(),cd.exports=e=function(l){a(h,l);function h(y,v,S){if(h.__super__.constructor.call(this,y),v==null)throw new Error("Missing element name");this.name=this.stringify.eleName(v),this.attributes={},S!=null&&this.attribute(S),y.isDocument&&(this.isRoot=!0,this.documentObject=y,y.rootObject=this)}return o(h,"XMLElement"),h.prototype.clone=function(){var y,v,S,I;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attributes={},I=this.attributes;for(v in I)u.call(I,v)&&(y=I[v],S.attributes[v]=y.clone());return S.children=[],this.children.forEach(function(E){var w;return w=E.clone(),w.parent=S,S.children.push(w)}),S},h.prototype.attribute=function(y,v){var S,I;if(y!=null&&(y=y.valueOf()),n(y))for(S in y)u.call(y,S)&&(I=y[S],this.attribute(S,I));else i(v)&&(v=v.apply()),(!this.options.skipNullAttributes||v!=null)&&(this.attributes[y]=new t(this,y,v));return this},h.prototype.removeAttribute=function(y){var v,S,I;if(y==null)throw new Error("Missing attribute name");if(y=y.valueOf(),Array.isArray(y))for(S=0,I=y.length;S<I;S++)v=y[S],delete this.attributes[v];else delete this.attributes[y];return this},h.prototype.toString=function(y){return this.options.writer.set(y).element(this)},h.prototype.att=function(y,v){return this.attribute(y,v)},h.prototype.a=function(y,v){return this.attribute(y,v)},h}(r)}).call(ud)});var $n=P((ld,fd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),fd.exports=t=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(u)}return o(s,"XMLCData"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).cdata(this)},s}(e)}).call(ld)});var Zn=P((dd,hd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),hd.exports=t=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing comment text");this.text=this.stringify.comment(u)}return o(s,"XMLComment"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).comment(this)},s}(e)}).call(dd)});var eo=P((pd,md)=>{(function(){var t,e,r,i=o(function(s,a){for(var u in a)n.call(a,u)&&(s[u]=a[u]);function l(){this.constructor=s}return o(l,"ctor"),l.prototype=a.prototype,s.prototype=new l,s.__super__=a.prototype,s},"extend"),n={}.hasOwnProperty;r=Nr().isObject,e=lt(),md.exports=t=function(s){i(a,s);function a(u,l,h,y){var v;a.__super__.constructor.call(this,u),r(l)&&(v=l,l=v.version,h=v.encoding,y=v.standalone),l||(l="1.0"),this.version=this.stringify.xmlVersion(l),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),y!=null&&(this.standalone=this.stringify.xmlStandalone(y))}return o(a,"XMLDeclaration"),a.prototype.toString=function(u){return this.options.writer.set(u).declaration(this)},a}(e)}).call(pd)});var to=P((yd,vd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),vd.exports=t=function(n){r(s,n);function s(a,u,l,h,y,v){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");if(l==null)throw new Error("Missing DTD attribute name");if(!h)throw new Error("Missing DTD attribute type");if(!y)throw new Error("Missing DTD attribute default");if(y.indexOf("#")!==0&&(y="#"+y),!y.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(v&&!y.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(u),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(h),this.defaultValue=this.stringify.dtdAttDefault(v),this.defaultValueType=y}return o(s,"XMLDTDAttList"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdAttList(this)},s}(e)}).call(yd)});var ro=P((gd,Nd)=>{(function(){var t,e,r,i=o(function(s,a){for(var u in a)n.call(a,u)&&(s[u]=a[u]);function l(){this.constructor=s}return o(l,"ctor"),l.prototype=a.prototype,s.prototype=new l,s.__super__=a.prototype,s},"extend"),n={}.hasOwnProperty;r=Nr().isObject,e=lt(),Nd.exports=t=function(s){i(a,s);function a(u,l,h,y){if(a.__super__.constructor.call(this,u),h==null)throw new Error("Missing entity name");if(y==null)throw new Error("Missing entity value");if(this.pe=!!l,this.name=this.stringify.eleName(h),!r(y))this.value=this.stringify.dtdEntityValue(y);else{if(!y.pubID&&!y.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(y.pubID&&!y.sysID)throw new Error("System identifier is required for a public external entity");if(y.pubID!=null&&(this.pubID=this.stringify.dtdPubID(y.pubID)),y.sysID!=null&&(this.sysID=this.stringify.dtdSysID(y.sysID)),y.nData!=null&&(this.nData=this.stringify.dtdNData(y.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}}return o(a,"XMLDTDEntity"),a.prototype.toString=function(u){return this.options.writer.set(u).dtdEntity(this)},a}(e)}).call(gd)});var io=P((wd,Ed)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),Ed.exports=t=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name");l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.eleName(u),this.value=this.stringify.dtdElementValue(l)}return o(s,"XMLDTDElement"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdElement(this)},s}(e)}).call(wd)});var no=P((xd,Cd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;e=lt(),Cd.exports=t=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing notation name");if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(u),l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return o(s,"XMLDTDNotation"),s.prototype.toString=function(a){return this.options.writer.set(a).dtdNotation(this)},s}(e)}).call(xd)});var oo=P((Sd,Td)=>{(function(){var t,e,r,i,n,s,a,u=o(function(h,y){for(var v in y)l.call(y,v)&&(h[v]=y[v]);function S(){this.constructor=h}return o(S,"ctor"),S.prototype=y.prototype,h.prototype=new S,h.__super__=y.prototype,h},"extend"),l={}.hasOwnProperty;a=Nr().isObject,s=lt(),t=to(),r=ro(),e=io(),i=no(),Td.exports=n=function(h){u(y,h);function y(v,S,I){var E,w;y.__super__.constructor.call(this,v),this.documentObject=v,a(S)&&(E=S,S=E.pubID,I=E.sysID),I==null&&(w=[S,I],I=w[0],S=w[1]),S!=null&&(this.pubID=this.stringify.dtdPubID(S)),I!=null&&(this.sysID=this.stringify.dtdSysID(I))}return o(y,"XMLDocType"),y.prototype.element=function(v,S){var I;return I=new e(this,v,S),this.children.push(I),this},y.prototype.attList=function(v,S,I,E,w){var D;return D=new t(this,v,S,I,E,w),this.children.push(D),this},y.prototype.entity=function(v,S){var I;return I=new r(this,!1,v,S),this.children.push(I),this},y.prototype.pEntity=function(v,S){var I;return I=new r(this,!0,v,S),this.children.push(I),this},y.prototype.notation=function(v,S){var I;return I=new i(this,v,S),this.children.push(I),this},y.prototype.toString=function(v){return this.options.writer.set(v).docType(this)},y.prototype.ele=function(v,S){return this.element(v,S)},y.prototype.att=function(v,S,I,E,w){return this.attList(v,S,I,E,w)},y.prototype.ent=function(v,S){return this.entity(v,S)},y.prototype.pent=function(v,S){return this.pEntity(v,S)},y.prototype.not=function(v,S){return this.notation(v,S)},y.prototype.up=function(){return this.root()||this.documentObject},y}(s)}).call(Sd)});var so=P((bd,Ad)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Ad.exports=e=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing raw text");this.value=this.stringify.raw(u)}return o(s,"XMLRaw"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).raw(this)},s}(t)}).call(bd)});var ao=P((Id,Od)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Od.exports=e=function(n){r(s,n);function s(a,u){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing element text");this.value=this.stringify.eleText(u)}return o(s,"XMLText"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).text(this)},s}(t)}).call(Id)});var uo=P((Rd,Dd)=>{(function(){var t,e,r=o(function(n,s){for(var a in s)i.call(s,a)&&(n[a]=s[a]);function u(){this.constructor=n}return o(u,"ctor"),u.prototype=s.prototype,n.prototype=new u,n.__super__=s.prototype,n},"extend"),i={}.hasOwnProperty;t=lt(),Dd.exports=e=function(n){r(s,n);function s(a,u,l){if(s.__super__.constructor.call(this,a),u==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(u),l&&(this.value=this.stringify.insValue(l))}return o(s,"XMLProcessingInstruction"),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.set(a).processingInstruction(this)},s}(t)}).call(Rd)});var lt=P((Pd,_d)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,I={}.hasOwnProperty;S=Nr(),v=S.isObject,y=S.isFunction,h=S.isEmpty,n=null,t=null,e=null,r=null,i=null,u=null,l=null,a=null,_d.exports=s=function(){function E(w){this.parent=w,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],n||(n=Qn(),t=$n(),e=Zn(),r=eo(),i=oo(),u=so(),l=ao(),a=uo())}return o(E,"XMLNode"),E.prototype.element=function(w,D,x){var p,C,R,_,T,A,g,K,X,F;if(A=null,D==null&&(D={}),D=D.valueOf(),v(D)||(X=[D,x],x=X[0],D=X[1]),w!=null&&(w=w.valueOf()),Array.isArray(w))for(R=0,g=w.length;R<g;R++)C=w[R],A=this.element(C);else if(y(w))A=this.element(w.apply());else if(v(w)){for(T in w)if(I.call(w,T))if(F=w[T],y(F)&&(F=F.apply()),v(F)&&h(F)&&(F=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(T.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F))for(_=0,K=F.length;_<K;_++)C=F[_],p={},p[T]=C,A=this.element(p);else v(F)?(A=this.element(T),A.element(F)):A=this.element(T,F)}else!this.options.ignoreDecorators&&this.stringify.convertTextKey&&w.indexOf(this.stringify.convertTextKey)===0?A=this.text(x):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&w.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(x):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&w.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(x):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&w.indexOf(this.stringify.convertRawKey)===0?A=this.raw(x):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&w.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(w.substr(this.stringify.convertPIKey.length),x):A=this.node(w,D,x);if(A==null)throw new Error("Could not create any elements with: "+w);return A},E.prototype.insertBefore=function(w,D,x){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C),p=this.parent.element(w,D,x),Array.prototype.push.apply(this.parent.children,R),p},E.prototype.insertAfter=function(w,D,x){var p,C,R;if(this.isRoot)throw new Error("Cannot insert elements at root level");return C=this.parent.children.indexOf(this),R=this.parent.children.splice(C+1),p=this.parent.element(w,D,x),Array.prototype.push.apply(this.parent.children,R),p},E.prototype.remove=function(){var w,D;if(this.isRoot)throw new Error("Cannot remove the root element");return w=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[w,w-w+1].concat(D=[])),this.parent},E.prototype.node=function(w,D,x){var p,C;return w!=null&&(w=w.valueOf()),D||(D={}),D=D.valueOf(),v(D)||(C=[D,x],x=C[0],D=C[1]),p=new n(this,w,D),x!=null&&p.text(x),this.children.push(p),p},E.prototype.text=function(w){var D;return D=new l(this,w),this.children.push(D),this},E.prototype.cdata=function(w){var D;return D=new t(this,w),this.children.push(D),this},E.prototype.comment=function(w){var D;return D=new e(this,w),this.children.push(D),this},E.prototype.commentBefore=function(w){var D,x,p;return x=this.parent.children.indexOf(this),p=this.parent.children.splice(x),D=this.parent.comment(w),Array.prototype.push.apply(this.parent.children,p),this},E.prototype.commentAfter=function(w){var D,x,p;return x=this.parent.children.indexOf(this),p=this.parent.children.splice(x+1),D=this.parent.comment(w),Array.prototype.push.apply(this.parent.children,p),this},E.prototype.raw=function(w){var D;return D=new u(this,w),this.children.push(D),this},E.prototype.instruction=function(w,D){var x,p,C,R,_;if(w!=null&&(w=w.valueOf()),D!=null&&(D=D.valueOf()),Array.isArray(w))for(R=0,_=w.length;R<_;R++)x=w[R],this.instruction(x);else if(v(w))for(x in w)I.call(w,x)&&(p=w[x],this.instruction(x,p));else y(D)&&(D=D.apply()),C=new a(this,w,D),this.children.push(C);return this},E.prototype.instructionBefore=function(w,D){var x,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p),x=this.parent.instruction(w,D),Array.prototype.push.apply(this.parent.children,C),this},E.prototype.instructionAfter=function(w,D){var x,p,C;return p=this.parent.children.indexOf(this),C=this.parent.children.splice(p+1),x=this.parent.instruction(w,D),Array.prototype.push.apply(this.parent.children,C),this},E.prototype.declaration=function(w,D,x){var p,C;return p=this.document(),C=new r(p,w,D,x),p.children[0]instanceof r?p.children[0]=C:p.children.unshift(C),p.root()||p},E.prototype.doctype=function(w,D){var x,p,C,R,_,T,A,g,K,X;for(p=this.document(),C=new i(p,w,D),K=p.children,R=_=0,A=K.length;_<A;R=++_)if(x=K[R],x instanceof i)return p.children[R]=C,C;for(X=p.children,R=T=0,g=X.length;T<g;R=++T)if(x=X[R],x.isRoot)return p.children.splice(R,0,C),C;return p.children.push(C),C},E.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},E.prototype.root=function(){var w;for(w=this;w;){if(w.isDocument)return w.rootObject;if(w.isRoot)return w;w=w.parent}},E.prototype.document=function(){var w;for(w=this;w;){if(w.isDocument)return w;w=w.parent}},E.prototype.end=function(w){return this.document().end(w)},E.prototype.prev=function(){var w;if(w=this.parent.children.indexOf(this),w<1)throw new Error("Already at the first node");return this.parent.children[w-1]},E.prototype.next=function(){var w;if(w=this.parent.children.indexOf(this),w===-1||w===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[w+1]},E.prototype.importDocument=function(w){var D;return D=w.root().clone(),D.parent=this,D.isRoot=!1,this.children.push(D),this},E.prototype.ele=function(w,D,x){return this.element(w,D,x)},E.prototype.nod=function(w,D,x){return this.node(w,D,x)},E.prototype.txt=function(w){return this.text(w)},E.prototype.dat=function(w){return this.cdata(w)},E.prototype.com=function(w){return this.comment(w)},E.prototype.ins=function(w,D){return this.instruction(w,D)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(w,D,x){return this.declaration(w,D,x)},E.prototype.dtd=function(w,D){return this.doctype(w,D)},E.prototype.e=function(w,D,x){return this.element(w,D,x)},E.prototype.n=function(w,D,x){return this.node(w,D,x)},E.prototype.t=function(w){return this.text(w)},E.prototype.d=function(w){return this.cdata(w)},E.prototype.c=function(w){return this.comment(w)},E.prototype.r=function(w){return this.raw(w)},E.prototype.i=function(w,D){return this.instruction(w,D)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(w){return this.importDocument(w)},E}()}).call(Pd)});var Ua=P((qd,kd)=>{(function(){var t,e=o(function(i,n){return function(){return i.apply(n,arguments)}},"bind"),r={}.hasOwnProperty;kd.exports=t=function(){function i(n){this.assertLegalChar=e(this.assertLegalChar,this);var s,a,u;n||(n={}),this.noDoubleEncoding=n.noDoubleEncoding,a=n.stringify||{};for(s in a)r.call(a,s)&&(u=a[s],this[s]=u)}return o(i,"XMLStringifier"),i.prototype.eleName=function(n){return n=""+n||"",this.assertLegalChar(n)},i.prototype.eleText=function(n){return n=""+n||"",this.assertLegalChar(this.elEscape(n))},i.prototype.cdata=function(n){return n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n)},i.prototype.comment=function(n){if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},i.prototype.raw=function(n){return""+n||""},i.prototype.attName=function(n){return n=""+n||""},i.prototype.attValue=function(n){return n=""+n||"",this.attEscape(n)},i.prototype.insTarget=function(n){return""+n||""},i.prototype.insValue=function(n){if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return n},i.prototype.xmlVersion=function(n){if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},i.prototype.xmlEncoding=function(n){if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return n},i.prototype.xmlStandalone=function(n){return n?"yes":"no"},i.prototype.dtdPubID=function(n){return""+n||""},i.prototype.dtdSysID=function(n){return""+n||""},i.prototype.dtdElementValue=function(n){return""+n||""},i.prototype.dtdAttType=function(n){return""+n||""},i.prototype.dtdAttDefault=function(n){return n!=null?""+n||"":n},i.prototype.dtdEntityValue=function(n){return""+n||""},i.prototype.dtdNData=function(n){return""+n||""},i.prototype.convertAttKey="@",i.prototype.convertPIKey="?",i.prototype.convertTextKey="#text",i.prototype.convertCDataKey="#cdata",i.prototype.convertCommentKey="#comment",i.prototype.convertRawKey="#raw",i.prototype.assertLegalChar=function(n){var s;if(s=n.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),s)throw new Error("Invalid character in string: "+n+" at index "+s.index);return n},i.prototype.elEscape=function(n){var s;return s=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},i.prototype.attEscape=function(n){var s;return s=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},i}()}).call(qd)});var Va=P((Ld,Md)=>{(function(){var t,e={}.hasOwnProperty;Md.exports=t=function(){function r(i){var n,s,a,u,l,h,y,v,S;i||(i={}),this.pretty=i.pretty||!1,this.allowEmpty=(s=i.allowEmpty)!=null?s:!1,this.pretty?(this.indent=(a=i.indent)!=null?a:" ",this.newline=(u=i.newline)!=null?u:`
16
+ `,this.offset=(l=i.offset)!=null?l:0,this.dontprettytextnodes=(h=i.dontprettytextnodes)!=null?h:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(y=i.spacebeforeslash)!=null?y:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,v=i.writer||{};for(n in v)e.call(v,n)&&(S=v[n],this[n]=S)}return o(r,"XMLWriterBase"),r.prototype.set=function(i){var n,s,a;i||(i={}),"pretty"in i&&(this.pretty=i.pretty),"allowEmpty"in i&&(this.allowEmpty=i.allowEmpty),this.pretty?(this.indent="indent"in i?i.indent:" ",this.newline="newline"in i?i.newline:`
17
+ `,this.offset="offset"in i?i.offset:0,this.dontprettytextnodes="dontprettytextnodes"in i?i.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in i?i.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,s=i.writer||{};for(n in s)e.call(s,n)&&(a=s[n],this[n]=a);return this},r.prototype.space=function(i){var n;return this.pretty?(n=(i||0)+this.offset+1,n>0?new Array(n).join(this.indent):""):""},r}()}).call(Ld)});var Es=P((Fd,Wd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,I,E=o(function(D,x){for(var p in x)w.call(x,p)&&(D[p]=x[p]);function C(){this.constructor=D}return o(C,"ctor"),C.prototype=x.prototype,D.prototype=new C,D.__super__=x.prototype,D},"extend"),w={}.hasOwnProperty;a=eo(),u=oo(),t=$n(),e=Zn(),l=Qn(),y=so(),S=ao(),h=uo(),r=to(),i=io(),n=ro(),s=no(),I=Va(),Wd.exports=v=function(D){E(x,D);function x(p){x.__super__.constructor.call(this,p)}return o(x,"XMLStringWriter"),x.prototype.document=function(p){var C,R,_,T,A;for(this.textispresent=!1,T="",A=p.children,R=0,_=A.length;R<_;R++)C=A[R],T+=function(){switch(!1){case!(C instanceof a):return this.declaration(C);case!(C instanceof u):return this.docType(C);case!(C instanceof e):return this.comment(C);case!(C instanceof h):return this.processingInstruction(C);default:return this.element(C,0)}}.call(this);return this.pretty&&T.slice(-this.newline.length)===this.newline&&(T=T.slice(0,-this.newline.length)),T},x.prototype.attribute=function(p){return" "+p.name+'="'+p.value+'"'},x.prototype.cdata=function(p,C){return this.space(C)+"<![CDATA["+p.text+"]]>"+this.newline},x.prototype.comment=function(p,C){return this.space(C)+"<!-- "+p.text+" -->"+this.newline},x.prototype.declaration=function(p,C){var R;return R=this.space(C),R+='<?xml version="'+p.version+'"',p.encoding!=null&&(R+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(R+=' standalone="'+p.standalone+'"'),R+=this.spacebeforeslash+"?>",R+=this.newline,R},x.prototype.docType=function(p,C){var R,_,T,A,g;if(C||(C=0),A=this.space(C),A+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?A+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(A+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(A+=" [",A+=this.newline,g=p.children,_=0,T=g.length;_<T;_++)R=g[_],A+=function(){switch(!1){case!(R instanceof r):return this.dtdAttList(R,C+1);case!(R instanceof i):return this.dtdElement(R,C+1);case!(R instanceof n):return this.dtdEntity(R,C+1);case!(R instanceof s):return this.dtdNotation(R,C+1);case!(R instanceof t):return this.cdata(R,C+1);case!(R instanceof e):return this.comment(R,C+1);case!(R instanceof h):return this.processingInstruction(R,C+1);default:throw new Error("Unknown DTD node type: "+R.constructor.name)}}.call(this);A+="]"}return A+=this.spacebeforeslash+">",A+=this.newline,A},x.prototype.element=function(p,C){var R,_,T,A,g,K,X,F,oe,We,Me,bt,Z;C||(C=0),Z=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),bt=this.space(C),F="",F+=bt+"<"+p.name,oe=p.attributes;for(X in oe)w.call(oe,X)&&(R=oe[X],F+=this.attribute(R));if(p.children.length===0||p.children.every(function(Er){return Er.value===""}))this.allowEmpty?F+="></"+p.name+">"+this.newline:F+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)F+=">",F+=p.children[0].value,F+="</"+p.name+">"+this.newline;else{if(this.dontprettytextnodes){for(We=p.children,T=0,g=We.length;T<g;T++)if(_=We[T],_.value!=null){this.textispresent++,Z=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,bt=this.space(C)),F+=">"+this.newline,Me=p.children,A=0,K=Me.length;A<K;A++)_=Me[A],F+=function(){switch(!1){case!(_ instanceof t):return this.cdata(_,C+1);case!(_ instanceof e):return this.comment(_,C+1);case!(_ instanceof l):return this.element(_,C+1);case!(_ instanceof y):return this.raw(_,C+1);case!(_ instanceof S):return this.text(_,C+1);case!(_ instanceof h):return this.processingInstruction(_,C+1);default:throw new Error("Unknown XML node type: "+_.constructor.name)}}.call(this);Z&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),F+=bt+"</"+p.name+">"+this.newline}return F},x.prototype.processingInstruction=function(p,C){var R;return R=this.space(C)+"<?"+p.target,p.value&&(R+=" "+p.value),R+=this.spacebeforeslash+"?>"+this.newline,R},x.prototype.raw=function(p,C){return this.space(C)+p.value+this.newline},x.prototype.text=function(p,C){return this.space(C)+p.value+this.newline},x.prototype.dtdAttList=function(p,C){var R;return R=this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(R+=" "+p.defaultValueType),p.defaultValue&&(R+=' "'+p.defaultValue+'"'),R+=this.spacebeforeslash+">"+this.newline,R},x.prototype.dtdElement=function(p,C){return this.space(C)+"<!ELEMENT "+p.name+" "+p.value+this.spacebeforeslash+">"+this.newline},x.prototype.dtdEntity=function(p,C){var R;return R=this.space(C)+"<!ENTITY",p.pe&&(R+=" %"),R+=" "+p.name,p.value?R+=' "'+p.value+'"':(p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),p.nData&&(R+=" NDATA "+p.nData)),R+=this.spacebeforeslash+">"+this.newline,R},x.prototype.dtdNotation=function(p,C){var R;return R=this.space(C)+"<!NOTATION "+p.name,p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?R+=' PUBLIC "'+p.pubID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),R+=this.spacebeforeslash+">"+this.newline,R},x.prototype.openNode=function(p,C){var R,_,T,A;if(C||(C=0),p instanceof l){T=this.space(C)+"<"+p.name,A=p.attributes;for(_ in A)w.call(A,_)&&(R=A[_],T+=this.attribute(R));return T+=(p.children?">":"/>")+this.newline,T}else return T=this.space(C)+"<!DOCTYPE "+p.rootNodeName,p.pubID&&p.sysID?T+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(T+=' SYSTEM "'+p.sysID+'"'),T+=(p.children?" [":">")+this.newline,T},x.prototype.closeNode=function(p,C){switch(C||(C=0),!1){case!(p instanceof l):return this.space(C)+"</"+p.name+">"+this.newline;case!(p instanceof u):return this.space(C)+"]>"+this.newline}},x}(I)}).call(Fd)});var Vd=P((Bd,Ud)=>{(function(){var t,e,r,i,n,s=o(function(u,l){for(var h in l)a.call(l,h)&&(u[h]=l[h]);function y(){this.constructor=u}return o(y,"ctor"),y.prototype=l.prototype,u.prototype=new y,u.__super__=l.prototype,u},"extend"),a={}.hasOwnProperty;n=Nr().isPlainObject,e=lt(),i=Ua(),r=Es(),Ud.exports=t=function(u){s(l,u);function l(h){l.__super__.constructor.call(this,null),h||(h={}),h.writer||(h.writer=new r),this.options=h,this.stringify=new i(h),this.isDocument=!0}return o(l,"XMLDocument"),l.prototype.end=function(h){var y;return h?n(h)&&(y=h,h=this.options.writer.set(y)):h=this.options.writer,h.document(this)},l.prototype.toString=function(h){return this.options.writer.set(h).document(this)},l}(e)}).call(Bd)});var jd=P((zd,Hd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,I,E,w,D,x,p,C,R={}.hasOwnProperty;C=Nr(),x=C.isObject,D=C.isFunction,p=C.isPlainObject,y=Qn(),e=$n(),r=Zn(),S=so(),w=ao(),v=uo(),u=eo(),l=oo(),i=to(),s=ro(),n=io(),a=no(),t=Ba(),E=Ua(),I=Es(),Hd.exports=h=function(){function _(T,A,g){var K;T||(T={}),T.writer?p(T.writer)&&(K=T.writer,T.writer=new I(K)):T.writer=new I(T),this.options=T,this.writer=T.writer,this.stringify=new E(T),this.onDataCallback=A||function(){},this.onEndCallback=g||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(_,"XMLDocumentCB"),_.prototype.node=function(T,A,g){var K;if(T==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),T=T.valueOf(),A==null&&(A={}),A=A.valueOf(),x(A)||(K=[A,g],g=K[0],A=K[1]),this.currentNode=new y(this,T,A),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,g!=null&&this.text(g),this},_.prototype.element=function(T,A,g){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(T,A,g)},_.prototype.attribute=function(T,A){var g,K;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(T!=null&&(T=T.valueOf()),x(T))for(g in T)R.call(T,g)&&(K=T[g],this.attribute(g,K));else D(A)&&(A=A.apply()),(!this.options.skipNullAttributes||A!=null)&&(this.currentNode.attributes[T]=new t(this,T,A));return this},_.prototype.text=function(T){var A;return this.openCurrent(),A=new w(this,T),this.onData(this.writer.text(A,this.currentLevel+1)),this},_.prototype.cdata=function(T){var A;return this.openCurrent(),A=new e(this,T),this.onData(this.writer.cdata(A,this.currentLevel+1)),this},_.prototype.comment=function(T){var A;return this.openCurrent(),A=new r(this,T),this.onData(this.writer.comment(A,this.currentLevel+1)),this},_.prototype.raw=function(T){var A;return this.openCurrent(),A=new S(this,T),this.onData(this.writer.raw(A,this.currentLevel+1)),this},_.prototype.instruction=function(T,A){var g,K,X,F,oe;if(this.openCurrent(),T!=null&&(T=T.valueOf()),A!=null&&(A=A.valueOf()),Array.isArray(T))for(g=0,F=T.length;g<F;g++)K=T[g],this.instruction(K);else if(x(T))for(K in T)R.call(T,K)&&(X=T[K],this.instruction(K,X));else D(A)&&(A=A.apply()),oe=new v(this,T,A),this.onData(this.writer.processingInstruction(oe,this.currentLevel+1));return this},_.prototype.declaration=function(T,A,g){var K;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return K=new u(this,T,A,g),this.onData(this.writer.declaration(K,this.currentLevel+1)),this},_.prototype.doctype=function(T,A,g){if(this.openCurrent(),T==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new l(this,A,g),this.currentNode.rootNodeName=T,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},_.prototype.dtdElement=function(T,A){var g;return this.openCurrent(),g=new n(this,T,A),this.onData(this.writer.dtdElement(g,this.currentLevel+1)),this},_.prototype.attList=function(T,A,g,K,X){var F;return this.openCurrent(),F=new i(this,T,A,g,K,X),this.onData(this.writer.dtdAttList(F,this.currentLevel+1)),this},_.prototype.entity=function(T,A){var g;return this.openCurrent(),g=new s(this,!1,T,A),this.onData(this.writer.dtdEntity(g,this.currentLevel+1)),this},_.prototype.pEntity=function(T,A){var g;return this.openCurrent(),g=new s(this,!0,T,A),this.onData(this.writer.dtdEntity(g,this.currentLevel+1)),this},_.prototype.notation=function(T,A){var g;return this.openCurrent(),g=new a(this,T,A),this.onData(this.writer.dtdNotation(g,this.currentLevel+1)),this},_.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},_.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},_.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},_.prototype.openNode=function(T){if(!T.isOpen)return!this.root&&this.currentLevel===0&&T instanceof y&&(this.root=T),this.onData(this.writer.openNode(T,this.currentLevel)),T.isOpen=!0},_.prototype.closeNode=function(T){if(!T.isClosed)return this.onData(this.writer.closeNode(T,this.currentLevel)),T.isClosed=!0},_.prototype.onData=function(T){return this.documentStarted=!0,this.onDataCallback(T)},_.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},_.prototype.ele=function(){return this.element.apply(this,arguments)},_.prototype.nod=function(T,A,g){return this.node(T,A,g)},_.prototype.txt=function(T){return this.text(T)},_.prototype.dat=function(T){return this.cdata(T)},_.prototype.com=function(T){return this.comment(T)},_.prototype.ins=function(T,A){return this.instruction(T,A)},_.prototype.dec=function(T,A,g){return this.declaration(T,A,g)},_.prototype.dtd=function(T,A,g){return this.doctype(T,A,g)},_.prototype.e=function(T,A,g){return this.element(T,A,g)},_.prototype.n=function(T,A,g){return this.node(T,A,g)},_.prototype.t=function(T){return this.text(T)},_.prototype.d=function(T){return this.cdata(T)},_.prototype.c=function(T){return this.comment(T)},_.prototype.r=function(T){return this.raw(T)},_.prototype.i=function(T,A){return this.instruction(T,A)},_.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},_.prototype.ent=function(T,A){return this.entity(T,A)},_.prototype.pent=function(T,A){return this.pEntity(T,A)},_.prototype.not=function(T,A){return this.notation(T,A)},_}()}).call(zd)});var Gd=P((Kd,Xd)=>{(function(){var t,e,r,i,n,s,a,u,l,h,y,v,S,I,E=o(function(D,x){for(var p in x)w.call(x,p)&&(D[p]=x[p]);function C(){this.constructor=D}return o(C,"ctor"),C.prototype=x.prototype,D.prototype=new C,D.__super__=x.prototype,D},"extend"),w={}.hasOwnProperty;a=eo(),u=oo(),t=$n(),e=Zn(),l=Qn(),y=so(),S=ao(),h=uo(),r=to(),i=io(),n=ro(),s=no(),I=Va(),Xd.exports=v=function(D){E(x,D);function x(p,C){x.__super__.constructor.call(this,C),this.stream=p}return o(x,"XMLStreamWriter"),x.prototype.document=function(p){var C,R,_,T,A,g,K,X;for(g=p.children,R=0,T=g.length;R<T;R++)C=g[R],C.isLastRootNode=!1;for(p.children[p.children.length-1].isLastRootNode=!0,K=p.children,X=[],_=0,A=K.length;_<A;_++)switch(C=K[_],!1){case!(C instanceof a):X.push(this.declaration(C));break;case!(C instanceof u):X.push(this.docType(C));break;case!(C instanceof e):X.push(this.comment(C));break;case!(C instanceof h):X.push(this.processingInstruction(C));break;default:X.push(this.element(C))}return X},x.prototype.attribute=function(p){return this.stream.write(" "+p.name+'="'+p.value+'"')},x.prototype.cdata=function(p,C){return this.stream.write(this.space(C)+"<![CDATA["+p.text+"]]>"+this.endline(p))},x.prototype.comment=function(p,C){return this.stream.write(this.space(C)+"<!-- "+p.text+" -->"+this.endline(p))},x.prototype.declaration=function(p,C){return this.stream.write(this.space(C)),this.stream.write('<?xml version="'+p.version+'"'),p.encoding!=null&&this.stream.write(' encoding="'+p.encoding+'"'),p.standalone!=null&&this.stream.write(' standalone="'+p.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(p))},x.prototype.docType=function(p,C){var R,_,T,A;if(C||(C=0),this.stream.write(this.space(C)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p)),A=p.children,_=0,T=A.length;_<T;_++)switch(R=A[_],!1){case!(R instanceof r):this.dtdAttList(R,C+1);break;case!(R instanceof i):this.dtdElement(R,C+1);break;case!(R instanceof n):this.dtdEntity(R,C+1);break;case!(R instanceof s):this.dtdNotation(R,C+1);break;case!(R instanceof t):this.cdata(R,C+1);break;case!(R instanceof e):this.comment(R,C+1);break;case!(R instanceof h):this.processingInstruction(R,C+1);break;default:throw new Error("Unknown DTD node type: "+R.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(p))},x.prototype.element=function(p,C){var R,_,T,A,g,K,X,F;C||(C=0),F=this.space(C),this.stream.write(F+"<"+p.name),K=p.attributes;for(g in K)w.call(K,g)&&(R=K[g],this.attribute(R));if(p.children.length===0||p.children.every(function(oe){return oe.value===""}))this.allowEmpty?this.stream.write("></"+p.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)this.stream.write(">"),this.stream.write(p.children[0].value),this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.newline),X=p.children,T=0,A=X.length;T<A;T++)switch(_=X[T],!1){case!(_ instanceof t):this.cdata(_,C+1);break;case!(_ instanceof e):this.comment(_,C+1);break;case!(_ instanceof l):this.element(_,C+1);break;case!(_ instanceof y):this.raw(_,C+1);break;case!(_ instanceof S):this.text(_,C+1);break;case!(_ instanceof h):this.processingInstruction(_,C+1);break;default:throw new Error("Unknown XML node type: "+_.constructor.name)}this.stream.write(F+"</"+p.name+">")}return this.stream.write(this.endline(p))},x.prototype.processingInstruction=function(p,C){return this.stream.write(this.space(C)+"<?"+p.target),p.value&&this.stream.write(" "+p.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(p))},x.prototype.raw=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},x.prototype.text=function(p,C){return this.stream.write(this.space(C)+p.value+this.endline(p))},x.prototype.dtdAttList=function(p,C){return this.stream.write(this.space(C)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType),p.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+p.defaultValueType),p.defaultValue&&this.stream.write(' "'+p.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},x.prototype.dtdElement=function(p,C){return this.stream.write(this.space(C)+"<!ELEMENT "+p.name+" "+p.value),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},x.prototype.dtdEntity=function(p,C){return this.stream.write(this.space(C)+"<!ENTITY"),p.pe&&this.stream.write(" %"),this.stream.write(" "+p.name),p.value?this.stream.write(' "'+p.value+'"'):(p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.nData&&this.stream.write(" NDATA "+p.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},x.prototype.dtdNotation=function(p,C){return this.stream.write(this.space(C)+"<!NOTATION "+p.name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.pubID?this.stream.write(' PUBLIC "'+p.pubID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},x.prototype.endline=function(p){return p.isLastRootNode?"":this.newline},x}(I)}).call(Kd)});var Yd=P((Jd,co)=>{(function(){var t,e,r,i,n,s,a;a=Nr(),n=a.assign,s=a.isFunction,t=Vd(),e=jd(),i=Es(),r=Gd(),co.exports.create=function(u,l,h,y){var v,S;if(u==null)throw new Error("Root element needs a name");return y=n({},l,h,y),v=new t(y),S=v.element(u),y.headless||(v.declaration(y),(y.pubID!=null||y.sysID!=null)&&v.doctype(y)),S},co.exports.begin=function(u,l,h){var y;return s(u)&&(y=[u,l],l=y[0],h=y[1],u={}),l?new e(u,l,h):new t(u)},co.exports.stringWriter=function(u){return new i(u)},co.exports.streamWriter=function(u,l){return new r(u,l)}}).call(Jd)});var Qd=P(za=>{(function(){"use strict";var t,e,r,i,n,s={}.hasOwnProperty;t=Yd(),e=ws().defaults,i=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),n=o(function(a){return"<![CDATA["+r(a)+"]]>"},"wrapCDATA"),r=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),za.Builder=function(){function a(u){var l,h,y;this.options={},h=e["0.2"];for(l in h)s.call(h,l)&&(y=h[l],this.options[l]=y);for(l in u)s.call(u,l)&&(y=u[l],this.options[l]=y)}return o(a,"Builder"),a.prototype.buildObject=function(u){var l,h,y,v,S;return l=this.options.attrkey,h=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(S=Object.keys(u)[0],u=u[S]):S=this.options.rootName,y=function(I){return function(E,w){var D,x,p,C,R,_;if(typeof w!="object")I.options.cdata&&i(w)?E.raw(n(w)):E.txt(w);else if(Array.isArray(w)){for(C in w)if(s.call(w,C)){x=w[C];for(R in x)p=x[R],E=y(E.ele(R),p).up()}}else for(R in w)if(s.call(w,R))if(x=w[R],R===l){if(typeof x=="object")for(D in x)_=x[D],E=E.att(D,_)}else if(R===h)I.options.cdata&&i(x)?E=E.raw(n(x)):E=E.txt(x);else if(Array.isArray(x))for(C in x)s.call(x,C)&&(p=x[C],typeof p=="string"?I.options.cdata&&i(p)?E=E.ele(R).raw(n(p)).up():E=E.ele(R,p).up():E=y(E.ele(R),p).up());else typeof x=="object"?E=y(E.ele(R),x).up():typeof x=="string"&&I.options.cdata&&i(x)?E=E.ele(R).raw(n(x)).up():(x==null&&(x=""),E=E.ele(R,x.toString()).up());return E}}(this),v=t.create(S,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(v,u).end(this.options.renderOpts)},a}()}).call(za)});var $d=P(xs=>{(function(t){t.parser=function(m,f){return new r(m,f)},t.SAXParser=r,t.SAXStream=h,t.createStream=l,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(m,f){if(!(this instanceof r))return new r(m,f);var k=this;n(k),k.q=k.c="",k.bufferCheckPosition=t.MAX_BUFFER_LENGTH,k.opt=f||{},k.opt.lowercase=k.opt.lowercase||k.opt.lowercasetags,k.looseCase=k.opt.lowercase?"toLowerCase":"toUpperCase",k.tags=[],k.closed=k.closedRoot=k.sawRoot=!1,k.tag=k.error=null,k.strict=!!m,k.noscript=!!(m||k.opt.noscript),k.state=g.BEGIN,k.strictEntities=k.opt.strictEntities,k.ENTITIES=k.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),k.attribList=[],k.opt.xmlns&&(k.ns=Object.create(E)),k.trackPosition=k.opt.position!==!1,k.trackPosition&&(k.position=k.line=k.column=0),X(k,"onready")}o(r,"SAXParser"),Object.create||(Object.create=function(m){function f(){}o(f,"F"),f.prototype=m;var k=new f;return k}),Object.keys||(Object.keys=function(m){var f=[];for(var k in m)m.hasOwnProperty(k)&&f.push(k);return f});function i(m){for(var f=Math.max(t.MAX_BUFFER_LENGTH,10),k=0,O=0,ee=e.length;O<ee;O++){var we=m[e[O]].length;if(we>f)switch(e[O]){case"textNode":oe(m);break;case"cdata":F(m,"oncdata",m.cdata),m.cdata="";break;case"script":F(m,"onscript",m.script),m.script="";break;default:Me(m,"Max buffer length exceeded: "+e[O])}k=Math.max(k,we)}var Te=t.MAX_BUFFER_LENGTH-k;m.bufferCheckPosition=Te+m.position}o(i,"checkBufferLength");function n(m){for(var f=0,k=e.length;f<k;f++)m[e[f]]=""}o(n,"clearBuffers");function s(m){oe(m),m.cdata!==""&&(F(m,"oncdata",m.cdata),m.cdata=""),m.script!==""&&(F(m,"onscript",m.script),m.script="")}o(s,"flushBuffers"),r.prototype={end:function(){bt(this)},write:Kr,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=te("stream").Stream}catch{a=o(function(){},"Stream")}var u=t.EVENTS.filter(function(m){return m!=="error"&&m!=="end"});function l(m,f){return new h(m,f)}o(l,"createStream");function h(m,f){if(!(this instanceof h))return new h(m,f);a.apply(this),this._parser=new r(m,f),this.writable=!0,this.readable=!0;var k=this;this._parser.onend=function(){k.emit("end")},this._parser.onerror=function(O){k.emit("error",O),k._parser.error=null},this._decoder=null,u.forEach(function(O){Object.defineProperty(k,"on"+O,{get:function(){return k._parser["on"+O]},set:function(ee){if(!ee)return k.removeAllListeners(O),k._parser["on"+O]=ee,ee;k.on(O,ee)},enumerable:!0,configurable:!1})})}o(h,"SAXStream"),h.prototype=Object.create(a.prototype,{constructor:{value:h}}),h.prototype.write=function(m){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(m)){if(!this._decoder){var f=te("string_decoder").StringDecoder;this._decoder=new f("utf8")}m=this._decoder.write(m)}return this._parser.write(m.toString()),this.emit("data",m),!0},h.prototype.end=function(m){return m&&m.length&&this.write(m),this._parser.end(),!0},h.prototype.on=function(m,f){var k=this;return!k._parser["on"+m]&&u.indexOf(m)!==-1&&(k._parser["on"+m]=function(){var O=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);O.splice(0,0,m),k.emit.apply(k,O)}),a.prototype.on.call(k,m,f)};var y="[CDATA[",v="DOCTYPE",S="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",E={xml:S,xmlns:I},w=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,x=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function C(m){return m===" "||m===`
18
+ `||m==="\r"||m===" "}o(C,"isWhitespace");function R(m){return m==='"'||m==="'"}o(R,"isQuote");function _(m){return m===">"||C(m)}o(_,"isAttribEnd");function T(m,f){return m.test(f)}o(T,"isMatch");function A(m,f){return!T(m,f)}o(A,"notMatch");var g=0;t.STATE={BEGIN:g++,BEGIN_WHITESPACE:g++,TEXT:g++,TEXT_ENTITY:g++,OPEN_WAKA:g++,SGML_DECL:g++,SGML_DECL_QUOTED:g++,DOCTYPE:g++,DOCTYPE_QUOTED:g++,DOCTYPE_DTD:g++,DOCTYPE_DTD_QUOTED:g++,COMMENT_STARTING:g++,COMMENT:g++,COMMENT_ENDING:g++,COMMENT_ENDED:g++,CDATA:g++,CDATA_ENDING:g++,CDATA_ENDING_2:g++,PROC_INST:g++,PROC_INST_BODY:g++,PROC_INST_ENDING:g++,OPEN_TAG:g++,OPEN_TAG_SLASH:g++,ATTRIB:g++,ATTRIB_NAME:g++,ATTRIB_NAME_SAW_WHITE:g++,ATTRIB_VALUE:g++,ATTRIB_VALUE_QUOTED:g++,ATTRIB_VALUE_CLOSED:g++,ATTRIB_VALUE_UNQUOTED:g++,ATTRIB_VALUE_ENTITY_Q:g++,ATTRIB_VALUE_ENTITY_U:g++,CLOSE_TAG:g++,CLOSE_TAG_SAW_WHITE:g++,SCRIPT:g++,SCRIPT_ENDING:g++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(m){var f=t.ENTITIES[m],k=typeof f=="number"?String.fromCharCode(f):f;t.ENTITIES[m]=k});for(var K in t.STATE)t.STATE[t.STATE[K]]=K;g=t.STATE;function X(m,f,k){m[f]&&m[f](k)}o(X,"emit");function F(m,f,k){m.textNode&&oe(m),X(m,f,k)}o(F,"emitNode");function oe(m){m.textNode=We(m.opt,m.textNode),m.textNode&&X(m,"ontext",m.textNode),m.textNode=""}o(oe,"closeText");function We(m,f){return m.trim&&(f=f.trim()),m.normalize&&(f=f.replace(/\s+/g," ")),f}o(We,"textopts");function Me(m,f){return oe(m),m.trackPosition&&(f+=`
20
19
  Line: `+m.line+`
21
20
  Column: `+m.column+`
22
- Char: `+m.c),d=new Error(d),m.error=d,X(m,"onerror",d),m}s(Fe,"error");function At(m){return m.sawRoot&&!m.closedRoot&&Z(m,"Unclosed root tag"),m.state!==g.BEGIN&&m.state!==g.BEGIN_WHITESPACE&&m.state!==g.TEXT&&Fe(m,"Unexpected end"),ne(m),m.c="",m.closed=!0,X(m,"onend"),r.call(m,m.strict,m.opt),m}s(At,"end");function Z(m,d){if(typeof m!="object"||!(m instanceof r))throw new Error("bad call to strictFail");m.strict&&Fe(m,d)}s(Z,"strictFail");function wr(m){m.strict||(m.tagName=m.tagName[m.looseCase]());var d=m.tags[m.tags.length-1]||m,k=m.tag={name:m.tagName,attributes:{}};m.opt.xmlns&&(k.ns=d.ns),m.attribList.length=0,M(m,"onopentagstart",k)}s(wr,"newTag");function xr(m,d){var k=m.indexOf(":"),R=k<0?["",m]:m.split(":"),ee=R[0],ye=R[1];return d&&m==="xmlns"&&(ee="xmlns",ye=""),{prefix:ee,local:ye}}s(xr,"qname");function Er(m){if(m.strict||(m.attribName=m.attribName[m.looseCase]()),m.attribList.indexOf(m.attribName)!==-1||m.tag.attributes.hasOwnProperty(m.attribName)){m.attribName=m.attribValue="";return}if(m.opt.xmlns){var d=xr(m.attribName,!0),k=d.prefix,R=d.local;if(k==="xmlns")if(R==="xml"&&m.attribValue!==S)Z(m,"xml: prefix must be bound to "+S+`
23
- Actual: `+m.attribValue);else if(R==="xmlns"&&m.attribValue!==I)Z(m,"xmlns: prefix must be bound to "+I+`
24
- Actual: `+m.attribValue);else{var ee=m.tag,ye=m.tags[m.tags.length-1]||m;ee.ns===ye.ns&&(ee.ns=Object.create(ye.ns)),ee.ns[R]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,M(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}s(Er,"attrib");function Nt(m,d){if(m.opt.xmlns){var k=m.tag,R=xr(m.tagName);k.prefix=R.prefix,k.local=R.local,k.uri=k.ns[R.prefix]||"",k.prefix&&!k.uri&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(m.tagName)),k.uri=R.prefix);var ee=m.tags[m.tags.length-1]||m;k.ns&&ee.ns!==k.ns&&Object.keys(k.ns).forEach(function(Vi){M(m,"onopennamespace",{prefix:Vi,uri:k.ns[Vi]})});for(var ye=0,we=m.attribList.length;ye<we;ye++){var Ge=m.attribList[ye],wt=Ge[0],Sr=Ge[1],Te=xr(wt,!0),Rt=Te.prefix,Bi=Te.local,J=Rt===""?"":k.ns[Rt]||"",Ur={name:wt,value:Sr,prefix:Rt,local:Bi,uri:J};Rt&&Rt!=="xmlns"&&!J&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(Rt)),Ur.uri=Rt),m.tag.attributes[wt]=Ur,M(m,"onattribute",Ur)}m.attribList.length=0}m.tag.isSelfClosing=!!d,m.sawRoot=!0,m.tags.push(m.tag),M(m,"onopentag",m.tag),d||(!m.noscript&&m.tagName.toLowerCase()==="script"?m.state=g.SCRIPT:m.state=g.TEXT,m.tag=null,m.tagName=""),m.attribName=m.attribValue="",m.attribList.length=0}s(Nt,"openTag");function Cr(m){if(!m.tagName){Z(m,"Weird empty close tag."),m.textNode+="</>",m.state=g.TEXT;return}if(m.script){if(m.tagName!=="script"){m.script+="</"+m.tagName+">",m.tagName="",m.state=g.SCRIPT;return}M(m,"onscript",m.script),m.script=""}var d=m.tags.length,k=m.tagName;m.strict||(k=k[m.looseCase]());for(var R=k;d--;){var ee=m.tags[d];if(ee.name!==R)Z(m,"Unexpected close tag");else break}if(d<0){Z(m,"Unmatched closing tag: "+m.tagName),m.textNode+="</"+m.tagName+">",m.state=g.TEXT;return}m.tagName=k;for(var ye=m.tags.length;ye-- >d;){var we=m.tag=m.tags.pop();m.tagName=m.tag.name,M(m,"onclosetag",m.tagName);var Ge={};for(var wt in we.ns)Ge[wt]=we.ns[wt];var Sr=m.tags[m.tags.length-1]||m;m.opt.xmlns&&we.ns!==Sr.ns&&Object.keys(we.ns).forEach(function(Te){var Rt=we.ns[Te];M(m,"onclosenamespace",{prefix:Te,uri:Rt})})}d===0&&(m.closedRoot=!0),m.tagName=m.attribValue=m.attribName="",m.attribList.length=0,m.state=g.TEXT}s(Cr,"closeTag");function pi(m){var d=m.entity,k=d.toLowerCase(),R,ee="";return m.ENTITIES[d]?m.ENTITIES[d]:m.ENTITIES[k]?m.ENTITIES[k]:(d=k,d.charAt(0)==="#"&&(d.charAt(1)==="x"?(d=d.slice(2),R=parseInt(d,16),ee=R.toString(16)):(d=d.slice(1),R=parseInt(d,10),ee=R.toString(10))),d=d.replace(/^0+/,""),isNaN(R)||ee.toLowerCase()!==d?(Z(m,"Invalid character entity"),"&"+m.entity+";"):String.fromCodePoint(R))}s(pi,"parseEntity");function It(m,d){d==="<"?(m.state=g.OPEN_WAKA,m.startTagPosition=m.position):C(d)||(Z(m,"Non-whitespace before first tag."),m.textNode=d,m.state=g.TEXT)}s(It,"beginWhiteSpace");function Ut(m,d){var k="";return d<m.length&&(k=m.charAt(d)),k}s(Ut,"charAt");function Vr(m){var d=this;if(this.error)throw this.error;if(d.closed)return Fe(d,"Cannot write after close. Assign an onready handler.");if(m===null)return At(d);typeof m=="object"&&(m=m.toString());for(var k=0,R="";R=Ut(m,k++),d.c=R,!!R;)switch(d.trackPosition&&(d.position++,R===`
25
- `?(d.line++,d.column=0):d.column++),d.state){case g.BEGIN:if(d.state=g.BEGIN_WHITESPACE,R==="\uFEFF")continue;It(d,R);continue;case g.BEGIN_WHITESPACE:It(d,R);continue;case g.TEXT:if(d.sawRoot&&!d.closedRoot){for(var ee=k-1;R&&R!=="<"&&R!=="&";)R=Ut(m,k++),R&&d.trackPosition&&(d.position++,R===`
26
- `?(d.line++,d.column=0):d.column++);d.textNode+=m.substring(ee,k-1)}R==="<"&&!(d.sawRoot&&d.closedRoot&&!d.strict)?(d.state=g.OPEN_WAKA,d.startTagPosition=d.position):(!C(R)&&(!d.sawRoot||d.closedRoot)&&Z(d,"Text data outside of root node."),R==="&"?d.state=g.TEXT_ENTITY:d.textNode+=R);continue;case g.SCRIPT:R==="<"?d.state=g.SCRIPT_ENDING:d.script+=R;continue;case g.SCRIPT_ENDING:R==="/"?d.state=g.CLOSE_TAG:(d.script+="<"+R,d.state=g.SCRIPT);continue;case g.OPEN_WAKA:if(R==="!")d.state=g.SGML_DECL,d.sgmlDecl="";else if(!C(R))if(T(w,R))d.state=g.OPEN_TAG,d.tagName=R;else if(R==="/")d.state=g.CLOSE_TAG,d.tagName="";else if(R==="?")d.state=g.PROC_INST,d.procInstName=d.procInstBody="";else{if(Z(d,"Unencoded <"),d.startTagPosition+1<d.position){var ye=d.position-d.startTagPosition;R=new Array(ye).join(" ")+R}d.textNode+="<"+R,d.state=g.TEXT}continue;case g.SGML_DECL:(d.sgmlDecl+R).toUpperCase()===y?(M(d,"onopencdata"),d.state=g.CDATA,d.sgmlDecl="",d.cdata=""):d.sgmlDecl+R==="--"?(d.state=g.COMMENT,d.comment="",d.sgmlDecl=""):(d.sgmlDecl+R).toUpperCase()===v?(d.state=g.DOCTYPE,(d.doctype||d.sawRoot)&&Z(d,"Inappropriately located doctype declaration"),d.doctype="",d.sgmlDecl=""):R===">"?(M(d,"onsgmldeclaration",d.sgmlDecl),d.sgmlDecl="",d.state=g.TEXT):(O(R)&&(d.state=g.SGML_DECL_QUOTED),d.sgmlDecl+=R);continue;case g.SGML_DECL_QUOTED:R===d.q&&(d.state=g.SGML_DECL,d.q=""),d.sgmlDecl+=R;continue;case g.DOCTYPE:R===">"?(d.state=g.TEXT,M(d,"ondoctype",d.doctype),d.doctype=!0):(d.doctype+=R,R==="["?d.state=g.DOCTYPE_DTD:O(R)&&(d.state=g.DOCTYPE_QUOTED,d.q=R));continue;case g.DOCTYPE_QUOTED:d.doctype+=R,R===d.q&&(d.q="",d.state=g.DOCTYPE);continue;case g.DOCTYPE_DTD:d.doctype+=R,R==="]"?d.state=g.DOCTYPE:O(R)&&(d.state=g.DOCTYPE_DTD_QUOTED,d.q=R);continue;case g.DOCTYPE_DTD_QUOTED:d.doctype+=R,R===d.q&&(d.state=g.DOCTYPE_DTD,d.q="");continue;case g.COMMENT:R==="-"?d.state=g.COMMENT_ENDING:d.comment+=R;continue;case g.COMMENT_ENDING:R==="-"?(d.state=g.COMMENT_ENDED,d.comment=We(d.opt,d.comment),d.comment&&M(d,"oncomment",d.comment),d.comment=""):(d.comment+="-"+R,d.state=g.COMMENT);continue;case g.COMMENT_ENDED:R!==">"?(Z(d,"Malformed comment"),d.comment+="--"+R,d.state=g.COMMENT):d.state=g.TEXT;continue;case g.CDATA:R==="]"?d.state=g.CDATA_ENDING:d.cdata+=R;continue;case g.CDATA_ENDING:R==="]"?d.state=g.CDATA_ENDING_2:(d.cdata+="]"+R,d.state=g.CDATA);continue;case g.CDATA_ENDING_2:R===">"?(d.cdata&&M(d,"oncdata",d.cdata),M(d,"onclosecdata"),d.cdata="",d.state=g.TEXT):R==="]"?d.cdata+="]":(d.cdata+="]]"+R,d.state=g.CDATA);continue;case g.PROC_INST:R==="?"?d.state=g.PROC_INST_ENDING:C(R)?d.state=g.PROC_INST_BODY:d.procInstName+=R;continue;case g.PROC_INST_BODY:if(!d.procInstBody&&C(R))continue;R==="?"?d.state=g.PROC_INST_ENDING:d.procInstBody+=R;continue;case g.PROC_INST_ENDING:R===">"?(M(d,"onprocessinginstruction",{name:d.procInstName,body:d.procInstBody}),d.procInstName=d.procInstBody="",d.state=g.TEXT):(d.procInstBody+="?"+R,d.state=g.PROC_INST_BODY);continue;case g.OPEN_TAG:T(D,R)?d.tagName+=R:(wr(d),R===">"?Nt(d):R==="/"?d.state=g.OPEN_TAG_SLASH:(C(R)||Z(d,"Invalid character in tag name"),d.state=g.ATTRIB));continue;case g.OPEN_TAG_SLASH:R===">"?(Nt(d,!0),Cr(d)):(Z(d,"Forward-slash in opening tag not followed by >"),d.state=g.ATTRIB);continue;case g.ATTRIB:if(C(R))continue;R===">"?Nt(d):R==="/"?d.state=g.OPEN_TAG_SLASH:T(w,R)?(d.attribName=R,d.attribValue="",d.state=g.ATTRIB_NAME):Z(d,"Invalid attribute name");continue;case g.ATTRIB_NAME:R==="="?d.state=g.ATTRIB_VALUE:R===">"?(Z(d,"Attribute without value"),d.attribValue=d.attribName,Er(d),Nt(d)):C(R)?d.state=g.ATTRIB_NAME_SAW_WHITE:T(D,R)?d.attribName+=R:Z(d,"Invalid attribute name");continue;case g.ATTRIB_NAME_SAW_WHITE:if(R==="=")d.state=g.ATTRIB_VALUE;else{if(C(R))continue;Z(d,"Attribute without value"),d.tag.attributes[d.attribName]="",d.attribValue="",M(d,"onattribute",{name:d.attribName,value:""}),d.attribName="",R===">"?Nt(d):T(w,R)?(d.attribName=R,d.state=g.ATTRIB_NAME):(Z(d,"Invalid attribute name"),d.state=g.ATTRIB)}continue;case g.ATTRIB_VALUE:if(C(R))continue;O(R)?(d.q=R,d.state=g.ATTRIB_VALUE_QUOTED):(Z(d,"Unquoted attribute value"),d.state=g.ATTRIB_VALUE_UNQUOTED,d.attribValue=R);continue;case g.ATTRIB_VALUE_QUOTED:if(R!==d.q){R==="&"?d.state=g.ATTRIB_VALUE_ENTITY_Q:d.attribValue+=R;continue}Er(d),d.q="",d.state=g.ATTRIB_VALUE_CLOSED;continue;case g.ATTRIB_VALUE_CLOSED:C(R)?d.state=g.ATTRIB:R===">"?Nt(d):R==="/"?d.state=g.OPEN_TAG_SLASH:T(w,R)?(Z(d,"No whitespace between attributes"),d.attribName=R,d.attribValue="",d.state=g.ATTRIB_NAME):Z(d,"Invalid attribute name");continue;case g.ATTRIB_VALUE_UNQUOTED:if(!_(R)){R==="&"?d.state=g.ATTRIB_VALUE_ENTITY_U:d.attribValue+=R;continue}Er(d),R===">"?Nt(d):d.state=g.ATTRIB;continue;case g.CLOSE_TAG:if(d.tagName)R===">"?Cr(d):T(D,R)?d.tagName+=R:d.script?(d.script+="</"+d.tagName,d.tagName="",d.state=g.SCRIPT):(C(R)||Z(d,"Invalid tagname in closing tag"),d.state=g.CLOSE_TAG_SAW_WHITE);else{if(C(R))continue;A(w,R)?d.script?(d.script+="</"+R,d.state=g.SCRIPT):Z(d,"Invalid tagname in closing tag."):d.tagName=R}continue;case g.CLOSE_TAG_SAW_WHITE:if(C(R))continue;R===">"?Cr(d):Z(d,"Invalid characters in closing tag");continue;case g.TEXT_ENTITY:case g.ATTRIB_VALUE_ENTITY_Q:case g.ATTRIB_VALUE_ENTITY_U:var we,Ge;switch(d.state){case g.TEXT_ENTITY:we=g.TEXT,Ge="textNode";break;case g.ATTRIB_VALUE_ENTITY_Q:we=g.ATTRIB_VALUE_QUOTED,Ge="attribValue";break;case g.ATTRIB_VALUE_ENTITY_U:we=g.ATTRIB_VALUE_UNQUOTED,Ge="attribValue";break}R===";"?(d[Ge]+=pi(d),d.entity="",d.state=we):T(d.entity.length?p:E,R)?d.entity+=R:(Z(d,"Invalid character in entity name"),d[Ge]+="&"+d.entity+R,d.entity="",d.state=we);continue;default:throw new Error(d,"Unknown state: "+d.state)}return d.position>=d.bufferCheckPosition&&i(d),d}s(Vr,"write");String.fromCodePoint||function(){var m=String.fromCharCode,d=Math.floor,k=s(function(){var R=16384,ee=[],ye,we,Ge=-1,wt=arguments.length;if(!wt)return"";for(var Sr="";++Ge<wt;){var Te=Number(arguments[Ge]);if(!isFinite(Te)||Te<0||Te>1114111||d(Te)!==Te)throw RangeError("Invalid code point: "+Te);Te<=65535?ee.push(Te):(Te-=65536,ye=(Te>>10)+55296,we=Te%1024+56320,ee.push(ye,we)),(Ge+1===wt||ee.length>R)&&(Sr+=m.apply(null,ee),ee.length=0)}return Sr},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k}()})(typeof xo>"u"?xo.sax={}:xo)});var jh=P(Ba=>{(function(){"use strict";Ba.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call(Ba)});var Va=P(di=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),di.normalize=function(e){return e.toLowerCase()},di.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},di.stripPrefix=function(e){return e.replace(t,"")},di.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},di.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(di)});var Kh=P(hi=>{(function(){"use strict";var t,e,r,i,n,o,a,u,l=s(function(v,S){return function(){return v.apply(S,arguments)}},"bind"),f=s(function(v,S){for(var I in S)y.call(S,I)&&(v[I]=S[I]);function x(){this.constructor=v}return s(x,"ctor"),x.prototype=S.prototype,v.prototype=new x,v.__super__=S.prototype,v},"extend"),y={}.hasOwnProperty;a=Hh(),r=te("events"),t=jh(),o=Va(),u=te("timers").setImmediate,e=No().defaults,i=s(function(v){return typeof v=="object"&&v!=null&&Object.keys(v).length===0},"isEmpty"),n=s(function(v,S,I){var x,w,D;for(x=0,w=v.length;x<w;x++)D=v[x],S=D(S,I);return S},"processItem"),hi.Parser=function(v){f(S,v);function S(I){this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var x,w,D;if(!(this instanceof hi.Parser))return new hi.Parser(I);this.options={},w=e["0.2"];for(x in w)y.call(w,x)&&(D=w[x],this.options[x]=D);for(x in I)y.call(I,x)&&(D=I[x],this.options[x]=D);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return s(S,"Parser"),S.prototype.processAsync=function(){var I,x;try{return this.remaining.length<=this.options.chunkSize?(I=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(I),this.saxParser.close()):(I=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(I),u(this.processAsync))}catch(w){if(x=w,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(x)}},S.prototype.assignOrPush=function(I,x,w){return x in I?(I[x]instanceof Array||(I[x]=[I[x]]),I[x].push(w)):this.options.explicitArray?I[x]=[w]:I[x]=w},S.prototype.reset=function(){var I,x,w,D;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(E){return function(p){if(E.saxParser.resume(),!E.saxParser.errThrown)return E.saxParser.errThrown=!0,E.emit("error",p)}}(this),this.saxParser.onend=function(E){return function(){if(!E.saxParser.ended)return E.saxParser.ended=!0,E.emit("end",E.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,D=[],I=this.options.attrkey,x=this.options.charkey,this.saxParser.onopentag=function(E){return function(p){var C,O,_,T,A;if(_={},_[x]="",!E.options.ignoreAttrs){A=p.attributes;for(C in A)y.call(A,C)&&(!(I in _)&&!E.options.mergeAttrs&&(_[I]={}),O=E.options.attrValueProcessors?n(E.options.attrValueProcessors,p.attributes[C],C):p.attributes[C],T=E.options.attrNameProcessors?n(E.options.attrNameProcessors,C):C,E.options.mergeAttrs?E.assignOrPush(_,T,O):_[I][T]=O)}return _["#name"]=E.options.tagNameProcessors?n(E.options.tagNameProcessors,p.name):p.name,E.options.xmlns&&(_[E.options.xmlnskey]={uri:p.uri,local:p.local}),D.push(_)}}(this),this.saxParser.onclosetag=function(E){return function(){var p,C,O,_,T,A,g,j,X,M;if(A=D.pop(),T=A["#name"],(!E.options.explicitChildren||!E.options.preserveChildrenOrder)&&delete A["#name"],A.cdata===!0&&(p=A.cdata,delete A.cdata),X=D[D.length-1],A[x].match(/^\s*$/)&&!p?(C=A[x],delete A[x]):(E.options.trim&&(A[x]=A[x].trim()),E.options.normalize&&(A[x]=A[x].replace(/\s{2,}/g," ").trim()),A[x]=E.options.valueProcessors?n(E.options.valueProcessors,A[x],T):A[x],Object.keys(A).length===1&&x in A&&!E.EXPLICIT_CHARKEY&&(A=A[x])),i(A)&&(A=E.options.emptyTag!==""?E.options.emptyTag:C),E.options.validator!=null&&(M="/"+function(){var ne,We,Fe;for(Fe=[],ne=0,We=D.length;ne<We;ne++)_=D[ne],Fe.push(_["#name"]);return Fe}().concat(T).join("/"),function(){var ne;try{return A=E.options.validator(M,X&&X[T],A)}catch(We){return ne=We,E.emit("error",ne)}}()),E.options.explicitChildren&&!E.options.mergeAttrs&&typeof A=="object"){if(!E.options.preserveChildrenOrder)_={},E.options.attrkey in A&&(_[E.options.attrkey]=A[E.options.attrkey],delete A[E.options.attrkey]),!E.options.charsAsChildren&&E.options.charkey in A&&(_[E.options.charkey]=A[E.options.charkey],delete A[E.options.charkey]),Object.getOwnPropertyNames(A).length>0&&(_[E.options.childkey]=A),A=_;else if(X){X[E.options.childkey]=X[E.options.childkey]||[],g={};for(O in A)y.call(A,O)&&(g[O]=A[O]);X[E.options.childkey].push(g),delete A["#name"],Object.keys(A).length===1&&x in A&&!E.EXPLICIT_CHARKEY&&(A=A[x])}}return D.length>0?E.assignOrPush(X,T,A):(E.options.explicitRoot&&(j=A,A={},A[T]=j),E.resultObject=A,E.saxParser.ended=!0,E.emit("end",E.resultObject))}}(this),w=function(E){return function(p){var C,O;if(O=D[D.length-1],O)return O[x]+=p,E.options.explicitChildren&&E.options.preserveChildrenOrder&&E.options.charsAsChildren&&(E.options.includeWhiteChars||p.replace(/\\n/g,"").trim()!=="")&&(O[E.options.childkey]=O[E.options.childkey]||[],C={"#name":"__text__"},C[x]=p,E.options.normalize&&(C[x]=C[x].replace(/\s{2,}/g," ").trim()),O[E.options.childkey].push(C)),O}}(this),this.saxParser.ontext=w,this.saxParser.oncdata=function(E){return function(p){var C;if(C=w(p),C)return C.cdata=!0}}(this)},S.prototype.parseString=function(I,x){var w;x!=null&&typeof x=="function"&&(this.on("end",function(D){return this.reset(),x(null,D)}),this.on("error",function(D){return this.reset(),x(D)}));try{return I=I.toString(),I.trim()===""?(this.emit("end",null),!0):(I=t.stripBOM(I),this.options.async?(this.remaining=I,u(this.processAsync),this.saxParser):this.saxParser.write(I).close())}catch(D){if(w=D,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw w}else return this.emit("error",w),this.saxParser.errThrown=!0}},S}(r.EventEmitter),hi.parseString=function(v,S,I){var x,w,D;return I!=null?(typeof I=="function"&&(x=I),typeof S=="object"&&(w=S)):(typeof S=="function"&&(x=S),w={}),D=new hi.Parser(w),D.parseString(v,x)}}).call(hi)});var Xh=P(Mr=>{(function(){"use strict";var t,e,r,i,n=s(function(a,u){for(var l in u)o.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return s(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),o={}.hasOwnProperty;e=No(),t=zh(),r=Kh(),i=Va(),Mr.defaults=e.defaults,Mr.processors=i,Mr.ValidationError=function(a){n(u,a);function u(l){this.message=l}return s(u,"ValidationError"),u}(Error),Mr.Builder=t.Builder,Mr.Parser=r.Parser,Mr.parseString=r.parseString}).call(Mr)});var Zh=P((xL,$h)=>{var Gh=V(),us=Gh.util,Tg=Gh.Model.Shape,bg=Xh(),Ag={explicitCharkey:!1,trim:!1,normalize:!1,explicitRoot:!1,emptyTag:null,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,validator:null};function Jh(){}s(Jh,"NodeXmlParser");Jh.prototype.parse=function(t,e){e=e||{};var r=null,i=null,n=new bg.Parser(Ag);if(n.parseString(t,function(a,u){i=a,r=u}),r){var o=Nr(r,e);return r.ResponseMetadata&&(o.ResponseMetadata=Nr(r.ResponseMetadata[0],{})),o}else{if(i)throw us.error(i,{code:"XMLParserError",retryable:!0});return Nr({},e)}};function Nr(t,e){switch(e.type){case"structure":return Ig(t,e);case"map":return Rg(t,e);case"list":return Qh(t,e);case void 0:case null:return Og(t);default:return Yh(t,e)}}s(Nr,"parseXml");function Ig(t,e){var r={};return t===null||us.each(e.members,function(i,n){var o=n.name;if(Object.prototype.hasOwnProperty.call(t,o)&&Array.isArray(t[o])){var a=t[o];n.flattened||(a=a[0]),r[i]=Nr(a,n)}else n.isXmlAttribute&&t.$&&Object.prototype.hasOwnProperty.call(t.$,o)?r[i]=Yh(t.$[o],n):n.type==="list"&&!e.api.xmlNoDefaultLists&&(r[i]=n.defaultValue)}),r}s(Ig,"parseStructure");function Rg(t,e){var r={};if(t===null)return r;var i=e.key.name||"key",n=e.value.name||"value",o=e.flattened?t:t.entry;return Array.isArray(o)&&us.arrayEach(o,function(a){r[a[i][0]]=Nr(a[n][0],e.value)}),r}s(Rg,"parseMap");function Qh(t,e){var r=[],i=e.member.name||"member";return e.flattened?us.arrayEach(t,function(n){r.push(Nr(n,e.member))}):t&&Array.isArray(t[i])&&us.arrayEach(t[i],function(n){r.push(Nr(n,e.member))}),r}s(Qh,"parseList");function Yh(t,e){return t&&t.$&&t.$.encoding==="base64"&&(e=new Tg.create({type:t.$.encoding})),t&&t._&&(t=t._),typeof e.toType=="function"?e.toType(t):t}s(Yh,"parseScalar");function Og(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t)){var e=[];for(i=0;i<t.length;i++)e.push(Nr(t[i],{}));return e}var r=Object.keys(t),i;if(r.length===0||r.length===1&&r[0]==="$")return{};var n={};for(i=0;i<r.length;i++){var o=r[i],a=t[o];o!=="$"&&(a.length>1?n[o]=Qh(a,{member:{}}):n[o]=Nr(a[0],{}))}return n}s(Og,"parseUnknown");$h.exports=Jh});var tf=P(()=>{var ge=V(),Dg=ge.util.stream.Stream,ef=ge.util.stream.Transform,Pg=ge.util.stream.Readable;Xs();var _g="AWS_NODEJS_CONNECTION_REUSE_ENABLED";ge.NodeHttpClient=ge.util.inherit({handleRequest:s(function(e,r,i,n){var o=this,a=e.endpoint,u="";r||(r={}),r.proxy&&(u=a.protocol+"//"+a.hostname,a.port!==80&&a.port!==443&&(u+=":"+a.port),a=new ge.Endpoint(r.proxy));var l=a.protocol==="https:",f=l?te("https"):te("http"),y={host:a.hostname,port:a.port,method:e.method,headers:e.headers,path:u+e.path};r.agent||(y.agent=this.getAgent(l,{keepAlive:process.env[_g]==="1"})),ge.util.update(y,r),delete y.proxy,delete y.timeout;var v=f.request(y,function(x){v.didCallback||(i(x),x.emit("headers",x.statusCode,x.headers,x.statusMessage))});if(e.stream=v,v.didCallback=!1,r.connectTimeout){var S;v.on("socket",function(x){x.connecting&&(S=setTimeout(s(function(){v.didCallback||(v.didCallback=!0,v.abort(),n(ge.util.error(new Error("Socket timed out without establishing a connection"),{code:"TimeoutError"})))},"connectTimeout"),r.connectTimeout),x.on("connect",function(){clearTimeout(S),S=null}))})}v.setTimeout(r.timeout||0,function(){if(!v.didCallback){v.didCallback=!0;var x="Connection timed out after "+r.timeout+"ms";n(ge.util.error(new Error(x),{code:"TimeoutError"})),v.abort()}}),v.on("error",function(x){S&&(clearTimeout(S),S=null),!v.didCallback&&(v.didCallback=!0,x.code==="ECONNRESET"||x.code==="EPIPE"||x.code==="ETIMEDOUT"?n(ge.util.error(x,{code:"TimeoutError"})):n(x))});var I=e.headers.Expect||e.headers.expect;return I==="100-continue"?v.once("continue",function(){o.writeBody(v,e)}):this.writeBody(v,e),v},"handleRequest"),writeBody:s(function(e,r){var i=r.body,n=parseInt(r.headers["Content-Length"],10);if(i instanceof Dg){var o=this.progressStream(e,n);o?i.pipe(o).pipe(e):i.pipe(e)}else i?(e.once("finish",function(){e.emit("sendProgress",{loaded:n,total:n})}),e.end(i)):e.end()},"writeBody"),getAgent:s(function(e,r){var i=e?te("https"):te("http");return e?(ge.NodeHttpClient.sslAgent||(ge.NodeHttpClient.sslAgent=new i.Agent(ge.util.merge({rejectUnauthorized:process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"},r||{})),ge.NodeHttpClient.sslAgent.setMaxListeners(0),Object.defineProperty(ge.NodeHttpClient.sslAgent,"maxSockets",{enumerable:!0,get:function(){var n=50,o=i.globalAgent;return o&&o.maxSockets!==1/0&&typeof o.maxSockets=="number"?o.maxSockets:n}})),ge.NodeHttpClient.sslAgent):(ge.NodeHttpClient.agent||(ge.NodeHttpClient.agent=new i.Agent(r)),ge.NodeHttpClient.agent)},"getAgent"),progressStream:s(function(e,r){if(!(typeof ef>"u")){var i=0,n=new ef;return n._transform=function(o,a,u){o&&(i+=o.length,e.emit("sendProgress",{loaded:i,total:r})),u(null,o)},n}},"progressStream"),emitter:null});ge.HttpClient.prototype=ge.NodeHttpClient.prototype;ge.HttpClient.streamsApiVersion=Pg?2:1});var rf=P(()=>{var Tt=V(),qg=te("fs"),kg=Fr(),Lg=Tt.util.iniLoader;Tt.TokenFileWebIdentityCredentials=Tt.util.inherit(Tt.Credentials,{constructor:s(function(e){Tt.Credentials.call(this),this.data=null,this.clientConfig=Tt.util.copy(e||{})},"TokenFileWebIdentityCredentials"),getParamsFromEnv:s(function(){var e="AWS_WEB_IDENTITY_TOKEN_FILE",r="AWS_ROLE_ARN";if(process.env[e]&&process.env[r])return[{envTokenFile:process.env[e],roleArn:process.env[r],roleSessionName:process.env.AWS_ROLE_SESSION_NAME}]},"getParamsFromEnv"),getParamsFromSharedConfig:s(function(){var e=Tt.util.getProfilesFromSharedConfig(Lg),r=process.env.AWS_PROFILE||Tt.util.defaultProfile,i=e[r]||{};if(Object.keys(i).length===0)throw Tt.util.error(new Error("Profile "+r+" not found"),{code:"TokenFileWebIdentityCredentialsProviderFailure"});for(var n=[];!i.web_identity_token_file&&i.source_profile;){n.unshift({roleArn:i.role_arn,roleSessionName:i.role_session_name});var o=i.source_profile;i=e[o]}return n.unshift({envTokenFile:i.web_identity_token_file,roleArn:i.role_arn,roleSessionName:i.role_session_name}),n},"getParamsFromSharedConfig"),refresh:s(function(e){this.coalesceRefresh(e||Tt.util.fn.callback)},"refresh"),assumeRoleChaining:s(function(e,r){var i=this;if(e.length===0)i.service.credentialsFrom(i.data,i),r();else{var n=e.shift();i.service.config.credentials=i.service.credentialsFrom(i.data,i),i.service.assumeRole({RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(o,a){i.data=null,o?r(o):(i.data=a,i.assumeRoleChaining(e,r))})}},"assumeRoleChaining"),load:s(function(e){var r=this;try{var i=r.getParamsFromEnv();if(i||(i=r.getParamsFromSharedConfig()),i){var n=i.shift(),o=qg.readFileSync(n.envTokenFile,{encoding:"ascii"});r.service||r.createClients(),r.service.assumeRoleWithWebIdentity({WebIdentityToken:o,RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(a,u){r.data=null,a?e(a):(r.data=u,r.assumeRoleChaining(i,e))})}}catch(a){e(a)}},"load"),createClients:function(){if(!this.service){var t=Tt.util.merge({},this.clientConfig);this.service=new kg(t),this.service.retryableError=function(e){return e.code==="IDPCommunicationErrorException"||e.code==="InvalidIdentityToken"?!0:Tt.Service.prototype.retryableError.call(this,e)}}}})});var sf=P((RL,nf)=>{var Fg=s(function(){return{IPv4:"http://169.254.169.254",IPv6:"http://[fd00:ec2::254]"}},"getEndpoint");nf.exports=Fg});var Ua=P((DL,of)=>{var Mg=s(function(){return{IPv4:"IPv4",IPv6:"IPv6"}},"getEndpointMode");of.exports=Mg});var uf=P((_L,af)=>{var Wg="AWS_EC2_METADATA_SERVICE_ENDPOINT",Bg="ec2_metadata_service_endpoint",Vg=s(function(){return{environmentVariableSelector:function(t){return t[Wg]},configFileSelector:function(t){return t[Bg]},default:void 0}},"getEndpointConfigOptions");af.exports=Vg});var lf=P((kL,cf)=>{var Ug=Ua()(),zg="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Hg="ec2_metadata_service_endpoint_mode",jg=s(function(){return{environmentVariableSelector:function(t){return t[zg]},configFileSelector:function(t){return t[Hg]},default:Ug.IPv4}},"getEndpointModeConfigOptions");cf.exports=jg});var mf=P((FL,pf)=>{var df=V(),hf=sf()(),ff=Ua()(),Kg=uf()(),Xg=lf()(),Gg=s(function(){var t=df.util.loadConfig(Kg);if(t!==void 0)return t;var e=df.util.loadConfig(Xg);switch(e){case ff.IPv4:return hf.IPv4;case ff.IPv6:return hf.IPv6;default:throw new Error("Unsupported endpoint mode: "+e)}},"getMetadataServiceEndpoint");pf.exports=Gg});var gf=P((WL,vf)=>{var Bt=V();Xs();var Jg=Bt.util.inherit,Qg=mf(),yf=te("url").URL;Bt.MetadataService=Jg({endpoint:Qg(),httpOptions:{timeout:0},disableFetchToken:!1,constructor:s(function(e){e&&e.host&&(e.endpoint="http://"+e.host,delete e.host),Bt.util.update(this,e)},"MetadataService"),request:s(function(e,r,i){if(arguments.length===2&&(i=r,r={}),process.env[Bt.util.imdsDisabledEnv]){i(new Error("EC2 Instance Metadata Service access disabled"));return}e=e||"/",yf&&new yf(this.endpoint);var n=new Bt.HttpRequest(this.endpoint+e);n.method=r.method||"GET",r.headers&&(n.headers=r.headers),Bt.util.handleRequestWithRetries(n,this,i)},"request"),loadCredentialsCallbacks:[],fetchMetadataToken:s(function(e){var r=this,i="/latest/api/token";r.request(i,{method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}},e)},"fetchMetadataToken"),fetchCredentials:s(function(e,r){var i=this,n="/latest/meta-data/iam/security-credentials/";i.request(n,e,function(o,a){if(o){i.disableFetchToken=o.statusCode!==401,r(Bt.util.error(o,{message:"EC2 Metadata roleName request returned error"}));return}a=a.split(`
27
- `)[0],i.request(n+a,e,function(u,l){if(u){i.disableFetchToken=u.statusCode!==401,r(Bt.util.error(u,{message:"EC2 Metadata creds request returned error"}));return}try{var f=JSON.parse(l);r(null,f)}catch(y){r(y)}})})},"fetchCredentials"),loadCredentials:s(function(e){var r=this;if(r.loadCredentialsCallbacks.push(e),r.loadCredentialsCallbacks.length>1)return;function i(n,o){for(var a;(a=r.loadCredentialsCallbacks.shift())!==void 0;)a(n,o)}s(i,"callbacks"),r.disableFetchToken?r.fetchCredentials({},i):r.fetchMetadataToken(function(n,o){if(n){if(n.code==="TimeoutError")r.disableFetchToken=!0;else if(n.retryable===!0){i(Bt.util.error(n,{message:"EC2 Metadata token request returned error"}));return}else if(n.statusCode===400){i(Bt.util.error(n,{message:"EC2 Metadata token request returned 400"}));return}}var a={};o&&(a.headers={"x-aws-ec2-metadata-token":o}),r.fetchCredentials(a,i)})},"loadCredentials")});vf.exports=Bt.MetadataService});var Nf=P(()=>{var gt=V();gf();gt.EC2MetadataCredentials=gt.util.inherit(gt.Credentials,{constructor:s(function(e){gt.Credentials.call(this),e=e?gt.util.copy(e):{},e=gt.util.merge({maxRetries:this.defaultMaxRetries},e),e.httpOptions||(e.httpOptions={}),e.httpOptions=gt.util.merge({timeout:this.defaultTimeout,connectTimeout:this.defaultConnectTimeout},e.httpOptions),this.metadataService=new gt.MetadataService(e),this.logger=e.logger||gt.config&&gt.config.logger},"EC2MetadataCredentials"),defaultTimeout:1e3,defaultConnectTimeout:1e3,defaultMaxRetries:3,originalExpiration:void 0,refresh:s(function(e){this.coalesceRefresh(e||gt.util.fn.callback)},"refresh"),load:s(function(e){var r=this;r.metadataService.loadCredentials(function(i,n){i?r.hasLoadedCredentials()?(r.extendExpirationIfExpired(),e()):e(i):(r.setCredentials(n),r.extendExpirationIfExpired(),e())})},"load"),hasLoadedCredentials:s(function(){return this.AccessKeyId&&this.secretAccessKey},"hasLoadedCredentials"),extendExpirationIfExpired:s(function(){if(this.needsRefresh()){this.originalExpiration=this.originalExpiration||this.expireTime,this.expired=!1;var e=15*60+Math.floor(Math.random()*5*60),r=gt.util.date.getDate().getTime();this.expireTime=new Date(r+e*1e3),this.logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again at "+this.expireTime+`
28
- For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`)}},"extendExpirationIfExpired"),setCredentials:s(function(e){var r=gt.util.date.getDate().getTime(),i=new Date(e.Expiration);this.expired=r>=i,this.metadata=e,this.accessKeyId=e.AccessKeyId,this.secretAccessKey=e.SecretAccessKey,this.sessionToken=e.Token,this.expireTime=i},"setCredentials")})});var Ef=P(()=>{var Ke=V(),za="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Eo="AWS_CONTAINER_CREDENTIALS_FULL_URI",Yg="AWS_CONTAINER_AUTHORIZATION_TOKEN",$g=["https:"],wf=["http:","https:"],xf=["localhost","127.0.0.1"],Zg="169.254.170.2";Ke.RemoteCredentials=Ke.util.inherit(Ke.Credentials,{constructor:s(function(e){Ke.Credentials.call(this),e=e?Ke.util.copy(e):{},e.httpOptions||(e.httpOptions={}),e.httpOptions=Ke.util.merge(this.httpOptions,e.httpOptions),Ke.util.update(this,e)},"RemoteCredentials"),httpOptions:{timeout:1e3},maxRetries:3,isConfiguredForEcsCredentials:s(function(){return Boolean(process&&process.env&&(process.env[za]||process.env[Eo]))},"isConfiguredForEcsCredentials"),getECSFullUri:s(function(){if(process&&process.env){var e=process.env[za],r=process.env[Eo];if(e)return"http://"+Zg+e;if(r){var i=Ke.util.urlParse(r);if(wf.indexOf(i.protocol)<0)throw Ke.util.error(new Error("Unsupported protocol: AWS.RemoteCredentials supports "+wf.join(",")+" only; "+i.protocol+" requested."),{code:"ECSCredentialsProviderFailure"});if($g.indexOf(i.protocol)<0&&xf.indexOf(i.hostname)<0)throw Ke.util.error(new Error("Unsupported hostname: AWS.RemoteCredentials only supports "+xf.join(",")+" for "+i.protocol+"; "+i.protocol+"//"+i.hostname+" requested."),{code:"ECSCredentialsProviderFailure"});return r}else throw Ke.util.error(new Error("Variable "+za+" or "+Eo+" must be set to use AWS.RemoteCredentials."),{code:"ECSCredentialsProviderFailure"})}else throw Ke.util.error(new Error("No process info available"),{code:"ECSCredentialsProviderFailure"})},"getECSFullUri"),getECSAuthToken:s(function(){if(process&&process.env&&process.env[Eo])return process.env[Yg]},"getECSAuthToken"),credsFormatIsValid:s(function(e){return!!e.accessKeyId&&!!e.secretAccessKey&&!!e.sessionToken&&!!e.expireTime},"credsFormatIsValid"),formatCreds:s(function(e){return e.credentials&&(e=e.credentials),{expired:!1,accessKeyId:e.accessKeyId||e.AccessKeyId,secretAccessKey:e.secretAccessKey||e.SecretAccessKey,sessionToken:e.sessionToken||e.Token,expireTime:new Date(e.expiration||e.Expiration)}},"formatCreds"),request:s(function(e,r){var i=new Ke.HttpRequest(e);i.method="GET",i.headers.Accept="application/json";var n=this.getECSAuthToken();n&&(i.headers.Authorization=n),Ke.util.handleRequestWithRetries(i,this,r)},"request"),refresh:s(function(e){this.coalesceRefresh(e||Ke.util.fn.callback)},"refresh"),load:s(function(e){var r=this,i;try{i=this.getECSFullUri()}catch(n){e(n);return}this.request(i,function(n,o){if(!n)try{o=JSON.parse(o);var a=r.formatCreds(o);if(!r.credsFormatIsValid(a))throw Ke.util.error(new Error("Response data is not in valid format"),{code:"ECSCredentialsProviderFailure"});Ke.util.update(r,a)}catch(u){n=u}e(n,a)})},"load")})});var Sf=P(()=>{var Cf=V();Cf.ECSCredentials=Cf.RemoteCredentials});var Tf=P(()=>{var Wr=V();Wr.EnvironmentCredentials=Wr.util.inherit(Wr.Credentials,{constructor:s(function(e){Wr.Credentials.call(this),this.envPrefix=e,this.get(function(){})},"EnvironmentCredentials"),refresh:s(function(e){if(e||(e=Wr.util.fn.callback),!process||!process.env){e(Wr.util.error(new Error("No process info or environment variables available"),{code:"EnvironmentCredentialsProviderFailure"}));return}for(var r=["ACCESS_KEY_ID","SECRET_ACCESS_KEY","SESSION_TOKEN"],i=[],n=0;n<r.length;n++){var o="";if(this.envPrefix&&(o=this.envPrefix+"_"),i[n]=process.env[o+r[n]],!i[n]&&r[n]!=="SESSION_TOKEN"){e(Wr.util.error(new Error("Variable "+o+r[n]+" not set."),{code:"EnvironmentCredentialsProviderFailure"}));return}}this.expired=!1,Wr.Credentials.apply(this,i),e()},"refresh")})});var bf=P(()=>{var Br=V();Br.FileSystemCredentials=Br.util.inherit(Br.Credentials,{constructor:s(function(e){Br.Credentials.call(this),this.filename=e,this.get(function(){})},"FileSystemCredentials"),refresh:s(function(e){e||(e=Br.util.fn.callback);try{var r=JSON.parse(Br.util.readFileSync(this.filename));if(Br.Credentials.call(this,r),!this.accessKeyId||!this.secretAccessKey)throw Br.util.error(new Error("Credentials not set in "+this.filename),{code:"FileSystemCredentialsProviderFailure"});this.expired=!1,e()}catch(i){e(i)}},"refresh")})});var If=P(()=>{var Xe=V(),eN=Fr(),Af=Xe.util.iniLoader,tN="us-east-1";Xe.SharedIniFileCredentials=Xe.util.inherit(Xe.Credentials,{constructor:s(function(e){Xe.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Xe.util.defaultProfile,this.disableAssumeRole=Boolean(e.disableAssumeRole),this.preferStaticCredentials=Boolean(e.preferStaticCredentials),this.tokenCodeFn=e.tokenCodeFn||null,this.httpOptions=e.httpOptions||null,this.get(e.callback||Xe.util.fn.noop)},"SharedIniFileCredentials"),load:s(function(e){var r=this;try{var i=Xe.util.getProfilesFromSharedConfig(Af,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Xe.util.error(new Error("Profile "+this.profile+" not found"),{code:"SharedIniFileCredentialsProviderFailure"});var o=Boolean(this.preferStaticCredentials&&n.aws_access_key_id&&n.aws_secret_access_key);if(n.role_arn&&!o){this.loadRoleProfile(i,n,function(a,u){a?e(a):(r.expired=!1,r.accessKeyId=u.Credentials.AccessKeyId,r.secretAccessKey=u.Credentials.SecretAccessKey,r.sessionToken=u.Credentials.SessionToken,r.expireTime=u.Credentials.Expiration,e(null))});return}if(this.accessKeyId=n.aws_access_key_id,this.secretAccessKey=n.aws_secret_access_key,this.sessionToken=n.aws_session_token,!this.accessKeyId||!this.secretAccessKey)throw Xe.util.error(new Error("Credentials not set for profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});this.expired=!1,e(null)}catch(a){e(a)}},"load"),refresh:s(function(e){Af.clearCachedFiles(),this.coalesceRefresh(e||Xe.util.fn.callback,this.disableAssumeRole)},"refresh"),loadRoleProfile:s(function(e,r,i){if(this.disableAssumeRole)throw Xe.util.error(new Error("Role assumption profiles are disabled. Failed to load profile "+this.profile+" from "+e.filename),{code:"SharedIniFileCredentialsProviderFailure"});var n=this,o=r.role_arn,a=r.role_session_name,u=r.external_id,l=r.mfa_serial,f=r.source_profile,y=r.region||tN;if(!f)throw Xe.util.error(new Error("source_profile is not set using profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});var v=e[f];if(typeof v!="object")throw Xe.util.error(new Error("source_profile "+f+" using profile "+this.profile+" does not exist"),{code:"SharedIniFileCredentialsProviderFailure"});var S=new Xe.SharedIniFileCredentials(Xe.util.merge(this.options||{},{profile:f,preferStaticCredentials:!0}));this.roleArn=o;var I=new eN({credentials:S,region:y,httpOptions:this.httpOptions}),x={RoleArn:o,RoleSessionName:a||"aws-sdk-js-"+Date.now()};if(u&&(x.ExternalId=u),l&&n.tokenCodeFn){x.SerialNumber=l,n.tokenCodeFn(l,function(w,D){if(w){var E;w instanceof Error?E=w.message:E=w,i(Xe.util.error(new Error("Error fetching MFA token: "+E),{code:"SharedIniFileCredentialsProviderFailure"}));return}x.TokenCode=D,I.assumeRole(x,i)});return}I.assumeRole(x,i)},"loadRoleProfile")})});var Rf=P(()=>{var Me=V(),rN=te("path"),iN=te("crypto"),Ha=Me.util.iniLoader;Me.SsoCredentials=Me.util.inherit(Me.Credentials,{constructor:s(function(e){Me.Credentials.call(this),e=e||{},this.errorCode="SsoCredentialsProviderFailure",this.expired=!0,this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Me.util.defaultProfile,this.service=e.ssoClient,this.httpOptions=e.httpOptions||null,this.get(e.callback||Me.util.fn.noop)},"SsoCredentials"),load:s(function(e){var r=9e5,i=this;try{var n=Me.util.getProfilesFromSharedConfig(Ha,this.filename),o=n[this.profile]||{};if(Object.keys(o).length===0)throw Me.util.error(new Error("Profile "+this.profile+" not found"),{code:i.errorCode});if(!o.sso_start_url||!o.sso_account_id||!o.sso_region||!o.sso_role_name)throw Me.util.error(new Error("Profile "+this.profile+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:i.errorCode});var a=iN.createHash("sha1"),u=a.update(o.sso_start_url).digest("hex")+".json",l=rN.join(Ha.getHomeDir(),".aws","sso","cache",u),f=Me.util.readFileSync(l),y=null;if(f&&(y=JSON.parse(f)),!y)throw Me.util.error(new Error("Cached credentials not found under "+this.profile+" profile. Please make sure you log in with aws sso login first"),{code:i.errorCode});if(!y.startUrl||!y.region||!y.accessToken||!y.expiresAt)throw Me.util.error(new Error("Cached credentials are missing required properties. Try running aws sso login."));if(new Date(y.expiresAt).getTime()-Date.now()<=r)throw Me.util.error(new Error("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile."));(!i.service||i.service.config.region!==o.sso_region)&&(i.service=new Me.SSO({region:o.sso_region,httpOptions:this.httpOptions}));var v={accessToken:y.accessToken,accountId:o.sso_account_id,roleName:o.sso_role_name};i.service.getRoleCredentials(v,function(S,I){if(S||!I||!I.roleCredentials)e(Me.util.error(S||new Error('Please log in using "aws sso login"'),{code:i.errorCode}),null);else{if(!I.roleCredentials.accessKeyId||!I.roleCredentials.secretAccessKey||!I.roleCredentials.sessionToken||!I.roleCredentials.expiration)throw Me.util.error(new Error("SSO returns an invalid temporary credential."));i.expired=!1,i.accessKeyId=I.roleCredentials.accessKeyId,i.secretAccessKey=I.roleCredentials.secretAccessKey,i.sessionToken=I.roleCredentials.sessionToken,i.expireTime=new Date(I.roleCredentials.expiration),e(null)}})}catch(S){e(S)}},"load"),refresh:s(function(e){Ha.clearCachedFiles(),this.coalesceRefresh(e||Me.util.fn.callback)},"refresh")})});var Of=P(()=>{var bt=V();bt.Token=bt.util.inherit({constructor:s(function(e){if(bt.util.hideProperties(this,["token"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1){var e=arguments[0];this.token=e.token,this.expireTime=e.expireTime}},"Token"),expiryWindow:15,needsRefresh:s(function(){var e=bt.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.token},"needsRefresh"),get:s(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:s(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:s(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(s(function(o){bt.util.arrayEach(i.refreshCallbacks,function(a){r?a(o):bt.util.defer(function(){a(o)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:s(function(e){e()},"load")});bt.Token.addPromisesToClass=s(function(e){this.prototype.getPromise=bt.util.promisifyMethod("get",e),this.prototype.refreshPromise=bt.util.promisifyMethod("refresh",e)},"addPromisesToClass");bt.Token.deletePromisesFromClass=s(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");bt.util.addPromises(bt.Token)});var Df=P(()=>{var Vt=V();Vt.TokenProviderChain=Vt.util.inherit(Vt.Token,{constructor:s(function(e){e?this.providers=e:this.providers=Vt.TokenProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"TokenProviderChain"),resolve:s(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Vt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var f=n[i++];typeof f=="function"?l=f.call():l=f,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var o=a;s(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Vt.TokenProviderChain.defaultProviders=[];Vt.TokenProviderChain.addPromisesToClass=s(function(e){this.prototype.resolvePromise=Vt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Vt.TokenProviderChain.deletePromisesFromClass=s(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Vt.util.addPromises(Vt.TokenProviderChain)});var qf=P(()=>{var Le=V(),nN=te("crypto"),Pf=te("fs"),sN=te("path"),Co=Le.util.iniLoader,_f=0,fi=s(function(e,r){if(!e[r])throw Le.util.error(new Error('Key "'+r+'" not present in SSO Token'),{code:"SSOTokenProviderFailure"})},"validateTokenKey"),ja=s(function(e,r,i){if(r>e)i(null);else throw Le.util.error(new Error('SSO Token refresh failed. Please log in using "aws sso login"'),{code:"SSOTokenProviderFailure"})},"refreshUnsuccessful");Le.SSOTokenProvider=Le.util.inherit(Le.Token,{expiryWindow:5*60,constructor:s(function(e){Le.Token.call(this),e=e||{},this.expired=!0,this.profile=e.profile||process.env.AWS_PROFILE||Le.util.defaultProfile,this.get(e.callback||Le.util.fn.noop)},"SSOTokenProvider"),load:s(function(e){var r=this,i=Co.loadFrom({isConfig:!0}),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Le.util.error(new Error('Profile "'+this.profile+'" not found'),{code:"SSOTokenProviderFailure"});if(!n.sso_session)throw Le.util.error(new Error('Profile "'+profileName+'" is missing required property "sso_session".'),{code:"SSOTokenProviderFailure"});var o=n.sso_session,a=Co.loadSsoSessionsFrom(),u=a[o];if(u)if(u.sso_start_url){if(!u.sso_region)throw Le.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_region".'),{code:"SSOTokenProviderFailure"})}else throw Le.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_start_url".'),{code:"SSOTokenProviderFailure"});else throw Le.util.error(new Error('Sso session "'+o+'" not found'),{code:"SSOTokenProviderFailure"});var l=nN.createHash("sha1"),f=l.update(o).digest("hex")+".json",y=sN.join(Co.getHomeDir(),".aws","sso","cache",f),v=JSON.parse(Pf.readFileSync(y));if(!v)throw Le.util.error(new Error('Cached token not found. Please log in using "aws sso login" for profile "'+this.profile+'".'),{code:"SSOTokenProviderFailure"});fi(v,"accessToken"),fi(v,"expiresAt");var S=Le.util.date.getDate().getTime(),I=new Date(S+this.expiryWindow*1e3),x=new Date(v.expiresAt);if(x>I){r.token=v.accessToken,r.expireTime=x,r.expired=!1,e(null);return}if(S-_f<30*1e3){ja(S,x,e);return}fi(v,"clientId"),fi(v,"clientSecret"),fi(v,"refreshToken"),(!r.service||r.service.config.region!==u.sso_region)&&(r.service=new Le.SSOOIDC({region:u.sso_region}));var w={clientId:v.clientId,clientSecret:v.clientSecret,refreshToken:v.refreshToken,grantType:"refresh_token"};_f=Le.util.date.getDate().getTime(),r.service.createToken(w,function(D,E){if(D||!E)ja(S,x,e);else try{fi(E,"accessToken"),fi(E,"expiresIn"),r.expired=!1,r.token=E.accessToken,r.expireTime=new Date(Date.now()+E.expiresIn*1e3),e(null);try{v.accessToken=E.accessToken,v.expiresAt=r.expireTime.toISOString(),v.refreshToken=E.refreshToken,Pf.writeFileSync(y,JSON.stringify(v,null,2))}catch{}}catch{ja(S,x,e)}})},"load"),refresh:s(function(e){Co.clearCachedFiles(),this.coalesceRefresh(e||Le.util.fn.callback)},"refresh")})});var vo=P((yF,Ff)=>{var Ne=Se(),Lf=ma(),oN=Lf.isFipsRegion,aN=Lf.getRealRegion;Ne.isBrowser=function(){return!1};Ne.isNode=function(){return!0};Ne.crypto.lib=te("crypto");Ne.Buffer=te("buffer").Buffer;Ne.domain=te("domain");Ne.stream=te("stream");Ne.url=te("url");Ne.querystring=te("querystring");Ne.environment="nodejs";Ne.createEventStream=Ne.stream.Readable?yd().createEventStream:wd().createEventStream;Ne.realClock=Ed();Ne.clientSideMonitoring={Publisher:Sd().Publisher,configProvider:Ad()};Ne.iniLoader=Pd().iniLoader;Ne.getSystemErrorName=te("util").getSystemErrorName;Ne.loadConfig=function(t){var e=t.environmentVariableSelector(process.env);if(e!==void 0)return e;var r={};try{r=Ne.iniLoader?Ne.iniLoader.loadFrom({isConfig:!0,filename:process.env[Ne.sharedConfigFileEnv]}):{}}catch{}var i=r[process.env.AWS_PROFILE||Ne.defaultProfile]||{},n=t.configFileSelector(i);return n!==void 0?n:typeof t.default=="function"?t.default():t.default};var ue;Ff.exports=ue=V();va();ga();Bd();Vd();Ud();Gd();Jd();qa();ue.XML.Parser=Zh();tf();Pa();rf();Nf();Ef();Sf();Tf();bf();If();qa();Rf();ue.CredentialProviderChain.defaultProviders=[function(){return new ue.EnvironmentCredentials("AWS")},function(){return new ue.EnvironmentCredentials("AMAZON")},function(){return new ue.SsoCredentials},function(){return new ue.SharedIniFileCredentials},function(){return new ue.ECSCredentials},function(){return new ue.ProcessCredentials},function(){return new ue.TokenFileWebIdentityCredentials},function(){return new ue.EC2MetadataCredentials}];Of();Df();qf();ue.TokenProviderChain.defaultProviders=[function(){return new ue.SSOTokenProvider}];var kf=s(function(){var t=process.env,e=t.AWS_REGION||t.AMAZON_REGION;if(t[ue.util.configOptInEnv])for(var r=[{filename:t[ue.util.sharedCredentialsFileEnv]},{isConfig:!0,filename:t[ue.util.sharedConfigFileEnv]}],i=ue.util.iniLoader;!e&&r.length;){var n={},o=r.shift();try{n=i.loadFrom(o)}catch(u){if(o.isConfig)throw u}var a=n[t.AWS_PROFILE||ue.util.defaultProfile];e=a&&a.region}return e},"getRegion"),So=s(function(t){return t==="true"?!0:t==="false"?!1:void 0},"getBooleanValue"),uN={environmentVariableSelector:function(t){return So(t.AWS_USE_FIPS_ENDPOINT)},configFileSelector:function(t){return So(t.use_fips_endpoint)},default:!1},cN={environmentVariableSelector:function(t){return So(t.AWS_USE_DUALSTACK_ENDPOINT)},configFileSelector:function(t){return So(t.use_dualstack_endpoint)},default:!1};ue.util.update(ue.Config.prototype.keys,{credentials:function(){var t=null;return new ue.CredentialProviderChain([function(){return new ue.EnvironmentCredentials("AWS")},function(){return new ue.EnvironmentCredentials("AMAZON")},function(){return new ue.SharedIniFileCredentials({disableAssumeRole:!0})}]).resolve(function(e,r){e||(t=r)}),t},credentialProvider:function(){return new ue.CredentialProviderChain},logger:function(){return process.env.AWSJS_DEBUG?console:null},region:function(){var t=kf();return t?aN(t):void 0},tokenProvider:function(){return new ue.TokenProviderChain},useFipsEndpoint:function(){var t=kf();return oN(t)?!0:Ne.loadConfig(uN)},useDualstackEndpoint:function(){return Ne.loadConfig(cN)}});ue.config=new ue.Config});var Mf=P(()=>{var Ka=V();Ka.util.update(Ka.RDSDataService.prototype,{retryableError:s(function(e){if(e.code==="BadRequestException"&&e.message&&e.message.match(/^Communications link failure/)&&e.statusCode===400)return!0;var r=Ka.Service.prototype.retryableError;return r.call(this,e)},"retryableError")})});var Wf=P((xF,lN)=>{lN.exports={version:"2.0",metadata:{apiVersion:"2018-08-01",endpointPrefix:"rds-data",jsonVersion:"1.1",protocol:"rest-json",serviceFullName:"AWS RDS DataService",serviceId:"RDS Data",signatureVersion:"v4",signingName:"rds-data",uid:"rds-data-2018-08-01"},operations:{BatchExecuteStatement:{http:{requestUri:"/BatchExecute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameterSets:{type:"list",member:{shape:"S6"}},transactionId:{}}},output:{type:"structure",members:{updateResults:{type:"list",member:{type:"structure",members:{generatedFields:{shape:"Sq"}}}}}}},BeginTransaction:{http:{requestUri:"/BeginTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn"],members:{resourceArn:{},secretArn:{},database:{},schema:{}}},output:{type:"structure",members:{transactionId:{}}}},CommitTransaction:{http:{requestUri:"/CommitTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}},ExecuteSql:{http:{requestUri:"/ExecuteSql",responseCode:200},input:{type:"structure",required:["dbClusterOrInstanceArn","awsSecretStoreArn","sqlStatements"],members:{dbClusterOrInstanceArn:{},awsSecretStoreArn:{},sqlStatements:{},database:{},schema:{}}},output:{type:"structure",members:{sqlStatementResults:{type:"list",member:{type:"structure",members:{resultFrame:{type:"structure",members:{resultSetMetadata:{type:"structure",members:{columnCount:{type:"long"},columnMetadata:{shape:"S13"}}},records:{type:"list",member:{type:"structure",members:{values:{type:"list",member:{shape:"S1a"}}}}}}},numberOfRecordsUpdated:{type:"long"}}}}}},deprecated:!0,deprecatedMessage:"The ExecuteSql API is deprecated, please use the ExecuteStatement API."},ExecuteStatement:{http:{requestUri:"/Execute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameters:{shape:"S6"},transactionId:{},includeResultMetadata:{type:"boolean"},continueAfterTimeout:{type:"boolean"},resultSetOptions:{type:"structure",members:{decimalReturnType:{},longReturnType:{}}},formatRecordsAs:{}}},output:{type:"structure",members:{records:{type:"list",member:{shape:"Sq"}},columnMetadata:{shape:"S13"},numberOfRecordsUpdated:{type:"long"},generatedFields:{shape:"Sq"},formattedRecords:{}}}},RollbackTransaction:{http:{requestUri:"/RollbackTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}}},shapes:{S6:{type:"list",member:{type:"structure",members:{name:{},value:{shape:"S9"},typeHint:{}}}},S9:{type:"structure",members:{isNull:{type:"boolean"},booleanValue:{type:"boolean"},longValue:{type:"long"},doubleValue:{type:"double"},stringValue:{},blobValue:{type:"blob"},arrayValue:{shape:"Sf"}},union:!0},Sf:{type:"structure",members:{booleanValues:{type:"list",member:{type:"boolean"}},longValues:{type:"list",member:{type:"long"}},doubleValues:{type:"list",member:{type:"double"}},stringValues:{type:"list",member:{}},arrayValues:{type:"list",member:{shape:"Sf"}}},union:!0},Sq:{type:"list",member:{shape:"S9"}},S13:{type:"list",member:{type:"structure",members:{name:{},type:{type:"integer"},typeName:{},label:{},schemaName:{},tableName:{},isAutoIncrement:{type:"boolean"},isSigned:{type:"boolean"},isCurrency:{type:"boolean"},isCaseSensitive:{type:"boolean"},nullable:{type:"integer"},precision:{type:"integer"},scale:{type:"integer"},arrayBaseColumnType:{type:"integer"}}}},S1a:{type:"structure",members:{isNull:{type:"boolean"},bitValue:{type:"boolean"},bigIntValue:{type:"long"},intValue:{type:"integer"},doubleValue:{type:"double"},realValue:{type:"float"},stringValue:{},blobValue:{type:"blob"},arrayValues:{shape:"S1d"},structValue:{type:"structure",members:{attributes:{shape:"S1d"}}}},union:!0},S1d:{type:"list",member:{shape:"S1a"}}}}});var Bf=P((EF,dN)=>{dN.exports={pagination:{}}});var zf=P((CF,Uf)=>{vo();var To=V(),hN=To.Service,Vf=To.apiLoader;Vf.services.rdsdataservice={};To.RDSDataService=hN.defineService("rdsdataservice",["2018-08-01"]);Mf();Object.defineProperty(Vf.services.rdsdataservice,"2018-08-01",{get:s(function(){var e=Wf();return e.paginators=Bf().pagination,e},"get"),enumerable:!0,configurable:!0});Uf.exports=To.RDSDataService});import fN from"path";function eu(t){return t===void 0}s(eu,"isUndefined");function rt(t){return typeof t=="string"}s(rt,"isString");function tu(t){return typeof t=="number"}s(tu,"isNumber");function ls(t){return typeof t=="boolean"}s(ls,"isBoolean");function ds(t){return t===null}s(ds,"isNull");function ru(t){return t instanceof Date}s(ru,"isDate");function iu(t){return typeof t=="bigint"}s(iu,"isBigInt");function xt(t){return typeof t=="function"}s(xt,"isFunction");function zt(t){return typeof t=="object"&&t!==null}s(zt,"isObject");function hs(t){return t[t.length-1]}s(hs,"getLast");function c(t){return Object.freeze(t)}s(c,"freeze");function Tr(t){return Array.isArray(t)}s(Tr,"isReadonlyArray");function Ui(t){return t}s(Ui,"noop");var Y=c({is(t){return t.kind==="IdentifierNode"},create(t){return c({kind:"IdentifierNode",name:t})}});var Ye=c({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return c({kind:"SchemableIdentifierNode",identifier:Y.create(t)})},createWithSchema(t,e){return c({kind:"SchemableIdentifierNode",schema:Y.create(t),identifier:Y.create(e)})}});var it=c({is(t){return t.kind==="TableNode"},create(t){return c({kind:"TableNode",table:Ye.create(t)})},createWithSchema(t,e){return c({kind:"TableNode",table:Ye.createWithSchema(t,e)})}});var xe=c({is(t){return t.kind==="AlterTableNode"},create(t){return c({kind:"AlterTableNode",table:it.create(t)})},cloneWith(t,e){return c({...t,...e})}});var tr=c({is(t){return t.kind==="CreateIndexNode"},create(t){return c({kind:"CreateIndexNode",name:Y.create(t)})},cloneWith(t,e){return c({...t,...e})}});var fs=c({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return c({kind:"CreateSchemaNode",schema:Y.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var nu=["preserve rows","delete rows","drop"],dt=c({is(t){return t.kind==="CreateTableNode"},create(t){return c({kind:"CreateTableNode",table:t,columns:c([])})},cloneWithColumn(t,e){return c({...t,columns:c([...t.columns,e])})},cloneWithConstraint(t,e){return c({...t,constraints:t.constraints?c([...t.constraints,e]):c([e])})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWith(t,e){return c({...t,...e})}});var mi=c({is(t){return t.kind==="DropIndexNode"},create(t,e){return c({kind:"DropIndexNode",name:Ye.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var zi=c({is(t){return t.kind==="DropSchemaNode"},create(t,e){return c({kind:"DropSchemaNode",schema:Y.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Hi=c({is(t){return t.kind==="DropTableNode"},create(t,e){return c({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return c({...t,...e})}});var Et=c({is(t){return t.kind==="AliasNode"},create(t,e){return c({kind:"AliasNode",node:t,alias:e})}});function ht(t){return zt(t)&&xt(t.toOperationNode)}s(ht,"isOperationNodeSource");var yi=c({is(t){return t.kind==="AndNode"},create(t,e){return c({kind:"AndNode",left:t,right:e})}});var vi=c({is(t){return t.kind==="OrNode"},create(t,e){return c({kind:"OrNode",left:t,right:e})}});var gi=c({is(t){return t.kind==="OnNode"},create(t){return c({kind:"OnNode",on:t})},cloneWithFilter(t,e,r){return c({...t,on:e==="And"?yi.create(t.on,r):vi.create(t.on,r)})}});var nt=c({is(t){return t.kind==="JoinNode"},create(t,e){return c({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return c({kind:"JoinNode",joinType:t,table:e,on:gi.create(r)})},cloneWithOn(t,e){return c({...t,on:t.on?gi.cloneWithFilter(t.on,"And",e):gi.create(e)})},cloneWithOrOn(t,e){return c({...t,on:t.on?gi.cloneWithFilter(t.on,"Or",e):gi.create(e)})}});var rr=c({is(t){return t.kind==="OrderByNode"},create(t){return c({kind:"OrderByNode",items:c([t])})},cloneWithItem(t,e){return c({...t,items:c([...t.items,e])})}});var qo=c({is(t){return t.kind==="PartitionByNode"},create(t){return c({kind:"PartitionByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var ji=c({is(t){return t.kind==="OverNode"},create(){return c({kind:"OverNode"})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithPartitionByItems(t,e){return c({...t,partitionBy:t.partitionBy?qo.cloneWithItems(t.partitionBy,e):qo.create(e)})}});var zr=c({is(t){return t.kind==="FromNode"},create(t){return c({kind:"FromNode",froms:c(t)})},cloneWithFroms(t,e){return c({...t,froms:c([...t.froms,...e])})}});var ko=c({is(t){return t.kind==="GroupByNode"},create(t){return c({kind:"GroupByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var Ki=c({is(t){return t.kind==="HavingNode"},create(t){return c({kind:"HavingNode",having:t})},cloneWithFilter(t,e,r){return c({...t,having:e==="And"?yi.create(t.having,r):vi.create(t.having,r)})}});var $=c({is(t){return t.kind==="SelectQueryNode"},create(t,e){return c({kind:"SelectQueryNode",from:zr.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})},cloneWithDistinctOnSelections(t,e){return c({...t,distinctOnSelections:t.distinctOnSelections?c([...t.distinctOnSelections,...e]):c(e)})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithGroupByItems(t,e){return c({...t,groupBy:t.groupBy?ko.cloneWithItems(t.groupBy,e):ko.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithOffset(t,e){return c({...t,offset:e})},cloneWithHaving(t,e){return c({...t,having:t.having?Ki.cloneWithFilter(t.having,"And",e):Ki.create(e)})},cloneWithOrHaving(t,e){return c({...t,having:t.having?Ki.cloneWithFilter(t.having,"Or",e):Ki.create(e)})},cloneWithSetOperation(t,e){return c({...t,setOperations:t.setOperations?c([...t.setOperations,e]):c([e])})},cloneWithExplain(t,e){return c({...t,explain:e})}});var Ht=c({is(t){return t.kind==="SelectModifierNode"},create(t){return c({kind:"SelectModifierNode",modifier:t})},createWithRaw(t){return c({kind:"SelectModifierNode",rawModifier:t})}});var Xi=c({is(t){return t.kind==="FilterNode"},create(t,e,r){return c({kind:"FilterNode",left:t,op:e,right:r})}});var ve=c({is(t){return t.kind==="RawNode"},create(t,e){return c({kind:"RawNode",sqlFragments:c(t),parameters:c(e)})},createWithSql(t){return ve.create([t],[])},createWithChild(t){return ve.create(["",""],[t])},createWithChildren(t){return ve.create(new Array(t.length+1).fill(""),t)}});var su=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","ilike","not ilike","@>","<@","?","?","?&","!<","!>","<=>","!~","~","~*","!~*","exists","not exists","&&","||","@@","@@@","!!","<->"],Lo=c({is(t){return t.kind==="OperatorNode"},create(t){return c({kind:"OperatorNode",operator:t})}});var ps=c({is(t){return t.kind==="ParensNode"},create(t){return c({kind:"ParensNode",node:t})}});var re=c({is(t){return t.kind==="ColumnNode"},create(t){return c({kind:"ColumnNode",column:Y.create(t)})}});var Ni=c({is(t){return t.kind==="SelectAllNode"},create(){return c({kind:"SelectAllNode"})}});var Hr=c({is(t){return t.kind==="ReferenceNode"},create(t,e){return c({kind:"ReferenceNode",table:t,column:e})},createSelectAll(t){return c({kind:"ReferenceNode",table:t,column:Ni.create()})}});var Gi=class{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return Be(this.#e)}};s(Gi,"DynamicReferenceBuilder");function ms(t){return zt(t)&&ht(t)&&rt(t.dynamicReference)}s(ms,"isDynamicReferenceBuilder");function ys(t){return Tr(t)?t.map(e=>ir(e)):[ir(t)]}s(ys,"parseReferenceExpressionOrList");function ir(t){return rt(t)?Be(t):ms(t)?t.toOperationNode():wi(t)}s(ir,"parseReferenceExpression");function Be(t){let e=".";if(t.includes(e)){let r=t.split(e).map(au);if(r.length===3)return rp(r);if(r.length===2)return ip(r);throw new Error(`invalid column reference ${t}`)}else return re.create(t)}s(Be,"parseStringReference");function ou(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(au);return Et.create(Be(r),Y.create(i))}else return Be(t)}s(ou,"parseAliasedStringReference");function Ji(t){return re.create(t)}s(Ji,"parseColumnName");function rp(t){let[e,r,i]=t;return Hr.create(it.createWithSchema(e,r),re.create(i))}s(rp,"parseStringReferenceWithTableAndSchema");function ip(t){let[e,r]=t;return Hr.create(it.create(e),re.create(r))}s(ip,"parseStringReferenceWithTable");function au(t){return t.trim()}s(au,"trim");var vs=c({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return c({kind:"PrimitiveValueListNode",values:c([...t])})}});var xi=c({is(t){return t.kind==="ValueListNode"},create(t){return c({kind:"ValueListNode",values:c(t)})}});var st=c({is(t){return t.kind==="ValueNode"},create(t){return c({kind:"ValueNode",value:t})},createImmediate(t){return c({kind:"ValueNode",value:t,immediate:!0})}});function Fo(t){return Tr(t)?np(t):jt(t)}s(Fo,"parseValueExpressionOrList");function jt(t){return Qi(t)?wi(t):st.create(t)}s(jt,"parseValueExpression");function np(t){return t.some(Qi)?xi.create(t.map(e=>jt(e))):vs.create(t)}s(np,"parseValueExpressionList");function ot(t){return Vo("where",t)}s(ot,"parseWhereFilter");function Wo(t){return Vo("having",t)}s(Wo,"parseHavingFilter");function Bo(t){return Vo("on",t)}s(Bo,"parseOnFilter");function Ee(t,e,r){return Xi.create(ir(t),Uo(e),ir(r))}s(Ee,"parseReferenceFilter");function Pe(t){return uu("exists",t)}s(Pe,"parseExistFilter");function _e(t){return uu("not exists",t)}s(_e,"parseNotExistFilter");function Vo(t,e){if(e.length===3)return sp(e[0],e[1],e[2]);if(e.length===1)return ap(t,e[0]);throw cu(t,e)}s(Vo,"parseFilter");function sp(t,e,r){return(e==="is"||e==="is not")&&(ds(r)||ls(r))?op(t,e,r):Xi.create(ir(t),Uo(e),Fo(r))}s(sp,"parseThreeArgFilter");function op(t,e,r){return Xi.create(ir(t),Uo(e),st.createImmediate(r))}s(op,"parseIsFilter");function Uo(t){if(rt(t)&&su.includes(t))return Lo.create(t);if(ht(t))return t.toOperationNode();throw new Error(`invalid comparison operator ${JSON.stringify(t)} passed to a filter method`)}s(Uo,"parseFilterOperator");function uu(t,e){return Xi.create(void 0,Lo.create(t),Fo(e))}s(uu,"parseExistExpression");function ap(t,e){if(xt(e))return up[t](e);if(ht(e)){let r=e.toOperationNode();if(ve.is(r))return r}throw cu(t,e)}s(ap,"parseOneArgFilter");function cu(t,e){return new Error(`invalid arguments passed to a '${t}' method: ${JSON.stringify(e)}`)}s(cu,"createFilterError");var up=c({where(t){let r=t(Mo()).toOperationNode();if(!r.where)throw new Error("no `where` methods called insided a group callback");return ps.create(r.where.where)},having(t){let r=t(Mo()).toOperationNode();if(!r.having)throw new Error("no `having` methods called insided a group callback");return ps.create(r.having.having)},on(t){let r=t(gs("InnerJoin","table")).toOperationNode();if(!r.on)throw new Error("no `on` methods called insided a group callback");return ps.create(r.on.on)}});function Ve(t,e){if(e.length===3)return lp(t,e[0],e[1],e[2]);if(e.length===2)return cp(t,e[0],e[1]);throw new Error("not implemented")}s(Ve,"parseJoin");function cp(t,e,r){return r(gs(t,e)).toOperationNode()}s(cp,"parseCallbackJoin");function lp(t,e,r,i){return nt.createWithOn(t,nr(e),Ee(r,"=",i))}s(lp,"parseSingleOnJoin");var Ei=c({is(t){return t.kind==="SelectionNode"},create(t){return c({kind:"SelectionNode",selection:t})},createSelectAll(){return c({kind:"SelectionNode",selection:Ni.create()})},createSelectAllFromTable(t){return c({kind:"SelectionNode",selection:Hr.createSelectAll(t)})}});function sr(t){return Tr(t)?t.map(e=>lu(e)):[lu(t)]}s(sr,"parseSelectExpressionOrList");function lu(t){return rt(t)?Ei.create(ou(t)):ms(t)?Ei.create(t.toOperationNode()):Ei.create(Ns(t))}s(lu,"parseSelectExpression");function br(t){return t?Array.isArray(t)?t.map(du):[du(t)]:[Ei.createSelectAll()]}s(br,"parseSelectAll");function du(t){if(rt(t))return Ei.createSelectAllFromTable(Ce(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}s(du,"parseSelectAllArg");var $e=c({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return c({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return c({...t,...e})}});var Ar=c({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return c({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return c({...t,from:t.from?zr.cloneWithFroms(t.from,e):zr.create(e)})},cloneWithUpdates(t,e){return c({...t,updates:t.updates?c([...t.updates,...e]):e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var Ir=c({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return c({kind:"DeleteQueryNode",from:zr.create([t]),...e&&{with:e}})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?rr.cloneWithItem(t.orderBy,e):rr.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var at=c({is(t){return t.kind==="WhereNode"},create(t){return c({kind:"WhereNode",where:t})},cloneWithFilter(t,e,r){return c({...t,where:e==="And"?yi.create(t.where,r):vi.create(t.where,r)})}});var zo=c({is(t){return t.kind==="ReturningNode"},create(t){return c({kind:"ReturningNode",selections:c(t)})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})}});var K=c({is(t){return Ir.is(t)||$e.is(t)||Ar.is(t)||$.is(t)},cloneWithWhere(t,e){return c({...t,where:t.where?at.cloneWithFilter(t.where,"And",e):at.create(e)})},cloneWithOrWhere(t,e){return c({...t,where:t.where?at.cloneWithFilter(t.where,"Or",e):at.create(e)})},cloneWithJoin(t,e){return c({...t,joins:t.joins?c([...t.joins,e]):c([e])})},cloneWithReturning(t,e){return c({...t,returning:t.returning?zo.cloneWithSelections(t.returning,e):zo.create(e)})}});var hu=c({is(t){return t.kind==="OrderByItemNode"},create(t,e){return c({kind:"OrderByItemNode",orderBy:t,direction:e})}});function Ci(t,e){return hu.create(dp(t),hp(e))}s(Ci,"parseOrderBy");function dp(t){return ir(t)}s(dp,"parseOrderByExpression");function hp(t){if(t)return t==="asc"||t==="desc"?ve.createWithSql(t):t.toOperationNode()}s(hp,"parseOrderByDirectionExpression");function z(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}s(z,"preventAwait");var ws=c({is(t){return t.kind==="LimitNode"},create(t){return c({kind:"LimitNode",limit:st.create(t)})}});var fu=c({is(t){return t.kind==="OffsetNode"},create(t){return c({kind:"OffsetNode",offset:st.create(t)})}});var pu=c({is(t){return t.kind==="GroupByItemNode"},create(t){return c({kind:"GroupByItemNode",groupBy:t})}});function mu(t){return ys(t).map(pu.create)}s(mu,"parseGroupBy");var Dt=class extends Error{node;constructor(e){super("no result"),this.node=e}};s(Dt,"NoResultError");var Rr=c({is(t){return t.kind==="ExplainNode"},create(t,e){return c({kind:"ExplainNode",format:t,options:e?.toOperationNode()})}});var xs=c({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return c({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function jr(t,e,r){return xs.create(t,e.toOperationNode(),r)}s(jr,"parseSetOperation");var U=class{#e;constructor(e){this.#e=c(e)}where(...e){return new U({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,ot(e))})}whereRef(e,r,i){return new U({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Ee(e,r,i))})}orWhere(...e){return new U({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,ot(e))})}orWhereRef(e,r,i){return new U({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Ee(e,r,i))})}whereExists(e){return new U({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Pe(e))})}whereNotExists(e){return new U({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,_e(e))})}orWhereExists(e){return new U({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Pe(e))})}orWhereNotExists(e){return new U({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,_e(e))})}having(...e){return new U({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,Wo(e))})}havingRef(e,r,i){return new U({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,Ee(e,r,i))})}orHaving(...e){return new U({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,Wo(e))})}orHavingRef(e,r,i){return new U({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,Ee(e,r,i))})}havingExists(e){return new U({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,Pe(e))})}havingNotExist(e){return new U({...this.#e,queryNode:$.cloneWithHaving(this.#e.queryNode,_e(e))})}orHavingExists(e){return new U({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,Pe(e))})}orHavingNotExists(e){return new U({...this.#e,queryNode:$.cloneWithOrHaving(this.#e.queryNode,_e(e))})}select(e){return new U({...this.#e,queryNode:$.cloneWithSelections(this.#e.queryNode,sr(e))})}distinctOn(e){return new U({...this.#e,queryNode:$.cloneWithDistinctOnSelections(this.#e.queryNode,sr(e))})}modifyFront(e){return new U({...this.#e,queryNode:$.cloneWithFrontModifier(this.#e.queryNode,Ht.createWithRaw(e.toOperationNode()))})}modifyEnd(e){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.createWithRaw(e.toOperationNode()))})}distinct(){return new U({...this.#e,queryNode:$.cloneWithFrontModifier(this.#e.queryNode,Ht.create("Distinct"))})}forUpdate(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("ForUpdate"))})}forShare(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("ForShare"))})}forKeyShare(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("ForKeyShare"))})}forNoKeyUpdate(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("ForNoKeyUpdate"))})}skipLocked(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("SkipLocked"))})}noWait(){return new U({...this.#e,queryNode:$.cloneWithEndModifier(this.#e.queryNode,Ht.create("NoWait"))})}selectAll(e){return new U({...this.#e,queryNode:$.cloneWithSelections(this.#e.queryNode,br(e))})}innerJoin(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("InnerJoin",e))})}leftJoin(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("LeftJoin",e))})}rightJoin(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("RightJoin",e))})}fullJoin(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("FullJoin",e))})}innerJoinLateral(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("LateralInnerJoin",e))})}leftJoinLateral(...e){return new U({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("LateralLeftJoin",e))})}orderBy(e,r){return new U({...this.#e,queryNode:$.cloneWithOrderByItem(this.#e.queryNode,Ci(e,r))})}groupBy(e){return new U({...this.#e,queryNode:$.cloneWithGroupByItems(this.#e.queryNode,mu(e))})}limit(e){return new U({...this.#e,queryNode:$.cloneWithLimit(this.#e.queryNode,ws.create(e))})}offset(e){return new U({...this.#e,queryNode:$.cloneWithOffset(this.#e.queryNode,fu.create(e))})}union(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("union",e,!1))})}unionAll(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("union",e,!0))})}intersect(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("intersect",e,!1))})}intersectAll(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("intersect",e,!0))})}except(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("except",e,!1))})}exceptAll(e){return new U({...this.#e,queryNode:$.cloneWithSetOperation(this.#e.queryNode,jr("except",e,!0))})}call(e){return e(this)}if(e,r){return e?r(this):new U({...this.#e})}as(e){return new Es(this,e)}castTo(){return new U(this.#e)}withPlugin(e){return new U({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Dt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async*stream(e=100){let r=this.compile(),i=this.#e.executor.stream(r,e,this.#e.queryId);for await(let n of i)yield*n.rows}async explain(e,r){return await new U({...this.#e,queryNode:$.cloneWithExplain(this.#e.queryNode,Rr.create(e,r))}).execute()}};s(U,"SelectQueryBuilder");z(U,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var Es=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get alias(){return this.#t}toOperationNode(){let e=this.#e.toOperationNode();return Et.create(e,Y.create(this.#t))}};s(Es,"AliasedQueryBuilder");var Kr=class{nodeStack=[];#e=c({AliasNode:this.transformAlias.bind(this),ColumnNode:this.transformColumn.bind(this),IdentifierNode:this.transformIdentifier.bind(this),SchemableIdentifierNode:this.transformSchemableIdentifier.bind(this),RawNode:this.transformRaw.bind(this),ReferenceNode:this.transformReference.bind(this),SelectQueryNode:this.transformSelectQuery.bind(this),SelectionNode:this.transformSelection.bind(this),TableNode:this.transformTable.bind(this),FromNode:this.transformFrom.bind(this),SelectAllNode:this.transformSelectAll.bind(this),FilterNode:this.transformFilter.bind(this),AndNode:this.transformAnd.bind(this),OrNode:this.transformOr.bind(this),ValueNode:this.transformValue.bind(this),ValueListNode:this.transformValueList.bind(this),PrimitiveValueListNode:this.transformPrimitiveValueList.bind(this),ParensNode:this.transformParens.bind(this),JoinNode:this.transformJoin.bind(this),OperatorNode:this.transformOperator.bind(this),WhereNode:this.transformWhere.bind(this),InsertQueryNode:this.transformInsertQuery.bind(this),DeleteQueryNode:this.transformDeleteQuery.bind(this),ReturningNode:this.transformReturning.bind(this),CreateTableNode:this.transformCreateTable.bind(this),AddColumnNode:this.transformAddColumn.bind(this),ColumnDefinitionNode:this.transformColumnDefinition.bind(this),DropTableNode:this.transformDropTable.bind(this),DataTypeNode:this.transformDataType.bind(this),OrderByNode:this.transformOrderBy.bind(this),OrderByItemNode:this.transformOrderByItem.bind(this),GroupByNode:this.transformGroupBy.bind(this),GroupByItemNode:this.transformGroupByItem.bind(this),UpdateQueryNode:this.transformUpdateQuery.bind(this),ColumnUpdateNode:this.transformColumnUpdate.bind(this),LimitNode:this.transformLimit.bind(this),OffsetNode:this.transformOffset.bind(this),OnConflictNode:this.transformOnConflict.bind(this),OnDuplicateKeyNode:this.transformOnDuplicateKey.bind(this),CreateIndexNode:this.transformCreateIndex.bind(this),DropIndexNode:this.transformDropIndex.bind(this),ListNode:this.transformList.bind(this),PrimaryKeyConstraintNode:this.transformPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.transformUniqueConstraint.bind(this),ReferencesNode:this.transformReferences.bind(this),CheckConstraintNode:this.transformCheckConstraint.bind(this),WithNode:this.transformWith.bind(this),CommonTableExpressionNode:this.transformCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.transformCommonTableExpressionName.bind(this),HavingNode:this.transformHaving.bind(this),CreateSchemaNode:this.transformCreateSchema.bind(this),DropSchemaNode:this.transformDropSchema.bind(this),AlterTableNode:this.transformAlterTable.bind(this),DropColumnNode:this.transformDropColumn.bind(this),RenameColumnNode:this.transformRenameColumn.bind(this),AlterColumnNode:this.transformAlterColumn.bind(this),ModifyColumnNode:this.transformModifyColumn.bind(this),AddConstraintNode:this.transformAddConstraint.bind(this),DropConstraintNode:this.transformDropConstraint.bind(this),ForeignKeyConstraintNode:this.transformForeignKeyConstraint.bind(this),CreateViewNode:this.transformCreateView.bind(this),DropViewNode:this.transformDropView.bind(this),GeneratedNode:this.transformGenerated.bind(this),DefaultValueNode:this.transformDefaultValue.bind(this),OnNode:this.transformOn.bind(this),ValuesNode:this.transformValues.bind(this),SelectModifierNode:this.transformSelectModifier.bind(this),CreateTypeNode:this.transformCreateType.bind(this),DropTypeNode:this.transformDropType.bind(this),ExplainNode:this.transformExplain.bind(this),DefaultInsertValueNode:this.transformDefaultInsertValue.bind(this),AggregateFunctionNode:this.transformAggregateFunction.bind(this),OverNode:this.transformOver.bind(this),PartitionByNode:this.transformPartitionBy.bind(this),PartitionByItemNode:this.transformPartitionByItem.bind(this),SetOperationNode:this.transformSetOperation.bind(this)});transformNode(e){if(!e)return e;this.nodeStack.push(e);let r=this.transformNodeImpl(e);return this.nodeStack.pop(),c(r)}transformNodeImpl(e){return this.#e[e.kind](e)}transformNodeList(e){return e&&c(e.map(r=>this.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOnSelections:this.transformNodeList(e.distinctOnSelections),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",table:this.transformNode(e.table),column:this.transformNode(e.column)}}transformFilter(e){return{kind:"FilterNode",left:this.transformNode(e.left),op:this.transformNode(e.op),right:this.transformNode(e.right)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:c([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain)}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated)}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),expression:this.transformNode(e.expression),unique:e.unique,using:this.transformNode(e.using)}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),renameColumn:this.transformNode(e.renameColumn),addColumn:this.transformNode(e.addColumn),dropColumn:this.transformNode(e.dropColumn),alterColumn:this.transformNode(e.alterColumn),modifyColumn:this.transformNode(e.modifyColumn),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",column:this.transformNode(e.column),distinct:e.distinct,func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}};s(Kr,"OperationNodeTransformer");var fp=c({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0}),Yi=class extends Kr{#e;#t=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#r(e))return super.transformNodeImpl(e);let r=this.#i(e);for(let n of r)this.#t.add(n);let i=super.transformNodeImpl(e);for(let n of r)this.#t.delete(n);return i}transformSchemableIdentifier(e){let r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:Y.create(this.#e)}}transformReferences(e){let r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:it.createWithSchema(this.#e,r.table.table.identifier.name)}}#r(e){return e.kind in fp}#i(e){let r=new Set;if("name"in e&&e.name&&Ye.is(e.name)&&this.#s(e.name,r),"from"in e&&e.from)for(let i of e.from.froms)this.#n(i,r);if("into"in e&&e.into&&this.#n(e.into,r),"table"in e&&e.table&&this.#n(e.table,r),"joins"in e&&e.joins)for(let i of e.joins)this.#n(i.table,r);return"with"in e&&e.with&&this.#o(e.with,r),r}#n(e,r){let i=it.is(e)?e:Et.is(e)&&it.is(e.node)?e.node:null;i&&this.#s(i.table,r)}#s(e,r){this.#t.has(e.identifier.name)||r.add(e.identifier.name)}#o(e,r){for(let i of e.expressions)r.delete(i.name.table.table.identifier.name)}};s(Yi,"WithSchemaTransformer");var Pt=class{#e;constructor(e){this.#e=new Yi(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}};s(Pt,"WithSchemaPlugin");var yu=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function vu(t){let e="";for(let r=0;r<t;++r)e+=pp();return e}s(vu,"randomString");function pp(){return yu[~~(Math.random()*yu.length)]}s(pp,"randomChar");function oe(){return new Cs}s(oe,"createQueryId");var Cs=class{#e;get queryId(){return this.#e===void 0&&(this.#e=vu(8)),this.#e}};s(Cs,"LazyQueryId");var or=c({is(t){return t.kind==="AggregateFunctionNode"},create(t,e){return c({kind:"AggregateFunctionNode",func:t,column:e})},cloneWithDistinct(t){return c({...t,distinct:!0})},cloneWithOver(t,e){return c({...t,over:e})}});var ft=class{#e;constructor(e){this.#e=c(e)}as(e){return new Ss(this,e)}distinct(){return new ft({...this.#e,aggregateFunctionNode:or.cloneWithDistinct(this.#e.aggregateFunctionNode)})}over(e){let r=gu();return new ft({...this.#e,aggregateFunctionNode:or.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}toOperationNode(){return this.#e.aggregateFunctionNode}};s(ft,"AggregateFunctionBuilder");z(ft,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");var Ss=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get alias(){return this.#t}toOperationNode(){return Et.create(this.#e.toOperationNode(),Y.create(this.#t))}};s(Ss,"AliasedAggregateFunctionBuilder");var Xr=class{constructor(){this.avg=this.avg.bind(this),this.count=this.count.bind(this),this.max=this.max.bind(this),this.min=this.min.bind(this),this.sum=this.sum.bind(this)}avg(e){return new ft({aggregateFunctionNode:or.create("avg",Be(e))})}count(e){return new ft({aggregateFunctionNode:or.create("count",Be(e))})}max(e){return new ft({aggregateFunctionNode:or.create("max",Be(e))})}min(e){return new ft({aggregateFunctionNode:or.create("min",Be(e))})}sum(e){return new ft({aggregateFunctionNode:or.create("sum",Be(e))})}};s(Xr,"FunctionModule");var Si=class{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}};s(Si,"Deferred");var mp=c([]),Gr=class{#e;constructor(e=mp){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(let i of this.#e){let n=i.transformQuery({node:e,queryId:r});if(n.kind===e.kind)e=n;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${n.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async i=>{let n=await i.executeQuery(e);return this.#t(n,r)})}async*stream(e,r,i){let n=new Si,o=new Si;this.provideConnection(async u=>(n.resolve(u),await o.promise)).catch(u=>n.reject(u));let a=await n.promise;try{for await(let u of a.streamQuery(e,r))yield await this.#t(u,i)}finally{o.resolve()}}async#t(e,r){for(let i of this.#e)e=await i.transformResult({result:e,queryId:r});return e}};s(Gr,"QueryExecutorBase");var ar=class extends Gr{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new ar([...this.plugins,e])}withPlugins(e){return new ar([...this.plugins,...e])}withPluginAtFront(e){return new ar([e,...this.plugins])}withoutPlugins(){return new ar([])}};s(ar,"NoopQueryExecutor");var Jr=new ar;var be=class{#e;constructor(e){this.#e=c(e)}as(e){return new Ts(this,e)}castTo(){return new be({...this.#e})}withPlugin(e){return new be({...this.#e,plugins:this.#e.plugins!==void 0?c([...this.#e.plugins,e]):c([e])})}toOperationNode(){let e=this.#e.plugins!==void 0?Jr.withPlugins(this.#e.plugins):Jr;return this.#t(e)}async execute(e){let r=this.#e.plugins!==void 0?e.getExecutor().withPlugins(this.#e.plugins):e.getExecutor();return r.executeQuery(this.#r(r),this.#e.queryId)}#t(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#r(e){return e.compileQuery(this.#t(e),this.#e.queryId)}};s(be,"RawBuilder");z(be,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");var Ts=class{#e;#t;get alias(){return this.#t}toOperationNode(){return Et.create(this.#e.toOperationNode(),ht(this.#t)?this.#t.toOperationNode():Y.create(this.#t))}constructor(e,r){this.#e=e,this.#t=r}};s(Ts,"AliasedRawBuilder");var Qr=class{#e;constructor(e){this.#e=c(e)}get fn(){return new Xr}selectFrom(e){return new U({queryId:oe(),executor:this.#e.executor,queryNode:$.create(Or(e))})}withSchema(e){return new Qr({...this.#e,executor:this.#e.executor.withPluginAtFront(new Pt(e))})}ref(e){return new be({queryId:oe(),plugins:this.#e.executor.plugins,rawNode:ve.createWithChild(Be(e))})}};s(Qr,"ExpressionBuilder");var Je=class{#e;constructor(e){this.#e=c(e)}on(...e){return new Je({...this.#e,joinNode:nt.cloneWithOn(this.#e.joinNode,Bo(e))})}orOn(...e){return new Je({...this.#e,joinNode:nt.cloneWithOrOn(this.#e.joinNode,Bo(e))})}onRef(e,r,i){return new Je({...this.#e,joinNode:nt.cloneWithOn(this.#e.joinNode,Ee(e,r,i))})}orOnRef(e,r,i){return new Je({...this.#e,joinNode:nt.cloneWithOrOn(this.#e.joinNode,Ee(e,r,i))})}onExists(e){return new Je({...this.#e,joinNode:nt.cloneWithOn(this.#e.joinNode,Pe(e))})}onNotExists(e){return new Je({...this.#e,joinNode:nt.cloneWithOn(this.#e.joinNode,_e(e))})}orOnExists(e){return new Je({...this.#e,joinNode:nt.cloneWithOrOn(this.#e.joinNode,Pe(e))})}orOnNotExists(e){return new Je({...this.#e,joinNode:nt.cloneWithOrOn(this.#e.joinNode,_e(e))})}onTrue(){return new Je({...this.#e,joinNode:nt.cloneWithOn(this.#e.joinNode,ve.createWithSql("true"))})}toOperationNode(){return this.#e.joinNode}};s(Je,"JoinBuilder");z(Je,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");var Nu=c({is(t){return t.kind==="PartitionByItemNode"},create(t){return c({kind:"PartitionByItemNode",partitionBy:t})}});function wu(t){return ys(t).map(Nu.create)}s(wu,"parsePartitionBy");var ur=class{#e;constructor(e){this.#e=c(e)}orderBy(e,r){return new ur({overNode:ji.cloneWithOrderByItem(this.#e.overNode,Ci(e,r))})}partitionBy(e){return new ur({overNode:ji.cloneWithPartitionByItems(this.#e.overNode,wu(e))})}toOperationNode(){return this.#e.overNode}};s(ur,"OverBuilder");z(ur,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");var xu=c({is(t){return t.kind==="ValuesNode"},create(t){return c({kind:"ValuesNode",values:c(t)})}});var Eu=c({is(t){return t.kind==="DefaultInsertValueNode"},create(){return c({kind:"DefaultInsertValueNode"})}});function Cu(t){return yp(Array.isArray(t)?t:[t])}s(Cu,"parseInsertObjectOrList");function yp(t){let e=vp(t);return[c([...e.keys()].map(re.create)),xu.create(t.map(r=>gp(r,e)))]}s(yp,"parseInsertColumnsAndValues");function vp(t){let e=new Map;for(let r of t){let i=Object.keys(r);for(let n of i)!e.has(n)&&r[n]!==void 0&&e.set(n,e.size)}return e}s(vp,"parseColumnNamesAndIndexes");function gp(t,e){let r=Object.keys(t),i=Array.from({length:e.size}),n=!1;for(let a of r){let u=e.get(a);if(u!==void 0){let l=t[a];Qi(l)&&(n=!0),i[u]=l}}if(r.length<e.size||n){let a=Eu.create();return xi.create(i.map(u=>eu(u)?a:jt(u)))}return vs.create(i)}s(gp,"parseRowValues");var Su=c({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return c({kind:"ColumnUpdateNode",column:t,value:e})}});function Ti(t){return Object.entries(t).filter(([e,r])=>r!==void 0).map(([e,r])=>Su.create(re.create(e),jt(r)))}s(Ti,"parseUpdateObject");var Tu=c({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return c({kind:"OnDuplicateKeyNode",updates:t})}});var $i=class{#e;constructor(e){this.#e=e}get insertId(){return this.#e}};s($i,"InsertResult");var de=c({is(t){return t.kind==="OnConflictNode"},create(){return c({kind:"OnConflictNode"})},cloneWith(t,e){return c({...t,...e})},cloneWithIndexWhere(t,e){return c({...t,indexWhere:t.indexWhere?at.cloneWithFilter(t.indexWhere,"And",e):at.create(e)})},cloneWithIndexOrWhere(t,e){return c({...t,indexWhere:t.indexWhere?at.cloneWithFilter(t.indexWhere,"Or",e):at.create(e)})},cloneWithUpdateWhere(t,e){return c({...t,updateWhere:t.updateWhere?at.cloneWithFilter(t.updateWhere,"And",e):at.create(e)})},cloneWithUpdateOrWhere(t,e){return c({...t,updateWhere:t.updateWhere?at.cloneWithFilter(t.updateWhere,"Or",e):at.create(e)})}});var qe=class{#e;constructor(e){this.#e=c(e)}column(e){let r=re.create(e);return new qe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,r]):c([r])})})}columns(e){let r=e.map(re.create);return new qe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,...r]):c(r)})})}constraint(e){return new qe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{constraint:Y.create(e)})})}expression(e){return new qe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,ot(e))})}whereRef(e,r,i){return new qe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Ee(e,r,i))})}orWhere(...e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,ot(e))})}orWhereRef(e,r,i){return new qe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Ee(e,r,i))})}whereExists(e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Pe(e))})}whereNotExists(e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,_e(e))})}orWhereExists(e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Pe(e))})}orWhereNotExists(e){return new qe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,_e(e))})}doNothing(){return new Zi({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new ut({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{updates:Ti(e)})})}};s(qe,"OnConflictBuilder");z(qe,"don't await OnConflictBuilder instances.");var Zi=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.onConflictNode}};s(Zi,"OnConflictDoNothingBuilder");z(Zi,"don't await OnConflictDoNothingBuilder instances.");var ut=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,ot(e))})}whereRef(e,r,i){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Ee(e,r,i))})}orWhere(...e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,ot(e))})}orWhereRef(e,r,i){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Ee(e,r,i))})}whereExists(e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Pe(e))})}whereNotExists(e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,_e(e))})}orWhereExists(e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Pe(e))})}orWhereNotExists(e){return new ut({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,_e(e))})}toOperationNode(){return this.#e.onConflictNode}};s(ut,"OnConflictUpdateBuilder");z(ut,"don't await OnConflictUpdateBuilder instances.");var Ae=class{#e;constructor(e){this.#e=c(e)}values(e){let[r,i]=Cu(e);return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{columns:r,values:i})})}columns(e){return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{columns:c(e.map(re.create))})})}expression(e){return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{values:wi(e)})})}ignore(){return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{onConflict:e(new qe({onConflictNode:de.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{onDuplicateKey:Tu.create(Ti(e))})})}returning(e){return new Ae({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,sr(e))})}returningAll(){return new Ae({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,br())})}call(e){return e(this)}if(e,r){return e?r(this):new Ae({...this.#e})}castTo(){return new Ae(this.#e)}withPlugin(e){return new Ae({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new $i(i.insertId)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Dt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new Ae({...this.#e,queryNode:$e.cloneWith(this.#e.queryNode,{explain:Rr.create(e,r)})}).execute()}};s(Ae,"InsertQueryBuilder");z(Ae,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var en=class{#e;constructor(e){this.#e=e}get numDeletedRows(){return this.#e}};s(en,"DeleteResult");var ce=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ce({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,ot(e))})}whereRef(e,r,i){return new ce({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Ee(e,r,i))})}orWhere(...e){return new ce({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,ot(e))})}orWhereRef(e,r,i){return new ce({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Ee(e,r,i))})}whereExists(e){return new ce({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Pe(e))})}whereNotExists(e){return new ce({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,_e(e))})}orWhereExists(e){return new ce({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Pe(e))})}orWhereNotExists(e){return new ce({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,_e(e))})}innerJoin(...e){return new ce({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("InnerJoin",e))})}leftJoin(...e){return new ce({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("LeftJoin",e))})}rightJoin(...e){return new ce({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("RightJoin",e))})}fullJoin(...e){return new ce({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("FullJoin",e))})}returning(e){return new ce({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,sr(e))})}returningAll(){return new ce({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,br())})}orderBy(e,r){return new ce({...this.#e,queryNode:Ir.cloneWithOrderByItem(this.#e.queryNode,Ci(e,r))})}limit(e){return new ce({...this.#e,queryNode:Ir.cloneWithLimit(this.#e.queryNode,ws.create(e))})}call(e){return e(this)}if(e,r){return e?r(this):new ce({...this.#e})}castTo(){return new ce(this.#e)}withPlugin(e){return new ce({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new en(i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Dt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ce({...this.#e,queryNode:Ir.cloneWithExplain(this.#e.queryNode,Rr.create(e,r))}).execute()}};s(ce,"DeleteQueryBuilder");z(ce,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var tn=class{#e;constructor(e){this.#e=e}get numUpdatedRows(){return this.#e}};s(tn,"UpdateResult");var le=class{#e;constructor(e){this.#e=c(e)}where(...e){return new le({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,ot(e))})}whereRef(e,r,i){return new le({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Ee(e,r,i))})}orWhere(...e){return new le({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,ot(e))})}orWhereRef(e,r,i){return new le({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Ee(e,r,i))})}whereExists(e){return new le({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,Pe(e))})}whereNotExists(e){return new le({...this.#e,queryNode:K.cloneWithWhere(this.#e.queryNode,_e(e))})}orWhereExists(e){return new le({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,Pe(e))})}orWhereNotExists(e){return new le({...this.#e,queryNode:K.cloneWithOrWhere(this.#e.queryNode,_e(e))})}from(e){return new le({...this.#e,queryNode:Ar.cloneWithFromItems(this.#e.queryNode,Or(e))})}innerJoin(...e){return new le({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("InnerJoin",e))})}leftJoin(...e){return new le({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("LeftJoin",e))})}rightJoin(...e){return new le({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("RightJoin",e))})}fullJoin(...e){return new le({...this.#e,queryNode:K.cloneWithJoin(this.#e.queryNode,Ve("FullJoin",e))})}set(e){return new le({...this.#e,queryNode:Ar.cloneWithUpdates(this.#e.queryNode,Ti(e))})}returning(e){return new le({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,sr(e))})}returningAll(){return new le({...this.#e,queryNode:K.cloneWithReturning(this.#e.queryNode,br())})}call(e){return e(this)}if(e,r){return e?r(this):new le({...this.#e})}castTo(){return new le(this.#e)}withPlugin(e){return new le({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new tn(i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Dt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new le({...this.#e,queryNode:Ar.cloneWithExplain(this.#e.queryNode,Rr.create(e,r))}).execute()}};s(le,"UpdateQueryBuilder");z(le,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var bu=c({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return c({kind:"CommonTableExpressionNode",name:t,expression:e})}});var Ho=c({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return c({kind:"CommonTableExpressionNameNode",table:it.create(t),columns:e?c(e.map(re.create)):void 0})}});function jo(t,e){let r=e(Au());return bu.create(Np(t),r.toOperationNode())}s(jo,"parseCommonTableExpression");function Np(t){if(t.includes("(")){let e=t.split(/[\(\)]/),r=e[0],i=e[1].split(",").map(n=>n.trim());return Ho.create(r,i)}else return Ho.create(t)}s(Np,"parseCommonTableExpressionName");var rn=c({is(t){return t.kind==="WithNode"},create(t,e){return c({kind:"WithNode",expressions:c([t]),...e})},cloneWithExpression(t,e){return c({...t,expressions:c([...t.expressions,e])})}});var pt=class{#e;constructor(e){this.#e=c(e)}selectFrom(e){return new U({queryId:oe(),executor:this.#e.executor,queryNode:$.create(Or(e),this.#e.withNode)})}insertInto(e){return new Ae({queryId:oe(),executor:this.#e.executor,queryNode:$e.create(Ce(e),this.#e.withNode)})}replaceInto(e){return new Ae({queryId:oe(),executor:this.#e.executor,queryNode:$e.create(Ce(e),this.#e.withNode,!0)})}deleteFrom(e){return new ce({queryId:oe(),executor:this.#e.executor,queryNode:Ir.create(nr(e),this.#e.withNode)})}updateTable(e){return new le({queryId:oe(),executor:this.#e.executor,queryNode:Ar.create(nr(e),this.#e.withNode)})}with(e,r){let i=jo(e,r);return new pt({...this.#e,withNode:this.#e.withNode?rn.cloneWithExpression(this.#e.withNode,i):rn.create(i)})}withRecursive(e,r){let i=jo(e,r);return new pt({...this.#e,withNode:this.#e.withNode?rn.cloneWithExpression(this.#e.withNode,i):rn.create(i,{recursive:!0})})}withPlugin(e){return new pt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new pt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new pt({...this.#e,executor:this.#e.executor.withPluginAtFront(new Pt(e))})}};s(pt,"QueryCreator");function Mo(){return new U({queryId:oe(),executor:Jr,queryNode:$.create(Or([]))})}s(Mo,"createSelectQueryBuilder");function Ko(){return new Qr({executor:Jr})}s(Ko,"createExpressionBuilder");function Au(){return new pt({executor:Jr})}s(Au,"createQueryCreator");function gs(t,e){return new Je({joinNode:nt.create(t,nr(e))})}s(gs,"createJoinBuilder");function gu(){return new ur({overNode:ji.create()})}s(gu,"createOverBuilder");function wi(t){if(ht(t))return t.toOperationNode();if(xt(t))return t(Ko()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}s(wi,"parseComplexExpression");function Ns(t){if(ht(t))return t.toOperationNode();if(xt(t))return t(Ko()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}s(Ns,"parseAliasedComplexExpression");function Qi(t){return ht(t)||xt(t)}s(Qi,"isComplexExpression");function Or(t){return Tr(t)?t.map(e=>nr(e)):[nr(t)]}s(Or,"parseTableExpressionOrList");function nr(t){return rt(t)?wp(t):Ns(t)}s(nr,"parseTableExpression");function wp(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(Iu);return Et.create(Ce(r),Y.create(i))}else return Ce(t)}s(wp,"parseAliasedTable");function Ce(t){let e=".";if(t.includes(e)){let[r,i]=t.split(e).map(Iu);return it.createWithSchema(r,i)}else return it.create(t)}s(Ce,"parseTable");function Iu(t){return t.trim()}s(Iu,"trim");var Ru=c({is(t){return t.kind==="AddColumnNode"},create(t){return c({kind:"AddColumnNode",column:t})}});var Yr=c({is(t){return t.kind==="AlterColumnNode"},create(t){return c({kind:"AlterColumnNode",column:re.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Ie=c({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return c({kind:"ColumnDefinitionNode",column:re.create(t),dataType:e})},cloneWith(t,e){return c({...t,...e})}});var bs=c({is(t){return t.kind==="DataTypeNode"},create(t){return c({kind:"DataTypeNode",dataType:t})}});var Ou=c({is(t){return t.kind==="DropColumnNode"},create(t){return c({kind:"DropColumnNode",column:re.create(t)})}});var Du=c({is(t){return t.kind==="RenameColumnNode"},create(t,e){return c({kind:"RenameColumnNode",column:re.create(t),renameTo:re.create(e)})}});var bi=c({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return c({kind:"CheckConstraintNode",expression:t,name:e?Y.create(e):void 0})}});var Pu=["no action","restrict","cascade","set null","set default"],Ai=c({is(t){return t.kind==="ReferencesNode"},create(t,e){return c({kind:"ReferencesNode",table:t,columns:c([...e])})},cloneWithOnDelete(t,e){return c({...t,onDelete:e})},cloneWithOnUpdate(t,e){return c({...t,onUpdate:e})}});function As(t){return t instanceof be?t.toOperationNode():st.createImmediate(t)}s(As,"parseDefaultValueExpression");var nn=c({is(t){return t.kind==="GeneratedNode"},create(t){return c({kind:"GeneratedNode",...t})},createWithExpression(t){return c({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return c({...t,...e})}});var _u=c({is(t){return t.kind==="DefaultValueNode"},create(t){return c({kind:"DefaultValueNode",defaultValue:t})}});function Ii(t){if(Pu.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}s(Ii,"parseOnModifyForeignAction");var he=class{#e;constructor(e){this.#e=e}autoIncrement(){return new he(Ie.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new he(Ie.cloneWith(this.#e,{primaryKey:!0}))}references(e){let r=Be(e);if(!Hr.is(r)||Ni.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new he(Ie.cloneWith(this.#e,{references:Ai.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new he(Ie.cloneWith(this.#e,{references:Ai.cloneWithOnDelete(this.#e.references,Ii(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new he(Ie.cloneWith(this.#e,{references:Ai.cloneWithOnUpdate(this.#e.references,Ii(e))}))}unique(){return new he(Ie.cloneWith(this.#e,{unique:!0}))}notNull(){return new he(Ie.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new he(Ie.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new he(Ie.cloneWith(this.#e,{defaultTo:_u.create(As(e))}))}check(e){return new he(Ie.cloneWith(this.#e,{check:bi.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new he(Ie.cloneWith(this.#e,{generated:nn.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new he(Ie.cloneWith(this.#e,{generated:nn.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new he(Ie.cloneWith(this.#e,{generated:nn.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new he(Ie.cloneWith(this.#e,{generated:nn.cloneWith(this.#e.generated,{stored:!0})}))}toOperationNode(){return this.#e}};s(he,"ColumnDefinitionBuilder");z(he,"don't await ColumnDefinitionBuilder instances directly.");var qu=c({is(t){return t.kind==="ModifyColumnNode"},create(t){return c({kind:"ModifyColumnNode",column:t})}});function sn(t){return ht(t)?t.toOperationNode():bs.create(t)}s(sn,"parseDataTypeExpression");var $r=c({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,i){return c({kind:"ForeignKeyConstraintNode",columns:t,references:Ai.create(e,r),name:i?Y.create(i):void 0})},cloneWith(t,e){return c({...t,...e})}});var _t=class{#e;constructor(e){this.#e=e}onDelete(e){return new _t($r.cloneWith(this.#e,{onDelete:Ii(e)}))}onUpdate(e){return new _t($r.cloneWith(this.#e,{onUpdate:Ii(e)}))}toOperationNode(){return this.#e}};s(_t,"ForeignKeyConstraintBuilder");z(_t,"don't await ForeignKeyConstraintBuilder instances directly.");var Is=c({is(t){return t.kind==="AddConstraintNode"},create(t){return c({kind:"AddConstraintNode",constraint:t})}});var Rs=c({is(t){return t.kind==="UniqueConstraintNode"},create(t,e){return c({kind:"UniqueConstraintNode",columns:c(t.map(re.create)),name:e?Y.create(e):void 0})}});var on=c({is(t){return t.kind==="DropConstraintNode"},create(t){return c({kind:"DropConstraintNode",constraintName:Y.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Ri=class{#e;constructor(e){this.#e=c(e)}renameTo(e){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{renameTo:Ce(e)})})}setSchema(e){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{setSchema:Y.create(e)})})}alterColumn(e){return new an({...this.#e,alterColumnNode:Yr.create(e)})}dropColumn(e){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{dropColumn:Ou.create(e)})})}renameColumn(e,r){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{renameColumn:Du.create(e,r)})})}addColumn(e,r,i=Ui){return i(new Re({...this.#e,columnBuilder:new he(Ie.create(e,sn(r)))}))}modifyColumn(e,r){return new Oe({...this.#e,columnBuilder:new he(Ie.create(e,sn(r)))})}addUniqueConstraint(e,r){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{addConstraint:Is.create(Rs.create(r,e))})})}addCheckConstraint(e,r){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{addConstraint:Is.create(bi.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,i,n){return new Dr({...this.#e,constraintBuilder:new _t($r.create(r.map(re.create),Ce(i),n.map(re.create),e))})}dropConstraint(e){return new cr({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{dropConstraint:on.create(e)})})}};s(Ri,"AlterTableBuilder");var an=class{#e;constructor(e){this.#e=c(e)}setDataType(e){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{alterColumn:Yr.cloneWith(this.#e.alterColumnNode,{dataType:bs.create(e)})})})}setDefault(e){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{alterColumn:Yr.cloneWith(this.#e.alterColumnNode,{setDefault:As(e)})})})}dropDefault(){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{alterColumn:Yr.cloneWith(this.#e.alterColumnNode,{dropDefault:!0})})})}setNotNull(){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{alterColumn:Yr.cloneWith(this.#e.alterColumnNode,{setNotNull:!0})})})}dropNotNull(){return new Ze({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{alterColumn:Yr.cloneWith(this.#e.alterColumnNode,{dropNotNull:!0})})})}};s(an,"AlterColumnBuilder");var Ze=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.alterTableNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Ze,"AlterTableExecutor");var Re=class{#e;constructor(e){this.#e=c(e)}autoIncrement(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.autoIncrement()})}primaryKey(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.primaryKey()})}references(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.references(e)})}onDelete(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.onDelete(e)})}onUpdate(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.onUpdate(e)})}unique(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.unique()})}notNull(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.notNull()})}unsigned(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.unsigned()})}defaultTo(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.defaultTo(e)})}check(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.check(e)})}generatedAlwaysAs(e){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.generatedAlwaysAs(e)})}generatedAlwaysAsIdentity(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.generatedAlwaysAsIdentity()})}generatedByDefaultAsIdentity(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.generatedByDefaultAsIdentity()})}stored(){return new Re({...this.#e,columnBuilder:this.#e.columnBuilder.stored()})}toOperationNode(){return this.#e.executor.transformQuery(xe.cloneWith(this.#e.alterTableNode,{addColumn:Ru.create(this.#e.columnBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Re,"AlterTableAddColumnBuilder");var Oe=class{#e;constructor(e){this.#e=c(e)}autoIncrement(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.autoIncrement()})}primaryKey(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.primaryKey()})}references(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.references(e)})}onDelete(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.onDelete(e)})}onUpdate(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.onUpdate(e)})}unique(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.unique()})}notNull(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.notNull()})}unsigned(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.unsigned()})}defaultTo(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.defaultTo(e)})}check(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.check(e)})}generatedAlwaysAs(e){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.generatedAlwaysAs(e)})}generatedAlwaysAsIdentity(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.generatedAlwaysAsIdentity()})}generatedByDefaultAsIdentity(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.generatedByDefaultAsIdentity()})}stored(){return new Oe({...this.#e,columnBuilder:this.#e.columnBuilder.stored()})}toOperationNode(){return this.#e.executor.transformQuery(xe.cloneWith(this.#e.alterTableNode,{modifyColumn:qu.create(this.#e.columnBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Oe,"AlterTableModifyColumnBuilder");var Dr=class{#e;constructor(e){this.#e=c(e)}onDelete(e){return new Dr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new Dr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}toOperationNode(){return this.#e.executor.transformQuery(xe.cloneWith(this.#e.alterTableNode,{addConstraint:Is.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Dr,"AlterTableAddForeignKeyConstraintBuilder");var cr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new cr({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{dropConstraint:on.cloneWith(this.#e.alterTableNode.dropConstraint,{ifExists:!0})})})}cascade(){return new cr({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{dropConstraint:on.cloneWith(this.#e.alterTableNode.dropConstraint,{modifier:"cascade"})})})}restrict(){return new cr({...this.#e,alterTableNode:xe.cloneWith(this.#e.alterTableNode,{dropConstraint:on.cloneWith(this.#e.alterTableNode.dropConstraint,{modifier:"restrict"})})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.alterTableNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(cr,"AlterTableDropConstraintBuilder");z(Ri,"don't await AlterTableBuilder instances");z(an,"don't await AlterColumnBuilder instances");z(Ze,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");z(Re,"don't await AlterTableAddColumnBuilder instances directly. To execute the query you need to call `execute`");z(Oe,"don't await AlterTableModifyColumnBuilder instances directly. To execute the query you need to call `execute`");z(Dr,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");z(cr,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");var ku=c({is(t){return t.kind==="ListNode"},create(t){return c({kind:"ListNode",items:c(t)})}});var mt=class{#e;constructor(e){this.#e=c(e)}unique(){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{unique:!0})})}on(e){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{table:Ce(e)})})}column(e){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{expression:Ji(e)})})}columns(e){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{expression:ku.create(e.map(Ji))})})}expression(e){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{expression:e.toOperationNode()})})}using(e){return new mt({...this.#e,createIndexNode:tr.cloneWith(this.#e.createIndexNode,{using:ve.createWithSql(e)})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.createIndexNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(mt,"CreateIndexBuilder");z(mt,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");var Pr=class{#e;constructor(e){this.#e=c(e)}ifNotExists(){return new Pr({...this.#e,createSchemaNode:fs.cloneWith(this.#e.createSchemaNode,{ifNotExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.createSchemaNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Pr,"CreateSchemaBuilder");z(Pr,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");var Lu=c({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return c({kind:"PrimaryKeyConstraintNode",columns:c(t.map(re.create)),name:e?Y.create(e):void 0})}});function Fu(t){if(nu.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}s(Fu,"parseOnCommitAction");var Ue=class{#e;constructor(e){this.#e=c(e)}temporary(){return new Ue({...this.#e,createTableNode:dt.cloneWith(this.#e.createTableNode,{temporary:!0})})}onCommit(e){return new Ue({...this.#e,createTableNode:dt.cloneWith(this.#e.createTableNode,{onCommit:Fu(e)})})}ifNotExists(){return new Ue({...this.#e,createTableNode:dt.cloneWith(this.#e.createTableNode,{ifNotExists:!0})})}addColumn(e,r,i=Ui){let n=i(new he(Ie.create(e,sn(r))));return new Ue({...this.#e,createTableNode:dt.cloneWithColumn(this.#e.createTableNode,n.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new Ue({...this.#e,createTableNode:dt.cloneWithConstraint(this.#e.createTableNode,Lu.create(r,e))})}addUniqueConstraint(e,r){return new Ue({...this.#e,createTableNode:dt.cloneWithConstraint(this.#e.createTableNode,Rs.create(r,e))})}addCheckConstraint(e,r){return new Ue({...this.#e,createTableNode:dt.cloneWithConstraint(this.#e.createTableNode,bi.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,i,n,o=Ui){let a=o(new _t($r.create(r.map(re.create),Ce(i),n.map(re.create),e)));return new Ue({...this.#e,createTableNode:dt.cloneWithConstraint(this.#e.createTableNode,a.toOperationNode())})}modifyFront(e){return new Ue({...this.#e,createTableNode:dt.cloneWithFrontModifier(this.#e.createTableNode,e.toOperationNode())})}modifyEnd(e){return new Ue({...this.#e,createTableNode:dt.cloneWithEndModifier(this.#e.createTableNode,e.toOperationNode())})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.createTableNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Ue,"CreateTableBuilder");z(Ue,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");var Kt=class{#e;constructor(e){this.#e=c(e)}on(e){return new Kt({...this.#e,dropIndexNode:mi.cloneWith(this.#e.dropIndexNode,{table:Ce(e)})})}ifExists(){return new Kt({...this.#e,dropIndexNode:mi.cloneWith(this.#e.dropIndexNode,{ifExists:!0})})}cascade(){return new Kt({...this.#e,dropIndexNode:mi.cloneWith(this.#e.dropIndexNode,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.dropIndexNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Kt,"DropIndexBuilder");z(Kt,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");var lr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new lr({...this.#e,dropSchemaNode:zi.cloneWith(this.#e.dropSchemaNode,{ifExists:!0})})}cascade(){return new lr({...this.#e,dropSchemaNode:zi.cloneWith(this.#e.dropSchemaNode,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.dropSchemaNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(lr,"DropSchemaBuilder");z(lr,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");var dr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new dr({...this.#e,dropTableNode:Hi.cloneWith(this.#e.dropTableNode,{ifExists:!0})})}cascade(){return new dr({...this.#e,dropTableNode:Hi.cloneWith(this.#e.dropTableNode,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.dropTableNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(dr,"DropTableBuilder");z(dr,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");var qt=c({is(t){return t.kind==="CreateViewNode"},create(t){return c({kind:"CreateViewNode",name:Ye.create(t)})},cloneWith(t,e){return c({...t,...e})}});var un=class extends Kr{transformValue(e){return{...super.transformValue(e),immediate:!0}}};s(un,"ImmediateValueTransformer");var cn=class{#e=new un;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}};s(cn,"ImmediateValuePlugin");var yt=class{#e;constructor(e){this.#e=c(e)}temporary(){return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{temporary:!0})})}materialized(){return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{materialized:!0})})}ifNotExists(){return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{ifNotExists:!0})})}orReplace(){return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{orReplace:!0})})}columns(e){return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{columns:e.map(Ji)})})}as(e){let r=e.withPlugin(new cn).toOperationNode();return new yt({...this.#e,createViewNode:qt.cloneWith(this.#e.createViewNode,{as:r})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.createViewNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(yt,"CreateViewBuilder");z(yt,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");var Oi=c({is(t){return t.kind==="DropViewNode"},create(t){return c({kind:"DropViewNode",name:Ye.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Xt=class{#e;constructor(e){this.#e=c(e)}materialized(){return new Xt({...this.#e,dropViewNode:Oi.cloneWith(this.#e.dropViewNode,{materialized:!0})})}ifExists(){return new Xt({...this.#e,dropViewNode:Oi.cloneWith(this.#e.dropViewNode,{ifExists:!0})})}cascade(){return new Xt({...this.#e,dropViewNode:Oi.cloneWith(this.#e.dropViewNode,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.dropViewNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(Xt,"DropViewBuilder");z(Xt,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");var Os=c({is(t){return t.kind==="CreateTypeNode"},create(t){return c({kind:"CreateTypeNode",name:Ye.create(t)})},cloneWithEnum(t,e){return c({...t,enum:xi.create(e.map(r=>st.createImmediate(r)))})}});var _r=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.createTypeNode,this.#e.queryId)}asEnum(e){return new _r({...this.#e,createTypeNode:Os.cloneWithEnum(this.#e.createTypeNode,e)})}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(_r,"CreateTypeBuilder");z(_r,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");var Ds=c({is(t){return t.kind==="DropTypeNode"},create(t){return c({kind:"DropTypeNode",name:Ye.create(t)})},cloneWith(t,e){return c({...t,...e})}});var qr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new qr({...this.#e,dropTypeNode:Ds.cloneWith(this.#e.dropTypeNode,{ifExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.dropTypeNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};s(qr,"DropTypeBuilder");z(qr,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");var hr=class{#e;constructor(e){this.#e=e}createTable(e){return new Ue({queryId:oe(),executor:this.#e,createTableNode:dt.create(Ce(e))})}dropTable(e){return new dr({queryId:oe(),executor:this.#e,dropTableNode:Hi.create(Ce(e))})}createIndex(e){return new mt({queryId:oe(),executor:this.#e,createIndexNode:tr.create(e)})}dropIndex(e){return new Kt({queryId:oe(),executor:this.#e,dropIndexNode:mi.create(e)})}createSchema(e){return new Pr({queryId:oe(),executor:this.#e,createSchemaNode:fs.create(e)})}dropSchema(e){return new lr({queryId:oe(),executor:this.#e,dropSchemaNode:zi.create(e)})}alterTable(e){return new Ri({queryId:oe(),executor:this.#e,alterTableNode:xe.create(e)})}createView(e){return new yt({queryId:oe(),executor:this.#e,createViewNode:qt.create(e)})}dropView(e){return new Xt({queryId:oe(),executor:this.#e,dropViewNode:Oi.create(e)})}createType(e){return new _r({queryId:oe(),executor:this.#e,createTypeNode:Os.create(e)})}dropType(e){return new qr({queryId:oe(),executor:this.#e,dropTypeNode:Ds.create(e)})}withPlugin(e){return new hr(this.#e.withPlugin(e))}withoutPlugins(){return new hr(this.#e.withoutPlugins())}withSchema(e){return new hr(this.#e.withPluginAtFront(new Pt(e)))}};s(hr,"SchemaModule");var ln=class{ref(e){return new Gi(e)}};s(ln,"DynamicModule");var dn=class{#e;constructor(e){this.#e=e}async provideConnection(e){let r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}};s(dn,"DefaultConnectionProvider");var kt=class extends Gr{#e;#t;#r;constructor(e,r,i,n=[]){super(n),this.#e=e,this.#t=r,this.#r=i}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new kt(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new kt(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new kt(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new kt(this.#e,this.#t,this.#r,[])}};s(kt,"DefaultQueryExecutor");function Xo(){return typeof performance<"u"&&xt(performance.now)?performance.now():Date.now()}s(Xo,"performanceNow");var hn=class{#e;#t;#r;#i;#n=new WeakSet;constructor(e,r){this.#e=e,this.#t=r}async init(){this.#r||(this.#r=this.#e.init().catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){await this.init();let e=await this.#e.acquireConnection();return this.#n.has(e)||(this.#s()&&this.#o(e),this.#n.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#s(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#o(e){let r=e.executeQuery;e.executeQuery=async i=>{let n=Xo();try{return await r.call(e,i)}catch(o){throw this.#u(o),o}finally{this.#c(i,n)}}}#u(e){this.#t.error(()=>({level:"error",error:e}))}#c(e,r){this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#l(r)}))}#l(e){return Xo()-e}};s(hn,"RuntimeDriver");var Di=class{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t;let r=this.#r(e);return this.#t=r.then(()=>{this.#t=void 0}).catch(()=>{this.#t=void 0}),r}async#r(e){return await e(this.#e)}};s(Di,"SingleConnectionProvider");var Mu=["read uncommitted","read committed","repeatable read","serializable"];var VO=c(["query","error"]),fn=class{#e;#t;constructor(e){xt(e)?(this.#t=e,this.#e=c({query:!0,error:!0})):(this.#t=xp,this.#e=c({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}query(e){this.#e.query&&this.#t(e())}error(e){this.#e.error&&this.#t(e())}};s(fn,"Log");function xp(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${t}`))}s(xp,"defaultLogger");var Lt=class extends pt{#e;constructor(e){let r,i;if(Ep(e))r={executor:e.executor},i={...e};else{let n=e.dialect,o=n.createDriver(),a=n.createQueryCompiler(),u=n.createAdapter(),l=new fn(e.log??[]),f=new hn(o,l),y=new dn(f),v=new kt(a,u,y,e.plugins??[]);r={executor:v},i={config:e,executor:v,dialect:n,driver:f}}super(r),this.#e=c(i)}get schema(){return new hr(this.#e.executor)}get dynamic(){return new ln}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}get fn(){return new Xr}transaction(){return new Zr({...this.#e})}connection(){return new pn({...this.#e})}withPlugin(e){return new Lt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Lt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new Lt({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}};s(Lt,"Kysely");var kr=class extends Lt{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new kr({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new kr({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new kr({...this.#e})}};s(kr,"Transaction");function Ep(t){return zt(t)&&zt(t.config)&&zt(t.driver)&&zt(t.executor)&&zt(t.dialect)}s(Ep,"isKyselyProps");var pn=class{#e;constructor(e){this.#e=c(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{let i=this.#e.executor.withConnectionProvider(new Di(r)),n=new Lt({...this.#e,executor:i});return await e(n)})}};s(pn,"ConnectionBuilder");z(pn,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");var Zr=class{#e;constructor(e){this.#e=c(e)}setIsolationLevel(e){return new Zr({...this.#e,isolationLevel:e})}async execute(e){let{isolationLevel:r,...i}=this.#e,n={isolationLevel:r};return Cp(n),this.#e.executor.provideConnection(async o=>{let a=this.#e.executor.withConnectionProvider(new Di(o)),u=new kr({...i,executor:a});try{await this.#e.driver.beginTransaction(o,n);let l=await e(u);return await this.#e.driver.commitTransaction(o),l}catch(l){throw await this.#e.driver.rollbackTransaction(o),l}})}};s(Zr,"TransactionBuilder");z(Zr,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function Cp(t){if(t.isolationLevel&&!Mu.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}s(Cp,"validateTransactionSettings");var et=Object.assign((t,...e)=>new be({queryId:oe(),rawNode:ve.create(t,e?.map(jt)??[])}),{ref(t){return new be({queryId:oe(),rawNode:ve.createWithChild(Be(t))})},value(t){return new be({queryId:oe(),rawNode:ve.createWithChild(jt(t))})},table(t){return new be({queryId:oe(),rawNode:ve.createWithChild(Ce(t))})},id(...t){let e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",new be({queryId:oe(),rawNode:ve.create(e,t.map(Y.create))})},literal(t){return new be({queryId:oe(),rawNode:ve.createWithChild(st.createImmediate(t))})},raw(t){return new be({queryId:oe(),rawNode:ve.createWithSql(t)})},join(t,e=et`, `){let r=new Array(2*t.length-1),i=e.toOperationNode();for(let n=0;n<t.length;++n)r[2*n]=jt(t[n]),n!==t.length-1&&(r[2*n+1]=i);return new be({queryId:oe(),rawNode:ve.createWithChildren(r)})}});var mn=class{nodeStack=[];get parentNode(){return this.nodeStack[this.nodeStack.length-2]}#e=c({AliasNode:this.visitAlias.bind(this),ColumnNode:this.visitColumn.bind(this),IdentifierNode:this.visitIdentifier.bind(this),SchemableIdentifierNode:this.visitSchemableIdentifier.bind(this),RawNode:this.visitRaw.bind(this),ReferenceNode:this.visitReference.bind(this),SelectQueryNode:this.visitSelectQuery.bind(this),SelectionNode:this.visitSelection.bind(this),TableNode:this.visitTable.bind(this),FromNode:this.visitFrom.bind(this),SelectAllNode:this.visitSelectAll.bind(this),FilterNode:this.visitFilter.bind(this),AndNode:this.visitAnd.bind(this),OrNode:this.visitOr.bind(this),ValueNode:this.visitValue.bind(this),ValueListNode:this.visitValueList.bind(this),PrimitiveValueListNode:this.visitPrimitiveValueList.bind(this),ParensNode:this.visitParens.bind(this),JoinNode:this.visitJoin.bind(this),OperatorNode:this.visitOperator.bind(this),WhereNode:this.visitWhere.bind(this),InsertQueryNode:this.visitInsertQuery.bind(this),DeleteQueryNode:this.visitDeleteQuery.bind(this),ReturningNode:this.visitReturning.bind(this),CreateTableNode:this.visitCreateTable.bind(this),AddColumnNode:this.visitAddColumn.bind(this),ColumnDefinitionNode:this.visitColumnDefinition.bind(this),DropTableNode:this.visitDropTable.bind(this),DataTypeNode:this.visitDataType.bind(this),OrderByNode:this.visitOrderBy.bind(this),OrderByItemNode:this.visitOrderByItem.bind(this),GroupByNode:this.visitGroupBy.bind(this),GroupByItemNode:this.visitGroupByItem.bind(this),UpdateQueryNode:this.visitUpdateQuery.bind(this),ColumnUpdateNode:this.visitColumnUpdate.bind(this),LimitNode:this.visitLimit.bind(this),OffsetNode:this.visitOffset.bind(this),OnConflictNode:this.visitOnConflict.bind(this),OnDuplicateKeyNode:this.visitOnDuplicateKey.bind(this),CreateIndexNode:this.visitCreateIndex.bind(this),DropIndexNode:this.visitDropIndex.bind(this),ListNode:this.visitList.bind(this),PrimaryKeyConstraintNode:this.visitPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.visitUniqueConstraint.bind(this),ReferencesNode:this.visitReferences.bind(this),CheckConstraintNode:this.visitCheckConstraint.bind(this),WithNode:this.visitWith.bind(this),CommonTableExpressionNode:this.visitCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.visitCommonTableExpressionName.bind(this),HavingNode:this.visitHaving.bind(this),CreateSchemaNode:this.visitCreateSchema.bind(this),DropSchemaNode:this.visitDropSchema.bind(this),AlterTableNode:this.visitAlterTable.bind(this),DropColumnNode:this.visitDropColumn.bind(this),RenameColumnNode:this.visitRenameColumn.bind(this),AlterColumnNode:this.visitAlterColumn.bind(this),ModifyColumnNode:this.visitModifyColumn.bind(this),AddConstraintNode:this.visitAddConstraint.bind(this),DropConstraintNode:this.visitDropConstraint.bind(this),ForeignKeyConstraintNode:this.visitForeignKeyConstraint.bind(this),CreateViewNode:this.visitCreateView.bind(this),DropViewNode:this.visitDropView.bind(this),GeneratedNode:this.visitGenerated.bind(this),DefaultValueNode:this.visitDefaultValue.bind(this),OnNode:this.visitOn.bind(this),ValuesNode:this.visitValues.bind(this),SelectModifierNode:this.visitSelectModifier.bind(this),CreateTypeNode:this.visitCreateType.bind(this),DropTypeNode:this.visitDropType.bind(this),ExplainNode:this.visitExplain.bind(this),DefaultInsertValueNode:this.visitDefaultInsertValue.bind(this),AggregateFunctionNode:this.visitAggregateFunction.bind(this),OverNode:this.visitOver.bind(this),PartitionByNode:this.visitPartitionBy.bind(this),PartitionByItemNode:this.visitPartitionByItem.bind(this),SetOperationNode:this.visitSetOperation.bind(this)});visitNode=e=>{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}};s(mn,"OperationNodeVisitor");var ei=class extends mn{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),c({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){let r=this.parentNode!==void 0&&!$e.is(this.parentNode)&&!qt.is(this.parentNode)&&!xs.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select "),e.distinctOnSelections&&(this.compileDistinctOn(e.distinctOnSelections),this.append(" ")),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.selections&&(this.compileList(e.selections),this.append(" ")),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){let i=hs(e);for(let n of e)this.visitNode(n),n!==i&&this.append(r)}visitWhere(e){this.append("where "),this.visitNode(e.where)}visitHaving(e){this.append("having "),this.visitNode(e.having)}visitInsertQuery(e){let r=this.nodeStack.find(K.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append(e.replace?"replace":"insert"),e.ignore&&this.append(" ignore"),this.append(" into "),this.visitNode(e.into),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.values&&(this.append(" "),this.visitNode(e.values)),e.onConflict&&(this.append(" "),this.visitNode(e.onConflict)),e.onDuplicateKey&&(this.append(" "),this.visitNode(e.onDuplicateKey)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitValues(e){this.append("values "),this.compileList(e.values)}visitDeleteQuery(e){let r=this.nodeStack.find(K.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("delete "),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitReturning(e){this.append("returning "),this.compileList(e.selections)}visitAlias(e){this.visitNode(e.node),this.append(" as "),this.visitNode(e.alias)}visitReference(e){this.visitNode(e.table),this.append("."),this.visitNode(e.column)}visitSelectAll(e){this.append("*")}visitIdentifier(e){this.append(this.getLeftIdentifierWrapper()),this.compileUnwrappedIdentifier(e),this.append(this.getRightIdentifierWrapper())}compileUnwrappedIdentifier(e){if(!rt(e.name))throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");this.append(this.sanitizeIdentifier(e.name))}visitFilter(e){e.left&&(this.visitNode(e.left),this.append(" ")),this.visitNode(e.op),this.append(" "),this.visitNode(e.right)}visitAnd(e){this.visitNode(e.left),this.append(" and "),this.visitNode(e.right)}visitOr(e){this.visitNode(e.left),this.append(" or "),this.visitNode(e.right)}visitValue(e){e.immediate?this.appendImmediateValue(e.value):this.appendValue(e.value)}visitValueList(e){this.append("("),this.compileList(e.values),this.append(")")}visitPrimitiveValueList(e){this.append("(");let{values:r}=e;for(let i=0;i<r.length;++i)this.appendValue(r[i]),i!==r.length-1&&this.append(", ");this.append(")")}visitParens(e){this.append("("),this.visitNode(e.node),this.append(")")}visitJoin(e){this.append(Tp[e.joinType]),this.append(" "),this.visitNode(e.table),e.on&&(this.append(" "),this.visitNode(e.on))}visitOn(e){this.append("on "),this.visitNode(e.on)}visitRaw(e){let{sqlFragments:r,parameters:i}=e;for(let n=0;n<r.length;++n)this.append(r[n]),i.length>n&&this.visitNode(i[n])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&(this.append(" "),this.compileList(e.endModifiers," "))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){let r=this.nodeStack.find(K.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.expression&&(this.append(" ("),this.visitNode(e.expression),this.append(")"))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.renameColumn&&this.visitNode(e.renameColumn),e.addColumn&&this.visitNode(e.addColumn),e.dropColumn&&this.visitNode(e.dropColumn),e.alterColumn&&this.visitNode(e.alterColumn),e.modifyColumn&&this.visitNode(e.modifyColumn)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(Sp[e.modifier])}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.visitNode(e.column),this.append(")"),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){let r=this.getLeftIdentifierWrapper(),i=this.getRightIdentifierWrapper(),n="";for(let o of e)n+=o,o===r?n+=r:o===i&&(n+=i);return n}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(rt(e))this.append(`'${e}'`);else if(tu(e)||ls(e))this.append(e.toString());else if(ds(e))this.append("null");else if(ru(e))this.appendImmediateValue(e.toISOString());else if(iu(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}};s(ei,"DefaultQueryCompiler");var Sp=c({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),Tp=c({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"});var ti=class{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}};s(ti,"DialectAdapterBase");var yn=class{transformQuery(e){return e.node}async transformResult(e){return e.result}};s(yn,"NoopPlugin");var gn="kysely_migration",Nn="kysely_migration_lock",Wu="migration_lock",Go=c({__noMigrations__:!0}),vn=class{#e;constructor(e){this.#e=c(e)}async getMigrations(){let e=await this.#a(this.#i)?await this.#e.db.withPlugin(this.#s).selectFrom(this.#i).select(["name","timestamp"]).execute():[];return(await this.#f()).map(({name:i,...n})=>{let o=e.find(a=>a.name===i);return{name:i,migration:n,executedAt:o?new Date(o.timestamp):void 0}})}async migrateToLatest(){return this.#t(({migrations:e})=>e.length-1)}async migrateTo(e){return this.#t(({migrations:r})=>{if(e===Go)return-1;let i=r.findIndex(n=>n.name===e);if(i===-1)throw new Error(`migration "${e}" doesn't exist`);return i})}async migrateUp(){return this.#t(({currentIndex:e,migrations:r})=>Math.min(e+1,r.length-1))}async migrateDown(){return this.#t(({currentIndex:e})=>Math.max(e-1,-1))}async#t(e){try{return await this.#o(),await this.#m(e)}catch(r){return r instanceof Pi?r.resultSet:{error:r}}}get#r(){return this.#e.migrationTableSchema}get#i(){return this.#e.migrationTableName??gn}get#n(){return this.#e.migrationLockTableName??Nn}get#s(){return this.#r?new Pt(this.#r):new yn}async#o(){await this.#u(),await this.#c(),await this.#l(),await this.#p()}async#u(){if(this.#r&&!await this.#d())try{await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute()}catch(e){if(!await this.#d())throw e}}async#c(){if(!await this.#a(this.#i))try{this.#r&&await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute(),await this.#e.db.schema.withPlugin(this.#s).createTable(this.#i).ifNotExists().addColumn("name","varchar(255)",e=>e.notNull().primaryKey()).addColumn("timestamp","varchar(255)",e=>e.notNull()).execute()}catch(e){if(!await this.#a(this.#i))throw e}}async#l(){if(!await this.#a(this.#n))try{await this.#e.db.schema.withPlugin(this.#s).createTable(this.#n).ifNotExists().addColumn("id","varchar(255)",e=>e.notNull().primaryKey()).addColumn("is_locked","integer",e=>e.notNull().defaultTo(0)).execute()}catch(e){if(!await this.#a(this.#n))throw e}}async#p(){if(!await this.#h())try{await this.#e.db.withPlugin(this.#s).insertInto(this.#n).values({id:Wu,is_locked:0}).execute()}catch(e){if(!await this.#h())throw e}}async#d(){return(await this.#e.db.introspection.getSchemas()).some(r=>r.name===this.#r)}async#a(e){let r=this.#r;return(await this.#e.db.introspection.getTables({withInternalKyselyTables:!0})).some(n=>n.name===e&&(!r||n.schema===r))}async#h(){return!!await this.#e.db.withPlugin(this.#s).selectFrom(this.#n).where("id","=",Wu).select("id").executeTakeFirst()}async#m(e){let r=this.#e.db.getExecutor().adapter,i=s(async n=>{try{await r.acquireMigrationLock(n);let o=await this.#y(n);if(o.migrations.length===0)return{results:[]};let a=e(o);return a===void 0?{results:[]}:a<o.currentIndex?await this.#N(n,o,a):a>o.currentIndex?await this.#w(n,o,a):{results:[]}}finally{await r.releaseMigrationLock(n)}},"run");return r.supportsTransactionalDdl?this.#e.db.transaction().execute(i):this.#e.db.connection().execute(i)}async#y(e){let r=await this.#f(),i=await this.#v(e);return this.#g(r,i),c({migrations:r,currentIndex:r.findIndex(n=>n.name===hs(i))})}async#f(){let e=await this.#e.provider.getMigrations();return Object.keys(e).sort().map(r=>({...e[r],name:r}))}async#v(e){return(await e.withPlugin(this.#s).selectFrom(this.#i).select("name").orderBy("name").execute()).map(i=>i.name)}#g(e,r){for(let i of r)if(!e.some(n=>n.name===i))throw new Error(`corrupted migrations: previously executed migration ${i} is missing`);for(let i=0;i<r.length;++i)if(e[i].name!==r[i])throw new Error(`corrupted migrations: expected previously executed migration ${r[i]} to be at index ${i} but ${e[i].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`)}async#N(e,r,i){let n=[];for(let o=r.currentIndex;o>i;--o)n.push({migrationName:r.migrations[o].name,direction:"Down",status:"NotExecuted"});for(let o=0;o<n.length;++o){let a=r.migrations.find(u=>u.name===n[o].migrationName);try{a.down&&(await a.down(e),await e.withPlugin(this.#s).deleteFrom(this.#i).where("name","=",a.name).execute(),n[o]={migrationName:a.name,direction:"Down",status:"Success"})}catch(u){throw n[o]={migrationName:a.name,direction:"Down",status:"Error"},new Pi({error:u,results:n})}}return{results:n}}async#w(e,r,i){let n=[];for(let o=r.currentIndex+1;o<=i;++o)n.push({migrationName:r.migrations[o].name,direction:"Up",status:"NotExecuted"});for(let o=0;o<n.length;++o){let a=r.migrations.find(u=>u.name===n[o].migrationName);try{await a.up(e),await e.withPlugin(this.#s).insertInto(this.#i).values({name:a.name,timestamp:new Date().toISOString()}).execute(),n[o]={migrationName:a.name,direction:"Up",status:"Success"}}catch(u){throw n[o]={migrationName:a.name,direction:"Up",status:"Error"},new Pi({error:u,results:n})}}return{results:n}}};s(vn,"Migrator");var Pi=class extends Error{#e;constructor(e){super(),this.#e=e}get resultSet(){return this.#e}};s(Pi,"MigrationResultSetError");var bp=/"/g,wn=class extends ei{sanitizeIdentifier(e){return e.replace(bp,'""')}};s(wn,"PostgresQueryCompiler");var xn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("pg_catalog.pg_namespace").select("nspname").castTo().execute()).map(r=>({name:r.nspname}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("pg_catalog.pg_attribute as a").innerJoin("pg_catalog.pg_class as c","a.attrelid","c.oid").innerJoin("pg_catalog.pg_namespace as ns","c.relnamespace","ns.oid").innerJoin("pg_catalog.pg_type as typ","a.atttypid","typ.oid").select(["a.attname as column","a.attnotnull as not_null","a.atthasdef as has_default","c.relname as table","ns.nspname as schema","typ.typname as type",this.#e.selectFrom("pg_class").select(et`true`.as("auto_incrementing")).whereRef("relnamespace","=","c.relnamespace").where("relkind","=","S").where("relname","=",et`c.relname || '_' || a.attname || '_seq'`).as("auto_incrementing")]).where("c.relkind","=","r").where("ns.nspname","!~","^pg_").where("ns.nspname","!=","information_schema").where("a.attnum",">=",0).where("a.attisdropped","!=",!0).orderBy("ns.nspname").orderBy("c.relname").orderBy("a.attname").castTo();e.withInternalKyselyTables||(r=r.where("c.relname","!=",gn).where("c.relname","!=",Nn));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(o=>o.name===i.table&&o.schema===i.schema);return n||(n=c({name:i.table,schema:i.schema,columns:[]}),r.push(n)),n.columns.push(c({name:i.column,dataType:i.type,isNullable:!i.not_null,isAutoIncrementing:!!i.auto_incrementing,hasDefaultValue:i.has_default})),r},[])}};s(xn,"PostgresIntrospector");var Ap=3853314791062309107n,En=class extends ti{get supportsTransactionalDdl(){return!0}get supportsReturning(){return!0}async acquireMigrationLock(e){await et`select pg_advisory_xact_lock(${et.literal(Ap)})`.execute(e)}async releaseMigrationLock(){}};s(En,"PostgresAdapter");var Ip=/`/g,Cn=class extends ei{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getExplainOptionAssignment(){return"="}getExplainOptionsDelimiter(){return" "}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return"`"}getRightIdentifierWrapper(){return"`"}sanitizeIdentifier(e){return e.replace(Ip,"``")}};s(Cn,"MysqlQueryCompiler");var Sn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("information_schema.schemata").select("schema_name").castTo().execute()).map(r=>({name:r.SCHEMA_NAME}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("information_schema.columns").select(["COLUMN_NAME","COLUMN_DEFAULT","TABLE_NAME","TABLE_SCHEMA","IS_NULLABLE","DATA_TYPE","EXTRA"]).where("table_schema","=",et`database()`).orderBy("table_name").orderBy("column_name").castTo();e.withInternalKyselyTables||(r=r.where("table_name","!=",gn).where("table_name","!=",Nn));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(o=>o.name===i.TABLE_NAME);return n||(n=c({name:i.TABLE_NAME,schema:i.TABLE_SCHEMA,columns:[]}),r.push(n)),n.columns.push(c({name:i.COLUMN_NAME,dataType:i.DATA_TYPE,isNullable:i.IS_NULLABLE==="YES",isAutoIncrementing:i.EXTRA.toLowerCase().includes("auto_increment"),hasDefaultValue:i.COLUMN_DEFAULT!==null})),r},[])}};s(Sn,"MysqlIntrospector");var Bu="ea586330-2c93-47c8-908d-981d9d270f9d",Rp=60*60,Tn=class extends ti{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}async acquireMigrationLock(e){await et`select get_lock(${et.literal(Bu)}, ${et.literal(Rp)})`.execute(e)}async releaseMigrationLock(e){await et`select release_lock(${et.literal(Bu)})`.execute(e)}};s(Tn,"MysqlAdapter");var bn=class{#e;constructor(e){this.#e=e}async init(){}async acquireConnection(){return new Ps(this.#e)}async beginTransaction(e){await e.beginTransaction()}async commitTransaction(e){await e.commitTransaction()}async rollbackTransaction(e){await e.rollbackTransaction()}async releaseConnection(e){}async destroy(){}};s(bn,"DataApiDriver");var Ps=class{#e;#t;constructor(e){this.#e=e}async beginTransaction(){let e=await this.#e.client.beginTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,database:this.#e.database}).promise();this.#t=e.transactionId}async commitTransaction(){if(!this.#t)throw new Error("Cannot commit a transaction before creating it");await this.#e.client.commitTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async rollbackTransaction(){if(!this.#t)throw new Error("Cannot rollback a transaction before creating it");await this.#e.client.rollbackTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async executeQuery(e){let r=await this.#e.client.executeStatement({transactionId:this.#t,secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,sql:e.sql,parameters:e.parameters,database:this.#e.database,includeResultMetadata:!0}).promise();return r.columnMetadata?{rows:r.records?.filter(o=>o.length!==0).map(o=>Object.fromEntries(o.map((a,u)=>[r.columnMetadata[u].label||r.columnMetadata[u].name,a.stringValue??a.blobValue??a.longValue??a.arrayValue??a.doubleValue??(a.isNull?null:a.booleanValue)])))||[]}:{numUpdatedOrDeletedRows:BigInt(r.numberOfRecordsUpdated||0),rows:[]}}async*streamQuery(e,r){throw new Error("Data API does not support streaming")}};s(Ps,"DataApiConnection");var An=class extends wn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Vu(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};s(An,"PostgresDataApiQueryCompiler");var In=class extends Cn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Vu(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};s(In,"MysqlDataApiQueryCompiler");function Vu(t){switch(typeof t){case"bigint":return{value:{doubleValue:Number(t)}};case"boolean":return{value:{booleanValue:t}};case"number":return Number.isInteger(t)?{value:{longValue:t}}:{value:{doubleValue:t}};case"object":if(t==null)return{value:{isNull:!0}};if(Buffer.isBuffer(t))return{value:{blobValue:t}};if(t instanceof Date)return{typeHint:"TIMESTAMP",value:{stringValue:Uu(t.toISOString())}};if(t?.value&&Pp(t.value))return t.typeHint&&t.value.stringValue&&typeof t.value.stringValue=="string"&&(t.value.stringValue=Op(t.typeHint,t.value.stringValue)),t;break;case"string":return{value:{stringValue:t}}}throw new _i("Could not serialize value")}s(Vu,"serialize");function Op(t,e){switch(t){case"DATE":return Jo(e).slice(0,10);case"TIME":return e.match(/^\d{4}-\d{2}-\d{2}/)?Jo(e).slice(11,23):Dp(e);case"TIMESTAMP":return Uu(Jo(e))}return e}s(Op,"fixStringValue");function Dp(t){let e=(t||"00:00:00").split(":");for(;e.length<3;)e.push("00");return e.join(":").slice(0,12)}s(Dp,"fixTimeString");function Uu(t){return t.replace("T"," ").slice(0,23)}s(Uu,"fixISOString");function Jo(t){return new Date(Date.parse(t)).toISOString()}s(Jo,"parseToISOString");function Pp(t){for(let e of qp)if(t[e])return!0;if(t.arrayValue){for(let e of _p)if(t.arrayValue?.[e])return!0}return!1}s(Pp,"isValueObject");var _i=class extends Error{constructor(e){super(e),this.name=_i.name}};s(_i,"QueryCompilerError");var _p=["booleanValues","doubleValues","longValues","stringValues"],qp=["blobValue","booleanValue","doubleValue","isNull","longValue","stringValue"];var Rn=class{#e;constructor(e){this.#e=e}createAdapter(){if(this.#e.mode==="postgres")return new En;if(this.#e.mode==="mysql")return new Tn;throw new Error("Unknown mode "+this.#e.mode)}createDriver(){return new bn(this.#e.driver)}createQueryCompiler(){if(this.#e.mode==="postgres")return new An;if(this.#e.mode==="mysql")return new In;throw new Error("Unknown mode "+this.#e.mode)}createIntrospector(e){if(this.#e.mode==="postgres")return new xn(e);if(this.#e.mode==="mysql")return new Sn(e);throw new Error("Unknown mode "+this.#e.mode)}};s(Rn,"DataApiDialect");var Hf=tp(zf(),1);import pN from"url";async function RF(t){let e=new Lt({dialect:new Rn({mode:process.env.RDS_ENGINE_MODE,driver:{client:new Hf.default,database:t?.database||process.env.RDS_DATABASE,secretArn:process.env.RDS_SECRET,resourceArn:process.env.RDS_ARN}})}),r=new vn({db:e,provider:new bo(fN.resolve(process.env.RDS_MIGRATIONS_PATH))});if(!t.type||t.type==="latest"){let i=await r.migrateToLatest(),n=i.error||i.results?.find(o=>o.status==="Error");if(n)throw n;return i}if(t.type==="to"){if(!t.data.name)return await r.migrateTo(Go);let i=await r.migrateTo(t.data.name),n=i.error||i.results?.find(o=>o.status==="Error");if(n)throw n;return i}if(t.type==="list")return await r.getMigrations()}s(RF,"handler");var bo=class{#e;constructor(e){this.#e=e}async getMigrations(){let e=await import("fs/promises"),r=await import("path"),i={},n=await e.readdir(this.#e);for(let o of n)if(o.endsWith(".js")||o.endsWith(".cjs")||o.endsWith(".mjs")){let[a]=r.basename(o).split("."),u=r.join(this.#e,o);if(process.env.LAMBDA_TASK_ROOT){let f=await import(u);i[a]=f;continue}let l=u.replace(/(mjs|cjs|js)/g,`${Date.now()}.$1`);try{await e.copyFile(u,l);let f=await import(pN.pathToFileURL(l).href);i[a]=f}catch(f){console.error(f)}await e.rm(l)}return i}};s(bo,"DynamicFileMigrationProvider");export{RF as handler};
21
+ Char: `+m.c),f=new Error(f),m.error=f,X(m,"onerror",f),m}o(Me,"error");function bt(m){return m.sawRoot&&!m.closedRoot&&Z(m,"Unclosed root tag"),m.state!==g.BEGIN&&m.state!==g.BEGIN_WHITESPACE&&m.state!==g.TEXT&&Me(m,"Unexpected end"),oe(m),m.c="",m.closed=!0,X(m,"onend"),r.call(m,m.strict,m.opt),m}o(bt,"end");function Z(m,f){if(typeof m!="object"||!(m instanceof r))throw new Error("bad call to strictFail");m.strict&&Me(m,f)}o(Z,"strictFail");function Er(m){m.strict||(m.tagName=m.tagName[m.looseCase]());var f=m.tags[m.tags.length-1]||m,k=m.tag={name:m.tagName,attributes:{}};m.opt.xmlns&&(k.ns=f.ns),m.attribList.length=0,F(m,"onopentagstart",k)}o(Er,"newTag");function xr(m,f){var k=m.indexOf(":"),O=k<0?["",m]:m.split(":"),ee=O[0],we=O[1];return f&&m==="xmlns"&&(ee="xmlns",we=""),{prefix:ee,local:we}}o(xr,"qname");function Cr(m){if(m.strict||(m.attribName=m.attribName[m.looseCase]()),m.attribList.indexOf(m.attribName)!==-1||m.tag.attributes.hasOwnProperty(m.attribName)){m.attribName=m.attribValue="";return}if(m.opt.xmlns){var f=xr(m.attribName,!0),k=f.prefix,O=f.local;if(k==="xmlns")if(O==="xml"&&m.attribValue!==S)Z(m,"xml: prefix must be bound to "+S+`
22
+ Actual: `+m.attribValue);else if(O==="xmlns"&&m.attribValue!==I)Z(m,"xmlns: prefix must be bound to "+I+`
23
+ Actual: `+m.attribValue);else{var ee=m.tag,we=m.tags[m.tags.length-1]||m;ee.ns===we.ns&&(ee.ns=Object.create(we.ns)),ee.ns[O]=m.attribValue}m.attribList.push([m.attribName,m.attribValue])}else m.tag.attributes[m.attribName]=m.attribValue,F(m,"onattribute",{name:m.attribName,value:m.attribValue});m.attribName=m.attribValue=""}o(Cr,"attrib");function Nt(m,f){if(m.opt.xmlns){var k=m.tag,O=xr(m.tagName);k.prefix=O.prefix,k.local=O.local,k.uri=k.ns[O.prefix]||"",k.prefix&&!k.uri&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(m.tagName)),k.uri=O.prefix);var ee=m.tags[m.tags.length-1]||m;k.ns&&ee.ns!==k.ns&&Object.keys(k.ns).forEach(function(Gi){F(m,"onopennamespace",{prefix:Gi,uri:k.ns[Gi]})});for(var we=0,Te=m.attribList.length;we<Te;we++){var Je=m.attribList[we],wt=Je[0],Tr=Je[1],Re=xr(wt,!0),It=Re.prefix,Xi=Re.local,J=It===""?"":k.ns[It]||"",Xr={name:wt,value:Tr,prefix:It,local:Xi,uri:J};It&&It!=="xmlns"&&!J&&(Z(m,"Unbound namespace prefix: "+JSON.stringify(It)),Xr.uri=It),m.tag.attributes[wt]=Xr,F(m,"onattribute",Xr)}m.attribList.length=0}m.tag.isSelfClosing=!!f,m.sawRoot=!0,m.tags.push(m.tag),F(m,"onopentag",m.tag),f||(!m.noscript&&m.tagName.toLowerCase()==="script"?m.state=g.SCRIPT:m.state=g.TEXT,m.tag=null,m.tagName=""),m.attribName=m.attribValue="",m.attribList.length=0}o(Nt,"openTag");function Sr(m){if(!m.tagName){Z(m,"Weird empty close tag."),m.textNode+="</>",m.state=g.TEXT;return}if(m.script){if(m.tagName!=="script"){m.script+="</"+m.tagName+">",m.tagName="",m.state=g.SCRIPT;return}F(m,"onscript",m.script),m.script=""}var f=m.tags.length,k=m.tagName;m.strict||(k=k[m.looseCase]());for(var O=k;f--;){var ee=m.tags[f];if(ee.name!==O)Z(m,"Unexpected close tag");else break}if(f<0){Z(m,"Unmatched closing tag: "+m.tagName),m.textNode+="</"+m.tagName+">",m.state=g.TEXT;return}m.tagName=k;for(var we=m.tags.length;we-- >f;){var Te=m.tag=m.tags.pop();m.tagName=m.tag.name,F(m,"onclosetag",m.tagName);var Je={};for(var wt in Te.ns)Je[wt]=Te.ns[wt];var Tr=m.tags[m.tags.length-1]||m;m.opt.xmlns&&Te.ns!==Tr.ns&&Object.keys(Te.ns).forEach(function(Re){var It=Te.ns[Re];F(m,"onclosenamespace",{prefix:Re,uri:It})})}f===0&&(m.closedRoot=!0),m.tagName=m.attribValue=m.attribName="",m.attribList.length=0,m.state=g.TEXT}o(Sr,"closeTag");function wi(m){var f=m.entity,k=f.toLowerCase(),O,ee="";return m.ENTITIES[f]?m.ENTITIES[f]:m.ENTITIES[k]?m.ENTITIES[k]:(f=k,f.charAt(0)==="#"&&(f.charAt(1)==="x"?(f=f.slice(2),O=parseInt(f,16),ee=O.toString(16)):(f=f.slice(1),O=parseInt(f,10),ee=O.toString(10))),f=f.replace(/^0+/,""),isNaN(O)||ee.toLowerCase()!==f?(Z(m,"Invalid character entity"),"&"+m.entity+";"):String.fromCodePoint(O))}o(wi,"parseEntity");function At(m,f){f==="<"?(m.state=g.OPEN_WAKA,m.startTagPosition=m.position):C(f)||(Z(m,"Non-whitespace before first tag."),m.textNode=f,m.state=g.TEXT)}o(At,"beginWhiteSpace");function Ut(m,f){var k="";return f<m.length&&(k=m.charAt(f)),k}o(Ut,"charAt");function Kr(m){var f=this;if(this.error)throw this.error;if(f.closed)return Me(f,"Cannot write after close. Assign an onready handler.");if(m===null)return bt(f);typeof m=="object"&&(m=m.toString());for(var k=0,O="";O=Ut(m,k++),f.c=O,!!O;)switch(f.trackPosition&&(f.position++,O===`
24
+ `?(f.line++,f.column=0):f.column++),f.state){case g.BEGIN:if(f.state=g.BEGIN_WHITESPACE,O==="\uFEFF")continue;At(f,O);continue;case g.BEGIN_WHITESPACE:At(f,O);continue;case g.TEXT:if(f.sawRoot&&!f.closedRoot){for(var ee=k-1;O&&O!=="<"&&O!=="&";)O=Ut(m,k++),O&&f.trackPosition&&(f.position++,O===`
25
+ `?(f.line++,f.column=0):f.column++);f.textNode+=m.substring(ee,k-1)}O==="<"&&!(f.sawRoot&&f.closedRoot&&!f.strict)?(f.state=g.OPEN_WAKA,f.startTagPosition=f.position):(!C(O)&&(!f.sawRoot||f.closedRoot)&&Z(f,"Text data outside of root node."),O==="&"?f.state=g.TEXT_ENTITY:f.textNode+=O);continue;case g.SCRIPT:O==="<"?f.state=g.SCRIPT_ENDING:f.script+=O;continue;case g.SCRIPT_ENDING:O==="/"?f.state=g.CLOSE_TAG:(f.script+="<"+O,f.state=g.SCRIPT);continue;case g.OPEN_WAKA:if(O==="!")f.state=g.SGML_DECL,f.sgmlDecl="";else if(!C(O))if(T(w,O))f.state=g.OPEN_TAG,f.tagName=O;else if(O==="/")f.state=g.CLOSE_TAG,f.tagName="";else if(O==="?")f.state=g.PROC_INST,f.procInstName=f.procInstBody="";else{if(Z(f,"Unencoded <"),f.startTagPosition+1<f.position){var we=f.position-f.startTagPosition;O=new Array(we).join(" ")+O}f.textNode+="<"+O,f.state=g.TEXT}continue;case g.SGML_DECL:(f.sgmlDecl+O).toUpperCase()===y?(F(f,"onopencdata"),f.state=g.CDATA,f.sgmlDecl="",f.cdata=""):f.sgmlDecl+O==="--"?(f.state=g.COMMENT,f.comment="",f.sgmlDecl=""):(f.sgmlDecl+O).toUpperCase()===v?(f.state=g.DOCTYPE,(f.doctype||f.sawRoot)&&Z(f,"Inappropriately located doctype declaration"),f.doctype="",f.sgmlDecl=""):O===">"?(F(f,"onsgmldeclaration",f.sgmlDecl),f.sgmlDecl="",f.state=g.TEXT):(R(O)&&(f.state=g.SGML_DECL_QUOTED),f.sgmlDecl+=O);continue;case g.SGML_DECL_QUOTED:O===f.q&&(f.state=g.SGML_DECL,f.q=""),f.sgmlDecl+=O;continue;case g.DOCTYPE:O===">"?(f.state=g.TEXT,F(f,"ondoctype",f.doctype),f.doctype=!0):(f.doctype+=O,O==="["?f.state=g.DOCTYPE_DTD:R(O)&&(f.state=g.DOCTYPE_QUOTED,f.q=O));continue;case g.DOCTYPE_QUOTED:f.doctype+=O,O===f.q&&(f.q="",f.state=g.DOCTYPE);continue;case g.DOCTYPE_DTD:f.doctype+=O,O==="]"?f.state=g.DOCTYPE:R(O)&&(f.state=g.DOCTYPE_DTD_QUOTED,f.q=O);continue;case g.DOCTYPE_DTD_QUOTED:f.doctype+=O,O===f.q&&(f.state=g.DOCTYPE_DTD,f.q="");continue;case g.COMMENT:O==="-"?f.state=g.COMMENT_ENDING:f.comment+=O;continue;case g.COMMENT_ENDING:O==="-"?(f.state=g.COMMENT_ENDED,f.comment=We(f.opt,f.comment),f.comment&&F(f,"oncomment",f.comment),f.comment=""):(f.comment+="-"+O,f.state=g.COMMENT);continue;case g.COMMENT_ENDED:O!==">"?(Z(f,"Malformed comment"),f.comment+="--"+O,f.state=g.COMMENT):f.state=g.TEXT;continue;case g.CDATA:O==="]"?f.state=g.CDATA_ENDING:f.cdata+=O;continue;case g.CDATA_ENDING:O==="]"?f.state=g.CDATA_ENDING_2:(f.cdata+="]"+O,f.state=g.CDATA);continue;case g.CDATA_ENDING_2:O===">"?(f.cdata&&F(f,"oncdata",f.cdata),F(f,"onclosecdata"),f.cdata="",f.state=g.TEXT):O==="]"?f.cdata+="]":(f.cdata+="]]"+O,f.state=g.CDATA);continue;case g.PROC_INST:O==="?"?f.state=g.PROC_INST_ENDING:C(O)?f.state=g.PROC_INST_BODY:f.procInstName+=O;continue;case g.PROC_INST_BODY:if(!f.procInstBody&&C(O))continue;O==="?"?f.state=g.PROC_INST_ENDING:f.procInstBody+=O;continue;case g.PROC_INST_ENDING:O===">"?(F(f,"onprocessinginstruction",{name:f.procInstName,body:f.procInstBody}),f.procInstName=f.procInstBody="",f.state=g.TEXT):(f.procInstBody+="?"+O,f.state=g.PROC_INST_BODY);continue;case g.OPEN_TAG:T(D,O)?f.tagName+=O:(Er(f),O===">"?Nt(f):O==="/"?f.state=g.OPEN_TAG_SLASH:(C(O)||Z(f,"Invalid character in tag name"),f.state=g.ATTRIB));continue;case g.OPEN_TAG_SLASH:O===">"?(Nt(f,!0),Sr(f)):(Z(f,"Forward-slash in opening tag not followed by >"),f.state=g.ATTRIB);continue;case g.ATTRIB:if(C(O))continue;O===">"?Nt(f):O==="/"?f.state=g.OPEN_TAG_SLASH:T(w,O)?(f.attribName=O,f.attribValue="",f.state=g.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case g.ATTRIB_NAME:O==="="?f.state=g.ATTRIB_VALUE:O===">"?(Z(f,"Attribute without value"),f.attribValue=f.attribName,Cr(f),Nt(f)):C(O)?f.state=g.ATTRIB_NAME_SAW_WHITE:T(D,O)?f.attribName+=O:Z(f,"Invalid attribute name");continue;case g.ATTRIB_NAME_SAW_WHITE:if(O==="=")f.state=g.ATTRIB_VALUE;else{if(C(O))continue;Z(f,"Attribute without value"),f.tag.attributes[f.attribName]="",f.attribValue="",F(f,"onattribute",{name:f.attribName,value:""}),f.attribName="",O===">"?Nt(f):T(w,O)?(f.attribName=O,f.state=g.ATTRIB_NAME):(Z(f,"Invalid attribute name"),f.state=g.ATTRIB)}continue;case g.ATTRIB_VALUE:if(C(O))continue;R(O)?(f.q=O,f.state=g.ATTRIB_VALUE_QUOTED):(Z(f,"Unquoted attribute value"),f.state=g.ATTRIB_VALUE_UNQUOTED,f.attribValue=O);continue;case g.ATTRIB_VALUE_QUOTED:if(O!==f.q){O==="&"?f.state=g.ATTRIB_VALUE_ENTITY_Q:f.attribValue+=O;continue}Cr(f),f.q="",f.state=g.ATTRIB_VALUE_CLOSED;continue;case g.ATTRIB_VALUE_CLOSED:C(O)?f.state=g.ATTRIB:O===">"?Nt(f):O==="/"?f.state=g.OPEN_TAG_SLASH:T(w,O)?(Z(f,"No whitespace between attributes"),f.attribName=O,f.attribValue="",f.state=g.ATTRIB_NAME):Z(f,"Invalid attribute name");continue;case g.ATTRIB_VALUE_UNQUOTED:if(!_(O)){O==="&"?f.state=g.ATTRIB_VALUE_ENTITY_U:f.attribValue+=O;continue}Cr(f),O===">"?Nt(f):f.state=g.ATTRIB;continue;case g.CLOSE_TAG:if(f.tagName)O===">"?Sr(f):T(D,O)?f.tagName+=O:f.script?(f.script+="</"+f.tagName,f.tagName="",f.state=g.SCRIPT):(C(O)||Z(f,"Invalid tagname in closing tag"),f.state=g.CLOSE_TAG_SAW_WHITE);else{if(C(O))continue;A(w,O)?f.script?(f.script+="</"+O,f.state=g.SCRIPT):Z(f,"Invalid tagname in closing tag."):f.tagName=O}continue;case g.CLOSE_TAG_SAW_WHITE:if(C(O))continue;O===">"?Sr(f):Z(f,"Invalid characters in closing tag");continue;case g.TEXT_ENTITY:case g.ATTRIB_VALUE_ENTITY_Q:case g.ATTRIB_VALUE_ENTITY_U:var Te,Je;switch(f.state){case g.TEXT_ENTITY:Te=g.TEXT,Je="textNode";break;case g.ATTRIB_VALUE_ENTITY_Q:Te=g.ATTRIB_VALUE_QUOTED,Je="attribValue";break;case g.ATTRIB_VALUE_ENTITY_U:Te=g.ATTRIB_VALUE_UNQUOTED,Je="attribValue";break}O===";"?(f[Je]+=wi(f),f.entity="",f.state=Te):T(f.entity.length?p:x,O)?f.entity+=O:(Z(f,"Invalid character in entity name"),f[Je]+="&"+f.entity+O,f.entity="",f.state=Te);continue;default:throw new Error(f,"Unknown state: "+f.state)}return f.position>=f.bufferCheckPosition&&i(f),f}o(Kr,"write");String.fromCodePoint||function(){var m=String.fromCharCode,f=Math.floor,k=o(function(){var O=16384,ee=[],we,Te,Je=-1,wt=arguments.length;if(!wt)return"";for(var Tr="";++Je<wt;){var Re=Number(arguments[Je]);if(!isFinite(Re)||Re<0||Re>1114111||f(Re)!==Re)throw RangeError("Invalid code point: "+Re);Re<=65535?ee.push(Re):(Re-=65536,we=(Re>>10)+55296,Te=Re%1024+56320,ee.push(we,Te)),(Je+1===wt||ee.length>O)&&(Tr+=m.apply(null,ee),ee.length=0)}return Tr},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k}()})(typeof xs>"u"?xs.sax={}:xs)});var Zd=P(Ha=>{(function(){"use strict";Ha.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call(Ha)});var ja=P(vi=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),vi.normalize=function(e){return e.toLowerCase()},vi.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},vi.stripPrefix=function(e){return e.replace(t,"")},vi.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},vi.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(vi)});var eh=P(gi=>{(function(){"use strict";var t,e,r,i,n,s,a,u,l=o(function(v,S){return function(){return v.apply(S,arguments)}},"bind"),h=o(function(v,S){for(var I in S)y.call(S,I)&&(v[I]=S[I]);function E(){this.constructor=v}return o(E,"ctor"),E.prototype=S.prototype,v.prototype=new E,v.__super__=S.prototype,v},"extend"),y={}.hasOwnProperty;a=$d(),r=te("events"),t=Zd(),s=ja(),u=te("timers").setImmediate,e=ws().defaults,i=o(function(v){return typeof v=="object"&&v!=null&&Object.keys(v).length===0},"isEmpty"),n=o(function(v,S,I){var E,w,D;for(E=0,w=v.length;E<w;E++)D=v[E],S=D(S,I);return S},"processItem"),gi.Parser=function(v){h(S,v);function S(I){this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this);var E,w,D;if(!(this instanceof gi.Parser))return new gi.Parser(I);this.options={},w=e["0.2"];for(E in w)y.call(w,E)&&(D=w[E],this.options[E]=D);for(E in I)y.call(I,E)&&(D=I[E],this.options[E]=D);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return o(S,"Parser"),S.prototype.processAsync=function(){var I,E;try{return this.remaining.length<=this.options.chunkSize?(I=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(I),this.saxParser.close()):(I=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(I),u(this.processAsync))}catch(w){if(E=w,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(E)}},S.prototype.assignOrPush=function(I,E,w){return E in I?(I[E]instanceof Array||(I[E]=[I[E]]),I[E].push(w)):this.options.explicitArray?I[E]=[w]:I[E]=w},S.prototype.reset=function(){var I,E,w,D;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(x){return function(p){if(x.saxParser.resume(),!x.saxParser.errThrown)return x.saxParser.errThrown=!0,x.emit("error",p)}}(this),this.saxParser.onend=function(x){return function(){if(!x.saxParser.ended)return x.saxParser.ended=!0,x.emit("end",x.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,D=[],I=this.options.attrkey,E=this.options.charkey,this.saxParser.onopentag=function(x){return function(p){var C,R,_,T,A;if(_={},_[E]="",!x.options.ignoreAttrs){A=p.attributes;for(C in A)y.call(A,C)&&(!(I in _)&&!x.options.mergeAttrs&&(_[I]={}),R=x.options.attrValueProcessors?n(x.options.attrValueProcessors,p.attributes[C],C):p.attributes[C],T=x.options.attrNameProcessors?n(x.options.attrNameProcessors,C):C,x.options.mergeAttrs?x.assignOrPush(_,T,R):_[I][T]=R)}return _["#name"]=x.options.tagNameProcessors?n(x.options.tagNameProcessors,p.name):p.name,x.options.xmlns&&(_[x.options.xmlnskey]={uri:p.uri,local:p.local}),D.push(_)}}(this),this.saxParser.onclosetag=function(x){return function(){var p,C,R,_,T,A,g,K,X,F;if(A=D.pop(),T=A["#name"],(!x.options.explicitChildren||!x.options.preserveChildrenOrder)&&delete A["#name"],A.cdata===!0&&(p=A.cdata,delete A.cdata),X=D[D.length-1],A[E].match(/^\s*$/)&&!p?(C=A[E],delete A[E]):(x.options.trim&&(A[E]=A[E].trim()),x.options.normalize&&(A[E]=A[E].replace(/\s{2,}/g," ").trim()),A[E]=x.options.valueProcessors?n(x.options.valueProcessors,A[E],T):A[E],Object.keys(A).length===1&&E in A&&!x.EXPLICIT_CHARKEY&&(A=A[E])),i(A)&&(A=x.options.emptyTag!==""?x.options.emptyTag:C),x.options.validator!=null&&(F="/"+function(){var oe,We,Me;for(Me=[],oe=0,We=D.length;oe<We;oe++)_=D[oe],Me.push(_["#name"]);return Me}().concat(T).join("/"),function(){var oe;try{return A=x.options.validator(F,X&&X[T],A)}catch(We){return oe=We,x.emit("error",oe)}}()),x.options.explicitChildren&&!x.options.mergeAttrs&&typeof A=="object"){if(!x.options.preserveChildrenOrder)_={},x.options.attrkey in A&&(_[x.options.attrkey]=A[x.options.attrkey],delete A[x.options.attrkey]),!x.options.charsAsChildren&&x.options.charkey in A&&(_[x.options.charkey]=A[x.options.charkey],delete A[x.options.charkey]),Object.getOwnPropertyNames(A).length>0&&(_[x.options.childkey]=A),A=_;else if(X){X[x.options.childkey]=X[x.options.childkey]||[],g={};for(R in A)y.call(A,R)&&(g[R]=A[R]);X[x.options.childkey].push(g),delete A["#name"],Object.keys(A).length===1&&E in A&&!x.EXPLICIT_CHARKEY&&(A=A[E])}}return D.length>0?x.assignOrPush(X,T,A):(x.options.explicitRoot&&(K=A,A={},A[T]=K),x.resultObject=A,x.saxParser.ended=!0,x.emit("end",x.resultObject))}}(this),w=function(x){return function(p){var C,R;if(R=D[D.length-1],R)return R[E]+=p,x.options.explicitChildren&&x.options.preserveChildrenOrder&&x.options.charsAsChildren&&(x.options.includeWhiteChars||p.replace(/\\n/g,"").trim()!=="")&&(R[x.options.childkey]=R[x.options.childkey]||[],C={"#name":"__text__"},C[E]=p,x.options.normalize&&(C[E]=C[E].replace(/\s{2,}/g," ").trim()),R[x.options.childkey].push(C)),R}}(this),this.saxParser.ontext=w,this.saxParser.oncdata=function(x){return function(p){var C;if(C=w(p),C)return C.cdata=!0}}(this)},S.prototype.parseString=function(I,E){var w;E!=null&&typeof E=="function"&&(this.on("end",function(D){return this.reset(),E(null,D)}),this.on("error",function(D){return this.reset(),E(D)}));try{return I=I.toString(),I.trim()===""?(this.emit("end",null),!0):(I=t.stripBOM(I),this.options.async?(this.remaining=I,u(this.processAsync),this.saxParser):this.saxParser.write(I).close())}catch(D){if(w=D,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw w}else return this.emit("error",w),this.saxParser.errThrown=!0}},S}(r.EventEmitter),gi.parseString=function(v,S,I){var E,w,D;return I!=null?(typeof I=="function"&&(E=I),typeof S=="object"&&(w=S)):(typeof S=="function"&&(E=S),w={}),D=new gi.Parser(w),D.parseString(v,E)}}).call(gi)});var th=P(zr=>{(function(){"use strict";var t,e,r,i,n=o(function(a,u){for(var l in u)s.call(u,l)&&(a[l]=u[l]);function h(){this.constructor=a}return o(h,"ctor"),h.prototype=u.prototype,a.prototype=new h,a.__super__=u.prototype,a},"extend"),s={}.hasOwnProperty;e=ws(),t=Qd(),r=eh(),i=ja(),zr.defaults=e.defaults,zr.processors=i,zr.ValidationError=function(a){n(u,a);function u(l){this.message=l}return o(u,"ValidationError"),u}(Error),zr.Builder=t.Builder,zr.Parser=r.Parser,zr.parseString=r.parseString}).call(zr)});var ah=P((DM,sh)=>{var rh=V(),lo=rh.util,qg=rh.Model.Shape,kg=th(),Lg={explicitCharkey:!1,trim:!1,normalize:!1,explicitRoot:!1,emptyTag:null,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,validator:null};function ih(){}o(ih,"NodeXmlParser");ih.prototype.parse=function(t,e){e=e||{};var r=null,i=null,n=new kg.Parser(Lg);if(n.parseString(t,function(a,u){i=a,r=u}),r){var s=wr(r,e);return r.ResponseMetadata&&(s.ResponseMetadata=wr(r.ResponseMetadata[0],{})),s}else{if(i)throw lo.error(i,{code:"XMLParserError",retryable:!0});return wr({},e)}};function wr(t,e){switch(e.type){case"structure":return Mg(t,e);case"map":return Fg(t,e);case"list":return nh(t,e);case void 0:case null:return Wg(t);default:return oh(t,e)}}o(wr,"parseXml");function Mg(t,e){var r={};return t===null||lo.each(e.members,function(i,n){var s=n.name;if(Object.prototype.hasOwnProperty.call(t,s)&&Array.isArray(t[s])){var a=t[s];n.flattened||(a=a[0]),r[i]=wr(a,n)}else n.isXmlAttribute&&t.$&&Object.prototype.hasOwnProperty.call(t.$,s)?r[i]=oh(t.$[s],n):n.type==="list"&&!e.api.xmlNoDefaultLists&&(r[i]=n.defaultValue)}),r}o(Mg,"parseStructure");function Fg(t,e){var r={};if(t===null)return r;var i=e.key.name||"key",n=e.value.name||"value",s=e.flattened?t:t.entry;return Array.isArray(s)&&lo.arrayEach(s,function(a){r[a[i][0]]=wr(a[n][0],e.value)}),r}o(Fg,"parseMap");function nh(t,e){var r=[],i=e.member.name||"member";return e.flattened?lo.arrayEach(t,function(n){r.push(wr(n,e.member))}):t&&Array.isArray(t[i])&&lo.arrayEach(t[i],function(n){r.push(wr(n,e.member))}),r}o(nh,"parseList");function oh(t,e){return t&&t.$&&t.$.encoding==="base64"&&(e=new qg.create({type:t.$.encoding})),t&&t._&&(t=t._),typeof e.toType=="function"?e.toType(t):t}o(oh,"parseScalar");function Wg(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t)){var e=[];for(i=0;i<t.length;i++)e.push(wr(t[i],{}));return e}var r=Object.keys(t),i;if(r.length===0||r.length===1&&r[0]==="$")return{};var n={};for(i=0;i<r.length;i++){var s=r[i],a=t[s];s!=="$"&&(a.length>1?n[s]=nh(a,{member:{}}):n[s]=wr(a[0],{}))}return n}o(Wg,"parseUnknown");sh.exports=ih});var ch=P(()=>{var Ce=V(),Bg=Ce.util.stream.Stream,uh=Ce.util.stream.Transform,Ug=Ce.util.stream.Readable;Jo();var Vg="AWS_NODEJS_CONNECTION_REUSE_ENABLED";Ce.NodeHttpClient=Ce.util.inherit({handleRequest:o(function(e,r,i,n){var s=this,a=e.endpoint,u="";r||(r={}),r.proxy&&(u=a.protocol+"//"+a.hostname,a.port!==80&&a.port!==443&&(u+=":"+a.port),a=new Ce.Endpoint(r.proxy));var l=a.protocol==="https:",h=l?te("https"):te("http"),y={host:a.hostname,port:a.port,method:e.method,headers:e.headers,path:u+e.path};r.agent||(y.agent=this.getAgent(l,{keepAlive:process.env[Vg]==="1"})),Ce.util.update(y,r),delete y.proxy,delete y.timeout;var v=h.request(y,function(E){v.didCallback||(i(E),E.emit("headers",E.statusCode,E.headers,E.statusMessage))});if(e.stream=v,v.didCallback=!1,r.connectTimeout){var S;v.on("socket",function(E){E.connecting&&(S=setTimeout(o(function(){v.didCallback||(v.didCallback=!0,v.abort(),n(Ce.util.error(new Error("Socket timed out without establishing a connection"),{code:"TimeoutError"})))},"connectTimeout"),r.connectTimeout),E.on("connect",function(){clearTimeout(S),S=null}))})}v.setTimeout(r.timeout||0,function(){if(!v.didCallback){v.didCallback=!0;var E="Connection timed out after "+r.timeout+"ms";n(Ce.util.error(new Error(E),{code:"TimeoutError"})),v.abort()}}),v.on("error",function(E){S&&(clearTimeout(S),S=null),!v.didCallback&&(v.didCallback=!0,E.code==="ECONNRESET"||E.code==="EPIPE"||E.code==="ETIMEDOUT"?n(Ce.util.error(E,{code:"TimeoutError"})):n(E))});var I=e.headers.Expect||e.headers.expect;return I==="100-continue"?v.once("continue",function(){s.writeBody(v,e)}):this.writeBody(v,e),v},"handleRequest"),writeBody:o(function(e,r){var i=r.body,n=parseInt(r.headers["Content-Length"],10);if(i instanceof Bg){var s=this.progressStream(e,n);s?i.pipe(s).pipe(e):i.pipe(e)}else i?(e.once("finish",function(){e.emit("sendProgress",{loaded:n,total:n})}),e.end(i)):e.end()},"writeBody"),getAgent:o(function(e,r){var i=e?te("https"):te("http");return e?(Ce.NodeHttpClient.sslAgent||(Ce.NodeHttpClient.sslAgent=new i.Agent(Ce.util.merge({rejectUnauthorized:process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"},r||{})),Ce.NodeHttpClient.sslAgent.setMaxListeners(0),Object.defineProperty(Ce.NodeHttpClient.sslAgent,"maxSockets",{enumerable:!0,get:function(){var n=50,s=i.globalAgent;return s&&s.maxSockets!==1/0&&typeof s.maxSockets=="number"?s.maxSockets:n}})),Ce.NodeHttpClient.sslAgent):(Ce.NodeHttpClient.agent||(Ce.NodeHttpClient.agent=new i.Agent(r)),Ce.NodeHttpClient.agent)},"getAgent"),progressStream:o(function(e,r){if(!(typeof uh>"u")){var i=0,n=new uh;return n._transform=function(s,a,u){s&&(i+=s.length,e.emit("sendProgress",{loaded:i,total:r})),u(null,s)},n}},"progressStream"),emitter:null});Ce.HttpClient.prototype=Ce.NodeHttpClient.prototype;Ce.HttpClient.streamsApiVersion=Ug?2:1});var lh=P(()=>{var St=V(),zg=te("fs"),Hg=Vr(),jg=St.util.iniLoader;St.TokenFileWebIdentityCredentials=St.util.inherit(St.Credentials,{constructor:o(function(e){St.Credentials.call(this),this.data=null,this.clientConfig=St.util.copy(e||{})},"TokenFileWebIdentityCredentials"),getParamsFromEnv:o(function(){var e="AWS_WEB_IDENTITY_TOKEN_FILE",r="AWS_ROLE_ARN";if(process.env[e]&&process.env[r])return[{envTokenFile:process.env[e],roleArn:process.env[r],roleSessionName:process.env.AWS_ROLE_SESSION_NAME}]},"getParamsFromEnv"),getParamsFromSharedConfig:o(function(){var e=St.util.getProfilesFromSharedConfig(jg),r=process.env.AWS_PROFILE||St.util.defaultProfile,i=e[r]||{};if(Object.keys(i).length===0)throw St.util.error(new Error("Profile "+r+" not found"),{code:"TokenFileWebIdentityCredentialsProviderFailure"});for(var n=[];!i.web_identity_token_file&&i.source_profile;){n.unshift({roleArn:i.role_arn,roleSessionName:i.role_session_name});var s=i.source_profile;i=e[s]}return n.unshift({envTokenFile:i.web_identity_token_file,roleArn:i.role_arn,roleSessionName:i.role_session_name}),n},"getParamsFromSharedConfig"),refresh:o(function(e){this.coalesceRefresh(e||St.util.fn.callback)},"refresh"),assumeRoleChaining:o(function(e,r){var i=this;if(e.length===0)i.service.credentialsFrom(i.data,i),r();else{var n=e.shift();i.service.config.credentials=i.service.credentialsFrom(i.data,i),i.service.assumeRole({RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(s,a){i.data=null,s?r(s):(i.data=a,i.assumeRoleChaining(e,r))})}},"assumeRoleChaining"),load:o(function(e){var r=this;try{var i=r.getParamsFromEnv();if(i||(i=r.getParamsFromSharedConfig()),i){var n=i.shift(),s=zg.readFileSync(n.envTokenFile,{encoding:"ascii"});r.service||r.createClients(),r.service.assumeRoleWithWebIdentity({WebIdentityToken:s,RoleArn:n.roleArn,RoleSessionName:n.roleSessionName||"token-file-web-identity"},function(a,u){r.data=null,a?e(a):(r.data=u,r.assumeRoleChaining(i,e))})}}catch(a){e(a)}},"load"),createClients:function(){if(!this.service){var t=St.util.merge({},this.clientConfig);this.service=new Hg(t),this.service.retryableError=function(e){return e.code==="IDPCommunicationErrorException"||e.code==="InvalidIdentityToken"?!0:St.Service.prototype.retryableError.call(this,e)}}}})});var dh=P((WM,fh)=>{var Kg=o(function(){return{IPv4:"http://169.254.169.254",IPv6:"http://[fd00:ec2::254]"}},"getEndpoint");fh.exports=Kg});var Ka=P((UM,hh)=>{var Xg=o(function(){return{IPv4:"IPv4",IPv6:"IPv6"}},"getEndpointMode");hh.exports=Xg});var mh=P((zM,ph)=>{var Gg="AWS_EC2_METADATA_SERVICE_ENDPOINT",Jg="ec2_metadata_service_endpoint",Yg=o(function(){return{environmentVariableSelector:function(t){return t[Gg]},configFileSelector:function(t){return t[Jg]},default:void 0}},"getEndpointConfigOptions");ph.exports=Yg});var vh=P((jM,yh)=>{var Qg=Ka()(),$g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Zg="ec2_metadata_service_endpoint_mode",eN=o(function(){return{environmentVariableSelector:function(t){return t[$g]},configFileSelector:function(t){return t[Zg]},default:Qg.IPv4}},"getEndpointModeConfigOptions");yh.exports=eN});var xh=P((XM,Eh)=>{var gh=V(),Nh=dh()(),wh=Ka()(),tN=mh()(),rN=vh()(),iN=o(function(){var t=gh.util.loadConfig(tN);if(t!==void 0)return t;var e=gh.util.loadConfig(rN);switch(e){case wh.IPv4:return Nh.IPv4;case wh.IPv6:return Nh.IPv6;default:throw new Error("Unsupported endpoint mode: "+e)}},"getMetadataServiceEndpoint");Eh.exports=iN});var Th=P((JM,Sh)=>{var Wt=V();Jo();var nN=Wt.util.inherit,oN=xh(),Ch=te("url").URL;Wt.MetadataService=nN({endpoint:oN(),httpOptions:{timeout:0},disableFetchToken:!1,constructor:o(function(e){e&&e.host&&(e.endpoint="http://"+e.host,delete e.host),Wt.util.update(this,e)},"MetadataService"),request:o(function(e,r,i){if(arguments.length===2&&(i=r,r={}),process.env[Wt.util.imdsDisabledEnv]){i(new Error("EC2 Instance Metadata Service access disabled"));return}e=e||"/",Ch&&new Ch(this.endpoint);var n=new Wt.HttpRequest(this.endpoint+e);n.method=r.method||"GET",r.headers&&(n.headers=r.headers),Wt.util.handleRequestWithRetries(n,this,i)},"request"),loadCredentialsCallbacks:[],fetchMetadataToken:o(function(e){var r=this,i="/latest/api/token";r.request(i,{method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}},e)},"fetchMetadataToken"),fetchCredentials:o(function(e,r){var i=this,n="/latest/meta-data/iam/security-credentials/";i.request(n,e,function(s,a){if(s){i.disableFetchToken=s.statusCode!==401,r(Wt.util.error(s,{message:"EC2 Metadata roleName request returned error"}));return}a=a.split(`
26
+ `)[0],i.request(n+a,e,function(u,l){if(u){i.disableFetchToken=u.statusCode!==401,r(Wt.util.error(u,{message:"EC2 Metadata creds request returned error"}));return}try{var h=JSON.parse(l);r(null,h)}catch(y){r(y)}})})},"fetchCredentials"),loadCredentials:o(function(e){var r=this;if(r.loadCredentialsCallbacks.push(e),r.loadCredentialsCallbacks.length>1)return;function i(n,s){for(var a;(a=r.loadCredentialsCallbacks.shift())!==void 0;)a(n,s)}o(i,"callbacks"),r.disableFetchToken?r.fetchCredentials({},i):r.fetchMetadataToken(function(n,s){if(n){if(n.code==="TimeoutError")r.disableFetchToken=!0;else if(n.retryable===!0){i(Wt.util.error(n,{message:"EC2 Metadata token request returned error"}));return}else if(n.statusCode===400){i(Wt.util.error(n,{message:"EC2 Metadata token request returned 400"}));return}}var a={};s&&(a.headers={"x-aws-ec2-metadata-token":s}),r.fetchCredentials(a,i)})},"loadCredentials")});Sh.exports=Wt.MetadataService});var bh=P(()=>{var gt=V();Th();gt.EC2MetadataCredentials=gt.util.inherit(gt.Credentials,{constructor:o(function(e){gt.Credentials.call(this),e=e?gt.util.copy(e):{},e=gt.util.merge({maxRetries:this.defaultMaxRetries},e),e.httpOptions||(e.httpOptions={}),e.httpOptions=gt.util.merge({timeout:this.defaultTimeout,connectTimeout:this.defaultConnectTimeout},e.httpOptions),this.metadataService=new gt.MetadataService(e),this.logger=e.logger||gt.config&&gt.config.logger},"EC2MetadataCredentials"),defaultTimeout:1e3,defaultConnectTimeout:1e3,defaultMaxRetries:3,originalExpiration:void 0,refresh:o(function(e){this.coalesceRefresh(e||gt.util.fn.callback)},"refresh"),load:o(function(e){var r=this;r.metadataService.loadCredentials(function(i,n){i?r.hasLoadedCredentials()?(r.extendExpirationIfExpired(),e()):e(i):(r.setCredentials(n),r.extendExpirationIfExpired(),e())})},"load"),hasLoadedCredentials:o(function(){return this.AccessKeyId&&this.secretAccessKey},"hasLoadedCredentials"),extendExpirationIfExpired:o(function(){if(this.needsRefresh()){this.originalExpiration=this.originalExpiration||this.expireTime,this.expired=!1;var e=15*60+Math.floor(Math.random()*5*60),r=gt.util.date.getDate().getTime();this.expireTime=new Date(r+e*1e3),this.logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again at "+this.expireTime+`
27
+ For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`)}},"extendExpirationIfExpired"),setCredentials:o(function(e){var r=gt.util.date.getDate().getTime(),i=new Date(e.Expiration);this.expired=r>=i,this.metadata=e,this.accessKeyId=e.AccessKeyId,this.secretAccessKey=e.SecretAccessKey,this.sessionToken=e.Token,this.expireTime=i},"setCredentials")})});var Oh=P(()=>{var Xe=V(),Xa="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Cs="AWS_CONTAINER_CREDENTIALS_FULL_URI",sN="AWS_CONTAINER_AUTHORIZATION_TOKEN",aN=["https:"],Ah=["http:","https:"],Ih=["localhost","127.0.0.1"],uN="169.254.170.2";Xe.RemoteCredentials=Xe.util.inherit(Xe.Credentials,{constructor:o(function(e){Xe.Credentials.call(this),e=e?Xe.util.copy(e):{},e.httpOptions||(e.httpOptions={}),e.httpOptions=Xe.util.merge(this.httpOptions,e.httpOptions),Xe.util.update(this,e)},"RemoteCredentials"),httpOptions:{timeout:1e3},maxRetries:3,isConfiguredForEcsCredentials:o(function(){return Boolean(process&&process.env&&(process.env[Xa]||process.env[Cs]))},"isConfiguredForEcsCredentials"),getECSFullUri:o(function(){if(process&&process.env){var e=process.env[Xa],r=process.env[Cs];if(e)return"http://"+uN+e;if(r){var i=Xe.util.urlParse(r);if(Ah.indexOf(i.protocol)<0)throw Xe.util.error(new Error("Unsupported protocol: AWS.RemoteCredentials supports "+Ah.join(",")+" only; "+i.protocol+" requested."),{code:"ECSCredentialsProviderFailure"});if(aN.indexOf(i.protocol)<0&&Ih.indexOf(i.hostname)<0)throw Xe.util.error(new Error("Unsupported hostname: AWS.RemoteCredentials only supports "+Ih.join(",")+" for "+i.protocol+"; "+i.protocol+"//"+i.hostname+" requested."),{code:"ECSCredentialsProviderFailure"});return r}else throw Xe.util.error(new Error("Variable "+Xa+" or "+Cs+" must be set to use AWS.RemoteCredentials."),{code:"ECSCredentialsProviderFailure"})}else throw Xe.util.error(new Error("No process info available"),{code:"ECSCredentialsProviderFailure"})},"getECSFullUri"),getECSAuthToken:o(function(){if(process&&process.env&&process.env[Cs])return process.env[sN]},"getECSAuthToken"),credsFormatIsValid:o(function(e){return!!e.accessKeyId&&!!e.secretAccessKey&&!!e.sessionToken&&!!e.expireTime},"credsFormatIsValid"),formatCreds:o(function(e){return e.credentials&&(e=e.credentials),{expired:!1,accessKeyId:e.accessKeyId||e.AccessKeyId,secretAccessKey:e.secretAccessKey||e.SecretAccessKey,sessionToken:e.sessionToken||e.Token,expireTime:new Date(e.expiration||e.Expiration)}},"formatCreds"),request:o(function(e,r){var i=new Xe.HttpRequest(e);i.method="GET",i.headers.Accept="application/json";var n=this.getECSAuthToken();n&&(i.headers.Authorization=n),Xe.util.handleRequestWithRetries(i,this,r)},"request"),refresh:o(function(e){this.coalesceRefresh(e||Xe.util.fn.callback)},"refresh"),load:o(function(e){var r=this,i;try{i=this.getECSFullUri()}catch(n){e(n);return}this.request(i,function(n,s){if(!n)try{s=JSON.parse(s);var a=r.formatCreds(s);if(!r.credsFormatIsValid(a))throw Xe.util.error(new Error("Response data is not in valid format"),{code:"ECSCredentialsProviderFailure"});Xe.util.update(r,a)}catch(u){n=u}e(n,a)})},"load")})});var Dh=P(()=>{var Rh=V();Rh.ECSCredentials=Rh.RemoteCredentials});var Ph=P(()=>{var Hr=V();Hr.EnvironmentCredentials=Hr.util.inherit(Hr.Credentials,{constructor:o(function(e){Hr.Credentials.call(this),this.envPrefix=e,this.get(function(){})},"EnvironmentCredentials"),refresh:o(function(e){if(e||(e=Hr.util.fn.callback),!process||!process.env){e(Hr.util.error(new Error("No process info or environment variables available"),{code:"EnvironmentCredentialsProviderFailure"}));return}for(var r=["ACCESS_KEY_ID","SECRET_ACCESS_KEY","SESSION_TOKEN"],i=[],n=0;n<r.length;n++){var s="";if(this.envPrefix&&(s=this.envPrefix+"_"),i[n]=process.env[s+r[n]],!i[n]&&r[n]!=="SESSION_TOKEN"){e(Hr.util.error(new Error("Variable "+s+r[n]+" not set."),{code:"EnvironmentCredentialsProviderFailure"}));return}}this.expired=!1,Hr.Credentials.apply(this,i),e()},"refresh")})});var _h=P(()=>{var jr=V();jr.FileSystemCredentials=jr.util.inherit(jr.Credentials,{constructor:o(function(e){jr.Credentials.call(this),this.filename=e,this.get(function(){})},"FileSystemCredentials"),refresh:o(function(e){e||(e=jr.util.fn.callback);try{var r=JSON.parse(jr.util.readFileSync(this.filename));if(jr.Credentials.call(this,r),!this.accessKeyId||!this.secretAccessKey)throw jr.util.error(new Error("Credentials not set in "+this.filename),{code:"FileSystemCredentialsProviderFailure"});this.expired=!1,e()}catch(i){e(i)}},"refresh")})});var kh=P(()=>{var Ge=V(),cN=Vr(),qh=Ge.util.iniLoader,lN="us-east-1";Ge.SharedIniFileCredentials=Ge.util.inherit(Ge.Credentials,{constructor:o(function(e){Ge.Credentials.call(this),e=e||{},this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Ge.util.defaultProfile,this.disableAssumeRole=Boolean(e.disableAssumeRole),this.preferStaticCredentials=Boolean(e.preferStaticCredentials),this.tokenCodeFn=e.tokenCodeFn||null,this.httpOptions=e.httpOptions||null,this.get(e.callback||Ge.util.fn.noop)},"SharedIniFileCredentials"),load:o(function(e){var r=this;try{var i=Ge.util.getProfilesFromSharedConfig(qh,this.filename),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Ge.util.error(new Error("Profile "+this.profile+" not found"),{code:"SharedIniFileCredentialsProviderFailure"});var s=Boolean(this.preferStaticCredentials&&n.aws_access_key_id&&n.aws_secret_access_key);if(n.role_arn&&!s){this.loadRoleProfile(i,n,function(a,u){a?e(a):(r.expired=!1,r.accessKeyId=u.Credentials.AccessKeyId,r.secretAccessKey=u.Credentials.SecretAccessKey,r.sessionToken=u.Credentials.SessionToken,r.expireTime=u.Credentials.Expiration,e(null))});return}if(this.accessKeyId=n.aws_access_key_id,this.secretAccessKey=n.aws_secret_access_key,this.sessionToken=n.aws_session_token,!this.accessKeyId||!this.secretAccessKey)throw Ge.util.error(new Error("Credentials not set for profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});this.expired=!1,e(null)}catch(a){e(a)}},"load"),refresh:o(function(e){qh.clearCachedFiles(),this.coalesceRefresh(e||Ge.util.fn.callback,this.disableAssumeRole)},"refresh"),loadRoleProfile:o(function(e,r,i){if(this.disableAssumeRole)throw Ge.util.error(new Error("Role assumption profiles are disabled. Failed to load profile "+this.profile+" from "+e.filename),{code:"SharedIniFileCredentialsProviderFailure"});var n=this,s=r.role_arn,a=r.role_session_name,u=r.external_id,l=r.mfa_serial,h=r.source_profile,y=r.region||lN;if(!h)throw Ge.util.error(new Error("source_profile is not set using profile "+this.profile),{code:"SharedIniFileCredentialsProviderFailure"});var v=e[h];if(typeof v!="object")throw Ge.util.error(new Error("source_profile "+h+" using profile "+this.profile+" does not exist"),{code:"SharedIniFileCredentialsProviderFailure"});var S=new Ge.SharedIniFileCredentials(Ge.util.merge(this.options||{},{profile:h,preferStaticCredentials:!0}));this.roleArn=s;var I=new cN({credentials:S,region:y,httpOptions:this.httpOptions}),E={RoleArn:s,RoleSessionName:a||"aws-sdk-js-"+Date.now()};if(u&&(E.ExternalId=u),l&&n.tokenCodeFn){E.SerialNumber=l,n.tokenCodeFn(l,function(w,D){if(w){var x;w instanceof Error?x=w.message:x=w,i(Ge.util.error(new Error("Error fetching MFA token: "+x),{code:"SharedIniFileCredentialsProviderFailure"}));return}E.TokenCode=D,I.assumeRole(E,i)});return}I.assumeRole(E,i)},"loadRoleProfile")})});var Lh=P(()=>{var Fe=V(),fN=te("path"),dN=te("crypto"),Ga=Fe.util.iniLoader;Fe.SsoCredentials=Fe.util.inherit(Fe.Credentials,{constructor:o(function(e){Fe.Credentials.call(this),e=e||{},this.errorCode="SsoCredentialsProviderFailure",this.expired=!0,this.filename=e.filename,this.profile=e.profile||process.env.AWS_PROFILE||Fe.util.defaultProfile,this.service=e.ssoClient,this.httpOptions=e.httpOptions||null,this.get(e.callback||Fe.util.fn.noop)},"SsoCredentials"),load:o(function(e){var r=9e5,i=this;try{var n=Fe.util.getProfilesFromSharedConfig(Ga,this.filename),s=n[this.profile]||{};if(Object.keys(s).length===0)throw Fe.util.error(new Error("Profile "+this.profile+" not found"),{code:i.errorCode});if(!s.sso_start_url||!s.sso_account_id||!s.sso_region||!s.sso_role_name)throw Fe.util.error(new Error("Profile "+this.profile+' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),{code:i.errorCode});var a=dN.createHash("sha1"),u=a.update(s.sso_start_url).digest("hex")+".json",l=fN.join(Ga.getHomeDir(),".aws","sso","cache",u),h=Fe.util.readFileSync(l),y=null;if(h&&(y=JSON.parse(h)),!y)throw Fe.util.error(new Error("Cached credentials not found under "+this.profile+" profile. Please make sure you log in with aws sso login first"),{code:i.errorCode});if(!y.startUrl||!y.region||!y.accessToken||!y.expiresAt)throw Fe.util.error(new Error("Cached credentials are missing required properties. Try running aws sso login."));if(new Date(y.expiresAt).getTime()-Date.now()<=r)throw Fe.util.error(new Error("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile."));(!i.service||i.service.config.region!==s.sso_region)&&(i.service=new Fe.SSO({region:s.sso_region,httpOptions:this.httpOptions}));var v={accessToken:y.accessToken,accountId:s.sso_account_id,roleName:s.sso_role_name};i.service.getRoleCredentials(v,function(S,I){if(S||!I||!I.roleCredentials)e(Fe.util.error(S||new Error('Please log in using "aws sso login"'),{code:i.errorCode}),null);else{if(!I.roleCredentials.accessKeyId||!I.roleCredentials.secretAccessKey||!I.roleCredentials.sessionToken||!I.roleCredentials.expiration)throw Fe.util.error(new Error("SSO returns an invalid temporary credential."));i.expired=!1,i.accessKeyId=I.roleCredentials.accessKeyId,i.secretAccessKey=I.roleCredentials.secretAccessKey,i.sessionToken=I.roleCredentials.sessionToken,i.expireTime=new Date(I.roleCredentials.expiration),e(null)}})}catch(S){e(S)}},"load"),refresh:o(function(e){Ga.clearCachedFiles(),this.coalesceRefresh(e||Fe.util.fn.callback)},"refresh")})});var Mh=P(()=>{var Tt=V();Tt.Token=Tt.util.inherit({constructor:o(function(e){if(Tt.util.hideProperties(this,["token"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],arguments.length===1){var e=arguments[0];this.token=e.token,this.expireTime=e.expireTime}},"Token"),expiryWindow:15,needsRefresh:o(function(){var e=Tt.util.date.getDate().getTime(),r=new Date(e+this.expiryWindow*1e3);return this.expireTime&&r>this.expireTime?!0:this.expired||!this.token},"needsRefresh"),get:o(function(e){var r=this;this.needsRefresh()?this.refresh(function(i){i||(r.expired=!1),e&&e(i)}):e&&e()},"get"),refresh:o(function(e){this.expired=!1,e()},"refresh"),coalesceRefresh:o(function(e,r){var i=this;i.refreshCallbacks.push(e)===1&&i.load(o(function(s){Tt.util.arrayEach(i.refreshCallbacks,function(a){r?a(s):Tt.util.defer(function(){a(s)})}),i.refreshCallbacks.length=0},"onLoad"))},"coalesceRefresh"),load:o(function(e){e()},"load")});Tt.Token.addPromisesToClass=o(function(e){this.prototype.getPromise=Tt.util.promisifyMethod("get",e),this.prototype.refreshPromise=Tt.util.promisifyMethod("refresh",e)},"addPromisesToClass");Tt.Token.deletePromisesFromClass=o(function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},"deletePromisesFromClass");Tt.util.addPromises(Tt.Token)});var Fh=P(()=>{var Bt=V();Bt.TokenProviderChain=Bt.util.inherit(Bt.Token,{constructor:o(function(e){e?this.providers=e:this.providers=Bt.TokenProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},"TokenProviderChain"),resolve:o(function(e){var r=this;if(r.providers.length===0)return e(new Error("No providers")),r;if(r.resolveCallbacks.push(e)===1){let a=function(u,l){if(!u&&l||i===n.length){Bt.util.arrayEach(r.resolveCallbacks,function(y){y(u,l)}),r.resolveCallbacks.length=0;return}var h=n[i++];typeof h=="function"?l=h.call():l=h,l.get?l.get(function(y){a(y,y?null:l)}):a(null,l)};var s=a;o(a,"resolveNext");var i=0,n=r.providers.slice(0);a()}return r},"resolve")});Bt.TokenProviderChain.defaultProviders=[];Bt.TokenProviderChain.addPromisesToClass=o(function(e){this.prototype.resolvePromise=Bt.util.promisifyMethod("resolve",e)},"addPromisesToClass");Bt.TokenProviderChain.deletePromisesFromClass=o(function(){delete this.prototype.resolvePromise},"deletePromisesFromClass");Bt.util.addPromises(Bt.TokenProviderChain)});var Uh=P(()=>{var Le=V(),hN=te("crypto"),Wh=te("fs"),pN=te("path"),Ss=Le.util.iniLoader,Bh=0,Ni=o(function(e,r){if(!e[r])throw Le.util.error(new Error('Key "'+r+'" not present in SSO Token'),{code:"SSOTokenProviderFailure"})},"validateTokenKey"),Ja=o(function(e,r,i){if(r>e)i(null);else throw Le.util.error(new Error('SSO Token refresh failed. Please log in using "aws sso login"'),{code:"SSOTokenProviderFailure"})},"refreshUnsuccessful");Le.SSOTokenProvider=Le.util.inherit(Le.Token,{expiryWindow:5*60,constructor:o(function(e){Le.Token.call(this),e=e||{},this.expired=!0,this.profile=e.profile||process.env.AWS_PROFILE||Le.util.defaultProfile,this.get(e.callback||Le.util.fn.noop)},"SSOTokenProvider"),load:o(function(e){var r=this,i=Ss.loadFrom({isConfig:!0}),n=i[this.profile]||{};if(Object.keys(n).length===0)throw Le.util.error(new Error('Profile "'+this.profile+'" not found'),{code:"SSOTokenProviderFailure"});if(!n.sso_session)throw Le.util.error(new Error('Profile "'+profileName+'" is missing required property "sso_session".'),{code:"SSOTokenProviderFailure"});var s=n.sso_session,a=Ss.loadSsoSessionsFrom(),u=a[s];if(u)if(u.sso_start_url){if(!u.sso_region)throw Le.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_region".'),{code:"SSOTokenProviderFailure"})}else throw Le.util.error(new Error('Sso session "'+profileName+'" is missing required property "sso_start_url".'),{code:"SSOTokenProviderFailure"});else throw Le.util.error(new Error('Sso session "'+s+'" not found'),{code:"SSOTokenProviderFailure"});var l=hN.createHash("sha1"),h=l.update(s).digest("hex")+".json",y=pN.join(Ss.getHomeDir(),".aws","sso","cache",h),v=JSON.parse(Wh.readFileSync(y));if(!v)throw Le.util.error(new Error('Cached token not found. Please log in using "aws sso login" for profile "'+this.profile+'".'),{code:"SSOTokenProviderFailure"});Ni(v,"accessToken"),Ni(v,"expiresAt");var S=Le.util.date.getDate().getTime(),I=new Date(S+this.expiryWindow*1e3),E=new Date(v.expiresAt);if(E>I){r.token=v.accessToken,r.expireTime=E,r.expired=!1,e(null);return}if(S-Bh<30*1e3){Ja(S,E,e);return}Ni(v,"clientId"),Ni(v,"clientSecret"),Ni(v,"refreshToken"),(!r.service||r.service.config.region!==u.sso_region)&&(r.service=new Le.SSOOIDC({region:u.sso_region}));var w={clientId:v.clientId,clientSecret:v.clientSecret,refreshToken:v.refreshToken,grantType:"refresh_token"};Bh=Le.util.date.getDate().getTime(),r.service.createToken(w,function(D,x){if(D||!x)Ja(S,E,e);else try{Ni(x,"accessToken"),Ni(x,"expiresIn"),r.expired=!1,r.token=x.accessToken,r.expireTime=new Date(Date.now()+x.expiresIn*1e3),e(null);try{v.accessToken=x.accessToken,v.expiresAt=r.expireTime.toISOString(),v.refreshToken=x.refreshToken,Wh.writeFileSync(y,JSON.stringify(v,null,2))}catch{}}catch{Ja(S,E,e)}})},"load"),refresh:o(function(e){Ss.clearCachedFiles(),this.coalesceRefresh(e||Le.util.fn.callback)},"refresh")})});var gs=P((bF,Hh)=>{var Se=Oe(),zh=Na(),mN=zh.isFipsRegion,yN=zh.getRealRegion;Se.isBrowser=function(){return!1};Se.isNode=function(){return!0};Se.crypto.lib=te("crypto");Se.Buffer=te("buffer").Buffer;Se.domain=te("domain");Se.stream=te("stream");Se.url=te("url");Se.querystring=te("querystring");Se.environment="nodejs";Se.createEventStream=Se.stream.Readable?Sf().createEventStream:If().createEventStream;Se.realClock=Rf();Se.clientSideMonitoring={Publisher:Pf().Publisher,configProvider:kf()};Se.iniLoader=Bf().iniLoader;Se.getSystemErrorName=te("util").getSystemErrorName;Se.loadConfig=function(t){var e=t.environmentVariableSelector(process.env);if(e!==void 0)return e;var r={};try{r=Se.iniLoader?Se.iniLoader.loadFrom({isConfig:!0,filename:process.env[Se.sharedConfigFileEnv]}):{}}catch{}var i=r[process.env.AWS_PROFILE||Se.defaultProfile]||{},n=t.configFileSelector(i);return n!==void 0?n:typeof t.default=="function"?t.default():t.default};var fe;Hh.exports=fe=V();Ea();xa();Gf();Jf();Yf();rd();id();Fa();fe.XML.Parser=ah();ch();La();lh();bh();Oh();Dh();Ph();_h();kh();Fa();Lh();fe.CredentialProviderChain.defaultProviders=[function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SsoCredentials},function(){return new fe.SharedIniFileCredentials},function(){return new fe.ECSCredentials},function(){return new fe.ProcessCredentials},function(){return new fe.TokenFileWebIdentityCredentials},function(){return new fe.EC2MetadataCredentials}];Mh();Fh();Uh();fe.TokenProviderChain.defaultProviders=[function(){return new fe.SSOTokenProvider}];var Vh=o(function(){var t=process.env,e=t.AWS_REGION||t.AMAZON_REGION;if(t[fe.util.configOptInEnv])for(var r=[{filename:t[fe.util.sharedCredentialsFileEnv]},{isConfig:!0,filename:t[fe.util.sharedConfigFileEnv]}],i=fe.util.iniLoader;!e&&r.length;){var n={},s=r.shift();try{n=i.loadFrom(s)}catch(u){if(s.isConfig)throw u}var a=n[t.AWS_PROFILE||fe.util.defaultProfile];e=a&&a.region}return e},"getRegion"),Ts=o(function(t){return t==="true"?!0:t==="false"?!1:void 0},"getBooleanValue"),vN={environmentVariableSelector:function(t){return Ts(t.AWS_USE_FIPS_ENDPOINT)},configFileSelector:function(t){return Ts(t.use_fips_endpoint)},default:!1},gN={environmentVariableSelector:function(t){return Ts(t.AWS_USE_DUALSTACK_ENDPOINT)},configFileSelector:function(t){return Ts(t.use_dualstack_endpoint)},default:!1};fe.util.update(fe.Config.prototype.keys,{credentials:function(){var t=null;return new fe.CredentialProviderChain([function(){return new fe.EnvironmentCredentials("AWS")},function(){return new fe.EnvironmentCredentials("AMAZON")},function(){return new fe.SharedIniFileCredentials({disableAssumeRole:!0})}]).resolve(function(e,r){e||(t=r)}),t},credentialProvider:function(){return new fe.CredentialProviderChain},logger:function(){return process.env.AWSJS_DEBUG?console:null},region:function(){var t=Vh();return t?yN(t):void 0},tokenProvider:function(){return new fe.TokenProviderChain},useFipsEndpoint:function(){var t=Vh();return mN(t)?!0:Se.loadConfig(vN)},useDualstackEndpoint:function(){return Se.loadConfig(gN)}});fe.config=new fe.Config});var jh=P(()=>{var Ya=V();Ya.util.update(Ya.RDSDataService.prototype,{retryableError:o(function(e){if(e.code==="BadRequestException"&&e.message&&e.message.match(/^Communications link failure/)&&e.statusCode===400)return!0;var r=Ya.Service.prototype.retryableError;return r.call(this,e)},"retryableError")})});var Kh=P((DF,NN)=>{NN.exports={version:"2.0",metadata:{apiVersion:"2018-08-01",endpointPrefix:"rds-data",jsonVersion:"1.1",protocol:"rest-json",serviceFullName:"AWS RDS DataService",serviceId:"RDS Data",signatureVersion:"v4",signingName:"rds-data",uid:"rds-data-2018-08-01"},operations:{BatchExecuteStatement:{http:{requestUri:"/BatchExecute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameterSets:{type:"list",member:{shape:"S6"}},transactionId:{}}},output:{type:"structure",members:{updateResults:{type:"list",member:{type:"structure",members:{generatedFields:{shape:"Sq"}}}}}}},BeginTransaction:{http:{requestUri:"/BeginTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn"],members:{resourceArn:{},secretArn:{},database:{},schema:{}}},output:{type:"structure",members:{transactionId:{}}}},CommitTransaction:{http:{requestUri:"/CommitTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}},ExecuteSql:{http:{requestUri:"/ExecuteSql",responseCode:200},input:{type:"structure",required:["dbClusterOrInstanceArn","awsSecretStoreArn","sqlStatements"],members:{dbClusterOrInstanceArn:{},awsSecretStoreArn:{},sqlStatements:{},database:{},schema:{}}},output:{type:"structure",members:{sqlStatementResults:{type:"list",member:{type:"structure",members:{resultFrame:{type:"structure",members:{resultSetMetadata:{type:"structure",members:{columnCount:{type:"long"},columnMetadata:{shape:"S13"}}},records:{type:"list",member:{type:"structure",members:{values:{type:"list",member:{shape:"S1a"}}}}}}},numberOfRecordsUpdated:{type:"long"}}}}}},deprecated:!0,deprecatedMessage:"The ExecuteSql API is deprecated, please use the ExecuteStatement API."},ExecuteStatement:{http:{requestUri:"/Execute",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","sql"],members:{resourceArn:{},secretArn:{},sql:{},database:{},schema:{},parameters:{shape:"S6"},transactionId:{},includeResultMetadata:{type:"boolean"},continueAfterTimeout:{type:"boolean"},resultSetOptions:{type:"structure",members:{decimalReturnType:{},longReturnType:{}}},formatRecordsAs:{}}},output:{type:"structure",members:{records:{type:"list",member:{shape:"Sq"}},columnMetadata:{shape:"S13"},numberOfRecordsUpdated:{type:"long"},generatedFields:{shape:"Sq"},formattedRecords:{}}}},RollbackTransaction:{http:{requestUri:"/RollbackTransaction",responseCode:200},input:{type:"structure",required:["resourceArn","secretArn","transactionId"],members:{resourceArn:{},secretArn:{},transactionId:{}}},output:{type:"structure",members:{transactionStatus:{}}}}},shapes:{S6:{type:"list",member:{type:"structure",members:{name:{},value:{shape:"S9"},typeHint:{}}}},S9:{type:"structure",members:{isNull:{type:"boolean"},booleanValue:{type:"boolean"},longValue:{type:"long"},doubleValue:{type:"double"},stringValue:{},blobValue:{type:"blob"},arrayValue:{shape:"Sf"}},union:!0},Sf:{type:"structure",members:{booleanValues:{type:"list",member:{type:"boolean"}},longValues:{type:"list",member:{type:"long"}},doubleValues:{type:"list",member:{type:"double"}},stringValues:{type:"list",member:{}},arrayValues:{type:"list",member:{shape:"Sf"}}},union:!0},Sq:{type:"list",member:{shape:"S9"}},S13:{type:"list",member:{type:"structure",members:{name:{},type:{type:"integer"},typeName:{},label:{},schemaName:{},tableName:{},isAutoIncrement:{type:"boolean"},isSigned:{type:"boolean"},isCurrency:{type:"boolean"},isCaseSensitive:{type:"boolean"},nullable:{type:"integer"},precision:{type:"integer"},scale:{type:"integer"},arrayBaseColumnType:{type:"integer"}}}},S1a:{type:"structure",members:{isNull:{type:"boolean"},bitValue:{type:"boolean"},bigIntValue:{type:"long"},intValue:{type:"integer"},doubleValue:{type:"double"},realValue:{type:"float"},stringValue:{},blobValue:{type:"blob"},arrayValues:{shape:"S1d"},structValue:{type:"structure",members:{attributes:{shape:"S1d"}}}},union:!0},S1d:{type:"list",member:{shape:"S1a"}}}}});var Xh=P((PF,wN)=>{wN.exports={pagination:{}}});var Yh=P((_F,Jh)=>{gs();var bs=V(),EN=bs.Service,Gh=bs.apiLoader;Gh.services.rdsdataservice={};bs.RDSDataService=EN.defineService("rdsdataservice",["2018-08-01"]);jh();Object.defineProperty(Gh.services.rdsdataservice,"2018-08-01",{get:o(function(){var e=Kh();return e.paginators=Xh().pagination,e},"get"),enumerable:!0,configurable:!0});Jh.exports=bs.RDSDataService});import xN from"path";function nu(t){return t===void 0}o(nu,"isUndefined");function Ze(t){return typeof t=="string"}o(Ze,"isString");function ou(t){return typeof t=="number"}o(ou,"isNumber");function ho(t){return typeof t=="boolean"}o(ho,"isBoolean");function po(t){return t===null}o(po,"isNull");function su(t){return t instanceof Date}o(su,"isDate");function au(t){return typeof t=="bigint"}o(au,"isBigInt");function ft(t){return typeof t=="function"}o(ft,"isFunction");function dt(t){return typeof t=="object"&&t!==null}o(dt,"isObject");function uu(t){return t[t.length-1]}o(uu,"getLast");function c(t){return Object.freeze(t)}o(c,"freeze");function br(t){return Array.isArray(t)}o(br,"isReadonlyArray");function Ar(t){return t}o(Ar,"noop");var $=c({is(t){return t.kind==="IdentifierNode"},create(t){return c({kind:"IdentifierNode",name:t})}});var ot=c({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return c({kind:"SchemableIdentifierNode",identifier:$.create(t)})},createWithSchema(t,e){return c({kind:"SchemableIdentifierNode",schema:$.create(t),identifier:$.create(e)})}});var st=c({is(t){return t.kind==="TableNode"},create(t){return c({kind:"TableNode",table:ot.create(t)})},createWithSchema(t,e){return c({kind:"TableNode",table:ot.createWithSchema(t,e)})}});var he=c({is(t){return t.kind==="AlterTableNode"},create(t){return c({kind:"AlterTableNode",table:st.create(t)})},cloneWithTableProps(t,e){return c({...t,...e})},cloneWithColumnAlteration(t,e){return c({...t,columnAlterations:t.columnAlterations?[...t.columnAlterations,e]:[e]})}});var er=c({is(t){return t.kind==="CreateIndexNode"},create(t){return c({kind:"CreateIndexNode",name:$.create(t)})},cloneWith(t,e){return c({...t,...e})}});var mo=c({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return c({kind:"CreateSchemaNode",schema:$.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var cu=["preserve rows","delete rows","drop"],ht=c({is(t){return t.kind==="CreateTableNode"},create(t){return c({kind:"CreateTableNode",table:t,columns:c([])})},cloneWithColumn(t,e){return c({...t,columns:c([...t.columns,e])})},cloneWithConstraint(t,e){return c({...t,constraints:t.constraints?c([...t.constraints,e]):c([e])})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWith(t,e){return c({...t,...e})}});var Ei=c({is(t){return t.kind==="DropIndexNode"},create(t,e){return c({kind:"DropIndexNode",name:ot.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Ji=c({is(t){return t.kind==="DropSchemaNode"},create(t,e){return c({kind:"DropSchemaNode",schema:$.create(t),...e})},cloneWith(t,e){return c({...t,...e})}});var Yi=c({is(t){return t.kind==="DropTableNode"},create(t,e){return c({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return c({...t,...e})}});var Et=c({is(t){return t.kind==="AliasNode"},create(t,e){return c({kind:"AliasNode",node:t,alias:e})}});function Ye(t){return dt(t)&&ft(t.toOperationNode)}o(Ye,"isOperationNodeSource");function lu(t){return dt(t)&&"expressionType"in t&&Ye(t)}o(lu,"isExpression");var xi=c({is(t){return t.kind==="AndNode"},create(t,e){return c({kind:"AndNode",left:t,right:e})}});var Ci=c({is(t){return t.kind==="OrNode"},create(t,e){return c({kind:"OrNode",left:t,right:e})}});var Si=c({is(t){return t.kind==="OnNode"},create(t){return c({kind:"OnNode",on:t})},cloneWithOperation(t,e,r){return c({...t,on:e==="And"?xi.create(t.on,r):Ci.create(t.on,r)})}});var at=c({is(t){return t.kind==="JoinNode"},create(t,e){return c({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return c({kind:"JoinNode",joinType:t,table:e,on:Si.create(r)})},cloneWithOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"And",e):Si.create(e)})},cloneWithOrOn(t,e){return c({...t,on:t.on?Si.cloneWithOperation(t.on,"Or",e):Si.create(e)})}});var tr=c({is(t){return t.kind==="OrderByNode"},create(t){return c({kind:"OrderByNode",items:c([t])})},cloneWithItem(t,e){return c({...t,items:c([...t.items,e])})}});var ks=c({is(t){return t.kind==="PartitionByNode"},create(t){return c({kind:"PartitionByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var Qi=c({is(t){return t.kind==="OverNode"},create(){return c({kind:"OverNode"})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithPartitionByItems(t,e){return c({...t,partitionBy:t.partitionBy?ks.cloneWithItems(t.partitionBy,e):ks.create(e)})}});var Gr=c({is(t){return t.kind==="FromNode"},create(t){return c({kind:"FromNode",froms:c(t)})},cloneWithFroms(t,e){return c({...t,froms:c([...t.froms,...e])})}});var Ls=c({is(t){return t.kind==="GroupByNode"},create(t){return c({kind:"GroupByNode",items:c(t)})},cloneWithItems(t,e){return c({...t,items:c([...t.items,...e])})}});var $i=c({is(t){return t.kind==="HavingNode"},create(t){return c({kind:"HavingNode",having:t})},cloneWithOperation(t,e,r){return c({...t,having:e==="And"?xi.create(t.having,r):Ci.create(t.having,r)})}});var Y=c({is(t){return t.kind==="SelectQueryNode"},create(t,e){return c({kind:"SelectQueryNode",from:Gr.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})},cloneWithDistinctOn(t,e){return c({...t,distinctOn:t.distinctOn?c([...t.distinctOn,...e]):c(e)})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):c([e])})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):c([e])})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithGroupByItems(t,e){return c({...t,groupBy:t.groupBy?Ls.cloneWithItems(t.groupBy,e):Ls.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithOffset(t,e){return c({...t,offset:e})},cloneWithHaving(t,e){return c({...t,having:t.having?$i.cloneWithOperation(t.having,"And",e):$i.create(e)})},cloneWithOrHaving(t,e){return c({...t,having:t.having?$i.cloneWithOperation(t.having,"Or",e):$i.create(e)})},cloneWithSetOperation(t,e){return c({...t,setOperations:t.setOperations?c([...t.setOperations,e]):c([e])})},cloneWithExplain(t,e){return c({...t,explain:e})},cloneWithoutSelections(t){return c({...t,selections:[]})},cloneWithoutLimit(t){return c({...t,limit:void 0})},cloneWithoutOffset(t){return c({...t,offset:void 0})},cloneWithoutOrderBy(t){return c({...t,orderBy:void 0})}});var Vt=c({is(t){return t.kind==="SelectModifierNode"},create(t){return c({kind:"SelectModifierNode",modifier:t})},createWithExpression(t){return c({kind:"SelectModifierNode",rawModifier:t})}});var yo=c({is(t){return t.kind==="BinaryOperationNode"},create(t,e,r){return c({kind:"BinaryOperationNode",leftOperand:t,operator:e,rightOperand:r})}});var pe=c({is(t){return t.kind==="RawNode"},create(t,e){return c({kind:"RawNode",sqlFragments:c(t),parameters:c(e)})},createWithSql(t){return pe.create([t],[])},createWithChild(t){return pe.create(["",""],[t])},createWithChildren(t){return pe.create(new Array(t.length+1).fill(""),t)}});var fu=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","ilike","not ilike","@>","<@","?","?&","!<","!>","<=>","!~","~","~*","!~*","&&","||","@@","@@@","!!","<->"];var vo=c({is(t){return t.kind==="OperatorNode"},create(t){return c({kind:"OperatorNode",operator:t})}});var go=c({is(t){return t.kind==="ParensNode"},create(t){return c({kind:"ParensNode",node:t})}});var re=c({is(t){return t.kind==="ColumnNode"},create(t){return c({kind:"ColumnNode",column:$.create(t)})}});var Ti=c({is(t){return t.kind==="SelectAllNode"},create(){return c({kind:"SelectAllNode"})}});var Jr=c({is(t){return t.kind==="ReferenceNode"},create(t,e){return c({kind:"ReferenceNode",table:t,column:e})},createSelectAll(t){return c({kind:"ReferenceNode",table:t,column:Ti.create()})}});function nr(t){return Ze(t)?ir(t):t.toOperationNode()}o(nr,"parseSimpleReferenceExpression");function Ir(t){return br(t)?t.map(e=>rr(e)):[rr(t)]}o(Ir,"parseReferenceExpressionOrList");function rr(t){return Yr(t)?bi(t):nr(t)}o(rr,"parseReferenceExpression");function ir(t){let e=".";if(t.includes(e)){let r=t.split(e).map(hu);if(r.length===3)return cp(r);if(r.length===2)return lp(r);throw new Error(`invalid column reference ${t}`)}else return re.create(t)}o(ir,"parseStringReference");function du(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(hu);return Et.create(ir(r),$.create(i))}else return ir(t)}o(du,"parseAliasedStringReference");function Zi(t){return re.create(t)}o(Zi,"parseColumnName");function cp(t){let[e,r,i]=t;return Jr.create(st.createWithSchema(e,r),re.create(i))}o(cp,"parseStringReferenceWithTableAndSchema");function lp(t){let[e,r]=t;return Jr.create(st.create(e),re.create(r))}o(lp,"parseStringReferenceWithTable");function hu(t){return t.trim()}o(hu,"trim");var No=c({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return c({kind:"PrimitiveValueListNode",values:c([...t])})}});var Ai=c({is(t){return t.kind==="ValueListNode"},create(t){return c({kind:"ValueListNode",values:c(t)})}});var ut=c({is(t){return t.kind==="ValueNode"},create(t){return c({kind:"ValueNode",value:t})},createImmediate(t){return c({kind:"ValueNode",value:t,immediate:!0})}});function wo(t){return br(t)?fp(t):zt(t)}o(wo,"parseValueExpressionOrList");function zt(t){return Yr(t)?bi(t):ut.create(t)}o(zt,"parseValueExpression");function fp(t){return t.some(Yr)?Ai.create(t.map(e=>zt(e))):No.create(t)}o(fp,"parseValueExpressionList");function Be(t){return Bs("where",t)}o(Be,"parseWhere");function Fs(t){return Bs("having",t)}o(Fs,"parseHaving");function Ws(t){return Bs("on",t)}o(Ws,"parseOn");function me(t,e,r){return yo.create(rr(t),Us(e),rr(r))}o(me,"parseReferentialFilter");function Bs(t,e){if(e.length===3)return dp(e[0],e[1],e[2]);if(e.length===1)return pp(t,e[0]);throw pu(t,e)}o(Bs,"parseFilterExpression");function dp(t,e,r){return(e==="is"||e==="is not")&&(po(r)||ho(r))?hp(t,e,r):yo.create(rr(t),Us(e),wo(r))}o(dp,"parseFilter");function hp(t,e,r){return yo.create(rr(t),Us(e),ut.createImmediate(r))}o(hp,"parseIs");function Us(t){if(Ze(t)&&fu.includes(t))return vo.create(t);if(Ye(t))return t.toOperationNode();throw new Error(`invalid comparison operator ${JSON.stringify(t)} passed to a filter method`)}o(Us,"parseComparisonOperatorExpression");function pp(t,e){if(ft(e))return mp[t](e);if(Ye(e)){let r=e.toOperationNode();if(pe.is(r))return r}throw pu(t,e)}o(pp,"parseOneArgFilterExpression");function pu(t,e){return new Error(`invalid arguments passed to a '${t}' method: ${JSON.stringify(e)}`)}o(pu,"createFilterExpressionError");var mp=c({where(t){let r=t(Ms()).toOperationNode();if(!r.where)throw new Error("no `where` methods called inside a group callback");return go.create(r.where.where)},having(t){let r=t(Ms()).toOperationNode();if(!r.having)throw new Error("no `having` methods called inside a group callback");return go.create(r.having.having)},on(t){let r=t(Eo("InnerJoin","table")).toOperationNode();if(!r.on)throw new Error("no `on` methods called inside a group callback");return go.create(r.on.on)}});function Ue(t,e){if(e.length===3)return vp(t,e[0],e[1],e[2]);if(e.length===2)return yp(t,e[0],e[1]);throw new Error("not implemented")}o(Ue,"parseJoin");function yp(t,e,r){return r(Eo(t,e)).toOperationNode()}o(yp,"parseCallbackJoin");function vp(t,e,r,i){return at.createWithOn(t,or(e),me(r,"=",i))}o(vp,"parseSingleOnJoin");var Ii=c({is(t){return t.kind==="SelectionNode"},create(t){return c({kind:"SelectionNode",selection:t})},createSelectAll(){return c({kind:"SelectionNode",selection:Ti.create()})},createSelectAllFromTable(t){return c({kind:"SelectionNode",selection:Jr.createSelectAll(t)})}});var en=class{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return nr(this.#e)}};o(en,"DynamicReferenceBuilder");function mu(t){return dt(t)&&Ye(t)&&Ze(t.dynamicReference)}o(mu,"isDynamicReferenceBuilder");function Or(t){return br(t)?t.map(e=>yu(e)):[yu(t)]}o(Or,"parseSelectExpressionOrList");function yu(t){return Ze(t)?Ii.create(du(t)):mu(t)?Ii.create(t.toOperationNode()):Ii.create(xo(t))}o(yu,"parseSelectExpression");function Rr(t){return t?Array.isArray(t)?t.map(vu):[vu(t)]:[Ii.createSelectAll()]}o(Rr,"parseSelectAll");function vu(t){if(Ze(t))return Ii.createSelectAllFromTable(be(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}o(vu,"parseSelectAllArg");var et=c({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return c({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return c({...t,...e})}});var Dr=c({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return c({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return c({...t,from:t.from?Gr.cloneWithFroms(t.from,e):Gr.create(e)})},cloneWithUpdates(t,e){return c({...t,updates:t.updates?c([...t.updates,...e]):e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var Pr=c({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return c({kind:"DeleteQueryNode",from:Gr.create([t]),...e&&{with:e}})},cloneWithOrderByItem(t,e){return c({...t,orderBy:t.orderBy?tr.cloneWithItem(t.orderBy,e):tr.create(e)})},cloneWithLimit(t,e){return c({...t,limit:e})},cloneWithExplain(t,e){return c({...t,explain:e})}});var qe=c({is(t){return t.kind==="WhereNode"},create(t){return c({kind:"WhereNode",where:t})},cloneWithOperation(t,e,r){return c({...t,where:e==="And"?xi.create(t.where,r):Ci.create(t.where,r)})}});var Vs=c({is(t){return t.kind==="ReturningNode"},create(t){return c({kind:"ReturningNode",selections:c(t)})},cloneWithSelections(t,e){return c({...t,selections:t.selections?c([...t.selections,...e]):c(e)})}});var H=c({is(t){return Pr.is(t)||et.is(t)||Dr.is(t)||Y.is(t)},cloneWithWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"And",e):qe.create(e)})},cloneWithOrWhere(t,e){return c({...t,where:t.where?qe.cloneWithOperation(t.where,"Or",e):qe.create(e)})},cloneWithJoin(t,e){return c({...t,joins:t.joins?c([...t.joins,e]):c([e])})},cloneWithReturning(t,e){return c({...t,returning:t.returning?Vs.cloneWithSelections(t.returning,e):Vs.create(e)})},cloneWithoutWhere(t){return c({...t,where:void 0})}});var gu=c({is(t){return t.kind==="OrderByItemNode"},create(t,e){return c({kind:"OrderByItemNode",orderBy:t,direction:e})}});function Oi(t,e){return gu.create(gp(t),Np(e))}o(Oi,"parseOrderBy");function gp(t){return rr(t)}o(gp,"parseOrderByExpression");function Np(t){if(t)return t==="asc"||t==="desc"?pe.createWithSql(t):t.toOperationNode()}o(Np,"parseOrderByDirectionExpression");function z(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}o(z,"preventAwait");var Co=c({is(t){return t.kind==="LimitNode"},create(t){return c({kind:"LimitNode",limit:ut.create(t)})}});var Nu=c({is(t){return t.kind==="OffsetNode"},create(t){return c({kind:"OffsetNode",offset:ut.create(t)})}});var wu=c({is(t){return t.kind==="GroupByItemNode"},create(t){return c({kind:"GroupByItemNode",groupBy:t})}});function Eu(t){return Ir(t).map(wu.create)}o(Eu,"parseGroupBy");var Rt=class extends Error{node;constructor(e){super("no result"),this.node=e}};o(Rt,"NoResultError");var _r=c({is(t){return t.kind==="ExplainNode"},create(t,e){return c({kind:"ExplainNode",format:t,options:e})}});var So=c({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return c({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function Qr(t,e,r){return So.create(t,e.toOperationNode(),r)}o(Qr,"parseSetOperation");var xu=c({is(t){return t.kind==="UnaryOperationNode"},create(t,e){return c({kind:"UnaryOperationNode",operator:t,operand:e})}});function Ee(t){return Cu("exists",t)}o(Ee,"parseExists");function xe(t){return Cu("not exists",t)}o(xe,"parseNotExists");function Cu(t,e){return xu.create(vo.create(t),wo(e))}o(Cu,"parseUnaryOperation");var B=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}where(...e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}whereNotExists(e){return new B({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}orWhereExists(e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}orWhereNotExists(e){return new B({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}having(...e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,Fs(e))})}havingRef(e,r,i){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,me(e,r,i))})}orHaving(...e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,Fs(e))})}orHavingRef(e,r,i){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,me(e,r,i))})}havingExists(e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,Ee(e))})}havingNotExist(e){return new B({...this.#e,queryNode:Y.cloneWithHaving(this.#e.queryNode,xe(e))})}orHavingExists(e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,Ee(e))})}orHavingNotExists(e){return new B({...this.#e,queryNode:Y.cloneWithOrHaving(this.#e.queryNode,xe(e))})}select(e){return new B({...this.#e,queryNode:Y.cloneWithSelections(this.#e.queryNode,Or(e))})}distinctOn(e){return new B({...this.#e,queryNode:Y.cloneWithDistinctOn(this.#e.queryNode,Ir(e))})}modifyFront(e){return new B({...this.#e,queryNode:Y.cloneWithFrontModifier(this.#e.queryNode,Vt.createWithExpression(e.toOperationNode()))})}modifyEnd(e){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.createWithExpression(e.toOperationNode()))})}distinct(){return new B({...this.#e,queryNode:Y.cloneWithFrontModifier(this.#e.queryNode,Vt.create("Distinct"))})}forUpdate(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForUpdate"))})}forShare(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForShare"))})}forKeyShare(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForKeyShare"))})}forNoKeyUpdate(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("ForNoKeyUpdate"))})}skipLocked(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("SkipLocked"))})}noWait(){return new B({...this.#e,queryNode:Y.cloneWithEndModifier(this.#e.queryNode,Vt.create("NoWait"))})}selectAll(e){return new B({...this.#e,queryNode:Y.cloneWithSelections(this.#e.queryNode,Rr(e))})}innerJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}innerJoinLateral(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralInnerJoin",e))})}leftJoinLateral(...e){return new B({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LateralLeftJoin",e))})}orderBy(e,r){return new B({...this.#e,queryNode:Y.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}groupBy(e){return new B({...this.#e,queryNode:Y.cloneWithGroupByItems(this.#e.queryNode,Eu(e))})}limit(e){return new B({...this.#e,queryNode:Y.cloneWithLimit(this.#e.queryNode,Co.create(e))})}offset(e){return new B({...this.#e,queryNode:Y.cloneWithOffset(this.#e.queryNode,Nu.create(e))})}union(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("union",e,!1))})}unionAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("union",e,!0))})}intersect(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("intersect",e,!1))})}intersectAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("intersect",e,!0))})}except(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("except",e,!1))})}exceptAll(e){return new B({...this.#e,queryNode:Y.cloneWithSetOperation(this.#e.queryNode,Qr("except",e,!0))})}clearSelect(){return new B({...this.#e,queryNode:Y.cloneWithoutSelections(this.#e.queryNode)})}clearWhere(){return new B({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}clearLimit(){return new B({...this.#e,queryNode:Y.cloneWithoutLimit(this.#e.queryNode)})}clearOffset(){return new B({...this.#e,queryNode:Y.cloneWithoutOffset(this.#e.queryNode)})}clearOrderBy(){return new B({...this.#e,queryNode:Y.cloneWithoutOrderBy(this.#e.queryNode)})}call(e){return e(this)}if(e,r){return e?r(this):new B({...this.#e})}as(e){return new To(this,e)}castTo(){return new B(this.#e)}assertType(){return new B(this.#e)}withPlugin(e){return new B({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async*stream(e=100){let r=this.compile(),i=this.#e.executor.stream(r,e,this.#e.queryId);for await(let n of i)yield*n.rows}async explain(e,r){return await new B({...this.#e,queryNode:Y.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(B,"SelectQueryBuilder");z(B,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var To=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return Et.create(this.#e.toOperationNode(),$.create(this.#t))}};o(To,"AliasedSelectQueryBuilder");var $r=class{nodeStack=[];#e=c({AliasNode:this.transformAlias.bind(this),ColumnNode:this.transformColumn.bind(this),IdentifierNode:this.transformIdentifier.bind(this),SchemableIdentifierNode:this.transformSchemableIdentifier.bind(this),RawNode:this.transformRaw.bind(this),ReferenceNode:this.transformReference.bind(this),SelectQueryNode:this.transformSelectQuery.bind(this),SelectionNode:this.transformSelection.bind(this),TableNode:this.transformTable.bind(this),FromNode:this.transformFrom.bind(this),SelectAllNode:this.transformSelectAll.bind(this),AndNode:this.transformAnd.bind(this),OrNode:this.transformOr.bind(this),ValueNode:this.transformValue.bind(this),ValueListNode:this.transformValueList.bind(this),PrimitiveValueListNode:this.transformPrimitiveValueList.bind(this),ParensNode:this.transformParens.bind(this),JoinNode:this.transformJoin.bind(this),OperatorNode:this.transformOperator.bind(this),WhereNode:this.transformWhere.bind(this),InsertQueryNode:this.transformInsertQuery.bind(this),DeleteQueryNode:this.transformDeleteQuery.bind(this),ReturningNode:this.transformReturning.bind(this),CreateTableNode:this.transformCreateTable.bind(this),AddColumnNode:this.transformAddColumn.bind(this),ColumnDefinitionNode:this.transformColumnDefinition.bind(this),DropTableNode:this.transformDropTable.bind(this),DataTypeNode:this.transformDataType.bind(this),OrderByNode:this.transformOrderBy.bind(this),OrderByItemNode:this.transformOrderByItem.bind(this),GroupByNode:this.transformGroupBy.bind(this),GroupByItemNode:this.transformGroupByItem.bind(this),UpdateQueryNode:this.transformUpdateQuery.bind(this),ColumnUpdateNode:this.transformColumnUpdate.bind(this),LimitNode:this.transformLimit.bind(this),OffsetNode:this.transformOffset.bind(this),OnConflictNode:this.transformOnConflict.bind(this),OnDuplicateKeyNode:this.transformOnDuplicateKey.bind(this),CreateIndexNode:this.transformCreateIndex.bind(this),DropIndexNode:this.transformDropIndex.bind(this),ListNode:this.transformList.bind(this),PrimaryKeyConstraintNode:this.transformPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.transformUniqueConstraint.bind(this),ReferencesNode:this.transformReferences.bind(this),CheckConstraintNode:this.transformCheckConstraint.bind(this),WithNode:this.transformWith.bind(this),CommonTableExpressionNode:this.transformCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.transformCommonTableExpressionName.bind(this),HavingNode:this.transformHaving.bind(this),CreateSchemaNode:this.transformCreateSchema.bind(this),DropSchemaNode:this.transformDropSchema.bind(this),AlterTableNode:this.transformAlterTable.bind(this),DropColumnNode:this.transformDropColumn.bind(this),RenameColumnNode:this.transformRenameColumn.bind(this),AlterColumnNode:this.transformAlterColumn.bind(this),ModifyColumnNode:this.transformModifyColumn.bind(this),AddConstraintNode:this.transformAddConstraint.bind(this),DropConstraintNode:this.transformDropConstraint.bind(this),ForeignKeyConstraintNode:this.transformForeignKeyConstraint.bind(this),CreateViewNode:this.transformCreateView.bind(this),DropViewNode:this.transformDropView.bind(this),GeneratedNode:this.transformGenerated.bind(this),DefaultValueNode:this.transformDefaultValue.bind(this),OnNode:this.transformOn.bind(this),ValuesNode:this.transformValues.bind(this),SelectModifierNode:this.transformSelectModifier.bind(this),CreateTypeNode:this.transformCreateType.bind(this),DropTypeNode:this.transformDropType.bind(this),ExplainNode:this.transformExplain.bind(this),DefaultInsertValueNode:this.transformDefaultInsertValue.bind(this),AggregateFunctionNode:this.transformAggregateFunction.bind(this),OverNode:this.transformOver.bind(this),PartitionByNode:this.transformPartitionBy.bind(this),PartitionByItemNode:this.transformPartitionByItem.bind(this),SetOperationNode:this.transformSetOperation.bind(this),BinaryOperationNode:this.transformBinaryOperation.bind(this),UnaryOperationNode:this.transformUnaryOperation.bind(this)});transformNode(e){if(!e)return e;this.nodeStack.push(e);let r=this.transformNodeImpl(e);return this.nodeStack.pop(),c(r)}transformNodeImpl(e){return this.#e[e.kind](e)}transformNodeList(e){return e&&c(e.map(r=>this.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOn:this.transformNodeList(e.distinctOn),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",table:this.transformNode(e.table),column:this.transformNode(e.column)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:c([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain)}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers)}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),expression:this.transformNode(e.expression),unique:e.unique,using:this.transformNode(e.using)}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),columnAlterations:this.transformNodeList(e.columnAlterations),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",column:this.transformNode(e.column),distinct:e.distinct,filter:this.transformNode(e.filter),func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformBinaryOperation(e){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(e.leftOperand),operator:this.transformNode(e.operator),rightOperand:this.transformNode(e.rightOperand)}}transformUnaryOperation(e){return{kind:"UnaryOperationNode",operator:this.transformNode(e.operator),operand:this.transformNode(e.operand)}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}};o($r,"OperationNodeTransformer");var wp=c({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0}),tn=class extends $r{#e;#t=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#r(e))return super.transformNodeImpl(e);let r=this.#i(e);for(let n of r)this.#t.add(n);let i=super.transformNodeImpl(e);for(let n of r)this.#t.delete(n);return i}transformSchemableIdentifier(e){let r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:$.create(this.#e)}}transformReferences(e){let r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:st.createWithSchema(this.#e,r.table.table.identifier.name)}}#r(e){return e.kind in wp}#i(e){let r=new Set;if("name"in e&&e.name&&ot.is(e.name)&&this.#o(e.name,r),"from"in e&&e.from)for(let i of e.from.froms)this.#n(i,r);if("into"in e&&e.into&&this.#n(e.into,r),"table"in e&&e.table&&this.#n(e.table,r),"joins"in e&&e.joins)for(let i of e.joins)this.#n(i.table,r);return"with"in e&&e.with&&this.#s(e.with,r),r}#n(e,r){let i=st.is(e)?e:Et.is(e)&&st.is(e.node)?e.node:null;i&&this.#o(i.table,r)}#o(e,r){this.#t.has(e.identifier.name)||r.add(e.identifier.name)}#s(e,r){for(let i of e.expressions)r.delete(i.name.table.table.identifier.name)}};o(tn,"WithSchemaTransformer");var Dt=class{#e;constructor(e){this.#e=new tn(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}};o(Dt,"WithSchemaPlugin");var Su=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function Tu(t){let e="";for(let r=0;r<t;++r)e+=Ep();return e}o(Tu,"randomString");function Ep(){return Su[~~(Math.random()*Su.length)]}o(Ep,"randomChar");function ne(){return new bo}o(ne,"createQueryId");var bo=class{#e;get queryId(){return this.#e===void 0&&(this.#e=Tu(8)),this.#e}};o(bo,"LazyQueryId");var Ve=c({is(t){return t.kind==="AggregateFunctionNode"},create(t,e){return c({kind:"AggregateFunctionNode",func:t,column:e})},cloneWithDistinct(t){return c({...t,distinct:!0})},cloneWithFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"And",e):qe.create(e)})},cloneWithOrFilter(t,e){return c({...t,filter:t.filter?qe.cloneWithOperation(t.filter,"Or",e):qe.create(e)})},cloneWithOver(t,e){return c({...t,over:e})}});function bu(t){return pe.create(t.length>1?["coalesce(",...new Array(t.length-1).fill(", "),")"]:["coalesce(",")"],Ir(t))}o(bu,"parseCoalesce");var Ri=class{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}};o(Ri,"Deferred");var Au=new Set;function Iu(t){Au.has(t)||(Au.add(t),console.log(t))}o(Iu,"logOnce");var xp=c([]),Zr=class{#e;constructor(e=xp){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(let i of this.#e){let n=i.transformQuery({node:e,queryId:r});if(n.kind===e.kind)e=n;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${n.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async i=>{let n=await i.executeQuery(e),s=await this.#t(n,r);return Cp(n,s),s})}async*stream(e,r,i){let n=new Ri,s=new Ri;this.provideConnection(async u=>(n.resolve(u),await s.promise)).catch(u=>n.reject(u));let a=await n.promise;try{for await(let u of a.streamQuery(e,r))yield await this.#t(u,i)}finally{s.resolve()}}async#t(e,r){for(let i of this.#e)e=await i.transformResult({result:e,queryId:r});return e}};o(Zr,"QueryExecutorBase");function Cp(t,e){let{numAffectedRows:r}=t;r===void 0&&t.numUpdatedOrDeletedRows===void 0||r!==void 0&&e.numAffectedRows!==void 0||Iu("kysely:warning: outdated driver/plugin detected! QueryResult.numUpdatedOrDeletedRows is deprecated and will be removed in a future release.")}o(Cp,"warnOfOutdatedDriverOrPlugins");var sr=class extends Zr{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new sr([...this.plugins,e])}withPlugins(e){return new sr([...this.plugins,...e])}withPluginAtFront(e){return new sr([e,...this.plugins])}withoutPlugins(){return new sr([])}};o(sr,"NoopQueryExecutor");var ei=new sr;var De=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new Ao(this,e)}castTo(){return new De({...this.#e})}withPlugin(e){return new De({...this.#e,plugins:this.#e.plugins!==void 0?c([...this.#e.plugins,e]):c([e])})}toOperationNode(){let e=this.#e.plugins!==void 0?ei.withPlugins(this.#e.plugins):ei;return this.#t(e)}async execute(e){let r=this.#e.plugins!==void 0?e.getExecutor().withPlugins(this.#e.plugins):e.getExecutor();return r.executeQuery(this.#r(r),this.#e.queryId)}#t(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#r(e){return e.compileQuery(this.#t(e),this.#e.queryId)}};o(De,"RawBuilder");z(De,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");var Ao=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return Et.create(this.#e.toOperationNode(),Ye(this.#t)?this.#t.toOperationNode():$.create(this.#t))}};o(Ao,"AliasedRawBuilder");var Ae=class{#e;constructor(e){this.#e=c(e)}get expressionType(){}as(e){return new Io(this,e)}distinct(){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithDistinct(this.#e.aggregateFunctionNode)})}filterWhere(...e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Be(e))})}filterWhereExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,Ee(e))})}filterWhereNotExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,xe(e))})}filterWhereRef(e,r,i){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}orFilterWhere(...e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Be(e))})}orFilterWhereExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,Ee(e))})}orFilterWhereNotExists(e){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,xe(e))})}orFilterWhereRef(e,r,i){return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOrFilter(this.#e.aggregateFunctionNode,me(e,r,i))})}over(e){let r=Ou();return new Ae({...this.#e,aggregateFunctionNode:Ve.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}toOperationNode(){return this.#e.aggregateFunctionNode}};o(Ae,"AggregateFunctionBuilder");z(Ae,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");var Io=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return Et.create(this.#e.toOperationNode(),$.create(this.#t))}};o(Io,"AliasedAggregateFunctionBuilder");var ti=class{constructor(){this.avg=this.avg.bind(this),this.coalesce=this.coalesce.bind(this),this.count=this.count.bind(this),this.max=this.max.bind(this),this.min=this.min.bind(this),this.sum=this.sum.bind(this)}avg(e){return new Ae({aggregateFunctionNode:Ve.create("avg",nr(e))})}coalesce(e,...r){return new De({queryId:ne(),rawNode:bu([e,...r])})}count(e){return new Ae({aggregateFunctionNode:Ve.create("count",nr(e))})}max(e){return new Ae({aggregateFunctionNode:Ve.create("max",nr(e))})}min(e){return new Ae({aggregateFunctionNode:Ve.create("min",nr(e))})}sum(e){return new Ae({aggregateFunctionNode:Ve.create("sum",nr(e))})}};o(ti,"FunctionModule");var ri=class{#e;constructor(e){this.#e=c(e)}get fn(){return new ti}selectFrom(e){return new B({queryId:ne(),executor:this.#e.executor,queryNode:Y.create(qr(e))})}withSchema(e){return new ri({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}ref(e){return new De({queryId:ne(),plugins:this.#e.executor.plugins,rawNode:pe.createWithChild(ir(e))})}};o(ri,"ExpressionBuilder");var Qe=class{#e;constructor(e){this.#e=c(e)}on(...e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Ws(e))})}orOn(...e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Ws(e))})}onRef(e,r,i){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,me(e,r,i))})}orOnRef(e,r,i){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,me(e,r,i))})}onExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,Ee(e))})}onNotExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,xe(e))})}orOnExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,Ee(e))})}orOnNotExists(e){return new Qe({...this.#e,joinNode:at.cloneWithOrOn(this.#e.joinNode,xe(e))})}onTrue(){return new Qe({...this.#e,joinNode:at.cloneWithOn(this.#e.joinNode,pe.createWithSql("true"))})}toOperationNode(){return this.#e.joinNode}};o(Qe,"JoinBuilder");z(Qe,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");var Ru=c({is(t){return t.kind==="PartitionByItemNode"},create(t){return c({kind:"PartitionByItemNode",partitionBy:t})}});function Du(t){return Ir(t).map(Ru.create)}o(Du,"parsePartitionBy");var ar=class{#e;constructor(e){this.#e=c(e)}orderBy(e,r){return new ar({overNode:Qi.cloneWithOrderByItem(this.#e.overNode,Oi(e,r))})}partitionBy(e){return new ar({overNode:Qi.cloneWithPartitionByItems(this.#e.overNode,Du(e))})}toOperationNode(){return this.#e.overNode}};o(ar,"OverBuilder");z(ar,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");var Pu=c({is(t){return t.kind==="ValuesNode"},create(t){return c({kind:"ValuesNode",values:c(t)})}});var _u=c({is(t){return t.kind==="DefaultInsertValueNode"},create(){return c({kind:"DefaultInsertValueNode"})}});function qu(t){return Sp(Array.isArray(t)?t:[t])}o(qu,"parseInsertObjectOrList");function Sp(t){let e=Tp(t);return[c([...e.keys()].map(re.create)),Pu.create(t.map(r=>bp(r,e)))]}o(Sp,"parseInsertColumnsAndValues");function Tp(t){let e=new Map;for(let r of t){let i=Object.keys(r);for(let n of i)!e.has(n)&&r[n]!==void 0&&e.set(n,e.size)}return e}o(Tp,"parseColumnNamesAndIndexes");function bp(t,e){let r=Object.keys(t),i=Array.from({length:e.size}),n=!1;for(let a of r){let u=e.get(a);if(u!==void 0){let l=t[a];Yr(l)&&(n=!0),i[u]=l}}if(r.length<e.size||n){let a=_u.create();return Ai.create(i.map(u=>nu(u)?a:zt(u)))}return No.create(i)}o(bp,"parseRowValues");var ku=c({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return c({kind:"ColumnUpdateNode",column:t,value:e})}});function Di(t){return Object.entries(t).filter(([e,r])=>r!==void 0).map(([e,r])=>ku.create(re.create(e),zt(r)))}o(Di,"parseUpdateObject");var Lu=c({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return c({kind:"OnDuplicateKeyNode",updates:t})}});var rn=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get insertId(){return this.#e}get numInsertedOrUpdatedRows(){return this.#t}};o(rn,"InsertResult");var de=c({is(t){return t.kind==="OnConflictNode"},create(){return c({kind:"OnConflictNode"})},cloneWith(t,e){return c({...t,...e})},cloneWithIndexWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"And",e):qe.create(e)})},cloneWithIndexOrWhere(t,e){return c({...t,indexWhere:t.indexWhere?qe.cloneWithOperation(t.indexWhere,"Or",e):qe.create(e)})},cloneWithUpdateWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"And",e):qe.create(e)})},cloneWithUpdateOrWhere(t,e){return c({...t,updateWhere:t.updateWhere?qe.cloneWithOperation(t.updateWhere,"Or",e):qe.create(e)})},cloneWithoutIndexWhere(t){return c({...t,indexWhere:void 0})},cloneWithoutUpdateWhere(t){return c({...t,updateWhere:void 0})}});var Pe=class{#e;constructor(e){this.#e=c(e)}column(e){let r=re.create(e);return new Pe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,r]):c([r])})})}columns(e){let r=e.map(re.create);return new Pe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?c([...this.#e.onConflictNode.columns,...r]):c(r)})})}constraint(e){return new Pe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{constraint:$.create(e)})})}expression(e){return new Pe({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,Ee(e))})}whereNotExists(e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexWhere(this.#e.onConflictNode,xe(e))})}orWhereExists(e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,Ee(e))})}orWhereNotExists(e){return new Pe({...this.#e,onConflictNode:de.cloneWithIndexOrWhere(this.#e.onConflictNode,xe(e))})}clearWhere(){return new Pe({...this.#e,onConflictNode:de.cloneWithoutIndexWhere(this.#e.onConflictNode)})}doNothing(){return new nn({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new tt({...this.#e,onConflictNode:de.cloneWith(this.#e.onConflictNode,{updates:Di(e)})})}};o(Pe,"OnConflictBuilder");z(Pe,"don't await OnConflictBuilder instances.");var nn=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.onConflictNode}};o(nn,"OnConflictDoNothingBuilder");z(nn,"don't await OnConflictDoNothingBuilder instances.");var tt=class{#e;constructor(e){this.#e=c(e)}where(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Be(e))})}whereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,me(e,r,i))})}orWhere(...e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Be(e))})}orWhereRef(e,r,i){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,me(e,r,i))})}whereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,Ee(e))})}whereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateWhere(this.#e.onConflictNode,xe(e))})}orWhereExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,Ee(e))})}orWhereNotExists(e){return new tt({...this.#e,onConflictNode:de.cloneWithUpdateOrWhere(this.#e.onConflictNode,xe(e))})}clearWhere(){return new tt({...this.#e,onConflictNode:de.cloneWithoutUpdateWhere(this.#e.onConflictNode)})}toOperationNode(){return this.#e.onConflictNode}};o(tt,"OnConflictUpdateBuilder");z(tt,"don't await OnConflictUpdateBuilder instances.");var Ie=class{#e;constructor(e){this.#e=c(e)}values(e){let[r,i]=qu(e);return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:r,values:i})})}columns(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{columns:c(e.map(re.create))})})}expression(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{values:bi(e)})})}ignore(){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onConflict:e(new Pe({onConflictNode:de.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{onDuplicateKey:Lu.create(Di(e))})})}returning(e){return new Ie({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new Ie({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}call(e){return e(this)}if(e,r){return e?r(this):new Ie({...this.#e})}castTo(){return new Ie(this.#e)}assertType(){return new Ie(this.#e)}withPlugin(e){return new Ie({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new rn(i.insertId,i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new Ie({...this.#e,queryNode:et.cloneWith(this.#e.queryNode,{explain:_r.create(e,r?.toOperationNode())})}).execute()}};o(Ie,"InsertQueryBuilder");z(Ie,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var on=class{#e;constructor(e){this.#e=e}get numDeletedRows(){return this.#e}};o(on,"DeleteResult");var ae=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}whereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}orWhereExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}orWhereNotExists(e){return new ae({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}clearWhere(){return new ae({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}innerJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ae({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}returning(e){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new ae({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}orderBy(e,r){return new ae({...this.#e,queryNode:Pr.cloneWithOrderByItem(this.#e.queryNode,Oi(e,r))})}limit(e){return new ae({...this.#e,queryNode:Pr.cloneWithLimit(this.#e.queryNode,Co.create(e))})}call(e){return e(this)}if(e,r){return e?r(this):new ae({...this.#e})}castTo(){return new ae(this.#e)}assertType(){return new ae(this.#e)}withPlugin(e){return new ae({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new on(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ae({...this.#e,queryNode:Pr.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(ae,"DeleteQueryBuilder");z(ae,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var sn=class{#e;constructor(e){this.#e=e}get numUpdatedRows(){return this.#e}};o(sn,"UpdateResult");var ue=class{#e;constructor(e){this.#e=c(e)}where(...e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Be(e))})}whereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,me(e,r,i))})}orWhere(...e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Be(e))})}orWhereRef(e,r,i){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,me(e,r,i))})}whereExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,Ee(e))})}whereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithWhere(this.#e.queryNode,xe(e))})}orWhereExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,Ee(e))})}orWhereNotExists(e){return new ue({...this.#e,queryNode:H.cloneWithOrWhere(this.#e.queryNode,xe(e))})}clearWhere(){return new ue({...this.#e,queryNode:H.cloneWithoutWhere(this.#e.queryNode)})}from(e){return new ue({...this.#e,queryNode:Dr.cloneWithFromItems(this.#e.queryNode,qr(e))})}innerJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("InnerJoin",e))})}leftJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("LeftJoin",e))})}rightJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("RightJoin",e))})}fullJoin(...e){return new ue({...this.#e,queryNode:H.cloneWithJoin(this.#e.queryNode,Ue("FullJoin",e))})}set(e){return new ue({...this.#e,queryNode:Dr.cloneWithUpdates(this.#e.queryNode,Di(e))})}returning(e){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Or(e))})}returningAll(){return new ue({...this.#e,queryNode:H.cloneWithReturning(this.#e.queryNode,Rr())})}call(e){return e(this)}if(e,r){return e?r(this):new ue({...this.#e})}castTo(){return new ue(this.#e)}assertType(){return new ue(this.#e)}withPlugin(e){return new ue({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){let e=this.compile(),r=e.query,i=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?i.rows:[new sn(i.numAffectedRows??i.numUpdatedOrDeletedRows)]}async executeTakeFirst(){let[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=Rt){let r=await this.executeTakeFirst();if(r===void 0)throw new e(this.toOperationNode());return r}async explain(e,r){return await new ue({...this.#e,queryNode:Dr.cloneWithExplain(this.#e.queryNode,_r.create(e,r?.toOperationNode()))}).execute()}};o(ue,"UpdateQueryBuilder");z(ue,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");var Mu=c({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return c({kind:"CommonTableExpressionNode",name:t,expression:e})}});var zs=c({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return c({kind:"CommonTableExpressionNameNode",table:st.create(t),columns:e?c(e.map(re.create)):void 0})}});function Hs(t,e){let r=e(Fu());return Mu.create(Ap(t),r.toOperationNode())}o(Hs,"parseCommonTableExpression");function Ap(t){if(t.includes("(")){let e=t.split(/[\(\)]/),r=e[0],i=e[1].split(",").map(n=>n.trim());return zs.create(r,i)}else return zs.create(t)}o(Ap,"parseCommonTableExpressionName");var an=c({is(t){return t.kind==="WithNode"},create(t,e){return c({kind:"WithNode",expressions:c([t]),...e})},cloneWithExpression(t,e){return c({...t,expressions:c([...t.expressions,e])})}});var pt=class{#e;constructor(e){this.#e=c(e)}selectFrom(e){return new B({queryId:ne(),executor:this.#e.executor,queryNode:Y.create(qr(e),this.#e.withNode)})}insertInto(e){return new Ie({queryId:ne(),executor:this.#e.executor,queryNode:et.create(be(e),this.#e.withNode)})}replaceInto(e){return new Ie({queryId:ne(),executor:this.#e.executor,queryNode:et.create(be(e),this.#e.withNode,!0)})}deleteFrom(e){return new ae({queryId:ne(),executor:this.#e.executor,queryNode:Pr.create(or(e),this.#e.withNode)})}updateTable(e){return new ue({queryId:ne(),executor:this.#e.executor,queryNode:Dr.create(or(e),this.#e.withNode)})}with(e,r){let i=Hs(e,r);return new pt({...this.#e,withNode:this.#e.withNode?an.cloneWithExpression(this.#e.withNode,i):an.create(i)})}withRecursive(e,r){let i=Hs(e,r);return new pt({...this.#e,withNode:this.#e.withNode?an.cloneWithExpression(this.#e.withNode,i):an.create(i,{recursive:!0})})}withPlugin(e){return new pt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new pt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new pt({...this.#e,executor:this.#e.executor.withPluginAtFront(new Dt(e))})}};o(pt,"QueryCreator");function Ms(){return new B({queryId:ne(),executor:ei,queryNode:Y.create(qr([]))})}o(Ms,"createSelectQueryBuilder");function js(){return new ri({executor:ei})}o(js,"createExpressionBuilder");function Fu(){return new pt({executor:ei})}o(Fu,"createQueryCreator");function Eo(t,e){return new Qe({joinNode:at.create(t,or(e))})}o(Eo,"createJoinBuilder");function Ou(){return new ar({overNode:Qi.create()})}o(Ou,"createOverBuilder");function bi(t){if(Ye(t))return t.toOperationNode();if(ft(t))return t(js()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}o(bi,"parseExpression");function xo(t){if(Ye(t))return t.toOperationNode();if(ft(t))return t(js()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}o(xo,"parseAliasedExpression");function Yr(t){return lu(t)||ft(t)}o(Yr,"isExpressionOrFactory");function qr(t){return br(t)?t.map(e=>or(e)):[or(t)]}o(qr,"parseTableExpressionOrList");function or(t){return Ze(t)?Ip(t):xo(t)}o(or,"parseTableExpression");function Ip(t){let e=" as ";if(t.includes(e)){let[r,i]=t.split(e).map(Wu);return Et.create(be(r),$.create(i))}else return be(t)}o(Ip,"parseAliasedTable");function be(t){let e=".";if(t.includes(e)){let[r,i]=t.split(e).map(Wu);return st.createWithSchema(r,i)}else return st.create(t)}o(be,"parseTable");function Wu(t){return t.trim()}o(Wu,"trim");var Ks=c({is(t){return t.kind==="AddColumnNode"},create(t){return c({kind:"AddColumnNode",column:t})}});var ur=c({is(t){return t.kind==="AlterColumnNode"},create(t){return c({kind:"AlterColumnNode",column:re.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ye=c({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return c({kind:"ColumnDefinitionNode",column:re.create(t),dataType:e})},cloneWithFrontModifier(t,e){return c({...t,frontModifiers:t.frontModifiers?c([...t.frontModifiers,e]):[e]})},cloneWithEndModifier(t,e){return c({...t,endModifiers:t.endModifiers?c([...t.endModifiers,e]):[e]})},cloneWith(t,e){return c({...t,...e})}});var Xs=c({is(t){return t.kind==="DropColumnNode"},create(t){return c({kind:"DropColumnNode",column:re.create(t)})}});var Gs=c({is(t){return t.kind==="RenameColumnNode"},create(t,e){return c({kind:"RenameColumnNode",column:re.create(t),renameTo:re.create(e)})}});var Pi=c({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return c({kind:"CheckConstraintNode",expression:t,name:e?$.create(e):void 0})}});var Bu=["no action","restrict","cascade","set null","set default"],_i=c({is(t){return t.kind==="ReferencesNode"},create(t,e){return c({kind:"ReferencesNode",table:t,columns:c([...e])})},cloneWithOnDelete(t,e){return c({...t,onDelete:e})},cloneWithOnUpdate(t,e){return c({...t,onUpdate:e})}});function Oo(t){return Ye(t)?t.toOperationNode():ut.createImmediate(t)}o(Oo,"parseDefaultValueExpression");var un=c({is(t){return t.kind==="GeneratedNode"},create(t){return c({kind:"GeneratedNode",...t})},createWithExpression(t){return c({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return c({...t,...e})}});var Uu=c({is(t){return t.kind==="DefaultValueNode"},create(t){return c({kind:"DefaultValueNode",defaultValue:t})}});function qi(t){if(Bu.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}o(qi,"parseOnModifyForeignAction");var le=class{#e;constructor(e){this.#e=e}autoIncrement(){return new le(ye.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new le(ye.cloneWith(this.#e,{primaryKey:!0}))}references(e){let r=ir(e);if(!Jr.is(r)||Ti.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new le(ye.cloneWith(this.#e,{references:_i.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnDelete(this.#e.references,qi(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new le(ye.cloneWith(this.#e,{references:_i.cloneWithOnUpdate(this.#e.references,qi(e))}))}unique(){return new le(ye.cloneWith(this.#e,{unique:!0}))}notNull(){return new le(ye.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new le(ye.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new le(ye.cloneWith(this.#e,{defaultTo:Uu.create(Oo(e))}))}check(e){return new le(ye.cloneWith(this.#e,{check:Pi.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new le(ye.cloneWith(this.#e,{generated:un.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:un.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new le(ye.cloneWith(this.#e,{generated:un.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new le(ye.cloneWith(this.#e,{generated:un.cloneWith(this.#e.generated,{stored:!0})}))}modifyFront(e){return new le(ye.cloneWithFrontModifier(this.#e,e.toOperationNode()))}modifyEnd(e){return new le(ye.cloneWithEndModifier(this.#e,e.toOperationNode()))}toOperationNode(){return this.#e}};o(le,"ColumnDefinitionBuilder");z(le,"don't await ColumnDefinitionBuilder instances directly.");var Js=c({is(t){return t.kind==="ModifyColumnNode"},create(t){return c({kind:"ModifyColumnNode",column:t})}});var Ro=c({is(t){return t.kind==="DataTypeNode"},create(t){return c({kind:"DataTypeNode",dataType:t})}});function ii(t){return Ye(t)?t.toOperationNode():Ro.create(t)}o(ii,"parseDataTypeExpression");var ni=c({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,i){return c({kind:"ForeignKeyConstraintNode",columns:t,references:_i.create(e,r),name:i?$.create(i):void 0})},cloneWith(t,e){return c({...t,...e})}});var Pt=class{#e;constructor(e){this.#e=e}onDelete(e){return new Pt(ni.cloneWith(this.#e,{onDelete:qi(e)}))}onUpdate(e){return new Pt(ni.cloneWith(this.#e,{onUpdate:qi(e)}))}toOperationNode(){return this.#e}};o(Pt,"ForeignKeyConstraintBuilder");z(Pt,"don't await ForeignKeyConstraintBuilder instances directly.");var cn=c({is(t){return t.kind==="AddConstraintNode"},create(t){return c({kind:"AddConstraintNode",constraint:t})}});var Do=c({is(t){return t.kind==="UniqueConstraintNode"},create(t,e){return c({kind:"UniqueConstraintNode",columns:c(t.map(re.create)),name:e?$.create(e):void 0})}});var ki=c({is(t){return t.kind==="DropConstraintNode"},create(t){return c({kind:"DropConstraintNode",constraintName:$.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Lr=class{alterColumnNode;constructor(e){this.alterColumnNode=e}setDataType(e){return new kr(ur.cloneWith(this.alterColumnNode,{dataType:Ro.create(e)}))}setDefault(e){return new kr(ur.cloneWith(this.alterColumnNode,{setDefault:Oo(e)}))}dropDefault(){return new kr(ur.cloneWith(this.alterColumnNode,{dropDefault:!0}))}setNotNull(){return new kr(ur.cloneWith(this.alterColumnNode,{setNotNull:!0}))}dropNotNull(){return new kr(ur.cloneWith(this.alterColumnNode,{dropNotNull:!0}))}};o(Lr,"AlterColumnBuilder");var kr=class extends Lr{toOperationNode(){return this.alterColumnNode}};o(kr,"AlteredColumnBuilder");var cr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(cr,"AlterTableExecutor");z(cr,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");var lr=class{#e;constructor(e){this.#e=c(e)}onDelete(e){return new lr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new lr({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}toOperationNode(){return this.#e.executor.transformQuery(he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(lr,"AlterTableAddForeignKeyConstraintBuilder");z(lr,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");var Ht=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:ki.cloneWith(this.#e.node.dropConstraint,{ifExists:!0})})})}cascade(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:ki.cloneWith(this.#e.node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:ki.cloneWith(this.#e.node.dropConstraint,{modifier:"restrict"})})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Ht,"AlterTableDropConstraintBuilder");z(Ht,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");var Li=class{#e;constructor(e){this.#e=c(e)}renameTo(e){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{renameTo:be(e)})})}setSchema(e){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{setSchema:$.create(e)})})}alterColumn(e,r){let i=r(new Lr(ur.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xs.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Gs.create(e,r))})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Ks.create(n.toOperationNode()))})}modifyColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Js.create(n.toOperationNode()))})}addUniqueConstraint(e,r){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(Do.create(r,e))})})}addCheckConstraint(e,r){return new cr({...this.#e,node:he.cloneWithTableProps(this.#e.node,{addConstraint:cn.create(Pi.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,i,n){return new lr({...this.#e,constraintBuilder:new Pt(ni.create(r.map(re.create),be(i),n.map(re.create),e))})}dropConstraint(e){return new Ht({...this.#e,node:he.cloneWithTableProps(this.#e.node,{dropConstraint:ki.create(e)})})}call(e){return e(this)}};o(Li,"AlterTableBuilder");var rt=class{#e;constructor(e){this.#e=c(e)}alterColumn(e,r){let i=r(new Lr(ur.create(e)));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,i.toOperationNode())})}dropColumn(e){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Xs.create(e))})}renameColumn(e,r){return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Gs.create(e,r))})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Ks.create(n.toOperationNode()))})}modifyColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new rt({...this.#e,node:he.cloneWithColumnAlteration(this.#e.node,Js.create(n.toOperationNode()))})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(rt,"AlterTableColumnAlteringBuilder");z(Li,"don't await AlterTableBuilder instances");z(Lr,"don't await AlterColumnBuilder instances");z(rt,"don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`");var Vu=c({is(t){return t.kind==="ListNode"},create(t){return c({kind:"ListNode",items:c(t)})}});var mt=class{#e;constructor(e){this.#e=c(e)}unique(){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{unique:!0})})}on(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{table:be(e)})})}column(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:Zi(e)})})}columns(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:Vu.create(e.map(Zi))})})}expression(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{expression:e.toOperationNode()})})}using(e){return new mt({...this.#e,node:er.cloneWith(this.#e.node,{using:pe.createWithSql(e)})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(mt,"CreateIndexBuilder");z(mt,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");var Mr=class{#e;constructor(e){this.#e=c(e)}ifNotExists(){return new Mr({...this.#e,node:mo.cloneWith(this.#e.node,{ifNotExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Mr,"CreateSchemaBuilder");z(Mr,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");var zu=c({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return c({kind:"PrimaryKeyConstraintNode",columns:c(t.map(re.create)),name:e?$.create(e):void 0})}});function Hu(t){if(cu.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}o(Hu,"parseOnCommitAction");var ze=class{#e;constructor(e){this.#e=c(e)}temporary(){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{temporary:!0})})}onCommit(e){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{onCommit:Hu(e)})})}ifNotExists(){return new ze({...this.#e,node:ht.cloneWith(this.#e.node,{ifNotExists:!0})})}addColumn(e,r,i=Ar){let n=i(new le(ye.create(e,ii(r))));return new ze({...this.#e,node:ht.cloneWithColumn(this.#e.node,n.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,zu.create(r,e))})}addUniqueConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,Do.create(r,e))})}addCheckConstraint(e,r){return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,Pi.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,i,n,s=Ar){let a=s(new Pt(ni.create(r.map(re.create),be(i),n.map(re.create),e)));return new ze({...this.#e,node:ht.cloneWithConstraint(this.#e.node,a.toOperationNode())})}modifyFront(e){return new ze({...this.#e,node:ht.cloneWithFrontModifier(this.#e.node,e.toOperationNode())})}modifyEnd(e){return new ze({...this.#e,node:ht.cloneWithEndModifier(this.#e.node,e.toOperationNode())})}call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(ze,"CreateTableBuilder");z(ze,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");var jt=class{#e;constructor(e){this.#e=c(e)}on(e){return new jt({...this.#e,node:Ei.cloneWith(this.#e.node,{table:be(e)})})}ifExists(){return new jt({...this.#e,node:Ei.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new jt({...this.#e,node:Ei.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(jt,"DropIndexBuilder");z(jt,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");var fr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new fr({...this.#e,node:Ji.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new fr({...this.#e,node:Ji.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(fr,"DropSchemaBuilder");z(fr,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");var dr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new dr({...this.#e,node:Yi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new dr({...this.#e,node:Yi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(dr,"DropTableBuilder");z(dr,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");var _t=c({is(t){return t.kind==="CreateViewNode"},create(t){return c({kind:"CreateViewNode",name:ot.create(t)})},cloneWith(t,e){return c({...t,...e})}});var ln=class extends $r{transformValue(e){return{...super.transformValue(e),immediate:!0}}};o(ln,"ImmediateValueTransformer");var fn=class{#e=new ln;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}};o(fn,"ImmediateValuePlugin");var yt=class{#e;constructor(e){this.#e=c(e)}temporary(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{temporary:!0})})}materialized(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{materialized:!0})})}ifNotExists(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{ifNotExists:!0})})}orReplace(){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{orReplace:!0})})}columns(e){return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{columns:e.map(Zi)})})}as(e){let r=e.withPlugin(new fn).toOperationNode();return new yt({...this.#e,node:_t.cloneWith(this.#e.node,{as:r})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(yt,"CreateViewBuilder");z(yt,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");var Mi=c({is(t){return t.kind==="DropViewNode"},create(t){return c({kind:"DropViewNode",name:ot.create(t)})},cloneWith(t,e){return c({...t,...e})}});var Kt=class{#e;constructor(e){this.#e=c(e)}materialized(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{materialized:!0})})}ifExists(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new Kt({...this.#e,node:Mi.cloneWith(this.#e.node,{cascade:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Kt,"DropViewBuilder");z(Kt,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");var Po=c({is(t){return t.kind==="CreateTypeNode"},create(t){return c({kind:"CreateTypeNode",name:t})},cloneWithEnum(t,e){return c({...t,enum:Ai.create(e.map(r=>ut.createImmediate(r)))})}});var Fr=class{#e;constructor(e){this.#e=c(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}asEnum(e){return new Fr({...this.#e,node:Po.cloneWithEnum(this.#e.node,e)})}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Fr,"CreateTypeBuilder");z(Fr,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");var _o=c({is(t){return t.kind==="DropTypeNode"},create(t){return c({kind:"DropTypeNode",name:t})},cloneWith(t,e){return c({...t,...e})}});var Wr=class{#e;constructor(e){this.#e=c(e)}ifExists(){return new Wr({...this.#e,node:_o.cloneWith(this.#e.node,{ifExists:!0})})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}};o(Wr,"DropTypeBuilder");z(Wr,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");function Ys(t){let e=".";if(t.includes(e)){let r=t.split(e).map(Op);if(r.length===2)return ot.createWithSchema(r[0],r[1]);throw new Error(`invalid schemable identifier ${t}`)}else return ot.create(t)}o(Ys,"parseSchemableIdentifier");function Op(t){return t.trim()}o(Op,"trim");var hr=class{#e;constructor(e){this.#e=e}createTable(e){return new ze({queryId:ne(),executor:this.#e,node:ht.create(be(e))})}dropTable(e){return new dr({queryId:ne(),executor:this.#e,node:Yi.create(be(e))})}createIndex(e){return new mt({queryId:ne(),executor:this.#e,node:er.create(e)})}dropIndex(e){return new jt({queryId:ne(),executor:this.#e,node:Ei.create(e)})}createSchema(e){return new Mr({queryId:ne(),executor:this.#e,node:mo.create(e)})}dropSchema(e){return new fr({queryId:ne(),executor:this.#e,node:Ji.create(e)})}alterTable(e){return new Li({queryId:ne(),executor:this.#e,node:he.create(e)})}createView(e){return new yt({queryId:ne(),executor:this.#e,node:_t.create(e)})}dropView(e){return new Kt({queryId:ne(),executor:this.#e,node:Mi.create(e)})}createType(e){return new Fr({queryId:ne(),executor:this.#e,node:Po.create(Ys(e))})}dropType(e){return new Wr({queryId:ne(),executor:this.#e,node:_o.create(Ys(e))})}withPlugin(e){return new hr(this.#e.withPlugin(e))}withoutPlugins(){return new hr(this.#e.withoutPlugins())}withSchema(e){return new hr(this.#e.withPluginAtFront(new Dt(e)))}};o(hr,"SchemaModule");var dn=class{ref(e){return new en(e)}};o(dn,"DynamicModule");var hn=class{#e;constructor(e){this.#e=e}async provideConnection(e){let r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}};o(hn,"DefaultConnectionProvider");var qt=class extends Zr{#e;#t;#r;constructor(e,r,i,n=[]){super(n),this.#e=e,this.#t=r,this.#r=i}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new qt(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new qt(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new qt(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new qt(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new qt(this.#e,this.#t,this.#r,[])}};o(qt,"DefaultQueryExecutor");function Qs(){return typeof performance<"u"&&ft(performance.now)?performance.now():Date.now()}o(Qs,"performanceNow");var pn=class{#e;#t;#r;#i;#n=new WeakSet;constructor(e,r){this.#e=e,this.#t=r}async init(){this.#r||(this.#r=this.#e.init().catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){await this.init();let e=await this.#e.acquireConnection();return this.#n.has(e)||(this.#o()&&this.#s(e),this.#n.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#o(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#s(e){let r=e.executeQuery;e.executeQuery=async i=>{let n=Qs();try{return await r.call(e,i)}catch(s){throw this.#u(s),s}finally{this.#c(i,n)}}}#u(e){this.#t.error(()=>({level:"error",error:e}))}#c(e,r){this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#l(r)}))}#l(e){return Qs()-e}};o(pn,"RuntimeDriver");var Fi=class{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t;let r=this.#r(e);return this.#t=r.then(()=>{this.#t=void 0}).catch(()=>{this.#t=void 0}),r}async#r(e){return await e(this.#e)}};o(Fi,"SingleConnectionProvider");var ju=["read uncommitted","read committed","repeatable read","serializable"];var QD=c(["query","error"]),mn=class{#e;#t;constructor(e){ft(e)?(this.#t=e,this.#e=c({query:!0,error:!0})):(this.#t=Rp,this.#e=c({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}query(e){this.#e.query&&this.#t(e())}error(e){this.#e.error&&this.#t(e())}};o(mn,"Log");function Rp(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${t}`))}o(Rp,"defaultLogger");var kt=class extends pt{#e;constructor(e){let r,i;if(Dp(e))r={executor:e.executor},i={...e};else{let n=e.dialect,s=n.createDriver(),a=n.createQueryCompiler(),u=n.createAdapter(),l=new mn(e.log??[]),h=new pn(s,l),y=new hn(h),v=new qt(a,u,y,e.plugins??[]);r={executor:v},i={config:e,executor:v,dialect:n,driver:h}}super(r),this.#e=c(i)}get schema(){return new hr(this.#e.executor)}get dynamic(){return new dn}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}get fn(){return new ti}transaction(){return new oi({...this.#e})}connection(){return new yn({...this.#e})}withPlugin(e){return new kt({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new kt({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new kt({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}};o(kt,"Kysely");var Br=class extends kt{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new Br({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Br({...this.#e,executor:this.#e.executor.withoutPlugins()})}withTables(){return new Br({...this.#e})}};o(Br,"Transaction");function Dp(t){return dt(t)&&dt(t.config)&&dt(t.driver)&&dt(t.executor)&&dt(t.dialect)}o(Dp,"isKyselyProps");var yn=class{#e;constructor(e){this.#e=c(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{let i=this.#e.executor.withConnectionProvider(new Fi(r)),n=new kt({...this.#e,executor:i});return await e(n)})}};o(yn,"ConnectionBuilder");z(yn,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");var oi=class{#e;constructor(e){this.#e=c(e)}setIsolationLevel(e){return new oi({...this.#e,isolationLevel:e})}async execute(e){let{isolationLevel:r,...i}=this.#e,n={isolationLevel:r};return Pp(n),this.#e.executor.provideConnection(async s=>{let a=this.#e.executor.withConnectionProvider(new Fi(s)),u=new Br({...i,executor:a});try{await this.#e.driver.beginTransaction(s,n);let l=await e(u);return await this.#e.driver.commitTransaction(s),l}catch(l){throw await this.#e.driver.rollbackTransaction(s),l}})}};o(oi,"TransactionBuilder");z(oi,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function Pp(t){if(t.isolationLevel&&!ju.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}o(Pp,"validateTransactionSettings");var it=Object.assign((t,...e)=>new De({queryId:ne(),rawNode:pe.create(t,e?.map(zt)??[])}),{ref(t){return new De({queryId:ne(),rawNode:pe.createWithChild(ir(t))})},value(t){return new De({queryId:ne(),rawNode:pe.createWithChild(zt(t))})},table(t){return new De({queryId:ne(),rawNode:pe.createWithChild(be(t))})},id(...t){let e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",new De({queryId:ne(),rawNode:pe.create(e,t.map($.create))})},literal(t){return new De({queryId:ne(),rawNode:pe.createWithChild(ut.createImmediate(t))})},raw(t){return new De({queryId:ne(),rawNode:pe.createWithSql(t)})},join(t,e=it`, `){let r=new Array(2*t.length-1),i=e.toOperationNode();for(let n=0;n<t.length;++n)r[2*n]=zt(t[n]),n!==t.length-1&&(r[2*n+1]=i);return new De({queryId:ne(),rawNode:pe.createWithChildren(r)})}});var vn=class{nodeStack=[];get parentNode(){return this.nodeStack[this.nodeStack.length-2]}#e=c({AliasNode:this.visitAlias.bind(this),ColumnNode:this.visitColumn.bind(this),IdentifierNode:this.visitIdentifier.bind(this),SchemableIdentifierNode:this.visitSchemableIdentifier.bind(this),RawNode:this.visitRaw.bind(this),ReferenceNode:this.visitReference.bind(this),SelectQueryNode:this.visitSelectQuery.bind(this),SelectionNode:this.visitSelection.bind(this),TableNode:this.visitTable.bind(this),FromNode:this.visitFrom.bind(this),SelectAllNode:this.visitSelectAll.bind(this),AndNode:this.visitAnd.bind(this),OrNode:this.visitOr.bind(this),ValueNode:this.visitValue.bind(this),ValueListNode:this.visitValueList.bind(this),PrimitiveValueListNode:this.visitPrimitiveValueList.bind(this),ParensNode:this.visitParens.bind(this),JoinNode:this.visitJoin.bind(this),OperatorNode:this.visitOperator.bind(this),WhereNode:this.visitWhere.bind(this),InsertQueryNode:this.visitInsertQuery.bind(this),DeleteQueryNode:this.visitDeleteQuery.bind(this),ReturningNode:this.visitReturning.bind(this),CreateTableNode:this.visitCreateTable.bind(this),AddColumnNode:this.visitAddColumn.bind(this),ColumnDefinitionNode:this.visitColumnDefinition.bind(this),DropTableNode:this.visitDropTable.bind(this),DataTypeNode:this.visitDataType.bind(this),OrderByNode:this.visitOrderBy.bind(this),OrderByItemNode:this.visitOrderByItem.bind(this),GroupByNode:this.visitGroupBy.bind(this),GroupByItemNode:this.visitGroupByItem.bind(this),UpdateQueryNode:this.visitUpdateQuery.bind(this),ColumnUpdateNode:this.visitColumnUpdate.bind(this),LimitNode:this.visitLimit.bind(this),OffsetNode:this.visitOffset.bind(this),OnConflictNode:this.visitOnConflict.bind(this),OnDuplicateKeyNode:this.visitOnDuplicateKey.bind(this),CreateIndexNode:this.visitCreateIndex.bind(this),DropIndexNode:this.visitDropIndex.bind(this),ListNode:this.visitList.bind(this),PrimaryKeyConstraintNode:this.visitPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.visitUniqueConstraint.bind(this),ReferencesNode:this.visitReferences.bind(this),CheckConstraintNode:this.visitCheckConstraint.bind(this),WithNode:this.visitWith.bind(this),CommonTableExpressionNode:this.visitCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.visitCommonTableExpressionName.bind(this),HavingNode:this.visitHaving.bind(this),CreateSchemaNode:this.visitCreateSchema.bind(this),DropSchemaNode:this.visitDropSchema.bind(this),AlterTableNode:this.visitAlterTable.bind(this),DropColumnNode:this.visitDropColumn.bind(this),RenameColumnNode:this.visitRenameColumn.bind(this),AlterColumnNode:this.visitAlterColumn.bind(this),ModifyColumnNode:this.visitModifyColumn.bind(this),AddConstraintNode:this.visitAddConstraint.bind(this),DropConstraintNode:this.visitDropConstraint.bind(this),ForeignKeyConstraintNode:this.visitForeignKeyConstraint.bind(this),CreateViewNode:this.visitCreateView.bind(this),DropViewNode:this.visitDropView.bind(this),GeneratedNode:this.visitGenerated.bind(this),DefaultValueNode:this.visitDefaultValue.bind(this),OnNode:this.visitOn.bind(this),ValuesNode:this.visitValues.bind(this),SelectModifierNode:this.visitSelectModifier.bind(this),CreateTypeNode:this.visitCreateType.bind(this),DropTypeNode:this.visitDropType.bind(this),ExplainNode:this.visitExplain.bind(this),DefaultInsertValueNode:this.visitDefaultInsertValue.bind(this),AggregateFunctionNode:this.visitAggregateFunction.bind(this),OverNode:this.visitOver.bind(this),PartitionByNode:this.visitPartitionBy.bind(this),PartitionByItemNode:this.visitPartitionByItem.bind(this),SetOperationNode:this.visitSetOperation.bind(this),BinaryOperationNode:this.visitBinaryOperation.bind(this),UnaryOperationNode:this.visitUnaryOperation.bind(this)});visitNode=e=>{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}};o(vn,"OperationNodeVisitor");var si=class extends vn{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),c({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){let r=this.parentNode!==void 0&&!et.is(this.parentNode)&&!_t.is(this.parentNode)&&!So.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select "),e.distinctOn&&(this.compileDistinctOn(e.distinctOn),this.append(" ")),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.selections&&(this.compileList(e.selections),this.append(" ")),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){let i=e.length-1;for(let n=0;n<=i;n++)this.visitNode(e[n]),n<i&&this.append(r)}visitWhere(e){this.append("where "),this.visitNode(e.where)}visitHaving(e){this.append("having "),this.visitNode(e.having)}visitInsertQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append(e.replace?"replace":"insert"),e.ignore&&this.append(" ignore"),this.append(" into "),this.visitNode(e.into),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.values&&(this.append(" "),this.visitNode(e.values)),e.onConflict&&(this.append(" "),this.visitNode(e.onConflict)),e.onDuplicateKey&&(this.append(" "),this.visitNode(e.onDuplicateKey)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitValues(e){this.append("values "),this.compileList(e.values)}visitDeleteQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("delete "),this.visitNode(e.from),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitReturning(e){this.append("returning "),this.compileList(e.selections)}visitAlias(e){this.visitNode(e.node),this.append(" as "),this.visitNode(e.alias)}visitReference(e){this.visitNode(e.table),this.append("."),this.visitNode(e.column)}visitSelectAll(e){this.append("*")}visitIdentifier(e){this.append(this.getLeftIdentifierWrapper()),this.compileUnwrappedIdentifier(e),this.append(this.getRightIdentifierWrapper())}compileUnwrappedIdentifier(e){if(!Ze(e.name))throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");this.append(this.sanitizeIdentifier(e.name))}visitAnd(e){this.visitNode(e.left),this.append(" and "),this.visitNode(e.right)}visitOr(e){this.visitNode(e.left),this.append(" or "),this.visitNode(e.right)}visitValue(e){e.immediate?this.appendImmediateValue(e.value):this.appendValue(e.value)}visitValueList(e){this.append("("),this.compileList(e.values),this.append(")")}visitPrimitiveValueList(e){this.append("(");let{values:r}=e;for(let i=0;i<r.length;++i)this.appendValue(r[i]),i!==r.length-1&&this.append(", ");this.append(")")}visitParens(e){this.append("("),this.visitNode(e.node),this.append(")")}visitJoin(e){this.append(qp[e.joinType]),this.append(" "),this.visitNode(e.table),e.on&&(this.append(" "),this.visitNode(e.on))}visitOn(e){this.append("on "),this.visitNode(e.on)}visitRaw(e){let{sqlFragments:r,parameters:i}=e;for(let n=0;n<r.length;++n)this.append(r[n]),i.length>n&&this.visitNode(i[n])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.frontModifiers&&e.frontModifiers.length>0&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){let r=this.nodeStack.find(H.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.expression&&(this.append(" ("),this.visitNode(e.expression),this.append(")"))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.columnAlterations&&this.compileList(e.columnAlterations)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(_p[e.modifier])}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.visitNode(e.column),this.append(")"),e.filter&&(this.append(" filter("),this.visitNode(e.filter),this.append(")")),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}visitBinaryOperation(e){this.visitNode(e.leftOperand),this.append(" "),this.visitNode(e.operator),this.append(" "),this.visitNode(e.rightOperand)}visitUnaryOperation(e){this.visitNode(e.operator),this.append(" "),this.visitNode(e.operand)}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){let r=this.getLeftIdentifierWrapper(),i=this.getRightIdentifierWrapper(),n="";for(let s of e)n+=s,s===r?n+=r:s===i&&(n+=i);return n}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(Ze(e))this.append(`'${e}'`);else if(ou(e)||ho(e))this.append(e.toString());else if(po(e))this.append("null");else if(su(e))this.appendImmediateValue(e.toISOString());else if(au(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}};o(si,"DefaultQueryCompiler");var _p=c({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),qp=c({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"});var ai=class{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}};o(ai,"DialectAdapterBase");var gn=class{transformQuery(e){return e.node}async transformResult(e){return e.result}};o(gn,"NoopPlugin");var wn="kysely_migration",En="kysely_migration_lock",Ku="migration_lock",$s=c({__noMigrations__:!0}),Nn=class{#e;constructor(e){this.#e=c(e)}async getMigrations(){let e=await this.#a(this.#i)?await this.#e.db.withPlugin(this.#o).selectFrom(this.#i).select(["name","timestamp"]).execute():[];return(await this.#h()).map(({name:i,...n})=>{let s=e.find(a=>a.name===i);return{name:i,migration:n,executedAt:s?new Date(s.timestamp):void 0}})}async migrateToLatest(){return this.#t(({migrations:e})=>e.length-1)}async migrateTo(e){return this.#t(({migrations:r})=>{if(e===$s)return-1;let i=r.findIndex(n=>n.name===e);if(i===-1)throw new Error(`migration "${e}" doesn't exist`);return i})}async migrateUp(){return this.#t(({currentIndex:e,migrations:r})=>Math.min(e+1,r.length-1))}async migrateDown(){return this.#t(({currentIndex:e})=>Math.max(e-1,-1))}async#t(e){try{return await this.#s(),await this.#m(e)}catch(r){return r instanceof Wi?r.resultSet:{error:r}}}get#r(){return this.#e.migrationTableSchema}get#i(){return this.#e.migrationTableName??wn}get#n(){return this.#e.migrationLockTableName??En}get#o(){return this.#r?new Dt(this.#r):new gn}async#s(){await this.#u(),await this.#c(),await this.#l(),await this.#p()}async#u(){if(this.#r&&!await this.#f())try{await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute()}catch(e){if(!await this.#f())throw e}}async#c(){if(!await this.#a(this.#i))try{this.#r&&await this.#e.db.schema.createSchema(this.#r).ifNotExists().execute(),await this.#e.db.schema.withPlugin(this.#o).createTable(this.#i).ifNotExists().addColumn("name","varchar(255)",e=>e.notNull().primaryKey()).addColumn("timestamp","varchar(255)",e=>e.notNull()).execute()}catch(e){if(!await this.#a(this.#i))throw e}}async#l(){if(!await this.#a(this.#n))try{await this.#e.db.schema.withPlugin(this.#o).createTable(this.#n).ifNotExists().addColumn("id","varchar(255)",e=>e.notNull().primaryKey()).addColumn("is_locked","integer",e=>e.notNull().defaultTo(0)).execute()}catch(e){if(!await this.#a(this.#n))throw e}}async#p(){if(!await this.#d())try{await this.#e.db.withPlugin(this.#o).insertInto(this.#n).values({id:Ku,is_locked:0}).execute()}catch(e){if(!await this.#d())throw e}}async#f(){return(await this.#e.db.introspection.getSchemas()).some(r=>r.name===this.#r)}async#a(e){let r=this.#r;return(await this.#e.db.introspection.getTables({withInternalKyselyTables:!0})).some(n=>n.name===e&&(!r||n.schema===r))}async#d(){return!!await this.#e.db.withPlugin(this.#o).selectFrom(this.#n).where("id","=",Ku).select("id").executeTakeFirst()}async#m(e){let r=this.#e.db.getExecutor().adapter,i=o(async n=>{try{await r.acquireMigrationLock(n);let s=await this.#y(n);if(s.migrations.length===0)return{results:[]};let a=e(s);return a===void 0?{results:[]}:a<s.currentIndex?await this.#N(n,s,a):a>s.currentIndex?await this.#w(n,s,a):{results:[]}}finally{await r.releaseMigrationLock(n)}},"run");return r.supportsTransactionalDdl?this.#e.db.transaction().execute(i):this.#e.db.connection().execute(i)}async#y(e){let r=await this.#h(),i=await this.#v(e);return this.#g(r,i),c({migrations:r,currentIndex:r.findIndex(n=>n.name===uu(i))})}async#h(){let e=await this.#e.provider.getMigrations();return Object.keys(e).sort().map(r=>({...e[r],name:r}))}async#v(e){return(await e.withPlugin(this.#o).selectFrom(this.#i).select("name").orderBy("name").execute()).map(i=>i.name)}#g(e,r){for(let i of r)if(!e.some(n=>n.name===i))throw new Error(`corrupted migrations: previously executed migration ${i} is missing`);for(let i=0;i<r.length;++i)if(e[i].name!==r[i])throw new Error(`corrupted migrations: expected previously executed migration ${r[i]} to be at index ${i} but ${e[i].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`)}async#N(e,r,i){let n=[];for(let s=r.currentIndex;s>i;--s)n.push({migrationName:r.migrations[s].name,direction:"Down",status:"NotExecuted"});for(let s=0;s<n.length;++s){let a=r.migrations.find(u=>u.name===n[s].migrationName);try{a.down&&(await a.down(e),await e.withPlugin(this.#o).deleteFrom(this.#i).where("name","=",a.name).execute(),n[s]={migrationName:a.name,direction:"Down",status:"Success"})}catch(u){throw n[s]={migrationName:a.name,direction:"Down",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}async#w(e,r,i){let n=[];for(let s=r.currentIndex+1;s<=i;++s)n.push({migrationName:r.migrations[s].name,direction:"Up",status:"NotExecuted"});for(let s=0;s<n.length;++s){let a=r.migrations.find(u=>u.name===n[s].migrationName);try{await a.up(e),await e.withPlugin(this.#o).insertInto(this.#i).values({name:a.name,timestamp:new Date().toISOString()}).execute(),n[s]={migrationName:a.name,direction:"Up",status:"Success"}}catch(u){throw n[s]={migrationName:a.name,direction:"Up",status:"Error"},new Wi({error:u,results:n})}}return{results:n}}};o(Nn,"Migrator");var Wi=class extends Error{#e;constructor(e){super(),this.#e=e}get resultSet(){return this.#e}};o(Wi,"MigrationResultSetError");var kp=/"/g,xn=class extends si{sanitizeIdentifier(e){return e.replace(kp,'""')}};o(xn,"PostgresQueryCompiler");var Cn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("pg_catalog.pg_namespace").select("nspname").castTo().execute()).map(r=>({name:r.nspname}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("pg_catalog.pg_attribute as a").innerJoin("pg_catalog.pg_class as c","a.attrelid","c.oid").innerJoin("pg_catalog.pg_namespace as ns","c.relnamespace","ns.oid").innerJoin("pg_catalog.pg_type as typ","a.atttypid","typ.oid").innerJoin("pg_catalog.pg_namespace as dtns","typ.typnamespace","dtns.oid").select(["a.attname as column","a.attnotnull as not_null","a.atthasdef as has_default","c.relname as table","ns.nspname as schema","typ.typname as type","dtns.nspname as type_schema",this.#e.selectFrom("pg_class").select(it`true`.as("auto_incrementing")).whereRef("relnamespace","=","c.relnamespace").where("relkind","=","S").where("relname","=",it`c.relname || '_' || a.attname || '_seq'`).as("auto_incrementing")]).where("c.relkind","=","r").where("ns.nspname","!~","^pg_").where("ns.nspname","!=","information_schema").where("a.attnum",">=",0).where("a.attisdropped","!=",!0).orderBy("ns.nspname").orderBy("c.relname").orderBy("a.attnum").castTo();e.withInternalKyselyTables||(r=r.where("c.relname","!=",wn).where("c.relname","!=",En));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(s=>s.name===i.table&&s.schema===i.schema);return n||(n=c({name:i.table,schema:i.schema,columns:[]}),r.push(n)),n.columns.push(c({name:i.column,dataType:i.type,dataTypeSchema:i.type_schema,isNullable:!i.not_null,isAutoIncrementing:!!i.auto_incrementing,hasDefaultValue:i.has_default})),r},[])}};o(Cn,"PostgresIntrospector");var Lp=BigInt("3853314791062309107"),Sn=class extends ai{get supportsTransactionalDdl(){return!0}get supportsReturning(){return!0}async acquireMigrationLock(e){await it`select pg_advisory_xact_lock(${it.literal(Lp)})`.execute(e)}async releaseMigrationLock(){}};o(Sn,"PostgresAdapter");var Mp=/`/g,Tn=class extends si{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getExplainOptionAssignment(){return"="}getExplainOptionsDelimiter(){return" "}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return"`"}getRightIdentifierWrapper(){return"`"}sanitizeIdentifier(e){return e.replace(Mp,"``")}};o(Tn,"MysqlQueryCompiler");var bn=class{#e;constructor(e){this.#e=e}async getSchemas(){return(await this.#e.selectFrom("information_schema.schemata").select("schema_name").castTo().execute()).map(r=>({name:r.SCHEMA_NAME}))}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("information_schema.columns").select(["COLUMN_NAME","COLUMN_DEFAULT","TABLE_NAME","TABLE_SCHEMA","IS_NULLABLE","DATA_TYPE","EXTRA"]).where("table_schema","=",it`database()`).orderBy("table_name").orderBy("ordinal_position").castTo();e.withInternalKyselyTables||(r=r.where("table_name","!=",wn).where("table_name","!=",En));let i=await r.execute();return this.#t(i)}async getMetadata(e){return{tables:await this.getTables(e)}}#t(e){return e.reduce((r,i)=>{let n=r.find(s=>s.name===i.TABLE_NAME);return n||(n=c({name:i.TABLE_NAME,schema:i.TABLE_SCHEMA,columns:[]}),r.push(n)),n.columns.push(c({name:i.COLUMN_NAME,dataType:i.DATA_TYPE,isNullable:i.IS_NULLABLE==="YES",isAutoIncrementing:i.EXTRA.toLowerCase().includes("auto_increment"),hasDefaultValue:i.COLUMN_DEFAULT!==null})),r},[])}};o(bn,"MysqlIntrospector");var Xu="ea586330-2c93-47c8-908d-981d9d270f9d",Fp=60*60,An=class extends ai{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}async acquireMigrationLock(e){await it`select get_lock(${it.literal(Xu)}, ${it.literal(Fp)})`.execute(e)}async releaseMigrationLock(e){await it`select release_lock(${it.literal(Xu)})`.execute(e)}};o(An,"MysqlAdapter");var In=class{#e;constructor(e){this.#e=e}async init(){}async acquireConnection(){return new qo(this.#e)}async beginTransaction(e){await e.beginTransaction()}async commitTransaction(e){await e.commitTransaction()}async rollbackTransaction(e){await e.rollbackTransaction()}async releaseConnection(e){}async destroy(){}};o(In,"DataApiDriver");var qo=class{#e;#t;constructor(e){this.#e=e}async beginTransaction(){let e=await this.#e.client.beginTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,database:this.#e.database}).promise();this.#t=e.transactionId}async commitTransaction(){if(!this.#t)throw new Error("Cannot commit a transaction before creating it");await this.#e.client.commitTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async rollbackTransaction(){if(!this.#t)throw new Error("Cannot rollback a transaction before creating it");await this.#e.client.rollbackTransaction({secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,transactionId:this.#t}).promise()}async executeQuery(e){let r=await this.#e.client.executeStatement({transactionId:this.#t,secretArn:this.#e.secretArn,resourceArn:this.#e.resourceArn,sql:e.sql,parameters:e.parameters,database:this.#e.database,includeResultMetadata:!0}).promise();return r.columnMetadata?{rows:r.records?.filter(s=>s.length!==0).map(s=>Object.fromEntries(s.map((a,u)=>[r.columnMetadata[u].label||r.columnMetadata[u].name,a.stringValue??a.blobValue??a.longValue??a.arrayValue??a.doubleValue??(a.isNull?null:a.booleanValue)])))||[]}:{numUpdatedOrDeletedRows:BigInt(r.numberOfRecordsUpdated||0),rows:[]}}async*streamQuery(e,r){throw new Error("Data API does not support streaming")}};o(qo,"DataApiConnection");var On=class extends xn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Gu(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};o(On,"PostgresDataApiQueryCompiler");var Rn=class extends Tn{appendValue(e){let r=this.numParameters;this.append(this.getCurrentParameterPlaceholder()),this.addParameter({name:r.toString(),...Gu(e)})}getCurrentParameterPlaceholder(){return":"+this.numParameters}};o(Rn,"MysqlDataApiQueryCompiler");function Gu(t){switch(typeof t){case"bigint":return{value:{doubleValue:Number(t)}};case"boolean":return{value:{booleanValue:t}};case"number":return Number.isInteger(t)?{value:{longValue:t}}:{value:{doubleValue:t}};case"object":if(t==null)return{value:{isNull:!0}};if(Buffer.isBuffer(t))return{value:{blobValue:t}};if(t instanceof Date)return{typeHint:"TIMESTAMP",value:{stringValue:Ju(t.toISOString())}};if(t?.value&&Up(t.value))return t.typeHint&&t.value.stringValue&&typeof t.value.stringValue=="string"&&(t.value.stringValue=Wp(t.typeHint,t.value.stringValue)),t;break;case"string":return{value:{stringValue:t}}}throw new Bi("Could not serialize value")}o(Gu,"serialize");function Wp(t,e){switch(t){case"DATE":return Zs(e).slice(0,10);case"TIME":return e.match(/^\d{4}-\d{2}-\d{2}/)?Zs(e).slice(11,23):Bp(e);case"TIMESTAMP":return Ju(Zs(e))}return e}o(Wp,"fixStringValue");function Bp(t){let e=(t||"00:00:00").split(":");for(;e.length<3;)e.push("00");return e.join(":").slice(0,12)}o(Bp,"fixTimeString");function Ju(t){return t.replace("T"," ").slice(0,23)}o(Ju,"fixISOString");function Zs(t){return new Date(Date.parse(t)).toISOString()}o(Zs,"parseToISOString");function Up(t){for(let e of zp)if(t[e])return!0;if(t.arrayValue){for(let e of Vp)if(t.arrayValue?.[e])return!0}return!1}o(Up,"isValueObject");var Bi=class extends Error{constructor(e){super(e),this.name=Bi.name}};o(Bi,"QueryCompilerError");var Vp=["booleanValues","doubleValues","longValues","stringValues"],zp=["blobValue","booleanValue","doubleValue","isNull","longValue","stringValue"];var Dn=class{#e;constructor(e){this.#e=e}createAdapter(){if(this.#e.mode==="postgres")return new Sn;if(this.#e.mode==="mysql")return new An;throw new Error("Unknown mode "+this.#e.mode)}createDriver(){return new In(this.#e.driver)}createQueryCompiler(){if(this.#e.mode==="postgres")return new On;if(this.#e.mode==="mysql")return new Rn;throw new Error("Unknown mode "+this.#e.mode)}createIntrospector(e){if(this.#e.mode==="postgres")return new Cn(e);if(this.#e.mode==="mysql")return new bn(e);throw new Error("Unknown mode "+this.#e.mode)}};o(Dn,"DataApiDialect");var Qh=up(Yh(),1);import CN from"url";async function WF(t){let e=new kt({dialect:new Dn({mode:process.env.RDS_ENGINE_MODE,driver:{client:new Qh.default,database:t?.database||process.env.RDS_DATABASE,secretArn:process.env.RDS_SECRET,resourceArn:process.env.RDS_ARN}})}),r=new Nn({db:e,provider:new As(xN.resolve(process.env.RDS_MIGRATIONS_PATH))});if(!t.type||t.type==="latest"){let i=await r.migrateToLatest(),n=i.error||i.results?.find(s=>s.status==="Error");if(n)throw n;return i}if(t.type==="to"){if(!t.data.name)return await r.migrateTo($s);let i=await r.migrateTo(t.data.name),n=i.error||i.results?.find(s=>s.status==="Error");if(n)throw n;return i}if(t.type==="list")return await r.getMigrations()}o(WF,"handler");var As=class{#e;constructor(e){this.#e=e}async getMigrations(){let e=await import("fs/promises"),r=await import("path"),i={},n=await e.readdir(this.#e);for(let s of n)if(s.endsWith(".js")||s.endsWith(".cjs")||s.endsWith(".mjs")){let[a]=r.basename(s).split("."),u=r.join(this.#e,s);if(process.env.LAMBDA_TASK_ROOT){let h=await import(u);i[a]=h;continue}let l=u.replace(/(mjs|cjs|js)/g,`${Date.now()}.$1`);try{await e.copyFile(u,l);let h=await import(CN.pathToFileURL(l).href);i[a]=h}catch(h){console.error(h)}await e.rm(l)}return i}};o(As,"DynamicFileMigrationProvider");export{WF as handler};
29
28
  /*! Bundled license information:
30
29
 
31
30
  sax/lib/sax.js: